@krak-stack/registry 0.1.27 → 0.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/code-block.js +1 -5
- package/dist/components/ui/copy-button.js +1 -5
- package/dist/components/ui/data-table.js +239 -242
- package/dist/components/ui/editing-locale-switcher.js +1 -5
- package/dist/components/ui/effect-form.js +170 -175
- package/dist/components/ui/error-component.d.ts +30 -0
- package/dist/components/ui/error-component.js +811 -0
- package/dist/components/ui/file-picker.js +1 -5
- package/dist/components/ui/form.js +113 -118
- package/dist/components/ui/google-map.js +1 -5
- package/dist/components/ui/icon-input.js +41 -48
- package/dist/components/ui/loading.js +1 -5
- package/dist/components/ui/locale-switcher.js +1 -5
- package/dist/components/ui/pagination.js +3 -7
- package/dist/components/ui/search-menu.js +1 -5
- package/dist/components/ui/sidebar-layout.js +67 -76
- package/dist/components/ui/stats-card.js +1 -5
- package/dist/components/ui/theme-switcher.js +4 -8
- package/dist/components/ui/virtualized-combobox.js +32 -39
- package/dist/lib/docs.js +134 -143
- package/dist/lib/docs.server.js +24 -49
- package/dist/lib/documentation-toolkit.js +25 -50
- package/dist/lib/httpapi-cli.js +7 -7
- package/dist/lib/httpapi-client.js +3 -3
- package/dist/lib/httpapi-helpers.js +11 -11
- package/dist/lib/httpapi-mcp.js +2 -2
- package/dist/lib/httpapi-toolkit.js +2 -2
- package/dist/lib/query.d.ts +16 -6
- package/dist/lib/query.js +17 -8
- package/dist/lib/seo.js +2 -2
- package/dist/lib/utils.d.ts +1 -2
- package/dist/lib/webfetch-toolkit.js +6 -6
- package/dist/services/agent/client/index.js +130 -133
- package/dist/services/agent/index.d.ts +4 -0
- package/dist/services/agent/index.js +1 -1
- package/dist/services/agent/schema.d.ts +6 -0
- package/dist/services/agent/schema.js +6 -5
- package/dist/services/file-extraction/index.js +4 -4
- package/dist/services/file-extraction/schema.js +2 -2
- package/dist/services/health/index.js +9 -9
- package/dist/services/notification/channels/ses/index.js +2 -2
- package/dist/services/notification/channels/ses/schema.js +2 -2
- package/dist/services/notification/client/index.js +6 -10
- package/dist/services/notification/index.js +2 -2
- package/dist/services/notification/persistence/drizzle.js +2 -2
- package/dist/services/notification/persistence/index.js +15 -15
- package/dist/services/notification/persistence/schema.js +12 -12
- package/dist/services/notification/public.js +8 -12
- package/dist/services/notification/schema.js +2 -2
- package/dist/services/s3/index.js +2 -2
- package/dist/services/s3/schema.js +2 -2
- package/package.json +7 -4
|
@@ -71,6 +71,7 @@ var reduceAgentEvent = (state, event) => {
|
|
|
71
71
|
return { ...state, history: event.value };
|
|
72
72
|
case "error":
|
|
73
73
|
return failAgentState(state, event.code);
|
|
74
|
+
case "heartbeat":
|
|
74
75
|
case "finish":
|
|
75
76
|
return state;
|
|
76
77
|
}
|
|
@@ -164,11 +165,7 @@ import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
|
164
165
|
import { cva } from "class-variance-authority";
|
|
165
166
|
|
|
166
167
|
// ../../src/lib/utils.ts
|
|
167
|
-
import {
|
|
168
|
-
import { twMerge } from "tailwind-merge";
|
|
169
|
-
function cn(...inputs) {
|
|
170
|
-
return twMerge(clsx(inputs));
|
|
171
|
-
}
|
|
168
|
+
import { cn } from "cn";
|
|
172
169
|
|
|
173
170
|
// ../../src/components/ui/button.tsx
|
|
174
171
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -780,12 +777,11 @@ import { cva as cva6 } from "class-variance-authority";
|
|
|
780
777
|
|
|
781
778
|
// ../../src/components/ui/input.tsx
|
|
782
779
|
import { Input as InputPrimitive } from "@base-ui/react/input";
|
|
783
|
-
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
784
780
|
|
|
785
781
|
// ../../src/components/ui/textarea.tsx
|
|
786
|
-
import { jsx as
|
|
782
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
787
783
|
function Textarea({ className, ...props }) {
|
|
788
|
-
return /* @__PURE__ */
|
|
784
|
+
return /* @__PURE__ */ jsx12("textarea", {
|
|
789
785
|
"data-slot": "textarea",
|
|
790
786
|
className: cn("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className),
|
|
791
787
|
...props
|
|
@@ -793,9 +789,9 @@ function Textarea({ className, ...props }) {
|
|
|
793
789
|
}
|
|
794
790
|
|
|
795
791
|
// ../../src/components/ui/input-group.tsx
|
|
796
|
-
import { jsx as
|
|
792
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
797
793
|
function InputGroup({ className, ...props }) {
|
|
798
|
-
return /* @__PURE__ */
|
|
794
|
+
return /* @__PURE__ */ jsx13("div", {
|
|
799
795
|
"data-slot": "input-group",
|
|
800
796
|
role: "group",
|
|
801
797
|
className: cn("group/input-group relative flex h-9 w-full min-w-0 items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5", className),
|
|
@@ -818,7 +814,7 @@ function InputGroupAddon({
|
|
|
818
814
|
align = "inline-start",
|
|
819
815
|
...props
|
|
820
816
|
}) {
|
|
821
|
-
return /* @__PURE__ */
|
|
817
|
+
return /* @__PURE__ */ jsx13("div", {
|
|
822
818
|
role: "group",
|
|
823
819
|
"data-slot": "input-group-addon",
|
|
824
820
|
"data-align": align,
|
|
@@ -850,7 +846,7 @@ function InputGroupButton({
|
|
|
850
846
|
size = "xs",
|
|
851
847
|
...props
|
|
852
848
|
}) {
|
|
853
|
-
return /* @__PURE__ */
|
|
849
|
+
return /* @__PURE__ */ jsx13(Button, {
|
|
854
850
|
type,
|
|
855
851
|
"data-size": size,
|
|
856
852
|
variant,
|
|
@@ -862,7 +858,7 @@ function InputGroupTextarea({
|
|
|
862
858
|
className,
|
|
863
859
|
...props
|
|
864
860
|
}) {
|
|
865
|
-
return /* @__PURE__ */
|
|
861
|
+
return /* @__PURE__ */ jsx13(Textarea, {
|
|
866
862
|
"data-slot": "input-group-control",
|
|
867
863
|
className: cn("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent", className),
|
|
868
864
|
...props
|
|
@@ -873,7 +869,7 @@ function InputGroupTextarea({
|
|
|
873
869
|
import { mergeProps as mergeProps3 } from "@base-ui/react/merge-props";
|
|
874
870
|
import { useRender as useRender3 } from "@base-ui/react/use-render";
|
|
875
871
|
import { cva as cva7 } from "class-variance-authority";
|
|
876
|
-
import { jsx as
|
|
872
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
877
873
|
var markerVariants = cva7("group/marker relative flex min-h-4 w-full items-center gap-2 text-left text-sm text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [a]:underline [a]:underline-offset-3 [a]:hover:text-foreground", {
|
|
878
874
|
variants: {
|
|
879
875
|
variant: {
|
|
@@ -902,7 +898,7 @@ function Marker({
|
|
|
902
898
|
});
|
|
903
899
|
}
|
|
904
900
|
function MarkerContent({ className, ...props }) {
|
|
905
|
-
return /* @__PURE__ */
|
|
901
|
+
return /* @__PURE__ */ jsx14("span", {
|
|
906
902
|
"data-slot": "marker-content",
|
|
907
903
|
className: cn("min-w-0 wrap-break-word group-data-[variant=separator]/marker:flex-none group-data-[variant=separator]/marker:text-center *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className),
|
|
908
904
|
...props
|
|
@@ -910,13 +906,13 @@ function MarkerContent({ className, ...props }) {
|
|
|
910
906
|
}
|
|
911
907
|
|
|
912
908
|
// ../../src/components/ui/message.tsx
|
|
913
|
-
import { jsx as
|
|
909
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
914
910
|
function Message({
|
|
915
911
|
className,
|
|
916
912
|
align = "start",
|
|
917
913
|
...props
|
|
918
914
|
}) {
|
|
919
|
-
return /* @__PURE__ */
|
|
915
|
+
return /* @__PURE__ */ jsx15("div", {
|
|
920
916
|
"data-slot": "message",
|
|
921
917
|
"data-align": align,
|
|
922
918
|
className: cn("group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse", className),
|
|
@@ -924,7 +920,7 @@ function Message({
|
|
|
924
920
|
});
|
|
925
921
|
}
|
|
926
922
|
function MessageContent({ className, ...props }) {
|
|
927
|
-
return /* @__PURE__ */
|
|
923
|
+
return /* @__PURE__ */ jsx15("div", {
|
|
928
924
|
"data-slot": "message-content",
|
|
929
925
|
className: cn("flex w-full min-w-0 flex-col gap-2.5 wrap-break-word group-data-[align=end]/message:*:data-slot:self-end", className),
|
|
930
926
|
...props
|
|
@@ -939,9 +935,9 @@ import {
|
|
|
939
935
|
useMessageScrollerVisibility
|
|
940
936
|
} from "@shadcn/react/message-scroller";
|
|
941
937
|
import { ArrowDownIcon } from "lucide-react";
|
|
942
|
-
import { jsx as
|
|
938
|
+
import { jsx as jsx16, jsxs as jsxs5, Fragment } from "react/jsx-runtime";
|
|
943
939
|
function MessageScrollerProvider(props) {
|
|
944
|
-
return /* @__PURE__ */
|
|
940
|
+
return /* @__PURE__ */ jsx16(MessageScrollerPrimitive.Provider, {
|
|
945
941
|
...props
|
|
946
942
|
});
|
|
947
943
|
}
|
|
@@ -949,7 +945,7 @@ function MessageScroller({
|
|
|
949
945
|
className,
|
|
950
946
|
...props
|
|
951
947
|
}) {
|
|
952
|
-
return /* @__PURE__ */
|
|
948
|
+
return /* @__PURE__ */ jsx16(MessageScrollerPrimitive.Root, {
|
|
953
949
|
"data-slot": "message-scroller",
|
|
954
950
|
className: cn("group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden", className),
|
|
955
951
|
...props
|
|
@@ -959,7 +955,7 @@ function MessageScrollerViewport({
|
|
|
959
955
|
className,
|
|
960
956
|
...props
|
|
961
957
|
}) {
|
|
962
|
-
return /* @__PURE__ */
|
|
958
|
+
return /* @__PURE__ */ jsx16(MessageScrollerPrimitive.Viewport, {
|
|
963
959
|
"data-slot": "message-scroller-viewport",
|
|
964
960
|
className: cn("size-full min-h-0 min-w-0 scroll-fade-b scrollbar-thin scrollbar-gutter-stable overflow-y-auto overscroll-contain contain-content data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent", className),
|
|
965
961
|
...props
|
|
@@ -969,7 +965,7 @@ function MessageScrollerContent({
|
|
|
969
965
|
className,
|
|
970
966
|
...props
|
|
971
967
|
}) {
|
|
972
|
-
return /* @__PURE__ */
|
|
968
|
+
return /* @__PURE__ */ jsx16(MessageScrollerPrimitive.Content, {
|
|
973
969
|
"data-slot": "message-scroller-content",
|
|
974
970
|
className: cn("flex h-max min-h-full flex-col gap-8", className),
|
|
975
971
|
...props
|
|
@@ -980,7 +976,7 @@ function MessageScrollerItem({
|
|
|
980
976
|
scrollAnchor = false,
|
|
981
977
|
...props
|
|
982
978
|
}) {
|
|
983
|
-
return /* @__PURE__ */
|
|
979
|
+
return /* @__PURE__ */ jsx16(MessageScrollerPrimitive.Item, {
|
|
984
980
|
"data-slot": "message-scroller-item",
|
|
985
981
|
scrollAnchor,
|
|
986
982
|
className: cn("min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]", className),
|
|
@@ -996,22 +992,22 @@ function MessageScrollerButton({
|
|
|
996
992
|
size = "icon-sm",
|
|
997
993
|
...props
|
|
998
994
|
}) {
|
|
999
|
-
return /* @__PURE__ */
|
|
995
|
+
return /* @__PURE__ */ jsx16(MessageScrollerPrimitive.Button, {
|
|
1000
996
|
"data-slot": "message-scroller-button",
|
|
1001
997
|
"data-direction": direction,
|
|
1002
998
|
"data-variant": variant,
|
|
1003
999
|
"data-size": size,
|
|
1004
1000
|
direction,
|
|
1005
1001
|
className: cn("absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180", className),
|
|
1006
|
-
render: render ?? /* @__PURE__ */
|
|
1002
|
+
render: render ?? /* @__PURE__ */ jsx16(Button, {
|
|
1007
1003
|
variant,
|
|
1008
1004
|
size
|
|
1009
1005
|
}),
|
|
1010
1006
|
...props,
|
|
1011
1007
|
children: children ?? /* @__PURE__ */ jsxs5(Fragment, {
|
|
1012
1008
|
children: [
|
|
1013
|
-
/* @__PURE__ */
|
|
1014
|
-
/* @__PURE__ */
|
|
1009
|
+
/* @__PURE__ */ jsx16(ArrowDownIcon, {}),
|
|
1010
|
+
/* @__PURE__ */ jsx16("span", {
|
|
1015
1011
|
className: "sr-only",
|
|
1016
1012
|
children: direction === "end" ? "Scroll to end" : "Scroll to start"
|
|
1017
1013
|
})
|
|
@@ -1022,15 +1018,15 @@ function MessageScrollerButton({
|
|
|
1022
1018
|
|
|
1023
1019
|
// ../../src/components/ui/popover.tsx
|
|
1024
1020
|
import { Popover as PopoverPrimitive } from "@base-ui/react/popover";
|
|
1025
|
-
import { jsx as
|
|
1021
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1026
1022
|
function Popover({ ...props }) {
|
|
1027
|
-
return /* @__PURE__ */
|
|
1023
|
+
return /* @__PURE__ */ jsx17(PopoverPrimitive.Root, {
|
|
1028
1024
|
"data-slot": "popover",
|
|
1029
1025
|
...props
|
|
1030
1026
|
});
|
|
1031
1027
|
}
|
|
1032
1028
|
function PopoverTrigger({ ...props }) {
|
|
1033
|
-
return /* @__PURE__ */
|
|
1029
|
+
return /* @__PURE__ */ jsx17(PopoverPrimitive.Trigger, {
|
|
1034
1030
|
"data-slot": "popover-trigger",
|
|
1035
1031
|
...props
|
|
1036
1032
|
});
|
|
@@ -1043,14 +1039,14 @@ function PopoverContent({
|
|
|
1043
1039
|
sideOffset = 4,
|
|
1044
1040
|
...props
|
|
1045
1041
|
}) {
|
|
1046
|
-
return /* @__PURE__ */
|
|
1047
|
-
children: /* @__PURE__ */
|
|
1042
|
+
return /* @__PURE__ */ jsx17(PopoverPrimitive.Portal, {
|
|
1043
|
+
children: /* @__PURE__ */ jsx17(PopoverPrimitive.Positioner, {
|
|
1048
1044
|
align,
|
|
1049
1045
|
alignOffset,
|
|
1050
1046
|
side,
|
|
1051
1047
|
sideOffset,
|
|
1052
1048
|
className: "isolate z-50",
|
|
1053
|
-
children: /* @__PURE__ */
|
|
1049
|
+
children: /* @__PURE__ */ jsx17(PopoverPrimitive.Popup, {
|
|
1054
1050
|
"data-slot": "popover-content",
|
|
1055
1051
|
className: cn("z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-md bg-popover p-4 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
1056
1052
|
...props
|
|
@@ -1061,16 +1057,16 @@ function PopoverContent({
|
|
|
1061
1057
|
|
|
1062
1058
|
// ../../src/components/ui/tooltip.tsx
|
|
1063
1059
|
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
|
|
1064
|
-
import { jsx as
|
|
1060
|
+
import { jsx as jsx18, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1065
1061
|
"use client";
|
|
1066
1062
|
function Tooltip({ ...props }) {
|
|
1067
|
-
return /* @__PURE__ */
|
|
1063
|
+
return /* @__PURE__ */ jsx18(TooltipPrimitive.Root, {
|
|
1068
1064
|
"data-slot": "tooltip",
|
|
1069
1065
|
...props
|
|
1070
1066
|
});
|
|
1071
1067
|
}
|
|
1072
1068
|
function TooltipTrigger({ ...props }) {
|
|
1073
|
-
return /* @__PURE__ */
|
|
1069
|
+
return /* @__PURE__ */ jsx18(TooltipPrimitive.Trigger, {
|
|
1074
1070
|
"data-slot": "tooltip-trigger",
|
|
1075
1071
|
...props
|
|
1076
1072
|
});
|
|
@@ -1084,8 +1080,8 @@ function TooltipContent({
|
|
|
1084
1080
|
children,
|
|
1085
1081
|
...props
|
|
1086
1082
|
}) {
|
|
1087
|
-
return /* @__PURE__ */
|
|
1088
|
-
children: /* @__PURE__ */
|
|
1083
|
+
return /* @__PURE__ */ jsx18(TooltipPrimitive.Portal, {
|
|
1084
|
+
children: /* @__PURE__ */ jsx18(TooltipPrimitive.Positioner, {
|
|
1089
1085
|
align,
|
|
1090
1086
|
alignOffset,
|
|
1091
1087
|
side,
|
|
@@ -1097,7 +1093,7 @@ function TooltipContent({
|
|
|
1097
1093
|
...props,
|
|
1098
1094
|
children: [
|
|
1099
1095
|
children,
|
|
1100
|
-
/* @__PURE__ */
|
|
1096
|
+
/* @__PURE__ */ jsx18(TooltipPrimitive.Arrow, {
|
|
1101
1097
|
className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"
|
|
1102
1098
|
})
|
|
1103
1099
|
]
|
|
@@ -1568,6 +1564,7 @@ var AgentMarkdownCodeBlock = Schema2.Struct({
|
|
|
1568
1564
|
language: Schema2.String
|
|
1569
1565
|
}).annotate({ identifier: "AgentMarkdownCodeBlock" });
|
|
1570
1566
|
var AgentEvent = Schema2.Union([
|
|
1567
|
+
Schema2.Struct({ type: Schema2.Literal("heartbeat") }),
|
|
1571
1568
|
Schema2.Struct({
|
|
1572
1569
|
type: Schema2.Literal("message-start"),
|
|
1573
1570
|
messageId: Schema2.String
|
|
@@ -1625,7 +1622,7 @@ var AgentStreamError = Schema2.Struct({
|
|
|
1625
1622
|
});
|
|
1626
1623
|
|
|
1627
1624
|
// ../../src/services/agent/client/widget.tsx
|
|
1628
|
-
import { jsx as
|
|
1625
|
+
import { jsx as jsx19, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1629
1626
|
var messages = {
|
|
1630
1627
|
en: {
|
|
1631
1628
|
approve: "Approve",
|
|
@@ -1718,7 +1715,7 @@ var highlightedInput = (input, references) => {
|
|
|
1718
1715
|
return input;
|
|
1719
1716
|
const mentionPattern = new RegExp(`(${mentions.map(escapeRegExp).join("|")})(?![\\p{L}\\p{N}_-])`, "gu");
|
|
1720
1717
|
const mentionSet = new Set(mentions);
|
|
1721
|
-
return input.split(mentionPattern).map((part, index) => mentionSet.has(part) ? /* @__PURE__ */
|
|
1718
|
+
return input.split(mentionPattern).map((part, index) => mentionSet.has(part) ? /* @__PURE__ */ jsx19("span", {
|
|
1722
1719
|
className: "bg-primary text-primary-foreground rounded-sm [box-shadow:2px_0_0_var(--primary),-2px_0_0_var(--primary)]",
|
|
1723
1720
|
children: part
|
|
1724
1721
|
}, `${part}:${index}`) : part);
|
|
@@ -1755,14 +1752,14 @@ var ToolLabel = ({
|
|
|
1755
1752
|
return label;
|
|
1756
1753
|
return /* @__PURE__ */ jsxs7(Tooltip, {
|
|
1757
1754
|
children: [
|
|
1758
|
-
/* @__PURE__ */
|
|
1759
|
-
render: /* @__PURE__ */
|
|
1755
|
+
/* @__PURE__ */ jsx19(TooltipTrigger, {
|
|
1756
|
+
render: /* @__PURE__ */ jsx19("span", {
|
|
1760
1757
|
className: "cursor-help",
|
|
1761
1758
|
tabIndex: 0
|
|
1762
1759
|
}),
|
|
1763
1760
|
children: label
|
|
1764
1761
|
}),
|
|
1765
|
-
/* @__PURE__ */
|
|
1762
|
+
/* @__PURE__ */ jsx19(TooltipContent, {
|
|
1766
1763
|
className: "max-w-sm",
|
|
1767
1764
|
children: description
|
|
1768
1765
|
})
|
|
@@ -1781,23 +1778,23 @@ function ToolActivityCard({
|
|
|
1781
1778
|
if (!requiresApproval) {
|
|
1782
1779
|
return /* @__PURE__ */ jsxs7(Marker, {
|
|
1783
1780
|
children: [
|
|
1784
|
-
/* @__PURE__ */
|
|
1785
|
-
children: /* @__PURE__ */
|
|
1781
|
+
/* @__PURE__ */ jsx19(MarkerContent, {
|
|
1782
|
+
children: /* @__PURE__ */ jsx19("span", {
|
|
1786
1783
|
className: cn("block w-fit max-w-full", tool.status === "running" && "shimmer"),
|
|
1787
|
-
children: /* @__PURE__ */
|
|
1784
|
+
children: /* @__PURE__ */ jsx19(ToolLabel, {
|
|
1788
1785
|
description: tool.metadata.description,
|
|
1789
1786
|
label
|
|
1790
1787
|
})
|
|
1791
1788
|
})
|
|
1792
1789
|
}),
|
|
1793
|
-
tool.status === "failed" || tool.status === "denied" ? /* @__PURE__ */
|
|
1790
|
+
tool.status === "failed" || tool.status === "denied" ? /* @__PURE__ */ jsx19(Badge, {
|
|
1794
1791
|
variant: "destructive",
|
|
1795
1792
|
children: tool.status === "failed" ? labels.toolFailed : labels.toolDenied
|
|
1796
1793
|
}) : null
|
|
1797
1794
|
]
|
|
1798
1795
|
});
|
|
1799
1796
|
}
|
|
1800
|
-
return /* @__PURE__ */
|
|
1797
|
+
return /* @__PURE__ */ jsx19(Collapsible, {
|
|
1801
1798
|
className: "mx-1",
|
|
1802
1799
|
open: detailsOpen,
|
|
1803
1800
|
onOpenChange: setDetailsOpen,
|
|
@@ -1810,25 +1807,25 @@ function ToolActivityCard({
|
|
|
1810
1807
|
/* @__PURE__ */ jsxs7(CardTitle, {
|
|
1811
1808
|
className: "flex items-center gap-2",
|
|
1812
1809
|
children: [
|
|
1813
|
-
/* @__PURE__ */
|
|
1810
|
+
/* @__PURE__ */ jsx19(ToolLabel, {
|
|
1814
1811
|
description: tool.metadata.description,
|
|
1815
1812
|
label
|
|
1816
1813
|
}),
|
|
1817
|
-
tool.metadata.destructive ? /* @__PURE__ */
|
|
1814
|
+
tool.metadata.destructive ? /* @__PURE__ */ jsx19(Badge, {
|
|
1818
1815
|
variant: "destructive",
|
|
1819
1816
|
children: labels.approvalDestructiveLabel
|
|
1820
1817
|
}) : null
|
|
1821
1818
|
]
|
|
1822
1819
|
}),
|
|
1823
|
-
/* @__PURE__ */
|
|
1820
|
+
/* @__PURE__ */ jsx19(CardDescription, {
|
|
1824
1821
|
children: tool.metadata.destructive ? labels.approvalDestructive : labels.approvalRequired
|
|
1825
1822
|
})
|
|
1826
1823
|
]
|
|
1827
1824
|
}),
|
|
1828
|
-
/* @__PURE__ */
|
|
1829
|
-
children: /* @__PURE__ */
|
|
1825
|
+
/* @__PURE__ */ jsx19(CollapsibleContent, {
|
|
1826
|
+
children: /* @__PURE__ */ jsx19(CardContent, {
|
|
1830
1827
|
className: "min-w-0 overflow-hidden border-y py-3",
|
|
1831
|
-
children: /* @__PURE__ */
|
|
1828
|
+
children: /* @__PURE__ */ jsx19(CodeBlock, {
|
|
1832
1829
|
code: inputCode(tool.input),
|
|
1833
1830
|
language: "json",
|
|
1834
1831
|
messages: { copied: labels.copied, copy: labels.copy }
|
|
@@ -1838,28 +1835,28 @@ function ToolActivityCard({
|
|
|
1838
1835
|
/* @__PURE__ */ jsxs7(CardFooter, {
|
|
1839
1836
|
className: "flex flex-wrap gap-2",
|
|
1840
1837
|
children: [
|
|
1841
|
-
/* @__PURE__ */
|
|
1838
|
+
/* @__PURE__ */ jsx19(Button, {
|
|
1842
1839
|
size: "sm",
|
|
1843
1840
|
variant: tool.metadata.destructive ? "destructive" : "default",
|
|
1844
1841
|
disabled,
|
|
1845
1842
|
onClick: () => onApproval(tool, true),
|
|
1846
1843
|
children: labels.approve
|
|
1847
1844
|
}),
|
|
1848
|
-
/* @__PURE__ */
|
|
1845
|
+
/* @__PURE__ */ jsx19(Button, {
|
|
1849
1846
|
size: "sm",
|
|
1850
1847
|
variant: "outline",
|
|
1851
1848
|
disabled,
|
|
1852
1849
|
onClick: () => onApproval(tool, false),
|
|
1853
1850
|
children: labels.cancel
|
|
1854
1851
|
}),
|
|
1855
|
-
/* @__PURE__ */
|
|
1852
|
+
/* @__PURE__ */ jsx19(CollapsibleTrigger, {
|
|
1856
1853
|
render: /* @__PURE__ */ jsxs7(Button, {
|
|
1857
1854
|
variant: "ghost",
|
|
1858
1855
|
size: "sm",
|
|
1859
1856
|
className: "ml-auto",
|
|
1860
1857
|
children: [
|
|
1861
1858
|
detailsOpen ? labels.viewLess : labels.viewMore,
|
|
1862
|
-
/* @__PURE__ */
|
|
1859
|
+
/* @__PURE__ */ jsx19(ChevronDownIcon, {
|
|
1863
1860
|
"data-icon": "inline-end",
|
|
1864
1861
|
className: cn("transition-transform", detailsOpen && "rotate-180")
|
|
1865
1862
|
})
|
|
@@ -1883,9 +1880,9 @@ function ToolActivityLog({
|
|
|
1883
1880
|
const [logOpen, setLogOpen] = useState2(false);
|
|
1884
1881
|
const currentTool = tools.at(-1);
|
|
1885
1882
|
if (!currentTool) {
|
|
1886
|
-
return /* @__PURE__ */
|
|
1887
|
-
children: /* @__PURE__ */
|
|
1888
|
-
children: /* @__PURE__ */
|
|
1883
|
+
return /* @__PURE__ */ jsx19(Marker, {
|
|
1884
|
+
children: /* @__PURE__ */ jsx19(MarkerContent, {
|
|
1885
|
+
children: /* @__PURE__ */ jsx19("span", {
|
|
1889
1886
|
className: "shimmer block w-fit max-w-full",
|
|
1890
1887
|
children: labels.toolRunning
|
|
1891
1888
|
})
|
|
@@ -1905,22 +1902,22 @@ function ToolActivityLog({
|
|
|
1905
1902
|
onOpenChange: setLogOpen,
|
|
1906
1903
|
children: [
|
|
1907
1904
|
/* @__PURE__ */ jsxs7(CollapsibleTrigger, {
|
|
1908
|
-
render: /* @__PURE__ */
|
|
1905
|
+
render: /* @__PURE__ */ jsx19(Button, {
|
|
1909
1906
|
variant: "ghost",
|
|
1910
1907
|
size: "sm",
|
|
1911
1908
|
className: "ml-auto"
|
|
1912
1909
|
}),
|
|
1913
1910
|
children: [
|
|
1914
1911
|
logOpen ? labels.viewLess : labels.viewMore,
|
|
1915
|
-
/* @__PURE__ */
|
|
1912
|
+
/* @__PURE__ */ jsx19(ChevronDownIcon, {
|
|
1916
1913
|
"data-icon": "inline-end",
|
|
1917
1914
|
className: cn("transition-transform", logOpen && "rotate-180")
|
|
1918
1915
|
})
|
|
1919
1916
|
]
|
|
1920
1917
|
}),
|
|
1921
|
-
/* @__PURE__ */
|
|
1918
|
+
/* @__PURE__ */ jsx19(CollapsibleContent, {
|
|
1922
1919
|
className: "mt-2 ml-2 flex flex-col gap-2 border-l pl-3",
|
|
1923
|
-
children: loggedTools.map((tool) => /* @__PURE__ */
|
|
1920
|
+
children: loggedTools.map((tool) => /* @__PURE__ */ jsx19(ToolActivityCard, {
|
|
1924
1921
|
disabled,
|
|
1925
1922
|
labels,
|
|
1926
1923
|
onApproval,
|
|
@@ -1929,7 +1926,7 @@ function ToolActivityLog({
|
|
|
1929
1926
|
})
|
|
1930
1927
|
]
|
|
1931
1928
|
}) : null,
|
|
1932
|
-
/* @__PURE__ */
|
|
1929
|
+
/* @__PURE__ */ jsx19(ToolActivityCard, {
|
|
1933
1930
|
disabled,
|
|
1934
1931
|
labels,
|
|
1935
1932
|
onApproval,
|
|
@@ -1943,28 +1940,28 @@ function ToolActivityLog({
|
|
|
1943
1940
|
onOpenChange: setLogOpen,
|
|
1944
1941
|
children: [
|
|
1945
1942
|
/* @__PURE__ */ jsxs7(CollapsibleTrigger, {
|
|
1946
|
-
render: /* @__PURE__ */
|
|
1943
|
+
render: /* @__PURE__ */ jsx19(Marker, {
|
|
1947
1944
|
className: "focus-visible:ring-ring/50 cursor-pointer rounded-sm outline-none focus-visible:ring-3",
|
|
1948
|
-
render: /* @__PURE__ */
|
|
1945
|
+
render: /* @__PURE__ */ jsx19("button", {
|
|
1949
1946
|
type: "button"
|
|
1950
1947
|
})
|
|
1951
1948
|
}),
|
|
1952
1949
|
children: [
|
|
1953
|
-
/* @__PURE__ */
|
|
1950
|
+
/* @__PURE__ */ jsx19(MarkerContent, {
|
|
1954
1951
|
className: "flex-1",
|
|
1955
|
-
children: /* @__PURE__ */
|
|
1952
|
+
children: /* @__PURE__ */ jsx19("span", {
|
|
1956
1953
|
className: cn("block w-fit max-w-full", isWorking && "shimmer"),
|
|
1957
1954
|
children: showWorkedSummary ? labels.toolWorked(workedSeconds) : label
|
|
1958
1955
|
})
|
|
1959
1956
|
}),
|
|
1960
|
-
currentTool.status === "failed" || currentTool.status === "denied" ? /* @__PURE__ */
|
|
1957
|
+
currentTool.status === "failed" || currentTool.status === "denied" ? /* @__PURE__ */ jsx19(Badge, {
|
|
1961
1958
|
variant: "destructive",
|
|
1962
1959
|
children: currentTool.status === "failed" ? labels.toolFailed : labels.toolDenied
|
|
1963
1960
|
}) : null,
|
|
1964
|
-
/* @__PURE__ */
|
|
1961
|
+
/* @__PURE__ */ jsx19(ChevronDownIcon, {
|
|
1965
1962
|
className: cn("transition-transform", logOpen && "rotate-180")
|
|
1966
1963
|
}),
|
|
1967
|
-
/* @__PURE__ */
|
|
1964
|
+
/* @__PURE__ */ jsx19("span", {
|
|
1968
1965
|
className: "sr-only",
|
|
1969
1966
|
children: logOpen ? labels.viewLess : labels.viewMore
|
|
1970
1967
|
})
|
|
@@ -1973,12 +1970,12 @@ function ToolActivityLog({
|
|
|
1973
1970
|
/* @__PURE__ */ jsxs7(CollapsibleContent, {
|
|
1974
1971
|
className: "mt-2 ml-2 flex flex-col gap-2 border-l pl-3",
|
|
1975
1972
|
children: [
|
|
1976
|
-
/* @__PURE__ */
|
|
1977
|
-
children: /* @__PURE__ */
|
|
1973
|
+
/* @__PURE__ */ jsx19(Marker, {
|
|
1974
|
+
children: /* @__PURE__ */ jsx19(MarkerContent, {
|
|
1978
1975
|
children: labels.toolRunning
|
|
1979
1976
|
})
|
|
1980
1977
|
}),
|
|
1981
|
-
loggedTools.map((tool) => /* @__PURE__ */
|
|
1978
|
+
loggedTools.map((tool) => /* @__PURE__ */ jsx19(ToolActivityCard, {
|
|
1982
1979
|
disabled,
|
|
1983
1980
|
labels,
|
|
1984
1981
|
onApproval,
|
|
@@ -2026,11 +2023,11 @@ function AgentMessageRow({
|
|
|
2026
2023
|
pending,
|
|
2027
2024
|
workedSeconds
|
|
2028
2025
|
]);
|
|
2029
|
-
return /* @__PURE__ */
|
|
2026
|
+
return /* @__PURE__ */ jsx19(Message, {
|
|
2030
2027
|
align: isUser ? "end" : "start",
|
|
2031
2028
|
children: /* @__PURE__ */ jsxs7(MessageContent, {
|
|
2032
2029
|
children: [
|
|
2033
|
-
!isUser && (message.tools.length > 0 || pending && !message.text) ? /* @__PURE__ */
|
|
2030
|
+
!isUser && (message.tools.length > 0 || pending && !message.text) ? /* @__PURE__ */ jsx19(ToolActivityLog, {
|
|
2034
2031
|
disabled,
|
|
2035
2032
|
labels,
|
|
2036
2033
|
onApproval,
|
|
@@ -2038,18 +2035,18 @@ function AgentMessageRow({
|
|
|
2038
2035
|
tools: message.tools,
|
|
2039
2036
|
workedSeconds
|
|
2040
2037
|
}) : null,
|
|
2041
|
-
message.text ? isUser ? /* @__PURE__ */
|
|
2038
|
+
message.text ? isUser ? /* @__PURE__ */ jsx19(Bubble, {
|
|
2042
2039
|
align: "end",
|
|
2043
|
-
children: /* @__PURE__ */
|
|
2040
|
+
children: /* @__PURE__ */ jsx19(BubbleContent, {
|
|
2044
2041
|
className: "whitespace-pre-wrap",
|
|
2045
2042
|
children: message.text
|
|
2046
2043
|
})
|
|
2047
|
-
}) : message.markdown ? /* @__PURE__ */
|
|
2044
|
+
}) : message.markdown ? /* @__PURE__ */ jsx19(MarkdownContent, {
|
|
2048
2045
|
className: "w-full",
|
|
2049
2046
|
codeBlocks: message.markdown.codeBlocks,
|
|
2050
2047
|
html: message.markdown.html,
|
|
2051
2048
|
messages: { copied: labels.copied, copy: labels.copy }
|
|
2052
|
-
}) : /* @__PURE__ */
|
|
2049
|
+
}) : /* @__PURE__ */ jsx19("div", {
|
|
2053
2050
|
className: "w-full whitespace-pre-wrap",
|
|
2054
2051
|
children: message.text
|
|
2055
2052
|
}) : null
|
|
@@ -2152,29 +2149,29 @@ function AgentWidget({
|
|
|
2152
2149
|
disablePointerDismissal: true,
|
|
2153
2150
|
children: [
|
|
2154
2151
|
/* @__PURE__ */ jsxs7(DialogTrigger, {
|
|
2155
|
-
render: /* @__PURE__ */
|
|
2152
|
+
render: /* @__PURE__ */ jsx19(Button, {
|
|
2156
2153
|
size: "icon-lg",
|
|
2157
2154
|
className: "fixed right-4 bottom-4 z-9999 rounded-full shadow-lg md:right-6 md:bottom-6"
|
|
2158
2155
|
}),
|
|
2159
2156
|
children: [
|
|
2160
|
-
/* @__PURE__ */
|
|
2161
|
-
/* @__PURE__ */
|
|
2157
|
+
/* @__PURE__ */ jsx19(BotIcon, {}),
|
|
2158
|
+
/* @__PURE__ */ jsx19("span", {
|
|
2162
2159
|
className: "sr-only",
|
|
2163
2160
|
children: labels.open
|
|
2164
2161
|
})
|
|
2165
2162
|
]
|
|
2166
2163
|
}),
|
|
2167
|
-
/* @__PURE__ */
|
|
2164
|
+
/* @__PURE__ */ jsx19(DialogPortal, {
|
|
2168
2165
|
children: /* @__PURE__ */ jsxs7(DialogPrimitive2.Popup, {
|
|
2169
2166
|
"data-slot": "dialog-content",
|
|
2170
2167
|
className: cn("bg-popover text-popover-foreground ring-foreground/10 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 fixed z-50 flex flex-col gap-0 overflow-hidden rounded-xl text-sm shadow-lg ring-1 duration-100 outline-none", maximized ? "inset-4 max-h-none max-w-none md:inset-6" : "right-4 bottom-20 h-[min(42rem,calc(100svh-6rem))] w-[calc(100%-2rem)] max-w-md md:right-6"),
|
|
2171
2168
|
children: [
|
|
2172
|
-
/* @__PURE__ */
|
|
2169
|
+
/* @__PURE__ */ jsx19(DialogHeader, {
|
|
2173
2170
|
className: "shrink-0 border-b p-4",
|
|
2174
2171
|
children: /* @__PURE__ */ jsxs7("div", {
|
|
2175
2172
|
className: "flex items-center gap-1",
|
|
2176
2173
|
children: [
|
|
2177
|
-
/* @__PURE__ */
|
|
2174
|
+
/* @__PURE__ */ jsx19(DialogTitle, {
|
|
2178
2175
|
className: "min-w-0 flex-1 truncate text-sm leading-none font-medium",
|
|
2179
2176
|
children: labels.title
|
|
2180
2177
|
}),
|
|
@@ -2183,8 +2180,8 @@ function AgentWidget({
|
|
|
2183
2180
|
size: "icon-sm",
|
|
2184
2181
|
onClick: () => setOpen(false),
|
|
2185
2182
|
children: [
|
|
2186
|
-
/* @__PURE__ */
|
|
2187
|
-
/* @__PURE__ */
|
|
2183
|
+
/* @__PURE__ */ jsx19(MinusIcon, {}),
|
|
2184
|
+
/* @__PURE__ */ jsx19("span", {
|
|
2188
2185
|
className: "sr-only",
|
|
2189
2186
|
children: labels.minimize
|
|
2190
2187
|
})
|
|
@@ -2195,21 +2192,21 @@ function AgentWidget({
|
|
|
2195
2192
|
size: "icon-sm",
|
|
2196
2193
|
onClick: () => setMaximized((current) => !current),
|
|
2197
2194
|
children: [
|
|
2198
|
-
maximized ? /* @__PURE__ */
|
|
2199
|
-
/* @__PURE__ */
|
|
2195
|
+
maximized ? /* @__PURE__ */ jsx19(Minimize2Icon, {}) : /* @__PURE__ */ jsx19(Maximize2Icon, {}),
|
|
2196
|
+
/* @__PURE__ */ jsx19("span", {
|
|
2200
2197
|
className: "sr-only",
|
|
2201
2198
|
children: maximized ? labels.restore : labels.maximize
|
|
2202
2199
|
})
|
|
2203
2200
|
]
|
|
2204
2201
|
}),
|
|
2205
2202
|
/* @__PURE__ */ jsxs7(DialogClose, {
|
|
2206
|
-
render: /* @__PURE__ */
|
|
2203
|
+
render: /* @__PURE__ */ jsx19(Button, {
|
|
2207
2204
|
variant: "ghost",
|
|
2208
2205
|
size: "icon-sm"
|
|
2209
2206
|
}),
|
|
2210
2207
|
children: [
|
|
2211
|
-
/* @__PURE__ */
|
|
2212
|
-
/* @__PURE__ */
|
|
2208
|
+
/* @__PURE__ */ jsx19(XIcon2, {}),
|
|
2209
|
+
/* @__PURE__ */ jsx19("span", {
|
|
2213
2210
|
className: "sr-only",
|
|
2214
2211
|
children: labels.close
|
|
2215
2212
|
})
|
|
@@ -2218,39 +2215,39 @@ function AgentWidget({
|
|
|
2218
2215
|
]
|
|
2219
2216
|
})
|
|
2220
2217
|
}),
|
|
2221
|
-
/* @__PURE__ */
|
|
2218
|
+
/* @__PURE__ */ jsx19("div", {
|
|
2222
2219
|
className: "min-h-0 flex-1 overflow-hidden",
|
|
2223
|
-
children: state.messages.length === 0 && !state.error ? /* @__PURE__ */
|
|
2220
|
+
children: state.messages.length === 0 && !state.error ? /* @__PURE__ */ jsx19(Empty, {
|
|
2224
2221
|
className: "h-full",
|
|
2225
2222
|
children: /* @__PURE__ */ jsxs7(EmptyHeader, {
|
|
2226
2223
|
children: [
|
|
2227
|
-
/* @__PURE__ */
|
|
2224
|
+
/* @__PURE__ */ jsx19(EmptyMedia, {
|
|
2228
2225
|
variant: "icon",
|
|
2229
|
-
children: /* @__PURE__ */
|
|
2226
|
+
children: /* @__PURE__ */ jsx19(MessageCircleDashedIcon, {})
|
|
2230
2227
|
}),
|
|
2231
|
-
/* @__PURE__ */
|
|
2228
|
+
/* @__PURE__ */ jsx19(EmptyTitle, {
|
|
2232
2229
|
children: labels.welcome
|
|
2233
2230
|
}),
|
|
2234
|
-
/* @__PURE__ */
|
|
2231
|
+
/* @__PURE__ */ jsx19(EmptyDescription, {
|
|
2235
2232
|
children: labels.description
|
|
2236
2233
|
})
|
|
2237
2234
|
]
|
|
2238
2235
|
})
|
|
2239
|
-
}) : /* @__PURE__ */
|
|
2236
|
+
}) : /* @__PURE__ */ jsx19(MessageScrollerProvider, {
|
|
2240
2237
|
autoScroll: true,
|
|
2241
2238
|
children: /* @__PURE__ */ jsxs7(MessageScroller, {
|
|
2242
2239
|
children: [
|
|
2243
|
-
/* @__PURE__ */
|
|
2240
|
+
/* @__PURE__ */ jsx19(MessageScrollerViewport, {
|
|
2244
2241
|
"aria-label": labels.title,
|
|
2245
2242
|
className: "[scrollbar-width:thin] [scrollbar-color:var(--border)_transparent]",
|
|
2246
2243
|
children: /* @__PURE__ */ jsxs7(MessageScrollerContent, {
|
|
2247
2244
|
"aria-busy": state.pending,
|
|
2248
2245
|
className: "p-4",
|
|
2249
2246
|
children: [
|
|
2250
|
-
state.messages.map((message, index) => /* @__PURE__ */
|
|
2247
|
+
state.messages.map((message, index) => /* @__PURE__ */ jsx19(MessageScrollerItem, {
|
|
2251
2248
|
messageId: message.id,
|
|
2252
2249
|
scrollAnchor: message.role === "user",
|
|
2253
|
-
children: /* @__PURE__ */
|
|
2250
|
+
children: /* @__PURE__ */ jsx19(AgentMessageRow, {
|
|
2254
2251
|
disabled: state.pending,
|
|
2255
2252
|
labels,
|
|
2256
2253
|
message,
|
|
@@ -2258,15 +2255,15 @@ function AgentWidget({
|
|
|
2258
2255
|
pending: state.pending && index === state.messages.length - 1
|
|
2259
2256
|
})
|
|
2260
2257
|
}, message.id)),
|
|
2261
|
-
state.error ? /* @__PURE__ */
|
|
2258
|
+
state.error ? /* @__PURE__ */ jsx19(MessageScrollerItem, {
|
|
2262
2259
|
messageId: "error",
|
|
2263
2260
|
children: /* @__PURE__ */ jsxs7(Alert, {
|
|
2264
2261
|
variant: "destructive",
|
|
2265
2262
|
children: [
|
|
2266
|
-
/* @__PURE__ */
|
|
2263
|
+
/* @__PURE__ */ jsx19(AlertTitle, {
|
|
2267
2264
|
children: labels.title
|
|
2268
2265
|
}),
|
|
2269
|
-
/* @__PURE__ */
|
|
2266
|
+
/* @__PURE__ */ jsx19(AlertDescription, {
|
|
2270
2267
|
children: errorMessage(state.error, labels)
|
|
2271
2268
|
})
|
|
2272
2269
|
]
|
|
@@ -2277,8 +2274,8 @@ function AgentWidget({
|
|
|
2277
2274
|
}),
|
|
2278
2275
|
/* @__PURE__ */ jsxs7(MessageScrollerButton, {
|
|
2279
2276
|
children: [
|
|
2280
|
-
/* @__PURE__ */
|
|
2281
|
-
/* @__PURE__ */
|
|
2277
|
+
/* @__PURE__ */ jsx19(ArrowDownIcon2, {}),
|
|
2278
|
+
/* @__PURE__ */ jsx19("span", {
|
|
2282
2279
|
className: "sr-only",
|
|
2283
2280
|
children: labels.scrollLatest
|
|
2284
2281
|
})
|
|
@@ -2288,7 +2285,7 @@ function AgentWidget({
|
|
|
2288
2285
|
})
|
|
2289
2286
|
})
|
|
2290
2287
|
}),
|
|
2291
|
-
/* @__PURE__ */
|
|
2288
|
+
/* @__PURE__ */ jsx19("form", {
|
|
2292
2289
|
className: "shrink-0 border-t p-3",
|
|
2293
2290
|
onSubmit: (event) => {
|
|
2294
2291
|
event.preventDefault();
|
|
@@ -2301,22 +2298,22 @@ function AgentWidget({
|
|
|
2301
2298
|
className: "bg-background rounded-t-[calc(var(--radius-md)-1px)] border-b",
|
|
2302
2299
|
children: [
|
|
2303
2300
|
activeContext.icon,
|
|
2304
|
-
/* @__PURE__ */
|
|
2301
|
+
/* @__PURE__ */ jsx19("span", {
|
|
2305
2302
|
className: "min-w-0 flex-1 truncate text-left",
|
|
2306
2303
|
children: activeContext.label
|
|
2307
2304
|
}),
|
|
2308
|
-
onRemoveContext ? /* @__PURE__ */
|
|
2305
|
+
onRemoveContext ? /* @__PURE__ */ jsx19(InputGroupButton, {
|
|
2309
2306
|
size: "icon-xs",
|
|
2310
2307
|
"aria-label": `${labels.removeContext}: ${activeContext.label}`,
|
|
2311
2308
|
onClick: onRemoveContext,
|
|
2312
|
-
children: /* @__PURE__ */
|
|
2309
|
+
children: /* @__PURE__ */ jsx19(XIcon2, {})
|
|
2313
2310
|
}) : null
|
|
2314
2311
|
]
|
|
2315
2312
|
}) : null,
|
|
2316
2313
|
/* @__PURE__ */ jsxs7("div", {
|
|
2317
2314
|
className: "relative w-full min-w-0 self-stretch text-left",
|
|
2318
2315
|
children: [
|
|
2319
|
-
/* @__PURE__ */
|
|
2316
|
+
/* @__PURE__ */ jsx19("div", {
|
|
2320
2317
|
ref: inputOverlayRef,
|
|
2321
2318
|
"aria-hidden": "true",
|
|
2322
2319
|
className: "text-foreground pointer-events-none absolute inset-0 [scrollbar-width:thin] [scrollbar-gutter:stable] overflow-hidden px-2.5 py-2 text-left font-[inherit] text-base break-words whitespace-pre-wrap md:text-sm",
|
|
@@ -2326,9 +2323,9 @@ function AgentWidget({
|
|
|
2326
2323
|
open: referencePickerOpen,
|
|
2327
2324
|
triggerId: referenceInputId,
|
|
2328
2325
|
children: [
|
|
2329
|
-
/* @__PURE__ */
|
|
2326
|
+
/* @__PURE__ */ jsx19(PopoverTrigger, {
|
|
2330
2327
|
id: referenceInputId,
|
|
2331
|
-
render: /* @__PURE__ */
|
|
2328
|
+
render: /* @__PURE__ */ jsx19(InputGroupTextarea, {
|
|
2332
2329
|
ref: inputRef,
|
|
2333
2330
|
className: "caret-foreground selection:bg-primary selection:text-primary-foreground relative max-h-32 w-full [scrollbar-width:thin] [scrollbar-color:var(--border)_transparent] [scrollbar-gutter:stable] overflow-y-auto overscroll-contain text-left text-transparent",
|
|
2334
2331
|
value: input,
|
|
@@ -2380,22 +2377,22 @@ function AgentWidget({
|
|
|
2380
2377
|
}
|
|
2381
2378
|
})
|
|
2382
2379
|
}),
|
|
2383
|
-
/* @__PURE__ */
|
|
2380
|
+
/* @__PURE__ */ jsx19(PopoverContent, {
|
|
2384
2381
|
align: "start",
|
|
2385
2382
|
initialFocus: false,
|
|
2386
2383
|
side: "top",
|
|
2387
2384
|
className: "w-[min(24rem,calc(100vw-2rem))] p-0",
|
|
2388
|
-
children: /* @__PURE__ */
|
|
2385
|
+
children: /* @__PURE__ */ jsx19(Command, {
|
|
2389
2386
|
shouldFilter: false,
|
|
2390
2387
|
value: activeReference?.key ?? "",
|
|
2391
2388
|
onValueChange: setActiveReferenceKey,
|
|
2392
2389
|
children: /* @__PURE__ */ jsxs7(CommandList, {
|
|
2393
2390
|
id: referenceListId,
|
|
2394
2391
|
children: [
|
|
2395
|
-
/* @__PURE__ */
|
|
2392
|
+
/* @__PURE__ */ jsx19(CommandEmpty, {
|
|
2396
2393
|
children: labels.noReferences
|
|
2397
2394
|
}),
|
|
2398
|
-
matchingReferences.length > 0 ? /* @__PURE__ */
|
|
2395
|
+
matchingReferences.length > 0 ? /* @__PURE__ */ jsx19(CommandGroup, {
|
|
2399
2396
|
heading: labels.references,
|
|
2400
2397
|
children: matchingReferences.map((reference, index) => /* @__PURE__ */ jsxs7(CommandItem, {
|
|
2401
2398
|
id: `${referenceInputId}-reference-${index}`,
|
|
@@ -2403,7 +2400,7 @@ function AgentWidget({
|
|
|
2403
2400
|
onSelect: () => selectReference(reference),
|
|
2404
2401
|
children: [
|
|
2405
2402
|
reference.icon,
|
|
2406
|
-
/* @__PURE__ */
|
|
2403
|
+
/* @__PURE__ */ jsx19("span", {
|
|
2407
2404
|
className: "truncate",
|
|
2408
2405
|
children: reference.label
|
|
2409
2406
|
})
|
|
@@ -2418,15 +2415,15 @@ function AgentWidget({
|
|
|
2418
2415
|
})
|
|
2419
2416
|
]
|
|
2420
2417
|
}),
|
|
2421
|
-
/* @__PURE__ */
|
|
2418
|
+
/* @__PURE__ */ jsx19(InputGroupAddon, {
|
|
2422
2419
|
align: "block-end",
|
|
2423
2420
|
className: "justify-end",
|
|
2424
2421
|
children: state.pending ? /* @__PURE__ */ jsxs7(InputGroupButton, {
|
|
2425
2422
|
size: "icon-xs",
|
|
2426
2423
|
onClick: onInterrupt,
|
|
2427
2424
|
children: [
|
|
2428
|
-
/* @__PURE__ */
|
|
2429
|
-
/* @__PURE__ */
|
|
2425
|
+
/* @__PURE__ */ jsx19(SquareIcon, {}),
|
|
2426
|
+
/* @__PURE__ */ jsx19("span", {
|
|
2430
2427
|
className: "sr-only",
|
|
2431
2428
|
children: labels.stop
|
|
2432
2429
|
})
|
|
@@ -2436,8 +2433,8 @@ function AgentWidget({
|
|
|
2436
2433
|
size: "icon-xs",
|
|
2437
2434
|
disabled: !input.trim() || hasPendingApproval,
|
|
2438
2435
|
children: [
|
|
2439
|
-
/* @__PURE__ */
|
|
2440
|
-
/* @__PURE__ */
|
|
2436
|
+
/* @__PURE__ */ jsx19(SendIcon, {}),
|
|
2437
|
+
/* @__PURE__ */ jsx19("span", {
|
|
2441
2438
|
className: "sr-only",
|
|
2442
2439
|
children: labels.send
|
|
2443
2440
|
})
|
|
@@ -2454,9 +2451,9 @@ function AgentWidget({
|
|
|
2454
2451
|
});
|
|
2455
2452
|
}
|
|
2456
2453
|
export {
|
|
2457
|
-
|
|
2458
|
-
makeAgentAtoms,
|
|
2459
|
-
initialAgentState,
|
|
2454
|
+
AgentWidget,
|
|
2460
2455
|
agentWidgetMessages,
|
|
2461
|
-
|
|
2456
|
+
initialAgentState,
|
|
2457
|
+
makeAgentAtoms,
|
|
2458
|
+
reduceAgentEvent
|
|
2462
2459
|
};
|