@inf-monkeys-tech/monkeys-design 1.0.48 → 1.0.49
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.
|
@@ -646,6 +646,8 @@ var DropdownMenuSeparator = React2.forwardRef(
|
|
|
646
646
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Separator, { ref, className: cn("-mx-1 my-1 h-px bg-muted", className), ...props })
|
|
647
647
|
);
|
|
648
648
|
DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
|
|
649
|
+
var Select = SelectPrimitive.Root;
|
|
650
|
+
var SelectValue = SelectPrimitive.Value;
|
|
649
651
|
var SelectTrigger = React2.forwardRef(
|
|
650
652
|
({ className, children, iconClassName, size = "default", ...props }, ref) => /* @__PURE__ */ jsxs(SelectPrimitive.Trigger, { ref, className: cn("flex h-10 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-control-surface px-3 py-2 text-left text-sm shadow-sm ring-offset-control-surface data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:min-w-0 [&>span]:flex-1 [&>span]:text-left", size === "sm" && "h-8 px-2 py-1 text-xs", className), ...props, children: [
|
|
651
653
|
children,
|
|
@@ -687,7 +689,14 @@ var SelectSeparator = React2.forwardRef(
|
|
|
687
689
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Separator, { ref, className: cn("-mx-1 my-1 h-px bg-muted", className), ...props })
|
|
688
690
|
);
|
|
689
691
|
SelectSeparator.displayName = "SelectSeparator";
|
|
690
|
-
var iconButtonClass = "
|
|
692
|
+
var iconButtonClass = "size-8 shrink-0 p-0 text-muted-foreground";
|
|
693
|
+
function ComposerSelect({ value, label, placeholder, options, className, onValueChange }) {
|
|
694
|
+
const selectedOption = options.find((option) => option.value === value);
|
|
695
|
+
return /* @__PURE__ */ jsxs(Select, { value: value || void 0, disabled: options.length === 0, onValueChange, children: [
|
|
696
|
+
/* @__PURE__ */ jsx(SelectTrigger, { size: "sm", "aria-label": label, className: cn2("shrink bg-background font-medium", className), children: /* @__PURE__ */ jsx(SelectValue, { placeholder, children: selectedOption?.label }) }),
|
|
697
|
+
/* @__PURE__ */ jsx(SelectContent, { disableTriggerViewportSizing: true, children: options.map((option) => /* @__PURE__ */ jsx(SelectItem, { value: option.value, disabled: option.disabled, children: option.label }, option.value)) })
|
|
698
|
+
] });
|
|
699
|
+
}
|
|
691
700
|
function modelOptionValue(option) {
|
|
692
701
|
return `${option.mode}:${option.id}`;
|
|
693
702
|
}
|
|
@@ -783,13 +792,13 @@ function AgentWorkbenchComposer({
|
|
|
783
792
|
}
|
|
784
793
|
) : /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: draft.text || messages.composer.attachmentOnly }),
|
|
785
794
|
/* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-0.5", children: [
|
|
786
|
-
/* @__PURE__ */ jsx(
|
|
787
|
-
/* @__PURE__ */ jsx(
|
|
788
|
-
/* @__PURE__ */ jsx(
|
|
795
|
+
/* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "icon", className: iconButtonClass, "aria-label": messages.composer.moveUp, disabled: index === 0, onClick: () => onIntent?.({ type: "move-queued-draft", draftId: draft.id, direction: "up" }), children: /* @__PURE__ */ jsx(ArrowUp, { className: "size-3.5" }) }),
|
|
796
|
+
/* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "icon", className: iconButtonClass, "aria-label": messages.composer.moveDown, disabled: index === viewModel.queuedDrafts.length - 1, onClick: () => onIntent?.({ type: "move-queued-draft", draftId: draft.id, direction: "down" }), children: /* @__PURE__ */ jsx(ArrowDown, { className: "size-3.5" }) }),
|
|
797
|
+
/* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "icon", className: iconButtonClass, "aria-label": messages.composer.editQueued, onClick: () => {
|
|
789
798
|
setEditingDraftId(draft.id);
|
|
790
799
|
setEditingText(draft.text);
|
|
791
800
|
}, children: /* @__PURE__ */ jsx(Pencil, { className: "size-3.5" }) }),
|
|
792
|
-
/* @__PURE__ */ jsx(
|
|
801
|
+
/* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "icon", className: cn2(iconButtonClass, "text-destructive-text hover:text-destructive-text"), "aria-label": messages.composer.deleteQueued, onClick: () => onIntent?.({ type: "delete-queued-draft", draftId: draft.id }), children: /* @__PURE__ */ jsx(Trash2, { className: "size-3.5" }) })
|
|
793
802
|
] })
|
|
794
803
|
] }, draft.id)) })
|
|
795
804
|
}
|
|
@@ -799,9 +808,11 @@ function AgentWorkbenchComposer({
|
|
|
799
808
|
attachment.previewUrl && attachment.mediaType?.startsWith("image/") ? /* @__PURE__ */ jsx("img", { src: attachment.previewUrl, alt: "", className: "size-full object-cover" }) : attachment.mediaType?.startsWith("image/") ? /* @__PURE__ */ jsx(Image, { className: "size-5 text-muted-foreground" }) : /* @__PURE__ */ jsx(File, { className: "size-5 text-muted-foreground" }),
|
|
800
809
|
attachment.status === "uploading" ? /* @__PURE__ */ jsx("span", { className: "absolute inset-0 flex items-center justify-center bg-background/80 text-[10px] font-medium", children: messages.composer.uploading }) : null,
|
|
801
810
|
/* @__PURE__ */ jsx(
|
|
802
|
-
|
|
811
|
+
Button,
|
|
803
812
|
{
|
|
804
813
|
type: "button",
|
|
814
|
+
variant: "secondary",
|
|
815
|
+
size: "icon",
|
|
805
816
|
className: "absolute right-1 top-1 flex size-5 items-center justify-center rounded-full bg-background/90 text-foreground shadow",
|
|
806
817
|
"aria-label": messages.composer.removeAttachment,
|
|
807
818
|
onClick: () => onIntent?.({ type: "remove-attachment", attachmentId: attachment.id }),
|
|
@@ -830,7 +841,7 @@ function AgentWorkbenchComposer({
|
|
|
830
841
|
/* @__PURE__ */ jsxs("div", { className: cn2("agent-workbench-composer__toolbar mt-2 flex min-h-8 min-w-0 max-w-full items-center gap-2", isNarrow ? "flex-wrap" : "flex-nowrap", classNames?.toolbar), children: [
|
|
831
842
|
/* @__PURE__ */ jsxs("div", { className: cn2("agent-workbench-composer__controls flex min-w-0 max-w-full flex-1 items-center gap-1.5", isNarrow ? "w-full flex-wrap" : "flex-nowrap"), children: [
|
|
832
843
|
viewModel.capabilities.attachments ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
833
|
-
/* @__PURE__ */ jsx(
|
|
844
|
+
/* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "icon", className: iconButtonClass, "aria-label": messages.composer.attach, onClick: () => fileInputRef.current?.click(), children: /* @__PURE__ */ jsx(Paperclip, { className: "size-4" }) }),
|
|
834
845
|
/* @__PURE__ */ jsx(
|
|
835
846
|
"input",
|
|
836
847
|
{
|
|
@@ -846,7 +857,7 @@ function AgentWorkbenchComposer({
|
|
|
846
857
|
}
|
|
847
858
|
)
|
|
848
859
|
] }) : null,
|
|
849
|
-
viewModel.capabilities.voiceInput ? /* @__PURE__ */ jsx(
|
|
860
|
+
viewModel.capabilities.voiceInput ? /* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "icon", className: iconButtonClass, "aria-label": messages.composer.voice, onClick: () => onIntent?.({ type: "request-voice-input" }), children: /* @__PURE__ */ jsx(Mic, { className: "size-4" }) }) : null,
|
|
850
861
|
viewModel.capabilities.webSearch ? /* @__PURE__ */ jsxs("label", { className: "flex shrink-0 items-center gap-1.5 whitespace-nowrap px-1 text-xs font-medium text-foreground", children: [
|
|
851
862
|
messages.composer.webSearch,
|
|
852
863
|
/* @__PURE__ */ jsx(Switch, { checked: viewModel.webSearchEnabled, onCheckedChange: (enabled) => onIntent?.({ type: "toggle-web-search", enabled }) })
|
|
@@ -858,12 +869,14 @@ function AgentWorkbenchComposer({
|
|
|
858
869
|
role: "group",
|
|
859
870
|
"aria-label": messages.composer.chatMode,
|
|
860
871
|
children: ["chat", "work"].map((mode) => /* @__PURE__ */ jsx(
|
|
861
|
-
|
|
872
|
+
Button,
|
|
862
873
|
{
|
|
863
874
|
type: "button",
|
|
875
|
+
variant: "ghost",
|
|
876
|
+
size: "sm",
|
|
864
877
|
"aria-pressed": viewModel.mode === mode,
|
|
865
878
|
className: cn2(
|
|
866
|
-
"h-7 rounded px-2.5 text-xs font-medium
|
|
879
|
+
"h-7 rounded px-2.5 text-xs font-medium shadow-none",
|
|
867
880
|
viewModel.mode === mode ? "bg-background text-foreground shadow-sm" : "text-foreground/75 hover:text-foreground"
|
|
868
881
|
),
|
|
869
882
|
onClick: () => onIntent?.({ type: "change-mode", mode }),
|
|
@@ -873,54 +886,57 @@ function AgentWorkbenchComposer({
|
|
|
873
886
|
))
|
|
874
887
|
}
|
|
875
888
|
) : null,
|
|
876
|
-
viewModel.capabilities.modelSelection ? /* @__PURE__ */ jsx(
|
|
877
|
-
|
|
878
|
-
"select",
|
|
889
|
+
viewModel.capabilities.modelSelection ? /* @__PURE__ */ jsx(
|
|
890
|
+
ComposerSelect,
|
|
879
891
|
{
|
|
880
|
-
id: "agent-workbench-model",
|
|
881
892
|
value: selectedModelValue,
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
893
|
+
label: messages.composer.model,
|
|
894
|
+
placeholder: messages.composer.noModels,
|
|
895
|
+
className: "w-48 min-w-36",
|
|
896
|
+
options: visibleModelOptions.map((option) => ({
|
|
897
|
+
value: modelOptionValue(option),
|
|
898
|
+
label: `${option.label} \xB7 ${messages.modes[option.mode]}`,
|
|
899
|
+
disabled: option.disabled
|
|
900
|
+
})),
|
|
901
|
+
onValueChange: (value) => {
|
|
902
|
+
const option = visibleModelOptions.find((item) => modelOptionValue(item) === value);
|
|
886
903
|
if (option) onIntent?.({ type: "select-model", modelId: option.id, mode: option.mode });
|
|
887
|
-
}
|
|
888
|
-
children: [
|
|
889
|
-
visibleModelOptions.length === 0 ? /* @__PURE__ */ jsx("option", { value: "", children: messages.composer.noModels }) : null,
|
|
890
|
-
visibleModelOptions.map((option) => /* @__PURE__ */ jsxs("option", { value: modelOptionValue(option), disabled: option.disabled, children: [
|
|
891
|
-
option.label,
|
|
892
|
-
" \xB7 ",
|
|
893
|
-
messages.modes[option.mode]
|
|
894
|
-
] }, modelOptionValue(option)))
|
|
895
|
-
]
|
|
904
|
+
}
|
|
896
905
|
}
|
|
897
906
|
) : null,
|
|
898
907
|
viewModel.capabilities.reasoning && viewModel.reasoning ? /* @__PURE__ */ jsx(
|
|
899
|
-
|
|
908
|
+
ComposerSelect,
|
|
900
909
|
{
|
|
901
910
|
value: viewModel.reasoning.value,
|
|
902
|
-
|
|
903
|
-
className: "
|
|
904
|
-
|
|
905
|
-
|
|
911
|
+
label: messages.composer.reasoning,
|
|
912
|
+
className: "w-32 min-w-24",
|
|
913
|
+
options: viewModel.reasoning.options.map((value) => ({
|
|
914
|
+
value,
|
|
915
|
+
label: messages.composer.reasoningOptions[value]
|
|
916
|
+
})),
|
|
917
|
+
onValueChange: (value) => onIntent?.({ type: "change-reasoning", value })
|
|
906
918
|
}
|
|
907
919
|
) : null,
|
|
908
920
|
viewModel.capabilities.permissions && viewModel.permissionProfile ? /* @__PURE__ */ jsx(
|
|
909
|
-
|
|
921
|
+
ComposerSelect,
|
|
910
922
|
{
|
|
911
923
|
value: viewModel.permissionProfile,
|
|
912
|
-
|
|
913
|
-
className: "
|
|
914
|
-
|
|
915
|
-
|
|
924
|
+
label: messages.composer.permissions,
|
|
925
|
+
className: "w-40 min-w-32",
|
|
926
|
+
options: ["approval-required", "auto-approve", "full-access"].map((value) => ({
|
|
927
|
+
value,
|
|
928
|
+
label: messages.composer.permissionOptions[value]
|
|
929
|
+
})),
|
|
930
|
+
onValueChange: (value) => onIntent?.({ type: "change-permission", value })
|
|
916
931
|
}
|
|
917
932
|
) : null
|
|
918
933
|
] }),
|
|
919
934
|
/* @__PURE__ */ jsxs("div", { className: "ml-auto flex shrink-0 items-center gap-1.5", children: [
|
|
920
935
|
showSubmitButton ? /* @__PURE__ */ jsx(
|
|
921
|
-
|
|
936
|
+
Button,
|
|
922
937
|
{
|
|
923
938
|
type: "submit",
|
|
939
|
+
size: "icon",
|
|
924
940
|
className: cn2(
|
|
925
941
|
iconButtonClass,
|
|
926
942
|
"bg-primary text-primary-foreground hover:bg-primary/90 hover:text-primary-foreground disabled:bg-primary/40 disabled:!opacity-100"
|
|
@@ -931,10 +947,12 @@ function AgentWorkbenchComposer({
|
|
|
931
947
|
}
|
|
932
948
|
) : null,
|
|
933
949
|
isBusy && !canSubmit && viewModel.capabilities.stop ? /* @__PURE__ */ jsx(
|
|
934
|
-
|
|
950
|
+
Button,
|
|
935
951
|
{
|
|
936
952
|
type: "button",
|
|
937
|
-
|
|
953
|
+
variant: "outline",
|
|
954
|
+
size: "icon",
|
|
955
|
+
className: iconButtonClass,
|
|
938
956
|
"aria-label": isStopping ? messages.run.stopping : messages.composer.stop,
|
|
939
957
|
disabled: isStopping,
|
|
940
958
|
onClick: () => onIntent?.({ type: "stop" }),
|