@rodrigocoliveira/agno-react 1.1.6 → 1.3.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/README.md +0 -3
- package/dist/hooks/useAgnoComponents.d.ts +54 -0
- package/dist/hooks/useAgnoComponents.d.ts.map +1 -0
- package/dist/hooks/useAgnoSessionState.d.ts +28 -0
- package/dist/hooks/useAgnoSessionState.d.ts.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +384 -130
- package/dist/index.js.map +6 -4
- package/dist/index.mjs +384 -130
- package/dist/index.mjs.map +6 -4
- package/dist/ui/composed/agno-chat/index.d.ts +0 -4
- package/dist/ui/composed/agno-chat/index.d.ts.map +1 -1
- package/dist/ui/composed/index.d.ts +2 -2
- package/dist/ui/composed/index.d.ts.map +1 -1
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui.js +947 -1011
- package/dist/ui.js.map +4 -5
- package/dist/ui.mjs +947 -1011
- package/dist/ui.mjs.map +4 -5
- package/package.json +4 -4
- package/dist/ui/composed/agno-chat/tool-status.d.ts +0 -5
- package/dist/ui/composed/agno-chat/tool-status.d.ts.map +0 -1
package/dist/ui.mjs
CHANGED
|
@@ -117,7 +117,7 @@ function isPreviewable(mimeType) {
|
|
|
117
117
|
import * as React from "react";
|
|
118
118
|
import { Slot } from "@radix-ui/react-slot";
|
|
119
119
|
import { cva } from "class-variance-authority";
|
|
120
|
-
import {
|
|
120
|
+
import { jsx } from "react/jsx-runtime";
|
|
121
121
|
var buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", {
|
|
122
122
|
variants: {
|
|
123
123
|
variant: {
|
|
@@ -142,16 +142,16 @@ var buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespa
|
|
|
142
142
|
});
|
|
143
143
|
var Button = React.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
144
144
|
const Comp = asChild ? Slot : "button";
|
|
145
|
-
return /* @__PURE__ */
|
|
145
|
+
return /* @__PURE__ */ jsx(Comp, {
|
|
146
146
|
className: cn(buttonVariants({ variant, size, className })),
|
|
147
147
|
ref,
|
|
148
148
|
...props
|
|
149
|
-
}
|
|
149
|
+
});
|
|
150
150
|
});
|
|
151
151
|
Button.displayName = "Button";
|
|
152
152
|
// src/ui/primitives/badge.tsx
|
|
153
153
|
import { cva as cva2 } from "class-variance-authority";
|
|
154
|
-
import {
|
|
154
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
155
155
|
var badgeVariants = cva2("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", {
|
|
156
156
|
variants: {
|
|
157
157
|
variant: {
|
|
@@ -166,61 +166,61 @@ var badgeVariants = cva2("inline-flex items-center rounded-md border px-2.5 py-0
|
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
168
|
function Badge({ className, variant, ...props }) {
|
|
169
|
-
return /* @__PURE__ */
|
|
169
|
+
return /* @__PURE__ */ jsx2("div", {
|
|
170
170
|
className: cn(badgeVariants({ variant }), className),
|
|
171
171
|
...props
|
|
172
|
-
}
|
|
172
|
+
});
|
|
173
173
|
}
|
|
174
174
|
// src/ui/primitives/avatar.tsx
|
|
175
175
|
import * as React2 from "react";
|
|
176
176
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
177
|
-
import {
|
|
178
|
-
var Avatar = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
177
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
178
|
+
var Avatar = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(AvatarPrimitive.Root, {
|
|
179
179
|
ref,
|
|
180
180
|
className: cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className),
|
|
181
181
|
...props
|
|
182
|
-
}
|
|
182
|
+
}));
|
|
183
183
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
184
|
-
var AvatarImage = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
184
|
+
var AvatarImage = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(AvatarPrimitive.Image, {
|
|
185
185
|
ref,
|
|
186
186
|
className: cn("aspect-square h-full w-full", className),
|
|
187
187
|
...props
|
|
188
|
-
}
|
|
188
|
+
}));
|
|
189
189
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
190
|
-
var AvatarFallback = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
190
|
+
var AvatarFallback = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(AvatarPrimitive.Fallback, {
|
|
191
191
|
ref,
|
|
192
192
|
className: cn("flex h-full w-full items-center justify-center rounded-full bg-muted", className),
|
|
193
193
|
...props
|
|
194
|
-
}
|
|
194
|
+
}));
|
|
195
195
|
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
196
196
|
// src/ui/primitives/input-group.tsx
|
|
197
197
|
import * as React3 from "react";
|
|
198
198
|
import { cva as cva3 } from "class-variance-authority";
|
|
199
|
-
import {
|
|
199
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
200
200
|
var Input = React3.forwardRef(({ className, type, ...props }, ref) => {
|
|
201
|
-
return /* @__PURE__ */
|
|
201
|
+
return /* @__PURE__ */ jsx4("input", {
|
|
202
202
|
type,
|
|
203
203
|
className: cn("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", className),
|
|
204
204
|
ref,
|
|
205
205
|
...props
|
|
206
|
-
}
|
|
206
|
+
});
|
|
207
207
|
});
|
|
208
208
|
Input.displayName = "Input";
|
|
209
209
|
var Textarea = React3.forwardRef(({ className, ...props }, ref) => {
|
|
210
|
-
return /* @__PURE__ */
|
|
210
|
+
return /* @__PURE__ */ jsx4("textarea", {
|
|
211
211
|
className: cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", className),
|
|
212
212
|
ref,
|
|
213
213
|
...props
|
|
214
|
-
}
|
|
214
|
+
});
|
|
215
215
|
});
|
|
216
216
|
Textarea.displayName = "Textarea";
|
|
217
217
|
function InputGroup({ className, ...props }) {
|
|
218
|
-
return /* @__PURE__ */
|
|
218
|
+
return /* @__PURE__ */ jsx4("div", {
|
|
219
219
|
"data-slot": "input-group",
|
|
220
220
|
role: "group",
|
|
221
221
|
className: cn("group/input-group border-input dark:bg-input/30 shadow-xs relative flex w-full items-center rounded-md border outline-none transition-[color,box-shadow]", "h-9 has-[>textarea]:h-auto", "has-[>[data-align=inline-start]]:[&>input]:pl-2", "has-[>[data-align=inline-end]]:[&>input]:pr-2", "has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3", "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-2.5", "has-[[data-slot=input-group-control]:focus-visible]:ring-ring has-[[data-slot=input-group-control]:focus-visible]:ring-1", "has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40", className),
|
|
222
222
|
...props
|
|
223
|
-
}
|
|
223
|
+
});
|
|
224
224
|
}
|
|
225
225
|
var inputGroupAddonVariants = cva3("text-muted-foreground flex h-auto cursor-text select-none items-center justify-center gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4", {
|
|
226
226
|
variants: {
|
|
@@ -240,7 +240,7 @@ function InputGroupAddon({
|
|
|
240
240
|
align = "inline-start",
|
|
241
241
|
...props
|
|
242
242
|
}) {
|
|
243
|
-
return /* @__PURE__ */
|
|
243
|
+
return /* @__PURE__ */ jsx4("div", {
|
|
244
244
|
role: "group",
|
|
245
245
|
"data-slot": "input-group-addon",
|
|
246
246
|
"data-align": align,
|
|
@@ -252,7 +252,7 @@ function InputGroupAddon({
|
|
|
252
252
|
e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
253
253
|
},
|
|
254
254
|
...props
|
|
255
|
-
}
|
|
255
|
+
});
|
|
256
256
|
}
|
|
257
257
|
var inputGroupButtonVariants = cva3("flex items-center gap-2 text-sm shadow-none", {
|
|
258
258
|
variants: {
|
|
@@ -274,33 +274,33 @@ function InputGroupButton({
|
|
|
274
274
|
size = "xs",
|
|
275
275
|
...props
|
|
276
276
|
}) {
|
|
277
|
-
return /* @__PURE__ */
|
|
277
|
+
return /* @__PURE__ */ jsx4(Button, {
|
|
278
278
|
type,
|
|
279
279
|
"data-size": size,
|
|
280
280
|
variant,
|
|
281
281
|
className: cn(inputGroupButtonVariants({ size }), className),
|
|
282
282
|
...props
|
|
283
|
-
}
|
|
283
|
+
});
|
|
284
284
|
}
|
|
285
285
|
function InputGroupText({ className, ...props }) {
|
|
286
|
-
return /* @__PURE__ */
|
|
286
|
+
return /* @__PURE__ */ jsx4("span", {
|
|
287
287
|
className: cn("text-muted-foreground flex items-center gap-2 text-sm [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none", className),
|
|
288
288
|
...props
|
|
289
|
-
}
|
|
289
|
+
});
|
|
290
290
|
}
|
|
291
291
|
function InputGroupInput({ className, ...props }) {
|
|
292
|
-
return /* @__PURE__ */
|
|
292
|
+
return /* @__PURE__ */ jsx4(Input, {
|
|
293
293
|
"data-slot": "input-group-control",
|
|
294
294
|
className: cn("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent", className),
|
|
295
295
|
...props
|
|
296
|
-
}
|
|
296
|
+
});
|
|
297
297
|
}
|
|
298
298
|
function InputGroupTextarea({ className, ...props }) {
|
|
299
|
-
return /* @__PURE__ */
|
|
299
|
+
return /* @__PURE__ */ jsx4(Textarea, {
|
|
300
300
|
"data-slot": "input-group-control",
|
|
301
301
|
className: cn("flex-1 resize-none rounded-none border-0 bg-transparent min-h-0 pt-3.5 pb-1.5 pl-3.5 shadow-none focus-visible:ring-0 dark:bg-transparent", className),
|
|
302
302
|
...props
|
|
303
|
-
}
|
|
303
|
+
});
|
|
304
304
|
}
|
|
305
305
|
// src/ui/primitives/collapsible.tsx
|
|
306
306
|
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
@@ -310,318 +310,318 @@ var CollapsibleContent2 = CollapsiblePrimitive.CollapsibleContent;
|
|
|
310
310
|
// src/ui/primitives/tooltip.tsx
|
|
311
311
|
import * as React4 from "react";
|
|
312
312
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
313
|
-
import {
|
|
313
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
314
314
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
315
315
|
var Tooltip = TooltipPrimitive.Root;
|
|
316
316
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
317
|
-
var TooltipContent = React4.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */
|
|
318
|
-
children: /* @__PURE__ */
|
|
317
|
+
var TooltipContent = React4.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx5(TooltipPrimitive.Portal, {
|
|
318
|
+
children: /* @__PURE__ */ jsx5(TooltipPrimitive.Content, {
|
|
319
319
|
ref,
|
|
320
320
|
sideOffset,
|
|
321
321
|
className: cn("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]", className),
|
|
322
322
|
...props
|
|
323
|
-
}
|
|
324
|
-
}
|
|
323
|
+
})
|
|
324
|
+
}));
|
|
325
325
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
326
326
|
// src/ui/primitives/accordion.tsx
|
|
327
327
|
import * as React5 from "react";
|
|
328
328
|
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
329
329
|
import { ChevronDown } from "lucide-react";
|
|
330
|
-
import {
|
|
330
|
+
import { jsx as jsx6, jsxs } from "react/jsx-runtime";
|
|
331
331
|
var Accordion = AccordionPrimitive.Root;
|
|
332
|
-
var AccordionItem = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
332
|
+
var AccordionItem = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(AccordionPrimitive.Item, {
|
|
333
333
|
ref,
|
|
334
334
|
className: cn("border-b", className),
|
|
335
335
|
...props
|
|
336
|
-
}
|
|
336
|
+
}));
|
|
337
337
|
AccordionItem.displayName = "AccordionItem";
|
|
338
|
-
var AccordionTrigger = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
338
|
+
var AccordionTrigger = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx6(AccordionPrimitive.Header, {
|
|
339
339
|
className: "flex",
|
|
340
|
-
children: /* @__PURE__ */
|
|
340
|
+
children: /* @__PURE__ */ jsxs(AccordionPrimitive.Trigger, {
|
|
341
341
|
ref,
|
|
342
342
|
className: cn("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline text-left [&[data-state=open]>svg]:rotate-180", className),
|
|
343
343
|
...props,
|
|
344
344
|
children: [
|
|
345
345
|
children,
|
|
346
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ jsx6(ChevronDown, {
|
|
347
347
|
className: "h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"
|
|
348
|
-
}
|
|
348
|
+
})
|
|
349
349
|
]
|
|
350
|
-
}
|
|
351
|
-
}
|
|
350
|
+
})
|
|
351
|
+
}));
|
|
352
352
|
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
353
|
-
var AccordionContent = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
353
|
+
var AccordionContent = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx6(AccordionPrimitive.Content, {
|
|
354
354
|
ref,
|
|
355
355
|
className: "overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
|
|
356
356
|
...props,
|
|
357
|
-
children: /* @__PURE__ */
|
|
357
|
+
children: /* @__PURE__ */ jsx6("div", {
|
|
358
358
|
className: cn("pb-4 pt-0", className),
|
|
359
359
|
children
|
|
360
|
-
}
|
|
361
|
-
}
|
|
360
|
+
})
|
|
361
|
+
}));
|
|
362
362
|
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
363
363
|
// src/ui/primitives/dropdown-menu.tsx
|
|
364
364
|
import * as React6 from "react";
|
|
365
365
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
366
366
|
import { Check, ChevronRight, Circle } from "lucide-react";
|
|
367
|
-
import {
|
|
367
|
+
import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
368
368
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
369
369
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
370
370
|
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
371
371
|
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
372
372
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
373
373
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
374
|
-
var DropdownMenuSubTrigger = React6.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */
|
|
374
|
+
var DropdownMenuSubTrigger = React6.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs2(DropdownMenuPrimitive.SubTrigger, {
|
|
375
375
|
ref,
|
|
376
376
|
className: cn("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", inset && "pl-8", className),
|
|
377
377
|
...props,
|
|
378
378
|
children: [
|
|
379
379
|
children,
|
|
380
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ jsx7(ChevronRight, {
|
|
381
381
|
className: "ml-auto"
|
|
382
|
-
}
|
|
382
|
+
})
|
|
383
383
|
]
|
|
384
|
-
}
|
|
384
|
+
}));
|
|
385
385
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
386
|
-
var DropdownMenuSubContent = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
386
|
+
var DropdownMenuSubContent = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx7(DropdownMenuPrimitive.SubContent, {
|
|
387
387
|
ref,
|
|
388
388
|
className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]", className),
|
|
389
389
|
...props
|
|
390
|
-
}
|
|
390
|
+
}));
|
|
391
391
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
392
|
-
var DropdownMenuContent = React6.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */
|
|
393
|
-
children: /* @__PURE__ */
|
|
392
|
+
var DropdownMenuContent = React6.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx7(DropdownMenuPrimitive.Portal, {
|
|
393
|
+
children: /* @__PURE__ */ jsx7(DropdownMenuPrimitive.Content, {
|
|
394
394
|
ref,
|
|
395
395
|
sideOffset,
|
|
396
396
|
className: cn("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md", "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]", className),
|
|
397
397
|
...props
|
|
398
|
-
}
|
|
399
|
-
}
|
|
398
|
+
})
|
|
399
|
+
}));
|
|
400
400
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
401
|
-
var DropdownMenuItem = React6.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */
|
|
401
|
+
var DropdownMenuItem = React6.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx7(DropdownMenuPrimitive.Item, {
|
|
402
402
|
ref,
|
|
403
403
|
className: cn("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0", inset && "pl-8", className),
|
|
404
404
|
...props
|
|
405
|
-
}
|
|
405
|
+
}));
|
|
406
406
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
407
|
-
var DropdownMenuCheckboxItem = React6.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */
|
|
407
|
+
var DropdownMenuCheckboxItem = React6.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs2(DropdownMenuPrimitive.CheckboxItem, {
|
|
408
408
|
ref,
|
|
409
409
|
className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className),
|
|
410
410
|
checked,
|
|
411
411
|
...props,
|
|
412
412
|
children: [
|
|
413
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ jsx7("span", {
|
|
414
414
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
415
|
-
children: /* @__PURE__ */
|
|
416
|
-
children: /* @__PURE__ */
|
|
415
|
+
children: /* @__PURE__ */ jsx7(DropdownMenuPrimitive.ItemIndicator, {
|
|
416
|
+
children: /* @__PURE__ */ jsx7(Check, {
|
|
417
417
|
className: "h-4 w-4"
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
}
|
|
418
|
+
})
|
|
419
|
+
})
|
|
420
|
+
}),
|
|
421
421
|
children
|
|
422
422
|
]
|
|
423
|
-
}
|
|
423
|
+
}));
|
|
424
424
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
425
|
-
var DropdownMenuRadioItem = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
425
|
+
var DropdownMenuRadioItem = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs2(DropdownMenuPrimitive.RadioItem, {
|
|
426
426
|
ref,
|
|
427
427
|
className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className),
|
|
428
428
|
...props,
|
|
429
429
|
children: [
|
|
430
|
-
/* @__PURE__ */
|
|
430
|
+
/* @__PURE__ */ jsx7("span", {
|
|
431
431
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
432
|
-
children: /* @__PURE__ */
|
|
433
|
-
children: /* @__PURE__ */
|
|
432
|
+
children: /* @__PURE__ */ jsx7(DropdownMenuPrimitive.ItemIndicator, {
|
|
433
|
+
children: /* @__PURE__ */ jsx7(Circle, {
|
|
434
434
|
className: "h-2 w-2 fill-current"
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
}
|
|
435
|
+
})
|
|
436
|
+
})
|
|
437
|
+
}),
|
|
438
438
|
children
|
|
439
439
|
]
|
|
440
|
-
}
|
|
440
|
+
}));
|
|
441
441
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
442
|
-
var DropdownMenuLabel = React6.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */
|
|
442
|
+
var DropdownMenuLabel = React6.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx7(DropdownMenuPrimitive.Label, {
|
|
443
443
|
ref,
|
|
444
444
|
className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className),
|
|
445
445
|
...props
|
|
446
|
-
}
|
|
446
|
+
}));
|
|
447
447
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
448
|
-
var DropdownMenuSeparator = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
448
|
+
var DropdownMenuSeparator = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx7(DropdownMenuPrimitive.Separator, {
|
|
449
449
|
ref,
|
|
450
450
|
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
451
451
|
...props
|
|
452
|
-
}
|
|
452
|
+
}));
|
|
453
453
|
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
454
454
|
var DropdownMenuShortcut = ({ className, ...props }) => {
|
|
455
|
-
return /* @__PURE__ */
|
|
455
|
+
return /* @__PURE__ */ jsx7("span", {
|
|
456
456
|
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
457
457
|
...props
|
|
458
|
-
}
|
|
458
|
+
});
|
|
459
459
|
};
|
|
460
460
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
461
461
|
// src/ui/primitives/hover-card.tsx
|
|
462
462
|
import * as React7 from "react";
|
|
463
463
|
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
464
|
-
import {
|
|
464
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
465
465
|
var HoverCard = HoverCardPrimitive.Root;
|
|
466
466
|
var HoverCardTrigger = HoverCardPrimitive.Trigger;
|
|
467
|
-
var HoverCardContent = React7.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */
|
|
467
|
+
var HoverCardContent = React7.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx8(HoverCardPrimitive.Content, {
|
|
468
468
|
ref,
|
|
469
469
|
align,
|
|
470
470
|
sideOffset,
|
|
471
471
|
className: cn("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-hover-card-content-transform-origin]", className),
|
|
472
472
|
...props
|
|
473
|
-
}
|
|
473
|
+
}));
|
|
474
474
|
HoverCardContent.displayName = HoverCardPrimitive.Content.displayName;
|
|
475
475
|
// src/ui/primitives/select.tsx
|
|
476
476
|
import * as React8 from "react";
|
|
477
477
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
478
478
|
import { Check as Check2, ChevronDown as ChevronDown2, ChevronUp } from "lucide-react";
|
|
479
|
-
import {
|
|
479
|
+
import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
480
480
|
var Select = SelectPrimitive.Root;
|
|
481
481
|
var SelectGroup = SelectPrimitive.Group;
|
|
482
482
|
var SelectValue = SelectPrimitive.Value;
|
|
483
|
-
var SelectTrigger = React8.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
483
|
+
var SelectTrigger = React8.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs3(SelectPrimitive.Trigger, {
|
|
484
484
|
ref,
|
|
485
485
|
className: cn("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", className),
|
|
486
486
|
...props,
|
|
487
487
|
children: [
|
|
488
488
|
children,
|
|
489
|
-
/* @__PURE__ */
|
|
489
|
+
/* @__PURE__ */ jsx9(SelectPrimitive.Icon, {
|
|
490
490
|
asChild: true,
|
|
491
|
-
children: /* @__PURE__ */
|
|
491
|
+
children: /* @__PURE__ */ jsx9(ChevronDown2, {
|
|
492
492
|
className: "h-4 w-4 opacity-50"
|
|
493
|
-
}
|
|
494
|
-
}
|
|
493
|
+
})
|
|
494
|
+
})
|
|
495
495
|
]
|
|
496
|
-
}
|
|
496
|
+
}));
|
|
497
497
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
498
|
-
var SelectScrollUpButton = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
498
|
+
var SelectScrollUpButton = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(SelectPrimitive.ScrollUpButton, {
|
|
499
499
|
ref,
|
|
500
500
|
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
501
501
|
...props,
|
|
502
|
-
children: /* @__PURE__ */
|
|
502
|
+
children: /* @__PURE__ */ jsx9(ChevronUp, {
|
|
503
503
|
className: "h-4 w-4"
|
|
504
|
-
}
|
|
505
|
-
}
|
|
504
|
+
})
|
|
505
|
+
}));
|
|
506
506
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
507
|
-
var SelectScrollDownButton = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
507
|
+
var SelectScrollDownButton = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(SelectPrimitive.ScrollDownButton, {
|
|
508
508
|
ref,
|
|
509
509
|
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
510
510
|
...props,
|
|
511
|
-
children: /* @__PURE__ */
|
|
511
|
+
children: /* @__PURE__ */ jsx9(ChevronDown2, {
|
|
512
512
|
className: "h-4 w-4"
|
|
513
|
-
}
|
|
514
|
-
}
|
|
513
|
+
})
|
|
514
|
+
}));
|
|
515
515
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
516
|
-
var SelectContent = React8.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */
|
|
517
|
-
children: /* @__PURE__ */
|
|
516
|
+
var SelectContent = React8.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx9(SelectPrimitive.Portal, {
|
|
517
|
+
children: /* @__PURE__ */ jsxs3(SelectPrimitive.Content, {
|
|
518
518
|
ref,
|
|
519
519
|
className: cn("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
|
|
520
520
|
position,
|
|
521
521
|
...props,
|
|
522
522
|
children: [
|
|
523
|
-
/* @__PURE__ */
|
|
524
|
-
/* @__PURE__ */
|
|
523
|
+
/* @__PURE__ */ jsx9(SelectScrollUpButton, {}),
|
|
524
|
+
/* @__PURE__ */ jsx9(SelectPrimitive.Viewport, {
|
|
525
525
|
className: cn("p-1", position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),
|
|
526
526
|
children
|
|
527
|
-
}
|
|
528
|
-
/* @__PURE__ */
|
|
527
|
+
}),
|
|
528
|
+
/* @__PURE__ */ jsx9(SelectScrollDownButton, {})
|
|
529
529
|
]
|
|
530
|
-
}
|
|
531
|
-
}
|
|
530
|
+
})
|
|
531
|
+
}));
|
|
532
532
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
533
|
-
var SelectLabel = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
533
|
+
var SelectLabel = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(SelectPrimitive.Label, {
|
|
534
534
|
ref,
|
|
535
535
|
className: cn("px-2 py-1.5 text-sm font-semibold", className),
|
|
536
536
|
...props
|
|
537
|
-
}
|
|
537
|
+
}));
|
|
538
538
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
539
|
-
var SelectItem = React8.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
539
|
+
var SelectItem = React8.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs3(SelectPrimitive.Item, {
|
|
540
540
|
ref,
|
|
541
541
|
className: cn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className),
|
|
542
542
|
...props,
|
|
543
543
|
children: [
|
|
544
|
-
/* @__PURE__ */
|
|
544
|
+
/* @__PURE__ */ jsx9("span", {
|
|
545
545
|
className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
546
|
-
children: /* @__PURE__ */
|
|
547
|
-
children: /* @__PURE__ */
|
|
546
|
+
children: /* @__PURE__ */ jsx9(SelectPrimitive.ItemIndicator, {
|
|
547
|
+
children: /* @__PURE__ */ jsx9(Check2, {
|
|
548
548
|
className: "h-4 w-4"
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
/* @__PURE__ */
|
|
549
|
+
})
|
|
550
|
+
})
|
|
551
|
+
}),
|
|
552
|
+
/* @__PURE__ */ jsx9(SelectPrimitive.ItemText, {
|
|
553
553
|
children
|
|
554
|
-
}
|
|
554
|
+
})
|
|
555
555
|
]
|
|
556
|
-
}
|
|
556
|
+
}));
|
|
557
557
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
558
|
-
var SelectSeparator = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
558
|
+
var SelectSeparator = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(SelectPrimitive.Separator, {
|
|
559
559
|
ref,
|
|
560
560
|
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
561
561
|
...props
|
|
562
|
-
}
|
|
562
|
+
}));
|
|
563
563
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
564
564
|
// src/ui/primitives/command.tsx
|
|
565
565
|
import * as React9 from "react";
|
|
566
566
|
import { Command as CommandPrimitive } from "cmdk";
|
|
567
567
|
import { Search } from "lucide-react";
|
|
568
|
-
import {
|
|
569
|
-
var Command = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
568
|
+
import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
569
|
+
var Command = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(CommandPrimitive, {
|
|
570
570
|
ref,
|
|
571
571
|
className: cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground", className),
|
|
572
572
|
...props
|
|
573
|
-
}
|
|
573
|
+
}));
|
|
574
574
|
Command.displayName = CommandPrimitive.displayName;
|
|
575
|
-
var CommandInput = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
575
|
+
var CommandInput = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs4("div", {
|
|
576
576
|
className: "flex items-center border-b px-3",
|
|
577
577
|
"cmdk-input-wrapper": "",
|
|
578
578
|
children: [
|
|
579
|
-
/* @__PURE__ */
|
|
579
|
+
/* @__PURE__ */ jsx10(Search, {
|
|
580
580
|
className: "mr-2 h-4 w-4 shrink-0 opacity-50"
|
|
581
|
-
}
|
|
582
|
-
/* @__PURE__ */
|
|
581
|
+
}),
|
|
582
|
+
/* @__PURE__ */ jsx10(CommandPrimitive.Input, {
|
|
583
583
|
ref,
|
|
584
584
|
className: cn("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
585
585
|
...props
|
|
586
|
-
}
|
|
586
|
+
})
|
|
587
587
|
]
|
|
588
|
-
}
|
|
588
|
+
}));
|
|
589
589
|
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
590
|
-
var CommandList = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
590
|
+
var CommandList = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(CommandPrimitive.List, {
|
|
591
591
|
ref,
|
|
592
592
|
className: cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className),
|
|
593
593
|
...props
|
|
594
|
-
}
|
|
594
|
+
}));
|
|
595
595
|
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
596
|
-
var CommandEmpty = React9.forwardRef((props, ref) => /* @__PURE__ */
|
|
596
|
+
var CommandEmpty = React9.forwardRef((props, ref) => /* @__PURE__ */ jsx10(CommandPrimitive.Empty, {
|
|
597
597
|
ref,
|
|
598
598
|
className: "py-6 text-center text-sm",
|
|
599
599
|
...props
|
|
600
|
-
}
|
|
600
|
+
}));
|
|
601
601
|
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
602
|
-
var CommandGroup = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
602
|
+
var CommandGroup = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(CommandPrimitive.Group, {
|
|
603
603
|
ref,
|
|
604
604
|
className: cn("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground", className),
|
|
605
605
|
...props
|
|
606
|
-
}
|
|
606
|
+
}));
|
|
607
607
|
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
608
|
-
var CommandSeparator = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
608
|
+
var CommandSeparator = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(CommandPrimitive.Separator, {
|
|
609
609
|
ref,
|
|
610
610
|
className: cn("-mx-1 h-px bg-border", className),
|
|
611
611
|
...props
|
|
612
|
-
}
|
|
612
|
+
}));
|
|
613
613
|
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
614
|
-
var CommandItem = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
614
|
+
var CommandItem = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(CommandPrimitive.Item, {
|
|
615
615
|
ref,
|
|
616
616
|
className: cn("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className),
|
|
617
617
|
...props
|
|
618
|
-
}
|
|
618
|
+
}));
|
|
619
619
|
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
|
620
620
|
var CommandShortcut = ({ className, ...props }) => {
|
|
621
|
-
return /* @__PURE__ */
|
|
621
|
+
return /* @__PURE__ */ jsx10("span", {
|
|
622
622
|
className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className),
|
|
623
623
|
...props
|
|
624
|
-
}
|
|
624
|
+
});
|
|
625
625
|
};
|
|
626
626
|
CommandShortcut.displayName = "CommandShortcut";
|
|
627
627
|
// src/ui/primitives/dialog.tsx
|
|
@@ -629,16 +629,16 @@ import * as React10 from "react";
|
|
|
629
629
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
630
630
|
import { cva as cva4 } from "class-variance-authority";
|
|
631
631
|
import { X } from "lucide-react";
|
|
632
|
-
import {
|
|
632
|
+
import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
633
633
|
var Dialog = DialogPrimitive.Root;
|
|
634
634
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
635
635
|
var DialogPortal = DialogPrimitive.Portal;
|
|
636
636
|
var DialogClose = DialogPrimitive.Close;
|
|
637
|
-
var DialogOverlay = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
637
|
+
var DialogOverlay = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(DialogPrimitive.Overlay, {
|
|
638
638
|
ref,
|
|
639
639
|
className: cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className),
|
|
640
640
|
...props
|
|
641
|
-
}
|
|
641
|
+
}));
|
|
642
642
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
643
643
|
var dialogContentVariants = cva4("fixed left-[50%] top-[50%] z-50 grid translate-x-[-50%] translate-y-[-50%] gap-4 border shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", {
|
|
644
644
|
variants: {
|
|
@@ -651,61 +651,61 @@ var dialogContentVariants = cva4("fixed left-[50%] top-[50%] z-50 grid translate
|
|
|
651
651
|
variant: "default"
|
|
652
652
|
}
|
|
653
653
|
});
|
|
654
|
-
var DialogContent = React10.forwardRef(({ className, variant, children, ...props }, ref) => /* @__PURE__ */
|
|
654
|
+
var DialogContent = React10.forwardRef(({ className, variant, children, ...props }, ref) => /* @__PURE__ */ jsxs5(DialogPortal, {
|
|
655
655
|
children: [
|
|
656
|
-
/* @__PURE__ */
|
|
657
|
-
/* @__PURE__ */
|
|
656
|
+
/* @__PURE__ */ jsx11(DialogOverlay, {}),
|
|
657
|
+
/* @__PURE__ */ jsxs5(DialogPrimitive.Content, {
|
|
658
658
|
ref,
|
|
659
659
|
className: cn(dialogContentVariants({ variant }), className),
|
|
660
660
|
...props,
|
|
661
661
|
children: [
|
|
662
662
|
children,
|
|
663
|
-
/* @__PURE__ */
|
|
663
|
+
/* @__PURE__ */ jsxs5(DialogPrimitive.Close, {
|
|
664
664
|
className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
|
|
665
665
|
children: [
|
|
666
|
-
/* @__PURE__ */
|
|
666
|
+
/* @__PURE__ */ jsx11(X, {
|
|
667
667
|
className: "h-4 w-4"
|
|
668
|
-
}
|
|
669
|
-
/* @__PURE__ */
|
|
668
|
+
}),
|
|
669
|
+
/* @__PURE__ */ jsx11("span", {
|
|
670
670
|
className: "sr-only",
|
|
671
671
|
children: "Close"
|
|
672
|
-
}
|
|
672
|
+
})
|
|
673
673
|
]
|
|
674
|
-
}
|
|
674
|
+
})
|
|
675
675
|
]
|
|
676
|
-
}
|
|
676
|
+
})
|
|
677
677
|
]
|
|
678
|
-
}
|
|
678
|
+
}));
|
|
679
679
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
680
|
-
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */
|
|
680
|
+
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx11("div", {
|
|
681
681
|
className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className),
|
|
682
682
|
...props
|
|
683
|
-
}
|
|
683
|
+
});
|
|
684
684
|
DialogHeader.displayName = "DialogHeader";
|
|
685
|
-
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */
|
|
685
|
+
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx11("div", {
|
|
686
686
|
className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className),
|
|
687
687
|
...props
|
|
688
|
-
}
|
|
688
|
+
});
|
|
689
689
|
DialogFooter.displayName = "DialogFooter";
|
|
690
|
-
var DialogTitle = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
690
|
+
var DialogTitle = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(DialogPrimitive.Title, {
|
|
691
691
|
ref,
|
|
692
692
|
className: cn("text-lg font-semibold leading-none tracking-tight", className),
|
|
693
693
|
...props
|
|
694
|
-
}
|
|
694
|
+
}));
|
|
695
695
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
696
|
-
var DialogDescription = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
696
|
+
var DialogDescription = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(DialogPrimitive.Description, {
|
|
697
697
|
ref,
|
|
698
698
|
className: cn("text-sm text-muted-foreground", className),
|
|
699
699
|
...props
|
|
700
|
-
}
|
|
700
|
+
}));
|
|
701
701
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
702
702
|
// src/ui/components/message.tsx
|
|
703
703
|
import { cva as cva5 } from "class-variance-authority";
|
|
704
|
-
import {
|
|
705
|
-
var Message = ({ className, from, ...props }) => /* @__PURE__ */
|
|
704
|
+
import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
705
|
+
var Message = ({ className, from, ...props }) => /* @__PURE__ */ jsx12("div", {
|
|
706
706
|
className: cn("group flex w-full items-end justify-end gap-2 py-4", from === "user" ? "is-user" : "is-assistant flex-row-reverse justify-end", className),
|
|
707
707
|
...props
|
|
708
|
-
}
|
|
708
|
+
});
|
|
709
709
|
var messageContentVariants = cva5("flex flex-col gap-2 overflow-hidden rounded-lg text-sm", {
|
|
710
710
|
variants: {
|
|
711
711
|
variant: {
|
|
@@ -724,41 +724,41 @@ var messageContentVariants = cva5("flex flex-col gap-2 overflow-hidden rounded-l
|
|
|
724
724
|
variant: "contained"
|
|
725
725
|
}
|
|
726
726
|
});
|
|
727
|
-
var MessageContent = ({ children, className, variant, ...props }) => /* @__PURE__ */
|
|
727
|
+
var MessageContent = ({ children, className, variant, ...props }) => /* @__PURE__ */ jsx12("div", {
|
|
728
728
|
className: cn(messageContentVariants({ variant, className })),
|
|
729
729
|
...props,
|
|
730
730
|
children
|
|
731
|
-
}
|
|
732
|
-
var MessageAvatar = ({ src, name, className, ...props }) => /* @__PURE__ */
|
|
731
|
+
});
|
|
732
|
+
var MessageAvatar = ({ src, name, className, ...props }) => /* @__PURE__ */ jsxs6(Avatar, {
|
|
733
733
|
className: cn("size-8 ring-1 ring-border", className),
|
|
734
734
|
...props,
|
|
735
735
|
children: [
|
|
736
|
-
/* @__PURE__ */
|
|
736
|
+
/* @__PURE__ */ jsx12(AvatarImage, {
|
|
737
737
|
alt: "",
|
|
738
738
|
className: "mt-0 mb-0",
|
|
739
739
|
src
|
|
740
|
-
}
|
|
741
|
-
/* @__PURE__ */
|
|
740
|
+
}),
|
|
741
|
+
/* @__PURE__ */ jsx12(AvatarFallback, {
|
|
742
742
|
children: name?.slice(0, 2) || "ME"
|
|
743
|
-
}
|
|
743
|
+
})
|
|
744
744
|
]
|
|
745
|
-
}
|
|
745
|
+
});
|
|
746
746
|
// src/ui/components/conversation.tsx
|
|
747
747
|
import { ArrowDownIcon } from "lucide-react";
|
|
748
748
|
import { useCallback } from "react";
|
|
749
749
|
import { StickToBottom, useStickToBottomContext } from "use-stick-to-bottom";
|
|
750
750
|
import { useStickToBottomContext as useStickToBottomContext2 } from "use-stick-to-bottom";
|
|
751
|
-
import {
|
|
752
|
-
var Conversation = ({ className, ...props }) => /* @__PURE__ */
|
|
751
|
+
import { jsx as jsx13, jsxs as jsxs7, Fragment } from "react/jsx-runtime";
|
|
752
|
+
var Conversation = ({ className, ...props }) => /* @__PURE__ */ jsx13(StickToBottom, {
|
|
753
753
|
className: cn("relative flex-1 overflow-y-auto", className),
|
|
754
754
|
initial: "smooth",
|
|
755
755
|
role: "log",
|
|
756
756
|
...props
|
|
757
|
-
}
|
|
758
|
-
var ConversationContent = ({ className, ...props }) => /* @__PURE__ */
|
|
757
|
+
});
|
|
758
|
+
var ConversationContent = ({ className, ...props }) => /* @__PURE__ */ jsx13(StickToBottom.Content, {
|
|
759
759
|
className: cn("p-4", className),
|
|
760
760
|
...props
|
|
761
|
-
}
|
|
761
|
+
});
|
|
762
762
|
var ConversationEmptyState = ({
|
|
763
763
|
className,
|
|
764
764
|
title = "No messages yet",
|
|
@@ -766,56 +766,56 @@ var ConversationEmptyState = ({
|
|
|
766
766
|
icon,
|
|
767
767
|
children,
|
|
768
768
|
...props
|
|
769
|
-
}) => /* @__PURE__ */
|
|
769
|
+
}) => /* @__PURE__ */ jsx13("div", {
|
|
770
770
|
className: cn("flex size-full flex-col items-center justify-center gap-3 p-8 text-center", className),
|
|
771
771
|
...props,
|
|
772
|
-
children: children ?? /* @__PURE__ */
|
|
772
|
+
children: children ?? /* @__PURE__ */ jsxs7(Fragment, {
|
|
773
773
|
children: [
|
|
774
|
-
icon && /* @__PURE__ */
|
|
774
|
+
icon && /* @__PURE__ */ jsx13("div", {
|
|
775
775
|
className: "text-muted-foreground",
|
|
776
776
|
children: icon
|
|
777
|
-
}
|
|
778
|
-
/* @__PURE__ */
|
|
777
|
+
}),
|
|
778
|
+
/* @__PURE__ */ jsxs7("div", {
|
|
779
779
|
className: "space-y-1",
|
|
780
780
|
children: [
|
|
781
|
-
/* @__PURE__ */
|
|
781
|
+
/* @__PURE__ */ jsx13("h3", {
|
|
782
782
|
className: "font-medium text-sm",
|
|
783
783
|
children: title
|
|
784
|
-
}
|
|
785
|
-
description && /* @__PURE__ */
|
|
784
|
+
}),
|
|
785
|
+
description && /* @__PURE__ */ jsx13("p", {
|
|
786
786
|
className: "text-muted-foreground text-sm",
|
|
787
787
|
children: description
|
|
788
|
-
}
|
|
788
|
+
})
|
|
789
789
|
]
|
|
790
|
-
}
|
|
790
|
+
})
|
|
791
791
|
]
|
|
792
|
-
}
|
|
793
|
-
}
|
|
792
|
+
})
|
|
793
|
+
});
|
|
794
794
|
var ConversationScrollButton = ({ className, ...props }) => {
|
|
795
795
|
const { isAtBottom, scrollToBottom } = useStickToBottomContext();
|
|
796
796
|
const handleScrollToBottom = useCallback(() => {
|
|
797
797
|
scrollToBottom();
|
|
798
798
|
}, [scrollToBottom]);
|
|
799
|
-
return !isAtBottom && /* @__PURE__ */
|
|
799
|
+
return !isAtBottom && /* @__PURE__ */ jsx13(Button, {
|
|
800
800
|
className: cn("absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full", className),
|
|
801
801
|
onClick: handleScrollToBottom,
|
|
802
802
|
size: "icon",
|
|
803
803
|
type: "button",
|
|
804
804
|
variant: "outline",
|
|
805
805
|
...props,
|
|
806
|
-
children: /* @__PURE__ */
|
|
806
|
+
children: /* @__PURE__ */ jsx13(ArrowDownIcon, {
|
|
807
807
|
className: "size-4"
|
|
808
|
-
}
|
|
809
|
-
}
|
|
808
|
+
})
|
|
809
|
+
});
|
|
810
810
|
};
|
|
811
811
|
// src/ui/components/response.tsx
|
|
812
812
|
import { memo } from "react";
|
|
813
813
|
import { Streamdown } from "streamdown";
|
|
814
|
-
import {
|
|
815
|
-
var Response = memo(({ className, ...props }) => /* @__PURE__ */
|
|
814
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
815
|
+
var Response = memo(({ className, ...props }) => /* @__PURE__ */ jsx14(Streamdown, {
|
|
816
816
|
className: cn("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", className),
|
|
817
817
|
...props
|
|
818
|
-
}
|
|
818
|
+
}), (prevProps, nextProps) => prevProps.children === nextProps.children);
|
|
819
819
|
Response.displayName = "Response";
|
|
820
820
|
// src/ui/components/tool.tsx
|
|
821
821
|
import {
|
|
@@ -837,7 +837,7 @@ import {
|
|
|
837
837
|
useRef,
|
|
838
838
|
useState
|
|
839
839
|
} from "react";
|
|
840
|
-
import {
|
|
840
|
+
import { jsx as jsx15, jsxs as jsxs8, Fragment as Fragment2 } from "react/jsx-runtime";
|
|
841
841
|
var CodeBlockContext = createContext({
|
|
842
842
|
code: ""
|
|
843
843
|
});
|
|
@@ -889,40 +889,40 @@ var CodeBlock = ({
|
|
|
889
889
|
});
|
|
890
890
|
}, [code, language, showLineNumbers]);
|
|
891
891
|
const useFallback = !html && !darkHtml;
|
|
892
|
-
return /* @__PURE__ */
|
|
892
|
+
return /* @__PURE__ */ jsx15(CodeBlockContext.Provider, {
|
|
893
893
|
value: { code },
|
|
894
|
-
children: /* @__PURE__ */
|
|
894
|
+
children: /* @__PURE__ */ jsx15("div", {
|
|
895
895
|
className: cn("group relative w-full overflow-hidden rounded-md border bg-background text-foreground", className),
|
|
896
896
|
...props,
|
|
897
|
-
children: /* @__PURE__ */
|
|
897
|
+
children: /* @__PURE__ */ jsxs8("div", {
|
|
898
898
|
className: "relative",
|
|
899
899
|
children: [
|
|
900
|
-
useFallback ? /* @__PURE__ */
|
|
900
|
+
useFallback ? /* @__PURE__ */ jsx15("pre", {
|
|
901
901
|
className: "m-0 overflow-auto bg-background p-4 text-foreground text-sm",
|
|
902
|
-
children: /* @__PURE__ */
|
|
902
|
+
children: /* @__PURE__ */ jsx15("code", {
|
|
903
903
|
className: "font-mono text-sm",
|
|
904
904
|
children: code
|
|
905
|
-
}
|
|
906
|
-
}
|
|
905
|
+
})
|
|
906
|
+
}) : /* @__PURE__ */ jsxs8(Fragment2, {
|
|
907
907
|
children: [
|
|
908
|
-
/* @__PURE__ */
|
|
908
|
+
/* @__PURE__ */ jsx15("div", {
|
|
909
909
|
className: "overflow-hidden dark:hidden [&>pre]:m-0 [&>pre]:bg-background! [&>pre]:p-4 [&>pre]:text-foreground! [&>pre]:text-sm [&_code]:font-mono [&_code]:text-sm",
|
|
910
910
|
dangerouslySetInnerHTML: { __html: html }
|
|
911
|
-
}
|
|
912
|
-
/* @__PURE__ */
|
|
911
|
+
}),
|
|
912
|
+
/* @__PURE__ */ jsx15("div", {
|
|
913
913
|
className: "hidden overflow-hidden dark:block [&>pre]:m-0 [&>pre]:bg-background! [&>pre]:p-4 [&>pre]:text-foreground! [&>pre]:text-sm [&_code]:font-mono [&_code]:text-sm",
|
|
914
914
|
dangerouslySetInnerHTML: { __html: darkHtml }
|
|
915
|
-
}
|
|
915
|
+
})
|
|
916
916
|
]
|
|
917
|
-
}
|
|
918
|
-
children && /* @__PURE__ */
|
|
917
|
+
}),
|
|
918
|
+
children && /* @__PURE__ */ jsx15("div", {
|
|
919
919
|
className: "absolute top-2 right-2 flex items-center gap-2",
|
|
920
920
|
children
|
|
921
|
-
}
|
|
921
|
+
})
|
|
922
922
|
]
|
|
923
|
-
}
|
|
924
|
-
}
|
|
925
|
-
}
|
|
923
|
+
})
|
|
924
|
+
})
|
|
925
|
+
});
|
|
926
926
|
};
|
|
927
927
|
var CodeBlockCopyButton = ({
|
|
928
928
|
onCopy,
|
|
@@ -949,24 +949,24 @@ var CodeBlockCopyButton = ({
|
|
|
949
949
|
}
|
|
950
950
|
};
|
|
951
951
|
const Icon2 = isCopied ? CheckIcon : CopyIcon;
|
|
952
|
-
return /* @__PURE__ */
|
|
952
|
+
return /* @__PURE__ */ jsx15(Button, {
|
|
953
953
|
className: cn("shrink-0", className),
|
|
954
954
|
onClick: copyToClipboard,
|
|
955
955
|
size: "icon",
|
|
956
956
|
variant: "ghost",
|
|
957
957
|
...props,
|
|
958
|
-
children: children ?? /* @__PURE__ */
|
|
958
|
+
children: children ?? /* @__PURE__ */ jsx15(Icon2, {
|
|
959
959
|
size: 14
|
|
960
|
-
}
|
|
961
|
-
}
|
|
960
|
+
})
|
|
961
|
+
});
|
|
962
962
|
};
|
|
963
963
|
|
|
964
964
|
// src/ui/components/tool.tsx
|
|
965
|
-
import {
|
|
966
|
-
var Tool = ({ className, ...props }) => /* @__PURE__ */
|
|
965
|
+
import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
966
|
+
var Tool = ({ className, ...props }) => /* @__PURE__ */ jsx16(Collapsible, {
|
|
967
967
|
className: cn("not-prose mb-4 w-full rounded-md border", className),
|
|
968
968
|
...props
|
|
969
|
-
}
|
|
969
|
+
});
|
|
970
970
|
var getStatusBadge = (status) => {
|
|
971
971
|
const labels = {
|
|
972
972
|
"input-streaming": "Pending",
|
|
@@ -978,163 +978,163 @@ var getStatusBadge = (status) => {
|
|
|
978
978
|
"output-denied": "Denied"
|
|
979
979
|
};
|
|
980
980
|
const icons = {
|
|
981
|
-
"input-streaming": /* @__PURE__ */
|
|
981
|
+
"input-streaming": /* @__PURE__ */ jsx16(CircleIcon, {
|
|
982
982
|
className: "size-4"
|
|
983
|
-
}
|
|
984
|
-
"input-available": /* @__PURE__ */
|
|
983
|
+
}),
|
|
984
|
+
"input-available": /* @__PURE__ */ jsx16(ClockIcon, {
|
|
985
985
|
className: "size-4 animate-pulse"
|
|
986
|
-
}
|
|
987
|
-
"approval-requested": /* @__PURE__ */
|
|
986
|
+
}),
|
|
987
|
+
"approval-requested": /* @__PURE__ */ jsx16(ClockIcon, {
|
|
988
988
|
className: "size-4 text-yellow-600"
|
|
989
|
-
}
|
|
990
|
-
"approval-responded": /* @__PURE__ */
|
|
989
|
+
}),
|
|
990
|
+
"approval-responded": /* @__PURE__ */ jsx16(CheckCircleIcon, {
|
|
991
991
|
className: "size-4 text-blue-600"
|
|
992
|
-
}
|
|
993
|
-
"output-available": /* @__PURE__ */
|
|
992
|
+
}),
|
|
993
|
+
"output-available": /* @__PURE__ */ jsx16(CheckCircleIcon, {
|
|
994
994
|
className: "size-4 text-green-600"
|
|
995
|
-
}
|
|
996
|
-
"output-error": /* @__PURE__ */
|
|
995
|
+
}),
|
|
996
|
+
"output-error": /* @__PURE__ */ jsx16(XCircleIcon, {
|
|
997
997
|
className: "size-4 text-red-600"
|
|
998
|
-
}
|
|
999
|
-
"output-denied": /* @__PURE__ */
|
|
998
|
+
}),
|
|
999
|
+
"output-denied": /* @__PURE__ */ jsx16(XCircleIcon, {
|
|
1000
1000
|
className: "size-4 text-orange-600"
|
|
1001
|
-
}
|
|
1001
|
+
})
|
|
1002
1002
|
};
|
|
1003
|
-
return /* @__PURE__ */
|
|
1003
|
+
return /* @__PURE__ */ jsxs9(Badge, {
|
|
1004
1004
|
className: "gap-1.5 rounded-full text-xs",
|
|
1005
1005
|
variant: "secondary",
|
|
1006
1006
|
children: [
|
|
1007
1007
|
icons[status],
|
|
1008
1008
|
labels[status]
|
|
1009
1009
|
]
|
|
1010
|
-
}
|
|
1010
|
+
});
|
|
1011
1011
|
};
|
|
1012
|
-
var ToolHeader = ({ className, title, type, state, ...props }) => /* @__PURE__ */
|
|
1012
|
+
var ToolHeader = ({ className, title, type, state, ...props }) => /* @__PURE__ */ jsxs9(CollapsibleTrigger2, {
|
|
1013
1013
|
className: cn("group flex w-full items-center justify-between gap-4 p-3", className),
|
|
1014
1014
|
...props,
|
|
1015
1015
|
children: [
|
|
1016
|
-
/* @__PURE__ */
|
|
1016
|
+
/* @__PURE__ */ jsxs9("div", {
|
|
1017
1017
|
className: "flex items-center gap-2",
|
|
1018
1018
|
children: [
|
|
1019
|
-
/* @__PURE__ */
|
|
1019
|
+
/* @__PURE__ */ jsx16(WrenchIcon, {
|
|
1020
1020
|
className: "size-4 text-muted-foreground"
|
|
1021
|
-
}
|
|
1022
|
-
/* @__PURE__ */
|
|
1021
|
+
}),
|
|
1022
|
+
/* @__PURE__ */ jsx16("span", {
|
|
1023
1023
|
className: "font-medium text-sm",
|
|
1024
1024
|
children: title ?? type?.split("-").slice(1).join("-") ?? "Tool"
|
|
1025
|
-
}
|
|
1025
|
+
}),
|
|
1026
1026
|
getStatusBadge(state)
|
|
1027
1027
|
]
|
|
1028
|
-
}
|
|
1029
|
-
/* @__PURE__ */
|
|
1028
|
+
}),
|
|
1029
|
+
/* @__PURE__ */ jsx16(ChevronDownIcon, {
|
|
1030
1030
|
className: "size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"
|
|
1031
|
-
}
|
|
1031
|
+
})
|
|
1032
1032
|
]
|
|
1033
|
-
}
|
|
1034
|
-
var ToolContent = ({ className, ...props }) => /* @__PURE__ */
|
|
1033
|
+
});
|
|
1034
|
+
var ToolContent = ({ className, ...props }) => /* @__PURE__ */ jsx16(CollapsibleContent2, {
|
|
1035
1035
|
className: cn("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in", className),
|
|
1036
1036
|
...props
|
|
1037
|
-
}
|
|
1038
|
-
var ToolInput = ({ className, input, ...props }) => /* @__PURE__ */
|
|
1037
|
+
});
|
|
1038
|
+
var ToolInput = ({ className, input, ...props }) => /* @__PURE__ */ jsxs9("div", {
|
|
1039
1039
|
className: cn("space-y-2 overflow-hidden p-4", className),
|
|
1040
1040
|
...props,
|
|
1041
1041
|
children: [
|
|
1042
|
-
/* @__PURE__ */
|
|
1042
|
+
/* @__PURE__ */ jsx16("h4", {
|
|
1043
1043
|
className: "font-medium text-muted-foreground text-xs uppercase tracking-wide",
|
|
1044
1044
|
children: "Parameters"
|
|
1045
|
-
}
|
|
1046
|
-
/* @__PURE__ */
|
|
1045
|
+
}),
|
|
1046
|
+
/* @__PURE__ */ jsx16("div", {
|
|
1047
1047
|
className: "rounded-md bg-muted/50",
|
|
1048
|
-
children: /* @__PURE__ */
|
|
1048
|
+
children: /* @__PURE__ */ jsx16(CodeBlock, {
|
|
1049
1049
|
code: JSON.stringify(input, null, 2),
|
|
1050
1050
|
language: "json"
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1051
|
+
})
|
|
1052
|
+
})
|
|
1053
1053
|
]
|
|
1054
|
-
}
|
|
1054
|
+
});
|
|
1055
1055
|
var ToolOutput = ({ className, output, errorText, ...props }) => {
|
|
1056
1056
|
if (!(output || errorText)) {
|
|
1057
1057
|
return null;
|
|
1058
1058
|
}
|
|
1059
|
-
let Output = /* @__PURE__ */
|
|
1059
|
+
let Output = /* @__PURE__ */ jsx16("div", {
|
|
1060
1060
|
children: output
|
|
1061
|
-
}
|
|
1061
|
+
});
|
|
1062
1062
|
if (typeof output === "object" && !isValidElement(output)) {
|
|
1063
|
-
Output = /* @__PURE__ */
|
|
1063
|
+
Output = /* @__PURE__ */ jsx16(CodeBlock, {
|
|
1064
1064
|
code: JSON.stringify(output, null, 2),
|
|
1065
1065
|
language: "json"
|
|
1066
|
-
}
|
|
1066
|
+
});
|
|
1067
1067
|
} else if (typeof output === "string") {
|
|
1068
|
-
Output = /* @__PURE__ */
|
|
1068
|
+
Output = /* @__PURE__ */ jsx16(CodeBlock, {
|
|
1069
1069
|
code: output,
|
|
1070
1070
|
language: "json"
|
|
1071
|
-
}
|
|
1071
|
+
});
|
|
1072
1072
|
}
|
|
1073
|
-
return /* @__PURE__ */
|
|
1073
|
+
return /* @__PURE__ */ jsxs9("div", {
|
|
1074
1074
|
className: cn("space-y-2 p-4", className),
|
|
1075
1075
|
...props,
|
|
1076
1076
|
children: [
|
|
1077
|
-
/* @__PURE__ */
|
|
1077
|
+
/* @__PURE__ */ jsx16("h4", {
|
|
1078
1078
|
className: "font-medium text-muted-foreground text-xs uppercase tracking-wide",
|
|
1079
1079
|
children: errorText ? "Error" : "Result"
|
|
1080
|
-
}
|
|
1081
|
-
/* @__PURE__ */
|
|
1080
|
+
}),
|
|
1081
|
+
/* @__PURE__ */ jsxs9("div", {
|
|
1082
1082
|
className: cn("overflow-x-auto rounded-md text-xs [&_table]:w-full", errorText ? "bg-destructive/10 text-destructive" : "bg-muted/50 text-foreground"),
|
|
1083
1083
|
children: [
|
|
1084
|
-
errorText && /* @__PURE__ */
|
|
1084
|
+
errorText && /* @__PURE__ */ jsx16("div", {
|
|
1085
1085
|
children: errorText
|
|
1086
|
-
}
|
|
1086
|
+
}),
|
|
1087
1087
|
Output
|
|
1088
1088
|
]
|
|
1089
|
-
}
|
|
1089
|
+
})
|
|
1090
1090
|
]
|
|
1091
|
-
}
|
|
1091
|
+
});
|
|
1092
1092
|
};
|
|
1093
1093
|
// src/ui/components/artifact.tsx
|
|
1094
1094
|
import { XIcon } from "lucide-react";
|
|
1095
|
-
import {
|
|
1096
|
-
var Artifact = ({ className, ...props }) => /* @__PURE__ */
|
|
1095
|
+
import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1096
|
+
var Artifact = ({ className, ...props }) => /* @__PURE__ */ jsx17("div", {
|
|
1097
1097
|
className: cn("flex flex-col overflow-hidden rounded-lg border bg-background shadow-sm", className),
|
|
1098
1098
|
...props
|
|
1099
|
-
}
|
|
1100
|
-
var ArtifactHeader = ({ className, ...props }) => /* @__PURE__ */
|
|
1099
|
+
});
|
|
1100
|
+
var ArtifactHeader = ({ className, ...props }) => /* @__PURE__ */ jsx17("div", {
|
|
1101
1101
|
className: cn("flex items-center justify-between border-b bg-muted/50 px-4 py-3", className),
|
|
1102
1102
|
...props
|
|
1103
|
-
}
|
|
1103
|
+
});
|
|
1104
1104
|
var ArtifactClose = ({
|
|
1105
1105
|
className,
|
|
1106
1106
|
children,
|
|
1107
1107
|
size = "sm",
|
|
1108
1108
|
variant = "ghost",
|
|
1109
1109
|
...props
|
|
1110
|
-
}) => /* @__PURE__ */
|
|
1110
|
+
}) => /* @__PURE__ */ jsxs10(Button, {
|
|
1111
1111
|
className: cn("size-8 p-0 text-muted-foreground hover:text-foreground", className),
|
|
1112
1112
|
size,
|
|
1113
1113
|
type: "button",
|
|
1114
1114
|
variant,
|
|
1115
1115
|
...props,
|
|
1116
1116
|
children: [
|
|
1117
|
-
children ?? /* @__PURE__ */
|
|
1117
|
+
children ?? /* @__PURE__ */ jsx17(XIcon, {
|
|
1118
1118
|
className: "size-4"
|
|
1119
|
-
}
|
|
1120
|
-
/* @__PURE__ */
|
|
1119
|
+
}),
|
|
1120
|
+
/* @__PURE__ */ jsx17("span", {
|
|
1121
1121
|
className: "sr-only",
|
|
1122
1122
|
children: "Close"
|
|
1123
|
-
}
|
|
1123
|
+
})
|
|
1124
1124
|
]
|
|
1125
|
-
}
|
|
1126
|
-
var ArtifactTitle = ({ className, ...props }) => /* @__PURE__ */
|
|
1125
|
+
});
|
|
1126
|
+
var ArtifactTitle = ({ className, ...props }) => /* @__PURE__ */ jsx17("p", {
|
|
1127
1127
|
className: cn("font-medium text-foreground text-sm", className),
|
|
1128
1128
|
...props
|
|
1129
|
-
}
|
|
1130
|
-
var ArtifactDescription = ({ className, ...props }) => /* @__PURE__ */
|
|
1129
|
+
});
|
|
1130
|
+
var ArtifactDescription = ({ className, ...props }) => /* @__PURE__ */ jsx17("p", {
|
|
1131
1131
|
className: cn("text-muted-foreground text-sm", className),
|
|
1132
1132
|
...props
|
|
1133
|
-
}
|
|
1134
|
-
var ArtifactActions = ({ className, ...props }) => /* @__PURE__ */
|
|
1133
|
+
});
|
|
1134
|
+
var ArtifactActions = ({ className, ...props }) => /* @__PURE__ */ jsx17("div", {
|
|
1135
1135
|
className: cn("flex items-center gap-1", className),
|
|
1136
1136
|
...props
|
|
1137
|
-
}
|
|
1137
|
+
});
|
|
1138
1138
|
var ArtifactAction = ({
|
|
1139
1139
|
tooltip,
|
|
1140
1140
|
label,
|
|
@@ -1145,80 +1145,80 @@ var ArtifactAction = ({
|
|
|
1145
1145
|
variant = "ghost",
|
|
1146
1146
|
...props
|
|
1147
1147
|
}) => {
|
|
1148
|
-
const button = /* @__PURE__ */
|
|
1148
|
+
const button = /* @__PURE__ */ jsxs10(Button, {
|
|
1149
1149
|
className: cn("size-8 p-0 text-muted-foreground hover:text-foreground", className),
|
|
1150
1150
|
size,
|
|
1151
1151
|
type: "button",
|
|
1152
1152
|
variant,
|
|
1153
1153
|
...props,
|
|
1154
1154
|
children: [
|
|
1155
|
-
Icon2 ? /* @__PURE__ */
|
|
1155
|
+
Icon2 ? /* @__PURE__ */ jsx17(Icon2, {
|
|
1156
1156
|
className: "size-4"
|
|
1157
|
-
}
|
|
1158
|
-
/* @__PURE__ */
|
|
1157
|
+
}) : children,
|
|
1158
|
+
/* @__PURE__ */ jsx17("span", {
|
|
1159
1159
|
className: "sr-only",
|
|
1160
1160
|
children: label || tooltip
|
|
1161
|
-
}
|
|
1161
|
+
})
|
|
1162
1162
|
]
|
|
1163
|
-
}
|
|
1163
|
+
});
|
|
1164
1164
|
if (tooltip) {
|
|
1165
|
-
return /* @__PURE__ */
|
|
1166
|
-
children: /* @__PURE__ */
|
|
1165
|
+
return /* @__PURE__ */ jsx17(TooltipProvider, {
|
|
1166
|
+
children: /* @__PURE__ */ jsxs10(Tooltip, {
|
|
1167
1167
|
children: [
|
|
1168
|
-
/* @__PURE__ */
|
|
1168
|
+
/* @__PURE__ */ jsx17(TooltipTrigger, {
|
|
1169
1169
|
asChild: true,
|
|
1170
1170
|
children: button
|
|
1171
|
-
}
|
|
1172
|
-
/* @__PURE__ */
|
|
1173
|
-
children: /* @__PURE__ */
|
|
1171
|
+
}),
|
|
1172
|
+
/* @__PURE__ */ jsx17(TooltipContent, {
|
|
1173
|
+
children: /* @__PURE__ */ jsx17("p", {
|
|
1174
1174
|
children: tooltip
|
|
1175
|
-
}
|
|
1176
|
-
}
|
|
1175
|
+
})
|
|
1176
|
+
})
|
|
1177
1177
|
]
|
|
1178
|
-
}
|
|
1179
|
-
}
|
|
1178
|
+
})
|
|
1179
|
+
});
|
|
1180
1180
|
}
|
|
1181
1181
|
return button;
|
|
1182
1182
|
};
|
|
1183
|
-
var ArtifactContent = ({ className, ...props }) => /* @__PURE__ */
|
|
1183
|
+
var ArtifactContent = ({ className, ...props }) => /* @__PURE__ */ jsx17("div", {
|
|
1184
1184
|
className: cn("flex-1 overflow-auto p-4", className),
|
|
1185
1185
|
...props
|
|
1186
|
-
}
|
|
1186
|
+
});
|
|
1187
1187
|
// src/ui/components/streaming-indicator.tsx
|
|
1188
1188
|
import { Bot } from "lucide-react";
|
|
1189
|
-
import {
|
|
1189
|
+
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1190
1190
|
function StreamingIndicator({ className, icon, avatar, ...props }) {
|
|
1191
|
-
return /* @__PURE__ */
|
|
1191
|
+
return /* @__PURE__ */ jsxs11("div", {
|
|
1192
1192
|
className: cn("flex items-start gap-3 px-1", className),
|
|
1193
1193
|
...props,
|
|
1194
1194
|
children: [
|
|
1195
|
-
avatar ?? /* @__PURE__ */
|
|
1195
|
+
avatar ?? /* @__PURE__ */ jsx18("div", {
|
|
1196
1196
|
className: "h-8 w-8 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0 mt-0.5",
|
|
1197
|
-
children: icon ?? /* @__PURE__ */
|
|
1197
|
+
children: icon ?? /* @__PURE__ */ jsx18(Bot, {
|
|
1198
1198
|
className: "h-4 w-4 text-primary"
|
|
1199
|
-
}
|
|
1200
|
-
}
|
|
1201
|
-
/* @__PURE__ */
|
|
1199
|
+
})
|
|
1200
|
+
}),
|
|
1201
|
+
/* @__PURE__ */ jsxs11("div", {
|
|
1202
1202
|
className: "flex items-center gap-1.5 pt-2.5",
|
|
1203
1203
|
children: [
|
|
1204
|
-
/* @__PURE__ */
|
|
1204
|
+
/* @__PURE__ */ jsx18("span", {
|
|
1205
1205
|
className: "h-2 w-2 rounded-full bg-primary/60 animate-pulse"
|
|
1206
|
-
}
|
|
1207
|
-
/* @__PURE__ */
|
|
1206
|
+
}),
|
|
1207
|
+
/* @__PURE__ */ jsx18("span", {
|
|
1208
1208
|
className: "h-2 w-2 rounded-full bg-primary/60 animate-pulse [animation-delay:150ms]"
|
|
1209
|
-
}
|
|
1210
|
-
/* @__PURE__ */
|
|
1209
|
+
}),
|
|
1210
|
+
/* @__PURE__ */ jsx18("span", {
|
|
1211
1211
|
className: "h-2 w-2 rounded-full bg-primary/60 animate-pulse [animation-delay:300ms]"
|
|
1212
|
-
}
|
|
1212
|
+
})
|
|
1213
1213
|
]
|
|
1214
|
-
}
|
|
1214
|
+
})
|
|
1215
1215
|
]
|
|
1216
|
-
}
|
|
1216
|
+
});
|
|
1217
1217
|
}
|
|
1218
1218
|
// src/ui/components/audio-recorder.tsx
|
|
1219
1219
|
import { useCallback as useCallback2, useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
|
|
1220
1220
|
import { Loader2, Mic, Square } from "lucide-react";
|
|
1221
|
-
import {
|
|
1221
|
+
import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1222
1222
|
function encodeWav(samples, sampleRate) {
|
|
1223
1223
|
const numChannels = 1;
|
|
1224
1224
|
const bitsPerSample = 16;
|
|
@@ -1433,22 +1433,22 @@ function AudioRecorder({
|
|
|
1433
1433
|
};
|
|
1434
1434
|
if (!isSupported)
|
|
1435
1435
|
return null;
|
|
1436
|
-
return /* @__PURE__ */
|
|
1436
|
+
return /* @__PURE__ */ jsxs12("div", {
|
|
1437
1437
|
className: cn("flex items-center gap-1", className),
|
|
1438
1438
|
children: [
|
|
1439
|
-
isRecording && /* @__PURE__ */
|
|
1439
|
+
isRecording && /* @__PURE__ */ jsx19("span", {
|
|
1440
1440
|
className: "text-xs text-destructive font-mono animate-pulse",
|
|
1441
1441
|
children: formatDuration(duration)
|
|
1442
|
-
}
|
|
1443
|
-
isTranscribing ? /* @__PURE__ */
|
|
1442
|
+
}),
|
|
1443
|
+
isTranscribing ? /* @__PURE__ */ jsxs12("span", {
|
|
1444
1444
|
className: "flex items-center gap-1.5 text-xs text-muted-foreground",
|
|
1445
1445
|
children: [
|
|
1446
|
-
/* @__PURE__ */
|
|
1446
|
+
/* @__PURE__ */ jsx19(Loader2, {
|
|
1447
1447
|
className: "size-3.5 animate-spin"
|
|
1448
|
-
}
|
|
1448
|
+
}),
|
|
1449
1449
|
resolvedLabels.transcribing
|
|
1450
1450
|
]
|
|
1451
|
-
}
|
|
1451
|
+
}) : /* @__PURE__ */ jsx19(Button, {
|
|
1452
1452
|
type: "button",
|
|
1453
1453
|
variant: "ghost",
|
|
1454
1454
|
size: "icon",
|
|
@@ -1456,49 +1456,49 @@ function AudioRecorder({
|
|
|
1456
1456
|
disabled,
|
|
1457
1457
|
onClick: isRecording ? stopRecording : startRecording,
|
|
1458
1458
|
title: isRecording ? resolvedLabels.stopRecording : resolvedLabels.recordAudio,
|
|
1459
|
-
children: isRecording ? /* @__PURE__ */
|
|
1459
|
+
children: isRecording ? /* @__PURE__ */ jsx19(Square, {
|
|
1460
1460
|
className: "size-4 fill-current"
|
|
1461
|
-
}
|
|
1461
|
+
}) : /* @__PURE__ */ jsx19(Mic, {
|
|
1462
1462
|
className: "size-4"
|
|
1463
|
-
}
|
|
1464
|
-
}
|
|
1463
|
+
})
|
|
1464
|
+
})
|
|
1465
1465
|
]
|
|
1466
|
-
}
|
|
1466
|
+
});
|
|
1467
1467
|
}
|
|
1468
1468
|
// src/ui/components/smart-timestamp.tsx
|
|
1469
|
-
import {
|
|
1469
|
+
import { jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1470
1470
|
function SmartTimestamp({ date, formatShort, className }) {
|
|
1471
1471
|
const shortText = formatShort ? formatShort(date) : formatSmartTimestamp(date);
|
|
1472
1472
|
const fullText = formatFullTimestamp(date);
|
|
1473
|
-
return /* @__PURE__ */
|
|
1474
|
-
children: /* @__PURE__ */
|
|
1473
|
+
return /* @__PURE__ */ jsx20(TooltipProvider, {
|
|
1474
|
+
children: /* @__PURE__ */ jsxs13(Tooltip, {
|
|
1475
1475
|
children: [
|
|
1476
|
-
/* @__PURE__ */
|
|
1476
|
+
/* @__PURE__ */ jsx20(TooltipTrigger, {
|
|
1477
1477
|
asChild: true,
|
|
1478
|
-
children: /* @__PURE__ */
|
|
1478
|
+
children: /* @__PURE__ */ jsx20("span", {
|
|
1479
1479
|
className,
|
|
1480
1480
|
children: shortText
|
|
1481
|
-
}
|
|
1482
|
-
}
|
|
1483
|
-
/* @__PURE__ */
|
|
1484
|
-
children: /* @__PURE__ */
|
|
1481
|
+
})
|
|
1482
|
+
}),
|
|
1483
|
+
/* @__PURE__ */ jsx20(TooltipContent, {
|
|
1484
|
+
children: /* @__PURE__ */ jsx20("p", {
|
|
1485
1485
|
children: fullText
|
|
1486
|
-
}
|
|
1487
|
-
}
|
|
1486
|
+
})
|
|
1487
|
+
})
|
|
1488
1488
|
]
|
|
1489
|
-
}
|
|
1490
|
-
}
|
|
1489
|
+
})
|
|
1490
|
+
});
|
|
1491
1491
|
}
|
|
1492
1492
|
// src/ui/components/file-preview-card.tsx
|
|
1493
1493
|
import { FileIcon, Search as Search2 } from "lucide-react";
|
|
1494
|
-
import {
|
|
1494
|
+
import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1495
1495
|
function ExtBadge({ ext }) {
|
|
1496
1496
|
if (!ext)
|
|
1497
1497
|
return null;
|
|
1498
|
-
return /* @__PURE__ */
|
|
1498
|
+
return /* @__PURE__ */ jsx21("span", {
|
|
1499
1499
|
className: "absolute bottom-1.5 left-1.5 rounded px-1 py-0.5 text-[9px] font-semibold uppercase leading-none bg-background/80 text-muted-foreground border border-border/50 backdrop-blur-sm",
|
|
1500
1500
|
children: ext
|
|
1501
|
-
}
|
|
1501
|
+
});
|
|
1502
1502
|
}
|
|
1503
1503
|
function FilePreviewCard({ file, onClick, className }) {
|
|
1504
1504
|
const previewType = getFilePreviewType(file.type);
|
|
@@ -1506,214 +1506,214 @@ function FilePreviewCard({ file, onClick, className }) {
|
|
|
1506
1506
|
const ext = getFileExtension(file.name, file.type);
|
|
1507
1507
|
const cardBase = cn("group relative flex flex-col overflow-hidden rounded-xl border border-border bg-muted/20 w-28 h-28", isClickable && "cursor-pointer hover:border-foreground/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 transition-colors", className);
|
|
1508
1508
|
if (previewType === "image" && file.url) {
|
|
1509
|
-
return /* @__PURE__ */
|
|
1509
|
+
return /* @__PURE__ */ jsxs14("button", {
|
|
1510
1510
|
type: "button",
|
|
1511
1511
|
onClick,
|
|
1512
1512
|
disabled: !isClickable,
|
|
1513
1513
|
className: cardBase,
|
|
1514
1514
|
children: [
|
|
1515
|
-
/* @__PURE__ */
|
|
1515
|
+
/* @__PURE__ */ jsx21("img", {
|
|
1516
1516
|
src: file.url,
|
|
1517
1517
|
alt: file.name,
|
|
1518
1518
|
className: "w-full h-full object-cover"
|
|
1519
|
-
}
|
|
1520
|
-
/* @__PURE__ */
|
|
1519
|
+
}),
|
|
1520
|
+
/* @__PURE__ */ jsx21(ExtBadge, {
|
|
1521
1521
|
ext
|
|
1522
|
-
}
|
|
1523
|
-
isClickable && /* @__PURE__ */
|
|
1522
|
+
}),
|
|
1523
|
+
isClickable && /* @__PURE__ */ jsx21("div", {
|
|
1524
1524
|
className: "absolute inset-0 flex items-center justify-center bg-black/0 group-hover:bg-black/30 transition-colors",
|
|
1525
|
-
children: /* @__PURE__ */
|
|
1525
|
+
children: /* @__PURE__ */ jsx21(Search2, {
|
|
1526
1526
|
className: "h-5 w-5 text-white opacity-0 group-hover:opacity-100 transition-opacity"
|
|
1527
|
-
}
|
|
1528
|
-
}
|
|
1527
|
+
})
|
|
1528
|
+
})
|
|
1529
1529
|
]
|
|
1530
|
-
}
|
|
1530
|
+
});
|
|
1531
1531
|
}
|
|
1532
1532
|
if (previewType === "pdf" && file.url) {
|
|
1533
|
-
return /* @__PURE__ */
|
|
1533
|
+
return /* @__PURE__ */ jsxs14("button", {
|
|
1534
1534
|
type: "button",
|
|
1535
1535
|
onClick,
|
|
1536
1536
|
disabled: !isClickable,
|
|
1537
1537
|
className: cardBase,
|
|
1538
1538
|
children: [
|
|
1539
|
-
/* @__PURE__ */
|
|
1539
|
+
/* @__PURE__ */ jsx21("div", {
|
|
1540
1540
|
className: "w-full h-full overflow-hidden pointer-events-none",
|
|
1541
|
-
children: /* @__PURE__ */
|
|
1541
|
+
children: /* @__PURE__ */ jsx21("object", {
|
|
1542
1542
|
data: `${file.url}#page=1&view=FitH`,
|
|
1543
1543
|
type: "application/pdf",
|
|
1544
1544
|
className: "w-[200%] h-[200%] origin-top-left scale-50",
|
|
1545
1545
|
"aria-label": file.name,
|
|
1546
|
-
children: /* @__PURE__ */
|
|
1546
|
+
children: /* @__PURE__ */ jsx21("div", {
|
|
1547
1547
|
className: "flex items-center justify-center w-full h-full",
|
|
1548
|
-
children: /* @__PURE__ */
|
|
1548
|
+
children: /* @__PURE__ */ jsx21(FileIcon, {
|
|
1549
1549
|
className: "h-8 w-8 text-muted-foreground/40"
|
|
1550
|
-
}
|
|
1551
|
-
}
|
|
1552
|
-
}
|
|
1553
|
-
}
|
|
1554
|
-
/* @__PURE__ */
|
|
1550
|
+
})
|
|
1551
|
+
})
|
|
1552
|
+
})
|
|
1553
|
+
}),
|
|
1554
|
+
/* @__PURE__ */ jsx21(ExtBadge, {
|
|
1555
1555
|
ext
|
|
1556
|
-
}
|
|
1557
|
-
isClickable && /* @__PURE__ */
|
|
1556
|
+
}),
|
|
1557
|
+
isClickable && /* @__PURE__ */ jsx21("div", {
|
|
1558
1558
|
className: "absolute inset-0 flex items-center justify-center bg-black/0 group-hover:bg-black/10 transition-colors",
|
|
1559
|
-
children: /* @__PURE__ */
|
|
1559
|
+
children: /* @__PURE__ */ jsx21(Search2, {
|
|
1560
1560
|
className: "h-5 w-5 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"
|
|
1561
|
-
}
|
|
1562
|
-
}
|
|
1561
|
+
})
|
|
1562
|
+
})
|
|
1563
1563
|
]
|
|
1564
|
-
}
|
|
1564
|
+
});
|
|
1565
1565
|
}
|
|
1566
|
-
return /* @__PURE__ */
|
|
1566
|
+
return /* @__PURE__ */ jsxs14("button", {
|
|
1567
1567
|
type: "button",
|
|
1568
1568
|
onClick,
|
|
1569
1569
|
disabled: !isClickable,
|
|
1570
1570
|
className: cardBase,
|
|
1571
1571
|
children: [
|
|
1572
|
-
/* @__PURE__ */
|
|
1572
|
+
/* @__PURE__ */ jsx21("div", {
|
|
1573
1573
|
className: "flex-1 flex items-center justify-center",
|
|
1574
|
-
children: /* @__PURE__ */
|
|
1574
|
+
children: /* @__PURE__ */ jsx21(FileIcon, {
|
|
1575
1575
|
className: "h-8 w-8 text-muted-foreground/40"
|
|
1576
|
-
}
|
|
1577
|
-
}
|
|
1578
|
-
/* @__PURE__ */
|
|
1576
|
+
})
|
|
1577
|
+
}),
|
|
1578
|
+
/* @__PURE__ */ jsxs14("div", {
|
|
1579
1579
|
className: "w-full text-center min-w-0 px-2 pb-2 space-y-0.5",
|
|
1580
1580
|
children: [
|
|
1581
|
-
/* @__PURE__ */
|
|
1581
|
+
/* @__PURE__ */ jsx21("p", {
|
|
1582
1582
|
className: "text-[10px] text-foreground truncate leading-tight",
|
|
1583
1583
|
title: file.name,
|
|
1584
1584
|
children: file.name
|
|
1585
|
-
}
|
|
1586
|
-
file.size != null && file.size > 0 && /* @__PURE__ */
|
|
1585
|
+
}),
|
|
1586
|
+
file.size != null && file.size > 0 && /* @__PURE__ */ jsx21("p", {
|
|
1587
1587
|
className: "text-[9px] text-muted-foreground leading-tight",
|
|
1588
1588
|
children: formatFileSize(file.size)
|
|
1589
|
-
}
|
|
1589
|
+
})
|
|
1590
1590
|
]
|
|
1591
|
-
}
|
|
1592
|
-
/* @__PURE__ */
|
|
1591
|
+
}),
|
|
1592
|
+
/* @__PURE__ */ jsx21(ExtBadge, {
|
|
1593
1593
|
ext
|
|
1594
|
-
}
|
|
1594
|
+
})
|
|
1595
1595
|
]
|
|
1596
|
-
}
|
|
1596
|
+
});
|
|
1597
1597
|
}
|
|
1598
1598
|
// src/ui/components/file-preview-modal.tsx
|
|
1599
1599
|
import { Download, FileIcon as FileIcon2 } from "lucide-react";
|
|
1600
|
-
import {
|
|
1600
|
+
import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1601
1601
|
function FilePreviewModal({ open, onOpenChange, file }) {
|
|
1602
1602
|
if (!file)
|
|
1603
1603
|
return null;
|
|
1604
1604
|
const previewType = getFilePreviewType(file.type);
|
|
1605
1605
|
const canPreview = isPreviewable(file.type) && !!file.url;
|
|
1606
|
-
return /* @__PURE__ */
|
|
1606
|
+
return /* @__PURE__ */ jsx22(Dialog, {
|
|
1607
1607
|
open,
|
|
1608
1608
|
onOpenChange,
|
|
1609
|
-
children: previewType === "image" && file.url ? /* @__PURE__ */
|
|
1609
|
+
children: previewType === "image" && file.url ? /* @__PURE__ */ jsxs15(DialogContent, {
|
|
1610
1610
|
variant: "lightbox",
|
|
1611
1611
|
"aria-describedby": undefined,
|
|
1612
1612
|
children: [
|
|
1613
|
-
/* @__PURE__ */
|
|
1613
|
+
/* @__PURE__ */ jsx22(DialogTitle, {
|
|
1614
1614
|
className: "sr-only",
|
|
1615
1615
|
children: file.name
|
|
1616
|
-
}
|
|
1617
|
-
/* @__PURE__ */
|
|
1616
|
+
}),
|
|
1617
|
+
/* @__PURE__ */ jsx22("img", {
|
|
1618
1618
|
src: file.url,
|
|
1619
1619
|
alt: file.name,
|
|
1620
1620
|
className: "max-h-[85vh] max-w-full object-contain rounded-md"
|
|
1621
|
-
}
|
|
1621
|
+
})
|
|
1622
1622
|
]
|
|
1623
|
-
}
|
|
1623
|
+
}) : previewType === "pdf" && file.url ? /* @__PURE__ */ jsxs15(DialogContent, {
|
|
1624
1624
|
variant: "lightbox",
|
|
1625
1625
|
className: "w-[80vw] h-[85vh]",
|
|
1626
1626
|
"aria-describedby": undefined,
|
|
1627
1627
|
children: [
|
|
1628
|
-
/* @__PURE__ */
|
|
1628
|
+
/* @__PURE__ */ jsx22(DialogTitle, {
|
|
1629
1629
|
className: "sr-only",
|
|
1630
1630
|
children: file.name
|
|
1631
|
-
}
|
|
1632
|
-
/* @__PURE__ */
|
|
1631
|
+
}),
|
|
1632
|
+
/* @__PURE__ */ jsx22("object", {
|
|
1633
1633
|
data: file.url,
|
|
1634
1634
|
type: "application/pdf",
|
|
1635
1635
|
className: "w-full h-full rounded-md",
|
|
1636
|
-
children: /* @__PURE__ */
|
|
1636
|
+
children: /* @__PURE__ */ jsxs15("div", {
|
|
1637
1637
|
className: "flex flex-col items-center justify-center h-full gap-3 text-muted-foreground",
|
|
1638
1638
|
children: [
|
|
1639
|
-
/* @__PURE__ */
|
|
1639
|
+
/* @__PURE__ */ jsx22("p", {
|
|
1640
1640
|
className: "text-sm",
|
|
1641
1641
|
children: "Unable to display PDF"
|
|
1642
|
-
}
|
|
1643
|
-
/* @__PURE__ */
|
|
1642
|
+
}),
|
|
1643
|
+
/* @__PURE__ */ jsxs15("a", {
|
|
1644
1644
|
href: file.url,
|
|
1645
1645
|
target: "_blank",
|
|
1646
1646
|
rel: "noopener noreferrer",
|
|
1647
1647
|
className: "inline-flex items-center gap-1.5 text-sm text-primary hover:underline",
|
|
1648
1648
|
children: [
|
|
1649
|
-
/* @__PURE__ */
|
|
1649
|
+
/* @__PURE__ */ jsx22(Download, {
|
|
1650
1650
|
className: "h-4 w-4"
|
|
1651
|
-
}
|
|
1651
|
+
}),
|
|
1652
1652
|
"Download ",
|
|
1653
1653
|
file.name
|
|
1654
1654
|
]
|
|
1655
|
-
}
|
|
1655
|
+
})
|
|
1656
1656
|
]
|
|
1657
|
-
}
|
|
1658
|
-
}
|
|
1657
|
+
})
|
|
1658
|
+
})
|
|
1659
1659
|
]
|
|
1660
|
-
}
|
|
1660
|
+
}) : /* @__PURE__ */ jsxs15(DialogContent, {
|
|
1661
1661
|
children: [
|
|
1662
|
-
/* @__PURE__ */
|
|
1662
|
+
/* @__PURE__ */ jsxs15(DialogHeader, {
|
|
1663
1663
|
children: [
|
|
1664
|
-
/* @__PURE__ */
|
|
1664
|
+
/* @__PURE__ */ jsxs15(DialogTitle, {
|
|
1665
1665
|
className: "flex items-center gap-2",
|
|
1666
1666
|
children: [
|
|
1667
|
-
/* @__PURE__ */
|
|
1667
|
+
/* @__PURE__ */ jsx22(FileIcon2, {
|
|
1668
1668
|
className: "h-5 w-5 text-muted-foreground"
|
|
1669
|
-
}
|
|
1669
|
+
}),
|
|
1670
1670
|
file.name
|
|
1671
1671
|
]
|
|
1672
|
-
}
|
|
1673
|
-
/* @__PURE__ */
|
|
1672
|
+
}),
|
|
1673
|
+
/* @__PURE__ */ jsxs15(DialogDescription, {
|
|
1674
1674
|
children: [
|
|
1675
|
-
file.size != null && file.size > 0 && /* @__PURE__ */
|
|
1675
|
+
file.size != null && file.size > 0 && /* @__PURE__ */ jsx22("span", {
|
|
1676
1676
|
children: formatFileSize(file.size)
|
|
1677
|
-
}
|
|
1678
|
-
!canPreview && /* @__PURE__ */
|
|
1677
|
+
}),
|
|
1678
|
+
!canPreview && /* @__PURE__ */ jsx22("span", {
|
|
1679
1679
|
children: " · Preview not available for this file type"
|
|
1680
|
-
}
|
|
1680
|
+
})
|
|
1681
1681
|
]
|
|
1682
|
-
}
|
|
1682
|
+
})
|
|
1683
1683
|
]
|
|
1684
|
-
}
|
|
1685
|
-
/* @__PURE__ */
|
|
1684
|
+
}),
|
|
1685
|
+
/* @__PURE__ */ jsxs15("div", {
|
|
1686
1686
|
className: "flex flex-col items-center justify-center py-8 text-muted-foreground gap-3",
|
|
1687
1687
|
children: [
|
|
1688
|
-
/* @__PURE__ */
|
|
1688
|
+
/* @__PURE__ */ jsx22(FileIcon2, {
|
|
1689
1689
|
className: "h-12 w-12"
|
|
1690
|
-
}
|
|
1691
|
-
/* @__PURE__ */
|
|
1690
|
+
}),
|
|
1691
|
+
/* @__PURE__ */ jsx22("p", {
|
|
1692
1692
|
className: "text-sm",
|
|
1693
1693
|
children: "Preview not available"
|
|
1694
|
-
}
|
|
1695
|
-
file.url && /^https?:\/\//i.test(file.url) && /* @__PURE__ */
|
|
1694
|
+
}),
|
|
1695
|
+
file.url && /^https?:\/\//i.test(file.url) && /* @__PURE__ */ jsxs15("a", {
|
|
1696
1696
|
href: file.url,
|
|
1697
1697
|
target: "_blank",
|
|
1698
1698
|
rel: "noopener noreferrer",
|
|
1699
1699
|
className: "inline-flex items-center gap-1.5 text-sm text-primary hover:underline",
|
|
1700
1700
|
children: [
|
|
1701
|
-
/* @__PURE__ */
|
|
1701
|
+
/* @__PURE__ */ jsx22(Download, {
|
|
1702
1702
|
className: "h-4 w-4"
|
|
1703
|
-
}
|
|
1703
|
+
}),
|
|
1704
1704
|
"Download file"
|
|
1705
1705
|
]
|
|
1706
|
-
}
|
|
1706
|
+
})
|
|
1707
1707
|
]
|
|
1708
|
-
}
|
|
1708
|
+
})
|
|
1709
1709
|
]
|
|
1710
|
-
}
|
|
1711
|
-
}
|
|
1710
|
+
})
|
|
1711
|
+
});
|
|
1712
1712
|
}
|
|
1713
1713
|
// src/ui/components/image-lightbox.tsx
|
|
1714
1714
|
import { useState as useState3, useEffect as useEffect3, useCallback as useCallback3 } from "react";
|
|
1715
1715
|
import { ChevronLeft, ChevronRight as ChevronRight2 } from "lucide-react";
|
|
1716
|
-
import {
|
|
1716
|
+
import { jsx as jsx23, jsxs as jsxs16, Fragment as Fragment3 } from "react/jsx-runtime";
|
|
1717
1717
|
function ImageLightbox({ open, onOpenChange, images, initialIndex = 0 }) {
|
|
1718
1718
|
const [currentIndex, setCurrentIndex] = useState3(initialIndex);
|
|
1719
1719
|
const hasMultiple = images.length > 1;
|
|
@@ -1744,70 +1744,70 @@ function ImageLightbox({ open, onOpenChange, images, initialIndex = 0 }) {
|
|
|
1744
1744
|
const current = images[currentIndex];
|
|
1745
1745
|
if (!current)
|
|
1746
1746
|
return null;
|
|
1747
|
-
return /* @__PURE__ */
|
|
1747
|
+
return /* @__PURE__ */ jsx23(Dialog, {
|
|
1748
1748
|
open,
|
|
1749
1749
|
onOpenChange,
|
|
1750
|
-
children: /* @__PURE__ */
|
|
1750
|
+
children: /* @__PURE__ */ jsxs16(DialogContent, {
|
|
1751
1751
|
variant: "lightbox",
|
|
1752
1752
|
"aria-describedby": undefined,
|
|
1753
1753
|
children: [
|
|
1754
|
-
/* @__PURE__ */
|
|
1754
|
+
/* @__PURE__ */ jsx23(DialogTitle, {
|
|
1755
1755
|
className: "sr-only",
|
|
1756
1756
|
children: current.alt || `Image ${currentIndex + 1} of ${images.length}`
|
|
1757
|
-
}
|
|
1758
|
-
/* @__PURE__ */
|
|
1757
|
+
}),
|
|
1758
|
+
/* @__PURE__ */ jsxs16("div", {
|
|
1759
1759
|
className: "relative flex items-center justify-center",
|
|
1760
1760
|
children: [
|
|
1761
|
-
/* @__PURE__ */
|
|
1761
|
+
/* @__PURE__ */ jsx23("img", {
|
|
1762
1762
|
src: current.url,
|
|
1763
1763
|
alt: current.alt || "Image preview",
|
|
1764
1764
|
className: "max-h-[85vh] max-w-full object-contain rounded-md"
|
|
1765
|
-
}
|
|
1766
|
-
hasMultiple && /* @__PURE__ */
|
|
1765
|
+
}),
|
|
1766
|
+
hasMultiple && /* @__PURE__ */ jsxs16(Fragment3, {
|
|
1767
1767
|
children: [
|
|
1768
|
-
/* @__PURE__ */
|
|
1768
|
+
/* @__PURE__ */ jsxs16("button", {
|
|
1769
1769
|
type: "button",
|
|
1770
1770
|
onClick: goPrev,
|
|
1771
1771
|
className: cn("absolute left-2 top-1/2 -translate-y-1/2 rounded-full bg-black/50 p-2 text-white", "hover:bg-black/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors"),
|
|
1772
1772
|
children: [
|
|
1773
|
-
/* @__PURE__ */
|
|
1773
|
+
/* @__PURE__ */ jsx23(ChevronLeft, {
|
|
1774
1774
|
className: "h-5 w-5"
|
|
1775
|
-
}
|
|
1776
|
-
/* @__PURE__ */
|
|
1775
|
+
}),
|
|
1776
|
+
/* @__PURE__ */ jsx23("span", {
|
|
1777
1777
|
className: "sr-only",
|
|
1778
1778
|
children: "Previous image"
|
|
1779
|
-
}
|
|
1779
|
+
})
|
|
1780
1780
|
]
|
|
1781
|
-
}
|
|
1782
|
-
/* @__PURE__ */
|
|
1781
|
+
}),
|
|
1782
|
+
/* @__PURE__ */ jsxs16("button", {
|
|
1783
1783
|
type: "button",
|
|
1784
1784
|
onClick: goNext,
|
|
1785
1785
|
className: cn("absolute right-2 top-1/2 -translate-y-1/2 rounded-full bg-black/50 p-2 text-white", "hover:bg-black/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors"),
|
|
1786
1786
|
children: [
|
|
1787
|
-
/* @__PURE__ */
|
|
1787
|
+
/* @__PURE__ */ jsx23(ChevronRight2, {
|
|
1788
1788
|
className: "h-5 w-5"
|
|
1789
|
-
}
|
|
1790
|
-
/* @__PURE__ */
|
|
1789
|
+
}),
|
|
1790
|
+
/* @__PURE__ */ jsx23("span", {
|
|
1791
1791
|
className: "sr-only",
|
|
1792
1792
|
children: "Next image"
|
|
1793
|
-
}
|
|
1793
|
+
})
|
|
1794
1794
|
]
|
|
1795
|
-
}
|
|
1796
|
-
/* @__PURE__ */
|
|
1795
|
+
}),
|
|
1796
|
+
/* @__PURE__ */ jsxs16("div", {
|
|
1797
1797
|
className: "absolute bottom-2 left-1/2 -translate-x-1/2 rounded-full bg-black/50 px-3 py-1 text-xs text-white",
|
|
1798
1798
|
children: [
|
|
1799
1799
|
currentIndex + 1,
|
|
1800
1800
|
" / ",
|
|
1801
1801
|
images.length
|
|
1802
1802
|
]
|
|
1803
|
-
}
|
|
1803
|
+
})
|
|
1804
1804
|
]
|
|
1805
|
-
}
|
|
1805
|
+
})
|
|
1806
1806
|
]
|
|
1807
|
-
}
|
|
1807
|
+
})
|
|
1808
1808
|
]
|
|
1809
|
-
}
|
|
1810
|
-
}
|
|
1809
|
+
})
|
|
1810
|
+
});
|
|
1811
1811
|
}
|
|
1812
1812
|
// src/ui/components/prompt-input/context.ts
|
|
1813
1813
|
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
@@ -1843,7 +1843,7 @@ var DropZoneContext = createContext2({ isDraggingOver: false });
|
|
|
1843
1843
|
var usePromptInputDropZone = () => useContext2(DropZoneContext);
|
|
1844
1844
|
// src/ui/components/prompt-input/provider.tsx
|
|
1845
1845
|
import { useCallback as useCallback4, useMemo, useRef as useRef3, useState as useState4 } from "react";
|
|
1846
|
-
import {
|
|
1846
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1847
1847
|
function generateId() {
|
|
1848
1848
|
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
|
|
1849
1849
|
return crypto.randomUUID();
|
|
@@ -1904,17 +1904,17 @@ function PromptInputProvider({ initialInput: initialTextInput = "", children })
|
|
|
1904
1904
|
attachments,
|
|
1905
1905
|
__registerFileInput
|
|
1906
1906
|
}), [textInput, clearInput, attachments, __registerFileInput]);
|
|
1907
|
-
return /* @__PURE__ */
|
|
1907
|
+
return /* @__PURE__ */ jsx24(PromptInputController.Provider, {
|
|
1908
1908
|
value: controller,
|
|
1909
|
-
children: /* @__PURE__ */
|
|
1909
|
+
children: /* @__PURE__ */ jsx24(ProviderAttachmentsContext.Provider, {
|
|
1910
1910
|
value: attachments,
|
|
1911
1911
|
children
|
|
1912
|
-
}
|
|
1913
|
-
}
|
|
1912
|
+
})
|
|
1913
|
+
});
|
|
1914
1914
|
}
|
|
1915
1915
|
// src/ui/components/prompt-input/prompt-input.tsx
|
|
1916
1916
|
import { useCallback as useCallback5, useEffect as useEffect4, useMemo as useMemo2, useRef as useRef4, useState as useState5 } from "react";
|
|
1917
|
-
import {
|
|
1917
|
+
import { jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1918
1918
|
function generateId2() {
|
|
1919
1919
|
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
|
|
1920
1920
|
return crypto.randomUUID();
|
|
@@ -2166,15 +2166,15 @@ var PromptInput = ({
|
|
|
2166
2166
|
});
|
|
2167
2167
|
};
|
|
2168
2168
|
const dropZoneValue = useMemo2(() => ({ isDraggingOver }), [isDraggingOver]);
|
|
2169
|
-
const inner = /* @__PURE__ */
|
|
2169
|
+
const inner = /* @__PURE__ */ jsx25(DropZoneContext.Provider, {
|
|
2170
2170
|
value: dropZoneValue,
|
|
2171
|
-
children: /* @__PURE__ */
|
|
2171
|
+
children: /* @__PURE__ */ jsxs17("form", {
|
|
2172
2172
|
className: cn("relative w-full", className),
|
|
2173
2173
|
onSubmit: handleSubmit,
|
|
2174
2174
|
ref: formRef,
|
|
2175
2175
|
...props,
|
|
2176
2176
|
children: [
|
|
2177
|
-
/* @__PURE__ */
|
|
2177
|
+
/* @__PURE__ */ jsx25("input", {
|
|
2178
2178
|
accept,
|
|
2179
2179
|
"aria-label": "Upload files",
|
|
2180
2180
|
className: "hidden",
|
|
@@ -2183,21 +2183,21 @@ var PromptInput = ({
|
|
|
2183
2183
|
ref: inputRef,
|
|
2184
2184
|
title: "Upload files",
|
|
2185
2185
|
type: "file"
|
|
2186
|
-
}
|
|
2187
|
-
/* @__PURE__ */
|
|
2186
|
+
}),
|
|
2187
|
+
/* @__PURE__ */ jsx25(InputGroup, {
|
|
2188
2188
|
children
|
|
2189
|
-
}
|
|
2189
|
+
})
|
|
2190
2190
|
]
|
|
2191
|
-
}
|
|
2192
|
-
}
|
|
2193
|
-
return usingProvider ? inner : /* @__PURE__ */
|
|
2191
|
+
})
|
|
2192
|
+
});
|
|
2193
|
+
return usingProvider ? inner : /* @__PURE__ */ jsx25(LocalAttachmentsContext.Provider, {
|
|
2194
2194
|
value: ctx,
|
|
2195
2195
|
children: inner
|
|
2196
|
-
}
|
|
2196
|
+
});
|
|
2197
2197
|
};
|
|
2198
2198
|
// src/ui/components/prompt-input/textarea.tsx
|
|
2199
2199
|
import { useState as useState6 } from "react";
|
|
2200
|
-
import {
|
|
2200
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
2201
2201
|
var PromptInputTextarea = ({
|
|
2202
2202
|
onChange,
|
|
2203
2203
|
className,
|
|
@@ -2247,7 +2247,7 @@ var PromptInputTextarea = ({
|
|
|
2247
2247
|
onChange?.(e);
|
|
2248
2248
|
}
|
|
2249
2249
|
} : { onChange };
|
|
2250
|
-
return /* @__PURE__ */
|
|
2250
|
+
return /* @__PURE__ */ jsx26(InputGroupTextarea, {
|
|
2251
2251
|
className: cn("[field-sizing:content] max-h-48 text-base", className),
|
|
2252
2252
|
rows: 1,
|
|
2253
2253
|
name: "message",
|
|
@@ -2258,52 +2258,52 @@ var PromptInputTextarea = ({
|
|
|
2258
2258
|
placeholder,
|
|
2259
2259
|
...props,
|
|
2260
2260
|
...controlledProps
|
|
2261
|
-
}
|
|
2261
|
+
});
|
|
2262
2262
|
};
|
|
2263
2263
|
// src/ui/components/prompt-input/attachments.tsx
|
|
2264
2264
|
import { ImageIcon, MicIcon, PaperclipIcon, XIcon as XIcon2 } from "lucide-react";
|
|
2265
2265
|
import { Fragment as Fragment4 } from "react";
|
|
2266
|
-
import {
|
|
2266
|
+
import { jsx as jsx27, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2267
2267
|
function PromptInputAttachment({ data, className, ...props }) {
|
|
2268
2268
|
const attachments = usePromptInputAttachments();
|
|
2269
2269
|
const filename = data.filename || "";
|
|
2270
2270
|
const isImage = data.mediaType?.startsWith("image/") && data.url;
|
|
2271
2271
|
const isAudio = data.mediaType?.startsWith("audio/");
|
|
2272
2272
|
const attachmentLabel = filename || (isImage ? "Image" : isAudio ? "Audio" : "Attachment");
|
|
2273
|
-
return /* @__PURE__ */
|
|
2273
|
+
return /* @__PURE__ */ jsxs18(HoverCard, {
|
|
2274
2274
|
openDelay: 0,
|
|
2275
2275
|
closeDelay: 0,
|
|
2276
2276
|
children: [
|
|
2277
|
-
/* @__PURE__ */
|
|
2277
|
+
/* @__PURE__ */ jsx27(HoverCardTrigger, {
|
|
2278
2278
|
asChild: true,
|
|
2279
|
-
children: /* @__PURE__ */
|
|
2279
|
+
children: /* @__PURE__ */ jsxs18("div", {
|
|
2280
2280
|
className: cn("group relative flex h-8 cursor-default select-none items-center gap-1.5 rounded-md border border-border px-1.5 font-medium text-sm transition-all hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50", className),
|
|
2281
2281
|
...props,
|
|
2282
2282
|
children: [
|
|
2283
|
-
/* @__PURE__ */
|
|
2283
|
+
/* @__PURE__ */ jsxs18("div", {
|
|
2284
2284
|
className: "relative size-5 shrink-0",
|
|
2285
2285
|
children: [
|
|
2286
|
-
/* @__PURE__ */
|
|
2286
|
+
/* @__PURE__ */ jsx27("div", {
|
|
2287
2287
|
className: "absolute inset-0 flex size-5 items-center justify-center overflow-hidden rounded bg-background transition-opacity group-hover:opacity-0",
|
|
2288
|
-
children: isImage ? /* @__PURE__ */
|
|
2288
|
+
children: isImage ? /* @__PURE__ */ jsx27("img", {
|
|
2289
2289
|
alt: filename || "attachment",
|
|
2290
2290
|
className: "size-5 object-cover",
|
|
2291
2291
|
height: 20,
|
|
2292
2292
|
src: data.url,
|
|
2293
2293
|
width: 20
|
|
2294
|
-
}
|
|
2294
|
+
}) : isAudio ? /* @__PURE__ */ jsx27("div", {
|
|
2295
2295
|
className: "flex size-5 items-center justify-center text-muted-foreground",
|
|
2296
|
-
children: /* @__PURE__ */
|
|
2296
|
+
children: /* @__PURE__ */ jsx27(MicIcon, {
|
|
2297
2297
|
className: "size-3"
|
|
2298
|
-
}
|
|
2299
|
-
}
|
|
2298
|
+
})
|
|
2299
|
+
}) : /* @__PURE__ */ jsx27("div", {
|
|
2300
2300
|
className: "flex size-5 items-center justify-center text-muted-foreground",
|
|
2301
|
-
children: /* @__PURE__ */
|
|
2301
|
+
children: /* @__PURE__ */ jsx27(PaperclipIcon, {
|
|
2302
2302
|
className: "size-3"
|
|
2303
|
-
}
|
|
2304
|
-
}
|
|
2305
|
-
}
|
|
2306
|
-
/* @__PURE__ */
|
|
2303
|
+
})
|
|
2304
|
+
})
|
|
2305
|
+
}),
|
|
2306
|
+
/* @__PURE__ */ jsxs18(Button, {
|
|
2307
2307
|
"aria-label": "Remove attachment",
|
|
2308
2308
|
className: "absolute inset-0 size-5 cursor-pointer rounded p-0 opacity-0 transition-opacity group-hover:pointer-events-auto group-hover:opacity-100 [&>svg]:size-2.5",
|
|
2309
2309
|
onClick: (e) => {
|
|
@@ -2313,119 +2313,119 @@ function PromptInputAttachment({ data, className, ...props }) {
|
|
|
2313
2313
|
type: "button",
|
|
2314
2314
|
variant: "ghost",
|
|
2315
2315
|
children: [
|
|
2316
|
-
/* @__PURE__ */
|
|
2317
|
-
/* @__PURE__ */
|
|
2316
|
+
/* @__PURE__ */ jsx27(XIcon2, {}),
|
|
2317
|
+
/* @__PURE__ */ jsx27("span", {
|
|
2318
2318
|
className: "sr-only",
|
|
2319
2319
|
children: "Remove"
|
|
2320
|
-
}
|
|
2320
|
+
})
|
|
2321
2321
|
]
|
|
2322
|
-
}
|
|
2322
|
+
})
|
|
2323
2323
|
]
|
|
2324
|
-
}
|
|
2325
|
-
/* @__PURE__ */
|
|
2324
|
+
}),
|
|
2325
|
+
/* @__PURE__ */ jsx27("span", {
|
|
2326
2326
|
className: "flex-1 truncate",
|
|
2327
2327
|
children: attachmentLabel
|
|
2328
|
-
}
|
|
2328
|
+
})
|
|
2329
2329
|
]
|
|
2330
|
-
}, data.id
|
|
2331
|
-
}
|
|
2332
|
-
/* @__PURE__ */
|
|
2330
|
+
}, data.id)
|
|
2331
|
+
}),
|
|
2332
|
+
/* @__PURE__ */ jsx27(HoverCardContent, {
|
|
2333
2333
|
align: "start",
|
|
2334
2334
|
className: "w-auto p-2",
|
|
2335
|
-
children: /* @__PURE__ */
|
|
2335
|
+
children: /* @__PURE__ */ jsxs18("div", {
|
|
2336
2336
|
className: "w-auto space-y-3",
|
|
2337
2337
|
children: [
|
|
2338
|
-
isImage && /* @__PURE__ */
|
|
2338
|
+
isImage && /* @__PURE__ */ jsx27("div", {
|
|
2339
2339
|
className: "flex max-h-96 w-96 items-center justify-center overflow-hidden rounded-md border",
|
|
2340
|
-
children: /* @__PURE__ */
|
|
2340
|
+
children: /* @__PURE__ */ jsx27("img", {
|
|
2341
2341
|
alt: filename || "attachment preview",
|
|
2342
2342
|
className: "max-h-full max-w-full object-contain",
|
|
2343
2343
|
height: 384,
|
|
2344
2344
|
src: data.url,
|
|
2345
2345
|
width: 448
|
|
2346
|
-
}
|
|
2347
|
-
}
|
|
2348
|
-
isAudio && data.url && /* @__PURE__ */
|
|
2346
|
+
})
|
|
2347
|
+
}),
|
|
2348
|
+
isAudio && data.url && /* @__PURE__ */ jsx27("div", {
|
|
2349
2349
|
className: "w-64",
|
|
2350
|
-
children: /* @__PURE__ */
|
|
2350
|
+
children: /* @__PURE__ */ jsx27("audio", {
|
|
2351
2351
|
src: data.url,
|
|
2352
2352
|
controls: true,
|
|
2353
2353
|
className: "w-full"
|
|
2354
|
-
}
|
|
2355
|
-
}
|
|
2356
|
-
/* @__PURE__ */
|
|
2354
|
+
})
|
|
2355
|
+
}),
|
|
2356
|
+
/* @__PURE__ */ jsx27("div", {
|
|
2357
2357
|
className: "flex items-center gap-2.5",
|
|
2358
|
-
children: /* @__PURE__ */
|
|
2358
|
+
children: /* @__PURE__ */ jsxs18("div", {
|
|
2359
2359
|
className: "min-w-0 flex-1 space-y-1 px-0.5",
|
|
2360
2360
|
children: [
|
|
2361
|
-
/* @__PURE__ */
|
|
2361
|
+
/* @__PURE__ */ jsx27("h4", {
|
|
2362
2362
|
className: "truncate font-semibold text-sm leading-none",
|
|
2363
2363
|
children: filename || (isImage ? "Image" : "Attachment")
|
|
2364
|
-
}
|
|
2365
|
-
data.mediaType && /* @__PURE__ */
|
|
2364
|
+
}),
|
|
2365
|
+
data.mediaType && /* @__PURE__ */ jsx27("p", {
|
|
2366
2366
|
className: "truncate font-mono text-muted-foreground text-xs",
|
|
2367
2367
|
children: data.mediaType
|
|
2368
|
-
}
|
|
2368
|
+
})
|
|
2369
2369
|
]
|
|
2370
|
-
}
|
|
2371
|
-
}
|
|
2370
|
+
})
|
|
2371
|
+
})
|
|
2372
2372
|
]
|
|
2373
|
-
}
|
|
2374
|
-
}
|
|
2373
|
+
})
|
|
2374
|
+
})
|
|
2375
2375
|
]
|
|
2376
|
-
}
|
|
2376
|
+
});
|
|
2377
2377
|
}
|
|
2378
2378
|
function PromptInputAttachments({ children }) {
|
|
2379
2379
|
const attachments = usePromptInputAttachments();
|
|
2380
2380
|
if (!attachments.files.length)
|
|
2381
2381
|
return null;
|
|
2382
|
-
return attachments.files.map((file) => /* @__PURE__ */
|
|
2382
|
+
return attachments.files.map((file) => /* @__PURE__ */ jsx27(Fragment4, {
|
|
2383
2383
|
children: children(file)
|
|
2384
|
-
}, file.id
|
|
2384
|
+
}, file.id));
|
|
2385
2385
|
}
|
|
2386
2386
|
var PromptInputActionAddAttachments = ({
|
|
2387
2387
|
label = "Add photos or files",
|
|
2388
2388
|
...props
|
|
2389
2389
|
}) => {
|
|
2390
2390
|
const attachments = usePromptInputAttachments();
|
|
2391
|
-
return /* @__PURE__ */
|
|
2391
|
+
return /* @__PURE__ */ jsxs18(DropdownMenuItem, {
|
|
2392
2392
|
...props,
|
|
2393
2393
|
onSelect: () => {
|
|
2394
2394
|
attachments.openFileDialog();
|
|
2395
2395
|
},
|
|
2396
2396
|
children: [
|
|
2397
|
-
/* @__PURE__ */
|
|
2397
|
+
/* @__PURE__ */ jsx27(ImageIcon, {
|
|
2398
2398
|
className: "mr-2 size-4"
|
|
2399
|
-
}
|
|
2399
|
+
}),
|
|
2400
2400
|
" ",
|
|
2401
2401
|
label
|
|
2402
2402
|
]
|
|
2403
|
-
}
|
|
2403
|
+
});
|
|
2404
2404
|
};
|
|
2405
2405
|
// src/ui/components/prompt-input/footer.tsx
|
|
2406
|
-
import {
|
|
2407
|
-
var PromptInputBody = ({ className, ...props }) => /* @__PURE__ */
|
|
2406
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2407
|
+
var PromptInputBody = ({ className, ...props }) => /* @__PURE__ */ jsx28("div", {
|
|
2408
2408
|
className: cn("contents", className),
|
|
2409
2409
|
...props
|
|
2410
|
-
}
|
|
2411
|
-
var PromptInputHeader = ({ className, ...props }) => /* @__PURE__ */
|
|
2410
|
+
});
|
|
2411
|
+
var PromptInputHeader = ({ className, ...props }) => /* @__PURE__ */ jsx28(InputGroupAddon, {
|
|
2412
2412
|
align: "block-start",
|
|
2413
2413
|
className: cn("flex-wrap gap-1 empty:hidden empty:p-0", className),
|
|
2414
2414
|
...props
|
|
2415
|
-
}
|
|
2416
|
-
var PromptInputFooter = ({ className, ...props }) => /* @__PURE__ */
|
|
2415
|
+
});
|
|
2416
|
+
var PromptInputFooter = ({ className, ...props }) => /* @__PURE__ */ jsx28(InputGroupAddon, {
|
|
2417
2417
|
align: "block-end",
|
|
2418
2418
|
className: cn("justify-between gap-1", className),
|
|
2419
2419
|
...props
|
|
2420
|
-
}
|
|
2421
|
-
var PromptInputTools = ({ className, ...props }) => /* @__PURE__ */
|
|
2420
|
+
});
|
|
2421
|
+
var PromptInputTools = ({ className, ...props }) => /* @__PURE__ */ jsx28("div", {
|
|
2422
2422
|
className: cn("flex items-center gap-1", className),
|
|
2423
2423
|
...props
|
|
2424
|
-
}
|
|
2424
|
+
});
|
|
2425
2425
|
// src/ui/components/prompt-input/buttons.tsx
|
|
2426
2426
|
import { Loader2Icon, PlusIcon, SendIcon, SquareIcon, XIcon as XIcon3 } from "lucide-react";
|
|
2427
2427
|
import { Children } from "react";
|
|
2428
|
-
import {
|
|
2428
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
2429
2429
|
var PromptInputButton = ({
|
|
2430
2430
|
variant = "ghost",
|
|
2431
2431
|
className,
|
|
@@ -2433,13 +2433,13 @@ var PromptInputButton = ({
|
|
|
2433
2433
|
...props
|
|
2434
2434
|
}) => {
|
|
2435
2435
|
const newSize = size ?? (Children.count(props.children) > 1 ? "sm" : "icon-sm");
|
|
2436
|
-
return /* @__PURE__ */
|
|
2436
|
+
return /* @__PURE__ */ jsx29(InputGroupButton, {
|
|
2437
2437
|
className: cn(className),
|
|
2438
2438
|
size: newSize,
|
|
2439
2439
|
type: "button",
|
|
2440
2440
|
variant,
|
|
2441
2441
|
...props
|
|
2442
|
-
}
|
|
2442
|
+
});
|
|
2443
2443
|
};
|
|
2444
2444
|
var PromptInputSubmit = ({
|
|
2445
2445
|
className,
|
|
@@ -2449,23 +2449,23 @@ var PromptInputSubmit = ({
|
|
|
2449
2449
|
children,
|
|
2450
2450
|
...props
|
|
2451
2451
|
}) => {
|
|
2452
|
-
let Icon2 = /* @__PURE__ */
|
|
2452
|
+
let Icon2 = /* @__PURE__ */ jsx29(SendIcon, {
|
|
2453
2453
|
className: "size-4"
|
|
2454
|
-
}
|
|
2454
|
+
});
|
|
2455
2455
|
if (status === "submitted") {
|
|
2456
|
-
Icon2 = /* @__PURE__ */
|
|
2456
|
+
Icon2 = /* @__PURE__ */ jsx29(Loader2Icon, {
|
|
2457
2457
|
className: "size-4 animate-spin"
|
|
2458
|
-
}
|
|
2458
|
+
});
|
|
2459
2459
|
} else if (status === "streaming") {
|
|
2460
|
-
Icon2 = /* @__PURE__ */
|
|
2460
|
+
Icon2 = /* @__PURE__ */ jsx29(SquareIcon, {
|
|
2461
2461
|
className: "size-4"
|
|
2462
|
-
}
|
|
2462
|
+
});
|
|
2463
2463
|
} else if (status === "error") {
|
|
2464
|
-
Icon2 = /* @__PURE__ */
|
|
2464
|
+
Icon2 = /* @__PURE__ */ jsx29(XIcon3, {
|
|
2465
2465
|
className: "size-4"
|
|
2466
|
-
}
|
|
2466
|
+
});
|
|
2467
2467
|
}
|
|
2468
|
-
return /* @__PURE__ */
|
|
2468
|
+
return /* @__PURE__ */ jsx29(InputGroupButton, {
|
|
2469
2469
|
"aria-label": "Submit",
|
|
2470
2470
|
className: cn(className),
|
|
2471
2471
|
size,
|
|
@@ -2473,44 +2473,44 @@ var PromptInputSubmit = ({
|
|
|
2473
2473
|
variant,
|
|
2474
2474
|
...props,
|
|
2475
2475
|
children: children ?? Icon2
|
|
2476
|
-
}
|
|
2476
|
+
});
|
|
2477
2477
|
};
|
|
2478
|
-
var PromptInputActionMenu = (props) => /* @__PURE__ */
|
|
2478
|
+
var PromptInputActionMenu = (props) => /* @__PURE__ */ jsx29(DropdownMenu, {
|
|
2479
2479
|
...props
|
|
2480
|
-
}
|
|
2480
|
+
});
|
|
2481
2481
|
var PromptInputActionMenuTrigger = ({
|
|
2482
2482
|
className,
|
|
2483
2483
|
children,
|
|
2484
2484
|
...props
|
|
2485
|
-
}) => /* @__PURE__ */
|
|
2485
|
+
}) => /* @__PURE__ */ jsx29(DropdownMenuTrigger, {
|
|
2486
2486
|
asChild: true,
|
|
2487
|
-
children: /* @__PURE__ */
|
|
2487
|
+
children: /* @__PURE__ */ jsx29(PromptInputButton, {
|
|
2488
2488
|
className,
|
|
2489
2489
|
...props,
|
|
2490
|
-
children: children ?? /* @__PURE__ */
|
|
2490
|
+
children: children ?? /* @__PURE__ */ jsx29(PlusIcon, {
|
|
2491
2491
|
className: "size-4"
|
|
2492
|
-
}
|
|
2493
|
-
}
|
|
2494
|
-
}
|
|
2492
|
+
})
|
|
2493
|
+
})
|
|
2494
|
+
});
|
|
2495
2495
|
var PromptInputActionMenuContent = ({
|
|
2496
2496
|
className,
|
|
2497
2497
|
...props
|
|
2498
|
-
}) => /* @__PURE__ */
|
|
2498
|
+
}) => /* @__PURE__ */ jsx29(DropdownMenuContent, {
|
|
2499
2499
|
align: "start",
|
|
2500
2500
|
className: cn(className),
|
|
2501
2501
|
...props
|
|
2502
|
-
}
|
|
2502
|
+
});
|
|
2503
2503
|
var PromptInputActionMenuItem = ({
|
|
2504
2504
|
className,
|
|
2505
2505
|
...props
|
|
2506
|
-
}) => /* @__PURE__ */
|
|
2506
|
+
}) => /* @__PURE__ */ jsx29(DropdownMenuItem, {
|
|
2507
2507
|
className: cn(className),
|
|
2508
2508
|
...props
|
|
2509
|
-
}
|
|
2509
|
+
});
|
|
2510
2510
|
// src/ui/components/prompt-input/drop-zone.tsx
|
|
2511
2511
|
import { Upload } from "lucide-react";
|
|
2512
2512
|
import { createPortal } from "react-dom";
|
|
2513
|
-
import {
|
|
2513
|
+
import { jsx as jsx30, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2514
2514
|
var PromptInputDropZone = ({
|
|
2515
2515
|
label = "Drop files here",
|
|
2516
2516
|
className,
|
|
@@ -2518,20 +2518,20 @@ var PromptInputDropZone = ({
|
|
|
2518
2518
|
...props
|
|
2519
2519
|
}) => {
|
|
2520
2520
|
const { isDraggingOver } = usePromptInputDropZone();
|
|
2521
|
-
const overlay = /* @__PURE__ */
|
|
2521
|
+
const overlay = /* @__PURE__ */ jsxs19("div", {
|
|
2522
2522
|
className: cn("absolute inset-0 z-10 pointer-events-none", "flex flex-col items-center justify-center gap-2", "border-2 border-dashed border-primary rounded-xl", "bg-primary/5 backdrop-blur-[2px] text-primary", "transition-opacity duration-200", isDraggingOver ? "opacity-100" : "opacity-0", className),
|
|
2523
2523
|
"aria-hidden": !isDraggingOver,
|
|
2524
2524
|
...props,
|
|
2525
2525
|
children: [
|
|
2526
|
-
/* @__PURE__ */
|
|
2526
|
+
/* @__PURE__ */ jsx30(Upload, {
|
|
2527
2527
|
className: "size-14"
|
|
2528
|
-
}
|
|
2529
|
-
/* @__PURE__ */
|
|
2528
|
+
}),
|
|
2529
|
+
/* @__PURE__ */ jsx30("span", {
|
|
2530
2530
|
className: "text-sm font-medium mt-2",
|
|
2531
2531
|
children: label
|
|
2532
|
-
}
|
|
2532
|
+
})
|
|
2533
2533
|
]
|
|
2534
|
-
}
|
|
2534
|
+
});
|
|
2535
2535
|
if (container?.current) {
|
|
2536
2536
|
return createPortal(overlay, container.current);
|
|
2537
2537
|
}
|
|
@@ -2540,7 +2540,7 @@ var PromptInputDropZone = ({
|
|
|
2540
2540
|
// src/ui/components/prompt-input/speech.tsx
|
|
2541
2541
|
import { MicIcon as MicIcon2 } from "lucide-react";
|
|
2542
2542
|
import { useCallback as useCallback6, useEffect as useEffect5, useRef as useRef5, useState as useState7 } from "react";
|
|
2543
|
-
import {
|
|
2543
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2544
2544
|
var PromptInputSpeechButton = ({
|
|
2545
2545
|
className,
|
|
2546
2546
|
onTranscriptionChange,
|
|
@@ -2598,92 +2598,92 @@ var PromptInputSpeechButton = ({
|
|
|
2598
2598
|
else
|
|
2599
2599
|
recognition.start();
|
|
2600
2600
|
}, [recognition, isListening]);
|
|
2601
|
-
return /* @__PURE__ */
|
|
2601
|
+
return /* @__PURE__ */ jsx31(PromptInputButton, {
|
|
2602
2602
|
className: cn("relative transition-all duration-200", isListening && "animate-pulse bg-accent text-accent-foreground", className),
|
|
2603
2603
|
disabled: !recognition,
|
|
2604
2604
|
onClick: toggleListening,
|
|
2605
2605
|
...props,
|
|
2606
|
-
children: /* @__PURE__ */
|
|
2606
|
+
children: /* @__PURE__ */ jsx31(MicIcon2, {
|
|
2607
2607
|
className: "size-4"
|
|
2608
|
-
}
|
|
2609
|
-
}
|
|
2608
|
+
})
|
|
2609
|
+
});
|
|
2610
2610
|
};
|
|
2611
2611
|
// src/ui/components/prompt-input/model-select.tsx
|
|
2612
|
-
import {
|
|
2613
|
-
var PromptInputModelSelect = (props) => /* @__PURE__ */
|
|
2612
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2613
|
+
var PromptInputModelSelect = (props) => /* @__PURE__ */ jsx32(Select, {
|
|
2614
2614
|
...props
|
|
2615
|
-
}
|
|
2615
|
+
});
|
|
2616
2616
|
var PromptInputModelSelectTrigger = ({
|
|
2617
2617
|
className,
|
|
2618
2618
|
...props
|
|
2619
|
-
}) => /* @__PURE__ */
|
|
2619
|
+
}) => /* @__PURE__ */ jsx32(SelectTrigger, {
|
|
2620
2620
|
className: cn("border-none bg-transparent font-medium text-muted-foreground shadow-none transition-colors", 'hover:bg-accent hover:text-foreground [&[aria-expanded="true"]]:bg-accent [&[aria-expanded="true"]]:text-foreground', className),
|
|
2621
2621
|
...props
|
|
2622
|
-
}
|
|
2623
|
-
var PromptInputModelSelectContent = ({ className, ...props }) => /* @__PURE__ */
|
|
2622
|
+
});
|
|
2623
|
+
var PromptInputModelSelectContent = ({ className, ...props }) => /* @__PURE__ */ jsx32(SelectContent, {
|
|
2624
2624
|
className: cn(className),
|
|
2625
2625
|
...props
|
|
2626
|
-
}
|
|
2627
|
-
var PromptInputModelSelectItem = ({ className, ...props }) => /* @__PURE__ */
|
|
2626
|
+
});
|
|
2627
|
+
var PromptInputModelSelectItem = ({ className, ...props }) => /* @__PURE__ */ jsx32(SelectItem, {
|
|
2628
2628
|
className: cn(className),
|
|
2629
2629
|
...props
|
|
2630
|
-
}
|
|
2631
|
-
var PromptInputModelSelectValue = ({ className, ...props }) => /* @__PURE__ */
|
|
2630
|
+
});
|
|
2631
|
+
var PromptInputModelSelectValue = ({ className, ...props }) => /* @__PURE__ */ jsx32(SelectValue, {
|
|
2632
2632
|
className: cn(className),
|
|
2633
2633
|
...props
|
|
2634
|
-
}
|
|
2634
|
+
});
|
|
2635
2635
|
// src/ui/components/prompt-input/tabs.tsx
|
|
2636
|
-
import {
|
|
2637
|
-
var PromptInputTabsList = ({ className, ...props }) => /* @__PURE__ */
|
|
2636
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
2637
|
+
var PromptInputTabsList = ({ className, ...props }) => /* @__PURE__ */ jsx33("div", {
|
|
2638
2638
|
className: cn(className),
|
|
2639
2639
|
...props
|
|
2640
|
-
}
|
|
2641
|
-
var PromptInputTab = ({ className, ...props }) => /* @__PURE__ */
|
|
2640
|
+
});
|
|
2641
|
+
var PromptInputTab = ({ className, ...props }) => /* @__PURE__ */ jsx33("div", {
|
|
2642
2642
|
className: cn(className),
|
|
2643
2643
|
...props
|
|
2644
|
-
}
|
|
2645
|
-
var PromptInputTabLabel = ({ className, ...props }) => /* @__PURE__ */
|
|
2644
|
+
});
|
|
2645
|
+
var PromptInputTabLabel = ({ className, ...props }) => /* @__PURE__ */ jsx33("h3", {
|
|
2646
2646
|
className: cn("mb-2 px-3 font-medium text-muted-foreground text-xs", className),
|
|
2647
2647
|
...props
|
|
2648
|
-
}
|
|
2649
|
-
var PromptInputTabBody = ({ className, ...props }) => /* @__PURE__ */
|
|
2648
|
+
});
|
|
2649
|
+
var PromptInputTabBody = ({ className, ...props }) => /* @__PURE__ */ jsx33("div", {
|
|
2650
2650
|
className: cn("space-y-1", className),
|
|
2651
2651
|
...props
|
|
2652
|
-
}
|
|
2653
|
-
var PromptInputTabItem = ({ className, ...props }) => /* @__PURE__ */
|
|
2652
|
+
});
|
|
2653
|
+
var PromptInputTabItem = ({ className, ...props }) => /* @__PURE__ */ jsx33("div", {
|
|
2654
2654
|
className: cn("flex items-center gap-2 px-3 py-2 text-xs hover:bg-accent", className),
|
|
2655
2655
|
...props
|
|
2656
|
-
}
|
|
2656
|
+
});
|
|
2657
2657
|
// src/ui/components/prompt-input/command.tsx
|
|
2658
|
-
import {
|
|
2659
|
-
var PromptInputCommand = ({ className, ...props }) => /* @__PURE__ */
|
|
2658
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
2659
|
+
var PromptInputCommand = ({ className, ...props }) => /* @__PURE__ */ jsx34(Command, {
|
|
2660
2660
|
className: cn(className),
|
|
2661
2661
|
...props
|
|
2662
|
-
}
|
|
2663
|
-
var PromptInputCommandInput = ({ className, ...props }) => /* @__PURE__ */
|
|
2662
|
+
});
|
|
2663
|
+
var PromptInputCommandInput = ({ className, ...props }) => /* @__PURE__ */ jsx34(CommandInput, {
|
|
2664
2664
|
className: cn(className),
|
|
2665
2665
|
...props
|
|
2666
|
-
}
|
|
2667
|
-
var PromptInputCommandList = ({ className, ...props }) => /* @__PURE__ */
|
|
2666
|
+
});
|
|
2667
|
+
var PromptInputCommandList = ({ className, ...props }) => /* @__PURE__ */ jsx34(CommandList, {
|
|
2668
2668
|
className: cn(className),
|
|
2669
2669
|
...props
|
|
2670
|
-
}
|
|
2671
|
-
var PromptInputCommandEmpty = ({ className, ...props }) => /* @__PURE__ */
|
|
2670
|
+
});
|
|
2671
|
+
var PromptInputCommandEmpty = ({ className, ...props }) => /* @__PURE__ */ jsx34(CommandEmpty, {
|
|
2672
2672
|
className: cn(className),
|
|
2673
2673
|
...props
|
|
2674
|
-
}
|
|
2675
|
-
var PromptInputCommandGroup = ({ className, ...props }) => /* @__PURE__ */
|
|
2674
|
+
});
|
|
2675
|
+
var PromptInputCommandGroup = ({ className, ...props }) => /* @__PURE__ */ jsx34(CommandGroup, {
|
|
2676
2676
|
className: cn(className),
|
|
2677
2677
|
...props
|
|
2678
|
-
}
|
|
2679
|
-
var PromptInputCommandItem = ({ className, ...props }) => /* @__PURE__ */
|
|
2678
|
+
});
|
|
2679
|
+
var PromptInputCommandItem = ({ className, ...props }) => /* @__PURE__ */ jsx34(CommandItem, {
|
|
2680
2680
|
className: cn(className),
|
|
2681
2681
|
...props
|
|
2682
|
-
}
|
|
2683
|
-
var PromptInputCommandSeparator = ({ className, ...props }) => /* @__PURE__ */
|
|
2682
|
+
});
|
|
2683
|
+
var PromptInputCommandSeparator = ({ className, ...props }) => /* @__PURE__ */ jsx34(CommandSeparator, {
|
|
2684
2684
|
className: cn(className),
|
|
2685
2685
|
...props
|
|
2686
|
-
}
|
|
2686
|
+
});
|
|
2687
2687
|
// src/ui/composed/AgnoMessageItem.tsx
|
|
2688
2688
|
import { useState as useState8 } from "react";
|
|
2689
2689
|
import { GenerativeUIRenderer } from "@rodrigocoliveira/agno-react";
|
|
@@ -2697,7 +2697,7 @@ import {
|
|
|
2697
2697
|
Paperclip,
|
|
2698
2698
|
Video
|
|
2699
2699
|
} from "lucide-react";
|
|
2700
|
-
import {
|
|
2700
|
+
import { jsx as jsx35, jsxs as jsxs20, Fragment as Fragment5 } from "react/jsx-runtime";
|
|
2701
2701
|
var defaultFormatTimestamp = formatSmartTimestamp;
|
|
2702
2702
|
var getToolState = (tool) => {
|
|
2703
2703
|
return tool.tool_call_error ? "output-error" : "output-available";
|
|
@@ -2739,264 +2739,264 @@ function AgnoMessageItem({
|
|
|
2739
2739
|
setPreview({ type: "file", file });
|
|
2740
2740
|
};
|
|
2741
2741
|
const closePreview = () => setPreview(null);
|
|
2742
|
-
return /* @__PURE__ */
|
|
2742
|
+
return /* @__PURE__ */ jsxs20("div", {
|
|
2743
2743
|
className: cn("py-5 first:pt-2", isUser ? "flex justify-end" : "", classNames?.root, className),
|
|
2744
2744
|
children: [
|
|
2745
|
-
isUser ? /* @__PURE__ */
|
|
2745
|
+
isUser ? /* @__PURE__ */ jsxs20("div", {
|
|
2746
2746
|
className: "flex items-start gap-2.5 max-w-[80%] flex-row-reverse",
|
|
2747
2747
|
children: [
|
|
2748
2748
|
avatars?.user,
|
|
2749
|
-
/* @__PURE__ */
|
|
2749
|
+
/* @__PURE__ */ jsxs20("div", {
|
|
2750
2750
|
className: "space-y-1.5 flex flex-col items-end min-w-0",
|
|
2751
2751
|
children: [
|
|
2752
|
-
(message.images && message.images.length > 0 || message.audio && message.audio.length > 0 || message.files && message.files.length > 0) && /* @__PURE__ */
|
|
2752
|
+
(message.images && message.images.length > 0 || message.audio && message.audio.length > 0 || message.files && message.files.length > 0) && /* @__PURE__ */ jsxs20("div", {
|
|
2753
2753
|
className: "flex flex-wrap gap-2 justify-end",
|
|
2754
2754
|
children: [
|
|
2755
|
-
message.images?.map((img, idx) => /* @__PURE__ */
|
|
2755
|
+
message.images?.map((img, idx) => /* @__PURE__ */ jsx35(FilePreviewCard, {
|
|
2756
2756
|
file: { name: img.revised_prompt || `Image ${idx + 1}`, type: "image/png", url: img.url },
|
|
2757
2757
|
onClick: showImageLightbox ? () => openImageLightbox(message.images.map((i) => ({ url: i.url, alt: i.revised_prompt })), idx) : undefined
|
|
2758
|
-
}, `img-${idx}
|
|
2759
|
-
message.audio?.map((audio, idx) => /* @__PURE__ */
|
|
2758
|
+
}, `img-${idx}`)),
|
|
2759
|
+
message.audio?.map((audio, idx) => /* @__PURE__ */ jsxs20("div", {
|
|
2760
2760
|
className: "flex items-center gap-1.5 rounded-lg border border-border bg-muted/50 px-2.5 py-1.5 text-xs text-foreground self-end",
|
|
2761
2761
|
children: [
|
|
2762
|
-
/* @__PURE__ */
|
|
2762
|
+
/* @__PURE__ */ jsx35(Music, {
|
|
2763
2763
|
className: "h-3.5 w-3.5 text-muted-foreground"
|
|
2764
|
-
}
|
|
2765
|
-
/* @__PURE__ */
|
|
2764
|
+
}),
|
|
2765
|
+
/* @__PURE__ */ jsx35("span", {
|
|
2766
2766
|
className: "truncate max-w-[150px]",
|
|
2767
2767
|
children: audio.id || `Audio ${idx + 1}`
|
|
2768
|
-
}
|
|
2768
|
+
})
|
|
2769
2769
|
]
|
|
2770
|
-
}, `audio-${idx}
|
|
2771
|
-
message.files?.map((file, idx) => showFilePreview ? /* @__PURE__ */
|
|
2770
|
+
}, `audio-${idx}`)),
|
|
2771
|
+
message.files?.map((file, idx) => showFilePreview ? /* @__PURE__ */ jsx35(FilePreviewCard, {
|
|
2772
2772
|
file: { name: file.name, type: file.type, url: file.url, size: file.size },
|
|
2773
2773
|
onClick: () => openFilePreview({ name: file.name, type: file.type, url: file.url, size: file.size })
|
|
2774
|
-
}, `file-${idx}
|
|
2774
|
+
}, `file-${idx}`) : /* @__PURE__ */ jsxs20("div", {
|
|
2775
2775
|
className: "flex items-center gap-1.5 rounded-lg border border-border bg-muted/50 px-2.5 py-1.5 text-xs text-foreground self-end",
|
|
2776
2776
|
children: [
|
|
2777
|
-
/* @__PURE__ */
|
|
2777
|
+
/* @__PURE__ */ jsx35(FileIcon3, {
|
|
2778
2778
|
className: "h-3.5 w-3.5 text-muted-foreground"
|
|
2779
|
-
}
|
|
2780
|
-
/* @__PURE__ */
|
|
2779
|
+
}),
|
|
2780
|
+
/* @__PURE__ */ jsx35("span", {
|
|
2781
2781
|
className: "truncate max-w-[150px]",
|
|
2782
2782
|
children: file.name
|
|
2783
|
-
}
|
|
2783
|
+
})
|
|
2784
2784
|
]
|
|
2785
|
-
}, `file-${idx}
|
|
2785
|
+
}, `file-${idx}`))
|
|
2786
2786
|
]
|
|
2787
|
-
}
|
|
2788
|
-
message.content && /* @__PURE__ */
|
|
2787
|
+
}),
|
|
2788
|
+
message.content && /* @__PURE__ */ jsx35("div", {
|
|
2789
2789
|
className: cn("rounded-2xl rounded-br-md px-4 py-2.5", classNames?.user?.bubble ?? "bg-primary text-primary-foreground", hasError && "opacity-70"),
|
|
2790
|
-
children: /* @__PURE__ */
|
|
2790
|
+
children: /* @__PURE__ */ jsx35("p", {
|
|
2791
2791
|
className: "text-sm whitespace-pre-wrap",
|
|
2792
2792
|
children: message.content
|
|
2793
|
-
}
|
|
2794
|
-
}
|
|
2795
|
-
(showTimestamp || actions?.user) && /* @__PURE__ */
|
|
2793
|
+
})
|
|
2794
|
+
}),
|
|
2795
|
+
(showTimestamp || actions?.user) && /* @__PURE__ */ jsxs20("div", {
|
|
2796
2796
|
className: "flex items-center justify-end gap-1.5 px-1",
|
|
2797
2797
|
children: [
|
|
2798
|
-
actions?.user && /* @__PURE__ */
|
|
2798
|
+
actions?.user && /* @__PURE__ */ jsx35("div", {
|
|
2799
2799
|
className: "flex items-center gap-1",
|
|
2800
2800
|
children: actions.user(message)
|
|
2801
|
-
}
|
|
2802
|
-
/* @__PURE__ */
|
|
2801
|
+
}),
|
|
2802
|
+
/* @__PURE__ */ jsx35(SmartTimestamp, {
|
|
2803
2803
|
date: new Date(message.created_at * 1000),
|
|
2804
2804
|
formatShort: isCustomTimestamp ? resolvedFormatTimestamp : undefined,
|
|
2805
2805
|
className: "text-[11px] text-muted-foreground"
|
|
2806
|
-
}
|
|
2807
|
-
hasError && /* @__PURE__ */
|
|
2806
|
+
}),
|
|
2807
|
+
hasError && /* @__PURE__ */ jsx35(AlertCircle, {
|
|
2808
2808
|
className: "h-3 w-3 text-destructive"
|
|
2809
|
-
}
|
|
2809
|
+
})
|
|
2810
2810
|
]
|
|
2811
|
-
}
|
|
2811
|
+
})
|
|
2812
2812
|
]
|
|
2813
|
-
}
|
|
2813
|
+
})
|
|
2814
2814
|
]
|
|
2815
|
-
}
|
|
2815
|
+
}) : /* @__PURE__ */ jsxs20("div", {
|
|
2816
2816
|
className: "flex items-start gap-3 group/message",
|
|
2817
2817
|
children: [
|
|
2818
2818
|
avatars?.assistant,
|
|
2819
|
-
/* @__PURE__ */
|
|
2819
|
+
/* @__PURE__ */ jsxs20("div", {
|
|
2820
2820
|
className: cn("flex-1 min-w-0 space-y-3", classNames?.assistant?.container),
|
|
2821
2821
|
children: [
|
|
2822
|
-
renderContent ? renderContent(message) : /* @__PURE__ */
|
|
2822
|
+
renderContent ? renderContent(message) : /* @__PURE__ */ jsxs20(Fragment5, {
|
|
2823
2823
|
children: [
|
|
2824
|
-
showReasoning && message.extra_data?.reasoning_steps && message.extra_data.reasoning_steps.length > 0 && /* @__PURE__ */
|
|
2824
|
+
showReasoning && message.extra_data?.reasoning_steps && message.extra_data.reasoning_steps.length > 0 && /* @__PURE__ */ jsxs20("div", {
|
|
2825
2825
|
className: cn("space-y-2 pt-1", classNames?.assistant?.reasoning),
|
|
2826
2826
|
children: [
|
|
2827
|
-
/* @__PURE__ */
|
|
2827
|
+
/* @__PURE__ */ jsxs20("div", {
|
|
2828
2828
|
className: "flex items-center gap-2 text-xs font-medium text-muted-foreground",
|
|
2829
2829
|
children: [
|
|
2830
|
-
/* @__PURE__ */
|
|
2830
|
+
/* @__PURE__ */ jsx35(Lightbulb, {
|
|
2831
2831
|
className: "h-3.5 w-3.5"
|
|
2832
|
-
}
|
|
2832
|
+
}),
|
|
2833
2833
|
"Reasoning (",
|
|
2834
2834
|
message.extra_data.reasoning_steps.length,
|
|
2835
2835
|
" steps)"
|
|
2836
2836
|
]
|
|
2837
|
-
}
|
|
2838
|
-
/* @__PURE__ */
|
|
2837
|
+
}),
|
|
2838
|
+
/* @__PURE__ */ jsx35(Accordion, {
|
|
2839
2839
|
type: "multiple",
|
|
2840
2840
|
className: "w-full",
|
|
2841
|
-
children: message.extra_data.reasoning_steps.map((step, idx) => /* @__PURE__ */
|
|
2841
|
+
children: message.extra_data.reasoning_steps.map((step, idx) => /* @__PURE__ */ jsxs20(AccordionItem, {
|
|
2842
2842
|
value: `reasoning-${idx}`,
|
|
2843
2843
|
className: "border-muted",
|
|
2844
2844
|
children: [
|
|
2845
|
-
/* @__PURE__ */
|
|
2845
|
+
/* @__PURE__ */ jsx35(AccordionTrigger, {
|
|
2846
2846
|
className: "text-xs py-1.5 hover:no-underline",
|
|
2847
2847
|
children: step.title || `Step ${idx + 1}`
|
|
2848
|
-
}
|
|
2849
|
-
/* @__PURE__ */
|
|
2848
|
+
}),
|
|
2849
|
+
/* @__PURE__ */ jsxs20(AccordionContent, {
|
|
2850
2850
|
className: "space-y-1.5 text-xs text-muted-foreground",
|
|
2851
2851
|
children: [
|
|
2852
|
-
step.action && /* @__PURE__ */
|
|
2852
|
+
step.action && /* @__PURE__ */ jsxs20("div", {
|
|
2853
2853
|
children: [
|
|
2854
|
-
/* @__PURE__ */
|
|
2854
|
+
/* @__PURE__ */ jsx35("span", {
|
|
2855
2855
|
className: "font-medium text-foreground",
|
|
2856
2856
|
children: "Action:"
|
|
2857
|
-
}
|
|
2857
|
+
}),
|
|
2858
2858
|
" ",
|
|
2859
2859
|
step.action
|
|
2860
2860
|
]
|
|
2861
|
-
}
|
|
2862
|
-
step.reasoning && /* @__PURE__ */
|
|
2861
|
+
}),
|
|
2862
|
+
step.reasoning && /* @__PURE__ */ jsxs20("div", {
|
|
2863
2863
|
children: [
|
|
2864
|
-
/* @__PURE__ */
|
|
2864
|
+
/* @__PURE__ */ jsx35("span", {
|
|
2865
2865
|
className: "font-medium text-foreground",
|
|
2866
2866
|
children: "Reasoning:"
|
|
2867
|
-
}
|
|
2867
|
+
}),
|
|
2868
2868
|
" ",
|
|
2869
2869
|
step.reasoning
|
|
2870
2870
|
]
|
|
2871
|
-
}
|
|
2872
|
-
step.result && /* @__PURE__ */
|
|
2871
|
+
}),
|
|
2872
|
+
step.result && /* @__PURE__ */ jsxs20("div", {
|
|
2873
2873
|
children: [
|
|
2874
|
-
/* @__PURE__ */
|
|
2874
|
+
/* @__PURE__ */ jsx35("span", {
|
|
2875
2875
|
className: "font-medium text-foreground",
|
|
2876
2876
|
children: "Result:"
|
|
2877
|
-
}
|
|
2877
|
+
}),
|
|
2878
2878
|
" ",
|
|
2879
2879
|
step.result
|
|
2880
2880
|
]
|
|
2881
|
-
}
|
|
2882
|
-
step.confidence !== undefined && /* @__PURE__ */
|
|
2881
|
+
}),
|
|
2882
|
+
step.confidence !== undefined && /* @__PURE__ */ jsxs20("div", {
|
|
2883
2883
|
children: [
|
|
2884
|
-
/* @__PURE__ */
|
|
2884
|
+
/* @__PURE__ */ jsx35("span", {
|
|
2885
2885
|
className: "font-medium text-foreground",
|
|
2886
2886
|
children: "Confidence:"
|
|
2887
|
-
}
|
|
2887
|
+
}),
|
|
2888
2888
|
" ",
|
|
2889
2889
|
(step.confidence * 100).toFixed(1),
|
|
2890
2890
|
"%"
|
|
2891
2891
|
]
|
|
2892
|
-
}
|
|
2892
|
+
})
|
|
2893
2893
|
]
|
|
2894
|
-
}
|
|
2894
|
+
})
|
|
2895
2895
|
]
|
|
2896
|
-
}, idx
|
|
2897
|
-
}
|
|
2896
|
+
}, idx))
|
|
2897
|
+
})
|
|
2898
2898
|
]
|
|
2899
|
-
}
|
|
2900
|
-
message.content && /* @__PURE__ */
|
|
2899
|
+
}),
|
|
2900
|
+
message.content && /* @__PURE__ */ jsx35("div", {
|
|
2901
2901
|
className: "prose prose-sm dark:prose-invert max-w-none prose-p:leading-relaxed prose-pre:bg-muted prose-pre:border prose-pre:border-border",
|
|
2902
|
-
children: /* @__PURE__ */
|
|
2902
|
+
children: /* @__PURE__ */ jsx35(Response, {
|
|
2903
2903
|
children: message.content
|
|
2904
|
-
}
|
|
2905
|
-
}
|
|
2906
|
-
showGenerativeUI && toolsWithUI.length > 0 && /* @__PURE__ */
|
|
2904
|
+
})
|
|
2905
|
+
}),
|
|
2906
|
+
showGenerativeUI && toolsWithUI.length > 0 && /* @__PURE__ */ jsx35("div", {
|
|
2907
2907
|
className: "space-y-3",
|
|
2908
2908
|
children: toolsWithUI.map((tool) => {
|
|
2909
2909
|
const uiComponent = tool.ui_component;
|
|
2910
|
-
return /* @__PURE__ */
|
|
2911
|
-
children: uiComponent.layout === "artifact" ? /* @__PURE__ */
|
|
2912
|
-
children: /* @__PURE__ */
|
|
2910
|
+
return /* @__PURE__ */ jsx35("div", {
|
|
2911
|
+
children: uiComponent.layout === "artifact" ? /* @__PURE__ */ jsx35(Artifact, {
|
|
2912
|
+
children: /* @__PURE__ */ jsx35(GenerativeUIRenderer, {
|
|
2913
2913
|
spec: uiComponent,
|
|
2914
2914
|
className: "w-full p-2"
|
|
2915
|
-
}
|
|
2916
|
-
}
|
|
2915
|
+
})
|
|
2916
|
+
}) : /* @__PURE__ */ jsx35(GenerativeUIRenderer, {
|
|
2917
2917
|
spec: uiComponent,
|
|
2918
2918
|
className: "w-full"
|
|
2919
|
-
}
|
|
2920
|
-
}, tool.tool_call_id
|
|
2919
|
+
})
|
|
2920
|
+
}, tool.tool_call_id);
|
|
2921
2921
|
})
|
|
2922
|
-
}
|
|
2922
|
+
}),
|
|
2923
2923
|
toolResultRenderers && message.tool_calls?.map((tool) => {
|
|
2924
2924
|
const renderer = toolResultRenderers[tool.tool_name];
|
|
2925
2925
|
const content = tool.result ?? tool.content;
|
|
2926
2926
|
if (!renderer || !content)
|
|
2927
2927
|
return null;
|
|
2928
|
-
return /* @__PURE__ */
|
|
2928
|
+
return /* @__PURE__ */ jsx35("div", {
|
|
2929
2929
|
children: renderer(tool.tool_args, content)
|
|
2930
|
-
}, `result-${tool.tool_call_id}
|
|
2930
|
+
}, `result-${tool.tool_call_id}`);
|
|
2931
2931
|
}),
|
|
2932
2932
|
renderMedia ? renderMedia(message) : (() => {
|
|
2933
2933
|
const mediaClassName = classNames?.assistant?.media;
|
|
2934
|
-
return /* @__PURE__ */
|
|
2934
|
+
return /* @__PURE__ */ jsxs20(Fragment5, {
|
|
2935
2935
|
children: [
|
|
2936
|
-
message.images && message.images.length > 0 && /* @__PURE__ */
|
|
2936
|
+
message.images && message.images.length > 0 && /* @__PURE__ */ jsxs20("div", {
|
|
2937
2937
|
className: cn("space-y-2 pt-1", mediaClassName),
|
|
2938
2938
|
children: [
|
|
2939
|
-
/* @__PURE__ */
|
|
2939
|
+
/* @__PURE__ */ jsxs20("div", {
|
|
2940
2940
|
className: "flex items-center gap-2 text-xs font-medium text-muted-foreground",
|
|
2941
2941
|
children: [
|
|
2942
|
-
/* @__PURE__ */
|
|
2942
|
+
/* @__PURE__ */ jsx35(ImageIcon2, {
|
|
2943
2943
|
className: "h-3.5 w-3.5"
|
|
2944
|
-
}
|
|
2944
|
+
}),
|
|
2945
2945
|
"Images (",
|
|
2946
2946
|
message.images.length,
|
|
2947
2947
|
")"
|
|
2948
2948
|
]
|
|
2949
|
-
}
|
|
2950
|
-
/* @__PURE__ */
|
|
2949
|
+
}),
|
|
2950
|
+
/* @__PURE__ */ jsx35("div", {
|
|
2951
2951
|
className: "grid grid-cols-2 gap-2",
|
|
2952
|
-
children: message.images.map((img, idx) => /* @__PURE__ */
|
|
2952
|
+
children: message.images.map((img, idx) => /* @__PURE__ */ jsxs20("div", {
|
|
2953
2953
|
className: "space-y-1",
|
|
2954
2954
|
children: [
|
|
2955
|
-
showImageLightbox ? /* @__PURE__ */
|
|
2955
|
+
showImageLightbox ? /* @__PURE__ */ jsx35("button", {
|
|
2956
2956
|
type: "button",
|
|
2957
2957
|
onClick: () => openImageLightbox(message.images.map((i) => ({ url: i.url, alt: i.revised_prompt })), idx),
|
|
2958
2958
|
className: "group relative w-full overflow-hidden rounded-lg border border-border cursor-pointer hover:border-primary/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors",
|
|
2959
|
-
children: /* @__PURE__ */
|
|
2959
|
+
children: /* @__PURE__ */ jsx35("img", {
|
|
2960
2960
|
src: img.url,
|
|
2961
2961
|
alt: img.revised_prompt || "Generated image",
|
|
2962
2962
|
className: "w-full rounded-lg"
|
|
2963
|
-
}
|
|
2964
|
-
}
|
|
2963
|
+
})
|
|
2964
|
+
}) : /* @__PURE__ */ jsx35("img", {
|
|
2965
2965
|
src: img.url,
|
|
2966
2966
|
alt: img.revised_prompt || "Generated image",
|
|
2967
2967
|
className: "w-full rounded-lg border border-border"
|
|
2968
|
-
}
|
|
2969
|
-
img.revised_prompt && /* @__PURE__ */
|
|
2968
|
+
}),
|
|
2969
|
+
img.revised_prompt && /* @__PURE__ */ jsx35("p", {
|
|
2970
2970
|
className: "text-[11px] text-muted-foreground italic px-0.5",
|
|
2971
2971
|
children: img.revised_prompt
|
|
2972
|
-
}
|
|
2972
|
+
})
|
|
2973
2973
|
]
|
|
2974
|
-
}, idx
|
|
2975
|
-
}
|
|
2974
|
+
}, idx))
|
|
2975
|
+
})
|
|
2976
2976
|
]
|
|
2977
|
-
}
|
|
2978
|
-
message.videos && message.videos.length > 0 && /* @__PURE__ */
|
|
2977
|
+
}),
|
|
2978
|
+
message.videos && message.videos.length > 0 && /* @__PURE__ */ jsxs20("div", {
|
|
2979
2979
|
className: cn("space-y-2 pt-1", mediaClassName),
|
|
2980
2980
|
children: [
|
|
2981
|
-
/* @__PURE__ */
|
|
2981
|
+
/* @__PURE__ */ jsxs20("div", {
|
|
2982
2982
|
className: "flex items-center gap-2 text-xs font-medium text-muted-foreground",
|
|
2983
2983
|
children: [
|
|
2984
|
-
/* @__PURE__ */
|
|
2984
|
+
/* @__PURE__ */ jsx35(Video, {
|
|
2985
2985
|
className: "h-3.5 w-3.5"
|
|
2986
|
-
}
|
|
2986
|
+
}),
|
|
2987
2987
|
"Videos (",
|
|
2988
2988
|
message.videos.length,
|
|
2989
2989
|
")"
|
|
2990
2990
|
]
|
|
2991
|
-
}
|
|
2992
|
-
/* @__PURE__ */
|
|
2991
|
+
}),
|
|
2992
|
+
/* @__PURE__ */ jsx35("div", {
|
|
2993
2993
|
className: "space-y-2",
|
|
2994
|
-
children: message.videos.map((video, idx) => /* @__PURE__ */
|
|
2995
|
-
children: video.url ? /* @__PURE__ */
|
|
2994
|
+
children: message.videos.map((video, idx) => /* @__PURE__ */ jsx35("div", {
|
|
2995
|
+
children: video.url ? /* @__PURE__ */ jsx35("video", {
|
|
2996
2996
|
src: video.url,
|
|
2997
2997
|
controls: true,
|
|
2998
2998
|
className: "w-full rounded-lg border border-border"
|
|
2999
|
-
}
|
|
2999
|
+
}) : /* @__PURE__ */ jsxs20("div", {
|
|
3000
3000
|
className: "bg-muted/50 border border-border p-2.5 rounded-lg text-xs text-muted-foreground",
|
|
3001
3001
|
children: [
|
|
3002
3002
|
"Video ID: ",
|
|
@@ -3005,185 +3005,185 @@ function AgnoMessageItem({
|
|
|
3005
3005
|
video.eta,
|
|
3006
3006
|
"s)"
|
|
3007
3007
|
]
|
|
3008
|
-
}
|
|
3009
|
-
}, idx
|
|
3010
|
-
}
|
|
3008
|
+
})
|
|
3009
|
+
}, idx))
|
|
3010
|
+
})
|
|
3011
3011
|
]
|
|
3012
|
-
}
|
|
3013
|
-
message.audio && message.audio.length > 0 && /* @__PURE__ */
|
|
3012
|
+
}),
|
|
3013
|
+
message.audio && message.audio.length > 0 && /* @__PURE__ */ jsxs20("div", {
|
|
3014
3014
|
className: cn("space-y-2 pt-1", mediaClassName),
|
|
3015
3015
|
children: [
|
|
3016
|
-
/* @__PURE__ */
|
|
3016
|
+
/* @__PURE__ */ jsxs20("div", {
|
|
3017
3017
|
className: "flex items-center gap-2 text-xs font-medium text-muted-foreground",
|
|
3018
3018
|
children: [
|
|
3019
|
-
/* @__PURE__ */
|
|
3019
|
+
/* @__PURE__ */ jsx35(Music, {
|
|
3020
3020
|
className: "h-3.5 w-3.5"
|
|
3021
|
-
}
|
|
3021
|
+
}),
|
|
3022
3022
|
"Audio (",
|
|
3023
3023
|
message.audio.length,
|
|
3024
3024
|
")"
|
|
3025
3025
|
]
|
|
3026
|
-
}
|
|
3027
|
-
/* @__PURE__ */
|
|
3026
|
+
}),
|
|
3027
|
+
/* @__PURE__ */ jsx35("div", {
|
|
3028
3028
|
className: "space-y-2",
|
|
3029
|
-
children: message.audio.map((audio, idx) => /* @__PURE__ */
|
|
3030
|
-
children: audio.url ? /* @__PURE__ */
|
|
3029
|
+
children: message.audio.map((audio, idx) => /* @__PURE__ */ jsx35("div", {
|
|
3030
|
+
children: audio.url ? /* @__PURE__ */ jsx35("audio", {
|
|
3031
3031
|
src: audio.url,
|
|
3032
3032
|
controls: true,
|
|
3033
3033
|
className: "w-full"
|
|
3034
|
-
}
|
|
3034
|
+
}) : audio.base64_audio ? /* @__PURE__ */ jsx35("audio", {
|
|
3035
3035
|
src: `data:${audio.mime_type || "audio/wav"};base64,${audio.base64_audio}`,
|
|
3036
3036
|
controls: true,
|
|
3037
3037
|
className: "w-full"
|
|
3038
|
-
}
|
|
3038
|
+
}) : /* @__PURE__ */ jsx35("div", {
|
|
3039
3039
|
className: "bg-muted/50 border border-border p-2.5 rounded-lg text-xs text-muted-foreground",
|
|
3040
3040
|
children: "Audio data unavailable"
|
|
3041
|
-
}
|
|
3042
|
-
}, idx
|
|
3043
|
-
}
|
|
3041
|
+
})
|
|
3042
|
+
}, idx))
|
|
3043
|
+
})
|
|
3044
3044
|
]
|
|
3045
|
-
}
|
|
3046
|
-
message.files && message.files.length > 0 && /* @__PURE__ */
|
|
3045
|
+
}),
|
|
3046
|
+
message.files && message.files.length > 0 && /* @__PURE__ */ jsxs20("div", {
|
|
3047
3047
|
className: cn("space-y-2 pt-1", mediaClassName),
|
|
3048
3048
|
children: [
|
|
3049
|
-
/* @__PURE__ */
|
|
3049
|
+
/* @__PURE__ */ jsxs20("div", {
|
|
3050
3050
|
className: "flex items-center gap-2 text-xs font-medium text-muted-foreground",
|
|
3051
3051
|
children: [
|
|
3052
|
-
/* @__PURE__ */
|
|
3052
|
+
/* @__PURE__ */ jsx35(Paperclip, {
|
|
3053
3053
|
className: "h-3.5 w-3.5"
|
|
3054
|
-
}
|
|
3054
|
+
}),
|
|
3055
3055
|
"Files (",
|
|
3056
3056
|
message.files.length,
|
|
3057
3057
|
")"
|
|
3058
3058
|
]
|
|
3059
|
-
}
|
|
3060
|
-
/* @__PURE__ */
|
|
3059
|
+
}),
|
|
3060
|
+
/* @__PURE__ */ jsx35("div", {
|
|
3061
3061
|
className: "flex flex-wrap gap-2",
|
|
3062
|
-
children: message.files.map((file, idx) => showFilePreview ? /* @__PURE__ */
|
|
3062
|
+
children: message.files.map((file, idx) => showFilePreview ? /* @__PURE__ */ jsx35(FilePreviewCard, {
|
|
3063
3063
|
file: { name: file.name, type: file.type, url: file.url, size: file.size },
|
|
3064
3064
|
onClick: () => openFilePreview({ name: file.name, type: file.type, url: file.url, size: file.size })
|
|
3065
|
-
}, idx
|
|
3065
|
+
}, idx) : /* @__PURE__ */ jsxs20("div", {
|
|
3066
3066
|
className: "flex items-center gap-2 rounded-lg border border-border px-3 py-2 text-xs bg-muted/30 hover:bg-muted/50 transition-colors",
|
|
3067
3067
|
children: [
|
|
3068
|
-
/* @__PURE__ */
|
|
3068
|
+
/* @__PURE__ */ jsx35(FileIcon3, {
|
|
3069
3069
|
className: "h-3.5 w-3.5 shrink-0 text-muted-foreground"
|
|
3070
|
-
}
|
|
3071
|
-
/* @__PURE__ */
|
|
3070
|
+
}),
|
|
3071
|
+
/* @__PURE__ */ jsx35("span", {
|
|
3072
3072
|
className: "truncate max-w-[180px]",
|
|
3073
3073
|
children: file.name
|
|
3074
|
-
}
|
|
3075
|
-
file.size && /* @__PURE__ */
|
|
3074
|
+
}),
|
|
3075
|
+
file.size && /* @__PURE__ */ jsxs20("span", {
|
|
3076
3076
|
className: "text-muted-foreground/70",
|
|
3077
3077
|
children: [
|
|
3078
3078
|
"(",
|
|
3079
3079
|
(file.size / 1024).toFixed(1),
|
|
3080
3080
|
"KB)"
|
|
3081
3081
|
]
|
|
3082
|
-
}
|
|
3083
|
-
file.url && /^https?:\/\//i.test(file.url) && /* @__PURE__ */
|
|
3082
|
+
}),
|
|
3083
|
+
file.url && /^https?:\/\//i.test(file.url) && /* @__PURE__ */ jsx35("a", {
|
|
3084
3084
|
href: file.url,
|
|
3085
3085
|
target: "_blank",
|
|
3086
3086
|
rel: "noopener noreferrer",
|
|
3087
3087
|
className: "text-primary hover:underline font-medium",
|
|
3088
3088
|
children: "View"
|
|
3089
|
-
}
|
|
3089
|
+
})
|
|
3090
3090
|
]
|
|
3091
|
-
}, idx
|
|
3092
|
-
}
|
|
3091
|
+
}, idx))
|
|
3092
|
+
})
|
|
3093
3093
|
]
|
|
3094
|
-
}
|
|
3095
|
-
message.response_audio && /* @__PURE__ */
|
|
3094
|
+
}),
|
|
3095
|
+
message.response_audio && /* @__PURE__ */ jsxs20("div", {
|
|
3096
3096
|
className: cn("space-y-2 pt-1", mediaClassName),
|
|
3097
3097
|
children: [
|
|
3098
|
-
/* @__PURE__ */
|
|
3098
|
+
/* @__PURE__ */ jsxs20("div", {
|
|
3099
3099
|
className: "flex items-center gap-2 text-xs font-medium text-muted-foreground",
|
|
3100
3100
|
children: [
|
|
3101
|
-
/* @__PURE__ */
|
|
3101
|
+
/* @__PURE__ */ jsx35(Music, {
|
|
3102
3102
|
className: "h-3.5 w-3.5"
|
|
3103
|
-
}
|
|
3103
|
+
}),
|
|
3104
3104
|
"Response Audio"
|
|
3105
3105
|
]
|
|
3106
|
-
}
|
|
3107
|
-
message.response_audio.transcript && /* @__PURE__ */
|
|
3106
|
+
}),
|
|
3107
|
+
message.response_audio.transcript && /* @__PURE__ */ jsxs20("div", {
|
|
3108
3108
|
className: "text-xs italic bg-muted/50 border border-border p-2.5 rounded-lg text-muted-foreground",
|
|
3109
3109
|
children: [
|
|
3110
3110
|
'"',
|
|
3111
3111
|
message.response_audio.transcript,
|
|
3112
3112
|
'"'
|
|
3113
3113
|
]
|
|
3114
|
-
}
|
|
3115
|
-
message.response_audio.content && /* @__PURE__ */
|
|
3114
|
+
}),
|
|
3115
|
+
message.response_audio.content && /* @__PURE__ */ jsx35("audio", {
|
|
3116
3116
|
src: `data:audio/wav;base64,${message.response_audio.content}`,
|
|
3117
3117
|
controls: true,
|
|
3118
3118
|
className: "w-full"
|
|
3119
|
-
}
|
|
3119
|
+
})
|
|
3120
3120
|
]
|
|
3121
|
-
}
|
|
3121
|
+
})
|
|
3122
3122
|
]
|
|
3123
|
-
}
|
|
3123
|
+
});
|
|
3124
3124
|
})(),
|
|
3125
|
-
showToolCalls && message.tool_calls && message.tool_calls.length > 0 && /* @__PURE__ */
|
|
3125
|
+
showToolCalls && message.tool_calls && message.tool_calls.length > 0 && /* @__PURE__ */ jsx35("div", {
|
|
3126
3126
|
className: cn("space-y-2 pt-1", classNames?.assistant?.toolCalls),
|
|
3127
|
-
children: message.tool_calls.map((tool, idx) => renderToolCall ? renderToolCall(tool, idx) : /* @__PURE__ */
|
|
3127
|
+
children: message.tool_calls.map((tool, idx) => renderToolCall ? renderToolCall(tool, idx) : /* @__PURE__ */ jsxs20(Tool, {
|
|
3128
3128
|
defaultOpen: idx === 0,
|
|
3129
3129
|
children: [
|
|
3130
|
-
/* @__PURE__ */
|
|
3130
|
+
/* @__PURE__ */ jsx35(ToolHeader, {
|
|
3131
3131
|
title: tool.tool_name,
|
|
3132
3132
|
type: "tool-use",
|
|
3133
3133
|
state: getToolState(tool)
|
|
3134
|
-
}
|
|
3135
|
-
/* @__PURE__ */
|
|
3134
|
+
}),
|
|
3135
|
+
/* @__PURE__ */ jsxs20(ToolContent, {
|
|
3136
3136
|
children: [
|
|
3137
|
-
/* @__PURE__ */
|
|
3137
|
+
/* @__PURE__ */ jsx35(ToolInput, {
|
|
3138
3138
|
input: tool.tool_args
|
|
3139
|
-
}
|
|
3140
|
-
tool.content && /* @__PURE__ */
|
|
3139
|
+
}),
|
|
3140
|
+
tool.content && /* @__PURE__ */ jsx35(ToolOutput, {
|
|
3141
3141
|
output: tool.content,
|
|
3142
3142
|
errorText: tool.tool_call_error ? "Tool execution failed" : undefined
|
|
3143
|
-
}
|
|
3143
|
+
})
|
|
3144
3144
|
]
|
|
3145
|
-
}
|
|
3145
|
+
})
|
|
3146
3146
|
]
|
|
3147
|
-
}, tool.tool_call_id || idx
|
|
3148
|
-
}
|
|
3149
|
-
showReferences && message.extra_data?.references && message.extra_data.references.length > 0 && /* @__PURE__ */
|
|
3147
|
+
}, tool.tool_call_id || idx))
|
|
3148
|
+
}),
|
|
3149
|
+
showReferences && message.extra_data?.references && message.extra_data.references.length > 0 && /* @__PURE__ */ jsxs20("div", {
|
|
3150
3150
|
className: cn("space-y-2 pt-1", classNames?.assistant?.references),
|
|
3151
3151
|
children: [
|
|
3152
|
-
/* @__PURE__ */
|
|
3152
|
+
/* @__PURE__ */ jsxs20("div", {
|
|
3153
3153
|
className: "flex items-center gap-2 text-xs font-medium text-muted-foreground",
|
|
3154
3154
|
children: [
|
|
3155
|
-
/* @__PURE__ */
|
|
3155
|
+
/* @__PURE__ */ jsx35(FileText, {
|
|
3156
3156
|
className: "h-3.5 w-3.5"
|
|
3157
|
-
}
|
|
3157
|
+
}),
|
|
3158
3158
|
"References (",
|
|
3159
3159
|
message.extra_data.references.length,
|
|
3160
3160
|
")"
|
|
3161
3161
|
]
|
|
3162
|
-
}
|
|
3163
|
-
/* @__PURE__ */
|
|
3162
|
+
}),
|
|
3163
|
+
/* @__PURE__ */ jsx35("div", {
|
|
3164
3164
|
className: "space-y-2",
|
|
3165
|
-
children: message.extra_data.references.map((refData, idx) => /* @__PURE__ */
|
|
3165
|
+
children: message.extra_data.references.map((refData, idx) => /* @__PURE__ */ jsxs20("div", {
|
|
3166
3166
|
className: "text-xs space-y-1.5",
|
|
3167
3167
|
children: [
|
|
3168
|
-
refData.query && /* @__PURE__ */
|
|
3168
|
+
refData.query && /* @__PURE__ */ jsxs20("div", {
|
|
3169
3169
|
className: "font-medium text-foreground",
|
|
3170
3170
|
children: [
|
|
3171
3171
|
"Query: ",
|
|
3172
3172
|
refData.query
|
|
3173
3173
|
]
|
|
3174
|
-
}
|
|
3175
|
-
refData.references.map((ref, refIdx) => /* @__PURE__ */
|
|
3174
|
+
}),
|
|
3175
|
+
refData.references.map((ref, refIdx) => /* @__PURE__ */ jsxs20("div", {
|
|
3176
3176
|
className: "bg-muted/50 border border-border p-2.5 rounded-lg",
|
|
3177
3177
|
children: [
|
|
3178
|
-
/* @__PURE__ */
|
|
3178
|
+
/* @__PURE__ */ jsxs20("div", {
|
|
3179
3179
|
className: "italic text-muted-foreground mb-1",
|
|
3180
3180
|
children: [
|
|
3181
3181
|
'"',
|
|
3182
3182
|
ref.content,
|
|
3183
3183
|
'"'
|
|
3184
3184
|
]
|
|
3185
|
-
}
|
|
3186
|
-
/* @__PURE__ */
|
|
3185
|
+
}),
|
|
3186
|
+
/* @__PURE__ */ jsxs20("div", {
|
|
3187
3187
|
className: "text-muted-foreground/70",
|
|
3188
3188
|
children: [
|
|
3189
3189
|
"Source: ",
|
|
@@ -3194,17 +3194,17 @@ function AgnoMessageItem({
|
|
|
3194
3194
|
ref.meta_data.chunk_size,
|
|
3195
3195
|
")"
|
|
3196
3196
|
]
|
|
3197
|
-
}
|
|
3197
|
+
})
|
|
3198
3198
|
]
|
|
3199
|
-
}, refIdx
|
|
3199
|
+
}, refIdx))
|
|
3200
3200
|
]
|
|
3201
|
-
}, idx
|
|
3202
|
-
}
|
|
3201
|
+
}, idx))
|
|
3202
|
+
})
|
|
3203
3203
|
]
|
|
3204
|
-
}
|
|
3204
|
+
})
|
|
3205
3205
|
]
|
|
3206
|
-
}
|
|
3207
|
-
(actions?.assistant || showTimestamp || hasError) && /* @__PURE__ */
|
|
3206
|
+
}),
|
|
3207
|
+
(actions?.assistant || showTimestamp || hasError) && /* @__PURE__ */ jsxs20("div", {
|
|
3208
3208
|
className: "flex items-center gap-2 pt-1",
|
|
3209
3209
|
children: [
|
|
3210
3210
|
actions?.assistant && (() => {
|
|
@@ -3212,32 +3212,32 @@ function AgnoMessageItem({
|
|
|
3212
3212
|
if (visibility === "last-assistant" && !isLastAssistantMessage)
|
|
3213
3213
|
return null;
|
|
3214
3214
|
const useHover = visibility === "hover" || visibility === "hover-last-visible" && !isLastAssistantMessage;
|
|
3215
|
-
return /* @__PURE__ */
|
|
3215
|
+
return /* @__PURE__ */ jsx35("div", {
|
|
3216
3216
|
className: cn("flex items-center gap-1 transition-opacity", useHover && "opacity-0 group-hover/message:opacity-100", classNames?.assistant?.actions),
|
|
3217
3217
|
children: actions.assistant(message)
|
|
3218
|
-
}
|
|
3218
|
+
});
|
|
3219
3219
|
})(),
|
|
3220
|
-
hasError && /* @__PURE__ */
|
|
3220
|
+
hasError && /* @__PURE__ */ jsxs20("span", {
|
|
3221
3221
|
className: "flex items-center gap-1 text-[11px] text-destructive",
|
|
3222
3222
|
children: [
|
|
3223
|
-
/* @__PURE__ */
|
|
3223
|
+
/* @__PURE__ */ jsx35(AlertCircle, {
|
|
3224
3224
|
className: "h-3 w-3"
|
|
3225
|
-
}
|
|
3225
|
+
}),
|
|
3226
3226
|
"Error"
|
|
3227
3227
|
]
|
|
3228
|
-
}
|
|
3229
|
-
showTimestamp && /* @__PURE__ */
|
|
3228
|
+
}),
|
|
3229
|
+
showTimestamp && /* @__PURE__ */ jsx35(SmartTimestamp, {
|
|
3230
3230
|
date: new Date(message.created_at * 1000),
|
|
3231
3231
|
formatShort: isCustomTimestamp ? resolvedFormatTimestamp : undefined,
|
|
3232
3232
|
className: "text-[11px] text-muted-foreground"
|
|
3233
|
-
}
|
|
3233
|
+
})
|
|
3234
3234
|
]
|
|
3235
|
-
}
|
|
3235
|
+
})
|
|
3236
3236
|
]
|
|
3237
|
-
}
|
|
3237
|
+
})
|
|
3238
3238
|
]
|
|
3239
|
-
}
|
|
3240
|
-
preview?.type === "image" && /* @__PURE__ */
|
|
3239
|
+
}),
|
|
3240
|
+
preview?.type === "image" && /* @__PURE__ */ jsx35(ImageLightbox, {
|
|
3241
3241
|
open: true,
|
|
3242
3242
|
onOpenChange: (open) => {
|
|
3243
3243
|
if (!open)
|
|
@@ -3245,21 +3245,21 @@ function AgnoMessageItem({
|
|
|
3245
3245
|
},
|
|
3246
3246
|
images: preview.images,
|
|
3247
3247
|
initialIndex: preview.initialIndex
|
|
3248
|
-
}
|
|
3249
|
-
preview?.type === "file" && /* @__PURE__ */
|
|
3248
|
+
}),
|
|
3249
|
+
preview?.type === "file" && /* @__PURE__ */ jsx35(FilePreviewModal, {
|
|
3250
3250
|
open: true,
|
|
3251
3251
|
onOpenChange: (open) => {
|
|
3252
3252
|
if (!open)
|
|
3253
3253
|
closePreview();
|
|
3254
3254
|
},
|
|
3255
3255
|
file: preview.file
|
|
3256
|
-
}
|
|
3256
|
+
})
|
|
3257
3257
|
]
|
|
3258
|
-
}
|
|
3258
|
+
});
|
|
3259
3259
|
}
|
|
3260
3260
|
// src/ui/composed/AgnoChatInput.tsx
|
|
3261
3261
|
import { CircleStop } from "lucide-react";
|
|
3262
|
-
import {
|
|
3262
|
+
import { jsx as jsx36, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3263
3263
|
var DEFAULT_ACCEPTED_FILE_TYPES = "image/*,audio/*,.pdf,.doc,.docx,.txt,.csv,.xlsx,.xls,.ppt,.pptx,.md,.json,.xml";
|
|
3264
3264
|
function normalizeAudio(audio) {
|
|
3265
3265
|
if (audio === true)
|
|
@@ -3279,37 +3279,37 @@ function dataUrlToBlob(dataUrl) {
|
|
|
3279
3279
|
return new Blob([buf], { type: mime });
|
|
3280
3280
|
}
|
|
3281
3281
|
function CancelButton({ onCancel }) {
|
|
3282
|
-
return /* @__PURE__ */
|
|
3282
|
+
return /* @__PURE__ */ jsx36(Button, {
|
|
3283
3283
|
type: "button",
|
|
3284
3284
|
variant: "destructive",
|
|
3285
3285
|
size: "icon",
|
|
3286
3286
|
className: "h-8 w-8 rounded-lg",
|
|
3287
3287
|
onClick: onCancel,
|
|
3288
3288
|
"aria-label": "Stop",
|
|
3289
|
-
children: /* @__PURE__ */
|
|
3289
|
+
children: /* @__PURE__ */ jsx36(CircleStop, {
|
|
3290
3290
|
className: "size-4"
|
|
3291
|
-
}
|
|
3292
|
-
}
|
|
3291
|
+
})
|
|
3292
|
+
});
|
|
3293
3293
|
}
|
|
3294
3294
|
function SubmitButton({ disabled, status }) {
|
|
3295
3295
|
const { textInput } = usePromptInputController();
|
|
3296
3296
|
const hasText = textInput.value.trim().length > 0;
|
|
3297
|
-
return /* @__PURE__ */
|
|
3297
|
+
return /* @__PURE__ */ jsx36(PromptInputSubmit, {
|
|
3298
3298
|
disabled: disabled || !hasText,
|
|
3299
3299
|
status
|
|
3300
|
-
}
|
|
3300
|
+
});
|
|
3301
3301
|
}
|
|
3302
3302
|
function AttachmentHeader() {
|
|
3303
3303
|
const { files } = usePromptInputAttachments();
|
|
3304
3304
|
if (files.length === 0)
|
|
3305
3305
|
return null;
|
|
3306
|
-
return /* @__PURE__ */
|
|
3307
|
-
children: /* @__PURE__ */
|
|
3308
|
-
children: (attachment) => /* @__PURE__ */
|
|
3306
|
+
return /* @__PURE__ */ jsx36(PromptInputHeader, {
|
|
3307
|
+
children: /* @__PURE__ */ jsx36(PromptInputAttachments, {
|
|
3308
|
+
children: (attachment) => /* @__PURE__ */ jsx36(PromptInputAttachment, {
|
|
3309
3309
|
data: attachment
|
|
3310
|
-
}
|
|
3311
|
-
}
|
|
3312
|
-
}
|
|
3310
|
+
})
|
|
3311
|
+
})
|
|
3312
|
+
});
|
|
3313
3313
|
}
|
|
3314
3314
|
function TranscribeAudioRecorder({
|
|
3315
3315
|
endpoint,
|
|
@@ -3320,7 +3320,7 @@ function TranscribeAudioRecorder({
|
|
|
3320
3320
|
labels
|
|
3321
3321
|
}) {
|
|
3322
3322
|
const { textInput } = usePromptInputController();
|
|
3323
|
-
return /* @__PURE__ */
|
|
3323
|
+
return /* @__PURE__ */ jsx36(AudioRecorder, {
|
|
3324
3324
|
mode: "transcribe",
|
|
3325
3325
|
transcriptionEndpoint: endpoint,
|
|
3326
3326
|
transcriptionHeaders: headers,
|
|
@@ -3333,7 +3333,7 @@ function TranscribeAudioRecorder({
|
|
|
3333
3333
|
},
|
|
3334
3334
|
disabled,
|
|
3335
3335
|
labels
|
|
3336
|
-
}
|
|
3336
|
+
});
|
|
3337
3337
|
}
|
|
3338
3338
|
function AgnoChatInput({
|
|
3339
3339
|
onSend,
|
|
@@ -3384,8 +3384,8 @@ function AgnoChatInput({
|
|
|
3384
3384
|
};
|
|
3385
3385
|
const computedStatus = status ?? (disabled ? "submitted" : undefined);
|
|
3386
3386
|
const showCancelButton = allowCancelRun && isStreaming && onCancel;
|
|
3387
|
-
return /* @__PURE__ */
|
|
3388
|
-
children: /* @__PURE__ */
|
|
3387
|
+
return /* @__PURE__ */ jsx36(PromptInputProvider, {
|
|
3388
|
+
children: /* @__PURE__ */ jsxs21(PromptInput, {
|
|
3389
3389
|
onSubmit: handleSubmit,
|
|
3390
3390
|
accept: fileUpload?.accept ?? DEFAULT_ACCEPTED_FILE_TYPES,
|
|
3391
3391
|
multiple: fileUpload?.multiple ?? true,
|
|
@@ -3395,58 +3395,58 @@ function AgnoChatInput({
|
|
|
3395
3395
|
dragListenerTarget: dropZoneContainerRef,
|
|
3396
3396
|
className: cn("w-full", className),
|
|
3397
3397
|
children: [
|
|
3398
|
-
/* @__PURE__ */
|
|
3399
|
-
/* @__PURE__ */
|
|
3400
|
-
children: /* @__PURE__ */
|
|
3398
|
+
/* @__PURE__ */ jsx36(AttachmentHeader, {}),
|
|
3399
|
+
/* @__PURE__ */ jsx36(PromptInputBody, {
|
|
3400
|
+
children: /* @__PURE__ */ jsx36(PromptInputTextarea, {
|
|
3401
3401
|
placeholder: placeholder || "Type your message... (Enter to send, Shift+Enter for new line)",
|
|
3402
3402
|
disabled
|
|
3403
|
-
}
|
|
3404
|
-
}
|
|
3405
|
-
/* @__PURE__ */
|
|
3403
|
+
})
|
|
3404
|
+
}),
|
|
3405
|
+
/* @__PURE__ */ jsxs21(PromptInputFooter, {
|
|
3406
3406
|
children: [
|
|
3407
|
-
/* @__PURE__ */
|
|
3407
|
+
/* @__PURE__ */ jsxs21(PromptInputTools, {
|
|
3408
3408
|
children: [
|
|
3409
|
-
showAttachments && /* @__PURE__ */
|
|
3409
|
+
showAttachments && /* @__PURE__ */ jsxs21(PromptInputActionMenu, {
|
|
3410
3410
|
children: [
|
|
3411
|
-
/* @__PURE__ */
|
|
3412
|
-
/* @__PURE__ */
|
|
3413
|
-
children: /* @__PURE__ */
|
|
3411
|
+
/* @__PURE__ */ jsx36(PromptInputActionMenuTrigger, {}),
|
|
3412
|
+
/* @__PURE__ */ jsx36(PromptInputActionMenuContent, {
|
|
3413
|
+
children: /* @__PURE__ */ jsx36(PromptInputActionAddAttachments, {
|
|
3414
3414
|
label: "Add files"
|
|
3415
|
-
}
|
|
3416
|
-
}
|
|
3415
|
+
})
|
|
3416
|
+
})
|
|
3417
3417
|
]
|
|
3418
|
-
}
|
|
3419
|
-
audioEnabled && (audioMode === "transcribe" && resolvedAudio?.endpoint ? /* @__PURE__ */
|
|
3418
|
+
}),
|
|
3419
|
+
audioEnabled && (audioMode === "transcribe" && resolvedAudio?.endpoint ? /* @__PURE__ */ jsx36(TranscribeAudioRecorder, {
|
|
3420
3420
|
endpoint: resolvedAudio.endpoint,
|
|
3421
3421
|
headers: resolvedAudio.headers,
|
|
3422
3422
|
disabled,
|
|
3423
3423
|
parseResponse: resolvedAudio.parseResponse,
|
|
3424
3424
|
onRequestPermission: resolvedAudio.requestPermission,
|
|
3425
3425
|
labels: resolvedAudio.labels
|
|
3426
|
-
}
|
|
3426
|
+
}) : /* @__PURE__ */ jsx36(AudioRecorder, {
|
|
3427
3427
|
onRecordingComplete: handleAudioRecording,
|
|
3428
3428
|
disabled,
|
|
3429
3429
|
onRequestPermission: resolvedAudio?.requestPermission,
|
|
3430
3430
|
labels: resolvedAudio?.labels
|
|
3431
|
-
}
|
|
3431
|
+
})),
|
|
3432
3432
|
extraTools
|
|
3433
3433
|
]
|
|
3434
|
-
}
|
|
3435
|
-
showCancelButton ? /* @__PURE__ */
|
|
3434
|
+
}),
|
|
3435
|
+
showCancelButton ? /* @__PURE__ */ jsx36(CancelButton, {
|
|
3436
3436
|
onCancel
|
|
3437
|
-
}
|
|
3437
|
+
}) : /* @__PURE__ */ jsx36(SubmitButton, {
|
|
3438
3438
|
disabled,
|
|
3439
3439
|
status: computedStatus
|
|
3440
|
-
}
|
|
3440
|
+
})
|
|
3441
3441
|
]
|
|
3442
|
-
}
|
|
3443
|
-
showAttachments && /* @__PURE__ */
|
|
3442
|
+
}),
|
|
3443
|
+
showAttachments && /* @__PURE__ */ jsx36(PromptInputDropZone, {
|
|
3444
3444
|
...dropZoneProps,
|
|
3445
3445
|
container: dropZoneContainerRef
|
|
3446
|
-
}
|
|
3446
|
+
})
|
|
3447
3447
|
]
|
|
3448
|
-
}
|
|
3449
|
-
}
|
|
3448
|
+
})
|
|
3449
|
+
});
|
|
3450
3450
|
}
|
|
3451
3451
|
// src/ui/composed/agno-chat/agno-chat.tsx
|
|
3452
3452
|
import { useCallback as useCallback7, useMemo as useMemo3, useRef as useRef6 } from "react";
|
|
@@ -3464,7 +3464,7 @@ function useAgnoChatContext() {
|
|
|
3464
3464
|
}
|
|
3465
3465
|
|
|
3466
3466
|
// src/ui/composed/agno-chat/agno-chat.tsx
|
|
3467
|
-
import {
|
|
3467
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
3468
3468
|
function AgnoChatRoot({
|
|
3469
3469
|
children,
|
|
3470
3470
|
toolHandlers = {},
|
|
@@ -3549,48 +3549,48 @@ function AgnoChatRoot({
|
|
|
3549
3549
|
handleSend,
|
|
3550
3550
|
toolResultRenderers
|
|
3551
3551
|
]);
|
|
3552
|
-
return /* @__PURE__ */
|
|
3552
|
+
return /* @__PURE__ */ jsx37(AgnoChatContext.Provider, {
|
|
3553
3553
|
value: contextValue,
|
|
3554
|
-
children: /* @__PURE__ */
|
|
3554
|
+
children: /* @__PURE__ */ jsx37("div", {
|
|
3555
3555
|
ref: containerRef,
|
|
3556
3556
|
className: cn("relative h-full flex flex-col", className),
|
|
3557
3557
|
...divProps,
|
|
3558
3558
|
children
|
|
3559
|
-
}
|
|
3560
|
-
}
|
|
3559
|
+
})
|
|
3560
|
+
});
|
|
3561
3561
|
}
|
|
3562
3562
|
|
|
3563
3563
|
// src/ui/composed/agno-chat/messages.tsx
|
|
3564
3564
|
import { useEffect as useEffect6, useRef as useRef7 } from "react";
|
|
3565
3565
|
|
|
3566
3566
|
// src/ui/composed/agno-chat/suggested-prompts.tsx
|
|
3567
|
-
import {
|
|
3567
|
+
import { jsx as jsx38, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3568
3568
|
function AgnoChatSuggestedPrompts({ className, prompts }) {
|
|
3569
3569
|
const { handleSend } = useAgnoChatContext();
|
|
3570
3570
|
if (prompts.length === 0)
|
|
3571
3571
|
return null;
|
|
3572
|
-
return /* @__PURE__ */
|
|
3572
|
+
return /* @__PURE__ */ jsx38("div", {
|
|
3573
3573
|
className: cn("grid grid-cols-2 gap-2 w-full max-w-md", className),
|
|
3574
|
-
children: prompts.map((prompt, idx) => /* @__PURE__ */
|
|
3574
|
+
children: prompts.map((prompt, idx) => /* @__PURE__ */ jsxs22("button", {
|
|
3575
3575
|
onClick: () => handleSend(prompt.text),
|
|
3576
3576
|
className: "flex items-center gap-2 px-3 py-2.5 rounded-xl border border-border bg-card hover:bg-accent/50 hover:border-primary/20 transition-all duration-200 text-left text-sm group",
|
|
3577
3577
|
children: [
|
|
3578
|
-
prompt.icon && /* @__PURE__ */
|
|
3578
|
+
prompt.icon && /* @__PURE__ */ jsx38("span", {
|
|
3579
3579
|
className: "text-muted-foreground group-hover:text-primary transition-colors",
|
|
3580
3580
|
children: prompt.icon
|
|
3581
|
-
}
|
|
3582
|
-
/* @__PURE__ */
|
|
3581
|
+
}),
|
|
3582
|
+
/* @__PURE__ */ jsx38("span", {
|
|
3583
3583
|
className: "text-muted-foreground group-hover:text-foreground transition-colors text-xs leading-snug",
|
|
3584
3584
|
children: prompt.text
|
|
3585
|
-
}
|
|
3585
|
+
})
|
|
3586
3586
|
]
|
|
3587
|
-
}, idx
|
|
3588
|
-
}
|
|
3587
|
+
}, idx))
|
|
3588
|
+
});
|
|
3589
3589
|
}
|
|
3590
3590
|
|
|
3591
3591
|
// src/ui/composed/agno-chat/messages.tsx
|
|
3592
3592
|
import { Bot as Bot2 } from "lucide-react";
|
|
3593
|
-
import {
|
|
3593
|
+
import { jsx as jsx39, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3594
3594
|
function ScrollOnNewUserMessage({ messageCount }) {
|
|
3595
3595
|
const { scrollToBottom } = useStickToBottomContext2();
|
|
3596
3596
|
const prevCount = useRef7(messageCount);
|
|
@@ -3656,154 +3656,92 @@ function AgnoChatMessages({
|
|
|
3656
3656
|
...messageClassNames !== undefined && { classNames: messageClassNames },
|
|
3657
3657
|
...toolResultRenderers !== undefined && { toolResultRenderers }
|
|
3658
3658
|
};
|
|
3659
|
-
const resolvedEmptyState = children ?? emptyState ?? /* @__PURE__ */
|
|
3659
|
+
const resolvedEmptyState = children ?? emptyState ?? /* @__PURE__ */ jsxs23("div", {
|
|
3660
3660
|
className: "flex flex-col items-center gap-6",
|
|
3661
3661
|
children: [
|
|
3662
|
-
/* @__PURE__ */
|
|
3662
|
+
/* @__PURE__ */ jsxs23("div", {
|
|
3663
3663
|
className: "relative",
|
|
3664
3664
|
children: [
|
|
3665
|
-
/* @__PURE__ */
|
|
3665
|
+
/* @__PURE__ */ jsx39("div", {
|
|
3666
3666
|
className: "h-16 w-16 rounded-2xl bg-primary/10 flex items-center justify-center",
|
|
3667
|
-
children: /* @__PURE__ */
|
|
3667
|
+
children: /* @__PURE__ */ jsx39(Bot2, {
|
|
3668
3668
|
className: "h-8 w-8 text-primary"
|
|
3669
|
-
}
|
|
3670
|
-
}
|
|
3671
|
-
/* @__PURE__ */
|
|
3669
|
+
})
|
|
3670
|
+
}),
|
|
3671
|
+
/* @__PURE__ */ jsx39("div", {
|
|
3672
3672
|
className: "absolute -bottom-1 -right-1 h-5 w-5 rounded-full bg-green-500 border-2 border-background flex items-center justify-center",
|
|
3673
|
-
children: /* @__PURE__ */
|
|
3673
|
+
children: /* @__PURE__ */ jsx39("span", {
|
|
3674
3674
|
className: "h-2 w-2 rounded-full bg-white animate-pulse"
|
|
3675
|
-
}
|
|
3676
|
-
}
|
|
3675
|
+
})
|
|
3676
|
+
})
|
|
3677
3677
|
]
|
|
3678
|
-
}
|
|
3679
|
-
/* @__PURE__ */
|
|
3678
|
+
}),
|
|
3679
|
+
/* @__PURE__ */ jsxs23("div", {
|
|
3680
3680
|
className: "space-y-2 text-center",
|
|
3681
3681
|
children: [
|
|
3682
|
-
/* @__PURE__ */
|
|
3682
|
+
/* @__PURE__ */ jsx39("h3", {
|
|
3683
3683
|
className: "text-xl font-semibold tracking-tight",
|
|
3684
3684
|
children: "Welcome to Agno Chat"
|
|
3685
|
-
}
|
|
3686
|
-
/* @__PURE__ */
|
|
3685
|
+
}),
|
|
3686
|
+
/* @__PURE__ */ jsx39("p", {
|
|
3687
3687
|
className: "text-muted-foreground text-sm max-w-sm",
|
|
3688
3688
|
children: "Start a conversation with your AI agent. Ask questions, explore ideas, or run tools."
|
|
3689
|
-
}
|
|
3689
|
+
})
|
|
3690
3690
|
]
|
|
3691
|
-
}
|
|
3692
|
-
suggestedPrompts.length > 0 && /* @__PURE__ */
|
|
3691
|
+
}),
|
|
3692
|
+
suggestedPrompts.length > 0 && /* @__PURE__ */ jsx39(AgnoChatSuggestedPrompts, {
|
|
3693
3693
|
prompts: suggestedPrompts
|
|
3694
|
-
}
|
|
3694
|
+
})
|
|
3695
3695
|
]
|
|
3696
|
-
}
|
|
3697
|
-
return /* @__PURE__ */
|
|
3696
|
+
});
|
|
3697
|
+
return /* @__PURE__ */ jsxs23(Conversation, {
|
|
3698
3698
|
className: cn("relative flex-1 w-full", className),
|
|
3699
3699
|
children: [
|
|
3700
|
-
/* @__PURE__ */
|
|
3700
|
+
/* @__PURE__ */ jsx39(ScrollOnNewUserMessage, {
|
|
3701
3701
|
messageCount: messages.length
|
|
3702
|
-
}
|
|
3703
|
-
/* @__PURE__ */
|
|
3702
|
+
}),
|
|
3703
|
+
/* @__PURE__ */ jsxs23(ConversationContent, {
|
|
3704
3704
|
className: "max-w-3xl mx-auto",
|
|
3705
3705
|
children: [
|
|
3706
|
-
messages.length === 0 ? /* @__PURE__ */
|
|
3706
|
+
messages.length === 0 ? /* @__PURE__ */ jsx39(ConversationEmptyState, {
|
|
3707
3707
|
children: resolvedEmptyState
|
|
3708
|
-
}
|
|
3708
|
+
}) : messages.map((message, index) => {
|
|
3709
3709
|
if (isThinking && index === messages.length - 1 && message === lastMessage)
|
|
3710
3710
|
return null;
|
|
3711
|
-
return renderMessage ? renderMessage(message, index) : /* @__PURE__ */
|
|
3711
|
+
return renderMessage ? renderMessage(message, index) : /* @__PURE__ */ jsx39(AgnoMessageItem, {
|
|
3712
3712
|
message,
|
|
3713
3713
|
avatars,
|
|
3714
3714
|
actions,
|
|
3715
3715
|
isLastAssistantMessage: index === lastAssistantIndex,
|
|
3716
3716
|
...messageItemProps
|
|
3717
|
-
}, `msg-${index}-${message.created_at}
|
|
3717
|
+
}, `msg-${index}-${message.created_at}`);
|
|
3718
3718
|
}),
|
|
3719
|
-
isThinking && /* @__PURE__ */
|
|
3719
|
+
isThinking && /* @__PURE__ */ jsx39("div", {
|
|
3720
3720
|
className: "py-2",
|
|
3721
|
-
children: renderThinkingIndicator ?? /* @__PURE__ */
|
|
3721
|
+
children: renderThinkingIndicator ?? /* @__PURE__ */ jsx39(StreamingIndicator, {
|
|
3722
3722
|
avatar: avatars?.assistant
|
|
3723
|
-
}
|
|
3724
|
-
}
|
|
3723
|
+
})
|
|
3724
|
+
})
|
|
3725
3725
|
]
|
|
3726
|
-
}
|
|
3727
|
-
/* @__PURE__ */
|
|
3726
|
+
}),
|
|
3727
|
+
/* @__PURE__ */ jsx39(ConversationScrollButton, {})
|
|
3728
3728
|
]
|
|
3729
|
-
}
|
|
3729
|
+
});
|
|
3730
3730
|
}
|
|
3731
3731
|
|
|
3732
3732
|
// src/ui/composed/agno-chat/empty-state.tsx
|
|
3733
|
-
import {
|
|
3733
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
3734
3734
|
function AgnoChatEmptyState({ children, className, ...props }) {
|
|
3735
|
-
return /* @__PURE__ */
|
|
3735
|
+
return /* @__PURE__ */ jsx40("div", {
|
|
3736
3736
|
className: cn("flex flex-col items-center gap-6", className),
|
|
3737
3737
|
...props,
|
|
3738
3738
|
children
|
|
3739
|
-
}
|
|
3740
|
-
}
|
|
3741
|
-
|
|
3742
|
-
// src/ui/composed/agno-chat/tool-status.tsx
|
|
3743
|
-
import { Loader2 as Loader22, Wrench } from "lucide-react";
|
|
3744
|
-
import { jsxDEV as jsxDEV41, Fragment as Fragment6 } from "react/jsx-dev-runtime";
|
|
3745
|
-
function AgnoChatToolStatus({ className }) {
|
|
3746
|
-
const { isPaused, isExecuting, pendingTools } = useAgnoChatContext();
|
|
3747
|
-
if (!isPaused && !isExecuting)
|
|
3748
|
-
return null;
|
|
3749
|
-
return /* @__PURE__ */ jsxDEV41("div", {
|
|
3750
|
-
className: cn("px-4 py-2.5 border-t border-border bg-primary/5", className),
|
|
3751
|
-
children: /* @__PURE__ */ jsxDEV41("div", {
|
|
3752
|
-
className: "flex items-center gap-2.5 text-sm max-w-3xl mx-auto",
|
|
3753
|
-
children: isExecuting ? /* @__PURE__ */ jsxDEV41(Fragment6, {
|
|
3754
|
-
children: [
|
|
3755
|
-
/* @__PURE__ */ jsxDEV41("div", {
|
|
3756
|
-
className: "h-5 w-5 rounded-full bg-primary/10 flex items-center justify-center",
|
|
3757
|
-
children: /* @__PURE__ */ jsxDEV41(Loader22, {
|
|
3758
|
-
className: "h-3 w-3 animate-spin text-primary"
|
|
3759
|
-
}, undefined, false, undefined, this)
|
|
3760
|
-
}, undefined, false, undefined, this),
|
|
3761
|
-
/* @__PURE__ */ jsxDEV41("span", {
|
|
3762
|
-
className: "text-muted-foreground",
|
|
3763
|
-
children: [
|
|
3764
|
-
"Executing",
|
|
3765
|
-
" ",
|
|
3766
|
-
/* @__PURE__ */ jsxDEV41("span", {
|
|
3767
|
-
className: "font-medium text-foreground",
|
|
3768
|
-
children: pendingTools.length
|
|
3769
|
-
}, undefined, false, undefined, this),
|
|
3770
|
-
" tool",
|
|
3771
|
-
pendingTools.length !== 1 ? "s" : "",
|
|
3772
|
-
"..."
|
|
3773
|
-
]
|
|
3774
|
-
}, undefined, true, undefined, this)
|
|
3775
|
-
]
|
|
3776
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */ jsxDEV41(Fragment6, {
|
|
3777
|
-
children: [
|
|
3778
|
-
/* @__PURE__ */ jsxDEV41("div", {
|
|
3779
|
-
className: "h-5 w-5 rounded-full bg-amber-500/10 flex items-center justify-center",
|
|
3780
|
-
children: /* @__PURE__ */ jsxDEV41(Wrench, {
|
|
3781
|
-
className: "h-3 w-3 text-amber-600 dark:text-amber-400"
|
|
3782
|
-
}, undefined, false, undefined, this)
|
|
3783
|
-
}, undefined, false, undefined, this),
|
|
3784
|
-
/* @__PURE__ */ jsxDEV41("span", {
|
|
3785
|
-
className: "text-muted-foreground",
|
|
3786
|
-
children: [
|
|
3787
|
-
"Preparing",
|
|
3788
|
-
" ",
|
|
3789
|
-
/* @__PURE__ */ jsxDEV41("span", {
|
|
3790
|
-
className: "font-medium text-foreground",
|
|
3791
|
-
children: pendingTools.length
|
|
3792
|
-
}, undefined, false, undefined, this),
|
|
3793
|
-
" tool",
|
|
3794
|
-
pendingTools.length !== 1 ? "s" : "",
|
|
3795
|
-
"..."
|
|
3796
|
-
]
|
|
3797
|
-
}, undefined, true, undefined, this)
|
|
3798
|
-
]
|
|
3799
|
-
}, undefined, true, undefined, this)
|
|
3800
|
-
}, undefined, false, undefined, this)
|
|
3801
|
-
}, undefined, false, undefined, this);
|
|
3739
|
+
});
|
|
3802
3740
|
}
|
|
3803
3741
|
|
|
3804
3742
|
// src/ui/composed/agno-chat/error-bar.tsx
|
|
3805
3743
|
import { useState as useState9, useEffect as useEffect7, useRef as useRef8 } from "react";
|
|
3806
|
-
import {
|
|
3744
|
+
import { jsx as jsx41, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3807
3745
|
function AgnoChatErrorBar({
|
|
3808
3746
|
className,
|
|
3809
3747
|
text,
|
|
@@ -3843,23 +3781,23 @@ function AgnoChatErrorBar({
|
|
|
3843
3781
|
if (children) {
|
|
3844
3782
|
return typeof children === "function" ? children(rawMessage) : children;
|
|
3845
3783
|
}
|
|
3846
|
-
return /* @__PURE__ */
|
|
3784
|
+
return /* @__PURE__ */ jsxs24("div", {
|
|
3847
3785
|
className: "flex items-center gap-2 max-w-3xl mx-auto",
|
|
3848
3786
|
children: [
|
|
3849
|
-
icon && /* @__PURE__ */
|
|
3787
|
+
icon && /* @__PURE__ */ jsx41("span", {
|
|
3850
3788
|
className: "shrink-0",
|
|
3851
3789
|
children: icon
|
|
3852
|
-
}
|
|
3853
|
-
/* @__PURE__ */
|
|
3790
|
+
}),
|
|
3791
|
+
/* @__PURE__ */ jsx41("p", {
|
|
3854
3792
|
className: "text-sm text-destructive flex-1",
|
|
3855
3793
|
children: displayMessage
|
|
3856
|
-
}
|
|
3857
|
-
dismissible && /* @__PURE__ */
|
|
3794
|
+
}),
|
|
3795
|
+
dismissible && /* @__PURE__ */ jsx41("button", {
|
|
3858
3796
|
type: "button",
|
|
3859
3797
|
onClick: () => setHidden(true),
|
|
3860
3798
|
className: "shrink-0 text-destructive/60 hover:text-destructive transition-colors",
|
|
3861
3799
|
"aria-label": "Dismiss error",
|
|
3862
|
-
children: /* @__PURE__ */
|
|
3800
|
+
children: /* @__PURE__ */ jsxs24("svg", {
|
|
3863
3801
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3864
3802
|
width: "16",
|
|
3865
3803
|
height: "16",
|
|
@@ -3870,26 +3808,26 @@ function AgnoChatErrorBar({
|
|
|
3870
3808
|
strokeLinecap: "round",
|
|
3871
3809
|
strokeLinejoin: "round",
|
|
3872
3810
|
children: [
|
|
3873
|
-
/* @__PURE__ */
|
|
3811
|
+
/* @__PURE__ */ jsx41("path", {
|
|
3874
3812
|
d: "M18 6 6 18"
|
|
3875
|
-
}
|
|
3876
|
-
/* @__PURE__ */
|
|
3813
|
+
}),
|
|
3814
|
+
/* @__PURE__ */ jsx41("path", {
|
|
3877
3815
|
d: "m6 6 12 12"
|
|
3878
|
-
}
|
|
3816
|
+
})
|
|
3879
3817
|
]
|
|
3880
|
-
}
|
|
3881
|
-
}
|
|
3818
|
+
})
|
|
3819
|
+
})
|
|
3882
3820
|
]
|
|
3883
|
-
}
|
|
3821
|
+
});
|
|
3884
3822
|
};
|
|
3885
|
-
return /* @__PURE__ */
|
|
3823
|
+
return /* @__PURE__ */ jsx41("div", {
|
|
3886
3824
|
className: cn("px-4 py-2.5 bg-destructive/5 border-t border-destructive/20", className),
|
|
3887
3825
|
children: renderContent()
|
|
3888
|
-
}
|
|
3826
|
+
});
|
|
3889
3827
|
}
|
|
3890
3828
|
|
|
3891
3829
|
// src/ui/composed/agno-chat/input.tsx
|
|
3892
|
-
import {
|
|
3830
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
3893
3831
|
function AgnoChatInputArea({
|
|
3894
3832
|
className,
|
|
3895
3833
|
children,
|
|
@@ -3902,11 +3840,11 @@ function AgnoChatInputArea({
|
|
|
3902
3840
|
dropZoneProps
|
|
3903
3841
|
}) {
|
|
3904
3842
|
const { handleSend, inputDisabled, isStreaming, isPaused, cancelRun, dropZoneContainerRef } = useAgnoChatContext();
|
|
3905
|
-
return /* @__PURE__ */
|
|
3843
|
+
return /* @__PURE__ */ jsx42("div", {
|
|
3906
3844
|
className: cn("border-t border-border bg-background/80 backdrop-blur-sm", className),
|
|
3907
|
-
children: /* @__PURE__ */
|
|
3845
|
+
children: /* @__PURE__ */ jsx42("div", {
|
|
3908
3846
|
className: "mx-auto px-4 py-2",
|
|
3909
|
-
children: children ? children({ onSend: handleSend, disabled: inputDisabled, isStreaming, isPaused }) : /* @__PURE__ */
|
|
3847
|
+
children: children ? children({ onSend: handleSend, disabled: inputDisabled, isStreaming, isPaused }) : /* @__PURE__ */ jsx42(AgnoChatInput, {
|
|
3910
3848
|
onSend: handleSend,
|
|
3911
3849
|
disabled: inputDisabled,
|
|
3912
3850
|
isStreaming,
|
|
@@ -3919,9 +3857,9 @@ function AgnoChatInputArea({
|
|
|
3919
3857
|
extraTools,
|
|
3920
3858
|
dropZoneContainerRef,
|
|
3921
3859
|
dropZoneProps
|
|
3922
|
-
}
|
|
3923
|
-
}
|
|
3924
|
-
}
|
|
3860
|
+
})
|
|
3861
|
+
})
|
|
3862
|
+
});
|
|
3925
3863
|
}
|
|
3926
3864
|
|
|
3927
3865
|
// src/ui/composed/agno-chat/index.ts
|
|
@@ -3929,7 +3867,6 @@ var AgnoChat = Object.assign(AgnoChatRoot, {
|
|
|
3929
3867
|
Messages: AgnoChatMessages,
|
|
3930
3868
|
EmptyState: AgnoChatEmptyState,
|
|
3931
3869
|
SuggestedPrompts: AgnoChatSuggestedPrompts,
|
|
3932
|
-
ToolStatus: AgnoChatToolStatus,
|
|
3933
3870
|
ErrorBar: AgnoChatErrorBar,
|
|
3934
3871
|
Input: AgnoChatInputArea
|
|
3935
3872
|
});
|
|
@@ -4077,7 +4014,6 @@ export {
|
|
|
4077
4014
|
ArtifactAction,
|
|
4078
4015
|
Artifact,
|
|
4079
4016
|
AgnoMessageItem,
|
|
4080
|
-
AgnoChatToolStatus,
|
|
4081
4017
|
AgnoChatSuggestedPrompts,
|
|
4082
4018
|
AgnoChatRoot,
|
|
4083
4019
|
AgnoChatMessages,
|
|
@@ -4092,4 +4028,4 @@ export {
|
|
|
4092
4028
|
Accordion
|
|
4093
4029
|
};
|
|
4094
4030
|
|
|
4095
|
-
//# debugId=
|
|
4031
|
+
//# debugId=B7CF327D3F6FBB7F64756E2164756E21
|