@mcp-b/react-components 0.14.2 → 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-DQkqt82e.d.ts → AgentChat-CrlpbvQJ.d.ts} +58 -6
- 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-CPCpFAUt.js → ModelSelector-SlJNgwKY.js} +2 -2
- 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-BPcehdbP.js → ThinkChat-CzC-zNGA.js} +24 -36
- package/dist/{ThinkChatActivity-BmwuIigx.d.ts → ThinkChatActivity-BFQnb2ct.d.ts} +3 -10
- package/dist/ThinkChatActivitySummary-BPmu9a-c.d.ts +39 -0
- package/dist/{ThinkChatToolParts-CDEjqS6A.d.ts → ThinkChatToolParts-CSzVwMXf.d.ts} +13 -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 +224 -200
- 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.js +1 -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 +18 -19
- package/dist/components/SubagentRun.js +25 -18
- 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 +29 -6
- package/dist/components/ThinkChat.js +7 -4
- package/dist/components/ThinkChatActivity.d.ts +3 -2
- package/dist/components/ThinkChatActivity.js +12 -318
- package/dist/components/ThinkChatActivitySummary.d.ts +2 -0
- package/dist/components/ThinkChatActivitySummary.js +421 -0
- package/dist/components/ThinkChatToolPanels.d.ts +7 -5
- package/dist/components/ThinkChatToolPanels.js +70 -8
- package/dist/components/ThinkChatToolParts.d.ts +2 -2
- package/dist/components/ThinkChatToolParts.js +36 -10
- 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 +133 -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 +14 -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/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 +55 -38
- 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 +104 -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/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,151 @@
|
|
|
1
|
+
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
+
import { Separator } from "./Separator.js";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/ResizableSidePanel.tsx
|
|
6
|
+
const ResizableSidePanelContext = React.createContext(null);
|
|
7
|
+
function clampSize(size, minSize, maxSize) {
|
|
8
|
+
return Math.min(maxSize, Math.max(minSize, size));
|
|
9
|
+
}
|
|
10
|
+
function panelSizeDelta(physicalDelta, side, direction) {
|
|
11
|
+
const sideDirection = side === "start" ? 1 : -1;
|
|
12
|
+
const writingDirection = direction === "ltr" ? 1 : -1;
|
|
13
|
+
return physicalDelta * sideDirection * writingDirection;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Shared sizing seam for a logical start- or end-side panel. Consumers retain
|
|
17
|
+
* ownership of panel placement, visibility, compact behavior, and top bars.
|
|
18
|
+
*/
|
|
19
|
+
function ResizableSidePanelRoot({ children, className, defaultSize, keyboardStep = 24, label, maxSize, minSize, onSizeChange, ref, side = "start", style, ...props }) {
|
|
20
|
+
const [size, setInnerSize] = React.useState(() => clampSize(defaultSize, minSize, maxSize));
|
|
21
|
+
const cleanupResizeRef = React.useRef(null);
|
|
22
|
+
const setSize = React.useCallback((nextSize) => {
|
|
23
|
+
const clampedSize = clampSize(nextSize, minSize, maxSize);
|
|
24
|
+
setInnerSize(clampedSize);
|
|
25
|
+
onSizeChange?.(clampedSize);
|
|
26
|
+
}, [
|
|
27
|
+
maxSize,
|
|
28
|
+
minSize,
|
|
29
|
+
onSizeChange
|
|
30
|
+
]);
|
|
31
|
+
const stopResize = React.useCallback(() => {
|
|
32
|
+
cleanupResizeRef.current?.();
|
|
33
|
+
cleanupResizeRef.current = null;
|
|
34
|
+
}, []);
|
|
35
|
+
React.useEffect(() => stopResize, [stopResize]);
|
|
36
|
+
const beginResize = React.useCallback((event) => {
|
|
37
|
+
if (event.button !== 0) return;
|
|
38
|
+
event.preventDefault();
|
|
39
|
+
stopResize();
|
|
40
|
+
const startX = event.clientX;
|
|
41
|
+
const startSize = size;
|
|
42
|
+
const pointerId = event.pointerId;
|
|
43
|
+
const direction = getComputedStyle(event.currentTarget).direction === "rtl" ? "rtl" : "ltr";
|
|
44
|
+
const onMove = (move) => {
|
|
45
|
+
if (move.pointerId !== pointerId) return;
|
|
46
|
+
setSize(startSize + panelSizeDelta(move.clientX - startX, side, direction));
|
|
47
|
+
};
|
|
48
|
+
const onEnd = (end) => {
|
|
49
|
+
if (end.pointerId === pointerId) stopResize();
|
|
50
|
+
};
|
|
51
|
+
const cleanup = () => {
|
|
52
|
+
window.removeEventListener("pointermove", onMove);
|
|
53
|
+
window.removeEventListener("pointerup", onEnd);
|
|
54
|
+
window.removeEventListener("pointercancel", onEnd);
|
|
55
|
+
document.body.classList.remove("is-resizing-side-panel");
|
|
56
|
+
};
|
|
57
|
+
cleanupResizeRef.current = cleanup;
|
|
58
|
+
document.body.classList.add("is-resizing-side-panel");
|
|
59
|
+
window.addEventListener("pointermove", onMove);
|
|
60
|
+
window.addEventListener("pointerup", onEnd);
|
|
61
|
+
window.addEventListener("pointercancel", onEnd);
|
|
62
|
+
}, [
|
|
63
|
+
setSize,
|
|
64
|
+
side,
|
|
65
|
+
size,
|
|
66
|
+
stopResize
|
|
67
|
+
]);
|
|
68
|
+
const context = React.useMemo(() => ({
|
|
69
|
+
beginResize,
|
|
70
|
+
keyboardStep,
|
|
71
|
+
label,
|
|
72
|
+
maxSize,
|
|
73
|
+
minSize,
|
|
74
|
+
setSize,
|
|
75
|
+
side,
|
|
76
|
+
size
|
|
77
|
+
}), [
|
|
78
|
+
beginResize,
|
|
79
|
+
keyboardStep,
|
|
80
|
+
label,
|
|
81
|
+
maxSize,
|
|
82
|
+
minSize,
|
|
83
|
+
setSize,
|
|
84
|
+
side,
|
|
85
|
+
size
|
|
86
|
+
]);
|
|
87
|
+
const rootStyle = {
|
|
88
|
+
...style,
|
|
89
|
+
"--resizable-side-panel-size": `${size}px`
|
|
90
|
+
};
|
|
91
|
+
return /* @__PURE__ */ jsx(ResizableSidePanelContext.Provider, {
|
|
92
|
+
value: context,
|
|
93
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
94
|
+
ref,
|
|
95
|
+
"data-slot": "resizable-side-panel",
|
|
96
|
+
"data-panel-side": side,
|
|
97
|
+
className: cx("resizable-side-panel", className),
|
|
98
|
+
style: rootStyle,
|
|
99
|
+
...props,
|
|
100
|
+
children
|
|
101
|
+
})
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function ResizableSidePanelHandle({ className, onKeyDown, onPointerDown, ref, ...props }) {
|
|
105
|
+
const context = React.useContext(ResizableSidePanelContext);
|
|
106
|
+
if (!context) throw new Error("ResizableSidePanel.Handle must be rendered inside ResizableSidePanel.Root.");
|
|
107
|
+
const { beginResize, keyboardStep, label, maxSize, minSize, setSize, side, size } = context;
|
|
108
|
+
const resizeBy = (physicalDelta, direction) => {
|
|
109
|
+
setSize(size + panelSizeDelta(physicalDelta, side, direction));
|
|
110
|
+
};
|
|
111
|
+
return /* @__PURE__ */ jsx(Separator, {
|
|
112
|
+
...props,
|
|
113
|
+
ref,
|
|
114
|
+
decorative: false,
|
|
115
|
+
orientation: "vertical",
|
|
116
|
+
tabIndex: 0,
|
|
117
|
+
"aria-label": `Resize ${label} panel`,
|
|
118
|
+
"aria-valuemin": minSize,
|
|
119
|
+
"aria-valuemax": maxSize,
|
|
120
|
+
"aria-valuenow": size,
|
|
121
|
+
className: cx("resizable-side-panel__handle", className),
|
|
122
|
+
onPointerDown: (event) => {
|
|
123
|
+
onPointerDown?.(event);
|
|
124
|
+
if (!event.defaultPrevented) beginResize(event);
|
|
125
|
+
},
|
|
126
|
+
onKeyDown: (event) => {
|
|
127
|
+
onKeyDown?.(event);
|
|
128
|
+
if (event.defaultPrevented) return;
|
|
129
|
+
const direction = getComputedStyle(event.currentTarget).direction === "rtl" ? "rtl" : "ltr";
|
|
130
|
+
if (event.key === "ArrowLeft") {
|
|
131
|
+
event.preventDefault();
|
|
132
|
+
resizeBy(-keyboardStep, direction);
|
|
133
|
+
} else if (event.key === "ArrowRight") {
|
|
134
|
+
event.preventDefault();
|
|
135
|
+
resizeBy(keyboardStep, direction);
|
|
136
|
+
} else if (event.key === "Home") {
|
|
137
|
+
event.preventDefault();
|
|
138
|
+
setSize(minSize);
|
|
139
|
+
} else if (event.key === "End") {
|
|
140
|
+
event.preventDefault();
|
|
141
|
+
setSize(maxSize);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
const ResizableSidePanel = {
|
|
147
|
+
Root: ResizableSidePanelRoot,
|
|
148
|
+
Handle: ResizableSidePanelHandle
|
|
149
|
+
};
|
|
150
|
+
//#endregion
|
|
151
|
+
export { ResizableSidePanel };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { i as ResponsiveSidebarShellTopBarControls, n as ResponsiveSidebarShellControls, r as ResponsiveSidebarShellProps, t as ResponsiveSidebarShell } from "../ResponsiveSidebarShell-Dd9DCcBT.js";
|
|
2
|
+
export { ResponsiveSidebarShell, ResponsiveSidebarShellControls, ResponsiveSidebarShellProps, ResponsiveSidebarShellTopBarControls };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
+
import { z as SidebarIcon } from "../icons-CpfUer49.js";
|
|
3
|
+
import { Button } from "./Button.js";
|
|
4
|
+
import { n as mergeRefs } from "../merge-refs-DF_7w2x_.js";
|
|
5
|
+
import { AppTopBar } from "./AppTopBar.js";
|
|
6
|
+
import { ResizableSidePanel } from "./ResizableSidePanel.js";
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/ResponsiveSidebarShell.tsx
|
|
10
|
+
const sidebarDefaultWidth = 256;
|
|
11
|
+
const sidebarMinWidth = 224;
|
|
12
|
+
const sidebarMaxWidth = 384;
|
|
13
|
+
const sidebarKeyboardStep = 24;
|
|
14
|
+
const compactSidebarWidthRem = 56;
|
|
15
|
+
function useControllableSidebar({ sidebarOpen, defaultSidebarOpen, onSidebarOpenChange }) {
|
|
16
|
+
const [innerOpen, setInnerOpen] = React.useState(defaultSidebarOpen ?? true);
|
|
17
|
+
return [sidebarOpen ?? innerOpen, React.useCallback((next) => {
|
|
18
|
+
if (sidebarOpen === void 0) setInnerOpen(next);
|
|
19
|
+
onSidebarOpenChange?.(next);
|
|
20
|
+
}, [sidebarOpen, onSidebarOpenChange])];
|
|
21
|
+
}
|
|
22
|
+
function isCompactSidebar(root) {
|
|
23
|
+
const rootFontSize = Number.parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;
|
|
24
|
+
return root.getBoundingClientRect().width <= compactSidebarWidthRem * rootFontSize;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Responsive master-detail shell with a resizable desktop sidebar and a compact
|
|
28
|
+
* floating sidebar that leaves the main content in place as a dismiss target.
|
|
29
|
+
*/
|
|
30
|
+
function ResponsiveSidebarShell({ sidebar, topBar, sidebarLabel, sidebarOpen, defaultSidebarOpen, defaultSidebarWidth = sidebarDefaultWidth, onSidebarOpenChange, toolbarLabel = "Sidebar controls", showMainLabel = "Show main content", className, children, ref, style, ...props }) {
|
|
31
|
+
const sidebarId = React.useId();
|
|
32
|
+
const rootRef = React.useRef(null);
|
|
33
|
+
const mainRef = React.useRef(null);
|
|
34
|
+
const openerRef = React.useRef(null);
|
|
35
|
+
const [isSidebarOpen, setSidebarOpen] = useControllableSidebar({
|
|
36
|
+
sidebarOpen,
|
|
37
|
+
defaultSidebarOpen,
|
|
38
|
+
onSidebarOpenChange
|
|
39
|
+
});
|
|
40
|
+
const toggleLabel = `${sidebarLabel.charAt(0).toUpperCase()}${sidebarLabel.slice(1)}`;
|
|
41
|
+
const toggleTooltip = `${isSidebarOpen ? "Hide" : "Show"} ${sidebarLabel}`;
|
|
42
|
+
const closeSidebar = React.useCallback(() => {
|
|
43
|
+
setSidebarOpen(false);
|
|
44
|
+
queueMicrotask(() => mainRef.current?.focus({ preventScroll: true }));
|
|
45
|
+
}, [setSidebarOpen]);
|
|
46
|
+
const closeSidebarOnCompact = React.useCallback(() => {
|
|
47
|
+
if (rootRef.current && isCompactSidebar(rootRef.current)) closeSidebar();
|
|
48
|
+
}, [closeSidebar]);
|
|
49
|
+
const toggleSidebar = React.useCallback((trigger) => {
|
|
50
|
+
if (trigger) openerRef.current = trigger;
|
|
51
|
+
setSidebarOpen(!isSidebarOpen);
|
|
52
|
+
}, [isSidebarOpen, setSidebarOpen]);
|
|
53
|
+
const dismissSidebar = React.useCallback(() => {
|
|
54
|
+
setSidebarOpen(false);
|
|
55
|
+
queueMicrotask(() => openerRef.current?.focus({ preventScroll: true }));
|
|
56
|
+
}, [setSidebarOpen]);
|
|
57
|
+
const sidebarContent = typeof sidebar === "function" ? sidebar({
|
|
58
|
+
closeSidebar,
|
|
59
|
+
closeSidebarOnCompact
|
|
60
|
+
}) : sidebar;
|
|
61
|
+
const sidebarToggle = /* @__PURE__ */ jsx(AppTopBar.Button, {
|
|
62
|
+
className: "responsive-sidebar-shell__toggle",
|
|
63
|
+
label: toggleLabel,
|
|
64
|
+
tooltip: toggleTooltip,
|
|
65
|
+
type: "button",
|
|
66
|
+
"aria-controls": sidebarId,
|
|
67
|
+
"aria-expanded": isSidebarOpen,
|
|
68
|
+
onClick: (event) => toggleSidebar(event.currentTarget),
|
|
69
|
+
children: /* @__PURE__ */ jsx(SidebarIcon, {})
|
|
70
|
+
});
|
|
71
|
+
const topBarContent = typeof topBar === "function" ? topBar({
|
|
72
|
+
sidebarId,
|
|
73
|
+
sidebarOpen: isSidebarOpen,
|
|
74
|
+
sidebarToggle,
|
|
75
|
+
toggleSidebar
|
|
76
|
+
}) : topBar;
|
|
77
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
78
|
+
ref: mergeRefs(rootRef, ref),
|
|
79
|
+
className: cx("responsive-sidebar-shell", className),
|
|
80
|
+
style,
|
|
81
|
+
...props,
|
|
82
|
+
onKeyDown: (event) => {
|
|
83
|
+
props.onKeyDown?.(event);
|
|
84
|
+
if (!event.defaultPrevented && event.key === "Escape" && isSidebarOpen && rootRef.current && isCompactSidebar(rootRef.current)) {
|
|
85
|
+
event.preventDefault();
|
|
86
|
+
dismissSidebar();
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
children: [topBarContent ?? /* @__PURE__ */ jsx(AppTopBar.Root, {
|
|
90
|
+
"aria-label": toolbarLabel,
|
|
91
|
+
children: /* @__PURE__ */ jsx(AppTopBar.Leading, { children: sidebarToggle })
|
|
92
|
+
}), /* @__PURE__ */ jsxs(ResizableSidePanel.Root, {
|
|
93
|
+
className: "responsive-sidebar-shell__frame",
|
|
94
|
+
label: sidebarLabel,
|
|
95
|
+
side: "start",
|
|
96
|
+
defaultSize: defaultSidebarWidth,
|
|
97
|
+
minSize: sidebarMinWidth,
|
|
98
|
+
maxSize: sidebarMaxWidth,
|
|
99
|
+
keyboardStep: sidebarKeyboardStep,
|
|
100
|
+
"data-sidebar-open": isSidebarOpen ? "true" : "false",
|
|
101
|
+
children: [
|
|
102
|
+
isSidebarOpen ? /* @__PURE__ */ jsx(ResizableSidePanel.Handle, { className: "responsive-sidebar-shell__resizer" }) : null,
|
|
103
|
+
/* @__PURE__ */ jsx("div", {
|
|
104
|
+
id: sidebarId,
|
|
105
|
+
className: "responsive-sidebar-shell__sidebar",
|
|
106
|
+
"aria-hidden": isSidebarOpen ? void 0 : true,
|
|
107
|
+
inert: isSidebarOpen ? void 0 : true,
|
|
108
|
+
children: sidebarContent
|
|
109
|
+
}),
|
|
110
|
+
/* @__PURE__ */ jsx("div", {
|
|
111
|
+
ref: mainRef,
|
|
112
|
+
className: "responsive-sidebar-shell__main",
|
|
113
|
+
tabIndex: -1,
|
|
114
|
+
children
|
|
115
|
+
}),
|
|
116
|
+
isSidebarOpen ? /* @__PURE__ */ jsx(Button, {
|
|
117
|
+
type: "button",
|
|
118
|
+
variant: "ghost",
|
|
119
|
+
color: "neutral",
|
|
120
|
+
className: "responsive-sidebar-shell__peek",
|
|
121
|
+
"aria-label": showMainLabel,
|
|
122
|
+
onClick: closeSidebar
|
|
123
|
+
}) : null
|
|
124
|
+
]
|
|
125
|
+
})]
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
export { ResponsiveSidebarShell };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
export { Select, SelectBackdropProps, SelectGroupLabelProps, SelectGroupProps, SelectIconProps, SelectItemIndicatorProps, SelectItemProps, SelectItemTextProps, SelectListProps, SelectPopupProps, SelectPortalProps, SelectPositionerProps, SelectProps, SelectScrollDownArrowProps, SelectScrollUpArrowProps, SelectSeparatorProps, SelectTriggerProps, SelectValueProps };
|
|
1
|
+
import { _ as SelectSeparatorProps, a as SelectIconProps, c as SelectItemTextProps, d as SelectPopupProps, f as SelectPortalProps, 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
|
+
export { Select, SelectBackdropProps, SelectGroupLabelProps, SelectGroupProps, SelectIconProps, SelectItemIndicatorProps, SelectItemProps, SelectItemTextProps, SelectLabelProps, SelectListProps, SelectPopupProps, SelectPortalProps, SelectPositionerProps, SelectProps, SelectScrollDownArrowProps, SelectScrollUpArrowProps, SelectSeparatorProps, SelectTriggerProps, SelectValueProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as ArrowUpIcon, o as CheckIcon, t as ArrowDownIcon } from "../icons-CpfUer49.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { Select as Select$1 } from "@base-ui/react/select";
|
|
@@ -34,6 +34,15 @@ function SelectRoot(props) {
|
|
|
34
34
|
...props
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
|
+
function SelectLabel({ className = "", ref, ...props }) {
|
|
38
|
+
const classes = ["select__label", className].filter(Boolean).join(" ");
|
|
39
|
+
return /* @__PURE__ */ jsx(Select$1.Label, {
|
|
40
|
+
ref,
|
|
41
|
+
"data-slot": "select-label",
|
|
42
|
+
className: classes,
|
|
43
|
+
...props
|
|
44
|
+
});
|
|
45
|
+
}
|
|
37
46
|
function SelectTrigger({ size = "default", className = "", ref, ...props }) {
|
|
38
47
|
const normalizedSize = size === "md" ? "default" : size;
|
|
39
48
|
const classes = [
|
|
@@ -203,7 +212,7 @@ function SelectScrollDownArrow({ className = "", children, ref, ...props }) {
|
|
|
203
212
|
}
|
|
204
213
|
const Select = {
|
|
205
214
|
Root: SelectRoot,
|
|
206
|
-
Label:
|
|
215
|
+
Label: SelectLabel,
|
|
207
216
|
Trigger: SelectTrigger,
|
|
208
217
|
Value: SelectValue,
|
|
209
218
|
Icon: SelectIcon,
|
|
@@ -21,6 +21,9 @@ interface SliderOutputProps extends Omit<React.ComponentPropsWithRef<typeof Slid
|
|
|
21
21
|
className?: string;
|
|
22
22
|
children?: (value: number, values: readonly number[], formattedValues: readonly string[]) => React.ReactNode;
|
|
23
23
|
}
|
|
24
|
+
interface SliderLabelProps extends Omit<React.ComponentPropsWithRef<typeof Slider$1.Label>, "className"> {
|
|
25
|
+
className?: string;
|
|
26
|
+
}
|
|
24
27
|
/**
|
|
25
28
|
* A slider component for selecting values from a range.
|
|
26
29
|
*
|
|
@@ -111,8 +114,17 @@ declare function SliderOutput({
|
|
|
111
114
|
}: SliderOutputProps & {
|
|
112
115
|
ref?: React.Ref<HTMLOutputElement>;
|
|
113
116
|
}): React.JSX.Element;
|
|
117
|
+
/** Visible label that participates in Base UI's slider naming relationship. */
|
|
118
|
+
declare function SliderLabel({
|
|
119
|
+
className,
|
|
120
|
+
ref,
|
|
121
|
+
...props
|
|
122
|
+
}: SliderLabelProps & {
|
|
123
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
124
|
+
}): React.JSX.Element;
|
|
114
125
|
declare const Slider: {
|
|
115
126
|
Root: typeof SliderRoot;
|
|
127
|
+
Label: typeof SliderLabel;
|
|
116
128
|
Value: typeof SliderOutput;
|
|
117
129
|
Control: typeof SliderControl;
|
|
118
130
|
Track: typeof SliderTrack;
|
|
@@ -120,4 +132,4 @@ declare const Slider: {
|
|
|
120
132
|
Thumb: typeof SliderThumb;
|
|
121
133
|
};
|
|
122
134
|
//#endregion
|
|
123
|
-
export { Slider, SliderControlProps, SliderIndicatorProps, SliderOutputProps, SliderProps, SliderThumbProps, SliderTrackProps };
|
|
135
|
+
export { Slider, SliderControlProps, SliderIndicatorProps, SliderLabelProps, SliderOutputProps, SliderProps, SliderThumbProps, SliderTrackProps };
|
|
@@ -104,8 +104,19 @@ function SliderOutput({ className = "", children, ref, ...props }) {
|
|
|
104
104
|
children: (formattedValues, values) => typeof children === "function" ? children(values[0] ?? 0, values, formattedValues) : formattedValues.join(" - ")
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
|
+
/** Visible label that participates in Base UI's slider naming relationship. */
|
|
108
|
+
function SliderLabel({ className = "", ref, ...props }) {
|
|
109
|
+
const classes = ["slider__label", className].filter(Boolean).join(" ");
|
|
110
|
+
return /* @__PURE__ */ jsx(Slider$1.Label, {
|
|
111
|
+
ref,
|
|
112
|
+
"data-slot": "slider-label",
|
|
113
|
+
className: classes,
|
|
114
|
+
...props
|
|
115
|
+
});
|
|
116
|
+
}
|
|
107
117
|
const Slider = {
|
|
108
118
|
Root: SliderRoot,
|
|
119
|
+
Label: SliderLabel,
|
|
109
120
|
Value: SliderOutput,
|
|
110
121
|
Control: SliderControl,
|
|
111
122
|
Track: SliderTrack,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Collapsible } from "./Collapsible.js";
|
|
2
2
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
3
|
-
import {
|
|
3
|
+
import { C as LinkIcon, l as ChevronRightIcon } from "../icons-CpfUer49.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/Sources.tsx
|
|
@@ -119,6 +119,7 @@ declare function StepperTrigger({
|
|
|
119
119
|
children,
|
|
120
120
|
disabled,
|
|
121
121
|
id,
|
|
122
|
+
type,
|
|
122
123
|
"aria-controls": ariaControls,
|
|
123
124
|
tabIndex,
|
|
124
125
|
onClick,
|
|
@@ -173,10 +174,13 @@ declare function StepperPanel({
|
|
|
173
174
|
interface StepperContentProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
174
175
|
value: number;
|
|
175
176
|
forceMount?: boolean;
|
|
177
|
+
/** Optional vertical rhythm for direct content children. */
|
|
178
|
+
spacing?: "none" | "compact" | "default";
|
|
176
179
|
}
|
|
177
180
|
declare function StepperContent({
|
|
178
181
|
value,
|
|
179
182
|
forceMount,
|
|
183
|
+
spacing,
|
|
180
184
|
className,
|
|
181
185
|
children,
|
|
182
186
|
id,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import {
|
|
2
|
+
import { B as SpinnerIcon, o as CheckIcon } from "../icons-CpfUer49.js";
|
|
3
3
|
import { t as assignRef } from "../merge-refs-DF_7w2x_.js";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -153,7 +153,7 @@ function StepperItem({ step, completed = false, disabled = false, loading = fals
|
|
|
153
153
|
})
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
-
function StepperTrigger({ className, children, disabled, id, "aria-controls": ariaControls, tabIndex, onClick, onKeyDown, ref, ...props }) {
|
|
156
|
+
function StepperTrigger({ className, children, disabled, id, type = "button", "aria-controls": ariaControls, tabIndex, onClick, onKeyDown, ref, ...props }) {
|
|
157
157
|
const { activeStep, focusFirst, focusLast, focusNext, focusPrev, idPrefix, registerTrigger, setActiveStep } = useStepper();
|
|
158
158
|
const { isDisabled, isLoading, state, step } = useStepItem();
|
|
159
159
|
const isSelected = activeStep === step;
|
|
@@ -213,6 +213,7 @@ function StepperTrigger({ className, children, disabled, id, "aria-controls": ar
|
|
|
213
213
|
onClick: handleClick,
|
|
214
214
|
onKeyDown: handleKeyDown,
|
|
215
215
|
tabIndex: typeof tabIndex === "number" ? tabIndex : isSelected ? 0 : -1,
|
|
216
|
+
type,
|
|
216
217
|
...props,
|
|
217
218
|
children
|
|
218
219
|
});
|
|
@@ -278,7 +279,7 @@ function StepperPanel({ className, ref, ...props }) {
|
|
|
278
279
|
...props
|
|
279
280
|
});
|
|
280
281
|
}
|
|
281
|
-
function StepperContent({ value, forceMount = false, className, children, id, "aria-labelledby": ariaLabelledBy, ref, ...props }) {
|
|
282
|
+
function StepperContent({ value, forceMount = false, spacing = "none", className, children, id, "aria-labelledby": ariaLabelledBy, ref, ...props }) {
|
|
282
283
|
const { activeStep, idPrefix } = useStepper();
|
|
283
284
|
const isActive = activeStep === value;
|
|
284
285
|
if (!forceMount && !isActive) return null;
|
|
@@ -288,6 +289,7 @@ function StepperContent({ value, forceMount = false, className, children, id, "a
|
|
|
288
289
|
id: id ?? `${idPrefix}-panel-${value}`,
|
|
289
290
|
"aria-labelledby": ariaLabelledBy ?? `${idPrefix}-trigger-${value}`,
|
|
290
291
|
className: cx("stepper__content", !isActive && "stepper__content--hidden", className),
|
|
292
|
+
"data-spacing": spacing,
|
|
291
293
|
"data-state": isActive ? "active" : "inactive",
|
|
292
294
|
hidden: !isActive,
|
|
293
295
|
tabIndex: 0,
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Collapsible } from "./Collapsible.js";
|
|
2
2
|
import { BadgeProps } from "./Badge.js";
|
|
3
|
+
import { SubagentRunIndicator, SubagentRunIndicatorProps, getSubagentRunName, getSubagentRunTooltip } from "./SubagentRunIndicator.js";
|
|
4
|
+
import { SubagentRunList, SubagentRunListProps } from "./SubagentRunList.js";
|
|
5
|
+
import { SubagentRunSelector, SubagentRunSelectorProps } from "./SubagentRunSelector.js";
|
|
3
6
|
import { SubagentRunActions, SubagentRunActionsProps, SubagentRunMilestone, SubagentRunMilestoneProps, SubagentRunMilestones, SubagentRunMilestonesProps, SubagentRunProgress, SubagentRunProgressProps } from "./SubagentRunDetails.js";
|
|
4
7
|
import * as React from "react";
|
|
5
8
|
|
|
@@ -7,7 +10,12 @@ import * as React from "react";
|
|
|
7
10
|
interface SubagentRunProps extends Omit<React.ComponentProps<typeof Collapsible.Root>, "className" | "unstyled"> {
|
|
8
11
|
className?: string;
|
|
9
12
|
}
|
|
10
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Transport-neutral inline disclosure for one delegated agent run.
|
|
15
|
+
*
|
|
16
|
+
* @deprecated Retained subagent transcripts should open in an adjacent
|
|
17
|
+
* `ThinkFullApp` workbench panel. Use `SubagentRunSelector` in the transcript.
|
|
18
|
+
*/
|
|
11
19
|
declare function SubagentRun({
|
|
12
20
|
className,
|
|
13
21
|
ref,
|
|
@@ -16,23 +24,10 @@ declare function SubagentRun({
|
|
|
16
24
|
interface SubagentRunTriggerProps extends Omit<React.ComponentProps<typeof Collapsible.Trigger>, "className" | "unstyled"> {
|
|
17
25
|
className?: string;
|
|
18
26
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/** Compact selector for a run whose transcript is rendered in a separate detail surface. */
|
|
24
|
-
declare function SubagentRunSelector({
|
|
25
|
-
className,
|
|
26
|
-
children,
|
|
27
|
-
naniteIndex,
|
|
28
|
-
selected,
|
|
29
|
-
ref,
|
|
30
|
-
type,
|
|
31
|
-
...props
|
|
32
|
-
}: SubagentRunSelectorProps & {
|
|
33
|
-
ref?: React.Ref<HTMLButtonElement>;
|
|
34
|
-
}): React.JSX.Element;
|
|
35
|
-
/** Compact run selector. Use the content for a short preview, not a full child transcript. */
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated Retained subagent transcripts should not expand inline. Use
|
|
29
|
+
* `SubagentRunSelector` and render the child in a `ThinkFullApp` workbench panel.
|
|
30
|
+
*/
|
|
36
31
|
declare function SubagentRunTrigger({
|
|
37
32
|
className,
|
|
38
33
|
children,
|
|
@@ -77,6 +72,10 @@ declare function SubagentRunStatus({
|
|
|
77
72
|
interface SubagentRunContentProps extends Omit<React.ComponentProps<typeof Collapsible.Panel>, "className" | "unstyled"> {
|
|
78
73
|
className?: string;
|
|
79
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* @deprecated Retained subagent transcripts should live in an adjacent
|
|
77
|
+
* `ThinkFullApp` workbench panel, not below the selector.
|
|
78
|
+
*/
|
|
80
79
|
declare function SubagentRunContent({
|
|
81
80
|
className,
|
|
82
81
|
children,
|
|
@@ -84,4 +83,4 @@ declare function SubagentRunContent({
|
|
|
84
83
|
...props
|
|
85
84
|
}: SubagentRunContentProps): React.JSX.Element;
|
|
86
85
|
//#endregion
|
|
87
|
-
export { SubagentRun, SubagentRunActions, type SubagentRunActionsProps, SubagentRunContent, SubagentRunContentProps, SubagentRunDescription, SubagentRunDescriptionProps, SubagentRunHeading, SubagentRunHeadingProps, SubagentRunMilestone, type SubagentRunMilestoneProps, SubagentRunMilestones, type SubagentRunMilestonesProps, SubagentRunProgress, type SubagentRunProgressProps, SubagentRunProps, SubagentRunSelector, SubagentRunSelectorProps, SubagentRunStatus, SubagentRunStatusProps, SubagentRunStatusTone, SubagentRunTitle, SubagentRunTitleProps, SubagentRunTrigger, SubagentRunTriggerProps };
|
|
86
|
+
export { SubagentRun, SubagentRunActions, type SubagentRunActionsProps, SubagentRunContent, SubagentRunContentProps, SubagentRunDescription, SubagentRunDescriptionProps, SubagentRunHeading, SubagentRunHeadingProps, SubagentRunIndicator, type SubagentRunIndicatorProps, SubagentRunList, type SubagentRunListProps, SubagentRunMilestone, type SubagentRunMilestoneProps, SubagentRunMilestones, type SubagentRunMilestonesProps, SubagentRunProgress, type SubagentRunProgressProps, SubagentRunProps, SubagentRunSelector, type SubagentRunSelectorProps, SubagentRunStatus, SubagentRunStatusProps, SubagentRunStatusTone, SubagentRunTitle, SubagentRunTitleProps, SubagentRunTrigger, SubagentRunTriggerProps, getSubagentRunName, getSubagentRunTooltip };
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { Collapsible } from "./Collapsible.js";
|
|
2
2
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
3
|
+
import { Button } from "./Button.js";
|
|
3
4
|
import { Badge } from "./Badge.js";
|
|
4
5
|
import { NaniteMark } from "./NaniteScene.js";
|
|
6
|
+
import { SubagentRunIndicator, getSubagentRunName, getSubagentRunTooltip } from "./SubagentRunIndicator.js";
|
|
7
|
+
import { SubagentRunSelector } from "./SubagentRunSelector.js";
|
|
8
|
+
import { SubagentRunList } from "./SubagentRunList.js";
|
|
5
9
|
import { SubagentRunActions, SubagentRunMilestone, SubagentRunMilestones, SubagentRunProgress } from "./SubagentRunDetails.js";
|
|
6
10
|
import "react";
|
|
7
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
12
|
//#region src/components/SubagentRun.tsx
|
|
9
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Transport-neutral inline disclosure for one delegated agent run.
|
|
15
|
+
*
|
|
16
|
+
* @deprecated Retained subagent transcripts should open in an adjacent
|
|
17
|
+
* `ThinkFullApp` workbench panel. Use `SubagentRunSelector` in the transcript.
|
|
18
|
+
*/
|
|
10
19
|
function SubagentRun({ className, ref, ...props }) {
|
|
11
20
|
return /* @__PURE__ */ jsx(Collapsible.Root, {
|
|
12
21
|
ref,
|
|
@@ -16,27 +25,21 @@ function SubagentRun({ className, ref, ...props }) {
|
|
|
16
25
|
unstyled: true
|
|
17
26
|
});
|
|
18
27
|
}
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
type,
|
|
24
|
-
"data-slot": "subagent-run-selector",
|
|
25
|
-
className: cx("subagent-run__trigger", className),
|
|
26
|
-
"aria-pressed": selected,
|
|
27
|
-
...props,
|
|
28
|
-
children: [/* @__PURE__ */ jsx(NaniteMark, { index: naniteIndex }), /* @__PURE__ */ jsx("span", {
|
|
29
|
-
className: "subagent-run__trigger-content",
|
|
30
|
-
children
|
|
31
|
-
})]
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
/** Compact run selector. Use the content for a short preview, not a full child transcript. */
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Retained subagent transcripts should not expand inline. Use
|
|
30
|
+
* `SubagentRunSelector` and render the child in a `ThinkFullApp` workbench panel.
|
|
31
|
+
*/
|
|
35
32
|
function SubagentRunTrigger({ className, children, ref, ...props }) {
|
|
36
33
|
return /* @__PURE__ */ jsxs(Collapsible.Trigger, {
|
|
37
34
|
ref,
|
|
38
35
|
"data-slot": "subagent-run-trigger",
|
|
39
36
|
className: cx("subagent-run__trigger", className),
|
|
37
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
38
|
+
type: "button",
|
|
39
|
+
variant: "outline",
|
|
40
|
+
color: "neutral",
|
|
41
|
+
size: "sm"
|
|
42
|
+
}),
|
|
40
43
|
...props,
|
|
41
44
|
unstyled: true,
|
|
42
45
|
children: [/* @__PURE__ */ jsx(NaniteMark, {}), /* @__PURE__ */ jsx("span", {
|
|
@@ -84,6 +87,10 @@ function SubagentRunStatus({ className, tone = "active", size = "sm", ...props }
|
|
|
84
87
|
...props
|
|
85
88
|
});
|
|
86
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* @deprecated Retained subagent transcripts should live in an adjacent
|
|
92
|
+
* `ThinkFullApp` workbench panel, not below the selector.
|
|
93
|
+
*/
|
|
87
94
|
function SubagentRunContent({ className, children, ref, ...props }) {
|
|
88
95
|
return /* @__PURE__ */ jsx(Collapsible.Panel, {
|
|
89
96
|
ref,
|
|
@@ -98,4 +105,4 @@ function SubagentRunContent({ className, children, ref, ...props }) {
|
|
|
98
105
|
});
|
|
99
106
|
}
|
|
100
107
|
//#endregion
|
|
101
|
-
export { SubagentRun, SubagentRunActions, SubagentRunContent, SubagentRunDescription, SubagentRunHeading, SubagentRunMilestone, SubagentRunMilestones, SubagentRunProgress, SubagentRunSelector, SubagentRunStatus, SubagentRunTitle, SubagentRunTrigger };
|
|
108
|
+
export { SubagentRun, SubagentRunActions, SubagentRunContent, SubagentRunDescription, SubagentRunHeading, SubagentRunIndicator, SubagentRunList, SubagentRunMilestone, SubagentRunMilestones, SubagentRunProgress, SubagentRunSelector, SubagentRunStatus, SubagentRunTitle, SubagentRunTrigger, getSubagentRunName, getSubagentRunTooltip };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { AgentToolRunPart, AgentToolRunState } from "agents/agent-tools";
|
|
3
|
+
|
|
4
|
+
//#region src/components/SubagentRunIndicator.d.ts
|
|
5
|
+
declare function getSubagentRunName(run: AgentToolRunState): string;
|
|
6
|
+
/** Human-readable detail for a retained run selector's tooltip. */
|
|
7
|
+
declare function getSubagentRunTooltip(run: AgentToolRunState): React.ReactNode;
|
|
8
|
+
interface SubagentRunIndicatorProps<Part extends AgentToolRunPart = AgentToolRunPart> extends Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
9
|
+
/** Complete retained-run state returned by `useAgentToolEvents()`. */
|
|
10
|
+
run: AgentToolRunState<Part>;
|
|
11
|
+
}
|
|
12
|
+
/** Decorative status mark derived from a whole upstream retained-run record. */
|
|
13
|
+
declare function SubagentRunIndicator<Part extends AgentToolRunPart = AgentToolRunPart>({
|
|
14
|
+
className,
|
|
15
|
+
run,
|
|
16
|
+
ref,
|
|
17
|
+
...props
|
|
18
|
+
}: SubagentRunIndicatorProps<Part> & {
|
|
19
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
20
|
+
}): React.JSX.Element;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { SubagentRunIndicator, SubagentRunIndicatorProps, getSubagentRunName, getSubagentRunTooltip };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
+
import { B as SpinnerIcon, U as StopIcon, o as CheckIcon, q as WarningIcon } from "../icons-CpfUer49.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/SubagentRunIndicator.tsx
|
|
6
|
+
function getSubagentRunName(run) {
|
|
7
|
+
return run.display?.name ?? run.agentType;
|
|
8
|
+
}
|
|
9
|
+
/** Human-readable detail for a retained run selector's tooltip. */
|
|
10
|
+
function getSubagentRunTooltip(run) {
|
|
11
|
+
switch (run.status) {
|
|
12
|
+
case "running": return run.progress?.message ?? run.progress?.phase ?? "Running";
|
|
13
|
+
case "completed": return run.summary ?? "Completed";
|
|
14
|
+
case "error": return run.error ?? "Agent run failed";
|
|
15
|
+
case "aborted": return run.error ?? "Agent run stopped";
|
|
16
|
+
case "interrupted": return run.error ?? (run.childStillRunning ? "Interrupted · agent may still be running" : "Interrupted");
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/** Decorative status mark derived from a whole upstream retained-run record. */
|
|
20
|
+
function SubagentRunIndicator({ className, run, ref, ...props }) {
|
|
21
|
+
const icon = run.status === "running" ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : run.status === "completed" ? /* @__PURE__ */ jsx(CheckIcon, {}) : run.status === "aborted" ? /* @__PURE__ */ jsx(StopIcon, {}) : /* @__PURE__ */ jsx(WarningIcon, {});
|
|
22
|
+
return /* @__PURE__ */ jsx("span", {
|
|
23
|
+
ref,
|
|
24
|
+
"data-slot": "subagent-run-indicator",
|
|
25
|
+
"data-status": run.status,
|
|
26
|
+
className: cx("subagent-run__indicator", className),
|
|
27
|
+
...props,
|
|
28
|
+
"aria-hidden": "true",
|
|
29
|
+
children: icon
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { SubagentRunIndicator, getSubagentRunName, getSubagentRunTooltip };
|