@agents24/chat-react 0.5.46 → 0.5.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -1
- package/dist/{chunk-YRUYJFPJ.js → chunk-3UKX2RRE.js} +2 -5
- package/dist/chunk-3UKX2RRE.js.map +1 -0
- package/dist/generated/run-usage.d.ts +2 -0
- package/dist/index.cjs +1 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/registry/agents24-chat.json +16 -16
- package/dist/runtime/index.cjs +7 -1
- package/dist/runtime/index.cjs.map +1 -1
- package/dist/runtime/index.js +7 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/use-agent-chat-runtime.d.ts +7 -0
- package/dist/scaffold/app.d.ts +5 -3
- package/dist/scaffold/components/chat/chat-composer.d.ts +4 -2
- package/dist/scaffold/components/chat/chat-message.d.ts +3 -2
- package/dist/scaffold/components/chat/chat-shell.d.ts +3 -2
- package/dist/scaffold/components/chat/message-parts.d.ts +3 -2
- package/dist/scaffold/index.cjs +284 -384
- package/dist/scaffold/index.cjs.map +1 -1
- package/dist/scaffold/index.d.ts +1 -1
- package/dist/scaffold/index.js +267 -366
- package/dist/scaffold/index.js.map +1 -1
- package/dist/styles.css +41 -5
- package/dist/ui/agent-chat-composer.d.ts +4 -1
- package/dist/ui/agent-chat-message.d.ts +3 -1
- package/dist/ui/agent-response-timeline.d.ts +3 -2
- package/dist/ui/attachment-text.d.ts +14 -0
- package/dist/ui/bubble.d.ts +1 -1
- package/dist/ui/completed-tool-activity.d.ts +36 -0
- package/dist/ui/composer-attachments.d.ts +2 -0
- package/dist/ui/index.cjs +2412 -1439
- package/dist/ui/index.cjs.map +1 -1
- package/dist/ui/index.d.ts +6 -0
- package/dist/ui/index.js +2340 -1371
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/message-response.d.ts +1 -1
- package/dist/ui/microphone-input.d.ts +24 -0
- package/dist/ui/pcm-capture.d.ts +14 -0
- package/dist/ui/realtime-dictation.d.ts +30 -0
- package/dist/ui/tool-sessions.d.ts +18 -2
- package/dist/ui/use-agent-chat-composer.d.ts +7 -2
- package/dist/ui/use-agent-chat-dictation.d.ts +65 -0
- package/dist/ui/voice-dictation.d.ts +32 -0
- package/package.json +5 -4
- package/scaffold/src/app.tsx +13 -4
- package/scaffold/src/chat.css +0 -1
- package/scaffold/src/components/chat/chat-composer.tsx +29 -25
- package/scaffold/src/components/chat/chat-message.tsx +4 -1
- package/scaffold/src/components/chat/chat-shell.tsx +8 -3
- package/scaffold/src/components/chat/external-link-dialog.tsx +30 -20
- package/scaffold/src/components/chat/message-parts.tsx +4 -1
- package/scaffold/src/index.tsx +1 -0
- package/dist/chunk-YRUYJFPJ.js.map +0 -1
package/dist/scaffold/index.cjs
CHANGED
|
@@ -47,7 +47,7 @@ var import_react3 = require("@agents24/react");
|
|
|
47
47
|
// scaffold/src/components/chat/chat-shell.tsx
|
|
48
48
|
var import_runtime3 = require("@agents24/chat-react/runtime");
|
|
49
49
|
var import_ui5 = require("@agents24/chat-react/ui");
|
|
50
|
-
var
|
|
50
|
+
var import_lucide_react10 = require("lucide-react");
|
|
51
51
|
var React9 = __toESM(require("react"), 1);
|
|
52
52
|
|
|
53
53
|
// scaffold/src/components/chat/chat-composer.tsx
|
|
@@ -516,6 +516,7 @@ function TooltipContent({
|
|
|
516
516
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
517
517
|
function ChatComposer({
|
|
518
518
|
inputContract,
|
|
519
|
+
realtimeDictation,
|
|
519
520
|
queue,
|
|
520
521
|
onRecordingStreamChange,
|
|
521
522
|
disabled,
|
|
@@ -536,36 +537,35 @@ function ChatComposer({
|
|
|
536
537
|
restoredDraft,
|
|
537
538
|
utilityRow = "inline"
|
|
538
539
|
}) {
|
|
540
|
+
const [audioRecording, setAudioRecording] = React2.useState(false);
|
|
539
541
|
const inputRef = React2.useRef(null);
|
|
542
|
+
const textareaRef = React2.useRef(null);
|
|
543
|
+
const voice = (0, import_ui.useAgentChatDictation)({
|
|
544
|
+
props: { inputContract, disabled: disabled || audioRecording, scopeKey, focusKey, forceExpanded, isCancelling, isRunning, restoredDraft, onSubmit },
|
|
545
|
+
textareaRef,
|
|
546
|
+
scopeKey: scopeKey || "default",
|
|
547
|
+
realtime: realtimeDictation,
|
|
548
|
+
onSubmit,
|
|
549
|
+
onEdit: () => void 0,
|
|
550
|
+
onStreamChange: (stream) => onRecordingStreamChange?.(stream)
|
|
551
|
+
});
|
|
552
|
+
const sendingDictation = voice.intent === "send" && ["stopping", "transcribing", "submitting"].includes(voice.phase);
|
|
540
553
|
const {
|
|
541
554
|
text,
|
|
542
555
|
setText,
|
|
543
556
|
files,
|
|
544
557
|
removeFile,
|
|
545
558
|
addFiles,
|
|
546
|
-
textareaRef,
|
|
547
559
|
submit,
|
|
548
560
|
attachmentError,
|
|
549
561
|
attachmentMimeTypes,
|
|
550
562
|
allowAttachments,
|
|
551
|
-
recordingAllowed,
|
|
552
563
|
recorder,
|
|
553
564
|
isExpanded,
|
|
554
565
|
validationError,
|
|
555
566
|
action,
|
|
556
567
|
canSubmit
|
|
557
|
-
} =
|
|
558
|
-
inputContract,
|
|
559
|
-
disabled,
|
|
560
|
-
scopeKey,
|
|
561
|
-
focusKey,
|
|
562
|
-
forceExpanded,
|
|
563
|
-
isCancelling,
|
|
564
|
-
isRunning,
|
|
565
|
-
onSubmit,
|
|
566
|
-
restoredDraft,
|
|
567
|
-
onRecordingStreamChange
|
|
568
|
-
});
|
|
568
|
+
} = voice.composer;
|
|
569
569
|
const selectedAgent = agents.find((item) => item.id === agentId);
|
|
570
570
|
const selectedModel = models.find((item) => item.id === modelId);
|
|
571
571
|
const modelSelector = models.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w-fit max-w-40", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Select, { disabled: disabled || isRunning, onValueChange: onModelChange, value: modelId || void 0, children: [
|
|
@@ -659,7 +659,7 @@ function ChatComposer({
|
|
|
659
659
|
rows: 1,
|
|
660
660
|
placeholder: "Message the agent",
|
|
661
661
|
"aria-label": "Message",
|
|
662
|
-
disabled,
|
|
662
|
+
disabled: disabled || voice.busy || audioRecording,
|
|
663
663
|
className: cn(
|
|
664
664
|
"agents24-composer-textarea max-h-56 min-h-9 field-sizing-content resize-none overflow-y-auto border-0 bg-transparent px-2 shadow-none focus-visible:ring-0 dark:bg-transparent",
|
|
665
665
|
isExpanded ? "py-2" : "h-9 py-2"
|
|
@@ -678,20 +678,20 @@ function ChatComposer({
|
|
|
678
678
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "agents24-composer-actions flex items-center gap-1", children: [
|
|
679
679
|
utilityRow === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_ui.AgentChatContextStatus, { contextWindow }) : null,
|
|
680
680
|
utilityRow === "inline" ? runtimeSelector : null,
|
|
681
|
-
|
|
682
|
-
|
|
681
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
682
|
+
import_ui.MicrophoneInput,
|
|
683
683
|
{
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
684
|
+
scopeKey,
|
|
685
|
+
className: "inline-flex size-9 items-center justify-center rounded-full",
|
|
686
|
+
disabled: disabled || voice.composer.isSubmitting,
|
|
687
|
+
dictation: { enabled: realtimeDictation?.feature.enabled === true, phase: voice.phase, start: voice.start, stop: () => voice.finish("edit"), cancel: voice.cancel },
|
|
688
|
+
audioEnabled: inputContract.modalities.audio.enabled && inputContract.modalities.audio.recording_enabled,
|
|
689
|
+
acceptedMimeTypes: inputContract.modalities.audio.allowed_mime_types,
|
|
690
|
+
onRecordingChange: setAudioRecording,
|
|
691
|
+
onStreamChange: onRecordingStreamChange,
|
|
692
|
+
onRecorded: (file) => addFiles([file])
|
|
693
693
|
}
|
|
694
|
-
)
|
|
694
|
+
),
|
|
695
695
|
action === "stop" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
696
696
|
Button,
|
|
697
697
|
{
|
|
@@ -701,10 +701,10 @@ function ChatComposer({
|
|
|
701
701
|
onClick: onStop,
|
|
702
702
|
children: isCancelling ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.LoaderCircle, { className: "animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.Square, { className: "fill-current" })
|
|
703
703
|
}
|
|
704
|
-
) : validationError ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Tooltip, { children: [
|
|
705
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { tabIndex: 0, "aria-label": validationError, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "icon", "aria-label": isRunning ? "Queue message" : "Send message", disabled: true, onClick: () => void submit(), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.ArrowUp, {}) }) }) }),
|
|
704
|
+
) : validationError && !voice.busy ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Tooltip, { children: [
|
|
705
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { tabIndex: 0, "aria-label": validationError, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "icon", "aria-label": isRunning ? "Queue message" : "Send message", disabled: true, onClick: () => void submit(), children: sendingDictation ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.LoaderCircle, { className: "animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.ArrowUp, {}) }) }) }),
|
|
706
706
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TooltipContent, { children: validationError })
|
|
707
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "icon", "aria-label": isRunning ? "Queue message" : "Send message", disabled: !canSubmit, onClick: () => void submit(), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.ArrowUp, {}) })
|
|
707
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { size: "icon", "aria-label": isRunning ? "Queue message" : "Send message", "aria-busy": sendingDictation || void 0, disabled: sendingDictation || !canSubmit, onClick: () => void submit(), children: sendingDictation ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.LoaderCircle, { className: "animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.ArrowUp, {}) })
|
|
708
708
|
] })
|
|
709
709
|
]
|
|
710
710
|
}
|
|
@@ -772,147 +772,18 @@ function CollapsibleUserMessage({ content }) {
|
|
|
772
772
|
|
|
773
773
|
// scaffold/src/components/chat/external-link-dialog.tsx
|
|
774
774
|
var React4 = __toESM(require("react"), 1);
|
|
775
|
-
|
|
776
|
-
// scaffold/src/components/ui/dialog.tsx
|
|
777
|
-
var import_radix_ui5 = require("radix-ui");
|
|
778
|
-
var import_lucide_react5 = require("lucide-react");
|
|
779
775
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
780
|
-
function Dialog({
|
|
781
|
-
...props
|
|
782
|
-
}) {
|
|
783
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_radix_ui5.Dialog.Root, { "data-slot": "dialog", ...props });
|
|
784
|
-
}
|
|
785
|
-
function DialogPortal({
|
|
786
|
-
container,
|
|
787
|
-
...props
|
|
788
|
-
}) {
|
|
789
|
-
const themeContainer = useThemePortalContainer();
|
|
790
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_radix_ui5.Dialog.Portal, { container: container || themeContainer || void 0, "data-slot": "dialog-portal", ...props });
|
|
791
|
-
}
|
|
792
|
-
function DialogOverlay({
|
|
793
|
-
className,
|
|
794
|
-
...props
|
|
795
|
-
}) {
|
|
796
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
797
|
-
import_radix_ui5.Dialog.Overlay,
|
|
798
|
-
{
|
|
799
|
-
"data-slot": "dialog-overlay",
|
|
800
|
-
className: cn(
|
|
801
|
-
"fixed inset-0 isolate z-50 bg-black/30 duration-100 supports-backdrop-filter:backdrop-blur-sm data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
802
|
-
className
|
|
803
|
-
),
|
|
804
|
-
...props
|
|
805
|
-
}
|
|
806
|
-
);
|
|
807
|
-
}
|
|
808
|
-
function DialogContent({
|
|
809
|
-
className,
|
|
810
|
-
children,
|
|
811
|
-
showCloseButton = true,
|
|
812
|
-
...props
|
|
813
|
-
}) {
|
|
814
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(DialogPortal, { children: [
|
|
815
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DialogOverlay, {}),
|
|
816
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
817
|
-
import_radix_ui5.Dialog.Content,
|
|
818
|
-
{
|
|
819
|
-
"data-slot": "dialog-content",
|
|
820
|
-
className: cn(
|
|
821
|
-
"fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-4xl bg-popover p-6 text-sm text-popover-foreground shadow-xl ring-1 ring-foreground/5 duration-100 outline-none sm:max-w-md dark:ring-foreground/10 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
822
|
-
className
|
|
823
|
-
),
|
|
824
|
-
...props,
|
|
825
|
-
children: [
|
|
826
|
-
children,
|
|
827
|
-
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_radix_ui5.Dialog.Close, { "data-slot": "dialog-close", asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
828
|
-
Button,
|
|
829
|
-
{
|
|
830
|
-
variant: "ghost",
|
|
831
|
-
className: "absolute top-4 right-4 bg-secondary",
|
|
832
|
-
size: "icon-sm",
|
|
833
|
-
children: [
|
|
834
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
835
|
-
import_lucide_react5.XIcon,
|
|
836
|
-
{}
|
|
837
|
-
),
|
|
838
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "sr-only", children: "Close" })
|
|
839
|
-
]
|
|
840
|
-
}
|
|
841
|
-
) })
|
|
842
|
-
]
|
|
843
|
-
}
|
|
844
|
-
)
|
|
845
|
-
] });
|
|
846
|
-
}
|
|
847
|
-
function DialogHeader({ className, ...props }) {
|
|
848
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
849
|
-
"div",
|
|
850
|
-
{
|
|
851
|
-
"data-slot": "dialog-header",
|
|
852
|
-
className: cn("flex flex-col gap-1.5", className),
|
|
853
|
-
...props
|
|
854
|
-
}
|
|
855
|
-
);
|
|
856
|
-
}
|
|
857
|
-
function DialogFooter({
|
|
858
|
-
className,
|
|
859
|
-
showCloseButton = false,
|
|
860
|
-
children,
|
|
861
|
-
...props
|
|
862
|
-
}) {
|
|
863
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
864
|
-
"div",
|
|
865
|
-
{
|
|
866
|
-
"data-slot": "dialog-footer",
|
|
867
|
-
className: cn(
|
|
868
|
-
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
869
|
-
className
|
|
870
|
-
),
|
|
871
|
-
...props,
|
|
872
|
-
children: [
|
|
873
|
-
children,
|
|
874
|
-
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_radix_ui5.Dialog.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Button, { variant: "outline", children: "Close" }) })
|
|
875
|
-
]
|
|
876
|
-
}
|
|
877
|
-
);
|
|
878
|
-
}
|
|
879
|
-
function DialogTitle({
|
|
880
|
-
className,
|
|
881
|
-
...props
|
|
882
|
-
}) {
|
|
883
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
884
|
-
import_radix_ui5.Dialog.Title,
|
|
885
|
-
{
|
|
886
|
-
"data-slot": "dialog-title",
|
|
887
|
-
className: cn(
|
|
888
|
-
"font-heading text-base leading-none font-medium",
|
|
889
|
-
className
|
|
890
|
-
),
|
|
891
|
-
...props
|
|
892
|
-
}
|
|
893
|
-
);
|
|
894
|
-
}
|
|
895
|
-
function DialogDescription({
|
|
896
|
-
className,
|
|
897
|
-
...props
|
|
898
|
-
}) {
|
|
899
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
900
|
-
import_radix_ui5.Dialog.Description,
|
|
901
|
-
{
|
|
902
|
-
"data-slot": "dialog-description",
|
|
903
|
-
className: cn(
|
|
904
|
-
"text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
905
|
-
className
|
|
906
|
-
),
|
|
907
|
-
...props
|
|
908
|
-
}
|
|
909
|
-
);
|
|
910
|
-
}
|
|
911
|
-
|
|
912
|
-
// scaffold/src/components/chat/external-link-dialog.tsx
|
|
913
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
914
776
|
function ExternalLinkDialog({ isOpen, onClose, onConfirm, url }) {
|
|
777
|
+
const dialogRef = React4.useRef(null);
|
|
778
|
+
const headingId = React4.useId();
|
|
779
|
+
const descriptionId = React4.useId();
|
|
915
780
|
const [copied, setCopied] = React4.useState(false);
|
|
781
|
+
React4.useEffect(() => {
|
|
782
|
+
const dialog = dialogRef.current;
|
|
783
|
+
if (!dialog) return;
|
|
784
|
+
if (isOpen && !dialog.open) dialog.showModal();
|
|
785
|
+
if (!isOpen && dialog.open) dialog.close();
|
|
786
|
+
}, [isOpen]);
|
|
916
787
|
const close = () => {
|
|
917
788
|
setCopied(false);
|
|
918
789
|
onClose();
|
|
@@ -925,29 +796,44 @@ function ExternalLinkDialog({ isOpen, onClose, onConfirm, url }) {
|
|
|
925
796
|
onConfirm();
|
|
926
797
|
close();
|
|
927
798
|
};
|
|
928
|
-
return /* @__PURE__ */ (0,
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
800
|
+
"dialog",
|
|
801
|
+
{
|
|
802
|
+
"aria-describedby": descriptionId,
|
|
803
|
+
"aria-labelledby": headingId,
|
|
804
|
+
className: "m-auto max-h-[calc(100dvh-2rem)] w-[calc(100%-2rem)] max-w-md overflow-auto rounded-lg border bg-background p-0 text-foreground shadow-lg backdrop:bg-black/50",
|
|
805
|
+
onCancel: (event) => {
|
|
806
|
+
event.preventDefault();
|
|
807
|
+
close();
|
|
808
|
+
},
|
|
809
|
+
onClick: (event) => {
|
|
810
|
+
if (event.target === event.currentTarget) close();
|
|
811
|
+
},
|
|
812
|
+
ref: dialogRef,
|
|
813
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "grid gap-4 p-6", children: [
|
|
814
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "grid gap-2", children: [
|
|
815
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h2", { className: "text-lg leading-none font-semibold", id: headingId, children: "Open external link?" }),
|
|
816
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-sm text-muted-foreground", id: descriptionId, children: "You\u2019re about to visit an external website." })
|
|
817
|
+
] }),
|
|
818
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "max-h-32 overflow-auto rounded-md bg-muted p-3 font-mono text-xs wrap-break-word", children: url }),
|
|
819
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", children: [
|
|
820
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Button, { onClick: close, type: "button", variant: "ghost", children: "Cancel" }),
|
|
821
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Button, { onClick: () => void copyUrl(), type: "button", variant: "outline", children: copied ? "Copied" : "Copy link" }),
|
|
822
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Button, { onClick: openUrl, type: "button", children: "Open link" })
|
|
823
|
+
] })
|
|
824
|
+
] })
|
|
825
|
+
}
|
|
826
|
+
);
|
|
941
827
|
}
|
|
942
828
|
|
|
943
829
|
// scaffold/src/components/chat/message-parts.tsx
|
|
944
|
-
var
|
|
830
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
945
831
|
var linkSafety = {
|
|
946
832
|
enabled: true,
|
|
947
|
-
renderModal: (props) => /* @__PURE__ */ (0,
|
|
833
|
+
renderModal: (props) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ExternalLinkDialog, { ...props })
|
|
948
834
|
};
|
|
949
835
|
function ScaffoldTimeline(props) {
|
|
950
|
-
return /* @__PURE__ */ (0,
|
|
836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
951
837
|
import_ui2.AgentResponseTimeline,
|
|
952
838
|
{
|
|
953
839
|
...props,
|
|
@@ -962,15 +848,17 @@ function MessageParts({
|
|
|
962
848
|
message,
|
|
963
849
|
getHitlActionState,
|
|
964
850
|
isLoading,
|
|
851
|
+
timelineOptions,
|
|
965
852
|
onHitlAction,
|
|
966
853
|
Timeline = ScaffoldTimeline
|
|
967
854
|
}) {
|
|
968
855
|
if (message.role === "assistant") {
|
|
969
|
-
return /* @__PURE__ */ (0,
|
|
856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
970
857
|
Timeline,
|
|
971
858
|
{
|
|
972
859
|
getHitlActionState,
|
|
973
860
|
isLoading,
|
|
861
|
+
...timelineOptions,
|
|
974
862
|
message,
|
|
975
863
|
onHitlAction: (part, response, options2) => {
|
|
976
864
|
void onHitlAction(part, response, options2).catch(() => void 0);
|
|
@@ -981,8 +869,8 @@ function MessageParts({
|
|
|
981
869
|
}
|
|
982
870
|
const text = message.parts.filter((part) => part.kind === "text").map((part) => part.kind === "text" ? part.text : "").join("") || message.content;
|
|
983
871
|
const supportingParts = message.parts.filter((part) => part.kind !== "text" && part.kind !== "data");
|
|
984
|
-
return /* @__PURE__ */ (0,
|
|
985
|
-
supportingParts.map((part) => /* @__PURE__ */ (0,
|
|
872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
873
|
+
supportingParts.map((part) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
986
874
|
import_ui2.AgentChatPart,
|
|
987
875
|
{
|
|
988
876
|
getHitlActionState,
|
|
@@ -994,14 +882,14 @@ function MessageParts({
|
|
|
994
882
|
},
|
|
995
883
|
part.id
|
|
996
884
|
)),
|
|
997
|
-
text ? /* @__PURE__ */ (0,
|
|
885
|
+
text ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CollapsibleUserMessage, { content: text }) : null
|
|
998
886
|
] });
|
|
999
887
|
}
|
|
1000
888
|
|
|
1001
889
|
// scaffold/src/components/ui/bubble.tsx
|
|
1002
890
|
var import_class_variance_authority2 = require("class-variance-authority");
|
|
1003
|
-
var
|
|
1004
|
-
var
|
|
891
|
+
var import_radix_ui5 = require("radix-ui");
|
|
892
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1005
893
|
var bubbleVariants = (0, import_class_variance_authority2.cva)(
|
|
1006
894
|
"group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full",
|
|
1007
895
|
{
|
|
@@ -1027,7 +915,7 @@ function Bubble({
|
|
|
1027
915
|
className,
|
|
1028
916
|
...props
|
|
1029
917
|
}) {
|
|
1030
|
-
return /* @__PURE__ */ (0,
|
|
918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1031
919
|
"div",
|
|
1032
920
|
{
|
|
1033
921
|
"data-slot": "bubble",
|
|
@@ -1043,8 +931,8 @@ function BubbleContent({
|
|
|
1043
931
|
className,
|
|
1044
932
|
...props
|
|
1045
933
|
}) {
|
|
1046
|
-
const Comp = asChild ?
|
|
1047
|
-
return /* @__PURE__ */ (0,
|
|
934
|
+
const Comp = asChild ? import_radix_ui5.Slot.Root : "div";
|
|
935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1048
936
|
Comp,
|
|
1049
937
|
{
|
|
1050
938
|
"data-slot": "bubble-content",
|
|
@@ -1077,13 +965,13 @@ var bubbleReactionsVariants = (0, import_class_variance_authority2.cva)(
|
|
|
1077
965
|
);
|
|
1078
966
|
|
|
1079
967
|
// scaffold/src/components/ui/message.tsx
|
|
1080
|
-
var
|
|
968
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1081
969
|
function Message({
|
|
1082
970
|
className,
|
|
1083
971
|
align = "start",
|
|
1084
972
|
...props
|
|
1085
973
|
}) {
|
|
1086
|
-
return /* @__PURE__ */ (0,
|
|
974
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1087
975
|
"div",
|
|
1088
976
|
{
|
|
1089
977
|
"data-slot": "message",
|
|
@@ -1097,7 +985,7 @@ function Message({
|
|
|
1097
985
|
);
|
|
1098
986
|
}
|
|
1099
987
|
function MessageContent({ className, ...props }) {
|
|
1100
|
-
return /* @__PURE__ */ (0,
|
|
988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1101
989
|
"div",
|
|
1102
990
|
{
|
|
1103
991
|
"data-slot": "message-content",
|
|
@@ -1110,7 +998,7 @@ function MessageContent({ className, ...props }) {
|
|
|
1110
998
|
);
|
|
1111
999
|
}
|
|
1112
1000
|
function MessageFooter({ className, ...props }) {
|
|
1113
|
-
return /* @__PURE__ */ (0,
|
|
1001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1114
1002
|
"div",
|
|
1115
1003
|
{
|
|
1116
1004
|
"data-slot": "message-footer",
|
|
@@ -1124,12 +1012,13 @@ function MessageFooter({ className, ...props }) {
|
|
|
1124
1012
|
}
|
|
1125
1013
|
|
|
1126
1014
|
// scaffold/src/components/chat/chat-message.tsx
|
|
1127
|
-
var
|
|
1015
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1128
1016
|
function ChatMessage({
|
|
1129
1017
|
animateCompletion,
|
|
1130
1018
|
allowFeedback,
|
|
1131
1019
|
getHitlActionState,
|
|
1132
1020
|
isLoading,
|
|
1021
|
+
timelineOptions,
|
|
1133
1022
|
message,
|
|
1134
1023
|
onHitlAction,
|
|
1135
1024
|
onRegenerate,
|
|
@@ -1140,8 +1029,8 @@ function ChatMessage({
|
|
|
1140
1029
|
const isUser = message.role === "user";
|
|
1141
1030
|
const showCompletionActions = !isUser && message.isFinal !== false && !isLoading;
|
|
1142
1031
|
const animateCompletionActions = (0, import_ui3.useCompletionActionEntrance)(showCompletionActions, message.runId, animateCompletion);
|
|
1143
|
-
return /* @__PURE__ */ (0,
|
|
1144
|
-
isUser && message.attachments?.length ? /* @__PURE__ */ (0,
|
|
1032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Message, { align: isUser ? "end" : "start", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(MessageContent, { className: isUser ? "gap-0" : void 0, children: [
|
|
1033
|
+
isUser && message.attachments?.length ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1145
1034
|
import_ui3.ChatAttachmentRows,
|
|
1146
1035
|
{
|
|
1147
1036
|
attachments: message.attachments,
|
|
@@ -1149,17 +1038,18 @@ function ChatMessage({
|
|
|
1149
1038
|
resolveContent: resolveAttachmentContent
|
|
1150
1039
|
}
|
|
1151
1040
|
) : null,
|
|
1152
|
-
/* @__PURE__ */ (0,
|
|
1041
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Bubble, { variant: isUser ? "secondary" : "ghost", align: isUser ? "end" : "start", className: isUser ? "max-w-[min(75%,42rem)]" : "max-w-full overflow-visible", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(BubbleContent, { className: isUser ? "px-4 py-2.5" : "w-full overflow-visible", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1153
1042
|
MessageParts,
|
|
1154
1043
|
{
|
|
1155
1044
|
getHitlActionState,
|
|
1156
1045
|
isLoading,
|
|
1046
|
+
timelineOptions,
|
|
1157
1047
|
message,
|
|
1158
1048
|
onHitlAction,
|
|
1159
1049
|
Timeline
|
|
1160
1050
|
}
|
|
1161
1051
|
) }) }),
|
|
1162
|
-
isUser && /* @__PURE__ */ (0,
|
|
1052
|
+
isUser && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_ui3.AgentChatUserMessageActionRow, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1163
1053
|
import_ui3.AgentChatDefaultActions,
|
|
1164
1054
|
{
|
|
1165
1055
|
handlers: {
|
|
@@ -1170,7 +1060,7 @@ function ChatMessage({
|
|
|
1170
1060
|
message
|
|
1171
1061
|
}
|
|
1172
1062
|
) }),
|
|
1173
|
-
showCompletionActions && /* @__PURE__ */ (0,
|
|
1063
|
+
showCompletionActions && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(MessageFooter, { className: "a24-chat-message-action-row--assistant gap-1", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1174
1064
|
import_ui3.AgentChatDefaultActions,
|
|
1175
1065
|
{
|
|
1176
1066
|
animateCompletion: animateCompletionActions,
|
|
@@ -1193,7 +1083,7 @@ var React5 = __toESM(require("react"), 1);
|
|
|
1193
1083
|
var import_react = require("@agents24/react");
|
|
1194
1084
|
var import_ui4 = require("@agents24/chat-react/ui");
|
|
1195
1085
|
var import_runtime2 = require("@agents24/chat-react/runtime");
|
|
1196
|
-
var
|
|
1086
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1197
1087
|
function SubagentTasks({ threadId }) {
|
|
1198
1088
|
const client = (0, import_react.useAgentClient)();
|
|
1199
1089
|
const source = React5.useMemo(() => ({ events: (input) => client.threads.delegations.events(input) }), [client]);
|
|
@@ -1201,14 +1091,14 @@ function SubagentTasks({ threadId }) {
|
|
|
1201
1091
|
const [selection, setSelection] = React5.useState({ threadId: null, handle: null });
|
|
1202
1092
|
const selected = selection.threadId === threadId ? selection.handle : null;
|
|
1203
1093
|
if (!threadId || !tasks.length && !error) return null;
|
|
1204
|
-
return /* @__PURE__ */ (0,
|
|
1205
|
-
/* @__PURE__ */ (0,
|
|
1094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("section", { "aria-label": "Subagent tasks", className: "mx-auto w-full max-w-3xl px-4 py-2 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("details", { children: [
|
|
1095
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("summary", { className: "cursor-pointer font-medium", children: [
|
|
1206
1096
|
"Tasks (",
|
|
1207
1097
|
tasks.length,
|
|
1208
1098
|
")"
|
|
1209
1099
|
] }),
|
|
1210
|
-
error ? /* @__PURE__ */ (0,
|
|
1211
|
-
/* @__PURE__ */ (0,
|
|
1100
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { role: "alert", children: "Task updates are unavailable. Retrying\u2026" }) : null,
|
|
1101
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("ul", { className: "max-h-56 overflow-y-auto", children: tasks.map((task) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { style: { paddingInlineStart: Math.max(0, task.depth - 1) * 12 }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1212
1102
|
"button",
|
|
1213
1103
|
{
|
|
1214
1104
|
type: "button",
|
|
@@ -1216,15 +1106,15 @@ function SubagentTasks({ threadId }) {
|
|
|
1216
1106
|
onClick: () => setSelection({ threadId, handle: selected === task.handle ? null : task.handle }),
|
|
1217
1107
|
"aria-expanded": selected === task.handle,
|
|
1218
1108
|
children: [
|
|
1219
|
-
/* @__PURE__ */ (0,
|
|
1109
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "min-w-0 truncate", children: [
|
|
1220
1110
|
task.name,
|
|
1221
1111
|
task.background ? " \xB7 Background" : ""
|
|
1222
1112
|
] }),
|
|
1223
|
-
/* @__PURE__ */ (0,
|
|
1113
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "shrink-0 text-xs text-muted-foreground", children: task.status.replaceAll("_", " ") })
|
|
1224
1114
|
]
|
|
1225
1115
|
}
|
|
1226
1116
|
) }, task.handle)) }),
|
|
1227
|
-
tasks.filter((task) => task.handle === selected).map((task) => /* @__PURE__ */ (0,
|
|
1117
|
+
tasks.filter((task) => task.handle === selected).map((task) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TaskConversation, { threadId, task, onChanged: refresh }, `${threadId}:${task.handle}`))
|
|
1228
1118
|
] }) });
|
|
1229
1119
|
}
|
|
1230
1120
|
function TaskConversation({ threadId, task, onChanged }) {
|
|
@@ -1292,34 +1182,34 @@ function TaskConversation({ threadId, task, onChanged }) {
|
|
|
1292
1182
|
}
|
|
1293
1183
|
};
|
|
1294
1184
|
const turns = Array.from(new Map([...earlier, ...history?.turns || []].map((turn) => [turn.id, turn])).values()).sort((a, b) => a.turn_index - b.turn_index);
|
|
1295
|
-
return /* @__PURE__ */ (0,
|
|
1296
|
-
/* @__PURE__ */ (0,
|
|
1297
|
-
error ? /* @__PURE__ */ (0,
|
|
1298
|
-
/* @__PURE__ */ (0,
|
|
1299
|
-
task.capabilities.interrupt ? /* @__PURE__ */ (0,
|
|
1300
|
-
task.capabilities.cancel ? /* @__PURE__ */ (0,
|
|
1301
|
-
before !== null ? /* @__PURE__ */ (0,
|
|
1185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "space-y-3 rounded-md bg-muted/30 p-3", children: [
|
|
1186
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h3", { className: "font-medium", children: task.name }),
|
|
1187
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { role: "alert", children: error }) : null,
|
|
1188
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-wrap gap-2", children: [
|
|
1189
|
+
task.capabilities.interrupt ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Button, { variant: "secondary", size: "sm", disabled: busy, onClick: () => void act("interrupt"), children: "Interrupt" }) : null,
|
|
1190
|
+
task.capabilities.cancel ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Button, { variant: "secondary", size: "sm", disabled: busy, onClick: () => void act("cancel"), children: "Cancel task" }) : null,
|
|
1191
|
+
before !== null ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Button, { variant: "ghost", size: "sm", disabled: busy, onClick: () => void loadEarlier(), children: "Earlier exchanges" }) : null
|
|
1302
1192
|
] }),
|
|
1303
|
-
/* @__PURE__ */ (0,
|
|
1304
|
-
turn.assignment_instruction ? /* @__PURE__ */ (0,
|
|
1305
|
-
turn.user_input_text ? /* @__PURE__ */ (0,
|
|
1306
|
-
turn.exchanges?.map((exchange) => /* @__PURE__ */ (0,
|
|
1307
|
-
/* @__PURE__ */ (0,
|
|
1193
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "max-h-[55dvh] space-y-4 overflow-y-auto break-words", children: turns.map((turn) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("article", { className: "space-y-2", children: [
|
|
1194
|
+
turn.assignment_instruction ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "whitespace-pre-wrap text-muted-foreground", children: turn.assignment_instruction }) : null,
|
|
1195
|
+
turn.user_input_text ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "whitespace-pre-wrap", children: turn.user_input_text }) : null,
|
|
1196
|
+
turn.exchanges?.map((exchange) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "whitespace-pre-wrap break-words text-sm", children: [
|
|
1197
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-xs font-medium", children: exchange.sender === "parent" ? "Parent Agent" : "Subagent update" }),
|
|
1308
1198
|
exchange.text
|
|
1309
1199
|
] }, exchange.id)),
|
|
1310
|
-
/* @__PURE__ */ (0,
|
|
1200
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_ui4.AgentResponseTimeline, { message: { id: turn.id, role: "assistant", createdAt: turn.created_at, content: turn.assistant_output_text || "", parts: (0, import_react.partsFromResponseBlocks)(turn.response_blocks) } })
|
|
1311
1201
|
] }, turn.id)) })
|
|
1312
1202
|
] });
|
|
1313
1203
|
}
|
|
1314
1204
|
|
|
1315
1205
|
// scaffold/src/components/chat/theme-menu.tsx
|
|
1316
|
-
var
|
|
1206
|
+
var import_lucide_react5 = require("lucide-react");
|
|
1317
1207
|
var React6 = __toESM(require("react"), 1);
|
|
1318
|
-
var
|
|
1208
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1319
1209
|
var options = [
|
|
1320
|
-
{ value: "system", label: "System", icon:
|
|
1321
|
-
{ value: "light", label: "Light", icon:
|
|
1322
|
-
{ value: "dark", label: "Dark", icon:
|
|
1210
|
+
{ value: "system", label: "System", icon: import_lucide_react5.Laptop },
|
|
1211
|
+
{ value: "light", label: "Light", icon: import_lucide_react5.Sun },
|
|
1212
|
+
{ value: "dark", label: "Dark", icon: import_lucide_react5.Moon }
|
|
1323
1213
|
];
|
|
1324
1214
|
function ThemeMenu() {
|
|
1325
1215
|
const { appearance, setAppearance, inherited } = useTheme();
|
|
@@ -1327,7 +1217,7 @@ function ThemeMenu() {
|
|
|
1327
1217
|
const rootRef = React6.useRef(null);
|
|
1328
1218
|
const firstItemRef = React6.useRef(null);
|
|
1329
1219
|
const menuId = React6.useId();
|
|
1330
|
-
const ActiveIcon = options.find((item) => item.value === appearance)?.icon ??
|
|
1220
|
+
const ActiveIcon = options.find((item) => item.value === appearance)?.icon ?? import_lucide_react5.Laptop;
|
|
1331
1221
|
React6.useEffect(() => {
|
|
1332
1222
|
if (!open) return;
|
|
1333
1223
|
firstItemRef.current?.focus();
|
|
@@ -1346,8 +1236,8 @@ function ThemeMenu() {
|
|
|
1346
1236
|
}, [open]);
|
|
1347
1237
|
if (inherited) return null;
|
|
1348
1238
|
const label = appearance === "system" ? "System" : appearance === "light" ? "Light" : "Dark";
|
|
1349
|
-
return /* @__PURE__ */ (0,
|
|
1350
|
-
/* @__PURE__ */ (0,
|
|
1239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { ref: rootRef, className: "relative", children: [
|
|
1240
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1351
1241
|
Button,
|
|
1352
1242
|
{
|
|
1353
1243
|
"aria-controls": menuId,
|
|
@@ -1357,16 +1247,16 @@ function ThemeMenu() {
|
|
|
1357
1247
|
onClick: () => setOpen((value) => !value),
|
|
1358
1248
|
size: "icon-sm",
|
|
1359
1249
|
variant: "ghost",
|
|
1360
|
-
children: /* @__PURE__ */ (0,
|
|
1250
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ActiveIcon, {})
|
|
1361
1251
|
}
|
|
1362
1252
|
),
|
|
1363
|
-
open ? /* @__PURE__ */ (0,
|
|
1253
|
+
open ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1364
1254
|
"div",
|
|
1365
1255
|
{
|
|
1366
1256
|
id: menuId,
|
|
1367
1257
|
className: "absolute end-0 top-full z-50 mt-1 flex min-w-44 flex-col rounded-xl border bg-popover p-1 text-popover-foreground shadow-md",
|
|
1368
1258
|
role: "menu",
|
|
1369
|
-
children: options.map(({ value, label: optionLabel, icon: Icon }, index) => /* @__PURE__ */ (0,
|
|
1259
|
+
children: options.map(({ value, label: optionLabel, icon: Icon }, index) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1370
1260
|
Button,
|
|
1371
1261
|
{
|
|
1372
1262
|
ref: index === 0 ? firstItemRef : void 0,
|
|
@@ -1380,7 +1270,7 @@ function ThemeMenu() {
|
|
|
1380
1270
|
size: "sm",
|
|
1381
1271
|
variant: "ghost",
|
|
1382
1272
|
children: [
|
|
1383
|
-
/* @__PURE__ */ (0,
|
|
1273
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon, {}),
|
|
1384
1274
|
" ",
|
|
1385
1275
|
optionLabel
|
|
1386
1276
|
]
|
|
@@ -1394,15 +1284,15 @@ function ThemeMenu() {
|
|
|
1394
1284
|
|
|
1395
1285
|
// scaffold/src/components/chat/thread-sidebar.tsx
|
|
1396
1286
|
var import_react2 = require("@agents24/react");
|
|
1397
|
-
var
|
|
1287
|
+
var import_lucide_react9 = require("lucide-react");
|
|
1398
1288
|
|
|
1399
1289
|
// scaffold/src/components/chat/identity-control.tsx
|
|
1400
|
-
var
|
|
1290
|
+
var import_lucide_react8 = require("lucide-react");
|
|
1401
1291
|
|
|
1402
1292
|
// scaffold/src/components/ui/sidebar.tsx
|
|
1403
1293
|
var React8 = __toESM(require("react"), 1);
|
|
1404
1294
|
var import_class_variance_authority3 = require("class-variance-authority");
|
|
1405
|
-
var
|
|
1295
|
+
var import_radix_ui8 = require("radix-ui");
|
|
1406
1296
|
|
|
1407
1297
|
// scaffold/src/hooks/use-mobile.ts
|
|
1408
1298
|
var React7 = __toESM(require("react"), 1);
|
|
@@ -1427,32 +1317,32 @@ function useIsMobile() {
|
|
|
1427
1317
|
}
|
|
1428
1318
|
|
|
1429
1319
|
// scaffold/src/components/ui/input.tsx
|
|
1430
|
-
var
|
|
1320
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1431
1321
|
|
|
1432
1322
|
// scaffold/src/components/ui/separator.tsx
|
|
1433
|
-
var
|
|
1434
|
-
var
|
|
1323
|
+
var import_radix_ui6 = require("radix-ui");
|
|
1324
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1435
1325
|
|
|
1436
1326
|
// scaffold/src/components/ui/sheet.tsx
|
|
1437
|
-
var
|
|
1438
|
-
var
|
|
1439
|
-
var
|
|
1327
|
+
var import_radix_ui7 = require("radix-ui");
|
|
1328
|
+
var import_lucide_react6 = require("lucide-react");
|
|
1329
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1440
1330
|
function Sheet({ ...props }) {
|
|
1441
|
-
return /* @__PURE__ */ (0,
|
|
1331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_radix_ui7.Dialog.Root, { "data-slot": "sheet", ...props });
|
|
1442
1332
|
}
|
|
1443
1333
|
function SheetPortal({
|
|
1444
1334
|
container,
|
|
1445
1335
|
...props
|
|
1446
1336
|
}) {
|
|
1447
1337
|
const themeContainer = useThemePortalContainer();
|
|
1448
|
-
return /* @__PURE__ */ (0,
|
|
1338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_radix_ui7.Dialog.Portal, { container: container || themeContainer || void 0, "data-slot": "sheet-portal", ...props });
|
|
1449
1339
|
}
|
|
1450
1340
|
function SheetOverlay({
|
|
1451
1341
|
className,
|
|
1452
1342
|
...props
|
|
1453
1343
|
}) {
|
|
1454
|
-
return /* @__PURE__ */ (0,
|
|
1455
|
-
|
|
1344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1345
|
+
import_radix_ui7.Dialog.Overlay,
|
|
1456
1346
|
{
|
|
1457
1347
|
"data-slot": "sheet-overlay",
|
|
1458
1348
|
className: cn(
|
|
@@ -1470,10 +1360,10 @@ function SheetContent({
|
|
|
1470
1360
|
showCloseButton = true,
|
|
1471
1361
|
...props
|
|
1472
1362
|
}) {
|
|
1473
|
-
return /* @__PURE__ */ (0,
|
|
1474
|
-
/* @__PURE__ */ (0,
|
|
1475
|
-
/* @__PURE__ */ (0,
|
|
1476
|
-
|
|
1363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(SheetPortal, { children: [
|
|
1364
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SheetOverlay, {}),
|
|
1365
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1366
|
+
import_radix_ui7.Dialog.Content,
|
|
1477
1367
|
{
|
|
1478
1368
|
"data-slot": "sheet-content",
|
|
1479
1369
|
"data-side": side,
|
|
@@ -1484,18 +1374,18 @@ function SheetContent({
|
|
|
1484
1374
|
...props,
|
|
1485
1375
|
children: [
|
|
1486
1376
|
children,
|
|
1487
|
-
showCloseButton && /* @__PURE__ */ (0,
|
|
1377
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_radix_ui7.Dialog.Close, { "data-slot": "sheet-close", asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1488
1378
|
Button,
|
|
1489
1379
|
{
|
|
1490
1380
|
variant: "ghost",
|
|
1491
1381
|
className: "absolute top-4 right-4 bg-secondary",
|
|
1492
1382
|
size: "icon-sm",
|
|
1493
1383
|
children: [
|
|
1494
|
-
/* @__PURE__ */ (0,
|
|
1495
|
-
|
|
1384
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1385
|
+
import_lucide_react6.XIcon,
|
|
1496
1386
|
{}
|
|
1497
1387
|
),
|
|
1498
|
-
/* @__PURE__ */ (0,
|
|
1388
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "sr-only", children: "Close" })
|
|
1499
1389
|
]
|
|
1500
1390
|
}
|
|
1501
1391
|
) })
|
|
@@ -1505,7 +1395,7 @@ function SheetContent({
|
|
|
1505
1395
|
] });
|
|
1506
1396
|
}
|
|
1507
1397
|
function SheetHeader({ className, ...props }) {
|
|
1508
|
-
return /* @__PURE__ */ (0,
|
|
1398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1509
1399
|
"div",
|
|
1510
1400
|
{
|
|
1511
1401
|
"data-slot": "sheet-header",
|
|
@@ -1518,8 +1408,8 @@ function SheetTitle({
|
|
|
1518
1408
|
className,
|
|
1519
1409
|
...props
|
|
1520
1410
|
}) {
|
|
1521
|
-
return /* @__PURE__ */ (0,
|
|
1522
|
-
|
|
1411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1412
|
+
import_radix_ui7.Dialog.Title,
|
|
1523
1413
|
{
|
|
1524
1414
|
"data-slot": "sheet-title",
|
|
1525
1415
|
className: cn(
|
|
@@ -1534,8 +1424,8 @@ function SheetDescription({
|
|
|
1534
1424
|
className,
|
|
1535
1425
|
...props
|
|
1536
1426
|
}) {
|
|
1537
|
-
return /* @__PURE__ */ (0,
|
|
1538
|
-
|
|
1427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1428
|
+
import_radix_ui7.Dialog.Description,
|
|
1539
1429
|
{
|
|
1540
1430
|
"data-slot": "sheet-description",
|
|
1541
1431
|
className: cn("text-sm text-muted-foreground", className),
|
|
@@ -1545,11 +1435,11 @@ function SheetDescription({
|
|
|
1545
1435
|
}
|
|
1546
1436
|
|
|
1547
1437
|
// scaffold/src/components/ui/skeleton.tsx
|
|
1548
|
-
var
|
|
1438
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1549
1439
|
|
|
1550
1440
|
// scaffold/src/components/ui/sidebar.tsx
|
|
1551
|
-
var
|
|
1552
|
-
var
|
|
1441
|
+
var import_lucide_react7 = require("lucide-react");
|
|
1442
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1553
1443
|
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
1554
1444
|
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
1555
1445
|
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
@@ -1611,7 +1501,7 @@ function SidebarProvider({
|
|
|
1611
1501
|
}),
|
|
1612
1502
|
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
|
|
1613
1503
|
);
|
|
1614
|
-
return /* @__PURE__ */ (0,
|
|
1504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1615
1505
|
"div",
|
|
1616
1506
|
{
|
|
1617
1507
|
"data-slot": "sidebar-wrapper",
|
|
@@ -1635,7 +1525,7 @@ function Sidebar({
|
|
|
1635
1525
|
}) {
|
|
1636
1526
|
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
1637
1527
|
if (collapsible === "none") {
|
|
1638
|
-
return /* @__PURE__ */ (0,
|
|
1528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1639
1529
|
"div",
|
|
1640
1530
|
{
|
|
1641
1531
|
"data-slot": "sidebar",
|
|
@@ -1649,7 +1539,7 @@ function Sidebar({
|
|
|
1649
1539
|
);
|
|
1650
1540
|
}
|
|
1651
1541
|
if (isMobile) {
|
|
1652
|
-
return /* @__PURE__ */ (0,
|
|
1542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1653
1543
|
SheetContent,
|
|
1654
1544
|
{
|
|
1655
1545
|
dir,
|
|
@@ -1659,16 +1549,16 @@ function Sidebar({
|
|
|
1659
1549
|
className: "w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [--sidebar-width:18rem] [&>button]:hidden",
|
|
1660
1550
|
side,
|
|
1661
1551
|
children: [
|
|
1662
|
-
/* @__PURE__ */ (0,
|
|
1663
|
-
/* @__PURE__ */ (0,
|
|
1664
|
-
/* @__PURE__ */ (0,
|
|
1552
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(SheetHeader, { className: "sr-only", children: [
|
|
1553
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SheetTitle, { children: "Sidebar" }),
|
|
1554
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SheetDescription, { children: "Displays the mobile sidebar." })
|
|
1665
1555
|
] }),
|
|
1666
|
-
/* @__PURE__ */ (0,
|
|
1556
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex h-full w-full flex-col", children })
|
|
1667
1557
|
]
|
|
1668
1558
|
}
|
|
1669
1559
|
) });
|
|
1670
1560
|
}
|
|
1671
|
-
return /* @__PURE__ */ (0,
|
|
1561
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1672
1562
|
"div",
|
|
1673
1563
|
{
|
|
1674
1564
|
className: "group peer hidden text-sidebar-foreground md:block",
|
|
@@ -1678,7 +1568,7 @@ function Sidebar({
|
|
|
1678
1568
|
"data-side": side,
|
|
1679
1569
|
"data-slot": "sidebar",
|
|
1680
1570
|
children: [
|
|
1681
|
-
/* @__PURE__ */ (0,
|
|
1571
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1682
1572
|
"div",
|
|
1683
1573
|
{
|
|
1684
1574
|
"data-slot": "sidebar-gap",
|
|
@@ -1690,7 +1580,7 @@ function Sidebar({
|
|
|
1690
1580
|
)
|
|
1691
1581
|
}
|
|
1692
1582
|
),
|
|
1693
|
-
/* @__PURE__ */ (0,
|
|
1583
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1694
1584
|
"div",
|
|
1695
1585
|
{
|
|
1696
1586
|
"data-slot": "sidebar-container",
|
|
@@ -1702,7 +1592,7 @@ function Sidebar({
|
|
|
1702
1592
|
className
|
|
1703
1593
|
),
|
|
1704
1594
|
...props,
|
|
1705
|
-
children: /* @__PURE__ */ (0,
|
|
1595
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1706
1596
|
"div",
|
|
1707
1597
|
{
|
|
1708
1598
|
"data-sidebar": "sidebar",
|
|
@@ -1723,7 +1613,7 @@ function SidebarTrigger({
|
|
|
1723
1613
|
...props
|
|
1724
1614
|
}) {
|
|
1725
1615
|
const { toggleSidebar } = useSidebar();
|
|
1726
|
-
return /* @__PURE__ */ (0,
|
|
1616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1727
1617
|
Button,
|
|
1728
1618
|
{
|
|
1729
1619
|
"data-sidebar": "trigger",
|
|
@@ -1737,15 +1627,15 @@ function SidebarTrigger({
|
|
|
1737
1627
|
},
|
|
1738
1628
|
...props,
|
|
1739
1629
|
children: [
|
|
1740
|
-
/* @__PURE__ */ (0,
|
|
1741
|
-
/* @__PURE__ */ (0,
|
|
1630
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react7.PanelLeftIcon, {}),
|
|
1631
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
1742
1632
|
]
|
|
1743
1633
|
}
|
|
1744
1634
|
);
|
|
1745
1635
|
}
|
|
1746
1636
|
function SidebarRail({ className, ...props }) {
|
|
1747
1637
|
const { toggleSidebar } = useSidebar();
|
|
1748
|
-
return /* @__PURE__ */ (0,
|
|
1638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1749
1639
|
"button",
|
|
1750
1640
|
{
|
|
1751
1641
|
"data-sidebar": "rail",
|
|
@@ -1768,7 +1658,7 @@ function SidebarRail({ className, ...props }) {
|
|
|
1768
1658
|
);
|
|
1769
1659
|
}
|
|
1770
1660
|
function SidebarInset({ className, ...props }) {
|
|
1771
|
-
return /* @__PURE__ */ (0,
|
|
1661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1772
1662
|
"main",
|
|
1773
1663
|
{
|
|
1774
1664
|
"data-slot": "sidebar-inset",
|
|
@@ -1781,7 +1671,7 @@ function SidebarInset({ className, ...props }) {
|
|
|
1781
1671
|
);
|
|
1782
1672
|
}
|
|
1783
1673
|
function SidebarHeader({ className, ...props }) {
|
|
1784
|
-
return /* @__PURE__ */ (0,
|
|
1674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1785
1675
|
"div",
|
|
1786
1676
|
{
|
|
1787
1677
|
"data-slot": "sidebar-header",
|
|
@@ -1795,7 +1685,7 @@ function SidebarHeader({ className, ...props }) {
|
|
|
1795
1685
|
);
|
|
1796
1686
|
}
|
|
1797
1687
|
function SidebarFooter({ className, ...props }) {
|
|
1798
|
-
return /* @__PURE__ */ (0,
|
|
1688
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1799
1689
|
"div",
|
|
1800
1690
|
{
|
|
1801
1691
|
"data-slot": "sidebar-footer",
|
|
@@ -1806,7 +1696,7 @@ function SidebarFooter({ className, ...props }) {
|
|
|
1806
1696
|
);
|
|
1807
1697
|
}
|
|
1808
1698
|
function SidebarContent({ className, ...props }) {
|
|
1809
|
-
return /* @__PURE__ */ (0,
|
|
1699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1810
1700
|
"div",
|
|
1811
1701
|
{
|
|
1812
1702
|
"data-slot": "sidebar-content",
|
|
@@ -1820,7 +1710,7 @@ function SidebarContent({ className, ...props }) {
|
|
|
1820
1710
|
);
|
|
1821
1711
|
}
|
|
1822
1712
|
function SidebarGroup({ className, ...props }) {
|
|
1823
|
-
return /* @__PURE__ */ (0,
|
|
1713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1824
1714
|
"div",
|
|
1825
1715
|
{
|
|
1826
1716
|
"data-slot": "sidebar-group",
|
|
@@ -1834,7 +1724,7 @@ function SidebarGroupContent({
|
|
|
1834
1724
|
className,
|
|
1835
1725
|
...props
|
|
1836
1726
|
}) {
|
|
1837
|
-
return /* @__PURE__ */ (0,
|
|
1727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1838
1728
|
"div",
|
|
1839
1729
|
{
|
|
1840
1730
|
"data-slot": "sidebar-group-content",
|
|
@@ -1845,7 +1735,7 @@ function SidebarGroupContent({
|
|
|
1845
1735
|
);
|
|
1846
1736
|
}
|
|
1847
1737
|
function SidebarMenu({ className, ...props }) {
|
|
1848
|
-
return /* @__PURE__ */ (0,
|
|
1738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1849
1739
|
"ul",
|
|
1850
1740
|
{
|
|
1851
1741
|
"data-slot": "sidebar-menu",
|
|
@@ -1856,7 +1746,7 @@ function SidebarMenu({ className, ...props }) {
|
|
|
1856
1746
|
);
|
|
1857
1747
|
}
|
|
1858
1748
|
function SidebarMenuItem({ className, ...props }) {
|
|
1859
|
-
return /* @__PURE__ */ (0,
|
|
1749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1860
1750
|
"li",
|
|
1861
1751
|
{
|
|
1862
1752
|
"data-slot": "sidebar-menu-item",
|
|
@@ -1895,9 +1785,9 @@ function SidebarMenuButton({
|
|
|
1895
1785
|
className,
|
|
1896
1786
|
...props
|
|
1897
1787
|
}) {
|
|
1898
|
-
const Comp = asChild ?
|
|
1788
|
+
const Comp = asChild ? import_radix_ui8.Slot.Root : "button";
|
|
1899
1789
|
const { isMobile, state } = useSidebar();
|
|
1900
|
-
const button = /* @__PURE__ */ (0,
|
|
1790
|
+
const button = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1901
1791
|
Comp,
|
|
1902
1792
|
{
|
|
1903
1793
|
"data-slot": "sidebar-menu-button",
|
|
@@ -1916,9 +1806,9 @@ function SidebarMenuButton({
|
|
|
1916
1806
|
children: tooltip
|
|
1917
1807
|
};
|
|
1918
1808
|
}
|
|
1919
|
-
return /* @__PURE__ */ (0,
|
|
1920
|
-
/* @__PURE__ */ (0,
|
|
1921
|
-
/* @__PURE__ */ (0,
|
|
1809
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Tooltip, { children: [
|
|
1810
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TooltipTrigger, { asChild: true, children: button }),
|
|
1811
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1922
1812
|
TooltipContent,
|
|
1923
1813
|
{
|
|
1924
1814
|
side: "right",
|
|
@@ -1935,8 +1825,8 @@ function SidebarMenuAction({
|
|
|
1935
1825
|
showOnHover = false,
|
|
1936
1826
|
...props
|
|
1937
1827
|
}) {
|
|
1938
|
-
const Comp = asChild ?
|
|
1939
|
-
return /* @__PURE__ */ (0,
|
|
1828
|
+
const Comp = asChild ? import_radix_ui8.Slot.Root : "button";
|
|
1829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1940
1830
|
Comp,
|
|
1941
1831
|
{
|
|
1942
1832
|
"data-slot": "sidebar-menu-action",
|
|
@@ -1952,7 +1842,7 @@ function SidebarMenuAction({
|
|
|
1952
1842
|
}
|
|
1953
1843
|
|
|
1954
1844
|
// scaffold/src/components/chat/identity-control.tsx
|
|
1955
|
-
var
|
|
1845
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1956
1846
|
function identityLabel(identity) {
|
|
1957
1847
|
if (identity.displayName) return identity.displayName;
|
|
1958
1848
|
if (identity.state === "authenticated") return "Signed in";
|
|
@@ -1963,42 +1853,42 @@ function identityLabel(identity) {
|
|
|
1963
1853
|
}
|
|
1964
1854
|
function IdentityAvatar({ identity }) {
|
|
1965
1855
|
if (identity.avatarUrl) {
|
|
1966
|
-
return /* @__PURE__ */ (0,
|
|
1856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("img", { alt: "", className: "size-6 rounded-full object-cover", src: identity.avatarUrl });
|
|
1967
1857
|
}
|
|
1968
|
-
return /* @__PURE__ */ (0,
|
|
1858
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "flex size-6 items-center justify-center rounded-full bg-sidebar-accent text-[10px] font-semibold", "aria-hidden": "true", children: identity.displayName ? identity.displayName.slice(0, 1).toUpperCase() : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react8.UserRound, { className: "size-3.5" }) });
|
|
1969
1859
|
}
|
|
1970
1860
|
function IdentityControl({ identity }) {
|
|
1971
1861
|
const label = identityLabel(identity);
|
|
1972
1862
|
const canSignOut = identity.state === "authenticated" && Boolean(identity.onSignOut);
|
|
1973
1863
|
const canSignIn = (identity.state === "guest" || identity.state === "signed_out" || identity.state === "error") && Boolean(identity.onSignIn);
|
|
1974
|
-
return /* @__PURE__ */ (0,
|
|
1975
|
-
/* @__PURE__ */ (0,
|
|
1864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SidebarMenu, { className: "w-full min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SidebarMenuItem, { className: "w-full min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenu, { children: [
|
|
1865
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1976
1866
|
SidebarMenuButton,
|
|
1977
1867
|
{
|
|
1978
1868
|
size: "lg",
|
|
1979
1869
|
"aria-label": `Account: ${label}`,
|
|
1980
1870
|
className: "w-full min-w-0 justify-start",
|
|
1981
1871
|
children: [
|
|
1982
|
-
/* @__PURE__ */ (0,
|
|
1983
|
-
/* @__PURE__ */ (0,
|
|
1984
|
-
/* @__PURE__ */ (0,
|
|
1985
|
-
identity.secondaryText ? /* @__PURE__ */ (0,
|
|
1872
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(IdentityAvatar, { identity }),
|
|
1873
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "min-w-0 flex-1 overflow-hidden text-start", children: [
|
|
1874
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "block truncate text-sm font-medium", children: label }),
|
|
1875
|
+
identity.secondaryText ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "block truncate text-xs text-muted-foreground", children: identity.secondaryText }) : null
|
|
1986
1876
|
] })
|
|
1987
1877
|
]
|
|
1988
1878
|
}
|
|
1989
1879
|
) }),
|
|
1990
|
-
/* @__PURE__ */ (0,
|
|
1991
|
-
/* @__PURE__ */ (0,
|
|
1992
|
-
/* @__PURE__ */ (0,
|
|
1993
|
-
identity.secondaryText ? /* @__PURE__ */ (0,
|
|
1880
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenuContent, { align: "start", side: "top", sideOffset: 8, children: [
|
|
1881
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenuLabel, { children: [
|
|
1882
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "block truncate", children: label }),
|
|
1883
|
+
identity.secondaryText ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "mt-0.5 block truncate text-xs font-normal text-muted-foreground", children: identity.secondaryText }) : null
|
|
1994
1884
|
] }),
|
|
1995
|
-
canSignIn || canSignOut ? /* @__PURE__ */ (0,
|
|
1996
|
-
canSignIn ? /* @__PURE__ */ (0,
|
|
1997
|
-
/* @__PURE__ */ (0,
|
|
1885
|
+
canSignIn || canSignOut ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DropdownMenuSeparator, {}) : null,
|
|
1886
|
+
canSignIn ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenuItem, { onSelect: () => identity.onSignIn?.(), children: [
|
|
1887
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react8.LogIn, {}),
|
|
1998
1888
|
"Sign in"
|
|
1999
1889
|
] }) : null,
|
|
2000
|
-
canSignOut ? /* @__PURE__ */ (0,
|
|
2001
|
-
/* @__PURE__ */ (0,
|
|
1890
|
+
canSignOut ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DropdownMenuItem, { onSelect: () => identity.onSignOut?.(), children: [
|
|
1891
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react8.LogOut, {}),
|
|
2002
1892
|
"Sign out"
|
|
2003
1893
|
] }) : null
|
|
2004
1894
|
] })
|
|
@@ -2006,26 +1896,26 @@ function IdentityControl({ identity }) {
|
|
|
2006
1896
|
}
|
|
2007
1897
|
|
|
2008
1898
|
// scaffold/src/components/chat/thread-sidebar.tsx
|
|
2009
|
-
var
|
|
1899
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2010
1900
|
function ThreadStatus({ thread }) {
|
|
2011
1901
|
const activity = (0, import_react2.getThreadActivity)(thread);
|
|
2012
1902
|
const waiting = ["paused", "waiting", "interrupted"].includes(activity.status || "");
|
|
2013
1903
|
if (!activity.isSpinning && !waiting) return null;
|
|
2014
1904
|
const label = waiting ? "Waiting" : activity.status === "cancelling" ? "Cancelling" : activity.status === "queued" ? "Queued" : "Running";
|
|
2015
|
-
return /* @__PURE__ */ (0,
|
|
1905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2016
1906
|
"span",
|
|
2017
1907
|
{
|
|
2018
1908
|
className: "pointer-events-none absolute end-1 top-1/2 flex size-5 -translate-y-1/2 items-center justify-center text-muted-foreground transition-opacity group-hover/menu-item:opacity-0",
|
|
2019
1909
|
role: "status",
|
|
2020
1910
|
"aria-label": label,
|
|
2021
1911
|
title: label,
|
|
2022
|
-
children: waiting ? /* @__PURE__ */ (0,
|
|
1912
|
+
children: waiting ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react9.Pause, { className: "size-3.5 text-amber-600" }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react9.LoaderCircle, { className: "size-3.5 animate-spin" })
|
|
2023
1913
|
}
|
|
2024
1914
|
);
|
|
2025
1915
|
}
|
|
2026
1916
|
function ThreadSidebar({ activeThreadId, hasMore, identity, isLoading, isLoadingMore, onDelete, onLoadMore, onNew, onOpen, threads }) {
|
|
2027
1917
|
const { setOpenMobile } = useSidebar();
|
|
2028
|
-
return /* @__PURE__ */ (0,
|
|
1918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2029
1919
|
Sidebar,
|
|
2030
1920
|
{
|
|
2031
1921
|
"aria-label": "Conversations",
|
|
@@ -2033,19 +1923,19 @@ function ThreadSidebar({ activeThreadId, hasMore, identity, isLoading, isLoading
|
|
|
2033
1923
|
"data-agents24-chat-sidebar": "",
|
|
2034
1924
|
role: "navigation",
|
|
2035
1925
|
children: [
|
|
2036
|
-
/* @__PURE__ */ (0,
|
|
2037
|
-
/* @__PURE__ */ (0,
|
|
2038
|
-
/* @__PURE__ */ (0,
|
|
1926
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(SidebarHeader, { className: "gap-1 p-2", children: [
|
|
1927
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "h-8 shrink-0", "aria-hidden": "true" }),
|
|
1928
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Button, { className: "w-full justify-start", variant: "ghost", onClick: () => {
|
|
2039
1929
|
onNew();
|
|
2040
1930
|
setOpenMobile(false);
|
|
2041
1931
|
}, children: [
|
|
2042
|
-
/* @__PURE__ */ (0,
|
|
1932
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react9.SquarePen, {}),
|
|
2043
1933
|
" New chat"
|
|
2044
1934
|
] })
|
|
2045
1935
|
] }),
|
|
2046
|
-
/* @__PURE__ */ (0,
|
|
2047
|
-
/* @__PURE__ */ (0,
|
|
2048
|
-
/* @__PURE__ */ (0,
|
|
1936
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SidebarContent, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SidebarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(SidebarGroupContent, { children: [
|
|
1937
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SidebarMenu, { children: threads.map((thread) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(SidebarMenuItem, { children: [
|
|
1938
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2049
1939
|
SidebarMenuButton,
|
|
2050
1940
|
{
|
|
2051
1941
|
className: "pr-8 pl-3",
|
|
@@ -2055,11 +1945,11 @@ function ThreadSidebar({ activeThreadId, hasMore, identity, isLoading, isLoading
|
|
|
2055
1945
|
void onOpen(thread.id).catch(() => void 0);
|
|
2056
1946
|
setOpenMobile(false);
|
|
2057
1947
|
},
|
|
2058
|
-
children: /* @__PURE__ */ (0,
|
|
1948
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "min-w-0 truncate", children: String(thread.title || "New conversation") })
|
|
2059
1949
|
}
|
|
2060
1950
|
),
|
|
2061
|
-
/* @__PURE__ */ (0,
|
|
2062
|
-
/* @__PURE__ */ (0,
|
|
1951
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ThreadStatus, { thread }),
|
|
1952
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2063
1953
|
SidebarMenuAction,
|
|
2064
1954
|
{
|
|
2065
1955
|
showOnHover: true,
|
|
@@ -2069,12 +1959,12 @@ function ThreadSidebar({ activeThreadId, hasMore, identity, isLoading, isLoading
|
|
|
2069
1959
|
event.stopPropagation();
|
|
2070
1960
|
if (window.confirm("Delete this conversation?")) void onDelete(thread.id).catch(() => void 0);
|
|
2071
1961
|
},
|
|
2072
|
-
children: /* @__PURE__ */ (0,
|
|
1962
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react9.Trash2, {})
|
|
2073
1963
|
}
|
|
2074
1964
|
)
|
|
2075
1965
|
] }, thread.id)) }),
|
|
2076
|
-
!isLoading && threads.length === 0 && /* @__PURE__ */ (0,
|
|
2077
|
-
hasMore && /* @__PURE__ */ (0,
|
|
1966
|
+
!isLoading && threads.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "px-2 py-8 text-center text-xs text-muted-foreground", children: "No conversations" }),
|
|
1967
|
+
hasMore && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2078
1968
|
Button,
|
|
2079
1969
|
{
|
|
2080
1970
|
className: "mt-2 w-full",
|
|
@@ -2083,14 +1973,14 @@ function ThreadSidebar({ activeThreadId, hasMore, identity, isLoading, isLoading
|
|
|
2083
1973
|
variant: "ghost",
|
|
2084
1974
|
onClick: () => void onLoadMore().catch(() => void 0),
|
|
2085
1975
|
children: [
|
|
2086
|
-
isLoadingMore && /* @__PURE__ */ (0,
|
|
1976
|
+
isLoadingMore && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react9.LoaderCircle, { className: "animate-spin" }),
|
|
2087
1977
|
"Load more"
|
|
2088
1978
|
]
|
|
2089
1979
|
}
|
|
2090
1980
|
)
|
|
2091
1981
|
] }) }) }),
|
|
2092
|
-
/* @__PURE__ */ (0,
|
|
2093
|
-
/* @__PURE__ */ (0,
|
|
1982
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SidebarFooter, { className: "w-full min-w-0 p-2", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(IdentityControl, { identity }) }),
|
|
1983
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SidebarRail, {})
|
|
2094
1984
|
]
|
|
2095
1985
|
}
|
|
2096
1986
|
);
|
|
@@ -2098,7 +1988,7 @@ function ThreadSidebar({ activeThreadId, hasMore, identity, isLoading, isLoading
|
|
|
2098
1988
|
|
|
2099
1989
|
// scaffold/src/components/chat/turn-outline.tsx
|
|
2100
1990
|
var import_chat_react = require("@agents24/chat-react");
|
|
2101
|
-
var
|
|
1991
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2102
1992
|
function turnsFromMessages(messages) {
|
|
2103
1993
|
return messages.reduce((turns, message) => {
|
|
2104
1994
|
if (message.role === "user") {
|
|
@@ -2117,7 +2007,7 @@ function turnsFromMessages(messages) {
|
|
|
2117
2007
|
}, []);
|
|
2118
2008
|
}
|
|
2119
2009
|
function TurnOutline({ messages }) {
|
|
2120
|
-
return /* @__PURE__ */ (0,
|
|
2010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2121
2011
|
import_chat_react.LatestThreadScroller.Outline,
|
|
2122
2012
|
{
|
|
2123
2013
|
items: turnsFromMessages(messages),
|
|
@@ -2141,7 +2031,7 @@ function isScaffoldTimelineLoading({
|
|
|
2141
2031
|
|
|
2142
2032
|
// scaffold/src/components/chat/chat-shell.tsx
|
|
2143
2033
|
var import_chat_react2 = require("@agents24/chat-react");
|
|
2144
|
-
var
|
|
2034
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2145
2035
|
var LOADING_INPUT_CONTRACT = {
|
|
2146
2036
|
version: "agents24.runtime-inputs.v3",
|
|
2147
2037
|
modalities: {
|
|
@@ -2154,31 +2044,31 @@ var LOADING_INPUT_CONTRACT = {
|
|
|
2154
2044
|
retention: { mode: "thread_lifetime" }
|
|
2155
2045
|
};
|
|
2156
2046
|
function PersistentSidebarTrigger() {
|
|
2157
|
-
return /* @__PURE__ */ (0,
|
|
2047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "pointer-events-none fixed start-3 top-0 z-[60] flex h-12 items-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SidebarTrigger, { className: "pointer-events-auto [&_svg]:size-[18px]" }) });
|
|
2158
2048
|
}
|
|
2159
2049
|
function CollapsedHeaderActions({ onNew }) {
|
|
2160
2050
|
const { isMobile, openMobile, state } = useSidebar();
|
|
2161
2051
|
const sidebarVisible = isMobile ? openMobile : state === "expanded";
|
|
2162
2052
|
if (sidebarVisible) return null;
|
|
2163
|
-
return /* @__PURE__ */ (0,
|
|
2164
|
-
/* @__PURE__ */ (0,
|
|
2165
|
-
/* @__PURE__ */ (0,
|
|
2053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
2054
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "h-8 w-17 shrink-0", "aria-hidden": "true" }),
|
|
2055
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "pointer-events-none fixed start-12 top-0 z-[60] flex h-12 items-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button, { className: "pointer-events-auto", variant: "ghost", size: "icon-sm", "aria-label": "New chat", onClick: onNew, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react10.SquarePen, {}) }) })
|
|
2166
2056
|
] });
|
|
2167
2057
|
}
|
|
2168
2058
|
function OperationErrorNotice({ runtime }) {
|
|
2169
2059
|
const error = runtime.operationError || runtime.backgroundError;
|
|
2170
2060
|
if (!error) return null;
|
|
2171
|
-
return /* @__PURE__ */ (0,
|
|
2172
|
-
/* @__PURE__ */ (0,
|
|
2173
|
-
/* @__PURE__ */ (0,
|
|
2174
|
-
/* @__PURE__ */ (0,
|
|
2061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "pointer-events-none absolute inset-x-0 top-3 z-40 flex justify-center px-4", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "pointer-events-auto flex max-w-lg items-start gap-2 rounded-lg border border-destructive/20 bg-background px-3 py-2 text-sm shadow-md", role: "alert", children: [
|
|
2062
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react10.CircleAlert, { className: "mt-0.5 size-4 shrink-0 text-destructive" }),
|
|
2063
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "min-w-0 flex-1 wrap-break-word", children: (0, import_runtime3.agentChatRuntimeErrorMessage)(error) || "The chat could not complete that action." }),
|
|
2064
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2175
2065
|
Button,
|
|
2176
2066
|
{
|
|
2177
2067
|
"aria-label": "Dismiss error",
|
|
2178
2068
|
onClick: runtime.operationError ? runtime.clearOperationError : runtime.controller.clearBackgroundError,
|
|
2179
2069
|
size: "icon-xs",
|
|
2180
2070
|
variant: "ghost",
|
|
2181
|
-
children: /* @__PURE__ */ (0,
|
|
2071
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react10.X, {})
|
|
2182
2072
|
}
|
|
2183
2073
|
)
|
|
2184
2074
|
] }) });
|
|
@@ -2187,7 +2077,8 @@ function ChatShell({
|
|
|
2187
2077
|
components,
|
|
2188
2078
|
identity,
|
|
2189
2079
|
runtime,
|
|
2190
|
-
sidebar
|
|
2080
|
+
sidebar,
|
|
2081
|
+
timelineOptions
|
|
2191
2082
|
}) {
|
|
2192
2083
|
const Composer = components?.Composer || ChatComposer;
|
|
2193
2084
|
const { controller } = runtime;
|
|
@@ -2222,15 +2113,15 @@ function ChatShell({
|
|
|
2222
2113
|
resizeObserver.observe(overlay);
|
|
2223
2114
|
return () => resizeObserver.disconnect();
|
|
2224
2115
|
}, [isEmptyState]);
|
|
2225
|
-
return /* @__PURE__ */ (0,
|
|
2116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2226
2117
|
SidebarProvider,
|
|
2227
2118
|
{
|
|
2228
2119
|
className: "h-svh min-h-0 overflow-hidden",
|
|
2229
2120
|
"data-agents24-chat": "",
|
|
2230
2121
|
"data-agents24-chat-layout": "",
|
|
2231
2122
|
children: [
|
|
2232
|
-
/* @__PURE__ */ (0,
|
|
2233
|
-
sidebar || /* @__PURE__ */ (0,
|
|
2123
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(PersistentSidebarTrigger, {}),
|
|
2124
|
+
sidebar || /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2234
2125
|
ThreadSidebar,
|
|
2235
2126
|
{
|
|
2236
2127
|
activeThreadId: controller.activeThreadId,
|
|
@@ -2245,58 +2136,58 @@ function ChatShell({
|
|
|
2245
2136
|
onOpen: runtime.openThread
|
|
2246
2137
|
}
|
|
2247
2138
|
),
|
|
2248
|
-
/* @__PURE__ */ (0,
|
|
2249
|
-
/* @__PURE__ */ (0,
|
|
2139
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(SidebarInset, { className: "h-svh min-h-0 overflow-hidden bg-background", children: [
|
|
2140
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2250
2141
|
"header",
|
|
2251
2142
|
{
|
|
2252
2143
|
className: "flex h-12 shrink-0 items-center gap-2 border-b border-border/50 px-3 sm:px-4",
|
|
2253
2144
|
"data-agents24-chat-header": "",
|
|
2254
2145
|
children: [
|
|
2255
|
-
/* @__PURE__ */ (0,
|
|
2256
|
-
/* @__PURE__ */ (0,
|
|
2257
|
-
/* @__PURE__ */ (0,
|
|
2146
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(CollapsedHeaderActions, { onNew: runtime.newThread }),
|
|
2147
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h1", { className: "truncate text-sm font-medium", children: String(activeTitle || "New chat") }) }),
|
|
2148
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ThemeMenu, {})
|
|
2258
2149
|
]
|
|
2259
2150
|
}
|
|
2260
2151
|
),
|
|
2261
|
-
/* @__PURE__ */ (0,
|
|
2152
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2262
2153
|
"section",
|
|
2263
2154
|
{
|
|
2264
2155
|
"aria-label": "Conversation",
|
|
2265
2156
|
className: "relative flex min-h-0 flex-1 flex-col overflow-hidden",
|
|
2266
2157
|
"data-agents24-chat-transcript": "",
|
|
2267
2158
|
children: [
|
|
2268
|
-
/* @__PURE__ */ (0,
|
|
2269
|
-
/* @__PURE__ */ (0,
|
|
2270
|
-
/* @__PURE__ */ (0,
|
|
2271
|
-
!isEmptyState && /* @__PURE__ */ (0,
|
|
2272
|
-
/* @__PURE__ */ (0,
|
|
2159
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(OperationErrorNotice, { runtime }),
|
|
2160
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SubagentTasks, { threadId: controller.activeThreadId }),
|
|
2161
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_chat_react2.LatestThreadScroller.Provider, { autoScroll: true, defaultScrollPosition: "last-anchor", scrollPreviousItemPeek: 64, children: [
|
|
2162
|
+
!isEmptyState && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_chat_react2.LatestThreadScroller.Root, { className: "relative min-h-0 flex-1", children: [
|
|
2163
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_chat_react2.LatestThreadScroller.Viewport, { preserveScrollOnPrepend: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2273
2164
|
import_chat_react2.LatestThreadScroller.Content,
|
|
2274
2165
|
{
|
|
2275
2166
|
className: "mx-auto w-full max-w-3xl gap-3 px-4 pt-8 pb-0 sm:px-6 sm:pt-12",
|
|
2276
2167
|
style: { paddingBottom: composerOverlayHeight + 72 },
|
|
2277
2168
|
children: [
|
|
2278
|
-
controller.hasOlderTurns && /* @__PURE__ */ (0,
|
|
2169
|
+
controller.hasOlderTurns && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Button, { className: "self-center", variant: "ghost", size: "sm", disabled: controller.isLoadingOlder, onClick: () => {
|
|
2279
2170
|
void controller.loadOlder().catch(() => void 0);
|
|
2280
2171
|
}, children: [
|
|
2281
|
-
controller.isLoadingOlder && /* @__PURE__ */ (0,
|
|
2172
|
+
controller.isLoadingOlder && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react10.LoaderCircle, { className: "animate-spin" }),
|
|
2282
2173
|
" Load earlier messages"
|
|
2283
2174
|
] }),
|
|
2284
|
-
runtime.isBootstrapping && /* @__PURE__ */ (0,
|
|
2285
|
-
hasBlockingError && /* @__PURE__ */ (0,
|
|
2286
|
-
/* @__PURE__ */ (0,
|
|
2287
|
-
/* @__PURE__ */ (0,
|
|
2288
|
-
/* @__PURE__ */ (0,
|
|
2289
|
-
/* @__PURE__ */ (0,
|
|
2175
|
+
runtime.isBootstrapping && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { "aria-label": "Loading conversation", className: "flex flex-1 items-center justify-center py-24 text-muted-foreground", role: "status", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react10.LoaderCircle, { className: "size-4 animate-spin" }) }),
|
|
2176
|
+
hasBlockingError && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-1 flex-col items-center justify-center gap-3 py-24 text-center", children: [
|
|
2177
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react10.CircleAlert, { className: "size-5 text-destructive" }),
|
|
2178
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { children: [
|
|
2179
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h2", { className: "font-medium", children: "Couldn\u2019t connect" }),
|
|
2180
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "mt-1 max-w-md text-sm text-muted-foreground", children: runtime.errorMessage })
|
|
2290
2181
|
] }),
|
|
2291
|
-
/* @__PURE__ */ (0,
|
|
2182
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button, { variant: "outline", onClick: () => void runtime.retryBootstrap(), children: "Try again" })
|
|
2292
2183
|
] }),
|
|
2293
|
-
controller.messages.map((message) => /* @__PURE__ */ (0,
|
|
2184
|
+
controller.messages.map((message) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2294
2185
|
import_chat_react2.LatestThreadScroller.Item,
|
|
2295
2186
|
{
|
|
2296
2187
|
messageId: message.id,
|
|
2297
2188
|
scrollAnchor: isRunning && message.id === latestAnchorId,
|
|
2298
2189
|
className: "overflow-visible [content-visibility:visible]",
|
|
2299
|
-
children: /* @__PURE__ */ (0,
|
|
2190
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2300
2191
|
ChatMessage,
|
|
2301
2192
|
{
|
|
2302
2193
|
animateCompletion: wasLiveRun(message.runId),
|
|
@@ -2313,7 +2204,8 @@ function ChatShell({
|
|
|
2313
2204
|
onRegenerate: () => controller.regenerate(message),
|
|
2314
2205
|
onSetFeedback: (input) => controller.setFeedback(message, input),
|
|
2315
2206
|
resolveAttachmentContent: runtime.resolveAttachmentContent,
|
|
2316
|
-
Timeline: components?.Timeline
|
|
2207
|
+
Timeline: components?.Timeline,
|
|
2208
|
+
timelineOptions
|
|
2317
2209
|
}
|
|
2318
2210
|
)
|
|
2319
2211
|
},
|
|
@@ -2322,9 +2214,9 @@ function ChatShell({
|
|
|
2322
2214
|
]
|
|
2323
2215
|
}
|
|
2324
2216
|
) }),
|
|
2325
|
-
/* @__PURE__ */ (0,
|
|
2217
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TurnOutline, { messages: controller.messages })
|
|
2326
2218
|
] }),
|
|
2327
|
-
/* @__PURE__ */ (0,
|
|
2219
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2328
2220
|
"div",
|
|
2329
2221
|
{
|
|
2330
2222
|
ref: composerOverlayRef,
|
|
@@ -2333,11 +2225,11 @@ function ChatShell({
|
|
|
2333
2225
|
background: "linear-gradient(to bottom, transparent 0%, color-mix(in oklch, var(--background) 85%, transparent) 45%, var(--background) 65%, var(--background) 100%)"
|
|
2334
2226
|
},
|
|
2335
2227
|
children: [
|
|
2336
|
-
isEmptyState ? /* @__PURE__ */ (0,
|
|
2337
|
-
/* @__PURE__ */ (0,
|
|
2228
|
+
isEmptyState ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "mx-auto mb-8 w-full max-w-3xl px-4 text-center sm:px-6", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h2", { className: "text-3xl font-semibold tracking-tight sm:text-4xl", children: "Ready when you are." }) }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "pointer-events-auto absolute inset-x-0 top-0 flex -translate-y-full justify-center pb-3", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_chat_react2.LatestThreadScroller.Button, { className: "!relative !inset-auto !translate-x-0 rtl:!translate-x-0" }) }),
|
|
2229
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "pointer-events-auto mx-auto w-full max-w-3xl px-4 sm:px-6", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2338
2230
|
Composer,
|
|
2339
2231
|
{
|
|
2340
|
-
queue: /* @__PURE__ */ (0,
|
|
2232
|
+
queue: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2341
2233
|
import_ui5.AgentChatQueue,
|
|
2342
2234
|
{
|
|
2343
2235
|
pending: controller.pendingMessages,
|
|
@@ -2349,6 +2241,7 @@ function ChatShell({
|
|
|
2349
2241
|
),
|
|
2350
2242
|
restoredDraft,
|
|
2351
2243
|
inputContract: runtime.inputContract || LOADING_INPUT_CONTRACT,
|
|
2244
|
+
realtimeDictation: runtime.dictation,
|
|
2352
2245
|
contextWindow: runtime.contextWindow,
|
|
2353
2246
|
disabled: runtime.isBootstrapping || runtime.isChangingAgent || isUploading || hasBlockingError,
|
|
2354
2247
|
scopeKey: controller.activeThreadId,
|
|
@@ -2367,10 +2260,12 @@ function ChatShell({
|
|
|
2367
2260
|
modelId: runtime.modelId,
|
|
2368
2261
|
models: runtime.models,
|
|
2369
2262
|
onModelChange: runtime.changeModel,
|
|
2370
|
-
onSubmit: (text, files) => runtime.submit({
|
|
2263
|
+
onSubmit: (text, files, context) => runtime.submit({
|
|
2371
2264
|
text,
|
|
2265
|
+
dictationSessionId: context?.dictationSessionId,
|
|
2372
2266
|
files: files.filter((file) => file.source).map((file) => ({
|
|
2373
2267
|
data: file.source,
|
|
2268
|
+
transcriptPresentation: file.transcriptPresentation,
|
|
2374
2269
|
mediaType: file.mediaType,
|
|
2375
2270
|
name: file.filename
|
|
2376
2271
|
})),
|
|
@@ -2397,29 +2292,34 @@ function ChatShell({
|
|
|
2397
2292
|
var GUEST_CHAT_IDENTITY = { state: "guest" };
|
|
2398
2293
|
|
|
2399
2294
|
// scaffold/src/app.tsx
|
|
2400
|
-
var
|
|
2295
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2401
2296
|
var createBrowserAbortController = () => new AbortController();
|
|
2402
2297
|
var browserVisibility = (0, import_browser.createBrowserVisibility)();
|
|
2403
2298
|
function RuntimeChat({
|
|
2404
2299
|
components,
|
|
2405
2300
|
identity = GUEST_CHAT_IDENTITY,
|
|
2301
|
+
nodeActivityMode,
|
|
2302
|
+
renderUiBlocks,
|
|
2303
|
+
toolLabelMode,
|
|
2304
|
+
toolSlots,
|
|
2305
|
+
toolViewMode,
|
|
2406
2306
|
...props
|
|
2407
2307
|
}) {
|
|
2408
2308
|
const runtime = (0, import_runtime4.useAgentChatRuntime)({
|
|
2409
2309
|
...props,
|
|
2410
2310
|
mcpRedirectUri: props.mcpRedirectUri || (typeof window === "undefined" ? void 0 : window.location.href)
|
|
2411
2311
|
});
|
|
2412
|
-
return /* @__PURE__ */ (0,
|
|
2312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ChatShell, { components, identity, runtime, sidebar: props.sidebar, timelineOptions: { nodeActivityMode, renderUiBlocks, toolLabelMode, toolSlots, toolViewMode } });
|
|
2413
2313
|
}
|
|
2414
2314
|
function App(props) {
|
|
2415
2315
|
const identity = props.identity || GUEST_CHAT_IDENTITY;
|
|
2416
|
-
return /* @__PURE__ */ (0,
|
|
2316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react3.Agents24Provider, { client: props.client, createAbortController: createBrowserAbortController, visibility: browserVisibility, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(RuntimeChat, { ...props }, identity.state) });
|
|
2417
2317
|
}
|
|
2418
2318
|
|
|
2419
2319
|
// scaffold/src/index.tsx
|
|
2420
|
-
var
|
|
2320
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2421
2321
|
function Agents24ChatScaffold({ appearanceController, theme, themeMode, ...props }) {
|
|
2422
|
-
return /* @__PURE__ */ (0,
|
|
2322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ThemeProvider, { controller: appearanceController, theme, mode: themeMode, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(App, { ...props }) }) });
|
|
2423
2323
|
}
|
|
2424
2324
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2425
2325
|
0 && (module.exports = {
|