@dataverse-kit/agent-kit 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -2
- package/dist/index.cjs +776 -370
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +153 -1
- package/dist/index.d.ts +153 -1
- package/dist/index.mjs +772 -361
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -36,12 +36,14 @@ __export(src_exports, {
|
|
|
36
36
|
AgentAppShell: () => AgentAppShell,
|
|
37
37
|
AgentAvatar: () => AgentAvatar,
|
|
38
38
|
AgentKitHostProvider: () => AgentKitHostProvider,
|
|
39
|
+
AgentLauncher: () => AgentLauncher,
|
|
39
40
|
AgentOpsPanel: () => AgentOpsPanel,
|
|
40
41
|
AgentPicker: () => AgentPicker,
|
|
41
42
|
AgentStatusBadge: () => AgentStatusBadge,
|
|
42
43
|
AnswerWithCitations: () => AnswerWithCitations,
|
|
43
44
|
AppRail: () => AppRail,
|
|
44
45
|
ApprovalCard: () => ApprovalCard,
|
|
46
|
+
AssistantPanel: () => AssistantPanel,
|
|
45
47
|
AvailabilityBanner: () => AvailabilityBanner,
|
|
46
48
|
CitationChip: () => CitationChip,
|
|
47
49
|
CitationList: () => CitationList,
|
|
@@ -53,6 +55,7 @@ __export(src_exports, {
|
|
|
53
55
|
DEFAULT_GROUP_WINDOW_MS: () => DEFAULT_GROUP_WINDOW_MS,
|
|
54
56
|
DayDivider: () => DayDivider,
|
|
55
57
|
EmptyConversation: () => EmptyConversation,
|
|
58
|
+
FeedbackPanel: () => FeedbackPanel,
|
|
56
59
|
GlobalSearchBar: () => GlobalSearchBar,
|
|
57
60
|
GroundingPanel: () => GroundingPanel,
|
|
58
61
|
LiveAnnouncer: () => LiveAnnouncer,
|
|
@@ -114,6 +117,7 @@ __export(src_exports, {
|
|
|
114
117
|
splitTextByCitations: () => splitTextByCitations,
|
|
115
118
|
useConversation: () => useConversation,
|
|
116
119
|
useFocusRestore: () => useFocusRestore,
|
|
120
|
+
useReturnFocus: () => useReturnFocus,
|
|
117
121
|
useRovingTabindex: () => useRovingTabindex,
|
|
118
122
|
useStickyScroll: () => useStickyScroll,
|
|
119
123
|
useVisuallyHiddenStyles: () => useVisuallyHiddenStyles
|
|
@@ -121,7 +125,7 @@ __export(src_exports, {
|
|
|
121
125
|
module.exports = __toCommonJS(src_exports);
|
|
122
126
|
|
|
123
127
|
// src/conversation/MessageList.tsx
|
|
124
|
-
var
|
|
128
|
+
var React11 = __toESM(require("react"), 1);
|
|
125
129
|
var import_react_components10 = require("@fluentui/react-components");
|
|
126
130
|
var import_react_icons3 = require("@fluentui/react-icons");
|
|
127
131
|
|
|
@@ -707,12 +711,40 @@ function useRovingTabindex(options) {
|
|
|
707
711
|
return { activeIndex, setActiveIndex, getItemProps };
|
|
708
712
|
}
|
|
709
713
|
|
|
710
|
-
// src/
|
|
714
|
+
// src/a11y/useReturnFocus.ts
|
|
711
715
|
var React4 = __toESM(require("react"), 1);
|
|
716
|
+
function useReturnFocus({ open, containerRef, manageInitialFocus = true }) {
|
|
717
|
+
const openerRef = React4.useRef(null);
|
|
718
|
+
const wasOpen = React4.useRef(open);
|
|
719
|
+
React4.useEffect(() => {
|
|
720
|
+
const container = containerRef.current;
|
|
721
|
+
const doc = container?.ownerDocument ?? (typeof document !== "undefined" ? document : void 0);
|
|
722
|
+
if (!doc) return;
|
|
723
|
+
if (open && !wasOpen.current) {
|
|
724
|
+
const active = doc.activeElement;
|
|
725
|
+
openerRef.current = active instanceof HTMLElement && active !== doc.body ? active : null;
|
|
726
|
+
if (manageInitialFocus && container) {
|
|
727
|
+
const first = container.querySelector(
|
|
728
|
+
'a[href],button:not([disabled]),input:not([disabled]),textarea:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])'
|
|
729
|
+
);
|
|
730
|
+
(first ?? container).focus();
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
if (!open && wasOpen.current) {
|
|
734
|
+
const opener = openerRef.current;
|
|
735
|
+
if (opener && opener.isConnected) opener.focus();
|
|
736
|
+
openerRef.current = null;
|
|
737
|
+
}
|
|
738
|
+
wasOpen.current = open;
|
|
739
|
+
}, [open, containerRef, manageInitialFocus]);
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
// src/hooks/useStickyScroll.ts
|
|
743
|
+
var React5 = __toESM(require("react"), 1);
|
|
712
744
|
function useStickyScroll(ref, messageCount) {
|
|
713
|
-
const wasPinnedRef =
|
|
714
|
-
const [isPinned, setIsPinned] =
|
|
715
|
-
const onScroll =
|
|
745
|
+
const wasPinnedRef = React5.useRef(true);
|
|
746
|
+
const [isPinned, setIsPinned] = React5.useState(true);
|
|
747
|
+
const onScroll = React5.useCallback(() => {
|
|
716
748
|
const el = ref.current;
|
|
717
749
|
if (!el) return;
|
|
718
750
|
const pinned = shouldStickToBottom({
|
|
@@ -723,14 +755,14 @@ function useStickyScroll(ref, messageCount) {
|
|
|
723
755
|
wasPinnedRef.current = pinned;
|
|
724
756
|
setIsPinned(pinned);
|
|
725
757
|
}, [ref]);
|
|
726
|
-
const scrollToBottom =
|
|
758
|
+
const scrollToBottom = React5.useCallback(() => {
|
|
727
759
|
const el = ref.current;
|
|
728
760
|
if (!el) return;
|
|
729
761
|
el.scrollTo({ top: el.scrollHeight, behavior: "auto" });
|
|
730
762
|
wasPinnedRef.current = true;
|
|
731
763
|
setIsPinned(true);
|
|
732
764
|
}, [ref]);
|
|
733
|
-
|
|
765
|
+
React5.useEffect(() => {
|
|
734
766
|
if (!wasPinnedRef.current) return;
|
|
735
767
|
const el = ref.current;
|
|
736
768
|
if (!el) return;
|
|
@@ -740,30 +772,30 @@ function useStickyScroll(ref, messageCount) {
|
|
|
740
772
|
}
|
|
741
773
|
|
|
742
774
|
// src/hooks/useConversation.ts
|
|
743
|
-
var
|
|
775
|
+
var React6 = __toESM(require("react"), 1);
|
|
744
776
|
var fallbackId = 0;
|
|
745
777
|
function useConversation(options) {
|
|
746
778
|
const { service, seed, grounding, conversationId, createId } = options;
|
|
747
|
-
const [state, setState] =
|
|
748
|
-
const [announcement, setAnnouncement] =
|
|
749
|
-
const abortRef =
|
|
750
|
-
const stateRef =
|
|
779
|
+
const [state, setState] = React6.useState(() => initialConversation(seed));
|
|
780
|
+
const [announcement, setAnnouncement] = React6.useState(NO_ANNOUNCEMENT);
|
|
781
|
+
const abortRef = React6.useRef(null);
|
|
782
|
+
const stateRef = React6.useRef(state);
|
|
751
783
|
stateRef.current = state;
|
|
752
|
-
const nextId =
|
|
784
|
+
const nextId = React6.useCallback(
|
|
753
785
|
() => createId?.() ?? `m${++fallbackId}-${Date.now().toString(36)}`,
|
|
754
786
|
[createId]
|
|
755
787
|
);
|
|
756
|
-
const commit =
|
|
788
|
+
const commit = React6.useCallback((next) => {
|
|
757
789
|
const previous = stateRef.current;
|
|
758
790
|
stateRef.current = next;
|
|
759
791
|
setState(next);
|
|
760
792
|
const derived = deriveAnnouncement(next, previous);
|
|
761
793
|
if (derived.polite || derived.assertive) setAnnouncement(derived);
|
|
762
794
|
}, []);
|
|
763
|
-
const cancel =
|
|
795
|
+
const cancel = React6.useCallback(() => {
|
|
764
796
|
abortRef.current?.abort();
|
|
765
797
|
}, []);
|
|
766
|
-
const send =
|
|
798
|
+
const send = React6.useCallback(
|
|
767
799
|
async (text, attachments) => {
|
|
768
800
|
if (!text.trim()) return;
|
|
769
801
|
abortRef.current?.abort();
|
|
@@ -800,13 +832,13 @@ function useConversation(options) {
|
|
|
800
832
|
},
|
|
801
833
|
[service, grounding, conversationId, nextId, commit]
|
|
802
834
|
);
|
|
803
|
-
|
|
835
|
+
React6.useEffect(() => () => abortRef.current?.abort(), []);
|
|
804
836
|
const busy = state.status === "connecting" || state.status === "streaming";
|
|
805
837
|
return { state, announcement, busy, send, cancel };
|
|
806
838
|
}
|
|
807
839
|
|
|
808
840
|
// src/conversation/MessageBubble.tsx
|
|
809
|
-
var
|
|
841
|
+
var React10 = __toESM(require("react"), 1);
|
|
810
842
|
var import_react_components7 = require("@fluentui/react-components");
|
|
811
843
|
|
|
812
844
|
// src/conversation/StreamingText.tsx
|
|
@@ -883,7 +915,7 @@ function ActionToolbar({ actions, label, className }) {
|
|
|
883
915
|
}
|
|
884
916
|
|
|
885
917
|
// src/internal/CardSurface.tsx
|
|
886
|
-
var
|
|
918
|
+
var React7 = __toESM(require("react"), 1);
|
|
887
919
|
var import_react_components4 = require("@fluentui/react-components");
|
|
888
920
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
889
921
|
var useStyles3 = (0, import_react_components4.makeStyles)({
|
|
@@ -899,7 +931,7 @@ var useStyles3 = (0, import_react_components4.makeStyles)({
|
|
|
899
931
|
},
|
|
900
932
|
attention: { borderLeft: `3px solid ${import_react_components4.tokens.colorBrandStroke1}` }
|
|
901
933
|
});
|
|
902
|
-
var CardSurface =
|
|
934
|
+
var CardSurface = React7.forwardRef(
|
|
903
935
|
function CardSurface2({ emphasis = "none", className, children, ...rest }, ref) {
|
|
904
936
|
const styles = useStyles3();
|
|
905
937
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
@@ -915,7 +947,7 @@ var CardSurface = React6.forwardRef(
|
|
|
915
947
|
);
|
|
916
948
|
|
|
917
949
|
// src/internal/ConfirmInline.tsx
|
|
918
|
-
var
|
|
950
|
+
var React8 = __toESM(require("react"), 1);
|
|
919
951
|
var import_react_components5 = require("@fluentui/react-components");
|
|
920
952
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
921
953
|
var useStyles4 = (0, import_react_components5.makeStyles)({
|
|
@@ -926,11 +958,11 @@ var FOCUSABLE = 'a[href],button:not([disabled]),input:not([disabled]),textarea:n
|
|
|
926
958
|
function ConfirmInline(props) {
|
|
927
959
|
const { open, title, body, confirmLabel = "Confirm", cancelLabel = "Cancel", destructive, onConfirm, onCancel } = props;
|
|
928
960
|
const styles = useStyles4();
|
|
929
|
-
const ref =
|
|
930
|
-
const returnTo =
|
|
931
|
-
const titleId =
|
|
932
|
-
const bodyId =
|
|
933
|
-
|
|
961
|
+
const ref = React8.useRef(null);
|
|
962
|
+
const returnTo = React8.useRef(null);
|
|
963
|
+
const titleId = React8.useId();
|
|
964
|
+
const bodyId = React8.useId();
|
|
965
|
+
React8.useEffect(() => {
|
|
934
966
|
if (!open) return;
|
|
935
967
|
returnTo.current = document.activeElement ?? null;
|
|
936
968
|
const first = ref.current?.querySelector(FOCUSABLE);
|
|
@@ -985,7 +1017,7 @@ function ConfirmInline(props) {
|
|
|
985
1017
|
}
|
|
986
1018
|
|
|
987
1019
|
// src/internal/Disclosure.tsx
|
|
988
|
-
var
|
|
1020
|
+
var React9 = __toESM(require("react"), 1);
|
|
989
1021
|
var import_react_components6 = require("@fluentui/react-components");
|
|
990
1022
|
var import_react_icons = require("@fluentui/react-icons");
|
|
991
1023
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
@@ -1013,7 +1045,7 @@ function Disclosure({
|
|
|
1013
1045
|
className
|
|
1014
1046
|
}) {
|
|
1015
1047
|
const styles = useStyles5();
|
|
1016
|
-
const [open, setOpen] =
|
|
1048
|
+
const [open, setOpen] = React9.useState(defaultOpen);
|
|
1017
1049
|
const panelId = `${id}-panel`;
|
|
1018
1050
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className, children: [
|
|
1019
1051
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
@@ -1110,7 +1142,7 @@ function MessageBubble(props) {
|
|
|
1110
1142
|
const { message, author, isRunStart = true, locale, ...actionHandlers } = props;
|
|
1111
1143
|
const styles = useStyles6();
|
|
1112
1144
|
const hidden = useVisuallyHiddenStyles();
|
|
1113
|
-
const [revealed, setRevealed] =
|
|
1145
|
+
const [revealed, setRevealed] = React10.useState(false);
|
|
1114
1146
|
const own = message.role === "user";
|
|
1115
1147
|
const name = author?.displayName ?? (own ? "You" : message.provider ?? "Assistant");
|
|
1116
1148
|
const time = new Intl.DateTimeFormat(locale, { timeStyle: "short" }).format(new Date(message.createdAt));
|
|
@@ -1248,21 +1280,21 @@ function MessageList(props) {
|
|
|
1248
1280
|
...actionHandlers
|
|
1249
1281
|
} = props;
|
|
1250
1282
|
const styles = useStyles9();
|
|
1251
|
-
const scrollerRef =
|
|
1283
|
+
const scrollerRef = React11.useRef(null);
|
|
1252
1284
|
const { onScroll, scrollToBottom, isPinned } = useStickyScroll(scrollerRef, messages.length);
|
|
1253
|
-
const byId =
|
|
1285
|
+
const byId = React11.useMemo(
|
|
1254
1286
|
() => new Map((participants ?? []).map((p) => [p.id, p])),
|
|
1255
1287
|
[participants]
|
|
1256
1288
|
);
|
|
1257
|
-
const runStarts =
|
|
1289
|
+
const runStarts = React11.useMemo(() => {
|
|
1258
1290
|
const groups = groupMessages(messages, { windowMs: groupWindowMs, timeZone });
|
|
1259
1291
|
return new Set(groups.map((g) => g.messageIds[0]));
|
|
1260
1292
|
}, [messages, groupWindowMs, timeZone]);
|
|
1261
|
-
const buckets =
|
|
1293
|
+
const buckets = React11.useMemo(
|
|
1262
1294
|
() => bucketByDay(messages, { timeZone, now }),
|
|
1263
1295
|
[messages, timeZone, now]
|
|
1264
1296
|
);
|
|
1265
|
-
const dividerBefore =
|
|
1297
|
+
const dividerBefore = React11.useMemo(() => {
|
|
1266
1298
|
const map = /* @__PURE__ */ new Map();
|
|
1267
1299
|
for (const bucket of buckets) map.set(bucket.messageIds[0], bucket.label);
|
|
1268
1300
|
return map;
|
|
@@ -1279,7 +1311,7 @@ function MessageList(props) {
|
|
|
1279
1311
|
"aria-label": "Conversation",
|
|
1280
1312
|
tabIndex: 0,
|
|
1281
1313
|
children: [
|
|
1282
|
-
messages.length === 0 ? emptyState ?? null : messages.map((message) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1314
|
+
messages.length === 0 ? emptyState ?? null : messages.map((message) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(React11.Fragment, { children: [
|
|
1283
1315
|
dividerBefore.has(message.id) ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DayDivider, { label: dividerBefore.get(message.id), locale }) : null,
|
|
1284
1316
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1285
1317
|
MessageBubble,
|
|
@@ -1311,7 +1343,7 @@ function MessageList(props) {
|
|
|
1311
1343
|
}
|
|
1312
1344
|
|
|
1313
1345
|
// src/conversation/Composer.tsx
|
|
1314
|
-
var
|
|
1346
|
+
var React12 = __toESM(require("react"), 1);
|
|
1315
1347
|
var import_react_components11 = require("@fluentui/react-components");
|
|
1316
1348
|
var import_react_icons4 = require("@fluentui/react-icons");
|
|
1317
1349
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
@@ -1398,7 +1430,7 @@ function Composer(props) {
|
|
|
1398
1430
|
} = props;
|
|
1399
1431
|
const styles = useStyles10();
|
|
1400
1432
|
const vh = useVisuallyHiddenStyles();
|
|
1401
|
-
const hintId =
|
|
1433
|
+
const hintId = React12.useId();
|
|
1402
1434
|
const submit = () => {
|
|
1403
1435
|
const text = value.trim();
|
|
1404
1436
|
if (!text || busy || disabled) return;
|
|
@@ -1648,14 +1680,14 @@ function UsageMeter({
|
|
|
1648
1680
|
}
|
|
1649
1681
|
|
|
1650
1682
|
// src/ops/ThrottleNotice.tsx
|
|
1651
|
-
var
|
|
1683
|
+
var React13 = __toESM(require("react"), 1);
|
|
1652
1684
|
var import_react_components18 = require("@fluentui/react-components");
|
|
1653
1685
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1654
1686
|
function ThrottleNotice({ failure, onRetry, now = Date.now }) {
|
|
1655
1687
|
const retryAfterMs = failure?.retryAfterMs;
|
|
1656
1688
|
const eligible = Boolean(failure?.recoverable && retryAfterMs && retryAfterMs > 0);
|
|
1657
|
-
const [remaining, setRemaining] =
|
|
1658
|
-
|
|
1689
|
+
const [remaining, setRemaining] = React13.useState(retryAfterMs ?? 0);
|
|
1690
|
+
React13.useEffect(() => {
|
|
1659
1691
|
if (!eligible) return;
|
|
1660
1692
|
const deadline = now() + (retryAfterMs ?? 0);
|
|
1661
1693
|
setRemaining(retryAfterMs ?? 0);
|
|
@@ -1714,7 +1746,7 @@ function AgentPicker({
|
|
|
1714
1746
|
}
|
|
1715
1747
|
|
|
1716
1748
|
// src/ops/RunTimeline.tsx
|
|
1717
|
-
var
|
|
1749
|
+
var React14 = __toESM(require("react"), 1);
|
|
1718
1750
|
var import_react_components21 = require("@fluentui/react-components");
|
|
1719
1751
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1720
1752
|
var useStyles14 = (0, import_react_components21.makeStyles)({
|
|
@@ -1734,7 +1766,7 @@ var TOOL_STATUS = {
|
|
|
1734
1766
|
};
|
|
1735
1767
|
function RunTimeline({ message, defaultOpen = false }) {
|
|
1736
1768
|
const styles = useStyles14();
|
|
1737
|
-
const id =
|
|
1769
|
+
const id = React14.useId();
|
|
1738
1770
|
const calls = message.toolCalls ?? [];
|
|
1739
1771
|
const sources = message.sources ?? [];
|
|
1740
1772
|
const hasAnything = calls.length > 0 || sources.length > 0 || message.usage || message.failure;
|
|
@@ -1842,18 +1874,388 @@ function AgentOpsPanel(props) {
|
|
|
1842
1874
|
] });
|
|
1843
1875
|
}
|
|
1844
1876
|
|
|
1845
|
-
// src/
|
|
1846
|
-
var React14 = __toESM(require("react"), 1);
|
|
1877
|
+
// src/support/AgentLauncher.tsx
|
|
1847
1878
|
var import_react_components24 = require("@fluentui/react-components");
|
|
1848
|
-
var import_react_icons6 = require("@fluentui/react-icons");
|
|
1849
|
-
var import_v9 = require("@dataverse-kit/surface-kit/v9");
|
|
1850
1879
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1851
1880
|
var useStyles17 = (0, import_react_components24.makeStyles)({
|
|
1881
|
+
root: {
|
|
1882
|
+
position: "absolute",
|
|
1883
|
+
top: "30%",
|
|
1884
|
+
display: "flex",
|
|
1885
|
+
flexDirection: "column",
|
|
1886
|
+
zIndex: 100
|
|
1887
|
+
},
|
|
1888
|
+
right: { right: 0, alignItems: "flex-end" },
|
|
1889
|
+
left: { left: 0, alignItems: "flex-start" },
|
|
1890
|
+
hidden: { display: "none" },
|
|
1891
|
+
pill: {
|
|
1892
|
+
display: "flex",
|
|
1893
|
+
alignItems: "center",
|
|
1894
|
+
gap: import_react_components24.tokens.spacingHorizontalS,
|
|
1895
|
+
border: "none",
|
|
1896
|
+
cursor: "pointer",
|
|
1897
|
+
padding: `${import_react_components24.tokens.spacingVerticalM} ${import_react_components24.tokens.spacingHorizontalM}`,
|
|
1898
|
+
color: import_react_components24.tokens.colorNeutralForegroundOnBrand,
|
|
1899
|
+
fontFamily: import_react_components24.tokens.fontFamilyBase,
|
|
1900
|
+
fontSize: import_react_components24.tokens.fontSizeBase300,
|
|
1901
|
+
// ★ Collapsed shows the icon only; the LABEL IS STILL IN THE DOM (see below), so the
|
|
1902
|
+
// expand-on-hover is purely visual and the button is named for AT at every width.
|
|
1903
|
+
maxWidth: "44px",
|
|
1904
|
+
overflow: "hidden",
|
|
1905
|
+
whiteSpace: "nowrap",
|
|
1906
|
+
transitionProperty: "max-width",
|
|
1907
|
+
transitionDuration: import_react_components24.tokens.durationNormal,
|
|
1908
|
+
":hover": { maxWidth: "260px" },
|
|
1909
|
+
":hover .fui-launcher-label": { opacity: 1 },
|
|
1910
|
+
":focus-within .fui-launcher-label": { opacity: 1 },
|
|
1911
|
+
// ★ :focus-within as well as :hover — a keyboard user must get the same reveal, and this is
|
|
1912
|
+
// the affordance the M365 reference only shows on pointer hover.
|
|
1913
|
+
":focus-within": { maxWidth: "260px" },
|
|
1914
|
+
":focus-visible": { outline: `2px solid ${import_react_components24.tokens.colorStrokeFocus2}`, outlineOffset: "-2px" }
|
|
1915
|
+
},
|
|
1916
|
+
primary: { backgroundColor: import_react_components24.tokens.colorBrandBackground, ":hover": { backgroundColor: import_react_components24.tokens.colorBrandBackgroundHover, maxWidth: "260px" } },
|
|
1917
|
+
secondary: { backgroundColor: import_react_components24.tokens.colorBrandBackgroundStatic, ":hover": { backgroundColor: import_react_components24.tokens.colorBrandBackgroundStatic, maxWidth: "260px" } },
|
|
1918
|
+
firstRight: { borderTopLeftRadius: import_react_components24.tokens.borderRadiusXLarge },
|
|
1919
|
+
lastRight: { borderBottomLeftRadius: import_react_components24.tokens.borderRadiusXLarge },
|
|
1920
|
+
firstLeft: { borderTopRightRadius: import_react_components24.tokens.borderRadiusXLarge },
|
|
1921
|
+
lastLeft: { borderBottomRightRadius: import_react_components24.tokens.borderRadiusXLarge },
|
|
1922
|
+
// ★★ flexShrink BELONGS ON THE ICON, NOT THE TEXT. With it on the text, a collapsed 44px pill
|
|
1923
|
+
// (20px of content box after padding) gave the unshrinkable label the whole width and squeezed
|
|
1924
|
+
// the icon to ZERO — so the collapsed rail showed two clipped letters instead of a glyph.
|
|
1925
|
+
// MEASURED on Chromatic build 18: svgWidth 0, reported as "the content is off screen".
|
|
1926
|
+
icon: { flexShrink: 0, display: "flex", fontSize: "20px", lineHeight: 1 },
|
|
1927
|
+
// ★ The label FADES rather than relying on the clip. `overflow: hidden` cuts at the PADDING box,
|
|
1928
|
+
// so a 44px pill still showed ~4px of the first letter beside the icon. Opacity keeps the label
|
|
1929
|
+
// in the accessible name (see the class docstring) while hiding it from sight.
|
|
1930
|
+
text: {
|
|
1931
|
+
flexShrink: 1,
|
|
1932
|
+
minWidth: 0,
|
|
1933
|
+
opacity: 0,
|
|
1934
|
+
transitionProperty: "opacity",
|
|
1935
|
+
transitionDuration: import_react_components24.tokens.durationNormal,
|
|
1936
|
+
"@media (prefers-reduced-motion: reduce)": { transitionDuration: "1ms" }
|
|
1937
|
+
}
|
|
1938
|
+
});
|
|
1939
|
+
function AgentLauncher({
|
|
1940
|
+
items,
|
|
1941
|
+
onSelect,
|
|
1942
|
+
side = "right",
|
|
1943
|
+
label = "Assistant",
|
|
1944
|
+
hidden = false
|
|
1945
|
+
}) {
|
|
1946
|
+
const styles = useStyles17();
|
|
1947
|
+
if (items.length === 0) return null;
|
|
1948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1949
|
+
"div",
|
|
1950
|
+
{
|
|
1951
|
+
className: (0, import_react_components24.mergeClasses)(styles.root, side === "right" ? styles.right : styles.left, hidden && styles.hidden),
|
|
1952
|
+
role: "group",
|
|
1953
|
+
"aria-label": label,
|
|
1954
|
+
children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1955
|
+
"button",
|
|
1956
|
+
{
|
|
1957
|
+
type: "button",
|
|
1958
|
+
onClick: () => onSelect(item.id),
|
|
1959
|
+
className: (0, import_react_components24.mergeClasses)(
|
|
1960
|
+
styles.pill,
|
|
1961
|
+
i === 0 ? styles.primary : styles.secondary,
|
|
1962
|
+
i === 0 && (side === "right" ? styles.firstRight : styles.firstLeft),
|
|
1963
|
+
i === items.length - 1 && (side === "right" ? styles.lastRight : styles.lastLeft)
|
|
1964
|
+
),
|
|
1965
|
+
children: [
|
|
1966
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: styles.icon, "aria-hidden": "true", children: item.icon }),
|
|
1967
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: (0, import_react_components24.mergeClasses)(styles.text, "fui-launcher-label"), children: item.label }),
|
|
1968
|
+
item.badgeCount ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_components24.Badge, { appearance: "filled", color: "danger", children: item.badgeCount }) : null
|
|
1969
|
+
]
|
|
1970
|
+
},
|
|
1971
|
+
item.id
|
|
1972
|
+
))
|
|
1973
|
+
}
|
|
1974
|
+
);
|
|
1975
|
+
}
|
|
1976
|
+
|
|
1977
|
+
// src/support/AssistantPanel.tsx
|
|
1978
|
+
var React15 = __toESM(require("react"), 1);
|
|
1979
|
+
var import_react_components25 = require("@fluentui/react-components");
|
|
1980
|
+
var import_react_icons6 = require("@fluentui/react-icons");
|
|
1981
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1982
|
+
var useStyles18 = (0, import_react_components25.makeStyles)({
|
|
1983
|
+
root: {
|
|
1984
|
+
display: "flex",
|
|
1985
|
+
flexDirection: "column",
|
|
1986
|
+
height: "100%",
|
|
1987
|
+
minWidth: "320px",
|
|
1988
|
+
backgroundColor: import_react_components25.tokens.colorNeutralBackground1,
|
|
1989
|
+
borderLeft: `1px solid ${import_react_components25.tokens.colorNeutralStroke2}`,
|
|
1990
|
+
// ★ transform, not width/left — those two lay out on every frame and a transcript is an
|
|
1991
|
+
// expensive subtree to reflow 60 times a second.
|
|
1992
|
+
transform: "translateX(0)",
|
|
1993
|
+
transitionProperty: "transform",
|
|
1994
|
+
transitionDuration: import_react_components25.tokens.durationGentle,
|
|
1995
|
+
transitionTimingFunction: import_react_components25.tokens.curveDecelerateMid,
|
|
1996
|
+
// ★★ prefers-reduced-motion is honoured, and it is not decoration: a full-height panel
|
|
1997
|
+
// sliding across the viewport is exactly the vestibular trigger the setting exists for.
|
|
1998
|
+
"@media (prefers-reduced-motion: reduce)": { transitionDuration: "1ms" }
|
|
1999
|
+
},
|
|
2000
|
+
closed: {
|
|
2001
|
+
transform: "translateX(100%)",
|
|
2002
|
+
// ★ Hidden from AT as well as sight. A translated-off panel is still in the a11y tree and
|
|
2003
|
+
// still tabbable, so a keyboard user would tab into a drawer they cannot see.
|
|
2004
|
+
visibility: "hidden"
|
|
2005
|
+
},
|
|
2006
|
+
header: { display: "flex", alignItems: "center", gap: import_react_components25.tokens.spacingHorizontalS, padding: import_react_components25.tokens.spacingVerticalS },
|
|
2007
|
+
tabstrip: { display: "flex", gap: import_react_components25.tokens.spacingHorizontalXXS, flexGrow: 1 },
|
|
2008
|
+
tab: {
|
|
2009
|
+
display: "flex",
|
|
2010
|
+
alignItems: "center",
|
|
2011
|
+
gap: import_react_components25.tokens.spacingHorizontalXS,
|
|
2012
|
+
border: "none",
|
|
2013
|
+
background: "none",
|
|
2014
|
+
cursor: "pointer",
|
|
2015
|
+
padding: `${import_react_components25.tokens.spacingVerticalXS} ${import_react_components25.tokens.spacingHorizontalS}`,
|
|
2016
|
+
color: import_react_components25.tokens.colorNeutralForeground2,
|
|
2017
|
+
fontFamily: import_react_components25.tokens.fontFamilyBase,
|
|
2018
|
+
borderBottom: `2px solid transparent`,
|
|
2019
|
+
":focus-visible": { outline: `2px solid ${import_react_components25.tokens.colorStrokeFocus2}`, outlineOffset: "-2px" }
|
|
2020
|
+
},
|
|
2021
|
+
tabSelected: { color: import_react_components25.tokens.colorNeutralForeground1, borderBottom: `2px solid ${import_react_components25.tokens.colorCompoundBrandStroke}` },
|
|
2022
|
+
title: { padding: `0 ${import_react_components25.tokens.spacingHorizontalM} ${import_react_components25.tokens.spacingVerticalS}` },
|
|
2023
|
+
status: {
|
|
2024
|
+
padding: `${import_react_components25.tokens.spacingVerticalXS} ${import_react_components25.tokens.spacingHorizontalM}`,
|
|
2025
|
+
color: import_react_components25.tokens.colorNeutralForeground3,
|
|
2026
|
+
fontSize: import_react_components25.tokens.fontSizeBase200
|
|
2027
|
+
},
|
|
2028
|
+
body: { flexGrow: 1, minHeight: 0, display: "flex", flexDirection: "column" },
|
|
2029
|
+
footer: {
|
|
2030
|
+
display: "flex",
|
|
2031
|
+
alignItems: "center",
|
|
2032
|
+
justifyContent: "space-between",
|
|
2033
|
+
padding: import_react_components25.tokens.spacingVerticalXS,
|
|
2034
|
+
borderTop: `1px solid ${import_react_components25.tokens.colorNeutralStroke2}`
|
|
2035
|
+
}
|
|
2036
|
+
});
|
|
2037
|
+
function AssistantPanel(props) {
|
|
2038
|
+
const {
|
|
2039
|
+
title,
|
|
2040
|
+
tabs,
|
|
2041
|
+
activeTabId,
|
|
2042
|
+
onTabChange,
|
|
2043
|
+
onClose,
|
|
2044
|
+
enabled,
|
|
2045
|
+
onEnabledChange,
|
|
2046
|
+
status,
|
|
2047
|
+
onDownloadTranscript,
|
|
2048
|
+
muted,
|
|
2049
|
+
onMutedChange,
|
|
2050
|
+
children,
|
|
2051
|
+
open = true,
|
|
2052
|
+
onDismiss
|
|
2053
|
+
} = props;
|
|
2054
|
+
const styles = useStyles18();
|
|
2055
|
+
const baseId = React15.useId();
|
|
2056
|
+
const rootRef = React15.useRef(null);
|
|
2057
|
+
useReturnFocus({ open, containerRef: rootRef });
|
|
2058
|
+
const selectedIndex = Math.max(0, tabs.findIndex((t) => t.id === activeTabId));
|
|
2059
|
+
const roving = useRovingTabindex({
|
|
2060
|
+
itemCount: tabs.length,
|
|
2061
|
+
orientation: "horizontal",
|
|
2062
|
+
// ★ MANUAL ACTIVATION: arrows move focus, Enter/Space selects. That is what the kit's
|
|
2063
|
+
// useRovingTabindex does everywhere, and it is the APG pattern for tabs whose panel is not
|
|
2064
|
+
// free to render. Do not special-case it here; consistency is worth more than the one
|
|
2065
|
+
// keystroke, and a divergent strip is the kind of thing nobody notices until it is shipped.
|
|
2066
|
+
onActivate: (i) => tabs[i] && onTabChange(tabs[i].id)
|
|
2067
|
+
});
|
|
2068
|
+
const { setActiveIndex } = roving;
|
|
2069
|
+
React15.useEffect(() => {
|
|
2070
|
+
setActiveIndex(selectedIndex);
|
|
2071
|
+
}, [selectedIndex, setActiveIndex]);
|
|
2072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2073
|
+
"section",
|
|
2074
|
+
{
|
|
2075
|
+
ref: rootRef,
|
|
2076
|
+
className: (0, import_react_components25.mergeClasses)(styles.root, !open && styles.closed),
|
|
2077
|
+
"aria-label": title,
|
|
2078
|
+
"aria-hidden": !open || void 0,
|
|
2079
|
+
tabIndex: -1,
|
|
2080
|
+
onKeyDown: (e) => {
|
|
2081
|
+
if (e.key !== "Escape" || !onDismiss) return;
|
|
2082
|
+
e.stopPropagation();
|
|
2083
|
+
onDismiss();
|
|
2084
|
+
},
|
|
2085
|
+
children: [
|
|
2086
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: styles.header, children: [
|
|
2087
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: styles.tabstrip, role: "tablist", "aria-label": `${title} views`, children: tabs.map((tab, i) => {
|
|
2088
|
+
const item = roving.getItemProps(i);
|
|
2089
|
+
const selected = tab.id === activeTabId;
|
|
2090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2091
|
+
"button",
|
|
2092
|
+
{
|
|
2093
|
+
type: "button",
|
|
2094
|
+
role: "tab",
|
|
2095
|
+
id: `${baseId}-tab-${tab.id}`,
|
|
2096
|
+
"aria-selected": selected,
|
|
2097
|
+
"aria-controls": `${baseId}-panel`,
|
|
2098
|
+
className: (0, import_react_components25.mergeClasses)(styles.tab, selected && styles.tabSelected),
|
|
2099
|
+
...item,
|
|
2100
|
+
onClick: () => {
|
|
2101
|
+
roving.setActiveIndex(i);
|
|
2102
|
+
onTabChange(tab.id);
|
|
2103
|
+
},
|
|
2104
|
+
children: [
|
|
2105
|
+
tab.icon,
|
|
2106
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: tab.label })
|
|
2107
|
+
]
|
|
2108
|
+
},
|
|
2109
|
+
tab.id
|
|
2110
|
+
);
|
|
2111
|
+
}) }),
|
|
2112
|
+
onEnabledChange ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_components25.Switch, { checked: enabled ?? true, onChange: (_, d) => onEnabledChange(d.checked), label: enabled ?? true ? "On" : "Off" }) : null,
|
|
2113
|
+
onClose ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_components25.Tooltip, { content: "Close", relationship: "label", withArrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_components25.Button, { appearance: "subtle", icon: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_icons6.DismissRegular, {}), onClick: onClose }) }) : null
|
|
2114
|
+
] }),
|
|
2115
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_components25.Text, { as: "h2", size: 600, weight: "semibold", className: styles.title, children: title }),
|
|
2116
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: styles.body, id: `${baseId}-panel`, role: "tabpanel", "aria-labelledby": `${baseId}-tab-${activeTabId}`, children: [
|
|
2117
|
+
status ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: styles.status, children: status }) : null,
|
|
2118
|
+
children
|
|
2119
|
+
] }),
|
|
2120
|
+
onDownloadTranscript || onMutedChange ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: styles.footer, children: [
|
|
2121
|
+
onDownloadTranscript ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_components25.Tooltip, { content: "Download transcript", relationship: "label", withArrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_components25.Button, { appearance: "subtle", icon: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_icons6.ArrowDownloadRegular, {}), onClick: onDownloadTranscript }) }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", {}),
|
|
2122
|
+
onMutedChange ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_components25.Tooltip, { content: muted ? "Unmute" : "Mute", relationship: "label", withArrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2123
|
+
import_react_components25.Button,
|
|
2124
|
+
{
|
|
2125
|
+
appearance: "subtle",
|
|
2126
|
+
"aria-pressed": !!muted,
|
|
2127
|
+
icon: muted ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_icons6.SpeakerMuteRegular, {}) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_icons6.Speaker2Regular, {}),
|
|
2128
|
+
onClick: () => onMutedChange(!muted)
|
|
2129
|
+
}
|
|
2130
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", {})
|
|
2131
|
+
] }) : null
|
|
2132
|
+
]
|
|
2133
|
+
}
|
|
2134
|
+
);
|
|
2135
|
+
}
|
|
2136
|
+
|
|
2137
|
+
// src/support/FeedbackPanel.tsx
|
|
2138
|
+
var React16 = __toESM(require("react"), 1);
|
|
2139
|
+
var import_react_components26 = require("@fluentui/react-components");
|
|
2140
|
+
var import_react_icons7 = require("@fluentui/react-icons");
|
|
2141
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2142
|
+
var STARS = [1, 2, 3, 4, 5];
|
|
2143
|
+
var useStyles19 = (0, import_react_components26.makeStyles)({
|
|
2144
|
+
root: { display: "flex", flexDirection: "column", gap: import_react_components26.tokens.spacingVerticalM, padding: import_react_components26.tokens.spacingVerticalL, maxWidth: "680px" },
|
|
2145
|
+
field: { display: "flex", flexDirection: "column", gap: import_react_components26.tokens.spacingVerticalXS },
|
|
2146
|
+
stars: { display: "flex", gap: import_react_components26.tokens.spacingHorizontalXS },
|
|
2147
|
+
star: {
|
|
2148
|
+
border: "none",
|
|
2149
|
+
background: "none",
|
|
2150
|
+
cursor: "pointer",
|
|
2151
|
+
padding: import_react_components26.tokens.spacingVerticalXXS,
|
|
2152
|
+
color: import_react_components26.tokens.colorNeutralForeground2,
|
|
2153
|
+
fontSize: "26px",
|
|
2154
|
+
lineHeight: 1,
|
|
2155
|
+
":focus-visible": { outline: `2px solid ${import_react_components26.tokens.colorStrokeFocus2}`, outlineOffset: "2px" }
|
|
2156
|
+
},
|
|
2157
|
+
starOn: { color: import_react_components26.tokens.colorCompoundBrandForeground1 },
|
|
2158
|
+
footer: { display: "flex", justifyContent: "flex-end", gap: import_react_components26.tokens.spacingHorizontalS },
|
|
2159
|
+
note: { color: import_react_components26.tokens.colorNeutralForeground3, fontSize: import_react_components26.tokens.fontSizeBase200 }
|
|
2160
|
+
});
|
|
2161
|
+
function FeedbackPanel(props) {
|
|
2162
|
+
const {
|
|
2163
|
+
value,
|
|
2164
|
+
onChange,
|
|
2165
|
+
onSubmit,
|
|
2166
|
+
onCancel,
|
|
2167
|
+
heading = "Send feedback",
|
|
2168
|
+
ratingLabel = "Rate your experience",
|
|
2169
|
+
attachments,
|
|
2170
|
+
privacyNote,
|
|
2171
|
+
busy = false
|
|
2172
|
+
} = props;
|
|
2173
|
+
const styles = useStyles19();
|
|
2174
|
+
const baseId = React16.useId();
|
|
2175
|
+
const roving = useRovingTabindex({
|
|
2176
|
+
itemCount: STARS.length,
|
|
2177
|
+
orientation: "horizontal",
|
|
2178
|
+
onActivate: (i) => onChange({ ...value, rating: i + 1 })
|
|
2179
|
+
});
|
|
2180
|
+
const canSubmit = value.rating > 0 && value.mayContact !== void 0 && !busy;
|
|
2181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: styles.root, children: [
|
|
2182
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_components26.Text, { as: "h2", size: 600, weight: "semibold", children: heading }),
|
|
2183
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: styles.field, children: [
|
|
2184
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_components26.Text, { id: `${baseId}-rating`, children: ratingLabel }),
|
|
2185
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: styles.stars, role: "radiogroup", "aria-labelledby": `${baseId}-rating`, children: STARS.map((n, i) => {
|
|
2186
|
+
const item = roving.getItemProps(i);
|
|
2187
|
+
const on = value.rating >= n;
|
|
2188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2189
|
+
"button",
|
|
2190
|
+
{
|
|
2191
|
+
type: "button",
|
|
2192
|
+
role: "radio",
|
|
2193
|
+
"aria-checked": value.rating === n,
|
|
2194
|
+
"aria-label": `${n} of 5`,
|
|
2195
|
+
className: (0, import_react_components26.mergeClasses)(styles.star, on && styles.starOn),
|
|
2196
|
+
...item,
|
|
2197
|
+
onClick: () => {
|
|
2198
|
+
roving.setActiveIndex(i);
|
|
2199
|
+
onChange({ ...value, rating: n });
|
|
2200
|
+
},
|
|
2201
|
+
children: on ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_icons7.StarFilled, {}) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_icons7.StarRegular, {})
|
|
2202
|
+
},
|
|
2203
|
+
n
|
|
2204
|
+
);
|
|
2205
|
+
}) })
|
|
2206
|
+
] }),
|
|
2207
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: styles.field, children: [
|
|
2208
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_components26.Text, { id: `${baseId}-detail`, children: "Explain in more detail" }),
|
|
2209
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2210
|
+
import_react_components26.Textarea,
|
|
2211
|
+
{
|
|
2212
|
+
"aria-labelledby": `${baseId}-detail`,
|
|
2213
|
+
placeholder: "Do not include any private or sensitive information.",
|
|
2214
|
+
value: value.comment,
|
|
2215
|
+
onChange: (_, d) => onChange({ ...value, comment: d.value }),
|
|
2216
|
+
resize: "vertical"
|
|
2217
|
+
}
|
|
2218
|
+
)
|
|
2219
|
+
] }),
|
|
2220
|
+
attachments ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: styles.field, children: [
|
|
2221
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_components26.Text, { children: "Add more details" }),
|
|
2222
|
+
attachments
|
|
2223
|
+
] }) : null,
|
|
2224
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: styles.field, children: [
|
|
2225
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_components26.Text, { id: `${baseId}-consent`, children: "May we contact you about your feedback?" }),
|
|
2226
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2227
|
+
import_react_components26.RadioGroup,
|
|
2228
|
+
{
|
|
2229
|
+
"aria-labelledby": `${baseId}-consent`,
|
|
2230
|
+
value: value.mayContact === void 0 ? "" : value.mayContact ? "yes" : "no",
|
|
2231
|
+
onChange: (_, d) => onChange({ ...value, mayContact: d.value === "yes" }),
|
|
2232
|
+
children: [
|
|
2233
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_components26.Radio, { value: "yes", label: "Yes, you may contact me" }),
|
|
2234
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_components26.Radio, { value: "no", label: "No, don't contact me" })
|
|
2235
|
+
]
|
|
2236
|
+
}
|
|
2237
|
+
)
|
|
2238
|
+
] }),
|
|
2239
|
+
privacyNote ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: styles.note, children: privacyNote }) : null,
|
|
2240
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: styles.footer, children: [
|
|
2241
|
+
onCancel ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_components26.Button, { appearance: "secondary", onClick: onCancel, children: "Cancel" }) : null,
|
|
2242
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_components26.Button, { appearance: "primary", disabled: !canSubmit, onClick: () => onSubmit(value), children: "Submit" })
|
|
2243
|
+
] })
|
|
2244
|
+
] });
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2247
|
+
// src/shell/AgentAppShell.tsx
|
|
2248
|
+
var React17 = __toESM(require("react"), 1);
|
|
2249
|
+
var import_react_components27 = require("@fluentui/react-components");
|
|
2250
|
+
var import_react_icons8 = require("@fluentui/react-icons");
|
|
2251
|
+
var import_v9 = require("@dataverse-kit/surface-kit/v9");
|
|
2252
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2253
|
+
var useStyles20 = (0, import_react_components27.makeStyles)({
|
|
1852
2254
|
root: {
|
|
1853
2255
|
display: "flex",
|
|
1854
2256
|
height: "100%",
|
|
1855
2257
|
minHeight: 0,
|
|
1856
|
-
backgroundColor:
|
|
2258
|
+
backgroundColor: import_react_components27.tokens.colorNeutralBackground2,
|
|
1857
2259
|
position: "relative",
|
|
1858
2260
|
overflow: "hidden"
|
|
1859
2261
|
},
|
|
@@ -1861,8 +2263,8 @@ var useStyles17 = (0, import_react_components24.makeStyles)({
|
|
|
1861
2263
|
display: "flex",
|
|
1862
2264
|
flexDirection: "column",
|
|
1863
2265
|
minHeight: 0,
|
|
1864
|
-
backgroundColor:
|
|
1865
|
-
borderRight: `1px solid ${
|
|
2266
|
+
backgroundColor: import_react_components27.tokens.colorNeutralBackground1,
|
|
2267
|
+
borderRight: `1px solid ${import_react_components27.tokens.colorNeutralStroke2}`
|
|
1866
2268
|
},
|
|
1867
2269
|
// Below `md` the list overlays the conversation instead of shrinking it to nothing.
|
|
1868
2270
|
sidebarOverlay: {
|
|
@@ -1871,12 +2273,12 @@ var useStyles17 = (0, import_react_components24.makeStyles)({
|
|
|
1871
2273
|
bottom: 0,
|
|
1872
2274
|
left: 0,
|
|
1873
2275
|
zIndex: 2,
|
|
1874
|
-
boxShadow:
|
|
2276
|
+
boxShadow: import_react_components27.tokens.shadow16
|
|
1875
2277
|
},
|
|
1876
|
-
scrim: { position: "absolute", inset: "0", zIndex: 1, backgroundColor:
|
|
2278
|
+
scrim: { position: "absolute", inset: "0", zIndex: 1, backgroundColor: import_react_components27.tokens.colorBackgroundOverlay },
|
|
1877
2279
|
main: { flex: 1, display: "flex", flexDirection: "column", minWidth: 0, minHeight: 0 },
|
|
1878
2280
|
body: { flex: 1, minHeight: 0, display: "flex", flexDirection: "column" },
|
|
1879
|
-
toggle: { position: "absolute", top:
|
|
2281
|
+
toggle: { position: "absolute", top: import_react_components27.tokens.spacingVerticalS, left: import_react_components27.tokens.spacingHorizontalS, zIndex: 3 }
|
|
1880
2282
|
});
|
|
1881
2283
|
function AgentAppShell(props) {
|
|
1882
2284
|
const {
|
|
@@ -1890,7 +2292,7 @@ function AgentAppShell(props) {
|
|
|
1890
2292
|
onSidebarOpenChange,
|
|
1891
2293
|
label = "Agent workspace"
|
|
1892
2294
|
} = props;
|
|
1893
|
-
const styles =
|
|
2295
|
+
const styles = useStyles20();
|
|
1894
2296
|
const [containerRef, measuredWidth] = (0, import_v9.useContainerWidth)();
|
|
1895
2297
|
const width = props.containerWidth ?? (measuredWidth > 0 ? measuredWidth : void 0);
|
|
1896
2298
|
const effective = width ?? import_v9.BREAKPOINTS.xl;
|
|
@@ -1898,17 +2300,17 @@ function AgentAppShell(props) {
|
|
|
1898
2300
|
const railVisible = effective >= import_v9.BREAKPOINTS.sm;
|
|
1899
2301
|
const sidebarInline = effective >= import_v9.BREAKPOINTS.md;
|
|
1900
2302
|
const rightPaneVisible = effective >= import_v9.BREAKPOINTS.lg;
|
|
1901
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
2303
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React17.useState(false);
|
|
1902
2304
|
const overlayOpen = sidebarOpen ?? uncontrolledOpen;
|
|
1903
2305
|
const setOverlayOpen = (open) => {
|
|
1904
2306
|
onSidebarOpenChange?.(open);
|
|
1905
2307
|
if (sidebarOpen === void 0) setUncontrolledOpen(open);
|
|
1906
2308
|
};
|
|
1907
|
-
return /* @__PURE__ */ (0,
|
|
2309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { ref: containerRef, className: styles.root, "data-breakpoint": breakpoint, "aria-label": label, children: [
|
|
1908
2310
|
rail && railVisible ? rail : null,
|
|
1909
|
-
sidebar && sidebarInline ? /* @__PURE__ */ (0,
|
|
1910
|
-
sidebar && !sidebarInline && overlayOpen ? /* @__PURE__ */ (0,
|
|
1911
|
-
/* @__PURE__ */ (0,
|
|
2311
|
+
sidebar && sidebarInline ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: styles.sidebar, style: { width: sidebarWidth }, children: sidebar }) : null,
|
|
2312
|
+
sidebar && !sidebarInline && overlayOpen ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
2313
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1912
2314
|
"div",
|
|
1913
2315
|
{
|
|
1914
2316
|
className: styles.scrim,
|
|
@@ -1916,49 +2318,49 @@ function AgentAppShell(props) {
|
|
|
1916
2318
|
"aria-hidden": "true"
|
|
1917
2319
|
}
|
|
1918
2320
|
),
|
|
1919
|
-
/* @__PURE__ */ (0,
|
|
2321
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: `${styles.sidebar} ${styles.sidebarOverlay}`, style: { width: sidebarWidth }, children: sidebar })
|
|
1920
2322
|
] }) : null,
|
|
1921
|
-
/* @__PURE__ */ (0,
|
|
1922
|
-
sidebar && !sidebarInline ? /* @__PURE__ */ (0,
|
|
1923
|
-
|
|
2323
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: styles.main, children: [
|
|
2324
|
+
sidebar && !sidebarInline ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2325
|
+
import_react_components27.Button,
|
|
1924
2326
|
{
|
|
1925
2327
|
className: styles.toggle,
|
|
1926
2328
|
size: "small",
|
|
1927
2329
|
appearance: "subtle",
|
|
1928
|
-
icon: /* @__PURE__ */ (0,
|
|
2330
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_icons8.NavigationRegular, {}),
|
|
1929
2331
|
"aria-label": overlayOpen ? "Hide conversations" : "Show conversations",
|
|
1930
2332
|
"aria-expanded": overlayOpen,
|
|
1931
2333
|
onClick: () => setOverlayOpen(!overlayOpen)
|
|
1932
2334
|
}
|
|
1933
2335
|
) : null,
|
|
1934
2336
|
header,
|
|
1935
|
-
/* @__PURE__ */ (0,
|
|
2337
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: styles.body, children })
|
|
1936
2338
|
] }),
|
|
1937
2339
|
rightPaneVisible ? rightPane : null
|
|
1938
2340
|
] });
|
|
1939
2341
|
}
|
|
1940
2342
|
|
|
1941
2343
|
// src/shell/AppRail.tsx
|
|
1942
|
-
var
|
|
1943
|
-
var
|
|
1944
|
-
var
|
|
1945
|
-
var
|
|
2344
|
+
var import_react_components28 = require("@fluentui/react-components");
|
|
2345
|
+
var import_react_icons9 = require("@fluentui/react-icons");
|
|
2346
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2347
|
+
var useStyles21 = (0, import_react_components28.makeStyles)({
|
|
1946
2348
|
root: {
|
|
1947
2349
|
display: "flex",
|
|
1948
2350
|
flexDirection: "column",
|
|
1949
2351
|
alignItems: "center",
|
|
1950
|
-
gap:
|
|
1951
|
-
padding:
|
|
1952
|
-
backgroundColor:
|
|
1953
|
-
borderRight: `1px solid ${
|
|
2352
|
+
gap: import_react_components28.tokens.spacingVerticalXS,
|
|
2353
|
+
padding: import_react_components28.tokens.spacingVerticalS,
|
|
2354
|
+
backgroundColor: import_react_components28.tokens.colorNeutralBackground3,
|
|
2355
|
+
borderRight: `1px solid ${import_react_components28.tokens.colorNeutralStroke2}`,
|
|
1954
2356
|
minHeight: 0
|
|
1955
2357
|
},
|
|
1956
2358
|
spacer: { flex: 1 },
|
|
1957
2359
|
button: {
|
|
1958
2360
|
position: "relative",
|
|
1959
|
-
":focus-visible": { outline: `2px solid ${
|
|
2361
|
+
":focus-visible": { outline: `2px solid ${import_react_components28.tokens.colorStrokeFocus2}`, outlineOffset: "1px" }
|
|
1960
2362
|
},
|
|
1961
|
-
selected: { backgroundColor:
|
|
2363
|
+
selected: { backgroundColor: import_react_components28.tokens.colorNeutralBackground1Selected },
|
|
1962
2364
|
badge: {
|
|
1963
2365
|
position: "absolute",
|
|
1964
2366
|
top: "2px",
|
|
@@ -1966,58 +2368,58 @@ var useStyles18 = (0, import_react_components25.makeStyles)({
|
|
|
1966
2368
|
minWidth: "16px",
|
|
1967
2369
|
height: "16px",
|
|
1968
2370
|
padding: "0 3px",
|
|
1969
|
-
borderRadius:
|
|
1970
|
-
backgroundColor:
|
|
1971
|
-
color:
|
|
2371
|
+
borderRadius: import_react_components28.tokens.borderRadiusCircular,
|
|
2372
|
+
backgroundColor: import_react_components28.tokens.colorPaletteRedBackground3,
|
|
2373
|
+
color: import_react_components28.tokens.colorNeutralForegroundOnBrand,
|
|
1972
2374
|
fontSize: "10px",
|
|
1973
2375
|
lineHeight: "16px"
|
|
1974
2376
|
}
|
|
1975
2377
|
});
|
|
1976
2378
|
function AppRail(props) {
|
|
1977
2379
|
const { items, selectedId, onSelect, maxVisible = 6, label = "Apps", footer } = props;
|
|
1978
|
-
const styles =
|
|
2380
|
+
const styles = useStyles21();
|
|
1979
2381
|
const visible = items.slice(0, maxVisible);
|
|
1980
2382
|
const overflow = items.slice(maxVisible);
|
|
1981
|
-
return /* @__PURE__ */ (0,
|
|
1982
|
-
visible.map((item) => /* @__PURE__ */ (0,
|
|
1983
|
-
|
|
2383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("nav", { className: styles.root, "aria-label": label, children: [
|
|
2384
|
+
visible.map((item) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_components28.Tooltip, { content: item.label, relationship: "label", positioning: "after", withArrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2385
|
+
import_react_components28.Button,
|
|
1984
2386
|
{
|
|
1985
2387
|
appearance: "subtle",
|
|
1986
2388
|
icon: item.icon,
|
|
1987
|
-
className: (0,
|
|
2389
|
+
className: (0, import_react_components28.mergeClasses)(styles.button, item.id === selectedId && styles.selected),
|
|
1988
2390
|
"aria-pressed": item.id === selectedId,
|
|
1989
2391
|
"aria-label": item.badgeCount ? `${item.label}, ${item.badgeCount} unread` : item.label,
|
|
1990
2392
|
onClick: () => onSelect(item.id),
|
|
1991
|
-
children: item.badgeCount ? /* @__PURE__ */ (0,
|
|
2393
|
+
children: item.badgeCount ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: styles.badge, "aria-hidden": "true", children: item.badgeCount }) : null
|
|
1992
2394
|
}
|
|
1993
2395
|
) }, item.id)),
|
|
1994
|
-
overflow.length > 0 ? /* @__PURE__ */ (0,
|
|
1995
|
-
/* @__PURE__ */ (0,
|
|
1996
|
-
|
|
2396
|
+
overflow.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_react_components28.Menu, { children: [
|
|
2397
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_components28.MenuTrigger, { disableButtonEnhancement: true, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2398
|
+
import_react_components28.Button,
|
|
1997
2399
|
{
|
|
1998
2400
|
appearance: "subtle",
|
|
1999
|
-
icon: /* @__PURE__ */ (0,
|
|
2401
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_icons9.MoreHorizontalRegular, {}),
|
|
2000
2402
|
className: styles.button,
|
|
2001
2403
|
"aria-label": `More apps, ${overflow.length} hidden`
|
|
2002
2404
|
}
|
|
2003
2405
|
) }),
|
|
2004
|
-
/* @__PURE__ */ (0,
|
|
2406
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_components28.MenuPopover, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_components28.MenuList, { children: overflow.map((item) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_components28.MenuItem, { icon: item.icon, onClick: () => onSelect(item.id), children: item.label }, item.id)) }) })
|
|
2005
2407
|
] }) : null,
|
|
2006
|
-
/* @__PURE__ */ (0,
|
|
2408
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: styles.spacer }),
|
|
2007
2409
|
footer
|
|
2008
2410
|
] });
|
|
2009
2411
|
}
|
|
2010
2412
|
|
|
2011
2413
|
// src/shell/ConversationList.tsx
|
|
2012
|
-
var
|
|
2013
|
-
var
|
|
2414
|
+
var React18 = __toESM(require("react"), 1);
|
|
2415
|
+
var import_react_components31 = require("@fluentui/react-components");
|
|
2014
2416
|
|
|
2015
2417
|
// src/shell/ConversationListItem.tsx
|
|
2016
|
-
var
|
|
2418
|
+
var import_react_components30 = require("@fluentui/react-components");
|
|
2017
2419
|
|
|
2018
2420
|
// src/shell/AgentAvatar.tsx
|
|
2019
|
-
var
|
|
2020
|
-
var
|
|
2421
|
+
var import_react_components29 = require("@fluentui/react-components");
|
|
2422
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2021
2423
|
var STATUS = {
|
|
2022
2424
|
available: "available",
|
|
2023
2425
|
busy: "busy",
|
|
@@ -2028,8 +2430,8 @@ var STATUS = {
|
|
|
2028
2430
|
};
|
|
2029
2431
|
function AgentAvatar({ participant, presence, size = 32, name }) {
|
|
2030
2432
|
const displayName = name ?? participant?.displayName ?? "Unknown";
|
|
2031
|
-
return /* @__PURE__ */ (0,
|
|
2032
|
-
|
|
2433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2434
|
+
import_react_components29.Avatar,
|
|
2033
2435
|
{
|
|
2034
2436
|
name: displayName,
|
|
2035
2437
|
initials: participant?.initials,
|
|
@@ -2042,49 +2444,49 @@ function AgentAvatar({ participant, presence, size = 32, name }) {
|
|
|
2042
2444
|
}
|
|
2043
2445
|
|
|
2044
2446
|
// src/shell/ConversationListItem.tsx
|
|
2045
|
-
var
|
|
2046
|
-
var
|
|
2447
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2448
|
+
var useStyles22 = (0, import_react_components30.makeStyles)({
|
|
2047
2449
|
row: {
|
|
2048
2450
|
display: "flex",
|
|
2049
|
-
gap:
|
|
2451
|
+
gap: import_react_components30.tokens.spacingHorizontalS,
|
|
2050
2452
|
alignItems: "center",
|
|
2051
|
-
padding: `${
|
|
2052
|
-
borderRadius:
|
|
2453
|
+
padding: `${import_react_components30.tokens.spacingVerticalS} ${import_react_components30.tokens.spacingHorizontalS}`,
|
|
2454
|
+
borderRadius: import_react_components30.tokens.borderRadiusMedium,
|
|
2053
2455
|
cursor: "pointer",
|
|
2054
|
-
":hover": { backgroundColor:
|
|
2456
|
+
":hover": { backgroundColor: import_react_components30.tokens.colorNeutralBackground1Hover }
|
|
2055
2457
|
},
|
|
2056
2458
|
// ★ The ACTIVE row (aria-activedescendant target) gets a visible focus indicator, because
|
|
2057
2459
|
// real DOM focus stays on the listbox — without this the keyboard user sees nothing move.
|
|
2058
|
-
active: { outline: `2px solid ${
|
|
2059
|
-
selected: { backgroundColor:
|
|
2460
|
+
active: { outline: `2px solid ${import_react_components30.tokens.colorStrokeFocus2}`, outlineOffset: "-2px" },
|
|
2461
|
+
selected: { backgroundColor: import_react_components30.tokens.colorNeutralBackground1Selected },
|
|
2060
2462
|
body: { flex: 1, minWidth: 0 },
|
|
2061
2463
|
title: {
|
|
2062
2464
|
display: "block",
|
|
2063
|
-
fontSize:
|
|
2064
|
-
fontWeight:
|
|
2465
|
+
fontSize: import_react_components30.tokens.fontSizeBase300,
|
|
2466
|
+
fontWeight: import_react_components30.tokens.fontWeightSemibold,
|
|
2065
2467
|
overflow: "hidden",
|
|
2066
2468
|
textOverflow: "ellipsis",
|
|
2067
2469
|
whiteSpace: "nowrap"
|
|
2068
2470
|
},
|
|
2069
|
-
muted: { fontWeight:
|
|
2471
|
+
muted: { fontWeight: import_react_components30.tokens.fontWeightRegular, color: import_react_components30.tokens.colorNeutralForeground3 },
|
|
2070
2472
|
preview: {
|
|
2071
2473
|
display: "block",
|
|
2072
|
-
fontSize:
|
|
2073
|
-
color:
|
|
2474
|
+
fontSize: import_react_components30.tokens.fontSizeBase200,
|
|
2475
|
+
color: import_react_components30.tokens.colorNeutralForeground3,
|
|
2074
2476
|
overflow: "hidden",
|
|
2075
2477
|
textOverflow: "ellipsis",
|
|
2076
2478
|
whiteSpace: "nowrap"
|
|
2077
2479
|
},
|
|
2078
2480
|
meta: { display: "flex", flexDirection: "column", alignItems: "flex-end", gap: "2px" },
|
|
2079
|
-
time: { fontSize:
|
|
2481
|
+
time: { fontSize: import_react_components30.tokens.fontSizeBase100, color: import_react_components30.tokens.colorNeutralForeground3 },
|
|
2080
2482
|
unread: {
|
|
2081
2483
|
minWidth: "18px",
|
|
2082
2484
|
height: "18px",
|
|
2083
|
-
padding: `0 ${
|
|
2084
|
-
borderRadius:
|
|
2085
|
-
backgroundColor:
|
|
2086
|
-
color:
|
|
2087
|
-
fontSize:
|
|
2485
|
+
padding: `0 ${import_react_components30.tokens.spacingHorizontalXXS}`,
|
|
2486
|
+
borderRadius: import_react_components30.tokens.borderRadiusCircular,
|
|
2487
|
+
backgroundColor: import_react_components30.tokens.colorBrandBackground,
|
|
2488
|
+
color: import_react_components30.tokens.colorNeutralForegroundOnBrand,
|
|
2489
|
+
fontSize: import_react_components30.tokens.fontSizeBase100,
|
|
2088
2490
|
lineHeight: "18px",
|
|
2089
2491
|
textAlign: "center"
|
|
2090
2492
|
}
|
|
@@ -2103,27 +2505,27 @@ function conversationAccessibleName(summary, locale) {
|
|
|
2103
2505
|
}
|
|
2104
2506
|
function ConversationListItem(props) {
|
|
2105
2507
|
const { summary, selected, active, id, locale, onSelect } = props;
|
|
2106
|
-
const styles =
|
|
2508
|
+
const styles = useStyles22();
|
|
2107
2509
|
const time = summary.timestamp ? new Intl.DateTimeFormat(locale, { timeStyle: "short" }).format(new Date(summary.timestamp)) : void 0;
|
|
2108
|
-
return /* @__PURE__ */ (0,
|
|
2510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
2109
2511
|
"div",
|
|
2110
2512
|
{
|
|
2111
2513
|
id,
|
|
2112
2514
|
role: "option",
|
|
2113
2515
|
"aria-selected": selected,
|
|
2114
2516
|
"aria-label": conversationAccessibleName(summary, locale),
|
|
2115
|
-
className: (0,
|
|
2517
|
+
className: (0, import_react_components30.mergeClasses)(styles.row, selected && styles.selected, active && styles.active),
|
|
2116
2518
|
onClick: () => onSelect(summary.id),
|
|
2117
2519
|
"data-conversation-option": true,
|
|
2118
2520
|
children: [
|
|
2119
|
-
/* @__PURE__ */ (0,
|
|
2120
|
-
/* @__PURE__ */ (0,
|
|
2121
|
-
/* @__PURE__ */ (0,
|
|
2122
|
-
summary.preview ? /* @__PURE__ */ (0,
|
|
2521
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AgentAvatar, { participant: summary.participant, presence: summary.presence, size: 32 }),
|
|
2522
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: styles.body, "aria-hidden": "true", children: [
|
|
2523
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: (0, import_react_components30.mergeClasses)(styles.title, summary.muted && styles.muted), children: summary.title }),
|
|
2524
|
+
summary.preview ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: styles.preview, children: summary.preview }) : null
|
|
2123
2525
|
] }),
|
|
2124
|
-
/* @__PURE__ */ (0,
|
|
2125
|
-
time ? /* @__PURE__ */ (0,
|
|
2126
|
-
!summary.muted && summary.unreadCount ? /* @__PURE__ */ (0,
|
|
2526
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: styles.meta, "aria-hidden": "true", children: [
|
|
2527
|
+
time ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: styles.time, children: time }) : null,
|
|
2528
|
+
!summary.muted && summary.unreadCount ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: styles.unread, children: summary.unreadCount }) : null
|
|
2127
2529
|
] })
|
|
2128
2530
|
]
|
|
2129
2531
|
}
|
|
@@ -2131,27 +2533,27 @@ function ConversationListItem(props) {
|
|
|
2131
2533
|
}
|
|
2132
2534
|
|
|
2133
2535
|
// src/shell/ConversationList.tsx
|
|
2134
|
-
var
|
|
2135
|
-
var
|
|
2536
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2537
|
+
var useStyles23 = (0, import_react_components31.makeStyles)({
|
|
2136
2538
|
root: {
|
|
2137
2539
|
display: "flex",
|
|
2138
2540
|
flexDirection: "column",
|
|
2139
2541
|
gap: "2px",
|
|
2140
|
-
padding:
|
|
2542
|
+
padding: import_react_components31.tokens.spacingHorizontalXS,
|
|
2141
2543
|
overflowY: "auto",
|
|
2142
2544
|
minHeight: 0,
|
|
2143
|
-
":focus-visible": { outline: `2px solid ${
|
|
2545
|
+
":focus-visible": { outline: `2px solid ${import_react_components31.tokens.colorStrokeFocus2}`, outlineOffset: "-2px" }
|
|
2144
2546
|
},
|
|
2145
|
-
empty: { padding:
|
|
2547
|
+
empty: { padding: import_react_components31.tokens.spacingVerticalM, color: import_react_components31.tokens.colorNeutralForeground3 }
|
|
2146
2548
|
});
|
|
2147
2549
|
function ConversationList(props) {
|
|
2148
2550
|
const { items, selectedId, onSelect, label = "Conversations", locale, empty } = props;
|
|
2149
|
-
const styles =
|
|
2150
|
-
const listRef =
|
|
2151
|
-
const idBase =
|
|
2551
|
+
const styles = useStyles23();
|
|
2552
|
+
const listRef = React18.useRef(null);
|
|
2553
|
+
const idBase = React18.useId();
|
|
2152
2554
|
const selectedIndex = Math.max(0, items.findIndex((i) => i.id === selectedId));
|
|
2153
|
-
const [active, setActive] =
|
|
2154
|
-
|
|
2555
|
+
const [active, setActive] = React18.useState(selectedIndex);
|
|
2556
|
+
React18.useEffect(() => {
|
|
2155
2557
|
setActive((current) => {
|
|
2156
2558
|
if (items.length === 0) return 0;
|
|
2157
2559
|
if (selectedIndex >= 0 && items[selectedIndex]) return selectedIndex;
|
|
@@ -2159,7 +2561,7 @@ function ConversationList(props) {
|
|
|
2159
2561
|
});
|
|
2160
2562
|
}, [selectedIndex, items]);
|
|
2161
2563
|
const optionId = (index) => `${idBase}-opt-${index}`;
|
|
2162
|
-
|
|
2564
|
+
React18.useEffect(() => {
|
|
2163
2565
|
const el = listRef.current?.ownerDocument.getElementById(optionId(active));
|
|
2164
2566
|
el?.scrollIntoView?.({ block: "nearest" });
|
|
2165
2567
|
}, [active, idBase]);
|
|
@@ -2182,9 +2584,9 @@ function ConversationList(props) {
|
|
|
2182
2584
|
setActive(next);
|
|
2183
2585
|
};
|
|
2184
2586
|
if (items.length === 0) {
|
|
2185
|
-
return /* @__PURE__ */ (0,
|
|
2587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: styles.root, children: empty ?? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_components31.Text, { className: styles.empty, size: 200, children: "No conversations yet." }) });
|
|
2186
2588
|
}
|
|
2187
|
-
return /* @__PURE__ */ (0,
|
|
2589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2188
2590
|
"div",
|
|
2189
2591
|
{
|
|
2190
2592
|
ref: listRef,
|
|
@@ -2194,7 +2596,7 @@ function ConversationList(props) {
|
|
|
2194
2596
|
tabIndex: 0,
|
|
2195
2597
|
"aria-activedescendant": optionId(active),
|
|
2196
2598
|
onKeyDown,
|
|
2197
|
-
children: items.map((summary, index) => /* @__PURE__ */ (0,
|
|
2599
|
+
children: items.map((summary, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2198
2600
|
ConversationListItem,
|
|
2199
2601
|
{
|
|
2200
2602
|
id: optionId(index),
|
|
@@ -2211,24 +2613,24 @@ function ConversationList(props) {
|
|
|
2211
2613
|
}
|
|
2212
2614
|
|
|
2213
2615
|
// src/shell/ConversationHeader.tsx
|
|
2214
|
-
var
|
|
2215
|
-
var
|
|
2216
|
-
var
|
|
2217
|
-
var
|
|
2616
|
+
var import_react_components32 = require("@fluentui/react-components");
|
|
2617
|
+
var import_react_icons10 = require("@fluentui/react-icons");
|
|
2618
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2619
|
+
var useStyles24 = (0, import_react_components32.makeStyles)({
|
|
2218
2620
|
root: {
|
|
2219
2621
|
display: "flex",
|
|
2220
2622
|
flexDirection: "column",
|
|
2221
|
-
gap:
|
|
2222
|
-
padding: `${
|
|
2223
|
-
borderBottom: `1px solid ${
|
|
2224
|
-
backgroundColor:
|
|
2623
|
+
gap: import_react_components32.tokens.spacingVerticalXS,
|
|
2624
|
+
padding: `${import_react_components32.tokens.spacingVerticalS} ${import_react_components32.tokens.spacingHorizontalM} 0`,
|
|
2625
|
+
borderBottom: `1px solid ${import_react_components32.tokens.colorNeutralStroke2}`,
|
|
2626
|
+
backgroundColor: import_react_components32.tokens.colorNeutralBackground1
|
|
2225
2627
|
},
|
|
2226
|
-
top: { display: "flex", alignItems: "center", gap:
|
|
2227
|
-
identity: { display: "flex", alignItems: "center", gap:
|
|
2628
|
+
top: { display: "flex", alignItems: "center", gap: import_react_components32.tokens.spacingHorizontalS },
|
|
2629
|
+
identity: { display: "flex", alignItems: "center", gap: import_react_components32.tokens.spacingHorizontalS, minWidth: 0 },
|
|
2228
2630
|
titles: { display: "flex", flexDirection: "column", minWidth: 0 },
|
|
2229
|
-
subtitle: { color:
|
|
2631
|
+
subtitle: { color: import_react_components32.tokens.colorNeutralForeground3, fontSize: import_react_components32.tokens.fontSizeBase200 },
|
|
2230
2632
|
spacer: { flex: 1 },
|
|
2231
|
-
tabRow: { display: "flex", alignItems: "flex-end", gap:
|
|
2633
|
+
tabRow: { display: "flex", alignItems: "flex-end", gap: import_react_components32.tokens.spacingHorizontalS }
|
|
2232
2634
|
});
|
|
2233
2635
|
function ConversationHeader(props) {
|
|
2234
2636
|
const {
|
|
@@ -2242,22 +2644,22 @@ function ConversationHeader(props) {
|
|
|
2242
2644
|
actions,
|
|
2243
2645
|
trailing
|
|
2244
2646
|
} = props;
|
|
2245
|
-
const styles =
|
|
2647
|
+
const styles = useStyles24();
|
|
2246
2648
|
const inline = (actions ?? []).slice(0, 2);
|
|
2247
2649
|
const overflow = (actions ?? []).slice(2);
|
|
2248
|
-
return /* @__PURE__ */ (0,
|
|
2249
|
-
/* @__PURE__ */ (0,
|
|
2250
|
-
/* @__PURE__ */ (0,
|
|
2251
|
-
/* @__PURE__ */ (0,
|
|
2252
|
-
/* @__PURE__ */ (0,
|
|
2253
|
-
/* @__PURE__ */ (0,
|
|
2254
|
-
subtitle ? /* @__PURE__ */ (0,
|
|
2650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("header", { className: styles.root, children: [
|
|
2651
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: styles.top, children: [
|
|
2652
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: styles.identity, children: [
|
|
2653
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(AgentAvatar, { participant, presence, size: 32, name: title }),
|
|
2654
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: styles.titles, children: [
|
|
2655
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_components32.Text, { weight: "semibold", truncate: true, wrap: false, children: title }),
|
|
2656
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: styles.subtitle, children: subtitle }) : null
|
|
2255
2657
|
] })
|
|
2256
2658
|
] }),
|
|
2257
|
-
/* @__PURE__ */ (0,
|
|
2659
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: styles.spacer }),
|
|
2258
2660
|
trailing,
|
|
2259
|
-
inline.map((action) => /* @__PURE__ */ (0,
|
|
2260
|
-
|
|
2661
|
+
inline.map((action) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2662
|
+
import_react_components32.Button,
|
|
2261
2663
|
{
|
|
2262
2664
|
appearance: "subtle",
|
|
2263
2665
|
size: "small",
|
|
@@ -2267,80 +2669,80 @@ function ConversationHeader(props) {
|
|
|
2267
2669
|
},
|
|
2268
2670
|
action.key
|
|
2269
2671
|
)),
|
|
2270
|
-
overflow.length > 0 ? /* @__PURE__ */ (0,
|
|
2271
|
-
/* @__PURE__ */ (0,
|
|
2272
|
-
|
|
2672
|
+
overflow.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react_components32.Menu, { children: [
|
|
2673
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_components32.MenuTrigger, { disableButtonEnhancement: true, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2674
|
+
import_react_components32.Button,
|
|
2273
2675
|
{
|
|
2274
2676
|
appearance: "subtle",
|
|
2275
2677
|
size: "small",
|
|
2276
|
-
icon: /* @__PURE__ */ (0,
|
|
2678
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_icons10.MoreHorizontalRegular, {}),
|
|
2277
2679
|
"aria-label": `More actions, ${overflow.length} available`
|
|
2278
2680
|
}
|
|
2279
2681
|
) }),
|
|
2280
|
-
/* @__PURE__ */ (0,
|
|
2682
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_components32.MenuPopover, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_components32.MenuList, { children: overflow.map((action) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_components32.MenuItem, { icon: action.icon, onClick: action.onClick, children: action.label }, action.key)) }) })
|
|
2281
2683
|
] }) : null
|
|
2282
2684
|
] }),
|
|
2283
|
-
tabs && tabs.length > 0 ? /* @__PURE__ */ (0,
|
|
2284
|
-
|
|
2685
|
+
tabs && tabs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: styles.tabRow, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2686
|
+
import_react_components32.TabList,
|
|
2285
2687
|
{
|
|
2286
2688
|
selectedValue: selectedTabId,
|
|
2287
2689
|
onTabSelect: (_, data) => onTabSelect?.(data.value),
|
|
2288
2690
|
size: "small",
|
|
2289
|
-
children: tabs.map((tab) => /* @__PURE__ */ (0,
|
|
2691
|
+
children: tabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_components32.Tab, { value: tab.id, children: tab.label }, tab.id))
|
|
2290
2692
|
}
|
|
2291
2693
|
) }) : null
|
|
2292
2694
|
] });
|
|
2293
2695
|
}
|
|
2294
2696
|
|
|
2295
2697
|
// src/shell/RightPane.tsx
|
|
2296
|
-
var
|
|
2297
|
-
var
|
|
2298
|
-
var
|
|
2299
|
-
var
|
|
2300
|
-
var
|
|
2698
|
+
var React19 = __toESM(require("react"), 1);
|
|
2699
|
+
var import_react_components33 = require("@fluentui/react-components");
|
|
2700
|
+
var import_react_icons11 = require("@fluentui/react-icons");
|
|
2701
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2702
|
+
var useStyles25 = (0, import_react_components33.makeStyles)({
|
|
2301
2703
|
root: {
|
|
2302
2704
|
display: "flex",
|
|
2303
2705
|
flexDirection: "column",
|
|
2304
|
-
borderLeft: `1px solid ${
|
|
2305
|
-
backgroundColor:
|
|
2706
|
+
borderLeft: `1px solid ${import_react_components33.tokens.colorNeutralStroke2}`,
|
|
2707
|
+
backgroundColor: import_react_components33.tokens.colorNeutralBackground1,
|
|
2306
2708
|
minHeight: 0
|
|
2307
2709
|
},
|
|
2308
2710
|
head: {
|
|
2309
2711
|
display: "flex",
|
|
2310
2712
|
alignItems: "center",
|
|
2311
2713
|
justifyContent: "space-between",
|
|
2312
|
-
gap:
|
|
2313
|
-
padding:
|
|
2314
|
-
borderBottom: `1px solid ${
|
|
2714
|
+
gap: import_react_components33.tokens.spacingHorizontalS,
|
|
2715
|
+
padding: import_react_components33.tokens.spacingVerticalS,
|
|
2716
|
+
borderBottom: `1px solid ${import_react_components33.tokens.colorNeutralStroke2}`
|
|
2315
2717
|
},
|
|
2316
|
-
body: { flex: 1, overflowY: "auto", padding:
|
|
2718
|
+
body: { flex: 1, overflowY: "auto", padding: import_react_components33.tokens.spacingVerticalM }
|
|
2317
2719
|
});
|
|
2318
2720
|
function RightPane({ open, title, onClose, children, width = 320 }) {
|
|
2319
|
-
const styles =
|
|
2320
|
-
const labelId =
|
|
2721
|
+
const styles = useStyles25();
|
|
2722
|
+
const labelId = React19.useId();
|
|
2321
2723
|
if (!open) return null;
|
|
2322
|
-
return /* @__PURE__ */ (0,
|
|
2323
|
-
/* @__PURE__ */ (0,
|
|
2324
|
-
/* @__PURE__ */ (0,
|
|
2325
|
-
/* @__PURE__ */ (0,
|
|
2326
|
-
|
|
2724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("aside", { className: styles.root, style: { width }, "aria-labelledby": labelId, children: [
|
|
2725
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: styles.head, children: [
|
|
2726
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_components33.Text, { id: labelId, weight: "semibold", children: title }),
|
|
2727
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2728
|
+
import_react_components33.Button,
|
|
2327
2729
|
{
|
|
2328
2730
|
appearance: "subtle",
|
|
2329
2731
|
size: "small",
|
|
2330
|
-
icon: /* @__PURE__ */ (0,
|
|
2732
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_icons11.DismissRegular, {}),
|
|
2331
2733
|
onClick: onClose,
|
|
2332
2734
|
"aria-label": `Close ${title}`
|
|
2333
2735
|
}
|
|
2334
2736
|
)
|
|
2335
2737
|
] }),
|
|
2336
|
-
/* @__PURE__ */ (0,
|
|
2738
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: styles.body, children })
|
|
2337
2739
|
] });
|
|
2338
2740
|
}
|
|
2339
2741
|
|
|
2340
2742
|
// src/shell/GlobalSearchBar.tsx
|
|
2341
|
-
var
|
|
2342
|
-
var
|
|
2343
|
-
var
|
|
2743
|
+
var import_react_components34 = require("@fluentui/react-components");
|
|
2744
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2745
|
+
var useStyles26 = (0, import_react_components34.makeStyles)({
|
|
2344
2746
|
root: { width: "100%", maxWidth: "640px" }
|
|
2345
2747
|
});
|
|
2346
2748
|
function GlobalSearchBar({
|
|
@@ -2349,9 +2751,9 @@ function GlobalSearchBar({
|
|
|
2349
2751
|
onSubmit,
|
|
2350
2752
|
placeholder = "Search conversations"
|
|
2351
2753
|
}) {
|
|
2352
|
-
const styles =
|
|
2353
|
-
return /* @__PURE__ */ (0,
|
|
2354
|
-
|
|
2754
|
+
const styles = useStyles26();
|
|
2755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2756
|
+
import_react_components34.SearchBox,
|
|
2355
2757
|
{
|
|
2356
2758
|
className: styles.root,
|
|
2357
2759
|
value,
|
|
@@ -2366,86 +2768,86 @@ function GlobalSearchBar({
|
|
|
2366
2768
|
}
|
|
2367
2769
|
|
|
2368
2770
|
// src/grounding/CitationChip.tsx
|
|
2369
|
-
var
|
|
2370
|
-
var
|
|
2371
|
-
var
|
|
2771
|
+
var import_react_components35 = require("@fluentui/react-components");
|
|
2772
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2773
|
+
var useStyles27 = (0, import_react_components35.makeStyles)({
|
|
2372
2774
|
chip: {
|
|
2373
2775
|
display: "inline-flex",
|
|
2374
2776
|
alignItems: "center",
|
|
2375
2777
|
justifyContent: "center",
|
|
2376
2778
|
minWidth: "18px",
|
|
2377
2779
|
height: "18px",
|
|
2378
|
-
padding: `0 ${
|
|
2780
|
+
padding: `0 ${import_react_components35.tokens.spacingHorizontalXXS}`,
|
|
2379
2781
|
marginLeft: "2px",
|
|
2380
2782
|
verticalAlign: "super",
|
|
2381
|
-
fontSize:
|
|
2783
|
+
fontSize: import_react_components35.tokens.fontSizeBase100,
|
|
2382
2784
|
lineHeight: "18px",
|
|
2383
|
-
borderRadius:
|
|
2384
|
-
border: `1px solid ${
|
|
2385
|
-
backgroundColor:
|
|
2386
|
-
color:
|
|
2785
|
+
borderRadius: import_react_components35.tokens.borderRadiusSmall,
|
|
2786
|
+
border: `1px solid ${import_react_components35.tokens.colorNeutralStroke2}`,
|
|
2787
|
+
backgroundColor: import_react_components35.tokens.colorNeutralBackground3,
|
|
2788
|
+
color: import_react_components35.tokens.colorNeutralForeground2,
|
|
2387
2789
|
cursor: "pointer",
|
|
2388
|
-
":hover": { backgroundColor:
|
|
2389
|
-
":focus-visible": { outline: `2px solid ${
|
|
2790
|
+
":hover": { backgroundColor: import_react_components35.tokens.colorNeutralBackground3Hover },
|
|
2791
|
+
":focus-visible": { outline: `2px solid ${import_react_components35.tokens.colorStrokeFocus2}`, outlineOffset: "1px" }
|
|
2390
2792
|
},
|
|
2391
2793
|
inert: { cursor: "default" }
|
|
2392
2794
|
});
|
|
2393
2795
|
function CitationChip({ marker, source, onOpen }) {
|
|
2394
|
-
const styles =
|
|
2796
|
+
const styles = useStyles27();
|
|
2395
2797
|
const label = source ? `Source ${marker}: ${source.title}` : `Source ${marker}`;
|
|
2396
2798
|
if (!source || !onOpen) {
|
|
2397
|
-
return /* @__PURE__ */ (0,
|
|
2799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: `${styles.chip} ${styles.inert}`, "aria-label": label, children: marker });
|
|
2398
2800
|
}
|
|
2399
|
-
return /* @__PURE__ */ (0,
|
|
2801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react_components35.Tooltip, { content: source.title, relationship: "description", withArrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("button", { type: "button", className: styles.chip, "aria-label": label, onClick: () => onOpen(source), children: marker }) });
|
|
2400
2802
|
}
|
|
2401
2803
|
|
|
2402
2804
|
// src/grounding/CitationList.tsx
|
|
2403
|
-
var
|
|
2404
|
-
var
|
|
2805
|
+
var React20 = __toESM(require("react"), 1);
|
|
2806
|
+
var import_react_components37 = require("@fluentui/react-components");
|
|
2405
2807
|
|
|
2406
2808
|
// src/grounding/SourceCard.tsx
|
|
2407
|
-
var
|
|
2408
|
-
var
|
|
2409
|
-
var
|
|
2809
|
+
var import_react_components36 = require("@fluentui/react-components");
|
|
2810
|
+
var import_react_icons12 = require("@fluentui/react-icons");
|
|
2811
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2410
2812
|
var ICONS = {
|
|
2411
|
-
dataverse:
|
|
2412
|
-
document:
|
|
2413
|
-
web:
|
|
2414
|
-
knowledge:
|
|
2415
|
-
other:
|
|
2813
|
+
dataverse: import_react_icons12.DatabaseRegular,
|
|
2814
|
+
document: import_react_icons12.DocumentRegular,
|
|
2815
|
+
web: import_react_icons12.GlobeRegular,
|
|
2816
|
+
knowledge: import_react_icons12.BookRegular,
|
|
2817
|
+
other: import_react_icons12.DocumentBulletListRegular
|
|
2416
2818
|
};
|
|
2417
|
-
var
|
|
2418
|
-
root: { gap:
|
|
2419
|
-
head: { display: "flex", alignItems: "center", gap:
|
|
2420
|
-
marker: { color:
|
|
2421
|
-
snippet: { color:
|
|
2422
|
-
meta: { display: "flex", alignItems: "center", gap:
|
|
2819
|
+
var useStyles28 = (0, import_react_components36.makeStyles)({
|
|
2820
|
+
root: { gap: import_react_components36.tokens.spacingVerticalXXS },
|
|
2821
|
+
head: { display: "flex", alignItems: "center", gap: import_react_components36.tokens.spacingHorizontalXS },
|
|
2822
|
+
marker: { color: import_react_components36.tokens.colorNeutralForeground3, fontSize: import_react_components36.tokens.fontSizeBase200 },
|
|
2823
|
+
snippet: { color: import_react_components36.tokens.colorNeutralForeground2, fontSize: import_react_components36.tokens.fontSizeBase200 },
|
|
2824
|
+
meta: { display: "flex", alignItems: "center", gap: import_react_components36.tokens.spacingHorizontalS, marginTop: import_react_components36.tokens.spacingVerticalXXS }
|
|
2423
2825
|
});
|
|
2424
2826
|
function SourceCard({ source, marker, onOpen, showSnippet = true }) {
|
|
2425
|
-
const styles =
|
|
2827
|
+
const styles = useStyles28();
|
|
2426
2828
|
const Icon = ICONS[source.kind] ?? ICONS.other;
|
|
2427
|
-
return /* @__PURE__ */ (0,
|
|
2428
|
-
/* @__PURE__ */ (0,
|
|
2429
|
-
/* @__PURE__ */ (0,
|
|
2430
|
-
marker ? /* @__PURE__ */ (0,
|
|
2829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(CardSurface, { className: styles.root, children: [
|
|
2830
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: styles.head, children: [
|
|
2831
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Icon, { "aria-hidden": "true" }),
|
|
2832
|
+
marker ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: styles.marker, children: [
|
|
2431
2833
|
"[",
|
|
2432
2834
|
marker,
|
|
2433
2835
|
"]"
|
|
2434
2836
|
] }) : null,
|
|
2435
|
-
/* @__PURE__ */ (0,
|
|
2837
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_components36.Text, { weight: "semibold", children: source.title })
|
|
2436
2838
|
] }),
|
|
2437
|
-
showSnippet && source.snippet ? /* @__PURE__ */ (0,
|
|
2438
|
-
/* @__PURE__ */ (0,
|
|
2439
|
-
onOpen && (source.recordId || source.url) ? /* @__PURE__ */ (0,
|
|
2440
|
-
/* @__PURE__ */ (0,
|
|
2839
|
+
showSnippet && source.snippet ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: styles.snippet, children: source.snippet }) : null,
|
|
2840
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: styles.meta, children: [
|
|
2841
|
+
onOpen && (source.recordId || source.url) ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_components36.Button, { size: "small", appearance: "subtle", onClick: () => onOpen(source), children: source.recordId ? "Open record" : "Open" }) : null,
|
|
2842
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: styles.snippet, children: source.score === void 0 ? "Relevance not reported" : `Relevance ${Math.round(source.score * 100)}%` })
|
|
2441
2843
|
] })
|
|
2442
2844
|
] });
|
|
2443
2845
|
}
|
|
2444
2846
|
|
|
2445
2847
|
// src/grounding/CitationList.tsx
|
|
2446
|
-
var
|
|
2447
|
-
var
|
|
2448
|
-
list: { display: "flex", flexDirection: "column", gap:
|
|
2848
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2849
|
+
var useStyles29 = (0, import_react_components37.makeStyles)({
|
|
2850
|
+
list: { display: "flex", flexDirection: "column", gap: import_react_components37.tokens.spacingVerticalXS, listStyle: "none", margin: 0, padding: 0 }
|
|
2449
2851
|
});
|
|
2450
2852
|
function CitationList({
|
|
2451
2853
|
text,
|
|
@@ -2453,38 +2855,38 @@ function CitationList({
|
|
|
2453
2855
|
onOpenSource,
|
|
2454
2856
|
defaultOpen = false
|
|
2455
2857
|
}) {
|
|
2456
|
-
const styles =
|
|
2457
|
-
const id =
|
|
2458
|
-
const { used, citations } =
|
|
2858
|
+
const styles = useStyles29();
|
|
2859
|
+
const id = React20.useId();
|
|
2860
|
+
const { used, citations } = React20.useMemo(() => renumberCitations(text, sources), [text, sources]);
|
|
2459
2861
|
if (used.length === 0) return null;
|
|
2460
2862
|
const markerFor = (sourceId) => citations.find((c) => c.sourceId === sourceId)?.marker;
|
|
2461
|
-
return /* @__PURE__ */ (0,
|
|
2863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2462
2864
|
Disclosure,
|
|
2463
2865
|
{
|
|
2464
2866
|
id,
|
|
2465
2867
|
defaultOpen,
|
|
2466
2868
|
summary: `${used.length} source${used.length === 1 ? "" : "s"}`,
|
|
2467
|
-
children: /* @__PURE__ */ (0,
|
|
2869
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("ul", { className: styles.list, children: used.map((source) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SourceCard, { source, marker: markerFor(source.id), onOpen: onOpenSource }) }, source.id)) })
|
|
2468
2870
|
}
|
|
2469
2871
|
);
|
|
2470
2872
|
}
|
|
2471
2873
|
|
|
2472
2874
|
// src/grounding/AnswerWithCitations.tsx
|
|
2473
|
-
var
|
|
2474
|
-
var
|
|
2475
|
-
var
|
|
2476
|
-
var
|
|
2875
|
+
var React21 = __toESM(require("react"), 1);
|
|
2876
|
+
var import_react_components38 = require("@fluentui/react-components");
|
|
2877
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2878
|
+
var useStyles30 = (0, import_react_components38.makeStyles)({ root: { whiteSpace: "pre-wrap", wordBreak: "break-word" } });
|
|
2477
2879
|
function AnswerWithCitations({
|
|
2478
2880
|
text,
|
|
2479
2881
|
citations = [],
|
|
2480
2882
|
sources = [],
|
|
2481
2883
|
onOpenSource
|
|
2482
2884
|
}) {
|
|
2483
|
-
const styles =
|
|
2484
|
-
const segments =
|
|
2485
|
-
const byId =
|
|
2486
|
-
return /* @__PURE__ */ (0,
|
|
2487
|
-
(segment, i) => segment.kind === "text" ? /* @__PURE__ */ (0,
|
|
2885
|
+
const styles = useStyles30();
|
|
2886
|
+
const segments = React21.useMemo(() => splitTextByCitations(text, citations), [text, citations]);
|
|
2887
|
+
const byId = React21.useMemo(() => new Map(sources.map((s) => [s.id, s])), [sources]);
|
|
2888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: styles.root, children: segments.map(
|
|
2889
|
+
(segment, i) => segment.kind === "text" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(React21.Fragment, { children: segment.text }, i) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2488
2890
|
CitationChip,
|
|
2489
2891
|
{
|
|
2490
2892
|
marker: segment.marker ?? "",
|
|
@@ -2497,20 +2899,20 @@ function AnswerWithCitations({
|
|
|
2497
2899
|
}
|
|
2498
2900
|
|
|
2499
2901
|
// src/grounding/GroundingPanel.tsx
|
|
2500
|
-
var
|
|
2501
|
-
var
|
|
2502
|
-
var
|
|
2503
|
-
var
|
|
2902
|
+
var React22 = __toESM(require("react"), 1);
|
|
2903
|
+
var import_react_components39 = require("@fluentui/react-components");
|
|
2904
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2905
|
+
var useStyles31 = (0, import_react_components39.makeStyles)({
|
|
2504
2906
|
grid: {
|
|
2505
2907
|
display: "grid",
|
|
2506
2908
|
gridTemplateColumns: "minmax(96px, max-content) 1fr",
|
|
2507
|
-
gap: `${
|
|
2909
|
+
gap: `${import_react_components39.tokens.spacingVerticalXXS} ${import_react_components39.tokens.spacingHorizontalM}`,
|
|
2508
2910
|
margin: 0,
|
|
2509
|
-
fontSize:
|
|
2911
|
+
fontSize: import_react_components39.tokens.fontSizeBase200
|
|
2510
2912
|
},
|
|
2511
|
-
key: { color:
|
|
2512
|
-
value: { margin: 0, wordBreak: "break-word", fontFamily:
|
|
2513
|
-
empty: { fontSize:
|
|
2913
|
+
key: { color: import_react_components39.tokens.colorNeutralForeground3, margin: 0 },
|
|
2914
|
+
value: { margin: 0, wordBreak: "break-word", fontFamily: import_react_components39.tokens.fontFamilyMonospace },
|
|
2915
|
+
empty: { fontSize: import_react_components39.tokens.fontSizeBase200, color: import_react_components39.tokens.colorNeutralForeground3 }
|
|
2514
2916
|
});
|
|
2515
2917
|
function render(value) {
|
|
2516
2918
|
if (value === null || value === void 0) return "\u2014";
|
|
@@ -2522,45 +2924,45 @@ function GroundingPanel({
|
|
|
2522
2924
|
title = "What this answer used",
|
|
2523
2925
|
defaultOpen = false
|
|
2524
2926
|
}) {
|
|
2525
|
-
const styles =
|
|
2526
|
-
const id =
|
|
2927
|
+
const styles = useStyles31();
|
|
2928
|
+
const id = React22.useId();
|
|
2527
2929
|
const entries = Object.entries(grounding ?? {});
|
|
2528
2930
|
if (entries.length === 0) return null;
|
|
2529
|
-
return /* @__PURE__ */ (0,
|
|
2530
|
-
/* @__PURE__ */ (0,
|
|
2531
|
-
/* @__PURE__ */ (0,
|
|
2532
|
-
/* @__PURE__ */ (0,
|
|
2931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Disclosure, { id, defaultOpen, summary: title, children: [
|
|
2932
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("dl", { className: styles.grid, children: entries.map(([key, value]) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(React22.Fragment, { children: [
|
|
2933
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("dt", { className: styles.key, children: key }),
|
|
2934
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("dd", { className: styles.value, children: render(value) })
|
|
2533
2935
|
] }, key)) }),
|
|
2534
|
-
/* @__PURE__ */ (0,
|
|
2936
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react_components39.Text, { as: "p", className: styles.empty, children: "These facts were supplied by the app, not produced by the model." })
|
|
2535
2937
|
] });
|
|
2536
2938
|
}
|
|
2537
2939
|
|
|
2538
2940
|
// src/grounding/ProviderAttribution.tsx
|
|
2539
|
-
var
|
|
2540
|
-
var
|
|
2541
|
-
var
|
|
2542
|
-
var
|
|
2941
|
+
var import_react_components40 = require("@fluentui/react-components");
|
|
2942
|
+
var import_react_icons13 = require("@fluentui/react-icons");
|
|
2943
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2944
|
+
var useStyles32 = (0, import_react_components40.makeStyles)({
|
|
2543
2945
|
root: {
|
|
2544
2946
|
display: "flex",
|
|
2545
2947
|
alignItems: "center",
|
|
2546
|
-
gap:
|
|
2547
|
-
fontSize:
|
|
2548
|
-
color:
|
|
2948
|
+
gap: import_react_components40.tokens.spacingHorizontalXXS,
|
|
2949
|
+
fontSize: import_react_components40.tokens.fontSizeBase100,
|
|
2950
|
+
color: import_react_components40.tokens.colorNeutralForeground3
|
|
2549
2951
|
},
|
|
2550
|
-
guarded: { color:
|
|
2952
|
+
guarded: { color: import_react_components40.tokens.colorPaletteDarkOrangeForeground1 }
|
|
2551
2953
|
});
|
|
2552
2954
|
function ProviderAttribution({ provider, model, guarded }) {
|
|
2553
|
-
const styles =
|
|
2955
|
+
const styles = useStyles32();
|
|
2554
2956
|
if (!provider && !model && !guarded) return null;
|
|
2555
2957
|
const who = [provider, model].filter(Boolean).join(" \xB7 ");
|
|
2556
2958
|
if (guarded) {
|
|
2557
|
-
return /* @__PURE__ */ (0,
|
|
2558
|
-
/* @__PURE__ */ (0,
|
|
2959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { className: `${styles.root} ${styles.guarded}`, children: [
|
|
2960
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react_icons13.ShieldErrorRegular, { "aria-hidden": "true" }),
|
|
2559
2961
|
"Withheld and replaced with safe text",
|
|
2560
2962
|
who ? ` \u2014 not ${who}'s words` : ""
|
|
2561
2963
|
] });
|
|
2562
2964
|
}
|
|
2563
|
-
return /* @__PURE__ */ (0,
|
|
2965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { className: styles.root, children: [
|
|
2564
2966
|
"Answered by ",
|
|
2565
2967
|
who || "the agent"
|
|
2566
2968
|
] });
|
|
@@ -2570,57 +2972,57 @@ function messageAttribution(message) {
|
|
|
2570
2972
|
}
|
|
2571
2973
|
|
|
2572
2974
|
// src/actions/ActionCard.tsx
|
|
2573
|
-
var
|
|
2574
|
-
var
|
|
2575
|
-
var
|
|
2576
|
-
var
|
|
2577
|
-
head: { display: "flex", alignItems: "center", gap:
|
|
2578
|
-
description: { color:
|
|
2579
|
-
footer: { display: "flex", gap:
|
|
2975
|
+
var React23 = __toESM(require("react"), 1);
|
|
2976
|
+
var import_react_components41 = require("@fluentui/react-components");
|
|
2977
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2978
|
+
var useStyles33 = (0, import_react_components41.makeStyles)({
|
|
2979
|
+
head: { display: "flex", alignItems: "center", gap: import_react_components41.tokens.spacingHorizontalXS },
|
|
2980
|
+
description: { color: import_react_components41.tokens.colorNeutralForeground2, fontSize: import_react_components41.tokens.fontSizeBase200 },
|
|
2981
|
+
footer: { display: "flex", gap: import_react_components41.tokens.spacingHorizontalS, justifyContent: "flex-end", marginTop: import_react_components41.tokens.spacingVerticalXS }
|
|
2580
2982
|
});
|
|
2581
2983
|
function ActionCard({ title, description, icon, pending, children, footer }) {
|
|
2582
|
-
const styles =
|
|
2583
|
-
return /* @__PURE__ */ (0,
|
|
2584
|
-
/* @__PURE__ */ (0,
|
|
2585
|
-
icon ?
|
|
2586
|
-
/* @__PURE__ */ (0,
|
|
2984
|
+
const styles = useStyles33();
|
|
2985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(CardSurface, { emphasis: pending ? "attention" : "none", children: [
|
|
2986
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: styles.head, children: [
|
|
2987
|
+
icon ? React23.cloneElement(icon, { "aria-hidden": "true" }) : null,
|
|
2988
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react_components41.Text, { weight: "semibold", children: title })
|
|
2587
2989
|
] }),
|
|
2588
|
-
description ? /* @__PURE__ */ (0,
|
|
2990
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: styles.description, children: description }) : null,
|
|
2589
2991
|
children,
|
|
2590
|
-
footer ? /* @__PURE__ */ (0,
|
|
2992
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: styles.footer, children: footer }) : null
|
|
2591
2993
|
] });
|
|
2592
2994
|
}
|
|
2593
2995
|
|
|
2594
2996
|
// src/actions/ApprovalCard.tsx
|
|
2595
|
-
var
|
|
2596
|
-
var
|
|
2597
|
-
var
|
|
2997
|
+
var React25 = __toESM(require("react"), 1);
|
|
2998
|
+
var import_react_components44 = require("@fluentui/react-components");
|
|
2999
|
+
var import_react_icons14 = require("@fluentui/react-icons");
|
|
2598
3000
|
|
|
2599
3001
|
// src/actions/ParameterReview.tsx
|
|
2600
|
-
var
|
|
2601
|
-
var
|
|
2602
|
-
var
|
|
2603
|
-
var
|
|
3002
|
+
var React24 = __toESM(require("react"), 1);
|
|
3003
|
+
var import_react_components42 = require("@fluentui/react-components");
|
|
3004
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3005
|
+
var useStyles34 = (0, import_react_components42.makeStyles)({
|
|
2604
3006
|
grid: {
|
|
2605
3007
|
display: "grid",
|
|
2606
3008
|
gridTemplateColumns: "minmax(110px, max-content) 1fr",
|
|
2607
|
-
gap: `${
|
|
3009
|
+
gap: `${import_react_components42.tokens.spacingVerticalXS} ${import_react_components42.tokens.spacingHorizontalM}`,
|
|
2608
3010
|
alignItems: "center",
|
|
2609
3011
|
margin: 0
|
|
2610
3012
|
},
|
|
2611
|
-
key: { margin: 0, color:
|
|
3013
|
+
key: { margin: 0, color: import_react_components42.tokens.colorNeutralForeground2, fontSize: import_react_components42.tokens.fontSizeBase200 },
|
|
2612
3014
|
value: { margin: 0 },
|
|
2613
3015
|
raw: {
|
|
2614
3016
|
whiteSpace: "pre-wrap",
|
|
2615
3017
|
wordBreak: "break-all",
|
|
2616
|
-
fontFamily:
|
|
2617
|
-
fontSize:
|
|
2618
|
-
color:
|
|
3018
|
+
fontFamily: import_react_components42.tokens.fontFamilyMonospace,
|
|
3019
|
+
fontSize: import_react_components42.tokens.fontSizeBase200,
|
|
3020
|
+
color: import_react_components42.tokens.colorNeutralForeground2
|
|
2619
3021
|
}
|
|
2620
3022
|
});
|
|
2621
3023
|
function ParameterReview({ argumentsJson, readOnly = true, onChange }) {
|
|
2622
|
-
const styles =
|
|
2623
|
-
const parsed =
|
|
3024
|
+
const styles = useStyles34();
|
|
3025
|
+
const parsed = React24.useMemo(() => {
|
|
2624
3026
|
try {
|
|
2625
3027
|
const value = JSON.parse(argumentsJson);
|
|
2626
3028
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
@@ -2629,19 +3031,19 @@ function ParameterReview({ argumentsJson, readOnly = true, onChange }) {
|
|
|
2629
3031
|
}
|
|
2630
3032
|
}, [argumentsJson]);
|
|
2631
3033
|
if (!parsed) {
|
|
2632
|
-
return /* @__PURE__ */ (0,
|
|
2633
|
-
/* @__PURE__ */ (0,
|
|
2634
|
-
/* @__PURE__ */ (0,
|
|
3034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { children: [
|
|
3035
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_react_components42.Text, { size: 200, children: "Arguments (unparsed)" }),
|
|
3036
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("pre", { className: styles.raw, children: argumentsJson || "(empty)" })
|
|
2635
3037
|
] });
|
|
2636
3038
|
}
|
|
2637
3039
|
const set = (key, next) => {
|
|
2638
3040
|
if (!onChange) return;
|
|
2639
3041
|
onChange(JSON.stringify({ ...parsed, [key]: next }));
|
|
2640
3042
|
};
|
|
2641
|
-
return /* @__PURE__ */ (0,
|
|
2642
|
-
/* @__PURE__ */ (0,
|
|
2643
|
-
/* @__PURE__ */ (0,
|
|
2644
|
-
|
|
3043
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("dl", { className: styles.grid, children: Object.entries(parsed).map(([key, value]) => /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(React24.Fragment, { children: [
|
|
3044
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("dt", { className: styles.key, children: key }),
|
|
3045
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("dd", { className: styles.value, children: readOnly ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: styles.raw, children: typeof value === "string" ? value : JSON.stringify(value) }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3046
|
+
import_react_components42.Input,
|
|
2645
3047
|
{
|
|
2646
3048
|
size: "small",
|
|
2647
3049
|
"aria-label": key,
|
|
@@ -2653,32 +3055,32 @@ function ParameterReview({ argumentsJson, readOnly = true, onChange }) {
|
|
|
2653
3055
|
}
|
|
2654
3056
|
|
|
2655
3057
|
// src/actions/ActionResult.tsx
|
|
2656
|
-
var
|
|
2657
|
-
var
|
|
3058
|
+
var import_react_components43 = require("@fluentui/react-components");
|
|
3059
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2658
3060
|
var INTENT2 = { succeeded: "success", failed: "error", denied: "warning" };
|
|
2659
3061
|
var TITLE = { succeeded: "Done", failed: "Failed", denied: "Not approved" };
|
|
2660
|
-
var
|
|
2661
|
-
id: { display: "block", marginTop:
|
|
3062
|
+
var useStyles35 = (0, import_react_components43.makeStyles)({
|
|
3063
|
+
id: { display: "block", marginTop: import_react_components43.tokens.spacingVerticalXXS, fontSize: import_react_components43.tokens.fontSizeBase100, color: import_react_components43.tokens.colorNeutralForeground3, fontFamily: import_react_components43.tokens.fontFamilyMonospace }
|
|
2662
3064
|
});
|
|
2663
3065
|
function ActionResult({ status, message, correlationId, onRetry }) {
|
|
2664
|
-
const styles =
|
|
2665
|
-
return /* @__PURE__ */ (0,
|
|
2666
|
-
/* @__PURE__ */ (0,
|
|
2667
|
-
/* @__PURE__ */ (0,
|
|
3066
|
+
const styles = useStyles35();
|
|
3067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react_components43.MessageBar, { intent: INTENT2[status], children: [
|
|
3068
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react_components43.MessageBarBody, { children: [
|
|
3069
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_components43.MessageBarTitle, { children: TITLE[status] }),
|
|
2668
3070
|
message,
|
|
2669
|
-
correlationId ? /* @__PURE__ */ (0,
|
|
3071
|
+
correlationId ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", { className: styles.id, children: [
|
|
2670
3072
|
"Correlation id: ",
|
|
2671
3073
|
correlationId
|
|
2672
3074
|
] }) : null
|
|
2673
3075
|
] }),
|
|
2674
|
-
status === "failed" && onRetry ? /* @__PURE__ */ (0,
|
|
3076
|
+
status === "failed" && onRetry ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_components43.MessageBarActions, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_components43.Button, { size: "small", onClick: onRetry, children: "Try again" }) }) : null
|
|
2675
3077
|
] });
|
|
2676
3078
|
}
|
|
2677
3079
|
|
|
2678
3080
|
// src/actions/ApprovalCard.tsx
|
|
2679
|
-
var
|
|
2680
|
-
var
|
|
2681
|
-
busy: { display: "flex", alignItems: "center", gap:
|
|
3081
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3082
|
+
var useStyles36 = (0, import_react_components44.makeStyles)({
|
|
3083
|
+
busy: { display: "flex", alignItems: "center", gap: import_react_components44.tokens.spacingHorizontalXS, fontSize: import_react_components44.tokens.fontSizeBase200 }
|
|
2682
3084
|
});
|
|
2683
3085
|
function ApprovalCard({
|
|
2684
3086
|
toolCall,
|
|
@@ -2687,15 +3089,15 @@ function ApprovalCard({
|
|
|
2687
3089
|
allowEdit = false,
|
|
2688
3090
|
busy = false
|
|
2689
3091
|
}) {
|
|
2690
|
-
const styles =
|
|
2691
|
-
const [args, setArgs] =
|
|
2692
|
-
const [editing, setEditing] =
|
|
2693
|
-
const [decided, setDecided] =
|
|
3092
|
+
const styles = useStyles36();
|
|
3093
|
+
const [args, setArgs] = React25.useState(toolCall.argumentsJson);
|
|
3094
|
+
const [editing, setEditing] = React25.useState(false);
|
|
3095
|
+
const [decided, setDecided] = React25.useState(false);
|
|
2694
3096
|
const settled = toolCall.status === "succeeded" || toolCall.status === "failed" || toolCall.status === "denied";
|
|
2695
3097
|
if (settled) {
|
|
2696
|
-
return /* @__PURE__ */ (0,
|
|
2697
|
-
/* @__PURE__ */ (0,
|
|
2698
|
-
/* @__PURE__ */ (0,
|
|
3098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(ActionCard, { title: toolCall.name, description: "Tool call", children: [
|
|
3099
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ParameterReview, { argumentsJson: toolCall.argumentsJson }),
|
|
3100
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
2699
3101
|
ActionResult,
|
|
2700
3102
|
{
|
|
2701
3103
|
status: toolCall.status === "succeeded" ? "succeeded" : toolCall.status === "denied" ? "denied" : "failed",
|
|
@@ -2716,29 +3118,29 @@ function ApprovalCard({
|
|
|
2716
3118
|
setDecided(true);
|
|
2717
3119
|
onDeny(toolCall);
|
|
2718
3120
|
};
|
|
2719
|
-
return /* @__PURE__ */ (0,
|
|
3121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
2720
3122
|
ActionCard,
|
|
2721
3123
|
{
|
|
2722
3124
|
title: toolCall.name,
|
|
2723
3125
|
description: "The agent is asking to run this. Check the details before approving.",
|
|
2724
3126
|
pending: !locked,
|
|
2725
|
-
footer: locked ? /* @__PURE__ */ (0,
|
|
2726
|
-
/* @__PURE__ */ (0,
|
|
3127
|
+
footer: locked ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { className: styles.busy, children: [
|
|
3128
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react_components44.Spinner, { size: "tiny" }),
|
|
2727
3129
|
" Submitting\u2026"
|
|
2728
|
-
] }) : /* @__PURE__ */ (0,
|
|
2729
|
-
allowEdit ? /* @__PURE__ */ (0,
|
|
2730
|
-
/* @__PURE__ */ (0,
|
|
2731
|
-
/* @__PURE__ */ (0,
|
|
3130
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
3131
|
+
allowEdit ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react_components44.Button, { size: "small", icon: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react_icons14.EditRegular, {}), onClick: () => setEditing((v) => !v), children: editing ? "Done editing" : "Edit" }) : null,
|
|
3132
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react_components44.Button, { size: "small", icon: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react_icons14.DismissRegular, {}), onClick: deny, disabled: locked, children: "Deny" }),
|
|
3133
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react_components44.Button, { size: "small", appearance: "primary", icon: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react_icons14.CheckmarkRegular, {}), onClick: approve, disabled: locked, children: "Approve" })
|
|
2732
3134
|
] }),
|
|
2733
|
-
children: /* @__PURE__ */ (0,
|
|
3135
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ParameterReview, { argumentsJson: args, readOnly: !editing, onChange: setArgs })
|
|
2734
3136
|
}
|
|
2735
3137
|
);
|
|
2736
3138
|
}
|
|
2737
3139
|
|
|
2738
3140
|
// src/actions/ToolCallCard.tsx
|
|
2739
|
-
var
|
|
2740
|
-
var
|
|
2741
|
-
var
|
|
3141
|
+
var React26 = __toESM(require("react"), 1);
|
|
3142
|
+
var import_react_components45 = require("@fluentui/react-components");
|
|
3143
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2742
3144
|
var LABEL = {
|
|
2743
3145
|
proposed: "Proposed",
|
|
2744
3146
|
running: "Running",
|
|
@@ -2753,42 +3155,42 @@ var COLOUR = {
|
|
|
2753
3155
|
failed: "danger",
|
|
2754
3156
|
denied: "warning"
|
|
2755
3157
|
};
|
|
2756
|
-
var
|
|
2757
|
-
head: { display: "flex", alignItems: "center", gap:
|
|
2758
|
-
name: { fontFamily:
|
|
3158
|
+
var useStyles37 = (0, import_react_components45.makeStyles)({
|
|
3159
|
+
head: { display: "flex", alignItems: "center", gap: import_react_components45.tokens.spacingHorizontalXS },
|
|
3160
|
+
name: { fontFamily: import_react_components45.tokens.fontFamilyMonospace, fontSize: import_react_components45.tokens.fontSizeBase200 },
|
|
2759
3161
|
result: {
|
|
2760
3162
|
whiteSpace: "pre-wrap",
|
|
2761
3163
|
wordBreak: "break-all",
|
|
2762
|
-
fontFamily:
|
|
2763
|
-
fontSize:
|
|
2764
|
-
marginTop:
|
|
3164
|
+
fontFamily: import_react_components45.tokens.fontFamilyMonospace,
|
|
3165
|
+
fontSize: import_react_components45.tokens.fontSizeBase200,
|
|
3166
|
+
marginTop: import_react_components45.tokens.spacingVerticalXS
|
|
2765
3167
|
}
|
|
2766
3168
|
});
|
|
2767
3169
|
function ToolCallCard({ toolCall, defaultExpanded = false }) {
|
|
2768
|
-
const styles =
|
|
2769
|
-
const id =
|
|
2770
|
-
return /* @__PURE__ */ (0,
|
|
3170
|
+
const styles = useStyles37();
|
|
3171
|
+
const id = React26.useId();
|
|
3172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(CardSurface, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
2771
3173
|
Disclosure,
|
|
2772
3174
|
{
|
|
2773
3175
|
id,
|
|
2774
3176
|
defaultOpen: defaultExpanded,
|
|
2775
|
-
summary: /* @__PURE__ */ (0,
|
|
2776
|
-
/* @__PURE__ */ (0,
|
|
2777
|
-
/* @__PURE__ */ (0,
|
|
2778
|
-
toolCall.status === "running" ? /* @__PURE__ */ (0,
|
|
3177
|
+
summary: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("span", { className: styles.head, children: [
|
|
3178
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: styles.name, children: toolCall.name }),
|
|
3179
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react_components45.Badge, { appearance: "tint", color: COLOUR[toolCall.status], children: LABEL[toolCall.status] }),
|
|
3180
|
+
toolCall.status === "running" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react_components45.Spinner, { size: "extra-tiny" }) : null
|
|
2779
3181
|
] }),
|
|
2780
3182
|
children: [
|
|
2781
|
-
/* @__PURE__ */ (0,
|
|
2782
|
-
toolCall.resultText ? /* @__PURE__ */ (0,
|
|
2783
|
-
toolCall.failure ? /* @__PURE__ */ (0,
|
|
3183
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ParameterReview, { argumentsJson: toolCall.argumentsJson }),
|
|
3184
|
+
toolCall.resultText ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: styles.result, children: toolCall.resultText }) : null,
|
|
3185
|
+
toolCall.failure ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: styles.result, children: toolCall.failure.message }) : null
|
|
2784
3186
|
]
|
|
2785
3187
|
}
|
|
2786
3188
|
) });
|
|
2787
3189
|
}
|
|
2788
3190
|
|
|
2789
3191
|
// src/host/AgentKitHostProvider.tsx
|
|
2790
|
-
var
|
|
2791
|
-
var
|
|
3192
|
+
var React27 = __toESM(require("react"), 1);
|
|
3193
|
+
var import_react_components46 = require("@fluentui/react-components");
|
|
2792
3194
|
|
|
2793
3195
|
// src/theme/index.ts
|
|
2794
3196
|
var import_fluent_theme = require("@dataverse-kit/fluent-theme");
|
|
@@ -2820,17 +3222,17 @@ function resolveHostTheme(input = {}) {
|
|
|
2820
3222
|
var nextAgentIdPrefix = createIdPrefixCounter("dvkak");
|
|
2821
3223
|
|
|
2822
3224
|
// src/host/AgentKitHostProvider.tsx
|
|
2823
|
-
var
|
|
3225
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
2824
3226
|
function AgentKitHostProvider(props) {
|
|
2825
3227
|
const { children, theme, hostTheme, isDarkTheme, targetDocument, className, style } = props;
|
|
2826
|
-
const [generated] =
|
|
3228
|
+
const [generated] = React27.useState(nextAgentIdPrefix);
|
|
2827
3229
|
const idPrefix = props.idPrefix ?? generated;
|
|
2828
|
-
const resolved =
|
|
3230
|
+
const resolved = React27.useMemo(
|
|
2829
3231
|
() => resolveHostTheme({ theme, hostTheme, isDarkTheme }),
|
|
2830
3232
|
[theme, hostTheme, isDarkTheme]
|
|
2831
3233
|
);
|
|
2832
|
-
return /* @__PURE__ */ (0,
|
|
2833
|
-
|
|
3234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_components46.IdPrefixProvider, { value: idPrefix, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3235
|
+
import_react_components46.FluentProvider,
|
|
2834
3236
|
{
|
|
2835
3237
|
theme: resolved,
|
|
2836
3238
|
targetDocument,
|
|
@@ -3139,12 +3541,14 @@ function createAgentService(config = { provider: "none" }) {
|
|
|
3139
3541
|
AgentAppShell,
|
|
3140
3542
|
AgentAvatar,
|
|
3141
3543
|
AgentKitHostProvider,
|
|
3544
|
+
AgentLauncher,
|
|
3142
3545
|
AgentOpsPanel,
|
|
3143
3546
|
AgentPicker,
|
|
3144
3547
|
AgentStatusBadge,
|
|
3145
3548
|
AnswerWithCitations,
|
|
3146
3549
|
AppRail,
|
|
3147
3550
|
ApprovalCard,
|
|
3551
|
+
AssistantPanel,
|
|
3148
3552
|
AvailabilityBanner,
|
|
3149
3553
|
CitationChip,
|
|
3150
3554
|
CitationList,
|
|
@@ -3156,6 +3560,7 @@ function createAgentService(config = { provider: "none" }) {
|
|
|
3156
3560
|
DEFAULT_GROUP_WINDOW_MS,
|
|
3157
3561
|
DayDivider,
|
|
3158
3562
|
EmptyConversation,
|
|
3563
|
+
FeedbackPanel,
|
|
3159
3564
|
GlobalSearchBar,
|
|
3160
3565
|
GroundingPanel,
|
|
3161
3566
|
LiveAnnouncer,
|
|
@@ -3217,6 +3622,7 @@ function createAgentService(config = { provider: "none" }) {
|
|
|
3217
3622
|
splitTextByCitations,
|
|
3218
3623
|
useConversation,
|
|
3219
3624
|
useFocusRestore,
|
|
3625
|
+
useReturnFocus,
|
|
3220
3626
|
useRovingTabindex,
|
|
3221
3627
|
useStickyScroll,
|
|
3222
3628
|
useVisuallyHiddenStyles
|