@mcp-b/react-components 0.14.2 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/dist/AgentActivity-BNUNrP9O.d.ts +36 -0
  2. package/dist/{AgentChat-DQkqt82e.d.ts → AgentChat-CrlpbvQJ.d.ts} +58 -6
  3. package/dist/{CodeBlock-DUh9WOGo.d.ts → CodeBlock-BRajW4QU.d.ts} +1 -1
  4. package/dist/{CodeBlock-BUFXG8HW.js → CodeBlock-BmB4Xaqq.js} +15 -4
  5. package/dist/{FileTree-mpEIcfzA.js → FileTree-CkVbIMWV.js} +82 -89
  6. package/dist/Message-BkMdE3bS.js +375 -0
  7. package/dist/{ModelSelector-CPCpFAUt.js → ModelSelector-SlJNgwKY.js} +2 -2
  8. package/dist/{PromptInput-ClNqBiIw.d.ts → PromptInput-BWTuXMOD.d.ts} +123 -5
  9. package/dist/ResponsiveSidebarShell-Dd9DCcBT.d.ts +67 -0
  10. package/dist/{Select-Dl_vF_Bt.d.ts → Select-BeEsefzh.d.ts} +12 -2
  11. package/dist/{ThinkChat-BPcehdbP.js → ThinkChat-CzC-zNGA.js} +24 -36
  12. package/dist/{ThinkChatActivity-BmwuIigx.d.ts → ThinkChatActivity-BFQnb2ct.d.ts} +3 -10
  13. package/dist/ThinkChatActivitySummary-BPmu9a-c.d.ts +39 -0
  14. package/dist/{ThinkChatToolParts-CDEjqS6A.d.ts → ThinkChatToolParts-CSzVwMXf.d.ts} +13 -3
  15. package/dist/ThinkExecutionRun-ChhWhOoU.d.ts +30 -0
  16. package/dist/Toggle-CAAlNl-M.d.ts +69 -0
  17. package/dist/ToggleGroup-8hPv-b69.d.ts +73 -0
  18. package/dist/Workspace-D39LxGvP.d.ts +62 -0
  19. package/dist/WorkspaceFile-DOZkPwzu.d.ts +106 -0
  20. package/dist/WorkspaceFileView-rSN_yT0L.js +744 -0
  21. package/dist/WorkspaceLink-DIPbXrUM.js +337 -0
  22. package/dist/WorkspaceLink-DK1DWMHe.d.ts +89 -0
  23. package/dist/components/Activity.d.ts +27 -1
  24. package/dist/components/Activity.js +33 -15
  25. package/dist/components/AgentActivity.d.ts +2 -0
  26. package/dist/components/AgentActivity.js +45 -0
  27. package/dist/components/AgentActivityPreview.d.ts +46 -0
  28. package/dist/components/AgentActivityPreview.js +94 -0
  29. package/dist/components/AgentAttention.d.ts +73 -0
  30. package/dist/components/AgentAttention.js +85 -0
  31. package/dist/components/AgentChat.d.ts +2 -2
  32. package/dist/components/AgentChat.js +224 -200
  33. package/dist/components/AgentChatMessageEditor.d.ts +29 -0
  34. package/dist/components/AgentChatMessageEditor.js +92 -0
  35. package/dist/components/AgentChatTurnError.d.ts +17 -0
  36. package/dist/components/AgentChatTurnError.js +40 -0
  37. package/dist/components/AgentConnection.d.ts +12 -17
  38. package/dist/components/AgentConnection.js +99 -91
  39. package/dist/components/AppFrame.d.ts +24 -0
  40. package/dist/components/AppFrame.js +25 -0
  41. package/dist/components/AppTopBar.d.ts +71 -0
  42. package/dist/components/AppTopBar.js +82 -0
  43. package/dist/components/Artifact.js +1 -1
  44. package/dist/components/BrowserLiveView.js +1 -1
  45. package/dist/components/BrowserReplay.js +1 -1
  46. package/dist/components/BrowserRunPanel.js +1 -1
  47. package/dist/components/Card.d.ts +3 -0
  48. package/dist/components/Card.js +2 -1
  49. package/dist/components/ChainOfThought.d.ts +1 -1
  50. package/dist/components/ChainOfThought.js +1 -1
  51. package/dist/components/ChatGptSignInScreen.js +2 -2
  52. package/dist/components/Checkbox.js +5 -13
  53. package/dist/components/CheckboxGroup.d.ts +58 -2
  54. package/dist/components/CheckboxGroup.js +59 -1
  55. package/dist/components/CodeBlock.d.ts +1 -1
  56. package/dist/components/CodeBlock.js +1 -1
  57. package/dist/components/CodexModelSelector.js +1 -1
  58. package/dist/components/Commit.js +2 -2
  59. package/dist/components/ContextMenu.js +1 -1
  60. package/dist/components/Conversation.js +1 -1
  61. package/dist/components/DescriptionList.d.ts +12 -0
  62. package/dist/components/DescriptionList.js +11 -0
  63. package/dist/components/DescriptionListParts.d.ts +37 -0
  64. package/dist/components/DescriptionListParts.js +35 -0
  65. package/dist/components/EnvironmentVariables.js +2 -2
  66. package/dist/components/Fieldset.d.ts +13 -1
  67. package/dist/components/Fieldset.js +11 -2
  68. package/dist/components/FileTree.js +1 -1
  69. package/dist/components/IconButton.d.ts +33 -0
  70. package/dist/components/IconButton.js +27 -0
  71. package/dist/components/McpConnectionRequest.d.ts +44 -0
  72. package/dist/components/McpConnectionRequest.js +122 -0
  73. package/dist/components/McpServerPicker.d.ts +48 -23
  74. package/dist/components/McpServerPicker.js +238 -189
  75. package/dist/components/Menubar.js +1 -1
  76. package/dist/components/Message.d.ts +1 -0
  77. package/dist/components/Message.js +1 -285
  78. package/dist/components/MessageScroller.js +1 -1
  79. package/dist/components/ModelSelector.js +1 -1
  80. package/dist/components/Pricing.d.ts +37 -0
  81. package/dist/components/Pricing.js +17 -0
  82. package/dist/components/PricingBillingToggle.d.ts +23 -0
  83. package/dist/components/PricingBillingToggle.js +86 -0
  84. package/dist/components/PricingConfirmationDialog.d.ts +25 -0
  85. package/dist/components/PricingConfirmationDialog.js +57 -0
  86. package/dist/components/PricingFAQ.d.ts +18 -0
  87. package/dist/components/PricingFAQ.js +27 -0
  88. package/dist/components/PricingPage.d.ts +2 -38
  89. package/dist/components/PricingPage.js +39 -359
  90. package/dist/components/PricingPlanCard.d.ts +22 -0
  91. package/dist/components/PricingPlanCard.js +109 -0
  92. package/dist/components/PricingUsageCalculator.d.ts +22 -0
  93. package/dist/components/PricingUsageCalculator.js +96 -0
  94. package/dist/components/PromptInput.d.ts +2 -2
  95. package/dist/components/PromptInput.js +210 -15
  96. package/dist/components/Queue.js +1 -1
  97. package/dist/components/Reasoning.d.ts +2 -1
  98. package/dist/components/Reasoning.js +14 -29
  99. package/dist/components/ResizableSidePanel.d.ts +57 -0
  100. package/dist/components/ResizableSidePanel.js +151 -0
  101. package/dist/components/ResponsiveSidebarShell.d.ts +2 -0
  102. package/dist/components/ResponsiveSidebarShell.js +129 -0
  103. package/dist/components/Select.d.ts +2 -2
  104. package/dist/components/Select.js +11 -2
  105. package/dist/components/Slider.d.ts +13 -1
  106. package/dist/components/Slider.js +11 -0
  107. package/dist/components/Sources.js +1 -1
  108. package/dist/components/Stepper.d.ts +4 -0
  109. package/dist/components/Stepper.js +5 -3
  110. package/dist/components/SubagentRun.d.ts +18 -19
  111. package/dist/components/SubagentRun.js +25 -18
  112. package/dist/components/SubagentRunIndicator.d.ts +22 -0
  113. package/dist/components/SubagentRunIndicator.js +33 -0
  114. package/dist/components/SubagentRunList.d.ts +25 -0
  115. package/dist/components/SubagentRunList.js +26 -0
  116. package/dist/components/SubagentRunSelector.d.ts +47 -0
  117. package/dist/components/SubagentRunSelector.js +55 -0
  118. package/dist/components/Task.js +1 -1
  119. package/dist/components/Terminal.js +2 -2
  120. package/dist/components/TestResults.js +1 -1
  121. package/dist/components/Textarea.d.ts +21 -0
  122. package/dist/components/Textarea.js +19 -0
  123. package/dist/components/ThemeModeControl.d.ts +24 -0
  124. package/dist/components/ThemeModeControl.js +52 -0
  125. package/dist/components/ThemeProvider.d.ts +38 -0
  126. package/dist/components/ThemeProvider.js +80 -0
  127. package/dist/components/ThinkChat.d.ts +29 -6
  128. package/dist/components/ThinkChat.js +7 -4
  129. package/dist/components/ThinkChatActivity.d.ts +3 -2
  130. package/dist/components/ThinkChatActivity.js +12 -318
  131. package/dist/components/ThinkChatActivitySummary.d.ts +2 -0
  132. package/dist/components/ThinkChatActivitySummary.js +421 -0
  133. package/dist/components/ThinkChatToolPanels.d.ts +7 -5
  134. package/dist/components/ThinkChatToolPanels.js +70 -8
  135. package/dist/components/ThinkChatToolParts.d.ts +2 -2
  136. package/dist/components/ThinkChatToolParts.js +36 -10
  137. package/dist/components/ThinkExecutionDetail.d.ts +20 -0
  138. package/dist/components/ThinkExecutionDetail.js +80 -0
  139. package/dist/components/ThinkExecutionRun.d.ts +2 -0
  140. package/dist/components/ThinkExecutionRun.js +72 -0
  141. package/dist/components/ThinkExecutionStatus.d.ts +22 -0
  142. package/dist/components/ThinkExecutionStatus.js +36 -0
  143. package/dist/components/ThinkExecutionWorkbench.d.ts +7 -0
  144. package/dist/components/ThinkExecutionWorkbench.js +69 -225
  145. package/dist/components/ThinkFullApp.d.ts +58 -14
  146. package/dist/components/ThinkFullApp.js +154 -160
  147. package/dist/components/ThinkFullAppViewSwitch.d.ts +31 -0
  148. package/dist/components/ThinkFullAppViewSwitch.js +34 -0
  149. package/dist/components/ThinkRoutine.d.ts +36 -0
  150. package/dist/components/ThinkRoutine.js +15 -0
  151. package/dist/components/ThinkRoutineBrowser.d.ts +25 -0
  152. package/dist/components/ThinkRoutineBrowser.js +156 -0
  153. package/dist/components/ThinkRoutineDetail.d.ts +24 -0
  154. package/dist/components/ThinkRoutineDetail.js +102 -0
  155. package/dist/components/ThinkRoutineForm.d.ts +32 -0
  156. package/dist/components/ThinkRoutineForm.js +151 -0
  157. package/dist/components/ThinkRoutineLibrary.d.ts +74 -0
  158. package/dist/components/ThinkRoutineLibrary.js +178 -0
  159. package/dist/components/ThinkRoutineRuns.d.ts +24 -0
  160. package/dist/components/ThinkRoutineRuns.js +68 -0
  161. package/dist/components/ThinkThreadPicker.d.ts +18 -1
  162. package/dist/components/ThinkThreadPicker.js +51 -5
  163. package/dist/components/ThinkThreadShell.d.ts +12 -9
  164. package/dist/components/ThinkThreadShell.js +17 -137
  165. package/dist/components/Toggle.d.ts +1 -68
  166. package/dist/components/ToggleGroup.d.ts +1 -72
  167. package/dist/components/Tooltip.d.ts +3 -1
  168. package/dist/components/Tooltip.js +4 -2
  169. package/dist/components/WebPreview.js +1 -1
  170. package/dist/components/Workspace.d.ts +2 -0
  171. package/dist/components/Workspace.js +424 -0
  172. package/dist/components/WorkspaceBrowser.d.ts +32 -0
  173. package/dist/components/WorkspaceBrowser.js +103 -0
  174. package/dist/components/WorkspaceExplorer.d.ts +12 -79
  175. package/dist/components/WorkspaceExplorer.js +116 -330
  176. package/dist/components/WorkspaceFile.d.ts +2 -0
  177. package/dist/components/WorkspaceFile.js +195 -0
  178. package/dist/components/WorkspaceFileView.d.ts +26 -0
  179. package/dist/components/WorkspaceFileView.js +2 -0
  180. package/dist/components/WorkspaceHeader.d.ts +35 -0
  181. package/dist/components/WorkspaceHeader.js +51 -0
  182. package/dist/components/WorkspaceLink.d.ts +2 -0
  183. package/dist/components/WorkspaceLink.js +2 -0
  184. package/dist/components/icons.d.ts +2 -2
  185. package/dist/components/icons.js +2 -2
  186. package/dist/{copy-button-DUMLYdsk.js → copy-button-Dejn5heL.js} +1 -1
  187. package/dist/icons-CpfUer49.js +85 -0
  188. package/dist/{icons-CUCz_Sft.d.ts → icons-GQd1xF4e.d.ts} +51 -1
  189. package/dist/styles/activity-header.css +75 -0
  190. package/dist/styles/activity.css +49 -63
  191. package/dist/styles/agent-activity-preview-overlay.css +80 -0
  192. package/dist/styles/agent-activity-preview.css +233 -0
  193. package/dist/styles/agent-attention.css +128 -0
  194. package/dist/styles/agent-chat.css +133 -4
  195. package/dist/styles/agent-connection.css +9 -9
  196. package/dist/styles/alert-dialog.css +11 -11
  197. package/dist/styles/app-frame.css +15 -0
  198. package/dist/styles/app-top-bar.css +102 -0
  199. package/dist/styles/avatar.css +0 -1
  200. package/dist/styles/browser-control-overlay.css +184 -0
  201. package/dist/styles/card.css +29 -8
  202. package/dist/styles/chain-of-thought.css +5 -5
  203. package/dist/styles/checkbox-group.css +69 -0
  204. package/dist/styles/codex-model-selector.css +3 -3
  205. package/dist/styles/combobox.css +2 -1
  206. package/dist/styles/context-menu.css +1 -1
  207. package/dist/styles/description-list.css +50 -0
  208. package/dist/styles/dialog.css +11 -11
  209. package/dist/styles/field.css +14 -14
  210. package/dist/styles/fieldset.css +15 -4
  211. package/dist/styles/index.css +14 -2
  212. package/dist/styles/mcp-connection-request.css +60 -0
  213. package/dist/styles/mcp-server-picker.css +96 -68
  214. package/dist/styles/menu.css +1 -1
  215. package/dist/styles/message.css +4 -43
  216. package/dist/styles/model-selector.css +18 -12
  217. package/dist/styles/popover.css +9 -9
  218. package/dist/styles/preview-card.css +1 -1
  219. package/dist/styles/pricing-page.css +21 -27
  220. package/dist/styles/prompt-input.css +225 -32
  221. package/dist/styles/reasoning.css +1 -55
  222. package/dist/styles/recipes.css +50 -24
  223. package/dist/styles/resizable-side-panel.css +66 -0
  224. package/dist/styles/responsive-sidebar-shell.css +169 -0
  225. package/dist/styles/select.css +13 -3
  226. package/dist/styles/sources.css +6 -6
  227. package/dist/styles/stepper.css +13 -0
  228. package/dist/styles/streamdown.css +0 -4
  229. package/dist/styles/subagent-run.css +59 -42
  230. package/dist/styles/task.css +17 -10
  231. package/dist/styles/test-results.css +17 -10
  232. package/dist/styles/textarea.css +20 -0
  233. package/dist/styles/theme-mode-control.css +72 -0
  234. package/dist/styles/think-execution-status.css +49 -0
  235. package/dist/styles/think-execution-workbench.css +16 -80
  236. package/dist/styles/think-full-app.css +143 -128
  237. package/dist/styles/think-routine-library.css +491 -0
  238. package/dist/styles/think-thread-picker.css +47 -3
  239. package/dist/styles/toast.css +6 -6
  240. package/dist/styles/toggle-group.css +7 -0
  241. package/dist/styles/tooltip.css +1 -1
  242. package/dist/styles/workspace-explorer.css +516 -64
  243. package/dist/utils/mcp-server-catalog.d.ts +82 -78
  244. package/dist/utils/mcp-server-catalog.js +64 -41
  245. package/dist/utils/structured-code.d.ts +1 -1
  246. package/dist/utils/theme.d.ts +22 -0
  247. package/dist/utils/theme.js +55 -0
  248. package/package.json +34 -28
  249. package/dist/icons-Ba9THQKz.js +0 -64
  250. package/dist/styles/think-resize-handle.css +0 -33
  251. package/dist/styles/think-thread-shell.css +0 -219
@@ -0,0 +1,92 @@
1
+ import { Button } from "./Button.js";
2
+ import { Field } from "./Field.js";
3
+ import { Form } from "./Form.js";
4
+ import { Textarea } from "./Textarea.js";
5
+ import * as React from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/components/AgentChatMessageEditor.tsx
8
+ /**
9
+ * Edit-and-resend form for a chat message. It composes the shared Base UI
10
+ * Form/Field wrappers and Textarea recipe so validation, labels, focus, and
11
+ * disabled states stay owned by the design-system primitives.
12
+ */
13
+ function AgentChatMessageEditor({ message, originalText, onCancel, onSubmit, onSuccess }) {
14
+ const [draft, setDraft] = React.useState(originalText);
15
+ const [isSubmitting, setIsSubmitting] = React.useState(false);
16
+ const [error, setError] = React.useState();
17
+ const textareaRef = React.useRef(null);
18
+ const trimmedDraft = draft.trim();
19
+ const canSubmit = !isSubmitting && Boolean(trimmedDraft) && trimmedDraft !== originalText.trim();
20
+ React.useLayoutEffect(() => {
21
+ textareaRef.current?.focus();
22
+ const end = textareaRef.current?.value.length ?? 0;
23
+ textareaRef.current?.setSelectionRange(end, end);
24
+ }, []);
25
+ const handleSubmit = async (event) => {
26
+ event.preventDefault();
27
+ if (!canSubmit) return;
28
+ setError(void 0);
29
+ setIsSubmitting(true);
30
+ try {
31
+ await onSubmit({
32
+ message,
33
+ text: trimmedDraft
34
+ });
35
+ onSuccess?.();
36
+ } catch {
37
+ setError("Message wasn’t resent. Try again.");
38
+ setIsSubmitting(false);
39
+ }
40
+ };
41
+ return /* @__PURE__ */ jsxs(Form, {
42
+ className: "message__edit-form",
43
+ "data-slot": "agent-chat-message-editor",
44
+ "aria-busy": isSubmitting,
45
+ onSubmit: (event) => void handleSubmit(event),
46
+ children: [/* @__PURE__ */ jsxs(Field.Root, {
47
+ name: "message",
48
+ invalid: Boolean(error),
49
+ disabled: isSubmitting,
50
+ children: [
51
+ /* @__PURE__ */ jsx(Field.Label, { children: "Edit message" }),
52
+ /* @__PURE__ */ jsx(Field.Control, {
53
+ render: /* @__PURE__ */ jsx(Textarea, {
54
+ ref: textareaRef,
55
+ className: "message__edit-textarea",
56
+ rows: 3
57
+ }),
58
+ value: draft,
59
+ onChange: (event) => {
60
+ setDraft(event.currentTarget.value);
61
+ if (error) setError(void 0);
62
+ },
63
+ onKeyDown: (event) => {
64
+ if (event.key !== "Escape" || isSubmitting) return;
65
+ event.preventDefault();
66
+ onCancel();
67
+ }
68
+ }),
69
+ error ? /* @__PURE__ */ jsx(Field.Error, { errors: [error] }) : null
70
+ ]
71
+ }), /* @__PURE__ */ jsxs("div", {
72
+ className: "message__edit-actions",
73
+ children: [/* @__PURE__ */ jsx(Button, {
74
+ type: "button",
75
+ variant: "outline",
76
+ color: "neutral",
77
+ size: "lg",
78
+ disabled: isSubmitting,
79
+ onClick: onCancel,
80
+ children: "Cancel"
81
+ }), /* @__PURE__ */ jsx(Button, {
82
+ type: "submit",
83
+ color: "primary",
84
+ size: "lg",
85
+ disabled: !canSubmit,
86
+ children: isSubmitting ? "Resending…" : "Send"
87
+ })]
88
+ })]
89
+ });
90
+ }
91
+ //#endregion
92
+ export { AgentChatMessageEditor };
@@ -0,0 +1,17 @@
1
+ //#region src/components/AgentChatTurnError.d.ts
2
+ interface AgentChatTurnErrorProps {
3
+ error: Error;
4
+ onDismiss: () => void;
5
+ onRetry?: () => void;
6
+ }
7
+ /**
8
+ * Recoverable turn failure for AgentChat-compatible surfaces. The message and
9
+ * actions remain one status unit while Button owns all interaction styling.
10
+ */
11
+ declare function AgentChatTurnError({
12
+ error,
13
+ onDismiss,
14
+ onRetry
15
+ }: AgentChatTurnErrorProps): import("react").JSX.Element;
16
+ //#endregion
17
+ export { AgentChatTurnError, AgentChatTurnErrorProps };
@@ -0,0 +1,40 @@
1
+ import { Button } from "./Button.js";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ //#region src/components/AgentChatTurnError.tsx
4
+ /**
5
+ * Recoverable turn failure for AgentChat-compatible surfaces. The message and
6
+ * actions remain one status unit while Button owns all interaction styling.
7
+ */
8
+ function AgentChatTurnError({ error, onDismiss, onRetry }) {
9
+ return /* @__PURE__ */ jsxs("div", {
10
+ className: "agent-chat__turn-error",
11
+ "data-slot": "agent-chat-turn-error",
12
+ "data-tone": "danger",
13
+ children: [/* @__PURE__ */ jsxs("p", {
14
+ className: "agent-chat__turn-error-message",
15
+ children: [
16
+ /* @__PURE__ */ jsx("strong", { children: "Response failed." }),
17
+ " ",
18
+ error.message.trim() || "The response could not be completed."
19
+ ]
20
+ }), /* @__PURE__ */ jsxs("div", {
21
+ className: "agent-chat__turn-error-actions",
22
+ children: [/* @__PURE__ */ jsx(Button, {
23
+ type: "button",
24
+ variant: "ghost",
25
+ color: "neutral",
26
+ size: "lg",
27
+ onClick: onDismiss,
28
+ children: "Dismiss"
29
+ }), onRetry ? /* @__PURE__ */ jsx(Button, {
30
+ type: "button",
31
+ color: "primary",
32
+ size: "lg",
33
+ onClick: onRetry,
34
+ children: "Try again"
35
+ }) : null]
36
+ })]
37
+ });
38
+ }
39
+ //#endregion
40
+ export { AgentChatTurnError };
@@ -1,4 +1,4 @@
1
- import { McpServerSetupAuth } from "../utils/mcp-server-catalog.js";
1
+ import { McpServerSetupAuth, McpServerSetupAuthFieldName } from "../utils/mcp-server-catalog.js";
2
2
  import * as React from "react";
3
3
 
4
4
  //#region src/components/AgentConnection.d.ts
@@ -19,6 +19,7 @@ type ConnectionProps = React.SVGProps<SVGGElement> & {
19
19
  type NanitesAgentConnectionOptions = {
20
20
  readonly mcpName?: string;
21
21
  readonly pluginMarketplace?: string;
22
+ readonly codexPluginRef?: string;
22
23
  readonly claudePluginRef?: string;
23
24
  readonly skillName?: string;
24
25
  };
@@ -33,25 +34,20 @@ type AgentConnectionPanelProps = {
33
34
  type AgentConnectionPopoverProps = Omit<AgentConnectionPanelProps, "section"> & {
34
35
  readonly className?: string;
35
36
  };
36
- type McpConnectorFormValues = {
37
- readonly bearerToken?: string;
38
- readonly clientId?: string;
39
- readonly clientSecret?: string;
37
+ type CredentialFieldName = Exclude<McpServerSetupAuthFieldName, "redirectUrl">;
38
+ type McpConnectorFormValues = Readonly<Partial<Record<CredentialFieldName, string>> & {
40
39
  readonly name: string;
41
- readonly scope?: string;
42
40
  readonly url: string;
43
- };
41
+ }>;
44
42
  type McpConnectorFormProps = Omit<React.FormHTMLAttributes<HTMLFormElement>, "onSubmit" | "status"> & {
45
- /** Authentication metadata that decides which credential fields render. */readonly auth?: McpServerSetupAuth; /** Label for the OAuth authorization button. */
46
- readonly authorizeLabel?: string; /** Initial MCP name and URL values. */
47
- readonly defaults?: Partial<Pick<McpConnectorFormValues, "name" | "url">>; /** Pattern used to validate the MCP name field. */
48
- readonly namePattern?: string; /** OAuth URL waiting for the user to authorize, when available. */
49
- readonly pendingAuthUrl?: string | null; /** Read-only redirect URL shown for manual OAuth client setup. */
43
+ /** Authentication metadata that decides which credential fields render. */readonly auth?: McpServerSetupAuth; /** Initial connector values. Publisher client credentials remain app-owned. */
44
+ readonly defaults?: Partial<McpConnectorFormValues>; /** Optional pattern used to validate the MCP name field. */
45
+ readonly namePattern?: string; /** Keep a catalog-owned MCP name and URL visible but immutable. */
46
+ readonly readOnlyServer?: boolean; /** Read-only redirect URL shown for manual OAuth client setup. */
50
47
  readonly redirectUrl?: string; /** Inline connection status announced politely to assistive tech. */
51
48
  readonly status?: React.ReactNode; /** Label for the submit button. */
52
49
  readonly submitLabel?: string; /** Label shown while submit is pending. */
53
- readonly submittingLabel?: string; /** Called when the user starts OAuth authorization. */
54
- readonly onAuthorize?: () => void | Promise<void>; /** Called with normalized connector values after native form validation passes. */
50
+ readonly submittingLabel?: string; /** Called with normalized connector values after native form validation passes. */
55
51
  readonly onSubmit: (values: McpConnectorFormValues) => void | Promise<void>;
56
52
  };
57
53
  declare function Connection({
@@ -64,6 +60,7 @@ declare function Connection({
64
60
  declare function buildNanitesAgentConnectionCommands(origin: string, {
65
61
  mcpName,
66
62
  pluginMarketplace,
63
+ codexPluginRef,
67
64
  claudePluginRef,
68
65
  skillName
69
66
  }?: NanitesAgentConnectionOptions): readonly AgentConnectionCommand[];
@@ -83,16 +80,14 @@ declare function AgentConnectionPanel({
83
80
  /** Collects MCP connector settings and optional credentials with native form validation. */
84
81
  declare function McpConnectorForm({
85
82
  auth,
86
- authorizeLabel,
87
83
  className,
88
84
  defaults,
89
85
  namePattern,
90
- pendingAuthUrl,
86
+ readOnlyServer,
91
87
  redirectUrl,
92
88
  status,
93
89
  submitLabel,
94
90
  submittingLabel,
95
- onAuthorize,
96
91
  onSubmit,
97
92
  ref,
98
93
  ...props
@@ -1,16 +1,16 @@
1
1
  import { t as cx } from "../class-names-9UtZwb0J.js";
2
- import { b as LinkIcon } from "../icons-Ba9THQKz.js";
3
- import { Popover } from "./Popover.js";
2
+ import { C as LinkIcon } from "../icons-CpfUer49.js";
4
3
  import { Button } from "./Button.js";
5
- import { a as CodeBlockCopyButton, i as CodeBlockContent, n as CodeBlockActions, p as CodeBlockTitle, r as CodeBlockContainer, s as CodeBlockHeader, t as CodeBlock } from "../CodeBlock-BUFXG8HW.js";
4
+ import { Popover } from "./Popover.js";
6
5
  import { Field } from "./Field.js";
7
6
  import { Form } from "./Form.js";
7
+ import { a as CodeBlockCopyButton, i as CodeBlockContent, n as CodeBlockActions, p as CodeBlockTitle, r as CodeBlockContainer, s as CodeBlockHeader, t as CodeBlock } from "../CodeBlock-BmB4Xaqq.js";
8
+ import { CUSTOM_MCP_SERVER_CARD } from "../utils/mcp-server-catalog.js";
8
9
  import * as React from "react";
9
10
  import { jsx, jsxs } from "react/jsx-runtime";
10
11
  //#region src/components/AgentConnection.tsx
11
12
  const DEFAULT_LOCAL_ORIGIN = "http://localhost:5173";
12
13
  const CONNECTION_CURVE_MIDPOINT = .5;
13
- const MCP_CONNECTOR_NAME_PATTERN = "[A-Za-z_$][A-Za-z0-9_$]*";
14
14
  const CUSTOM_AUTH_FIELDS = [{
15
15
  inputType: "password",
16
16
  label: "Bearer",
@@ -43,7 +43,7 @@ function getBrowserOrigin() {
43
43
  function buildMcpUrl(origin) {
44
44
  return `${origin.replace(/\/$/, "")}/mcp`;
45
45
  }
46
- function buildNanitesAgentConnectionCommands(origin, { mcpName = "nanites", pluginMarketplace = "WebMCP-org/nanites", claudePluginRef = "nanites@nanites", skillName = "nanites" } = {}) {
46
+ function buildNanitesAgentConnectionCommands(origin, { mcpName = "nanites", pluginMarketplace = "WebMCP-org/nanites", codexPluginRef = "nanites@nanites", claudePluginRef = "nanites@nanites", skillName = "nanites" } = {}) {
47
47
  const mcpUrl = buildMcpUrl(origin);
48
48
  return [
49
49
  {
@@ -55,6 +55,7 @@ function buildNanitesAgentConnectionCommands(origin, { mcpName = "nanites", plug
55
55
  `NANITES_MCP_URL="${mcpUrl}"`,
56
56
  "",
57
57
  `codex plugin marketplace add ${pluginMarketplace}`,
58
+ `codex plugin add ${codexPluginRef}`,
58
59
  `codex mcp add ${mcpName} --url "$NANITES_MCP_URL"`,
59
60
  `codex mcp login ${mcpName}`
60
61
  ].join("\n")
@@ -154,106 +155,115 @@ function AgentConnectionPanel({ className, commands: commandsProp, defaultTarget
154
155
  });
155
156
  }
156
157
  /** Collects MCP connector settings and optional credentials with native form validation. */
157
- function McpConnectorForm({ auth, authorizeLabel = "Authorize", className, defaults, namePattern = MCP_CONNECTOR_NAME_PATTERN, pendingAuthUrl, redirectUrl = "", status, submitLabel = "Connect MCP", submittingLabel = "Connecting", onAuthorize, onSubmit, ref, ...props }) {
158
- const [submitting, setSubmitting] = React.useState(false);
158
+ function McpConnectorForm({ auth, className, defaults, namePattern, readOnlyServer = false, redirectUrl = "", status, submitLabel = "Connect MCP", submittingLabel = "Connecting", onSubmit, ref, ...props }) {
159
+ const [submission, setSubmission] = React.useState(null);
159
160
  const credentialFields = (auth?.fields ?? CUSTOM_AUTH_FIELDS).filter(isCredentialAuthField);
160
161
  const redirectUrlField = auth?.fields.find((field) => field.name === "redirectUrl");
161
- async function handleSubmit(event) {
162
- event.preventDefault();
163
- event.stopPropagation();
164
- if (!event.currentTarget.reportValidity()) return;
165
- setSubmitting(true);
162
+ async function handleSubmit(values) {
163
+ setSubmission(true);
166
164
  try {
167
- await onSubmit(readMcpConnectorFormValues(new FormData(event.currentTarget)));
168
- } finally {
169
- setSubmitting(false);
165
+ await onSubmit(readMcpConnectorFormValues(values));
166
+ setSubmission(null);
167
+ } catch (error) {
168
+ setSubmission(error instanceof Error ? error.message : String(error));
170
169
  }
171
170
  }
172
171
  return /* @__PURE__ */ jsxs(Form, {
173
172
  ref,
174
173
  "aria-label": "MCP connector",
175
174
  className: cx("agent-connect__mcp-form", className),
176
- noValidate: false,
177
- onSubmit: handleSubmit,
175
+ onFormSubmit: handleSubmit,
178
176
  ...props,
179
177
  children: [
180
- /* @__PURE__ */ jsxs(Field.Root, { children: [
181
- /* @__PURE__ */ jsx(Field.Label, { children: "MCP name" }),
182
- /* @__PURE__ */ jsx(Field.Control, {
183
- name: "name",
184
- pattern: namePattern,
185
- required: true,
186
- title: "Use a valid JavaScript identifier.",
187
- defaultValue: defaults?.name ?? "localMcp"
188
- }),
189
- /* @__PURE__ */ jsx(Field.Error, {
190
- match: "valueMissing",
191
- children: "MCP name is required."
192
- }),
193
- /* @__PURE__ */ jsx(Field.Error, {
194
- match: "patternMismatch",
195
- children: "Use a valid JavaScript identifier."
196
- })
197
- ] }),
198
- /* @__PURE__ */ jsxs(Field.Root, { children: [
199
- /* @__PURE__ */ jsx(Field.Label, { children: "MCP URL" }),
200
- /* @__PURE__ */ jsx(Field.Control, {
201
- name: "url",
202
- placeholder: "http://127.0.0.1:8787/mcp",
203
- required: true,
204
- type: "url",
205
- defaultValue: defaults?.url ?? ""
206
- }),
207
- /* @__PURE__ */ jsx(Field.Error, {
208
- match: "valueMissing",
209
- children: "MCP URL is required."
210
- }),
211
- /* @__PURE__ */ jsx(Field.Error, {
212
- match: "typeMismatch",
213
- children: "MCP URL must use http or https."
214
- })
215
- ] }),
216
- redirectUrlField ? /* @__PURE__ */ jsxs(Field.Root, { children: [/* @__PURE__ */ jsx(Field.Label, { children: redirectUrlField.label }), /* @__PURE__ */ jsx(Field.Control, {
178
+ /* @__PURE__ */ jsxs(Field.Root, {
179
+ name: "name",
180
+ children: [
181
+ /* @__PURE__ */ jsx(Field.Label, { children: "MCP name" }),
182
+ /* @__PURE__ */ jsx(Field.Control, {
183
+ defaultValue: defaults?.name ?? CUSTOM_MCP_SERVER_CARD.id,
184
+ pattern: namePattern,
185
+ readOnly: readOnlyServer,
186
+ required: true,
187
+ title: namePattern ? "Use the required name format." : void 0
188
+ }),
189
+ /* @__PURE__ */ jsx(Field.Error, {
190
+ match: "valueMissing",
191
+ children: "MCP name is required."
192
+ }),
193
+ /* @__PURE__ */ jsx(Field.Error, {
194
+ match: "patternMismatch",
195
+ children: "Use the required name format."
196
+ })
197
+ ]
198
+ }),
199
+ /* @__PURE__ */ jsxs(Field.Root, {
200
+ name: "url",
201
+ children: [
202
+ /* @__PURE__ */ jsx(Field.Label, { children: "MCP URL" }),
203
+ /* @__PURE__ */ jsx(Field.Control, {
204
+ defaultValue: defaults?.url ?? "",
205
+ placeholder: "http://127.0.0.1:8787/mcp",
206
+ readOnly: readOnlyServer,
207
+ required: true,
208
+ type: "url"
209
+ }),
210
+ /* @__PURE__ */ jsx(Field.Error, {
211
+ match: "valueMissing",
212
+ children: "MCP URL is required."
213
+ }),
214
+ /* @__PURE__ */ jsx(Field.Error, {
215
+ match: "typeMismatch",
216
+ children: "MCP URL must use http or https."
217
+ })
218
+ ]
219
+ }),
220
+ redirectUrlField ? /* @__PURE__ */ jsxs(Field.Root, {
217
221
  name: "redirectUrl",
218
- readOnly: true,
219
- type: "url",
220
- value: redirectUrl
221
- })] }) : null,
222
- credentialFields.map((authField) => /* @__PURE__ */ jsxs(Field.Root, { children: [
223
- /* @__PURE__ */ jsx(Field.Label, { children: authField.label }),
224
- /* @__PURE__ */ jsx(Field.Control, {
225
- autoComplete: "off",
226
- name: authField.name,
227
- placeholder: authField.placeholder,
228
- required: authField.required,
229
- type: authField.inputType ?? "text"
230
- }),
231
- /* @__PURE__ */ jsxs(Field.Error, {
232
- match: "valueMissing",
233
- children: [authField.label, " is required."]
234
- })
235
- ] }, authField.name)),
236
- /* @__PURE__ */ jsxs("div", {
222
+ children: [/* @__PURE__ */ jsx(Field.Label, { children: redirectUrlField.label }), /* @__PURE__ */ jsx(Field.Control, {
223
+ readOnly: true,
224
+ type: "url",
225
+ value: redirectUrl
226
+ })]
227
+ }) : null,
228
+ credentialFields.length > 0 ? /* @__PURE__ */ jsxs(Field.Set, { children: [/* @__PURE__ */ jsx(Field.Legend, {
229
+ variant: "label",
230
+ children: auth?.label ?? "Credentials"
231
+ }), /* @__PURE__ */ jsx(Field.Group, { children: credentialFields.map((authField) => /* @__PURE__ */ jsxs(Field.Root, {
232
+ name: authField.name,
233
+ children: [
234
+ /* @__PURE__ */ jsx(Field.Label, { children: authField.label }),
235
+ /* @__PURE__ */ jsx(Field.Control, {
236
+ autoComplete: "off",
237
+ defaultValue: defaults?.[authField.name],
238
+ placeholder: authField.placeholder,
239
+ required: authField.required,
240
+ type: authField.inputType ?? "text"
241
+ }),
242
+ /* @__PURE__ */ jsxs(Field.Error, {
243
+ match: "valueMissing",
244
+ children: [authField.label, " is required."]
245
+ })
246
+ ]
247
+ }, authField.name)) })] }) : null,
248
+ /* @__PURE__ */ jsx("div", {
237
249
  className: "agent-connect__mcp-form-actions",
238
- children: [/* @__PURE__ */ jsx(Button, {
250
+ children: /* @__PURE__ */ jsx(Button, {
239
251
  type: "submit",
240
252
  size: "sm",
241
- disabled: submitting,
242
- children: submitting ? submittingLabel : submitLabel
243
- }), pendingAuthUrl ? /* @__PURE__ */ jsx(Button, {
244
- type: "button",
245
- variant: "outline",
246
- color: "neutral",
247
- size: "sm",
248
- onClick: () => {
249
- onAuthorize?.();
250
- },
251
- children: authorizeLabel
252
- }) : null]
253
+ disabled: submission === true,
254
+ focusableWhenDisabled: submission === true,
255
+ children: submission === true ? submittingLabel : submitLabel
256
+ })
253
257
  }),
254
- status ? /* @__PURE__ */ jsx("span", {
258
+ typeof submission === "string" ? /* @__PURE__ */ jsx("span", {
259
+ className: "agent-connect__mcp-form-status",
260
+ "aria-atomic": "true",
261
+ role: "alert",
262
+ children: submission
263
+ }) : status ? /* @__PURE__ */ jsx("span", {
255
264
  className: "agent-connect__mcp-form-status",
256
- "aria-live": "polite",
265
+ "aria-atomic": "true",
266
+ role: "status",
257
267
  children: status
258
268
  }) : null
259
269
  ]
@@ -263,18 +273,16 @@ function readMcpConnectorFormValues(data) {
263
273
  const bearerToken = readFormString(data, "bearerToken");
264
274
  const clientId = readFormString(data, "clientId");
265
275
  const clientSecret = readFormString(data, "clientSecret");
266
- const scope = readFormString(data, "scope");
267
276
  return {
268
277
  ...bearerToken ? { bearerToken } : {},
269
278
  ...clientId ? { clientId } : {},
270
279
  ...clientSecret ? { clientSecret } : {},
271
280
  name: readFormString(data, "name"),
272
- ...scope ? { scope } : {},
273
281
  url: readFormString(data, "url")
274
282
  };
275
283
  }
276
284
  function readFormString(data, name) {
277
- const value = data.get(name);
285
+ const value = data[name];
278
286
  return typeof value === "string" ? value.trim() : "";
279
287
  }
280
288
  function isCredentialAuthField(field) {
@@ -0,0 +1,24 @@
1
+ import * as React from "react";
2
+
3
+ //#region src/components/AppFrame.d.ts
4
+ declare function Root({
5
+ className,
6
+ ref,
7
+ ...props
8
+ }: React.HTMLAttributes<HTMLDivElement> & {
9
+ ref?: React.Ref<HTMLDivElement>;
10
+ }): React.JSX.Element;
11
+ declare function Body({
12
+ className,
13
+ ref,
14
+ ...props
15
+ }: React.HTMLAttributes<HTMLDivElement> & {
16
+ ref?: React.Ref<HTMLDivElement>;
17
+ }): React.JSX.Element;
18
+ /** Full-height application frame with a fixed chrome row and contained work surface. */
19
+ declare const AppFrame: {
20
+ Root: typeof Root;
21
+ Body: typeof Body;
22
+ };
23
+ //#endregion
24
+ export { AppFrame };
@@ -0,0 +1,25 @@
1
+ import { t as cx } from "../class-names-9UtZwb0J.js";
2
+ import "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region src/components/AppFrame.tsx
5
+ function Root({ className, ref, ...props }) {
6
+ return /* @__PURE__ */ jsx("div", {
7
+ ref,
8
+ className: cx("app-frame", className),
9
+ ...props
10
+ });
11
+ }
12
+ function Body({ className, ref, ...props }) {
13
+ return /* @__PURE__ */ jsx("div", {
14
+ ref,
15
+ className: cx("app-frame__body", className),
16
+ ...props
17
+ });
18
+ }
19
+ /** Full-height application frame with a fixed chrome row and contained work surface. */
20
+ const AppFrame = {
21
+ Root,
22
+ Body
23
+ };
24
+ //#endregion
25
+ export { AppFrame };
@@ -0,0 +1,71 @@
1
+ import { Toolbar, ToolbarButtonProps, ToolbarGroupProps } from "./Toolbar.js";
2
+ import * as React from "react";
3
+
4
+ //#region src/components/AppTopBar.d.ts
5
+ interface AppTopBarRootProps extends React.ComponentPropsWithoutRef<typeof Toolbar.Root> {
6
+ /** Accessible name describing the controls in this application bar. */
7
+ "aria-label": string;
8
+ }
9
+ interface AppTopBarGroupProps extends ToolbarGroupProps {}
10
+ interface AppTopBarTitleProps extends React.HTMLAttributes<HTMLDivElement> {}
11
+ interface AppTopBarButtonProps extends Omit<ToolbarButtonProps, "aria-label"> {
12
+ /** Accessible name and default tooltip text for the icon-only control. */
13
+ label: string;
14
+ /** Tooltip text when it should differ from the accessible name. */
15
+ tooltip?: React.ReactNode;
16
+ }
17
+ interface AppTopBarControlProps extends ToolbarButtonProps {}
18
+ /**
19
+ * Stable application-level toolbar with composable leading, title, and trailing
20
+ * slots. Descendant buttons share Base UI's roving focus and tooltip provider.
21
+ */
22
+ declare function AppTopBarRoot({
23
+ children,
24
+ className,
25
+ ...props
26
+ }: AppTopBarRootProps): React.JSX.Element;
27
+ declare function AppTopBarLeading({
28
+ className,
29
+ ...props
30
+ }: AppTopBarGroupProps): React.JSX.Element;
31
+ declare function AppTopBarTitle({
32
+ className,
33
+ ref,
34
+ ...props
35
+ }: AppTopBarTitleProps & {
36
+ ref?: React.Ref<HTMLDivElement>;
37
+ }): React.JSX.Element;
38
+ declare function AppTopBarTrailing({
39
+ className,
40
+ ...props
41
+ }: AppTopBarGroupProps): React.JSX.Element;
42
+ declare function AppTopBarControl({
43
+ className,
44
+ ...props
45
+ }: AppTopBarControlProps): React.JSX.Element;
46
+ declare function AppTopBarButton({
47
+ children,
48
+ className,
49
+ disabled,
50
+ label,
51
+ render,
52
+ tooltip,
53
+ ...props
54
+ }: AppTopBarButtonProps): React.JSX.Element;
55
+ /**
56
+ * Composable application top bar with stable leading, title, and trailing
57
+ * slots. Icon controls use shared Toolbar roving focus and coordinated Tooltip
58
+ * behavior; their fixed slots do not resize when state icons change. Render an
59
+ * existing behavior-rich button through `Control` to retain those toolbar
60
+ * semantics without rebuilding the control.
61
+ */
62
+ declare const AppTopBar: {
63
+ Root: typeof AppTopBarRoot;
64
+ Leading: typeof AppTopBarLeading;
65
+ Title: typeof AppTopBarTitle;
66
+ Trailing: typeof AppTopBarTrailing;
67
+ Control: typeof AppTopBarControl;
68
+ Button: typeof AppTopBarButton;
69
+ };
70
+ //#endregion
71
+ export { AppTopBar, AppTopBarButtonProps, AppTopBarControlProps, AppTopBarGroupProps, AppTopBarRootProps, AppTopBarTitleProps };