@object-ui/plugin-chatbot 14.1.0 → 16.0.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/CHANGELOG.md +34 -0
- package/dist/ChatbotEnhanced.d.ts +23 -0
- package/dist/ChatbotEnhanced.d.ts.map +1 -1
- package/dist/index.js +455 -400
- package/dist/index.umd.cjs +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
2
|
import { Children as t, Fragment as n, createContext as r, isValidElement as i, memo as a, useCallback as o, useContext as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
3
|
-
import { Alert as f, AlertDescription as p, Avatar as m, AvatarFallback as h, AvatarImage as g, Badge as _, Button as v, Card as y, CardContent as b, CardDescription as x, CardHeader as S, CardTitle as C, Collapsible as w, CollapsibleContent as T, CollapsibleTrigger as E, Command as D, CommandEmpty as O, CommandGroup as k, CommandInput as A, CommandItem as j, CommandList as M, CommandSeparator as N, DropdownMenu as ee, DropdownMenuContent as P, DropdownMenuItem as F, DropdownMenuTrigger as I, Empty as te, EmptyDescription as ne, EmptyHeader as L, EmptyMedia as re, EmptyTitle as ie, HoverCard as R, HoverCardContent as ae, HoverCardTrigger as oe, Input as
|
|
4
|
-
import { AlertCircle as
|
|
3
|
+
import { Alert as f, AlertDescription as p, Avatar as m, AvatarFallback as h, AvatarImage as g, Badge as _, Button as v, Card as y, CardContent as b, CardDescription as x, CardHeader as S, CardTitle as C, Collapsible as w, CollapsibleContent as T, CollapsibleTrigger as E, Command as D, CommandEmpty as O, CommandGroup as k, CommandInput as A, CommandItem as j, CommandList as M, CommandSeparator as N, DropdownMenu as ee, DropdownMenuContent as P, DropdownMenuItem as F, DropdownMenuTrigger as I, Empty as te, EmptyDescription as ne, EmptyHeader as L, EmptyMedia as re, EmptyTitle as ie, HoverCard as R, HoverCardContent as ae, HoverCardTrigger as oe, Input as se, Label as z, ScrollArea as ce, ScrollBar as le, Select as ue, SelectContent as de, SelectItem as fe, SelectTrigger as pe, SelectValue as me, Separator as he, Sheet as ge, SheetContent as _e, SheetDescription as ve, SheetHeader as ye, SheetTitle as be, Skeleton as xe, Table as Se, TableBody as Ce, TableCell as B, TableHead as V, TableHeader as we, TableRow as Te, Tabs as Ee, TabsList as De, TabsTrigger as Oe, Textarea as ke, Tooltip as H, TooltipContent as Ae, TooltipProvider as U, TooltipTrigger as je, cn as W } from "@object-ui/components";
|
|
4
|
+
import { AlertCircle as Me, ArrowDownIcon as Ne, ArrowRight as Pe, BookIcon as G, Bot as Fe, BrainIcon as Ie, Check as Le, CheckCircle2 as K, CheckCircleIcon as Re, CheckIcon as ze, ChevronDownIcon as Be, ChevronLeftIcon as Ve, ChevronRightIcon as q, CircleIcon as He, ClipboardList as Ue, Clock as We, Clock3 as Ge, ClockIcon as Ke, Copy as qe, CopyIcon as Je, CornerDownLeft as Ye, CornerDownLeftIcon as Xe, Eye as Ze, GitCompareArrows as Qe, HelpCircle as $e, Hourglass as et, ImageIcon as tt, Inbox as nt, Loader2 as rt, Loader2Icon as it, Maximize2 as at, MicIcon as ot, Minimize2 as st, PaperclipIcon as ct, PlusIcon as lt, RefreshCw as ut, Rocket as dt, Send as ft, ShieldCheck as pt, Sparkles as mt, SquareIcon as ht, Table2 as gt, TriangleAlert as _t, WifiOff as vt, WrenchIcon as yt, X as J, XCircle as Y, XCircleIcon as bt, XIcon as X } from "lucide-react";
|
|
5
5
|
import { Fragment as Z, jsx as Q, jsxs as $ } from "react/jsx-runtime";
|
|
6
6
|
import { useChat as xt } from "@ai-sdk/react";
|
|
7
7
|
import { DefaultChatTransport as St } from "ai";
|
|
@@ -759,11 +759,11 @@ function Ln({ position: e = "bottom-right", size: t = 56, className: n }) {
|
|
|
759
759
|
let { isOpen: r, toggle: i } = Mn(), a = Nn();
|
|
760
760
|
return /* @__PURE__ */ Q(v, {
|
|
761
761
|
onClick: i,
|
|
762
|
-
className:
|
|
762
|
+
className: W("fixed z-50 rounded-full shadow-lg transition-transform hover:scale-105", In(t), r && "hidden", e === "bottom-right" ? "right-6 bottom-20 sm:bottom-6" : "left-6 bottom-20 sm:bottom-6", n),
|
|
763
763
|
size: "icon",
|
|
764
764
|
"aria-label": r ? a("closeChat", "Close chat") : a("openChat", "Open chat"),
|
|
765
765
|
"data-testid": "floating-chatbot-trigger",
|
|
766
|
-
children: Q(r ?
|
|
766
|
+
children: Q(r ? J : Fe, { className: "h-6 w-6" })
|
|
767
767
|
});
|
|
768
768
|
}
|
|
769
769
|
//#endregion
|
|
@@ -813,7 +813,7 @@ function Hn(e) {
|
|
|
813
813
|
function Un({ title: e = "Chat", position: t = "bottom-right", width: n = 400, height: r = 520, children: i, className: a, headerExtra: o, headerActions: s }) {
|
|
814
814
|
let { isOpen: c, isFullscreen: l, close: u, toggleFullscreen: d } = Mn();
|
|
815
815
|
return c ? /* @__PURE__ */ $("div", {
|
|
816
|
-
className:
|
|
816
|
+
className: W("fixed z-50 flex flex-col overflow-hidden border bg-background shadow-xl transition-all", l ? "inset-0 h-svh w-screen rounded-none" : t === "bottom-right" ? W("left-3 right-3 bottom-[calc(4rem_+_env(safe-area-inset-bottom))] rounded-lg", "sm:left-auto sm:right-6 sm:bottom-20 sm:max-h-[calc(100vh_-_100px)]", Vn(n), Hn(r)) : W("left-3 right-3 bottom-[calc(4rem_+_env(safe-area-inset-bottom))] rounded-lg", "sm:right-auto sm:left-6 sm:bottom-20 sm:max-h-[calc(100vh_-_100px)]", Vn(n), Hn(r)), a),
|
|
817
817
|
role: "dialog",
|
|
818
818
|
"aria-label": e,
|
|
819
819
|
"data-testid": "floating-chatbot-panel",
|
|
@@ -840,7 +840,7 @@ function Un({ title: e = "Chat", position: t = "bottom-right", width: n = 400, h
|
|
|
840
840
|
onClick: d,
|
|
841
841
|
"aria-label": l ? "Exit fullscreen" : "Fullscreen",
|
|
842
842
|
"data-testid": "floating-chatbot-fullscreen",
|
|
843
|
-
children: Q(l ?
|
|
843
|
+
children: Q(l ? st : at, { className: "h-4 w-4" })
|
|
844
844
|
}),
|
|
845
845
|
/* @__PURE__ */ Q(v, {
|
|
846
846
|
variant: "ghost",
|
|
@@ -849,7 +849,7 @@ function Un({ title: e = "Chat", position: t = "bottom-right", width: n = 400, h
|
|
|
849
849
|
onClick: u,
|
|
850
850
|
"aria-label": "Close chat",
|
|
851
851
|
"data-testid": "floating-chatbot-close",
|
|
852
|
-
children: /* @__PURE__ */ Q(
|
|
852
|
+
children: /* @__PURE__ */ Q(J, { className: "h-4 w-4" })
|
|
853
853
|
})
|
|
854
854
|
]
|
|
855
855
|
})
|
|
@@ -950,16 +950,16 @@ function Qn(e) {
|
|
|
950
950
|
//#endregion
|
|
951
951
|
//#region src/elements/conversation.tsx
|
|
952
952
|
var $n = ({ className: e, ...t }) => /* @__PURE__ */ Q(Et, {
|
|
953
|
-
className:
|
|
953
|
+
className: W("relative flex-1 overflow-y-hidden", e),
|
|
954
954
|
initial: "smooth",
|
|
955
955
|
resize: "smooth",
|
|
956
956
|
role: "log",
|
|
957
957
|
...t
|
|
958
958
|
}), er = ({ className: e, ...t }) => /* @__PURE__ */ Q(Et.Content, {
|
|
959
|
-
className:
|
|
959
|
+
className: W("flex flex-col gap-8 p-4", e),
|
|
960
960
|
...t
|
|
961
961
|
}), tr = ({ className: e, title: t = "No messages yet", description: n = "Start a conversation to see messages here", icon: r, children: i, ...a }) => /* @__PURE__ */ Q("div", {
|
|
962
|
-
className:
|
|
962
|
+
className: W("flex size-full flex-col items-center justify-center gap-3 p-8 text-center", e),
|
|
963
963
|
...a,
|
|
964
964
|
children: i ?? /* @__PURE__ */ $(Z, { children: [r && /* @__PURE__ */ Q("div", {
|
|
965
965
|
className: "text-muted-foreground",
|
|
@@ -979,13 +979,13 @@ var $n = ({ className: e, ...t }) => /* @__PURE__ */ Q(Et, {
|
|
|
979
979
|
r();
|
|
980
980
|
}, [r]);
|
|
981
981
|
return !n && /* @__PURE__ */ Q(v, {
|
|
982
|
-
className:
|
|
982
|
+
className: W("absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full", e),
|
|
983
983
|
onClick: i,
|
|
984
984
|
size: "icon",
|
|
985
985
|
type: "button",
|
|
986
986
|
variant: "outline",
|
|
987
987
|
...t,
|
|
988
|
-
children: /* @__PURE__ */ Q(
|
|
988
|
+
children: /* @__PURE__ */ Q(Ne, { className: "size-4" })
|
|
989
989
|
});
|
|
990
990
|
}, rr = Ot("flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1", {
|
|
991
991
|
variants: { orientation: {
|
|
@@ -999,27 +999,27 @@ function ir({ className: e, orientation: t, ...n }) {
|
|
|
999
999
|
role: "group",
|
|
1000
1000
|
"data-slot": "button-group",
|
|
1001
1001
|
"data-orientation": t,
|
|
1002
|
-
className:
|
|
1002
|
+
className: W(rr({ orientation: t }), e),
|
|
1003
1003
|
...n
|
|
1004
1004
|
});
|
|
1005
1005
|
}
|
|
1006
1006
|
function ar({ className: e, asChild: t = !1, ...n }) {
|
|
1007
1007
|
return /* @__PURE__ */ Q(t ? kt : "div", {
|
|
1008
|
-
className:
|
|
1008
|
+
className: W("flex items-center gap-2 rounded-md border bg-muted px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", e),
|
|
1009
1009
|
...n
|
|
1010
1010
|
});
|
|
1011
1011
|
}
|
|
1012
1012
|
//#endregion
|
|
1013
1013
|
//#region src/elements/message.tsx
|
|
1014
1014
|
var or = ({ className: e, from: t, ...n }) => /* @__PURE__ */ Q("div", {
|
|
1015
|
-
className:
|
|
1015
|
+
className: W("group flex w-full max-w-[95%] flex-col gap-2", t === "user" ? "is-user ml-auto justify-end" : "is-assistant", e),
|
|
1016
1016
|
...n
|
|
1017
1017
|
}), sr = ({ children: e, className: t, ...n }) => /* @__PURE__ */ Q("div", {
|
|
1018
|
-
className:
|
|
1018
|
+
className: W("is-user:dark flex w-fit max-w-full min-w-0 flex-col gap-2 overflow-hidden text-sm", "group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground", "group-[.is-assistant]:text-foreground", t),
|
|
1019
1019
|
...n,
|
|
1020
1020
|
children: e
|
|
1021
1021
|
}), cr = ({ className: e, children: t, ...n }) => /* @__PURE__ */ Q("div", {
|
|
1022
|
-
className:
|
|
1022
|
+
className: W("flex items-center gap-1", e),
|
|
1023
1023
|
...n,
|
|
1024
1024
|
children: t
|
|
1025
1025
|
}), lr = ({ tooltip: e, children: t, label: n, variant: r = "ghost", size: i = "icon", ...a }) => {
|
|
@@ -1033,10 +1033,10 @@ var or = ({ className: e, from: t, ...n }) => /* @__PURE__ */ Q("div", {
|
|
|
1033
1033
|
children: n || e
|
|
1034
1034
|
})]
|
|
1035
1035
|
});
|
|
1036
|
-
return e ? /* @__PURE__ */ Q(
|
|
1036
|
+
return e ? /* @__PURE__ */ Q(U, { children: /* @__PURE__ */ $(H, { children: [/* @__PURE__ */ Q(je, {
|
|
1037
1037
|
asChild: !0,
|
|
1038
1038
|
children: o
|
|
1039
|
-
}), /* @__PURE__ */ Q(
|
|
1039
|
+
}), /* @__PURE__ */ Q(Ae, { children: /* @__PURE__ */ Q("p", { children: e }) })] }) }) : o;
|
|
1040
1040
|
}, ur = r(null), dr = () => {
|
|
1041
1041
|
let e = s(ur);
|
|
1042
1042
|
if (!e) throw Error("MessageBranch components must be used within MessageBranch");
|
|
@@ -1061,7 +1061,7 @@ var or = ({ className: e, from: t, ...n }) => /* @__PURE__ */ Q("div", {
|
|
|
1061
1061
|
return /* @__PURE__ */ Q(ur.Provider, {
|
|
1062
1062
|
value: l,
|
|
1063
1063
|
children: /* @__PURE__ */ Q("div", {
|
|
1064
|
-
className:
|
|
1064
|
+
className: W("grid w-full gap-2 [&>div]:pb-0", n),
|
|
1065
1065
|
...r
|
|
1066
1066
|
})
|
|
1067
1067
|
});
|
|
@@ -1074,7 +1074,7 @@ var or = ({ className: e, from: t, ...n }) => /* @__PURE__ */ Q("div", {
|
|
|
1074
1074
|
i,
|
|
1075
1075
|
r
|
|
1076
1076
|
]), a.map((e, r) => /* @__PURE__ */ Q("div", {
|
|
1077
|
-
className:
|
|
1077
|
+
className: W("grid gap-2 overflow-hidden [&>div]:pb-0", r === n ? "block" : "hidden"),
|
|
1078
1078
|
...t,
|
|
1079
1079
|
children: e
|
|
1080
1080
|
}, e.key));
|
|
@@ -1095,7 +1095,7 @@ var or = ({ className: e, from: t, ...n }) => /* @__PURE__ */ Q("div", {
|
|
|
1095
1095
|
type: "button",
|
|
1096
1096
|
variant: "ghost",
|
|
1097
1097
|
...t,
|
|
1098
|
-
children: e ?? /* @__PURE__ */ Q(
|
|
1098
|
+
children: e ?? /* @__PURE__ */ Q(Ve, { size: 14 })
|
|
1099
1099
|
});
|
|
1100
1100
|
}, gr = ({ children: e, className: t, ...n }) => {
|
|
1101
1101
|
let { goToNext: r, totalBranches: i } = dr();
|
|
@@ -1107,12 +1107,12 @@ var or = ({ className: e, from: t, ...n }) => /* @__PURE__ */ Q("div", {
|
|
|
1107
1107
|
type: "button",
|
|
1108
1108
|
variant: "ghost",
|
|
1109
1109
|
...n,
|
|
1110
|
-
children: e ?? /* @__PURE__ */ Q(
|
|
1110
|
+
children: e ?? /* @__PURE__ */ Q(q, { size: 14 })
|
|
1111
1111
|
});
|
|
1112
1112
|
}, _r = ({ className: e, ...t }) => {
|
|
1113
1113
|
let { currentBranch: n, totalBranches: r } = dr();
|
|
1114
1114
|
return /* @__PURE__ */ $(ar, {
|
|
1115
|
-
className:
|
|
1115
|
+
className: W("border-none bg-transparent text-muted-foreground shadow-none", e),
|
|
1116
1116
|
...t,
|
|
1117
1117
|
children: [
|
|
1118
1118
|
n + 1,
|
|
@@ -1121,14 +1121,14 @@ var or = ({ className: e, from: t, ...n }) => /* @__PURE__ */ Q("div", {
|
|
|
1121
1121
|
]
|
|
1122
1122
|
});
|
|
1123
1123
|
}, vr = a(({ className: e, ...t }) => /* @__PURE__ */ Q(At, {
|
|
1124
|
-
className:
|
|
1124
|
+
className: W("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", e),
|
|
1125
1125
|
...t
|
|
1126
1126
|
}), (e, t) => e.children === t.children);
|
|
1127
1127
|
vr.displayName = "MessageResponse";
|
|
1128
1128
|
function yr({ data: e, className: t, onRemove: n, ...r }) {
|
|
1129
1129
|
let i = e.filename || "", a = (e.mediaType?.startsWith("image/") && e.url ? "image" : "file") == "image", o = i || (a ? "Image" : "Attachment");
|
|
1130
1130
|
return /* @__PURE__ */ Q("div", {
|
|
1131
|
-
className:
|
|
1131
|
+
className: W("group relative size-24 overflow-hidden rounded-lg", t),
|
|
1132
1132
|
...r,
|
|
1133
1133
|
children: a ? /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ Q("img", {
|
|
1134
1134
|
alt: i || "attachment",
|
|
@@ -1144,17 +1144,17 @@ function yr({ data: e, className: t, onRemove: n, ...r }) {
|
|
|
1144
1144
|
},
|
|
1145
1145
|
type: "button",
|
|
1146
1146
|
variant: "ghost",
|
|
1147
|
-
children: [/* @__PURE__ */ Q(
|
|
1147
|
+
children: [/* @__PURE__ */ Q(X, {}), /* @__PURE__ */ Q("span", {
|
|
1148
1148
|
className: "sr-only",
|
|
1149
1149
|
children: "Remove"
|
|
1150
1150
|
})]
|
|
1151
|
-
})] }) : /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ $(
|
|
1151
|
+
})] }) : /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ $(H, { children: [/* @__PURE__ */ Q(je, {
|
|
1152
1152
|
asChild: !0,
|
|
1153
1153
|
children: /* @__PURE__ */ Q("div", {
|
|
1154
1154
|
className: "flex size-full shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground",
|
|
1155
|
-
children: /* @__PURE__ */ Q(
|
|
1155
|
+
children: /* @__PURE__ */ Q(ct, { className: "size-4" })
|
|
1156
1156
|
})
|
|
1157
|
-
}), /* @__PURE__ */ Q(
|
|
1157
|
+
}), /* @__PURE__ */ Q(Ae, { children: /* @__PURE__ */ Q("p", { children: o }) })] }), n && /* @__PURE__ */ $(v, {
|
|
1158
1158
|
"aria-label": "Remove attachment",
|
|
1159
1159
|
className: "size-6 shrink-0 rounded-full p-0 opacity-0 transition-opacity hover:bg-accent group-hover:opacity-100 [&>svg]:size-3",
|
|
1160
1160
|
onClick: (e) => {
|
|
@@ -1162,7 +1162,7 @@ function yr({ data: e, className: t, onRemove: n, ...r }) {
|
|
|
1162
1162
|
},
|
|
1163
1163
|
type: "button",
|
|
1164
1164
|
variant: "ghost",
|
|
1165
|
-
children: [/* @__PURE__ */ Q(
|
|
1165
|
+
children: [/* @__PURE__ */ Q(X, {}), /* @__PURE__ */ Q("span", {
|
|
1166
1166
|
className: "sr-only",
|
|
1167
1167
|
children: "Remove"
|
|
1168
1168
|
})]
|
|
@@ -1171,13 +1171,13 @@ function yr({ data: e, className: t, onRemove: n, ...r }) {
|
|
|
1171
1171
|
}
|
|
1172
1172
|
function br({ children: e, className: t, ...n }) {
|
|
1173
1173
|
return e ? /* @__PURE__ */ Q("div", {
|
|
1174
|
-
className:
|
|
1174
|
+
className: W("ml-auto flex w-fit flex-wrap items-start gap-2", t),
|
|
1175
1175
|
...n,
|
|
1176
1176
|
children: e
|
|
1177
1177
|
}) : null;
|
|
1178
1178
|
}
|
|
1179
1179
|
var xr = ({ className: e, children: t, ...n }) => /* @__PURE__ */ Q("div", {
|
|
1180
|
-
className:
|
|
1180
|
+
className: W("mt-4 flex w-full items-center justify-between gap-4", e),
|
|
1181
1181
|
...n,
|
|
1182
1182
|
children: t
|
|
1183
1183
|
});
|
|
@@ -1187,7 +1187,7 @@ function Sr({ className: e, ...t }) {
|
|
|
1187
1187
|
return /* @__PURE__ */ Q("div", {
|
|
1188
1188
|
"data-slot": "input-group",
|
|
1189
1189
|
role: "group",
|
|
1190
|
-
className:
|
|
1190
|
+
className: W("group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30", "h-9 min-w-0 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-3", "has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] 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-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40", e),
|
|
1191
1191
|
...t
|
|
1192
1192
|
});
|
|
1193
1193
|
}
|
|
@@ -1205,7 +1205,7 @@ function wr({ className: e, align: t = "inline-start", ...n }) {
|
|
|
1205
1205
|
role: "group",
|
|
1206
1206
|
"data-slot": "input-group-addon",
|
|
1207
1207
|
"data-align": t,
|
|
1208
|
-
className:
|
|
1208
|
+
className: W(Cr({ align: t }), e),
|
|
1209
1209
|
onClick: (e) => {
|
|
1210
1210
|
e.target.closest("button") || e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
1211
1211
|
},
|
|
@@ -1226,14 +1226,14 @@ function Er({ className: e, type: t = "button", variant: n = "ghost", size: r =
|
|
|
1226
1226
|
type: t,
|
|
1227
1227
|
"data-size": r,
|
|
1228
1228
|
variant: n,
|
|
1229
|
-
className:
|
|
1229
|
+
className: W(Tr({ size: r }), e),
|
|
1230
1230
|
...i
|
|
1231
1231
|
});
|
|
1232
1232
|
}
|
|
1233
1233
|
function Dr({ className: e, ...t }) {
|
|
1234
|
-
return /* @__PURE__ */ Q(
|
|
1234
|
+
return /* @__PURE__ */ Q(ke, {
|
|
1235
1235
|
"data-slot": "input-group-control",
|
|
1236
|
-
className:
|
|
1236
|
+
className: W("flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent", e),
|
|
1237
1237
|
...t
|
|
1238
1238
|
});
|
|
1239
1239
|
}
|
|
@@ -1322,7 +1322,7 @@ function Lr({ data: e, className: t, ...n }) {
|
|
|
1322
1322
|
return /* @__PURE__ */ $(ii, { children: [/* @__PURE__ */ Q(oe, {
|
|
1323
1323
|
asChild: !0,
|
|
1324
1324
|
children: /* @__PURE__ */ $("div", {
|
|
1325
|
-
className:
|
|
1325
|
+
className: W("group relative flex h-8 cursor-pointer 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", t),
|
|
1326
1326
|
...n,
|
|
1327
1327
|
children: [/* @__PURE__ */ $("div", {
|
|
1328
1328
|
className: "relative size-5 shrink-0",
|
|
@@ -1336,7 +1336,7 @@ function Lr({ data: e, className: t, ...n }) {
|
|
|
1336
1336
|
width: 20
|
|
1337
1337
|
}) : /* @__PURE__ */ Q("div", {
|
|
1338
1338
|
className: "flex size-5 items-center justify-center text-muted-foreground",
|
|
1339
|
-
children: /* @__PURE__ */ Q(
|
|
1339
|
+
children: /* @__PURE__ */ Q(ct, { className: "size-3" })
|
|
1340
1340
|
})
|
|
1341
1341
|
}), /* @__PURE__ */ $(v, {
|
|
1342
1342
|
"aria-label": "Remove attachment",
|
|
@@ -1346,7 +1346,7 @@ function Lr({ data: e, className: t, ...n }) {
|
|
|
1346
1346
|
},
|
|
1347
1347
|
type: "button",
|
|
1348
1348
|
variant: "ghost",
|
|
1349
|
-
children: [/* @__PURE__ */ Q(
|
|
1349
|
+
children: [/* @__PURE__ */ Q(X, {}), /* @__PURE__ */ Q("span", {
|
|
1350
1350
|
className: "sr-only",
|
|
1351
1351
|
children: "Remove"
|
|
1352
1352
|
})]
|
|
@@ -1388,7 +1388,7 @@ function Lr({ data: e, className: t, ...n }) {
|
|
|
1388
1388
|
function Rr({ children: e, className: t, ...r }) {
|
|
1389
1389
|
let i = Ir();
|
|
1390
1390
|
return i.files.length ? /* @__PURE__ */ Q("div", {
|
|
1391
|
-
className:
|
|
1391
|
+
className: W("flex flex-wrap items-center gap-2 p-3 w-full", t),
|
|
1392
1392
|
...r,
|
|
1393
1393
|
children: i.files.map((t) => /* @__PURE__ */ Q(n, { children: e(t) }, t.id))
|
|
1394
1394
|
}) : null;
|
|
@@ -1401,7 +1401,7 @@ var zr = ({ label: e = "Add photos or files", ...t }) => {
|
|
|
1401
1401
|
e.preventDefault(), n.openFileDialog();
|
|
1402
1402
|
},
|
|
1403
1403
|
children: [
|
|
1404
|
-
/* @__PURE__ */ Q(
|
|
1404
|
+
/* @__PURE__ */ Q(tt, { className: "mr-2 size-4" }),
|
|
1405
1405
|
" ",
|
|
1406
1406
|
e
|
|
1407
1407
|
]
|
|
@@ -1529,7 +1529,7 @@ var zr = ({ label: e = "Add photos or files", ...t }) => {
|
|
|
1529
1529
|
title: r,
|
|
1530
1530
|
type: "file"
|
|
1531
1531
|
}), /* @__PURE__ */ Q("form", {
|
|
1532
|
-
className:
|
|
1532
|
+
className: W("w-full", e),
|
|
1533
1533
|
onSubmit: (e) => {
|
|
1534
1534
|
e.preventDefault();
|
|
1535
1535
|
let t = e.currentTarget, n = v ? _.textInput.value : new FormData(t).get("message") || "";
|
|
@@ -1566,7 +1566,7 @@ var zr = ({ label: e = "Add photos or files", ...t }) => {
|
|
|
1566
1566
|
children: I
|
|
1567
1567
|
});
|
|
1568
1568
|
}, Vr = ({ className: e, ...t }) => /* @__PURE__ */ Q("div", {
|
|
1569
|
-
className:
|
|
1569
|
+
className: W("contents", e),
|
|
1570
1570
|
...t
|
|
1571
1571
|
}), Hr = ({ onChange: e, className: t, placeholder: n = "What would you like to know?", ...r }) => {
|
|
1572
1572
|
let i = jr(), a = Ir(), [o, s] = d(!1), c = (e) => {
|
|
@@ -1598,7 +1598,7 @@ var zr = ({ label: e = "Add photos or files", ...t }) => {
|
|
|
1598
1598
|
}
|
|
1599
1599
|
} : { onChange: e };
|
|
1600
1600
|
return /* @__PURE__ */ Q(Dr, {
|
|
1601
|
-
className:
|
|
1601
|
+
className: W("field-sizing-content max-h-48 min-h-16", t),
|
|
1602
1602
|
name: "message",
|
|
1603
1603
|
onCompositionEnd: () => s(!1),
|
|
1604
1604
|
onCompositionStart: () => s(!0),
|
|
@@ -1610,19 +1610,19 @@ var zr = ({ label: e = "Add photos or files", ...t }) => {
|
|
|
1610
1610
|
});
|
|
1611
1611
|
}, Ur = ({ className: e, ...t }) => /* @__PURE__ */ Q(wr, {
|
|
1612
1612
|
align: "block-end",
|
|
1613
|
-
className:
|
|
1613
|
+
className: W("order-first flex-wrap gap-1", e),
|
|
1614
1614
|
...t
|
|
1615
1615
|
}), Wr = ({ className: e, ...t }) => /* @__PURE__ */ Q(wr, {
|
|
1616
1616
|
align: "block-end",
|
|
1617
|
-
className:
|
|
1617
|
+
className: W("justify-between gap-1", e),
|
|
1618
1618
|
...t
|
|
1619
1619
|
}), Gr = ({ className: e, ...t }) => /* @__PURE__ */ Q("div", {
|
|
1620
|
-
className:
|
|
1620
|
+
className: W("flex items-center gap-1", e),
|
|
1621
1621
|
...t
|
|
1622
1622
|
}), Kr = ({ variant: e = "ghost", className: n, size: r, ...i }) => {
|
|
1623
1623
|
let a = r ?? (t.count(i.children) > 1 ? "sm" : "icon-sm");
|
|
1624
1624
|
return /* @__PURE__ */ Q(Er, {
|
|
1625
|
-
className:
|
|
1625
|
+
className: W(n),
|
|
1626
1626
|
size: a,
|
|
1627
1627
|
type: "button",
|
|
1628
1628
|
variant: e,
|
|
@@ -1633,20 +1633,20 @@ var zr = ({ label: e = "Add photos or files", ...t }) => {
|
|
|
1633
1633
|
children: /* @__PURE__ */ Q(Kr, {
|
|
1634
1634
|
className: e,
|
|
1635
1635
|
...n,
|
|
1636
|
-
children: t ?? /* @__PURE__ */ Q(
|
|
1636
|
+
children: t ?? /* @__PURE__ */ Q(lt, { className: "size-4" })
|
|
1637
1637
|
})
|
|
1638
1638
|
}), Yr = ({ className: e, ...t }) => /* @__PURE__ */ Q(P, {
|
|
1639
1639
|
align: "start",
|
|
1640
|
-
className:
|
|
1640
|
+
className: W(e),
|
|
1641
1641
|
...t
|
|
1642
1642
|
}), Xr = ({ className: e, ...t }) => /* @__PURE__ */ Q(F, {
|
|
1643
|
-
className:
|
|
1643
|
+
className: W(e),
|
|
1644
1644
|
...t
|
|
1645
1645
|
}), Zr = ({ className: e, variant: t = "default", size: n = "icon-sm", status: r, children: i, ...a }) => {
|
|
1646
|
-
let o = /* @__PURE__ */ Q(
|
|
1647
|
-
return r === "submitted" ? o = /* @__PURE__ */ Q(
|
|
1646
|
+
let o = /* @__PURE__ */ Q(Xe, { className: "size-4" });
|
|
1647
|
+
return r === "submitted" ? o = /* @__PURE__ */ Q(it, { className: "size-4 animate-spin" }) : r === "streaming" ? o = /* @__PURE__ */ Q(ht, { className: "size-4" }) : r === "error" && (o = /* @__PURE__ */ Q(X, { className: "size-4" })), /* @__PURE__ */ Q(Er, {
|
|
1648
1648
|
"aria-label": "Submit",
|
|
1649
|
-
className:
|
|
1649
|
+
className: W(e),
|
|
1650
1650
|
size: n,
|
|
1651
1651
|
type: "submit",
|
|
1652
1652
|
variant: t,
|
|
@@ -1684,23 +1684,23 @@ var zr = ({ label: e = "Add photos or files", ...t }) => {
|
|
|
1684
1684
|
s && (i ? s.stop() : s.start());
|
|
1685
1685
|
}, [s, i]);
|
|
1686
1686
|
return /* @__PURE__ */ Q(Kr, {
|
|
1687
|
-
className:
|
|
1687
|
+
className: W("relative transition-all duration-200", i && "animate-pulse bg-accent text-accent-foreground", e),
|
|
1688
1688
|
disabled: !s,
|
|
1689
1689
|
onClick: p,
|
|
1690
1690
|
...r,
|
|
1691
|
-
children: /* @__PURE__ */ Q(
|
|
1691
|
+
children: /* @__PURE__ */ Q(ot, { className: "size-4" })
|
|
1692
1692
|
});
|
|
1693
|
-
}, $r = (e) => /* @__PURE__ */ Q(
|
|
1694
|
-
className:
|
|
1693
|
+
}, $r = (e) => /* @__PURE__ */ Q(ue, { ...e }), ei = ({ className: e, ...t }) => /* @__PURE__ */ Q(pe, {
|
|
1694
|
+
className: W("border-none bg-transparent font-medium text-muted-foreground shadow-none transition-colors", "hover:bg-accent hover:text-foreground aria-expanded:bg-accent aria-expanded:text-foreground", e),
|
|
1695
1695
|
...t
|
|
1696
|
-
}), ti = ({ className: e, ...t }) => /* @__PURE__ */ Q(
|
|
1697
|
-
className:
|
|
1696
|
+
}), ti = ({ className: e, ...t }) => /* @__PURE__ */ Q(de, {
|
|
1697
|
+
className: W(e),
|
|
1698
1698
|
...t
|
|
1699
|
-
}), ni = ({ className: e, ...t }) => /* @__PURE__ */ Q(
|
|
1700
|
-
className:
|
|
1699
|
+
}), ni = ({ className: e, ...t }) => /* @__PURE__ */ Q(fe, {
|
|
1700
|
+
className: W(e),
|
|
1701
1701
|
...t
|
|
1702
|
-
}), ri = ({ className: e, ...t }) => /* @__PURE__ */ Q(
|
|
1703
|
-
className:
|
|
1702
|
+
}), ri = ({ className: e, ...t }) => /* @__PURE__ */ Q(me, {
|
|
1703
|
+
className: W(e),
|
|
1704
1704
|
...t
|
|
1705
1705
|
}), ii = ({ openDelay: e = 0, closeDelay: t = 0, ...n }) => /* @__PURE__ */ Q(R, {
|
|
1706
1706
|
closeDelay: t,
|
|
@@ -1710,53 +1710,53 @@ var zr = ({ label: e = "Add photos or files", ...t }) => {
|
|
|
1710
1710
|
align: e,
|
|
1711
1711
|
...t
|
|
1712
1712
|
}), si = ({ className: e, ...t }) => /* @__PURE__ */ Q("div", {
|
|
1713
|
-
className:
|
|
1713
|
+
className: W(e),
|
|
1714
1714
|
...t
|
|
1715
1715
|
}), ci = ({ className: e, ...t }) => /* @__PURE__ */ Q("div", {
|
|
1716
|
-
className:
|
|
1716
|
+
className: W(e),
|
|
1717
1717
|
...t
|
|
1718
1718
|
}), li = ({ className: e, ...t }) => /* @__PURE__ */ Q("h3", {
|
|
1719
|
-
className:
|
|
1719
|
+
className: W("mb-2 px-3 font-medium text-muted-foreground text-xs", e),
|
|
1720
1720
|
...t
|
|
1721
1721
|
}), ui = ({ className: e, ...t }) => /* @__PURE__ */ Q("div", {
|
|
1722
|
-
className:
|
|
1722
|
+
className: W("space-y-1", e),
|
|
1723
1723
|
...t
|
|
1724
1724
|
}), di = ({ className: e, ...t }) => /* @__PURE__ */ Q("div", {
|
|
1725
|
-
className:
|
|
1725
|
+
className: W("flex items-center gap-2 px-3 py-2 text-xs hover:bg-accent", e),
|
|
1726
1726
|
...t
|
|
1727
1727
|
}), fi = ({ className: e, ...t }) => /* @__PURE__ */ Q(D, {
|
|
1728
|
-
className:
|
|
1728
|
+
className: W(e),
|
|
1729
1729
|
...t
|
|
1730
1730
|
}), pi = ({ className: e, ...t }) => /* @__PURE__ */ Q(A, {
|
|
1731
|
-
className:
|
|
1731
|
+
className: W(e),
|
|
1732
1732
|
...t
|
|
1733
1733
|
}), mi = ({ className: e, ...t }) => /* @__PURE__ */ Q(M, {
|
|
1734
|
-
className:
|
|
1734
|
+
className: W(e),
|
|
1735
1735
|
...t
|
|
1736
1736
|
}), hi = ({ className: e, ...t }) => /* @__PURE__ */ Q(O, {
|
|
1737
|
-
className:
|
|
1737
|
+
className: W(e),
|
|
1738
1738
|
...t
|
|
1739
1739
|
}), gi = ({ className: e, ...t }) => /* @__PURE__ */ Q(k, {
|
|
1740
|
-
className:
|
|
1740
|
+
className: W(e),
|
|
1741
1741
|
...t
|
|
1742
1742
|
}), _i = ({ className: e, ...t }) => /* @__PURE__ */ Q(j, {
|
|
1743
|
-
className:
|
|
1743
|
+
className: W(e),
|
|
1744
1744
|
...t
|
|
1745
1745
|
}), vi = ({ className: e, ...t }) => /* @__PURE__ */ Q(N, {
|
|
1746
|
-
className:
|
|
1746
|
+
className: W(e),
|
|
1747
1747
|
...t
|
|
1748
|
-
}), yi = ({ className: e, children: t, ...n }) => /* @__PURE__ */ $(
|
|
1748
|
+
}), yi = ({ className: e, children: t, ...n }) => /* @__PURE__ */ $(ce, {
|
|
1749
1749
|
className: "w-full overflow-x-auto whitespace-nowrap",
|
|
1750
1750
|
...n,
|
|
1751
1751
|
children: [/* @__PURE__ */ Q("div", {
|
|
1752
|
-
className:
|
|
1752
|
+
className: W("flex w-max flex-nowrap items-center gap-2", e),
|
|
1753
1753
|
children: t
|
|
1754
|
-
}), /* @__PURE__ */ Q(
|
|
1754
|
+
}), /* @__PURE__ */ Q(le, {
|
|
1755
1755
|
className: "hidden",
|
|
1756
1756
|
orientation: "horizontal"
|
|
1757
1757
|
})]
|
|
1758
1758
|
}), bi = ({ suggestion: e, onClick: t, className: n, variant: r = "outline", size: i = "sm", children: a, ...o }) => /* @__PURE__ */ Q(v, {
|
|
1759
|
-
className:
|
|
1759
|
+
className: W("cursor-pointer rounded-full px-4", n),
|
|
1760
1760
|
onClick: () => {
|
|
1761
1761
|
t?.(e);
|
|
1762
1762
|
},
|
|
@@ -1811,7 +1811,7 @@ var wi = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
|
|
|
1811
1811
|
]), /* @__PURE__ */ Q(xi.Provider, {
|
|
1812
1812
|
value: { code: e },
|
|
1813
1813
|
children: /* @__PURE__ */ Q("div", {
|
|
1814
|
-
className:
|
|
1814
|
+
className: W("group relative w-full overflow-hidden rounded-md border bg-background text-foreground", r),
|
|
1815
1815
|
...a,
|
|
1816
1816
|
children: /* @__PURE__ */ $("div", {
|
|
1817
1817
|
className: "relative",
|
|
@@ -1843,9 +1843,9 @@ var wi = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
|
|
|
1843
1843
|
} catch (e) {
|
|
1844
1844
|
t?.(e);
|
|
1845
1845
|
}
|
|
1846
|
-
}, f = o ?
|
|
1846
|
+
}, f = o ? ze : Je;
|
|
1847
1847
|
return /* @__PURE__ */ Q(v, {
|
|
1848
|
-
className:
|
|
1848
|
+
className: W("shrink-0", i),
|
|
1849
1849
|
onClick: u,
|
|
1850
1850
|
size: "icon",
|
|
1851
1851
|
variant: "ghost",
|
|
@@ -1853,19 +1853,19 @@ var wi = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
|
|
|
1853
1853
|
children: r ?? /* @__PURE__ */ Q(f, { size: 14 })
|
|
1854
1854
|
});
|
|
1855
1855
|
}, Ei = ({ className: e, ...t }) => /* @__PURE__ */ Q(w, {
|
|
1856
|
-
className:
|
|
1856
|
+
className: W("not-prose mb-4 w-full rounded-md border", e),
|
|
1857
1857
|
...t
|
|
1858
1858
|
}), Di = (e) => /* @__PURE__ */ $(_, {
|
|
1859
1859
|
className: "gap-1.5 rounded-full text-xs",
|
|
1860
1860
|
variant: "secondary",
|
|
1861
1861
|
children: [{
|
|
1862
|
-
"input-streaming": /* @__PURE__ */ Q(
|
|
1863
|
-
"input-available": /* @__PURE__ */ Q(
|
|
1864
|
-
"approval-requested": /* @__PURE__ */ Q(
|
|
1865
|
-
"approval-responded": /* @__PURE__ */ Q(
|
|
1866
|
-
"output-available": /* @__PURE__ */ Q(
|
|
1867
|
-
"output-error": /* @__PURE__ */ Q(
|
|
1868
|
-
"output-denied": /* @__PURE__ */ Q(
|
|
1862
|
+
"input-streaming": /* @__PURE__ */ Q(He, { className: "size-4" }),
|
|
1863
|
+
"input-available": /* @__PURE__ */ Q(Ke, { className: "size-4 animate-pulse" }),
|
|
1864
|
+
"approval-requested": /* @__PURE__ */ Q(Ke, { className: "size-4 text-yellow-600" }),
|
|
1865
|
+
"approval-responded": /* @__PURE__ */ Q(Re, { className: "size-4 text-blue-600" }),
|
|
1866
|
+
"output-available": /* @__PURE__ */ Q(Re, { className: "size-4 text-green-600" }),
|
|
1867
|
+
"output-error": /* @__PURE__ */ Q(bt, { className: "size-4 text-red-600" }),
|
|
1868
|
+
"output-denied": /* @__PURE__ */ Q(bt, { className: "size-4 text-orange-600" })
|
|
1869
1869
|
}[e], {
|
|
1870
1870
|
"input-streaming": "Pending",
|
|
1871
1871
|
"input-available": "Running",
|
|
@@ -1876,24 +1876,24 @@ var wi = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
|
|
|
1876
1876
|
"output-denied": "Denied"
|
|
1877
1877
|
}[e]]
|
|
1878
1878
|
}), Oi = ({ className: e, title: t, type: n, state: r, ...i }) => /* @__PURE__ */ $(E, {
|
|
1879
|
-
className:
|
|
1879
|
+
className: W("flex w-full items-center justify-between gap-4 p-3", e),
|
|
1880
1880
|
...i,
|
|
1881
1881
|
children: [/* @__PURE__ */ $("div", {
|
|
1882
1882
|
className: "flex items-center gap-2",
|
|
1883
1883
|
children: [
|
|
1884
|
-
/* @__PURE__ */ Q(
|
|
1884
|
+
/* @__PURE__ */ Q(yt, { className: "size-4 text-muted-foreground" }),
|
|
1885
1885
|
/* @__PURE__ */ Q("span", {
|
|
1886
1886
|
className: "font-medium text-sm",
|
|
1887
1887
|
children: t ?? n.split("-").slice(1).join("-")
|
|
1888
1888
|
}),
|
|
1889
1889
|
Di(r)
|
|
1890
1890
|
]
|
|
1891
|
-
}), /* @__PURE__ */ Q(
|
|
1891
|
+
}), /* @__PURE__ */ Q(Be, { className: "size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180" })]
|
|
1892
1892
|
}), ki = ({ className: e, ...t }) => /* @__PURE__ */ Q(T, {
|
|
1893
|
-
className:
|
|
1893
|
+
className: W("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", e),
|
|
1894
1894
|
...t
|
|
1895
1895
|
}), Ai = ({ className: e, input: t, ...n }) => /* @__PURE__ */ $("div", {
|
|
1896
|
-
className:
|
|
1896
|
+
className: W("space-y-2 overflow-hidden p-4", e),
|
|
1897
1897
|
...n,
|
|
1898
1898
|
children: [/* @__PURE__ */ Q("h4", {
|
|
1899
1899
|
className: "font-medium text-muted-foreground text-xs uppercase tracking-wide",
|
|
@@ -1915,13 +1915,13 @@ var wi = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
|
|
|
1915
1915
|
code: t,
|
|
1916
1916
|
language: "json"
|
|
1917
1917
|
})), /* @__PURE__ */ $("div", {
|
|
1918
|
-
className:
|
|
1918
|
+
className: W("space-y-2 p-4", e),
|
|
1919
1919
|
...r,
|
|
1920
1920
|
children: [/* @__PURE__ */ Q("h4", {
|
|
1921
1921
|
className: "font-medium text-muted-foreground text-xs uppercase tracking-wide",
|
|
1922
1922
|
children: n ? "Error" : "Result"
|
|
1923
1923
|
}), /* @__PURE__ */ $("div", {
|
|
1924
|
-
className:
|
|
1924
|
+
className: W("overflow-x-auto rounded-md text-xs [&_table]:w-full", n ? "bg-destructive/10 text-destructive" : "bg-muted/50 text-foreground"),
|
|
1925
1925
|
children: [n && /* @__PURE__ */ Q("div", { children: n }), a]
|
|
1926
1926
|
})]
|
|
1927
1927
|
});
|
|
@@ -1929,7 +1929,7 @@ var wi = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
|
|
|
1929
1929
|
let a = Pt.create(t), o = l(() => (e?.length ?? 0) * i, [e, i]);
|
|
1930
1930
|
return /* @__PURE__ */ Q(a, {
|
|
1931
1931
|
animate: { backgroundPosition: "0% center" },
|
|
1932
|
-
className:
|
|
1932
|
+
className: W("relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent", "[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]", n),
|
|
1933
1933
|
initial: { backgroundPosition: "100% center" },
|
|
1934
1934
|
style: {
|
|
1935
1935
|
"--spread": `${o}px`,
|
|
@@ -1982,7 +1982,7 @@ var wi = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
|
|
|
1982
1982
|
duration: f
|
|
1983
1983
|
},
|
|
1984
1984
|
children: /* @__PURE__ */ Q(w, {
|
|
1985
|
-
className:
|
|
1985
|
+
className: W("not-prose mb-4", e),
|
|
1986
1986
|
onOpenChange: (e) => {
|
|
1987
1987
|
u(e);
|
|
1988
1988
|
},
|
|
@@ -2001,16 +2001,16 @@ var wi = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
|
|
|
2001
2001
|
] }), zi = a(({ className: e, children: t, getThinkingMessage: n = Ri, ...r }) => {
|
|
2002
2002
|
let { isStreaming: i, isOpen: a, duration: o } = Pi();
|
|
2003
2003
|
return /* @__PURE__ */ Q(E, {
|
|
2004
|
-
className:
|
|
2004
|
+
className: W("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground", e),
|
|
2005
2005
|
...r,
|
|
2006
2006
|
children: t ?? /* @__PURE__ */ $(Z, { children: [
|
|
2007
|
-
/* @__PURE__ */ Q(
|
|
2007
|
+
/* @__PURE__ */ Q(Ie, { className: "size-4" }),
|
|
2008
2008
|
n(i, o),
|
|
2009
|
-
/* @__PURE__ */ Q(
|
|
2009
|
+
/* @__PURE__ */ Q(Be, { className: W("size-4 transition-transform", a ? "rotate-180" : "rotate-0") })
|
|
2010
2010
|
] })
|
|
2011
2011
|
});
|
|
2012
2012
|
}), Bi = a(({ className: e, children: t, ...n }) => /* @__PURE__ */ Q(T, {
|
|
2013
|
-
className:
|
|
2013
|
+
className: W("mt-4 text-sm", "data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in", e),
|
|
2014
2014
|
...n,
|
|
2015
2015
|
children: /* @__PURE__ */ Q(At, { children: t })
|
|
2016
2016
|
}));
|
|
@@ -2018,10 +2018,10 @@ Li.displayName = "Reasoning", zi.displayName = "ReasoningTrigger", Bi.displayNam
|
|
|
2018
2018
|
//#endregion
|
|
2019
2019
|
//#region src/elements/sources.tsx
|
|
2020
2020
|
var Vi = ({ className: e, ...t }) => /* @__PURE__ */ Q(w, {
|
|
2021
|
-
className:
|
|
2021
|
+
className: W("not-prose mb-4 text-primary text-xs", e),
|
|
2022
2022
|
...t
|
|
2023
2023
|
}), Hi = ({ className: e, count: t, children: n, ...r }) => /* @__PURE__ */ Q(E, {
|
|
2024
|
-
className:
|
|
2024
|
+
className: W("flex items-center gap-2", e),
|
|
2025
2025
|
...r,
|
|
2026
2026
|
children: n ?? /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ $("p", {
|
|
2027
2027
|
className: "font-medium",
|
|
@@ -2030,9 +2030,9 @@ var Vi = ({ className: e, ...t }) => /* @__PURE__ */ Q(w, {
|
|
|
2030
2030
|
t,
|
|
2031
2031
|
" sources"
|
|
2032
2032
|
]
|
|
2033
|
-
}), /* @__PURE__ */ Q(
|
|
2033
|
+
}), /* @__PURE__ */ Q(Be, { className: "h-4 w-4" })] })
|
|
2034
2034
|
}), Ui = ({ className: e, ...t }) => /* @__PURE__ */ Q(T, {
|
|
2035
|
-
className:
|
|
2035
|
+
className: W("mt-3 flex w-fit flex-col gap-2", "data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 outline-none data-[state=closed]:animate-out data-[state=open]:animate-in", e),
|
|
2036
2036
|
...t
|
|
2037
2037
|
}), Wi = ({ href: e, title: t, children: n, ...r }) => /* @__PURE__ */ Q("a", {
|
|
2038
2038
|
className: "flex items-center gap-2",
|
|
@@ -2040,7 +2040,7 @@ var Vi = ({ className: e, ...t }) => /* @__PURE__ */ Q(w, {
|
|
|
2040
2040
|
rel: "noreferrer",
|
|
2041
2041
|
target: "_blank",
|
|
2042
2042
|
...r,
|
|
2043
|
-
children: n ?? /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ Q(
|
|
2043
|
+
children: n ?? /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ Q(G, { className: "h-4 w-4" }), /* @__PURE__ */ Q("span", {
|
|
2044
2044
|
className: "block font-medium",
|
|
2045
2045
|
children: t
|
|
2046
2046
|
})] })
|
|
@@ -2193,25 +2193,25 @@ function aa({ health: e }) {
|
|
|
2193
2193
|
children: [
|
|
2194
2194
|
o.length > 0 ? /* @__PURE__ */ $("div", {
|
|
2195
2195
|
className: "flex items-center gap-1.5 text-xs text-emerald-700",
|
|
2196
|
-
children: [/* @__PURE__ */ Q(
|
|
2196
|
+
children: [/* @__PURE__ */ Q(K, { className: "size-3.5 shrink-0" }), /* @__PURE__ */ Q("span", { children: o.join(" · ") })]
|
|
2197
2197
|
}) : null,
|
|
2198
2198
|
e.seedError ? /* @__PURE__ */ $("div", {
|
|
2199
2199
|
className: "flex items-start gap-1.5 text-xs text-red-600",
|
|
2200
|
-
children: [/* @__PURE__ */ Q(
|
|
2200
|
+
children: [/* @__PURE__ */ Q(Y, { className: "mt-0.5 size-3.5 shrink-0" }), /* @__PURE__ */ Q("span", { children: e.seedError })]
|
|
2201
2201
|
}) : null,
|
|
2202
2202
|
n.map((e, t) => /* @__PURE__ */ $("div", {
|
|
2203
2203
|
className: "flex items-start gap-1.5 text-xs text-red-600",
|
|
2204
|
-
children: [/* @__PURE__ */ Q(
|
|
2204
|
+
children: [/* @__PURE__ */ Q(Y, { className: "mt-0.5 size-3.5 shrink-0" }), /* @__PURE__ */ Q("span", { children: e.message })]
|
|
2205
2205
|
}, `e${t}`)),
|
|
2206
2206
|
r.map((e, t) => /* @__PURE__ */ $("div", {
|
|
2207
2207
|
className: "flex items-start gap-1.5 text-xs text-amber-600",
|
|
2208
|
-
children: [/* @__PURE__ */ Q(
|
|
2208
|
+
children: [/* @__PURE__ */ Q(Me, { className: "mt-0.5 size-3.5 shrink-0" }), /* @__PURE__ */ Q("span", { children: e.message })]
|
|
2209
2209
|
}, `w${t}`))
|
|
2210
2210
|
]
|
|
2211
2211
|
});
|
|
2212
2212
|
}
|
|
2213
|
-
var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type your message...", onSendMessage: i, onClear: a, onStop: o, onReload: s, onUpgrade: c, disabled: l = !1, readOnly: u = !1, isLoading: d = !1, error: f, showTimestamp: p = !1, showAvatars: m = !1, userAvatarUrl: h, userAvatarFallback: g = "You", assistantAvatarUrl: _, assistantAvatarFallback: v = "AI", hideClearBar: y = !1, maxHeight: b = "500px", enableMarkdown: x = !0, enableFileUpload: S = !1, acceptedFileTypes: C = "image/*,.pdf,.doc,.docx,.txt,.csv,.tsv,.xlsx,.xlsm", maxFileSize: w = 10 * 1024 * 1024, suggestions: T, labels: E, models: D, selectedModelId: O, onModelChange: k, headerSlot: A, promptOverlaySlot: j, onInputChange: M, onToolApprove: N, toolApproveLabel: ee = "Approve", toolDenyLabel: P = "Deny", toolDenyReason: F = "User denied the operation", toolDecisions: I, onReviewDraft: te, toolReviewLabel: ne = (e) => `Review ${e} change${e === 1 ? "" : "s"}`, onPublishDrafts: L, onOpenBuiltApp: re, openBuiltAppLabel: ie = "Open app",
|
|
2214
|
-
let G = d ? "streaming" : "ready",
|
|
2213
|
+
var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type your message...", onSendMessage: i, onClear: a, onStop: o, onReload: s, onUpgrade: c, disabled: l = !1, readOnly: u = !1, isLoading: d = !1, error: f, showTimestamp: p = !1, showAvatars: m = !1, userAvatarUrl: h, userAvatarFallback: g = "You", assistantAvatarUrl: _, assistantAvatarFallback: v = "AI", hideClearBar: y = !1, maxHeight: b = "500px", enableMarkdown: x = !0, enableFileUpload: S = !1, acceptedFileTypes: C = "image/*,.pdf,.doc,.docx,.txt,.csv,.tsv,.xlsx,.xlsm", maxFileSize: w = 10 * 1024 * 1024, suggestions: T, labels: E, models: D, selectedModelId: O, onModelChange: k, headerSlot: A, promptOverlaySlot: j, onInputChange: M, onToolApprove: N, toolApproveLabel: ee = "Approve", toolDenyLabel: P = "Deny", toolDenyReason: F = "User denied the operation", toolDecisions: I, onReviewDraft: te, toolReviewLabel: ne = (e) => `Review ${e} change${e === 1 ? "" : "s"}`, onPublishDrafts: L, onOpenBuiltApp: re, openBuiltAppLabel: ie = "Open app", onDesignBuiltApp: R, designBuiltAppLabel: ae = "Design in Studio", getArtifactAction: oe, onPreviewDraftApp: se, previewDraftLabel: z = "Preview", onDraftArtifacts: ce, onBuildMaterialized: le, publishDraftsLabel: ue = "Publish", publishedLabel: de = "Published", verifiedLabel: fe = "Verified", nextStepsLabel: pe = "What's next", planTitleLabel: me = "Proposed plan", builderHandoffTitleLabel: he = "Build this in the Builder", builderHandoffOpenLabel: ge = "Open in Builder →", builderHandoffSupersededTitle: _e = "A newer request is available", onOpenBuilder: ve, planExtendLabel: ye = "Adding to existing app", planQuestionsLabel: be = "Confirm before building", planAssumptionsLabel: xe = "Assumptions", planDeferredLabel: Se = "Not yet built", planApproveHintLabel: Ce = "Reply to approve or adjust this plan.", planApproveLabel: B = "Build it", planAdjustLabel: V = "Adjust", planBuiltLabel: we = "Built", planBuildingLabel: Te = "Building…", planReadyLabel: Ee = "The plan is ready. Build it now, or tell me what to adjust.", planApproveMessage: De = "Looks good — build it as proposed.", planApproveDefaultsMessage: Oe = "Build it with your best assumptions; use sensible defaults for the open questions.", planAnswerMessage: ke = (e, t) => `For "${e}", go with: ${t}.`, fetchPendingDraftCount: H, autoPublishDrafts: Ae = !1, processVisibility: U = "summary", surface: je = "card", ...Ne }, Pe) => {
|
|
2214
|
+
let G = d ? "streaming" : "ready", Ie = je === "plain", [Re, ze] = e.useState(null), Be = e.useRef(""), Ve = e.useRef(null), q = e.useMemo(() => ({
|
|
2215
2215
|
emptyTitle: E?.emptyTitle ?? "Start a conversation",
|
|
2216
2216
|
emptyDescription: E?.emptyDescription ?? "Ask anything — the assistant has access to your current app context.",
|
|
2217
2217
|
clear: E?.clear ?? "Clear",
|
|
@@ -2238,54 +2238,54 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2238
2238
|
connectionOfflineLabel: E?.connectionOfflineLabel ?? "Connection lost — reconnecting…",
|
|
2239
2239
|
designingPlanLabel: E?.designingPlanLabel ?? "Designing your app…",
|
|
2240
2240
|
designingPlanHints: E?.designingPlanHints ?? ha
|
|
2241
|
-
}), [E]), [
|
|
2242
|
-
if (
|
|
2243
|
-
let t = await
|
|
2244
|
-
|
|
2241
|
+
}), [E]), [He, We] = e.useState(() => /* @__PURE__ */ new Set()), [Ge, Ke] = e.useState(() => /* @__PURE__ */ new Map()), [Je, Xe] = e.useState(() => /* @__PURE__ */ new Map()), tt = e.useRef(/* @__PURE__ */ new Set()), nt = e.useCallback(async (e) => {
|
|
2242
|
+
if (H) try {
|
|
2243
|
+
let t = await H(e);
|
|
2244
|
+
Xe((n) => {
|
|
2245
2245
|
if (n.get(e) === t) return n;
|
|
2246
2246
|
let r = new Map(n);
|
|
2247
2247
|
return r.set(e, t), r;
|
|
2248
2248
|
});
|
|
2249
2249
|
} catch {}
|
|
2250
|
-
}, [
|
|
2250
|
+
}, [H]);
|
|
2251
2251
|
e.useEffect(() => {
|
|
2252
|
-
if (!
|
|
2252
|
+
if (!H || d) return;
|
|
2253
2253
|
let e = /* @__PURE__ */ new Set();
|
|
2254
2254
|
for (let t of n) for (let n of t.toolInvocations ?? []) {
|
|
2255
2255
|
let t = n.draftReview?.packageId, r = n.toolCallId;
|
|
2256
|
-
t && r && !
|
|
2256
|
+
t && r && !tt.current.has(r) && (tt.current.add(r), e.add(t));
|
|
2257
2257
|
}
|
|
2258
|
-
for (let t of e)
|
|
2258
|
+
for (let t of e) nt(t);
|
|
2259
2259
|
}, [
|
|
2260
2260
|
n,
|
|
2261
2261
|
d,
|
|
2262
|
-
|
|
2263
|
-
|
|
2262
|
+
H,
|
|
2263
|
+
nt
|
|
2264
2264
|
]);
|
|
2265
|
-
let
|
|
2265
|
+
let it = e.useCallback(async (e) => {
|
|
2266
2266
|
if (!L) return;
|
|
2267
2267
|
let t = [];
|
|
2268
2268
|
for (let r of n) for (let n of r.toolInvocations ?? []) n.draftReview?.packageId === e && n.toolCallId && t.push(n.toolCallId);
|
|
2269
2269
|
let r = await L(e), i = r && typeof r == "object" ? r : void 0;
|
|
2270
2270
|
if ((i ? i.ok !== !1 : r !== !1) && t.length > 0) {
|
|
2271
|
-
|
|
2271
|
+
We((e) => {
|
|
2272
2272
|
let n = new Set(e);
|
|
2273
2273
|
for (let e of t) n.add(e);
|
|
2274
2274
|
return n;
|
|
2275
2275
|
});
|
|
2276
2276
|
let e = i?.health;
|
|
2277
|
-
e &&
|
|
2277
|
+
e && Ke((n) => {
|
|
2278
2278
|
let r = new Map(n);
|
|
2279
2279
|
for (let n of t) r.set(n, e);
|
|
2280
2280
|
return r;
|
|
2281
2281
|
});
|
|
2282
2282
|
}
|
|
2283
|
-
|
|
2283
|
+
nt(e);
|
|
2284
2284
|
}, [
|
|
2285
2285
|
L,
|
|
2286
2286
|
n,
|
|
2287
|
-
|
|
2288
|
-
]),
|
|
2287
|
+
nt
|
|
2288
|
+
]), at = e.useRef(/* @__PURE__ */ new Set()), ot = e.useRef(!1);
|
|
2289
2289
|
e.useEffect(() => {
|
|
2290
2290
|
let e = [];
|
|
2291
2291
|
for (let t of n) for (let n of t.toolInvocations ?? []) {
|
|
@@ -2295,27 +2295,27 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2295
2295
|
packageId: t.packageId
|
|
2296
2296
|
});
|
|
2297
2297
|
}
|
|
2298
|
-
if (
|
|
2299
|
-
|
|
2300
|
-
for (let t of e)
|
|
2298
|
+
if (!ot.current) {
|
|
2299
|
+
ot.current = !0;
|
|
2300
|
+
for (let t of e) at.current.add(t.key);
|
|
2301
2301
|
return;
|
|
2302
2302
|
}
|
|
2303
|
-
if (!
|
|
2304
|
-
let t = e.filter((e) => !
|
|
2303
|
+
if (!Ae || !L || d) return;
|
|
2304
|
+
let t = e.filter((e) => !at.current.has(e.key));
|
|
2305
2305
|
if (t.length !== 0) {
|
|
2306
|
-
for (let e of t)
|
|
2307
|
-
for (let e of [...new Set(t.map((e) => e.packageId))])
|
|
2306
|
+
for (let e of t) at.current.add(e.key);
|
|
2307
|
+
for (let e of [...new Set(t.map((e) => e.packageId))]) it(e);
|
|
2308
2308
|
}
|
|
2309
2309
|
}, [
|
|
2310
2310
|
n,
|
|
2311
2311
|
d,
|
|
2312
|
-
|
|
2312
|
+
Ae,
|
|
2313
2313
|
L,
|
|
2314
|
-
|
|
2314
|
+
it
|
|
2315
2315
|
]);
|
|
2316
|
-
let
|
|
2316
|
+
let st = e.useRef(/* @__PURE__ */ new Set());
|
|
2317
2317
|
e.useEffect(() => {
|
|
2318
|
-
if (!
|
|
2318
|
+
if (!ce) return;
|
|
2319
2319
|
let e = /* @__PURE__ */ new Map(), t;
|
|
2320
2320
|
for (let r of n) {
|
|
2321
2321
|
for (let t of r.buildProgress?.items ?? []) t?.type && t?.name && e.set(`${t.type}:${t.name}`, t);
|
|
@@ -2325,47 +2325,57 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2325
2325
|
r?.packageId && r.items?.some((e) => e.type === "app") && (t = r.packageId);
|
|
2326
2326
|
}
|
|
2327
2327
|
}
|
|
2328
|
-
let r =
|
|
2328
|
+
let r = st.current, i = !1;
|
|
2329
2329
|
for (let t of e.keys()) r.has(t) || (r.add(t), i = !0);
|
|
2330
|
-
i &&
|
|
2331
|
-
}, [n,
|
|
2332
|
-
let
|
|
2330
|
+
i && ce([...e.values()], t);
|
|
2331
|
+
}, [n, ce]);
|
|
2332
|
+
let ct = e.useRef(/* @__PURE__ */ new Set());
|
|
2333
2333
|
e.useEffect(() => {
|
|
2334
|
-
if (
|
|
2334
|
+
if (le) for (let e of n) for (let t of e.toolInvocations ?? []) {
|
|
2335
2335
|
let e = t.draftReview;
|
|
2336
2336
|
if (!e?.materialized || !t.toolCallId) continue;
|
|
2337
2337
|
let n = e.items.find((e) => e.type === "app");
|
|
2338
|
-
!n ||
|
|
2338
|
+
!n || ct.current.has(t.toolCallId) || (ct.current.add(t.toolCallId), le(n.name));
|
|
2339
2339
|
}
|
|
2340
|
-
}, [n,
|
|
2341
|
-
let
|
|
2340
|
+
}, [n, le]);
|
|
2341
|
+
let lt = e.useCallback((e) => {
|
|
2342
2342
|
let t = !!e.text?.trim(), n = e.files?.map((e) => e.file).filter(Boolean), r = !!(n && n.length > 0);
|
|
2343
2343
|
if (!(t || r)) return;
|
|
2344
2344
|
let a = e.text?.trim() ?? "";
|
|
2345
|
-
|
|
2346
|
-
}, [i]),
|
|
2347
|
-
i?.(e);
|
|
2348
|
-
}, [i]),
|
|
2349
|
-
|
|
2345
|
+
Be.current = a, Ve.current = null, J.current = null, i?.(a, n);
|
|
2346
|
+
}, [i]), ft = e.useCallback((e) => {
|
|
2347
|
+
J.current = null, i?.(e);
|
|
2348
|
+
}, [i]), ht = e.useRef(null), [vt, yt] = e.useState(() => /* @__PURE__ */ new Set()), J = e.useRef(null), bt = e.useCallback((e, t) => {
|
|
2349
|
+
t && (J.current = t, yt((e) => {
|
|
2350
|
+
let n = new Set(e);
|
|
2351
|
+
return n.add(t), n;
|
|
2352
|
+
})), i?.(e ? Oe : De);
|
|
2350
2353
|
}, [
|
|
2351
2354
|
i,
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
]),
|
|
2355
|
-
let e =
|
|
2355
|
+
De,
|
|
2356
|
+
Oe
|
|
2357
|
+
]), X = e.useCallback(() => {
|
|
2358
|
+
let e = ht.current?.querySelector("textarea");
|
|
2356
2359
|
e && (e.focus(), e.scrollIntoView({ block: "nearest" }));
|
|
2357
2360
|
}, []);
|
|
2358
2361
|
e.useEffect(() => {
|
|
2359
|
-
if (!f || !Xn(f) ||
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
+
if (!f || !Xn(f) || Ve.current === f) return;
|
|
2363
|
+
if (Ve.current = f, J.current) {
|
|
2364
|
+
let e = J.current;
|
|
2365
|
+
J.current = null, yt((t) => {
|
|
2366
|
+
if (!t.has(e)) return t;
|
|
2367
|
+
let n = new Set(t);
|
|
2368
|
+
return n.delete(e), n;
|
|
2369
|
+
});
|
|
2370
|
+
}
|
|
2371
|
+
let e = Be.current;
|
|
2362
2372
|
if (!e) return;
|
|
2363
|
-
let t =
|
|
2373
|
+
let t = ht.current?.querySelector("textarea");
|
|
2364
2374
|
t && t.value.trim() === "" && (t.value = e, t.dispatchEvent(new Event("input", { bubbles: !0 })), t.focus());
|
|
2365
2375
|
}, [f]);
|
|
2366
|
-
let
|
|
2367
|
-
navigator.clipboard?.writeText(e.content),
|
|
2368
|
-
}, []),
|
|
2376
|
+
let xt = e.useCallback((e) => {
|
|
2377
|
+
navigator.clipboard?.writeText(e.content), ze(e.id), window.setTimeout(() => ze((t) => t === e.id ? null : t), 1500);
|
|
2378
|
+
}, []), St = e.useMemo(() => {
|
|
2369
2379
|
let e = /* @__PURE__ */ new Set(), t = [], r = -1, i = 0;
|
|
2370
2380
|
for (let e of n) for (let n of e.toolInvocations ?? []) (n.proposedPlan || Qi(n)) && n.toolCallId && t.push({
|
|
2371
2381
|
id: n.toolCallId,
|
|
@@ -2373,11 +2383,11 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2373
2383
|
}), n.toolName === "apply_blueprint" && (r = i), i += 1;
|
|
2374
2384
|
for (let n of t) n.order < r && e.add(n.id);
|
|
2375
2385
|
return e;
|
|
2376
|
-
}, [n]),
|
|
2386
|
+
}, [n]), Ct = e.useMemo(() => {
|
|
2377
2387
|
let e;
|
|
2378
2388
|
for (let t of n) for (let n of t.toolInvocations ?? []) n.builderHandoff && n.toolCallId && (e = n.toolCallId);
|
|
2379
2389
|
return e;
|
|
2380
|
-
}, [n]),
|
|
2390
|
+
}, [n]), Tt = e.useMemo(() => {
|
|
2381
2391
|
let e = /* @__PURE__ */ new Set(), t = [], r = /* @__PURE__ */ new Map(), i = 0;
|
|
2382
2392
|
for (let e of n) for (let n of e.toolInvocations ?? []) n.proposedChanges && n.toolCallId ? t.push({
|
|
2383
2393
|
id: n.toolCallId,
|
|
@@ -2389,8 +2399,8 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2389
2399
|
t !== void 0 && t > n.order && e.add(n.id);
|
|
2390
2400
|
}
|
|
2391
2401
|
return e;
|
|
2392
|
-
}, [n]),
|
|
2393
|
-
let t = e.state ?? (e.errorText ? "output-error" : e.result === void 0 ? "input-available" : "output-available"), n = `tool-${e.toolName}`, r = I?.[e.toolCallId], a = t === "approval-requested" && !!N && !r, o = t === "approval-requested" && !!e.pendingActionId, s = Gn(e.toolName), c = Kn(e.result), l =
|
|
2402
|
+
}, [n]), Et = (e) => {
|
|
2403
|
+
let t = e.state ?? (e.errorText ? "output-error" : e.result === void 0 ? "input-available" : "output-available"), n = `tool-${e.toolName}`, r = I?.[e.toolCallId], a = t === "approval-requested" && !!N && !r, o = t === "approval-requested" && !!e.pendingActionId, s = Gn(e.toolName), c = Kn(e.result), l = U === "debug" && s && s.toLowerCase() !== e.toolName.toLowerCase(), u = U === "debug" || a, d = e.draftReview?.packageId, f = d === void 0 ? void 0 : Je.get(d), p = f === void 0 ? He.has(e.toolCallId) : f === 0, m = t === "input-streaming" || t === "input-available", h = t === "output-available" && Ji(e.result) ? "approval-requested" : t, g = /* @__PURE__ */ $("span", {
|
|
2394
2404
|
className: "inline-flex min-w-0 items-center gap-2",
|
|
2395
2405
|
children: [
|
|
2396
2406
|
/* @__PURE__ */ Q("span", { children: s || e.toolName }),
|
|
@@ -2399,10 +2409,10 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2399
2409
|
children: e.toolName
|
|
2400
2410
|
}) : null,
|
|
2401
2411
|
m ? Zi(e) ? /* @__PURE__ */ Q(va, {
|
|
2402
|
-
label:
|
|
2403
|
-
hints:
|
|
2404
|
-
offlineLabel:
|
|
2405
|
-
}) : /* @__PURE__ */ Q(ya, { offlineLabel:
|
|
2412
|
+
label: q.designingPlanLabel,
|
|
2413
|
+
hints: q.designingPlanHints,
|
|
2414
|
+
offlineLabel: q.connectionOfflineLabel
|
|
2415
|
+
}) : /* @__PURE__ */ Q(ya, { offlineLabel: q.connectionOfflineLabel }) : null
|
|
2406
2416
|
]
|
|
2407
2417
|
});
|
|
2408
2418
|
return /* @__PURE__ */ $(Ei, {
|
|
@@ -2445,18 +2455,18 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2445
2455
|
L && e.draftReview.packageId ? p ? /* @__PURE__ */ $("span", {
|
|
2446
2456
|
className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-emerald-200 bg-emerald-50 px-3 text-xs font-medium text-emerald-700",
|
|
2447
2457
|
children: [
|
|
2448
|
-
/* @__PURE__ */ Q(
|
|
2449
|
-
|
|
2458
|
+
/* @__PURE__ */ Q(K, { className: "size-3.5" }),
|
|
2459
|
+
de,
|
|
2450
2460
|
e.draftReview.failedCount ? ` · ${e.draftReview.failedCount} need${e.draftReview.failedCount === 1 ? "s" : ""} attention` : ""
|
|
2451
2461
|
]
|
|
2452
2462
|
}) : /* @__PURE__ */ $("button", {
|
|
2453
2463
|
type: "button",
|
|
2454
|
-
onClick: () => void
|
|
2464
|
+
onClick: () => void it(e.draftReview.packageId),
|
|
2455
2465
|
className: "inline-flex h-7 items-center gap-1.5 rounded-md bg-primary px-3 text-xs font-medium text-primary-foreground hover:bg-primary/90",
|
|
2456
2466
|
"data-testid": "draft-publish",
|
|
2457
2467
|
children: [
|
|
2458
|
-
/* @__PURE__ */ Q(
|
|
2459
|
-
|
|
2468
|
+
/* @__PURE__ */ Q(dt, { className: "size-3.5" }),
|
|
2469
|
+
ue,
|
|
2460
2470
|
typeof f == "number" && f > 0 ? ` (${f})` : ""
|
|
2461
2471
|
]
|
|
2462
2472
|
}) : null,
|
|
@@ -2464,29 +2474,29 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2464
2474
|
type: "button",
|
|
2465
2475
|
onClick: () => te(e.draftReview.items),
|
|
2466
2476
|
className: L && e.draftReview.packageId ? "inline-flex h-7 items-center gap-1.5 rounded-md border px-3 text-xs font-medium hover:bg-muted" : "inline-flex h-7 items-center gap-1.5 rounded-md bg-primary px-3 text-xs font-medium text-primary-foreground hover:bg-primary/90",
|
|
2467
|
-
children: [/* @__PURE__ */ Q(
|
|
2477
|
+
children: [/* @__PURE__ */ Q(Qe, { className: "size-3.5" }), ne(e.draftReview.items.length)]
|
|
2468
2478
|
}) : null,
|
|
2469
|
-
|
|
2479
|
+
se && !p ? (() => {
|
|
2470
2480
|
let t = e.draftReview.items.find((e) => e.type === "app");
|
|
2471
2481
|
return t ? /* @__PURE__ */ $("button", {
|
|
2472
2482
|
type: "button",
|
|
2473
|
-
onClick: () =>
|
|
2483
|
+
onClick: () => se(t.name, {
|
|
2474
2484
|
materialized: e.draftReview.materialized === !0,
|
|
2475
2485
|
appSegment: e.draftReview.packageId
|
|
2476
2486
|
}),
|
|
2477
2487
|
className: "inline-flex h-7 items-center gap-1.5 rounded-md border px-3 text-xs font-medium hover:bg-muted",
|
|
2478
2488
|
"data-testid": "draft-preview-app",
|
|
2479
|
-
children: [/* @__PURE__ */ Q(
|
|
2489
|
+
children: [/* @__PURE__ */ Q(Ze, { className: "size-3.5" }), z]
|
|
2480
2490
|
}) : null;
|
|
2481
2491
|
})() : null,
|
|
2482
2492
|
e.draftReview.verification ? e.draftReview.verification.errors > 0 ? /* @__PURE__ */ $("span", {
|
|
2483
2493
|
className: "inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md border border-amber-200 bg-amber-50 px-2.5 text-xs font-medium text-amber-700",
|
|
2484
2494
|
"data-testid": "draft-verification-chip",
|
|
2485
|
-
children: [/* @__PURE__ */ Q(
|
|
2495
|
+
children: [/* @__PURE__ */ Q(_t, { className: "size-3.5" }), `${e.draftReview.verification.errors} issue${e.draftReview.verification.errors === 1 ? "" : "s"}`]
|
|
2486
2496
|
}) : /* @__PURE__ */ $("span", {
|
|
2487
2497
|
className: "inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md border border-emerald-200 bg-emerald-50 px-2.5 text-xs font-medium text-emerald-700",
|
|
2488
2498
|
"data-testid": "draft-verification-chip",
|
|
2489
|
-
children: [/* @__PURE__ */ Q(
|
|
2499
|
+
children: [/* @__PURE__ */ Q(pt, { className: "size-3.5" }), fe]
|
|
2490
2500
|
}) : null,
|
|
2491
2501
|
e.draftReview.summary ? /* @__PURE__ */ Q("span", {
|
|
2492
2502
|
className: "min-w-0 flex-1 truncate text-xs text-muted-foreground",
|
|
@@ -2499,19 +2509,19 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2499
2509
|
"data-testid": "draft-issues",
|
|
2500
2510
|
children: [e.draftReview.issues.filter((e) => e.severity === "error").map((e, t) => /* @__PURE__ */ $("div", {
|
|
2501
2511
|
className: "flex items-start gap-1.5 text-xs text-red-600",
|
|
2502
|
-
children: [/* @__PURE__ */ Q(
|
|
2512
|
+
children: [/* @__PURE__ */ Q(Y, { className: "mt-0.5 size-3.5 shrink-0" }), /* @__PURE__ */ Q("span", { children: e.fix ? `${e.message} — ${e.fix}` : e.message })]
|
|
2503
2513
|
}, `e${t}`)), e.draftReview.issues.filter((e) => e.severity !== "error").map((e, t) => /* @__PURE__ */ $("div", {
|
|
2504
2514
|
className: "flex items-start gap-1.5 text-xs text-amber-600",
|
|
2505
|
-
children: [/* @__PURE__ */ Q(
|
|
2515
|
+
children: [/* @__PURE__ */ Q(Me, { className: "mt-0.5 size-3.5 shrink-0" }), /* @__PURE__ */ Q("span", { children: e.message })]
|
|
2506
2516
|
}, `w${t}`))]
|
|
2507
2517
|
}) : null,
|
|
2508
|
-
|
|
2518
|
+
He.has(e.toolCallId) ? /* @__PURE__ */ Q(aa, { health: Ge.get(e.toolCallId) }) : null,
|
|
2509
2519
|
e.draftReview.nextSteps && e.draftReview.nextSteps.length > 0 ? /* @__PURE__ */ $("div", {
|
|
2510
2520
|
className: "flex flex-col gap-1 border-t bg-muted/20 px-3 py-2",
|
|
2511
2521
|
"data-testid": "draft-next-steps",
|
|
2512
2522
|
children: [/* @__PURE__ */ Q("span", {
|
|
2513
2523
|
className: "text-xs font-medium text-foreground/80",
|
|
2514
|
-
children:
|
|
2524
|
+
children: pe
|
|
2515
2525
|
}), e.draftReview.nextSteps.map((e, t) => /* @__PURE__ */ $("div", {
|
|
2516
2526
|
className: "flex items-start gap-1.5 text-xs text-muted-foreground",
|
|
2517
2527
|
children: [/* @__PURE__ */ Q("span", {
|
|
@@ -2527,22 +2537,22 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2527
2537
|
children: [
|
|
2528
2538
|
/* @__PURE__ */ $("span", {
|
|
2529
2539
|
className: "inline-flex items-center gap-1.5 text-xs font-medium text-foreground/80",
|
|
2530
|
-
children: [/* @__PURE__ */ Q(
|
|
2540
|
+
children: [/* @__PURE__ */ Q(mt, { className: "size-3.5" }), he]
|
|
2531
2541
|
}),
|
|
2532
2542
|
/* @__PURE__ */ Q("p", {
|
|
2533
2543
|
className: "text-xs text-muted-foreground",
|
|
2534
2544
|
children: e.builderHandoff.prompt
|
|
2535
2545
|
}),
|
|
2536
2546
|
(() => {
|
|
2537
|
-
let t = !!
|
|
2547
|
+
let t = !!Ct && e.toolCallId !== Ct;
|
|
2538
2548
|
return /* @__PURE__ */ Q("button", {
|
|
2539
2549
|
type: "button",
|
|
2540
|
-
onClick: () =>
|
|
2541
|
-
disabled: !
|
|
2550
|
+
onClick: () => ve?.(e.builderHandoff),
|
|
2551
|
+
disabled: !ve || t,
|
|
2542
2552
|
"data-testid": t ? "builder-handoff-superseded" : "builder-handoff-open",
|
|
2543
|
-
title: t ?
|
|
2553
|
+
title: t ? _e : void 0,
|
|
2544
2554
|
className: "inline-flex w-fit items-center gap-1 rounded-md bg-primary px-2.5 py-1 text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50",
|
|
2545
|
-
children:
|
|
2555
|
+
children: ge
|
|
2546
2556
|
});
|
|
2547
2557
|
})()
|
|
2548
2558
|
]
|
|
@@ -2553,14 +2563,14 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2553
2563
|
children: [
|
|
2554
2564
|
/* @__PURE__ */ $("span", {
|
|
2555
2565
|
className: "inline-flex items-center gap-1.5 text-xs font-medium text-foreground/80",
|
|
2556
|
-
children: [/* @__PURE__ */ Q(
|
|
2566
|
+
children: [/* @__PURE__ */ Q(Ue, { className: "size-3.5" }), me]
|
|
2557
2567
|
}),
|
|
2558
2568
|
e.proposedPlan.targetApp ? /* @__PURE__ */ $("span", {
|
|
2559
2569
|
className: "inline-flex w-fit items-center gap-1 rounded-md border border-blue-200 bg-blue-50 px-2 py-0.5 text-[11px] font-medium text-blue-700 dark:border-blue-900/50 dark:bg-blue-950/30 dark:text-blue-300",
|
|
2560
2570
|
"data-testid": "proposed-plan-extend",
|
|
2561
2571
|
children: [
|
|
2562
2572
|
"+ ",
|
|
2563
|
-
|
|
2573
|
+
ye,
|
|
2564
2574
|
" 「",
|
|
2565
2575
|
e.proposedPlan.targetApp,
|
|
2566
2576
|
"」"
|
|
@@ -2576,7 +2586,7 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2576
2586
|
className: "inline-flex items-center gap-1 rounded-md border bg-background px-1.5 py-0.5 text-[11px] text-foreground/80",
|
|
2577
2587
|
title: e.name,
|
|
2578
2588
|
children: [
|
|
2579
|
-
/* @__PURE__ */ Q(
|
|
2589
|
+
/* @__PURE__ */ Q(gt, { className: "size-3 text-foreground/40" }),
|
|
2580
2590
|
e.label || e.name,
|
|
2581
2591
|
e.fieldCount > 0 ? /* @__PURE__ */ $("span", {
|
|
2582
2592
|
className: "text-foreground/40",
|
|
@@ -2599,7 +2609,7 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2599
2609
|
"data-testid": "proposed-plan-assumptions",
|
|
2600
2610
|
children: [/* @__PURE__ */ Q("span", {
|
|
2601
2611
|
className: "text-[11px] font-medium text-foreground/70",
|
|
2602
|
-
children:
|
|
2612
|
+
children: xe
|
|
2603
2613
|
}), t.map((e, t) => /* @__PURE__ */ $("div", {
|
|
2604
2614
|
className: "flex items-start gap-1.5 text-[11px] text-muted-foreground",
|
|
2605
2615
|
children: [/* @__PURE__ */ Q("span", {
|
|
@@ -2612,7 +2622,7 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2612
2622
|
"data-testid": "proposed-plan-deferred",
|
|
2613
2623
|
children: [/* @__PURE__ */ $("span", {
|
|
2614
2624
|
className: "inline-flex items-center gap-1.5 text-[11px] font-medium text-amber-800 dark:text-amber-300",
|
|
2615
|
-
children: [/* @__PURE__ */ Q(
|
|
2625
|
+
children: [/* @__PURE__ */ Q(et, { className: "size-3.5" }), Se]
|
|
2616
2626
|
}), n.map((e, t) => /* @__PURE__ */ $("div", {
|
|
2617
2627
|
className: "flex items-start gap-1.5 text-[11px] text-amber-900/90 dark:text-amber-200/90",
|
|
2618
2628
|
children: [/* @__PURE__ */ Q("span", {
|
|
@@ -2627,7 +2637,7 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2627
2637
|
"data-testid": "proposed-plan-questions",
|
|
2628
2638
|
children: [/* @__PURE__ */ $("span", {
|
|
2629
2639
|
className: "inline-flex items-center gap-1.5 text-[11px] font-medium text-amber-800 dark:text-amber-300",
|
|
2630
|
-
children: [/* @__PURE__ */ Q(
|
|
2640
|
+
children: [/* @__PURE__ */ Q($e, { className: "size-3.5" }), be]
|
|
2631
2641
|
}), e.proposedPlan.questions.map((t, n) => {
|
|
2632
2642
|
let r = e.proposedPlan.questionChoices?.find((e) => e.text === t);
|
|
2633
2643
|
return /* @__PURE__ */ $("div", {
|
|
@@ -2643,7 +2653,7 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2643
2653
|
"data-testid": "proposed-plan-choice",
|
|
2644
2654
|
children: r.options.map((e, n) => /* @__PURE__ */ Q("button", {
|
|
2645
2655
|
type: "button",
|
|
2646
|
-
onClick: () => i(
|
|
2656
|
+
onClick: () => i(ke(t, e)),
|
|
2647
2657
|
className: "inline-flex h-6 items-center rounded-full border border-amber-300 bg-background px-2 text-[11px] font-medium text-amber-900 hover:bg-amber-100 dark:border-amber-800 dark:text-amber-200 dark:hover:bg-amber-900/40",
|
|
2648
2658
|
children: e
|
|
2649
2659
|
}, n))
|
|
@@ -2651,33 +2661,41 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2651
2661
|
}, n);
|
|
2652
2662
|
})]
|
|
2653
2663
|
}) : null,
|
|
2654
|
-
i ?
|
|
2664
|
+
i ? St.has(e.toolCallId) ? /* @__PURE__ */ Q("div", {
|
|
2655
2665
|
className: "flex flex-wrap items-center gap-1.5 pt-0.5",
|
|
2656
2666
|
"data-testid": "proposed-plan-actions",
|
|
2657
2667
|
children: /* @__PURE__ */ $("span", {
|
|
2658
2668
|
className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-emerald-200 bg-emerald-50 px-3 text-xs font-medium text-emerald-700 dark:border-emerald-900/50 dark:bg-emerald-950/30 dark:text-emerald-300",
|
|
2659
2669
|
"data-testid": "proposed-plan-built",
|
|
2660
|
-
children: [/* @__PURE__ */ Q(
|
|
2670
|
+
children: [/* @__PURE__ */ Q(K, { className: "size-3.5" }), we]
|
|
2671
|
+
})
|
|
2672
|
+
}) : vt.has(e.toolCallId) ? /* @__PURE__ */ Q("div", {
|
|
2673
|
+
className: "flex flex-wrap items-center gap-1.5 pt-0.5",
|
|
2674
|
+
"data-testid": "proposed-plan-actions",
|
|
2675
|
+
children: /* @__PURE__ */ $("span", {
|
|
2676
|
+
className: "inline-flex h-7 items-center gap-1.5 rounded-md border bg-muted/40 px-3 text-xs font-medium text-muted-foreground",
|
|
2677
|
+
"data-testid": "proposed-plan-building",
|
|
2678
|
+
children: [/* @__PURE__ */ Q(rt, { className: "size-3.5 animate-spin" }), Te]
|
|
2661
2679
|
})
|
|
2662
2680
|
}) : /* @__PURE__ */ $("div", {
|
|
2663
2681
|
className: "flex flex-wrap items-center gap-1.5 pt-0.5",
|
|
2664
2682
|
"data-testid": "proposed-plan-actions",
|
|
2665
2683
|
children: [/* @__PURE__ */ $("button", {
|
|
2666
2684
|
type: "button",
|
|
2667
|
-
onClick: () =>
|
|
2685
|
+
onClick: () => bt(e.proposedPlan.questions.length > 0, e.toolCallId),
|
|
2668
2686
|
className: "inline-flex h-7 items-center gap-1.5 rounded-md bg-primary px-3 text-xs font-medium text-primary-foreground hover:bg-primary/90",
|
|
2669
2687
|
"data-testid": "proposed-plan-approve",
|
|
2670
|
-
children: [/* @__PURE__ */ Q(
|
|
2688
|
+
children: [/* @__PURE__ */ Q(dt, { className: "size-3.5" }), B]
|
|
2671
2689
|
}), /* @__PURE__ */ Q("button", {
|
|
2672
2690
|
type: "button",
|
|
2673
|
-
onClick:
|
|
2691
|
+
onClick: X,
|
|
2674
2692
|
className: "inline-flex h-7 items-center rounded-md border bg-background px-3 text-xs font-medium hover:bg-accent",
|
|
2675
2693
|
"data-testid": "proposed-plan-adjust",
|
|
2676
|
-
children:
|
|
2694
|
+
children: V
|
|
2677
2695
|
})]
|
|
2678
2696
|
}) : /* @__PURE__ */ Q("span", {
|
|
2679
2697
|
className: "text-[11px] italic text-muted-foreground/80",
|
|
2680
|
-
children:
|
|
2698
|
+
children: Ce
|
|
2681
2699
|
})
|
|
2682
2700
|
]
|
|
2683
2701
|
}) : null,
|
|
@@ -2687,39 +2705,47 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2687
2705
|
children: [
|
|
2688
2706
|
/* @__PURE__ */ $("span", {
|
|
2689
2707
|
className: "inline-flex items-center gap-1.5 text-xs font-medium text-foreground/80",
|
|
2690
|
-
children: [/* @__PURE__ */ Q(
|
|
2708
|
+
children: [/* @__PURE__ */ Q(Ue, { className: "size-3.5" }), me]
|
|
2691
2709
|
}),
|
|
2692
2710
|
/* @__PURE__ */ Q("p", {
|
|
2693
2711
|
className: "text-xs text-muted-foreground",
|
|
2694
|
-
children:
|
|
2712
|
+
children: Ee
|
|
2695
2713
|
}),
|
|
2696
|
-
i ?
|
|
2714
|
+
i ? St.has(e.toolCallId) ? /* @__PURE__ */ Q("div", {
|
|
2697
2715
|
className: "flex flex-wrap items-center gap-1.5 pt-0.5",
|
|
2698
2716
|
"data-testid": "proposed-plan-actions",
|
|
2699
2717
|
children: /* @__PURE__ */ $("span", {
|
|
2700
2718
|
className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-emerald-200 bg-emerald-50 px-3 text-xs font-medium text-emerald-700 dark:border-emerald-900/50 dark:bg-emerald-950/30 dark:text-emerald-300",
|
|
2701
2719
|
"data-testid": "proposed-plan-built",
|
|
2702
|
-
children: [/* @__PURE__ */ Q(
|
|
2720
|
+
children: [/* @__PURE__ */ Q(K, { className: "size-3.5" }), we]
|
|
2721
|
+
})
|
|
2722
|
+
}) : vt.has(e.toolCallId) ? /* @__PURE__ */ Q("div", {
|
|
2723
|
+
className: "flex flex-wrap items-center gap-1.5 pt-0.5",
|
|
2724
|
+
"data-testid": "proposed-plan-actions",
|
|
2725
|
+
children: /* @__PURE__ */ $("span", {
|
|
2726
|
+
className: "inline-flex h-7 items-center gap-1.5 rounded-md border bg-muted/40 px-3 text-xs font-medium text-muted-foreground",
|
|
2727
|
+
"data-testid": "proposed-plan-building",
|
|
2728
|
+
children: [/* @__PURE__ */ Q(rt, { className: "size-3.5 animate-spin" }), Te]
|
|
2703
2729
|
})
|
|
2704
2730
|
}) : /* @__PURE__ */ $("div", {
|
|
2705
2731
|
className: "flex flex-wrap items-center gap-1.5 pt-0.5",
|
|
2706
2732
|
"data-testid": "proposed-plan-actions",
|
|
2707
2733
|
children: [/* @__PURE__ */ $("button", {
|
|
2708
2734
|
type: "button",
|
|
2709
|
-
onClick: () =>
|
|
2735
|
+
onClick: () => bt(!1, e.toolCallId),
|
|
2710
2736
|
className: "inline-flex h-7 items-center gap-1.5 rounded-md bg-primary px-3 text-xs font-medium text-primary-foreground hover:bg-primary/90",
|
|
2711
2737
|
"data-testid": "proposed-plan-approve",
|
|
2712
|
-
children: [/* @__PURE__ */ Q(
|
|
2738
|
+
children: [/* @__PURE__ */ Q(dt, { className: "size-3.5" }), B]
|
|
2713
2739
|
}), /* @__PURE__ */ Q("button", {
|
|
2714
2740
|
type: "button",
|
|
2715
|
-
onClick:
|
|
2741
|
+
onClick: X,
|
|
2716
2742
|
className: "inline-flex h-7 items-center rounded-md border bg-background px-3 text-xs font-medium hover:bg-accent",
|
|
2717
2743
|
"data-testid": "proposed-plan-adjust",
|
|
2718
|
-
children:
|
|
2744
|
+
children: V
|
|
2719
2745
|
})]
|
|
2720
2746
|
}) : /* @__PURE__ */ Q("span", {
|
|
2721
2747
|
className: "text-[11px] italic text-muted-foreground/80",
|
|
2722
|
-
children:
|
|
2748
|
+
children: Ce
|
|
2723
2749
|
})
|
|
2724
2750
|
]
|
|
2725
2751
|
}) : null,
|
|
@@ -2729,7 +2755,7 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2729
2755
|
children: [
|
|
2730
2756
|
/* @__PURE__ */ $("span", {
|
|
2731
2757
|
className: "inline-flex items-center gap-1.5 text-xs font-medium text-foreground/80",
|
|
2732
|
-
children: [/* @__PURE__ */ Q(
|
|
2758
|
+
children: [/* @__PURE__ */ Q(Ue, { className: "size-3.5" }), "确认改动"]
|
|
2733
2759
|
}),
|
|
2734
2760
|
e.proposedChanges.summary ? /* @__PURE__ */ Q("p", {
|
|
2735
2761
|
className: "text-xs text-muted-foreground",
|
|
@@ -2739,16 +2765,16 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2739
2765
|
className: "flex flex-col gap-1",
|
|
2740
2766
|
children: e.proposedChanges.changes.map((e, t) => /* @__PURE__ */ $("div", {
|
|
2741
2767
|
className: "flex items-start gap-1.5 rounded-md border bg-background px-2 py-1 text-[11px] text-foreground/80",
|
|
2742
|
-
children: [/* @__PURE__ */ Q(
|
|
2768
|
+
children: [/* @__PURE__ */ Q(gt, { className: "mt-px size-3 shrink-0 text-foreground/40" }), /* @__PURE__ */ Q("span", { children: Xi(e) })]
|
|
2743
2769
|
}, t))
|
|
2744
2770
|
}),
|
|
2745
|
-
i ?
|
|
2771
|
+
i ? Tt.has(e.toolCallId) ? /* @__PURE__ */ Q("div", {
|
|
2746
2772
|
className: "flex flex-wrap items-center gap-1.5 pt-0.5",
|
|
2747
2773
|
"data-testid": "proposed-changes-actions",
|
|
2748
2774
|
children: /* @__PURE__ */ $("span", {
|
|
2749
2775
|
className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-emerald-200 bg-emerald-50 px-3 text-xs font-medium text-emerald-700 dark:border-emerald-900/50 dark:bg-emerald-950/30 dark:text-emerald-300",
|
|
2750
2776
|
"data-testid": "proposed-changes-confirmed",
|
|
2751
|
-
children: [/* @__PURE__ */ Q(
|
|
2777
|
+
children: [/* @__PURE__ */ Q(K, { className: "size-3.5" }), "已确认"]
|
|
2752
2778
|
})
|
|
2753
2779
|
}) : /* @__PURE__ */ $("div", {
|
|
2754
2780
|
className: "flex flex-wrap items-center gap-1.5 pt-0.5",
|
|
@@ -2758,10 +2784,10 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2758
2784
|
onClick: () => i("确认修改,应用你刚才提议的改动。"),
|
|
2759
2785
|
className: "inline-flex h-7 items-center gap-1.5 rounded-md bg-primary px-3 text-xs font-medium text-primary-foreground hover:bg-primary/90",
|
|
2760
2786
|
"data-testid": "proposed-changes-confirm",
|
|
2761
|
-
children: [/* @__PURE__ */ Q(
|
|
2787
|
+
children: [/* @__PURE__ */ Q(K, { className: "size-3.5" }), "确认修改"]
|
|
2762
2788
|
}), /* @__PURE__ */ Q("button", {
|
|
2763
2789
|
type: "button",
|
|
2764
|
-
onClick:
|
|
2790
|
+
onClick: X,
|
|
2765
2791
|
className: "inline-flex h-7 items-center rounded-md border bg-background px-3 text-xs font-medium hover:bg-accent",
|
|
2766
2792
|
"data-testid": "proposed-changes-adjust",
|
|
2767
2793
|
children: "调整"
|
|
@@ -2776,28 +2802,28 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2776
2802
|
}, e.toolCallId);
|
|
2777
2803
|
};
|
|
2778
2804
|
return /* @__PURE__ */ $("div", {
|
|
2779
|
-
ref:
|
|
2780
|
-
className:
|
|
2805
|
+
ref: Pe,
|
|
2806
|
+
className: W(Ie ? "flex min-h-0 flex-col overflow-hidden bg-background" : "flex min-h-0 flex-col overflow-hidden rounded-lg border bg-background", t),
|
|
2781
2807
|
style: { maxHeight: b },
|
|
2782
|
-
...
|
|
2808
|
+
...Ne,
|
|
2783
2809
|
children: [
|
|
2784
2810
|
a && !y && n.length > 0 && /* @__PURE__ */ Q("div", {
|
|
2785
|
-
className:
|
|
2811
|
+
className: W("flex items-center justify-end px-4 py-2", Ie ? "bg-background" : "border-b bg-muted/30"),
|
|
2786
2812
|
children: /* @__PURE__ */ Q("button", {
|
|
2787
2813
|
type: "button",
|
|
2788
2814
|
onClick: a,
|
|
2789
2815
|
className: "text-xs text-muted-foreground hover:text-foreground transition-colors",
|
|
2790
|
-
children:
|
|
2816
|
+
children: q.clear
|
|
2791
2817
|
})
|
|
2792
2818
|
}),
|
|
2793
2819
|
A ? /* @__PURE__ */ Q("div", {
|
|
2794
|
-
className:
|
|
2820
|
+
className: W("shrink-0", !Ie && "border-b bg-background/50"),
|
|
2795
2821
|
children: A
|
|
2796
2822
|
}) : null,
|
|
2797
2823
|
/* @__PURE__ */ $($n, {
|
|
2798
2824
|
className: "flex-1 min-h-0",
|
|
2799
2825
|
children: [/* @__PURE__ */ $(er, {
|
|
2800
|
-
className:
|
|
2826
|
+
className: W("space-y-4", Ie ? "mx-auto w-full max-w-2xl px-4 py-8 sm:px-0" : "px-4 py-3"),
|
|
2801
2827
|
children: [n.length === 0 ? /* @__PURE__ */ $(tr, {
|
|
2802
2828
|
className: "gap-3 px-0 py-8",
|
|
2803
2829
|
children: [
|
|
@@ -2807,16 +2833,16 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2807
2833
|
src: _,
|
|
2808
2834
|
alt: "",
|
|
2809
2835
|
className: "size-full rounded-md object-cover"
|
|
2810
|
-
}) : /* @__PURE__ */ Q(
|
|
2836
|
+
}) : /* @__PURE__ */ Q(Fe, { className: "size-4" })
|
|
2811
2837
|
}),
|
|
2812
2838
|
/* @__PURE__ */ $("div", {
|
|
2813
2839
|
className: "w-full max-w-full space-y-1",
|
|
2814
2840
|
children: [/* @__PURE__ */ Q("h3", {
|
|
2815
2841
|
className: "text-sm font-medium text-foreground/90 break-words",
|
|
2816
|
-
children:
|
|
2842
|
+
children: q.emptyTitle
|
|
2817
2843
|
}), /* @__PURE__ */ Q("p", {
|
|
2818
2844
|
className: "text-sm text-muted-foreground break-words",
|
|
2819
|
-
children:
|
|
2845
|
+
children: q.emptyDescription
|
|
2820
2846
|
})]
|
|
2821
2847
|
}),
|
|
2822
2848
|
T && T.length > 0 ? /* @__PURE__ */ Q("div", {
|
|
@@ -2824,58 +2850,62 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2824
2850
|
children: T.map((e) => /* @__PURE__ */ Q(bi, {
|
|
2825
2851
|
className: "h-auto min-h-8 min-w-0 max-w-full whitespace-normal break-words rounded-full border-border/60 bg-background/80 px-3 py-1 text-left text-xs font-medium text-foreground/90 shadow-none hover:bg-muted/60",
|
|
2826
2852
|
suggestion: e,
|
|
2827
|
-
onClick:
|
|
2853
|
+
onClick: ft
|
|
2828
2854
|
}, e))
|
|
2829
2855
|
}) : null
|
|
2830
2856
|
]
|
|
2831
2857
|
}) : n.map((e) => {
|
|
2832
|
-
let t = e.role === "user", n = e.toolInvocations ?? [], r = e.reasoning?.trim(), i = e.sources ?? [], a = t ? void 0 : e.buildProgress, o = !t && !n.some((e) => !!e.proposedPlan) ? e.blueprintProgress : void 0, c = !t &&
|
|
2858
|
+
let t = e.role === "user", n = e.toolInvocations ?? [], r = e.reasoning?.trim(), i = e.sources ?? [], a = t ? void 0 : e.buildProgress, o = !t && !n.some((e) => !!e.proposedPlan) ? e.blueprintProgress : void 0, c = !t && U === "summary" ? n.filter((e) => !ta(e) && !(o && e.toolName === "propose_blueprint")) : [], l = !t && U === "debug" ? n : !t && U !== "debug" ? n.filter(ta) : [], u = !t && e.content.trim().length > 0 && !ra(e.content), d = U === "debug" && !!r, f = !t && !!e.streaming && !u && c.length === 0 && l.length === 0 && !d && !a && !o;
|
|
2833
2859
|
return /* @__PURE__ */ Q(or, {
|
|
2834
2860
|
from: Ki(e.role),
|
|
2835
2861
|
children: /* @__PURE__ */ $("div", {
|
|
2836
|
-
className:
|
|
2862
|
+
className: W("flex w-full gap-2.5", m ? t ? "flex-row-reverse items-start" : "flex-row items-start" : "flex-col"),
|
|
2837
2863
|
children: [m ? /* @__PURE__ */ Q(sa, {
|
|
2838
2864
|
isUser: t,
|
|
2839
2865
|
url: t ? h : _,
|
|
2840
2866
|
fallback: t ? g : v
|
|
2841
2867
|
}) : null, /* @__PURE__ */ $("div", {
|
|
2842
|
-
className:
|
|
2868
|
+
className: W("flex min-w-0 flex-col gap-2", m && !t && "flex-1"),
|
|
2843
2869
|
children: [/* @__PURE__ */ $(sr, { children: [
|
|
2844
2870
|
o ? /* @__PURE__ */ Q(Sa, {
|
|
2845
2871
|
progress: o,
|
|
2846
|
-
designingLabel:
|
|
2847
|
-
extendLabel:
|
|
2848
|
-
waitingLabel:
|
|
2849
|
-
stalledLabel:
|
|
2850
|
-
offlineLabel:
|
|
2872
|
+
designingLabel: q.designingPlanLabel,
|
|
2873
|
+
extendLabel: ye,
|
|
2874
|
+
waitingLabel: q.connectionWaiting,
|
|
2875
|
+
stalledLabel: q.connectionStalledLabel,
|
|
2876
|
+
offlineLabel: q.connectionOfflineLabel
|
|
2851
2877
|
}) : null,
|
|
2852
2878
|
a ? /* @__PURE__ */ Q(Ca, {
|
|
2853
2879
|
progress: a,
|
|
2880
|
+
appSegment: e.toolInvocations?.map((e) => e.draftReview).find((e) => e?.packageId && e.items?.some((e) => e.type === "app"))?.packageId,
|
|
2854
2881
|
onOpenBuiltApp: re,
|
|
2855
2882
|
openBuiltAppLabel: ie,
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2883
|
+
onDesignBuiltApp: R,
|
|
2884
|
+
designBuiltAppLabel: ae,
|
|
2885
|
+
getArtifactAction: oe,
|
|
2886
|
+
onPreviewDraftApp: se,
|
|
2887
|
+
previewDraftLabel: z,
|
|
2888
|
+
waitingLabel: q.connectionWaiting,
|
|
2889
|
+
stalledLabel: q.connectionStalledLabel,
|
|
2890
|
+
offlineLabel: q.connectionOfflineLabel
|
|
2861
2891
|
}) : null,
|
|
2862
|
-
!t &&
|
|
2892
|
+
!t && U === "debug" && r ? /* @__PURE__ */ $(Li, {
|
|
2863
2893
|
isStreaming: !!e.streaming && !e.content,
|
|
2864
2894
|
className: "mb-2",
|
|
2865
2895
|
children: [/* @__PURE__ */ Q(zi, {}), /* @__PURE__ */ Q(Bi, { children: r })]
|
|
2866
2896
|
}) : null,
|
|
2867
|
-
!t &&
|
|
2897
|
+
!t && U === "summary" && c.length > 0 ? /* @__PURE__ */ Q(wa, {
|
|
2868
2898
|
groups: ia(c),
|
|
2869
|
-
labels:
|
|
2899
|
+
labels: q
|
|
2870
2900
|
}) : null,
|
|
2871
|
-
!t && l.length > 0 ? l.map(
|
|
2901
|
+
!t && l.length > 0 ? l.map(Et) : null,
|
|
2872
2902
|
t ? e.content ? /* @__PURE__ */ Q("div", {
|
|
2873
2903
|
className: "whitespace-pre-wrap break-words",
|
|
2874
2904
|
children: e.content
|
|
2875
2905
|
}) : null : f ? /* @__PURE__ */ Q(la, {}) : u ? /* @__PURE__ */ Q(vr, { children: e.content }) : !e.streaming && ra(e.content) ? /* @__PURE__ */ Q("span", {
|
|
2876
2906
|
className: "text-xs italic text-muted-foreground/70",
|
|
2877
2907
|
title: e.content,
|
|
2878
|
-
children:
|
|
2908
|
+
children: q.agentActivity
|
|
2879
2909
|
}) : null,
|
|
2880
2910
|
e.streaming && u ? /* @__PURE__ */ Q("span", {
|
|
2881
2911
|
"aria-hidden": !0,
|
|
@@ -2912,23 +2942,23 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2912
2942
|
className: "opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100",
|
|
2913
2943
|
children: [
|
|
2914
2944
|
/* @__PURE__ */ Q(lr, {
|
|
2915
|
-
label:
|
|
2916
|
-
tooltip:
|
|
2917
|
-
onClick: () =>
|
|
2918
|
-
children:
|
|
2945
|
+
label: Re === e.id ? q.copied : q.copy,
|
|
2946
|
+
tooltip: Re === e.id ? q.copied : q.copy,
|
|
2947
|
+
onClick: () => xt(e),
|
|
2948
|
+
children: Re === e.id ? /* @__PURE__ */ Q(Le, { className: "size-3.5" }) : /* @__PURE__ */ Q(qe, { className: "size-3.5" })
|
|
2919
2949
|
}),
|
|
2920
2950
|
s ? /* @__PURE__ */ Q(lr, {
|
|
2921
|
-
label:
|
|
2922
|
-
tooltip:
|
|
2951
|
+
label: q.regenerate,
|
|
2952
|
+
tooltip: q.regenerate,
|
|
2923
2953
|
onClick: s,
|
|
2924
|
-
children: /* @__PURE__ */ Q(
|
|
2954
|
+
children: /* @__PURE__ */ Q(ut, { className: "size-3.5" })
|
|
2925
2955
|
}) : null,
|
|
2926
|
-
|
|
2956
|
+
U === "debug" && e.traceId ? /* @__PURE__ */ Q("a", {
|
|
2927
2957
|
href: `#trace/${e.traceId}`,
|
|
2928
2958
|
"data-trace-id": e.traceId,
|
|
2929
2959
|
className: "text-[10px] text-muted-foreground hover:text-foreground ml-1 underline",
|
|
2930
|
-
title:
|
|
2931
|
-
children:
|
|
2960
|
+
title: q.viewTrace,
|
|
2961
|
+
children: q.trace
|
|
2932
2962
|
}) : null
|
|
2933
2963
|
]
|
|
2934
2964
|
}) : null]
|
|
@@ -2939,32 +2969,32 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2939
2969
|
showAvatar: m,
|
|
2940
2970
|
assistantAvatarUrl: _,
|
|
2941
2971
|
assistantAvatarFallback: v,
|
|
2942
|
-
waitingLabel:
|
|
2943
|
-
stalledLabel:
|
|
2944
|
-
offlineLabel:
|
|
2972
|
+
waitingLabel: q.connectionWaiting,
|
|
2973
|
+
stalledLabel: q.connectionStalledLabel,
|
|
2974
|
+
offlineLabel: q.connectionOfflineLabel
|
|
2945
2975
|
}) : null]
|
|
2946
2976
|
}), /* @__PURE__ */ Q(nr, {})]
|
|
2947
2977
|
}),
|
|
2948
2978
|
f ? Xn(f) && !Yn(f) ? /* @__PURE__ */ Q(Da, {
|
|
2949
2979
|
error: f,
|
|
2950
|
-
rateLimitedLabel:
|
|
2951
|
-
genericLabel:
|
|
2980
|
+
rateLimitedLabel: q.sendFailedRateLimited,
|
|
2981
|
+
genericLabel: q.sendFailedGeneric
|
|
2952
2982
|
}) : /* @__PURE__ */ Q(Oa, {
|
|
2953
2983
|
error: f,
|
|
2954
2984
|
onReload: s,
|
|
2955
2985
|
onUpgrade: c
|
|
2956
2986
|
}) : null,
|
|
2957
2987
|
u ? null : /* @__PURE__ */ $("div", {
|
|
2958
|
-
ref:
|
|
2959
|
-
className:
|
|
2988
|
+
ref: ht,
|
|
2989
|
+
className: W("relative", Ie && "mx-auto w-full max-w-2xl px-4 pb-4 sm:px-0"),
|
|
2960
2990
|
children: [j ? /* @__PURE__ */ Q("div", {
|
|
2961
2991
|
className: "absolute bottom-full left-0 right-0 z-10 px-3 pb-1",
|
|
2962
2992
|
children: j
|
|
2963
2993
|
}) : null, /* @__PURE__ */ $(Br, {
|
|
2964
2994
|
accept: C,
|
|
2965
|
-
fileInputLabel:
|
|
2995
|
+
fileInputLabel: q.uploadFiles,
|
|
2966
2996
|
maxFileSize: w,
|
|
2967
|
-
onSubmit:
|
|
2997
|
+
onSubmit: lt,
|
|
2968
2998
|
onError: (e) => {
|
|
2969
2999
|
console.warn("[plugin-chatbot] prompt-input error", e);
|
|
2970
3000
|
},
|
|
@@ -2978,7 +3008,7 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2978
3008
|
/* @__PURE__ */ $(Wr, { children: [/* @__PURE__ */ $(Gr, { children: [
|
|
2979
3009
|
S ? /* @__PURE__ */ $(qr, { children: [/* @__PURE__ */ Q(Jr, {}), /* @__PURE__ */ Q(Yr, { children: /* @__PURE__ */ Q(zr, {}) })] }) : null,
|
|
2980
3010
|
D && D.length > 1 ? /* @__PURE__ */ Q("select", {
|
|
2981
|
-
"aria-label":
|
|
3011
|
+
"aria-label": q.model,
|
|
2982
3012
|
value: O ?? D[0].id,
|
|
2983
3013
|
onChange: (e) => k?.(e.target.value),
|
|
2984
3014
|
className: "h-7 rounded-md border bg-background px-2 text-xs text-muted-foreground hover:text-foreground focus:outline-none focus:ring-1 focus:ring-ring",
|
|
@@ -2990,13 +3020,13 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
2990
3020
|
/* @__PURE__ */ $("span", {
|
|
2991
3021
|
className: "hidden items-center gap-1 text-[10px] text-muted-foreground sm:inline-flex",
|
|
2992
3022
|
"aria-hidden": "true",
|
|
2993
|
-
children: [/* @__PURE__ */ Q(
|
|
3023
|
+
children: [/* @__PURE__ */ Q(Ye, { className: "h-3 w-3" }), /* @__PURE__ */ Q("span", {
|
|
2994
3024
|
className: "opacity-70",
|
|
2995
|
-
children:
|
|
3025
|
+
children: q.sendHint
|
|
2996
3026
|
})]
|
|
2997
3027
|
})
|
|
2998
3028
|
] }), /* @__PURE__ */ Q(Zr, {
|
|
2999
|
-
"aria-label": G === "streaming" ?
|
|
3029
|
+
"aria-label": G === "streaming" ? q.stopResponse : q.submit,
|
|
3000
3030
|
status: G,
|
|
3001
3031
|
disabled: l,
|
|
3002
3032
|
onClick: G === "streaming" ? o : void 0,
|
|
@@ -3011,13 +3041,13 @@ var oa = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
3011
3041
|
oa.displayName = "ChatbotEnhanced";
|
|
3012
3042
|
function sa({ isUser: e, url: t, fallback: n }) {
|
|
3013
3043
|
return /* @__PURE__ */ Q("div", {
|
|
3014
|
-
className:
|
|
3044
|
+
className: W("mt-0.5 flex size-7 shrink-0 items-center justify-center overflow-hidden rounded-full text-[11px] font-medium", e ? "bg-secondary text-secondary-foreground" : "bg-primary/10 text-primary"),
|
|
3015
3045
|
"aria-hidden": "true",
|
|
3016
3046
|
children: t ? /* @__PURE__ */ Q("img", {
|
|
3017
3047
|
src: t,
|
|
3018
3048
|
alt: "",
|
|
3019
3049
|
className: "size-full object-cover"
|
|
3020
|
-
}) : e ? n?.trim()?.charAt(0)?.toUpperCase() || "U" : /* @__PURE__ */ Q(
|
|
3050
|
+
}) : e ? n?.trim()?.charAt(0)?.toUpperCase() || "U" : /* @__PURE__ */ Q(Fe, { className: "size-4" })
|
|
3021
3051
|
});
|
|
3022
3052
|
}
|
|
3023
3053
|
function ca({ showAvatar: e, assistantAvatarUrl: t, assistantAvatarFallback: n, waitingLabel: r, stalledLabel: i, offlineLabel: a }) {
|
|
@@ -3025,7 +3055,7 @@ function ca({ showAvatar: e, assistantAvatarUrl: t, assistantAvatarFallback: n,
|
|
|
3025
3055
|
from: "assistant",
|
|
3026
3056
|
"aria-live": "polite",
|
|
3027
3057
|
children: /* @__PURE__ */ $("div", {
|
|
3028
|
-
className:
|
|
3058
|
+
className: W("flex w-full gap-2.5", e ? "flex-row items-start" : "flex-col"),
|
|
3029
3059
|
children: [e ? /* @__PURE__ */ Q(sa, {
|
|
3030
3060
|
isUser: !1,
|
|
3031
3061
|
url: t,
|
|
@@ -3111,19 +3141,19 @@ function pa() {
|
|
|
3111
3141
|
function ma({ active: e, activityKey: t, pending: n = !1, waitingLabel: r, stalledLabel: i = "Still working…", offlineLabel: a = "Connection lost — reconnecting…" }) {
|
|
3112
3142
|
let { elapsedSeconds: o, quietSeconds: s, live: c } = fa(e, t), l = pa() ? "offline" : c ? n ? "waiting" : "receiving" : "stalled", u = ua(o);
|
|
3113
3143
|
return /* @__PURE__ */ $("span", {
|
|
3114
|
-
className:
|
|
3144
|
+
className: W("inline-flex items-center gap-1.5 text-xs tabular-nums", l === "offline" ? "text-red-600 font-medium" : l === "stalled" ? "text-amber-600 font-medium" : "font-normal text-muted-foreground"),
|
|
3115
3145
|
"aria-live": "polite",
|
|
3116
3146
|
"data-liveness-tier": l,
|
|
3117
3147
|
title: l === "offline" ? `${a} · ${u} elapsed` : l === "receiving" ? `Receiving from server · ${u} elapsed` : l === "stalled" ? `${i} (${s}s with no response) · ${u} elapsed` : `${r} · ${u} elapsed`,
|
|
3118
3148
|
children: [
|
|
3119
|
-
l === "offline" ? /* @__PURE__ */ Q(
|
|
3149
|
+
l === "offline" ? /* @__PURE__ */ Q(vt, {
|
|
3120
3150
|
className: "size-3 shrink-0",
|
|
3121
3151
|
"aria-hidden": !0
|
|
3122
3152
|
}) : /* @__PURE__ */ Q("span", {
|
|
3123
3153
|
"aria-hidden": !0,
|
|
3124
|
-
className:
|
|
3154
|
+
className: W("size-1.5 shrink-0 rounded-full", l === "receiving" ? "bg-emerald-500 animate-pulse" : l === "stalled" ? "bg-amber-500" : "bg-muted-foreground/50 animate-pulse")
|
|
3125
3155
|
}),
|
|
3126
|
-
/* @__PURE__ */ Q(
|
|
3156
|
+
/* @__PURE__ */ Q(Ge, {
|
|
3127
3157
|
className: "size-3 shrink-0",
|
|
3128
3158
|
"aria-hidden": !0
|
|
3129
3159
|
}),
|
|
@@ -3163,7 +3193,7 @@ function va({ label: t, hints: n, offlineLabel: r }) {
|
|
|
3163
3193
|
"data-testid": "build-proposal-progress",
|
|
3164
3194
|
"aria-live": "polite",
|
|
3165
3195
|
children: [
|
|
3166
|
-
/* @__PURE__ */ Q(
|
|
3196
|
+
/* @__PURE__ */ Q(mt, {
|
|
3167
3197
|
className: "size-3 shrink-0 animate-pulse text-primary",
|
|
3168
3198
|
"aria-hidden": !0
|
|
3169
3199
|
}),
|
|
@@ -3179,7 +3209,7 @@ function va({ label: t, hints: n, offlineLabel: r }) {
|
|
|
3179
3209
|
className: "hidden shrink-0 items-center gap-0.5 sm:inline-flex",
|
|
3180
3210
|
"data-testid": "build-proposal-progress-dots",
|
|
3181
3211
|
"aria-hidden": !0,
|
|
3182
|
-
children: n.map((e, t) => /* @__PURE__ */ Q("span", { className:
|
|
3212
|
+
children: n.map((e, t) => /* @__PURE__ */ Q("span", { className: W("size-1 rounded-full transition-colors", t <= o ? "bg-primary/70" : "bg-muted-foreground/25") }, t))
|
|
3183
3213
|
}) : null,
|
|
3184
3214
|
/* @__PURE__ */ Q(ya, { offlineLabel: r })
|
|
3185
3215
|
]
|
|
@@ -3191,11 +3221,11 @@ function ya({ offlineLabel: t }) {
|
|
|
3191
3221
|
let e = Date.now(), t = setInterval(() => r(Math.floor((Date.now() - e) / 1e3)), 1e3);
|
|
3192
3222
|
return () => clearInterval(t);
|
|
3193
3223
|
}, []), /* @__PURE__ */ $("span", {
|
|
3194
|
-
className:
|
|
3224
|
+
className: W("inline-flex items-center gap-1 text-xs tabular-nums", i ? "text-red-600 font-medium" : "text-muted-foreground"),
|
|
3195
3225
|
"aria-live": "polite",
|
|
3196
3226
|
"data-tool-running-timer": !0,
|
|
3197
3227
|
children: [
|
|
3198
|
-
Q(i ?
|
|
3228
|
+
Q(i ? vt : Ge, {
|
|
3199
3229
|
className: "size-3 shrink-0",
|
|
3200
3230
|
"aria-hidden": !0
|
|
3201
3231
|
}),
|
|
@@ -3226,7 +3256,7 @@ function Sa({ progress: e, designingLabel: t = "Designing your app…", extendLa
|
|
|
3226
3256
|
/* @__PURE__ */ $("div", {
|
|
3227
3257
|
className: "mb-2 flex items-center gap-2 font-medium",
|
|
3228
3258
|
children: [
|
|
3229
|
-
p ? /* @__PURE__ */ Q(
|
|
3259
|
+
p ? /* @__PURE__ */ Q(K, { className: "size-4 shrink-0 text-emerald-600" }) : /* @__PURE__ */ Q(rt, { className: "size-4 shrink-0 animate-spin text-primary" }),
|
|
3230
3260
|
/* @__PURE__ */ Q("span", {
|
|
3231
3261
|
className: "min-w-0 truncate",
|
|
3232
3262
|
children: h
|
|
@@ -3265,7 +3295,7 @@ function Sa({ progress: e, designingLabel: t = "Designing your app…", extendLa
|
|
|
3265
3295
|
className: "inline-flex animate-in fade-in items-center gap-1 rounded-md border bg-background px-1.5 py-0.5 text-[11px] text-foreground/80 duration-500",
|
|
3266
3296
|
title: e.name,
|
|
3267
3297
|
children: [
|
|
3268
|
-
/* @__PURE__ */ Q(
|
|
3298
|
+
/* @__PURE__ */ Q(gt, { className: "size-3 text-foreground/40" }),
|
|
3269
3299
|
e.label || e.name,
|
|
3270
3300
|
e.fields ? /* @__PURE__ */ $("span", {
|
|
3271
3301
|
className: "text-foreground/40",
|
|
@@ -3281,13 +3311,16 @@ function Sa({ progress: e, designingLabel: t = "Designing your app…", extendLa
|
|
|
3281
3311
|
]
|
|
3282
3312
|
});
|
|
3283
3313
|
}
|
|
3284
|
-
function Ca({ progress:
|
|
3285
|
-
let { phase:
|
|
3286
|
-
for (let e of
|
|
3287
|
-
let t =
|
|
3288
|
-
t.push(
|
|
3314
|
+
function Ca({ progress: t, appSegment: n, onOpenBuiltApp: r, openBuiltAppLabel: i = "Open app", onDesignBuiltApp: a, designBuiltAppLabel: o = "Design in Studio", getArtifactAction: s, onPreviewDraftApp: c, previewDraftLabel: l = "Preview", waitingLabel: u = "Waiting for server…", stalledLabel: d = "Still working…", offlineLabel: f = "Connection lost — reconnecting…" }) {
|
|
3315
|
+
let { phase: p, appLabel: m, items: h, done: g, total: _, seq: v } = t, y = p === "done", b = v ?? `${p}:${g}:${h.length}`, x = h.find((e) => e.type === "app"), S = _ > 0 ? Math.min(100, Math.round(g / _ * 100)) : y ? 100 : 6, C = /* @__PURE__ */ new Map();
|
|
3316
|
+
for (let e of h) {
|
|
3317
|
+
let t = C.get(e.type) ?? [];
|
|
3318
|
+
t.push({
|
|
3319
|
+
name: e.name,
|
|
3320
|
+
display: e.name.replace(/_sample$/, "")
|
|
3321
|
+
}), C.set(e.type, t);
|
|
3289
3322
|
}
|
|
3290
|
-
let
|
|
3323
|
+
let w = [...ba.filter((e) => C.has(e)), ...[...C.keys()].filter((e) => !ba.includes(e))];
|
|
3291
3324
|
return /* @__PURE__ */ $("div", {
|
|
3292
3325
|
className: "rounded-lg border bg-muted/30 p-3 text-sm",
|
|
3293
3326
|
"data-testid": "build-progress",
|
|
@@ -3295,20 +3328,20 @@ function Ca({ progress: e, onOpenBuiltApp: t, openBuiltAppLabel: n = "Open app",
|
|
|
3295
3328
|
/* @__PURE__ */ $("div", {
|
|
3296
3329
|
className: "mb-2 flex items-center gap-2 font-medium",
|
|
3297
3330
|
children: [
|
|
3298
|
-
|
|
3299
|
-
/* @__PURE__ */ Q("span", { children:
|
|
3300
|
-
!
|
|
3331
|
+
y ? /* @__PURE__ */ Q(K, { className: "size-4 shrink-0 text-emerald-600" }) : /* @__PURE__ */ Q(rt, { className: "size-4 shrink-0 animate-spin text-primary" }),
|
|
3332
|
+
/* @__PURE__ */ Q("span", { children: y ? `Built ${m ?? "your app"}` : `Building ${m ?? "your app"}…` }),
|
|
3333
|
+
!y && p === "data" ? /* @__PURE__ */ Q("span", {
|
|
3301
3334
|
className: "text-xs font-normal text-muted-foreground",
|
|
3302
3335
|
children: "adding sample data"
|
|
3303
3336
|
}) : null,
|
|
3304
|
-
|
|
3337
|
+
y ? null : /* @__PURE__ */ Q("span", {
|
|
3305
3338
|
className: "ml-auto",
|
|
3306
3339
|
children: /* @__PURE__ */ Q(ma, {
|
|
3307
3340
|
active: !0,
|
|
3308
|
-
activityKey:
|
|
3309
|
-
waitingLabel:
|
|
3310
|
-
stalledLabel:
|
|
3311
|
-
offlineLabel:
|
|
3341
|
+
activityKey: b,
|
|
3342
|
+
waitingLabel: u,
|
|
3343
|
+
stalledLabel: d,
|
|
3344
|
+
offlineLabel: f
|
|
3312
3345
|
})
|
|
3313
3346
|
})
|
|
3314
3347
|
]
|
|
@@ -3316,46 +3349,68 @@ function Ca({ progress: e, onOpenBuiltApp: t, openBuiltAppLabel: n = "Open app",
|
|
|
3316
3349
|
/* @__PURE__ */ Q("div", {
|
|
3317
3350
|
className: "mb-2 h-1.5 w-full overflow-hidden rounded-full bg-muted",
|
|
3318
3351
|
children: /* @__PURE__ */ Q("div", {
|
|
3319
|
-
className:
|
|
3320
|
-
style: { width: `${
|
|
3352
|
+
className: W("h-full rounded-full transition-all duration-500", y ? "bg-emerald-500" : "bg-primary"),
|
|
3353
|
+
style: { width: `${S}%` }
|
|
3321
3354
|
})
|
|
3322
3355
|
}),
|
|
3323
3356
|
/* @__PURE__ */ Q("ul", {
|
|
3324
3357
|
className: "space-y-1",
|
|
3325
|
-
children:
|
|
3326
|
-
let
|
|
3358
|
+
children: w.map((t) => {
|
|
3359
|
+
let r = C.get(t);
|
|
3327
3360
|
return /* @__PURE__ */ $("li", {
|
|
3328
3361
|
className: "flex items-start gap-2",
|
|
3329
|
-
children: [/* @__PURE__ */ Q(
|
|
3362
|
+
children: [/* @__PURE__ */ Q(K, { className: "mt-0.5 size-3.5 shrink-0 text-emerald-600" }), /* @__PURE__ */ $("span", {
|
|
3330
3363
|
className: "min-w-0 text-muted-foreground",
|
|
3331
3364
|
children: [
|
|
3332
3365
|
/* @__PURE__ */ Q("span", {
|
|
3333
3366
|
className: "font-medium text-foreground",
|
|
3334
|
-
children: xa[
|
|
3367
|
+
children: xa[t] ?? t
|
|
3335
3368
|
}),
|
|
3336
3369
|
" ",
|
|
3337
|
-
|
|
3338
|
-
|
|
3370
|
+
r.slice(0, 6).map((r, i) => {
|
|
3371
|
+
let a = y ? s?.({
|
|
3372
|
+
type: t,
|
|
3373
|
+
name: r.name
|
|
3374
|
+
}, n) : null;
|
|
3375
|
+
return /* @__PURE__ */ $(e.Fragment, { children: [i > 0 ? ", " : null, a ? /* @__PURE__ */ Q("button", {
|
|
3376
|
+
type: "button",
|
|
3377
|
+
onClick: a,
|
|
3378
|
+
className: "rounded-sm text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary",
|
|
3379
|
+
"data-testid": `build-artifact-link-${t}-${r.name}`,
|
|
3380
|
+
children: r.display
|
|
3381
|
+
}) : r.display] }, r.name);
|
|
3382
|
+
}),
|
|
3383
|
+
r.length > 6 ? ` +${r.length - 6} more` : ""
|
|
3339
3384
|
]
|
|
3340
3385
|
})]
|
|
3341
|
-
},
|
|
3386
|
+
}, t);
|
|
3342
3387
|
})
|
|
3343
3388
|
}),
|
|
3344
|
-
|
|
3389
|
+
y && x && (a || r || c) ? /* @__PURE__ */ $("div", {
|
|
3345
3390
|
className: "mt-3 flex items-center gap-2",
|
|
3346
|
-
children: [
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3391
|
+
children: [
|
|
3392
|
+
a ? /* @__PURE__ */ $("button", {
|
|
3393
|
+
type: "button",
|
|
3394
|
+
onClick: () => a(x.name, n),
|
|
3395
|
+
className: "inline-flex h-7 items-center gap-1.5 rounded-md bg-primary px-3 text-xs font-medium text-primary-foreground hover:bg-primary/90",
|
|
3396
|
+
"data-testid": "build-progress-design-app",
|
|
3397
|
+
children: [o, /* @__PURE__ */ Q(Pe, { className: "size-3.5" })]
|
|
3398
|
+
}) : null,
|
|
3399
|
+
r ? /* @__PURE__ */ $("button", {
|
|
3400
|
+
type: "button",
|
|
3401
|
+
onClick: () => r(x.name),
|
|
3402
|
+
className: W("inline-flex h-7 items-center gap-1.5 rounded-md px-3 text-xs font-medium", a ? "border hover:bg-muted" : "bg-primary text-primary-foreground hover:bg-primary/90"),
|
|
3403
|
+
"data-testid": "build-progress-open-app",
|
|
3404
|
+
children: [i, /* @__PURE__ */ Q(Pe, { className: "size-3.5" })]
|
|
3405
|
+
}) : null,
|
|
3406
|
+
c ? /* @__PURE__ */ $("button", {
|
|
3407
|
+
type: "button",
|
|
3408
|
+
onClick: () => c(x.name),
|
|
3409
|
+
className: "inline-flex h-7 items-center gap-1.5 rounded-md border px-3 text-xs font-medium hover:bg-muted",
|
|
3410
|
+
"data-testid": "build-progress-preview-app",
|
|
3411
|
+
children: [/* @__PURE__ */ Q(Ze, { className: "size-3.5" }), l]
|
|
3412
|
+
}) : null
|
|
3413
|
+
]
|
|
3359
3414
|
}) : null
|
|
3360
3415
|
]
|
|
3361
3416
|
});
|
|
@@ -3385,7 +3440,7 @@ function wa({ groups: e, labels: t }) {
|
|
|
3385
3440
|
hints: t.designingPlanHints,
|
|
3386
3441
|
offlineLabel: t.connectionOfflineLabel
|
|
3387
3442
|
}) : /* @__PURE__ */ Q(ya, { offlineLabel: t.connectionOfflineLabel }) : /* @__PURE__ */ Q("span", {
|
|
3388
|
-
className:
|
|
3443
|
+
className: W("shrink-0 text-[10px] font-medium", e.state === "failed" ? "text-destructive" : e.state === "completed" ? "text-emerald-700 dark:text-emerald-400" : "text-muted-foreground"),
|
|
3389
3444
|
children: Ea(e.state, t)
|
|
3390
3445
|
})]
|
|
3391
3446
|
}, e.key))
|
|
@@ -3393,7 +3448,7 @@ function wa({ groups: e, labels: t }) {
|
|
|
3393
3448
|
});
|
|
3394
3449
|
}
|
|
3395
3450
|
function Ta({ state: e }) {
|
|
3396
|
-
return e === "failed" ? /* @__PURE__ */ Q(
|
|
3451
|
+
return e === "failed" ? /* @__PURE__ */ Q(Y, { className: "size-3.5 shrink-0 text-destructive" }) : e === "completed" ? /* @__PURE__ */ Q(K, { className: "size-3.5 shrink-0 text-emerald-600" }) : /* @__PURE__ */ Q(Ge, { className: "size-3.5 shrink-0 text-muted-foreground" });
|
|
3397
3452
|
}
|
|
3398
3453
|
function Ea(e, t) {
|
|
3399
3454
|
switch (e) {
|
|
@@ -3417,7 +3472,7 @@ function Da({ error: t, rateLimitedLabel: n, genericLabel: r }) {
|
|
|
3417
3472
|
className: "rounded-md border border-amber-300/40 bg-amber-50/60 px-3 py-2 text-foreground dark:bg-amber-950/20",
|
|
3418
3473
|
children: /* @__PURE__ */ $("div", {
|
|
3419
3474
|
className: "flex items-start gap-2",
|
|
3420
|
-
children: [/* @__PURE__ */ Q(
|
|
3475
|
+
children: [/* @__PURE__ */ Q(_t, { className: "mt-0.5 h-4 w-4 shrink-0 text-amber-600" }), /* @__PURE__ */ Q("div", {
|
|
3421
3476
|
className: "min-w-0 flex-1 break-words leading-snug",
|
|
3422
3477
|
children: i
|
|
3423
3478
|
})]
|
|
@@ -3463,7 +3518,7 @@ function Oa({ error: t, onReload: n, onUpgrade: r }) {
|
|
|
3463
3518
|
children: [/* @__PURE__ */ $("div", {
|
|
3464
3519
|
className: "flex items-start gap-2",
|
|
3465
3520
|
children: [
|
|
3466
|
-
/* @__PURE__ */ Q(
|
|
3521
|
+
/* @__PURE__ */ Q(Me, { className: "mt-0.5 h-4 w-4 shrink-0 text-destructive" }),
|
|
3467
3522
|
/* @__PURE__ */ $("div", {
|
|
3468
3523
|
className: "min-w-0 flex-1",
|
|
3469
3524
|
children: [/* @__PURE__ */ Q("div", {
|
|
@@ -3486,7 +3541,7 @@ function Oa({ error: t, onReload: n, onUpgrade: r }) {
|
|
|
3486
3541
|
type: "button",
|
|
3487
3542
|
onClick: n,
|
|
3488
3543
|
className: "inline-flex h-7 items-center rounded-md border border-destructive/30 bg-background px-2 text-xs font-medium text-destructive hover:bg-destructive/10",
|
|
3489
|
-
children: [/* @__PURE__ */ Q(
|
|
3544
|
+
children: [/* @__PURE__ */ Q(ut, { className: "mr-1 h-3 w-3" }), "Retry"]
|
|
3490
3545
|
}) : null]
|
|
3491
3546
|
})
|
|
3492
3547
|
]
|
|
@@ -4171,7 +4226,7 @@ var ja = ({ size: e = 16 }) => /* @__PURE__ */ $("svg", {
|
|
|
4171
4226
|
}) })
|
|
4172
4227
|
]
|
|
4173
4228
|
}), Ma = ({ className: e, size: t = 16, ...n }) => /* @__PURE__ */ Q("div", {
|
|
4174
|
-
className:
|
|
4229
|
+
className: W("inline-flex animate-spin items-center justify-center", e),
|
|
4175
4230
|
...n,
|
|
4176
4231
|
children: /* @__PURE__ */ Q(ja, { size: t })
|
|
4177
4232
|
}), Na = /* @__PURE__ */ Lt({
|
|
@@ -4481,24 +4536,24 @@ function Wa({ apiBase: t, headers: n, pollInterval: r = 5e3, conversationId: i,
|
|
|
4481
4536
|
} finally {
|
|
4482
4537
|
E(null);
|
|
4483
4538
|
}
|
|
4484
|
-
}, [F]),
|
|
4539
|
+
}, [F]), se = /* @__PURE__ */ $("div", {
|
|
4485
4540
|
className: "space-y-3",
|
|
4486
4541
|
children: [
|
|
4487
4542
|
/* @__PURE__ */ $("div", {
|
|
4488
4543
|
className: "flex items-center justify-between gap-2",
|
|
4489
|
-
children: [/* @__PURE__ */ Q(
|
|
4544
|
+
children: [/* @__PURE__ */ Q(Ee, {
|
|
4490
4545
|
value: l,
|
|
4491
4546
|
onValueChange: (e) => u(e),
|
|
4492
|
-
children: /* @__PURE__ */ $(
|
|
4493
|
-
/* @__PURE__ */ Q(
|
|
4547
|
+
children: /* @__PURE__ */ $(De, { children: [
|
|
4548
|
+
/* @__PURE__ */ Q(Oe, {
|
|
4494
4549
|
value: "pending",
|
|
4495
4550
|
children: "Pending"
|
|
4496
4551
|
}),
|
|
4497
|
-
/* @__PURE__ */ Q(
|
|
4552
|
+
/* @__PURE__ */ Q(Oe, {
|
|
4498
4553
|
value: "decided",
|
|
4499
4554
|
children: "Decided"
|
|
4500
4555
|
}),
|
|
4501
|
-
/* @__PURE__ */ Q(
|
|
4556
|
+
/* @__PURE__ */ Q(Oe, {
|
|
4502
4557
|
value: "all",
|
|
4503
4558
|
children: "All"
|
|
4504
4559
|
})
|
|
@@ -4509,20 +4564,20 @@ function Wa({ apiBase: t, headers: n, pollInterval: r = 5e3, conversationId: i,
|
|
|
4509
4564
|
onClick: () => void ee(),
|
|
4510
4565
|
disabled: M,
|
|
4511
4566
|
"data-testid": "ai-inbox-refresh",
|
|
4512
|
-
children: [/* @__PURE__ */ Q(
|
|
4567
|
+
children: [/* @__PURE__ */ Q(ut, { className: `h-3.5 w-3.5 mr-1.5 ${M ? "animate-spin" : ""}` }), "Refresh"]
|
|
4513
4568
|
})]
|
|
4514
4569
|
}),
|
|
4515
4570
|
N ? /* @__PURE__ */ $(f, {
|
|
4516
4571
|
variant: "destructive",
|
|
4517
|
-
children: [/* @__PURE__ */ Q(
|
|
4572
|
+
children: [/* @__PURE__ */ Q(Me, { className: "h-4 w-4" }), /* @__PURE__ */ Q(p, { children: N.message })]
|
|
4518
4573
|
}) : null,
|
|
4519
4574
|
D ? /* @__PURE__ */ $(f, {
|
|
4520
4575
|
variant: "destructive",
|
|
4521
|
-
children: [/* @__PURE__ */ Q(
|
|
4576
|
+
children: [/* @__PURE__ */ Q(Me, { className: "h-4 w-4" }), /* @__PURE__ */ Q(p, { children: D })]
|
|
4522
4577
|
}) : null,
|
|
4523
4578
|
k && !D ? /* @__PURE__ */ $(f, {
|
|
4524
4579
|
variant: k.ok ? "default" : "destructive",
|
|
4525
|
-
children: [k.ok ? /* @__PURE__ */ Q(
|
|
4580
|
+
children: [k.ok ? /* @__PURE__ */ Q(K, { className: "h-4 w-4" }) : /* @__PURE__ */ Q(Y, { className: "h-4 w-4" }), /* @__PURE__ */ $(p, { children: [
|
|
4526
4581
|
k.kind === "approve" ? "Approve" : "Reject",
|
|
4527
4582
|
" for",
|
|
4528
4583
|
" ",
|
|
@@ -4538,69 +4593,69 @@ function Wa({ apiBase: t, headers: n, pollInterval: r = 5e3, conversationId: i,
|
|
|
4538
4593
|
M && I.length === 0 ? /* @__PURE__ */ $("div", {
|
|
4539
4594
|
className: "space-y-2",
|
|
4540
4595
|
children: [
|
|
4541
|
-
/* @__PURE__ */ Q(
|
|
4542
|
-
/* @__PURE__ */ Q(
|
|
4543
|
-
/* @__PURE__ */ Q(
|
|
4596
|
+
/* @__PURE__ */ Q(xe, { className: "h-10 w-full" }),
|
|
4597
|
+
/* @__PURE__ */ Q(xe, { className: "h-10 w-full" }),
|
|
4598
|
+
/* @__PURE__ */ Q(xe, { className: "h-10 w-full" })
|
|
4544
4599
|
]
|
|
4545
4600
|
}) : I.length === 0 ? /* @__PURE__ */ Q(te, { children: /* @__PURE__ */ $(L, { children: [
|
|
4546
|
-
/* @__PURE__ */ Q(re, { children: /* @__PURE__ */ Q(
|
|
4601
|
+
/* @__PURE__ */ Q(re, { children: /* @__PURE__ */ Q(nt, { className: "h-8 w-8 text-muted-foreground" }) }),
|
|
4547
4602
|
/* @__PURE__ */ Q(ie, { children: "No actions waiting" }),
|
|
4548
4603
|
/* @__PURE__ */ Q(ne, { children: "When the AI proposes a sensitive action it will appear here for review." })
|
|
4549
4604
|
] }) }) : /* @__PURE__ */ Q("div", {
|
|
4550
4605
|
className: "rounded-md border",
|
|
4551
|
-
children: /* @__PURE__ */ $(
|
|
4552
|
-
/* @__PURE__ */ Q(
|
|
4606
|
+
children: /* @__PURE__ */ $(Se, { children: [/* @__PURE__ */ Q(we, { children: /* @__PURE__ */ $(Te, { children: [
|
|
4607
|
+
/* @__PURE__ */ Q(V, {
|
|
4553
4608
|
className: "w-[140px]",
|
|
4554
4609
|
children: "Tool"
|
|
4555
4610
|
}),
|
|
4556
|
-
/* @__PURE__ */ Q(
|
|
4611
|
+
/* @__PURE__ */ Q(V, {
|
|
4557
4612
|
className: "w-[140px]",
|
|
4558
4613
|
children: "Action"
|
|
4559
4614
|
}),
|
|
4560
|
-
/* @__PURE__ */ Q(
|
|
4615
|
+
/* @__PURE__ */ Q(V, {
|
|
4561
4616
|
className: "w-[120px]",
|
|
4562
4617
|
children: "Object"
|
|
4563
4618
|
}),
|
|
4564
|
-
/* @__PURE__ */ Q(
|
|
4619
|
+
/* @__PURE__ */ Q(V, {
|
|
4565
4620
|
className: "w-[110px]",
|
|
4566
4621
|
children: "Status"
|
|
4567
4622
|
}),
|
|
4568
|
-
/* @__PURE__ */ Q(
|
|
4623
|
+
/* @__PURE__ */ Q(V, {
|
|
4569
4624
|
className: "w-[110px]",
|
|
4570
4625
|
children: "Proposed"
|
|
4571
4626
|
}),
|
|
4572
|
-
/* @__PURE__ */ Q(
|
|
4627
|
+
/* @__PURE__ */ Q(V, {
|
|
4573
4628
|
className: "w-[260px] text-right",
|
|
4574
4629
|
children: "Decision"
|
|
4575
4630
|
})
|
|
4576
|
-
] }) }), /* @__PURE__ */ Q(
|
|
4631
|
+
] }) }), /* @__PURE__ */ Q(Ce, { children: I.map((e) => {
|
|
4577
4632
|
let t = e.status === "pending", n = T === e.id;
|
|
4578
|
-
return /* @__PURE__ */ $(
|
|
4579
|
-
/* @__PURE__ */ Q(
|
|
4633
|
+
return /* @__PURE__ */ $(Te, { children: [
|
|
4634
|
+
/* @__PURE__ */ Q(B, {
|
|
4580
4635
|
className: "font-mono text-xs",
|
|
4581
4636
|
children: e.tool_name
|
|
4582
4637
|
}),
|
|
4583
|
-
/* @__PURE__ */ Q(
|
|
4638
|
+
/* @__PURE__ */ Q(B, {
|
|
4584
4639
|
className: "text-sm",
|
|
4585
4640
|
children: e.action_name
|
|
4586
4641
|
}),
|
|
4587
|
-
/* @__PURE__ */ Q(
|
|
4642
|
+
/* @__PURE__ */ Q(B, {
|
|
4588
4643
|
className: "text-sm",
|
|
4589
4644
|
children: e.object_name
|
|
4590
4645
|
}),
|
|
4591
|
-
/* @__PURE__ */ Q(
|
|
4592
|
-
/* @__PURE__ */ Q(
|
|
4646
|
+
/* @__PURE__ */ Q(B, { children: /* @__PURE__ */ Q(za, { status: e.status }) }),
|
|
4647
|
+
/* @__PURE__ */ Q(B, {
|
|
4593
4648
|
className: "text-xs text-muted-foreground",
|
|
4594
4649
|
children: /* @__PURE__ */ $("span", {
|
|
4595
4650
|
className: "inline-flex items-center gap-1",
|
|
4596
4651
|
children: [
|
|
4597
|
-
/* @__PURE__ */ Q(
|
|
4652
|
+
/* @__PURE__ */ Q(We, { className: "h-3 w-3" }),
|
|
4598
4653
|
" ",
|
|
4599
4654
|
Ba(e.proposed_at)
|
|
4600
4655
|
]
|
|
4601
4656
|
})
|
|
4602
4657
|
}),
|
|
4603
|
-
/* @__PURE__ */ Q(
|
|
4658
|
+
/* @__PURE__ */ Q(B, {
|
|
4604
4659
|
className: "text-right",
|
|
4605
4660
|
children: /* @__PURE__ */ $("div", {
|
|
4606
4661
|
className: "inline-flex gap-1.5",
|
|
@@ -4609,14 +4664,14 @@ function Wa({ apiBase: t, headers: n, pollInterval: r = 5e3, conversationId: i,
|
|
|
4609
4664
|
variant: "ghost",
|
|
4610
4665
|
onClick: () => m(e.id),
|
|
4611
4666
|
"data-testid": `ai-inbox-view-${e.id}`,
|
|
4612
|
-
children: [/* @__PURE__ */ Q(
|
|
4667
|
+
children: [/* @__PURE__ */ Q(Ze, { className: "h-3.5 w-3.5 mr-1" }), " View"]
|
|
4613
4668
|
}), t ? /* @__PURE__ */ $(Z, { children: [/* @__PURE__ */ $(v, {
|
|
4614
4669
|
size: "sm",
|
|
4615
4670
|
variant: "default",
|
|
4616
4671
|
disabled: n,
|
|
4617
4672
|
onClick: () => void ae(e.id),
|
|
4618
4673
|
"data-testid": `ai-inbox-approve-${e.id}`,
|
|
4619
|
-
children: [/* @__PURE__ */ Q(
|
|
4674
|
+
children: [/* @__PURE__ */ Q(K, { className: "h-3.5 w-3.5 mr-1" }), n ? "Working…" : "Approve"]
|
|
4620
4675
|
}), /* @__PURE__ */ $(v, {
|
|
4621
4676
|
size: "sm",
|
|
4622
4677
|
variant: "destructive",
|
|
@@ -4625,7 +4680,7 @@ function Wa({ apiBase: t, headers: n, pollInterval: r = 5e3, conversationId: i,
|
|
|
4625
4680
|
g(e.id), w("");
|
|
4626
4681
|
},
|
|
4627
4682
|
"data-testid": `ai-inbox-reject-${e.id}`,
|
|
4628
|
-
children: [/* @__PURE__ */ Q(
|
|
4683
|
+
children: [/* @__PURE__ */ Q(Y, { className: "h-3.5 w-3.5 mr-1" }), "Reject"]
|
|
4629
4684
|
})] }) : null]
|
|
4630
4685
|
})
|
|
4631
4686
|
})
|
|
@@ -4642,27 +4697,27 @@ function Wa({ apiBase: t, headers: n, pollInterval: r = 5e3, conversationId: i,
|
|
|
4642
4697
|
children: [/* @__PURE__ */ $(C, {
|
|
4643
4698
|
className: "flex items-center gap-2",
|
|
4644
4699
|
children: [
|
|
4645
|
-
/* @__PURE__ */ Q(
|
|
4700
|
+
/* @__PURE__ */ Q(Fe, { className: "h-4 w-4" }),
|
|
4646
4701
|
" ",
|
|
4647
4702
|
o
|
|
4648
4703
|
]
|
|
4649
4704
|
}), s ? /* @__PURE__ */ Q(x, { children: s }) : null]
|
|
4650
|
-
}), /* @__PURE__ */ Q(b, { children:
|
|
4705
|
+
}), /* @__PURE__ */ Q(b, { children: se })]
|
|
4651
4706
|
}) : /* @__PURE__ */ Q("div", {
|
|
4652
4707
|
className: c,
|
|
4653
|
-
children:
|
|
4708
|
+
children: se
|
|
4654
4709
|
}),
|
|
4655
|
-
/* @__PURE__ */ Q(
|
|
4710
|
+
/* @__PURE__ */ Q(ge, {
|
|
4656
4711
|
open: !!d,
|
|
4657
4712
|
onOpenChange: (e) => {
|
|
4658
4713
|
e || m(null);
|
|
4659
4714
|
},
|
|
4660
|
-
children: /* @__PURE__ */ $(
|
|
4715
|
+
children: /* @__PURE__ */ $(_e, {
|
|
4661
4716
|
className: "sm:max-w-[560px] overflow-y-auto",
|
|
4662
|
-
children: [/* @__PURE__ */ $(
|
|
4717
|
+
children: [/* @__PURE__ */ $(ye, { children: [/* @__PURE__ */ $(be, {
|
|
4663
4718
|
className: "flex items-center gap-2",
|
|
4664
|
-
children: [/* @__PURE__ */ Q(
|
|
4665
|
-
}), /* @__PURE__ */ Q(
|
|
4719
|
+
children: [/* @__PURE__ */ Q(Fe, { className: "h-4 w-4" }), R ? R.action_name : "Pending action"]
|
|
4720
|
+
}), /* @__PURE__ */ Q(ve, { children: R ? /* @__PURE__ */ $(Z, { children: [
|
|
4666
4721
|
"Tool ",
|
|
4667
4722
|
/* @__PURE__ */ Q("code", {
|
|
4668
4723
|
className: "text-xs",
|
|
@@ -4680,28 +4735,28 @@ function Wa({ apiBase: t, headers: n, pollInterval: r = 5e3, conversationId: i,
|
|
|
4680
4735
|
/* @__PURE__ */ $("div", {
|
|
4681
4736
|
className: "grid grid-cols-2 gap-3 text-sm",
|
|
4682
4737
|
children: [
|
|
4683
|
-
/* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(
|
|
4738
|
+
/* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(z, {
|
|
4684
4739
|
className: "text-xs text-muted-foreground",
|
|
4685
4740
|
children: "Status"
|
|
4686
4741
|
}), /* @__PURE__ */ Q("div", {
|
|
4687
4742
|
className: "mt-1",
|
|
4688
4743
|
children: /* @__PURE__ */ Q(za, { status: R.status })
|
|
4689
4744
|
})] }),
|
|
4690
|
-
/* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(
|
|
4745
|
+
/* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(z, {
|
|
4691
4746
|
className: "text-xs text-muted-foreground",
|
|
4692
4747
|
children: "Proposed"
|
|
4693
4748
|
}), /* @__PURE__ */ Q("div", {
|
|
4694
4749
|
className: "mt-1 text-xs",
|
|
4695
4750
|
children: Ba(R.proposed_at)
|
|
4696
4751
|
})] }),
|
|
4697
|
-
/* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(
|
|
4752
|
+
/* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(z, {
|
|
4698
4753
|
className: "text-xs text-muted-foreground",
|
|
4699
4754
|
children: "Proposed by"
|
|
4700
4755
|
}), /* @__PURE__ */ Q("div", {
|
|
4701
4756
|
className: "mt-1 text-xs font-mono break-all",
|
|
4702
4757
|
children: R.proposed_by ?? "—"
|
|
4703
4758
|
})] }),
|
|
4704
|
-
/* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(
|
|
4759
|
+
/* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(z, {
|
|
4705
4760
|
className: "text-xs text-muted-foreground",
|
|
4706
4761
|
children: "Decided by"
|
|
4707
4762
|
}), /* @__PURE__ */ Q("div", {
|
|
@@ -4710,7 +4765,7 @@ function Wa({ apiBase: t, headers: n, pollInterval: r = 5e3, conversationId: i,
|
|
|
4710
4765
|
})] }),
|
|
4711
4766
|
R.conversation_id ? /* @__PURE__ */ $("div", {
|
|
4712
4767
|
className: "col-span-2",
|
|
4713
|
-
children: [/* @__PURE__ */ Q(
|
|
4768
|
+
children: [/* @__PURE__ */ Q(z, {
|
|
4714
4769
|
className: "text-xs text-muted-foreground",
|
|
4715
4770
|
children: "Conversation"
|
|
4716
4771
|
}), /* @__PURE__ */ Q("div", {
|
|
@@ -4720,29 +4775,29 @@ function Wa({ apiBase: t, headers: n, pollInterval: r = 5e3, conversationId: i,
|
|
|
4720
4775
|
}) : null
|
|
4721
4776
|
]
|
|
4722
4777
|
}),
|
|
4723
|
-
/* @__PURE__ */ Q(
|
|
4724
|
-
/* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(
|
|
4778
|
+
/* @__PURE__ */ Q(he, {}),
|
|
4779
|
+
/* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(z, {
|
|
4725
4780
|
className: "text-xs",
|
|
4726
4781
|
children: "Tool input"
|
|
4727
4782
|
}), /* @__PURE__ */ Q("div", {
|
|
4728
4783
|
className: "mt-1.5",
|
|
4729
4784
|
children: /* @__PURE__ */ Q(Ha, { value: Va(R.tool_input) })
|
|
4730
4785
|
})] }),
|
|
4731
|
-
R.result ? /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(
|
|
4786
|
+
R.result ? /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(z, {
|
|
4732
4787
|
className: "text-xs",
|
|
4733
4788
|
children: "Result"
|
|
4734
4789
|
}), /* @__PURE__ */ Q("div", {
|
|
4735
4790
|
className: "mt-1.5",
|
|
4736
4791
|
children: /* @__PURE__ */ Q(Ha, { value: Va(R.result) })
|
|
4737
4792
|
})] }) : null,
|
|
4738
|
-
R.error ? /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(
|
|
4793
|
+
R.error ? /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(z, {
|
|
4739
4794
|
className: "text-xs text-destructive",
|
|
4740
4795
|
children: "Error"
|
|
4741
4796
|
}), /* @__PURE__ */ Q("div", {
|
|
4742
4797
|
className: "mt-1.5",
|
|
4743
4798
|
children: /* @__PURE__ */ Q(Ha, { value: R.error })
|
|
4744
4799
|
})] }) : null,
|
|
4745
|
-
R.rejection_reason ? /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(
|
|
4800
|
+
R.rejection_reason ? /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q(z, {
|
|
4746
4801
|
className: "text-xs",
|
|
4747
4802
|
children: "Rejection reason"
|
|
4748
4803
|
}), /* @__PURE__ */ Q("div", {
|
|
@@ -4755,7 +4810,7 @@ function Wa({ apiBase: t, headers: n, pollInterval: r = 5e3, conversationId: i,
|
|
|
4755
4810
|
size: "sm",
|
|
4756
4811
|
onClick: () => void ae(R.id),
|
|
4757
4812
|
disabled: T === R.id,
|
|
4758
|
-
children: [/* @__PURE__ */ Q(
|
|
4813
|
+
children: [/* @__PURE__ */ Q(K, { className: "h-3.5 w-3.5 mr-1" }), "Approve & Execute"]
|
|
4759
4814
|
}), /* @__PURE__ */ $(v, {
|
|
4760
4815
|
size: "sm",
|
|
4761
4816
|
variant: "destructive",
|
|
@@ -4763,24 +4818,24 @@ function Wa({ apiBase: t, headers: n, pollInterval: r = 5e3, conversationId: i,
|
|
|
4763
4818
|
g(R.id), w("");
|
|
4764
4819
|
},
|
|
4765
4820
|
disabled: T === R.id,
|
|
4766
|
-
children: [/* @__PURE__ */ Q(
|
|
4821
|
+
children: [/* @__PURE__ */ Q(Y, { className: "h-3.5 w-3.5 mr-1" }), "Reject"]
|
|
4767
4822
|
})]
|
|
4768
4823
|
}) : null
|
|
4769
4824
|
]
|
|
4770
4825
|
}) : null]
|
|
4771
4826
|
})
|
|
4772
4827
|
}),
|
|
4773
|
-
/* @__PURE__ */ Q(
|
|
4828
|
+
/* @__PURE__ */ Q(ge, {
|
|
4774
4829
|
open: !!h,
|
|
4775
4830
|
onOpenChange: (e) => {
|
|
4776
4831
|
e || (g(null), w(""));
|
|
4777
4832
|
},
|
|
4778
|
-
children: /* @__PURE__ */ $(
|
|
4833
|
+
children: /* @__PURE__ */ $(_e, {
|
|
4779
4834
|
side: "bottom",
|
|
4780
4835
|
className: "max-h-[40vh]",
|
|
4781
|
-
children: [/* @__PURE__ */ $(
|
|
4836
|
+
children: [/* @__PURE__ */ $(ye, { children: [/* @__PURE__ */ Q(be, { children: "Reject this action?" }), /* @__PURE__ */ Q(ve, { children: "The reason is shown back to the AI so it can adjust its next response." })] }), /* @__PURE__ */ $("div", {
|
|
4782
4837
|
className: "px-4 mt-3 space-y-3",
|
|
4783
|
-
children: [/* @__PURE__ */ Q(
|
|
4838
|
+
children: [/* @__PURE__ */ Q(ke, {
|
|
4784
4839
|
value: _,
|
|
4785
4840
|
onChange: (e) => w(e.target.value),
|
|
4786
4841
|
placeholder: "Optional reason (e.g. 'Wrong record id — please confirm with the user first.')",
|
|
@@ -4801,7 +4856,7 @@ function Wa({ apiBase: t, headers: n, pollInterval: r = 5e3, conversationId: i,
|
|
|
4801
4856
|
onClick: () => h && void oe(h, _),
|
|
4802
4857
|
disabled: !h || T === h,
|
|
4803
4858
|
"data-testid": "ai-inbox-reject-confirm",
|
|
4804
|
-
children: [/* @__PURE__ */ Q(
|
|
4859
|
+
children: [/* @__PURE__ */ Q(Y, { className: "h-3.5 w-3.5 mr-1" }), "Reject"]
|
|
4805
4860
|
})]
|
|
4806
4861
|
})]
|
|
4807
4862
|
})]
|
|
@@ -4974,10 +5029,10 @@ var Za = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
4974
5029
|
};
|
|
4975
5030
|
return /* @__PURE__ */ $("div", {
|
|
4976
5031
|
ref: p,
|
|
4977
|
-
className:
|
|
5032
|
+
className: W("flex flex-col border rounded-lg bg-background overflow-hidden", t),
|
|
4978
5033
|
style: { maxHeight: d },
|
|
4979
5034
|
...f,
|
|
4980
|
-
children: [/* @__PURE__ */ Q(
|
|
5035
|
+
children: [/* @__PURE__ */ Q(ce, {
|
|
4981
5036
|
ref: g,
|
|
4982
5037
|
className: "flex-1 p-4",
|
|
4983
5038
|
children: /* @__PURE__ */ Q("div", {
|
|
@@ -4998,7 +5053,7 @@ var Za = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
4998
5053
|
className: "border-t p-4",
|
|
4999
5054
|
children: /* @__PURE__ */ $("div", {
|
|
5000
5055
|
className: "flex gap-2",
|
|
5001
|
-
children: [/* @__PURE__ */ Q(
|
|
5056
|
+
children: [/* @__PURE__ */ Q(se, {
|
|
5002
5057
|
ref: _,
|
|
5003
5058
|
value: m,
|
|
5004
5059
|
onChange: (e) => h(e.target.value),
|
|
@@ -5010,7 +5065,7 @@ var Za = e.forwardRef(({ className: t, messages: n = [], placeholder: r = "Type
|
|
|
5010
5065
|
onClick: y,
|
|
5011
5066
|
disabled: a || !m.trim(),
|
|
5012
5067
|
size: "icon",
|
|
5013
|
-
children: /* @__PURE__ */ Q(
|
|
5068
|
+
children: /* @__PURE__ */ Q(ft, { className: "h-4 w-4" })
|
|
5014
5069
|
})]
|
|
5015
5070
|
})
|
|
5016
5071
|
})]
|
|
@@ -5028,7 +5083,7 @@ var Qa = ({ message: e, showTimestamp: t, userAvatarUrl: n, userAvatarFallback:
|
|
|
5028
5083
|
});
|
|
5029
5084
|
let s = o ? e.avatar || n : e.avatar || i, c = o ? e.avatarFallback || r : e.avatarFallback || a;
|
|
5030
5085
|
return /* @__PURE__ */ $("div", {
|
|
5031
|
-
className:
|
|
5086
|
+
className: W("flex gap-3", o ? "flex-row-reverse" : "flex-row"),
|
|
5032
5087
|
children: [/* @__PURE__ */ $(m, {
|
|
5033
5088
|
className: "h-8 w-8",
|
|
5034
5089
|
children: [/* @__PURE__ */ Q(g, { src: s }), /* @__PURE__ */ Q(h, {
|
|
@@ -5036,9 +5091,9 @@ var Qa = ({ message: e, showTimestamp: t, userAvatarUrl: n, userAvatarFallback:
|
|
|
5036
5091
|
children: c
|
|
5037
5092
|
})]
|
|
5038
5093
|
}), /* @__PURE__ */ $("div", {
|
|
5039
|
-
className:
|
|
5094
|
+
className: W("flex flex-col gap-1", o ? "items-end" : "items-start"),
|
|
5040
5095
|
children: [/* @__PURE__ */ Q("div", {
|
|
5041
|
-
className:
|
|
5096
|
+
className: W("rounded-lg px-4 py-2 max-w-[70%] break-words", o ? "bg-primary text-primary-foreground" : "bg-muted"),
|
|
5042
5097
|
children: /* @__PURE__ */ Q("p", {
|
|
5043
5098
|
className: "text-sm whitespace-pre-wrap",
|
|
5044
5099
|
children: e.content
|
|
@@ -5051,7 +5106,7 @@ var Qa = ({ message: e, showTimestamp: t, userAvatarUrl: n, userAvatarFallback:
|
|
|
5051
5106
|
});
|
|
5052
5107
|
}, $a = e.forwardRef(({ className: e, avatarSrc: t, avatarFallback: n = "AI", ...r }, i) => /* @__PURE__ */ $("div", {
|
|
5053
5108
|
ref: i,
|
|
5054
|
-
className:
|
|
5109
|
+
className: W("flex gap-3", e),
|
|
5055
5110
|
...r,
|
|
5056
5111
|
children: [/* @__PURE__ */ $(m, {
|
|
5057
5112
|
className: "h-8 w-8",
|