@inf-monkeys-tech/monkeys-design 1.0.24 → 1.0.27

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.
Files changed (59) hide show
  1. package/dist/components/agent-workbench/index.d.mts +8 -3
  2. package/dist/components/agent-workbench/index.d.ts +8 -3
  3. package/dist/components/agent-workbench/index.js +61 -21
  4. package/dist/components/agent-workbench/index.js.map +1 -1
  5. package/dist/components/agent-workbench/index.mjs +61 -21
  6. package/dist/components/agent-workbench/index.mjs.map +1 -1
  7. package/dist/components/base/index.js +2 -0
  8. package/dist/components/base/index.js.map +1 -1
  9. package/dist/components/base/index.mjs +2 -0
  10. package/dist/components/base/index.mjs.map +1 -1
  11. package/dist/components/data-explorer/index.js +2 -0
  12. package/dist/components/data-explorer/index.js.map +1 -1
  13. package/dist/components/data-explorer/index.mjs +2 -0
  14. package/dist/components/data-explorer/index.mjs.map +1 -1
  15. package/dist/components/layout/index.js +2 -0
  16. package/dist/components/layout/index.js.map +1 -1
  17. package/dist/components/layout/index.mjs +2 -0
  18. package/dist/components/layout/index.mjs.map +1 -1
  19. package/dist/components/runtime/index.js +2 -0
  20. package/dist/components/runtime/index.js.map +1 -1
  21. package/dist/components/runtime/index.mjs +2 -0
  22. package/dist/components/runtime/index.mjs.map +1 -1
  23. package/dist/components/toast/index.d.mts +1 -1
  24. package/dist/components/toast/index.d.ts +1 -1
  25. package/dist/components/toast/index.js +2 -0
  26. package/dist/components/toast/index.js.map +1 -1
  27. package/dist/components/toast/index.mjs +2 -0
  28. package/dist/components/toast/index.mjs.map +1 -1
  29. package/dist/components/toolbar/index.js +2 -0
  30. package/dist/components/toolbar/index.js.map +1 -1
  31. package/dist/components/toolbar/index.mjs +2 -0
  32. package/dist/components/toolbar/index.mjs.map +1 -1
  33. package/dist/components/workbench/index.js +2 -0
  34. package/dist/components/workbench/index.js.map +1 -1
  35. package/dist/components/workbench/index.mjs +2 -0
  36. package/dist/components/workbench/index.mjs.map +1 -1
  37. package/dist/{details-model-235bb3448dca.d.mts → details-model-bc28e9593e3f.d.mts} +2 -1
  38. package/dist/{details-model-235bb3448dca.d.ts → details-model-bc28e9593e3f.d.ts} +2 -1
  39. package/dist/index.d.mts +2 -2
  40. package/dist/index.d.ts +2 -2
  41. package/dist/index.js +25 -13
  42. package/dist/index.js.map +1 -1
  43. package/dist/index.mjs +25 -13
  44. package/dist/index.mjs.map +1 -1
  45. package/dist/locale/index.d.mts +6 -2
  46. package/dist/locale/index.d.ts +6 -2
  47. package/dist/locale/index.js +4 -0
  48. package/dist/locale/index.js.map +1 -1
  49. package/dist/locale/index.mjs +4 -0
  50. package/dist/locale/index.mjs.map +1 -1
  51. package/dist/provider/index.d.mts +2 -2
  52. package/dist/provider/index.d.ts +2 -2
  53. package/dist/provider/index.js +4 -0
  54. package/dist/provider/index.js.map +1 -1
  55. package/dist/provider/index.mjs +4 -0
  56. package/dist/provider/index.mjs.map +1 -1
  57. package/dist/{types-a81dc2d284e3.d.mts → types-4c3363833cff.d.mts} +2 -0
  58. package/dist/{types-a81dc2d284e3.d.ts → types-4c3363833cff.d.ts} +2 -0
  59. package/package.json +1 -1
@@ -124,6 +124,7 @@ var enUS = {
124
124
  attach: "Add photos or files",
125
125
  voice: "Start voice input",
126
126
  webSearch: "Web search",
127
+ chatMode: "Chat mode",
127
128
  model: "Model",
128
129
  reasoning: "Reasoning effort",
129
130
  permissions: "Permissions",
@@ -173,6 +174,7 @@ var enUS = {
173
174
  },
174
175
  navigation: {
175
176
  search: "Search agents and sessions",
177
+ searchSessions: "Search sessions",
176
178
  searchShortcut: "Focus search",
177
179
  clearSearch: "Clear search",
178
180
  tabsLabel: "Agent workbench navigation",
@@ -648,6 +650,8 @@ function modelOptionValue(option) {
648
650
  }
649
651
  function AgentWorkbenchComposer({
650
652
  viewModel,
653
+ modeSelectionEnabled = false,
654
+ modeFilteringEnabled = false,
651
655
  className,
652
656
  classNames,
653
657
  onIntent
@@ -658,19 +662,25 @@ function AgentWorkbenchComposer({
658
662
  const [editingDraftId, setEditingDraftId] = useState();
659
663
  const [editingText, setEditingText] = useState("");
660
664
  const [isNarrow, setIsNarrow] = useState(false);
665
+ const narrowBreakpoint = modeSelectionEnabled ? 900 : 704;
661
666
  const isBusy = viewModel.status === "loading" || viewModel.status === "streaming" || viewModel.status === "stopping";
662
667
  const isStopping = viewModel.status === "stopping";
663
668
  const isUploading = viewModel.attachments.some((attachment) => attachment.status === "uploading");
664
669
  const canSubmit = !isStopping && !isUploading && (viewModel.value.trim().length > 0 || viewModel.attachments.some((item) => item.status === "ready"));
665
670
  const showSubmitButton = !isBusy || canSubmit;
671
+ const filterModelsByMode = modeSelectionEnabled || modeFilteringEnabled;
672
+ const visibleModelOptions = useMemo(
673
+ () => filterModelsByMode ? viewModel.model.options.filter((option) => option.mode === viewModel.mode) : viewModel.model.options,
674
+ [filterModelsByMode, viewModel.mode, viewModel.model.options]
675
+ );
666
676
  const selectedModelValue = useMemo(() => {
667
- const selected = viewModel.model.options.find((option) => option.id === viewModel.model.selectedId);
668
- return selected ? modelOptionValue(selected) : "";
669
- }, [viewModel.model.options, viewModel.model.selectedId]);
677
+ const selected = visibleModelOptions.find((option) => option.id === viewModel.model.selectedId && option.mode === viewModel.mode);
678
+ return selected ? modelOptionValue(selected) : visibleModelOptions[0] ? modelOptionValue(visibleModelOptions[0]) : "";
679
+ }, [viewModel.mode, viewModel.model.selectedId, visibleModelOptions]);
670
680
  useEffect(() => {
671
681
  const surface = surfaceRef.current;
672
682
  if (!surface) return void 0;
673
- const updateLayout = () => setIsNarrow(surface.getBoundingClientRect().width <= 704);
683
+ const updateLayout = () => setIsNarrow(surface.getBoundingClientRect().width <= narrowBreakpoint);
674
684
  updateLayout();
675
685
  window.addEventListener("resize", updateLayout);
676
686
  if (typeof ResizeObserver === "undefined") {
@@ -686,7 +696,7 @@ function AgentWorkbenchComposer({
686
696
  observer.disconnect();
687
697
  window.removeEventListener("resize", updateLayout);
688
698
  };
689
- }, []);
699
+ }, [narrowBreakpoint]);
690
700
  const submit = () => {
691
701
  if (canSubmit) onIntent?.({ type: "submit" });
692
702
  };
@@ -798,6 +808,28 @@ function AgentWorkbenchComposer({
798
808
  messages.composer.webSearch,
799
809
  /* @__PURE__ */ jsx(Switch, { checked: viewModel.webSearchEnabled, onCheckedChange: (enabled) => onIntent?.({ type: "toggle-web-search", enabled }) })
800
810
  ] }) : null,
811
+ modeSelectionEnabled ? /* @__PURE__ */ jsx(
812
+ "div",
813
+ {
814
+ className: "flex h-8 shrink-0 items-center rounded-md border border-border bg-muted p-0.5",
815
+ role: "group",
816
+ "aria-label": messages.composer.chatMode,
817
+ children: ["chatbot", "agent"].map((mode) => /* @__PURE__ */ jsx(
818
+ "button",
819
+ {
820
+ type: "button",
821
+ "aria-pressed": viewModel.mode === mode,
822
+ className: cn2(
823
+ "h-7 rounded px-2.5 text-xs font-medium transition-colors",
824
+ viewModel.mode === mode ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
825
+ ),
826
+ onClick: () => onIntent?.({ type: "change-mode", mode }),
827
+ children: messages.modes[mode]
828
+ },
829
+ mode
830
+ ))
831
+ }
832
+ ) : null,
801
833
  viewModel.capabilities.modelSelection ? /* @__PURE__ */ jsx("label", { className: "sr-only", htmlFor: "agent-workbench-model", children: messages.composer.model }) : null,
802
834
  viewModel.capabilities.modelSelection ? /* @__PURE__ */ jsxs(
803
835
  "select",
@@ -807,12 +839,12 @@ function AgentWorkbenchComposer({
807
839
  "aria-label": messages.composer.model,
808
840
  className: "h-8 w-48 min-w-36 shrink rounded-md border border-border bg-background px-2 text-xs font-medium text-foreground",
809
841
  onChange: (event) => {
810
- const option = viewModel.model.options.find((item) => modelOptionValue(item) === event.target.value);
842
+ const option = visibleModelOptions.find((item) => modelOptionValue(item) === event.target.value);
811
843
  if (option) onIntent?.({ type: "select-model", modelId: option.id, mode: option.mode });
812
844
  },
813
845
  children: [
814
- viewModel.model.options.length === 0 ? /* @__PURE__ */ jsx("option", { value: "", children: messages.composer.noModels }) : null,
815
- viewModel.model.options.map((option) => /* @__PURE__ */ jsxs("option", { value: modelOptionValue(option), disabled: option.disabled, children: [
846
+ visibleModelOptions.length === 0 ? /* @__PURE__ */ jsx("option", { value: "", children: messages.composer.noModels }) : null,
847
+ visibleModelOptions.map((option) => /* @__PURE__ */ jsxs("option", { value: modelOptionValue(option), disabled: option.disabled, children: [
816
848
  option.label,
817
849
  " \xB7 ",
818
850
  messages.modes[option.mode]
@@ -959,9 +991,17 @@ function SessionActions({
959
991
  ] })
960
992
  ] });
961
993
  }
962
- function AgentWorkbenchSidebar({ viewModel, headerActions, className, classNames, onIntent }) {
994
+ function AgentWorkbenchSidebar({
995
+ viewModel,
996
+ navigationMode = "agents-and-sessions",
997
+ headerActions,
998
+ className,
999
+ classNames,
1000
+ onIntent
1001
+ }) {
963
1002
  const { locale } = useMonkeysLocale();
964
1003
  const messages = useMonkeysLocaleMessages().agentWorkbench.navigation;
1004
+ const sessionsOnly = navigationMode === "sessions-only";
965
1005
  const searchRef = useRef(null);
966
1006
  const renameInputRef = useRef(null);
967
1007
  const [editingSessionId, setEditingSessionId] = useState();
@@ -1008,9 +1048,9 @@ function AgentWorkbenchSidebar({ viewModel, headerActions, className, classNames
1008
1048
  return /* @__PURE__ */ jsx("nav", { "aria-label": messages.tabsLabel, className: cn2("h-full min-h-0", classNames?.root, className), children: /* @__PURE__ */ jsxs(
1009
1049
  Tabs,
1010
1050
  {
1011
- value: viewModel.activeTab,
1051
+ value: sessionsOnly ? "sessions" : viewModel.activeTab,
1012
1052
  onValueChange: (value) => {
1013
- if (value === "agents" || value === "sessions") onIntent?.({ type: "change-tab", tab: value });
1053
+ if (!sessionsOnly && (value === "agents" || value === "sessions")) onIntent?.({ type: "change-tab", tab: value });
1014
1054
  },
1015
1055
  className: "flex h-full min-h-0 flex-col bg-background text-foreground",
1016
1056
  children: [
@@ -1023,8 +1063,8 @@ function AgentWorkbenchSidebar({ viewModel, headerActions, className, classNames
1023
1063
  ref: searchRef,
1024
1064
  type: "search",
1025
1065
  value: viewModel.searchQuery,
1026
- "aria-label": messages.search,
1027
- placeholder: messages.search,
1066
+ "aria-label": sessionsOnly ? messages.searchSessions : messages.search,
1067
+ placeholder: sessionsOnly ? messages.searchSessions : messages.search,
1028
1068
  className: "min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground [&::-webkit-search-cancel-button]:hidden",
1029
1069
  onChange: (event) => onIntent?.({ type: "change-search", query: event.target.value }),
1030
1070
  onKeyDown: (event) => {
@@ -1036,15 +1076,15 @@ function AgentWorkbenchSidebar({ viewModel, headerActions, className, classNames
1036
1076
  ),
1037
1077
  viewModel.searchQuery ? /* @__PURE__ */ jsx("button", { type: "button", className: "flex size-6 items-center justify-center rounded-md hover:bg-muted", "aria-label": messages.clearSearch, onClick: () => onIntent?.({ type: "change-search", query: "" }), children: /* @__PURE__ */ jsx(X, { className: "size-3.5", "aria-hidden": "true" }) }) : /* @__PURE__ */ jsx("kbd", { className: "rounded border border-border px-1.5 py-0.5 text-[10px] text-muted-foreground", children: "Ctrl K" })
1038
1078
  ] }),
1039
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1040
- /* @__PURE__ */ jsxs(TabsList, { className: cn2("grid min-w-0 flex-1 grid-cols-2 text-foreground", classNames?.tabs), "aria-label": messages.tabsLabel, children: [
1079
+ !sessionsOnly || headerActions ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
1080
+ !sessionsOnly ? /* @__PURE__ */ jsxs(TabsList, { className: cn2("grid min-w-0 flex-1 grid-cols-2 text-foreground", classNames?.tabs), "aria-label": messages.tabsLabel, children: [
1041
1081
  /* @__PURE__ */ jsx(TabsTrigger, { value: "agents", children: messages.agents }),
1042
1082
  /* @__PURE__ */ jsx(TabsTrigger, { value: "sessions", children: messages.sessions })
1043
- ] }),
1083
+ ] }) : null,
1044
1084
  headerActions ? /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center", children: headerActions }) : null
1045
- ] })
1085
+ ] }) : null
1046
1086
  ] }),
1047
- /* @__PURE__ */ jsxs(TabsContent, { value: "agents", className: cn2("mt-0 min-h-0 flex-1 overflow-y-auto px-4 pb-4", classNames?.body), children: [
1087
+ !sessionsOnly ? /* @__PURE__ */ jsxs(TabsContent, { value: "agents", className: cn2("mt-0 min-h-0 flex-1 overflow-y-auto px-4 pb-4", classNames?.body), children: [
1048
1088
  viewModel.capabilities.createAgent ? /* @__PURE__ */ jsxs("button", { type: "button", className: "mb-3 flex h-9 w-full items-center gap-2 rounded-md px-3 text-left text-sm font-medium hover:bg-muted", onClick: () => onIntent?.({ type: "create-agent" }), children: [
1049
1089
  /* @__PURE__ */ jsx(Plus, { className: "size-4", "aria-hidden": "true" }),
1050
1090
  messages.newAgent
@@ -1089,13 +1129,13 @@ function AgentWorkbenchSidebar({ viewModel, headerActions, className, classNames
1089
1129
  },
1090
1130
  item.id
1091
1131
  )) })
1092
- ] }),
1132
+ ] }) : null,
1093
1133
  /* @__PURE__ */ jsxs(TabsContent, { value: "sessions", className: cn2("mt-0 min-h-0 flex-1 overflow-y-auto px-4 pb-4", classNames?.body), children: [
1094
1134
  viewModel.capabilities.createSession ? /* @__PURE__ */ jsxs("button", { type: "button", className: "flex h-9 w-full items-center gap-2 rounded-md px-3 text-left text-sm font-medium hover:bg-muted", onClick: () => onIntent?.({ type: "create-session" }), children: [
1095
1135
  /* @__PURE__ */ jsx(SquarePen, { className: "size-4", "aria-hidden": "true" }),
1096
1136
  messages.newSession
1097
1137
  ] }) : null,
1098
- viewModel.capabilities.manageCapabilities ? /* @__PURE__ */ jsxs("button", { type: "button", className: "mb-3 flex h-9 w-full items-center gap-2 rounded-md px-3 text-left text-sm font-medium hover:bg-muted", onClick: () => onIntent?.({ type: "open-capabilities" }), children: [
1138
+ !sessionsOnly && viewModel.capabilities.manageCapabilities ? /* @__PURE__ */ jsxs("button", { type: "button", className: "mb-3 flex h-9 w-full items-center gap-2 rounded-md px-3 text-left text-sm font-medium hover:bg-muted", onClick: () => onIntent?.({ type: "open-capabilities" }), children: [
1099
1139
  /* @__PURE__ */ jsx(Blocks, { className: "size-4", "aria-hidden": "true" }),
1100
1140
  messages.capabilities
1101
1141
  ] }) : null,
@@ -1152,7 +1192,7 @@ function AgentWorkbenchSidebar({ viewModel, headerActions, className, classNames
1152
1192
  ] }, item.id);
1153
1193
  }) })
1154
1194
  ] }),
1155
- viewModel.capabilities.manageAgentSettings ? /* @__PURE__ */ jsx("div", { className: cn2("shrink-0 border-t border-border p-4", classNames?.footer), children: /* @__PURE__ */ jsxs("button", { type: "button", className: "flex h-10 w-full items-center gap-2 rounded-md px-3 text-left text-sm font-medium hover:bg-muted", onClick: () => onIntent?.({ type: "open-agent-settings" }), children: [
1195
+ !sessionsOnly && viewModel.capabilities.manageAgentSettings ? /* @__PURE__ */ jsx("div", { className: cn2("shrink-0 border-t border-border p-4", classNames?.footer), children: /* @__PURE__ */ jsxs("button", { type: "button", className: "flex h-10 w-full items-center gap-2 rounded-md px-3 text-left text-sm font-medium hover:bg-muted", onClick: () => onIntent?.({ type: "open-agent-settings" }), children: [
1156
1196
  /* @__PURE__ */ jsx(Settings, { className: "size-4", "aria-hidden": "true" }),
1157
1197
  messages.settings
1158
1198
  ] }) }) : null