@uipath/apollo-wind 2.68.0 → 2.69.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/components/ui/code-block.cjs +375 -0
  2. package/dist/components/ui/code-block.d.ts +38 -0
  3. package/dist/components/ui/code-block.js +307 -0
  4. package/dist/components/ui/index.cjs +254 -188
  5. package/dist/components/ui/index.d.ts +6 -0
  6. package/dist/components/ui/index.js +6 -0
  7. package/dist/components/ui/json-tree-view/JsonTree.cjs +2 -2
  8. package/dist/components/ui/json-tree-view/JsonTree.js +1 -1
  9. package/dist/components/ui/json-tree-view/index.cjs +26 -23
  10. package/dist/components/ui/json-tree-view/index.d.ts +2 -2
  11. package/dist/components/ui/json-tree-view/index.js +2 -2
  12. package/dist/components/ui/live-region.cjs +106 -0
  13. package/dist/components/ui/live-region.d.ts +31 -0
  14. package/dist/components/ui/live-region.js +72 -0
  15. package/dist/components/ui/loading-dots.cjs +95 -0
  16. package/dist/components/ui/loading-dots.d.ts +21 -0
  17. package/dist/components/ui/loading-dots.js +55 -0
  18. package/dist/components/ui/markdown.cjs +428 -0
  19. package/dist/components/ui/markdown.d.ts +55 -0
  20. package/dist/components/ui/markdown.js +378 -0
  21. package/dist/components/ui/thinking-indicator.cjs +146 -0
  22. package/dist/components/ui/thinking-indicator.d.ts +38 -0
  23. package/dist/components/ui/thinking-indicator.js +106 -0
  24. package/dist/components/ui/tool-call.cjs +359 -0
  25. package/dist/components/ui/tool-call.d.ts +75 -0
  26. package/dist/components/ui/tool-call.js +301 -0
  27. package/dist/index.cjs +321 -252
  28. package/dist/index.d.ts +12 -0
  29. package/dist/index.js +7 -1
  30. package/dist/styles.css +206 -0
  31. package/dist/tailwind.utilities.css +21 -0
  32. package/package.json +7 -1
  33. /package/dist/{components/ui/json-tree-view → lib}/clipboard.cjs +0 -0
  34. /package/dist/{components/ui/json-tree-view → lib}/clipboard.d.ts +0 -0
  35. /package/dist/{components/ui/json-tree-view → lib}/clipboard.js +0 -0
@@ -0,0 +1,359 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ ToolCallInput: ()=>ToolCallInput,
28
+ ToolCall: ()=>ToolCall,
29
+ ToolCallOutput: ()=>ToolCallOutput,
30
+ ToolCallError: ()=>ToolCallError,
31
+ DEFAULT_TOOL_CALL_STRINGS: ()=>DEFAULT_TOOL_CALL_STRINGS,
32
+ toolCallVariants: ()=>toolCallVariants,
33
+ ToolCallHeader: ()=>ToolCallHeader,
34
+ ToolCallContent: ()=>ToolCallContent,
35
+ ToolCallSection: ()=>ToolCallSection
36
+ });
37
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
38
+ const external_class_variance_authority_namespaceObject = require("class-variance-authority");
39
+ const external_lucide_react_namespaceObject = require("lucide-react");
40
+ const external_react_namespaceObject = require("react");
41
+ const index_cjs_namespaceObject = require("../../lib/index.cjs");
42
+ const external_collapsible_cjs_namespaceObject = require("./collapsible.cjs");
43
+ const external_json_tree_view_index_cjs_namespaceObject = require("./json-tree-view/index.cjs");
44
+ const DEFAULT_TOOL_CALL_STRINGS = {
45
+ pending: 'Pending',
46
+ executing: 'Running',
47
+ completed: 'Completed',
48
+ failed: 'Failed',
49
+ running: (name)=>`Running '${name}'`,
50
+ ran: (name, duration)=>duration ? `Ran '${name}' for ${duration}` : `Ran '${name}'`,
51
+ input: 'Input',
52
+ output: 'Output',
53
+ errors: 'Errors'
54
+ };
55
+ const ToolCallContext = /*#__PURE__*/ external_react_namespaceObject.createContext(null);
56
+ function useToolCallContext(component) {
57
+ const context = external_react_namespaceObject.useContext(ToolCallContext);
58
+ if (!context) throw new Error(`${component} must be used within a ToolCall`);
59
+ return context;
60
+ }
61
+ function mergeStrings(overrides) {
62
+ const merged = {
63
+ ...DEFAULT_TOOL_CALL_STRINGS
64
+ };
65
+ if (!overrides) return merged;
66
+ for (const key of Object.keys(overrides)){
67
+ const value = overrides[key];
68
+ if (void 0 !== value) merged[key] = value;
69
+ }
70
+ return merged;
71
+ }
72
+ const useIsomorphicLayoutEffect = "u" < typeof window ? external_react_namespaceObject.useEffect : external_react_namespaceObject.useLayoutEffect;
73
+ const TOGGLE_CLASSES = 'flex w-full min-w-0 items-center gap-2 rounded p-1 text-left transition-colors hover:text-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring motion-reduce:transition-none';
74
+ const toolCallVariants = (0, external_class_variance_authority_namespaceObject.cva)('group/tool-call flex w-full min-w-0 flex-col text-muted-foreground', {
75
+ variants: {
76
+ size: {
77
+ sm: 'p-2 text-xs',
78
+ md: 'p-3 text-sm'
79
+ }
80
+ },
81
+ defaultVariants: {
82
+ size: 'md'
83
+ }
84
+ });
85
+ const ToolCall = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, status, size = 'md', open, defaultOpen, onOpenChange, strings, jsonTreeStrings, ...props }, ref)=>{
86
+ const [contentCount, setContentCount] = external_react_namespaceObject.useState(0);
87
+ const registerContent = external_react_namespaceObject.useCallback(()=>{
88
+ setContentCount((count)=>count + 1);
89
+ return ()=>setContentCount((count)=>count - 1);
90
+ }, []);
91
+ const context = external_react_namespaceObject.useMemo(()=>({
92
+ status,
93
+ strings: mergeStrings(strings),
94
+ jsonTreeStrings,
95
+ hasContent: contentCount > 0,
96
+ registerContent
97
+ }), [
98
+ status,
99
+ strings,
100
+ jsonTreeStrings,
101
+ contentCount,
102
+ registerContent
103
+ ]);
104
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ToolCallContext.Provider, {
105
+ value: context,
106
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_collapsible_cjs_namespaceObject.Collapsible, {
107
+ asChild: true,
108
+ open: open,
109
+ defaultOpen: defaultOpen,
110
+ onOpenChange: onOpenChange,
111
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
112
+ ref: ref,
113
+ "data-slot": "tool-call",
114
+ "data-status": status,
115
+ "data-size": size,
116
+ className: (0, index_cjs_namespaceObject.cn)(toolCallVariants({
117
+ size
118
+ }), className),
119
+ ...props
120
+ })
121
+ })
122
+ });
123
+ });
124
+ ToolCall.displayName = 'ToolCall';
125
+ const STATUS_ICONS = {
126
+ pending: external_lucide_react_namespaceObject.Clock,
127
+ executing: external_lucide_react_namespaceObject.Loader2,
128
+ completed: external_lucide_react_namespaceObject.CircleCheck,
129
+ failed: external_lucide_react_namespaceObject.CircleX
130
+ };
131
+ const toolCallStatusIconVariants = (0, external_class_variance_authority_namespaceObject.cva)('size-5 shrink-0 group-data-[size=sm]/tool-call:size-4', {
132
+ variants: {
133
+ status: {
134
+ pending: 'text-muted-foreground',
135
+ executing: 'animate-spin text-primary motion-reduce:animate-none',
136
+ completed: 'text-success',
137
+ failed: 'text-destructive'
138
+ }
139
+ }
140
+ });
141
+ const ToolCallHeader = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, name, duration, ...props }, ref)=>{
142
+ const { status, strings, hasContent } = useToolCallContext('ToolCallHeader');
143
+ const StatusIcon = STATUS_ICONS[status];
144
+ const finished = 'completed' === status || 'failed' === status;
145
+ const line = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
146
+ children: [
147
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(StatusIcon, {
148
+ "data-slot": "tool-call-status-icon",
149
+ "aria-hidden": "true",
150
+ className: toolCallStatusIconVariants({
151
+ status
152
+ })
153
+ }),
154
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
155
+ "data-slot": "tool-call-status",
156
+ className: "sr-only",
157
+ children: strings[status]
158
+ }),
159
+ ' ',
160
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
161
+ "data-slot": "tool-call-label",
162
+ className: "min-w-0 wrap-break-word",
163
+ children: finished ? strings.ran(name, duration) : strings.running(name)
164
+ })
165
+ ]
166
+ });
167
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
168
+ ref: ref,
169
+ "data-slot": "tool-call-header",
170
+ className: (0, index_cjs_namespaceObject.cn)('flex min-w-0', className),
171
+ ...props,
172
+ children: hasContent ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_collapsible_cjs_namespaceObject.CollapsibleTrigger, {
173
+ "data-slot": "tool-call-toggle",
174
+ className: (0, index_cjs_namespaceObject.cn)('group/tool-call-toggle', TOGGLE_CLASSES),
175
+ children: [
176
+ line,
177
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronDown, {
178
+ "aria-hidden": "true",
179
+ className: "size-4 shrink-0 transition-transform motion-reduce:transition-none group-data-[state=open]/tool-call-toggle:rotate-180"
180
+ })
181
+ ]
182
+ }) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
183
+ className: "flex min-w-0 items-center gap-2 p-1",
184
+ children: line
185
+ })
186
+ });
187
+ });
188
+ ToolCallHeader.displayName = 'ToolCallHeader';
189
+ const ToolCallContent = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>{
190
+ const { registerContent } = useToolCallContext('ToolCallContent');
191
+ useIsomorphicLayoutEffect(()=>registerContent(), [
192
+ registerContent
193
+ ]);
194
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_collapsible_cjs_namespaceObject.CollapsibleContent, {
195
+ ref: ref,
196
+ "data-slot": "tool-call-content",
197
+ className: (0, index_cjs_namespaceObject.cn)('mt-2 ml-3 flex min-w-0 flex-col border-l pl-3 group-data-[size=sm]/tool-call:ml-2 group-data-[size=sm]/tool-call:pl-2', className),
198
+ ...props
199
+ });
200
+ });
201
+ ToolCallContent.displayName = 'ToolCallContent';
202
+ const ToolCallSection = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, title, open, defaultOpen = false, onOpenChange, children, ...props }, ref)=>{
203
+ useToolCallContext('ToolCallSection');
204
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_collapsible_cjs_namespaceObject.Collapsible, {
205
+ asChild: true,
206
+ open: open,
207
+ defaultOpen: defaultOpen,
208
+ onOpenChange: onOpenChange,
209
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
210
+ ref: ref,
211
+ "data-slot": "tool-call-section",
212
+ className: (0, index_cjs_namespaceObject.cn)('flex min-w-0 flex-col', className),
213
+ ...props,
214
+ children: [
215
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_collapsible_cjs_namespaceObject.CollapsibleTrigger, {
216
+ "data-slot": "tool-call-section-toggle",
217
+ className: (0, index_cjs_namespaceObject.cn)('group/tool-call-section-toggle', TOGGLE_CLASSES),
218
+ children: [
219
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronRight, {
220
+ "aria-hidden": "true",
221
+ className: "size-4 shrink-0 transition-transform motion-reduce:transition-none group-data-[state=open]/tool-call-section-toggle:rotate-90"
222
+ }),
223
+ title
224
+ ]
225
+ }),
226
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_collapsible_cjs_namespaceObject.CollapsibleContent, {
227
+ "data-slot": "tool-call-section-content",
228
+ className: "ml-7 min-w-0",
229
+ children: children
230
+ })
231
+ ]
232
+ })
233
+ });
234
+ });
235
+ ToolCallSection.displayName = 'ToolCallSection';
236
+ function isJsonContainer(value) {
237
+ if (Array.isArray(value)) return true;
238
+ if ('object' != typeof value || null === value) return false;
239
+ const prototype = Object.getPrototypeOf(value);
240
+ return prototype === Object.prototype || null === prototype;
241
+ }
242
+ const VIRTUALIZE_NODE_COUNT = 200;
243
+ function countNodes(nodes) {
244
+ let count = 0;
245
+ const stack = [
246
+ ...nodes
247
+ ];
248
+ while(stack.length > 0){
249
+ const node = stack.pop();
250
+ count += 1;
251
+ if (node.children) stack.push(...node.children);
252
+ }
253
+ return count;
254
+ }
255
+ function ToolCallJsonValue({ value }) {
256
+ const { jsonTreeStrings } = useToolCallContext('ToolCallJsonValue');
257
+ const nodes = external_react_namespaceObject.useMemo(()=>(0, external_json_tree_view_index_cjs_namespaceObject.buildJsonTree)({
258
+ value
259
+ }), [
260
+ value
261
+ ]);
262
+ const [opened, setOpened] = external_react_namespaceObject.useState({});
263
+ const collapsed = external_react_namespaceObject.useMemo(()=>Object.fromEntries((0, external_json_tree_view_index_cjs_namespaceObject.collectContainerPaths)(nodes).map(({ path })=>[
264
+ path,
265
+ !opened[path]
266
+ ])), [
267
+ nodes,
268
+ opened
269
+ ]);
270
+ const toggle = external_react_namespaceObject.useCallback((path)=>setOpened((prev)=>({
271
+ ...prev,
272
+ [path]: !prev[path]
273
+ })), []);
274
+ const virtualized = external_react_namespaceObject.useMemo(()=>countNodes(nodes) > VIRTUALIZE_NODE_COUNT, [
275
+ nodes
276
+ ]);
277
+ const [scrollElement, setScrollElement] = external_react_namespaceObject.useState(null);
278
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
279
+ ref: setScrollElement,
280
+ "data-slot": "tool-call-value",
281
+ className: "my-2 max-h-80 overflow-auto rounded-md border bg-background",
282
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_json_tree_view_index_cjs_namespaceObject.JsonTreeView, {
283
+ nodes: nodes,
284
+ collapsed: collapsed,
285
+ onToggleCollapsed: toggle,
286
+ readOnly: true,
287
+ strings: jsonTreeStrings,
288
+ virtualized: virtualized,
289
+ scrollElement: virtualized ? scrollElement : void 0
290
+ })
291
+ });
292
+ }
293
+ function ToolCallTextValue({ value }) {
294
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
295
+ tabIndex: 0,
296
+ "data-slot": "tool-call-value",
297
+ className: "my-2 max-h-45 overflow-y-auto rounded bg-muted px-3 py-2 text-xs wrap-break-word whitespace-pre-wrap outline-hidden focus-visible:ring-2 focus-visible:ring-ring",
298
+ children: String(value)
299
+ });
300
+ }
301
+ function ToolCallValue({ value, renderValue }) {
302
+ const custom = renderValue?.(value);
303
+ if (void 0 !== custom) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(jsx_runtime_namespaceObject.Fragment, {
304
+ children: custom
305
+ });
306
+ if (!isJsonContainer(value)) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ToolCallTextValue, {
307
+ value: value
308
+ });
309
+ if (0 === Object.keys(value).length) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ToolCallTextValue, {
310
+ value: Array.isArray(value) ? '[]' : '{}'
311
+ });
312
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ToolCallJsonValue, {
313
+ value: value
314
+ });
315
+ }
316
+ function createValueSection(slot, titleKey, displayName) {
317
+ const Section = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ value, renderValue, ...props }, ref)=>{
318
+ const { strings } = useToolCallContext(displayName);
319
+ if (null == value) return null;
320
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ToolCallSection, {
321
+ ref: ref,
322
+ "data-slot": `tool-call-${slot}`,
323
+ title: strings[titleKey],
324
+ ...props,
325
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ToolCallValue, {
326
+ value: value,
327
+ renderValue: renderValue
328
+ })
329
+ });
330
+ });
331
+ Section.displayName = displayName;
332
+ return Section;
333
+ }
334
+ const ToolCallInput = createValueSection('input', 'input', 'ToolCallInput');
335
+ const ToolCallOutput = createValueSection('output', 'output', 'ToolCallOutput');
336
+ const ToolCallError = createValueSection('error', 'errors', 'ToolCallError');
337
+ exports.DEFAULT_TOOL_CALL_STRINGS = __webpack_exports__.DEFAULT_TOOL_CALL_STRINGS;
338
+ exports.ToolCall = __webpack_exports__.ToolCall;
339
+ exports.ToolCallContent = __webpack_exports__.ToolCallContent;
340
+ exports.ToolCallError = __webpack_exports__.ToolCallError;
341
+ exports.ToolCallHeader = __webpack_exports__.ToolCallHeader;
342
+ exports.ToolCallInput = __webpack_exports__.ToolCallInput;
343
+ exports.ToolCallOutput = __webpack_exports__.ToolCallOutput;
344
+ exports.ToolCallSection = __webpack_exports__.ToolCallSection;
345
+ exports.toolCallVariants = __webpack_exports__.toolCallVariants;
346
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
347
+ "DEFAULT_TOOL_CALL_STRINGS",
348
+ "ToolCall",
349
+ "ToolCallContent",
350
+ "ToolCallError",
351
+ "ToolCallHeader",
352
+ "ToolCallInput",
353
+ "ToolCallOutput",
354
+ "ToolCallSection",
355
+ "toolCallVariants"
356
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
357
+ Object.defineProperty(exports, '__esModule', {
358
+ value: true
359
+ });
@@ -0,0 +1,75 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ import * as React from 'react';
3
+ import { CollapsibleContent } from './collapsible';
4
+ import { type JsonTreeViewStrings } from './json-tree-view';
5
+ export type ToolCallStatus = 'pending' | 'executing' | 'completed' | 'failed';
6
+ export interface ToolCallStrings {
7
+ pending: string;
8
+ executing: string;
9
+ completed: string;
10
+ failed: string;
11
+ /** Status line while the call is pending or executing. */
12
+ running: (name: string) => string;
13
+ /** Status line once the call has finished. `duration` is pre-formatted, e.g. "1.23 seconds". */
14
+ ran: (name: string, duration?: string) => string;
15
+ input: string;
16
+ output: string;
17
+ errors: string;
18
+ }
19
+ export declare const DEFAULT_TOOL_CALL_STRINGS: ToolCallStrings;
20
+ declare const toolCallVariants: (props?: ({
21
+ size?: "sm" | "md" | null | undefined;
22
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
23
+ export interface ToolCallProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof toolCallVariants> {
24
+ status: ToolCallStatus;
25
+ /** Controlled open state of the body. */
26
+ open?: boolean;
27
+ /** Initial open state when uncontrolled. */
28
+ defaultOpen?: boolean;
29
+ onOpenChange?: (open: boolean) => void;
30
+ /** Overrides for any subset of the English strings. */
31
+ strings?: Partial<ToolCallStrings>;
32
+ /** Overrides for the JSON tree's strings, merged over any outer `JsonTreeViewProvider`. */
33
+ jsonTreeStrings?: Partial<JsonTreeViewStrings>;
34
+ }
35
+ /**
36
+ * One agent tool call, laid out like the Material ApToolCall: a status line ("Ran 'x' for 1.2
37
+ * seconds") that toggles an indented body of collapsible sections (input, errors, output, or any
38
+ * `ToolCallSection`). The body is not rendered while closed. Omit `ToolCallContent` for a
39
+ * name-only line (the toggle hides itself).
40
+ */
41
+ declare const ToolCall: React.ForwardRefExoticComponent<ToolCallProps & React.RefAttributes<HTMLDivElement>>;
42
+ export interface ToolCallHeaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
43
+ /** Tool name, as it should read inside the status line. */
44
+ name: string;
45
+ /** Pre-formatted elapsed time, e.g. "1.23 seconds". Shown once the call has finished. */
46
+ duration?: string;
47
+ }
48
+ declare const ToolCallHeader: React.ForwardRefExoticComponent<ToolCallHeaderProps & React.RefAttributes<HTMLDivElement>>;
49
+ export type ToolCallContentProps = React.ComponentPropsWithoutRef<typeof CollapsibleContent>;
50
+ declare const ToolCallContent: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-collapsible").CollapsibleContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
51
+ export interface ToolCallSectionProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
52
+ title: React.ReactNode;
53
+ /** Controlled open state. */
54
+ open?: boolean;
55
+ /** Initial open state when uncontrolled. Sections start closed, like ApToolCall's. */
56
+ defaultOpen?: boolean;
57
+ onOpenChange?: (open: boolean) => void;
58
+ }
59
+ /** A collapsible section of the body, for input/output/errors or custom ones such as traces. */
60
+ declare const ToolCallSection: React.ForwardRefExoticComponent<ToolCallSectionProps & React.RefAttributes<HTMLDivElement>>;
61
+ /** Returns a node to replace the default rendering, or `undefined` to keep it. */
62
+ export type ToolCallRenderValue = (value: unknown) => React.ReactNode | undefined;
63
+ export interface ToolCallValueProps extends Omit<ToolCallSectionProps, 'title' | 'children'> {
64
+ /**
65
+ * Arrays and plain objects render as a read-only JSON tree with nested values folded; anything
66
+ * else as text. `undefined` and `null` hide the section, as ApToolCall hides empty data.
67
+ */
68
+ value: unknown;
69
+ /** Custom renderer, e.g. a syntax-highlighted code block. */
70
+ renderValue?: ToolCallRenderValue;
71
+ }
72
+ declare const ToolCallInput: React.ForwardRefExoticComponent<ToolCallValueProps & React.RefAttributes<HTMLDivElement>>;
73
+ declare const ToolCallOutput: React.ForwardRefExoticComponent<ToolCallValueProps & React.RefAttributes<HTMLDivElement>>;
74
+ declare const ToolCallError: React.ForwardRefExoticComponent<ToolCallValueProps & React.RefAttributes<HTMLDivElement>>;
75
+ export { ToolCall, ToolCallHeader, ToolCallContent, ToolCallSection, ToolCallInput, ToolCallOutput, ToolCallError, toolCallVariants, };