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