@axiom-lattice/react-sdk 2.1.74 → 2.1.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -41,6 +41,7 @@ __export(index_exports, {
41
41
  AxiomLatticeProvider: () => AxiomLatticeProvider,
42
42
  ChangePasswordModal: () => ChangePasswordModal,
43
43
  ChannelInstallationsDrawerContent: () => ChannelInstallationsDrawerContent,
44
+ ChatSidebar: () => ChatSidebar,
44
45
  ChatUIContext: () => ChatUIContext,
45
46
  ChatUIContextProvider: () => ChatUIContextProvider,
46
47
  Chating: () => Chating,
@@ -48,7 +49,9 @@ __export(index_exports, {
48
49
  ConversationContext: () => ConversationContext,
49
50
  ConversationContextProvider: () => ConversationContextProvider,
50
51
  CreateAssistantModal: () => CreateAssistantModal_default,
52
+ DEFAULT_MENU_ITEMS: () => DEFAULT_MENU_ITEMS,
51
53
  DEFAULT_MIDDLEWARE_TYPES: () => DEFAULT_MIDDLEWARE_TYPES,
54
+ DEFAULT_WORKSPACE_MENU_ITEMS: () => DEFAULT_WORKSPACE_MENU_ITEMS,
52
55
  EvalPanel: () => EvalPanel,
53
56
  EvalRunResults: () => EvalRunResults,
54
57
  EvalSuiteCardList: () => EvalSuiteCardList,
@@ -1440,6 +1443,7 @@ var DEFAULT_CONFIG = {
1440
1443
  enableModelSelector: false,
1441
1444
  sidebarMode: "icon",
1442
1445
  sidebarDefaultExpanded: true,
1446
+ workspaceMenuDefaultExpanded: true,
1443
1447
  sidebarShowToggle: true,
1444
1448
  sidebarShowNewAnalysis: true,
1445
1449
  sidebarLogoText: "Lattice"
@@ -20725,6 +20729,110 @@ var EvalPanel = () => {
20725
20729
 
20726
20730
  // src/components/Chat/WorkspaceResourceManager.tsx
20727
20731
  var import_jsx_runtime82 = require("react/jsx-runtime");
20732
+ var DEFAULT_WORKSPACE_MENU_ITEMS = [
20733
+ {
20734
+ id: "workspace_projects",
20735
+ type: "route",
20736
+ name: "Projects",
20737
+ icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react14.FolderOpen, { size: 20 }),
20738
+ order: 0
20739
+ },
20740
+ {
20741
+ id: "metrics",
20742
+ builtin: "metrics",
20743
+ type: "route",
20744
+ name: "Metrics",
20745
+ icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react14.Activity, { size: 20 }),
20746
+ order: 10,
20747
+ group: "DataSource"
20748
+ },
20749
+ {
20750
+ id: "database",
20751
+ builtin: "database",
20752
+ type: "route",
20753
+ name: "Database",
20754
+ icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react14.Database, { size: 20 }),
20755
+ order: 20,
20756
+ group: "DataSource"
20757
+ },
20758
+ {
20759
+ id: "topology-automations",
20760
+ type: "route",
20761
+ name: "Automations",
20762
+ icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react14.Share2, { size: 20 }),
20763
+ order: 25,
20764
+ group: "Process"
20765
+ },
20766
+ {
20767
+ id: "topology-runtimes",
20768
+ type: "route",
20769
+ name: "Runtime",
20770
+ icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react14.History, { size: 20 }),
20771
+ order: 26,
20772
+ group: "Process"
20773
+ },
20774
+ {
20775
+ id: "topology-inbox",
20776
+ type: "route",
20777
+ name: "Inbox",
20778
+ icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react14.Inbox, { size: 20 }),
20779
+ order: 27,
20780
+ group: "Process"
20781
+ },
20782
+ {
20783
+ id: "eval",
20784
+ type: "route",
20785
+ name: "Eval",
20786
+ icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react14.FlaskConical, { size: 20 }),
20787
+ order: 28,
20788
+ group: "Process"
20789
+ },
20790
+ {
20791
+ id: "assistants",
20792
+ builtin: "assistants",
20793
+ type: "route",
20794
+ name: "Assistants",
20795
+ icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react14.Bot, { size: 20 }),
20796
+ order: 30,
20797
+ group: "Settings"
20798
+ },
20799
+ {
20800
+ id: "skills",
20801
+ builtin: "skills",
20802
+ type: "route",
20803
+ name: "Skills",
20804
+ icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react14.Zap, { size: 20 }),
20805
+ order: 35,
20806
+ group: "Settings"
20807
+ },
20808
+ {
20809
+ id: "mcp",
20810
+ builtin: "mcp",
20811
+ type: "route",
20812
+ name: "MCP",
20813
+ icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react14.Plug, { size: 20 }),
20814
+ order: 40,
20815
+ group: "Settings"
20816
+ },
20817
+ {
20818
+ id: "tools",
20819
+ builtin: "tools",
20820
+ type: "route",
20821
+ name: "Tools",
20822
+ icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react14.Wrench, { size: 20 }),
20823
+ order: 50,
20824
+ group: "Settings"
20825
+ },
20826
+ {
20827
+ id: "switch_tenant",
20828
+ builtin: "switch-tenant",
20829
+ type: "action",
20830
+ name: "Switch tenant",
20831
+ icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react14.Building2, { size: 20 }),
20832
+ order: 900,
20833
+ group: "Account"
20834
+ }
20835
+ ];
20728
20836
  var createWrapper = (Component) => {
20729
20837
  return () => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Component, { ...{} });
20730
20838
  };
@@ -20794,120 +20902,13 @@ var WorkspaceResourceManager = ({
20794
20902
  }, []);
20795
20903
  const { user, logout, tenants, currentTenant, selectTenant, isLoading } = useAuth();
20796
20904
  const { setWorkspace, setProject } = useWorkspaceContext();
20905
+ const { config } = useLatticeChatShellContext();
20797
20906
  const [tenantModalOpen, setTenantModalOpen] = (0, import_react71.useState)(false);
20798
20907
  const [changePasswordOpen, setChangePasswordOpen] = (0, import_react71.useState)(false);
20799
20908
  const menuItems = (0, import_react71.useMemo)(() => {
20800
- return [
20801
- // Projects - opens in SideApp via route type
20802
- // ProjectCardList fetches its own data
20803
- {
20804
- id: "workspace_projects",
20805
- type: "route",
20806
- name: "Projects",
20807
- icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react14.FolderOpen, { size: 20 }),
20808
- order: 0
20809
- },
20810
- // DataSource Group
20811
- {
20812
- id: "metrics",
20813
- builtin: "metrics",
20814
- type: "route",
20815
- name: "Metrics",
20816
- icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react14.Activity, { size: 20 }),
20817
- order: 10,
20818
- group: "DataSource"
20819
- },
20820
- {
20821
- id: "database",
20822
- builtin: "database",
20823
- type: "route",
20824
- name: "Database",
20825
- icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react14.Database, { size: 20 }),
20826
- order: 20,
20827
- group: "DataSource"
20828
- },
20829
- // Process Group
20830
- {
20831
- id: "topology-automations",
20832
- type: "route",
20833
- name: "Automations",
20834
- icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react14.Share2, { size: 20 }),
20835
- order: 25,
20836
- group: "Process"
20837
- },
20838
- {
20839
- id: "topology-runtimes",
20840
- type: "route",
20841
- name: "Runtime",
20842
- icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react14.History, { size: 20 }),
20843
- order: 26,
20844
- group: "Process"
20845
- },
20846
- {
20847
- id: "topology-inbox",
20848
- type: "route",
20849
- name: "Inbox",
20850
- icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react14.Inbox, { size: 20 }),
20851
- order: 27,
20852
- group: "Process"
20853
- },
20854
- {
20855
- id: "eval",
20856
- type: "route",
20857
- name: "Eval",
20858
- icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react14.FlaskConical, { size: 20 }),
20859
- order: 28,
20860
- group: "Process"
20861
- },
20862
- // Settings Group
20863
- {
20864
- id: "assistants",
20865
- builtin: "assistants",
20866
- type: "route",
20867
- name: "Assistants",
20868
- icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react14.Bot, { size: 20 }),
20869
- order: 30,
20870
- group: "Settings"
20871
- },
20872
- {
20873
- id: "skills",
20874
- builtin: "skills",
20875
- type: "route",
20876
- name: "Skills",
20877
- icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react14.Zap, { size: 20 }),
20878
- order: 35,
20879
- group: "Settings"
20880
- },
20881
- {
20882
- id: "mcp",
20883
- builtin: "mcp",
20884
- type: "route",
20885
- name: "MCP",
20886
- icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react14.Plug, { size: 20 }),
20887
- order: 40,
20888
- group: "Settings"
20889
- },
20890
- {
20891
- id: "tools",
20892
- builtin: "tools",
20893
- type: "route",
20894
- name: "Tools",
20895
- icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react14.Wrench, { size: 20 }),
20896
- order: 50,
20897
- group: "Settings"
20898
- },
20899
- // Switch Tenant action
20900
- {
20901
- id: "switch_tenant",
20902
- builtin: "switch-tenant",
20903
- type: "action",
20904
- name: "Switch tenant",
20905
- icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react14.Building2, { size: 20 }),
20906
- order: 900,
20907
- group: "Account"
20908
- }
20909
- ];
20910
- }, [workspaceName]);
20909
+ const items = config.workspaceMenuItems?.length ? [...config.workspaceMenuItems] : [...DEFAULT_WORKSPACE_MENU_ITEMS];
20910
+ return items.sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
20911
+ }, [config.workspaceMenuItems]);
20911
20912
  const handleItemClick = (item) => {
20912
20913
  if (item.type === "action" && item.builtin === "switch-tenant") {
20913
20914
  setTenantModalOpen(true);
@@ -20927,26 +20928,23 @@ var WorkspaceResourceManager = ({
20927
20928
  "topology-inbox": "workspace_topology_inbox",
20928
20929
  eval: "workspace_eval"
20929
20930
  };
20930
- const componentKey = componentKeyMap[item.id];
20931
- if (componentKey) {
20932
- openContentApp({
20933
- component_key: componentKey,
20934
- data: {},
20935
- message: item.name
20936
- });
20937
- }
20931
+ const componentKey = componentKeyMap[item.id] ?? item.id;
20932
+ openContentApp({
20933
+ component_key: componentKey,
20934
+ data: {},
20935
+ message: item.name
20936
+ });
20938
20937
  }
20939
20938
  };
20940
20939
  (0, import_react71.useEffect)(() => {
20941
- if (!hasOpenedDefault.current) {
20940
+ if (!hasOpenedDefault.current && menuItems.length > 0) {
20942
20941
  hasOpenedDefault.current = true;
20943
- openContentApp({
20944
- component_key: "workspace_projects",
20945
- data: {},
20946
- message: "Projects"
20947
- });
20942
+ const firstRoute = menuItems.find((item) => item.type === "route");
20943
+ if (firstRoute) {
20944
+ handleItemClick(firstRoute);
20945
+ }
20948
20946
  }
20949
- }, [openContentApp]);
20947
+ }, []);
20950
20948
  const userMenuItems = /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { style: { minWidth: 160 }, children: [
20951
20949
  /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { style: { padding: "8px 12px", borderBottom: "1px solid #f0f0f0" }, children: [
20952
20950
  /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { style: { fontWeight: 500 }, children: user?.name || user?.email }),
@@ -21001,7 +20999,7 @@ var WorkspaceResourceManager = ({
21001
20999
  logo,
21002
21000
  logoText: workspaceName || "Workspace",
21003
21001
  showToggle: true,
21004
- defaultExpanded: true,
21002
+ defaultExpanded: config.workspaceMenuDefaultExpanded ?? true,
21005
21003
  collapsed: menuCollapsed,
21006
21004
  onCollapsedChange: setMenuCollapsed,
21007
21005
  footer: ({ isIconMode }) => user && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
@@ -30896,7 +30894,6 @@ var DRAWER_STYLES2 = {
30896
30894
  }
30897
30895
  };
30898
30896
  var DEFAULT_MENU_ITEMS = [
30899
- // First: New Analysis (action)
30900
30897
  {
30901
30898
  id: "new-analysis",
30902
30899
  builtin: "new-analysis",
@@ -30905,7 +30902,6 @@ var DEFAULT_MENU_ITEMS = [
30905
30902
  icon: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_lucide_react33.PlusCircle, { size: 20 }),
30906
30903
  order: 0
30907
30904
  },
30908
- // Second: Thread History (inline drawer)
30909
30905
  {
30910
30906
  id: "thread-history",
30911
30907
  builtin: "thread-history",
@@ -30919,7 +30915,6 @@ var DEFAULT_MENU_ITEMS = [
30919
30915
  inlineDefaultExpanded: true,
30920
30916
  content: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(ThreadHistoryMenuContent, {})
30921
30917
  }
30922
- // Project Files removed - now accessed via header toggle
30923
30918
  ];
30924
30919
  var ChatSidebar = ({
30925
30920
  onSettingsClick,
@@ -30941,10 +30936,7 @@ var ChatSidebar = ({
30941
30936
  } = config;
30942
30937
  const isExpandedMode = sidebarMode === "expanded";
30943
30938
  const menuItems = (0, import_react101.useMemo)(() => {
30944
- const items = [...DEFAULT_MENU_ITEMS];
30945
- for (const item of customMenuItems) {
30946
- items.push(item);
30947
- }
30939
+ const items = customMenuItems.length > 0 ? [...customMenuItems] : [...DEFAULT_MENU_ITEMS];
30948
30940
  return items.sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
30949
30941
  }, [customMenuItems]);
30950
30942
  const handleMenuClick = (0, import_react101.useCallback)(async (item) => {
@@ -32580,11 +32572,6 @@ var import_antd97 = require("antd");
32580
32572
  var import_lucide_react34 = require("lucide-react");
32581
32573
  var import_jsx_runtime126 = require("react/jsx-runtime");
32582
32574
  var { Text: Text47, Title: Title17 } = import_antd97.Typography;
32583
- var MAPPING_MODE_OPTIONS = [
32584
- { label: "User", value: "user" },
32585
- { label: "Group", value: "group" },
32586
- { label: "Hybrid", value: "hybrid" }
32587
- ];
32588
32575
  var ChannelInstallationsDrawerContent = () => {
32589
32576
  const { get, post, put, del } = useApi();
32590
32577
  const [installations, setInstallations] = (0, import_react104.useState)([]);
@@ -32706,22 +32693,6 @@ var ChannelInstallationsDrawerContent = () => {
32706
32693
  "ID: ",
32707
32694
  installation.id
32708
32695
  ] }),
32709
- /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(Text47, { style: { fontSize: 13 }, children: [
32710
- "Assistant ID: ",
32711
- installation.config.assistantId
32712
- ] }),
32713
- /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(Text47, { style: { fontSize: 13 }, children: [
32714
- "Mapping Mode: ",
32715
- installation.config.mappingMode
32716
- ] }),
32717
- installation.config.workspaceId ? /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(Text47, { style: { fontSize: 13 }, children: [
32718
- "Workspace ID: ",
32719
- installation.config.workspaceId
32720
- ] }) : null,
32721
- installation.config.projectId ? /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(Text47, { style: { fontSize: 13 }, children: [
32722
- "Project ID: ",
32723
- installation.config.projectId
32724
- ] }) : null,
32725
32696
  webhookPath ? /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Text47, { code: true, style: { fontSize: 12 }, children: webhookPath }) : /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Text47, { type: "secondary", style: { fontSize: 12 }, children: "Unsupported channel configuration UI" })
32726
32697
  ]
32727
32698
  }
@@ -32777,23 +32748,17 @@ var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCance
32777
32748
  const [form] = import_antd97.Form.useForm();
32778
32749
  (0, import_react104.useEffect)(() => {
32779
32750
  if (installation) {
32751
+ const config = installation.config;
32780
32752
  form.setFieldsValue({
32781
32753
  name: installation.name,
32782
- appId: installation.config.appId,
32783
- appSecret: installation.config.appSecret,
32784
- verificationToken: installation.config.verificationToken,
32785
- encryptKey: installation.config.encryptKey,
32786
- mappingMode: installation.config.mappingMode,
32787
- assistantId: installation.config.assistantId,
32788
- workspaceId: installation.config.workspaceId,
32789
- projectId: installation.config.projectId
32754
+ appId: config.appId,
32755
+ appSecret: config.appSecret,
32756
+ verificationToken: config.verificationToken,
32757
+ encryptKey: config.encryptKey
32790
32758
  });
32791
32759
  return;
32792
32760
  }
32793
32761
  form.resetFields();
32794
- form.setFieldsValue({
32795
- mappingMode: "hybrid"
32796
- });
32797
32762
  }, [installation, form]);
32798
32763
  const handleSubmit = async () => {
32799
32764
  const values = await form.validateFields();
@@ -32801,11 +32766,7 @@ var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCance
32801
32766
  appId: values.appId,
32802
32767
  appSecret: values.appSecret,
32803
32768
  verificationToken: values.verificationToken,
32804
- encryptKey: values.encryptKey,
32805
- mappingMode: values.mappingMode,
32806
- assistantId: values.assistantId,
32807
- workspaceId: values.workspaceId,
32808
- projectId: values.projectId
32769
+ encryptKey: values.encryptKey
32809
32770
  };
32810
32771
  try {
32811
32772
  if (installation) {
@@ -32878,27 +32839,7 @@ var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCance
32878
32839
  }
32879
32840
  ),
32880
32841
  /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_antd97.Form.Item, { name: "verificationToken", label: "Verification Token", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_antd97.Input, {}) }),
32881
- /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_antd97.Form.Item, { name: "encryptKey", label: "Encrypt Key", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_antd97.Input, {}) }),
32882
- /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
32883
- import_antd97.Form.Item,
32884
- {
32885
- name: "mappingMode",
32886
- label: "Mapping Mode",
32887
- rules: [{ required: true, message: "Mapping Mode is required" }],
32888
- children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_antd97.Select, { options: MAPPING_MODE_OPTIONS })
32889
- }
32890
- ),
32891
- /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
32892
- import_antd97.Form.Item,
32893
- {
32894
- name: "assistantId",
32895
- label: "Assistant ID",
32896
- rules: [{ required: true, message: "Assistant ID is required" }],
32897
- children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_antd97.Input, {})
32898
- }
32899
- ),
32900
- /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_antd97.Form.Item, { name: "workspaceId", label: "Workspace ID", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_antd97.Input, {}) }),
32901
- /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_antd97.Form.Item, { name: "projectId", label: "Project ID", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_antd97.Input, {}) })
32842
+ /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_antd97.Form.Item, { name: "encryptKey", label: "Encrypt Key", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_antd97.Input, {}) })
32902
32843
  ] })
32903
32844
  }
32904
32845
  );
@@ -32915,6 +32856,7 @@ var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCance
32915
32856
  AxiomLatticeProvider,
32916
32857
  ChangePasswordModal,
32917
32858
  ChannelInstallationsDrawerContent,
32859
+ ChatSidebar,
32918
32860
  ChatUIContext,
32919
32861
  ChatUIContextProvider,
32920
32862
  Chating,
@@ -32922,7 +32864,9 @@ var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCance
32922
32864
  ConversationContext,
32923
32865
  ConversationContextProvider,
32924
32866
  CreateAssistantModal,
32867
+ DEFAULT_MENU_ITEMS,
32925
32868
  DEFAULT_MIDDLEWARE_TYPES,
32869
+ DEFAULT_WORKSPACE_MENU_ITEMS,
32926
32870
  EvalPanel,
32927
32871
  EvalRunResults,
32928
32872
  EvalSuiteCardList,