@mcp-b/react-components 0.47.0 → 0.49.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 (274) hide show
  1. package/dist/AgentChatQueue-C_Jaw3Ia.d.ts +48 -0
  2. package/dist/AgentToolRunsContext-GMe_hSnD.d.ts +35 -0
  3. package/dist/Avatar-o2NO1fCG.d.ts +124 -0
  4. package/dist/{Button-CZt3yywF.d.ts → Button-DjONW5UW.d.ts} +1 -1
  5. package/dist/{CodeBlock-C380GD5t.d.ts → CodeBlock--r6GS8YV.d.ts} +8 -2
  6. package/dist/{CodeBlock-DMHZiw86.js → CodeBlock-g8sADidM.js} +7 -7
  7. package/dist/Correspondent-7K6uNLUm.d.ts +64 -0
  8. package/dist/{FileTree-BHebfvkK.js → FileTree-H8mMg4rV.js} +20 -29
  9. package/dist/{IconButton-BAUFhUk8.d.ts → IconButton-ByiyjkYE.d.ts} +2 -2
  10. package/dist/{Message-D_vCVEGB.d.ts → Message-DyaTBiV7.d.ts} +17 -4
  11. package/dist/MessageScrollerVirtual-D4afYwVB.d.ts +84 -0
  12. package/dist/{PromptInput-DtJHyp0S.d.ts → PromptInput-C4Mofitz.d.ts} +44 -31
  13. package/dist/PromptInputApproval-D2hpn54U.d.ts +44 -0
  14. package/dist/Separator-CzhtLYE1.d.ts +41 -0
  15. package/dist/Toolbar-CGY004u0.d.ts +155 -0
  16. package/dist/{Workspace-C_zHq9KZ.d.ts → Workspace-HzGrWDX3.d.ts} +14 -3
  17. package/dist/{WorkspaceFile-Dq-GC0_T.d.ts → WorkspaceFile-Bouauobc.d.ts} +1 -1
  18. package/dist/{WorkspaceFileView-ChIJz-fl.js → WorkspaceFileView-DYPtRVpM.js} +4 -3
  19. package/dist/{WorkspaceLink-B1d2GIGl.js → WorkspaceLink-BYZG-V_I.js} +8 -91
  20. package/dist/{WorkspaceMessageResponse-Dg_aNpoj.js → WorkspaceMessageResponse-CUJk9_P5.js} +6 -3
  21. package/dist/components/agents-sdk/AgentChat.d.ts +198 -2
  22. package/dist/components/agents-sdk/AgentChat.js +525 -670
  23. package/dist/components/agents-sdk/AgentChatQueue.d.ts +2 -0
  24. package/dist/components/agents-sdk/AgentChatQueue.js +206 -0
  25. package/dist/components/agents-sdk/AgentEvent.js +1 -1
  26. package/dist/components/agents-sdk/AgentToolRunsContext.d.ts +2 -2
  27. package/dist/components/agents-sdk/AgentToolRunsContext.js +1 -36
  28. package/dist/components/agents-sdk/BrowserLiveScreen.js +21 -13
  29. package/dist/components/agents-sdk/BrowserReplay.d.ts +1 -1
  30. package/dist/components/agents-sdk/BrowserRunPanel.d.ts +3 -0
  31. package/dist/components/agents-sdk/BrowserRunPanel.js +31 -30
  32. package/dist/components/agents-sdk/EmployeeChrome.d.ts +212 -0
  33. package/dist/components/agents-sdk/EmployeeChrome.js +555 -0
  34. package/dist/components/agents-sdk/ManagerOffice.d.ts +115 -85
  35. package/dist/components/agents-sdk/ManagerOffice.js +545 -1154
  36. package/dist/components/agents-sdk/McpConnectionRequest.d.ts +4 -4
  37. package/dist/components/agents-sdk/McpConnectionRequest.js +3 -2
  38. package/dist/components/agents-sdk/McpConnectorForm.d.ts +38 -1
  39. package/dist/components/agents-sdk/McpPluginCatalog.d.ts +93 -1
  40. package/dist/components/agents-sdk/McpPluginCatalog.js +3 -2
  41. package/dist/components/agents-sdk/McpServerIcon.d.ts +17 -0
  42. package/dist/components/agents-sdk/McpServerIcon.js +25 -0
  43. package/dist/components/agents-sdk/McpServerPicker.d.ts +4 -3
  44. package/dist/components/agents-sdk/McpServerPicker.js +2 -1
  45. package/dist/components/agents-sdk/ModelSelector.d.ts +4 -4
  46. package/dist/components/agents-sdk/ModelSelector.js +3 -3
  47. package/dist/components/agents-sdk/PromptInputApproval.d.ts +1 -43
  48. package/dist/components/agents-sdk/PromptInputCommands.d.ts +1 -1
  49. package/dist/components/agents-sdk/PromptInputCommands.js +1 -2
  50. package/dist/components/agents-sdk/SessionCompaction.d.ts +88 -1
  51. package/dist/components/agents-sdk/SessionCompaction.js +2 -2
  52. package/dist/components/agents-sdk/SubagentRunDetails.d.ts +30 -1
  53. package/dist/components/agents-sdk/SubagentRunDetails.js +57 -1
  54. package/dist/components/agents-sdk/SubagentRunIndicator.d.ts +9 -9
  55. package/dist/components/agents-sdk/SubagentRunIndicator.js +18 -23
  56. package/dist/components/agents-sdk/SubagentRunList.d.ts +6 -3
  57. package/dist/components/agents-sdk/SubagentRunList.js +4 -2
  58. package/dist/components/agents-sdk/SubagentRunPanel.d.ts +60 -0
  59. package/dist/components/agents-sdk/SubagentRunPanel.js +255 -0
  60. package/dist/components/agents-sdk/SubagentRunSelector.d.ts +8 -4
  61. package/dist/components/agents-sdk/SubagentRunSelector.js +4 -2
  62. package/dist/components/agents-sdk/ThinkChat.d.ts +102 -2
  63. package/dist/components/agents-sdk/ThinkChat.js +233 -2
  64. package/dist/components/agents-sdk/ThinkChatActivity.d.ts +76 -1
  65. package/dist/components/agents-sdk/ThinkChatActivity.js +17 -9
  66. package/dist/components/agents-sdk/ThinkChatContext.d.ts +27 -1
  67. package/dist/components/agents-sdk/ThinkChatContext.js +1 -1
  68. package/dist/components/agents-sdk/ThinkChatToolPanels.js +23 -18
  69. package/dist/components/agents-sdk/ThinkExecutionDetail.js +1 -1
  70. package/dist/components/agents-sdk/ThinkExecutionStatus.d.ts +1 -1
  71. package/dist/components/agents-sdk/ThinkExecutionWorkbench.d.ts +85 -28
  72. package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +158 -101
  73. package/dist/components/agents-sdk/ThinkFullApp.d.ts +40 -158
  74. package/dist/components/agents-sdk/ThinkFullApp.js +71 -285
  75. package/dist/components/agents-sdk/ThinkRecoveryNotice.d.ts +18 -1
  76. package/dist/components/agents-sdk/ThinkRoutineActions.d.ts +51 -0
  77. package/dist/components/agents-sdk/ThinkRoutineActions.js +201 -0
  78. package/dist/components/agents-sdk/ThinkRoutineBrowser.d.ts +4 -1
  79. package/dist/components/agents-sdk/ThinkRoutineBrowser.js +16 -14
  80. package/dist/components/agents-sdk/ThinkRoutineDetail.js +12 -12
  81. package/dist/components/agents-sdk/ThinkRoutineForm.d.ts +2 -1
  82. package/dist/components/agents-sdk/ThinkRoutineForm.js +11 -11
  83. package/dist/components/agents-sdk/ThinkRoutineRuns.js +6 -6
  84. package/dist/components/agents-sdk/ThinkThreadPicker.d.ts +90 -1
  85. package/dist/components/agents-sdk/ThinkThreadPicker.js +2 -2
  86. package/dist/components/agents-sdk/Workspace.d.ts +2 -2
  87. package/dist/components/agents-sdk/Workspace.js +20 -23
  88. package/dist/components/agents-sdk/WorkspaceBrowser.d.ts +1 -1
  89. package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
  90. package/dist/components/agents-sdk/WorkspaceConcept.d.ts +3 -2
  91. package/dist/components/agents-sdk/WorkspaceConcept.js +3 -3
  92. package/dist/components/agents-sdk/WorkspaceCorrespondence.d.ts +15 -10
  93. package/dist/components/agents-sdk/WorkspaceCorrespondence.js +43 -40
  94. package/dist/components/agents-sdk/WorkspaceExecution.d.ts +31 -31
  95. package/dist/components/agents-sdk/WorkspaceExecution.js +115 -192
  96. package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +5 -2
  97. package/dist/components/agents-sdk/WorkspaceExplorer.js +3 -2
  98. package/dist/components/agents-sdk/WorkspaceFile.d.ts +1 -1
  99. package/dist/components/agents-sdk/WorkspaceFileView.d.ts +1 -1
  100. package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
  101. package/dist/components/agents-sdk/WorkspaceLink.js +1 -1
  102. package/dist/components/agents-sdk/WorkspaceLive.d.ts +60 -1
  103. package/dist/components/agents-sdk/WorkspaceLive.js +33 -5
  104. package/dist/components/agents-sdk/WorkspaceMessageResponse.d.ts +47 -1
  105. package/dist/components/agents-sdk/WorkspaceMessageResponse.js +1 -1
  106. package/dist/components/agents-sdk/WorkspaceMountManager.d.ts +3 -2
  107. package/dist/components/agents-sdk/WorkspaceMountManager.js +5 -8
  108. package/dist/components/agents-sdk/WorkspaceNavigationRestoration.d.ts +38 -0
  109. package/dist/components/agents-sdk/WorkspaceNavigationRestoration.js +86 -0
  110. package/dist/components/agents-sdk/WorkspaceProject.d.ts +44 -15
  111. package/dist/components/agents-sdk/WorkspaceProject.js +74 -51
  112. package/dist/components/agents-sdk/WorkspaceUserScript.d.ts +1 -1
  113. package/dist/components/agents-sdk/WorkspaceUserScript.js +5 -2
  114. package/dist/components/ai-sdk/Activity.d.ts +1 -1
  115. package/dist/components/ai-sdk/AgentAttention.d.ts +2 -2
  116. package/dist/components/ai-sdk/AgentChatStartScreen.d.ts +89 -2
  117. package/dist/components/ai-sdk/AgentChatStartScreen.js +63 -42
  118. package/dist/components/ai-sdk/AgentMessageParts.d.ts +45 -1
  119. package/dist/components/ai-sdk/Approval.d.ts +1 -1
  120. package/dist/components/ai-sdk/Artifact.d.ts +2 -2
  121. package/dist/components/ai-sdk/Artifact.js +2 -2
  122. package/dist/components/ai-sdk/ChainOfThought.d.ts +1 -1
  123. package/dist/components/ai-sdk/CodeBlock.d.ts +1 -1
  124. package/dist/components/ai-sdk/CodeBlock.js +1 -1
  125. package/dist/components/ai-sdk/ComposerLink.js +1 -2
  126. package/dist/components/ai-sdk/ConnectedAppCards.d.ts +16 -1
  127. package/dist/components/ai-sdk/ConnectedAppCards.js +69 -94
  128. package/dist/components/ai-sdk/Context.d.ts +7 -3
  129. package/dist/components/ai-sdk/Context.js +7 -17
  130. package/dist/components/ai-sdk/Conversation.d.ts +2 -2
  131. package/dist/components/ai-sdk/Correspondent.d.ts +2 -0
  132. package/dist/components/ai-sdk/Correspondent.js +145 -0
  133. package/dist/components/ai-sdk/Goal.d.ts +3 -3
  134. package/dist/components/ai-sdk/Goal.js +2 -2
  135. package/dist/components/ai-sdk/InlineCitation.d.ts +1 -1
  136. package/dist/components/ai-sdk/InlineCitation.js +1 -1
  137. package/dist/components/ai-sdk/MediaPreviewCard.d.ts +1 -1
  138. package/dist/components/ai-sdk/Message.d.ts +2 -2
  139. package/dist/components/ai-sdk/Message.js +11 -2
  140. package/dist/components/ai-sdk/MessageScroller.d.ts +1 -1
  141. package/dist/components/ai-sdk/MessageScrollerVirtual.d.ts +2 -76
  142. package/dist/components/ai-sdk/MessageScrollerVirtual.js +38 -4
  143. package/dist/components/ai-sdk/Plan.d.ts +1 -1
  144. package/dist/components/ai-sdk/PromptInput.d.ts +2 -2
  145. package/dist/components/ai-sdk/PromptInput.js +170 -226
  146. package/dist/components/ai-sdk/PromptInputComposerEditor.js +32 -9
  147. package/dist/components/ai-sdk/Queue.d.ts +28 -5
  148. package/dist/components/ai-sdk/Queue.js +19 -4
  149. package/dist/components/ai-sdk/Reasoning.d.ts +1 -1
  150. package/dist/components/ai-sdk/Reasoning.js +4 -4
  151. package/dist/components/ai-sdk/Sources.d.ts +1 -1
  152. package/dist/components/ai-sdk/Task.d.ts +1 -1
  153. package/dist/components/extension/ChatGptSignInScreen.d.ts +1 -1
  154. package/dist/components/extension/CodexModelSelector.d.ts +5 -0
  155. package/dist/components/extension/ConversationTabPicker.d.ts +1 -0
  156. package/dist/components/extension/ConversationTabPicker.js +1 -1
  157. package/dist/components/foundations/AlertDialog.d.ts +1 -1
  158. package/dist/components/foundations/AppIcon.d.ts +3 -2
  159. package/dist/components/foundations/Autocomplete.js +6 -1
  160. package/dist/components/foundations/Avatar.d.ts +1 -121
  161. package/dist/components/foundations/Button.d.ts +1 -1
  162. package/dist/components/foundations/Card.d.ts +22 -27
  163. package/dist/components/foundations/Card.js +51 -32
  164. package/dist/components/foundations/CheckboxGroup.d.ts +1 -1
  165. package/dist/components/foundations/Collapsible.d.ts +1 -1
  166. package/dist/components/foundations/Combobox.js +6 -1
  167. package/dist/components/foundations/Dialog.d.ts +106 -1
  168. package/dist/components/foundations/EmptyState.d.ts +1 -1
  169. package/dist/components/foundations/Field.d.ts +2 -1
  170. package/dist/components/foundations/Fieldset.d.ts +1 -1
  171. package/dist/components/foundations/Form.d.ts +4 -4
  172. package/dist/components/foundations/IconButton.d.ts +1 -1
  173. package/dist/components/foundations/Label.d.ts +1 -1
  174. package/dist/components/foundations/LinkButton.d.ts +2 -2
  175. package/dist/components/foundations/Meter.d.ts +1 -1
  176. package/dist/components/foundations/NumberField.d.ts +1 -1
  177. package/dist/components/foundations/ScrollArea.d.ts +1 -1
  178. package/dist/components/foundations/SearchField.d.ts +1 -1
  179. package/dist/components/foundations/Select.js +6 -1
  180. package/dist/components/foundations/Separator.d.ts +1 -40
  181. package/dist/components/foundations/Stepper.d.ts +1 -1
  182. package/dist/components/foundations/Textarea.d.ts +1 -1
  183. package/dist/components/foundations/Toast.d.ts +5 -1
  184. package/dist/components/foundations/Toggle.d.ts +70 -1
  185. package/dist/components/foundations/ToggleGroup.d.ts +3 -2
  186. package/dist/components/foundations/Toolbar.d.ts +1 -151
  187. package/dist/components/foundations/TransitionSurface.d.ts +1 -1
  188. package/dist/components/general-purpose/ActionGuide.d.ts +10 -26
  189. package/dist/components/general-purpose/ActionGuide.js +4 -18
  190. package/dist/components/general-purpose/AppTopBar.d.ts +4 -2
  191. package/dist/components/general-purpose/Commit.d.ts +2 -2
  192. package/dist/components/general-purpose/Commit.js +1 -1
  193. package/dist/components/general-purpose/EnvironmentVariables.d.ts +2 -2
  194. package/dist/components/general-purpose/FileTree.d.ts +1 -7
  195. package/dist/components/general-purpose/FileTree.js +1 -1
  196. package/dist/components/general-purpose/PricingBillingToggle.js +1 -1
  197. package/dist/components/general-purpose/PricingPlanCard.d.ts +4 -0
  198. package/dist/components/general-purpose/PricingUsageCalculator.js +1 -1
  199. package/dist/components/general-purpose/ResizableSidePanel.d.ts +2 -2
  200. package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +128 -2
  201. package/dist/components/general-purpose/ResponsiveSidebarShell.js +119 -101
  202. package/dist/components/general-purpose/SettingsFormDialog.d.ts +14 -27
  203. package/dist/components/general-purpose/SettingsFormDialog.js +40 -70
  204. package/dist/components/general-purpose/SetupChecklist.d.ts +1 -0
  205. package/dist/components/general-purpose/SetupChecklist.js +76 -1
  206. package/dist/components/general-purpose/Terminal.d.ts +3 -3
  207. package/dist/components/general-purpose/Terminal.js +10 -5
  208. package/dist/components/general-purpose/TestResults.d.ts +23 -11
  209. package/dist/components/general-purpose/TestResults.js +48 -50
  210. package/dist/components/general-purpose/ThemeModeControl.d.ts +2 -0
  211. package/dist/components/general-purpose/WebPreview.d.ts +29 -4
  212. package/dist/components/general-purpose/WebPreview.js +37 -12
  213. package/dist/components/nanites/AgentConnection.js +1 -1
  214. package/dist/components/nanites/AgentToolDetail.d.ts +13 -11
  215. package/dist/components/nanites/AgentToolDetail.js +20 -41
  216. package/dist/{copy-button-C0JyjClr.d.ts → copy-button-OUwOdgEm.d.ts} +1 -1
  217. package/dist/mcp-server-mAErsxHU.js +27 -0
  218. package/dist/styles/activity.css +1 -96
  219. package/dist/styles/agent-chat.css +75 -102
  220. package/dist/styles/agent-tool-detail.css +0 -16
  221. package/dist/styles/base.css +3 -3
  222. package/dist/styles/browser-run-panel.css +1 -15
  223. package/dist/styles/button.css +7 -1
  224. package/dist/styles/code-block.css +12 -0
  225. package/dist/styles/composition-motion.css +0 -2
  226. package/dist/styles/correspondent.css +73 -0
  227. package/dist/styles/employee-chrome.css +43 -0
  228. package/dist/styles/file-tree.css +5 -0
  229. package/dist/styles/index.css +5 -2
  230. package/dist/styles/manager-office.css +380 -1086
  231. package/dist/styles/message.css +2 -10
  232. package/dist/styles/queue.css +71 -0
  233. package/dist/styles/subagent-run.css +122 -6
  234. package/dist/styles/test-results.css +2 -5
  235. package/dist/styles/think-chat-activity.css +13 -0
  236. package/dist/styles/think-chat-tool-panels.css +81 -0
  237. package/dist/styles/think-execution-workbench.css +2 -8
  238. package/dist/styles/think-full-app.css +42 -251
  239. package/dist/styles/{think-routine-library.css → think-routine.css} +64 -80
  240. package/dist/styles/web-preview.css +15 -1
  241. package/dist/utils/mcp-server-catalog.d.ts +1112 -2
  242. package/dist/utils/mcp-server-catalog.js +28 -9
  243. package/dist/utils/structured-code.d.ts +1 -1
  244. package/dist/{workspace-assets-CxpEHsac.js → workspace-assets-Bg7XhPsk.js} +16 -2
  245. package/package.json +7 -3
  246. package/dist/AgentChat-BLmQghkt.d.ts +0 -327
  247. package/dist/AgentChatStartScreen-Bkv7Avni.d.ts +0 -84
  248. package/dist/AgentMessageParts-C7L-Mv9U.d.ts +0 -46
  249. package/dist/AgentToolRunsContext-jtmveaRE.d.ts +0 -57
  250. package/dist/Dialog-B_FhRWaz.d.ts +0 -107
  251. package/dist/McpConnectorForm-CeYNY0MI.d.ts +0 -39
  252. package/dist/McpPluginCatalog-3qWu8oK1.d.ts +0 -92
  253. package/dist/ResponsiveSidebarShell-BTVPxLJK.d.ts +0 -123
  254. package/dist/SessionCompaction-CmTJFpzj.d.ts +0 -89
  255. package/dist/SetupChecklist-CwRjIDH4.js +0 -77
  256. package/dist/ThinkChat-CwMdEum8.d.ts +0 -185
  257. package/dist/ThinkChat-DLDta57t.js +0 -332
  258. package/dist/ThinkChatActivity-B3lGVS-6.d.ts +0 -77
  259. package/dist/ThinkChatContext-COIgzkYp.d.ts +0 -28
  260. package/dist/ThinkRecoveryNotice-DGWr94rk.d.ts +0 -19
  261. package/dist/ThinkThreadPicker-yFz4vvIf.d.ts +0 -91
  262. package/dist/Toggle-DLrIf5YH.d.ts +0 -69
  263. package/dist/WorkspaceLive-DLGhtIly.d.ts +0 -49
  264. package/dist/WorkspaceMessageResponse-kJYU8Onj.d.ts +0 -48
  265. package/dist/components/agents-sdk/ThinkFullAppViewSwitch.d.ts +0 -31
  266. package/dist/components/agents-sdk/ThinkFullAppViewSwitch.js +0 -34
  267. package/dist/components/agents-sdk/ThinkRoutineLibrary.d.ts +0 -80
  268. package/dist/components/agents-sdk/ThinkRoutineLibrary.js +0 -159
  269. package/dist/components/agents-sdk/ThinkSidepanel.d.ts +0 -200
  270. package/dist/components/agents-sdk/ThinkSidepanel.js +0 -775
  271. package/dist/mcp-server-7NR24ASj.js +0 -69
  272. package/dist/mcp-server-catalog-C_g7C-9o.d.ts +0 -1108
  273. package/dist/styles/think-sidepanel.css +0 -78
  274. package/dist/think-agent-Cip5KAPj.d.ts +0 -7
@@ -33,18 +33,27 @@ interface WorkspaceCorrespondenceSource {
33
33
  onDelete?: (path: string) => void | Promise<void>;
34
34
  }
35
35
  interface WorkspaceCorrespondenceCardProps extends Omit<CardProps, "children" | "hover" | "size" | "title" | "onChange"> {
36
+ /** Correspondence renderer key, such as the message or email kind selected by the host. */
36
37
  kind: string;
38
+ /** Workspace-relative file path represented by this card. */
37
39
  path: string;
40
+ /** Ordered header fields rendered above the correspondence body. */
38
41
  fields: readonly WorkspaceCorrespondenceField[];
42
+ /** Editable or read-only correspondence body. */
39
43
  body: string;
44
+ /** Leading icon identifying the correspondence channel. */
40
45
  icon?: React.ReactNode;
41
46
  /** `sent` renders the read-only snapshot and ignores `onChange`/`onSend`. */
42
47
  state?: WorkspaceCorrespondenceState;
43
48
  /** Persistence lifecycle of the visible draft. Send is disabled while set. */
44
49
  saveState?: ConnectedAppCardSaveState;
50
+ /** Receives the complete draft after an editable field changes. */
45
51
  onChange?: (next: WorkspaceCorrespondenceDraft) => void;
52
+ /** Sends the visible draft through the host-owned channel. */
46
53
  onSend?: () => void | Promise<void>;
54
+ /** Opens the backing correspondence file or detail route. */
47
55
  onOpen?: () => void;
56
+ /** Deletes the backing correspondence through the host. */
48
57
  onDelete?: () => void | Promise<void>;
49
58
  }
50
59
  interface WorkspaceCorrespondenceFileProps extends Omit<WorkspaceCorrespondenceCardProps, "body" | "fields" | "kind" | "onChange" | "onDelete" | "onOpen" | "onSend" | "path" | "saveState" | "state"> {
@@ -72,7 +81,7 @@ declare function WorkspaceCorrespondenceCard({
72
81
  ref,
73
82
  ...props
74
83
  }: WorkspaceCorrespondenceCardProps & {
75
- ref?: React.Ref<HTMLDivElement>;
84
+ /** Ref forwarded to the component's rendered root element. */ref?: React.Ref<HTMLDivElement>;
76
85
  }): React.JSX.Element;
77
86
  /**
78
87
  * Query-backed reviewed correspondence. The host supplies normalized reads
@@ -85,16 +94,12 @@ declare function WorkspaceCorrespondenceCard({
85
94
  * flushes the outstanding edit first and refuses when that save fails — the
86
95
  * agent must never be told to send content the workspace does not hold.
87
96
  *
88
- * Interaction state belongs to one file. The adapter resets it when the
89
- * source's query key changes, but hosts should still key this element by path
90
- * where a placement can swap files, so React reconciles it as a new card.
97
+ * Interaction state belongs to one query identity. The keyed session makes a
98
+ * source swap a real unmount, so an old save or send cannot settle onto the
99
+ * next file.
91
100
  */
92
- declare function WorkspaceCorrespondenceFile({
93
- fallback,
94
- source,
95
- ...props
96
- }: WorkspaceCorrespondenceFileProps & {
101
+ declare function WorkspaceCorrespondenceFile(props: WorkspaceCorrespondenceFileProps & {
97
102
  ref?: React.Ref<HTMLDivElement>;
98
- }): string | number | bigint | boolean | React.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null;
103
+ }): React.JSX.Element;
99
104
  //#endregion
100
105
  export { WorkspaceCorrespondence, WorkspaceCorrespondenceCard, WorkspaceCorrespondenceCardProps, WorkspaceCorrespondenceDraft, WorkspaceCorrespondenceField, WorkspaceCorrespondenceFile, WorkspaceCorrespondenceFileProps, WorkspaceCorrespondenceSource, WorkspaceCorrespondenceState };
@@ -9,14 +9,17 @@ import { Input } from "../foundations/Input.js";
9
9
  import { DescriptionList } from "../foundations/DescriptionList.js";
10
10
  import { Card, CardAction, CardContent, CardFooter, CardHeader, CardTitle } from "../foundations/Card.js";
11
11
  import { EmailMessageCard, SlackMessageCard } from "../ai-sdk/ConnectedAppCards.js";
12
- import { i as WorkspaceDeleteControl, r as httpUrl, t as FaviconMark } from "../../workspace-assets-CxpEHsac.js";
12
+ import { i as WorkspaceDeleteControl, r as httpUrl, t as FaviconMark } from "../../workspace-assets-Bg7XhPsk.js";
13
13
  import * as React from "react";
14
+ import { createElement } from "react";
14
15
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
15
- import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
16
+ import { hashKey, useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
16
17
  //#region src/components/agents-sdk/WorkspaceCorrespondence.tsx
17
18
  const SAVE_DEBOUNCE_MS = 400;
18
19
  const SEND_BLOCKED_MESSAGE = "Your edit has not saved, so nothing was sent. Retry the save first.";
19
20
  const FILE_MISSING_MESSAGE = "The file is no longer in the workspace.";
21
+ const SAVE_UNAVAILABLE_MESSAGE = "Saving is no longer available.";
22
+ const SEND_UNAVAILABLE_MESSAGE = "Sending is no longer available.";
20
23
  function fieldValue(fields, name) {
21
24
  return fields.find((field) => field.name === name)?.value;
22
25
  }
@@ -105,7 +108,10 @@ function GenericWorkspaceCorrespondenceCard({ className, body, fields, kind, pat
105
108
  /* @__PURE__ */ jsxs(CardHeader, { children: [/* @__PURE__ */ jsxs(CardTitle, {
106
109
  id: titleId,
107
110
  className: "connected-app-card__title",
108
- render: /* @__PURE__ */ jsx("h3", {}),
111
+ render: (props) => /* @__PURE__ */ jsx("h3", {
112
+ ...props,
113
+ children: props.children
114
+ }),
109
115
  children: [/* @__PURE__ */ jsx("span", {
110
116
  className: "connected-app-card__icon",
111
117
  "aria-hidden": "true",
@@ -298,11 +304,17 @@ function WorkspaceCorrespondenceCard({ body, fields, kind, path, icon, saveState
298
304
  * flushes the outstanding edit first and refuses when that save fails — the
299
305
  * agent must never be told to send content the workspace does not hold.
300
306
  *
301
- * Interaction state belongs to one file. The adapter resets it when the
302
- * source's query key changes, but hosts should still key this element by path
303
- * where a placement can swap files, so React reconciles it as a new card.
307
+ * Interaction state belongs to one query identity. The keyed session makes a
308
+ * source swap a real unmount, so an old save or send cannot settle onto the
309
+ * next file.
304
310
  */
305
- function WorkspaceCorrespondenceFile({ fallback = null, source, ...props }) {
311
+ function WorkspaceCorrespondenceFile(props) {
312
+ return /* @__PURE__ */ createElement(WorkspaceCorrespondenceFileSession, {
313
+ ...props,
314
+ key: hashKey(props.source.queryOptions.queryKey)
315
+ });
316
+ }
317
+ function WorkspaceCorrespondenceFileSession({ fallback = null, source, ...props }) {
306
318
  const queryClient = useQueryClient();
307
319
  const persisted = useQuery(source.queryOptions).data ?? null;
308
320
  const path = persisted?.path;
@@ -316,20 +328,9 @@ function WorkspaceCorrespondenceFile({ fallback = null, source, ...props }) {
316
328
  const savePromiseRef = React.useRef(null);
317
329
  /** The last projection this card rendered, kept for the sent snapshot. */
318
330
  const lastShownRef = React.useRef(null);
319
- const identity = String(source.queryOptions.queryKey);
320
- const [seenIdentity, setSeenIdentity] = React.useState(identity);
321
- if (identity !== seenIdentity) {
322
- setSeenIdentity(identity);
323
- setDraft(null);
324
- setSessionSent(false);
325
- attemptedDraftRef.current = null;
326
- savedDraftRef.current = null;
327
- savePromiseRef.current = null;
328
- lastShownRef.current = null;
329
- }
330
331
  const saveMutation = useMutation({
331
332
  mutationFn: async (next) => {
332
- if (!source.onChange) return;
333
+ if (!source.onChange) throw new Error(SAVE_UNAVAILABLE_MESSAGE);
333
334
  if (path === void 0) throw new Error(FILE_MISSING_MESSAGE);
334
335
  await source.onChange(path, next);
335
336
  },
@@ -357,36 +358,34 @@ function WorkspaceCorrespondenceFile({ fallback = null, source, ...props }) {
357
358
  savePromiseRef.current = settled;
358
359
  return settled;
359
360
  }, [mutateSaveAsync]);
360
- const sendMutation = useMutation({ mutationFn: async () => {
361
- if (!source.onSend) return;
362
- if (path === void 0) throw new Error(FILE_MISSING_MESSAGE);
363
- await source.onSend(path);
364
- } });
365
- const { mutateAsync: mutateSendAsync } = sendMutation;
361
+ const { mutateAsync: mutateSendAsync } = useMutation({
362
+ mutationFn: async () => {
363
+ if (!source.onSend) throw new Error(SEND_UNAVAILABLE_MESSAGE);
364
+ if (path === void 0) throw new Error(FILE_MISSING_MESSAGE);
365
+ await source.onSend(path);
366
+ },
367
+ onSuccess: () => queryClient.invalidateQueries({
368
+ queryKey: source.queryOptions.queryKey,
369
+ exact: true
370
+ })
371
+ });
366
372
  const canSave = source.onChange != null;
373
+ const settled = persisted?.state === "sent" || persisted?.state === void 0 && sessionSent;
374
+ const runDebouncedSave = React.useEffectEvent((next) => {
375
+ runSave(next);
376
+ });
367
377
  React.useEffect(() => {
368
- if (!canSave || path === void 0 || sessionSent || draft === null) return;
378
+ if (!canSave || path === void 0 || settled || draft === null) return;
369
379
  if (draft === savedDraftRef.current || draft === attemptedDraftRef.current) return;
370
380
  if (savePending) return;
371
- const timer = setTimeout(() => void runSave(draft), SAVE_DEBOUNCE_MS);
381
+ const timer = setTimeout(() => runDebouncedSave(draft), SAVE_DEBOUNCE_MS);
372
382
  return () => clearTimeout(timer);
373
383
  }, [
374
384
  canSave,
375
385
  draft,
376
386
  path,
377
- runSave,
378
387
  savePending,
379
- sessionSent
380
- ]);
381
- const { reset: resetSave } = saveMutation;
382
- const { reset: resetSend } = sendMutation;
383
- React.useEffect(() => {
384
- resetSave();
385
- resetSend();
386
- }, [
387
- identity,
388
- resetSave,
389
- resetSend
388
+ settled
390
389
  ]);
391
390
  const send = React.useCallback(async () => {
392
391
  if (savePromiseRef.current !== null && !await savePromiseRef.current) throw new Error(SEND_BLOCKED_MESSAGE);
@@ -395,13 +394,17 @@ function WorkspaceCorrespondenceFile({ fallback = null, source, ...props }) {
395
394
  if (!await runSave(outstanding)) throw new Error(SEND_BLOCKED_MESSAGE);
396
395
  }
397
396
  await mutateSendAsync();
397
+ if (persisted) lastShownRef.current = draft === null ? persisted : {
398
+ ...persisted,
399
+ ...draft
400
+ };
398
401
  setSessionSent(true);
399
402
  }, [
400
403
  draft,
401
404
  mutateSendAsync,
405
+ persisted,
402
406
  runSave
403
407
  ]);
404
- if (persisted) lastShownRef.current = persisted;
405
408
  const shown = persisted ?? (sessionSent ? lastShownRef.current : null);
406
409
  if (!shown) return fallback;
407
410
  const visible = draft ?? shown;
@@ -1,4 +1,3 @@
1
- import { ThinkFullAppPanel } from "./ThinkFullApp.js";
2
1
  import { WorkspaceConceptQueryOptions } from "./WorkspaceConcept.js";
3
2
  import { CardProps } from "../foundations/Card.js";
4
3
  import * as React from "react";
@@ -10,51 +9,60 @@ interface WorkspaceExecutionParam {
10
9
  label: string;
11
10
  type: WorkspaceExecutionParamType;
12
11
  /**
13
- * Whether the module's schema lists this property as required. Optional
14
- * string and number fields may run empty and are omitted from the submitted
15
- * values; required ones refuse the run until filled.
12
+ * Whether the module's schema lists this property as required. This is a
13
+ * presentation hint only; the execution runtime owns argument validation.
16
14
  */
17
15
  required: boolean;
18
- value: string | number | boolean;
16
+ value?: string | number | boolean;
19
17
  }
20
18
  interface WorkspaceExecutionRun {
21
19
  path: string;
22
20
  label: string;
21
+ }
22
+ interface WorkspaceExecutionRunView extends WorkspaceExecutionRun {
23
23
  onOpen?: () => void;
24
24
  }
25
+ interface WorkspaceExecutionOutcome {
26
+ /** Serialized return value from the existing execution runtime. */
27
+ result: unknown;
28
+ logs: readonly string[];
29
+ /** Result and log files emitted when the runtime overflowed its inline bounds. */
30
+ runs: readonly WorkspaceExecutionRun[];
31
+ }
32
+ interface WorkspaceExecutionViewOutcome extends Omit<WorkspaceExecutionOutcome, "runs"> {
33
+ runs: readonly WorkspaceExecutionRunView[];
34
+ }
25
35
  interface WorkspaceExecution {
26
36
  /** Workspace path of the module file. */
27
37
  path: string;
28
38
  name: string;
29
39
  description?: string;
30
- /**
31
- * Hostnames or URLs the model said this operates on. Shown like user-script
32
- * Sites. Not a run argument and not parsed from the JavaScript.
33
- */
34
- sites?: readonly string[];
35
- /** Brand mark. Defaults to the first site favicon, then `TerminalIcon`. */
40
+ /** Brand mark. Defaults to `TerminalIcon`. */
36
41
  icon?: React.ReactNode;
37
42
  parameters: readonly WorkspaceExecutionParam[];
38
43
  /** Recent result peeks, newest first. Not a results directory. */
39
44
  runs?: readonly WorkspaceExecutionRun[];
45
+ }
46
+ /** Data-only execution projection hydrated with card actions outside Query. */
47
+ interface WorkspaceExecutionView extends WorkspaceExecution {
48
+ runs?: readonly WorkspaceExecutionRunView[];
40
49
  /**
41
- * Runs the module with the submitted values and resolves with its visible
42
- * result files. The card owns the run lifecycle: a resolved promise shows a
43
- * completed run even when the array is empty; returned files enrich that row.
50
+ * Runs the module with the submitted values. The card owns the run lifecycle;
51
+ * inline output and any overflow files enrich the completed row.
44
52
  */
45
- onRun?: (parameters: readonly WorkspaceExecutionParam[]) => Promise<readonly WorkspaceExecutionRun[]>;
53
+ onRun?: (parameters: readonly WorkspaceExecutionParam[]) => Promise<WorkspaceExecutionViewOutcome>;
46
54
  onOpen?: () => void;
47
55
  onDelete?: () => void | Promise<void>;
48
56
  }
49
57
  interface WorkspaceExecutionSource {
50
58
  queryOptions: WorkspaceConceptQueryOptions<readonly WorkspaceExecution[]>;
51
- /** Runs the module with the submitted values and returns its visible result files. */
52
- onRun?: (path: string, parameters: readonly WorkspaceExecutionParam[]) => Promise<readonly WorkspaceExecutionRun[]>;
59
+ /** Runs the module with the submitted values and returns its visible outcome. */
60
+ onRun?: (path: string, parameters: readonly WorkspaceExecutionParam[]) => Promise<WorkspaceExecutionOutcome>;
53
61
  onOpen?: (path: string) => void;
54
62
  onDelete?: (path: string) => void | Promise<void>;
55
63
  }
56
64
  interface WorkspaceExecutionCardProps extends Omit<CardProps, "children" | "hover" | "size" | "title"> {
57
- module: WorkspaceExecution;
65
+ module: WorkspaceExecutionView;
58
66
  }
59
67
  interface WorkspaceExecutionFileProps extends Omit<WorkspaceExecutionCardProps, "module"> {
60
68
  path: string;
@@ -62,15 +70,11 @@ interface WorkspaceExecutionFileProps extends Omit<WorkspaceExecutionCardProps,
62
70
  fallback?: React.ReactNode;
63
71
  }
64
72
  interface WorkspaceExecutionsPanelProps extends Omit<React.HTMLAttributes<HTMLElement>, "children"> {
65
- modules: readonly WorkspaceExecution[];
66
- /** Query failure to show instead of the empty state. Loaded modules win. */
67
- error?: string;
68
- onRetry?: () => void;
73
+ /** Shared workspace query and host actions, also used by inline module cards. */
74
+ source: WorkspaceExecutionSource;
69
75
  }
70
76
  declare function WorkspaceExecutionCard({
71
- className,
72
77
  module,
73
- ref,
74
78
  ...props
75
79
  }: WorkspaceExecutionCardProps & {
76
80
  ref?: React.Ref<HTMLDivElement>;
@@ -92,15 +96,11 @@ declare function WorkspaceExecutionFile({
92
96
  */
93
97
  declare function WorkspaceExecutionsPanel({
94
98
  className,
95
- error,
96
- modules,
97
- onRetry,
99
+ source,
98
100
  ref,
99
101
  ...props
100
102
  }: WorkspaceExecutionsPanelProps & {
101
- ref?: React.Ref<HTMLElement>;
103
+ /** Ref forwarded to the component's rendered root element. */ref?: React.Ref<HTMLElement>;
102
104
  }): React.JSX.Element;
103
- /** Canonical workbench descriptor; hosts supply only the source adapter. */
104
- declare function workspaceExecutionsPanel(source: WorkspaceExecutionSource): ThinkFullAppPanel;
105
105
  //#endregion
106
- export { WorkspaceExecution, WorkspaceExecutionCard, WorkspaceExecutionCardProps, WorkspaceExecutionFile, WorkspaceExecutionFileProps, WorkspaceExecutionParam, WorkspaceExecutionParamType, WorkspaceExecutionRun, WorkspaceExecutionSource, WorkspaceExecutionsPanel, WorkspaceExecutionsPanelProps, workspaceExecutionsPanel };
106
+ export { WorkspaceExecution, WorkspaceExecutionCard, WorkspaceExecutionCardProps, WorkspaceExecutionFile, WorkspaceExecutionFileProps, WorkspaceExecutionOutcome, WorkspaceExecutionParam, WorkspaceExecutionParamType, WorkspaceExecutionRun, WorkspaceExecutionRunView, WorkspaceExecutionSource, WorkspaceExecutionView, WorkspaceExecutionViewOutcome, WorkspaceExecutionsPanel, WorkspaceExecutionsPanelProps };