@inf-monkeys-tech/monkeys-design 1.0.33 → 1.0.34

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 (58) hide show
  1. package/dist/components/agent-workbench/index.d.mts +50 -1
  2. package/dist/components/agent-workbench/index.d.ts +50 -1
  3. package/dist/components/agent-workbench/index.js +142 -1
  4. package/dist/components/agent-workbench/index.js.map +1 -1
  5. package/dist/components/agent-workbench/index.mjs +143 -3
  6. package/dist/components/agent-workbench/index.mjs.map +1 -1
  7. package/dist/components/base/index.js +5 -0
  8. package/dist/components/base/index.js.map +1 -1
  9. package/dist/components/base/index.mjs +5 -0
  10. package/dist/components/base/index.mjs.map +1 -1
  11. package/dist/components/data-explorer/index.js +5 -0
  12. package/dist/components/data-explorer/index.js.map +1 -1
  13. package/dist/components/data-explorer/index.mjs +5 -0
  14. package/dist/components/data-explorer/index.mjs.map +1 -1
  15. package/dist/components/layout/index.js +5 -0
  16. package/dist/components/layout/index.js.map +1 -1
  17. package/dist/components/layout/index.mjs +5 -0
  18. package/dist/components/layout/index.mjs.map +1 -1
  19. package/dist/components/runtime/index.js +5 -0
  20. package/dist/components/runtime/index.js.map +1 -1
  21. package/dist/components/runtime/index.mjs +5 -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 +5 -0
  26. package/dist/components/toast/index.js.map +1 -1
  27. package/dist/components/toast/index.mjs +5 -0
  28. package/dist/components/toast/index.mjs.map +1 -1
  29. package/dist/components/toolbar/index.js +5 -0
  30. package/dist/components/toolbar/index.js.map +1 -1
  31. package/dist/components/toolbar/index.mjs +5 -0
  32. package/dist/components/toolbar/index.mjs.map +1 -1
  33. package/dist/components/workbench/index.js +5 -0
  34. package/dist/components/workbench/index.js.map +1 -1
  35. package/dist/components/workbench/index.mjs +5 -0
  36. package/dist/components/workbench/index.mjs.map +1 -1
  37. package/dist/index.d.mts +1 -1
  38. package/dist/index.d.ts +1 -1
  39. package/dist/index.js +15 -1
  40. package/dist/index.js.map +1 -1
  41. package/dist/index.mjs +16 -2
  42. package/dist/index.mjs.map +1 -1
  43. package/dist/locale/index.d.mts +12 -2
  44. package/dist/locale/index.d.ts +12 -2
  45. package/dist/locale/index.js +14 -0
  46. package/dist/locale/index.js.map +1 -1
  47. package/dist/locale/index.mjs +14 -0
  48. package/dist/locale/index.mjs.map +1 -1
  49. package/dist/provider/index.d.mts +2 -2
  50. package/dist/provider/index.d.ts +2 -2
  51. package/dist/provider/index.js +14 -0
  52. package/dist/provider/index.js.map +1 -1
  53. package/dist/provider/index.mjs +14 -0
  54. package/dist/provider/index.mjs.map +1 -1
  55. package/dist/styles.css +1 -1
  56. package/dist/{types-055c43c39002.d.mts → types-b8d18b1454c2.d.mts} +6 -0
  57. package/dist/{types-055c43c39002.d.ts → types-b8d18b1454c2.d.ts} +6 -0
  58. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { ChevronDown, Check, ChevronRight, Circle, ChevronUp, ArrowUp, ArrowDown, Pencil, Trash2, Image, File, X, Paperclip, Mic, Send, Square, Search, Plus, Pin, SquarePen, Blocks, Bot, Settings, TerminalSquare, Clock3, FileOutput, Download, Loader2, CircleAlert, ListFilter, Link2, ExternalLink, PanelRightClose, FileText, Wrench, BookOpen, RefreshCw, CheckCircle2, XCircle, CircleStop, AlertCircle, GitFork, PencilLine, Copy, RotateCcw, FileCode2, Files, TestTube2, Globe2, Film, Presentation, FileImage, Music2, Ellipsis } from 'lucide-react';
1
+ import { ChevronDown, Check, ChevronRight, Circle, ChevronUp, ArrowUp, ArrowDown, Pencil, Trash2, Image, File, X, Paperclip, Mic, Send, Square, ShoppingBag, Code2, FileText, Search, Palette, Sparkles, ArrowLeft, Upload, Plus, Pin, SquarePen, Blocks, MessageSquare, Bot, Settings, TerminalSquare, Clock3, FileOutput, Download, Loader2, CircleAlert, ListFilter, Link2, ExternalLink, PanelRightClose, Wrench, BookOpen, RefreshCw, CheckCircle2, XCircle, CircleStop, AlertCircle, GitFork, PencilLine, Copy, RotateCcw, FileCode2, Files, TestTube2, Globe2, Film, Presentation, FileImage, Music2, Ellipsis } from 'lucide-react';
2
2
  import * as React2 from 'react';
3
3
  import { createContext, useRef, useState, useMemo, useEffect, useContext } from 'react';
4
4
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
@@ -145,6 +145,11 @@ var enUS = {
145
145
  reasoningOptions: { low: "Low", medium: "Medium", high: "High", xhigh: "Extra high" },
146
146
  permissionOptions: { "approval-required": "Approval required", "auto-approve": "Auto approve", "full-access": "Full access" }
147
147
  },
148
+ quickStart: {
149
+ label: "Quick start",
150
+ back: "Back",
151
+ addFile: "Add file"
152
+ },
148
153
  tool: {
149
154
  input: "Input",
150
155
  output: "Output",
@@ -930,6 +935,141 @@ function AgentWorkbenchComposer({
930
935
  }
931
936
  );
932
937
  }
938
+ var ICONS = {
939
+ sparkles: Sparkles,
940
+ palette: Palette,
941
+ search: Search,
942
+ "file-text": FileText,
943
+ code: Code2,
944
+ "shopping-bag": ShoppingBag
945
+ };
946
+ function TemplateVisual({ template }) {
947
+ const Icon2 = ICONS[template.icon || "sparkles"];
948
+ if (template.coverImageUrl) {
949
+ return /* @__PURE__ */ jsx("img", { src: template.coverImageUrl, alt: "", className: "size-full object-cover transition-transform duration-200 group-hover:scale-105" });
950
+ }
951
+ return /* @__PURE__ */ jsx("span", { className: "flex size-full items-center justify-center bg-gradient-to-br from-primary/5 via-muted/50 to-primary/15", children: /* @__PURE__ */ jsx("span", { className: "flex size-14 items-center justify-center rounded-2xl border border-primary/10 bg-background/85 text-primary shadow-sm", children: /* @__PURE__ */ jsx(Icon2, { className: "size-7", "aria-hidden": "true" }) }) });
952
+ }
953
+ function AgentWorkbenchQuickStart({ viewModel, className, onIntent }) {
954
+ const messages = useMonkeysLocaleMessages().agentWorkbench.quickStart;
955
+ const fileInputRef = useRef(null);
956
+ const [activeCategoryId, setActiveCategoryId] = useState();
957
+ const [activeSectionId, setActiveSectionId] = useState();
958
+ const [pendingTemplate, setPendingTemplate] = useState();
959
+ const categories = useMemo(
960
+ () => viewModel.categories.map((category) => ({
961
+ ...category,
962
+ sections: category.sections.map((section) => ({
963
+ ...section,
964
+ templates: section.templates.filter((template) => !template.modes || template.modes.includes(viewModel.mode))
965
+ })).filter((section) => section.templates.length > 0)
966
+ })).filter((category) => category.sections.length > 0),
967
+ [viewModel.categories, viewModel.mode]
968
+ );
969
+ const activeCategory = categories.find((category) => category.id === activeCategoryId);
970
+ const activeSection = activeCategory?.sections.find((section) => section.id === activeSectionId) || activeCategory?.sections[0];
971
+ useEffect(() => {
972
+ if (activeCategoryId && !categories.some((category) => category.id === activeCategoryId)) {
973
+ setActiveCategoryId(void 0);
974
+ setActiveSectionId(void 0);
975
+ }
976
+ }, [activeCategoryId, categories]);
977
+ if (categories.length === 0) return null;
978
+ const selectCategory = (category) => {
979
+ setActiveCategoryId(category.id);
980
+ setActiveSectionId(category.sections[0]?.id);
981
+ onIntent?.({ type: "change-category", categoryId: category.id });
982
+ };
983
+ const selectSection = (sectionId) => {
984
+ if (!activeCategory) return;
985
+ setActiveSectionId(sectionId);
986
+ onIntent?.({
987
+ type: "change-section",
988
+ categoryId: activeCategory.id,
989
+ sectionId
990
+ });
991
+ };
992
+ const selectTemplate = (template) => {
993
+ if (viewModel.disabled) return;
994
+ if (template.action !== "upload") {
995
+ onIntent?.({
996
+ type: "select-template",
997
+ templateId: template.id,
998
+ prompt: template.prompt
999
+ });
1000
+ return;
1001
+ }
1002
+ const input = fileInputRef.current;
1003
+ if (!input) return;
1004
+ input.accept = template.accept || "*/*";
1005
+ input.multiple = template.multiple === true;
1006
+ setPendingTemplate(template);
1007
+ input.click();
1008
+ };
1009
+ return /* @__PURE__ */ jsxs("section", { className: cn2("agent-workbench-quick-start min-w-0 max-w-full", className), "aria-label": messages.label, children: [
1010
+ /* @__PURE__ */ jsx(
1011
+ "input",
1012
+ {
1013
+ ref: fileInputRef,
1014
+ type: "file",
1015
+ className: "hidden",
1016
+ onChange: (event) => {
1017
+ const files = Array.from(event.target.files || []);
1018
+ if (pendingTemplate && files.length > 0) {
1019
+ onIntent?.({
1020
+ type: "select-template",
1021
+ templateId: pendingTemplate.id,
1022
+ prompt: pendingTemplate.prompt,
1023
+ files: pendingTemplate.multiple ? files : files.slice(0, 1)
1024
+ });
1025
+ }
1026
+ setPendingTemplate(void 0);
1027
+ event.target.value = "";
1028
+ }
1029
+ }
1030
+ ),
1031
+ !activeCategory ? /* @__PURE__ */ jsx("div", { className: "flex max-w-full items-center justify-center gap-2 overflow-x-auto px-1 pb-1", children: categories.map((category) => {
1032
+ const Icon2 = ICONS[category.icon || "sparkles"];
1033
+ return /* @__PURE__ */ jsxs("button", { type: "button", className: "inline-flex h-10 shrink-0 items-center gap-2 rounded-full border border-border bg-background px-4 text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", onClick: () => selectCategory(category), children: [
1034
+ /* @__PURE__ */ jsx(Icon2, { className: "size-4 text-muted-foreground", "aria-hidden": "true" }),
1035
+ category.label
1036
+ ] }, category.id);
1037
+ }) }) : /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
1038
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 max-w-full items-center gap-1 overflow-x-auto pb-1", children: [
1039
+ /* @__PURE__ */ jsxs(
1040
+ "button",
1041
+ {
1042
+ type: "button",
1043
+ className: "inline-flex h-9 shrink-0 items-center gap-1.5 rounded-full px-3 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1044
+ onClick: () => {
1045
+ setActiveCategoryId(void 0);
1046
+ setActiveSectionId(void 0);
1047
+ onIntent?.({ type: "change-category" });
1048
+ },
1049
+ children: [
1050
+ /* @__PURE__ */ jsx(ArrowLeft, { className: "size-4", "aria-hidden": "true" }),
1051
+ messages.back
1052
+ ]
1053
+ }
1054
+ ),
1055
+ activeCategory.sections.map((section) => /* @__PURE__ */ jsx("button", { type: "button", "aria-pressed": activeSection?.id === section.id, className: cn2("h-9 shrink-0 rounded-full px-4 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", activeSection?.id === section.id ? "bg-muted text-foreground" : "text-muted-foreground hover:bg-muted/70 hover:text-foreground"), onClick: () => selectSection(section.id), children: section.label }, section.id))
1056
+ ] }),
1057
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-[repeat(auto-fit,minmax(min(100%,14rem),1fr))] gap-3", children: activeSection?.templates.map((template) => /* @__PURE__ */ jsxs("button", { type: "button", disabled: viewModel.disabled, "data-quick-start-template-id": template.id, className: "group min-w-0 overflow-hidden rounded-xl border border-border bg-background text-left transition-colors hover:border-primary/30 hover:bg-muted/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", onClick: () => selectTemplate(template), children: [
1058
+ /* @__PURE__ */ jsxs("span", { className: "block px-4 pb-3 pt-4", children: [
1059
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 text-sm font-semibold text-foreground", children: [
1060
+ template.title,
1061
+ template.action === "upload" ? /* @__PURE__ */ jsxs("span", { className: "ml-auto inline-flex items-center gap-1 text-[11px] font-medium text-muted-foreground", children: [
1062
+ /* @__PURE__ */ jsx(Upload, { className: "size-3", "aria-hidden": "true" }),
1063
+ messages.addFile
1064
+ ] }) : null
1065
+ ] }),
1066
+ template.description ? /* @__PURE__ */ jsx("span", { className: "mt-1 line-clamp-2 block min-h-8 text-xs leading-4 text-muted-foreground", children: template.description }) : null
1067
+ ] }),
1068
+ /* @__PURE__ */ jsx("span", { className: "block h-28 overflow-hidden", children: /* @__PURE__ */ jsx(TemplateVisual, { template }) })
1069
+ ] }, template.id)) })
1070
+ ] })
1071
+ ] });
1072
+ }
933
1073
  function ItemAvatar({ item }) {
934
1074
  const [failed, setFailed] = useState(false);
935
1075
  if (item.iconUrl && !failed) {
@@ -1225,7 +1365,7 @@ function AgentWorkbenchSidebar({
1225
1365
  !sessionsOnly ? /* @__PURE__ */ jsx("h3", { className: "mb-2 px-3 text-xs font-medium text-muted-foreground", children: messages.recentSessions }) : null,
1226
1366
  /* @__PURE__ */ jsx(CollectionState, { status: viewModel.sessions.status, empty: messages.emptySessions, noResults: messages.noResults, hasItems: sessions.length > 0, query, error: viewModel.sessions.error, onRetry: () => onIntent?.({ type: "retry-sessions" }) }),
1227
1367
  sessionsOnly && sessions.length > 0 ? /* @__PURE__ */ jsx("div", { className: "space-y-2", children: [
1228
- { id: "chatbot", label: messages.chats, icon: SquarePen, items: chatbotSessions },
1368
+ { id: "chatbot", label: messages.chats, icon: MessageSquare, items: chatbotSessions },
1229
1369
  { id: "agent", label: messages.agents, icon: Bot, items: agentSessions }
1230
1370
  ].map(({ id, label, icon: Icon2, items }) => /* @__PURE__ */ jsxs("details", { open: true, "aria-label": label, children: [
1231
1371
  /* @__PURE__ */ jsxs("summary", { className: "flex h-9 cursor-pointer list-none items-center gap-2 rounded-md px-3 text-sm font-semibold hover:bg-muted", children: [
@@ -2889,6 +3029,6 @@ function AgentWorkbenchArtifactWorkspace({
2889
3029
  );
2890
3030
  }
2891
3031
 
2892
- export { AgentWorkbenchAction, AgentWorkbenchActivity, AgentWorkbenchArtifactSummary, AgentWorkbenchArtifactWorkspace, AgentWorkbenchComposer, AgentWorkbenchProcess, AgentWorkbenchSidebar, AgentWorkbenchTaskDetails, AgentWorkbenchThread, AgentWorkbenchTool, createAgentWorkbenchActivityModel, createAgentWorkbenchDetailsModel };
3032
+ export { AgentWorkbenchAction, AgentWorkbenchActivity, AgentWorkbenchArtifactSummary, AgentWorkbenchArtifactWorkspace, AgentWorkbenchComposer, AgentWorkbenchProcess, AgentWorkbenchQuickStart, AgentWorkbenchSidebar, AgentWorkbenchTaskDetails, AgentWorkbenchThread, AgentWorkbenchTool, createAgentWorkbenchActivityModel, createAgentWorkbenchDetailsModel };
2893
3033
  //# sourceMappingURL=index.mjs.map
2894
3034
  //# sourceMappingURL=index.mjs.map