@superinterface/react 3.0.2 → 3.2.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/dist/index.cjs +954 -892
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +89 -90
- package/dist/index.d.ts +89 -90
- package/dist/index.js +893 -831
- package/dist/index.js.map +1 -1
- package/dist/server.cjs.map +1 -1
- package/dist/server.js.map +1 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +5 -1
- package/dist/types/index.d.ts +5 -1
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +27 -18
package/dist/index.js
CHANGED
|
@@ -415,388 +415,15 @@ var SuperinterfaceProvider = function(param) {
|
|
|
415
415
|
};
|
|
416
416
|
// src/components/threads/Thread/Messages/index.tsx
|
|
417
417
|
import { Flex as Flex18 } from "@radix-ui/themes";
|
|
418
|
-
// src/components/threads/Thread/Messages/Content/index.tsx
|
|
419
|
-
import { useEffect as useEffect2 } from "react";
|
|
420
|
-
// src/hooks/messages/useMessages/index.tsx
|
|
421
|
-
import { useMemo } from "react";
|
|
422
|
-
import { useInfiniteQuery, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
|
423
|
-
// src/lib/threads/queryOptions/index.ts
|
|
424
|
-
import { infiniteQueryOptions } from "@tanstack/react-query";
|
|
425
|
-
// src/lib/threads/queryOptions/variableParams.ts
|
|
426
|
-
var variableParams = function(param) {
|
|
427
|
-
var variables = param.variables, superinterfaceContext = param.superinterfaceContext;
|
|
428
|
-
var _superinterfaceContext_threadIdCookieOptions;
|
|
429
|
-
if (variables.threadId) return variables;
|
|
430
|
-
if (!variables.assistantId) return variables;
|
|
431
|
-
if (!((_superinterfaceContext_threadIdCookieOptions = superinterfaceContext.threadIdCookieOptions) === null || _superinterfaceContext_threadIdCookieOptions === void 0 ? void 0 : _superinterfaceContext_threadIdCookieOptions.get)) return variables;
|
|
432
|
-
var threadId = superinterfaceContext.threadIdCookieOptions.get({
|
|
433
|
-
assistantId: variables.assistantId
|
|
434
|
-
});
|
|
435
|
-
if (!threadId) return variables;
|
|
436
|
-
return _object_spread_props(_object_spread({}, variables), {
|
|
437
|
-
threadId: threadId
|
|
438
|
-
});
|
|
439
|
-
};
|
|
440
|
-
// src/lib/threads/queryOptions/index.ts
|
|
441
|
-
var queryOptions = function(param) {
|
|
442
|
-
var queryKeyBase = param.queryKeyBase, path2 = param.path, queryClient = param.queryClient, threadContext = param.threadContext, superinterfaceContext = param.superinterfaceContext;
|
|
443
|
-
var queryKey = _to_consumable_array(queryKeyBase).concat([
|
|
444
|
-
threadContext.variables
|
|
445
|
-
]);
|
|
446
|
-
return infiniteQueryOptions(_object_spread_props(_object_spread({
|
|
447
|
-
// @ts-ignore-next-line
|
|
448
|
-
queryFn: /*#__PURE__*/ function() {
|
|
449
|
-
var _ref = _async_to_generator(function(param) {
|
|
450
|
-
var pageParam, queryKey2, _queryKey2, _key, variables, params;
|
|
451
|
-
return _ts_generator(this, function(_state) {
|
|
452
|
-
pageParam = param.pageParam, queryKey2 = param.queryKey;
|
|
453
|
-
_queryKey2 = _sliced_to_array(queryKey2, 2), _key = _queryKey2[0], variables = _queryKey2[1];
|
|
454
|
-
params = new URLSearchParams(_object_spread({}, pageParam ? {
|
|
455
|
-
pageParam: pageParam
|
|
456
|
-
} : {}, variableParams({
|
|
457
|
-
variables: variables,
|
|
458
|
-
superinterfaceContext: superinterfaceContext
|
|
459
|
-
})));
|
|
460
|
-
return [
|
|
461
|
-
2,
|
|
462
|
-
fetch("".concat(superinterfaceContext.baseUrl).concat(path2, "?").concat(params)).then(/*#__PURE__*/ function() {
|
|
463
|
-
var _ref = _async_to_generator(function(response) {
|
|
464
|
-
var errorResponse, error;
|
|
465
|
-
return _ts_generator(this, function(_state) {
|
|
466
|
-
switch(_state.label){
|
|
467
|
-
case 0:
|
|
468
|
-
if (!(response.status !== 200)) return [
|
|
469
|
-
3,
|
|
470
|
-
4
|
|
471
|
-
];
|
|
472
|
-
_state.label = 1;
|
|
473
|
-
case 1:
|
|
474
|
-
_state.trys.push([
|
|
475
|
-
1,
|
|
476
|
-
3,
|
|
477
|
-
,
|
|
478
|
-
4
|
|
479
|
-
]);
|
|
480
|
-
return [
|
|
481
|
-
4,
|
|
482
|
-
response.json()
|
|
483
|
-
];
|
|
484
|
-
case 2:
|
|
485
|
-
errorResponse = _state.sent();
|
|
486
|
-
throw new Error(errorResponse.error);
|
|
487
|
-
case 3:
|
|
488
|
-
error = _state.sent();
|
|
489
|
-
throw new Error("Failed to fetch");
|
|
490
|
-
case 4:
|
|
491
|
-
return [
|
|
492
|
-
2,
|
|
493
|
-
response.json()
|
|
494
|
-
];
|
|
495
|
-
}
|
|
496
|
-
});
|
|
497
|
-
});
|
|
498
|
-
return function(response) {
|
|
499
|
-
return _ref.apply(this, arguments);
|
|
500
|
-
};
|
|
501
|
-
}())
|
|
502
|
-
];
|
|
503
|
-
});
|
|
504
|
-
});
|
|
505
|
-
return function(_) {
|
|
506
|
-
return _ref.apply(this, arguments);
|
|
507
|
-
};
|
|
508
|
-
}(),
|
|
509
|
-
initialPageParam: void 0,
|
|
510
|
-
getNextPageParam: function(lastPage) {
|
|
511
|
-
if (!lastPage.hasNextPage) return null;
|
|
512
|
-
return lastPage.lastId;
|
|
513
|
-
},
|
|
514
|
-
limit: 10
|
|
515
|
-
}, threadContext.defaultOptions.queries, queryClient.getQueryDefaults(queryKey)), {
|
|
516
|
-
queryKey: queryKey
|
|
517
|
-
}));
|
|
518
|
-
};
|
|
519
|
-
// src/lib/messages/messagesQueryOptions.ts
|
|
520
|
-
var messagesQueryOptions = function(param) {
|
|
521
|
-
var queryClient = param.queryClient, threadContext = param.threadContext, superinterfaceContext = param.superinterfaceContext;
|
|
522
|
-
return queryOptions({
|
|
523
|
-
queryKeyBase: [
|
|
524
|
-
"messages"
|
|
525
|
-
],
|
|
526
|
-
path: "/messages",
|
|
527
|
-
queryClient: queryClient,
|
|
528
|
-
threadContext: threadContext,
|
|
529
|
-
superinterfaceContext: superinterfaceContext
|
|
530
|
-
});
|
|
531
|
-
};
|
|
532
|
-
// src/hooks/messages/useMessages/index.tsx
|
|
533
|
-
var messages = function(param) {
|
|
534
|
-
var props = param.props;
|
|
535
|
-
if (!props.data) return [];
|
|
536
|
-
return props.data.pages.reduce(function(acc, page) {
|
|
537
|
-
return acc.concat(page.data);
|
|
538
|
-
}, []);
|
|
539
|
-
};
|
|
540
|
-
var useMessages = function() {
|
|
541
|
-
var queryClient = useQueryClient2();
|
|
542
|
-
var threadContext = useSuperinterfaceContext();
|
|
543
|
-
var superinterfaceContext = useSuperinterfaceContext();
|
|
544
|
-
var props = useInfiniteQuery(messagesQueryOptions({
|
|
545
|
-
queryClient: queryClient,
|
|
546
|
-
threadContext: threadContext,
|
|
547
|
-
superinterfaceContext: superinterfaceContext
|
|
548
|
-
}));
|
|
549
|
-
return useMemo(function() {
|
|
550
|
-
return _object_spread_props(_object_spread({}, props), {
|
|
551
|
-
// @ts-ignore-next-line
|
|
552
|
-
messages: messages({
|
|
553
|
-
props: props
|
|
554
|
-
})
|
|
555
|
-
});
|
|
556
|
-
}, [
|
|
557
|
-
props
|
|
558
|
-
]);
|
|
559
|
-
};
|
|
560
|
-
// src/hooks/messageGroups/useMessageGroups/index.ts
|
|
561
|
-
import { useMemo as useMemo2 } from "react";
|
|
562
|
-
// src/hooks/messageGroups/useMessageGroups/lib/messageGroups/index.ts
|
|
563
|
-
import _3 from "lodash";
|
|
564
|
-
import { last } from "radash";
|
|
565
|
-
// src/lib/messages/order.ts
|
|
566
|
-
import { sort } from "radash";
|
|
567
|
-
var order = function(param) {
|
|
568
|
-
var messages2 = param.messages;
|
|
569
|
-
return sort(messages2, function(m) {
|
|
570
|
-
return m.created_at;
|
|
571
|
-
}, true);
|
|
572
|
-
};
|
|
573
|
-
// src/hooks/messageGroups/useMessageGroups/lib/messageGroups/newGroup/newGroupItem.ts
|
|
574
|
-
var newGroupItem = function(param) {
|
|
575
|
-
var message = param.message;
|
|
576
|
-
return {
|
|
577
|
-
id: message.id,
|
|
578
|
-
role: message.role,
|
|
579
|
-
createdAt: message.created_at,
|
|
580
|
-
messages: [
|
|
581
|
-
message
|
|
582
|
-
]
|
|
583
|
-
};
|
|
584
|
-
};
|
|
585
|
-
// src/hooks/messageGroups/useMessageGroups/lib/messageGroups/newGroup/index.ts
|
|
586
|
-
var newGroup = function(param) {
|
|
587
|
-
var groups = param.groups, message = param.message;
|
|
588
|
-
return _to_consumable_array(groups).concat([
|
|
589
|
-
newGroupItem({
|
|
590
|
-
message: message
|
|
591
|
-
})
|
|
592
|
-
]);
|
|
593
|
-
};
|
|
594
|
-
// src/hooks/messageGroups/useMessageGroups/lib/messageGroups/index.ts
|
|
595
|
-
var messageGroups = function(param) {
|
|
596
|
-
var messages2 = param.messages;
|
|
597
|
-
return _3.reduce(order({
|
|
598
|
-
messages: messages2
|
|
599
|
-
}), function(groups, message) {
|
|
600
|
-
var group = last(groups);
|
|
601
|
-
if (!group) return newGroup({
|
|
602
|
-
groups: groups,
|
|
603
|
-
message: message
|
|
604
|
-
});
|
|
605
|
-
if (group.role !== message.role) {
|
|
606
|
-
return newGroup({
|
|
607
|
-
groups: groups,
|
|
608
|
-
message: message
|
|
609
|
-
});
|
|
610
|
-
}
|
|
611
|
-
return _to_consumable_array(_3.dropRight(groups)).concat([
|
|
612
|
-
_object_spread_props(_object_spread({}, group), {
|
|
613
|
-
messages: _to_consumable_array(group.messages).concat([
|
|
614
|
-
message
|
|
615
|
-
])
|
|
616
|
-
})
|
|
617
|
-
]);
|
|
618
|
-
}, []);
|
|
619
|
-
};
|
|
620
|
-
// src/hooks/messageGroups/useMessageGroups/index.ts
|
|
621
|
-
var useMessageGroups = function(param) {
|
|
622
|
-
var messages2 = param.messages;
|
|
623
|
-
return useMemo2(function() {
|
|
624
|
-
return {
|
|
625
|
-
messageGroups: messageGroups({
|
|
626
|
-
messages: messages2
|
|
627
|
-
})
|
|
628
|
-
};
|
|
629
|
-
}, [
|
|
630
|
-
messages2
|
|
631
|
-
]);
|
|
632
|
-
};
|
|
633
|
-
// src/components/skeletons/MessagesSkeleton/index.tsx
|
|
634
|
-
import { forwardRef as forwardRef2 } from "react";
|
|
635
|
-
import { Flex as Flex3, Avatar, Box, Skeleton } from "@radix-ui/themes";
|
|
636
|
-
// src/components/messageGroups/MessageGroupBase/index.tsx
|
|
637
|
-
import { forwardRef } from "react";
|
|
638
|
-
import { Flex, Container } from "@radix-ui/themes";
|
|
639
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
640
|
-
var MessageGroupBase = forwardRef(function MessageGroupBase2(param, ref) {
|
|
641
|
-
var children = param.children;
|
|
642
|
-
return /* @__PURE__ */ jsx2(Container, {
|
|
643
|
-
ref: ref,
|
|
644
|
-
size: "2",
|
|
645
|
-
flexGrow: "0",
|
|
646
|
-
children: /* @__PURE__ */ jsx2(Flex, {
|
|
647
|
-
flexShrink: "0",
|
|
648
|
-
gap: "3",
|
|
649
|
-
children: children
|
|
650
|
-
})
|
|
651
|
-
});
|
|
652
|
-
});
|
|
653
|
-
// src/components/messageGroups/MessageGroupBase/Name.tsx
|
|
654
|
-
import { Flex as Flex2, Text } from "@radix-ui/themes";
|
|
655
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
656
|
-
var Name = function(param) {
|
|
657
|
-
var children = param.children;
|
|
658
|
-
return /* @__PURE__ */ jsx3(Flex2, {
|
|
659
|
-
align: "center",
|
|
660
|
-
height: "var(--space-5)",
|
|
661
|
-
children: /* @__PURE__ */ jsx3(Text, {
|
|
662
|
-
size: "2",
|
|
663
|
-
weight: "bold",
|
|
664
|
-
children: children
|
|
665
|
-
})
|
|
666
|
-
});
|
|
667
|
-
};
|
|
668
|
-
// src/components/skeletons/MessagesSkeleton/index.tsx
|
|
669
|
-
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
670
|
-
var MessagesSkeleton = forwardRef2(function MessagesSkeleton2(_props, ref) {
|
|
671
|
-
return /* @__PURE__ */ jsxs(MessageGroupBase, {
|
|
672
|
-
ref: ref,
|
|
673
|
-
children: [
|
|
674
|
-
/* @__PURE__ */ jsx4(Skeleton, {
|
|
675
|
-
loading: true,
|
|
676
|
-
children: /* @__PURE__ */ jsx4(Avatar, {
|
|
677
|
-
fallback: /* @__PURE__ */ jsx4(Flex3, {}),
|
|
678
|
-
size: "1"
|
|
679
|
-
})
|
|
680
|
-
}),
|
|
681
|
-
/* @__PURE__ */ jsxs(Box, {
|
|
682
|
-
pb: "3",
|
|
683
|
-
children: [
|
|
684
|
-
/* @__PURE__ */ jsx4(Name, {
|
|
685
|
-
children: /* @__PURE__ */ jsx4(Skeleton, {
|
|
686
|
-
loading: true,
|
|
687
|
-
style: {
|
|
688
|
-
width: "128px"
|
|
689
|
-
}
|
|
690
|
-
})
|
|
691
|
-
}),
|
|
692
|
-
/* @__PURE__ */ jsx4(Skeleton, {
|
|
693
|
-
loading: true,
|
|
694
|
-
style: {
|
|
695
|
-
width: "256px"
|
|
696
|
-
}
|
|
697
|
-
}),
|
|
698
|
-
/* @__PURE__ */ jsx4(Skeleton, {
|
|
699
|
-
loading: true,
|
|
700
|
-
style: {
|
|
701
|
-
width: "256px",
|
|
702
|
-
marginTop: "var(--space-2)"
|
|
703
|
-
}
|
|
704
|
-
}),
|
|
705
|
-
/* @__PURE__ */ jsx4(Skeleton, {
|
|
706
|
-
loading: true,
|
|
707
|
-
style: {
|
|
708
|
-
width: "256px",
|
|
709
|
-
marginTop: "var(--space-2)"
|
|
710
|
-
}
|
|
711
|
-
})
|
|
712
|
-
]
|
|
713
|
-
})
|
|
714
|
-
]
|
|
715
|
-
});
|
|
716
|
-
});
|
|
717
|
-
// src/hooks/toasts/useToasts/index.ts
|
|
718
|
-
import { useContext as useContext2 } from "react";
|
|
719
|
-
// src/contexts/toasts/ToastsContext/index.ts
|
|
720
|
-
import { createContext as createContext2 } from "react";
|
|
721
|
-
var ToastsContext = createContext2({
|
|
722
|
-
toasts: [],
|
|
723
|
-
addToast: function() {}
|
|
724
|
-
});
|
|
725
|
-
// src/hooks/toasts/useToasts/index.ts
|
|
726
|
-
var useToasts = function() {
|
|
727
|
-
return useContext2(ToastsContext);
|
|
728
|
-
};
|
|
729
|
-
// src/components/threads/Thread/Messages/Content/MessageGroup/index.tsx
|
|
730
|
-
import { useContext as useContext8 } from "react";
|
|
731
|
-
import { Box as Box11 } from "@radix-ui/themes";
|
|
732
|
-
// src/components/messageGroups/MessageGroupBase/AssistantAvatar.tsx
|
|
733
|
-
import { useContext as useContext3 } from "react";
|
|
734
|
-
import { Flex as Flex4 } from "@radix-ui/themes";
|
|
735
|
-
// src/contexts/assistants/AssistantAvatarContext/index.tsx
|
|
736
|
-
import { createContext as createContext3 } from "react";
|
|
737
|
-
import { Avatar as Avatar2 } from "@radix-ui/themes";
|
|
738
|
-
import { LightningBoltIcon } from "@radix-ui/react-icons";
|
|
739
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
740
|
-
var AssistantAvatarContext = createContext3(/* @__PURE__ */ jsx5(Avatar2, {
|
|
741
|
-
fallback: /* @__PURE__ */ jsx5(LightningBoltIcon, {}),
|
|
742
|
-
size: "1"
|
|
743
|
-
}));
|
|
744
|
-
// src/components/messageGroups/MessageGroupBase/AssistantAvatar.tsx
|
|
745
|
-
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
746
|
-
var AssistantAvatar = function() {
|
|
747
|
-
var AssistantAvatarContextValue = useContext3(AssistantAvatarContext);
|
|
748
|
-
return /* @__PURE__ */ jsx6(Flex4, {
|
|
749
|
-
flexShrink: "0",
|
|
750
|
-
height: "24px",
|
|
751
|
-
width: "24px",
|
|
752
|
-
style: {
|
|
753
|
-
borderRadius: "var(--radius-3)",
|
|
754
|
-
overflow: "hidden"
|
|
755
|
-
},
|
|
756
|
-
children: AssistantAvatarContextValue
|
|
757
|
-
});
|
|
758
|
-
};
|
|
759
|
-
// src/contexts/assistants/AssistantNameContext/index.tsx
|
|
760
|
-
import { createContext as createContext4 } from "react";
|
|
761
|
-
var AssistantNameContext = createContext4("Assistant");
|
|
762
|
-
// src/components/messageGroups/MessageGroupBase/UserAvatar.tsx
|
|
763
|
-
import { useContext as useContext4 } from "react";
|
|
764
|
-
import { Flex as Flex5 } from "@radix-ui/themes";
|
|
765
|
-
// src/contexts/users/UserAvatarContext/index.tsx
|
|
766
|
-
import { createContext as createContext5 } from "react";
|
|
767
|
-
import { Avatar as Avatar3 } from "@radix-ui/themes";
|
|
768
|
-
import { PersonIcon } from "@radix-ui/react-icons";
|
|
769
|
-
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
770
|
-
var UserAvatarContext = createContext5(/* @__PURE__ */ jsx7(Avatar3, {
|
|
771
|
-
fallback: /* @__PURE__ */ jsx7(PersonIcon, {}),
|
|
772
|
-
size: "1"
|
|
773
|
-
}));
|
|
774
|
-
// src/components/messageGroups/MessageGroupBase/UserAvatar.tsx
|
|
775
|
-
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
776
|
-
var UserAvatar = function() {
|
|
777
|
-
var UserAvatarContextValue = useContext4(UserAvatarContext);
|
|
778
|
-
return /* @__PURE__ */ jsx8(Flex5, {
|
|
779
|
-
flexShrink: "0",
|
|
780
|
-
height: "24px",
|
|
781
|
-
width: "24px",
|
|
782
|
-
style: {
|
|
783
|
-
borderRadius: "var(--radius-3)",
|
|
784
|
-
overflow: "hidden"
|
|
785
|
-
},
|
|
786
|
-
children: UserAvatarContextValue
|
|
787
|
-
});
|
|
788
|
-
};
|
|
789
|
-
// src/components/threads/Thread/Messages/Content/MessageGroup/Content/index.tsx
|
|
790
|
-
import { Flex as Flex16 } from "@radix-ui/themes";
|
|
791
418
|
// src/components/threads/Thread/Message/index.tsx
|
|
792
|
-
import { useMemo as
|
|
419
|
+
import { useMemo as useMemo8 } from "react";
|
|
793
420
|
import { isEmpty as isEmpty2 } from "radash";
|
|
794
|
-
import { Box as
|
|
421
|
+
import { Box as Box9 } from "@radix-ui/themes";
|
|
795
422
|
// src/components/skeletons/StartingContentSkeleton/index.tsx
|
|
796
|
-
import { Skeleton
|
|
797
|
-
import { jsx as
|
|
423
|
+
import { Skeleton } from "@radix-ui/themes";
|
|
424
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
798
425
|
var StartingContentSkeleton = function() {
|
|
799
|
-
return /* @__PURE__ */
|
|
426
|
+
return /* @__PURE__ */ jsx2(Skeleton, {
|
|
800
427
|
loading: true,
|
|
801
428
|
mt: "1",
|
|
802
429
|
height: "var(--space-4)",
|
|
@@ -808,28 +435,28 @@ var StartingContentSkeleton = function() {
|
|
|
808
435
|
});
|
|
809
436
|
};
|
|
810
437
|
// src/components/runSteps/RunSteps/index.tsx
|
|
811
|
-
import { Flex as
|
|
812
|
-
import { useContext as
|
|
438
|
+
import { Flex as Flex5 } from "@radix-ui/themes";
|
|
439
|
+
import { useContext as useContext3 } from "react";
|
|
813
440
|
// src/contexts/components/ComponentsContext/index.tsx
|
|
814
|
-
import { createContext as
|
|
441
|
+
import { createContext as createContext3 } from "react";
|
|
815
442
|
// src/components/runSteps/RunStep/ToolCalls/index.tsx
|
|
816
|
-
import { Flex as
|
|
443
|
+
import { Flex as Flex4 } from "@radix-ui/themes";
|
|
817
444
|
// src/components/runSteps/RunStep/ToolCalls/ToolCall/Fn/index.tsx
|
|
818
|
-
import { useContext as
|
|
445
|
+
import { useContext as useContext2 } from "react";
|
|
819
446
|
// src/contexts/functions/FunctionComponentsContext/index.tsx
|
|
820
|
-
import { createContext as
|
|
821
|
-
var FunctionComponentsContext =
|
|
447
|
+
import { createContext as createContext2 } from "react";
|
|
448
|
+
var FunctionComponentsContext = createContext2({});
|
|
822
449
|
// src/components/functions/FunctionBase/index.tsx
|
|
823
|
-
import { Popover, Flex as
|
|
450
|
+
import { Popover, Flex as Flex2 } from "@radix-ui/themes";
|
|
824
451
|
// src/components/toolCalls/ToolCallBase/index.tsx
|
|
825
|
-
import { Flex
|
|
826
|
-
import { jsx as
|
|
452
|
+
import { Flex, Button } from "@radix-ui/themes";
|
|
453
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
827
454
|
var ToolCallBase = function(param) {
|
|
828
455
|
var children = param.children;
|
|
829
|
-
return /* @__PURE__ */
|
|
456
|
+
return /* @__PURE__ */ jsx3(Flex, {
|
|
830
457
|
py: "1",
|
|
831
458
|
ml: "-2",
|
|
832
|
-
children: /* @__PURE__ */
|
|
459
|
+
children: /* @__PURE__ */ jsx3(Button, {
|
|
833
460
|
size: "1",
|
|
834
461
|
color: "gold",
|
|
835
462
|
variant: "outline",
|
|
@@ -841,31 +468,31 @@ var ToolCallBase = function(param) {
|
|
|
841
468
|
});
|
|
842
469
|
};
|
|
843
470
|
// src/components/toolCalls/ToolCallBase/ToolCallTitle.tsx
|
|
844
|
-
import { Text
|
|
845
|
-
import { jsx as
|
|
471
|
+
import { Text } from "@radix-ui/themes";
|
|
472
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
846
473
|
var ToolCallTitle = function(param) {
|
|
847
474
|
var children = param.children;
|
|
848
|
-
return /* @__PURE__ */
|
|
475
|
+
return /* @__PURE__ */ jsx4(Text, {
|
|
849
476
|
weight: "regular",
|
|
850
477
|
children: children
|
|
851
478
|
});
|
|
852
479
|
};
|
|
853
480
|
// src/components/toolCalls/ToolCallBase/ToolCallIcon.tsx
|
|
854
481
|
import { CircleIcon, CircleBackslashIcon, CheckCircledIcon } from "@radix-ui/react-icons";
|
|
855
|
-
import { jsx as
|
|
482
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
856
483
|
var ToolCallIcon = function(param) {
|
|
857
484
|
var runStep = param.runStep;
|
|
858
485
|
if (runStep.completed_at) {
|
|
859
|
-
return /* @__PURE__ */
|
|
486
|
+
return /* @__PURE__ */ jsx5(CheckCircledIcon, {});
|
|
860
487
|
} else if (runStep.cancelled_at || runStep.failed_at || runStep.status === "expired") {
|
|
861
|
-
return /* @__PURE__ */
|
|
488
|
+
return /* @__PURE__ */ jsx5(CircleBackslashIcon, {});
|
|
862
489
|
} else {
|
|
863
|
-
return /* @__PURE__ */
|
|
490
|
+
return /* @__PURE__ */ jsx5(CircleIcon, {});
|
|
864
491
|
}
|
|
865
492
|
};
|
|
866
493
|
// src/components/functions/FunctionBase/Content/index.tsx
|
|
867
|
-
import { useMemo
|
|
868
|
-
import { Code, Box
|
|
494
|
+
import { useMemo } from "react";
|
|
495
|
+
import { Code, Box } from "@radix-ui/themes";
|
|
869
496
|
// src/components/functions/FunctionBase/Content/lib/formattedJsonOrRaw.ts
|
|
870
497
|
var formattedJsonOrRaw = function(param) {
|
|
871
498
|
var value = param.value;
|
|
@@ -883,24 +510,24 @@ var formattedJsonOrRaw = function(param) {
|
|
|
883
510
|
}
|
|
884
511
|
};
|
|
885
512
|
// src/components/functions/FunctionBase/Content/index.tsx
|
|
886
|
-
import { jsx as
|
|
513
|
+
import { jsx as jsx6, jsxs } from "react/jsx-runtime";
|
|
887
514
|
var Content = function(param) {
|
|
888
515
|
var fn = param.fn;
|
|
889
|
-
var args =
|
|
516
|
+
var args = useMemo(function() {
|
|
890
517
|
return formattedJsonOrRaw({
|
|
891
518
|
value: fn.arguments
|
|
892
519
|
});
|
|
893
520
|
}, [
|
|
894
521
|
fn
|
|
895
522
|
]);
|
|
896
|
-
var output =
|
|
523
|
+
var output = useMemo(function() {
|
|
897
524
|
return formattedJsonOrRaw({
|
|
898
525
|
value: fn.output
|
|
899
526
|
});
|
|
900
527
|
}, [
|
|
901
528
|
fn
|
|
902
529
|
]);
|
|
903
|
-
return /* @__PURE__ */
|
|
530
|
+
return /* @__PURE__ */ jsxs(Code, {
|
|
904
531
|
variant: "ghost",
|
|
905
532
|
color: "gold",
|
|
906
533
|
style: {
|
|
@@ -908,40 +535,40 @@ var Content = function(param) {
|
|
|
908
535
|
wordBreak: "break-word"
|
|
909
536
|
},
|
|
910
537
|
children: [
|
|
911
|
-
args && /* @__PURE__ */
|
|
538
|
+
args && /* @__PURE__ */ jsx6(Box, {
|
|
912
539
|
children: args
|
|
913
540
|
}),
|
|
914
|
-
output && /* @__PURE__ */
|
|
541
|
+
output && /* @__PURE__ */ jsx6(Box, {
|
|
915
542
|
children: output
|
|
916
543
|
})
|
|
917
544
|
]
|
|
918
545
|
});
|
|
919
546
|
};
|
|
920
547
|
// src/components/functions/FunctionBase/index.tsx
|
|
921
|
-
import { jsx as
|
|
548
|
+
import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
922
549
|
var FunctionBase = function(param) {
|
|
923
550
|
var fn = param.fn, runStep = param.runStep, title2 = param.title;
|
|
924
|
-
return /* @__PURE__ */
|
|
551
|
+
return /* @__PURE__ */ jsxs2(Popover.Root, {
|
|
925
552
|
children: [
|
|
926
|
-
/* @__PURE__ */
|
|
927
|
-
children: /* @__PURE__ */
|
|
928
|
-
children: /* @__PURE__ */
|
|
553
|
+
/* @__PURE__ */ jsx7(Popover.Trigger, {
|
|
554
|
+
children: /* @__PURE__ */ jsx7(Flex2, {
|
|
555
|
+
children: /* @__PURE__ */ jsxs2(ToolCallBase, {
|
|
929
556
|
children: [
|
|
930
|
-
/* @__PURE__ */
|
|
557
|
+
/* @__PURE__ */ jsx7(ToolCallIcon, {
|
|
931
558
|
runStep: runStep
|
|
932
559
|
}),
|
|
933
|
-
/* @__PURE__ */
|
|
560
|
+
/* @__PURE__ */ jsx7(ToolCallTitle, {
|
|
934
561
|
children: title2
|
|
935
562
|
})
|
|
936
563
|
]
|
|
937
564
|
})
|
|
938
565
|
})
|
|
939
566
|
}),
|
|
940
|
-
/* @__PURE__ */
|
|
567
|
+
/* @__PURE__ */ jsx7(Popover.Content, {
|
|
941
568
|
style: {
|
|
942
569
|
maxHeight: "200px"
|
|
943
570
|
},
|
|
944
|
-
children: /* @__PURE__ */
|
|
571
|
+
children: /* @__PURE__ */ jsx7(Content, {
|
|
945
572
|
fn: fn
|
|
946
573
|
})
|
|
947
574
|
})
|
|
@@ -960,10 +587,10 @@ var title = function(param) {
|
|
|
960
587
|
}
|
|
961
588
|
};
|
|
962
589
|
// src/components/runSteps/RunStep/ToolCalls/ToolCall/Fn/DefaultFunction/index.tsx
|
|
963
|
-
import { jsx as
|
|
590
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
964
591
|
var DefaultFunction = function(param) {
|
|
965
592
|
var fn = param.fn, runStep = param.runStep;
|
|
966
|
-
return /* @__PURE__ */
|
|
593
|
+
return /* @__PURE__ */ jsx8(FunctionBase, {
|
|
967
594
|
fn: fn,
|
|
968
595
|
runStep: runStep,
|
|
969
596
|
title: title({
|
|
@@ -973,28 +600,28 @@ var DefaultFunction = function(param) {
|
|
|
973
600
|
});
|
|
974
601
|
};
|
|
975
602
|
// src/components/runSteps/RunStep/ToolCalls/ToolCall/Fn/index.tsx
|
|
976
|
-
import { jsx as
|
|
603
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
977
604
|
var Fn = function(param) {
|
|
978
605
|
var fn = param.fn, runStep = param.runStep;
|
|
979
|
-
var functionComponentsContext =
|
|
606
|
+
var functionComponentsContext = useContext2(FunctionComponentsContext);
|
|
980
607
|
var Component = functionComponentsContext[fn.name] || DefaultFunction;
|
|
981
608
|
return(// @ts-ignore-next-line
|
|
982
|
-
/* @__PURE__ */
|
|
609
|
+
/* @__PURE__ */ jsx9(Component, {
|
|
983
610
|
fn: fn,
|
|
984
611
|
runStep: runStep
|
|
985
612
|
}));
|
|
986
613
|
};
|
|
987
614
|
// src/components/runSteps/RunStep/ToolCalls/ToolCall/CodeInterpreter/index.tsx
|
|
988
|
-
import { Popover as Popover2, Flex as
|
|
615
|
+
import { Popover as Popover2, Flex as Flex3 } from "@radix-ui/themes";
|
|
989
616
|
// src/components/runSteps/RunStep/ToolCalls/ToolCall/CodeInterpreter/Content.tsx
|
|
990
|
-
import { Code as Code2, Box as
|
|
991
|
-
import { jsx as
|
|
617
|
+
import { Code as Code2, Box as Box2 } from "@radix-ui/themes";
|
|
618
|
+
import { jsx as jsx10, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
992
619
|
var Content2 = function(param) {
|
|
993
620
|
var codeInterpreter = param.codeInterpreter;
|
|
994
621
|
if (!codeInterpreter.input) {
|
|
995
622
|
return null;
|
|
996
623
|
}
|
|
997
|
-
return /* @__PURE__ */
|
|
624
|
+
return /* @__PURE__ */ jsxs3(Code2, {
|
|
998
625
|
variant: "ghost",
|
|
999
626
|
color: "gold",
|
|
1000
627
|
style: {
|
|
@@ -1002,38 +629,38 @@ var Content2 = function(param) {
|
|
|
1002
629
|
wordBreak: "break-word"
|
|
1003
630
|
},
|
|
1004
631
|
children: [
|
|
1005
|
-
/* @__PURE__ */
|
|
632
|
+
/* @__PURE__ */ jsx10(Box2, {
|
|
1006
633
|
children: codeInterpreter.input
|
|
1007
634
|
}),
|
|
1008
|
-
/* @__PURE__ */
|
|
635
|
+
/* @__PURE__ */ jsx10(Box2, {
|
|
1009
636
|
children: JSON.stringify(codeInterpreter.outputs)
|
|
1010
637
|
})
|
|
1011
638
|
]
|
|
1012
639
|
});
|
|
1013
640
|
};
|
|
1014
641
|
// src/components/runSteps/RunStep/ToolCalls/ToolCall/CodeInterpreter/index.tsx
|
|
1015
|
-
import { jsx as
|
|
642
|
+
import { jsx as jsx11, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1016
643
|
var CodeInterpreter = function(param) {
|
|
1017
644
|
var codeInterpreter = param.codeInterpreter, runStep = param.runStep;
|
|
1018
|
-
return /* @__PURE__ */
|
|
645
|
+
return /* @__PURE__ */ jsxs4(Popover2.Root, {
|
|
1019
646
|
children: [
|
|
1020
|
-
/* @__PURE__ */
|
|
1021
|
-
children: /* @__PURE__ */
|
|
1022
|
-
children: /* @__PURE__ */
|
|
647
|
+
/* @__PURE__ */ jsx11(Popover2.Trigger, {
|
|
648
|
+
children: /* @__PURE__ */ jsx11(Flex3, {
|
|
649
|
+
children: /* @__PURE__ */ jsxs4(ToolCallBase, {
|
|
1023
650
|
children: [
|
|
1024
|
-
/* @__PURE__ */
|
|
651
|
+
/* @__PURE__ */ jsx11(ToolCallIcon, {
|
|
1025
652
|
runStep: runStep
|
|
1026
653
|
}),
|
|
1027
|
-
/* @__PURE__ */
|
|
654
|
+
/* @__PURE__ */ jsx11(ToolCallTitle, {
|
|
1028
655
|
children: "Using code interpreter"
|
|
1029
656
|
})
|
|
1030
657
|
]
|
|
1031
658
|
})
|
|
1032
659
|
})
|
|
1033
660
|
}),
|
|
1034
|
-
/* @__PURE__ */
|
|
661
|
+
/* @__PURE__ */ jsx11(Popover2.Content, {
|
|
1035
662
|
maxHeight: "200px",
|
|
1036
|
-
children: /* @__PURE__ */
|
|
663
|
+
children: /* @__PURE__ */ jsx11(Content2, {
|
|
1037
664
|
codeInterpreter: codeInterpreter
|
|
1038
665
|
})
|
|
1039
666
|
})
|
|
@@ -1041,30 +668,30 @@ var CodeInterpreter = function(param) {
|
|
|
1041
668
|
});
|
|
1042
669
|
};
|
|
1043
670
|
// src/components/runSteps/RunStep/ToolCalls/ToolCall/FileSearch.tsx
|
|
1044
|
-
import { jsx as
|
|
671
|
+
import { jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1045
672
|
var FileSearch = function(param) {
|
|
1046
673
|
var runStep = param.runStep, toolCall = param.toolCall;
|
|
1047
|
-
return /* @__PURE__ */
|
|
674
|
+
return /* @__PURE__ */ jsxs5(ToolCallBase, {
|
|
1048
675
|
children: [
|
|
1049
|
-
/* @__PURE__ */
|
|
676
|
+
/* @__PURE__ */ jsx12(ToolCallIcon, {
|
|
1050
677
|
runStep: runStep
|
|
1051
678
|
}),
|
|
1052
|
-
/* @__PURE__ */
|
|
679
|
+
/* @__PURE__ */ jsx12(ToolCallTitle, {
|
|
1053
680
|
children: "Searching files"
|
|
1054
681
|
})
|
|
1055
682
|
]
|
|
1056
683
|
});
|
|
1057
684
|
};
|
|
1058
685
|
// src/components/runSteps/RunStep/ToolCalls/ToolCall/Fallback.tsx
|
|
1059
|
-
import { jsx as
|
|
686
|
+
import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1060
687
|
var Fallback = function(param) {
|
|
1061
688
|
var runStep = param.runStep, toolCall = param.toolCall;
|
|
1062
|
-
return /* @__PURE__ */
|
|
689
|
+
return /* @__PURE__ */ jsxs6(ToolCallBase, {
|
|
1063
690
|
children: [
|
|
1064
|
-
/* @__PURE__ */
|
|
691
|
+
/* @__PURE__ */ jsx13(ToolCallIcon, {
|
|
1065
692
|
runStep: runStep
|
|
1066
693
|
}),
|
|
1067
|
-
/* @__PURE__ */
|
|
694
|
+
/* @__PURE__ */ jsxs6(ToolCallTitle, {
|
|
1068
695
|
children: [
|
|
1069
696
|
"Using tool: ",
|
|
1070
697
|
toolCall.type
|
|
@@ -1074,52 +701,52 @@ var Fallback = function(param) {
|
|
|
1074
701
|
});
|
|
1075
702
|
};
|
|
1076
703
|
// src/components/runSteps/RunStep/ToolCalls/ToolCall/index.tsx
|
|
1077
|
-
import { jsx as
|
|
704
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1078
705
|
var ToolCall = function(param) {
|
|
1079
706
|
var toolCall = param.toolCall, runStep = param.runStep;
|
|
1080
707
|
if (toolCall.type === "function") {
|
|
1081
|
-
return /* @__PURE__ */
|
|
708
|
+
return /* @__PURE__ */ jsx14(Fn, {
|
|
1082
709
|
fn: toolCall.function,
|
|
1083
710
|
runStep: runStep
|
|
1084
711
|
});
|
|
1085
712
|
}
|
|
1086
713
|
if (toolCall.type === "code_interpreter") {
|
|
1087
|
-
return /* @__PURE__ */
|
|
714
|
+
return /* @__PURE__ */ jsx14(CodeInterpreter, {
|
|
1088
715
|
codeInterpreter: toolCall.code_interpreter,
|
|
1089
716
|
runStep: runStep
|
|
1090
717
|
});
|
|
1091
718
|
}
|
|
1092
719
|
if (toolCall.type === "file_search") {
|
|
1093
|
-
return /* @__PURE__ */
|
|
720
|
+
return /* @__PURE__ */ jsx14(FileSearch, {
|
|
1094
721
|
toolCall: toolCall,
|
|
1095
722
|
runStep: runStep
|
|
1096
723
|
});
|
|
1097
724
|
}
|
|
1098
|
-
return /* @__PURE__ */
|
|
725
|
+
return /* @__PURE__ */ jsx14(Fallback, {
|
|
1099
726
|
toolCall: toolCall,
|
|
1100
727
|
runStep: runStep
|
|
1101
728
|
});
|
|
1102
729
|
};
|
|
1103
730
|
// src/components/runSteps/RunStep/ToolCalls/Starting/index.tsx
|
|
1104
|
-
import { Popover as Popover3, Text as
|
|
731
|
+
import { Popover as Popover3, Text as Text2 } from "@radix-ui/themes";
|
|
1105
732
|
import { CircleIcon as CircleIcon2 } from "@radix-ui/react-icons";
|
|
1106
|
-
import { jsx as
|
|
733
|
+
import { jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1107
734
|
var Starting = function() {
|
|
1108
|
-
return /* @__PURE__ */
|
|
735
|
+
return /* @__PURE__ */ jsxs7(Popover3.Root, {
|
|
1109
736
|
children: [
|
|
1110
|
-
/* @__PURE__ */
|
|
737
|
+
/* @__PURE__ */ jsxs7(ToolCallBase, {
|
|
1111
738
|
children: [
|
|
1112
|
-
/* @__PURE__ */
|
|
1113
|
-
/* @__PURE__ */
|
|
739
|
+
/* @__PURE__ */ jsx15(CircleIcon2, {}),
|
|
740
|
+
/* @__PURE__ */ jsx15(ToolCallTitle, {
|
|
1114
741
|
children: "Starting actions"
|
|
1115
742
|
})
|
|
1116
743
|
]
|
|
1117
744
|
}),
|
|
1118
|
-
/* @__PURE__ */
|
|
745
|
+
/* @__PURE__ */ jsx15(Popover3.Content, {
|
|
1119
746
|
style: {
|
|
1120
747
|
maxHeight: "500px"
|
|
1121
748
|
},
|
|
1122
|
-
children: /* @__PURE__ */
|
|
749
|
+
children: /* @__PURE__ */ jsx15(Text2, {
|
|
1123
750
|
children: "Getting ready to connect to domain API"
|
|
1124
751
|
})
|
|
1125
752
|
})
|
|
@@ -1127,21 +754,25 @@ var Starting = function() {
|
|
|
1127
754
|
});
|
|
1128
755
|
};
|
|
1129
756
|
// src/components/runSteps/RunStep/ToolCalls/index.tsx
|
|
1130
|
-
import { jsx as
|
|
757
|
+
import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1131
758
|
var Root = function(param) {
|
|
1132
|
-
var children = param.children;
|
|
1133
|
-
return /* @__PURE__ */
|
|
759
|
+
var children = param.children, className = param.className, style = param.style;
|
|
760
|
+
return /* @__PURE__ */ jsx16(Flex4, {
|
|
1134
761
|
direction: "column",
|
|
762
|
+
className: className,
|
|
763
|
+
style: style,
|
|
1135
764
|
children: children
|
|
1136
765
|
});
|
|
1137
766
|
};
|
|
1138
767
|
var ToolCalls = function(param) {
|
|
1139
|
-
var stepDetails = param.stepDetails, runStep = param.runStep;
|
|
1140
|
-
return /* @__PURE__ */
|
|
768
|
+
var stepDetails = param.stepDetails, runStep = param.runStep, className = param.className, style = param.style;
|
|
769
|
+
return /* @__PURE__ */ jsxs8(Root, {
|
|
770
|
+
className: className,
|
|
771
|
+
style: style,
|
|
1141
772
|
children: [
|
|
1142
|
-
!stepDetails.tool_calls.length && /* @__PURE__ */
|
|
773
|
+
!stepDetails.tool_calls.length && /* @__PURE__ */ jsx16(Starting, {}),
|
|
1143
774
|
stepDetails.tool_calls.map(function(toolCall) {
|
|
1144
|
-
return /* @__PURE__ */
|
|
775
|
+
return /* @__PURE__ */ jsx16(ToolCall, {
|
|
1145
776
|
toolCall: toolCall,
|
|
1146
777
|
runStep: runStep
|
|
1147
778
|
}, toolCall.id);
|
|
@@ -1153,11 +784,13 @@ ToolCalls.Root = Root;
|
|
|
1153
784
|
ToolCalls.Starting = Starting;
|
|
1154
785
|
ToolCalls.ToolCall = ToolCall;
|
|
1155
786
|
// src/components/runSteps/RunStep/index.tsx
|
|
1156
|
-
import { jsx as
|
|
787
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1157
788
|
var RunStep = function(param) {
|
|
1158
|
-
var runStep = param.runStep;
|
|
789
|
+
var runStep = param.runStep, className = param.className, style = param.style;
|
|
1159
790
|
if (runStep.step_details.type === "tool_calls") {
|
|
1160
|
-
return /* @__PURE__ */
|
|
791
|
+
return /* @__PURE__ */ jsx17(ToolCalls, {
|
|
792
|
+
className: className,
|
|
793
|
+
style: style,
|
|
1161
794
|
stepDetails: runStep.step_details,
|
|
1162
795
|
runStep: runStep
|
|
1163
796
|
});
|
|
@@ -1166,28 +799,28 @@ var RunStep = function(param) {
|
|
|
1166
799
|
};
|
|
1167
800
|
RunStep.ToolCalls = ToolCalls;
|
|
1168
801
|
// src/contexts/components/ComponentsContext/index.tsx
|
|
1169
|
-
var ComponentsContext =
|
|
802
|
+
var ComponentsContext = createContext3({
|
|
1170
803
|
components: {
|
|
1171
804
|
RunStep: RunStep
|
|
1172
805
|
}
|
|
1173
806
|
});
|
|
1174
807
|
// src/components/runSteps/RunSteps/index.tsx
|
|
1175
|
-
import { jsx as
|
|
808
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1176
809
|
var RunSteps = function(param) {
|
|
1177
810
|
var runSteps = param.runSteps;
|
|
1178
|
-
var componentsContext =
|
|
811
|
+
var componentsContext = useContext3(ComponentsContext);
|
|
1179
812
|
var Component = componentsContext.components.RunStep;
|
|
1180
|
-
return /* @__PURE__ */
|
|
813
|
+
return /* @__PURE__ */ jsx18(Flex5, {
|
|
1181
814
|
direction: "column-reverse",
|
|
1182
815
|
children: runSteps.map(function(runStep) {
|
|
1183
|
-
return /* @__PURE__ */
|
|
816
|
+
return /* @__PURE__ */ jsx18(Component, {
|
|
1184
817
|
runStep: runStep
|
|
1185
818
|
}, runStep.id);
|
|
1186
819
|
})
|
|
1187
820
|
});
|
|
1188
821
|
};
|
|
1189
822
|
// src/hooks/messages/useIsMutatingMessage/index.ts
|
|
1190
|
-
import { useMemo as
|
|
823
|
+
import { useMemo as useMemo2 } from "react";
|
|
1191
824
|
import { useIsMutating } from "@tanstack/react-query";
|
|
1192
825
|
var useIsMutatingMessage = function() {
|
|
1193
826
|
var threadContext = useSuperinterfaceContext();
|
|
@@ -1197,7 +830,7 @@ var useIsMutatingMessage = function() {
|
|
|
1197
830
|
threadContext.variables
|
|
1198
831
|
]
|
|
1199
832
|
});
|
|
1200
|
-
var isMutatingMessage =
|
|
833
|
+
var isMutatingMessage = useMemo2(function() {
|
|
1201
834
|
return mutatingMessagesCount > 0;
|
|
1202
835
|
}, [
|
|
1203
836
|
mutatingMessagesCount
|
|
@@ -1205,28 +838,28 @@ var useIsMutatingMessage = function() {
|
|
|
1205
838
|
return isMutatingMessage;
|
|
1206
839
|
};
|
|
1207
840
|
// src/contexts/messages/MessageContext/index.ts
|
|
1208
|
-
import { createContext as
|
|
1209
|
-
var MessageContext =
|
|
841
|
+
import { createContext as createContext4 } from "react";
|
|
842
|
+
var MessageContext = createContext4({
|
|
1210
843
|
message: null
|
|
1211
844
|
});
|
|
1212
845
|
// src/components/threads/Thread/Message/Provider.tsx
|
|
1213
846
|
var Provider = MessageContext.Provider;
|
|
1214
847
|
// src/components/threads/Thread/Message/Attachments/index.tsx
|
|
1215
|
-
import { Flex as
|
|
848
|
+
import { Flex as Flex6, Badge } from "@radix-ui/themes";
|
|
1216
849
|
import { FileIcon } from "@radix-ui/react-icons";
|
|
1217
|
-
import { jsx as
|
|
850
|
+
import { jsx as jsx19, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1218
851
|
var Attachments = function(param) {
|
|
1219
852
|
var message = param.message;
|
|
1220
853
|
var _message_attachments;
|
|
1221
854
|
if (!((_message_attachments = message.attachments) === null || _message_attachments === void 0 ? void 0 : _message_attachments.length)) return null;
|
|
1222
|
-
return /* @__PURE__ */
|
|
855
|
+
return /* @__PURE__ */ jsx19(Flex6, {
|
|
1223
856
|
align: "start",
|
|
1224
857
|
pb: "1",
|
|
1225
|
-
children: /* @__PURE__ */
|
|
858
|
+
children: /* @__PURE__ */ jsxs9(Badge, {
|
|
1226
859
|
color: "gray",
|
|
1227
860
|
variant: "surface",
|
|
1228
861
|
children: [
|
|
1229
|
-
/* @__PURE__ */
|
|
862
|
+
/* @__PURE__ */ jsx19(FileIcon, {}),
|
|
1230
863
|
message.attachments.length,
|
|
1231
864
|
" file",
|
|
1232
865
|
message.attachments.length > 1 ? "s" : ""
|
|
@@ -1237,19 +870,19 @@ var Attachments = function(param) {
|
|
|
1237
870
|
// src/components/threads/Thread/Message/ContentPart/TextContent.tsx
|
|
1238
871
|
import Markdown from "react-markdown";
|
|
1239
872
|
// src/hooks/markdown/useMarkdownContext/index.ts
|
|
1240
|
-
import { useContext as
|
|
873
|
+
import { useContext as useContext5 } from "react";
|
|
1241
874
|
// src/contexts/markdown/MarkdownContext/index.ts
|
|
1242
|
-
import { createContext as
|
|
875
|
+
import { createContext as createContext6 } from "react";
|
|
1243
876
|
// src/contexts/markdown/MarkdownContext/lib/components/index.tsx
|
|
1244
877
|
import { Heading, Table } from "@radix-ui/themes";
|
|
1245
878
|
// src/contexts/markdown/MarkdownContext/lib/components/Paragraph.tsx
|
|
1246
|
-
import { Box as
|
|
1247
|
-
import { jsx as
|
|
879
|
+
import { Box as Box3, Text as Text3 } from "@radix-ui/themes";
|
|
880
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1248
881
|
var Paragraph = function(param) {
|
|
1249
882
|
var children = param.children;
|
|
1250
|
-
return /* @__PURE__ */
|
|
883
|
+
return /* @__PURE__ */ jsx20(Box3, {
|
|
1251
884
|
pb: "3",
|
|
1252
|
-
children: /* @__PURE__ */
|
|
885
|
+
children: /* @__PURE__ */ jsx20(Text3, {
|
|
1253
886
|
size: "3",
|
|
1254
887
|
style: {
|
|
1255
888
|
whiteSpace: "pre-line",
|
|
@@ -1261,10 +894,10 @@ var Paragraph = function(param) {
|
|
|
1261
894
|
};
|
|
1262
895
|
// src/contexts/markdown/MarkdownContext/lib/components/Link.tsx
|
|
1263
896
|
import { Link as RadixLink } from "@radix-ui/themes";
|
|
1264
|
-
import { jsx as
|
|
897
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1265
898
|
var Link = function(param) {
|
|
1266
899
|
var children = param.children, href = param.href, download = param.download, _param_target = param.target, target = _param_target === void 0 ? "_blank" : _param_target;
|
|
1267
|
-
return /* @__PURE__ */
|
|
900
|
+
return /* @__PURE__ */ jsx21(RadixLink, {
|
|
1268
901
|
href: href,
|
|
1269
902
|
target: target,
|
|
1270
903
|
download: download,
|
|
@@ -1272,14 +905,14 @@ var Link = function(param) {
|
|
|
1272
905
|
});
|
|
1273
906
|
};
|
|
1274
907
|
// src/contexts/markdown/MarkdownContext/lib/components/UnorderedList.tsx
|
|
1275
|
-
import { Box as
|
|
1276
|
-
import { jsx as
|
|
908
|
+
import { Box as Box4 } from "@radix-ui/themes";
|
|
909
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1277
910
|
var UnorderedList = function(param) {
|
|
1278
911
|
var children = param.children;
|
|
1279
|
-
return /* @__PURE__ */
|
|
912
|
+
return /* @__PURE__ */ jsx22(Box4, {
|
|
1280
913
|
pb: "3",
|
|
1281
914
|
asChild: true,
|
|
1282
|
-
children: /* @__PURE__ */
|
|
915
|
+
children: /* @__PURE__ */ jsx22("ul", {
|
|
1283
916
|
style: {
|
|
1284
917
|
listStylePosition: "inside"
|
|
1285
918
|
},
|
|
@@ -1288,14 +921,14 @@ var UnorderedList = function(param) {
|
|
|
1288
921
|
});
|
|
1289
922
|
};
|
|
1290
923
|
// src/contexts/markdown/MarkdownContext/lib/components/OrderedList.tsx
|
|
1291
|
-
import { Box as
|
|
1292
|
-
import { jsx as
|
|
924
|
+
import { Box as Box5 } from "@radix-ui/themes";
|
|
925
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1293
926
|
var OrderedList = function(param) {
|
|
1294
927
|
var children = param.children;
|
|
1295
|
-
return /* @__PURE__ */
|
|
928
|
+
return /* @__PURE__ */ jsx23(Box5, {
|
|
1296
929
|
pb: "3",
|
|
1297
930
|
asChild: true,
|
|
1298
|
-
children: /* @__PURE__ */
|
|
931
|
+
children: /* @__PURE__ */ jsx23("ol", {
|
|
1299
932
|
style: {
|
|
1300
933
|
listStylePosition: "inside"
|
|
1301
934
|
},
|
|
@@ -1304,32 +937,32 @@ var OrderedList = function(param) {
|
|
|
1304
937
|
});
|
|
1305
938
|
};
|
|
1306
939
|
// src/contexts/markdown/MarkdownContext/lib/components/ListItem.tsx
|
|
1307
|
-
import { Box as
|
|
1308
|
-
import { jsx as
|
|
940
|
+
import { Box as Box6 } from "@radix-ui/themes";
|
|
941
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1309
942
|
var ListItem = function(param) {
|
|
1310
943
|
var children = param.children;
|
|
1311
|
-
return /* @__PURE__ */
|
|
944
|
+
return /* @__PURE__ */ jsx24(Box6, {
|
|
1312
945
|
pb: "1",
|
|
1313
|
-
children: /* @__PURE__ */
|
|
946
|
+
children: /* @__PURE__ */ jsx24("li", {
|
|
1314
947
|
children: children
|
|
1315
948
|
})
|
|
1316
949
|
});
|
|
1317
950
|
};
|
|
1318
951
|
// src/contexts/markdown/MarkdownContext/lib/components/Strong.tsx
|
|
1319
952
|
import { Strong as RadixStrong } from "@radix-ui/themes";
|
|
1320
|
-
import { jsx as
|
|
953
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1321
954
|
var Strong = function(param) {
|
|
1322
955
|
var children = param.children;
|
|
1323
|
-
return /* @__PURE__ */
|
|
956
|
+
return /* @__PURE__ */ jsx25(RadixStrong, {
|
|
1324
957
|
children: children
|
|
1325
958
|
});
|
|
1326
959
|
};
|
|
1327
960
|
// src/contexts/markdown/MarkdownContext/lib/components/Pre.tsx
|
|
1328
|
-
import { Box as
|
|
1329
|
-
import { jsx as
|
|
961
|
+
import { Box as Box7 } from "@radix-ui/themes";
|
|
962
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1330
963
|
var Pre = function(param) {
|
|
1331
964
|
var children = param.children;
|
|
1332
|
-
return /* @__PURE__ */
|
|
965
|
+
return /* @__PURE__ */ jsx26(Box7, {
|
|
1333
966
|
style: {
|
|
1334
967
|
whiteSpace: "pre-wrap",
|
|
1335
968
|
wordBreak: "break-word"
|
|
@@ -1340,12 +973,153 @@ var Pre = function(param) {
|
|
|
1340
973
|
// src/contexts/markdown/MarkdownContext/lib/components/Code.tsx
|
|
1341
974
|
import { Code as RadixCode } from "@radix-ui/themes";
|
|
1342
975
|
// src/components/suggestions/Suggestions/index.tsx
|
|
1343
|
-
import { useMemo as
|
|
976
|
+
import { useMemo as useMemo6 } from "react";
|
|
977
|
+
// src/hooks/messages/useLatestMessage/index.ts
|
|
978
|
+
import { useMemo as useMemo4 } from "react";
|
|
979
|
+
// src/hooks/messages/useMessages/index.tsx
|
|
980
|
+
import { useMemo as useMemo3 } from "react";
|
|
981
|
+
import { useInfiniteQuery, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
|
982
|
+
// src/lib/threads/queryOptions/index.ts
|
|
983
|
+
import { infiniteQueryOptions } from "@tanstack/react-query";
|
|
984
|
+
// src/lib/threads/queryOptions/variableParams.ts
|
|
985
|
+
var variableParams = function(param) {
|
|
986
|
+
var variables = param.variables, superinterfaceContext = param.superinterfaceContext;
|
|
987
|
+
var _superinterfaceContext_threadIdCookieOptions;
|
|
988
|
+
if (variables.threadId) return variables;
|
|
989
|
+
if (!variables.assistantId) return variables;
|
|
990
|
+
if (!((_superinterfaceContext_threadIdCookieOptions = superinterfaceContext.threadIdCookieOptions) === null || _superinterfaceContext_threadIdCookieOptions === void 0 ? void 0 : _superinterfaceContext_threadIdCookieOptions.get)) return variables;
|
|
991
|
+
var threadId = superinterfaceContext.threadIdCookieOptions.get({
|
|
992
|
+
assistantId: variables.assistantId
|
|
993
|
+
});
|
|
994
|
+
if (!threadId) return variables;
|
|
995
|
+
return _object_spread_props(_object_spread({}, variables), {
|
|
996
|
+
threadId: threadId
|
|
997
|
+
});
|
|
998
|
+
};
|
|
999
|
+
// src/lib/threads/queryOptions/index.ts
|
|
1000
|
+
var queryOptions = function(param) {
|
|
1001
|
+
var queryKeyBase = param.queryKeyBase, path2 = param.path, queryClient = param.queryClient, threadContext = param.threadContext, superinterfaceContext = param.superinterfaceContext;
|
|
1002
|
+
var queryKey = _to_consumable_array(queryKeyBase).concat([
|
|
1003
|
+
threadContext.variables
|
|
1004
|
+
]);
|
|
1005
|
+
return infiniteQueryOptions(_object_spread_props(_object_spread({
|
|
1006
|
+
// @ts-ignore-next-line
|
|
1007
|
+
queryFn: /*#__PURE__*/ function() {
|
|
1008
|
+
var _ref = _async_to_generator(function(param) {
|
|
1009
|
+
var pageParam, queryKey2, _queryKey2, _key, variables, params;
|
|
1010
|
+
return _ts_generator(this, function(_state) {
|
|
1011
|
+
pageParam = param.pageParam, queryKey2 = param.queryKey;
|
|
1012
|
+
_queryKey2 = _sliced_to_array(queryKey2, 2), _key = _queryKey2[0], variables = _queryKey2[1];
|
|
1013
|
+
params = new URLSearchParams(_object_spread({}, pageParam ? {
|
|
1014
|
+
pageParam: pageParam
|
|
1015
|
+
} : {}, variableParams({
|
|
1016
|
+
variables: variables,
|
|
1017
|
+
superinterfaceContext: superinterfaceContext
|
|
1018
|
+
})));
|
|
1019
|
+
return [
|
|
1020
|
+
2,
|
|
1021
|
+
fetch("".concat(superinterfaceContext.baseUrl).concat(path2, "?").concat(params)).then(/*#__PURE__*/ function() {
|
|
1022
|
+
var _ref = _async_to_generator(function(response) {
|
|
1023
|
+
var errorResponse, error;
|
|
1024
|
+
return _ts_generator(this, function(_state) {
|
|
1025
|
+
switch(_state.label){
|
|
1026
|
+
case 0:
|
|
1027
|
+
if (!(response.status !== 200)) return [
|
|
1028
|
+
3,
|
|
1029
|
+
4
|
|
1030
|
+
];
|
|
1031
|
+
_state.label = 1;
|
|
1032
|
+
case 1:
|
|
1033
|
+
_state.trys.push([
|
|
1034
|
+
1,
|
|
1035
|
+
3,
|
|
1036
|
+
,
|
|
1037
|
+
4
|
|
1038
|
+
]);
|
|
1039
|
+
return [
|
|
1040
|
+
4,
|
|
1041
|
+
response.json()
|
|
1042
|
+
];
|
|
1043
|
+
case 2:
|
|
1044
|
+
errorResponse = _state.sent();
|
|
1045
|
+
throw new Error(errorResponse.error);
|
|
1046
|
+
case 3:
|
|
1047
|
+
error = _state.sent();
|
|
1048
|
+
throw new Error("Failed to fetch");
|
|
1049
|
+
case 4:
|
|
1050
|
+
return [
|
|
1051
|
+
2,
|
|
1052
|
+
response.json()
|
|
1053
|
+
];
|
|
1054
|
+
}
|
|
1055
|
+
});
|
|
1056
|
+
});
|
|
1057
|
+
return function(response) {
|
|
1058
|
+
return _ref.apply(this, arguments);
|
|
1059
|
+
};
|
|
1060
|
+
}())
|
|
1061
|
+
];
|
|
1062
|
+
});
|
|
1063
|
+
});
|
|
1064
|
+
return function(_) {
|
|
1065
|
+
return _ref.apply(this, arguments);
|
|
1066
|
+
};
|
|
1067
|
+
}(),
|
|
1068
|
+
initialPageParam: void 0,
|
|
1069
|
+
getNextPageParam: function(lastPage) {
|
|
1070
|
+
if (!lastPage.hasNextPage) return null;
|
|
1071
|
+
return lastPage.lastId;
|
|
1072
|
+
},
|
|
1073
|
+
limit: 10
|
|
1074
|
+
}, threadContext.defaultOptions.queries, queryClient.getQueryDefaults(queryKey)), {
|
|
1075
|
+
queryKey: queryKey
|
|
1076
|
+
}));
|
|
1077
|
+
};
|
|
1078
|
+
// src/lib/messages/messagesQueryOptions.ts
|
|
1079
|
+
var messagesQueryOptions = function(param) {
|
|
1080
|
+
var queryClient = param.queryClient, threadContext = param.threadContext, superinterfaceContext = param.superinterfaceContext;
|
|
1081
|
+
return queryOptions({
|
|
1082
|
+
queryKeyBase: [
|
|
1083
|
+
"messages"
|
|
1084
|
+
],
|
|
1085
|
+
path: "/messages",
|
|
1086
|
+
queryClient: queryClient,
|
|
1087
|
+
threadContext: threadContext,
|
|
1088
|
+
superinterfaceContext: superinterfaceContext
|
|
1089
|
+
});
|
|
1090
|
+
};
|
|
1091
|
+
// src/hooks/messages/useMessages/index.tsx
|
|
1092
|
+
var messages = function(param) {
|
|
1093
|
+
var props = param.props;
|
|
1094
|
+
if (!props.data) return [];
|
|
1095
|
+
return props.data.pages.reduce(function(acc, page) {
|
|
1096
|
+
return acc.concat(page.data);
|
|
1097
|
+
}, []);
|
|
1098
|
+
};
|
|
1099
|
+
var useMessages = function() {
|
|
1100
|
+
var queryClient = useQueryClient2();
|
|
1101
|
+
var threadContext = useSuperinterfaceContext();
|
|
1102
|
+
var superinterfaceContext = useSuperinterfaceContext();
|
|
1103
|
+
var props = useInfiniteQuery(messagesQueryOptions({
|
|
1104
|
+
queryClient: queryClient,
|
|
1105
|
+
threadContext: threadContext,
|
|
1106
|
+
superinterfaceContext: superinterfaceContext
|
|
1107
|
+
}));
|
|
1108
|
+
return useMemo3(function() {
|
|
1109
|
+
return _object_spread_props(_object_spread({}, props), {
|
|
1110
|
+
// @ts-ignore-next-line
|
|
1111
|
+
messages: messages({
|
|
1112
|
+
props: props
|
|
1113
|
+
})
|
|
1114
|
+
});
|
|
1115
|
+
}, [
|
|
1116
|
+
props
|
|
1117
|
+
]);
|
|
1118
|
+
};
|
|
1344
1119
|
// src/hooks/messages/useLatestMessage/index.ts
|
|
1345
|
-
import { useMemo as useMemo5 } from "react";
|
|
1346
1120
|
var useLatestMessage = function() {
|
|
1347
1121
|
var props = useMessages();
|
|
1348
|
-
return
|
|
1122
|
+
return useMemo4(function() {
|
|
1349
1123
|
return _object_spread_props(_object_spread({}, props), {
|
|
1350
1124
|
latestMessage: props.messages[0] || null
|
|
1351
1125
|
});
|
|
@@ -1354,13 +1128,13 @@ var useLatestMessage = function() {
|
|
|
1354
1128
|
]);
|
|
1355
1129
|
};
|
|
1356
1130
|
// src/components/suggestions/Suggestions/Content.tsx
|
|
1357
|
-
import { useMemo as
|
|
1131
|
+
import { useMemo as useMemo5 } from "react";
|
|
1358
1132
|
import { isEmpty } from "radash";
|
|
1359
1133
|
import { onlyText } from "react-children-utilities";
|
|
1360
|
-
import { Flex as
|
|
1134
|
+
import { Flex as Flex7 } from "@radix-ui/themes";
|
|
1361
1135
|
// src/components/suggestions/Suggestions/Item.tsx
|
|
1362
1136
|
import { ArrowUpIcon } from "@radix-ui/react-icons";
|
|
1363
|
-
import { Text as
|
|
1137
|
+
import { Text as Text4, Button as Button2, Spinner } from "@radix-ui/themes";
|
|
1364
1138
|
// src/hooks/messages/useCreateMessage/index.ts
|
|
1365
1139
|
import { partob } from "radash";
|
|
1366
1140
|
import { useMutation, useQueryClient as useQueryClient3 } from "@tanstack/react-query";
|
|
@@ -1485,16 +1259,16 @@ var threadCreated = function(param) {
|
|
|
1485
1259
|
});
|
|
1486
1260
|
};
|
|
1487
1261
|
// src/lib/optimistic/isOptimistic.ts
|
|
1488
|
-
import
|
|
1262
|
+
import _3 from "lodash";
|
|
1489
1263
|
var isOptimistic = function(param) {
|
|
1490
1264
|
var id = param.id;
|
|
1491
|
-
return
|
|
1265
|
+
return _3.startsWith(id, "-");
|
|
1492
1266
|
};
|
|
1493
1267
|
// src/hooks/messages/useCreateMessage/lib/mutationOptions/mutationFn/handleResponse/handlers/extendMessage.ts
|
|
1494
|
-
import { last
|
|
1268
|
+
import { last } from "radash";
|
|
1495
1269
|
var extendMessage = function(param) {
|
|
1496
1270
|
var message = param.message, messages2 = param.messages;
|
|
1497
|
-
var
|
|
1271
|
+
var _last, _last1;
|
|
1498
1272
|
var prevRunMessages = messages2.filter(function(m) {
|
|
1499
1273
|
return m.run_id === message.run_id;
|
|
1500
1274
|
});
|
|
@@ -1503,8 +1277,8 @@ var extendMessage = function(param) {
|
|
|
1503
1277
|
id: m.id
|
|
1504
1278
|
});
|
|
1505
1279
|
});
|
|
1506
|
-
var
|
|
1507
|
-
var runSteps = (_ref = (
|
|
1280
|
+
var _last_runSteps, _ref;
|
|
1281
|
+
var runSteps = (_ref = (_last_runSteps = (_last = last(prevOptimitisticRunMessages)) === null || _last === void 0 ? void 0 : _last.runSteps) !== null && _last_runSteps !== void 0 ? _last_runSteps : (_last1 = last(prevRunMessages)) === null || _last1 === void 0 ? void 0 : _last1.runSteps) !== null && _ref !== void 0 ? _ref : [];
|
|
1508
1282
|
return _object_spread_props(_object_spread({}, message), {
|
|
1509
1283
|
runSteps: runSteps
|
|
1510
1284
|
});
|
|
@@ -1556,7 +1330,7 @@ var threadMessageCreated = function(param) {
|
|
|
1556
1330
|
});
|
|
1557
1331
|
};
|
|
1558
1332
|
// src/hooks/messages/useCreateMessage/lib/mutationOptions/mutationFn/handleResponse/handlers/threadMessageDelta.ts
|
|
1559
|
-
import
|
|
1333
|
+
import _4 from "lodash";
|
|
1560
1334
|
import { omit as omit2 } from "radash";
|
|
1561
1335
|
var updatedContentPart = function(param) {
|
|
1562
1336
|
var prevContentPart = param.prevContentPart, delta = param.delta;
|
|
@@ -1579,7 +1353,7 @@ var updatedContentPart = function(param) {
|
|
|
1579
1353
|
var updatedContent = function(param) {
|
|
1580
1354
|
var content = param.content, value = param.value;
|
|
1581
1355
|
if (!value.data.delta.content) return content;
|
|
1582
|
-
var result =
|
|
1356
|
+
var result = _4.cloneDeep(content);
|
|
1583
1357
|
value.data.delta.content.forEach(function(delta) {
|
|
1584
1358
|
result[delta.index] = updatedContentPart({
|
|
1585
1359
|
// @ts-ignore-next-line
|
|
@@ -1713,7 +1487,7 @@ var threadRunStepCreated = function(param) {
|
|
|
1713
1487
|
});
|
|
1714
1488
|
};
|
|
1715
1489
|
// src/hooks/messages/useCreateMessage/lib/mutationOptions/mutationFn/handleResponse/handlers/threadRunStepDelta.ts
|
|
1716
|
-
import
|
|
1490
|
+
import _5 from "lodash";
|
|
1717
1491
|
import { omit as omit3 } from "radash";
|
|
1718
1492
|
var updatedToolCall = function(param) {
|
|
1719
1493
|
var toolCall = param.toolCall, delta = param.delta;
|
|
@@ -1723,7 +1497,7 @@ var updatedToolCall = function(param) {
|
|
|
1723
1497
|
]);
|
|
1724
1498
|
}
|
|
1725
1499
|
if (delta.type === "function" && delta.function && toolCall.type === "function" && toolCall.function) {
|
|
1726
|
-
var result =
|
|
1500
|
+
var result = _5.cloneDeep(toolCall);
|
|
1727
1501
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
1728
1502
|
try {
|
|
1729
1503
|
for(var _iterator = Object.entries(delta.function)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
@@ -1755,7 +1529,7 @@ var updatedRunStep = function(param) {
|
|
|
1755
1529
|
if (!(runStep === null || runStep === void 0 ? void 0 : (_runStep_step_details = runStep.step_details) === null || _runStep_step_details === void 0 ? void 0 : _runStep_step_details.tool_calls)) return runStep;
|
|
1756
1530
|
if (((_value_data_delta = value.data.delta) === null || _value_data_delta === void 0 ? void 0 : (_value_data_delta_step_details = _value_data_delta.step_details) === null || _value_data_delta_step_details === void 0 ? void 0 : _value_data_delta_step_details.type) === "tool_calls") {
|
|
1757
1531
|
if (!value.data.delta.step_details.tool_calls) return runStep;
|
|
1758
|
-
var newToolCalls =
|
|
1532
|
+
var newToolCalls = _5.cloneDeep(runStep.step_details.tool_calls);
|
|
1759
1533
|
value.data.delta.step_details.tool_calls.forEach(function(delta) {
|
|
1760
1534
|
return newToolCalls[delta.index] = updatedToolCall({
|
|
1761
1535
|
toolCall: newToolCalls[delta.index],
|
|
@@ -2119,6 +1893,18 @@ var useCreateMessage = function() {
|
|
|
2119
1893
|
};
|
|
2120
1894
|
// src/components/suggestions/Suggestions/Item.tsx
|
|
2121
1895
|
import { useQueryClient as useQueryClient4 } from "@tanstack/react-query";
|
|
1896
|
+
// src/hooks/toasts/useToasts/index.ts
|
|
1897
|
+
import { useContext as useContext4 } from "react";
|
|
1898
|
+
// src/contexts/toasts/ToastsContext/index.ts
|
|
1899
|
+
import { createContext as createContext5 } from "react";
|
|
1900
|
+
var ToastsContext = createContext5({
|
|
1901
|
+
toasts: [],
|
|
1902
|
+
addToast: function() {}
|
|
1903
|
+
});
|
|
1904
|
+
// src/hooks/toasts/useToasts/index.ts
|
|
1905
|
+
var useToasts = function() {
|
|
1906
|
+
return useContext4(ToastsContext);
|
|
1907
|
+
};
|
|
2122
1908
|
// src/lib/errors/createMessageDefaultOnError.ts
|
|
2123
1909
|
var createMessageDefaultOnError = function(param) {
|
|
2124
1910
|
var queryClient = param.queryClient, addToast = param.addToast, threadContext = param.threadContext;
|
|
@@ -2145,9 +1931,9 @@ var createMessageDefaultOnError = function(param) {
|
|
|
2145
1931
|
};
|
|
2146
1932
|
};
|
|
2147
1933
|
// src/components/suggestions/Suggestions/Item.tsx
|
|
2148
|
-
import { jsx as
|
|
1934
|
+
import { jsx as jsx27, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2149
1935
|
var Item = function(param) {
|
|
2150
|
-
var suggestion = param.suggestion, isDisabled = param.isDisabled;
|
|
1936
|
+
var suggestion = param.suggestion, isDisabled = param.isDisabled, className = param.className, style = param.style;
|
|
2151
1937
|
var addToast = useToasts().addToast;
|
|
2152
1938
|
var queryClient = useQueryClient4();
|
|
2153
1939
|
var threadContext = useSuperinterfaceContext();
|
|
@@ -2158,7 +1944,7 @@ var Item = function(param) {
|
|
|
2158
1944
|
threadContext: threadContext
|
|
2159
1945
|
})
|
|
2160
1946
|
}), createMessage = _useCreateMessage.createMessage, isPending = _useCreateMessage.isPending;
|
|
2161
|
-
return /* @__PURE__ */
|
|
1947
|
+
return /* @__PURE__ */ jsx27(Content3, {
|
|
2162
1948
|
onClick: function() {
|
|
2163
1949
|
createMessage({
|
|
2164
1950
|
// @ts-ignore-next-line
|
|
@@ -2167,29 +1953,32 @@ var Item = function(param) {
|
|
|
2167
1953
|
},
|
|
2168
1954
|
isDisabled: isDisabled,
|
|
2169
1955
|
isPending: isPending,
|
|
1956
|
+
className: className,
|
|
1957
|
+
style: style,
|
|
2170
1958
|
children: suggestion
|
|
2171
1959
|
});
|
|
2172
1960
|
};
|
|
2173
1961
|
var Content3 = function(param) {
|
|
2174
|
-
var onClick = param.onClick, isDisabled = param.isDisabled, isPending = param.isPending, children = param.children;
|
|
2175
|
-
return /* @__PURE__ */
|
|
1962
|
+
var onClick = param.onClick, isDisabled = param.isDisabled, isPending = param.isPending, children = param.children, className = param.className, style = param.style;
|
|
1963
|
+
return /* @__PURE__ */ jsxs10(Button2, {
|
|
1964
|
+
className: className,
|
|
2176
1965
|
variant: "soft",
|
|
2177
1966
|
onClick: onClick,
|
|
2178
1967
|
disabled: isDisabled,
|
|
2179
|
-
style: {
|
|
1968
|
+
style: _object_spread({
|
|
2180
1969
|
minHeight: "var(--base-button-height)",
|
|
2181
1970
|
height: "inherit",
|
|
2182
1971
|
flexShrink: 1
|
|
2183
|
-
},
|
|
1972
|
+
}, style !== null && style !== void 0 ? style : {}),
|
|
2184
1973
|
children: [
|
|
2185
|
-
/* @__PURE__ */
|
|
1974
|
+
/* @__PURE__ */ jsx27(Text4, {
|
|
2186
1975
|
size: "1",
|
|
2187
1976
|
weight: "regular",
|
|
2188
1977
|
children: children
|
|
2189
1978
|
}),
|
|
2190
|
-
/* @__PURE__ */
|
|
1979
|
+
/* @__PURE__ */ jsx27(Spinner, {
|
|
2191
1980
|
loading: isPending,
|
|
2192
|
-
children: /* @__PURE__ */
|
|
1981
|
+
children: /* @__PURE__ */ jsx27(ArrowUpIcon, {
|
|
2193
1982
|
style: {
|
|
2194
1983
|
flexShrink: 0
|
|
2195
1984
|
}
|
|
@@ -2200,11 +1989,11 @@ var Content3 = function(param) {
|
|
|
2200
1989
|
};
|
|
2201
1990
|
Item.Content = Content3;
|
|
2202
1991
|
// src/components/suggestions/Suggestions/Content.tsx
|
|
2203
|
-
import { jsx as
|
|
1992
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2204
1993
|
var Content4 = function(param) {
|
|
2205
|
-
var children = param.children;
|
|
1994
|
+
var children = param.children, className = param.className, style = param.style;
|
|
2206
1995
|
var isMutatingMessage = useIsMutatingMessage();
|
|
2207
|
-
var suggestions =
|
|
1996
|
+
var suggestions = useMemo5(function() {
|
|
2208
1997
|
return onlyText(children).split(/\r?\n/).filter(function(c) {
|
|
2209
1998
|
return !isEmpty(c);
|
|
2210
1999
|
}).map(function(c) {
|
|
@@ -2214,12 +2003,14 @@ var Content4 = function(param) {
|
|
|
2214
2003
|
children
|
|
2215
2004
|
]);
|
|
2216
2005
|
if (isEmpty(suggestions)) return null;
|
|
2217
|
-
return /* @__PURE__ */
|
|
2006
|
+
return /* @__PURE__ */ jsx28(Flex7, {
|
|
2218
2007
|
gap: "2",
|
|
2219
2008
|
py: "2",
|
|
2220
2009
|
wrap: "wrap",
|
|
2010
|
+
className: className,
|
|
2011
|
+
style: style,
|
|
2221
2012
|
children: suggestions.map(function(suggestion) {
|
|
2222
|
-
return /* @__PURE__ */
|
|
2013
|
+
return /* @__PURE__ */ jsx28(Item, {
|
|
2223
2014
|
suggestion: suggestion,
|
|
2224
2015
|
isDisabled: isMutatingMessage
|
|
2225
2016
|
}, suggestion);
|
|
@@ -2227,11 +2018,11 @@ var Content4 = function(param) {
|
|
|
2227
2018
|
});
|
|
2228
2019
|
};
|
|
2229
2020
|
// src/components/suggestions/Suggestions/index.tsx
|
|
2230
|
-
import { jsx as
|
|
2021
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
2231
2022
|
var Suggestions = function(param) {
|
|
2232
|
-
var children = param.children;
|
|
2023
|
+
var children = param.children, className = param.className, style = param.style;
|
|
2233
2024
|
var latestMessageProps = useLatestMessage();
|
|
2234
|
-
var isDisabled =
|
|
2025
|
+
var isDisabled = useMemo6(function() {
|
|
2235
2026
|
var // @ts-ignore-next-line
|
|
2236
2027
|
_latestMessageProps_latestMessage_metadata, _latestMessageProps_latestMessage;
|
|
2237
2028
|
return (_latestMessageProps_latestMessage = latestMessageProps.latestMessage) === null || _latestMessageProps_latestMessage === void 0 ? void 0 : (_latestMessageProps_latestMessage_metadata = _latestMessageProps_latestMessage.metadata) === null || _latestMessageProps_latestMessage_metadata === void 0 ? void 0 : _latestMessageProps_latestMessage_metadata.isBlocking;
|
|
@@ -2240,31 +2031,33 @@ var Suggestions = function(param) {
|
|
|
2240
2031
|
]);
|
|
2241
2032
|
if (latestMessageProps.isLoading) return null;
|
|
2242
2033
|
if (isDisabled) return null;
|
|
2243
|
-
return /* @__PURE__ */
|
|
2034
|
+
return /* @__PURE__ */ jsx29(Content4, {
|
|
2035
|
+
className: className,
|
|
2036
|
+
style: style,
|
|
2244
2037
|
children: children
|
|
2245
2038
|
});
|
|
2246
2039
|
};
|
|
2247
2040
|
Suggestions.Item = Item;
|
|
2248
2041
|
// src/contexts/markdown/MarkdownContext/lib/components/Code.tsx
|
|
2249
|
-
import { jsx as
|
|
2042
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
2250
2043
|
var Code3 = function(param) {
|
|
2251
2044
|
var children = param.children, className = param.className;
|
|
2252
2045
|
if (className === "language-suggestions") {
|
|
2253
|
-
return /* @__PURE__ */
|
|
2046
|
+
return /* @__PURE__ */ jsx30(Suggestions, {
|
|
2254
2047
|
children: children
|
|
2255
2048
|
});
|
|
2256
2049
|
}
|
|
2257
|
-
return /* @__PURE__ */
|
|
2050
|
+
return /* @__PURE__ */ jsx30(RadixCode, {
|
|
2258
2051
|
children: children
|
|
2259
2052
|
});
|
|
2260
2053
|
};
|
|
2261
2054
|
// src/components/images/Image.tsx
|
|
2262
|
-
import { Box as
|
|
2263
|
-
import { jsx as
|
|
2055
|
+
import { Box as Box8 } from "@radix-ui/themes";
|
|
2056
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2264
2057
|
var Image = function(props) {
|
|
2265
|
-
return /* @__PURE__ */
|
|
2058
|
+
return /* @__PURE__ */ jsx31(Box8, {
|
|
2266
2059
|
pb: "3",
|
|
2267
|
-
children: /* @__PURE__ */
|
|
2060
|
+
children: /* @__PURE__ */ jsx31("img", _object_spread_props(_object_spread({}, props), {
|
|
2268
2061
|
style: {
|
|
2269
2062
|
maxWidth: "100%",
|
|
2270
2063
|
height: "auto"
|
|
@@ -2319,21 +2112,21 @@ var isAudioSrc = function(param) {
|
|
|
2319
2112
|
return src.endsWith(".mp3") || src.endsWith(".wav");
|
|
2320
2113
|
};
|
|
2321
2114
|
// src/contexts/markdown/MarkdownContext/lib/components/Img/Video/index.tsx
|
|
2322
|
-
import { Flex as
|
|
2115
|
+
import { Flex as Flex8 } from "@radix-ui/themes";
|
|
2323
2116
|
import "@vidstack/react/player/styles/base.css";
|
|
2324
2117
|
import { MediaPlayer, MediaProvider, Controls } from "@vidstack/react";
|
|
2325
2118
|
// src/components/media/PlayButton.tsx
|
|
2326
2119
|
import { PlayButton as VidstackPlayButton, useMediaState } from "@vidstack/react";
|
|
2327
2120
|
import { IconButton } from "@radix-ui/themes";
|
|
2328
2121
|
import { PlayIcon, PauseIcon } from "@radix-ui/react-icons";
|
|
2329
|
-
import { jsx as
|
|
2122
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2330
2123
|
var PlayButton = function() {
|
|
2331
2124
|
var isPaused = useMediaState("paused");
|
|
2332
|
-
return /* @__PURE__ */
|
|
2125
|
+
return /* @__PURE__ */ jsx32(IconButton, {
|
|
2333
2126
|
variant: "ghost",
|
|
2334
2127
|
asChild: true,
|
|
2335
|
-
children: /* @__PURE__ */
|
|
2336
|
-
children: isPaused ? /* @__PURE__ */
|
|
2128
|
+
children: /* @__PURE__ */ jsx32(VidstackPlayButton, {
|
|
2129
|
+
children: isPaused ? /* @__PURE__ */ jsx32(PlayIcon, {}) : /* @__PURE__ */ jsx32(PauseIcon, {})
|
|
2337
2130
|
})
|
|
2338
2131
|
});
|
|
2339
2132
|
};
|
|
@@ -2341,27 +2134,27 @@ var PlayButton = function() {
|
|
|
2341
2134
|
import { MuteButton, useMediaState as useMediaState2, useMediaRemote } from "@vidstack/react";
|
|
2342
2135
|
import { IconButton as IconButton2, HoverCard, Slider } from "@radix-ui/themes";
|
|
2343
2136
|
import { SpeakerModerateIcon, SpeakerOffIcon } from "@radix-ui/react-icons";
|
|
2344
|
-
import { jsx as
|
|
2137
|
+
import { jsx as jsx33, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2345
2138
|
var VolumeButton = function() {
|
|
2346
2139
|
var volume = useMediaState2("volume");
|
|
2347
2140
|
var isMuted = useMediaState2("muted");
|
|
2348
2141
|
var remote = useMediaRemote();
|
|
2349
|
-
return /* @__PURE__ */
|
|
2142
|
+
return /* @__PURE__ */ jsxs11(HoverCard.Root, {
|
|
2350
2143
|
children: [
|
|
2351
|
-
/* @__PURE__ */
|
|
2352
|
-
children: /* @__PURE__ */
|
|
2144
|
+
/* @__PURE__ */ jsx33(HoverCard.Trigger, {
|
|
2145
|
+
children: /* @__PURE__ */ jsx33(IconButton2, {
|
|
2353
2146
|
variant: "ghost",
|
|
2354
2147
|
asChild: true,
|
|
2355
|
-
children: /* @__PURE__ */
|
|
2356
|
-
children: isMuted || volume === 0 ? /* @__PURE__ */
|
|
2148
|
+
children: /* @__PURE__ */ jsx33(MuteButton, {
|
|
2149
|
+
children: isMuted || volume === 0 ? /* @__PURE__ */ jsx33(SpeakerOffIcon, {}) : /* @__PURE__ */ jsx33(SpeakerModerateIcon, {})
|
|
2357
2150
|
})
|
|
2358
2151
|
})
|
|
2359
2152
|
}),
|
|
2360
|
-
/* @__PURE__ */
|
|
2153
|
+
/* @__PURE__ */ jsx33(HoverCard.Content, {
|
|
2361
2154
|
size: "1",
|
|
2362
2155
|
side: "top",
|
|
2363
2156
|
height: "100px",
|
|
2364
|
-
children: /* @__PURE__ */
|
|
2157
|
+
children: /* @__PURE__ */ jsx33(Slider, {
|
|
2365
2158
|
size: "1",
|
|
2366
2159
|
variant: "soft",
|
|
2367
2160
|
orientation: "vertical",
|
|
@@ -2378,10 +2171,10 @@ var VolumeButton = function() {
|
|
|
2378
2171
|
});
|
|
2379
2172
|
};
|
|
2380
2173
|
// src/components/media/Time.tsx
|
|
2381
|
-
import { useState, useEffect, useMemo as
|
|
2174
|
+
import { useState, useEffect, useMemo as useMemo7 } from "react";
|
|
2382
2175
|
import { useMediaState as useMediaState3, useMediaRemote as useMediaRemote2 } from "@vidstack/react";
|
|
2383
2176
|
import { Slider as Slider2 } from "@radix-ui/themes";
|
|
2384
|
-
import { jsx as
|
|
2177
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
2385
2178
|
var Time = function() {
|
|
2386
2179
|
var time = useMediaState3("currentTime");
|
|
2387
2180
|
var duration = useMediaState3("duration");
|
|
@@ -2397,12 +2190,12 @@ var Time = function() {
|
|
|
2397
2190
|
duration,
|
|
2398
2191
|
seeking
|
|
2399
2192
|
]);
|
|
2400
|
-
var step =
|
|
2193
|
+
var step = useMemo7(function() {
|
|
2401
2194
|
return 1 / duration * 100;
|
|
2402
2195
|
}, [
|
|
2403
2196
|
duration
|
|
2404
2197
|
]);
|
|
2405
|
-
return /* @__PURE__ */
|
|
2198
|
+
return /* @__PURE__ */ jsx34(Slider2, {
|
|
2406
2199
|
size: "1",
|
|
2407
2200
|
variant: "soft",
|
|
2408
2201
|
value: [
|
|
@@ -2423,12 +2216,12 @@ var Time = function() {
|
|
|
2423
2216
|
};
|
|
2424
2217
|
// src/components/media/MediaContainer.tsx
|
|
2425
2218
|
import { Card, Inset } from "@radix-ui/themes";
|
|
2426
|
-
import { jsx as
|
|
2219
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
2427
2220
|
var MediaContainer = function(param) {
|
|
2428
2221
|
var children = param.children;
|
|
2429
|
-
return /* @__PURE__ */
|
|
2222
|
+
return /* @__PURE__ */ jsx35(Card, {
|
|
2430
2223
|
mb: "3",
|
|
2431
|
-
children: /* @__PURE__ */
|
|
2224
|
+
children: /* @__PURE__ */ jsx35(Inset, {
|
|
2432
2225
|
clip: "padding-box",
|
|
2433
2226
|
style: {
|
|
2434
2227
|
display: "flex",
|
|
@@ -2442,23 +2235,23 @@ var MediaContainer = function(param) {
|
|
|
2442
2235
|
import { FullscreenButton as VidstackFullscreenButton, useMediaState as useMediaState4 } from "@vidstack/react";
|
|
2443
2236
|
import { IconButton as IconButton3 } from "@radix-ui/themes";
|
|
2444
2237
|
import { EnterFullScreenIcon, ExitFullScreenIcon } from "@radix-ui/react-icons";
|
|
2445
|
-
import { jsx as
|
|
2238
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
2446
2239
|
var FullscreenButton = function() {
|
|
2447
2240
|
var isFullscreen = useMediaState4("fullscreen");
|
|
2448
|
-
return /* @__PURE__ */
|
|
2241
|
+
return /* @__PURE__ */ jsx36(IconButton3, {
|
|
2449
2242
|
variant: "ghost",
|
|
2450
2243
|
asChild: true,
|
|
2451
|
-
children: /* @__PURE__ */
|
|
2452
|
-
children: isFullscreen ? /* @__PURE__ */
|
|
2244
|
+
children: /* @__PURE__ */ jsx36(VidstackFullscreenButton, {
|
|
2245
|
+
children: isFullscreen ? /* @__PURE__ */ jsx36(ExitFullScreenIcon, {}) : /* @__PURE__ */ jsx36(EnterFullScreenIcon, {})
|
|
2453
2246
|
})
|
|
2454
2247
|
});
|
|
2455
2248
|
};
|
|
2456
2249
|
// src/contexts/markdown/MarkdownContext/lib/components/Img/Video/index.tsx
|
|
2457
|
-
import { jsx as
|
|
2250
|
+
import { jsx as jsx37, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2458
2251
|
var Video = function(param) {
|
|
2459
2252
|
var src = param.src;
|
|
2460
|
-
return /* @__PURE__ */
|
|
2461
|
-
children: /* @__PURE__ */
|
|
2253
|
+
return /* @__PURE__ */ jsx37(MediaContainer, {
|
|
2254
|
+
children: /* @__PURE__ */ jsxs12(MediaPlayer, {
|
|
2462
2255
|
src: {
|
|
2463
2256
|
src: src,
|
|
2464
2257
|
type: "video/".concat(src.split(".").pop())
|
|
@@ -2467,11 +2260,11 @@ var Video = function(param) {
|
|
|
2467
2260
|
hideControlsOnMouseLeave: true,
|
|
2468
2261
|
crossOrigin: true,
|
|
2469
2262
|
children: [
|
|
2470
|
-
/* @__PURE__ */
|
|
2471
|
-
/* @__PURE__ */
|
|
2263
|
+
/* @__PURE__ */ jsx37(MediaProvider, {}),
|
|
2264
|
+
/* @__PURE__ */ jsx37("style", {
|
|
2472
2265
|
children: "\n .superinterface-video-controls {\n opacity: 0;\n transition: opacity 0.2s ease-out;\n }\n\n .superinterface-video-controls[data-visible] {\n opacity: 1;\n }\n "
|
|
2473
2266
|
}),
|
|
2474
|
-
/* @__PURE__ */
|
|
2267
|
+
/* @__PURE__ */ jsx37(Flex8, {
|
|
2475
2268
|
asChild: true,
|
|
2476
2269
|
position: "absolute",
|
|
2477
2270
|
bottom: "0",
|
|
@@ -2483,18 +2276,18 @@ var Video = function(param) {
|
|
|
2483
2276
|
zIndex: 10,
|
|
2484
2277
|
background: "var(--accent-4)"
|
|
2485
2278
|
},
|
|
2486
|
-
children: /* @__PURE__ */
|
|
2487
|
-
children: /* @__PURE__ */
|
|
2279
|
+
children: /* @__PURE__ */ jsx37(Controls.Root, {
|
|
2280
|
+
children: /* @__PURE__ */ jsx37(Flex8, {
|
|
2488
2281
|
asChild: true,
|
|
2489
2282
|
align: "center",
|
|
2490
2283
|
gap: "3",
|
|
2491
2284
|
flexGrow: "1",
|
|
2492
|
-
children: /* @__PURE__ */
|
|
2285
|
+
children: /* @__PURE__ */ jsxs12(Controls.Group, {
|
|
2493
2286
|
children: [
|
|
2494
|
-
/* @__PURE__ */
|
|
2495
|
-
/* @__PURE__ */
|
|
2496
|
-
/* @__PURE__ */
|
|
2497
|
-
/* @__PURE__ */
|
|
2287
|
+
/* @__PURE__ */ jsx37(PlayButton, {}),
|
|
2288
|
+
/* @__PURE__ */ jsx37(Time, {}),
|
|
2289
|
+
/* @__PURE__ */ jsx37(VolumeButton, {}),
|
|
2290
|
+
/* @__PURE__ */ jsx37(FullscreenButton, {})
|
|
2498
2291
|
]
|
|
2499
2292
|
})
|
|
2500
2293
|
})
|
|
@@ -2505,14 +2298,14 @@ var Video = function(param) {
|
|
|
2505
2298
|
});
|
|
2506
2299
|
};
|
|
2507
2300
|
// src/contexts/markdown/MarkdownContext/lib/components/Img/Audio/index.tsx
|
|
2508
|
-
import { Flex as
|
|
2301
|
+
import { Flex as Flex9 } from "@radix-ui/themes";
|
|
2509
2302
|
import "@vidstack/react/player/styles/base.css";
|
|
2510
2303
|
import { MediaPlayer as MediaPlayer2, MediaProvider as MediaProvider2, Controls as Controls2 } from "@vidstack/react";
|
|
2511
|
-
import { jsx as
|
|
2304
|
+
import { jsx as jsx38, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2512
2305
|
var Audio = function(param) {
|
|
2513
2306
|
var src = param.src;
|
|
2514
|
-
return /* @__PURE__ */
|
|
2515
|
-
children: /* @__PURE__ */
|
|
2307
|
+
return /* @__PURE__ */ jsx38(MediaContainer, {
|
|
2308
|
+
children: /* @__PURE__ */ jsxs13(MediaPlayer2, {
|
|
2516
2309
|
src: {
|
|
2517
2310
|
src: src,
|
|
2518
2311
|
type: "audio/".concat(src.split(".").pop())
|
|
@@ -2521,8 +2314,8 @@ var Audio = function(param) {
|
|
|
2521
2314
|
crossOrigin: true,
|
|
2522
2315
|
playsInline: true,
|
|
2523
2316
|
children: [
|
|
2524
|
-
/* @__PURE__ */
|
|
2525
|
-
/* @__PURE__ */
|
|
2317
|
+
/* @__PURE__ */ jsx38(MediaProvider2, {}),
|
|
2318
|
+
/* @__PURE__ */ jsx38(Flex9, {
|
|
2526
2319
|
asChild: true,
|
|
2527
2320
|
p: "3",
|
|
2528
2321
|
flexGrow: "1",
|
|
@@ -2530,17 +2323,17 @@ var Audio = function(param) {
|
|
|
2530
2323
|
zIndex: 10,
|
|
2531
2324
|
background: "var(--accent-4)"
|
|
2532
2325
|
},
|
|
2533
|
-
children: /* @__PURE__ */
|
|
2534
|
-
children: /* @__PURE__ */
|
|
2326
|
+
children: /* @__PURE__ */ jsx38(Controls2.Root, {
|
|
2327
|
+
children: /* @__PURE__ */ jsx38(Flex9, {
|
|
2535
2328
|
asChild: true,
|
|
2536
2329
|
align: "center",
|
|
2537
2330
|
gap: "3",
|
|
2538
2331
|
flexGrow: "1",
|
|
2539
|
-
children: /* @__PURE__ */
|
|
2332
|
+
children: /* @__PURE__ */ jsxs13(Controls2.Group, {
|
|
2540
2333
|
children: [
|
|
2541
|
-
/* @__PURE__ */
|
|
2542
|
-
/* @__PURE__ */
|
|
2543
|
-
/* @__PURE__ */
|
|
2334
|
+
/* @__PURE__ */ jsx38(PlayButton, {}),
|
|
2335
|
+
/* @__PURE__ */ jsx38(Time, {}),
|
|
2336
|
+
/* @__PURE__ */ jsx38(VolumeButton, {})
|
|
2544
2337
|
]
|
|
2545
2338
|
})
|
|
2546
2339
|
})
|
|
@@ -2551,48 +2344,48 @@ var Audio = function(param) {
|
|
|
2551
2344
|
});
|
|
2552
2345
|
};
|
|
2553
2346
|
// src/contexts/markdown/MarkdownContext/lib/components/Img/index.tsx
|
|
2554
|
-
import { jsx as
|
|
2347
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
2555
2348
|
var Img = function(props) {
|
|
2556
2349
|
if (!props.src) {
|
|
2557
|
-
return /* @__PURE__ */
|
|
2350
|
+
return /* @__PURE__ */ jsx39(Image, _object_spread({}, props));
|
|
2558
2351
|
} else if (isVideoSrc({
|
|
2559
2352
|
src: props.src
|
|
2560
2353
|
})) {
|
|
2561
|
-
return /* @__PURE__ */
|
|
2354
|
+
return /* @__PURE__ */ jsx39(Video, {
|
|
2562
2355
|
src: props.src
|
|
2563
2356
|
});
|
|
2564
2357
|
} else if (isAudioSrc({
|
|
2565
2358
|
src: props.src
|
|
2566
2359
|
})) {
|
|
2567
|
-
return /* @__PURE__ */
|
|
2360
|
+
return /* @__PURE__ */ jsx39(Audio, {
|
|
2568
2361
|
src: props.src
|
|
2569
2362
|
});
|
|
2570
2363
|
} else {
|
|
2571
|
-
return /* @__PURE__ */
|
|
2364
|
+
return /* @__PURE__ */ jsx39(Image, _object_spread({}, props));
|
|
2572
2365
|
}
|
|
2573
2366
|
};
|
|
2574
2367
|
// src/contexts/markdown/MarkdownContext/lib/components/Annotation/index.tsx
|
|
2575
2368
|
import { QuoteIcon } from "@radix-ui/react-icons";
|
|
2576
2369
|
// src/contexts/markdown/MarkdownContext/lib/components/Annotation/AnnotationBase.tsx
|
|
2577
|
-
import { IconButton as IconButton4, Popover as Popover4, Flex as
|
|
2578
|
-
import { jsx as
|
|
2370
|
+
import { IconButton as IconButton4, Popover as Popover4, Flex as Flex10, Text as Text5 } from "@radix-ui/themes";
|
|
2371
|
+
import { jsx as jsx40, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2579
2372
|
var AnnotationBase = function(param) {
|
|
2580
2373
|
var icon = param.icon, content = param.content;
|
|
2581
|
-
return /* @__PURE__ */
|
|
2374
|
+
return /* @__PURE__ */ jsxs14(Popover4.Root, {
|
|
2582
2375
|
children: [
|
|
2583
|
-
/* @__PURE__ */
|
|
2584
|
-
children: /* @__PURE__ */
|
|
2376
|
+
/* @__PURE__ */ jsx40(Popover4.Trigger, {
|
|
2377
|
+
children: /* @__PURE__ */ jsx40(IconButton4, {
|
|
2585
2378
|
variant: "soft",
|
|
2586
2379
|
color: "gray",
|
|
2587
2380
|
size: "1",
|
|
2588
2381
|
children: icon
|
|
2589
2382
|
})
|
|
2590
2383
|
}),
|
|
2591
|
-
/* @__PURE__ */
|
|
2384
|
+
/* @__PURE__ */ jsx40(Popover4.Content, {
|
|
2592
2385
|
size: "1",
|
|
2593
|
-
children: /* @__PURE__ */
|
|
2386
|
+
children: /* @__PURE__ */ jsx40(Flex10, {
|
|
2594
2387
|
direction: "column",
|
|
2595
|
-
children: /* @__PURE__ */
|
|
2388
|
+
children: /* @__PURE__ */ jsx40(Text5, {
|
|
2596
2389
|
size: "1",
|
|
2597
2390
|
color: "gray",
|
|
2598
2391
|
children: content
|
|
@@ -2603,12 +2396,12 @@ var AnnotationBase = function(param) {
|
|
|
2603
2396
|
});
|
|
2604
2397
|
};
|
|
2605
2398
|
// src/contexts/markdown/MarkdownContext/lib/components/Annotation/FilePathAnnotation.tsx
|
|
2606
|
-
import { jsx as
|
|
2399
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
2607
2400
|
var FilePathAnnotation = function(param) {
|
|
2608
2401
|
var annotation = param.annotation, children = param.children;
|
|
2609
2402
|
var superinterfaceContext = useSuperinterfaceContext();
|
|
2610
2403
|
var nextSearchParams = new URLSearchParams(superinterfaceContext.variables);
|
|
2611
|
-
return /* @__PURE__ */
|
|
2404
|
+
return /* @__PURE__ */ jsx41(Link, {
|
|
2612
2405
|
href: "".concat(superinterfaceContext.baseUrl, "/files/").concat(annotation.file_path.file_id, "/contents?").concat(nextSearchParams),
|
|
2613
2406
|
target: "_self",
|
|
2614
2407
|
download: true,
|
|
@@ -2616,16 +2409,16 @@ var FilePathAnnotation = function(param) {
|
|
|
2616
2409
|
});
|
|
2617
2410
|
};
|
|
2618
2411
|
// src/contexts/markdown/MarkdownContext/lib/components/Annotation/index.tsx
|
|
2619
|
-
import { jsx as
|
|
2412
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
2620
2413
|
var Annotation = function(param) {
|
|
2621
2414
|
var annotation = param.annotation, children = param.children;
|
|
2622
2415
|
if (annotation.type === "file_citation") {
|
|
2623
|
-
return /* @__PURE__ */
|
|
2624
|
-
icon: /* @__PURE__ */
|
|
2416
|
+
return /* @__PURE__ */ jsx42(AnnotationBase, {
|
|
2417
|
+
icon: /* @__PURE__ */ jsx42(QuoteIcon, {}),
|
|
2625
2418
|
content: "File cited."
|
|
2626
2419
|
});
|
|
2627
2420
|
} else if (annotation.type === "file_path") {
|
|
2628
|
-
return /* @__PURE__ */
|
|
2421
|
+
return /* @__PURE__ */ jsx42(FilePathAnnotation, {
|
|
2629
2422
|
annotation: annotation,
|
|
2630
2423
|
children: children
|
|
2631
2424
|
});
|
|
@@ -2633,7 +2426,7 @@ var Annotation = function(param) {
|
|
|
2633
2426
|
return null;
|
|
2634
2427
|
};
|
|
2635
2428
|
// src/contexts/markdown/MarkdownContext/lib/components/index.tsx
|
|
2636
|
-
import { jsx as
|
|
2429
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
2637
2430
|
var components = {
|
|
2638
2431
|
p: Paragraph,
|
|
2639
2432
|
a: Link,
|
|
@@ -2646,48 +2439,48 @@ var components = {
|
|
|
2646
2439
|
img: Img,
|
|
2647
2440
|
annotation: Annotation,
|
|
2648
2441
|
h1: function(props) {
|
|
2649
|
-
return /* @__PURE__ */
|
|
2442
|
+
return /* @__PURE__ */ jsx43(Heading, {
|
|
2650
2443
|
as: "h1",
|
|
2651
2444
|
children: props.children
|
|
2652
2445
|
});
|
|
2653
2446
|
},
|
|
2654
2447
|
h2: function(props) {
|
|
2655
|
-
return /* @__PURE__ */
|
|
2448
|
+
return /* @__PURE__ */ jsx43(Heading, {
|
|
2656
2449
|
as: "h2",
|
|
2657
2450
|
size: "5",
|
|
2658
2451
|
children: props.children
|
|
2659
2452
|
});
|
|
2660
2453
|
},
|
|
2661
2454
|
h3: function(props) {
|
|
2662
|
-
return /* @__PURE__ */
|
|
2455
|
+
return /* @__PURE__ */ jsx43(Heading, {
|
|
2663
2456
|
as: "h3",
|
|
2664
2457
|
size: "4",
|
|
2665
2458
|
children: props.children
|
|
2666
2459
|
});
|
|
2667
2460
|
},
|
|
2668
2461
|
h4: function(props) {
|
|
2669
|
-
return /* @__PURE__ */
|
|
2462
|
+
return /* @__PURE__ */ jsx43(Heading, {
|
|
2670
2463
|
as: "h4",
|
|
2671
2464
|
size: "3",
|
|
2672
2465
|
children: props.children
|
|
2673
2466
|
});
|
|
2674
2467
|
},
|
|
2675
2468
|
h5: function(props) {
|
|
2676
|
-
return /* @__PURE__ */
|
|
2469
|
+
return /* @__PURE__ */ jsx43(Heading, {
|
|
2677
2470
|
as: "h5",
|
|
2678
2471
|
size: "3",
|
|
2679
2472
|
children: props.children
|
|
2680
2473
|
});
|
|
2681
2474
|
},
|
|
2682
2475
|
h6: function(props) {
|
|
2683
|
-
return /* @__PURE__ */
|
|
2476
|
+
return /* @__PURE__ */ jsx43(Heading, {
|
|
2684
2477
|
as: "h6",
|
|
2685
2478
|
size: "3",
|
|
2686
2479
|
children: props.children
|
|
2687
2480
|
});
|
|
2688
2481
|
},
|
|
2689
2482
|
table: function(props) {
|
|
2690
|
-
return /* @__PURE__ */
|
|
2483
|
+
return /* @__PURE__ */ jsx43(Table.Root, _object_spread_props(_object_spread({}, props), {
|
|
2691
2484
|
variant: "surface",
|
|
2692
2485
|
mb: "3"
|
|
2693
2486
|
}));
|
|
@@ -2870,135 +2663,358 @@ var getRemarkPlugins = function(param) {
|
|
|
2870
2663
|
remarkGfm
|
|
2871
2664
|
];
|
|
2872
2665
|
};
|
|
2873
|
-
// src/contexts/markdown/MarkdownContext/index.ts
|
|
2874
|
-
var MarkdownContext =
|
|
2875
|
-
components: components,
|
|
2876
|
-
getRemarkPlugins: getRemarkPlugins
|
|
2666
|
+
// src/contexts/markdown/MarkdownContext/index.ts
|
|
2667
|
+
var MarkdownContext = createContext6({
|
|
2668
|
+
components: components,
|
|
2669
|
+
getRemarkPlugins: getRemarkPlugins
|
|
2670
|
+
});
|
|
2671
|
+
// src/hooks/markdown/useMarkdownContext/index.ts
|
|
2672
|
+
var useMarkdownContext = function() {
|
|
2673
|
+
return useContext5(MarkdownContext);
|
|
2674
|
+
};
|
|
2675
|
+
// src/components/threads/Thread/Message/ContentPart/TextContent.tsx
|
|
2676
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
2677
|
+
var TextContent = function(param) {
|
|
2678
|
+
var content = param.content;
|
|
2679
|
+
var _useMarkdownContext = useMarkdownContext(), getRemarkPlugins2 = _useMarkdownContext.getRemarkPlugins, rest = _object_without_properties(_useMarkdownContext, [
|
|
2680
|
+
"getRemarkPlugins"
|
|
2681
|
+
]);
|
|
2682
|
+
return(// @ts-ignore-next-line
|
|
2683
|
+
/* @__PURE__ */ jsx44(Markdown, _object_spread_props(_object_spread({}, rest), {
|
|
2684
|
+
remarkPlugins: getRemarkPlugins2({
|
|
2685
|
+
content: content
|
|
2686
|
+
}),
|
|
2687
|
+
children: content.text.value
|
|
2688
|
+
})));
|
|
2689
|
+
};
|
|
2690
|
+
// src/components/threads/Thread/Message/ContentPart/ImageFileContent.tsx
|
|
2691
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
2692
|
+
var ImageFileContent = function(param) {
|
|
2693
|
+
var content = param.content;
|
|
2694
|
+
var superinterfaceContext = useSuperinterfaceContext();
|
|
2695
|
+
var nextSearchParams = new URLSearchParams(superinterfaceContext.variables);
|
|
2696
|
+
return /* @__PURE__ */ jsx45(Image, {
|
|
2697
|
+
alt: "",
|
|
2698
|
+
src: "".concat(superinterfaceContext.baseUrl, "/files/").concat(content.image_file.file_id, "/contents?").concat(nextSearchParams)
|
|
2699
|
+
});
|
|
2700
|
+
};
|
|
2701
|
+
// src/components/threads/Thread/Message/ContentPart/index.tsx
|
|
2702
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
2703
|
+
var ContentPart = function(param) {
|
|
2704
|
+
var content = param.content;
|
|
2705
|
+
if (content.type === "text") {
|
|
2706
|
+
return /* @__PURE__ */ jsx46(TextContent, {
|
|
2707
|
+
content: content
|
|
2708
|
+
});
|
|
2709
|
+
}
|
|
2710
|
+
if (content.type === "image_file") {
|
|
2711
|
+
return /* @__PURE__ */ jsx46(ImageFileContent, {
|
|
2712
|
+
content: content
|
|
2713
|
+
});
|
|
2714
|
+
}
|
|
2715
|
+
return null;
|
|
2716
|
+
};
|
|
2717
|
+
// src/components/threads/Thread/Message/index.tsx
|
|
2718
|
+
import { jsx as jsx47, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2719
|
+
var Message = function(param) {
|
|
2720
|
+
var message = param.message, className = param.className, style = param.style;
|
|
2721
|
+
var _useMemo8 = _sliced_to_array(useMemo8(function() {
|
|
2722
|
+
if (!message.runSteps.length) return [
|
|
2723
|
+
[],
|
|
2724
|
+
[]
|
|
2725
|
+
];
|
|
2726
|
+
var messageCreationRunStepIndex = message.runSteps.findIndex(function(runStep) {
|
|
2727
|
+
if (runStep.step_details.type !== "message_creation") return;
|
|
2728
|
+
return runStep.step_details.message_creation.message_id === message.id;
|
|
2729
|
+
});
|
|
2730
|
+
var nextRunStepIndex = message.runSteps.slice(0, messageCreationRunStepIndex).findLastIndex(function(runStep) {
|
|
2731
|
+
return runStep.step_details.type === "message_creation";
|
|
2732
|
+
});
|
|
2733
|
+
if (nextRunStepIndex === -1) {
|
|
2734
|
+
nextRunStepIndex = 0;
|
|
2735
|
+
}
|
|
2736
|
+
var laterRunSteps2 = message.runSteps.slice(nextRunStepIndex, messageCreationRunStepIndex);
|
|
2737
|
+
var prevRunStepIndex = message.runSteps.slice(messageCreationRunStepIndex + 1).findIndex(function(runStep) {
|
|
2738
|
+
return runStep.step_details.type === "message_creation";
|
|
2739
|
+
});
|
|
2740
|
+
var olderRunSteps2;
|
|
2741
|
+
if (prevRunStepIndex === -1) {
|
|
2742
|
+
olderRunSteps2 = message.runSteps.slice(messageCreationRunStepIndex + 1);
|
|
2743
|
+
} else {
|
|
2744
|
+
olderRunSteps2 = message.runSteps.slice(messageCreationRunStepIndex + 1, messageCreationRunStepIndex + prevRunStepIndex);
|
|
2745
|
+
}
|
|
2746
|
+
return [
|
|
2747
|
+
olderRunSteps2,
|
|
2748
|
+
laterRunSteps2
|
|
2749
|
+
];
|
|
2750
|
+
}, [
|
|
2751
|
+
message
|
|
2752
|
+
]), 2), olderRunSteps = _useMemo8[0], laterRunSteps = _useMemo8[1];
|
|
2753
|
+
var isMutatingMessage = useIsMutatingMessage();
|
|
2754
|
+
var isInProgress = useMemo8(function() {
|
|
2755
|
+
if (!isMutatingMessage) return false;
|
|
2756
|
+
if (message.status === "in_progress") return true;
|
|
2757
|
+
return message.runSteps.some(function(rs) {
|
|
2758
|
+
return rs.status === "in_progress";
|
|
2759
|
+
});
|
|
2760
|
+
}, [
|
|
2761
|
+
message
|
|
2762
|
+
]);
|
|
2763
|
+
return /* @__PURE__ */ jsx47(Provider, {
|
|
2764
|
+
value: {
|
|
2765
|
+
message: message
|
|
2766
|
+
},
|
|
2767
|
+
children: /* @__PURE__ */ jsxs15(Box9, {
|
|
2768
|
+
className: className,
|
|
2769
|
+
style: style,
|
|
2770
|
+
children: [
|
|
2771
|
+
/* @__PURE__ */ jsx47(RunSteps, {
|
|
2772
|
+
runSteps: olderRunSteps
|
|
2773
|
+
}),
|
|
2774
|
+
/* @__PURE__ */ jsxs15(Box9, {
|
|
2775
|
+
children: [
|
|
2776
|
+
/* @__PURE__ */ jsx47(Attachments, {
|
|
2777
|
+
message: message
|
|
2778
|
+
}),
|
|
2779
|
+
message.content.map(function(content, index) {
|
|
2780
|
+
return /* @__PURE__ */ jsx47(ContentPart, {
|
|
2781
|
+
content: content
|
|
2782
|
+
}, index);
|
|
2783
|
+
}),
|
|
2784
|
+
isInProgress && isEmpty2(laterRunSteps) && /* @__PURE__ */ jsx47(StartingContentSkeleton, {})
|
|
2785
|
+
]
|
|
2786
|
+
}),
|
|
2787
|
+
/* @__PURE__ */ jsx47(RunSteps, {
|
|
2788
|
+
runSteps: laterRunSteps
|
|
2789
|
+
}),
|
|
2790
|
+
isInProgress && !isEmpty2(laterRunSteps) && /* @__PURE__ */ jsx47(Box9, {
|
|
2791
|
+
children: /* @__PURE__ */ jsx47(StartingContentSkeleton, {})
|
|
2792
|
+
})
|
|
2793
|
+
]
|
|
2794
|
+
})
|
|
2795
|
+
});
|
|
2796
|
+
};
|
|
2797
|
+
// src/components/threads/Thread/Messages/Content/index.tsx
|
|
2798
|
+
import { useEffect as useEffect2 } from "react";
|
|
2799
|
+
// src/hooks/messageGroups/useMessageGroups/index.ts
|
|
2800
|
+
import { useMemo as useMemo9 } from "react";
|
|
2801
|
+
// src/hooks/messageGroups/useMessageGroups/lib/messageGroups/index.ts
|
|
2802
|
+
import _6 from "lodash";
|
|
2803
|
+
import { last as last2 } from "radash";
|
|
2804
|
+
// src/lib/messages/order.ts
|
|
2805
|
+
import { sort } from "radash";
|
|
2806
|
+
var order = function(param) {
|
|
2807
|
+
var messages2 = param.messages;
|
|
2808
|
+
return sort(messages2, function(m) {
|
|
2809
|
+
return m.created_at;
|
|
2810
|
+
}, true);
|
|
2811
|
+
};
|
|
2812
|
+
// src/hooks/messageGroups/useMessageGroups/lib/messageGroups/newGroup/newGroupItem.ts
|
|
2813
|
+
var newGroupItem = function(param) {
|
|
2814
|
+
var message = param.message;
|
|
2815
|
+
return {
|
|
2816
|
+
id: message.id,
|
|
2817
|
+
role: message.role,
|
|
2818
|
+
createdAt: message.created_at,
|
|
2819
|
+
messages: [
|
|
2820
|
+
message
|
|
2821
|
+
]
|
|
2822
|
+
};
|
|
2823
|
+
};
|
|
2824
|
+
// src/hooks/messageGroups/useMessageGroups/lib/messageGroups/newGroup/index.ts
|
|
2825
|
+
var newGroup = function(param) {
|
|
2826
|
+
var groups = param.groups, message = param.message;
|
|
2827
|
+
return _to_consumable_array(groups).concat([
|
|
2828
|
+
newGroupItem({
|
|
2829
|
+
message: message
|
|
2830
|
+
})
|
|
2831
|
+
]);
|
|
2832
|
+
};
|
|
2833
|
+
// src/hooks/messageGroups/useMessageGroups/lib/messageGroups/index.ts
|
|
2834
|
+
var messageGroups = function(param) {
|
|
2835
|
+
var messages2 = param.messages;
|
|
2836
|
+
return _6.reduce(order({
|
|
2837
|
+
messages: messages2
|
|
2838
|
+
}), function(groups, message) {
|
|
2839
|
+
var group = last2(groups);
|
|
2840
|
+
if (!group) return newGroup({
|
|
2841
|
+
groups: groups,
|
|
2842
|
+
message: message
|
|
2843
|
+
});
|
|
2844
|
+
if (group.role !== message.role) {
|
|
2845
|
+
return newGroup({
|
|
2846
|
+
groups: groups,
|
|
2847
|
+
message: message
|
|
2848
|
+
});
|
|
2849
|
+
}
|
|
2850
|
+
return _to_consumable_array(_6.dropRight(groups)).concat([
|
|
2851
|
+
_object_spread_props(_object_spread({}, group), {
|
|
2852
|
+
messages: _to_consumable_array(group.messages).concat([
|
|
2853
|
+
message
|
|
2854
|
+
])
|
|
2855
|
+
})
|
|
2856
|
+
]);
|
|
2857
|
+
}, []);
|
|
2858
|
+
};
|
|
2859
|
+
// src/hooks/messageGroups/useMessageGroups/index.ts
|
|
2860
|
+
var useMessageGroups = function(param) {
|
|
2861
|
+
var messages2 = param.messages;
|
|
2862
|
+
return useMemo9(function() {
|
|
2863
|
+
return {
|
|
2864
|
+
messageGroups: messageGroups({
|
|
2865
|
+
messages: messages2
|
|
2866
|
+
})
|
|
2867
|
+
};
|
|
2868
|
+
}, [
|
|
2869
|
+
messages2
|
|
2870
|
+
]);
|
|
2871
|
+
};
|
|
2872
|
+
// src/components/skeletons/MessagesSkeleton/index.tsx
|
|
2873
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
2874
|
+
import { Flex as Flex13, Avatar, Box as Box10, Skeleton as Skeleton2 } from "@radix-ui/themes";
|
|
2875
|
+
// src/components/messageGroups/MessageGroupBase/index.tsx
|
|
2876
|
+
import { forwardRef } from "react";
|
|
2877
|
+
import { Flex as Flex11, Container } from "@radix-ui/themes";
|
|
2878
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
2879
|
+
var MessageGroupBase = forwardRef(function MessageGroupBase2(param, ref) {
|
|
2880
|
+
var children = param.children;
|
|
2881
|
+
return /* @__PURE__ */ jsx48(Container, {
|
|
2882
|
+
ref: ref,
|
|
2883
|
+
size: "2",
|
|
2884
|
+
flexGrow: "0",
|
|
2885
|
+
children: /* @__PURE__ */ jsx48(Flex11, {
|
|
2886
|
+
flexShrink: "0",
|
|
2887
|
+
gap: "3",
|
|
2888
|
+
children: children
|
|
2889
|
+
})
|
|
2890
|
+
});
|
|
2891
|
+
});
|
|
2892
|
+
// src/components/messageGroups/MessageGroupBase/Name.tsx
|
|
2893
|
+
import { Flex as Flex12, Text as Text6 } from "@radix-ui/themes";
|
|
2894
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
2895
|
+
var Name = function(param) {
|
|
2896
|
+
var children = param.children;
|
|
2897
|
+
return /* @__PURE__ */ jsx49(Flex12, {
|
|
2898
|
+
align: "center",
|
|
2899
|
+
height: "var(--space-5)",
|
|
2900
|
+
children: /* @__PURE__ */ jsx49(Text6, {
|
|
2901
|
+
size: "2",
|
|
2902
|
+
weight: "bold",
|
|
2903
|
+
children: children
|
|
2904
|
+
})
|
|
2905
|
+
});
|
|
2906
|
+
};
|
|
2907
|
+
// src/components/skeletons/MessagesSkeleton/index.tsx
|
|
2908
|
+
import { jsx as jsx50, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2909
|
+
var MessagesSkeleton = forwardRef2(function MessagesSkeleton2(_props, ref) {
|
|
2910
|
+
return /* @__PURE__ */ jsxs16(MessageGroupBase, {
|
|
2911
|
+
ref: ref,
|
|
2912
|
+
children: [
|
|
2913
|
+
/* @__PURE__ */ jsx50(Skeleton2, {
|
|
2914
|
+
loading: true,
|
|
2915
|
+
children: /* @__PURE__ */ jsx50(Avatar, {
|
|
2916
|
+
fallback: /* @__PURE__ */ jsx50(Flex13, {}),
|
|
2917
|
+
size: "1"
|
|
2918
|
+
})
|
|
2919
|
+
}),
|
|
2920
|
+
/* @__PURE__ */ jsxs16(Box10, {
|
|
2921
|
+
pb: "3",
|
|
2922
|
+
children: [
|
|
2923
|
+
/* @__PURE__ */ jsx50(Name, {
|
|
2924
|
+
children: /* @__PURE__ */ jsx50(Skeleton2, {
|
|
2925
|
+
loading: true,
|
|
2926
|
+
style: {
|
|
2927
|
+
width: "128px"
|
|
2928
|
+
}
|
|
2929
|
+
})
|
|
2930
|
+
}),
|
|
2931
|
+
/* @__PURE__ */ jsx50(Skeleton2, {
|
|
2932
|
+
loading: true,
|
|
2933
|
+
style: {
|
|
2934
|
+
width: "256px"
|
|
2935
|
+
}
|
|
2936
|
+
}),
|
|
2937
|
+
/* @__PURE__ */ jsx50(Skeleton2, {
|
|
2938
|
+
loading: true,
|
|
2939
|
+
style: {
|
|
2940
|
+
width: "256px",
|
|
2941
|
+
marginTop: "var(--space-2)"
|
|
2942
|
+
}
|
|
2943
|
+
}),
|
|
2944
|
+
/* @__PURE__ */ jsx50(Skeleton2, {
|
|
2945
|
+
loading: true,
|
|
2946
|
+
style: {
|
|
2947
|
+
width: "256px",
|
|
2948
|
+
marginTop: "var(--space-2)"
|
|
2949
|
+
}
|
|
2950
|
+
})
|
|
2951
|
+
]
|
|
2952
|
+
})
|
|
2953
|
+
]
|
|
2954
|
+
});
|
|
2877
2955
|
});
|
|
2878
|
-
// src/
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2956
|
+
// src/components/threads/Thread/Messages/Content/MessageGroup/index.tsx
|
|
2957
|
+
import { useContext as useContext8 } from "react";
|
|
2958
|
+
import { Box as Box11 } from "@radix-ui/themes";
|
|
2959
|
+
// src/components/messageGroups/MessageGroupBase/AssistantAvatar.tsx
|
|
2960
|
+
import { useContext as useContext6 } from "react";
|
|
2961
|
+
import { Flex as Flex14 } from "@radix-ui/themes";
|
|
2962
|
+
// src/contexts/assistants/AssistantAvatarContext/index.tsx
|
|
2963
|
+
import { createContext as createContext7 } from "react";
|
|
2964
|
+
import { Avatar as Avatar2 } from "@radix-ui/themes";
|
|
2965
|
+
import { LightningBoltIcon } from "@radix-ui/react-icons";
|
|
2883
2966
|
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
2884
|
-
var
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
return /* @__PURE__ */ jsx51(Markdown, _object_spread_props(_object_spread({}, rest), {
|
|
2890
|
-
remarkPlugins: getRemarkPlugins2({
|
|
2891
|
-
content: content
|
|
2892
|
-
}),
|
|
2893
|
-
children: content.text.value
|
|
2894
|
-
}));
|
|
2895
|
-
};
|
|
2896
|
-
// src/components/threads/Thread/Message/ContentPart/ImageFileContent.tsx
|
|
2967
|
+
var AssistantAvatarContext = createContext7(/* @__PURE__ */ jsx51(Avatar2, {
|
|
2968
|
+
fallback: /* @__PURE__ */ jsx51(LightningBoltIcon, {}),
|
|
2969
|
+
size: "1"
|
|
2970
|
+
}));
|
|
2971
|
+
// src/components/messageGroups/MessageGroupBase/AssistantAvatar.tsx
|
|
2897
2972
|
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
2898
|
-
var
|
|
2899
|
-
var
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2973
|
+
var AssistantAvatar = function() {
|
|
2974
|
+
var AssistantAvatarContextValue = useContext6(AssistantAvatarContext);
|
|
2975
|
+
return /* @__PURE__ */ jsx52(Flex14, {
|
|
2976
|
+
flexShrink: "0",
|
|
2977
|
+
height: "24px",
|
|
2978
|
+
width: "24px",
|
|
2979
|
+
style: {
|
|
2980
|
+
borderRadius: "var(--radius-3)",
|
|
2981
|
+
overflow: "hidden"
|
|
2982
|
+
},
|
|
2983
|
+
children: AssistantAvatarContextValue
|
|
2905
2984
|
});
|
|
2906
2985
|
};
|
|
2907
|
-
// src/
|
|
2986
|
+
// src/contexts/assistants/AssistantNameContext/index.tsx
|
|
2987
|
+
import { createContext as createContext8 } from "react";
|
|
2988
|
+
var AssistantNameContext = createContext8("Assistant");
|
|
2989
|
+
// src/components/messageGroups/MessageGroupBase/UserAvatar.tsx
|
|
2990
|
+
import { useContext as useContext7 } from "react";
|
|
2991
|
+
import { Flex as Flex15 } from "@radix-ui/themes";
|
|
2992
|
+
// src/contexts/users/UserAvatarContext/index.tsx
|
|
2993
|
+
import { createContext as createContext9 } from "react";
|
|
2994
|
+
import { Avatar as Avatar3 } from "@radix-ui/themes";
|
|
2995
|
+
import { PersonIcon } from "@radix-ui/react-icons";
|
|
2908
2996
|
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
2909
|
-
var
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
import { jsx as jsx54, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2925
|
-
var Message = function(param) {
|
|
2926
|
-
var message = param.message;
|
|
2927
|
-
var _useMemo9 = _sliced_to_array(useMemo9(function() {
|
|
2928
|
-
if (!message.runSteps.length) return [
|
|
2929
|
-
[],
|
|
2930
|
-
[]
|
|
2931
|
-
];
|
|
2932
|
-
var messageCreationRunStepIndex = message.runSteps.findIndex(function(runStep) {
|
|
2933
|
-
if (runStep.step_details.type !== "message_creation") return;
|
|
2934
|
-
return runStep.step_details.message_creation.message_id === message.id;
|
|
2935
|
-
});
|
|
2936
|
-
var nextRunStepIndex = message.runSteps.slice(0, messageCreationRunStepIndex).findLastIndex(function(runStep) {
|
|
2937
|
-
return runStep.step_details.type === "message_creation";
|
|
2938
|
-
});
|
|
2939
|
-
if (nextRunStepIndex === -1) {
|
|
2940
|
-
nextRunStepIndex = 0;
|
|
2941
|
-
}
|
|
2942
|
-
var laterRunSteps2 = message.runSteps.slice(nextRunStepIndex, messageCreationRunStepIndex);
|
|
2943
|
-
var prevRunStepIndex = message.runSteps.slice(messageCreationRunStepIndex + 1).findIndex(function(runStep) {
|
|
2944
|
-
return runStep.step_details.type === "message_creation";
|
|
2945
|
-
});
|
|
2946
|
-
var olderRunSteps2;
|
|
2947
|
-
if (prevRunStepIndex === -1) {
|
|
2948
|
-
olderRunSteps2 = message.runSteps.slice(messageCreationRunStepIndex + 1);
|
|
2949
|
-
} else {
|
|
2950
|
-
olderRunSteps2 = message.runSteps.slice(messageCreationRunStepIndex + 1, messageCreationRunStepIndex + prevRunStepIndex);
|
|
2951
|
-
}
|
|
2952
|
-
return [
|
|
2953
|
-
olderRunSteps2,
|
|
2954
|
-
laterRunSteps2
|
|
2955
|
-
];
|
|
2956
|
-
}, [
|
|
2957
|
-
message
|
|
2958
|
-
]), 2), olderRunSteps = _useMemo9[0], laterRunSteps = _useMemo9[1];
|
|
2959
|
-
var isMutatingMessage = useIsMutatingMessage();
|
|
2960
|
-
var isInProgress = useMemo9(function() {
|
|
2961
|
-
if (!isMutatingMessage) return false;
|
|
2962
|
-
if (message.status === "in_progress") return true;
|
|
2963
|
-
return message.runSteps.some(function(rs) {
|
|
2964
|
-
return rs.status === "in_progress";
|
|
2965
|
-
});
|
|
2966
|
-
}, [
|
|
2967
|
-
message
|
|
2968
|
-
]);
|
|
2969
|
-
return /* @__PURE__ */ jsx54(Provider, {
|
|
2970
|
-
value: {
|
|
2971
|
-
message: message
|
|
2997
|
+
var UserAvatarContext = createContext9(/* @__PURE__ */ jsx53(Avatar3, {
|
|
2998
|
+
fallback: /* @__PURE__ */ jsx53(PersonIcon, {}),
|
|
2999
|
+
size: "1"
|
|
3000
|
+
}));
|
|
3001
|
+
// src/components/messageGroups/MessageGroupBase/UserAvatar.tsx
|
|
3002
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
3003
|
+
var UserAvatar = function() {
|
|
3004
|
+
var UserAvatarContextValue = useContext7(UserAvatarContext);
|
|
3005
|
+
return /* @__PURE__ */ jsx54(Flex15, {
|
|
3006
|
+
flexShrink: "0",
|
|
3007
|
+
height: "24px",
|
|
3008
|
+
width: "24px",
|
|
3009
|
+
style: {
|
|
3010
|
+
borderRadius: "var(--radius-3)",
|
|
3011
|
+
overflow: "hidden"
|
|
2972
3012
|
},
|
|
2973
|
-
children:
|
|
2974
|
-
children: [
|
|
2975
|
-
/* @__PURE__ */ jsx54(RunSteps, {
|
|
2976
|
-
runSteps: olderRunSteps
|
|
2977
|
-
}),
|
|
2978
|
-
/* @__PURE__ */ jsxs16(Box10, {
|
|
2979
|
-
children: [
|
|
2980
|
-
/* @__PURE__ */ jsx54(Attachments, {
|
|
2981
|
-
message: message
|
|
2982
|
-
}),
|
|
2983
|
-
message.content.map(function(content, index) {
|
|
2984
|
-
return /* @__PURE__ */ jsx54(ContentPart, {
|
|
2985
|
-
content: content
|
|
2986
|
-
}, index);
|
|
2987
|
-
}),
|
|
2988
|
-
isInProgress && isEmpty2(laterRunSteps) && /* @__PURE__ */ jsx54(StartingContentSkeleton, {})
|
|
2989
|
-
]
|
|
2990
|
-
}),
|
|
2991
|
-
/* @__PURE__ */ jsx54(RunSteps, {
|
|
2992
|
-
runSteps: laterRunSteps
|
|
2993
|
-
}),
|
|
2994
|
-
isInProgress && !isEmpty2(laterRunSteps) && /* @__PURE__ */ jsx54(Box10, {
|
|
2995
|
-
children: /* @__PURE__ */ jsx54(StartingContentSkeleton, {})
|
|
2996
|
-
})
|
|
2997
|
-
]
|
|
2998
|
-
})
|
|
3013
|
+
children: UserAvatarContextValue
|
|
2999
3014
|
});
|
|
3000
3015
|
};
|
|
3001
3016
|
// src/components/threads/Thread/Messages/Content/MessageGroup/Content/index.tsx
|
|
3017
|
+
import { Flex as Flex16 } from "@radix-ui/themes";
|
|
3002
3018
|
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
3003
3019
|
var Content5 = function(param) {
|
|
3004
3020
|
var messageGroup = param.messageGroup;
|
|
@@ -3166,7 +3182,7 @@ var useInfiniteScroll = function(param) {
|
|
|
3166
3182
|
// src/components/threads/Thread/Messages/Root/index.tsx
|
|
3167
3183
|
import { jsx as jsx60, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3168
3184
|
var Root2 = function(param) {
|
|
3169
|
-
var children = param.children,
|
|
3185
|
+
var children = param.children, style = param.style, className = param.className;
|
|
3170
3186
|
var _useMessages = useMessages(), isFetchingNextPage = _useMessages.isFetchingNextPage, hasNextPage = _useMessages.hasNextPage, fetchNextPage = _useMessages.fetchNextPage;
|
|
3171
3187
|
var _useInfiniteScroll = useInfiniteScroll({
|
|
3172
3188
|
isFetchingNextPage: isFetchingNextPage,
|
|
@@ -3177,9 +3193,10 @@ var Root2 = function(param) {
|
|
|
3177
3193
|
ref: containerRef,
|
|
3178
3194
|
direction: "column-reverse",
|
|
3179
3195
|
flexGrow: "1",
|
|
3180
|
-
style:
|
|
3196
|
+
style: _object_spread({
|
|
3181
3197
|
overflow: "auto"
|
|
3182
|
-
}),
|
|
3198
|
+
}, style !== null && style !== void 0 ? style : {}),
|
|
3199
|
+
className: className,
|
|
3183
3200
|
children: [
|
|
3184
3201
|
children,
|
|
3185
3202
|
hasNextPage && /* @__PURE__ */ jsx60(Flex17, {
|
|
@@ -3204,9 +3221,10 @@ var NextPageSkeleton = function() {
|
|
|
3204
3221
|
// src/components/threads/Thread/Messages/index.tsx
|
|
3205
3222
|
import { jsx as jsx62, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3206
3223
|
var Messages = function(param) {
|
|
3207
|
-
var children = param.children,
|
|
3224
|
+
var children = param.children, className = param.className, style = param.style;
|
|
3208
3225
|
return /* @__PURE__ */ jsxs20(Root2, {
|
|
3209
3226
|
style: style,
|
|
3227
|
+
className: className,
|
|
3210
3228
|
children: [
|
|
3211
3229
|
/* @__PURE__ */ jsx62(Flex18, {
|
|
3212
3230
|
flexShrink: "0",
|
|
@@ -3249,36 +3267,40 @@ var useMessageFormContext = function() {
|
|
|
3249
3267
|
// src/components/threads/Thread/MessageForm/Submit/index.tsx
|
|
3250
3268
|
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
3251
3269
|
var Root3 = function(param) {
|
|
3252
|
-
var children = param.children;
|
|
3270
|
+
var children = param.children, style = param.style, className = param.className;
|
|
3253
3271
|
return /* @__PURE__ */ jsx63(Flex19, {
|
|
3254
3272
|
flexShrink: "0",
|
|
3255
3273
|
align: "end",
|
|
3274
|
+
style: style,
|
|
3275
|
+
className: className,
|
|
3256
3276
|
children: children
|
|
3257
3277
|
});
|
|
3258
3278
|
};
|
|
3259
|
-
var Button3 = function() {
|
|
3279
|
+
var Button3 = function(props) {
|
|
3260
3280
|
var superinterfaceContext = useSuperinterfaceContext();
|
|
3261
3281
|
var _useMessageFormContext = useMessageFormContext(), isDisabled = _useMessageFormContext.isDisabled, isLoading = _useMessageFormContext.isLoading, isFileLoading = _useMessageFormContext.isFileLoading;
|
|
3262
3282
|
if (isLoading) {
|
|
3263
|
-
return /* @__PURE__ */ jsx63(IconButton5, {
|
|
3283
|
+
return /* @__PURE__ */ jsx63(IconButton5, _object_spread_props(_object_spread({
|
|
3264
3284
|
type: "button",
|
|
3265
3285
|
onClick: function() {
|
|
3266
3286
|
var _superinterfaceContext_createMessageAbortControllerRef_current;
|
|
3267
3287
|
return (_superinterfaceContext_createMessageAbortControllerRef_current = superinterfaceContext.createMessageAbortControllerRef.current) === null || _superinterfaceContext_createMessageAbortControllerRef_current === void 0 ? void 0 : _superinterfaceContext_createMessageAbortControllerRef_current.abort();
|
|
3268
|
-
}
|
|
3288
|
+
}
|
|
3289
|
+
}, props), {
|
|
3269
3290
|
children: /* @__PURE__ */ jsx63(StopIcon, {})
|
|
3270
|
-
});
|
|
3291
|
+
}));
|
|
3271
3292
|
}
|
|
3272
|
-
return /* @__PURE__ */ jsx63(IconButton5, {
|
|
3293
|
+
return /* @__PURE__ */ jsx63(IconButton5, _object_spread_props(_object_spread({
|
|
3273
3294
|
type: "submit",
|
|
3274
|
-
disabled: isDisabled || isFileLoading
|
|
3295
|
+
disabled: isDisabled || isFileLoading
|
|
3296
|
+
}, props), {
|
|
3275
3297
|
children: /* @__PURE__ */ jsx63(ArrowUpIcon2, {})
|
|
3276
|
-
});
|
|
3298
|
+
}));
|
|
3277
3299
|
};
|
|
3278
|
-
var Submit = function() {
|
|
3279
|
-
return /* @__PURE__ */ jsx63(Root3, {
|
|
3300
|
+
var Submit = function(props) {
|
|
3301
|
+
return /* @__PURE__ */ jsx63(Root3, _object_spread_props(_object_spread({}, props), {
|
|
3280
3302
|
children: /* @__PURE__ */ jsx63(Button3, {})
|
|
3281
|
-
});
|
|
3303
|
+
}));
|
|
3282
3304
|
};
|
|
3283
3305
|
Submit.Root = Root3;
|
|
3284
3306
|
Submit.Button = Button3;
|
|
@@ -3300,7 +3322,7 @@ var formOptions = {
|
|
|
3300
3322
|
import { partob as partob2 } from "radash";
|
|
3301
3323
|
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
3302
3324
|
var Root4 = function(param) {
|
|
3303
|
-
var children = param.children, onSubmitArg = param.onSubmit, isDisabledArg = param.isDisabled;
|
|
3325
|
+
var children = param.children, onSubmitArg = param.onSubmit, isDisabledArg = param.isDisabled, style = param.style, className = param.className;
|
|
3304
3326
|
var _useState2 = _sliced_to_array(useState2([]), 2), files = _useState2[0], setFiles = _useState2[1];
|
|
3305
3327
|
var formProps = useForm(formOptions);
|
|
3306
3328
|
var handleSubmit = formProps.handleSubmit, isSubmitting = formProps.formState.isSubmitting, reset = formProps.reset, watch = formProps.watch;
|
|
@@ -3404,6 +3426,8 @@ var Root4 = function(param) {
|
|
|
3404
3426
|
children: /* @__PURE__ */ jsx64(Box13, {
|
|
3405
3427
|
asChild: true,
|
|
3406
3428
|
flexShrink: "0",
|
|
3429
|
+
style: style,
|
|
3430
|
+
className: className,
|
|
3407
3431
|
children: /* @__PURE__ */ jsx64("form", {
|
|
3408
3432
|
onSubmit: handleSubmit(onSubmit),
|
|
3409
3433
|
children: children
|
|
@@ -3433,7 +3457,11 @@ import { useContext as useContext11, useMemo as useMemo12, useRef as useRef5, us
|
|
|
3433
3457
|
import { forwardRef as forwardRef3 } from "react";
|
|
3434
3458
|
import TextareaAutosize from "react-textarea-autosize";
|
|
3435
3459
|
import { Fragment as Fragment2, jsx as jsx65, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3436
|
-
var TextareaBase = forwardRef3(function TextareaBase2(
|
|
3460
|
+
var TextareaBase = forwardRef3(function TextareaBase2(_param, ref) {
|
|
3461
|
+
var style = _param.style, className = _param.className, rest = _object_without_properties(_param, [
|
|
3462
|
+
"style",
|
|
3463
|
+
"className"
|
|
3464
|
+
]);
|
|
3437
3465
|
return /* @__PURE__ */ jsxs21(Fragment2, {
|
|
3438
3466
|
children: [
|
|
3439
3467
|
/* @__PURE__ */ jsx65("style", {
|
|
@@ -3441,8 +3469,8 @@ var TextareaBase = forwardRef3(function TextareaBase2(props, ref) {
|
|
|
3441
3469
|
}),
|
|
3442
3470
|
/* @__PURE__ */ jsx65(TextareaAutosize, _object_spread({
|
|
3443
3471
|
ref: ref,
|
|
3444
|
-
className: "rt-reset superinterface-textarea",
|
|
3445
|
-
style: {
|
|
3472
|
+
className: "rt-reset superinterface-textarea ".concat(className !== null && className !== void 0 ? className : ""),
|
|
3473
|
+
style: _object_spread({
|
|
3446
3474
|
border: 0,
|
|
3447
3475
|
outline: 0,
|
|
3448
3476
|
boxSizing: "border-box",
|
|
@@ -3450,22 +3478,24 @@ var TextareaBase = forwardRef3(function TextareaBase2(props, ref) {
|
|
|
3450
3478
|
color: "var(--gray-12)",
|
|
3451
3479
|
flexGrow: 1,
|
|
3452
3480
|
display: "flex"
|
|
3453
|
-
}
|
|
3454
|
-
},
|
|
3481
|
+
}, style !== null && style !== void 0 ? style : {})
|
|
3482
|
+
}, rest))
|
|
3455
3483
|
]
|
|
3456
3484
|
});
|
|
3457
3485
|
});
|
|
3458
3486
|
// src/components/threads/Thread/MessageForm/Field/Control.tsx
|
|
3459
3487
|
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
3460
3488
|
var Root5 = function(param) {
|
|
3461
|
-
var children = param.children;
|
|
3489
|
+
var children = param.children, style = param.style, className = param.className;
|
|
3462
3490
|
return /* @__PURE__ */ jsx66(Flex20, {
|
|
3463
3491
|
flexGrow: "1",
|
|
3464
3492
|
pt: "4px",
|
|
3493
|
+
style: style,
|
|
3494
|
+
className: className,
|
|
3465
3495
|
children: children
|
|
3466
3496
|
});
|
|
3467
3497
|
};
|
|
3468
|
-
var Input = function() {
|
|
3498
|
+
var Input = function(props) {
|
|
3469
3499
|
var assistantNameContext = useContext11(AssistantNameContext);
|
|
3470
3500
|
var register = useFormContext().register;
|
|
3471
3501
|
var _useMessageFormContext = useMessageFormContext(), isDisabled = _useMessageFormContext.isDisabled, isLoading = _useMessageFormContext.isLoading;
|
|
@@ -3500,17 +3530,17 @@ var Input = function() {
|
|
|
3500
3530
|
(_e_currentTarget_form = e.currentTarget.form) === null || _e_currentTarget_form === void 0 ? void 0 : _e_currentTarget_form.requestSubmit();
|
|
3501
3531
|
}
|
|
3502
3532
|
}
|
|
3503
|
-
}, textareaProps), {
|
|
3533
|
+
}, textareaProps, props), {
|
|
3504
3534
|
ref: function(e) {
|
|
3505
3535
|
textareaProps.ref(e);
|
|
3506
3536
|
textareaRef.current = e;
|
|
3507
3537
|
}
|
|
3508
3538
|
}));
|
|
3509
3539
|
};
|
|
3510
|
-
var Control = function() {
|
|
3511
|
-
return /* @__PURE__ */ jsx66(Root5, {
|
|
3540
|
+
var Control = function(props) {
|
|
3541
|
+
return /* @__PURE__ */ jsx66(Root5, _object_spread_props(_object_spread({}, props), {
|
|
3512
3542
|
children: /* @__PURE__ */ jsx66(Input, {})
|
|
3513
|
-
});
|
|
3543
|
+
}));
|
|
3514
3544
|
};
|
|
3515
3545
|
Control.Root = Root5;
|
|
3516
3546
|
Control.Input = Input;
|
|
@@ -3518,16 +3548,17 @@ Control.Input = Input;
|
|
|
3518
3548
|
import { Flex as Flex21, Card as Card2, Spinner as Spinner2, Text as Text7, IconButton as IconButton6 } from "@radix-ui/themes";
|
|
3519
3549
|
import { FileIcon as FileIcon2, Cross2Icon } from "@radix-ui/react-icons";
|
|
3520
3550
|
import { jsx as jsx67, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3521
|
-
var Preview = function() {
|
|
3551
|
+
var Preview = function(props) {
|
|
3522
3552
|
var _useMessageFormContext = useMessageFormContext(), files = _useMessageFormContext.files, setFiles = _useMessageFormContext.setFiles;
|
|
3523
3553
|
if (!files.length) {
|
|
3524
3554
|
return null;
|
|
3525
3555
|
}
|
|
3526
|
-
return /* @__PURE__ */ jsx67(Flex21, {
|
|
3556
|
+
return /* @__PURE__ */ jsx67(Flex21, _object_spread_props(_object_spread({
|
|
3527
3557
|
flexBasis: "100%",
|
|
3528
3558
|
direction: "column",
|
|
3529
3559
|
pb: "2",
|
|
3530
|
-
gap: "1"
|
|
3560
|
+
gap: "1"
|
|
3561
|
+
}, props), {
|
|
3531
3562
|
children: files.map(function(file) {
|
|
3532
3563
|
return /* @__PURE__ */ jsx67(Card2, {
|
|
3533
3564
|
variant: "ghost",
|
|
@@ -3580,7 +3611,7 @@ var Preview = function() {
|
|
|
3580
3611
|
})
|
|
3581
3612
|
}, file.id);
|
|
3582
3613
|
})
|
|
3583
|
-
});
|
|
3614
|
+
}));
|
|
3584
3615
|
};
|
|
3585
3616
|
// src/components/threads/Thread/MessageForm/Field/Files/Control.tsx
|
|
3586
3617
|
import { useCallback as useCallback2 } from "react";
|
|
@@ -3700,7 +3731,7 @@ var useCreateFile = function() {
|
|
|
3700
3731
|
// src/components/threads/Thread/MessageForm/Field/Files/Control.tsx
|
|
3701
3732
|
import { jsx as jsx68, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3702
3733
|
var accept = ".c,text/x-c,\n.cs,text/x-csharp,\n.cpp,text/x-c++,\n.doc,application/msword,\n.docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document,\n.html,text/html,\n.java,text/x-java,\n.json,application/json,\n.md,text/markdown,\n.pdf,application/pdf,\n.php,text/x-php,\n.pptx,application/vnd.openxmlformats-officedocument.presentationml.presentation,\n.py,text/x-python,\n.py,text/x-script.python,\n.rb,text/x-ruby,\n.tex,text/x-tex,\n.txt,text/plain,\n.css,text/css,\n.js,text/javascript,\n.sh,application/x-sh,\n.ts,application/typescript";
|
|
3703
|
-
var Control2 = function() {
|
|
3734
|
+
var Control2 = function(props) {
|
|
3704
3735
|
var _useMessageFormContext = useMessageFormContext(), isDisabled = _useMessageFormContext.isDisabled, isLoading = _useMessageFormContext.isLoading, setFiles = _useMessageFormContext.setFiles;
|
|
3705
3736
|
var createFile = useCreateFile().createFile;
|
|
3706
3737
|
var addToast = useToasts().addToast;
|
|
@@ -3872,10 +3903,11 @@ var Control2 = function() {
|
|
|
3872
3903
|
createFile,
|
|
3873
3904
|
setFiles
|
|
3874
3905
|
]);
|
|
3875
|
-
return /* @__PURE__ */ jsx68(Flex22, {
|
|
3906
|
+
return /* @__PURE__ */ jsx68(Flex22, _object_spread_props(_object_spread({
|
|
3876
3907
|
pt: "2",
|
|
3877
3908
|
pr: "2",
|
|
3878
|
-
flexGrow: "0"
|
|
3909
|
+
flexGrow: "0"
|
|
3910
|
+
}, props), {
|
|
3879
3911
|
children: /* @__PURE__ */ jsxs23(IconButton7, {
|
|
3880
3912
|
type: "button",
|
|
3881
3913
|
variant: "ghost",
|
|
@@ -3904,7 +3936,7 @@ var Control2 = function() {
|
|
|
3904
3936
|
})
|
|
3905
3937
|
]
|
|
3906
3938
|
})
|
|
3907
|
-
});
|
|
3939
|
+
}));
|
|
3908
3940
|
};
|
|
3909
3941
|
// src/components/threads/Thread/MessageForm/Field/Files/index.tsx
|
|
3910
3942
|
var Files = {
|
|
@@ -3914,11 +3946,13 @@ var Files = {
|
|
|
3914
3946
|
// src/components/threads/Thread/MessageForm/Field/index.tsx
|
|
3915
3947
|
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
3916
3948
|
var Root6 = function(param) {
|
|
3917
|
-
var children = param.children;
|
|
3949
|
+
var children = param.children, className = param.className, style = param.style;
|
|
3918
3950
|
var _useFormContext2 = useFormContext2(), errors = _useFormContext2.formState.errors;
|
|
3919
3951
|
return /* @__PURE__ */ jsx69(RadixContainer, {
|
|
3920
3952
|
size: "2",
|
|
3921
3953
|
flexGrow: "0",
|
|
3954
|
+
className: className,
|
|
3955
|
+
style: style,
|
|
3922
3956
|
children: /* @__PURE__ */ jsx69(Flex23, {
|
|
3923
3957
|
direction: "column",
|
|
3924
3958
|
flexShrink: "0",
|
|
@@ -3950,15 +3984,15 @@ var Field = {
|
|
|
3950
3984
|
};
|
|
3951
3985
|
// src/components/threads/Thread/MessageForm/index.tsx
|
|
3952
3986
|
import { jsx as jsx70, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3953
|
-
var MessageForm = function() {
|
|
3954
|
-
return /* @__PURE__ */ jsx70(Root4, {
|
|
3987
|
+
var MessageForm = function(props) {
|
|
3988
|
+
return /* @__PURE__ */ jsx70(Root4, _object_spread_props(_object_spread({}, props), {
|
|
3955
3989
|
children: /* @__PURE__ */ jsxs24(Field.Root, {
|
|
3956
3990
|
children: [
|
|
3957
3991
|
/* @__PURE__ */ jsx70(Field.Control, {}),
|
|
3958
3992
|
/* @__PURE__ */ jsx70(Submit, {})
|
|
3959
3993
|
]
|
|
3960
3994
|
})
|
|
3961
|
-
});
|
|
3995
|
+
}));
|
|
3962
3996
|
};
|
|
3963
3997
|
MessageForm.Root = Root4;
|
|
3964
3998
|
MessageForm.Field = Field;
|
|
@@ -4052,8 +4086,10 @@ var ToastsProvider = function(param) {
|
|
|
4052
4086
|
// src/components/threads/Thread/Root/index.tsx
|
|
4053
4087
|
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
4054
4088
|
var Root8 = function(_param) {
|
|
4055
|
-
var children = _param.children, rest = _object_without_properties(_param, [
|
|
4056
|
-
"children"
|
|
4089
|
+
var children = _param.children, style = _param.style, className = _param.className, rest = _object_without_properties(_param, [
|
|
4090
|
+
"children",
|
|
4091
|
+
"style",
|
|
4092
|
+
"className"
|
|
4057
4093
|
]);
|
|
4058
4094
|
return /* @__PURE__ */ jsx73(ToastsProvider, {
|
|
4059
4095
|
bottom: "var(--space-9)",
|
|
@@ -4061,6 +4097,8 @@ var Root8 = function(_param) {
|
|
|
4061
4097
|
children: /* @__PURE__ */ jsx73(Flex25, {
|
|
4062
4098
|
direction: "column",
|
|
4063
4099
|
flexGrow: "1",
|
|
4100
|
+
className: className,
|
|
4101
|
+
style: style,
|
|
4064
4102
|
children: children
|
|
4065
4103
|
})
|
|
4066
4104
|
}))
|
|
@@ -4223,17 +4261,18 @@ import { Flex as Flex26 } from "@radix-ui/themes";
|
|
|
4223
4261
|
import { IconButton as IconButton8 } from "@radix-ui/themes";
|
|
4224
4262
|
import { ChatBubbleIcon } from "@radix-ui/react-icons";
|
|
4225
4263
|
import { jsx as jsx77 } from "react/jsx-runtime";
|
|
4226
|
-
var Button4 = function() {
|
|
4227
|
-
return /* @__PURE__ */ jsx77(IconButton8, {
|
|
4264
|
+
var Button4 = function(props) {
|
|
4265
|
+
return /* @__PURE__ */ jsx77(IconButton8, _object_spread_props(_object_spread({
|
|
4228
4266
|
size: "4",
|
|
4229
|
-
radius: "full"
|
|
4267
|
+
radius: "full"
|
|
4268
|
+
}, props), {
|
|
4230
4269
|
children: /* @__PURE__ */ jsx77(ChatBubbleIcon, {})
|
|
4231
|
-
});
|
|
4270
|
+
}));
|
|
4232
4271
|
};
|
|
4233
4272
|
// src/components/threads/ThreadDialog/Trigger/index.tsx
|
|
4234
4273
|
import { jsx as jsx78 } from "react/jsx-runtime";
|
|
4235
4274
|
var Root10 = function(param) {
|
|
4236
|
-
var children = param.children,
|
|
4275
|
+
var children = param.children, style = param.style, className = param.className;
|
|
4237
4276
|
var _useThreadDialogContext = useThreadDialogContext(), setIsOpen = _useThreadDialogContext.setIsOpen, isOpen = _useThreadDialogContext.isOpen;
|
|
4238
4277
|
return /* @__PURE__ */ jsx78(Flex26, {
|
|
4239
4278
|
display: {
|
|
@@ -4252,9 +4291,10 @@ var Root10 = function(param) {
|
|
|
4252
4291
|
position: "fixed",
|
|
4253
4292
|
bottom: "24px",
|
|
4254
4293
|
right: "24px",
|
|
4294
|
+
className: className,
|
|
4255
4295
|
style: _object_spread({
|
|
4256
4296
|
zIndex: 9999999999
|
|
4257
|
-
}, style),
|
|
4297
|
+
}, style !== null && style !== void 0 ? style : {}),
|
|
4258
4298
|
children: children
|
|
4259
4299
|
});
|
|
4260
4300
|
};
|
|
@@ -4303,10 +4343,11 @@ var Close = function() {
|
|
|
4303
4343
|
// src/components/threads/ThreadDialog/Content/index.tsx
|
|
4304
4344
|
import { jsx as jsx80, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
4305
4345
|
var Root11 = function(param) {
|
|
4306
|
-
var children = param.children,
|
|
4346
|
+
var children = param.children, className = param.className, style = param.style;
|
|
4307
4347
|
var isOpen = useThreadDialogContext().isOpen;
|
|
4308
4348
|
if (!isOpen) return null;
|
|
4309
4349
|
return /* @__PURE__ */ jsx80(Flex28, {
|
|
4350
|
+
className: className,
|
|
4310
4351
|
direction: "column",
|
|
4311
4352
|
justify: "end",
|
|
4312
4353
|
position: "fixed",
|
|
@@ -4360,30 +4401,32 @@ var Root11 = function(param) {
|
|
|
4360
4401
|
})
|
|
4361
4402
|
});
|
|
4362
4403
|
};
|
|
4363
|
-
var Messages2 = function() {
|
|
4404
|
+
var Messages2 = function(param) {
|
|
4405
|
+
var className = param.className, style = param.style;
|
|
4364
4406
|
return /* @__PURE__ */ jsx80(Thread.Messages, {
|
|
4365
|
-
|
|
4407
|
+
className: className,
|
|
4408
|
+
style: _object_spread({
|
|
4366
4409
|
paddingTop: "var(--space-5)",
|
|
4367
4410
|
paddingRight: "var(--space-5)",
|
|
4368
4411
|
paddingLeft: "var(--space-5)"
|
|
4369
|
-
}
|
|
4412
|
+
}, style)
|
|
4370
4413
|
});
|
|
4371
4414
|
};
|
|
4372
4415
|
var FormContainer = function(param) {
|
|
4373
|
-
var children = param.children;
|
|
4416
|
+
var children = param.children, className = param.className, style = param.style;
|
|
4374
4417
|
return /* @__PURE__ */ jsx80(Flex28, {
|
|
4375
4418
|
direction: "column",
|
|
4376
4419
|
pl: "5",
|
|
4377
4420
|
pr: "5",
|
|
4378
4421
|
pb: "3",
|
|
4379
4422
|
flexShrink: "0",
|
|
4423
|
+
className: className,
|
|
4424
|
+
style: style,
|
|
4380
4425
|
children: children
|
|
4381
4426
|
});
|
|
4382
4427
|
};
|
|
4383
|
-
var Content7 = function(
|
|
4384
|
-
|
|
4385
|
-
return /* @__PURE__ */ jsx80(Root11, {
|
|
4386
|
-
style: style,
|
|
4428
|
+
var Content7 = function(props) {
|
|
4429
|
+
return /* @__PURE__ */ jsx80(Root11, _object_spread_props(_object_spread({}, props), {
|
|
4387
4430
|
children: /* @__PURE__ */ jsxs28(Thread.Root, {
|
|
4388
4431
|
children: [
|
|
4389
4432
|
/* @__PURE__ */ jsx80(Messages2, {}),
|
|
@@ -4392,7 +4435,7 @@ var Content7 = function(param) {
|
|
|
4392
4435
|
})
|
|
4393
4436
|
]
|
|
4394
4437
|
})
|
|
4395
|
-
});
|
|
4438
|
+
}));
|
|
4396
4439
|
};
|
|
4397
4440
|
Content7.Root = Root11;
|
|
4398
4441
|
Content7.Messages = Messages2;
|
|
@@ -4448,6 +4491,7 @@ var AudioThreadContext = createContext12({
|
|
|
4448
4491
|
}),
|
|
4449
4492
|
visualizationAnalyser: null
|
|
4450
4493
|
},
|
|
4494
|
+
// @ts-ignore-next-line
|
|
4451
4495
|
messageAudioProps: {
|
|
4452
4496
|
visualizationAnalyser: null,
|
|
4453
4497
|
playing: false,
|
|
@@ -4922,7 +4966,7 @@ var useMessageAudio = function(param) {
|
|
|
4922
4966
|
import { useQueryClient as useQueryClient7 } from "@tanstack/react-query";
|
|
4923
4967
|
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
4924
4968
|
var Content8 = function(param) {
|
|
4925
|
-
var children = param.children;
|
|
4969
|
+
var children = param.children, className = param.className, style = param.style;
|
|
4926
4970
|
var addToast = useToasts().addToast;
|
|
4927
4971
|
var queryClient = useQueryClient7();
|
|
4928
4972
|
var threadContext = useSuperinterfaceContext();
|
|
@@ -5000,16 +5044,20 @@ var Content8 = function(param) {
|
|
|
5000
5044
|
direction: "column",
|
|
5001
5045
|
flexGrow: "1",
|
|
5002
5046
|
p: "9",
|
|
5047
|
+
className: className,
|
|
5048
|
+
style: style,
|
|
5003
5049
|
children: children
|
|
5004
5050
|
})
|
|
5005
5051
|
});
|
|
5006
5052
|
};
|
|
5007
|
-
var Root12 = function(
|
|
5008
|
-
var children =
|
|
5053
|
+
var Root12 = function(_param) {
|
|
5054
|
+
var children = _param.children, rest = _object_without_properties(_param, [
|
|
5055
|
+
"children"
|
|
5056
|
+
]);
|
|
5009
5057
|
return /* @__PURE__ */ jsx82(ToastsProvider, {
|
|
5010
|
-
children: /* @__PURE__ */ jsx82(Content8, {
|
|
5058
|
+
children: /* @__PURE__ */ jsx82(Content8, _object_spread_props(_object_spread({}, rest), {
|
|
5011
5059
|
children: children
|
|
5012
|
-
})
|
|
5060
|
+
}))
|
|
5013
5061
|
});
|
|
5014
5062
|
};
|
|
5015
5063
|
// src/components/threads/AudioThread/Visualization/index.tsx
|
|
@@ -5087,7 +5135,7 @@ var BarsVisualizer = function(param) {
|
|
|
5087
5135
|
};
|
|
5088
5136
|
// src/components/threads/AudioThread/Visualization/index.tsx
|
|
5089
5137
|
import { jsx as jsx84, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
5090
|
-
var Visualization = function() {
|
|
5138
|
+
var Visualization = function(props) {
|
|
5091
5139
|
var audioThreadContext = useAudioThreadContext();
|
|
5092
5140
|
var assistantNameContext = useContext15(AssistantNameContext);
|
|
5093
5141
|
var _useState9 = _sliced_to_array(useState9(0), 2), scale = _useState9[0], setScale = _useState9[1];
|
|
@@ -5114,12 +5162,13 @@ var Visualization = function() {
|
|
|
5114
5162
|
draw,
|
|
5115
5163
|
audioThreadContext
|
|
5116
5164
|
]);
|
|
5117
|
-
return /* @__PURE__ */ jsxs30(Flex31, {
|
|
5165
|
+
return /* @__PURE__ */ jsxs30(Flex31, _object_spread_props(_object_spread({
|
|
5118
5166
|
direction: "column",
|
|
5119
5167
|
align: "center",
|
|
5120
5168
|
justify: "center",
|
|
5121
5169
|
mb: "3",
|
|
5122
|
-
flexGrow: "1"
|
|
5170
|
+
flexGrow: "1"
|
|
5171
|
+
}, props), {
|
|
5123
5172
|
children: [
|
|
5124
5173
|
/* @__PURE__ */ jsx84(Flex31, {
|
|
5125
5174
|
align: "center",
|
|
@@ -5150,7 +5199,7 @@ var Visualization = function() {
|
|
|
5150
5199
|
]
|
|
5151
5200
|
})
|
|
5152
5201
|
]
|
|
5153
|
-
});
|
|
5202
|
+
}));
|
|
5154
5203
|
};
|
|
5155
5204
|
// src/components/threads/AudioThread/Status/StatusMessages.tsx
|
|
5156
5205
|
import { Flex as Flex32, Text as Text9 } from "@radix-ui/themes";
|
|
@@ -5162,10 +5211,12 @@ var html = function(param) {
|
|
|
5162
5211
|
}).join(""), "\n }");
|
|
5163
5212
|
};
|
|
5164
5213
|
var StatusMessages = function(param) {
|
|
5165
|
-
var texts = param.texts;
|
|
5214
|
+
var texts = param.texts, className = param.className, style = param.style;
|
|
5166
5215
|
return /* @__PURE__ */ jsxs31(Flex32, {
|
|
5167
5216
|
justify: "center",
|
|
5168
5217
|
pb: "5",
|
|
5218
|
+
className: className,
|
|
5219
|
+
style: style,
|
|
5169
5220
|
children: [
|
|
5170
5221
|
/* @__PURE__ */ jsx85(Text9, {
|
|
5171
5222
|
size: "2",
|
|
@@ -5185,41 +5236,41 @@ var StatusMessages = function(param) {
|
|
|
5185
5236
|
};
|
|
5186
5237
|
// src/components/threads/AudioThread/Status/index.tsx
|
|
5187
5238
|
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
5188
|
-
var Status = function() {
|
|
5239
|
+
var Status = function(props) {
|
|
5189
5240
|
var audioThreadContext = useAudioThreadContext();
|
|
5190
5241
|
if (audioThreadContext.status === "recording") {
|
|
5191
|
-
return /* @__PURE__ */ jsx86(StatusMessages, {
|
|
5242
|
+
return /* @__PURE__ */ jsx86(StatusMessages, _object_spread({
|
|
5192
5243
|
texts: [
|
|
5193
5244
|
"Start speaking",
|
|
5194
5245
|
"Listening",
|
|
5195
5246
|
"Finish speaking to send",
|
|
5196
5247
|
"Click the button below to send manually"
|
|
5197
5248
|
]
|
|
5198
|
-
});
|
|
5249
|
+
}, props));
|
|
5199
5250
|
}
|
|
5200
5251
|
if ([
|
|
5201
5252
|
"recorderPaused",
|
|
5202
5253
|
"idle",
|
|
5203
5254
|
"playerPaused"
|
|
5204
5255
|
].includes(audioThreadContext.status)) {
|
|
5205
|
-
return /* @__PURE__ */ jsx86(StatusMessages, {
|
|
5256
|
+
return /* @__PURE__ */ jsx86(StatusMessages, _object_spread({
|
|
5206
5257
|
texts: [
|
|
5207
5258
|
"Click the button below to activate"
|
|
5208
5259
|
]
|
|
5209
|
-
});
|
|
5260
|
+
}, props));
|
|
5210
5261
|
}
|
|
5211
5262
|
if (audioThreadContext.status === "playing") {
|
|
5212
|
-
return /* @__PURE__ */ jsx86(StatusMessages, {
|
|
5263
|
+
return /* @__PURE__ */ jsx86(StatusMessages, _object_spread({
|
|
5213
5264
|
texts: [
|
|
5214
5265
|
"Click the button below to interrupt"
|
|
5215
5266
|
]
|
|
5216
|
-
});
|
|
5267
|
+
}, props));
|
|
5217
5268
|
}
|
|
5218
|
-
return /* @__PURE__ */ jsx86(StatusMessages, {
|
|
5269
|
+
return /* @__PURE__ */ jsx86(StatusMessages, _object_spread({
|
|
5219
5270
|
texts: [
|
|
5220
5271
|
"Thinking"
|
|
5221
5272
|
]
|
|
5222
|
-
});
|
|
5273
|
+
}, props));
|
|
5223
5274
|
};
|
|
5224
5275
|
// src/components/threads/AudioThread/Form/index.tsx
|
|
5225
5276
|
import { Flex as Flex34 } from "@radix-ui/themes";
|
|
@@ -5321,11 +5372,12 @@ var ActionButton = function() {
|
|
|
5321
5372
|
};
|
|
5322
5373
|
// src/components/threads/AudioThread/Form/index.tsx
|
|
5323
5374
|
import { jsx as jsx89, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
5324
|
-
var Form = function() {
|
|
5375
|
+
var Form = function(props) {
|
|
5325
5376
|
var audioThreadContext = useAudioThreadContext();
|
|
5326
|
-
return /* @__PURE__ */ jsxs33(Flex34, {
|
|
5377
|
+
return /* @__PURE__ */ jsxs33(Flex34, _object_spread_props(_object_spread({
|
|
5327
5378
|
direction: "column",
|
|
5328
|
-
align: "center"
|
|
5379
|
+
align: "center"
|
|
5380
|
+
}, props), {
|
|
5329
5381
|
children: [
|
|
5330
5382
|
/* @__PURE__ */ jsxs33(Flex34, {
|
|
5331
5383
|
pb: "3",
|
|
@@ -5359,7 +5411,7 @@ var Form = function() {
|
|
|
5359
5411
|
}),
|
|
5360
5412
|
/* @__PURE__ */ jsx89(ActionButton, {})
|
|
5361
5413
|
]
|
|
5362
|
-
});
|
|
5414
|
+
}));
|
|
5363
5415
|
};
|
|
5364
5416
|
// src/components/threads/AudioThread/index.tsx
|
|
5365
5417
|
import { jsx as jsx90, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
@@ -5378,15 +5430,15 @@ AudioThread.Status = Status;
|
|
|
5378
5430
|
AudioThread.Form = Form;
|
|
5379
5431
|
// src/components/threads/AudioThreadDialog/index.tsx
|
|
5380
5432
|
import { jsx as jsx91, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
5381
|
-
var AudioThreadDialog = function() {
|
|
5382
|
-
return /* @__PURE__ */ jsxs35(Root9, {
|
|
5433
|
+
var AudioThreadDialog = function(props) {
|
|
5434
|
+
return /* @__PURE__ */ jsxs35(Root9, _object_spread_props(_object_spread({}, props), {
|
|
5383
5435
|
children: [
|
|
5384
5436
|
/* @__PURE__ */ jsx91(Content7.Root, {
|
|
5385
5437
|
children: /* @__PURE__ */ jsx91(AudioThread, {})
|
|
5386
5438
|
}),
|
|
5387
5439
|
/* @__PURE__ */ jsx91(Trigger, {})
|
|
5388
5440
|
]
|
|
5389
|
-
});
|
|
5441
|
+
}));
|
|
5390
5442
|
};
|
|
5391
5443
|
AudioThreadDialog.Root = Root9;
|
|
5392
5444
|
AudioThreadDialog.Trigger = Trigger;
|
|
@@ -5466,9 +5518,11 @@ var optimizedSrc = function(param) {
|
|
|
5466
5518
|
// src/components/imageAvatars/ImageAvatar/index.tsx
|
|
5467
5519
|
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
5468
5520
|
var ImageAvatar = function(param) {
|
|
5469
|
-
var imageAvatar = param.imageAvatar, size = param.size;
|
|
5521
|
+
var imageAvatar = param.imageAvatar, size = param.size, className = param.className, style = param.style;
|
|
5470
5522
|
var superinterfaceContext = useSuperinterfaceContext();
|
|
5471
5523
|
return /* @__PURE__ */ jsx93(Avatar4, {
|
|
5524
|
+
className: className,
|
|
5525
|
+
style: style,
|
|
5472
5526
|
fallback: "",
|
|
5473
5527
|
src: optimizedSrc({
|
|
5474
5528
|
imageAvatar: imageAvatar,
|
|
@@ -5488,13 +5542,15 @@ var iconAvatarComponents = (_obj = {}, _define_property(_obj, "BACKPACK" /* BACK
|
|
|
5488
5542
|
// src/components/iconAvatars/IconAvatar.tsx
|
|
5489
5543
|
import { jsx as jsx94 } from "react/jsx-runtime";
|
|
5490
5544
|
var IconAvatar = function(param) {
|
|
5491
|
-
var iconAvatar = param.iconAvatar, size = param.size;
|
|
5545
|
+
var iconAvatar = param.iconAvatar, size = param.size, className = param.className, style = param.style;
|
|
5492
5546
|
var Component = useMemo18(function() {
|
|
5493
5547
|
return iconAvatarComponents[iconAvatar.name];
|
|
5494
5548
|
}, [
|
|
5495
5549
|
iconAvatar
|
|
5496
5550
|
]);
|
|
5497
5551
|
return /* @__PURE__ */ jsx94(Avatar5, {
|
|
5552
|
+
className: className,
|
|
5553
|
+
style: style,
|
|
5498
5554
|
size: size,
|
|
5499
5555
|
fallback: Component ? /* @__PURE__ */ jsx94(Component, {}) : ""
|
|
5500
5556
|
});
|
|
@@ -5502,24 +5558,30 @@ var IconAvatar = function(param) {
|
|
|
5502
5558
|
// src/components/avatars/Avatar.tsx
|
|
5503
5559
|
import { jsx as jsx95 } from "react/jsx-runtime";
|
|
5504
5560
|
var Avatar6 = function(param) {
|
|
5505
|
-
var avatar = param.avatar, _param_size = param.size, size = _param_size === void 0 ? "1" : _param_size;
|
|
5561
|
+
var avatar = param.avatar, _param_size = param.size, size = _param_size === void 0 ? "1" : _param_size, className = param.className, style = param.style;
|
|
5506
5562
|
if (avatar) {
|
|
5507
5563
|
if (avatar.type === "IMAGE" /* IMAGE */ && avatar.imageAvatar) {
|
|
5508
5564
|
return /* @__PURE__ */ jsx95(ImageAvatar, {
|
|
5509
5565
|
imageAvatar: avatar.imageAvatar,
|
|
5510
|
-
size: size
|
|
5566
|
+
size: size,
|
|
5567
|
+
className: className,
|
|
5568
|
+
style: style
|
|
5511
5569
|
});
|
|
5512
5570
|
}
|
|
5513
5571
|
if (avatar.type === "ICON" /* ICON */ && avatar.iconAvatar) {
|
|
5514
5572
|
return /* @__PURE__ */ jsx95(IconAvatar, {
|
|
5515
5573
|
iconAvatar: avatar.iconAvatar,
|
|
5516
|
-
size: size
|
|
5574
|
+
size: size,
|
|
5575
|
+
className: className,
|
|
5576
|
+
style: style
|
|
5517
5577
|
});
|
|
5518
5578
|
}
|
|
5519
5579
|
}
|
|
5520
5580
|
return /* @__PURE__ */ jsx95(RadixAvatar, {
|
|
5521
5581
|
fallback: "",
|
|
5522
|
-
size: size
|
|
5582
|
+
size: size,
|
|
5583
|
+
className: className,
|
|
5584
|
+
style: style
|
|
5523
5585
|
});
|
|
5524
5586
|
};
|
|
5525
5587
|
// src/components/components/ComponentsProvider.tsx
|