@truefoundry/trueforge-ui 0.2.2 → 0.2.3-rc.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 +11 -0
- package/dist/{ConnectorSettings-EYOQ72OS.js → ConnectorSettings-ODC3LVHN.js} +2 -2
- package/dist/{DockLayout-XIOJZ2YM.js → DockLayout-2RWDSUKE.js} +5 -5
- package/dist/{DrawerLayout-CNKNNVI7.js → DrawerLayout-CZLJYMIN.js} +5 -5
- package/dist/{ModelSettings-WBDPLI6O.js → ModelSettings-CKQ5CVAC.js} +2 -2
- package/dist/{SandboxSettings-4GHBXULN.js → SandboxSettings-HSCPYUOC.js} +2 -2
- package/dist/{SettingsBuilder-TD42LCIU.js → SettingsBuilder-MYWRFXRI.js} +13 -8
- package/dist/SettingsBuilder-MYWRFXRI.js.map +1 -0
- package/dist/{SidebarLayout-JGLTENB3.js → SidebarLayout-WVY54TGZ.js} +5 -5
- package/dist/{SkillSettings-UG6USX4N.js → SkillSettings-ECH6SHZ7.js} +2 -2
- package/dist/{TrueForgeUIWithRouter-CTC5XRSY.js → TrueForgeUIWithRouter-RKZ2E7PV.js} +3 -3
- package/dist/{WidgetLayout-6P6OUUTG.js → WidgetLayout-NWWB2SXI.js} +5 -5
- package/dist/{chunk-QNFP35TA.js → chunk-HVSUPYX2.js} +2 -2
- package/dist/{chunk-UVG6JSDE.js → chunk-KFUBFJR5.js} +6 -6
- package/dist/{chunk-27MKI3HF.js → chunk-OZTNBS6V.js} +2 -2
- package/dist/{chunk-H75C5ETA.js → chunk-TCAVLWYL.js} +5 -5
- package/dist/{chunk-YTC2SI4K.js → chunk-XRTTKGKN.js} +267 -263
- package/dist/chunk-XRTTKGKN.js.map +1 -0
- package/dist/index.js +4 -4
- package/dist/plugins/trueforge-agent-server-adapter/index.d.ts +13 -13
- package/dist/plugins/trueforge-agent-server-adapter/index.js +15 -12
- package/dist/plugins/trueforge-agent-server-adapter/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/SettingsBuilder-TD42LCIU.js.map +0 -1
- package/dist/chunk-YTC2SI4K.js.map +0 -1
- /package/dist/{ConnectorSettings-EYOQ72OS.js.map → ConnectorSettings-ODC3LVHN.js.map} +0 -0
- /package/dist/{DockLayout-XIOJZ2YM.js.map → DockLayout-2RWDSUKE.js.map} +0 -0
- /package/dist/{DrawerLayout-CNKNNVI7.js.map → DrawerLayout-CZLJYMIN.js.map} +0 -0
- /package/dist/{ModelSettings-WBDPLI6O.js.map → ModelSettings-CKQ5CVAC.js.map} +0 -0
- /package/dist/{SandboxSettings-4GHBXULN.js.map → SandboxSettings-HSCPYUOC.js.map} +0 -0
- /package/dist/{SidebarLayout-JGLTENB3.js.map → SidebarLayout-WVY54TGZ.js.map} +0 -0
- /package/dist/{SkillSettings-UG6USX4N.js.map → SkillSettings-ECH6SHZ7.js.map} +0 -0
- /package/dist/{TrueForgeUIWithRouter-CTC5XRSY.js.map → TrueForgeUIWithRouter-RKZ2E7PV.js.map} +0 -0
- /package/dist/{WidgetLayout-6P6OUUTG.js.map → WidgetLayout-NWWB2SXI.js.map} +0 -0
- /package/dist/{chunk-QNFP35TA.js.map → chunk-HVSUPYX2.js.map} +0 -0
- /package/dist/{chunk-UVG6JSDE.js.map → chunk-KFUBFJR5.js.map} +0 -0
- /package/dist/{chunk-27MKI3HF.js.map → chunk-OZTNBS6V.js.map} +0 -0
- /package/dist/{chunk-H75C5ETA.js.map → chunk-TCAVLWYL.js.map} +0 -0
|
@@ -695,7 +695,7 @@ function ResumeUnavailable({ className }) {
|
|
|
695
695
|
}
|
|
696
696
|
|
|
697
697
|
// src/atoms/AgentsLibrary.tsx
|
|
698
|
-
import { useEffect as useEffect4, useState as
|
|
698
|
+
import { useEffect as useEffect4, useState as useState6 } from "react";
|
|
699
699
|
|
|
700
700
|
// src/atoms/lib/useSearchAgentsList.ts
|
|
701
701
|
import { useCallback, useEffect as useEffect2, useRef, useState as useState3 } from "react";
|
|
@@ -968,8 +968,96 @@ function Skeleton({ className, ...props }) {
|
|
|
968
968
|
return /* @__PURE__ */ jsx15("div", { className: cn("animate-pulse rounded-md bg-secondary-bg", className), ...props });
|
|
969
969
|
}
|
|
970
970
|
|
|
971
|
+
// src/atoms/primitives/Tooltip.tsx
|
|
972
|
+
import { cloneElement, isValidElement, useLayoutEffect as useLayoutEffect2, useRef as useRef3, useState as useState5 } from "react";
|
|
973
|
+
import { createPortal } from "react-dom";
|
|
974
|
+
import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
975
|
+
function themePortalRoot(from) {
|
|
976
|
+
const dialog = from?.closest("dialog");
|
|
977
|
+
if (dialog instanceof HTMLElement) return dialog;
|
|
978
|
+
return from?.closest(".aui-theme-root") ?? document.body;
|
|
979
|
+
}
|
|
980
|
+
function Tooltip({ content, children, className, side = "top" }) {
|
|
981
|
+
const [visible, setVisible] = useState5(false);
|
|
982
|
+
const [pos, setPos] = useState5(null);
|
|
983
|
+
const triggerWrapRef = useRef3(null);
|
|
984
|
+
useLayoutEffect2(() => {
|
|
985
|
+
if (!visible) {
|
|
986
|
+
setPos(null);
|
|
987
|
+
return;
|
|
988
|
+
}
|
|
989
|
+
const update = () => {
|
|
990
|
+
const el = triggerWrapRef.current;
|
|
991
|
+
if (!el) return;
|
|
992
|
+
const rect = el.getBoundingClientRect();
|
|
993
|
+
setPos({
|
|
994
|
+
top: side === "bottom" ? rect.bottom + 6 : rect.top - 6,
|
|
995
|
+
left: rect.left + rect.width / 2
|
|
996
|
+
});
|
|
997
|
+
};
|
|
998
|
+
update();
|
|
999
|
+
window.addEventListener("scroll", update, true);
|
|
1000
|
+
window.addEventListener("resize", update);
|
|
1001
|
+
return () => {
|
|
1002
|
+
window.removeEventListener("scroll", update, true);
|
|
1003
|
+
window.removeEventListener("resize", update);
|
|
1004
|
+
};
|
|
1005
|
+
}, [visible, side]);
|
|
1006
|
+
if (!isValidElement(children)) return children;
|
|
1007
|
+
const p = children.props;
|
|
1008
|
+
const child = cloneElement(children, {
|
|
1009
|
+
onMouseEnter(e) {
|
|
1010
|
+
setVisible(true);
|
|
1011
|
+
p.onMouseEnter?.(e);
|
|
1012
|
+
},
|
|
1013
|
+
onMouseLeave(e) {
|
|
1014
|
+
setVisible(false);
|
|
1015
|
+
p.onMouseLeave?.(e);
|
|
1016
|
+
},
|
|
1017
|
+
onFocus(e) {
|
|
1018
|
+
setVisible(true);
|
|
1019
|
+
p.onFocus?.(e);
|
|
1020
|
+
},
|
|
1021
|
+
onBlur(e) {
|
|
1022
|
+
setVisible(false);
|
|
1023
|
+
p.onBlur?.(e);
|
|
1024
|
+
},
|
|
1025
|
+
onClick(e) {
|
|
1026
|
+
setVisible(false);
|
|
1027
|
+
p.onClick?.(e);
|
|
1028
|
+
}
|
|
1029
|
+
});
|
|
1030
|
+
const tooltip = visible && content != null && pos != null ? createPortal(
|
|
1031
|
+
/* @__PURE__ */ jsx16(
|
|
1032
|
+
"span",
|
|
1033
|
+
{
|
|
1034
|
+
role: "tooltip",
|
|
1035
|
+
style: {
|
|
1036
|
+
top: pos.top,
|
|
1037
|
+
left: pos.left,
|
|
1038
|
+
transform: side === "bottom" ? "translate(-50%, 0)" : "translate(-50%, -100%)"
|
|
1039
|
+
},
|
|
1040
|
+
className: cn(
|
|
1041
|
+
"pointer-events-none fixed z-[200]",
|
|
1042
|
+
"whitespace-nowrap rounded bg-card-bg px-2 py-1 text-xs text-text-primary shadow-md",
|
|
1043
|
+
className
|
|
1044
|
+
),
|
|
1045
|
+
children: content
|
|
1046
|
+
}
|
|
1047
|
+
),
|
|
1048
|
+
themePortalRoot(triggerWrapRef.current)
|
|
1049
|
+
) : null;
|
|
1050
|
+
return /* @__PURE__ */ jsxs9("span", { ref: triggerWrapRef, className: "relative inline-flex", children: [
|
|
1051
|
+
child,
|
|
1052
|
+
tooltip
|
|
1053
|
+
] });
|
|
1054
|
+
}
|
|
1055
|
+
function LightTooltip({ title, children, className, size: _size, side }) {
|
|
1056
|
+
return /* @__PURE__ */ jsx16(Tooltip, { content: title, className, side, children });
|
|
1057
|
+
}
|
|
1058
|
+
|
|
971
1059
|
// src/atoms/AgentsLibrary.tsx
|
|
972
|
-
import { Fragment as Fragment2, jsx as
|
|
1060
|
+
import { Fragment as Fragment2, jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
973
1061
|
function displayModelLabel(modelName) {
|
|
974
1062
|
const slash = modelName.lastIndexOf("/");
|
|
975
1063
|
return slash >= 0 ? modelName.slice(slash + 1) : modelName;
|
|
@@ -979,7 +1067,11 @@ function AgentLibraryRow({ agent, showEdit, onTry, onEdit }) {
|
|
|
979
1067
|
const modelName = spec?.model.name;
|
|
980
1068
|
const skillsCount = spec?.skills?.length ?? 0;
|
|
981
1069
|
const mcpCount = spec?.mcpServers?.length ?? 0;
|
|
982
|
-
|
|
1070
|
+
const skillNames = (spec?.skills ?? []).map((s) => s.name).filter(Boolean);
|
|
1071
|
+
const mcpNames = (spec?.mcpServers ?? []).map((m) => m.name).filter(Boolean);
|
|
1072
|
+
const connectorsTitle = mcpNames.length ? `Connectors: ${mcpNames.join(", ")}` : `${mcpCount} connectors`;
|
|
1073
|
+
const skillsTitle = skillNames.length ? `Skills: ${skillNames.join(", ")}` : `${skillsCount} skills`;
|
|
1074
|
+
return /* @__PURE__ */ jsxs10(
|
|
983
1075
|
"div",
|
|
984
1076
|
{
|
|
985
1077
|
role: "menuitem",
|
|
@@ -989,24 +1081,24 @@ function AgentLibraryRow({ agent, showEdit, onTry, onEdit }) {
|
|
|
989
1081
|
"focus-within:border-border focus-within:bg-ghost-button-hover"
|
|
990
1082
|
),
|
|
991
1083
|
children: [
|
|
992
|
-
/* @__PURE__ */
|
|
993
|
-
/* @__PURE__ */
|
|
994
|
-
spec != null ? /* @__PURE__ */
|
|
995
|
-
modelName ? /* @__PURE__ */
|
|
996
|
-
/* @__PURE__ */
|
|
997
|
-
/* @__PURE__ */
|
|
1084
|
+
/* @__PURE__ */ jsx17("span", { className: "bg-primary-bg text-text-secondary inline-flex size-8 shrink-0 items-center justify-center rounded-md border border-border", children: /* @__PURE__ */ jsx17(Icon, { name: "robot", className: "size-4" }) }),
|
|
1085
|
+
/* @__PURE__ */ jsx17("span", { className: "text-text-primary min-w-0 flex-1 truncate text-left text-sm font-medium leading-tight", children: agent.name }),
|
|
1086
|
+
spec != null ? /* @__PURE__ */ jsxs10("span", { className: "text-text-secondary flex shrink-0 items-center gap-2", children: [
|
|
1087
|
+
modelName ? /* @__PURE__ */ jsxs10("span", { className: "bg-primary-button-bg/10 text-primary-button-bg inline-flex max-w-[8rem] items-center gap-1 truncate rounded-full px-2 py-0.5 text-xs font-medium", children: [
|
|
1088
|
+
/* @__PURE__ */ jsx17(Icon, { name: "cpu", className: "size-3.5 shrink-0" }),
|
|
1089
|
+
/* @__PURE__ */ jsx17("span", { className: "truncate", children: displayModelLabel(modelName) })
|
|
998
1090
|
] }) : null,
|
|
999
|
-
/* @__PURE__ */
|
|
1000
|
-
/* @__PURE__ */
|
|
1001
|
-
skillsCount
|
|
1002
|
-
] }),
|
|
1003
|
-
/* @__PURE__ */ jsxs9("span", { className: "inline-flex items-center gap-1 text-xs", "aria-label": `${mcpCount} MCP servers`, children: [
|
|
1004
|
-
/* @__PURE__ */ jsx16(Icon, { name: "plug", className: "size-3.5" }),
|
|
1091
|
+
/* @__PURE__ */ jsx17(Tooltip, { content: connectorsTitle, children: /* @__PURE__ */ jsxs10("span", { className: "inline-flex items-center gap-1 text-xs", "aria-label": connectorsTitle, children: [
|
|
1092
|
+
/* @__PURE__ */ jsx17(Icon, { name: "plug", className: "size-3.5" }),
|
|
1005
1093
|
mcpCount
|
|
1006
|
-
] })
|
|
1094
|
+
] }) }),
|
|
1095
|
+
/* @__PURE__ */ jsx17(Tooltip, { content: skillsTitle, children: /* @__PURE__ */ jsxs10("span", { className: "inline-flex items-center gap-1 text-xs", "aria-label": skillsTitle, children: [
|
|
1096
|
+
/* @__PURE__ */ jsx17(Icon, { name: "lightbulb", className: "size-3.5" }),
|
|
1097
|
+
skillsCount
|
|
1098
|
+
] }) })
|
|
1007
1099
|
] }) : null,
|
|
1008
|
-
/* @__PURE__ */
|
|
1009
|
-
showEdit ? /* @__PURE__ */
|
|
1100
|
+
/* @__PURE__ */ jsxs10("span", { className: "flex shrink-0 items-center gap-1.5", children: [
|
|
1101
|
+
showEdit ? /* @__PURE__ */ jsxs10(
|
|
1010
1102
|
"button",
|
|
1011
1103
|
{
|
|
1012
1104
|
type: "button",
|
|
@@ -1017,12 +1109,12 @@ function AgentLibraryRow({ agent, showEdit, onTry, onEdit }) {
|
|
|
1017
1109
|
}),
|
|
1018
1110
|
onClick: onEdit,
|
|
1019
1111
|
children: [
|
|
1020
|
-
/* @__PURE__ */
|
|
1112
|
+
/* @__PURE__ */ jsx17(Icon, { name: "pencil", className: "size-3.5" }),
|
|
1021
1113
|
"Edit"
|
|
1022
1114
|
]
|
|
1023
1115
|
}
|
|
1024
1116
|
) : null,
|
|
1025
|
-
/* @__PURE__ */
|
|
1117
|
+
/* @__PURE__ */ jsxs10(
|
|
1026
1118
|
"button",
|
|
1027
1119
|
{
|
|
1028
1120
|
type: "button",
|
|
@@ -1033,7 +1125,7 @@ function AgentLibraryRow({ agent, showEdit, onTry, onEdit }) {
|
|
|
1033
1125
|
}),
|
|
1034
1126
|
onClick: onTry,
|
|
1035
1127
|
children: [
|
|
1036
|
-
/* @__PURE__ */
|
|
1128
|
+
/* @__PURE__ */ jsx17(Icon, { name: "play", className: "size-3.5" }),
|
|
1037
1129
|
"Try"
|
|
1038
1130
|
]
|
|
1039
1131
|
}
|
|
@@ -1045,7 +1137,7 @@ function AgentLibraryRow({ agent, showEdit, onTry, onEdit }) {
|
|
|
1045
1137
|
}
|
|
1046
1138
|
function AgentsLibrary({ open, onOpenChange, onSelectAgent }) {
|
|
1047
1139
|
const shell = useOptionalShellMode();
|
|
1048
|
-
const [query, setQuery] =
|
|
1140
|
+
const [query, setQuery] = useState6("");
|
|
1049
1141
|
const canEdit = shell?.isComposerEnabled === true;
|
|
1050
1142
|
const agentsListEpoch = shell?.agentsListEpoch ?? 0;
|
|
1051
1143
|
useEffect4(() => {
|
|
@@ -1079,23 +1171,23 @@ function AgentsLibrary({ open, onOpenChange, onSelectAgent }) {
|
|
|
1079
1171
|
agentSpec
|
|
1080
1172
|
});
|
|
1081
1173
|
};
|
|
1082
|
-
return /* @__PURE__ */
|
|
1083
|
-
/* @__PURE__ */
|
|
1084
|
-
/* @__PURE__ */
|
|
1085
|
-
isSearching ? /* @__PURE__ */
|
|
1174
|
+
return /* @__PURE__ */ jsx17(CenteredModal, { open, onOpenChange, title: "Agents Library", children: /* @__PURE__ */ jsxs10("div", { className: "bg-secondary-bg/40 flex min-h-0 flex-1 flex-col", children: [
|
|
1175
|
+
/* @__PURE__ */ jsxs10("div", { className: "shrink-0 border-b border-border px-4 py-3", children: [
|
|
1176
|
+
/* @__PURE__ */ jsx17(SearchInput_default, { query, setQuery, placeholder: "Search agents" }),
|
|
1177
|
+
isSearching ? /* @__PURE__ */ jsx17("p", { className: "text-text-secondary mt-1.5 text-xs", role: "status", children: "Searching\u2026" }) : null
|
|
1086
1178
|
] }),
|
|
1087
|
-
/* @__PURE__ */
|
|
1179
|
+
/* @__PURE__ */ jsx17(
|
|
1088
1180
|
"div",
|
|
1089
1181
|
{
|
|
1090
1182
|
ref: listRef,
|
|
1091
1183
|
className: "flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto p-2",
|
|
1092
1184
|
role: "menu",
|
|
1093
1185
|
"aria-label": "Agents",
|
|
1094
|
-
children: isInitialLoading ? /* @__PURE__ */
|
|
1186
|
+
children: isInitialLoading ? /* @__PURE__ */ jsx17("div", { className: "flex flex-col gap-2 p-1", role: "status", "aria-label": "Loading agents", children: Array.from({ length: 6 }, (_, i) => /* @__PURE__ */ jsx17(Skeleton, { className: "h-11 w-full rounded-md" }, i)) }) : error ? /* @__PURE__ */ jsx17("p", { className: "text-failure-bg px-3 py-8 text-center text-sm", children: error }) : agents.length === 0 ? /* @__PURE__ */ jsx17("p", { className: "text-text-secondary px-3 py-8 text-center text-sm", children: query.trim() ? `No agents match "${query.trim()}".` : "No agents yet. Build one in a chat, then save it as an agent." }) : /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
1095
1187
|
agents.map((agent) => {
|
|
1096
1188
|
const agentSpec = agent.agentSpec;
|
|
1097
1189
|
const showEdit = canEdit && agentSpec != null;
|
|
1098
|
-
return /* @__PURE__ */
|
|
1190
|
+
return /* @__PURE__ */ jsx17(
|
|
1099
1191
|
AgentLibraryRow,
|
|
1100
1192
|
{
|
|
1101
1193
|
agent,
|
|
@@ -1108,7 +1200,7 @@ function AgentsLibrary({ open, onOpenChange, onSelectAgent }) {
|
|
|
1108
1200
|
libraryAgentId(agent)
|
|
1109
1201
|
);
|
|
1110
1202
|
}),
|
|
1111
|
-
hasMore ? /* @__PURE__ */
|
|
1203
|
+
hasMore ? /* @__PURE__ */ jsx17("div", { ref: sentinelRef, className: "flex h-8 shrink-0 items-center justify-center", "aria-hidden": true, children: loadingMore ? /* @__PURE__ */ jsx17("span", { className: "text-text-secondary text-xs", role: "status", children: "Loading more\u2026" }) : null }) : null
|
|
1112
1204
|
] })
|
|
1113
1205
|
}
|
|
1114
1206
|
)
|
|
@@ -1116,14 +1208,14 @@ function AgentsLibrary({ open, onOpenChange, onSelectAgent }) {
|
|
|
1116
1208
|
}
|
|
1117
1209
|
|
|
1118
1210
|
// src/atoms/AgentsLibraryButton.tsx
|
|
1119
|
-
import { useEffect as useEffect5, useState as
|
|
1120
|
-
import { Fragment as Fragment3, jsx as
|
|
1211
|
+
import { useEffect as useEffect5, useState as useState7 } from "react";
|
|
1212
|
+
import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1121
1213
|
function AgentsLibraryButton({ className, compact = false, onSelectAgent }) {
|
|
1122
1214
|
const AgentsLibrary2 = useSlot("AgentsLibrary");
|
|
1123
1215
|
const server = useOptionalServer();
|
|
1124
1216
|
const shell = useOptionalShellMode();
|
|
1125
|
-
const [open, setOpen] =
|
|
1126
|
-
const [countLabel, setCountLabel] =
|
|
1217
|
+
const [open, setOpen] = useState7(false);
|
|
1218
|
+
const [countLabel, setCountLabel] = useState7(null);
|
|
1127
1219
|
const enabled = shell?.isLibraryEnabled === true && server != null;
|
|
1128
1220
|
const agentsListEpoch = shell?.agentsListEpoch ?? 0;
|
|
1129
1221
|
useEffect5(() => {
|
|
@@ -1138,8 +1230,8 @@ function AgentsLibraryButton({ className, compact = false, onSelectAgent }) {
|
|
|
1138
1230
|
};
|
|
1139
1231
|
}, [enabled, server, agentsListEpoch, compact]);
|
|
1140
1232
|
if (!enabled) return null;
|
|
1141
|
-
return /* @__PURE__ */
|
|
1142
|
-
/* @__PURE__ */
|
|
1233
|
+
return /* @__PURE__ */ jsxs11(Fragment3, { children: [
|
|
1234
|
+
/* @__PURE__ */ jsx18("div", { className: cn("relative min-w-0", compact ? "w-8" : "w-full", className), children: /* @__PURE__ */ jsxs11(
|
|
1143
1235
|
"button",
|
|
1144
1236
|
{
|
|
1145
1237
|
type: "button",
|
|
@@ -1157,29 +1249,29 @@ function AgentsLibraryButton({ className, compact = false, onSelectAgent }) {
|
|
|
1157
1249
|
}),
|
|
1158
1250
|
onClick: () => setOpen(true),
|
|
1159
1251
|
children: [
|
|
1160
|
-
/* @__PURE__ */
|
|
1161
|
-
!compact ? /* @__PURE__ */
|
|
1162
|
-
/* @__PURE__ */
|
|
1252
|
+
/* @__PURE__ */ jsx18(Icon, { name: "robot" }),
|
|
1253
|
+
!compact ? /* @__PURE__ */ jsxs11(Fragment3, { children: [
|
|
1254
|
+
/* @__PURE__ */ jsxs11("span", { className: "truncate", children: [
|
|
1163
1255
|
"Agents Library",
|
|
1164
|
-
countLabel != null ? /* @__PURE__ */
|
|
1256
|
+
countLabel != null ? /* @__PURE__ */ jsxs11("span", { className: "text-text-secondary", children: [
|
|
1165
1257
|
" (",
|
|
1166
1258
|
countLabel,
|
|
1167
1259
|
")"
|
|
1168
1260
|
] }) : null
|
|
1169
1261
|
] }),
|
|
1170
|
-
/* @__PURE__ */
|
|
1262
|
+
/* @__PURE__ */ jsx18(Icon, { name: "chevron-right", className: "ml-auto size-3.5 shrink-0 opacity-60" })
|
|
1171
1263
|
] }) : null
|
|
1172
1264
|
]
|
|
1173
1265
|
}
|
|
1174
1266
|
) }),
|
|
1175
|
-
/* @__PURE__ */
|
|
1267
|
+
/* @__PURE__ */ jsx18(AgentsLibrary2, { open, onOpenChange: setOpen, onSelectAgent })
|
|
1176
1268
|
] });
|
|
1177
1269
|
}
|
|
1178
1270
|
|
|
1179
1271
|
// src/atoms/AssistantMessageBubble.tsx
|
|
1180
|
-
import { jsx as
|
|
1272
|
+
import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1181
1273
|
function AssistantMessageBubble({ children, error, actionBar, className }) {
|
|
1182
|
-
return /* @__PURE__ */
|
|
1274
|
+
return /* @__PURE__ */ jsxs12(
|
|
1183
1275
|
"div",
|
|
1184
1276
|
{
|
|
1185
1277
|
"data-slot": "aui_assistant-message-root",
|
|
@@ -1188,11 +1280,11 @@ function AssistantMessageBubble({ children, error, actionBar, className }) {
|
|
|
1188
1280
|
className
|
|
1189
1281
|
),
|
|
1190
1282
|
children: [
|
|
1191
|
-
/* @__PURE__ */
|
|
1283
|
+
/* @__PURE__ */ jsxs12("div", { className: "min-w-0 max-w-full", children: [
|
|
1192
1284
|
children,
|
|
1193
|
-
error && /* @__PURE__ */
|
|
1285
|
+
error && /* @__PURE__ */ jsx19("div", { className: "mt-2 text-sm text-failure-bg", children: error })
|
|
1194
1286
|
] }),
|
|
1195
|
-
actionBar && /* @__PURE__ */
|
|
1287
|
+
actionBar && /* @__PURE__ */ jsx19("div", { className: "mt-1", children: actionBar })
|
|
1196
1288
|
]
|
|
1197
1289
|
}
|
|
1198
1290
|
);
|
|
@@ -1202,15 +1294,15 @@ function AssistantMessageBubble({ children, error, actionBar, className }) {
|
|
|
1202
1294
|
var USER_MESSAGE_ATTACHMENT_PREVIEW_REM = 12;
|
|
1203
1295
|
|
|
1204
1296
|
// src/atoms/primitives/Avatar.tsx
|
|
1205
|
-
import { useState as
|
|
1206
|
-
import { jsx as
|
|
1297
|
+
import { useState as useState8 } from "react";
|
|
1298
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1207
1299
|
var sizeClasses = {
|
|
1208
1300
|
sm: "h-6 w-6 text-xs",
|
|
1209
1301
|
default: "h-8 w-8 text-sm",
|
|
1210
1302
|
lg: "h-10 w-10 text-base"
|
|
1211
1303
|
};
|
|
1212
1304
|
function Avatar({ className, size = "default", ...props }) {
|
|
1213
|
-
return /* @__PURE__ */
|
|
1305
|
+
return /* @__PURE__ */ jsx20(
|
|
1214
1306
|
"div",
|
|
1215
1307
|
{
|
|
1216
1308
|
"data-slot": "avatar",
|
|
@@ -1221,9 +1313,9 @@ function Avatar({ className, size = "default", ...props }) {
|
|
|
1221
1313
|
);
|
|
1222
1314
|
}
|
|
1223
1315
|
function AvatarImage({ className, src, alt = "", onError, ...props }) {
|
|
1224
|
-
const [failed, setFailed] =
|
|
1316
|
+
const [failed, setFailed] = useState8(false);
|
|
1225
1317
|
if (failed || !src) return null;
|
|
1226
|
-
return /* @__PURE__ */
|
|
1318
|
+
return /* @__PURE__ */ jsx20(
|
|
1227
1319
|
"img",
|
|
1228
1320
|
{
|
|
1229
1321
|
"data-slot": "avatar-image",
|
|
@@ -1239,7 +1331,7 @@ function AvatarImage({ className, src, alt = "", onError, ...props }) {
|
|
|
1239
1331
|
);
|
|
1240
1332
|
}
|
|
1241
1333
|
function AvatarFallback({ className, ...props }) {
|
|
1242
|
-
return /* @__PURE__ */
|
|
1334
|
+
return /* @__PURE__ */ jsx20(
|
|
1243
1335
|
"div",
|
|
1244
1336
|
{
|
|
1245
1337
|
"data-slot": "avatar-fallback",
|
|
@@ -1253,7 +1345,7 @@ function AvatarFallback({ className, ...props }) {
|
|
|
1253
1345
|
}
|
|
1254
1346
|
|
|
1255
1347
|
// src/atoms/AttachmentCard.tsx
|
|
1256
|
-
import { jsx as
|
|
1348
|
+
import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1257
1349
|
function AttachmentCard({
|
|
1258
1350
|
name,
|
|
1259
1351
|
previewSrc,
|
|
@@ -1265,7 +1357,7 @@ function AttachmentCard({
|
|
|
1265
1357
|
}) {
|
|
1266
1358
|
if (size === "preview" && isImage && previewSrc) {
|
|
1267
1359
|
const previewSize = previewRem != null ? { width: `${previewRem}rem`, height: `${previewRem}rem` } : void 0;
|
|
1268
|
-
return /* @__PURE__ */
|
|
1360
|
+
return /* @__PURE__ */ jsx21(
|
|
1269
1361
|
"div",
|
|
1270
1362
|
{
|
|
1271
1363
|
"data-slot": "aui_attachment-preview",
|
|
@@ -1275,11 +1367,11 @@ function AttachmentCard({
|
|
|
1275
1367
|
previewRem == null && "size-24",
|
|
1276
1368
|
className
|
|
1277
1369
|
),
|
|
1278
|
-
children: /* @__PURE__ */
|
|
1370
|
+
children: /* @__PURE__ */ jsx21("img", { src: previewSrc, alt: name, className: "h-full w-full object-cover" })
|
|
1279
1371
|
}
|
|
1280
1372
|
);
|
|
1281
1373
|
}
|
|
1282
|
-
return /* @__PURE__ */
|
|
1374
|
+
return /* @__PURE__ */ jsxs13(
|
|
1283
1375
|
"div",
|
|
1284
1376
|
{
|
|
1285
1377
|
"data-slot": "aui_attachment-chip",
|
|
@@ -1289,12 +1381,12 @@ function AttachmentCard({
|
|
|
1289
1381
|
className
|
|
1290
1382
|
),
|
|
1291
1383
|
children: [
|
|
1292
|
-
/* @__PURE__ */
|
|
1293
|
-
/* @__PURE__ */
|
|
1294
|
-
/* @__PURE__ */
|
|
1295
|
-
] }) : /* @__PURE__ */
|
|
1296
|
-
/* @__PURE__ */
|
|
1297
|
-
onRemove && /* @__PURE__ */
|
|
1384
|
+
/* @__PURE__ */ jsx21("div", { className: "bg-primary-bg flex size-7 shrink-0 items-center justify-center overflow-hidden rounded-md border", children: isImage && previewSrc ? /* @__PURE__ */ jsxs13(Avatar, { className: "size-7 rounded-none", children: [
|
|
1385
|
+
/* @__PURE__ */ jsx21(AvatarImage, { src: previewSrc, alt: name, className: "object-cover" }),
|
|
1386
|
+
/* @__PURE__ */ jsx21(AvatarFallback, { children: /* @__PURE__ */ jsx21(Icon, { name: "file", size: "1rem", className: "text-text-secondary" }) })
|
|
1387
|
+
] }) : /* @__PURE__ */ jsx21(Icon, { name: "file", size: "1rem", className: "text-text-secondary" }) }),
|
|
1388
|
+
/* @__PURE__ */ jsx21("span", { className: "text-text-primary min-w-0 truncate text-sm", children: name }),
|
|
1389
|
+
onRemove && /* @__PURE__ */ jsx21(
|
|
1298
1390
|
"button",
|
|
1299
1391
|
{
|
|
1300
1392
|
type: "button",
|
|
@@ -1306,7 +1398,7 @@ function AttachmentCard({
|
|
|
1306
1398
|
className: "size-6 shrink-0 rounded-full"
|
|
1307
1399
|
}),
|
|
1308
1400
|
onClick: onRemove,
|
|
1309
|
-
children: /* @__PURE__ */
|
|
1401
|
+
children: /* @__PURE__ */ jsx21(Icon, { name: "xmark" })
|
|
1310
1402
|
}
|
|
1311
1403
|
)
|
|
1312
1404
|
]
|
|
@@ -1315,9 +1407,9 @@ function AttachmentCard({
|
|
|
1315
1407
|
}
|
|
1316
1408
|
|
|
1317
1409
|
// src/atoms/AttachmentPickerButton.tsx
|
|
1318
|
-
import { jsx as
|
|
1410
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1319
1411
|
function AttachmentPickerButton({ className, ...props }) {
|
|
1320
|
-
return /* @__PURE__ */
|
|
1412
|
+
return /* @__PURE__ */ jsx22(
|
|
1321
1413
|
"button",
|
|
1322
1414
|
{
|
|
1323
1415
|
type: "button",
|
|
@@ -1329,17 +1421,17 @@ function AttachmentPickerButton({ className, ...props }) {
|
|
|
1329
1421
|
className: `size-7 rounded-full p-1 ${className ?? ""}`
|
|
1330
1422
|
}),
|
|
1331
1423
|
...props,
|
|
1332
|
-
children: /* @__PURE__ */
|
|
1424
|
+
children: /* @__PURE__ */ jsx22(Icon, { name: "paperclip" })
|
|
1333
1425
|
}
|
|
1334
1426
|
);
|
|
1335
1427
|
}
|
|
1336
1428
|
|
|
1337
1429
|
// src/atoms/AttachmentPreviewDialog.tsx
|
|
1338
|
-
import { useState as
|
|
1430
|
+
import { useState as useState9 } from "react";
|
|
1339
1431
|
|
|
1340
1432
|
// src/atoms/primitives/Dialog.tsx
|
|
1341
|
-
import
|
|
1342
|
-
import { jsx as
|
|
1433
|
+
import React7 from "react";
|
|
1434
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1343
1435
|
function Dialog({
|
|
1344
1436
|
open,
|
|
1345
1437
|
onOpenChange,
|
|
@@ -1348,8 +1440,8 @@ function Dialog({
|
|
|
1348
1440
|
"aria-label": ariaLabel,
|
|
1349
1441
|
"aria-labelledby": ariaLabelledBy
|
|
1350
1442
|
}) {
|
|
1351
|
-
const ref =
|
|
1352
|
-
|
|
1443
|
+
const ref = React7.useRef(null);
|
|
1444
|
+
React7.useEffect(() => {
|
|
1353
1445
|
const el = ref.current;
|
|
1354
1446
|
if (!el) return;
|
|
1355
1447
|
if (open && !el.open) {
|
|
@@ -1358,7 +1450,7 @@ function Dialog({
|
|
|
1358
1450
|
el.close();
|
|
1359
1451
|
}
|
|
1360
1452
|
}, [open]);
|
|
1361
|
-
|
|
1453
|
+
React7.useEffect(() => {
|
|
1362
1454
|
const el = ref.current;
|
|
1363
1455
|
if (!el) return;
|
|
1364
1456
|
const handler = () => onOpenChange(false);
|
|
@@ -1368,7 +1460,7 @@ function Dialog({
|
|
|
1368
1460
|
const handleBackdropClick = (e) => {
|
|
1369
1461
|
if (e.target === ref.current) onOpenChange(false);
|
|
1370
1462
|
};
|
|
1371
|
-
return /* @__PURE__ */
|
|
1463
|
+
return /* @__PURE__ */ jsx23(
|
|
1372
1464
|
"dialog",
|
|
1373
1465
|
{
|
|
1374
1466
|
ref,
|
|
@@ -1386,22 +1478,22 @@ function Dialog({
|
|
|
1386
1478
|
);
|
|
1387
1479
|
}
|
|
1388
1480
|
function DialogContent({ className, children, ...props }) {
|
|
1389
|
-
return /* @__PURE__ */
|
|
1481
|
+
return /* @__PURE__ */ jsx23("div", { className: cn("flex flex-col gap-4 p-6", className), ...props, children });
|
|
1390
1482
|
}
|
|
1391
1483
|
function DialogHeader({ className, ...props }) {
|
|
1392
|
-
return /* @__PURE__ */
|
|
1484
|
+
return /* @__PURE__ */ jsx23("div", { className: cn("flex flex-col gap-1.5", className), ...props });
|
|
1393
1485
|
}
|
|
1394
1486
|
function DialogTitle({ className, ...props }) {
|
|
1395
|
-
return /* @__PURE__ */
|
|
1487
|
+
return /* @__PURE__ */ jsx23("h2", { className: cn("text-lg font-semibold leading-none tracking-tight", className), ...props });
|
|
1396
1488
|
}
|
|
1397
1489
|
|
|
1398
1490
|
// src/atoms/AttachmentPreviewDialog.tsx
|
|
1399
|
-
import { Fragment as Fragment4, jsx as
|
|
1491
|
+
import { Fragment as Fragment4, jsx as jsx24, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1400
1492
|
function AttachmentPreviewDialog({ previewSrc, children }) {
|
|
1401
|
-
const [open, setOpen] =
|
|
1402
|
-
if (!previewSrc) return /* @__PURE__ */
|
|
1403
|
-
return /* @__PURE__ */
|
|
1404
|
-
/* @__PURE__ */
|
|
1493
|
+
const [open, setOpen] = useState9(false);
|
|
1494
|
+
if (!previewSrc) return /* @__PURE__ */ jsx24(Fragment4, { children });
|
|
1495
|
+
return /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
1496
|
+
/* @__PURE__ */ jsx24(
|
|
1405
1497
|
"button",
|
|
1406
1498
|
{
|
|
1407
1499
|
type: "button",
|
|
@@ -1411,15 +1503,15 @@ function AttachmentPreviewDialog({ previewSrc, children }) {
|
|
|
1411
1503
|
children
|
|
1412
1504
|
}
|
|
1413
1505
|
),
|
|
1414
|
-
/* @__PURE__ */
|
|
1506
|
+
/* @__PURE__ */ jsx24(
|
|
1415
1507
|
Dialog,
|
|
1416
1508
|
{
|
|
1417
1509
|
open,
|
|
1418
1510
|
onOpenChange: setOpen,
|
|
1419
1511
|
"aria-label": "Attachment preview",
|
|
1420
1512
|
className: "max-w-[calc(100%-2rem)] sm:max-w-3xl",
|
|
1421
|
-
children: /* @__PURE__ */
|
|
1422
|
-
/* @__PURE__ */
|
|
1513
|
+
children: /* @__PURE__ */ jsxs14(DialogContent, { className: "relative p-2", children: [
|
|
1514
|
+
/* @__PURE__ */ jsx24("span", { className: "absolute top-2 right-2 z-10 inline-flex", children: /* @__PURE__ */ jsx24(
|
|
1423
1515
|
"button",
|
|
1424
1516
|
{
|
|
1425
1517
|
type: "button",
|
|
@@ -1427,10 +1519,10 @@ function AttachmentPreviewDialog({ previewSrc, children }) {
|
|
|
1427
1519
|
title: "Close",
|
|
1428
1520
|
className: auiButtonClass({ variant: "ghost", size: "icon" }),
|
|
1429
1521
|
onClick: () => setOpen(false),
|
|
1430
|
-
children: /* @__PURE__ */
|
|
1522
|
+
children: /* @__PURE__ */ jsx24(Icon, { name: "xmark" })
|
|
1431
1523
|
}
|
|
1432
1524
|
) }),
|
|
1433
|
-
/* @__PURE__ */
|
|
1525
|
+
/* @__PURE__ */ jsx24("div", { className: "bg-primary-bg relative mx-auto flex max-h-[80dvh] w-full items-center justify-center overflow-hidden", children: /* @__PURE__ */ jsx24(
|
|
1434
1526
|
"img",
|
|
1435
1527
|
{
|
|
1436
1528
|
src: previewSrc,
|
|
@@ -1445,36 +1537,36 @@ function AttachmentPreviewDialog({ previewSrc, children }) {
|
|
|
1445
1537
|
}
|
|
1446
1538
|
|
|
1447
1539
|
// src/atoms/ChatFileDownload.tsx
|
|
1448
|
-
import { useState as
|
|
1449
|
-
import { jsx as
|
|
1540
|
+
import { useState as useState10 } from "react";
|
|
1541
|
+
import { jsx as jsx25, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1450
1542
|
function ChatFileDownload({ files, fileDownloadBaseUrl, onDownloadArtifact, readOnly }) {
|
|
1451
|
-
const [downloadingPath, setDownloadingPath] =
|
|
1452
|
-
return /* @__PURE__ */
|
|
1543
|
+
const [downloadingPath, setDownloadingPath] = useState10(null);
|
|
1544
|
+
return /* @__PURE__ */ jsxs15(
|
|
1453
1545
|
"details",
|
|
1454
1546
|
{
|
|
1455
1547
|
open: true,
|
|
1456
1548
|
className: "aui-sandbox-artifacts group my-2 overflow-hidden rounded-lg border border-primary-button-bg/20 bg-card-bg",
|
|
1457
1549
|
"data-testid": "aui-sandbox-artifacts",
|
|
1458
1550
|
children: [
|
|
1459
|
-
/* @__PURE__ */
|
|
1460
|
-
/* @__PURE__ */
|
|
1461
|
-
/* @__PURE__ */
|
|
1462
|
-
/* @__PURE__ */
|
|
1551
|
+
/* @__PURE__ */ jsxs15("summary", { className: "flex min-h-9 cursor-pointer list-none items-center gap-2 bg-primary-button-bg/5 px-3 py-2 text-xs font-medium leading-none text-primary-button-bg [&::-webkit-details-marker]:hidden", children: [
|
|
1552
|
+
/* @__PURE__ */ jsx25(Icon, { name: "chevron-down", size: 13, className: "shrink-0 transition-transform group-open:rotate-180" }),
|
|
1553
|
+
/* @__PURE__ */ jsx25(Icon, { name: "file", size: 16, className: "shrink-0" }),
|
|
1554
|
+
/* @__PURE__ */ jsxs15("span", { className: "leading-none", children: [
|
|
1463
1555
|
files.length,
|
|
1464
1556
|
" ",
|
|
1465
1557
|
files.length === 1 ? "file" : "files",
|
|
1466
1558
|
" generated"
|
|
1467
1559
|
] })
|
|
1468
1560
|
] }),
|
|
1469
|
-
/* @__PURE__ */
|
|
1561
|
+
/* @__PURE__ */ jsx25("div", { className: "flex flex-wrap items-center gap-y-1 px-3 py-2", children: files.map(({ name, path }) => {
|
|
1470
1562
|
if (readOnly) {
|
|
1471
|
-
return /* @__PURE__ */
|
|
1563
|
+
return /* @__PURE__ */ jsxs15(
|
|
1472
1564
|
"span",
|
|
1473
1565
|
{
|
|
1474
1566
|
className: "mr-3 inline-flex min-h-7 items-center gap-1.5 border-r border-border pr-3 text-xs text-text-secondary last:mr-0 last:border-r-0 last:pr-0",
|
|
1475
1567
|
children: [
|
|
1476
|
-
/* @__PURE__ */
|
|
1477
|
-
/* @__PURE__ */
|
|
1568
|
+
/* @__PURE__ */ jsx25(Icon, { name: "file", size: 14, className: "shrink-0" }),
|
|
1569
|
+
/* @__PURE__ */ jsx25("span", { className: "leading-none", children: name })
|
|
1478
1570
|
]
|
|
1479
1571
|
},
|
|
1480
1572
|
path
|
|
@@ -1494,7 +1586,7 @@ function ChatFileDownload({ files, fileDownloadBaseUrl, onDownloadArtifact, read
|
|
|
1494
1586
|
setDownloadingPath((current) => current === path ? null : current);
|
|
1495
1587
|
});
|
|
1496
1588
|
};
|
|
1497
|
-
return /* @__PURE__ */
|
|
1589
|
+
return /* @__PURE__ */ jsxs15(
|
|
1498
1590
|
"a",
|
|
1499
1591
|
{
|
|
1500
1592
|
href: canDownload ? href ?? "#" : void 0,
|
|
@@ -1508,9 +1600,9 @@ function ChatFileDownload({ files, fileDownloadBaseUrl, onDownloadArtifact, read
|
|
|
1508
1600
|
download: name,
|
|
1509
1601
|
"aria-label": isDownloading ? `Downloading ${name}` : `Download ${name}`,
|
|
1510
1602
|
children: [
|
|
1511
|
-
/* @__PURE__ */
|
|
1512
|
-
/* @__PURE__ */
|
|
1513
|
-
isDownloading ? /* @__PURE__ */
|
|
1603
|
+
/* @__PURE__ */ jsx25(Icon, { name: "file", size: 14, className: "shrink-0 text-text-secondary" }),
|
|
1604
|
+
/* @__PURE__ */ jsx25("span", { className: "leading-none", children: name }),
|
|
1605
|
+
isDownloading ? /* @__PURE__ */ jsx25(Spinner, { size: 14, className: "shrink-0 text-primary-button-bg" }) : /* @__PURE__ */ jsx25(Icon, { name: "download", size: 14, className: "shrink-0 text-primary-button-bg" })
|
|
1514
1606
|
]
|
|
1515
1607
|
},
|
|
1516
1608
|
path
|
|
@@ -1552,12 +1644,12 @@ function useChatHeaderContentVisible() {
|
|
|
1552
1644
|
}
|
|
1553
1645
|
|
|
1554
1646
|
// src/atoms/ClearChatButton.tsx
|
|
1555
|
-
import { jsx as
|
|
1647
|
+
import { jsx as jsx26, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1556
1648
|
function ClearChatButton() {
|
|
1557
1649
|
const shell = useOptionalShellMode();
|
|
1558
1650
|
const visible = useChatChromeActionsVisible();
|
|
1559
1651
|
if (!visible || shell == null) return null;
|
|
1560
|
-
return /* @__PURE__ */
|
|
1652
|
+
return /* @__PURE__ */ jsxs16(
|
|
1561
1653
|
"button",
|
|
1562
1654
|
{
|
|
1563
1655
|
type: "button",
|
|
@@ -1565,7 +1657,7 @@ function ClearChatButton() {
|
|
|
1565
1657
|
className: auiButtonClass({ variant: "ghost", size: "sm" }),
|
|
1566
1658
|
onClick: () => shell.clearChat(),
|
|
1567
1659
|
children: [
|
|
1568
|
-
/* @__PURE__ */
|
|
1660
|
+
/* @__PURE__ */ jsx26(Icon, { name: "broom", size: "0.875rem" }),
|
|
1569
1661
|
"Clear chat"
|
|
1570
1662
|
]
|
|
1571
1663
|
}
|
|
@@ -1573,15 +1665,15 @@ function ClearChatButton() {
|
|
|
1573
1665
|
}
|
|
1574
1666
|
|
|
1575
1667
|
// src/atoms/CodeEditor.tsx
|
|
1576
|
-
import { useCallback as useCallback2, useState as
|
|
1577
|
-
import { jsx as
|
|
1668
|
+
import { useCallback as useCallback2, useState as useState11 } from "react";
|
|
1669
|
+
import { jsx as jsx27, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1578
1670
|
function ToolbarButton({
|
|
1579
1671
|
onClick,
|
|
1580
1672
|
tooltip,
|
|
1581
1673
|
icon,
|
|
1582
1674
|
active
|
|
1583
1675
|
}) {
|
|
1584
|
-
return /* @__PURE__ */
|
|
1676
|
+
return /* @__PURE__ */ jsx27(
|
|
1585
1677
|
"button",
|
|
1586
1678
|
{
|
|
1587
1679
|
type: "button",
|
|
@@ -1593,7 +1685,7 @@ function ToolbarButton({
|
|
|
1593
1685
|
active && "bg-dropdown-selected-item-bg text-dropdown-selected-item-text"
|
|
1594
1686
|
),
|
|
1595
1687
|
"aria-label": tooltip,
|
|
1596
|
-
children: /* @__PURE__ */
|
|
1688
|
+
children: /* @__PURE__ */ jsx27(Icon, { name: icon, size: "0.875em" })
|
|
1597
1689
|
}
|
|
1598
1690
|
);
|
|
1599
1691
|
}
|
|
@@ -1610,9 +1702,9 @@ function CodeEditor({
|
|
|
1610
1702
|
showToolbar = true
|
|
1611
1703
|
}) {
|
|
1612
1704
|
const MonacoEditorCore2 = useSlot("MonacoEditorCore");
|
|
1613
|
-
const [showLineNumbers, setShowLineNumbers] =
|
|
1614
|
-
const [expanded, setExpanded] =
|
|
1615
|
-
const [copied, setCopied] =
|
|
1705
|
+
const [showLineNumbers, setShowLineNumbers] = useState11(false);
|
|
1706
|
+
const [expanded, setExpanded] = useState11(false);
|
|
1707
|
+
const [copied, setCopied] = useState11(false);
|
|
1616
1708
|
const handleCopy = useCallback2(() => {
|
|
1617
1709
|
void navigator.clipboard.writeText(value).then(() => {
|
|
1618
1710
|
setCopied(true);
|
|
@@ -1635,7 +1727,7 @@ function CodeEditor({
|
|
|
1635
1727
|
wordWrap: "on"
|
|
1636
1728
|
};
|
|
1637
1729
|
const editorHeight = expanded ? "100%" : height ?? 320;
|
|
1638
|
-
return /* @__PURE__ */
|
|
1730
|
+
return /* @__PURE__ */ jsxs17(
|
|
1639
1731
|
"div",
|
|
1640
1732
|
{
|
|
1641
1733
|
className: cn(
|
|
@@ -1644,10 +1736,10 @@ function CodeEditor({
|
|
|
1644
1736
|
className
|
|
1645
1737
|
),
|
|
1646
1738
|
children: [
|
|
1647
|
-
showToolbar && /* @__PURE__ */
|
|
1648
|
-
filename && /* @__PURE__ */
|
|
1649
|
-
/* @__PURE__ */
|
|
1650
|
-
/* @__PURE__ */
|
|
1739
|
+
showToolbar && /* @__PURE__ */ jsxs17("div", { className: "flex items-center justify-between gap-1 border-b border-border px-2 py-1", children: [
|
|
1740
|
+
filename && /* @__PURE__ */ jsx27("span", { className: "truncate text-xs text-text-secondary", children: filename }),
|
|
1741
|
+
/* @__PURE__ */ jsxs17("div", { className: "ml-auto flex items-center gap-0.5", children: [
|
|
1742
|
+
/* @__PURE__ */ jsx27(
|
|
1651
1743
|
ToolbarButton,
|
|
1652
1744
|
{
|
|
1653
1745
|
onClick: () => setShowLineNumbers((v) => !v),
|
|
@@ -1656,7 +1748,7 @@ function CodeEditor({
|
|
|
1656
1748
|
active: showLineNumbers
|
|
1657
1749
|
}
|
|
1658
1750
|
),
|
|
1659
|
-
/* @__PURE__ */
|
|
1751
|
+
/* @__PURE__ */ jsx27(
|
|
1660
1752
|
ToolbarButton,
|
|
1661
1753
|
{
|
|
1662
1754
|
onClick: handleCopy,
|
|
@@ -1664,8 +1756,8 @@ function CodeEditor({
|
|
|
1664
1756
|
icon: copied ? "check" : "copy"
|
|
1665
1757
|
}
|
|
1666
1758
|
),
|
|
1667
|
-
/* @__PURE__ */
|
|
1668
|
-
/* @__PURE__ */
|
|
1759
|
+
/* @__PURE__ */ jsx27(ToolbarButton, { onClick: handleDownload, tooltip: "Download", icon: "download" }),
|
|
1760
|
+
/* @__PURE__ */ jsx27(
|
|
1669
1761
|
ToolbarButton,
|
|
1670
1762
|
{
|
|
1671
1763
|
onClick: () => setExpanded((v) => !v),
|
|
@@ -1675,7 +1767,7 @@ function CodeEditor({
|
|
|
1675
1767
|
)
|
|
1676
1768
|
] })
|
|
1677
1769
|
] }),
|
|
1678
|
-
/* @__PURE__ */
|
|
1770
|
+
/* @__PURE__ */ jsx27("div", { className: "flex-1 overflow-hidden", style: expanded ? void 0 : { height: editorHeight }, children: /* @__PURE__ */ jsx27(
|
|
1679
1771
|
MonacoEditorCore2,
|
|
1680
1772
|
{
|
|
1681
1773
|
value,
|
|
@@ -1694,10 +1786,10 @@ function CodeEditor({
|
|
|
1694
1786
|
}
|
|
1695
1787
|
|
|
1696
1788
|
// src/atoms/ComposerSections.tsx
|
|
1697
|
-
import { jsx as
|
|
1789
|
+
import { jsx as jsx28, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1698
1790
|
function ComposerLeftSection({ onAttach }) {
|
|
1699
1791
|
if (!onAttach) return null;
|
|
1700
|
-
return /* @__PURE__ */
|
|
1792
|
+
return /* @__PURE__ */ jsx28(
|
|
1701
1793
|
"button",
|
|
1702
1794
|
{
|
|
1703
1795
|
type: "button",
|
|
@@ -1705,7 +1797,7 @@ function ComposerLeftSection({ onAttach }) {
|
|
|
1705
1797
|
title: "Attach",
|
|
1706
1798
|
className: auiButtonClass({ variant: "ghost", size: "icon" }),
|
|
1707
1799
|
onClick: onAttach,
|
|
1708
|
-
children: /* @__PURE__ */
|
|
1800
|
+
children: /* @__PURE__ */ jsx28(Icon, { name: "paperclip" })
|
|
1709
1801
|
}
|
|
1710
1802
|
);
|
|
1711
1803
|
}
|
|
@@ -1714,7 +1806,7 @@ function ComposerRightSection(_) {
|
|
|
1714
1806
|
}
|
|
1715
1807
|
function ComposerSendButton({ canSubmit, isRunning, onSubmit, onCancel }) {
|
|
1716
1808
|
if (isRunning) {
|
|
1717
|
-
return /* @__PURE__ */
|
|
1809
|
+
return /* @__PURE__ */ jsxs18(
|
|
1718
1810
|
"button",
|
|
1719
1811
|
{
|
|
1720
1812
|
type: "button",
|
|
@@ -1723,13 +1815,13 @@ function ComposerSendButton({ canSubmit, isRunning, onSubmit, onCancel }) {
|
|
|
1723
1815
|
onClick: onCancel,
|
|
1724
1816
|
"aria-label": "Cancel",
|
|
1725
1817
|
children: [
|
|
1726
|
-
/* @__PURE__ */
|
|
1818
|
+
/* @__PURE__ */ jsx28(Spinner, { size: 14 }),
|
|
1727
1819
|
"Cancel"
|
|
1728
1820
|
]
|
|
1729
1821
|
}
|
|
1730
1822
|
);
|
|
1731
1823
|
}
|
|
1732
|
-
return /* @__PURE__ */
|
|
1824
|
+
return /* @__PURE__ */ jsx28(
|
|
1733
1825
|
"button",
|
|
1734
1826
|
{
|
|
1735
1827
|
type: "button",
|
|
@@ -1738,14 +1830,14 @@ function ComposerSendButton({ canSubmit, isRunning, onSubmit, onCancel }) {
|
|
|
1738
1830
|
onClick: onSubmit,
|
|
1739
1831
|
title: "Send message",
|
|
1740
1832
|
"aria-label": "Send message",
|
|
1741
|
-
children: /* @__PURE__ */
|
|
1833
|
+
children: /* @__PURE__ */ jsx28(Icon, { name: "arrow-up" })
|
|
1742
1834
|
}
|
|
1743
1835
|
);
|
|
1744
1836
|
}
|
|
1745
1837
|
|
|
1746
1838
|
// src/atoms/ComposerShell.tsx
|
|
1747
1839
|
import "react";
|
|
1748
|
-
import { jsx as
|
|
1840
|
+
import { jsx as jsx29, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1749
1841
|
function ComposerShell({
|
|
1750
1842
|
input,
|
|
1751
1843
|
disabled,
|
|
@@ -1763,7 +1855,7 @@ function ComposerShell({
|
|
|
1763
1855
|
const ComposerLeftSection2 = useSlot("ComposerLeftSection");
|
|
1764
1856
|
const ComposerRightSection2 = useSlot("ComposerRightSection");
|
|
1765
1857
|
const ComposerSendButton2 = useSlot("ComposerSendButton");
|
|
1766
|
-
return /* @__PURE__ */
|
|
1858
|
+
return /* @__PURE__ */ jsxs19(
|
|
1767
1859
|
"div",
|
|
1768
1860
|
{
|
|
1769
1861
|
"data-slot": "aui_composer-shell",
|
|
@@ -1774,18 +1866,18 @@ function ComposerShell({
|
|
|
1774
1866
|
children: [
|
|
1775
1867
|
attachments,
|
|
1776
1868
|
input,
|
|
1777
|
-
/* @__PURE__ */
|
|
1778
|
-
/* @__PURE__ */
|
|
1779
|
-
/* @__PURE__ */
|
|
1780
|
-
connectorStatusLabel && /* @__PURE__ */
|
|
1869
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex min-w-0 flex-wrap items-center justify-between gap-2 px-1", children: [
|
|
1870
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex min-w-0 max-w-full flex-wrap items-center gap-2", children: [
|
|
1871
|
+
/* @__PURE__ */ jsx29(ComposerLeftSection2, { disabled, isRunning, onAttach }),
|
|
1872
|
+
connectorStatusLabel && /* @__PURE__ */ jsx29("span", { className: "text-text-secondary max-w-[12rem] truncate text-xs", children: connectorStatusLabel })
|
|
1781
1873
|
] }),
|
|
1782
|
-
/* @__PURE__ */
|
|
1783
|
-
modelLabel && /* @__PURE__ */
|
|
1874
|
+
/* @__PURE__ */ jsxs19("div", { className: "ml-auto flex min-w-0 shrink-0 flex-wrap items-center justify-end gap-2", children: [
|
|
1875
|
+
modelLabel && /* @__PURE__ */ jsxs19("span", { className: "bg-secondary-bg text-text-secondary flex max-w-[10rem] items-center gap-1 truncate rounded-full px-2 py-0.5 text-xs", children: [
|
|
1784
1876
|
modelIcon,
|
|
1785
|
-
/* @__PURE__ */
|
|
1877
|
+
/* @__PURE__ */ jsx29("span", { className: "truncate", children: modelLabel })
|
|
1786
1878
|
] }),
|
|
1787
|
-
/* @__PURE__ */
|
|
1788
|
-
/* @__PURE__ */
|
|
1879
|
+
/* @__PURE__ */ jsx29(ComposerRightSection2, { disabled, isRunning }),
|
|
1880
|
+
/* @__PURE__ */ jsx29(
|
|
1789
1881
|
ComposerSendButton2,
|
|
1790
1882
|
{
|
|
1791
1883
|
disabled,
|
|
@@ -1804,7 +1896,7 @@ function ComposerShell({
|
|
|
1804
1896
|
|
|
1805
1897
|
// src/atoms/draft/DraftReasoningEffortSelector.tsx
|
|
1806
1898
|
import { useTrueFoundryAgentSpec as useTrueFoundryAgentSpec2, useTrueFoundryUpdateAgentSpec } from "@truefoundry/assistant-ui-runtime";
|
|
1807
|
-
import { useEffect as useEffect7, useId as useId3, useRef as
|
|
1899
|
+
import { useEffect as useEffect7, useId as useId3, useRef as useRef5, useState as useState12 } from "react";
|
|
1808
1900
|
|
|
1809
1901
|
// src/atoms/lib/useIsMobile.ts
|
|
1810
1902
|
import { useSyncExternalStore } from "react";
|
|
@@ -1823,8 +1915,8 @@ function useIsMobile() {
|
|
|
1823
1915
|
}
|
|
1824
1916
|
|
|
1825
1917
|
// src/atoms/primitives/BottomSheet.tsx
|
|
1826
|
-
import { useEffect as useEffect6, useRef as
|
|
1827
|
-
import { jsx as
|
|
1918
|
+
import { useEffect as useEffect6, useRef as useRef4 } from "react";
|
|
1919
|
+
import { jsx as jsx30, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1828
1920
|
function BottomSheet({
|
|
1829
1921
|
open,
|
|
1830
1922
|
onOpenChange,
|
|
@@ -1833,7 +1925,7 @@ function BottomSheet({
|
|
|
1833
1925
|
id,
|
|
1834
1926
|
"aria-label": ariaLabel
|
|
1835
1927
|
}) {
|
|
1836
|
-
const ref =
|
|
1928
|
+
const ref = useRef4(null);
|
|
1837
1929
|
const compact = useCompactLayout();
|
|
1838
1930
|
const compactStyle = useCompactOverlayStyle(ref, compact);
|
|
1839
1931
|
useEffect6(() => {
|
|
@@ -1852,7 +1944,7 @@ function BottomSheet({
|
|
|
1852
1944
|
const handleBackdropClick = (event) => {
|
|
1853
1945
|
if (event.target === ref.current) onOpenChange(false);
|
|
1854
1946
|
};
|
|
1855
|
-
return /* @__PURE__ */
|
|
1947
|
+
return /* @__PURE__ */ jsxs20(
|
|
1856
1948
|
"dialog",
|
|
1857
1949
|
{
|
|
1858
1950
|
ref,
|
|
@@ -1872,7 +1964,7 @@ function BottomSheet({
|
|
|
1872
1964
|
className
|
|
1873
1965
|
),
|
|
1874
1966
|
children: [
|
|
1875
|
-
/* @__PURE__ */
|
|
1967
|
+
/* @__PURE__ */ jsx30("div", { className: "flex h-5 shrink-0 items-center justify-center", "aria-hidden": true, children: /* @__PURE__ */ jsx30("span", { className: "h-1 w-10 rounded-full bg-text-secondary/30" }) }),
|
|
1876
1968
|
children
|
|
1877
1969
|
]
|
|
1878
1970
|
}
|
|
@@ -1902,14 +1994,14 @@ function modelPatchWithReasoningEffort(name, existingParams, efforts) {
|
|
|
1902
1994
|
}
|
|
1903
1995
|
|
|
1904
1996
|
// src/atoms/draft/DraftReasoningEffortSelector.tsx
|
|
1905
|
-
import { Fragment as Fragment5, jsx as
|
|
1997
|
+
import { Fragment as Fragment5, jsx as jsx31, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1906
1998
|
function DraftReasoningEffortSelector({ disabled, isRunning }) {
|
|
1907
1999
|
const { models, ensureLoaded } = useDraftCatalog();
|
|
1908
2000
|
const { agentSpec } = useTrueFoundryAgentSpec2();
|
|
1909
2001
|
const updateAgentSpec = useTrueFoundryUpdateAgentSpec();
|
|
1910
|
-
const [open, setOpen] =
|
|
1911
|
-
const containerRef =
|
|
1912
|
-
const clearedStickyEffortForModelRef =
|
|
2002
|
+
const [open, setOpen] = useState12(false);
|
|
2003
|
+
const containerRef = useRef5(null);
|
|
2004
|
+
const clearedStickyEffortForModelRef = useRef5(null);
|
|
1913
2005
|
const menuId = useId3();
|
|
1914
2006
|
const isMobile = useIsMobile();
|
|
1915
2007
|
const compactLayout = useCompactLayout();
|
|
@@ -1945,9 +2037,9 @@ function DraftReasoningEffortSelector({ disabled, isRunning }) {
|
|
|
1945
2037
|
});
|
|
1946
2038
|
}, [updateAgentSpec, selected, efforts, currentEffort, agentSpec?.model?.params]);
|
|
1947
2039
|
if (!hasReasoningEfforts(efforts) || !resolved) return null;
|
|
1948
|
-
const content = /* @__PURE__ */
|
|
1949
|
-
/* @__PURE__ */
|
|
1950
|
-
/* @__PURE__ */
|
|
2040
|
+
const content = /* @__PURE__ */ jsxs21(Fragment5, { children: [
|
|
2041
|
+
/* @__PURE__ */ jsx31("div", { className: "border-b border-border px-3 py-2", children: /* @__PURE__ */ jsx31("p", { className: "text-text-primary text-sm font-semibold", children: "Reasoning effort" }) }),
|
|
2042
|
+
/* @__PURE__ */ jsx31(
|
|
1951
2043
|
"div",
|
|
1952
2044
|
{
|
|
1953
2045
|
id: menuId,
|
|
@@ -1956,7 +2048,7 @@ function DraftReasoningEffortSelector({ disabled, isRunning }) {
|
|
|
1956
2048
|
className: "flex min-h-0 flex-1 flex-col overflow-y-auto p-1",
|
|
1957
2049
|
children: efforts.map((effort) => {
|
|
1958
2050
|
const active = effort === resolved;
|
|
1959
|
-
return /* @__PURE__ */
|
|
2051
|
+
return /* @__PURE__ */ jsx31(
|
|
1960
2052
|
"button",
|
|
1961
2053
|
{
|
|
1962
2054
|
type: "button",
|
|
@@ -1977,7 +2069,7 @@ function DraftReasoningEffortSelector({ disabled, isRunning }) {
|
|
|
1977
2069
|
});
|
|
1978
2070
|
setOpen(false);
|
|
1979
2071
|
},
|
|
1980
|
-
children: /* @__PURE__ */
|
|
2072
|
+
children: /* @__PURE__ */ jsx31("span", { className: "truncate font-medium", children: effort })
|
|
1981
2073
|
},
|
|
1982
2074
|
effort
|
|
1983
2075
|
);
|
|
@@ -1985,8 +2077,8 @@ function DraftReasoningEffortSelector({ disabled, isRunning }) {
|
|
|
1985
2077
|
}
|
|
1986
2078
|
)
|
|
1987
2079
|
] });
|
|
1988
|
-
return /* @__PURE__ */
|
|
1989
|
-
/* @__PURE__ */
|
|
2080
|
+
return /* @__PURE__ */ jsxs21("div", { ref: containerRef, className: "relative", children: [
|
|
2081
|
+
/* @__PURE__ */ jsxs21(
|
|
1990
2082
|
"button",
|
|
1991
2083
|
{
|
|
1992
2084
|
type: "button",
|
|
@@ -2005,26 +2097,26 @@ function DraftReasoningEffortSelector({ disabled, isRunning }) {
|
|
|
2005
2097
|
}),
|
|
2006
2098
|
onClick: () => setOpen((v) => !v),
|
|
2007
2099
|
children: [
|
|
2008
|
-
/* @__PURE__ */
|
|
2009
|
-
/* @__PURE__ */
|
|
2100
|
+
/* @__PURE__ */ jsx31("span", { className: "truncate", children: resolved }),
|
|
2101
|
+
/* @__PURE__ */ jsx31(Icon, { name: "chevron-down", className: "size-3.5 shrink-0 opacity-60" })
|
|
2010
2102
|
]
|
|
2011
2103
|
}
|
|
2012
2104
|
),
|
|
2013
|
-
open ? isMobile || compactLayout ? /* @__PURE__ */
|
|
2105
|
+
open ? isMobile || compactLayout ? /* @__PURE__ */ jsx31(BottomSheet, { open: true, onOpenChange: setOpen, "aria-label": "Select reasoning effort", children: content }) : /* @__PURE__ */ jsx31("div", { className: "bg-card-bg text-text-primary absolute right-0 bottom-full z-50 mb-2 flex max-h-[22rem] w-[12rem] flex-col overflow-hidden rounded-lg border border-border shadow-lg", children: content }) : null
|
|
2014
2106
|
] });
|
|
2015
2107
|
}
|
|
2016
2108
|
|
|
2017
2109
|
// src/atoms/draft/DraftComposerSections.tsx
|
|
2018
|
-
import { jsx as
|
|
2110
|
+
import { jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2019
2111
|
function DraftComposerLeftSection({ disabled, isRunning, onAttach }) {
|
|
2020
2112
|
const DraftCompositeSelector2 = useSlot("DraftCompositeSelector");
|
|
2021
|
-
return /* @__PURE__ */
|
|
2113
|
+
return /* @__PURE__ */ jsx32("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: /* @__PURE__ */ jsx32(DraftCompositeSelector2, { disabled, isRunning, onAttach }) });
|
|
2022
2114
|
}
|
|
2023
2115
|
function DraftComposerRightSection({ disabled, isRunning }) {
|
|
2024
2116
|
const DraftModelSelector2 = useSlot("DraftModelSelector");
|
|
2025
|
-
return /* @__PURE__ */
|
|
2026
|
-
/* @__PURE__ */
|
|
2027
|
-
/* @__PURE__ */
|
|
2117
|
+
return /* @__PURE__ */ jsxs22("div", { className: "flex min-w-0 items-center gap-1", children: [
|
|
2118
|
+
/* @__PURE__ */ jsx32(DraftModelSelector2, { disabled, isRunning }),
|
|
2119
|
+
/* @__PURE__ */ jsx32(DraftReasoningEffortSelector, { disabled, isRunning })
|
|
2028
2120
|
] });
|
|
2029
2121
|
}
|
|
2030
2122
|
|
|
@@ -2033,11 +2125,11 @@ import { useTrueFoundryAgentSpec as useTrueFoundryAgentSpec3, useTrueFoundryUpda
|
|
|
2033
2125
|
import { useCallback as useCallback5, useEffect as useEffect9, useId as useId4, useMemo as useMemo3, useRef as useRef7, useState as useState15 } from "react";
|
|
2034
2126
|
|
|
2035
2127
|
// src/hooks/useMcpAuth.ts
|
|
2036
|
-
import { useCallback as useCallback4, useEffect as useEffect8, useMemo as useMemo2, useRef as
|
|
2128
|
+
import { useCallback as useCallback4, useEffect as useEffect8, useMemo as useMemo2, useRef as useRef6, useState as useState14 } from "react";
|
|
2037
2129
|
|
|
2038
2130
|
// src/containers/ToasterContainer.tsx
|
|
2039
|
-
import { createContext as createContext2, useCallback as useCallback3, useContext as useContext3, useMemo, useState as
|
|
2040
|
-
import { jsx as
|
|
2131
|
+
import { createContext as createContext2, useCallback as useCallback3, useContext as useContext3, useMemo, useState as useState13 } from "react";
|
|
2132
|
+
import { jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2041
2133
|
var MAX_TOAST_DESCRIPTION_CHARS = 480;
|
|
2042
2134
|
var MAX_VISIBLE_TOASTS = 5;
|
|
2043
2135
|
var SUCCESS_TOAST_TTL_MS = 3e3;
|
|
@@ -2071,7 +2163,7 @@ function normalizeError(error) {
|
|
|
2071
2163
|
function ToasterProvider({ children }) {
|
|
2072
2164
|
const Toast2 = useSlot("Toast");
|
|
2073
2165
|
const ToastStack2 = useSlot("ToastStack");
|
|
2074
|
-
const [toasts, setToasts] =
|
|
2166
|
+
const [toasts, setToasts] = useState13([]);
|
|
2075
2167
|
const dismiss = useCallback3((id) => {
|
|
2076
2168
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
2077
2169
|
}, []);
|
|
@@ -2092,9 +2184,9 @@ function ToasterProvider({ children }) {
|
|
|
2092
2184
|
[dismiss]
|
|
2093
2185
|
);
|
|
2094
2186
|
const value = useMemo(() => ({ showError, showSuccess }), [showError, showSuccess]);
|
|
2095
|
-
return /* @__PURE__ */
|
|
2187
|
+
return /* @__PURE__ */ jsxs23(ToasterContext.Provider, { value, children: [
|
|
2096
2188
|
children,
|
|
2097
|
-
/* @__PURE__ */
|
|
2189
|
+
/* @__PURE__ */ jsx33(ToastStack2, { children: toasts.map((toast) => /* @__PURE__ */ jsx33(
|
|
2098
2190
|
Toast2,
|
|
2099
2191
|
{
|
|
2100
2192
|
title: toast.title,
|
|
@@ -2131,9 +2223,9 @@ var isPopupMessage = (value) => {
|
|
|
2131
2223
|
var useMCPAuth = ({ callbackPath } = {}) => {
|
|
2132
2224
|
const { connectorCatalog } = useCatalogServer();
|
|
2133
2225
|
const toaster = useToasterOptional();
|
|
2134
|
-
const [isOAuthLoading, setIsOAuthLoading] =
|
|
2226
|
+
const [isOAuthLoading, setIsOAuthLoading] = useState14(false);
|
|
2135
2227
|
const popupUid = useMemo2(() => generatePopupUid(), []);
|
|
2136
|
-
const listenerCleanupRef =
|
|
2228
|
+
const listenerCleanupRef = useRef6(null);
|
|
2137
2229
|
const clearPopupListener = useCallback4(() => {
|
|
2138
2230
|
listenerCleanupRef.current?.();
|
|
2139
2231
|
listenerCleanupRef.current = null;
|
|
@@ -2209,94 +2301,6 @@ function auiInputClass(className) {
|
|
|
2209
2301
|
return cn(baseClasses, className);
|
|
2210
2302
|
}
|
|
2211
2303
|
|
|
2212
|
-
// src/atoms/primitives/Tooltip.tsx
|
|
2213
|
-
import { cloneElement, isValidElement, useLayoutEffect as useLayoutEffect2, useRef as useRef6, useState as useState14 } from "react";
|
|
2214
|
-
import { createPortal } from "react-dom";
|
|
2215
|
-
import { jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2216
|
-
function themePortalRoot(from) {
|
|
2217
|
-
const dialog = from?.closest("dialog");
|
|
2218
|
-
if (dialog instanceof HTMLElement) return dialog;
|
|
2219
|
-
return from?.closest(".aui-theme-root") ?? document.body;
|
|
2220
|
-
}
|
|
2221
|
-
function Tooltip({ content, children, className, side = "top" }) {
|
|
2222
|
-
const [visible, setVisible] = useState14(false);
|
|
2223
|
-
const [pos, setPos] = useState14(null);
|
|
2224
|
-
const triggerWrapRef = useRef6(null);
|
|
2225
|
-
useLayoutEffect2(() => {
|
|
2226
|
-
if (!visible) {
|
|
2227
|
-
setPos(null);
|
|
2228
|
-
return;
|
|
2229
|
-
}
|
|
2230
|
-
const update = () => {
|
|
2231
|
-
const el = triggerWrapRef.current;
|
|
2232
|
-
if (!el) return;
|
|
2233
|
-
const rect = el.getBoundingClientRect();
|
|
2234
|
-
setPos({
|
|
2235
|
-
top: side === "bottom" ? rect.bottom + 6 : rect.top - 6,
|
|
2236
|
-
left: rect.left + rect.width / 2
|
|
2237
|
-
});
|
|
2238
|
-
};
|
|
2239
|
-
update();
|
|
2240
|
-
window.addEventListener("scroll", update, true);
|
|
2241
|
-
window.addEventListener("resize", update);
|
|
2242
|
-
return () => {
|
|
2243
|
-
window.removeEventListener("scroll", update, true);
|
|
2244
|
-
window.removeEventListener("resize", update);
|
|
2245
|
-
};
|
|
2246
|
-
}, [visible, side]);
|
|
2247
|
-
if (!isValidElement(children)) return children;
|
|
2248
|
-
const p = children.props;
|
|
2249
|
-
const child = cloneElement(children, {
|
|
2250
|
-
onMouseEnter(e) {
|
|
2251
|
-
setVisible(true);
|
|
2252
|
-
p.onMouseEnter?.(e);
|
|
2253
|
-
},
|
|
2254
|
-
onMouseLeave(e) {
|
|
2255
|
-
setVisible(false);
|
|
2256
|
-
p.onMouseLeave?.(e);
|
|
2257
|
-
},
|
|
2258
|
-
onFocus(e) {
|
|
2259
|
-
setVisible(true);
|
|
2260
|
-
p.onFocus?.(e);
|
|
2261
|
-
},
|
|
2262
|
-
onBlur(e) {
|
|
2263
|
-
setVisible(false);
|
|
2264
|
-
p.onBlur?.(e);
|
|
2265
|
-
},
|
|
2266
|
-
onClick(e) {
|
|
2267
|
-
setVisible(false);
|
|
2268
|
-
p.onClick?.(e);
|
|
2269
|
-
}
|
|
2270
|
-
});
|
|
2271
|
-
const tooltip = visible && content != null && pos != null ? createPortal(
|
|
2272
|
-
/* @__PURE__ */ jsx33(
|
|
2273
|
-
"span",
|
|
2274
|
-
{
|
|
2275
|
-
role: "tooltip",
|
|
2276
|
-
style: {
|
|
2277
|
-
top: pos.top,
|
|
2278
|
-
left: pos.left,
|
|
2279
|
-
transform: side === "bottom" ? "translate(-50%, 0)" : "translate(-50%, -100%)"
|
|
2280
|
-
},
|
|
2281
|
-
className: cn(
|
|
2282
|
-
"pointer-events-none fixed z-[200]",
|
|
2283
|
-
"whitespace-nowrap rounded bg-card-bg px-2 py-1 text-xs text-text-primary shadow-md",
|
|
2284
|
-
className
|
|
2285
|
-
),
|
|
2286
|
-
children: content
|
|
2287
|
-
}
|
|
2288
|
-
),
|
|
2289
|
-
themePortalRoot(triggerWrapRef.current)
|
|
2290
|
-
) : null;
|
|
2291
|
-
return /* @__PURE__ */ jsxs23("span", { ref: triggerWrapRef, className: "relative inline-flex", children: [
|
|
2292
|
-
child,
|
|
2293
|
-
tooltip
|
|
2294
|
-
] });
|
|
2295
|
-
}
|
|
2296
|
-
function LightTooltip({ title, children, className, size: _size, side }) {
|
|
2297
|
-
return /* @__PURE__ */ jsx33(Tooltip, { content: title, className, side, children });
|
|
2298
|
-
}
|
|
2299
|
-
|
|
2300
2304
|
// src/atoms/draft/agentCapabilities.ts
|
|
2301
2305
|
var DEFAULT_AGENT_CAPABILITIES = {
|
|
2302
2306
|
generativeUi: true,
|
|
@@ -6741,6 +6745,7 @@ export {
|
|
|
6741
6745
|
useSearchAgentsList,
|
|
6742
6746
|
CenteredModal,
|
|
6743
6747
|
SearchInput_default,
|
|
6748
|
+
Tooltip,
|
|
6744
6749
|
AgentsLibrary,
|
|
6745
6750
|
AgentsLibraryButton,
|
|
6746
6751
|
AssistantMessageBubble,
|
|
@@ -6771,7 +6776,6 @@ export {
|
|
|
6771
6776
|
MCP_AUTH_POPUP_CHANNEL,
|
|
6772
6777
|
useMCPAuth,
|
|
6773
6778
|
auiInputClass,
|
|
6774
|
-
Tooltip,
|
|
6775
6779
|
Switch,
|
|
6776
6780
|
DraftCompositeSelector,
|
|
6777
6781
|
CatalogLogo,
|
|
@@ -6818,4 +6822,4 @@ export {
|
|
|
6818
6822
|
WelcomeScreen,
|
|
6819
6823
|
defaultSlots
|
|
6820
6824
|
};
|
|
6821
|
-
//# sourceMappingURL=chunk-
|
|
6825
|
+
//# sourceMappingURL=chunk-XRTTKGKN.js.map
|