@mcp-b/react-components 0.14.1 → 0.16.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.
- package/dist/AgentActivity-BNUNrP9O.d.ts +36 -0
- package/dist/{AgentChat-Cgb1xuT7.d.ts → AgentChat-CrlpbvQJ.d.ts} +62 -8
- package/dist/{CodeBlock-DUh9WOGo.d.ts → CodeBlock-BRajW4QU.d.ts} +1 -1
- package/dist/{CodeBlock-BUFXG8HW.js → CodeBlock-BmB4Xaqq.js} +15 -4
- package/dist/{FileTree-mpEIcfzA.js → FileTree-CkVbIMWV.js} +82 -89
- package/dist/Message-BkMdE3bS.js +375 -0
- package/dist/{ModelSelector-DVgVBdvw.js → ModelSelector-SlJNgwKY.js} +17 -8
- package/dist/{PromptInput-ClNqBiIw.d.ts → PromptInput-BWTuXMOD.d.ts} +123 -5
- package/dist/ResponsiveSidebarShell-Dd9DCcBT.d.ts +67 -0
- package/dist/{Select-Dl_vF_Bt.d.ts → Select-BeEsefzh.d.ts} +12 -2
- package/dist/{ThinkChat-7DQ2CogF.js → ThinkChat-CzC-zNGA.js} +27 -37
- package/dist/{ThinkChatActivity-m9orbdeI.d.ts → ThinkChatActivity-BFQnb2ct.d.ts} +3 -10
- package/dist/ThinkChatActivitySummary-BPmu9a-c.d.ts +39 -0
- package/dist/{ThinkChatToolParts-Cv4o7j6F.d.ts → ThinkChatToolParts-CSzVwMXf.d.ts} +62 -3
- package/dist/ThinkExecutionRun-ChhWhOoU.d.ts +30 -0
- package/dist/Toggle-CAAlNl-M.d.ts +69 -0
- package/dist/ToggleGroup-8hPv-b69.d.ts +73 -0
- package/dist/Workspace-D39LxGvP.d.ts +62 -0
- package/dist/WorkspaceFile-DOZkPwzu.d.ts +106 -0
- package/dist/WorkspaceFileView-rSN_yT0L.js +744 -0
- package/dist/WorkspaceLink-DIPbXrUM.js +337 -0
- package/dist/WorkspaceLink-DK1DWMHe.d.ts +89 -0
- package/dist/components/Activity.d.ts +27 -1
- package/dist/components/Activity.js +33 -15
- package/dist/components/AgentActivity.d.ts +2 -0
- package/dist/components/AgentActivity.js +45 -0
- package/dist/components/AgentActivityPreview.d.ts +46 -0
- package/dist/components/AgentActivityPreview.js +94 -0
- package/dist/components/AgentAttention.d.ts +73 -0
- package/dist/components/AgentAttention.js +85 -0
- package/dist/components/AgentChat.d.ts +2 -2
- package/dist/components/AgentChat.js +231 -205
- package/dist/components/AgentChatMessageEditor.d.ts +29 -0
- package/dist/components/AgentChatMessageEditor.js +92 -0
- package/dist/components/AgentChatTurnError.d.ts +17 -0
- package/dist/components/AgentChatTurnError.js +40 -0
- package/dist/components/AgentConnection.d.ts +12 -17
- package/dist/components/AgentConnection.js +99 -91
- package/dist/components/AppFrame.d.ts +24 -0
- package/dist/components/AppFrame.js +25 -0
- package/dist/components/AppTopBar.d.ts +71 -0
- package/dist/components/AppTopBar.js +82 -0
- package/dist/components/Artifact.js +1 -1
- package/dist/components/BrowserLiveView.js +1 -1
- package/dist/components/BrowserReplay.js +1 -1
- package/dist/components/BrowserRunPanel.js +1 -1
- package/dist/components/Card.d.ts +3 -0
- package/dist/components/Card.js +2 -1
- package/dist/components/ChainOfThought.d.ts +1 -1
- package/dist/components/ChainOfThought.js +1 -1
- package/dist/components/ChatGptSignInScreen.js +2 -2
- package/dist/components/Checkbox.js +5 -13
- package/dist/components/CheckboxGroup.d.ts +58 -2
- package/dist/components/CheckboxGroup.js +59 -1
- package/dist/components/CodeBlock.d.ts +1 -1
- package/dist/components/CodeBlock.js +1 -1
- package/dist/components/CodexModelSelector.js +1 -1
- package/dist/components/Commit.js +2 -2
- package/dist/components/ContextMenu.js +1 -1
- package/dist/components/Conversation.js +1 -1
- package/dist/components/DescriptionList.d.ts +12 -0
- package/dist/components/DescriptionList.js +11 -0
- package/dist/components/DescriptionListParts.d.ts +37 -0
- package/dist/components/DescriptionListParts.js +35 -0
- package/dist/components/EnvironmentVariables.js +2 -2
- package/dist/components/Fieldset.d.ts +13 -1
- package/dist/components/Fieldset.js +11 -2
- package/dist/components/FileTree.js +1 -1
- package/dist/components/IconButton.d.ts +33 -0
- package/dist/components/IconButton.js +27 -0
- package/dist/components/McpConnectionRequest.d.ts +44 -0
- package/dist/components/McpConnectionRequest.js +122 -0
- package/dist/components/McpServerPicker.d.ts +48 -23
- package/dist/components/McpServerPicker.js +238 -189
- package/dist/components/Menubar.js +1 -1
- package/dist/components/Message.d.ts +1 -0
- package/dist/components/Message.js +1 -285
- package/dist/components/MessageScroller.js +1 -1
- package/dist/components/ModelSelector.d.ts +15 -3
- package/dist/components/ModelSelector.js +1 -1
- package/dist/components/NaniteScene.d.ts +10 -1
- package/dist/components/NaniteScene.js +36 -1
- package/dist/components/Pricing.d.ts +37 -0
- package/dist/components/Pricing.js +17 -0
- package/dist/components/PricingBillingToggle.d.ts +23 -0
- package/dist/components/PricingBillingToggle.js +86 -0
- package/dist/components/PricingConfirmationDialog.d.ts +25 -0
- package/dist/components/PricingConfirmationDialog.js +57 -0
- package/dist/components/PricingFAQ.d.ts +18 -0
- package/dist/components/PricingFAQ.js +27 -0
- package/dist/components/PricingPage.d.ts +2 -38
- package/dist/components/PricingPage.js +39 -359
- package/dist/components/PricingPlanCard.d.ts +22 -0
- package/dist/components/PricingPlanCard.js +109 -0
- package/dist/components/PricingUsageCalculator.d.ts +22 -0
- package/dist/components/PricingUsageCalculator.js +96 -0
- package/dist/components/PromptInput.d.ts +2 -2
- package/dist/components/PromptInput.js +210 -15
- package/dist/components/Queue.js +1 -1
- package/dist/components/Reasoning.d.ts +2 -1
- package/dist/components/Reasoning.js +14 -29
- package/dist/components/ResizableSidePanel.d.ts +57 -0
- package/dist/components/ResizableSidePanel.js +151 -0
- package/dist/components/ResponsiveSidebarShell.d.ts +2 -0
- package/dist/components/ResponsiveSidebarShell.js +129 -0
- package/dist/components/Select.d.ts +2 -2
- package/dist/components/Select.js +11 -2
- package/dist/components/Slider.d.ts +13 -1
- package/dist/components/Slider.js +11 -0
- package/dist/components/Sources.js +1 -1
- package/dist/components/Stepper.d.ts +4 -0
- package/dist/components/Stepper.js +5 -3
- package/dist/components/SubagentRun.d.ts +86 -0
- package/dist/components/SubagentRun.js +108 -0
- package/dist/components/SubagentRunDetails.d.ts +44 -0
- package/dist/components/SubagentRunDetails.js +48 -0
- package/dist/components/SubagentRunIndicator.d.ts +22 -0
- package/dist/components/SubagentRunIndicator.js +33 -0
- package/dist/components/SubagentRunList.d.ts +25 -0
- package/dist/components/SubagentRunList.js +26 -0
- package/dist/components/SubagentRunSelector.d.ts +47 -0
- package/dist/components/SubagentRunSelector.js +55 -0
- package/dist/components/Task.js +1 -1
- package/dist/components/Terminal.js +2 -2
- package/dist/components/TestResults.js +1 -1
- package/dist/components/Textarea.d.ts +21 -0
- package/dist/components/Textarea.js +19 -0
- package/dist/components/ThemeModeControl.d.ts +24 -0
- package/dist/components/ThemeModeControl.js +52 -0
- package/dist/components/ThemeProvider.d.ts +38 -0
- package/dist/components/ThemeProvider.js +80 -0
- package/dist/components/ThinkChat.d.ts +34 -7
- package/dist/components/ThinkChat.js +7 -4
- package/dist/components/ThinkChatActivity.d.ts +3 -2
- package/dist/components/ThinkChatActivity.js +18 -297
- package/dist/components/ThinkChatActivitySummary.d.ts +2 -0
- package/dist/components/ThinkChatActivitySummary.js +421 -0
- package/dist/components/ThinkChatToolPanels.d.ts +15 -5
- package/dist/components/ThinkChatToolPanels.js +116 -9
- package/dist/components/ThinkChatToolParts.d.ts +2 -2
- package/dist/components/ThinkChatToolParts.js +51 -9
- package/dist/components/ThinkExecutionDetail.d.ts +20 -0
- package/dist/components/ThinkExecutionDetail.js +80 -0
- package/dist/components/ThinkExecutionRun.d.ts +2 -0
- package/dist/components/ThinkExecutionRun.js +72 -0
- package/dist/components/ThinkExecutionStatus.d.ts +22 -0
- package/dist/components/ThinkExecutionStatus.js +36 -0
- package/dist/components/ThinkExecutionWorkbench.d.ts +7 -0
- package/dist/components/ThinkExecutionWorkbench.js +69 -225
- package/dist/components/ThinkFullApp.d.ts +58 -14
- package/dist/components/ThinkFullApp.js +129 -160
- package/dist/components/ThinkFullAppViewSwitch.d.ts +31 -0
- package/dist/components/ThinkFullAppViewSwitch.js +34 -0
- package/dist/components/ThinkRoutine.d.ts +36 -0
- package/dist/components/ThinkRoutine.js +15 -0
- package/dist/components/ThinkRoutineBrowser.d.ts +25 -0
- package/dist/components/ThinkRoutineBrowser.js +156 -0
- package/dist/components/ThinkRoutineDetail.d.ts +24 -0
- package/dist/components/ThinkRoutineDetail.js +102 -0
- package/dist/components/ThinkRoutineForm.d.ts +32 -0
- package/dist/components/ThinkRoutineForm.js +151 -0
- package/dist/components/ThinkRoutineLibrary.d.ts +74 -0
- package/dist/components/ThinkRoutineLibrary.js +178 -0
- package/dist/components/ThinkRoutineRuns.d.ts +24 -0
- package/dist/components/ThinkRoutineRuns.js +68 -0
- package/dist/components/ThinkThreadPicker.d.ts +18 -1
- package/dist/components/ThinkThreadPicker.js +51 -5
- package/dist/components/ThinkThreadShell.d.ts +12 -9
- package/dist/components/ThinkThreadShell.js +17 -137
- package/dist/components/Toggle.d.ts +1 -68
- package/dist/components/ToggleGroup.d.ts +1 -72
- package/dist/components/Tooltip.d.ts +3 -1
- package/dist/components/Tooltip.js +4 -2
- package/dist/components/WebPreview.js +1 -1
- package/dist/components/Workspace.d.ts +2 -0
- package/dist/components/Workspace.js +424 -0
- package/dist/components/WorkspaceBrowser.d.ts +32 -0
- package/dist/components/WorkspaceBrowser.js +103 -0
- package/dist/components/WorkspaceExplorer.d.ts +12 -79
- package/dist/components/WorkspaceExplorer.js +116 -330
- package/dist/components/WorkspaceFile.d.ts +2 -0
- package/dist/components/WorkspaceFile.js +195 -0
- package/dist/components/WorkspaceFileView.d.ts +26 -0
- package/dist/components/WorkspaceFileView.js +2 -0
- package/dist/components/WorkspaceHeader.d.ts +35 -0
- package/dist/components/WorkspaceHeader.js +51 -0
- package/dist/components/WorkspaceLink.d.ts +2 -0
- package/dist/components/WorkspaceLink.js +2 -0
- package/dist/components/icons.d.ts +2 -2
- package/dist/components/icons.js +2 -2
- package/dist/{copy-button-DUMLYdsk.js → copy-button-Dejn5heL.js} +1 -1
- package/dist/icons-CpfUer49.js +85 -0
- package/dist/{icons-CUCz_Sft.d.ts → icons-GQd1xF4e.d.ts} +51 -1
- package/dist/styles/activity-header.css +75 -0
- package/dist/styles/activity.css +49 -63
- package/dist/styles/agent-activity-preview-overlay.css +80 -0
- package/dist/styles/agent-activity-preview.css +235 -0
- package/dist/styles/agent-attention.css +122 -0
- package/dist/styles/agent-chat.css +141 -4
- package/dist/styles/app-frame.css +15 -0
- package/dist/styles/app-top-bar.css +100 -0
- package/dist/styles/avatar.css +0 -1
- package/dist/styles/browser-control-overlay.css +184 -0
- package/dist/styles/card.css +21 -0
- package/dist/styles/checkbox-group.css +69 -0
- package/dist/styles/description-list.css +50 -0
- package/dist/styles/fieldset.css +11 -0
- package/dist/styles/index.css +15 -2
- package/dist/styles/mcp-connection-request.css +60 -0
- package/dist/styles/mcp-server-picker.css +95 -68
- package/dist/styles/message.css +4 -43
- package/dist/styles/nanite-scene.css +16 -0
- package/dist/styles/pricing-page.css +21 -27
- package/dist/styles/prompt-input.css +225 -32
- package/dist/styles/reasoning.css +1 -55
- package/dist/styles/recipes.css +23 -15
- package/dist/styles/resizable-side-panel.css +66 -0
- package/dist/styles/responsive-sidebar-shell.css +169 -0
- package/dist/styles/select.css +10 -0
- package/dist/styles/stepper.css +13 -0
- package/dist/styles/streamdown.css +0 -4
- package/dist/styles/subagent-run.css +205 -0
- package/dist/styles/textarea.css +20 -0
- package/dist/styles/theme-mode-control.css +72 -0
- package/dist/styles/think-execution-status.css +49 -0
- package/dist/styles/think-execution-workbench.css +8 -72
- package/dist/styles/think-full-app.css +106 -131
- package/dist/styles/think-routine-library.css +491 -0
- package/dist/styles/think-thread-picker.css +47 -3
- package/dist/styles/toggle-group.css +7 -0
- package/dist/styles/workspace-explorer.css +511 -64
- package/dist/utils/codex-model-catalog.d.ts +4 -4
- package/dist/utils/mcp-server-catalog.d.ts +82 -78
- package/dist/utils/mcp-server-catalog.js +64 -41
- package/dist/utils/structured-code.d.ts +1 -1
- package/dist/utils/theme.d.ts +22 -0
- package/dist/utils/theme.js +55 -0
- package/package.json +34 -28
- package/dist/icons-Ba9THQKz.js +0 -64
- package/dist/styles/think-resize-handle.css +0 -33
- package/dist/styles/think-thread-shell.css +0 -219
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import { t as cx } from "./class-names-9UtZwb0J.js";
|
|
2
|
+
import { n as ArrowLeftIcon, r as ArrowRightIcon, v as FileIcon } from "./icons-CpfUer49.js";
|
|
3
|
+
import { Button } from "./components/Button.js";
|
|
4
|
+
import { Tooltip } from "./components/Tooltip.js";
|
|
5
|
+
import { c as useWorkspaceNavigationContext, r as resolveWorkspaceLink, t as WorkspaceFileLink } from "./WorkspaceLink-DIPbXrUM.js";
|
|
6
|
+
import { t as AttachmentPreview } from "./attachment-preview-DIs50Q0h.js";
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { cjk } from "@streamdown/cjk";
|
|
10
|
+
import { code } from "@streamdown/code";
|
|
11
|
+
import { math } from "@streamdown/math";
|
|
12
|
+
import { mermaid } from "@streamdown/mermaid";
|
|
13
|
+
import { Streamdown, defaultRehypePlugins } from "streamdown";
|
|
14
|
+
import { visit } from "unist-util-visit";
|
|
15
|
+
//#region src/components/_internal/workspace-markdown.ts
|
|
16
|
+
const WORKSPACE_HARDEN_ORIGIN = "https://workspace.invalid/";
|
|
17
|
+
const workspaceOriginalUrl = Symbol("workspace-original-url");
|
|
18
|
+
function captureWorkspaceUrls() {
|
|
19
|
+
return (tree) => {
|
|
20
|
+
visit(tree, "element", (node) => {
|
|
21
|
+
const property = node.tagName === "a" ? "href" : node.tagName === "img" ? "src" : null;
|
|
22
|
+
const value = property ? node.properties[property] : null;
|
|
23
|
+
if (typeof value === "string") node[workspaceOriginalUrl] = value;
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function isWorkspaceRelativeUrl(value) {
|
|
28
|
+
if (value.startsWith("//")) return false;
|
|
29
|
+
try {
|
|
30
|
+
new URL(value);
|
|
31
|
+
return false;
|
|
32
|
+
} catch {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function restoreWorkspaceUrls({ root, base }) {
|
|
37
|
+
return (tree) => {
|
|
38
|
+
visit(tree, "element", (node) => {
|
|
39
|
+
const workspaceNode = node;
|
|
40
|
+
const originalUrl = workspaceNode[workspaceOriginalUrl];
|
|
41
|
+
delete workspaceNode[workspaceOriginalUrl];
|
|
42
|
+
if (originalUrl === void 0) return;
|
|
43
|
+
if (node.tagName === "img") {
|
|
44
|
+
if (isWorkspaceRelativeUrl(originalUrl)) {
|
|
45
|
+
const alt = typeof node.properties.alt === "string" ? node.properties.alt : "";
|
|
46
|
+
node.tagName = "a";
|
|
47
|
+
node.properties = { href: originalUrl };
|
|
48
|
+
node.children = [{
|
|
49
|
+
type: "text",
|
|
50
|
+
value: alt || "Open linked image"
|
|
51
|
+
}];
|
|
52
|
+
} else if (originalUrl.startsWith("//")) node.properties.src = originalUrl;
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (node.tagName !== "a") return;
|
|
56
|
+
node.properties.href = originalUrl;
|
|
57
|
+
if (resolveWorkspaceLink({
|
|
58
|
+
href: originalUrl,
|
|
59
|
+
root,
|
|
60
|
+
base
|
|
61
|
+
}).kind === "file") {
|
|
62
|
+
delete node.properties.target;
|
|
63
|
+
delete node.properties.rel;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function configureWorkspaceHarden(plugin) {
|
|
69
|
+
if (!Array.isArray(plugin) || typeof plugin[0] !== "function") throw new Error("Streamdown's harden plugin no longer exposes configurable options.");
|
|
70
|
+
const options = plugin[1];
|
|
71
|
+
if (options !== void 0 && (typeof options !== "object" || options === null || Array.isArray(options))) throw new Error("Streamdown's harden plugin options have an unsupported shape.");
|
|
72
|
+
return [plugin[0], {
|
|
73
|
+
...options,
|
|
74
|
+
defaultOrigin: WORKSPACE_HARDEN_ORIGIN
|
|
75
|
+
}];
|
|
76
|
+
}
|
|
77
|
+
const workspaceHardenPlugin = configureWorkspaceHarden(defaultRehypePlugins.harden);
|
|
78
|
+
/** Preserve validated filesystem links through Streamdown's URL hardening pass. */
|
|
79
|
+
function createWorkspaceRehypePlugins(root, base) {
|
|
80
|
+
const plugins = [];
|
|
81
|
+
for (const [name, plugin] of Object.entries(defaultRehypePlugins)) if (name === "harden") plugins.push(captureWorkspaceUrls, workspaceHardenPlugin, [restoreWorkspaceUrls, {
|
|
82
|
+
root,
|
|
83
|
+
base
|
|
84
|
+
}]);
|
|
85
|
+
else plugins.push(plugin);
|
|
86
|
+
return plugins;
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/components/Message.tsx
|
|
90
|
+
/**
|
|
91
|
+
* A chat message row. Aligns and styles itself based on {@link from}.
|
|
92
|
+
* Adapted from Vercel AI Elements and restyled with Sigvelo CSS tokens.
|
|
93
|
+
*
|
|
94
|
+
* Compose with {@link MessageContent} for the bubble, {@link MessageActions}
|
|
95
|
+
* for toolbar actions, and {@link MessageBranch} for multi-version responses.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```tsx
|
|
99
|
+
* <Message from="assistant">
|
|
100
|
+
* <MessageContent>Hello there!</MessageContent>
|
|
101
|
+
* <MessageActions>
|
|
102
|
+
* <MessageAction label="Copy" tooltip="Copy to clipboard">
|
|
103
|
+
* <CopyIcon />
|
|
104
|
+
* </MessageAction>
|
|
105
|
+
* </MessageActions>
|
|
106
|
+
* </Message>
|
|
107
|
+
* ```
|
|
108
|
+
*
|
|
109
|
+
* @see {@link https://elements.ai-sdk.dev/components/message | AI Elements Message}
|
|
110
|
+
*/
|
|
111
|
+
function Message({ className, from = "assistant", children, ref, ...props }) {
|
|
112
|
+
return /* @__PURE__ */ jsx("div", {
|
|
113
|
+
ref,
|
|
114
|
+
className: cx("message", className),
|
|
115
|
+
"data-from": from,
|
|
116
|
+
...props,
|
|
117
|
+
children
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* The visible bubble/body of a message. Styled differently based on the
|
|
122
|
+
* parent {@link Message}'s `from` attribute.
|
|
123
|
+
*/
|
|
124
|
+
function MessageContent({ className, children, ref, ...props }) {
|
|
125
|
+
return /* @__PURE__ */ jsx("div", {
|
|
126
|
+
ref,
|
|
127
|
+
className: cx("message__content", className),
|
|
128
|
+
...props,
|
|
129
|
+
children
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
const streamdownPlugins = {
|
|
133
|
+
cjk,
|
|
134
|
+
code,
|
|
135
|
+
math,
|
|
136
|
+
mermaid
|
|
137
|
+
};
|
|
138
|
+
const messageResponseComponents = { img: "img" };
|
|
139
|
+
const workspaceMessageResponseComponents = {
|
|
140
|
+
...messageResponseComponents,
|
|
141
|
+
a: WorkspaceFileLink
|
|
142
|
+
};
|
|
143
|
+
const MessageResponse = React.memo(function MessageResponse({ className, components, rehypePlugins, ...props }) {
|
|
144
|
+
const workspace = useWorkspaceNavigationContext();
|
|
145
|
+
const defaultComponents = workspace ? workspaceMessageResponseComponents : messageResponseComponents;
|
|
146
|
+
const mergedComponents = components ? {
|
|
147
|
+
...defaultComponents,
|
|
148
|
+
...components
|
|
149
|
+
} : defaultComponents;
|
|
150
|
+
const resolvedRehypePlugins = React.useMemo(() => rehypePlugins ?? (workspace ? createWorkspaceRehypePlugins(workspace.root, workspace.base) : void 0), [
|
|
151
|
+
rehypePlugins,
|
|
152
|
+
workspace?.base.kind,
|
|
153
|
+
workspace?.base.path,
|
|
154
|
+
workspace?.root
|
|
155
|
+
]);
|
|
156
|
+
return /* @__PURE__ */ jsx(Streamdown, {
|
|
157
|
+
className: cx("message__response", className),
|
|
158
|
+
components: mergedComponents,
|
|
159
|
+
plugins: streamdownPlugins,
|
|
160
|
+
rehypePlugins: resolvedRehypePlugins,
|
|
161
|
+
...props
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
/**
|
|
165
|
+
* A `file` part inside a message: images render inline (click to zoom),
|
|
166
|
+
* anything else becomes a download chip. Covers both directions — files the
|
|
167
|
+
* user attached and files the agent emitted.
|
|
168
|
+
*/
|
|
169
|
+
function MessageAttachment({ part, className, ...props }) {
|
|
170
|
+
const name = part.filename ?? (part.mediaType || "attachment");
|
|
171
|
+
if (part.mediaType.startsWith("image/")) return /* @__PURE__ */ jsx(AttachmentPreview, {
|
|
172
|
+
url: part.url,
|
|
173
|
+
filename: part.filename,
|
|
174
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
175
|
+
variant: "ghost",
|
|
176
|
+
color: "neutral",
|
|
177
|
+
className: cx("message__attachment-zoom", className),
|
|
178
|
+
"aria-label": `Preview ${name}`,
|
|
179
|
+
...props,
|
|
180
|
+
children: /* @__PURE__ */ jsx("img", {
|
|
181
|
+
className: "message__attachment-image",
|
|
182
|
+
src: part.url,
|
|
183
|
+
alt: part.filename ?? "Attached image"
|
|
184
|
+
})
|
|
185
|
+
})
|
|
186
|
+
});
|
|
187
|
+
return /* @__PURE__ */ jsxs("a", {
|
|
188
|
+
className: cx("message__attachment", className),
|
|
189
|
+
href: part.url,
|
|
190
|
+
download: part.filename,
|
|
191
|
+
...props,
|
|
192
|
+
children: [/* @__PURE__ */ jsx(FileIcon, { className: "message__attachment-icon" }), /* @__PURE__ */ jsx("span", {
|
|
193
|
+
className: "message__attachment-name",
|
|
194
|
+
children: name
|
|
195
|
+
})]
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Horizontal list of action buttons (copy, retry, thumbs-up, etc.) shown
|
|
200
|
+
* alongside or beneath a message.
|
|
201
|
+
*/
|
|
202
|
+
function MessageActions({ className, children, ref, ...props }) {
|
|
203
|
+
return /* @__PURE__ */ jsx("div", {
|
|
204
|
+
ref,
|
|
205
|
+
className: cx("message__actions", className),
|
|
206
|
+
role: "group",
|
|
207
|
+
...props,
|
|
208
|
+
children
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* A single icon button inside {@link MessageActions}. Always has an accessible
|
|
213
|
+
* name; shows a tooltip on hover/focus when {@link tooltip} is set.
|
|
214
|
+
*/
|
|
215
|
+
function MessageAction({ className, label, tooltip, variant = "ghost", color = "neutral", size = "icon-xs", children, ref, ...props }) {
|
|
216
|
+
const button = /* @__PURE__ */ jsx(Button, {
|
|
217
|
+
ref,
|
|
218
|
+
type: "button",
|
|
219
|
+
variant,
|
|
220
|
+
color,
|
|
221
|
+
size,
|
|
222
|
+
className: cx("message__action", className),
|
|
223
|
+
"aria-label": label ?? tooltip,
|
|
224
|
+
...props,
|
|
225
|
+
children
|
|
226
|
+
});
|
|
227
|
+
if (!tooltip) return button;
|
|
228
|
+
return /* @__PURE__ */ jsxs(Tooltip.Root, { children: [/* @__PURE__ */ jsx(Tooltip.Trigger, { render: button }), /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, {
|
|
229
|
+
sideOffset: 6,
|
|
230
|
+
children: /* @__PURE__ */ jsx(Tooltip.Popup, { children: tooltip })
|
|
231
|
+
}) })] });
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Horizontal container that places children in a row with space between —
|
|
235
|
+
* typically a {@link MessageBranchSelector} on one side and
|
|
236
|
+
* {@link MessageActions} on the other.
|
|
237
|
+
*/
|
|
238
|
+
function MessageToolbar({ className, children, ref, ...props }) {
|
|
239
|
+
return /* @__PURE__ */ jsx("div", {
|
|
240
|
+
ref,
|
|
241
|
+
className: cx("message__toolbar", className),
|
|
242
|
+
...props,
|
|
243
|
+
children
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
const MessageBranchContext = React.createContext(null);
|
|
247
|
+
function useMessageBranch(component) {
|
|
248
|
+
const ctx = React.useContext(MessageBranchContext);
|
|
249
|
+
if (!ctx) throw new Error(`${component} must be used inside a <MessageBranch>.`);
|
|
250
|
+
return ctx;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Container for a message response with multiple versions. Tracks which
|
|
254
|
+
* branch is active and exposes navigation through {@link MessageBranchSelector},
|
|
255
|
+
* {@link MessageBranchPrevious}, {@link MessageBranchNext}, and {@link MessageBranchPage}.
|
|
256
|
+
*/
|
|
257
|
+
function MessageBranch({ className, defaultBranch = 0, branch, onBranchChange, children, ref, ...props }) {
|
|
258
|
+
const [internalIndex, setInternalIndex] = React.useState(defaultBranch);
|
|
259
|
+
const [branchCount, setBranchCount] = React.useState(0);
|
|
260
|
+
const isControlled = branch !== void 0;
|
|
261
|
+
const branchIndex = isControlled ? branch : internalIndex;
|
|
262
|
+
const setBranchIndex = React.useCallback((next) => {
|
|
263
|
+
if (!isControlled) setInternalIndex(next);
|
|
264
|
+
onBranchChange?.(next);
|
|
265
|
+
}, [isControlled, onBranchChange]);
|
|
266
|
+
const ctx = React.useMemo(() => ({
|
|
267
|
+
branchIndex,
|
|
268
|
+
branchCount,
|
|
269
|
+
setBranchIndex,
|
|
270
|
+
registerCount: setBranchCount
|
|
271
|
+
}), [
|
|
272
|
+
branchCount,
|
|
273
|
+
branchIndex,
|
|
274
|
+
setBranchIndex
|
|
275
|
+
]);
|
|
276
|
+
return /* @__PURE__ */ jsx(MessageBranchContext.Provider, {
|
|
277
|
+
value: ctx,
|
|
278
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
279
|
+
ref,
|
|
280
|
+
className: cx("message__branch", className),
|
|
281
|
+
...props,
|
|
282
|
+
children
|
|
283
|
+
})
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Renders only the active branch's child. Expects siblings to represent
|
|
288
|
+
* alternative versions of the same response.
|
|
289
|
+
*/
|
|
290
|
+
function MessageBranchContent({ className, children, ref, ...props }) {
|
|
291
|
+
const { branchIndex, registerCount } = useMessageBranch("MessageBranchContent");
|
|
292
|
+
const items = React.Children.toArray(children);
|
|
293
|
+
React.useEffect(() => {
|
|
294
|
+
registerCount(items.length);
|
|
295
|
+
}, [items.length, registerCount]);
|
|
296
|
+
const safeIndex = items.length === 0 ? 0 : Math.min(Math.max(branchIndex, 0), items.length - 1);
|
|
297
|
+
return /* @__PURE__ */ jsx("div", {
|
|
298
|
+
ref,
|
|
299
|
+
className: cx("message__branch-content", className),
|
|
300
|
+
...props,
|
|
301
|
+
children: items.map((item, index) => /* @__PURE__ */ jsx("div", {
|
|
302
|
+
className: "message__branch-panel",
|
|
303
|
+
hidden: index !== safeIndex,
|
|
304
|
+
children: item
|
|
305
|
+
}, React.isValidElement(item) && item.key != null ? item.key : index))
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Inline group containing branch navigation controls (previous / page /
|
|
310
|
+
* next). Hidden automatically when there is only one branch.
|
|
311
|
+
*/
|
|
312
|
+
function MessageBranchSelector({ className, children, ref, ...props }) {
|
|
313
|
+
const { branchCount } = useMessageBranch("MessageBranchSelector");
|
|
314
|
+
if (branchCount <= 1) return null;
|
|
315
|
+
return /* @__PURE__ */ jsx("div", {
|
|
316
|
+
ref,
|
|
317
|
+
className: cx("message__branch-selector", className),
|
|
318
|
+
...props,
|
|
319
|
+
children
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
/** Button that selects the previous branch. Disabled at the first branch. */
|
|
323
|
+
function MessageBranchPrevious({ className, label = "Previous response", variant = "ghost", color = "neutral", size = "icon-xs", children, onClick, ref, ...props }) {
|
|
324
|
+
const { branchIndex, branchCount, setBranchIndex } = useMessageBranch("MessageBranchPrevious");
|
|
325
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
326
|
+
ref,
|
|
327
|
+
type: "button",
|
|
328
|
+
variant,
|
|
329
|
+
color,
|
|
330
|
+
size,
|
|
331
|
+
disabled: branchCount <= 1,
|
|
332
|
+
className: cx("message__branch-prev", className),
|
|
333
|
+
"aria-label": label,
|
|
334
|
+
onClick: (event) => {
|
|
335
|
+
onClick?.(event);
|
|
336
|
+
if (!event.defaultPrevented) setBranchIndex(branchIndex > 0 ? branchIndex - 1 : branchCount - 1);
|
|
337
|
+
},
|
|
338
|
+
...props,
|
|
339
|
+
children: children ?? /* @__PURE__ */ jsx(ArrowLeftIcon, {})
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
/** Button that selects the next branch. Disabled at the last branch. */
|
|
343
|
+
function MessageBranchNext({ className, label = "Next response", variant = "ghost", color = "neutral", size = "icon-xs", children, onClick, ref, ...props }) {
|
|
344
|
+
const { branchIndex, branchCount, setBranchIndex } = useMessageBranch("MessageBranchNext");
|
|
345
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
346
|
+
ref,
|
|
347
|
+
type: "button",
|
|
348
|
+
variant,
|
|
349
|
+
color,
|
|
350
|
+
size,
|
|
351
|
+
disabled: branchCount <= 1,
|
|
352
|
+
className: cx("message__branch-next", className),
|
|
353
|
+
"aria-label": label,
|
|
354
|
+
onClick: (event) => {
|
|
355
|
+
onClick?.(event);
|
|
356
|
+
if (!event.defaultPrevented) setBranchIndex(branchIndex < branchCount - 1 ? branchIndex + 1 : 0);
|
|
357
|
+
},
|
|
358
|
+
...props,
|
|
359
|
+
children: children ?? /* @__PURE__ */ jsx(ArrowRightIcon, {})
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
/** Page indicator (e.g. "1 / 3") for the current branch selection. */
|
|
363
|
+
function MessageBranchPage({ className, format, ref, ...props }) {
|
|
364
|
+
const { branchIndex, branchCount } = useMessageBranch("MessageBranchPage");
|
|
365
|
+
const label = format ? format(branchIndex + 1, branchCount) : `${branchIndex + 1} / ${branchCount}`;
|
|
366
|
+
return /* @__PURE__ */ jsx("span", {
|
|
367
|
+
ref,
|
|
368
|
+
className: cx("message__branch-page", className),
|
|
369
|
+
"aria-live": "polite",
|
|
370
|
+
...props,
|
|
371
|
+
children: label
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
//#endregion
|
|
375
|
+
export { MessageBranch as a, MessageBranchPage as c, MessageContent as d, MessageResponse as f, MessageAttachment as i, MessageBranchPrevious as l, createWorkspaceRehypePlugins as m, MessageAction as n, MessageBranchContent as o, MessageToolbar as p, MessageActions as r, MessageBranchNext as s, Message as t, MessageBranchSelector as u };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as cx } from "./class-names-9UtZwb0J.js";
|
|
2
|
-
import {
|
|
3
|
-
import { Separator } from "./components/Separator.js";
|
|
2
|
+
import { R as SearchIcon, s as ChevronDownIcon } from "./icons-CpfUer49.js";
|
|
4
3
|
import { Button } from "./components/Button.js";
|
|
4
|
+
import { Separator } from "./components/Separator.js";
|
|
5
5
|
import { Dialog } from "./components/Dialog.js";
|
|
6
6
|
import { Input } from "./components/Input.js";
|
|
7
7
|
import * as React from "react";
|
|
@@ -134,7 +134,11 @@ function readCloudflareModelId(entry) {
|
|
|
134
134
|
const modelId = readCatalogString(entry);
|
|
135
135
|
return modelId && isCloudflareRunnableModelId(modelId) ? modelId : null;
|
|
136
136
|
}
|
|
137
|
-
for (const field of [
|
|
137
|
+
for (const field of [
|
|
138
|
+
"model_id",
|
|
139
|
+
"name",
|
|
140
|
+
"id"
|
|
141
|
+
]) {
|
|
138
142
|
const modelId = readCatalogField(entry, field);
|
|
139
143
|
if (modelId && isCloudflareRunnableModelId(modelId)) return modelId;
|
|
140
144
|
}
|
|
@@ -175,12 +179,17 @@ function normalizeCloudflareModelSelectorModels(models) {
|
|
|
175
179
|
return options;
|
|
176
180
|
}
|
|
177
181
|
async function listCloudflareModelSelectorOptions(client, params) {
|
|
182
|
+
const { account_id, task, per_page = 100 } = params;
|
|
178
183
|
const models = [];
|
|
179
|
-
for
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
+
for (let page = 1;; page += 1) {
|
|
185
|
+
const response = await client.get(`/accounts/${account_id}/ai/catalog/models`, { query: {
|
|
186
|
+
page,
|
|
187
|
+
per_page
|
|
188
|
+
} });
|
|
189
|
+
const pageModels = response.result.filter((model) => !model.private && (!task || model.task === task));
|
|
190
|
+
models.push(...pageModels);
|
|
191
|
+
if (response.result.length < per_page) break;
|
|
192
|
+
}
|
|
184
193
|
return normalizeCloudflareModelSelectorModels(models);
|
|
185
194
|
}
|
|
186
195
|
function groupCloudflareModelOptions(options) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as ButtonProps } from "./Button-FX_hpqxm.js";
|
|
2
|
+
import { _ as SelectSeparatorProps, a as SelectIconProps, c as SelectItemTextProps, d as SelectPopupProps, g as SelectScrollUpArrowProps, h as SelectScrollDownArrowProps, i as SelectGroupProps, l as SelectLabelProps, m as SelectProps, n as SelectBackdropProps, o as SelectItemIndicatorProps, p as SelectPositionerProps, r as SelectGroupLabelProps, s as SelectItemProps, t as Select, u as SelectListProps, v as SelectTriggerProps, y as SelectValueProps } from "./Select-BeEsefzh.js";
|
|
2
3
|
import { i as TabsListProps, n as TabProps, r as Tabs, t as TabPanelProps } from "./Tabs-3Zc4tb9D.js";
|
|
3
4
|
import { t as Combobox } from "./Combobox-B9Fcd6q-.js";
|
|
4
5
|
import { d as MenuProps, s as MenuItemProps, t as Menu } from "./Menu-Bgu-ufb5.js";
|
|
5
|
-
import { r as ButtonProps } from "./Button-FX_hpqxm.js";
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import { ChatAddToolApproveResponseFunction, ChatStatus, DynamicToolUIPart, FileUIPart, ToolUIPart, UIMessage } from "ai";
|
|
8
8
|
import { PendingApproval, Think } from "@cloudflare/think";
|
|
@@ -14,6 +14,8 @@ import { UseVoiceInputReturn } from "@cloudflare/voice/react";
|
|
|
14
14
|
interface PromptInputMessage {
|
|
15
15
|
text: string;
|
|
16
16
|
files: FileUIPart[];
|
|
17
|
+
/** Skill, MCP, or other host-owned references selected in the composer. */
|
|
18
|
+
references?: PromptInputReference[];
|
|
17
19
|
}
|
|
18
20
|
interface AttachmentsContext {
|
|
19
21
|
files: Array<FileUIPart & {
|
|
@@ -335,6 +337,10 @@ interface PromptInputSubmitProps extends Omit<ButtonProps, "children" | "classNa
|
|
|
335
337
|
onStop?: () => void;
|
|
336
338
|
children?: React.ReactNode;
|
|
337
339
|
label?: string;
|
|
340
|
+
/** Allow a composed follow-up to submit while a response is active. */
|
|
341
|
+
allowSubmitWhileBusy?: boolean;
|
|
342
|
+
/** Whether the composer currently contains text, references, or attachments. */
|
|
343
|
+
hasContent?: boolean;
|
|
338
344
|
}
|
|
339
345
|
declare function PromptInputSubmit({
|
|
340
346
|
className,
|
|
@@ -346,6 +352,8 @@ declare function PromptInputSubmit({
|
|
|
346
352
|
onClick,
|
|
347
353
|
children,
|
|
348
354
|
label,
|
|
355
|
+
allowSubmitWhileBusy,
|
|
356
|
+
hasContent,
|
|
349
357
|
ref,
|
|
350
358
|
...props
|
|
351
359
|
}: PromptInputSubmitProps & {
|
|
@@ -416,7 +424,13 @@ declare function PromptInputApproval({
|
|
|
416
424
|
type PromptInputSelectProps = React.ComponentProps<typeof Select.Root>;
|
|
417
425
|
declare const PromptInputSelect: {
|
|
418
426
|
Root: <Value>(props: SelectProps<Value>) => React.JSX.Element;
|
|
419
|
-
Label:
|
|
427
|
+
Label: ({
|
|
428
|
+
className,
|
|
429
|
+
ref,
|
|
430
|
+
...props
|
|
431
|
+
}: SelectLabelProps & {
|
|
432
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
433
|
+
}) => React.JSX.Element;
|
|
420
434
|
Trigger: ({
|
|
421
435
|
size,
|
|
422
436
|
className,
|
|
@@ -719,7 +733,7 @@ declare const PromptInputCommandInput: ({
|
|
|
719
733
|
} & {
|
|
720
734
|
ref?: React.Ref<HTMLInputElement>;
|
|
721
735
|
}) => React.JSX.Element;
|
|
722
|
-
|
|
736
|
+
type PromptInputCommandListProps = React.ComponentPropsWithoutRef<typeof Combobox.List>;
|
|
723
737
|
declare function PromptInputCommandList({
|
|
724
738
|
className,
|
|
725
739
|
ref,
|
|
@@ -747,6 +761,16 @@ declare const PromptInputCommandGroup: ({
|
|
|
747
761
|
} & {
|
|
748
762
|
ref?: React.Ref<HTMLDivElement>;
|
|
749
763
|
}) => React.JSX.Element;
|
|
764
|
+
type PromptInputCommandGroupLabelProps = React.ComponentPropsWithoutRef<typeof Combobox.GroupLabel>;
|
|
765
|
+
declare const PromptInputCommandGroupLabel: ({
|
|
766
|
+
className,
|
|
767
|
+
ref,
|
|
768
|
+
...props
|
|
769
|
+
}: Omit<React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxGroupLabel>, "className"> & {
|
|
770
|
+
className?: string;
|
|
771
|
+
} & {
|
|
772
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
773
|
+
}) => React.JSX.Element;
|
|
750
774
|
type PromptInputCommandItemProps = React.ComponentPropsWithoutRef<typeof Combobox.Item>;
|
|
751
775
|
declare const PromptInputCommandItem: ({
|
|
752
776
|
className,
|
|
@@ -759,5 +783,99 @@ declare const PromptInputCommandItem: ({
|
|
|
759
783
|
}) => React.JSX.Element;
|
|
760
784
|
type PromptInputCommandSeparatorProps = React.ComponentPropsWithoutRef<typeof Combobox.Separator>;
|
|
761
785
|
declare const PromptInputCommandSeparator: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").SeparatorProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
786
|
+
interface PromptInputCommandDefinition {
|
|
787
|
+
/** Stable identity for keyed rendering. */
|
|
788
|
+
id: string;
|
|
789
|
+
/** Stable host-owned command value. Keep it token-safe when using ThinkChat's default submit. */
|
|
790
|
+
value: string;
|
|
791
|
+
label: string;
|
|
792
|
+
description?: string;
|
|
793
|
+
icon?: React.ReactNode;
|
|
794
|
+
keywords?: readonly string[];
|
|
795
|
+
disabled?: boolean;
|
|
796
|
+
group?: string;
|
|
797
|
+
/** Quiet trailing provenance such as a workspace, server, or installation scope. */
|
|
798
|
+
meta?: React.ReactNode;
|
|
799
|
+
}
|
|
800
|
+
type PromptInputCommandTrigger = "/" | "@";
|
|
801
|
+
interface PromptInputReference {
|
|
802
|
+
id: string;
|
|
803
|
+
value: string;
|
|
804
|
+
label: string;
|
|
805
|
+
icon?: React.ReactNode;
|
|
806
|
+
/** Records which picker produced the reference. */
|
|
807
|
+
trigger?: PromptInputCommandTrigger;
|
|
808
|
+
}
|
|
809
|
+
interface PromptInputCommandComposerProps extends Omit<PromptInputTextareaProps, "value" | "defaultValue" | "onChange"> {
|
|
810
|
+
commands: readonly PromptInputCommandDefinition[];
|
|
811
|
+
/** MCP or other mentionable entries revealed by an `@` draft. */
|
|
812
|
+
mentionCommands?: readonly PromptInputCommandDefinition[];
|
|
813
|
+
value: string;
|
|
814
|
+
onValueChange: (value: string) => void;
|
|
815
|
+
onCommandSelect: (command: PromptInputCommandDefinition, trigger: PromptInputCommandTrigger) => void;
|
|
816
|
+
emptyMessage?: React.ReactNode;
|
|
817
|
+
mentionEmptyMessage?: React.ReactNode;
|
|
818
|
+
}
|
|
819
|
+
/**
|
|
820
|
+
* Controlled PromptInput textarea with slash-command discovery. The host owns
|
|
821
|
+
* both the command catalog and the draft policy applied after selection.
|
|
822
|
+
*/
|
|
823
|
+
declare function PromptInputCommandComposer({
|
|
824
|
+
commands,
|
|
825
|
+
mentionCommands,
|
|
826
|
+
value,
|
|
827
|
+
onValueChange,
|
|
828
|
+
onCommandSelect,
|
|
829
|
+
emptyMessage,
|
|
830
|
+
mentionEmptyMessage,
|
|
831
|
+
onKeyDown,
|
|
832
|
+
ref,
|
|
833
|
+
...textareaProps
|
|
834
|
+
}: PromptInputCommandComposerProps & {
|
|
835
|
+
ref?: React.Ref<HTMLTextAreaElement>;
|
|
836
|
+
}): React.JSX.Element;
|
|
837
|
+
interface PromptInputReferencesProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
838
|
+
references: readonly PromptInputReference[];
|
|
839
|
+
onRemove: (reference: PromptInputReference) => void;
|
|
840
|
+
}
|
|
841
|
+
/** Removable inline context selected from slash-command or mention pickers. */
|
|
842
|
+
declare function PromptInputReferences({
|
|
843
|
+
references,
|
|
844
|
+
onRemove,
|
|
845
|
+
className,
|
|
846
|
+
ref,
|
|
847
|
+
...props
|
|
848
|
+
}: PromptInputReferencesProps & {
|
|
849
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
850
|
+
}): React.JSX.Element | null;
|
|
851
|
+
interface PromptInputContextItem {
|
|
852
|
+
/** Exact host identifier or path preserved through selection. */
|
|
853
|
+
value: string;
|
|
854
|
+
label: string;
|
|
855
|
+
/** Full path or other disambiguating context shown in the menu and tooltip. */
|
|
856
|
+
description?: string;
|
|
857
|
+
unavailable?: boolean;
|
|
858
|
+
}
|
|
859
|
+
interface PromptInputContextAction {
|
|
860
|
+
label: string;
|
|
861
|
+
onSelect: () => void;
|
|
862
|
+
}
|
|
863
|
+
interface PromptInputContextSelectorProps {
|
|
864
|
+
items: readonly PromptInputContextItem[];
|
|
865
|
+
value?: string;
|
|
866
|
+
onValueChange: (value: string) => void;
|
|
867
|
+
categoryLabel?: string;
|
|
868
|
+
unavailableLabel?: string;
|
|
869
|
+
action?: PromptInputContextAction;
|
|
870
|
+
}
|
|
871
|
+
/** Controlled composer-footer picker for a host-owned folder or working context. */
|
|
872
|
+
declare function PromptInputContextSelector({
|
|
873
|
+
items,
|
|
874
|
+
value,
|
|
875
|
+
onValueChange,
|
|
876
|
+
categoryLabel,
|
|
877
|
+
unavailableLabel,
|
|
878
|
+
action
|
|
879
|
+
}: PromptInputContextSelectorProps): React.JSX.Element;
|
|
762
880
|
//#endregion
|
|
763
|
-
export {
|
|
881
|
+
export { PromptInputDictation as $, PromptInputCommandComposerProps as A, PromptInputTabLabelProps as At, PromptInputCommandItem as B, TooltipSide as Bt, PromptInputBody as C, PromptInputSubmitProps as Ct, PromptInputButtonTooltip as D, PromptInputTabItem as Dt, PromptInputButtonProps as E, PromptInputTabBodyProps as Et, PromptInputCommandGroupLabel as F, PromptInputTextareaProps as Ft, PromptInputCommandSeparator as G, usePromptInputController as Gt, PromptInputCommandList as H, getApprovalStateKey as Ht, PromptInputCommandGroupLabelProps as I, PromptInputTools as It, PromptInputContextAction as J, PromptInputCommandSeparatorProps as K, useProviderAttachments as Kt, PromptInputCommandGroupProps as L, PromptInputToolsProps as Lt, PromptInputCommandEmpty as M, PromptInputTabsList as Mt, PromptInputCommandEmptyProps as N, PromptInputTabsListProps as Nt, PromptInputCommand as O, PromptInputTabItemProps as Ot, PromptInputCommandGroup as P, PromptInputTextarea as Pt, PromptInputControllerProps as Q, PromptInputCommandInput as R, PromptInputTooltipConfig as Rt, PromptInputAttachmentsProps as S, PromptInputSubmit as St, PromptInputButton as T, PromptInputTabBody as Tt, PromptInputCommandListProps as U, getPendingToolApprovals as Ut, PromptInputCommandItemProps as V, getApprovalRequestId as Vt, PromptInputCommandProps as W, usePromptInputAttachments as Wt, PromptInputContextSelector as X, PromptInputContextItem as Y, PromptInputContextSelectorProps as Z, PromptInputApproval as _, PromptInputReference as _t, PromptInputActionAddAttachments as a, PromptInputHoverCard as at, PromptInputAttachmentProps as b, PromptInputSelect as bt, PromptInputActionAddScreenshotProps as c, PromptInputHoverCardProps as ct, PromptInputActionMenuContentProps as d, PromptInputMessage as dt, PromptInputDictationProps as et, PromptInputActionMenuItem as f, PromptInputPermissionSelector as ft, PromptInputActionMenuTriggerProps as g, PromptInputProviderProps as gt, PromptInputActionMenuTrigger as h, PromptInputProvider as ht, PromptInput as i, PromptInputHeaderProps as it, PromptInputCommandDefinition as j, PromptInputTabProps as jt, PromptInputCommandComposer as k, PromptInputTabLabel as kt, PromptInputActionMenu as l, PromptInputHoverCardTrigger as lt, PromptInputActionMenuProps as m, PromptInputProps as mt, PendingToolApproval as n, PromptInputFooterProps as nt, PromptInputActionAddAttachmentsProps as o, PromptInputHoverCardContent as ot, PromptInputActionMenuItemProps as p, PromptInputPermissionSelectorProps as pt, PromptInputCommandTrigger as q, PermissionMode as r, PromptInputHeader as rt, PromptInputActionAddScreenshot as s, PromptInputHoverCardContentProps as st, AttachmentsContext as t, PromptInputFooter as tt, PromptInputActionMenuContent as u, PromptInputHoverCardTriggerProps as ut, PromptInputApprovalProps as v, PromptInputReferences as vt, PromptInputBodyProps as w, PromptInputTab as wt, PromptInputAttachments as x, PromptInputSelectProps as xt, PromptInputAttachment as y, PromptInputReferencesProps as yt, PromptInputCommandInputProps as z, TextInputContext as zt };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/ResponsiveSidebarShell.d.ts
|
|
4
|
+
interface ResponsiveSidebarShellControls {
|
|
5
|
+
/** Close the sidebar and move focus to the main content. */
|
|
6
|
+
closeSidebar: () => void;
|
|
7
|
+
/** Close only when the shell is currently using its compact drawer layout. */
|
|
8
|
+
closeSidebarOnCompact: () => void;
|
|
9
|
+
}
|
|
10
|
+
interface ResponsiveSidebarShellTopBarControls {
|
|
11
|
+
/** The shell-owned, labelled sidebar toggle to place in a top-bar slot. */
|
|
12
|
+
sidebarToggle: React.ReactNode;
|
|
13
|
+
/** Stable id for a caller-composed compact disclosure trigger. */
|
|
14
|
+
sidebarId: string;
|
|
15
|
+
/** Whether the shared sidebar surface is currently visible. */
|
|
16
|
+
sidebarOpen: boolean;
|
|
17
|
+
/** Toggle the sidebar and remember the invoking control for Escape focus restoration. */
|
|
18
|
+
toggleSidebar: (trigger?: HTMLElement) => void;
|
|
19
|
+
}
|
|
20
|
+
interface ResponsiveSidebarShellProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
21
|
+
/** Navigation or other secondary surface shown beside the selected content. */
|
|
22
|
+
sidebar: React.ReactNode | ((controls: ResponsiveSidebarShellControls) => React.ReactNode);
|
|
23
|
+
/**
|
|
24
|
+
* Optional composable application bar. The render form receives the
|
|
25
|
+
* shell-owned sidebar toggle so callers can place it beside their own icon
|
|
26
|
+
* groups without duplicating drawer behavior.
|
|
27
|
+
*/
|
|
28
|
+
topBar?: React.ReactNode | ((controls: ResponsiveSidebarShellTopBarControls) => React.ReactNode);
|
|
29
|
+
/** Short noun used by the toggle and resize control, such as “threads” or “schedules”. */
|
|
30
|
+
sidebarLabel: string;
|
|
31
|
+
/** Whether the sidebar is open. Omit for internal state. */
|
|
32
|
+
sidebarOpen?: boolean;
|
|
33
|
+
/** Initial sidebar state when `sidebarOpen` is uncontrolled. */
|
|
34
|
+
defaultSidebarOpen?: boolean;
|
|
35
|
+
/** Initial desktop sidebar width in CSS pixels. */
|
|
36
|
+
defaultSidebarWidth?: number;
|
|
37
|
+
/** Called when the sidebar is opened or closed. */
|
|
38
|
+
onSidebarOpenChange?: (open: boolean) => void;
|
|
39
|
+
/** Accessible name for the toolbar containing the sidebar toggle. */
|
|
40
|
+
toolbarLabel?: string;
|
|
41
|
+
/** Accessible name for the mobile preview target that returns to the main content. */
|
|
42
|
+
showMainLabel?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Responsive master-detail shell with a resizable desktop sidebar and a compact
|
|
46
|
+
* floating sidebar that leaves the main content in place as a dismiss target.
|
|
47
|
+
*/
|
|
48
|
+
declare function ResponsiveSidebarShell({
|
|
49
|
+
sidebar,
|
|
50
|
+
topBar,
|
|
51
|
+
sidebarLabel,
|
|
52
|
+
sidebarOpen,
|
|
53
|
+
defaultSidebarOpen,
|
|
54
|
+
defaultSidebarWidth,
|
|
55
|
+
onSidebarOpenChange,
|
|
56
|
+
toolbarLabel,
|
|
57
|
+
showMainLabel,
|
|
58
|
+
className,
|
|
59
|
+
children,
|
|
60
|
+
ref,
|
|
61
|
+
style,
|
|
62
|
+
...props
|
|
63
|
+
}: ResponsiveSidebarShellProps & {
|
|
64
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
65
|
+
}): React.JSX.Element;
|
|
66
|
+
//#endregion
|
|
67
|
+
export { ResponsiveSidebarShellTopBarControls as i, ResponsiveSidebarShellControls as n, ResponsiveSidebarShellProps as r, ResponsiveSidebarShell as t };
|