@rodrigocoliveira/agno-react 1.2.0 → 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/dist/hooks/useAgnoComponents.d.ts +54 -0
- package/dist/hooks/useAgnoComponents.d.ts.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +297 -88
- package/dist/index.js.map +5 -4
- package/dist/index.mjs +297 -88
- package/dist/index.mjs.map +5 -4
- package/dist/ui.js +947 -947
- package/dist/ui.js.map +2 -2
- package/dist/ui.mjs +947 -947
- package/dist/ui.mjs.map +2 -2
- package/package.json +4 -4
package/dist/ui.js
CHANGED
|
@@ -311,7 +311,7 @@ function isPreviewable(mimeType) {
|
|
|
311
311
|
var React = __toESM(require("react"));
|
|
312
312
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
313
313
|
var import_class_variance_authority = require("class-variance-authority");
|
|
314
|
-
var
|
|
314
|
+
var jsx_runtime = require("react/jsx-runtime");
|
|
315
315
|
var buttonVariants = import_class_variance_authority.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", {
|
|
316
316
|
variants: {
|
|
317
317
|
variant: {
|
|
@@ -336,16 +336,16 @@ var buttonVariants = import_class_variance_authority.cva("inline-flex items-cent
|
|
|
336
336
|
});
|
|
337
337
|
var Button = React.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
338
338
|
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
339
|
-
return /* @__PURE__ */
|
|
339
|
+
return /* @__PURE__ */ jsx_runtime.jsx(Comp, {
|
|
340
340
|
className: cn(buttonVariants({ variant, size, className })),
|
|
341
341
|
ref,
|
|
342
342
|
...props
|
|
343
|
-
}
|
|
343
|
+
});
|
|
344
344
|
});
|
|
345
345
|
Button.displayName = "Button";
|
|
346
346
|
// src/ui/primitives/badge.tsx
|
|
347
347
|
var import_class_variance_authority2 = require("class-variance-authority");
|
|
348
|
-
var
|
|
348
|
+
var jsx_runtime2 = require("react/jsx-runtime");
|
|
349
349
|
var badgeVariants = import_class_variance_authority2.cva("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", {
|
|
350
350
|
variants: {
|
|
351
351
|
variant: {
|
|
@@ -360,61 +360,61 @@ var badgeVariants = import_class_variance_authority2.cva("inline-flex items-cent
|
|
|
360
360
|
}
|
|
361
361
|
});
|
|
362
362
|
function Badge({ className, variant, ...props }) {
|
|
363
|
-
return /* @__PURE__ */
|
|
363
|
+
return /* @__PURE__ */ jsx_runtime2.jsx("div", {
|
|
364
364
|
className: cn(badgeVariants({ variant }), className),
|
|
365
365
|
...props
|
|
366
|
-
}
|
|
366
|
+
});
|
|
367
367
|
}
|
|
368
368
|
// src/ui/primitives/avatar.tsx
|
|
369
369
|
var React2 = __toESM(require("react"));
|
|
370
370
|
var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"));
|
|
371
|
-
var
|
|
372
|
-
var Avatar = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
371
|
+
var jsx_runtime3 = require("react/jsx-runtime");
|
|
372
|
+
var Avatar = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime3.jsx(AvatarPrimitive.Root, {
|
|
373
373
|
ref,
|
|
374
374
|
className: cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className),
|
|
375
375
|
...props
|
|
376
|
-
}
|
|
376
|
+
}));
|
|
377
377
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
378
|
-
var AvatarImage = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
378
|
+
var AvatarImage = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime3.jsx(AvatarPrimitive.Image, {
|
|
379
379
|
ref,
|
|
380
380
|
className: cn("aspect-square h-full w-full", className),
|
|
381
381
|
...props
|
|
382
|
-
}
|
|
382
|
+
}));
|
|
383
383
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
384
|
-
var AvatarFallback = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
384
|
+
var AvatarFallback = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime3.jsx(AvatarPrimitive.Fallback, {
|
|
385
385
|
ref,
|
|
386
386
|
className: cn("flex h-full w-full items-center justify-center rounded-full bg-muted", className),
|
|
387
387
|
...props
|
|
388
|
-
}
|
|
388
|
+
}));
|
|
389
389
|
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
390
390
|
// src/ui/primitives/input-group.tsx
|
|
391
391
|
var React3 = __toESM(require("react"));
|
|
392
392
|
var import_class_variance_authority3 = require("class-variance-authority");
|
|
393
|
-
var
|
|
393
|
+
var jsx_runtime4 = require("react/jsx-runtime");
|
|
394
394
|
var Input = React3.forwardRef(({ className, type, ...props }, ref) => {
|
|
395
|
-
return /* @__PURE__ */
|
|
395
|
+
return /* @__PURE__ */ jsx_runtime4.jsx("input", {
|
|
396
396
|
type,
|
|
397
397
|
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),
|
|
398
398
|
ref,
|
|
399
399
|
...props
|
|
400
|
-
}
|
|
400
|
+
});
|
|
401
401
|
});
|
|
402
402
|
Input.displayName = "Input";
|
|
403
403
|
var Textarea = React3.forwardRef(({ className, ...props }, ref) => {
|
|
404
|
-
return /* @__PURE__ */
|
|
404
|
+
return /* @__PURE__ */ jsx_runtime4.jsx("textarea", {
|
|
405
405
|
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),
|
|
406
406
|
ref,
|
|
407
407
|
...props
|
|
408
|
-
}
|
|
408
|
+
});
|
|
409
409
|
});
|
|
410
410
|
Textarea.displayName = "Textarea";
|
|
411
411
|
function InputGroup({ className, ...props }) {
|
|
412
|
-
return /* @__PURE__ */
|
|
412
|
+
return /* @__PURE__ */ jsx_runtime4.jsx("div", {
|
|
413
413
|
"data-slot": "input-group",
|
|
414
414
|
role: "group",
|
|
415
415
|
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),
|
|
416
416
|
...props
|
|
417
|
-
}
|
|
417
|
+
});
|
|
418
418
|
}
|
|
419
419
|
var inputGroupAddonVariants = import_class_variance_authority3.cva("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", {
|
|
420
420
|
variants: {
|
|
@@ -434,7 +434,7 @@ function InputGroupAddon({
|
|
|
434
434
|
align = "inline-start",
|
|
435
435
|
...props
|
|
436
436
|
}) {
|
|
437
|
-
return /* @__PURE__ */
|
|
437
|
+
return /* @__PURE__ */ jsx_runtime4.jsx("div", {
|
|
438
438
|
role: "group",
|
|
439
439
|
"data-slot": "input-group-addon",
|
|
440
440
|
"data-align": align,
|
|
@@ -446,7 +446,7 @@ function InputGroupAddon({
|
|
|
446
446
|
e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
447
447
|
},
|
|
448
448
|
...props
|
|
449
|
-
}
|
|
449
|
+
});
|
|
450
450
|
}
|
|
451
451
|
var inputGroupButtonVariants = import_class_variance_authority3.cva("flex items-center gap-2 text-sm shadow-none", {
|
|
452
452
|
variants: {
|
|
@@ -468,33 +468,33 @@ function InputGroupButton({
|
|
|
468
468
|
size = "xs",
|
|
469
469
|
...props
|
|
470
470
|
}) {
|
|
471
|
-
return /* @__PURE__ */
|
|
471
|
+
return /* @__PURE__ */ jsx_runtime4.jsx(Button, {
|
|
472
472
|
type,
|
|
473
473
|
"data-size": size,
|
|
474
474
|
variant,
|
|
475
475
|
className: cn(inputGroupButtonVariants({ size }), className),
|
|
476
476
|
...props
|
|
477
|
-
}
|
|
477
|
+
});
|
|
478
478
|
}
|
|
479
479
|
function InputGroupText({ className, ...props }) {
|
|
480
|
-
return /* @__PURE__ */
|
|
480
|
+
return /* @__PURE__ */ jsx_runtime4.jsx("span", {
|
|
481
481
|
className: cn("text-muted-foreground flex items-center gap-2 text-sm [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none", className),
|
|
482
482
|
...props
|
|
483
|
-
}
|
|
483
|
+
});
|
|
484
484
|
}
|
|
485
485
|
function InputGroupInput({ className, ...props }) {
|
|
486
|
-
return /* @__PURE__ */
|
|
486
|
+
return /* @__PURE__ */ jsx_runtime4.jsx(Input, {
|
|
487
487
|
"data-slot": "input-group-control",
|
|
488
488
|
className: cn("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent", className),
|
|
489
489
|
...props
|
|
490
|
-
}
|
|
490
|
+
});
|
|
491
491
|
}
|
|
492
492
|
function InputGroupTextarea({ className, ...props }) {
|
|
493
|
-
return /* @__PURE__ */
|
|
493
|
+
return /* @__PURE__ */ jsx_runtime4.jsx(Textarea, {
|
|
494
494
|
"data-slot": "input-group-control",
|
|
495
495
|
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),
|
|
496
496
|
...props
|
|
497
|
-
}
|
|
497
|
+
});
|
|
498
498
|
}
|
|
499
499
|
// src/ui/primitives/collapsible.tsx
|
|
500
500
|
var CollapsiblePrimitive = __toESM(require("@radix-ui/react-collapsible"));
|
|
@@ -504,318 +504,318 @@ var CollapsibleContent2 = CollapsiblePrimitive.CollapsibleContent;
|
|
|
504
504
|
// src/ui/primitives/tooltip.tsx
|
|
505
505
|
var React4 = __toESM(require("react"));
|
|
506
506
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
507
|
-
var
|
|
507
|
+
var jsx_runtime5 = require("react/jsx-runtime");
|
|
508
508
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
509
509
|
var Tooltip = TooltipPrimitive.Root;
|
|
510
510
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
511
|
-
var TooltipContent = React4.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */
|
|
512
|
-
children: /* @__PURE__ */
|
|
511
|
+
var TooltipContent = React4.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx_runtime5.jsx(TooltipPrimitive.Portal, {
|
|
512
|
+
children: /* @__PURE__ */ jsx_runtime5.jsx(TooltipPrimitive.Content, {
|
|
513
513
|
ref,
|
|
514
514
|
sideOffset,
|
|
515
515
|
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),
|
|
516
516
|
...props
|
|
517
|
-
}
|
|
518
|
-
}
|
|
517
|
+
})
|
|
518
|
+
}));
|
|
519
519
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
520
520
|
// src/ui/primitives/accordion.tsx
|
|
521
521
|
var React5 = __toESM(require("react"));
|
|
522
522
|
var AccordionPrimitive = __toESM(require("@radix-ui/react-accordion"));
|
|
523
523
|
var import_lucide_react = require("lucide-react");
|
|
524
|
-
var
|
|
524
|
+
var jsx_runtime6 = require("react/jsx-runtime");
|
|
525
525
|
var Accordion = AccordionPrimitive.Root;
|
|
526
|
-
var AccordionItem = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
526
|
+
var AccordionItem = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime6.jsx(AccordionPrimitive.Item, {
|
|
527
527
|
ref,
|
|
528
528
|
className: cn("border-b", className),
|
|
529
529
|
...props
|
|
530
|
-
}
|
|
530
|
+
}));
|
|
531
531
|
AccordionItem.displayName = "AccordionItem";
|
|
532
|
-
var AccordionTrigger = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
532
|
+
var AccordionTrigger = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx_runtime6.jsx(AccordionPrimitive.Header, {
|
|
533
533
|
className: "flex",
|
|
534
|
-
children: /* @__PURE__ */
|
|
534
|
+
children: /* @__PURE__ */ jsx_runtime6.jsxs(AccordionPrimitive.Trigger, {
|
|
535
535
|
ref,
|
|
536
536
|
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),
|
|
537
537
|
...props,
|
|
538
538
|
children: [
|
|
539
539
|
children,
|
|
540
|
-
/* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ jsx_runtime6.jsx(import_lucide_react.ChevronDown, {
|
|
541
541
|
className: "h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"
|
|
542
|
-
}
|
|
542
|
+
})
|
|
543
543
|
]
|
|
544
|
-
}
|
|
545
|
-
}
|
|
544
|
+
})
|
|
545
|
+
}));
|
|
546
546
|
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
547
|
-
var AccordionContent = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
547
|
+
var AccordionContent = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx_runtime6.jsx(AccordionPrimitive.Content, {
|
|
548
548
|
ref,
|
|
549
549
|
className: "overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
|
|
550
550
|
...props,
|
|
551
|
-
children: /* @__PURE__ */
|
|
551
|
+
children: /* @__PURE__ */ jsx_runtime6.jsx("div", {
|
|
552
552
|
className: cn("pb-4 pt-0", className),
|
|
553
553
|
children
|
|
554
|
-
}
|
|
555
|
-
}
|
|
554
|
+
})
|
|
555
|
+
}));
|
|
556
556
|
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
557
557
|
// src/ui/primitives/dropdown-menu.tsx
|
|
558
558
|
var React6 = __toESM(require("react"));
|
|
559
559
|
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
560
560
|
var import_lucide_react2 = require("lucide-react");
|
|
561
|
-
var
|
|
561
|
+
var jsx_runtime7 = require("react/jsx-runtime");
|
|
562
562
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
563
563
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
564
564
|
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
565
565
|
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
566
566
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
567
567
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
568
|
-
var DropdownMenuSubTrigger = React6.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */
|
|
568
|
+
var DropdownMenuSubTrigger = React6.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsx_runtime7.jsxs(DropdownMenuPrimitive.SubTrigger, {
|
|
569
569
|
ref,
|
|
570
570
|
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),
|
|
571
571
|
...props,
|
|
572
572
|
children: [
|
|
573
573
|
children,
|
|
574
|
-
/* @__PURE__ */
|
|
574
|
+
/* @__PURE__ */ jsx_runtime7.jsx(import_lucide_react2.ChevronRight, {
|
|
575
575
|
className: "ml-auto"
|
|
576
|
-
}
|
|
576
|
+
})
|
|
577
577
|
]
|
|
578
|
-
}
|
|
578
|
+
}));
|
|
579
579
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
580
|
-
var DropdownMenuSubContent = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
580
|
+
var DropdownMenuSubContent = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime7.jsx(DropdownMenuPrimitive.SubContent, {
|
|
581
581
|
ref,
|
|
582
582
|
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),
|
|
583
583
|
...props
|
|
584
|
-
}
|
|
584
|
+
}));
|
|
585
585
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
586
|
-
var DropdownMenuContent = React6.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */
|
|
587
|
-
children: /* @__PURE__ */
|
|
586
|
+
var DropdownMenuContent = React6.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx_runtime7.jsx(DropdownMenuPrimitive.Portal, {
|
|
587
|
+
children: /* @__PURE__ */ jsx_runtime7.jsx(DropdownMenuPrimitive.Content, {
|
|
588
588
|
ref,
|
|
589
589
|
sideOffset,
|
|
590
590
|
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),
|
|
591
591
|
...props
|
|
592
|
-
}
|
|
593
|
-
}
|
|
592
|
+
})
|
|
593
|
+
}));
|
|
594
594
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
595
|
-
var DropdownMenuItem = React6.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */
|
|
595
|
+
var DropdownMenuItem = React6.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx_runtime7.jsx(DropdownMenuPrimitive.Item, {
|
|
596
596
|
ref,
|
|
597
597
|
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),
|
|
598
598
|
...props
|
|
599
|
-
}
|
|
599
|
+
}));
|
|
600
600
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
601
|
-
var DropdownMenuCheckboxItem = React6.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */
|
|
601
|
+
var DropdownMenuCheckboxItem = React6.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsx_runtime7.jsxs(DropdownMenuPrimitive.CheckboxItem, {
|
|
602
602
|
ref,
|
|
603
603
|
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),
|
|
604
604
|
checked,
|
|
605
605
|
...props,
|
|
606
606
|
children: [
|
|
607
|
-
/* @__PURE__ */
|
|
607
|
+
/* @__PURE__ */ jsx_runtime7.jsx("span", {
|
|
608
608
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
609
|
-
children: /* @__PURE__ */
|
|
610
|
-
children: /* @__PURE__ */
|
|
609
|
+
children: /* @__PURE__ */ jsx_runtime7.jsx(DropdownMenuPrimitive.ItemIndicator, {
|
|
610
|
+
children: /* @__PURE__ */ jsx_runtime7.jsx(import_lucide_react2.Check, {
|
|
611
611
|
className: "h-4 w-4"
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
}
|
|
612
|
+
})
|
|
613
|
+
})
|
|
614
|
+
}),
|
|
615
615
|
children
|
|
616
616
|
]
|
|
617
|
-
}
|
|
617
|
+
}));
|
|
618
618
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
619
|
-
var DropdownMenuRadioItem = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
619
|
+
var DropdownMenuRadioItem = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx_runtime7.jsxs(DropdownMenuPrimitive.RadioItem, {
|
|
620
620
|
ref,
|
|
621
621
|
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),
|
|
622
622
|
...props,
|
|
623
623
|
children: [
|
|
624
|
-
/* @__PURE__ */
|
|
624
|
+
/* @__PURE__ */ jsx_runtime7.jsx("span", {
|
|
625
625
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
626
|
-
children: /* @__PURE__ */
|
|
627
|
-
children: /* @__PURE__ */
|
|
626
|
+
children: /* @__PURE__ */ jsx_runtime7.jsx(DropdownMenuPrimitive.ItemIndicator, {
|
|
627
|
+
children: /* @__PURE__ */ jsx_runtime7.jsx(import_lucide_react2.Circle, {
|
|
628
628
|
className: "h-2 w-2 fill-current"
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
}
|
|
629
|
+
})
|
|
630
|
+
})
|
|
631
|
+
}),
|
|
632
632
|
children
|
|
633
633
|
]
|
|
634
|
-
}
|
|
634
|
+
}));
|
|
635
635
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
636
|
-
var DropdownMenuLabel = React6.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */
|
|
636
|
+
var DropdownMenuLabel = React6.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx_runtime7.jsx(DropdownMenuPrimitive.Label, {
|
|
637
637
|
ref,
|
|
638
638
|
className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className),
|
|
639
639
|
...props
|
|
640
|
-
}
|
|
640
|
+
}));
|
|
641
641
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
642
|
-
var DropdownMenuSeparator = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
642
|
+
var DropdownMenuSeparator = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime7.jsx(DropdownMenuPrimitive.Separator, {
|
|
643
643
|
ref,
|
|
644
644
|
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
645
645
|
...props
|
|
646
|
-
}
|
|
646
|
+
}));
|
|
647
647
|
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
648
648
|
var DropdownMenuShortcut = ({ className, ...props }) => {
|
|
649
|
-
return /* @__PURE__ */
|
|
649
|
+
return /* @__PURE__ */ jsx_runtime7.jsx("span", {
|
|
650
650
|
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
651
651
|
...props
|
|
652
|
-
}
|
|
652
|
+
});
|
|
653
653
|
};
|
|
654
654
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
655
655
|
// src/ui/primitives/hover-card.tsx
|
|
656
656
|
var React7 = __toESM(require("react"));
|
|
657
657
|
var HoverCardPrimitive = __toESM(require("@radix-ui/react-hover-card"));
|
|
658
|
-
var
|
|
658
|
+
var jsx_runtime8 = require("react/jsx-runtime");
|
|
659
659
|
var HoverCard = HoverCardPrimitive.Root;
|
|
660
660
|
var HoverCardTrigger = HoverCardPrimitive.Trigger;
|
|
661
|
-
var HoverCardContent = React7.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */
|
|
661
|
+
var HoverCardContent = React7.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx_runtime8.jsx(HoverCardPrimitive.Content, {
|
|
662
662
|
ref,
|
|
663
663
|
align,
|
|
664
664
|
sideOffset,
|
|
665
665
|
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),
|
|
666
666
|
...props
|
|
667
|
-
}
|
|
667
|
+
}));
|
|
668
668
|
HoverCardContent.displayName = HoverCardPrimitive.Content.displayName;
|
|
669
669
|
// src/ui/primitives/select.tsx
|
|
670
670
|
var React8 = __toESM(require("react"));
|
|
671
671
|
var SelectPrimitive = __toESM(require("@radix-ui/react-select"));
|
|
672
672
|
var import_lucide_react3 = require("lucide-react");
|
|
673
|
-
var
|
|
673
|
+
var jsx_runtime9 = require("react/jsx-runtime");
|
|
674
674
|
var Select = SelectPrimitive.Root;
|
|
675
675
|
var SelectGroup = SelectPrimitive.Group;
|
|
676
676
|
var SelectValue = SelectPrimitive.Value;
|
|
677
|
-
var SelectTrigger = React8.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
677
|
+
var SelectTrigger = React8.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx_runtime9.jsxs(SelectPrimitive.Trigger, {
|
|
678
678
|
ref,
|
|
679
679
|
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),
|
|
680
680
|
...props,
|
|
681
681
|
children: [
|
|
682
682
|
children,
|
|
683
|
-
/* @__PURE__ */
|
|
683
|
+
/* @__PURE__ */ jsx_runtime9.jsx(SelectPrimitive.Icon, {
|
|
684
684
|
asChild: true,
|
|
685
|
-
children: /* @__PURE__ */
|
|
685
|
+
children: /* @__PURE__ */ jsx_runtime9.jsx(import_lucide_react3.ChevronDown, {
|
|
686
686
|
className: "h-4 w-4 opacity-50"
|
|
687
|
-
}
|
|
688
|
-
}
|
|
687
|
+
})
|
|
688
|
+
})
|
|
689
689
|
]
|
|
690
|
-
}
|
|
690
|
+
}));
|
|
691
691
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
692
|
-
var SelectScrollUpButton = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
692
|
+
var SelectScrollUpButton = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime9.jsx(SelectPrimitive.ScrollUpButton, {
|
|
693
693
|
ref,
|
|
694
694
|
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
695
695
|
...props,
|
|
696
|
-
children: /* @__PURE__ */
|
|
696
|
+
children: /* @__PURE__ */ jsx_runtime9.jsx(import_lucide_react3.ChevronUp, {
|
|
697
697
|
className: "h-4 w-4"
|
|
698
|
-
}
|
|
699
|
-
}
|
|
698
|
+
})
|
|
699
|
+
}));
|
|
700
700
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
701
|
-
var SelectScrollDownButton = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
701
|
+
var SelectScrollDownButton = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime9.jsx(SelectPrimitive.ScrollDownButton, {
|
|
702
702
|
ref,
|
|
703
703
|
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
704
704
|
...props,
|
|
705
|
-
children: /* @__PURE__ */
|
|
705
|
+
children: /* @__PURE__ */ jsx_runtime9.jsx(import_lucide_react3.ChevronDown, {
|
|
706
706
|
className: "h-4 w-4"
|
|
707
|
-
}
|
|
708
|
-
}
|
|
707
|
+
})
|
|
708
|
+
}));
|
|
709
709
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
710
|
-
var SelectContent = React8.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */
|
|
711
|
-
children: /* @__PURE__ */
|
|
710
|
+
var SelectContent = React8.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx_runtime9.jsx(SelectPrimitive.Portal, {
|
|
711
|
+
children: /* @__PURE__ */ jsx_runtime9.jsxs(SelectPrimitive.Content, {
|
|
712
712
|
ref,
|
|
713
713
|
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),
|
|
714
714
|
position,
|
|
715
715
|
...props,
|
|
716
716
|
children: [
|
|
717
|
-
/* @__PURE__ */
|
|
718
|
-
/* @__PURE__ */
|
|
717
|
+
/* @__PURE__ */ jsx_runtime9.jsx(SelectScrollUpButton, {}),
|
|
718
|
+
/* @__PURE__ */ jsx_runtime9.jsx(SelectPrimitive.Viewport, {
|
|
719
719
|
className: cn("p-1", position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),
|
|
720
720
|
children
|
|
721
|
-
}
|
|
722
|
-
/* @__PURE__ */
|
|
721
|
+
}),
|
|
722
|
+
/* @__PURE__ */ jsx_runtime9.jsx(SelectScrollDownButton, {})
|
|
723
723
|
]
|
|
724
|
-
}
|
|
725
|
-
}
|
|
724
|
+
})
|
|
725
|
+
}));
|
|
726
726
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
727
|
-
var SelectLabel = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
727
|
+
var SelectLabel = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime9.jsx(SelectPrimitive.Label, {
|
|
728
728
|
ref,
|
|
729
729
|
className: cn("px-2 py-1.5 text-sm font-semibold", className),
|
|
730
730
|
...props
|
|
731
|
-
}
|
|
731
|
+
}));
|
|
732
732
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
733
|
-
var SelectItem = React8.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
733
|
+
var SelectItem = React8.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx_runtime9.jsxs(SelectPrimitive.Item, {
|
|
734
734
|
ref,
|
|
735
735
|
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),
|
|
736
736
|
...props,
|
|
737
737
|
children: [
|
|
738
|
-
/* @__PURE__ */
|
|
738
|
+
/* @__PURE__ */ jsx_runtime9.jsx("span", {
|
|
739
739
|
className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
740
|
-
children: /* @__PURE__ */
|
|
741
|
-
children: /* @__PURE__ */
|
|
740
|
+
children: /* @__PURE__ */ jsx_runtime9.jsx(SelectPrimitive.ItemIndicator, {
|
|
741
|
+
children: /* @__PURE__ */ jsx_runtime9.jsx(import_lucide_react3.Check, {
|
|
742
742
|
className: "h-4 w-4"
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
/* @__PURE__ */
|
|
743
|
+
})
|
|
744
|
+
})
|
|
745
|
+
}),
|
|
746
|
+
/* @__PURE__ */ jsx_runtime9.jsx(SelectPrimitive.ItemText, {
|
|
747
747
|
children
|
|
748
|
-
}
|
|
748
|
+
})
|
|
749
749
|
]
|
|
750
|
-
}
|
|
750
|
+
}));
|
|
751
751
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
752
|
-
var SelectSeparator = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
752
|
+
var SelectSeparator = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime9.jsx(SelectPrimitive.Separator, {
|
|
753
753
|
ref,
|
|
754
754
|
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
755
755
|
...props
|
|
756
|
-
}
|
|
756
|
+
}));
|
|
757
757
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
758
758
|
// src/ui/primitives/command.tsx
|
|
759
759
|
var React9 = __toESM(require("react"));
|
|
760
760
|
var import_cmdk = require("cmdk");
|
|
761
761
|
var import_lucide_react4 = require("lucide-react");
|
|
762
|
-
var
|
|
763
|
-
var Command = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
762
|
+
var jsx_runtime10 = require("react/jsx-runtime");
|
|
763
|
+
var Command = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime10.jsx(import_cmdk.Command, {
|
|
764
764
|
ref,
|
|
765
765
|
className: cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground", className),
|
|
766
766
|
...props
|
|
767
|
-
}
|
|
767
|
+
}));
|
|
768
768
|
Command.displayName = import_cmdk.Command.displayName;
|
|
769
|
-
var CommandInput = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
769
|
+
var CommandInput = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime10.jsxs("div", {
|
|
770
770
|
className: "flex items-center border-b px-3",
|
|
771
771
|
"cmdk-input-wrapper": "",
|
|
772
772
|
children: [
|
|
773
|
-
/* @__PURE__ */
|
|
773
|
+
/* @__PURE__ */ jsx_runtime10.jsx(import_lucide_react4.Search, {
|
|
774
774
|
className: "mr-2 h-4 w-4 shrink-0 opacity-50"
|
|
775
|
-
}
|
|
776
|
-
/* @__PURE__ */
|
|
775
|
+
}),
|
|
776
|
+
/* @__PURE__ */ jsx_runtime10.jsx(import_cmdk.Command.Input, {
|
|
777
777
|
ref,
|
|
778
778
|
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),
|
|
779
779
|
...props
|
|
780
|
-
}
|
|
780
|
+
})
|
|
781
781
|
]
|
|
782
|
-
}
|
|
782
|
+
}));
|
|
783
783
|
CommandInput.displayName = import_cmdk.Command.Input.displayName;
|
|
784
|
-
var CommandList = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
784
|
+
var CommandList = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime10.jsx(import_cmdk.Command.List, {
|
|
785
785
|
ref,
|
|
786
786
|
className: cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className),
|
|
787
787
|
...props
|
|
788
|
-
}
|
|
788
|
+
}));
|
|
789
789
|
CommandList.displayName = import_cmdk.Command.List.displayName;
|
|
790
|
-
var CommandEmpty = React9.forwardRef((props, ref) => /* @__PURE__ */
|
|
790
|
+
var CommandEmpty = React9.forwardRef((props, ref) => /* @__PURE__ */ jsx_runtime10.jsx(import_cmdk.Command.Empty, {
|
|
791
791
|
ref,
|
|
792
792
|
className: "py-6 text-center text-sm",
|
|
793
793
|
...props
|
|
794
|
-
}
|
|
794
|
+
}));
|
|
795
795
|
CommandEmpty.displayName = import_cmdk.Command.Empty.displayName;
|
|
796
|
-
var CommandGroup = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
796
|
+
var CommandGroup = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime10.jsx(import_cmdk.Command.Group, {
|
|
797
797
|
ref,
|
|
798
798
|
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),
|
|
799
799
|
...props
|
|
800
|
-
}
|
|
800
|
+
}));
|
|
801
801
|
CommandGroup.displayName = import_cmdk.Command.Group.displayName;
|
|
802
|
-
var CommandSeparator = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
802
|
+
var CommandSeparator = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime10.jsx(import_cmdk.Command.Separator, {
|
|
803
803
|
ref,
|
|
804
804
|
className: cn("-mx-1 h-px bg-border", className),
|
|
805
805
|
...props
|
|
806
|
-
}
|
|
806
|
+
}));
|
|
807
807
|
CommandSeparator.displayName = import_cmdk.Command.Separator.displayName;
|
|
808
|
-
var CommandItem = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
808
|
+
var CommandItem = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime10.jsx(import_cmdk.Command.Item, {
|
|
809
809
|
ref,
|
|
810
810
|
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),
|
|
811
811
|
...props
|
|
812
|
-
}
|
|
812
|
+
}));
|
|
813
813
|
CommandItem.displayName = import_cmdk.Command.Item.displayName;
|
|
814
814
|
var CommandShortcut = ({ className, ...props }) => {
|
|
815
|
-
return /* @__PURE__ */
|
|
815
|
+
return /* @__PURE__ */ jsx_runtime10.jsx("span", {
|
|
816
816
|
className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className),
|
|
817
817
|
...props
|
|
818
|
-
}
|
|
818
|
+
});
|
|
819
819
|
};
|
|
820
820
|
CommandShortcut.displayName = "CommandShortcut";
|
|
821
821
|
// src/ui/primitives/dialog.tsx
|
|
@@ -823,16 +823,16 @@ var React10 = __toESM(require("react"));
|
|
|
823
823
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
824
824
|
var import_class_variance_authority4 = require("class-variance-authority");
|
|
825
825
|
var import_lucide_react5 = require("lucide-react");
|
|
826
|
-
var
|
|
826
|
+
var jsx_runtime11 = require("react/jsx-runtime");
|
|
827
827
|
var Dialog = DialogPrimitive.Root;
|
|
828
828
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
829
829
|
var DialogPortal = DialogPrimitive.Portal;
|
|
830
830
|
var DialogClose = DialogPrimitive.Close;
|
|
831
|
-
var DialogOverlay = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
831
|
+
var DialogOverlay = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime11.jsx(DialogPrimitive.Overlay, {
|
|
832
832
|
ref,
|
|
833
833
|
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),
|
|
834
834
|
...props
|
|
835
|
-
}
|
|
835
|
+
}));
|
|
836
836
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
837
837
|
var dialogContentVariants = import_class_variance_authority4.cva("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", {
|
|
838
838
|
variants: {
|
|
@@ -845,61 +845,61 @@ var dialogContentVariants = import_class_variance_authority4.cva("fixed left-[50
|
|
|
845
845
|
variant: "default"
|
|
846
846
|
}
|
|
847
847
|
});
|
|
848
|
-
var DialogContent = React10.forwardRef(({ className, variant, children, ...props }, ref) => /* @__PURE__ */
|
|
848
|
+
var DialogContent = React10.forwardRef(({ className, variant, children, ...props }, ref) => /* @__PURE__ */ jsx_runtime11.jsxs(DialogPortal, {
|
|
849
849
|
children: [
|
|
850
|
-
/* @__PURE__ */
|
|
851
|
-
/* @__PURE__ */
|
|
850
|
+
/* @__PURE__ */ jsx_runtime11.jsx(DialogOverlay, {}),
|
|
851
|
+
/* @__PURE__ */ jsx_runtime11.jsxs(DialogPrimitive.Content, {
|
|
852
852
|
ref,
|
|
853
853
|
className: cn(dialogContentVariants({ variant }), className),
|
|
854
854
|
...props,
|
|
855
855
|
children: [
|
|
856
856
|
children,
|
|
857
|
-
/* @__PURE__ */
|
|
857
|
+
/* @__PURE__ */ jsx_runtime11.jsxs(DialogPrimitive.Close, {
|
|
858
858
|
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",
|
|
859
859
|
children: [
|
|
860
|
-
/* @__PURE__ */
|
|
860
|
+
/* @__PURE__ */ jsx_runtime11.jsx(import_lucide_react5.X, {
|
|
861
861
|
className: "h-4 w-4"
|
|
862
|
-
}
|
|
863
|
-
/* @__PURE__ */
|
|
862
|
+
}),
|
|
863
|
+
/* @__PURE__ */ jsx_runtime11.jsx("span", {
|
|
864
864
|
className: "sr-only",
|
|
865
865
|
children: "Close"
|
|
866
|
-
}
|
|
866
|
+
})
|
|
867
867
|
]
|
|
868
|
-
}
|
|
868
|
+
})
|
|
869
869
|
]
|
|
870
|
-
}
|
|
870
|
+
})
|
|
871
871
|
]
|
|
872
|
-
}
|
|
872
|
+
}));
|
|
873
873
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
874
|
-
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */
|
|
874
|
+
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime11.jsx("div", {
|
|
875
875
|
className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className),
|
|
876
876
|
...props
|
|
877
|
-
}
|
|
877
|
+
});
|
|
878
878
|
DialogHeader.displayName = "DialogHeader";
|
|
879
|
-
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */
|
|
879
|
+
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime11.jsx("div", {
|
|
880
880
|
className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className),
|
|
881
881
|
...props
|
|
882
|
-
}
|
|
882
|
+
});
|
|
883
883
|
DialogFooter.displayName = "DialogFooter";
|
|
884
|
-
var DialogTitle = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
884
|
+
var DialogTitle = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime11.jsx(DialogPrimitive.Title, {
|
|
885
885
|
ref,
|
|
886
886
|
className: cn("text-lg font-semibold leading-none tracking-tight", className),
|
|
887
887
|
...props
|
|
888
|
-
}
|
|
888
|
+
}));
|
|
889
889
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
890
|
-
var DialogDescription = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
890
|
+
var DialogDescription = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx_runtime11.jsx(DialogPrimitive.Description, {
|
|
891
891
|
ref,
|
|
892
892
|
className: cn("text-sm text-muted-foreground", className),
|
|
893
893
|
...props
|
|
894
|
-
}
|
|
894
|
+
}));
|
|
895
895
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
896
896
|
// src/ui/components/message.tsx
|
|
897
897
|
var import_class_variance_authority5 = require("class-variance-authority");
|
|
898
|
-
var
|
|
899
|
-
var Message = ({ className, from, ...props }) => /* @__PURE__ */
|
|
898
|
+
var jsx_runtime12 = require("react/jsx-runtime");
|
|
899
|
+
var Message = ({ className, from, ...props }) => /* @__PURE__ */ jsx_runtime12.jsx("div", {
|
|
900
900
|
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),
|
|
901
901
|
...props
|
|
902
|
-
}
|
|
902
|
+
});
|
|
903
903
|
var messageContentVariants = import_class_variance_authority5.cva("flex flex-col gap-2 overflow-hidden rounded-lg text-sm", {
|
|
904
904
|
variants: {
|
|
905
905
|
variant: {
|
|
@@ -918,41 +918,41 @@ var messageContentVariants = import_class_variance_authority5.cva("flex flex-col
|
|
|
918
918
|
variant: "contained"
|
|
919
919
|
}
|
|
920
920
|
});
|
|
921
|
-
var MessageContent = ({ children, className, variant, ...props }) => /* @__PURE__ */
|
|
921
|
+
var MessageContent = ({ children, className, variant, ...props }) => /* @__PURE__ */ jsx_runtime12.jsx("div", {
|
|
922
922
|
className: cn(messageContentVariants({ variant, className })),
|
|
923
923
|
...props,
|
|
924
924
|
children
|
|
925
|
-
}
|
|
926
|
-
var MessageAvatar = ({ src, name, className, ...props }) => /* @__PURE__ */
|
|
925
|
+
});
|
|
926
|
+
var MessageAvatar = ({ src, name, className, ...props }) => /* @__PURE__ */ jsx_runtime12.jsxs(Avatar, {
|
|
927
927
|
className: cn("size-8 ring-1 ring-border", className),
|
|
928
928
|
...props,
|
|
929
929
|
children: [
|
|
930
|
-
/* @__PURE__ */
|
|
930
|
+
/* @__PURE__ */ jsx_runtime12.jsx(AvatarImage, {
|
|
931
931
|
alt: "",
|
|
932
932
|
className: "mt-0 mb-0",
|
|
933
933
|
src
|
|
934
|
-
}
|
|
935
|
-
/* @__PURE__ */
|
|
934
|
+
}),
|
|
935
|
+
/* @__PURE__ */ jsx_runtime12.jsx(AvatarFallback, {
|
|
936
936
|
children: name?.slice(0, 2) || "ME"
|
|
937
|
-
}
|
|
937
|
+
})
|
|
938
938
|
]
|
|
939
|
-
}
|
|
939
|
+
});
|
|
940
940
|
// src/ui/components/conversation.tsx
|
|
941
941
|
var import_lucide_react6 = require("lucide-react");
|
|
942
942
|
var import_react = require("react");
|
|
943
943
|
var import_use_stick_to_bottom = require("use-stick-to-bottom");
|
|
944
944
|
var import_use_stick_to_bottom2 = require("use-stick-to-bottom");
|
|
945
|
-
var
|
|
946
|
-
var Conversation = ({ className, ...props }) => /* @__PURE__ */
|
|
945
|
+
var jsx_runtime13 = require("react/jsx-runtime");
|
|
946
|
+
var Conversation = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime13.jsx(import_use_stick_to_bottom.StickToBottom, {
|
|
947
947
|
className: cn("relative flex-1 overflow-y-auto", className),
|
|
948
948
|
initial: "smooth",
|
|
949
949
|
role: "log",
|
|
950
950
|
...props
|
|
951
|
-
}
|
|
952
|
-
var ConversationContent = ({ className, ...props }) => /* @__PURE__ */
|
|
951
|
+
});
|
|
952
|
+
var ConversationContent = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime13.jsx(import_use_stick_to_bottom.StickToBottom.Content, {
|
|
953
953
|
className: cn("p-4", className),
|
|
954
954
|
...props
|
|
955
|
-
}
|
|
955
|
+
});
|
|
956
956
|
var ConversationEmptyState = ({
|
|
957
957
|
className,
|
|
958
958
|
title = "No messages yet",
|
|
@@ -960,56 +960,56 @@ var ConversationEmptyState = ({
|
|
|
960
960
|
icon,
|
|
961
961
|
children,
|
|
962
962
|
...props
|
|
963
|
-
}) => /* @__PURE__ */
|
|
963
|
+
}) => /* @__PURE__ */ jsx_runtime13.jsx("div", {
|
|
964
964
|
className: cn("flex size-full flex-col items-center justify-center gap-3 p-8 text-center", className),
|
|
965
965
|
...props,
|
|
966
|
-
children: children ?? /* @__PURE__ */
|
|
966
|
+
children: children ?? /* @__PURE__ */ jsx_runtime13.jsxs(jsx_runtime13.Fragment, {
|
|
967
967
|
children: [
|
|
968
|
-
icon && /* @__PURE__ */
|
|
968
|
+
icon && /* @__PURE__ */ jsx_runtime13.jsx("div", {
|
|
969
969
|
className: "text-muted-foreground",
|
|
970
970
|
children: icon
|
|
971
|
-
}
|
|
972
|
-
/* @__PURE__ */
|
|
971
|
+
}),
|
|
972
|
+
/* @__PURE__ */ jsx_runtime13.jsxs("div", {
|
|
973
973
|
className: "space-y-1",
|
|
974
974
|
children: [
|
|
975
|
-
/* @__PURE__ */
|
|
975
|
+
/* @__PURE__ */ jsx_runtime13.jsx("h3", {
|
|
976
976
|
className: "font-medium text-sm",
|
|
977
977
|
children: title
|
|
978
|
-
}
|
|
979
|
-
description && /* @__PURE__ */
|
|
978
|
+
}),
|
|
979
|
+
description && /* @__PURE__ */ jsx_runtime13.jsx("p", {
|
|
980
980
|
className: "text-muted-foreground text-sm",
|
|
981
981
|
children: description
|
|
982
|
-
}
|
|
982
|
+
})
|
|
983
983
|
]
|
|
984
|
-
}
|
|
984
|
+
})
|
|
985
985
|
]
|
|
986
|
-
}
|
|
987
|
-
}
|
|
986
|
+
})
|
|
987
|
+
});
|
|
988
988
|
var ConversationScrollButton = ({ className, ...props }) => {
|
|
989
989
|
const { isAtBottom, scrollToBottom } = import_use_stick_to_bottom.useStickToBottomContext();
|
|
990
990
|
const handleScrollToBottom = import_react.useCallback(() => {
|
|
991
991
|
scrollToBottom();
|
|
992
992
|
}, [scrollToBottom]);
|
|
993
|
-
return !isAtBottom && /* @__PURE__ */
|
|
993
|
+
return !isAtBottom && /* @__PURE__ */ jsx_runtime13.jsx(Button, {
|
|
994
994
|
className: cn("absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full", className),
|
|
995
995
|
onClick: handleScrollToBottom,
|
|
996
996
|
size: "icon",
|
|
997
997
|
type: "button",
|
|
998
998
|
variant: "outline",
|
|
999
999
|
...props,
|
|
1000
|
-
children: /* @__PURE__ */
|
|
1000
|
+
children: /* @__PURE__ */ jsx_runtime13.jsx(import_lucide_react6.ArrowDownIcon, {
|
|
1001
1001
|
className: "size-4"
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1002
|
+
})
|
|
1003
|
+
});
|
|
1004
1004
|
};
|
|
1005
1005
|
// src/ui/components/response.tsx
|
|
1006
1006
|
var import_react2 = require("react");
|
|
1007
1007
|
var import_streamdown = require("streamdown");
|
|
1008
|
-
var
|
|
1009
|
-
var Response = import_react2.memo(({ className, ...props }) => /* @__PURE__ */
|
|
1008
|
+
var jsx_runtime14 = require("react/jsx-runtime");
|
|
1009
|
+
var Response = import_react2.memo(({ className, ...props }) => /* @__PURE__ */ jsx_runtime14.jsx(import_streamdown.Streamdown, {
|
|
1010
1010
|
className: cn("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", className),
|
|
1011
1011
|
...props
|
|
1012
|
-
}
|
|
1012
|
+
}), (prevProps, nextProps) => prevProps.children === nextProps.children);
|
|
1013
1013
|
Response.displayName = "Response";
|
|
1014
1014
|
// src/ui/components/tool.tsx
|
|
1015
1015
|
var import_lucide_react8 = require("lucide-react");
|
|
@@ -1018,7 +1018,7 @@ var import_react4 = require("react");
|
|
|
1018
1018
|
// src/ui/components/code-block.tsx
|
|
1019
1019
|
var import_lucide_react7 = require("lucide-react");
|
|
1020
1020
|
var import_react3 = require("react");
|
|
1021
|
-
var
|
|
1021
|
+
var jsx_runtime15 = require("react/jsx-runtime");
|
|
1022
1022
|
var CodeBlockContext = import_react3.createContext({
|
|
1023
1023
|
code: ""
|
|
1024
1024
|
});
|
|
@@ -1070,40 +1070,40 @@ var CodeBlock = ({
|
|
|
1070
1070
|
});
|
|
1071
1071
|
}, [code, language, showLineNumbers]);
|
|
1072
1072
|
const useFallback = !html && !darkHtml;
|
|
1073
|
-
return /* @__PURE__ */
|
|
1073
|
+
return /* @__PURE__ */ jsx_runtime15.jsx(CodeBlockContext.Provider, {
|
|
1074
1074
|
value: { code },
|
|
1075
|
-
children: /* @__PURE__ */
|
|
1075
|
+
children: /* @__PURE__ */ jsx_runtime15.jsx("div", {
|
|
1076
1076
|
className: cn("group relative w-full overflow-hidden rounded-md border bg-background text-foreground", className),
|
|
1077
1077
|
...props,
|
|
1078
|
-
children: /* @__PURE__ */
|
|
1078
|
+
children: /* @__PURE__ */ jsx_runtime15.jsxs("div", {
|
|
1079
1079
|
className: "relative",
|
|
1080
1080
|
children: [
|
|
1081
|
-
useFallback ? /* @__PURE__ */
|
|
1081
|
+
useFallback ? /* @__PURE__ */ jsx_runtime15.jsx("pre", {
|
|
1082
1082
|
className: "m-0 overflow-auto bg-background p-4 text-foreground text-sm",
|
|
1083
|
-
children: /* @__PURE__ */
|
|
1083
|
+
children: /* @__PURE__ */ jsx_runtime15.jsx("code", {
|
|
1084
1084
|
className: "font-mono text-sm",
|
|
1085
1085
|
children: code
|
|
1086
|
-
}
|
|
1087
|
-
}
|
|
1086
|
+
})
|
|
1087
|
+
}) : /* @__PURE__ */ jsx_runtime15.jsxs(jsx_runtime15.Fragment, {
|
|
1088
1088
|
children: [
|
|
1089
|
-
/* @__PURE__ */
|
|
1089
|
+
/* @__PURE__ */ jsx_runtime15.jsx("div", {
|
|
1090
1090
|
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",
|
|
1091
1091
|
dangerouslySetInnerHTML: { __html: html }
|
|
1092
|
-
}
|
|
1093
|
-
/* @__PURE__ */
|
|
1092
|
+
}),
|
|
1093
|
+
/* @__PURE__ */ jsx_runtime15.jsx("div", {
|
|
1094
1094
|
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",
|
|
1095
1095
|
dangerouslySetInnerHTML: { __html: darkHtml }
|
|
1096
|
-
}
|
|
1096
|
+
})
|
|
1097
1097
|
]
|
|
1098
|
-
}
|
|
1099
|
-
children && /* @__PURE__ */
|
|
1098
|
+
}),
|
|
1099
|
+
children && /* @__PURE__ */ jsx_runtime15.jsx("div", {
|
|
1100
1100
|
className: "absolute top-2 right-2 flex items-center gap-2",
|
|
1101
1101
|
children
|
|
1102
|
-
}
|
|
1102
|
+
})
|
|
1103
1103
|
]
|
|
1104
|
-
}
|
|
1105
|
-
}
|
|
1106
|
-
}
|
|
1104
|
+
})
|
|
1105
|
+
})
|
|
1106
|
+
});
|
|
1107
1107
|
};
|
|
1108
1108
|
var CodeBlockCopyButton = ({
|
|
1109
1109
|
onCopy,
|
|
@@ -1130,24 +1130,24 @@ var CodeBlockCopyButton = ({
|
|
|
1130
1130
|
}
|
|
1131
1131
|
};
|
|
1132
1132
|
const Icon2 = isCopied ? import_lucide_react7.CheckIcon : import_lucide_react7.CopyIcon;
|
|
1133
|
-
return /* @__PURE__ */
|
|
1133
|
+
return /* @__PURE__ */ jsx_runtime15.jsx(Button, {
|
|
1134
1134
|
className: cn("shrink-0", className),
|
|
1135
1135
|
onClick: copyToClipboard,
|
|
1136
1136
|
size: "icon",
|
|
1137
1137
|
variant: "ghost",
|
|
1138
1138
|
...props,
|
|
1139
|
-
children: children ?? /* @__PURE__ */
|
|
1139
|
+
children: children ?? /* @__PURE__ */ jsx_runtime15.jsx(Icon2, {
|
|
1140
1140
|
size: 14
|
|
1141
|
-
}
|
|
1142
|
-
}
|
|
1141
|
+
})
|
|
1142
|
+
});
|
|
1143
1143
|
};
|
|
1144
1144
|
|
|
1145
1145
|
// src/ui/components/tool.tsx
|
|
1146
|
-
var
|
|
1147
|
-
var Tool = ({ className, ...props }) => /* @__PURE__ */
|
|
1146
|
+
var jsx_runtime16 = require("react/jsx-runtime");
|
|
1147
|
+
var Tool = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime16.jsx(Collapsible, {
|
|
1148
1148
|
className: cn("not-prose mb-4 w-full rounded-md border", className),
|
|
1149
1149
|
...props
|
|
1150
|
-
}
|
|
1150
|
+
});
|
|
1151
1151
|
var getStatusBadge = (status) => {
|
|
1152
1152
|
const labels = {
|
|
1153
1153
|
"input-streaming": "Pending",
|
|
@@ -1159,163 +1159,163 @@ var getStatusBadge = (status) => {
|
|
|
1159
1159
|
"output-denied": "Denied"
|
|
1160
1160
|
};
|
|
1161
1161
|
const icons = {
|
|
1162
|
-
"input-streaming": /* @__PURE__ */
|
|
1162
|
+
"input-streaming": /* @__PURE__ */ jsx_runtime16.jsx(import_lucide_react8.CircleIcon, {
|
|
1163
1163
|
className: "size-4"
|
|
1164
|
-
}
|
|
1165
|
-
"input-available": /* @__PURE__ */
|
|
1164
|
+
}),
|
|
1165
|
+
"input-available": /* @__PURE__ */ jsx_runtime16.jsx(import_lucide_react8.ClockIcon, {
|
|
1166
1166
|
className: "size-4 animate-pulse"
|
|
1167
|
-
}
|
|
1168
|
-
"approval-requested": /* @__PURE__ */
|
|
1167
|
+
}),
|
|
1168
|
+
"approval-requested": /* @__PURE__ */ jsx_runtime16.jsx(import_lucide_react8.ClockIcon, {
|
|
1169
1169
|
className: "size-4 text-yellow-600"
|
|
1170
|
-
}
|
|
1171
|
-
"approval-responded": /* @__PURE__ */
|
|
1170
|
+
}),
|
|
1171
|
+
"approval-responded": /* @__PURE__ */ jsx_runtime16.jsx(import_lucide_react8.CheckCircleIcon, {
|
|
1172
1172
|
className: "size-4 text-blue-600"
|
|
1173
|
-
}
|
|
1174
|
-
"output-available": /* @__PURE__ */
|
|
1173
|
+
}),
|
|
1174
|
+
"output-available": /* @__PURE__ */ jsx_runtime16.jsx(import_lucide_react8.CheckCircleIcon, {
|
|
1175
1175
|
className: "size-4 text-green-600"
|
|
1176
|
-
}
|
|
1177
|
-
"output-error": /* @__PURE__ */
|
|
1176
|
+
}),
|
|
1177
|
+
"output-error": /* @__PURE__ */ jsx_runtime16.jsx(import_lucide_react8.XCircleIcon, {
|
|
1178
1178
|
className: "size-4 text-red-600"
|
|
1179
|
-
}
|
|
1180
|
-
"output-denied": /* @__PURE__ */
|
|
1179
|
+
}),
|
|
1180
|
+
"output-denied": /* @__PURE__ */ jsx_runtime16.jsx(import_lucide_react8.XCircleIcon, {
|
|
1181
1181
|
className: "size-4 text-orange-600"
|
|
1182
|
-
}
|
|
1182
|
+
})
|
|
1183
1183
|
};
|
|
1184
|
-
return /* @__PURE__ */
|
|
1184
|
+
return /* @__PURE__ */ jsx_runtime16.jsxs(Badge, {
|
|
1185
1185
|
className: "gap-1.5 rounded-full text-xs",
|
|
1186
1186
|
variant: "secondary",
|
|
1187
1187
|
children: [
|
|
1188
1188
|
icons[status],
|
|
1189
1189
|
labels[status]
|
|
1190
1190
|
]
|
|
1191
|
-
}
|
|
1191
|
+
});
|
|
1192
1192
|
};
|
|
1193
|
-
var ToolHeader = ({ className, title, type, state, ...props }) => /* @__PURE__ */
|
|
1193
|
+
var ToolHeader = ({ className, title, type, state, ...props }) => /* @__PURE__ */ jsx_runtime16.jsxs(CollapsibleTrigger2, {
|
|
1194
1194
|
className: cn("group flex w-full items-center justify-between gap-4 p-3", className),
|
|
1195
1195
|
...props,
|
|
1196
1196
|
children: [
|
|
1197
|
-
/* @__PURE__ */
|
|
1197
|
+
/* @__PURE__ */ jsx_runtime16.jsxs("div", {
|
|
1198
1198
|
className: "flex items-center gap-2",
|
|
1199
1199
|
children: [
|
|
1200
|
-
/* @__PURE__ */
|
|
1200
|
+
/* @__PURE__ */ jsx_runtime16.jsx(import_lucide_react8.WrenchIcon, {
|
|
1201
1201
|
className: "size-4 text-muted-foreground"
|
|
1202
|
-
}
|
|
1203
|
-
/* @__PURE__ */
|
|
1202
|
+
}),
|
|
1203
|
+
/* @__PURE__ */ jsx_runtime16.jsx("span", {
|
|
1204
1204
|
className: "font-medium text-sm",
|
|
1205
1205
|
children: title ?? type?.split("-").slice(1).join("-") ?? "Tool"
|
|
1206
|
-
}
|
|
1206
|
+
}),
|
|
1207
1207
|
getStatusBadge(state)
|
|
1208
1208
|
]
|
|
1209
|
-
}
|
|
1210
|
-
/* @__PURE__ */
|
|
1209
|
+
}),
|
|
1210
|
+
/* @__PURE__ */ jsx_runtime16.jsx(import_lucide_react8.ChevronDownIcon, {
|
|
1211
1211
|
className: "size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"
|
|
1212
|
-
}
|
|
1212
|
+
})
|
|
1213
1213
|
]
|
|
1214
|
-
}
|
|
1215
|
-
var ToolContent = ({ className, ...props }) => /* @__PURE__ */
|
|
1214
|
+
});
|
|
1215
|
+
var ToolContent = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime16.jsx(CollapsibleContent2, {
|
|
1216
1216
|
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),
|
|
1217
1217
|
...props
|
|
1218
|
-
}
|
|
1219
|
-
var ToolInput = ({ className, input, ...props }) => /* @__PURE__ */
|
|
1218
|
+
});
|
|
1219
|
+
var ToolInput = ({ className, input, ...props }) => /* @__PURE__ */ jsx_runtime16.jsxs("div", {
|
|
1220
1220
|
className: cn("space-y-2 overflow-hidden p-4", className),
|
|
1221
1221
|
...props,
|
|
1222
1222
|
children: [
|
|
1223
|
-
/* @__PURE__ */
|
|
1223
|
+
/* @__PURE__ */ jsx_runtime16.jsx("h4", {
|
|
1224
1224
|
className: "font-medium text-muted-foreground text-xs uppercase tracking-wide",
|
|
1225
1225
|
children: "Parameters"
|
|
1226
|
-
}
|
|
1227
|
-
/* @__PURE__ */
|
|
1226
|
+
}),
|
|
1227
|
+
/* @__PURE__ */ jsx_runtime16.jsx("div", {
|
|
1228
1228
|
className: "rounded-md bg-muted/50",
|
|
1229
|
-
children: /* @__PURE__ */
|
|
1229
|
+
children: /* @__PURE__ */ jsx_runtime16.jsx(CodeBlock, {
|
|
1230
1230
|
code: JSON.stringify(input, null, 2),
|
|
1231
1231
|
language: "json"
|
|
1232
|
-
}
|
|
1233
|
-
}
|
|
1232
|
+
})
|
|
1233
|
+
})
|
|
1234
1234
|
]
|
|
1235
|
-
}
|
|
1235
|
+
});
|
|
1236
1236
|
var ToolOutput = ({ className, output, errorText, ...props }) => {
|
|
1237
1237
|
if (!(output || errorText)) {
|
|
1238
1238
|
return null;
|
|
1239
1239
|
}
|
|
1240
|
-
let Output = /* @__PURE__ */
|
|
1240
|
+
let Output = /* @__PURE__ */ jsx_runtime16.jsx("div", {
|
|
1241
1241
|
children: output
|
|
1242
|
-
}
|
|
1242
|
+
});
|
|
1243
1243
|
if (typeof output === "object" && !import_react4.isValidElement(output)) {
|
|
1244
|
-
Output = /* @__PURE__ */
|
|
1244
|
+
Output = /* @__PURE__ */ jsx_runtime16.jsx(CodeBlock, {
|
|
1245
1245
|
code: JSON.stringify(output, null, 2),
|
|
1246
1246
|
language: "json"
|
|
1247
|
-
}
|
|
1247
|
+
});
|
|
1248
1248
|
} else if (typeof output === "string") {
|
|
1249
|
-
Output = /* @__PURE__ */
|
|
1249
|
+
Output = /* @__PURE__ */ jsx_runtime16.jsx(CodeBlock, {
|
|
1250
1250
|
code: output,
|
|
1251
1251
|
language: "json"
|
|
1252
|
-
}
|
|
1252
|
+
});
|
|
1253
1253
|
}
|
|
1254
|
-
return /* @__PURE__ */
|
|
1254
|
+
return /* @__PURE__ */ jsx_runtime16.jsxs("div", {
|
|
1255
1255
|
className: cn("space-y-2 p-4", className),
|
|
1256
1256
|
...props,
|
|
1257
1257
|
children: [
|
|
1258
|
-
/* @__PURE__ */
|
|
1258
|
+
/* @__PURE__ */ jsx_runtime16.jsx("h4", {
|
|
1259
1259
|
className: "font-medium text-muted-foreground text-xs uppercase tracking-wide",
|
|
1260
1260
|
children: errorText ? "Error" : "Result"
|
|
1261
|
-
}
|
|
1262
|
-
/* @__PURE__ */
|
|
1261
|
+
}),
|
|
1262
|
+
/* @__PURE__ */ jsx_runtime16.jsxs("div", {
|
|
1263
1263
|
className: cn("overflow-x-auto rounded-md text-xs [&_table]:w-full", errorText ? "bg-destructive/10 text-destructive" : "bg-muted/50 text-foreground"),
|
|
1264
1264
|
children: [
|
|
1265
|
-
errorText && /* @__PURE__ */
|
|
1265
|
+
errorText && /* @__PURE__ */ jsx_runtime16.jsx("div", {
|
|
1266
1266
|
children: errorText
|
|
1267
|
-
}
|
|
1267
|
+
}),
|
|
1268
1268
|
Output
|
|
1269
1269
|
]
|
|
1270
|
-
}
|
|
1270
|
+
})
|
|
1271
1271
|
]
|
|
1272
|
-
}
|
|
1272
|
+
});
|
|
1273
1273
|
};
|
|
1274
1274
|
// src/ui/components/artifact.tsx
|
|
1275
1275
|
var import_lucide_react9 = require("lucide-react");
|
|
1276
|
-
var
|
|
1277
|
-
var Artifact = ({ className, ...props }) => /* @__PURE__ */
|
|
1276
|
+
var jsx_runtime17 = require("react/jsx-runtime");
|
|
1277
|
+
var Artifact = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime17.jsx("div", {
|
|
1278
1278
|
className: cn("flex flex-col overflow-hidden rounded-lg border bg-background shadow-sm", className),
|
|
1279
1279
|
...props
|
|
1280
|
-
}
|
|
1281
|
-
var ArtifactHeader = ({ className, ...props }) => /* @__PURE__ */
|
|
1280
|
+
});
|
|
1281
|
+
var ArtifactHeader = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime17.jsx("div", {
|
|
1282
1282
|
className: cn("flex items-center justify-between border-b bg-muted/50 px-4 py-3", className),
|
|
1283
1283
|
...props
|
|
1284
|
-
}
|
|
1284
|
+
});
|
|
1285
1285
|
var ArtifactClose = ({
|
|
1286
1286
|
className,
|
|
1287
1287
|
children,
|
|
1288
1288
|
size = "sm",
|
|
1289
1289
|
variant = "ghost",
|
|
1290
1290
|
...props
|
|
1291
|
-
}) => /* @__PURE__ */
|
|
1291
|
+
}) => /* @__PURE__ */ jsx_runtime17.jsxs(Button, {
|
|
1292
1292
|
className: cn("size-8 p-0 text-muted-foreground hover:text-foreground", className),
|
|
1293
1293
|
size,
|
|
1294
1294
|
type: "button",
|
|
1295
1295
|
variant,
|
|
1296
1296
|
...props,
|
|
1297
1297
|
children: [
|
|
1298
|
-
children ?? /* @__PURE__ */
|
|
1298
|
+
children ?? /* @__PURE__ */ jsx_runtime17.jsx(import_lucide_react9.XIcon, {
|
|
1299
1299
|
className: "size-4"
|
|
1300
|
-
}
|
|
1301
|
-
/* @__PURE__ */
|
|
1300
|
+
}),
|
|
1301
|
+
/* @__PURE__ */ jsx_runtime17.jsx("span", {
|
|
1302
1302
|
className: "sr-only",
|
|
1303
1303
|
children: "Close"
|
|
1304
|
-
}
|
|
1304
|
+
})
|
|
1305
1305
|
]
|
|
1306
|
-
}
|
|
1307
|
-
var ArtifactTitle = ({ className, ...props }) => /* @__PURE__ */
|
|
1306
|
+
});
|
|
1307
|
+
var ArtifactTitle = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime17.jsx("p", {
|
|
1308
1308
|
className: cn("font-medium text-foreground text-sm", className),
|
|
1309
1309
|
...props
|
|
1310
|
-
}
|
|
1311
|
-
var ArtifactDescription = ({ className, ...props }) => /* @__PURE__ */
|
|
1310
|
+
});
|
|
1311
|
+
var ArtifactDescription = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime17.jsx("p", {
|
|
1312
1312
|
className: cn("text-muted-foreground text-sm", className),
|
|
1313
1313
|
...props
|
|
1314
|
-
}
|
|
1315
|
-
var ArtifactActions = ({ className, ...props }) => /* @__PURE__ */
|
|
1314
|
+
});
|
|
1315
|
+
var ArtifactActions = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime17.jsx("div", {
|
|
1316
1316
|
className: cn("flex items-center gap-1", className),
|
|
1317
1317
|
...props
|
|
1318
|
-
}
|
|
1318
|
+
});
|
|
1319
1319
|
var ArtifactAction = ({
|
|
1320
1320
|
tooltip,
|
|
1321
1321
|
label,
|
|
@@ -1326,80 +1326,80 @@ var ArtifactAction = ({
|
|
|
1326
1326
|
variant = "ghost",
|
|
1327
1327
|
...props
|
|
1328
1328
|
}) => {
|
|
1329
|
-
const button = /* @__PURE__ */
|
|
1329
|
+
const button = /* @__PURE__ */ jsx_runtime17.jsxs(Button, {
|
|
1330
1330
|
className: cn("size-8 p-0 text-muted-foreground hover:text-foreground", className),
|
|
1331
1331
|
size,
|
|
1332
1332
|
type: "button",
|
|
1333
1333
|
variant,
|
|
1334
1334
|
...props,
|
|
1335
1335
|
children: [
|
|
1336
|
-
Icon2 ? /* @__PURE__ */
|
|
1336
|
+
Icon2 ? /* @__PURE__ */ jsx_runtime17.jsx(Icon2, {
|
|
1337
1337
|
className: "size-4"
|
|
1338
|
-
}
|
|
1339
|
-
/* @__PURE__ */
|
|
1338
|
+
}) : children,
|
|
1339
|
+
/* @__PURE__ */ jsx_runtime17.jsx("span", {
|
|
1340
1340
|
className: "sr-only",
|
|
1341
1341
|
children: label || tooltip
|
|
1342
|
-
}
|
|
1342
|
+
})
|
|
1343
1343
|
]
|
|
1344
|
-
}
|
|
1344
|
+
});
|
|
1345
1345
|
if (tooltip) {
|
|
1346
|
-
return /* @__PURE__ */
|
|
1347
|
-
children: /* @__PURE__ */
|
|
1346
|
+
return /* @__PURE__ */ jsx_runtime17.jsx(TooltipProvider, {
|
|
1347
|
+
children: /* @__PURE__ */ jsx_runtime17.jsxs(Tooltip, {
|
|
1348
1348
|
children: [
|
|
1349
|
-
/* @__PURE__ */
|
|
1349
|
+
/* @__PURE__ */ jsx_runtime17.jsx(TooltipTrigger, {
|
|
1350
1350
|
asChild: true,
|
|
1351
1351
|
children: button
|
|
1352
|
-
}
|
|
1353
|
-
/* @__PURE__ */
|
|
1354
|
-
children: /* @__PURE__ */
|
|
1352
|
+
}),
|
|
1353
|
+
/* @__PURE__ */ jsx_runtime17.jsx(TooltipContent, {
|
|
1354
|
+
children: /* @__PURE__ */ jsx_runtime17.jsx("p", {
|
|
1355
1355
|
children: tooltip
|
|
1356
|
-
}
|
|
1357
|
-
}
|
|
1356
|
+
})
|
|
1357
|
+
})
|
|
1358
1358
|
]
|
|
1359
|
-
}
|
|
1360
|
-
}
|
|
1359
|
+
})
|
|
1360
|
+
});
|
|
1361
1361
|
}
|
|
1362
1362
|
return button;
|
|
1363
1363
|
};
|
|
1364
|
-
var ArtifactContent = ({ className, ...props }) => /* @__PURE__ */
|
|
1364
|
+
var ArtifactContent = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime17.jsx("div", {
|
|
1365
1365
|
className: cn("flex-1 overflow-auto p-4", className),
|
|
1366
1366
|
...props
|
|
1367
|
-
}
|
|
1367
|
+
});
|
|
1368
1368
|
// src/ui/components/streaming-indicator.tsx
|
|
1369
1369
|
var import_lucide_react10 = require("lucide-react");
|
|
1370
|
-
var
|
|
1370
|
+
var jsx_runtime18 = require("react/jsx-runtime");
|
|
1371
1371
|
function StreamingIndicator({ className, icon, avatar, ...props }) {
|
|
1372
|
-
return /* @__PURE__ */
|
|
1372
|
+
return /* @__PURE__ */ jsx_runtime18.jsxs("div", {
|
|
1373
1373
|
className: cn("flex items-start gap-3 px-1", className),
|
|
1374
1374
|
...props,
|
|
1375
1375
|
children: [
|
|
1376
|
-
avatar ?? /* @__PURE__ */
|
|
1376
|
+
avatar ?? /* @__PURE__ */ jsx_runtime18.jsx("div", {
|
|
1377
1377
|
className: "h-8 w-8 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0 mt-0.5",
|
|
1378
|
-
children: icon ?? /* @__PURE__ */
|
|
1378
|
+
children: icon ?? /* @__PURE__ */ jsx_runtime18.jsx(import_lucide_react10.Bot, {
|
|
1379
1379
|
className: "h-4 w-4 text-primary"
|
|
1380
|
-
}
|
|
1381
|
-
}
|
|
1382
|
-
/* @__PURE__ */
|
|
1380
|
+
})
|
|
1381
|
+
}),
|
|
1382
|
+
/* @__PURE__ */ jsx_runtime18.jsxs("div", {
|
|
1383
1383
|
className: "flex items-center gap-1.5 pt-2.5",
|
|
1384
1384
|
children: [
|
|
1385
|
-
/* @__PURE__ */
|
|
1385
|
+
/* @__PURE__ */ jsx_runtime18.jsx("span", {
|
|
1386
1386
|
className: "h-2 w-2 rounded-full bg-primary/60 animate-pulse"
|
|
1387
|
-
}
|
|
1388
|
-
/* @__PURE__ */
|
|
1387
|
+
}),
|
|
1388
|
+
/* @__PURE__ */ jsx_runtime18.jsx("span", {
|
|
1389
1389
|
className: "h-2 w-2 rounded-full bg-primary/60 animate-pulse [animation-delay:150ms]"
|
|
1390
|
-
}
|
|
1391
|
-
/* @__PURE__ */
|
|
1390
|
+
}),
|
|
1391
|
+
/* @__PURE__ */ jsx_runtime18.jsx("span", {
|
|
1392
1392
|
className: "h-2 w-2 rounded-full bg-primary/60 animate-pulse [animation-delay:300ms]"
|
|
1393
|
-
}
|
|
1393
|
+
})
|
|
1394
1394
|
]
|
|
1395
|
-
}
|
|
1395
|
+
})
|
|
1396
1396
|
]
|
|
1397
|
-
}
|
|
1397
|
+
});
|
|
1398
1398
|
}
|
|
1399
1399
|
// src/ui/components/audio-recorder.tsx
|
|
1400
1400
|
var import_react5 = require("react");
|
|
1401
1401
|
var import_lucide_react11 = require("lucide-react");
|
|
1402
|
-
var
|
|
1402
|
+
var jsx_runtime19 = require("react/jsx-runtime");
|
|
1403
1403
|
function encodeWav(samples, sampleRate) {
|
|
1404
1404
|
const numChannels = 1;
|
|
1405
1405
|
const bitsPerSample = 16;
|
|
@@ -1614,22 +1614,22 @@ function AudioRecorder({
|
|
|
1614
1614
|
};
|
|
1615
1615
|
if (!isSupported)
|
|
1616
1616
|
return null;
|
|
1617
|
-
return /* @__PURE__ */
|
|
1617
|
+
return /* @__PURE__ */ jsx_runtime19.jsxs("div", {
|
|
1618
1618
|
className: cn("flex items-center gap-1", className),
|
|
1619
1619
|
children: [
|
|
1620
|
-
isRecording && /* @__PURE__ */
|
|
1620
|
+
isRecording && /* @__PURE__ */ jsx_runtime19.jsx("span", {
|
|
1621
1621
|
className: "text-xs text-destructive font-mono animate-pulse",
|
|
1622
1622
|
children: formatDuration(duration)
|
|
1623
|
-
}
|
|
1624
|
-
isTranscribing ? /* @__PURE__ */
|
|
1623
|
+
}),
|
|
1624
|
+
isTranscribing ? /* @__PURE__ */ jsx_runtime19.jsxs("span", {
|
|
1625
1625
|
className: "flex items-center gap-1.5 text-xs text-muted-foreground",
|
|
1626
1626
|
children: [
|
|
1627
|
-
/* @__PURE__ */
|
|
1627
|
+
/* @__PURE__ */ jsx_runtime19.jsx(import_lucide_react11.Loader2, {
|
|
1628
1628
|
className: "size-3.5 animate-spin"
|
|
1629
|
-
}
|
|
1629
|
+
}),
|
|
1630
1630
|
resolvedLabels.transcribing
|
|
1631
1631
|
]
|
|
1632
|
-
}
|
|
1632
|
+
}) : /* @__PURE__ */ jsx_runtime19.jsx(Button, {
|
|
1633
1633
|
type: "button",
|
|
1634
1634
|
variant: "ghost",
|
|
1635
1635
|
size: "icon",
|
|
@@ -1637,49 +1637,49 @@ function AudioRecorder({
|
|
|
1637
1637
|
disabled,
|
|
1638
1638
|
onClick: isRecording ? stopRecording : startRecording,
|
|
1639
1639
|
title: isRecording ? resolvedLabels.stopRecording : resolvedLabels.recordAudio,
|
|
1640
|
-
children: isRecording ? /* @__PURE__ */
|
|
1640
|
+
children: isRecording ? /* @__PURE__ */ jsx_runtime19.jsx(import_lucide_react11.Square, {
|
|
1641
1641
|
className: "size-4 fill-current"
|
|
1642
|
-
}
|
|
1642
|
+
}) : /* @__PURE__ */ jsx_runtime19.jsx(import_lucide_react11.Mic, {
|
|
1643
1643
|
className: "size-4"
|
|
1644
|
-
}
|
|
1645
|
-
}
|
|
1644
|
+
})
|
|
1645
|
+
})
|
|
1646
1646
|
]
|
|
1647
|
-
}
|
|
1647
|
+
});
|
|
1648
1648
|
}
|
|
1649
1649
|
// src/ui/components/smart-timestamp.tsx
|
|
1650
|
-
var
|
|
1650
|
+
var jsx_runtime20 = require("react/jsx-runtime");
|
|
1651
1651
|
function SmartTimestamp({ date, formatShort, className }) {
|
|
1652
1652
|
const shortText = formatShort ? formatShort(date) : formatSmartTimestamp(date);
|
|
1653
1653
|
const fullText = formatFullTimestamp(date);
|
|
1654
|
-
return /* @__PURE__ */
|
|
1655
|
-
children: /* @__PURE__ */
|
|
1654
|
+
return /* @__PURE__ */ jsx_runtime20.jsx(TooltipProvider, {
|
|
1655
|
+
children: /* @__PURE__ */ jsx_runtime20.jsxs(Tooltip, {
|
|
1656
1656
|
children: [
|
|
1657
|
-
/* @__PURE__ */
|
|
1657
|
+
/* @__PURE__ */ jsx_runtime20.jsx(TooltipTrigger, {
|
|
1658
1658
|
asChild: true,
|
|
1659
|
-
children: /* @__PURE__ */
|
|
1659
|
+
children: /* @__PURE__ */ jsx_runtime20.jsx("span", {
|
|
1660
1660
|
className,
|
|
1661
1661
|
children: shortText
|
|
1662
|
-
}
|
|
1663
|
-
}
|
|
1664
|
-
/* @__PURE__ */
|
|
1665
|
-
children: /* @__PURE__ */
|
|
1662
|
+
})
|
|
1663
|
+
}),
|
|
1664
|
+
/* @__PURE__ */ jsx_runtime20.jsx(TooltipContent, {
|
|
1665
|
+
children: /* @__PURE__ */ jsx_runtime20.jsx("p", {
|
|
1666
1666
|
children: fullText
|
|
1667
|
-
}
|
|
1668
|
-
}
|
|
1667
|
+
})
|
|
1668
|
+
})
|
|
1669
1669
|
]
|
|
1670
|
-
}
|
|
1671
|
-
}
|
|
1670
|
+
})
|
|
1671
|
+
});
|
|
1672
1672
|
}
|
|
1673
1673
|
// src/ui/components/file-preview-card.tsx
|
|
1674
1674
|
var import_lucide_react12 = require("lucide-react");
|
|
1675
|
-
var
|
|
1675
|
+
var jsx_runtime21 = require("react/jsx-runtime");
|
|
1676
1676
|
function ExtBadge({ ext }) {
|
|
1677
1677
|
if (!ext)
|
|
1678
1678
|
return null;
|
|
1679
|
-
return /* @__PURE__ */
|
|
1679
|
+
return /* @__PURE__ */ jsx_runtime21.jsx("span", {
|
|
1680
1680
|
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",
|
|
1681
1681
|
children: ext
|
|
1682
|
-
}
|
|
1682
|
+
});
|
|
1683
1683
|
}
|
|
1684
1684
|
function FilePreviewCard({ file, onClick, className }) {
|
|
1685
1685
|
const previewType = getFilePreviewType(file.type);
|
|
@@ -1687,214 +1687,214 @@ function FilePreviewCard({ file, onClick, className }) {
|
|
|
1687
1687
|
const ext = getFileExtension(file.name, file.type);
|
|
1688
1688
|
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);
|
|
1689
1689
|
if (previewType === "image" && file.url) {
|
|
1690
|
-
return /* @__PURE__ */
|
|
1690
|
+
return /* @__PURE__ */ jsx_runtime21.jsxs("button", {
|
|
1691
1691
|
type: "button",
|
|
1692
1692
|
onClick,
|
|
1693
1693
|
disabled: !isClickable,
|
|
1694
1694
|
className: cardBase,
|
|
1695
1695
|
children: [
|
|
1696
|
-
/* @__PURE__ */
|
|
1696
|
+
/* @__PURE__ */ jsx_runtime21.jsx("img", {
|
|
1697
1697
|
src: file.url,
|
|
1698
1698
|
alt: file.name,
|
|
1699
1699
|
className: "w-full h-full object-cover"
|
|
1700
|
-
}
|
|
1701
|
-
/* @__PURE__ */
|
|
1700
|
+
}),
|
|
1701
|
+
/* @__PURE__ */ jsx_runtime21.jsx(ExtBadge, {
|
|
1702
1702
|
ext
|
|
1703
|
-
}
|
|
1704
|
-
isClickable && /* @__PURE__ */
|
|
1703
|
+
}),
|
|
1704
|
+
isClickable && /* @__PURE__ */ jsx_runtime21.jsx("div", {
|
|
1705
1705
|
className: "absolute inset-0 flex items-center justify-center bg-black/0 group-hover:bg-black/30 transition-colors",
|
|
1706
|
-
children: /* @__PURE__ */
|
|
1706
|
+
children: /* @__PURE__ */ jsx_runtime21.jsx(import_lucide_react12.Search, {
|
|
1707
1707
|
className: "h-5 w-5 text-white opacity-0 group-hover:opacity-100 transition-opacity"
|
|
1708
|
-
}
|
|
1709
|
-
}
|
|
1708
|
+
})
|
|
1709
|
+
})
|
|
1710
1710
|
]
|
|
1711
|
-
}
|
|
1711
|
+
});
|
|
1712
1712
|
}
|
|
1713
1713
|
if (previewType === "pdf" && file.url) {
|
|
1714
|
-
return /* @__PURE__ */
|
|
1714
|
+
return /* @__PURE__ */ jsx_runtime21.jsxs("button", {
|
|
1715
1715
|
type: "button",
|
|
1716
1716
|
onClick,
|
|
1717
1717
|
disabled: !isClickable,
|
|
1718
1718
|
className: cardBase,
|
|
1719
1719
|
children: [
|
|
1720
|
-
/* @__PURE__ */
|
|
1720
|
+
/* @__PURE__ */ jsx_runtime21.jsx("div", {
|
|
1721
1721
|
className: "w-full h-full overflow-hidden pointer-events-none",
|
|
1722
|
-
children: /* @__PURE__ */
|
|
1722
|
+
children: /* @__PURE__ */ jsx_runtime21.jsx("object", {
|
|
1723
1723
|
data: `${file.url}#page=1&view=FitH`,
|
|
1724
1724
|
type: "application/pdf",
|
|
1725
1725
|
className: "w-[200%] h-[200%] origin-top-left scale-50",
|
|
1726
1726
|
"aria-label": file.name,
|
|
1727
|
-
children: /* @__PURE__ */
|
|
1727
|
+
children: /* @__PURE__ */ jsx_runtime21.jsx("div", {
|
|
1728
1728
|
className: "flex items-center justify-center w-full h-full",
|
|
1729
|
-
children: /* @__PURE__ */
|
|
1729
|
+
children: /* @__PURE__ */ jsx_runtime21.jsx(import_lucide_react12.FileIcon, {
|
|
1730
1730
|
className: "h-8 w-8 text-muted-foreground/40"
|
|
1731
|
-
}
|
|
1732
|
-
}
|
|
1733
|
-
}
|
|
1734
|
-
}
|
|
1735
|
-
/* @__PURE__ */
|
|
1731
|
+
})
|
|
1732
|
+
})
|
|
1733
|
+
})
|
|
1734
|
+
}),
|
|
1735
|
+
/* @__PURE__ */ jsx_runtime21.jsx(ExtBadge, {
|
|
1736
1736
|
ext
|
|
1737
|
-
}
|
|
1738
|
-
isClickable && /* @__PURE__ */
|
|
1737
|
+
}),
|
|
1738
|
+
isClickable && /* @__PURE__ */ jsx_runtime21.jsx("div", {
|
|
1739
1739
|
className: "absolute inset-0 flex items-center justify-center bg-black/0 group-hover:bg-black/10 transition-colors",
|
|
1740
|
-
children: /* @__PURE__ */
|
|
1740
|
+
children: /* @__PURE__ */ jsx_runtime21.jsx(import_lucide_react12.Search, {
|
|
1741
1741
|
className: "h-5 w-5 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"
|
|
1742
|
-
}
|
|
1743
|
-
}
|
|
1742
|
+
})
|
|
1743
|
+
})
|
|
1744
1744
|
]
|
|
1745
|
-
}
|
|
1745
|
+
});
|
|
1746
1746
|
}
|
|
1747
|
-
return /* @__PURE__ */
|
|
1747
|
+
return /* @__PURE__ */ jsx_runtime21.jsxs("button", {
|
|
1748
1748
|
type: "button",
|
|
1749
1749
|
onClick,
|
|
1750
1750
|
disabled: !isClickable,
|
|
1751
1751
|
className: cardBase,
|
|
1752
1752
|
children: [
|
|
1753
|
-
/* @__PURE__ */
|
|
1753
|
+
/* @__PURE__ */ jsx_runtime21.jsx("div", {
|
|
1754
1754
|
className: "flex-1 flex items-center justify-center",
|
|
1755
|
-
children: /* @__PURE__ */
|
|
1755
|
+
children: /* @__PURE__ */ jsx_runtime21.jsx(import_lucide_react12.FileIcon, {
|
|
1756
1756
|
className: "h-8 w-8 text-muted-foreground/40"
|
|
1757
|
-
}
|
|
1758
|
-
}
|
|
1759
|
-
/* @__PURE__ */
|
|
1757
|
+
})
|
|
1758
|
+
}),
|
|
1759
|
+
/* @__PURE__ */ jsx_runtime21.jsxs("div", {
|
|
1760
1760
|
className: "w-full text-center min-w-0 px-2 pb-2 space-y-0.5",
|
|
1761
1761
|
children: [
|
|
1762
|
-
/* @__PURE__ */
|
|
1762
|
+
/* @__PURE__ */ jsx_runtime21.jsx("p", {
|
|
1763
1763
|
className: "text-[10px] text-foreground truncate leading-tight",
|
|
1764
1764
|
title: file.name,
|
|
1765
1765
|
children: file.name
|
|
1766
|
-
}
|
|
1767
|
-
file.size != null && file.size > 0 && /* @__PURE__ */
|
|
1766
|
+
}),
|
|
1767
|
+
file.size != null && file.size > 0 && /* @__PURE__ */ jsx_runtime21.jsx("p", {
|
|
1768
1768
|
className: "text-[9px] text-muted-foreground leading-tight",
|
|
1769
1769
|
children: formatFileSize(file.size)
|
|
1770
|
-
}
|
|
1770
|
+
})
|
|
1771
1771
|
]
|
|
1772
|
-
}
|
|
1773
|
-
/* @__PURE__ */
|
|
1772
|
+
}),
|
|
1773
|
+
/* @__PURE__ */ jsx_runtime21.jsx(ExtBadge, {
|
|
1774
1774
|
ext
|
|
1775
|
-
}
|
|
1775
|
+
})
|
|
1776
1776
|
]
|
|
1777
|
-
}
|
|
1777
|
+
});
|
|
1778
1778
|
}
|
|
1779
1779
|
// src/ui/components/file-preview-modal.tsx
|
|
1780
1780
|
var import_lucide_react13 = require("lucide-react");
|
|
1781
|
-
var
|
|
1781
|
+
var jsx_runtime22 = require("react/jsx-runtime");
|
|
1782
1782
|
function FilePreviewModal({ open, onOpenChange, file }) {
|
|
1783
1783
|
if (!file)
|
|
1784
1784
|
return null;
|
|
1785
1785
|
const previewType = getFilePreviewType(file.type);
|
|
1786
1786
|
const canPreview = isPreviewable(file.type) && !!file.url;
|
|
1787
|
-
return /* @__PURE__ */
|
|
1787
|
+
return /* @__PURE__ */ jsx_runtime22.jsx(Dialog, {
|
|
1788
1788
|
open,
|
|
1789
1789
|
onOpenChange,
|
|
1790
|
-
children: previewType === "image" && file.url ? /* @__PURE__ */
|
|
1790
|
+
children: previewType === "image" && file.url ? /* @__PURE__ */ jsx_runtime22.jsxs(DialogContent, {
|
|
1791
1791
|
variant: "lightbox",
|
|
1792
1792
|
"aria-describedby": undefined,
|
|
1793
1793
|
children: [
|
|
1794
|
-
/* @__PURE__ */
|
|
1794
|
+
/* @__PURE__ */ jsx_runtime22.jsx(DialogTitle, {
|
|
1795
1795
|
className: "sr-only",
|
|
1796
1796
|
children: file.name
|
|
1797
|
-
}
|
|
1798
|
-
/* @__PURE__ */
|
|
1797
|
+
}),
|
|
1798
|
+
/* @__PURE__ */ jsx_runtime22.jsx("img", {
|
|
1799
1799
|
src: file.url,
|
|
1800
1800
|
alt: file.name,
|
|
1801
1801
|
className: "max-h-[85vh] max-w-full object-contain rounded-md"
|
|
1802
|
-
}
|
|
1802
|
+
})
|
|
1803
1803
|
]
|
|
1804
|
-
}
|
|
1804
|
+
}) : previewType === "pdf" && file.url ? /* @__PURE__ */ jsx_runtime22.jsxs(DialogContent, {
|
|
1805
1805
|
variant: "lightbox",
|
|
1806
1806
|
className: "w-[80vw] h-[85vh]",
|
|
1807
1807
|
"aria-describedby": undefined,
|
|
1808
1808
|
children: [
|
|
1809
|
-
/* @__PURE__ */
|
|
1809
|
+
/* @__PURE__ */ jsx_runtime22.jsx(DialogTitle, {
|
|
1810
1810
|
className: "sr-only",
|
|
1811
1811
|
children: file.name
|
|
1812
|
-
}
|
|
1813
|
-
/* @__PURE__ */
|
|
1812
|
+
}),
|
|
1813
|
+
/* @__PURE__ */ jsx_runtime22.jsx("object", {
|
|
1814
1814
|
data: file.url,
|
|
1815
1815
|
type: "application/pdf",
|
|
1816
1816
|
className: "w-full h-full rounded-md",
|
|
1817
|
-
children: /* @__PURE__ */
|
|
1817
|
+
children: /* @__PURE__ */ jsx_runtime22.jsxs("div", {
|
|
1818
1818
|
className: "flex flex-col items-center justify-center h-full gap-3 text-muted-foreground",
|
|
1819
1819
|
children: [
|
|
1820
|
-
/* @__PURE__ */
|
|
1820
|
+
/* @__PURE__ */ jsx_runtime22.jsx("p", {
|
|
1821
1821
|
className: "text-sm",
|
|
1822
1822
|
children: "Unable to display PDF"
|
|
1823
|
-
}
|
|
1824
|
-
/* @__PURE__ */
|
|
1823
|
+
}),
|
|
1824
|
+
/* @__PURE__ */ jsx_runtime22.jsxs("a", {
|
|
1825
1825
|
href: file.url,
|
|
1826
1826
|
target: "_blank",
|
|
1827
1827
|
rel: "noopener noreferrer",
|
|
1828
1828
|
className: "inline-flex items-center gap-1.5 text-sm text-primary hover:underline",
|
|
1829
1829
|
children: [
|
|
1830
|
-
/* @__PURE__ */
|
|
1830
|
+
/* @__PURE__ */ jsx_runtime22.jsx(import_lucide_react13.Download, {
|
|
1831
1831
|
className: "h-4 w-4"
|
|
1832
|
-
}
|
|
1832
|
+
}),
|
|
1833
1833
|
"Download ",
|
|
1834
1834
|
file.name
|
|
1835
1835
|
]
|
|
1836
|
-
}
|
|
1836
|
+
})
|
|
1837
1837
|
]
|
|
1838
|
-
}
|
|
1839
|
-
}
|
|
1838
|
+
})
|
|
1839
|
+
})
|
|
1840
1840
|
]
|
|
1841
|
-
}
|
|
1841
|
+
}) : /* @__PURE__ */ jsx_runtime22.jsxs(DialogContent, {
|
|
1842
1842
|
children: [
|
|
1843
|
-
/* @__PURE__ */
|
|
1843
|
+
/* @__PURE__ */ jsx_runtime22.jsxs(DialogHeader, {
|
|
1844
1844
|
children: [
|
|
1845
|
-
/* @__PURE__ */
|
|
1845
|
+
/* @__PURE__ */ jsx_runtime22.jsxs(DialogTitle, {
|
|
1846
1846
|
className: "flex items-center gap-2",
|
|
1847
1847
|
children: [
|
|
1848
|
-
/* @__PURE__ */
|
|
1848
|
+
/* @__PURE__ */ jsx_runtime22.jsx(import_lucide_react13.FileIcon, {
|
|
1849
1849
|
className: "h-5 w-5 text-muted-foreground"
|
|
1850
|
-
}
|
|
1850
|
+
}),
|
|
1851
1851
|
file.name
|
|
1852
1852
|
]
|
|
1853
|
-
}
|
|
1854
|
-
/* @__PURE__ */
|
|
1853
|
+
}),
|
|
1854
|
+
/* @__PURE__ */ jsx_runtime22.jsxs(DialogDescription, {
|
|
1855
1855
|
children: [
|
|
1856
|
-
file.size != null && file.size > 0 && /* @__PURE__ */
|
|
1856
|
+
file.size != null && file.size > 0 && /* @__PURE__ */ jsx_runtime22.jsx("span", {
|
|
1857
1857
|
children: formatFileSize(file.size)
|
|
1858
|
-
}
|
|
1859
|
-
!canPreview && /* @__PURE__ */
|
|
1858
|
+
}),
|
|
1859
|
+
!canPreview && /* @__PURE__ */ jsx_runtime22.jsx("span", {
|
|
1860
1860
|
children: " · Preview not available for this file type"
|
|
1861
|
-
}
|
|
1861
|
+
})
|
|
1862
1862
|
]
|
|
1863
|
-
}
|
|
1863
|
+
})
|
|
1864
1864
|
]
|
|
1865
|
-
}
|
|
1866
|
-
/* @__PURE__ */
|
|
1865
|
+
}),
|
|
1866
|
+
/* @__PURE__ */ jsx_runtime22.jsxs("div", {
|
|
1867
1867
|
className: "flex flex-col items-center justify-center py-8 text-muted-foreground gap-3",
|
|
1868
1868
|
children: [
|
|
1869
|
-
/* @__PURE__ */
|
|
1869
|
+
/* @__PURE__ */ jsx_runtime22.jsx(import_lucide_react13.FileIcon, {
|
|
1870
1870
|
className: "h-12 w-12"
|
|
1871
|
-
}
|
|
1872
|
-
/* @__PURE__ */
|
|
1871
|
+
}),
|
|
1872
|
+
/* @__PURE__ */ jsx_runtime22.jsx("p", {
|
|
1873
1873
|
className: "text-sm",
|
|
1874
1874
|
children: "Preview not available"
|
|
1875
|
-
}
|
|
1876
|
-
file.url && /^https?:\/\//i.test(file.url) && /* @__PURE__ */
|
|
1875
|
+
}),
|
|
1876
|
+
file.url && /^https?:\/\//i.test(file.url) && /* @__PURE__ */ jsx_runtime22.jsxs("a", {
|
|
1877
1877
|
href: file.url,
|
|
1878
1878
|
target: "_blank",
|
|
1879
1879
|
rel: "noopener noreferrer",
|
|
1880
1880
|
className: "inline-flex items-center gap-1.5 text-sm text-primary hover:underline",
|
|
1881
1881
|
children: [
|
|
1882
|
-
/* @__PURE__ */
|
|
1882
|
+
/* @__PURE__ */ jsx_runtime22.jsx(import_lucide_react13.Download, {
|
|
1883
1883
|
className: "h-4 w-4"
|
|
1884
|
-
}
|
|
1884
|
+
}),
|
|
1885
1885
|
"Download file"
|
|
1886
1886
|
]
|
|
1887
|
-
}
|
|
1887
|
+
})
|
|
1888
1888
|
]
|
|
1889
|
-
}
|
|
1889
|
+
})
|
|
1890
1890
|
]
|
|
1891
|
-
}
|
|
1892
|
-
}
|
|
1891
|
+
})
|
|
1892
|
+
});
|
|
1893
1893
|
}
|
|
1894
1894
|
// src/ui/components/image-lightbox.tsx
|
|
1895
1895
|
var import_react6 = require("react");
|
|
1896
1896
|
var import_lucide_react14 = require("lucide-react");
|
|
1897
|
-
var
|
|
1897
|
+
var jsx_runtime23 = require("react/jsx-runtime");
|
|
1898
1898
|
function ImageLightbox({ open, onOpenChange, images, initialIndex = 0 }) {
|
|
1899
1899
|
const [currentIndex, setCurrentIndex] = import_react6.useState(initialIndex);
|
|
1900
1900
|
const hasMultiple = images.length > 1;
|
|
@@ -1925,70 +1925,70 @@ function ImageLightbox({ open, onOpenChange, images, initialIndex = 0 }) {
|
|
|
1925
1925
|
const current = images[currentIndex];
|
|
1926
1926
|
if (!current)
|
|
1927
1927
|
return null;
|
|
1928
|
-
return /* @__PURE__ */
|
|
1928
|
+
return /* @__PURE__ */ jsx_runtime23.jsx(Dialog, {
|
|
1929
1929
|
open,
|
|
1930
1930
|
onOpenChange,
|
|
1931
|
-
children: /* @__PURE__ */
|
|
1931
|
+
children: /* @__PURE__ */ jsx_runtime23.jsxs(DialogContent, {
|
|
1932
1932
|
variant: "lightbox",
|
|
1933
1933
|
"aria-describedby": undefined,
|
|
1934
1934
|
children: [
|
|
1935
|
-
/* @__PURE__ */
|
|
1935
|
+
/* @__PURE__ */ jsx_runtime23.jsx(DialogTitle, {
|
|
1936
1936
|
className: "sr-only",
|
|
1937
1937
|
children: current.alt || `Image ${currentIndex + 1} of ${images.length}`
|
|
1938
|
-
}
|
|
1939
|
-
/* @__PURE__ */
|
|
1938
|
+
}),
|
|
1939
|
+
/* @__PURE__ */ jsx_runtime23.jsxs("div", {
|
|
1940
1940
|
className: "relative flex items-center justify-center",
|
|
1941
1941
|
children: [
|
|
1942
|
-
/* @__PURE__ */
|
|
1942
|
+
/* @__PURE__ */ jsx_runtime23.jsx("img", {
|
|
1943
1943
|
src: current.url,
|
|
1944
1944
|
alt: current.alt || "Image preview",
|
|
1945
1945
|
className: "max-h-[85vh] max-w-full object-contain rounded-md"
|
|
1946
|
-
}
|
|
1947
|
-
hasMultiple && /* @__PURE__ */
|
|
1946
|
+
}),
|
|
1947
|
+
hasMultiple && /* @__PURE__ */ jsx_runtime23.jsxs(jsx_runtime23.Fragment, {
|
|
1948
1948
|
children: [
|
|
1949
|
-
/* @__PURE__ */
|
|
1949
|
+
/* @__PURE__ */ jsx_runtime23.jsxs("button", {
|
|
1950
1950
|
type: "button",
|
|
1951
1951
|
onClick: goPrev,
|
|
1952
1952
|
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"),
|
|
1953
1953
|
children: [
|
|
1954
|
-
/* @__PURE__ */
|
|
1954
|
+
/* @__PURE__ */ jsx_runtime23.jsx(import_lucide_react14.ChevronLeft, {
|
|
1955
1955
|
className: "h-5 w-5"
|
|
1956
|
-
}
|
|
1957
|
-
/* @__PURE__ */
|
|
1956
|
+
}),
|
|
1957
|
+
/* @__PURE__ */ jsx_runtime23.jsx("span", {
|
|
1958
1958
|
className: "sr-only",
|
|
1959
1959
|
children: "Previous image"
|
|
1960
|
-
}
|
|
1960
|
+
})
|
|
1961
1961
|
]
|
|
1962
|
-
}
|
|
1963
|
-
/* @__PURE__ */
|
|
1962
|
+
}),
|
|
1963
|
+
/* @__PURE__ */ jsx_runtime23.jsxs("button", {
|
|
1964
1964
|
type: "button",
|
|
1965
1965
|
onClick: goNext,
|
|
1966
1966
|
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"),
|
|
1967
1967
|
children: [
|
|
1968
|
-
/* @__PURE__ */
|
|
1968
|
+
/* @__PURE__ */ jsx_runtime23.jsx(import_lucide_react14.ChevronRight, {
|
|
1969
1969
|
className: "h-5 w-5"
|
|
1970
|
-
}
|
|
1971
|
-
/* @__PURE__ */
|
|
1970
|
+
}),
|
|
1971
|
+
/* @__PURE__ */ jsx_runtime23.jsx("span", {
|
|
1972
1972
|
className: "sr-only",
|
|
1973
1973
|
children: "Next image"
|
|
1974
|
-
}
|
|
1974
|
+
})
|
|
1975
1975
|
]
|
|
1976
|
-
}
|
|
1977
|
-
/* @__PURE__ */
|
|
1976
|
+
}),
|
|
1977
|
+
/* @__PURE__ */ jsx_runtime23.jsxs("div", {
|
|
1978
1978
|
className: "absolute bottom-2 left-1/2 -translate-x-1/2 rounded-full bg-black/50 px-3 py-1 text-xs text-white",
|
|
1979
1979
|
children: [
|
|
1980
1980
|
currentIndex + 1,
|
|
1981
1981
|
" / ",
|
|
1982
1982
|
images.length
|
|
1983
1983
|
]
|
|
1984
|
-
}
|
|
1984
|
+
})
|
|
1985
1985
|
]
|
|
1986
|
-
}
|
|
1986
|
+
})
|
|
1987
1987
|
]
|
|
1988
|
-
}
|
|
1988
|
+
})
|
|
1989
1989
|
]
|
|
1990
|
-
}
|
|
1991
|
-
}
|
|
1990
|
+
})
|
|
1991
|
+
});
|
|
1992
1992
|
}
|
|
1993
1993
|
// src/ui/components/prompt-input/context.ts
|
|
1994
1994
|
var import_react7 = require("react");
|
|
@@ -2024,7 +2024,7 @@ var DropZoneContext = import_react7.createContext({ isDraggingOver: false });
|
|
|
2024
2024
|
var usePromptInputDropZone = () => import_react7.useContext(DropZoneContext);
|
|
2025
2025
|
// src/ui/components/prompt-input/provider.tsx
|
|
2026
2026
|
var import_react8 = require("react");
|
|
2027
|
-
var
|
|
2027
|
+
var jsx_runtime24 = require("react/jsx-runtime");
|
|
2028
2028
|
function generateId() {
|
|
2029
2029
|
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
|
|
2030
2030
|
return crypto.randomUUID();
|
|
@@ -2085,17 +2085,17 @@ function PromptInputProvider({ initialInput: initialTextInput = "", children })
|
|
|
2085
2085
|
attachments,
|
|
2086
2086
|
__registerFileInput
|
|
2087
2087
|
}), [textInput, clearInput, attachments, __registerFileInput]);
|
|
2088
|
-
return /* @__PURE__ */
|
|
2088
|
+
return /* @__PURE__ */ jsx_runtime24.jsx(PromptInputController.Provider, {
|
|
2089
2089
|
value: controller,
|
|
2090
|
-
children: /* @__PURE__ */
|
|
2090
|
+
children: /* @__PURE__ */ jsx_runtime24.jsx(ProviderAttachmentsContext.Provider, {
|
|
2091
2091
|
value: attachments,
|
|
2092
2092
|
children
|
|
2093
|
-
}
|
|
2094
|
-
}
|
|
2093
|
+
})
|
|
2094
|
+
});
|
|
2095
2095
|
}
|
|
2096
2096
|
// src/ui/components/prompt-input/prompt-input.tsx
|
|
2097
2097
|
var import_react9 = require("react");
|
|
2098
|
-
var
|
|
2098
|
+
var jsx_runtime25 = require("react/jsx-runtime");
|
|
2099
2099
|
function generateId2() {
|
|
2100
2100
|
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
|
|
2101
2101
|
return crypto.randomUUID();
|
|
@@ -2347,15 +2347,15 @@ var PromptInput = ({
|
|
|
2347
2347
|
});
|
|
2348
2348
|
};
|
|
2349
2349
|
const dropZoneValue = import_react9.useMemo(() => ({ isDraggingOver }), [isDraggingOver]);
|
|
2350
|
-
const inner = /* @__PURE__ */
|
|
2350
|
+
const inner = /* @__PURE__ */ jsx_runtime25.jsx(DropZoneContext.Provider, {
|
|
2351
2351
|
value: dropZoneValue,
|
|
2352
|
-
children: /* @__PURE__ */
|
|
2352
|
+
children: /* @__PURE__ */ jsx_runtime25.jsxs("form", {
|
|
2353
2353
|
className: cn("relative w-full", className),
|
|
2354
2354
|
onSubmit: handleSubmit,
|
|
2355
2355
|
ref: formRef,
|
|
2356
2356
|
...props,
|
|
2357
2357
|
children: [
|
|
2358
|
-
/* @__PURE__ */
|
|
2358
|
+
/* @__PURE__ */ jsx_runtime25.jsx("input", {
|
|
2359
2359
|
accept,
|
|
2360
2360
|
"aria-label": "Upload files",
|
|
2361
2361
|
className: "hidden",
|
|
@@ -2364,21 +2364,21 @@ var PromptInput = ({
|
|
|
2364
2364
|
ref: inputRef,
|
|
2365
2365
|
title: "Upload files",
|
|
2366
2366
|
type: "file"
|
|
2367
|
-
}
|
|
2368
|
-
/* @__PURE__ */
|
|
2367
|
+
}),
|
|
2368
|
+
/* @__PURE__ */ jsx_runtime25.jsx(InputGroup, {
|
|
2369
2369
|
children
|
|
2370
|
-
}
|
|
2370
|
+
})
|
|
2371
2371
|
]
|
|
2372
|
-
}
|
|
2373
|
-
}
|
|
2374
|
-
return usingProvider ? inner : /* @__PURE__ */
|
|
2372
|
+
})
|
|
2373
|
+
});
|
|
2374
|
+
return usingProvider ? inner : /* @__PURE__ */ jsx_runtime25.jsx(LocalAttachmentsContext.Provider, {
|
|
2375
2375
|
value: ctx,
|
|
2376
2376
|
children: inner
|
|
2377
|
-
}
|
|
2377
|
+
});
|
|
2378
2378
|
};
|
|
2379
2379
|
// src/ui/components/prompt-input/textarea.tsx
|
|
2380
2380
|
var import_react10 = require("react");
|
|
2381
|
-
var
|
|
2381
|
+
var jsx_runtime26 = require("react/jsx-runtime");
|
|
2382
2382
|
var PromptInputTextarea = ({
|
|
2383
2383
|
onChange,
|
|
2384
2384
|
className,
|
|
@@ -2428,7 +2428,7 @@ var PromptInputTextarea = ({
|
|
|
2428
2428
|
onChange?.(e);
|
|
2429
2429
|
}
|
|
2430
2430
|
} : { onChange };
|
|
2431
|
-
return /* @__PURE__ */
|
|
2431
|
+
return /* @__PURE__ */ jsx_runtime26.jsx(InputGroupTextarea, {
|
|
2432
2432
|
className: cn("[field-sizing:content] max-h-48 text-base", className),
|
|
2433
2433
|
rows: 1,
|
|
2434
2434
|
name: "message",
|
|
@@ -2439,52 +2439,52 @@ var PromptInputTextarea = ({
|
|
|
2439
2439
|
placeholder,
|
|
2440
2440
|
...props,
|
|
2441
2441
|
...controlledProps
|
|
2442
|
-
}
|
|
2442
|
+
});
|
|
2443
2443
|
};
|
|
2444
2444
|
// src/ui/components/prompt-input/attachments.tsx
|
|
2445
2445
|
var import_lucide_react15 = require("lucide-react");
|
|
2446
2446
|
var import_react11 = require("react");
|
|
2447
|
-
var
|
|
2447
|
+
var jsx_runtime27 = require("react/jsx-runtime");
|
|
2448
2448
|
function PromptInputAttachment({ data, className, ...props }) {
|
|
2449
2449
|
const attachments = usePromptInputAttachments();
|
|
2450
2450
|
const filename = data.filename || "";
|
|
2451
2451
|
const isImage = data.mediaType?.startsWith("image/") && data.url;
|
|
2452
2452
|
const isAudio = data.mediaType?.startsWith("audio/");
|
|
2453
2453
|
const attachmentLabel = filename || (isImage ? "Image" : isAudio ? "Audio" : "Attachment");
|
|
2454
|
-
return /* @__PURE__ */
|
|
2454
|
+
return /* @__PURE__ */ jsx_runtime27.jsxs(HoverCard, {
|
|
2455
2455
|
openDelay: 0,
|
|
2456
2456
|
closeDelay: 0,
|
|
2457
2457
|
children: [
|
|
2458
|
-
/* @__PURE__ */
|
|
2458
|
+
/* @__PURE__ */ jsx_runtime27.jsx(HoverCardTrigger, {
|
|
2459
2459
|
asChild: true,
|
|
2460
|
-
children: /* @__PURE__ */
|
|
2460
|
+
children: /* @__PURE__ */ jsx_runtime27.jsxs("div", {
|
|
2461
2461
|
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),
|
|
2462
2462
|
...props,
|
|
2463
2463
|
children: [
|
|
2464
|
-
/* @__PURE__ */
|
|
2464
|
+
/* @__PURE__ */ jsx_runtime27.jsxs("div", {
|
|
2465
2465
|
className: "relative size-5 shrink-0",
|
|
2466
2466
|
children: [
|
|
2467
|
-
/* @__PURE__ */
|
|
2467
|
+
/* @__PURE__ */ jsx_runtime27.jsx("div", {
|
|
2468
2468
|
className: "absolute inset-0 flex size-5 items-center justify-center overflow-hidden rounded bg-background transition-opacity group-hover:opacity-0",
|
|
2469
|
-
children: isImage ? /* @__PURE__ */
|
|
2469
|
+
children: isImage ? /* @__PURE__ */ jsx_runtime27.jsx("img", {
|
|
2470
2470
|
alt: filename || "attachment",
|
|
2471
2471
|
className: "size-5 object-cover",
|
|
2472
2472
|
height: 20,
|
|
2473
2473
|
src: data.url,
|
|
2474
2474
|
width: 20
|
|
2475
|
-
}
|
|
2475
|
+
}) : isAudio ? /* @__PURE__ */ jsx_runtime27.jsx("div", {
|
|
2476
2476
|
className: "flex size-5 items-center justify-center text-muted-foreground",
|
|
2477
|
-
children: /* @__PURE__ */
|
|
2477
|
+
children: /* @__PURE__ */ jsx_runtime27.jsx(import_lucide_react15.MicIcon, {
|
|
2478
2478
|
className: "size-3"
|
|
2479
|
-
}
|
|
2480
|
-
}
|
|
2479
|
+
})
|
|
2480
|
+
}) : /* @__PURE__ */ jsx_runtime27.jsx("div", {
|
|
2481
2481
|
className: "flex size-5 items-center justify-center text-muted-foreground",
|
|
2482
|
-
children: /* @__PURE__ */
|
|
2482
|
+
children: /* @__PURE__ */ jsx_runtime27.jsx(import_lucide_react15.PaperclipIcon, {
|
|
2483
2483
|
className: "size-3"
|
|
2484
|
-
}
|
|
2485
|
-
}
|
|
2486
|
-
}
|
|
2487
|
-
/* @__PURE__ */
|
|
2484
|
+
})
|
|
2485
|
+
})
|
|
2486
|
+
}),
|
|
2487
|
+
/* @__PURE__ */ jsx_runtime27.jsxs(Button, {
|
|
2488
2488
|
"aria-label": "Remove attachment",
|
|
2489
2489
|
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",
|
|
2490
2490
|
onClick: (e) => {
|
|
@@ -2494,119 +2494,119 @@ function PromptInputAttachment({ data, className, ...props }) {
|
|
|
2494
2494
|
type: "button",
|
|
2495
2495
|
variant: "ghost",
|
|
2496
2496
|
children: [
|
|
2497
|
-
/* @__PURE__ */
|
|
2498
|
-
/* @__PURE__ */
|
|
2497
|
+
/* @__PURE__ */ jsx_runtime27.jsx(import_lucide_react15.XIcon, {}),
|
|
2498
|
+
/* @__PURE__ */ jsx_runtime27.jsx("span", {
|
|
2499
2499
|
className: "sr-only",
|
|
2500
2500
|
children: "Remove"
|
|
2501
|
-
}
|
|
2501
|
+
})
|
|
2502
2502
|
]
|
|
2503
|
-
}
|
|
2503
|
+
})
|
|
2504
2504
|
]
|
|
2505
|
-
}
|
|
2506
|
-
/* @__PURE__ */
|
|
2505
|
+
}),
|
|
2506
|
+
/* @__PURE__ */ jsx_runtime27.jsx("span", {
|
|
2507
2507
|
className: "flex-1 truncate",
|
|
2508
2508
|
children: attachmentLabel
|
|
2509
|
-
}
|
|
2509
|
+
})
|
|
2510
2510
|
]
|
|
2511
|
-
}, data.id
|
|
2512
|
-
}
|
|
2513
|
-
/* @__PURE__ */
|
|
2511
|
+
}, data.id)
|
|
2512
|
+
}),
|
|
2513
|
+
/* @__PURE__ */ jsx_runtime27.jsx(HoverCardContent, {
|
|
2514
2514
|
align: "start",
|
|
2515
2515
|
className: "w-auto p-2",
|
|
2516
|
-
children: /* @__PURE__ */
|
|
2516
|
+
children: /* @__PURE__ */ jsx_runtime27.jsxs("div", {
|
|
2517
2517
|
className: "w-auto space-y-3",
|
|
2518
2518
|
children: [
|
|
2519
|
-
isImage && /* @__PURE__ */
|
|
2519
|
+
isImage && /* @__PURE__ */ jsx_runtime27.jsx("div", {
|
|
2520
2520
|
className: "flex max-h-96 w-96 items-center justify-center overflow-hidden rounded-md border",
|
|
2521
|
-
children: /* @__PURE__ */
|
|
2521
|
+
children: /* @__PURE__ */ jsx_runtime27.jsx("img", {
|
|
2522
2522
|
alt: filename || "attachment preview",
|
|
2523
2523
|
className: "max-h-full max-w-full object-contain",
|
|
2524
2524
|
height: 384,
|
|
2525
2525
|
src: data.url,
|
|
2526
2526
|
width: 448
|
|
2527
|
-
}
|
|
2528
|
-
}
|
|
2529
|
-
isAudio && data.url && /* @__PURE__ */
|
|
2527
|
+
})
|
|
2528
|
+
}),
|
|
2529
|
+
isAudio && data.url && /* @__PURE__ */ jsx_runtime27.jsx("div", {
|
|
2530
2530
|
className: "w-64",
|
|
2531
|
-
children: /* @__PURE__ */
|
|
2531
|
+
children: /* @__PURE__ */ jsx_runtime27.jsx("audio", {
|
|
2532
2532
|
src: data.url,
|
|
2533
2533
|
controls: true,
|
|
2534
2534
|
className: "w-full"
|
|
2535
|
-
}
|
|
2536
|
-
}
|
|
2537
|
-
/* @__PURE__ */
|
|
2535
|
+
})
|
|
2536
|
+
}),
|
|
2537
|
+
/* @__PURE__ */ jsx_runtime27.jsx("div", {
|
|
2538
2538
|
className: "flex items-center gap-2.5",
|
|
2539
|
-
children: /* @__PURE__ */
|
|
2539
|
+
children: /* @__PURE__ */ jsx_runtime27.jsxs("div", {
|
|
2540
2540
|
className: "min-w-0 flex-1 space-y-1 px-0.5",
|
|
2541
2541
|
children: [
|
|
2542
|
-
/* @__PURE__ */
|
|
2542
|
+
/* @__PURE__ */ jsx_runtime27.jsx("h4", {
|
|
2543
2543
|
className: "truncate font-semibold text-sm leading-none",
|
|
2544
2544
|
children: filename || (isImage ? "Image" : "Attachment")
|
|
2545
|
-
}
|
|
2546
|
-
data.mediaType && /* @__PURE__ */
|
|
2545
|
+
}),
|
|
2546
|
+
data.mediaType && /* @__PURE__ */ jsx_runtime27.jsx("p", {
|
|
2547
2547
|
className: "truncate font-mono text-muted-foreground text-xs",
|
|
2548
2548
|
children: data.mediaType
|
|
2549
|
-
}
|
|
2549
|
+
})
|
|
2550
2550
|
]
|
|
2551
|
-
}
|
|
2552
|
-
}
|
|
2551
|
+
})
|
|
2552
|
+
})
|
|
2553
2553
|
]
|
|
2554
|
-
}
|
|
2555
|
-
}
|
|
2554
|
+
})
|
|
2555
|
+
})
|
|
2556
2556
|
]
|
|
2557
|
-
}
|
|
2557
|
+
});
|
|
2558
2558
|
}
|
|
2559
2559
|
function PromptInputAttachments({ children }) {
|
|
2560
2560
|
const attachments = usePromptInputAttachments();
|
|
2561
2561
|
if (!attachments.files.length)
|
|
2562
2562
|
return null;
|
|
2563
|
-
return attachments.files.map((file) => /* @__PURE__ */
|
|
2563
|
+
return attachments.files.map((file) => /* @__PURE__ */ jsx_runtime27.jsx(import_react11.Fragment, {
|
|
2564
2564
|
children: children(file)
|
|
2565
|
-
}, file.id
|
|
2565
|
+
}, file.id));
|
|
2566
2566
|
}
|
|
2567
2567
|
var PromptInputActionAddAttachments = ({
|
|
2568
2568
|
label = "Add photos or files",
|
|
2569
2569
|
...props
|
|
2570
2570
|
}) => {
|
|
2571
2571
|
const attachments = usePromptInputAttachments();
|
|
2572
|
-
return /* @__PURE__ */
|
|
2572
|
+
return /* @__PURE__ */ jsx_runtime27.jsxs(DropdownMenuItem, {
|
|
2573
2573
|
...props,
|
|
2574
2574
|
onSelect: () => {
|
|
2575
2575
|
attachments.openFileDialog();
|
|
2576
2576
|
},
|
|
2577
2577
|
children: [
|
|
2578
|
-
/* @__PURE__ */
|
|
2578
|
+
/* @__PURE__ */ jsx_runtime27.jsx(import_lucide_react15.ImageIcon, {
|
|
2579
2579
|
className: "mr-2 size-4"
|
|
2580
|
-
}
|
|
2580
|
+
}),
|
|
2581
2581
|
" ",
|
|
2582
2582
|
label
|
|
2583
2583
|
]
|
|
2584
|
-
}
|
|
2584
|
+
});
|
|
2585
2585
|
};
|
|
2586
2586
|
// src/ui/components/prompt-input/footer.tsx
|
|
2587
|
-
var
|
|
2588
|
-
var PromptInputBody = ({ className, ...props }) => /* @__PURE__ */
|
|
2587
|
+
var jsx_runtime28 = require("react/jsx-runtime");
|
|
2588
|
+
var PromptInputBody = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime28.jsx("div", {
|
|
2589
2589
|
className: cn("contents", className),
|
|
2590
2590
|
...props
|
|
2591
|
-
}
|
|
2592
|
-
var PromptInputHeader = ({ className, ...props }) => /* @__PURE__ */
|
|
2591
|
+
});
|
|
2592
|
+
var PromptInputHeader = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime28.jsx(InputGroupAddon, {
|
|
2593
2593
|
align: "block-start",
|
|
2594
2594
|
className: cn("flex-wrap gap-1 empty:hidden empty:p-0", className),
|
|
2595
2595
|
...props
|
|
2596
|
-
}
|
|
2597
|
-
var PromptInputFooter = ({ className, ...props }) => /* @__PURE__ */
|
|
2596
|
+
});
|
|
2597
|
+
var PromptInputFooter = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime28.jsx(InputGroupAddon, {
|
|
2598
2598
|
align: "block-end",
|
|
2599
2599
|
className: cn("justify-between gap-1", className),
|
|
2600
2600
|
...props
|
|
2601
|
-
}
|
|
2602
|
-
var PromptInputTools = ({ className, ...props }) => /* @__PURE__ */
|
|
2601
|
+
});
|
|
2602
|
+
var PromptInputTools = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime28.jsx("div", {
|
|
2603
2603
|
className: cn("flex items-center gap-1", className),
|
|
2604
2604
|
...props
|
|
2605
|
-
}
|
|
2605
|
+
});
|
|
2606
2606
|
// src/ui/components/prompt-input/buttons.tsx
|
|
2607
2607
|
var import_lucide_react16 = require("lucide-react");
|
|
2608
2608
|
var import_react12 = require("react");
|
|
2609
|
-
var
|
|
2609
|
+
var jsx_runtime29 = require("react/jsx-runtime");
|
|
2610
2610
|
var PromptInputButton = ({
|
|
2611
2611
|
variant = "ghost",
|
|
2612
2612
|
className,
|
|
@@ -2614,13 +2614,13 @@ var PromptInputButton = ({
|
|
|
2614
2614
|
...props
|
|
2615
2615
|
}) => {
|
|
2616
2616
|
const newSize = size ?? (import_react12.Children.count(props.children) > 1 ? "sm" : "icon-sm");
|
|
2617
|
-
return /* @__PURE__ */
|
|
2617
|
+
return /* @__PURE__ */ jsx_runtime29.jsx(InputGroupButton, {
|
|
2618
2618
|
className: cn(className),
|
|
2619
2619
|
size: newSize,
|
|
2620
2620
|
type: "button",
|
|
2621
2621
|
variant,
|
|
2622
2622
|
...props
|
|
2623
|
-
}
|
|
2623
|
+
});
|
|
2624
2624
|
};
|
|
2625
2625
|
var PromptInputSubmit = ({
|
|
2626
2626
|
className,
|
|
@@ -2630,23 +2630,23 @@ var PromptInputSubmit = ({
|
|
|
2630
2630
|
children,
|
|
2631
2631
|
...props
|
|
2632
2632
|
}) => {
|
|
2633
|
-
let Icon2 = /* @__PURE__ */
|
|
2633
|
+
let Icon2 = /* @__PURE__ */ jsx_runtime29.jsx(import_lucide_react16.SendIcon, {
|
|
2634
2634
|
className: "size-4"
|
|
2635
|
-
}
|
|
2635
|
+
});
|
|
2636
2636
|
if (status === "submitted") {
|
|
2637
|
-
Icon2 = /* @__PURE__ */
|
|
2637
|
+
Icon2 = /* @__PURE__ */ jsx_runtime29.jsx(import_lucide_react16.Loader2Icon, {
|
|
2638
2638
|
className: "size-4 animate-spin"
|
|
2639
|
-
}
|
|
2639
|
+
});
|
|
2640
2640
|
} else if (status === "streaming") {
|
|
2641
|
-
Icon2 = /* @__PURE__ */
|
|
2641
|
+
Icon2 = /* @__PURE__ */ jsx_runtime29.jsx(import_lucide_react16.SquareIcon, {
|
|
2642
2642
|
className: "size-4"
|
|
2643
|
-
}
|
|
2643
|
+
});
|
|
2644
2644
|
} else if (status === "error") {
|
|
2645
|
-
Icon2 = /* @__PURE__ */
|
|
2645
|
+
Icon2 = /* @__PURE__ */ jsx_runtime29.jsx(import_lucide_react16.XIcon, {
|
|
2646
2646
|
className: "size-4"
|
|
2647
|
-
}
|
|
2647
|
+
});
|
|
2648
2648
|
}
|
|
2649
|
-
return /* @__PURE__ */
|
|
2649
|
+
return /* @__PURE__ */ jsx_runtime29.jsx(InputGroupButton, {
|
|
2650
2650
|
"aria-label": "Submit",
|
|
2651
2651
|
className: cn(className),
|
|
2652
2652
|
size,
|
|
@@ -2654,44 +2654,44 @@ var PromptInputSubmit = ({
|
|
|
2654
2654
|
variant,
|
|
2655
2655
|
...props,
|
|
2656
2656
|
children: children ?? Icon2
|
|
2657
|
-
}
|
|
2657
|
+
});
|
|
2658
2658
|
};
|
|
2659
|
-
var PromptInputActionMenu = (props) => /* @__PURE__ */
|
|
2659
|
+
var PromptInputActionMenu = (props) => /* @__PURE__ */ jsx_runtime29.jsx(DropdownMenu, {
|
|
2660
2660
|
...props
|
|
2661
|
-
}
|
|
2661
|
+
});
|
|
2662
2662
|
var PromptInputActionMenuTrigger = ({
|
|
2663
2663
|
className,
|
|
2664
2664
|
children,
|
|
2665
2665
|
...props
|
|
2666
|
-
}) => /* @__PURE__ */
|
|
2666
|
+
}) => /* @__PURE__ */ jsx_runtime29.jsx(DropdownMenuTrigger, {
|
|
2667
2667
|
asChild: true,
|
|
2668
|
-
children: /* @__PURE__ */
|
|
2668
|
+
children: /* @__PURE__ */ jsx_runtime29.jsx(PromptInputButton, {
|
|
2669
2669
|
className,
|
|
2670
2670
|
...props,
|
|
2671
|
-
children: children ?? /* @__PURE__ */
|
|
2671
|
+
children: children ?? /* @__PURE__ */ jsx_runtime29.jsx(import_lucide_react16.PlusIcon, {
|
|
2672
2672
|
className: "size-4"
|
|
2673
|
-
}
|
|
2674
|
-
}
|
|
2675
|
-
}
|
|
2673
|
+
})
|
|
2674
|
+
})
|
|
2675
|
+
});
|
|
2676
2676
|
var PromptInputActionMenuContent = ({
|
|
2677
2677
|
className,
|
|
2678
2678
|
...props
|
|
2679
|
-
}) => /* @__PURE__ */
|
|
2679
|
+
}) => /* @__PURE__ */ jsx_runtime29.jsx(DropdownMenuContent, {
|
|
2680
2680
|
align: "start",
|
|
2681
2681
|
className: cn(className),
|
|
2682
2682
|
...props
|
|
2683
|
-
}
|
|
2683
|
+
});
|
|
2684
2684
|
var PromptInputActionMenuItem = ({
|
|
2685
2685
|
className,
|
|
2686
2686
|
...props
|
|
2687
|
-
}) => /* @__PURE__ */
|
|
2687
|
+
}) => /* @__PURE__ */ jsx_runtime29.jsx(DropdownMenuItem, {
|
|
2688
2688
|
className: cn(className),
|
|
2689
2689
|
...props
|
|
2690
|
-
}
|
|
2690
|
+
});
|
|
2691
2691
|
// src/ui/components/prompt-input/drop-zone.tsx
|
|
2692
2692
|
var import_lucide_react17 = require("lucide-react");
|
|
2693
2693
|
var import_react_dom = require("react-dom");
|
|
2694
|
-
var
|
|
2694
|
+
var jsx_runtime30 = require("react/jsx-runtime");
|
|
2695
2695
|
var PromptInputDropZone = ({
|
|
2696
2696
|
label = "Drop files here",
|
|
2697
2697
|
className,
|
|
@@ -2699,20 +2699,20 @@ var PromptInputDropZone = ({
|
|
|
2699
2699
|
...props
|
|
2700
2700
|
}) => {
|
|
2701
2701
|
const { isDraggingOver } = usePromptInputDropZone();
|
|
2702
|
-
const overlay = /* @__PURE__ */
|
|
2702
|
+
const overlay = /* @__PURE__ */ jsx_runtime30.jsxs("div", {
|
|
2703
2703
|
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),
|
|
2704
2704
|
"aria-hidden": !isDraggingOver,
|
|
2705
2705
|
...props,
|
|
2706
2706
|
children: [
|
|
2707
|
-
/* @__PURE__ */
|
|
2707
|
+
/* @__PURE__ */ jsx_runtime30.jsx(import_lucide_react17.Upload, {
|
|
2708
2708
|
className: "size-14"
|
|
2709
|
-
}
|
|
2710
|
-
/* @__PURE__ */
|
|
2709
|
+
}),
|
|
2710
|
+
/* @__PURE__ */ jsx_runtime30.jsx("span", {
|
|
2711
2711
|
className: "text-sm font-medium mt-2",
|
|
2712
2712
|
children: label
|
|
2713
|
-
}
|
|
2713
|
+
})
|
|
2714
2714
|
]
|
|
2715
|
-
}
|
|
2715
|
+
});
|
|
2716
2716
|
if (container?.current) {
|
|
2717
2717
|
return import_react_dom.createPortal(overlay, container.current);
|
|
2718
2718
|
}
|
|
@@ -2721,7 +2721,7 @@ var PromptInputDropZone = ({
|
|
|
2721
2721
|
// src/ui/components/prompt-input/speech.tsx
|
|
2722
2722
|
var import_lucide_react18 = require("lucide-react");
|
|
2723
2723
|
var import_react13 = require("react");
|
|
2724
|
-
var
|
|
2724
|
+
var jsx_runtime31 = require("react/jsx-runtime");
|
|
2725
2725
|
var PromptInputSpeechButton = ({
|
|
2726
2726
|
className,
|
|
2727
2727
|
onTranscriptionChange,
|
|
@@ -2779,97 +2779,97 @@ var PromptInputSpeechButton = ({
|
|
|
2779
2779
|
else
|
|
2780
2780
|
recognition.start();
|
|
2781
2781
|
}, [recognition, isListening]);
|
|
2782
|
-
return /* @__PURE__ */
|
|
2782
|
+
return /* @__PURE__ */ jsx_runtime31.jsx(PromptInputButton, {
|
|
2783
2783
|
className: cn("relative transition-all duration-200", isListening && "animate-pulse bg-accent text-accent-foreground", className),
|
|
2784
2784
|
disabled: !recognition,
|
|
2785
2785
|
onClick: toggleListening,
|
|
2786
2786
|
...props,
|
|
2787
|
-
children: /* @__PURE__ */
|
|
2787
|
+
children: /* @__PURE__ */ jsx_runtime31.jsx(import_lucide_react18.MicIcon, {
|
|
2788
2788
|
className: "size-4"
|
|
2789
|
-
}
|
|
2790
|
-
}
|
|
2789
|
+
})
|
|
2790
|
+
});
|
|
2791
2791
|
};
|
|
2792
2792
|
// src/ui/components/prompt-input/model-select.tsx
|
|
2793
|
-
var
|
|
2794
|
-
var PromptInputModelSelect = (props) => /* @__PURE__ */
|
|
2793
|
+
var jsx_runtime32 = require("react/jsx-runtime");
|
|
2794
|
+
var PromptInputModelSelect = (props) => /* @__PURE__ */ jsx_runtime32.jsx(Select, {
|
|
2795
2795
|
...props
|
|
2796
|
-
}
|
|
2796
|
+
});
|
|
2797
2797
|
var PromptInputModelSelectTrigger = ({
|
|
2798
2798
|
className,
|
|
2799
2799
|
...props
|
|
2800
|
-
}) => /* @__PURE__ */
|
|
2800
|
+
}) => /* @__PURE__ */ jsx_runtime32.jsx(SelectTrigger, {
|
|
2801
2801
|
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),
|
|
2802
2802
|
...props
|
|
2803
|
-
}
|
|
2804
|
-
var PromptInputModelSelectContent = ({ className, ...props }) => /* @__PURE__ */
|
|
2803
|
+
});
|
|
2804
|
+
var PromptInputModelSelectContent = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime32.jsx(SelectContent, {
|
|
2805
2805
|
className: cn(className),
|
|
2806
2806
|
...props
|
|
2807
|
-
}
|
|
2808
|
-
var PromptInputModelSelectItem = ({ className, ...props }) => /* @__PURE__ */
|
|
2807
|
+
});
|
|
2808
|
+
var PromptInputModelSelectItem = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime32.jsx(SelectItem, {
|
|
2809
2809
|
className: cn(className),
|
|
2810
2810
|
...props
|
|
2811
|
-
}
|
|
2812
|
-
var PromptInputModelSelectValue = ({ className, ...props }) => /* @__PURE__ */
|
|
2811
|
+
});
|
|
2812
|
+
var PromptInputModelSelectValue = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime32.jsx(SelectValue, {
|
|
2813
2813
|
className: cn(className),
|
|
2814
2814
|
...props
|
|
2815
|
-
}
|
|
2815
|
+
});
|
|
2816
2816
|
// src/ui/components/prompt-input/tabs.tsx
|
|
2817
|
-
var
|
|
2818
|
-
var PromptInputTabsList = ({ className, ...props }) => /* @__PURE__ */
|
|
2817
|
+
var jsx_runtime33 = require("react/jsx-runtime");
|
|
2818
|
+
var PromptInputTabsList = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime33.jsx("div", {
|
|
2819
2819
|
className: cn(className),
|
|
2820
2820
|
...props
|
|
2821
|
-
}
|
|
2822
|
-
var PromptInputTab = ({ className, ...props }) => /* @__PURE__ */
|
|
2821
|
+
});
|
|
2822
|
+
var PromptInputTab = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime33.jsx("div", {
|
|
2823
2823
|
className: cn(className),
|
|
2824
2824
|
...props
|
|
2825
|
-
}
|
|
2826
|
-
var PromptInputTabLabel = ({ className, ...props }) => /* @__PURE__ */
|
|
2825
|
+
});
|
|
2826
|
+
var PromptInputTabLabel = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime33.jsx("h3", {
|
|
2827
2827
|
className: cn("mb-2 px-3 font-medium text-muted-foreground text-xs", className),
|
|
2828
2828
|
...props
|
|
2829
|
-
}
|
|
2830
|
-
var PromptInputTabBody = ({ className, ...props }) => /* @__PURE__ */
|
|
2829
|
+
});
|
|
2830
|
+
var PromptInputTabBody = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime33.jsx("div", {
|
|
2831
2831
|
className: cn("space-y-1", className),
|
|
2832
2832
|
...props
|
|
2833
|
-
}
|
|
2834
|
-
var PromptInputTabItem = ({ className, ...props }) => /* @__PURE__ */
|
|
2833
|
+
});
|
|
2834
|
+
var PromptInputTabItem = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime33.jsx("div", {
|
|
2835
2835
|
className: cn("flex items-center gap-2 px-3 py-2 text-xs hover:bg-accent", className),
|
|
2836
2836
|
...props
|
|
2837
|
-
}
|
|
2837
|
+
});
|
|
2838
2838
|
// src/ui/components/prompt-input/command.tsx
|
|
2839
|
-
var
|
|
2840
|
-
var PromptInputCommand = ({ className, ...props }) => /* @__PURE__ */
|
|
2839
|
+
var jsx_runtime34 = require("react/jsx-runtime");
|
|
2840
|
+
var PromptInputCommand = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime34.jsx(Command, {
|
|
2841
2841
|
className: cn(className),
|
|
2842
2842
|
...props
|
|
2843
|
-
}
|
|
2844
|
-
var PromptInputCommandInput = ({ className, ...props }) => /* @__PURE__ */
|
|
2843
|
+
});
|
|
2844
|
+
var PromptInputCommandInput = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime34.jsx(CommandInput, {
|
|
2845
2845
|
className: cn(className),
|
|
2846
2846
|
...props
|
|
2847
|
-
}
|
|
2848
|
-
var PromptInputCommandList = ({ className, ...props }) => /* @__PURE__ */
|
|
2847
|
+
});
|
|
2848
|
+
var PromptInputCommandList = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime34.jsx(CommandList, {
|
|
2849
2849
|
className: cn(className),
|
|
2850
2850
|
...props
|
|
2851
|
-
}
|
|
2852
|
-
var PromptInputCommandEmpty = ({ className, ...props }) => /* @__PURE__ */
|
|
2851
|
+
});
|
|
2852
|
+
var PromptInputCommandEmpty = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime34.jsx(CommandEmpty, {
|
|
2853
2853
|
className: cn(className),
|
|
2854
2854
|
...props
|
|
2855
|
-
}
|
|
2856
|
-
var PromptInputCommandGroup = ({ className, ...props }) => /* @__PURE__ */
|
|
2855
|
+
});
|
|
2856
|
+
var PromptInputCommandGroup = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime34.jsx(CommandGroup, {
|
|
2857
2857
|
className: cn(className),
|
|
2858
2858
|
...props
|
|
2859
|
-
}
|
|
2860
|
-
var PromptInputCommandItem = ({ className, ...props }) => /* @__PURE__ */
|
|
2859
|
+
});
|
|
2860
|
+
var PromptInputCommandItem = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime34.jsx(CommandItem, {
|
|
2861
2861
|
className: cn(className),
|
|
2862
2862
|
...props
|
|
2863
|
-
}
|
|
2864
|
-
var PromptInputCommandSeparator = ({ className, ...props }) => /* @__PURE__ */
|
|
2863
|
+
});
|
|
2864
|
+
var PromptInputCommandSeparator = ({ className, ...props }) => /* @__PURE__ */ jsx_runtime34.jsx(CommandSeparator, {
|
|
2865
2865
|
className: cn(className),
|
|
2866
2866
|
...props
|
|
2867
|
-
}
|
|
2867
|
+
});
|
|
2868
2868
|
// src/ui/composed/AgnoMessageItem.tsx
|
|
2869
2869
|
var import_react14 = require("react");
|
|
2870
2870
|
var import_agno_react = require("@rodrigocoliveira/agno-react");
|
|
2871
2871
|
var import_lucide_react19 = require("lucide-react");
|
|
2872
|
-
var
|
|
2872
|
+
var jsx_runtime35 = require("react/jsx-runtime");
|
|
2873
2873
|
var defaultFormatTimestamp = formatSmartTimestamp;
|
|
2874
2874
|
var getToolState = (tool) => {
|
|
2875
2875
|
return tool.tool_call_error ? "output-error" : "output-available";
|
|
@@ -2911,264 +2911,264 @@ function AgnoMessageItem({
|
|
|
2911
2911
|
setPreview({ type: "file", file });
|
|
2912
2912
|
};
|
|
2913
2913
|
const closePreview = () => setPreview(null);
|
|
2914
|
-
return /* @__PURE__ */
|
|
2914
|
+
return /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
2915
2915
|
className: cn("py-5 first:pt-2", isUser ? "flex justify-end" : "", classNames?.root, className),
|
|
2916
2916
|
children: [
|
|
2917
|
-
isUser ? /* @__PURE__ */
|
|
2917
|
+
isUser ? /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
2918
2918
|
className: "flex items-start gap-2.5 max-w-[80%] flex-row-reverse",
|
|
2919
2919
|
children: [
|
|
2920
2920
|
avatars?.user,
|
|
2921
|
-
/* @__PURE__ */
|
|
2921
|
+
/* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
2922
2922
|
className: "space-y-1.5 flex flex-col items-end min-w-0",
|
|
2923
2923
|
children: [
|
|
2924
|
-
(message.images && message.images.length > 0 || message.audio && message.audio.length > 0 || message.files && message.files.length > 0) && /* @__PURE__ */
|
|
2924
|
+
(message.images && message.images.length > 0 || message.audio && message.audio.length > 0 || message.files && message.files.length > 0) && /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
2925
2925
|
className: "flex flex-wrap gap-2 justify-end",
|
|
2926
2926
|
children: [
|
|
2927
|
-
message.images?.map((img, idx) => /* @__PURE__ */
|
|
2927
|
+
message.images?.map((img, idx) => /* @__PURE__ */ jsx_runtime35.jsx(FilePreviewCard, {
|
|
2928
2928
|
file: { name: img.revised_prompt || `Image ${idx + 1}`, type: "image/png", url: img.url },
|
|
2929
2929
|
onClick: showImageLightbox ? () => openImageLightbox(message.images.map((i) => ({ url: i.url, alt: i.revised_prompt })), idx) : undefined
|
|
2930
|
-
}, `img-${idx}
|
|
2931
|
-
message.audio?.map((audio, idx) => /* @__PURE__ */
|
|
2930
|
+
}, `img-${idx}`)),
|
|
2931
|
+
message.audio?.map((audio, idx) => /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
2932
2932
|
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",
|
|
2933
2933
|
children: [
|
|
2934
|
-
/* @__PURE__ */
|
|
2934
|
+
/* @__PURE__ */ jsx_runtime35.jsx(import_lucide_react19.Music, {
|
|
2935
2935
|
className: "h-3.5 w-3.5 text-muted-foreground"
|
|
2936
|
-
}
|
|
2937
|
-
/* @__PURE__ */
|
|
2936
|
+
}),
|
|
2937
|
+
/* @__PURE__ */ jsx_runtime35.jsx("span", {
|
|
2938
2938
|
className: "truncate max-w-[150px]",
|
|
2939
2939
|
children: audio.id || `Audio ${idx + 1}`
|
|
2940
|
-
}
|
|
2940
|
+
})
|
|
2941
2941
|
]
|
|
2942
|
-
}, `audio-${idx}
|
|
2943
|
-
message.files?.map((file, idx) => showFilePreview ? /* @__PURE__ */
|
|
2942
|
+
}, `audio-${idx}`)),
|
|
2943
|
+
message.files?.map((file, idx) => showFilePreview ? /* @__PURE__ */ jsx_runtime35.jsx(FilePreviewCard, {
|
|
2944
2944
|
file: { name: file.name, type: file.type, url: file.url, size: file.size },
|
|
2945
2945
|
onClick: () => openFilePreview({ name: file.name, type: file.type, url: file.url, size: file.size })
|
|
2946
|
-
}, `file-${idx}
|
|
2946
|
+
}, `file-${idx}`) : /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
2947
2947
|
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",
|
|
2948
2948
|
children: [
|
|
2949
|
-
/* @__PURE__ */
|
|
2949
|
+
/* @__PURE__ */ jsx_runtime35.jsx(import_lucide_react19.FileIcon, {
|
|
2950
2950
|
className: "h-3.5 w-3.5 text-muted-foreground"
|
|
2951
|
-
}
|
|
2952
|
-
/* @__PURE__ */
|
|
2951
|
+
}),
|
|
2952
|
+
/* @__PURE__ */ jsx_runtime35.jsx("span", {
|
|
2953
2953
|
className: "truncate max-w-[150px]",
|
|
2954
2954
|
children: file.name
|
|
2955
|
-
}
|
|
2955
|
+
})
|
|
2956
2956
|
]
|
|
2957
|
-
}, `file-${idx}
|
|
2957
|
+
}, `file-${idx}`))
|
|
2958
2958
|
]
|
|
2959
|
-
}
|
|
2960
|
-
message.content && /* @__PURE__ */
|
|
2959
|
+
}),
|
|
2960
|
+
message.content && /* @__PURE__ */ jsx_runtime35.jsx("div", {
|
|
2961
2961
|
className: cn("rounded-2xl rounded-br-md px-4 py-2.5", classNames?.user?.bubble ?? "bg-primary text-primary-foreground", hasError && "opacity-70"),
|
|
2962
|
-
children: /* @__PURE__ */
|
|
2962
|
+
children: /* @__PURE__ */ jsx_runtime35.jsx("p", {
|
|
2963
2963
|
className: "text-sm whitespace-pre-wrap",
|
|
2964
2964
|
children: message.content
|
|
2965
|
-
}
|
|
2966
|
-
}
|
|
2967
|
-
(showTimestamp || actions?.user) && /* @__PURE__ */
|
|
2965
|
+
})
|
|
2966
|
+
}),
|
|
2967
|
+
(showTimestamp || actions?.user) && /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
2968
2968
|
className: "flex items-center justify-end gap-1.5 px-1",
|
|
2969
2969
|
children: [
|
|
2970
|
-
actions?.user && /* @__PURE__ */
|
|
2970
|
+
actions?.user && /* @__PURE__ */ jsx_runtime35.jsx("div", {
|
|
2971
2971
|
className: "flex items-center gap-1",
|
|
2972
2972
|
children: actions.user(message)
|
|
2973
|
-
}
|
|
2974
|
-
/* @__PURE__ */
|
|
2973
|
+
}),
|
|
2974
|
+
/* @__PURE__ */ jsx_runtime35.jsx(SmartTimestamp, {
|
|
2975
2975
|
date: new Date(message.created_at * 1000),
|
|
2976
2976
|
formatShort: isCustomTimestamp ? resolvedFormatTimestamp : undefined,
|
|
2977
2977
|
className: "text-[11px] text-muted-foreground"
|
|
2978
|
-
}
|
|
2979
|
-
hasError && /* @__PURE__ */
|
|
2978
|
+
}),
|
|
2979
|
+
hasError && /* @__PURE__ */ jsx_runtime35.jsx(import_lucide_react19.AlertCircle, {
|
|
2980
2980
|
className: "h-3 w-3 text-destructive"
|
|
2981
|
-
}
|
|
2981
|
+
})
|
|
2982
2982
|
]
|
|
2983
|
-
}
|
|
2983
|
+
})
|
|
2984
2984
|
]
|
|
2985
|
-
}
|
|
2985
|
+
})
|
|
2986
2986
|
]
|
|
2987
|
-
}
|
|
2987
|
+
}) : /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
2988
2988
|
className: "flex items-start gap-3 group/message",
|
|
2989
2989
|
children: [
|
|
2990
2990
|
avatars?.assistant,
|
|
2991
|
-
/* @__PURE__ */
|
|
2991
|
+
/* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
2992
2992
|
className: cn("flex-1 min-w-0 space-y-3", classNames?.assistant?.container),
|
|
2993
2993
|
children: [
|
|
2994
|
-
renderContent ? renderContent(message) : /* @__PURE__ */
|
|
2994
|
+
renderContent ? renderContent(message) : /* @__PURE__ */ jsx_runtime35.jsxs(jsx_runtime35.Fragment, {
|
|
2995
2995
|
children: [
|
|
2996
|
-
showReasoning && message.extra_data?.reasoning_steps && message.extra_data.reasoning_steps.length > 0 && /* @__PURE__ */
|
|
2996
|
+
showReasoning && message.extra_data?.reasoning_steps && message.extra_data.reasoning_steps.length > 0 && /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
2997
2997
|
className: cn("space-y-2 pt-1", classNames?.assistant?.reasoning),
|
|
2998
2998
|
children: [
|
|
2999
|
-
/* @__PURE__ */
|
|
2999
|
+
/* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3000
3000
|
className: "flex items-center gap-2 text-xs font-medium text-muted-foreground",
|
|
3001
3001
|
children: [
|
|
3002
|
-
/* @__PURE__ */
|
|
3002
|
+
/* @__PURE__ */ jsx_runtime35.jsx(import_lucide_react19.Lightbulb, {
|
|
3003
3003
|
className: "h-3.5 w-3.5"
|
|
3004
|
-
}
|
|
3004
|
+
}),
|
|
3005
3005
|
"Reasoning (",
|
|
3006
3006
|
message.extra_data.reasoning_steps.length,
|
|
3007
3007
|
" steps)"
|
|
3008
3008
|
]
|
|
3009
|
-
}
|
|
3010
|
-
/* @__PURE__ */
|
|
3009
|
+
}),
|
|
3010
|
+
/* @__PURE__ */ jsx_runtime35.jsx(Accordion, {
|
|
3011
3011
|
type: "multiple",
|
|
3012
3012
|
className: "w-full",
|
|
3013
|
-
children: message.extra_data.reasoning_steps.map((step, idx) => /* @__PURE__ */
|
|
3013
|
+
children: message.extra_data.reasoning_steps.map((step, idx) => /* @__PURE__ */ jsx_runtime35.jsxs(AccordionItem, {
|
|
3014
3014
|
value: `reasoning-${idx}`,
|
|
3015
3015
|
className: "border-muted",
|
|
3016
3016
|
children: [
|
|
3017
|
-
/* @__PURE__ */
|
|
3017
|
+
/* @__PURE__ */ jsx_runtime35.jsx(AccordionTrigger, {
|
|
3018
3018
|
className: "text-xs py-1.5 hover:no-underline",
|
|
3019
3019
|
children: step.title || `Step ${idx + 1}`
|
|
3020
|
-
}
|
|
3021
|
-
/* @__PURE__ */
|
|
3020
|
+
}),
|
|
3021
|
+
/* @__PURE__ */ jsx_runtime35.jsxs(AccordionContent, {
|
|
3022
3022
|
className: "space-y-1.5 text-xs text-muted-foreground",
|
|
3023
3023
|
children: [
|
|
3024
|
-
step.action && /* @__PURE__ */
|
|
3024
|
+
step.action && /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3025
3025
|
children: [
|
|
3026
|
-
/* @__PURE__ */
|
|
3026
|
+
/* @__PURE__ */ jsx_runtime35.jsx("span", {
|
|
3027
3027
|
className: "font-medium text-foreground",
|
|
3028
3028
|
children: "Action:"
|
|
3029
|
-
}
|
|
3029
|
+
}),
|
|
3030
3030
|
" ",
|
|
3031
3031
|
step.action
|
|
3032
3032
|
]
|
|
3033
|
-
}
|
|
3034
|
-
step.reasoning && /* @__PURE__ */
|
|
3033
|
+
}),
|
|
3034
|
+
step.reasoning && /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3035
3035
|
children: [
|
|
3036
|
-
/* @__PURE__ */
|
|
3036
|
+
/* @__PURE__ */ jsx_runtime35.jsx("span", {
|
|
3037
3037
|
className: "font-medium text-foreground",
|
|
3038
3038
|
children: "Reasoning:"
|
|
3039
|
-
}
|
|
3039
|
+
}),
|
|
3040
3040
|
" ",
|
|
3041
3041
|
step.reasoning
|
|
3042
3042
|
]
|
|
3043
|
-
}
|
|
3044
|
-
step.result && /* @__PURE__ */
|
|
3043
|
+
}),
|
|
3044
|
+
step.result && /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3045
3045
|
children: [
|
|
3046
|
-
/* @__PURE__ */
|
|
3046
|
+
/* @__PURE__ */ jsx_runtime35.jsx("span", {
|
|
3047
3047
|
className: "font-medium text-foreground",
|
|
3048
3048
|
children: "Result:"
|
|
3049
|
-
}
|
|
3049
|
+
}),
|
|
3050
3050
|
" ",
|
|
3051
3051
|
step.result
|
|
3052
3052
|
]
|
|
3053
|
-
}
|
|
3054
|
-
step.confidence !== undefined && /* @__PURE__ */
|
|
3053
|
+
}),
|
|
3054
|
+
step.confidence !== undefined && /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3055
3055
|
children: [
|
|
3056
|
-
/* @__PURE__ */
|
|
3056
|
+
/* @__PURE__ */ jsx_runtime35.jsx("span", {
|
|
3057
3057
|
className: "font-medium text-foreground",
|
|
3058
3058
|
children: "Confidence:"
|
|
3059
|
-
}
|
|
3059
|
+
}),
|
|
3060
3060
|
" ",
|
|
3061
3061
|
(step.confidence * 100).toFixed(1),
|
|
3062
3062
|
"%"
|
|
3063
3063
|
]
|
|
3064
|
-
}
|
|
3064
|
+
})
|
|
3065
3065
|
]
|
|
3066
|
-
}
|
|
3066
|
+
})
|
|
3067
3067
|
]
|
|
3068
|
-
}, idx
|
|
3069
|
-
}
|
|
3068
|
+
}, idx))
|
|
3069
|
+
})
|
|
3070
3070
|
]
|
|
3071
|
-
}
|
|
3072
|
-
message.content && /* @__PURE__ */
|
|
3071
|
+
}),
|
|
3072
|
+
message.content && /* @__PURE__ */ jsx_runtime35.jsx("div", {
|
|
3073
3073
|
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",
|
|
3074
|
-
children: /* @__PURE__ */
|
|
3074
|
+
children: /* @__PURE__ */ jsx_runtime35.jsx(Response, {
|
|
3075
3075
|
children: message.content
|
|
3076
|
-
}
|
|
3077
|
-
}
|
|
3078
|
-
showGenerativeUI && toolsWithUI.length > 0 && /* @__PURE__ */
|
|
3076
|
+
})
|
|
3077
|
+
}),
|
|
3078
|
+
showGenerativeUI && toolsWithUI.length > 0 && /* @__PURE__ */ jsx_runtime35.jsx("div", {
|
|
3079
3079
|
className: "space-y-3",
|
|
3080
3080
|
children: toolsWithUI.map((tool) => {
|
|
3081
3081
|
const uiComponent = tool.ui_component;
|
|
3082
|
-
return /* @__PURE__ */
|
|
3083
|
-
children: uiComponent.layout === "artifact" ? /* @__PURE__ */
|
|
3084
|
-
children: /* @__PURE__ */
|
|
3082
|
+
return /* @__PURE__ */ jsx_runtime35.jsx("div", {
|
|
3083
|
+
children: uiComponent.layout === "artifact" ? /* @__PURE__ */ jsx_runtime35.jsx(Artifact, {
|
|
3084
|
+
children: /* @__PURE__ */ jsx_runtime35.jsx(import_agno_react.GenerativeUIRenderer, {
|
|
3085
3085
|
spec: uiComponent,
|
|
3086
3086
|
className: "w-full p-2"
|
|
3087
|
-
}
|
|
3088
|
-
}
|
|
3087
|
+
})
|
|
3088
|
+
}) : /* @__PURE__ */ jsx_runtime35.jsx(import_agno_react.GenerativeUIRenderer, {
|
|
3089
3089
|
spec: uiComponent,
|
|
3090
3090
|
className: "w-full"
|
|
3091
|
-
}
|
|
3092
|
-
}, tool.tool_call_id
|
|
3091
|
+
})
|
|
3092
|
+
}, tool.tool_call_id);
|
|
3093
3093
|
})
|
|
3094
|
-
}
|
|
3094
|
+
}),
|
|
3095
3095
|
toolResultRenderers && message.tool_calls?.map((tool) => {
|
|
3096
3096
|
const renderer = toolResultRenderers[tool.tool_name];
|
|
3097
3097
|
const content = tool.result ?? tool.content;
|
|
3098
3098
|
if (!renderer || !content)
|
|
3099
3099
|
return null;
|
|
3100
|
-
return /* @__PURE__ */
|
|
3100
|
+
return /* @__PURE__ */ jsx_runtime35.jsx("div", {
|
|
3101
3101
|
children: renderer(tool.tool_args, content)
|
|
3102
|
-
}, `result-${tool.tool_call_id}
|
|
3102
|
+
}, `result-${tool.tool_call_id}`);
|
|
3103
3103
|
}),
|
|
3104
3104
|
renderMedia ? renderMedia(message) : (() => {
|
|
3105
3105
|
const mediaClassName = classNames?.assistant?.media;
|
|
3106
|
-
return /* @__PURE__ */
|
|
3106
|
+
return /* @__PURE__ */ jsx_runtime35.jsxs(jsx_runtime35.Fragment, {
|
|
3107
3107
|
children: [
|
|
3108
|
-
message.images && message.images.length > 0 && /* @__PURE__ */
|
|
3108
|
+
message.images && message.images.length > 0 && /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3109
3109
|
className: cn("space-y-2 pt-1", mediaClassName),
|
|
3110
3110
|
children: [
|
|
3111
|
-
/* @__PURE__ */
|
|
3111
|
+
/* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3112
3112
|
className: "flex items-center gap-2 text-xs font-medium text-muted-foreground",
|
|
3113
3113
|
children: [
|
|
3114
|
-
/* @__PURE__ */
|
|
3114
|
+
/* @__PURE__ */ jsx_runtime35.jsx(import_lucide_react19.Image, {
|
|
3115
3115
|
className: "h-3.5 w-3.5"
|
|
3116
|
-
}
|
|
3116
|
+
}),
|
|
3117
3117
|
"Images (",
|
|
3118
3118
|
message.images.length,
|
|
3119
3119
|
")"
|
|
3120
3120
|
]
|
|
3121
|
-
}
|
|
3122
|
-
/* @__PURE__ */
|
|
3121
|
+
}),
|
|
3122
|
+
/* @__PURE__ */ jsx_runtime35.jsx("div", {
|
|
3123
3123
|
className: "grid grid-cols-2 gap-2",
|
|
3124
|
-
children: message.images.map((img, idx) => /* @__PURE__ */
|
|
3124
|
+
children: message.images.map((img, idx) => /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3125
3125
|
className: "space-y-1",
|
|
3126
3126
|
children: [
|
|
3127
|
-
showImageLightbox ? /* @__PURE__ */
|
|
3127
|
+
showImageLightbox ? /* @__PURE__ */ jsx_runtime35.jsx("button", {
|
|
3128
3128
|
type: "button",
|
|
3129
3129
|
onClick: () => openImageLightbox(message.images.map((i) => ({ url: i.url, alt: i.revised_prompt })), idx),
|
|
3130
3130
|
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",
|
|
3131
|
-
children: /* @__PURE__ */
|
|
3131
|
+
children: /* @__PURE__ */ jsx_runtime35.jsx("img", {
|
|
3132
3132
|
src: img.url,
|
|
3133
3133
|
alt: img.revised_prompt || "Generated image",
|
|
3134
3134
|
className: "w-full rounded-lg"
|
|
3135
|
-
}
|
|
3136
|
-
}
|
|
3135
|
+
})
|
|
3136
|
+
}) : /* @__PURE__ */ jsx_runtime35.jsx("img", {
|
|
3137
3137
|
src: img.url,
|
|
3138
3138
|
alt: img.revised_prompt || "Generated image",
|
|
3139
3139
|
className: "w-full rounded-lg border border-border"
|
|
3140
|
-
}
|
|
3141
|
-
img.revised_prompt && /* @__PURE__ */
|
|
3140
|
+
}),
|
|
3141
|
+
img.revised_prompt && /* @__PURE__ */ jsx_runtime35.jsx("p", {
|
|
3142
3142
|
className: "text-[11px] text-muted-foreground italic px-0.5",
|
|
3143
3143
|
children: img.revised_prompt
|
|
3144
|
-
}
|
|
3144
|
+
})
|
|
3145
3145
|
]
|
|
3146
|
-
}, idx
|
|
3147
|
-
}
|
|
3146
|
+
}, idx))
|
|
3147
|
+
})
|
|
3148
3148
|
]
|
|
3149
|
-
}
|
|
3150
|
-
message.videos && message.videos.length > 0 && /* @__PURE__ */
|
|
3149
|
+
}),
|
|
3150
|
+
message.videos && message.videos.length > 0 && /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3151
3151
|
className: cn("space-y-2 pt-1", mediaClassName),
|
|
3152
3152
|
children: [
|
|
3153
|
-
/* @__PURE__ */
|
|
3153
|
+
/* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3154
3154
|
className: "flex items-center gap-2 text-xs font-medium text-muted-foreground",
|
|
3155
3155
|
children: [
|
|
3156
|
-
/* @__PURE__ */
|
|
3156
|
+
/* @__PURE__ */ jsx_runtime35.jsx(import_lucide_react19.Video, {
|
|
3157
3157
|
className: "h-3.5 w-3.5"
|
|
3158
|
-
}
|
|
3158
|
+
}),
|
|
3159
3159
|
"Videos (",
|
|
3160
3160
|
message.videos.length,
|
|
3161
3161
|
")"
|
|
3162
3162
|
]
|
|
3163
|
-
}
|
|
3164
|
-
/* @__PURE__ */
|
|
3163
|
+
}),
|
|
3164
|
+
/* @__PURE__ */ jsx_runtime35.jsx("div", {
|
|
3165
3165
|
className: "space-y-2",
|
|
3166
|
-
children: message.videos.map((video, idx) => /* @__PURE__ */
|
|
3167
|
-
children: video.url ? /* @__PURE__ */
|
|
3166
|
+
children: message.videos.map((video, idx) => /* @__PURE__ */ jsx_runtime35.jsx("div", {
|
|
3167
|
+
children: video.url ? /* @__PURE__ */ jsx_runtime35.jsx("video", {
|
|
3168
3168
|
src: video.url,
|
|
3169
3169
|
controls: true,
|
|
3170
3170
|
className: "w-full rounded-lg border border-border"
|
|
3171
|
-
}
|
|
3171
|
+
}) : /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3172
3172
|
className: "bg-muted/50 border border-border p-2.5 rounded-lg text-xs text-muted-foreground",
|
|
3173
3173
|
children: [
|
|
3174
3174
|
"Video ID: ",
|
|
@@ -3177,185 +3177,185 @@ function AgnoMessageItem({
|
|
|
3177
3177
|
video.eta,
|
|
3178
3178
|
"s)"
|
|
3179
3179
|
]
|
|
3180
|
-
}
|
|
3181
|
-
}, idx
|
|
3182
|
-
}
|
|
3180
|
+
})
|
|
3181
|
+
}, idx))
|
|
3182
|
+
})
|
|
3183
3183
|
]
|
|
3184
|
-
}
|
|
3185
|
-
message.audio && message.audio.length > 0 && /* @__PURE__ */
|
|
3184
|
+
}),
|
|
3185
|
+
message.audio && message.audio.length > 0 && /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3186
3186
|
className: cn("space-y-2 pt-1", mediaClassName),
|
|
3187
3187
|
children: [
|
|
3188
|
-
/* @__PURE__ */
|
|
3188
|
+
/* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3189
3189
|
className: "flex items-center gap-2 text-xs font-medium text-muted-foreground",
|
|
3190
3190
|
children: [
|
|
3191
|
-
/* @__PURE__ */
|
|
3191
|
+
/* @__PURE__ */ jsx_runtime35.jsx(import_lucide_react19.Music, {
|
|
3192
3192
|
className: "h-3.5 w-3.5"
|
|
3193
|
-
}
|
|
3193
|
+
}),
|
|
3194
3194
|
"Audio (",
|
|
3195
3195
|
message.audio.length,
|
|
3196
3196
|
")"
|
|
3197
3197
|
]
|
|
3198
|
-
}
|
|
3199
|
-
/* @__PURE__ */
|
|
3198
|
+
}),
|
|
3199
|
+
/* @__PURE__ */ jsx_runtime35.jsx("div", {
|
|
3200
3200
|
className: "space-y-2",
|
|
3201
|
-
children: message.audio.map((audio, idx) => /* @__PURE__ */
|
|
3202
|
-
children: audio.url ? /* @__PURE__ */
|
|
3201
|
+
children: message.audio.map((audio, idx) => /* @__PURE__ */ jsx_runtime35.jsx("div", {
|
|
3202
|
+
children: audio.url ? /* @__PURE__ */ jsx_runtime35.jsx("audio", {
|
|
3203
3203
|
src: audio.url,
|
|
3204
3204
|
controls: true,
|
|
3205
3205
|
className: "w-full"
|
|
3206
|
-
}
|
|
3206
|
+
}) : audio.base64_audio ? /* @__PURE__ */ jsx_runtime35.jsx("audio", {
|
|
3207
3207
|
src: `data:${audio.mime_type || "audio/wav"};base64,${audio.base64_audio}`,
|
|
3208
3208
|
controls: true,
|
|
3209
3209
|
className: "w-full"
|
|
3210
|
-
}
|
|
3210
|
+
}) : /* @__PURE__ */ jsx_runtime35.jsx("div", {
|
|
3211
3211
|
className: "bg-muted/50 border border-border p-2.5 rounded-lg text-xs text-muted-foreground",
|
|
3212
3212
|
children: "Audio data unavailable"
|
|
3213
|
-
}
|
|
3214
|
-
}, idx
|
|
3215
|
-
}
|
|
3213
|
+
})
|
|
3214
|
+
}, idx))
|
|
3215
|
+
})
|
|
3216
3216
|
]
|
|
3217
|
-
}
|
|
3218
|
-
message.files && message.files.length > 0 && /* @__PURE__ */
|
|
3217
|
+
}),
|
|
3218
|
+
message.files && message.files.length > 0 && /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3219
3219
|
className: cn("space-y-2 pt-1", mediaClassName),
|
|
3220
3220
|
children: [
|
|
3221
|
-
/* @__PURE__ */
|
|
3221
|
+
/* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3222
3222
|
className: "flex items-center gap-2 text-xs font-medium text-muted-foreground",
|
|
3223
3223
|
children: [
|
|
3224
|
-
/* @__PURE__ */
|
|
3224
|
+
/* @__PURE__ */ jsx_runtime35.jsx(import_lucide_react19.Paperclip, {
|
|
3225
3225
|
className: "h-3.5 w-3.5"
|
|
3226
|
-
}
|
|
3226
|
+
}),
|
|
3227
3227
|
"Files (",
|
|
3228
3228
|
message.files.length,
|
|
3229
3229
|
")"
|
|
3230
3230
|
]
|
|
3231
|
-
}
|
|
3232
|
-
/* @__PURE__ */
|
|
3231
|
+
}),
|
|
3232
|
+
/* @__PURE__ */ jsx_runtime35.jsx("div", {
|
|
3233
3233
|
className: "flex flex-wrap gap-2",
|
|
3234
|
-
children: message.files.map((file, idx) => showFilePreview ? /* @__PURE__ */
|
|
3234
|
+
children: message.files.map((file, idx) => showFilePreview ? /* @__PURE__ */ jsx_runtime35.jsx(FilePreviewCard, {
|
|
3235
3235
|
file: { name: file.name, type: file.type, url: file.url, size: file.size },
|
|
3236
3236
|
onClick: () => openFilePreview({ name: file.name, type: file.type, url: file.url, size: file.size })
|
|
3237
|
-
}, idx
|
|
3237
|
+
}, idx) : /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3238
3238
|
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",
|
|
3239
3239
|
children: [
|
|
3240
|
-
/* @__PURE__ */
|
|
3240
|
+
/* @__PURE__ */ jsx_runtime35.jsx(import_lucide_react19.FileIcon, {
|
|
3241
3241
|
className: "h-3.5 w-3.5 shrink-0 text-muted-foreground"
|
|
3242
|
-
}
|
|
3243
|
-
/* @__PURE__ */
|
|
3242
|
+
}),
|
|
3243
|
+
/* @__PURE__ */ jsx_runtime35.jsx("span", {
|
|
3244
3244
|
className: "truncate max-w-[180px]",
|
|
3245
3245
|
children: file.name
|
|
3246
|
-
}
|
|
3247
|
-
file.size && /* @__PURE__ */
|
|
3246
|
+
}),
|
|
3247
|
+
file.size && /* @__PURE__ */ jsx_runtime35.jsxs("span", {
|
|
3248
3248
|
className: "text-muted-foreground/70",
|
|
3249
3249
|
children: [
|
|
3250
3250
|
"(",
|
|
3251
3251
|
(file.size / 1024).toFixed(1),
|
|
3252
3252
|
"KB)"
|
|
3253
3253
|
]
|
|
3254
|
-
}
|
|
3255
|
-
file.url && /^https?:\/\//i.test(file.url) && /* @__PURE__ */
|
|
3254
|
+
}),
|
|
3255
|
+
file.url && /^https?:\/\//i.test(file.url) && /* @__PURE__ */ jsx_runtime35.jsx("a", {
|
|
3256
3256
|
href: file.url,
|
|
3257
3257
|
target: "_blank",
|
|
3258
3258
|
rel: "noopener noreferrer",
|
|
3259
3259
|
className: "text-primary hover:underline font-medium",
|
|
3260
3260
|
children: "View"
|
|
3261
|
-
}
|
|
3261
|
+
})
|
|
3262
3262
|
]
|
|
3263
|
-
}, idx
|
|
3264
|
-
}
|
|
3263
|
+
}, idx))
|
|
3264
|
+
})
|
|
3265
3265
|
]
|
|
3266
|
-
}
|
|
3267
|
-
message.response_audio && /* @__PURE__ */
|
|
3266
|
+
}),
|
|
3267
|
+
message.response_audio && /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3268
3268
|
className: cn("space-y-2 pt-1", mediaClassName),
|
|
3269
3269
|
children: [
|
|
3270
|
-
/* @__PURE__ */
|
|
3270
|
+
/* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3271
3271
|
className: "flex items-center gap-2 text-xs font-medium text-muted-foreground",
|
|
3272
3272
|
children: [
|
|
3273
|
-
/* @__PURE__ */
|
|
3273
|
+
/* @__PURE__ */ jsx_runtime35.jsx(import_lucide_react19.Music, {
|
|
3274
3274
|
className: "h-3.5 w-3.5"
|
|
3275
|
-
}
|
|
3275
|
+
}),
|
|
3276
3276
|
"Response Audio"
|
|
3277
3277
|
]
|
|
3278
|
-
}
|
|
3279
|
-
message.response_audio.transcript && /* @__PURE__ */
|
|
3278
|
+
}),
|
|
3279
|
+
message.response_audio.transcript && /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3280
3280
|
className: "text-xs italic bg-muted/50 border border-border p-2.5 rounded-lg text-muted-foreground",
|
|
3281
3281
|
children: [
|
|
3282
3282
|
'"',
|
|
3283
3283
|
message.response_audio.transcript,
|
|
3284
3284
|
'"'
|
|
3285
3285
|
]
|
|
3286
|
-
}
|
|
3287
|
-
message.response_audio.content && /* @__PURE__ */
|
|
3286
|
+
}),
|
|
3287
|
+
message.response_audio.content && /* @__PURE__ */ jsx_runtime35.jsx("audio", {
|
|
3288
3288
|
src: `data:audio/wav;base64,${message.response_audio.content}`,
|
|
3289
3289
|
controls: true,
|
|
3290
3290
|
className: "w-full"
|
|
3291
|
-
}
|
|
3291
|
+
})
|
|
3292
3292
|
]
|
|
3293
|
-
}
|
|
3293
|
+
})
|
|
3294
3294
|
]
|
|
3295
|
-
}
|
|
3295
|
+
});
|
|
3296
3296
|
})(),
|
|
3297
|
-
showToolCalls && message.tool_calls && message.tool_calls.length > 0 && /* @__PURE__ */
|
|
3297
|
+
showToolCalls && message.tool_calls && message.tool_calls.length > 0 && /* @__PURE__ */ jsx_runtime35.jsx("div", {
|
|
3298
3298
|
className: cn("space-y-2 pt-1", classNames?.assistant?.toolCalls),
|
|
3299
|
-
children: message.tool_calls.map((tool, idx) => renderToolCall ? renderToolCall(tool, idx) : /* @__PURE__ */
|
|
3299
|
+
children: message.tool_calls.map((tool, idx) => renderToolCall ? renderToolCall(tool, idx) : /* @__PURE__ */ jsx_runtime35.jsxs(Tool, {
|
|
3300
3300
|
defaultOpen: idx === 0,
|
|
3301
3301
|
children: [
|
|
3302
|
-
/* @__PURE__ */
|
|
3302
|
+
/* @__PURE__ */ jsx_runtime35.jsx(ToolHeader, {
|
|
3303
3303
|
title: tool.tool_name,
|
|
3304
3304
|
type: "tool-use",
|
|
3305
3305
|
state: getToolState(tool)
|
|
3306
|
-
}
|
|
3307
|
-
/* @__PURE__ */
|
|
3306
|
+
}),
|
|
3307
|
+
/* @__PURE__ */ jsx_runtime35.jsxs(ToolContent, {
|
|
3308
3308
|
children: [
|
|
3309
|
-
/* @__PURE__ */
|
|
3309
|
+
/* @__PURE__ */ jsx_runtime35.jsx(ToolInput, {
|
|
3310
3310
|
input: tool.tool_args
|
|
3311
|
-
}
|
|
3312
|
-
tool.content && /* @__PURE__ */
|
|
3311
|
+
}),
|
|
3312
|
+
tool.content && /* @__PURE__ */ jsx_runtime35.jsx(ToolOutput, {
|
|
3313
3313
|
output: tool.content,
|
|
3314
3314
|
errorText: tool.tool_call_error ? "Tool execution failed" : undefined
|
|
3315
|
-
}
|
|
3315
|
+
})
|
|
3316
3316
|
]
|
|
3317
|
-
}
|
|
3317
|
+
})
|
|
3318
3318
|
]
|
|
3319
|
-
}, tool.tool_call_id || idx
|
|
3320
|
-
}
|
|
3321
|
-
showReferences && message.extra_data?.references && message.extra_data.references.length > 0 && /* @__PURE__ */
|
|
3319
|
+
}, tool.tool_call_id || idx))
|
|
3320
|
+
}),
|
|
3321
|
+
showReferences && message.extra_data?.references && message.extra_data.references.length > 0 && /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3322
3322
|
className: cn("space-y-2 pt-1", classNames?.assistant?.references),
|
|
3323
3323
|
children: [
|
|
3324
|
-
/* @__PURE__ */
|
|
3324
|
+
/* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3325
3325
|
className: "flex items-center gap-2 text-xs font-medium text-muted-foreground",
|
|
3326
3326
|
children: [
|
|
3327
|
-
/* @__PURE__ */
|
|
3327
|
+
/* @__PURE__ */ jsx_runtime35.jsx(import_lucide_react19.FileText, {
|
|
3328
3328
|
className: "h-3.5 w-3.5"
|
|
3329
|
-
}
|
|
3329
|
+
}),
|
|
3330
3330
|
"References (",
|
|
3331
3331
|
message.extra_data.references.length,
|
|
3332
3332
|
")"
|
|
3333
3333
|
]
|
|
3334
|
-
}
|
|
3335
|
-
/* @__PURE__ */
|
|
3334
|
+
}),
|
|
3335
|
+
/* @__PURE__ */ jsx_runtime35.jsx("div", {
|
|
3336
3336
|
className: "space-y-2",
|
|
3337
|
-
children: message.extra_data.references.map((refData, idx) => /* @__PURE__ */
|
|
3337
|
+
children: message.extra_data.references.map((refData, idx) => /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3338
3338
|
className: "text-xs space-y-1.5",
|
|
3339
3339
|
children: [
|
|
3340
|
-
refData.query && /* @__PURE__ */
|
|
3340
|
+
refData.query && /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3341
3341
|
className: "font-medium text-foreground",
|
|
3342
3342
|
children: [
|
|
3343
3343
|
"Query: ",
|
|
3344
3344
|
refData.query
|
|
3345
3345
|
]
|
|
3346
|
-
}
|
|
3347
|
-
refData.references.map((ref, refIdx) => /* @__PURE__ */
|
|
3346
|
+
}),
|
|
3347
|
+
refData.references.map((ref, refIdx) => /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3348
3348
|
className: "bg-muted/50 border border-border p-2.5 rounded-lg",
|
|
3349
3349
|
children: [
|
|
3350
|
-
/* @__PURE__ */
|
|
3350
|
+
/* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3351
3351
|
className: "italic text-muted-foreground mb-1",
|
|
3352
3352
|
children: [
|
|
3353
3353
|
'"',
|
|
3354
3354
|
ref.content,
|
|
3355
3355
|
'"'
|
|
3356
3356
|
]
|
|
3357
|
-
}
|
|
3358
|
-
/* @__PURE__ */
|
|
3357
|
+
}),
|
|
3358
|
+
/* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3359
3359
|
className: "text-muted-foreground/70",
|
|
3360
3360
|
children: [
|
|
3361
3361
|
"Source: ",
|
|
@@ -3366,17 +3366,17 @@ function AgnoMessageItem({
|
|
|
3366
3366
|
ref.meta_data.chunk_size,
|
|
3367
3367
|
")"
|
|
3368
3368
|
]
|
|
3369
|
-
}
|
|
3369
|
+
})
|
|
3370
3370
|
]
|
|
3371
|
-
}, refIdx
|
|
3371
|
+
}, refIdx))
|
|
3372
3372
|
]
|
|
3373
|
-
}, idx
|
|
3374
|
-
}
|
|
3373
|
+
}, idx))
|
|
3374
|
+
})
|
|
3375
3375
|
]
|
|
3376
|
-
}
|
|
3376
|
+
})
|
|
3377
3377
|
]
|
|
3378
|
-
}
|
|
3379
|
-
(actions?.assistant || showTimestamp || hasError) && /* @__PURE__ */
|
|
3378
|
+
}),
|
|
3379
|
+
(actions?.assistant || showTimestamp || hasError) && /* @__PURE__ */ jsx_runtime35.jsxs("div", {
|
|
3380
3380
|
className: "flex items-center gap-2 pt-1",
|
|
3381
3381
|
children: [
|
|
3382
3382
|
actions?.assistant && (() => {
|
|
@@ -3384,32 +3384,32 @@ function AgnoMessageItem({
|
|
|
3384
3384
|
if (visibility === "last-assistant" && !isLastAssistantMessage)
|
|
3385
3385
|
return null;
|
|
3386
3386
|
const useHover = visibility === "hover" || visibility === "hover-last-visible" && !isLastAssistantMessage;
|
|
3387
|
-
return /* @__PURE__ */
|
|
3387
|
+
return /* @__PURE__ */ jsx_runtime35.jsx("div", {
|
|
3388
3388
|
className: cn("flex items-center gap-1 transition-opacity", useHover && "opacity-0 group-hover/message:opacity-100", classNames?.assistant?.actions),
|
|
3389
3389
|
children: actions.assistant(message)
|
|
3390
|
-
}
|
|
3390
|
+
});
|
|
3391
3391
|
})(),
|
|
3392
|
-
hasError && /* @__PURE__ */
|
|
3392
|
+
hasError && /* @__PURE__ */ jsx_runtime35.jsxs("span", {
|
|
3393
3393
|
className: "flex items-center gap-1 text-[11px] text-destructive",
|
|
3394
3394
|
children: [
|
|
3395
|
-
/* @__PURE__ */
|
|
3395
|
+
/* @__PURE__ */ jsx_runtime35.jsx(import_lucide_react19.AlertCircle, {
|
|
3396
3396
|
className: "h-3 w-3"
|
|
3397
|
-
}
|
|
3397
|
+
}),
|
|
3398
3398
|
"Error"
|
|
3399
3399
|
]
|
|
3400
|
-
}
|
|
3401
|
-
showTimestamp && /* @__PURE__ */
|
|
3400
|
+
}),
|
|
3401
|
+
showTimestamp && /* @__PURE__ */ jsx_runtime35.jsx(SmartTimestamp, {
|
|
3402
3402
|
date: new Date(message.created_at * 1000),
|
|
3403
3403
|
formatShort: isCustomTimestamp ? resolvedFormatTimestamp : undefined,
|
|
3404
3404
|
className: "text-[11px] text-muted-foreground"
|
|
3405
|
-
}
|
|
3405
|
+
})
|
|
3406
3406
|
]
|
|
3407
|
-
}
|
|
3407
|
+
})
|
|
3408
3408
|
]
|
|
3409
|
-
}
|
|
3409
|
+
})
|
|
3410
3410
|
]
|
|
3411
|
-
}
|
|
3412
|
-
preview?.type === "image" && /* @__PURE__ */
|
|
3411
|
+
}),
|
|
3412
|
+
preview?.type === "image" && /* @__PURE__ */ jsx_runtime35.jsx(ImageLightbox, {
|
|
3413
3413
|
open: true,
|
|
3414
3414
|
onOpenChange: (open) => {
|
|
3415
3415
|
if (!open)
|
|
@@ -3417,21 +3417,21 @@ function AgnoMessageItem({
|
|
|
3417
3417
|
},
|
|
3418
3418
|
images: preview.images,
|
|
3419
3419
|
initialIndex: preview.initialIndex
|
|
3420
|
-
}
|
|
3421
|
-
preview?.type === "file" && /* @__PURE__ */
|
|
3420
|
+
}),
|
|
3421
|
+
preview?.type === "file" && /* @__PURE__ */ jsx_runtime35.jsx(FilePreviewModal, {
|
|
3422
3422
|
open: true,
|
|
3423
3423
|
onOpenChange: (open) => {
|
|
3424
3424
|
if (!open)
|
|
3425
3425
|
closePreview();
|
|
3426
3426
|
},
|
|
3427
3427
|
file: preview.file
|
|
3428
|
-
}
|
|
3428
|
+
})
|
|
3429
3429
|
]
|
|
3430
|
-
}
|
|
3430
|
+
});
|
|
3431
3431
|
}
|
|
3432
3432
|
// src/ui/composed/AgnoChatInput.tsx
|
|
3433
3433
|
var import_lucide_react20 = require("lucide-react");
|
|
3434
|
-
var
|
|
3434
|
+
var jsx_runtime36 = require("react/jsx-runtime");
|
|
3435
3435
|
var DEFAULT_ACCEPTED_FILE_TYPES = "image/*,audio/*,.pdf,.doc,.docx,.txt,.csv,.xlsx,.xls,.ppt,.pptx,.md,.json,.xml";
|
|
3436
3436
|
function normalizeAudio(audio) {
|
|
3437
3437
|
if (audio === true)
|
|
@@ -3451,37 +3451,37 @@ function dataUrlToBlob(dataUrl) {
|
|
|
3451
3451
|
return new Blob([buf], { type: mime });
|
|
3452
3452
|
}
|
|
3453
3453
|
function CancelButton({ onCancel }) {
|
|
3454
|
-
return /* @__PURE__ */
|
|
3454
|
+
return /* @__PURE__ */ jsx_runtime36.jsx(Button, {
|
|
3455
3455
|
type: "button",
|
|
3456
3456
|
variant: "destructive",
|
|
3457
3457
|
size: "icon",
|
|
3458
3458
|
className: "h-8 w-8 rounded-lg",
|
|
3459
3459
|
onClick: onCancel,
|
|
3460
3460
|
"aria-label": "Stop",
|
|
3461
|
-
children: /* @__PURE__ */
|
|
3461
|
+
children: /* @__PURE__ */ jsx_runtime36.jsx(import_lucide_react20.CircleStop, {
|
|
3462
3462
|
className: "size-4"
|
|
3463
|
-
}
|
|
3464
|
-
}
|
|
3463
|
+
})
|
|
3464
|
+
});
|
|
3465
3465
|
}
|
|
3466
3466
|
function SubmitButton({ disabled, status }) {
|
|
3467
3467
|
const { textInput } = usePromptInputController();
|
|
3468
3468
|
const hasText = textInput.value.trim().length > 0;
|
|
3469
|
-
return /* @__PURE__ */
|
|
3469
|
+
return /* @__PURE__ */ jsx_runtime36.jsx(PromptInputSubmit, {
|
|
3470
3470
|
disabled: disabled || !hasText,
|
|
3471
3471
|
status
|
|
3472
|
-
}
|
|
3472
|
+
});
|
|
3473
3473
|
}
|
|
3474
3474
|
function AttachmentHeader() {
|
|
3475
3475
|
const { files } = usePromptInputAttachments();
|
|
3476
3476
|
if (files.length === 0)
|
|
3477
3477
|
return null;
|
|
3478
|
-
return /* @__PURE__ */
|
|
3479
|
-
children: /* @__PURE__ */
|
|
3480
|
-
children: (attachment) => /* @__PURE__ */
|
|
3478
|
+
return /* @__PURE__ */ jsx_runtime36.jsx(PromptInputHeader, {
|
|
3479
|
+
children: /* @__PURE__ */ jsx_runtime36.jsx(PromptInputAttachments, {
|
|
3480
|
+
children: (attachment) => /* @__PURE__ */ jsx_runtime36.jsx(PromptInputAttachment, {
|
|
3481
3481
|
data: attachment
|
|
3482
|
-
}
|
|
3483
|
-
}
|
|
3484
|
-
}
|
|
3482
|
+
})
|
|
3483
|
+
})
|
|
3484
|
+
});
|
|
3485
3485
|
}
|
|
3486
3486
|
function TranscribeAudioRecorder({
|
|
3487
3487
|
endpoint,
|
|
@@ -3492,7 +3492,7 @@ function TranscribeAudioRecorder({
|
|
|
3492
3492
|
labels
|
|
3493
3493
|
}) {
|
|
3494
3494
|
const { textInput } = usePromptInputController();
|
|
3495
|
-
return /* @__PURE__ */
|
|
3495
|
+
return /* @__PURE__ */ jsx_runtime36.jsx(AudioRecorder, {
|
|
3496
3496
|
mode: "transcribe",
|
|
3497
3497
|
transcriptionEndpoint: endpoint,
|
|
3498
3498
|
transcriptionHeaders: headers,
|
|
@@ -3505,7 +3505,7 @@ function TranscribeAudioRecorder({
|
|
|
3505
3505
|
},
|
|
3506
3506
|
disabled,
|
|
3507
3507
|
labels
|
|
3508
|
-
}
|
|
3508
|
+
});
|
|
3509
3509
|
}
|
|
3510
3510
|
function AgnoChatInput({
|
|
3511
3511
|
onSend,
|
|
@@ -3556,8 +3556,8 @@ function AgnoChatInput({
|
|
|
3556
3556
|
};
|
|
3557
3557
|
const computedStatus = status ?? (disabled ? "submitted" : undefined);
|
|
3558
3558
|
const showCancelButton = allowCancelRun && isStreaming && onCancel;
|
|
3559
|
-
return /* @__PURE__ */
|
|
3560
|
-
children: /* @__PURE__ */
|
|
3559
|
+
return /* @__PURE__ */ jsx_runtime36.jsx(PromptInputProvider, {
|
|
3560
|
+
children: /* @__PURE__ */ jsx_runtime36.jsxs(PromptInput, {
|
|
3561
3561
|
onSubmit: handleSubmit,
|
|
3562
3562
|
accept: fileUpload?.accept ?? DEFAULT_ACCEPTED_FILE_TYPES,
|
|
3563
3563
|
multiple: fileUpload?.multiple ?? true,
|
|
@@ -3567,58 +3567,58 @@ function AgnoChatInput({
|
|
|
3567
3567
|
dragListenerTarget: dropZoneContainerRef,
|
|
3568
3568
|
className: cn("w-full", className),
|
|
3569
3569
|
children: [
|
|
3570
|
-
/* @__PURE__ */
|
|
3571
|
-
/* @__PURE__ */
|
|
3572
|
-
children: /* @__PURE__ */
|
|
3570
|
+
/* @__PURE__ */ jsx_runtime36.jsx(AttachmentHeader, {}),
|
|
3571
|
+
/* @__PURE__ */ jsx_runtime36.jsx(PromptInputBody, {
|
|
3572
|
+
children: /* @__PURE__ */ jsx_runtime36.jsx(PromptInputTextarea, {
|
|
3573
3573
|
placeholder: placeholder || "Type your message... (Enter to send, Shift+Enter for new line)",
|
|
3574
3574
|
disabled
|
|
3575
|
-
}
|
|
3576
|
-
}
|
|
3577
|
-
/* @__PURE__ */
|
|
3575
|
+
})
|
|
3576
|
+
}),
|
|
3577
|
+
/* @__PURE__ */ jsx_runtime36.jsxs(PromptInputFooter, {
|
|
3578
3578
|
children: [
|
|
3579
|
-
/* @__PURE__ */
|
|
3579
|
+
/* @__PURE__ */ jsx_runtime36.jsxs(PromptInputTools, {
|
|
3580
3580
|
children: [
|
|
3581
|
-
showAttachments && /* @__PURE__ */
|
|
3581
|
+
showAttachments && /* @__PURE__ */ jsx_runtime36.jsxs(PromptInputActionMenu, {
|
|
3582
3582
|
children: [
|
|
3583
|
-
/* @__PURE__ */
|
|
3584
|
-
/* @__PURE__ */
|
|
3585
|
-
children: /* @__PURE__ */
|
|
3583
|
+
/* @__PURE__ */ jsx_runtime36.jsx(PromptInputActionMenuTrigger, {}),
|
|
3584
|
+
/* @__PURE__ */ jsx_runtime36.jsx(PromptInputActionMenuContent, {
|
|
3585
|
+
children: /* @__PURE__ */ jsx_runtime36.jsx(PromptInputActionAddAttachments, {
|
|
3586
3586
|
label: "Add files"
|
|
3587
|
-
}
|
|
3588
|
-
}
|
|
3587
|
+
})
|
|
3588
|
+
})
|
|
3589
3589
|
]
|
|
3590
|
-
}
|
|
3591
|
-
audioEnabled && (audioMode === "transcribe" && resolvedAudio?.endpoint ? /* @__PURE__ */
|
|
3590
|
+
}),
|
|
3591
|
+
audioEnabled && (audioMode === "transcribe" && resolvedAudio?.endpoint ? /* @__PURE__ */ jsx_runtime36.jsx(TranscribeAudioRecorder, {
|
|
3592
3592
|
endpoint: resolvedAudio.endpoint,
|
|
3593
3593
|
headers: resolvedAudio.headers,
|
|
3594
3594
|
disabled,
|
|
3595
3595
|
parseResponse: resolvedAudio.parseResponse,
|
|
3596
3596
|
onRequestPermission: resolvedAudio.requestPermission,
|
|
3597
3597
|
labels: resolvedAudio.labels
|
|
3598
|
-
}
|
|
3598
|
+
}) : /* @__PURE__ */ jsx_runtime36.jsx(AudioRecorder, {
|
|
3599
3599
|
onRecordingComplete: handleAudioRecording,
|
|
3600
3600
|
disabled,
|
|
3601
3601
|
onRequestPermission: resolvedAudio?.requestPermission,
|
|
3602
3602
|
labels: resolvedAudio?.labels
|
|
3603
|
-
}
|
|
3603
|
+
})),
|
|
3604
3604
|
extraTools
|
|
3605
3605
|
]
|
|
3606
|
-
}
|
|
3607
|
-
showCancelButton ? /* @__PURE__ */
|
|
3606
|
+
}),
|
|
3607
|
+
showCancelButton ? /* @__PURE__ */ jsx_runtime36.jsx(CancelButton, {
|
|
3608
3608
|
onCancel
|
|
3609
|
-
}
|
|
3609
|
+
}) : /* @__PURE__ */ jsx_runtime36.jsx(SubmitButton, {
|
|
3610
3610
|
disabled,
|
|
3611
3611
|
status: computedStatus
|
|
3612
|
-
}
|
|
3612
|
+
})
|
|
3613
3613
|
]
|
|
3614
|
-
}
|
|
3615
|
-
showAttachments && /* @__PURE__ */
|
|
3614
|
+
}),
|
|
3615
|
+
showAttachments && /* @__PURE__ */ jsx_runtime36.jsx(PromptInputDropZone, {
|
|
3616
3616
|
...dropZoneProps,
|
|
3617
3617
|
container: dropZoneContainerRef
|
|
3618
|
-
}
|
|
3618
|
+
})
|
|
3619
3619
|
]
|
|
3620
|
-
}
|
|
3621
|
-
}
|
|
3620
|
+
})
|
|
3621
|
+
});
|
|
3622
3622
|
}
|
|
3623
3623
|
// src/ui/composed/agno-chat/agno-chat.tsx
|
|
3624
3624
|
var import_react16 = require("react");
|
|
@@ -3636,7 +3636,7 @@ function useAgnoChatContext() {
|
|
|
3636
3636
|
}
|
|
3637
3637
|
|
|
3638
3638
|
// src/ui/composed/agno-chat/agno-chat.tsx
|
|
3639
|
-
var
|
|
3639
|
+
var jsx_runtime37 = require("react/jsx-runtime");
|
|
3640
3640
|
function AgnoChatRoot({
|
|
3641
3641
|
children,
|
|
3642
3642
|
toolHandlers = {},
|
|
@@ -3721,48 +3721,48 @@ function AgnoChatRoot({
|
|
|
3721
3721
|
handleSend,
|
|
3722
3722
|
toolResultRenderers
|
|
3723
3723
|
]);
|
|
3724
|
-
return /* @__PURE__ */
|
|
3724
|
+
return /* @__PURE__ */ jsx_runtime37.jsx(AgnoChatContext.Provider, {
|
|
3725
3725
|
value: contextValue,
|
|
3726
|
-
children: /* @__PURE__ */
|
|
3726
|
+
children: /* @__PURE__ */ jsx_runtime37.jsx("div", {
|
|
3727
3727
|
ref: containerRef,
|
|
3728
3728
|
className: cn("relative h-full flex flex-col", className),
|
|
3729
3729
|
...divProps,
|
|
3730
3730
|
children
|
|
3731
|
-
}
|
|
3732
|
-
}
|
|
3731
|
+
})
|
|
3732
|
+
});
|
|
3733
3733
|
}
|
|
3734
3734
|
|
|
3735
3735
|
// src/ui/composed/agno-chat/messages.tsx
|
|
3736
3736
|
var import_react17 = require("react");
|
|
3737
3737
|
|
|
3738
3738
|
// src/ui/composed/agno-chat/suggested-prompts.tsx
|
|
3739
|
-
var
|
|
3739
|
+
var jsx_runtime38 = require("react/jsx-runtime");
|
|
3740
3740
|
function AgnoChatSuggestedPrompts({ className, prompts }) {
|
|
3741
3741
|
const { handleSend } = useAgnoChatContext();
|
|
3742
3742
|
if (prompts.length === 0)
|
|
3743
3743
|
return null;
|
|
3744
|
-
return /* @__PURE__ */
|
|
3744
|
+
return /* @__PURE__ */ jsx_runtime38.jsx("div", {
|
|
3745
3745
|
className: cn("grid grid-cols-2 gap-2 w-full max-w-md", className),
|
|
3746
|
-
children: prompts.map((prompt, idx) => /* @__PURE__ */
|
|
3746
|
+
children: prompts.map((prompt, idx) => /* @__PURE__ */ jsx_runtime38.jsxs("button", {
|
|
3747
3747
|
onClick: () => handleSend(prompt.text),
|
|
3748
3748
|
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",
|
|
3749
3749
|
children: [
|
|
3750
|
-
prompt.icon && /* @__PURE__ */
|
|
3750
|
+
prompt.icon && /* @__PURE__ */ jsx_runtime38.jsx("span", {
|
|
3751
3751
|
className: "text-muted-foreground group-hover:text-primary transition-colors",
|
|
3752
3752
|
children: prompt.icon
|
|
3753
|
-
}
|
|
3754
|
-
/* @__PURE__ */
|
|
3753
|
+
}),
|
|
3754
|
+
/* @__PURE__ */ jsx_runtime38.jsx("span", {
|
|
3755
3755
|
className: "text-muted-foreground group-hover:text-foreground transition-colors text-xs leading-snug",
|
|
3756
3756
|
children: prompt.text
|
|
3757
|
-
}
|
|
3757
|
+
})
|
|
3758
3758
|
]
|
|
3759
|
-
}, idx
|
|
3760
|
-
}
|
|
3759
|
+
}, idx))
|
|
3760
|
+
});
|
|
3761
3761
|
}
|
|
3762
3762
|
|
|
3763
3763
|
// src/ui/composed/agno-chat/messages.tsx
|
|
3764
3764
|
var import_lucide_react21 = require("lucide-react");
|
|
3765
|
-
var
|
|
3765
|
+
var jsx_runtime39 = require("react/jsx-runtime");
|
|
3766
3766
|
function ScrollOnNewUserMessage({ messageCount }) {
|
|
3767
3767
|
const { scrollToBottom } = import_use_stick_to_bottom2.useStickToBottomContext();
|
|
3768
3768
|
const prevCount = import_react17.useRef(messageCount);
|
|
@@ -3828,92 +3828,92 @@ function AgnoChatMessages({
|
|
|
3828
3828
|
...messageClassNames !== undefined && { classNames: messageClassNames },
|
|
3829
3829
|
...toolResultRenderers !== undefined && { toolResultRenderers }
|
|
3830
3830
|
};
|
|
3831
|
-
const resolvedEmptyState = children ?? emptyState ?? /* @__PURE__ */
|
|
3831
|
+
const resolvedEmptyState = children ?? emptyState ?? /* @__PURE__ */ jsx_runtime39.jsxs("div", {
|
|
3832
3832
|
className: "flex flex-col items-center gap-6",
|
|
3833
3833
|
children: [
|
|
3834
|
-
/* @__PURE__ */
|
|
3834
|
+
/* @__PURE__ */ jsx_runtime39.jsxs("div", {
|
|
3835
3835
|
className: "relative",
|
|
3836
3836
|
children: [
|
|
3837
|
-
/* @__PURE__ */
|
|
3837
|
+
/* @__PURE__ */ jsx_runtime39.jsx("div", {
|
|
3838
3838
|
className: "h-16 w-16 rounded-2xl bg-primary/10 flex items-center justify-center",
|
|
3839
|
-
children: /* @__PURE__ */
|
|
3839
|
+
children: /* @__PURE__ */ jsx_runtime39.jsx(import_lucide_react21.Bot, {
|
|
3840
3840
|
className: "h-8 w-8 text-primary"
|
|
3841
|
-
}
|
|
3842
|
-
}
|
|
3843
|
-
/* @__PURE__ */
|
|
3841
|
+
})
|
|
3842
|
+
}),
|
|
3843
|
+
/* @__PURE__ */ jsx_runtime39.jsx("div", {
|
|
3844
3844
|
className: "absolute -bottom-1 -right-1 h-5 w-5 rounded-full bg-green-500 border-2 border-background flex items-center justify-center",
|
|
3845
|
-
children: /* @__PURE__ */
|
|
3845
|
+
children: /* @__PURE__ */ jsx_runtime39.jsx("span", {
|
|
3846
3846
|
className: "h-2 w-2 rounded-full bg-white animate-pulse"
|
|
3847
|
-
}
|
|
3848
|
-
}
|
|
3847
|
+
})
|
|
3848
|
+
})
|
|
3849
3849
|
]
|
|
3850
|
-
}
|
|
3851
|
-
/* @__PURE__ */
|
|
3850
|
+
}),
|
|
3851
|
+
/* @__PURE__ */ jsx_runtime39.jsxs("div", {
|
|
3852
3852
|
className: "space-y-2 text-center",
|
|
3853
3853
|
children: [
|
|
3854
|
-
/* @__PURE__ */
|
|
3854
|
+
/* @__PURE__ */ jsx_runtime39.jsx("h3", {
|
|
3855
3855
|
className: "text-xl font-semibold tracking-tight",
|
|
3856
3856
|
children: "Welcome to Agno Chat"
|
|
3857
|
-
}
|
|
3858
|
-
/* @__PURE__ */
|
|
3857
|
+
}),
|
|
3858
|
+
/* @__PURE__ */ jsx_runtime39.jsx("p", {
|
|
3859
3859
|
className: "text-muted-foreground text-sm max-w-sm",
|
|
3860
3860
|
children: "Start a conversation with your AI agent. Ask questions, explore ideas, or run tools."
|
|
3861
|
-
}
|
|
3861
|
+
})
|
|
3862
3862
|
]
|
|
3863
|
-
}
|
|
3864
|
-
suggestedPrompts.length > 0 && /* @__PURE__ */
|
|
3863
|
+
}),
|
|
3864
|
+
suggestedPrompts.length > 0 && /* @__PURE__ */ jsx_runtime39.jsx(AgnoChatSuggestedPrompts, {
|
|
3865
3865
|
prompts: suggestedPrompts
|
|
3866
|
-
}
|
|
3866
|
+
})
|
|
3867
3867
|
]
|
|
3868
|
-
}
|
|
3869
|
-
return /* @__PURE__ */
|
|
3868
|
+
});
|
|
3869
|
+
return /* @__PURE__ */ jsx_runtime39.jsxs(Conversation, {
|
|
3870
3870
|
className: cn("relative flex-1 w-full", className),
|
|
3871
3871
|
children: [
|
|
3872
|
-
/* @__PURE__ */
|
|
3872
|
+
/* @__PURE__ */ jsx_runtime39.jsx(ScrollOnNewUserMessage, {
|
|
3873
3873
|
messageCount: messages.length
|
|
3874
|
-
}
|
|
3875
|
-
/* @__PURE__ */
|
|
3874
|
+
}),
|
|
3875
|
+
/* @__PURE__ */ jsx_runtime39.jsxs(ConversationContent, {
|
|
3876
3876
|
className: "max-w-3xl mx-auto",
|
|
3877
3877
|
children: [
|
|
3878
|
-
messages.length === 0 ? /* @__PURE__ */
|
|
3878
|
+
messages.length === 0 ? /* @__PURE__ */ jsx_runtime39.jsx(ConversationEmptyState, {
|
|
3879
3879
|
children: resolvedEmptyState
|
|
3880
|
-
}
|
|
3880
|
+
}) : messages.map((message, index) => {
|
|
3881
3881
|
if (isThinking && index === messages.length - 1 && message === lastMessage)
|
|
3882
3882
|
return null;
|
|
3883
|
-
return renderMessage ? renderMessage(message, index) : /* @__PURE__ */
|
|
3883
|
+
return renderMessage ? renderMessage(message, index) : /* @__PURE__ */ jsx_runtime39.jsx(AgnoMessageItem, {
|
|
3884
3884
|
message,
|
|
3885
3885
|
avatars,
|
|
3886
3886
|
actions,
|
|
3887
3887
|
isLastAssistantMessage: index === lastAssistantIndex,
|
|
3888
3888
|
...messageItemProps
|
|
3889
|
-
}, `msg-${index}-${message.created_at}
|
|
3889
|
+
}, `msg-${index}-${message.created_at}`);
|
|
3890
3890
|
}),
|
|
3891
|
-
isThinking && /* @__PURE__ */
|
|
3891
|
+
isThinking && /* @__PURE__ */ jsx_runtime39.jsx("div", {
|
|
3892
3892
|
className: "py-2",
|
|
3893
|
-
children: renderThinkingIndicator ?? /* @__PURE__ */
|
|
3893
|
+
children: renderThinkingIndicator ?? /* @__PURE__ */ jsx_runtime39.jsx(StreamingIndicator, {
|
|
3894
3894
|
avatar: avatars?.assistant
|
|
3895
|
-
}
|
|
3896
|
-
}
|
|
3895
|
+
})
|
|
3896
|
+
})
|
|
3897
3897
|
]
|
|
3898
|
-
}
|
|
3899
|
-
/* @__PURE__ */
|
|
3898
|
+
}),
|
|
3899
|
+
/* @__PURE__ */ jsx_runtime39.jsx(ConversationScrollButton, {})
|
|
3900
3900
|
]
|
|
3901
|
-
}
|
|
3901
|
+
});
|
|
3902
3902
|
}
|
|
3903
3903
|
|
|
3904
3904
|
// src/ui/composed/agno-chat/empty-state.tsx
|
|
3905
|
-
var
|
|
3905
|
+
var jsx_runtime40 = require("react/jsx-runtime");
|
|
3906
3906
|
function AgnoChatEmptyState({ children, className, ...props }) {
|
|
3907
|
-
return /* @__PURE__ */
|
|
3907
|
+
return /* @__PURE__ */ jsx_runtime40.jsx("div", {
|
|
3908
3908
|
className: cn("flex flex-col items-center gap-6", className),
|
|
3909
3909
|
...props,
|
|
3910
3910
|
children
|
|
3911
|
-
}
|
|
3911
|
+
});
|
|
3912
3912
|
}
|
|
3913
3913
|
|
|
3914
3914
|
// src/ui/composed/agno-chat/error-bar.tsx
|
|
3915
3915
|
var import_react18 = require("react");
|
|
3916
|
-
var
|
|
3916
|
+
var jsx_runtime41 = require("react/jsx-runtime");
|
|
3917
3917
|
function AgnoChatErrorBar({
|
|
3918
3918
|
className,
|
|
3919
3919
|
text,
|
|
@@ -3953,23 +3953,23 @@ function AgnoChatErrorBar({
|
|
|
3953
3953
|
if (children) {
|
|
3954
3954
|
return typeof children === "function" ? children(rawMessage) : children;
|
|
3955
3955
|
}
|
|
3956
|
-
return /* @__PURE__ */
|
|
3956
|
+
return /* @__PURE__ */ jsx_runtime41.jsxs("div", {
|
|
3957
3957
|
className: "flex items-center gap-2 max-w-3xl mx-auto",
|
|
3958
3958
|
children: [
|
|
3959
|
-
icon && /* @__PURE__ */
|
|
3959
|
+
icon && /* @__PURE__ */ jsx_runtime41.jsx("span", {
|
|
3960
3960
|
className: "shrink-0",
|
|
3961
3961
|
children: icon
|
|
3962
|
-
}
|
|
3963
|
-
/* @__PURE__ */
|
|
3962
|
+
}),
|
|
3963
|
+
/* @__PURE__ */ jsx_runtime41.jsx("p", {
|
|
3964
3964
|
className: "text-sm text-destructive flex-1",
|
|
3965
3965
|
children: displayMessage
|
|
3966
|
-
}
|
|
3967
|
-
dismissible && /* @__PURE__ */
|
|
3966
|
+
}),
|
|
3967
|
+
dismissible && /* @__PURE__ */ jsx_runtime41.jsx("button", {
|
|
3968
3968
|
type: "button",
|
|
3969
3969
|
onClick: () => setHidden(true),
|
|
3970
3970
|
className: "shrink-0 text-destructive/60 hover:text-destructive transition-colors",
|
|
3971
3971
|
"aria-label": "Dismiss error",
|
|
3972
|
-
children: /* @__PURE__ */
|
|
3972
|
+
children: /* @__PURE__ */ jsx_runtime41.jsxs("svg", {
|
|
3973
3973
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3974
3974
|
width: "16",
|
|
3975
3975
|
height: "16",
|
|
@@ -3980,26 +3980,26 @@ function AgnoChatErrorBar({
|
|
|
3980
3980
|
strokeLinecap: "round",
|
|
3981
3981
|
strokeLinejoin: "round",
|
|
3982
3982
|
children: [
|
|
3983
|
-
/* @__PURE__ */
|
|
3983
|
+
/* @__PURE__ */ jsx_runtime41.jsx("path", {
|
|
3984
3984
|
d: "M18 6 6 18"
|
|
3985
|
-
}
|
|
3986
|
-
/* @__PURE__ */
|
|
3985
|
+
}),
|
|
3986
|
+
/* @__PURE__ */ jsx_runtime41.jsx("path", {
|
|
3987
3987
|
d: "m6 6 12 12"
|
|
3988
|
-
}
|
|
3988
|
+
})
|
|
3989
3989
|
]
|
|
3990
|
-
}
|
|
3991
|
-
}
|
|
3990
|
+
})
|
|
3991
|
+
})
|
|
3992
3992
|
]
|
|
3993
|
-
}
|
|
3993
|
+
});
|
|
3994
3994
|
};
|
|
3995
|
-
return /* @__PURE__ */
|
|
3995
|
+
return /* @__PURE__ */ jsx_runtime41.jsx("div", {
|
|
3996
3996
|
className: cn("px-4 py-2.5 bg-destructive/5 border-t border-destructive/20", className),
|
|
3997
3997
|
children: renderContent()
|
|
3998
|
-
}
|
|
3998
|
+
});
|
|
3999
3999
|
}
|
|
4000
4000
|
|
|
4001
4001
|
// src/ui/composed/agno-chat/input.tsx
|
|
4002
|
-
var
|
|
4002
|
+
var jsx_runtime42 = require("react/jsx-runtime");
|
|
4003
4003
|
function AgnoChatInputArea({
|
|
4004
4004
|
className,
|
|
4005
4005
|
children,
|
|
@@ -4012,11 +4012,11 @@ function AgnoChatInputArea({
|
|
|
4012
4012
|
dropZoneProps
|
|
4013
4013
|
}) {
|
|
4014
4014
|
const { handleSend, inputDisabled, isStreaming, isPaused, cancelRun, dropZoneContainerRef } = useAgnoChatContext();
|
|
4015
|
-
return /* @__PURE__ */
|
|
4015
|
+
return /* @__PURE__ */ jsx_runtime42.jsx("div", {
|
|
4016
4016
|
className: cn("border-t border-border bg-background/80 backdrop-blur-sm", className),
|
|
4017
|
-
children: /* @__PURE__ */
|
|
4017
|
+
children: /* @__PURE__ */ jsx_runtime42.jsx("div", {
|
|
4018
4018
|
className: "mx-auto px-4 py-2",
|
|
4019
|
-
children: children ? children({ onSend: handleSend, disabled: inputDisabled, isStreaming, isPaused }) : /* @__PURE__ */
|
|
4019
|
+
children: children ? children({ onSend: handleSend, disabled: inputDisabled, isStreaming, isPaused }) : /* @__PURE__ */ jsx_runtime42.jsx(AgnoChatInput, {
|
|
4020
4020
|
onSend: handleSend,
|
|
4021
4021
|
disabled: inputDisabled,
|
|
4022
4022
|
isStreaming,
|
|
@@ -4029,9 +4029,9 @@ function AgnoChatInputArea({
|
|
|
4029
4029
|
extraTools,
|
|
4030
4030
|
dropZoneContainerRef,
|
|
4031
4031
|
dropZoneProps
|
|
4032
|
-
}
|
|
4033
|
-
}
|
|
4034
|
-
}
|
|
4032
|
+
})
|
|
4033
|
+
})
|
|
4034
|
+
});
|
|
4035
4035
|
}
|
|
4036
4036
|
|
|
4037
4037
|
// src/ui/composed/agno-chat/index.ts
|
|
@@ -4043,4 +4043,4 @@ var AgnoChat = Object.assign(AgnoChatRoot, {
|
|
|
4043
4043
|
Input: AgnoChatInputArea
|
|
4044
4044
|
});
|
|
4045
4045
|
|
|
4046
|
-
//# debugId=
|
|
4046
|
+
//# debugId=7D6444DACC443C3D64756E2164756E21
|