@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.mjs CHANGED
@@ -1359,6 +1359,7 @@ var DEFAULT_CONFIG = {
1359
1359
  enableModelSelector: false,
1360
1360
  sidebarMode: "icon",
1361
1361
  sidebarDefaultExpanded: true,
1362
+ workspaceMenuDefaultExpanded: true,
1362
1363
  sidebarShowToggle: true,
1363
1364
  sidebarShowNewAnalysis: true,
1364
1365
  sidebarLogoText: "Lattice"
@@ -20887,6 +20888,110 @@ var EvalPanel = () => {
20887
20888
 
20888
20889
  // src/components/Chat/WorkspaceResourceManager.tsx
20889
20890
  import { jsx as jsx82, jsxs as jsxs56 } from "react/jsx-runtime";
20891
+ var DEFAULT_WORKSPACE_MENU_ITEMS = [
20892
+ {
20893
+ id: "workspace_projects",
20894
+ type: "route",
20895
+ name: "Projects",
20896
+ icon: /* @__PURE__ */ jsx82(FolderOpen2, { size: 20 }),
20897
+ order: 0
20898
+ },
20899
+ {
20900
+ id: "metrics",
20901
+ builtin: "metrics",
20902
+ type: "route",
20903
+ name: "Metrics",
20904
+ icon: /* @__PURE__ */ jsx82(Activity3, { size: 20 }),
20905
+ order: 10,
20906
+ group: "DataSource"
20907
+ },
20908
+ {
20909
+ id: "database",
20910
+ builtin: "database",
20911
+ type: "route",
20912
+ name: "Database",
20913
+ icon: /* @__PURE__ */ jsx82(Database4, { size: 20 }),
20914
+ order: 20,
20915
+ group: "DataSource"
20916
+ },
20917
+ {
20918
+ id: "topology-automations",
20919
+ type: "route",
20920
+ name: "Automations",
20921
+ icon: /* @__PURE__ */ jsx82(Share2, { size: 20 }),
20922
+ order: 25,
20923
+ group: "Process"
20924
+ },
20925
+ {
20926
+ id: "topology-runtimes",
20927
+ type: "route",
20928
+ name: "Runtime",
20929
+ icon: /* @__PURE__ */ jsx82(History, { size: 20 }),
20930
+ order: 26,
20931
+ group: "Process"
20932
+ },
20933
+ {
20934
+ id: "topology-inbox",
20935
+ type: "route",
20936
+ name: "Inbox",
20937
+ icon: /* @__PURE__ */ jsx82(Inbox, { size: 20 }),
20938
+ order: 27,
20939
+ group: "Process"
20940
+ },
20941
+ {
20942
+ id: "eval",
20943
+ type: "route",
20944
+ name: "Eval",
20945
+ icon: /* @__PURE__ */ jsx82(FlaskConical3, { size: 20 }),
20946
+ order: 28,
20947
+ group: "Process"
20948
+ },
20949
+ {
20950
+ id: "assistants",
20951
+ builtin: "assistants",
20952
+ type: "route",
20953
+ name: "Assistants",
20954
+ icon: /* @__PURE__ */ jsx82(Bot2, { size: 20 }),
20955
+ order: 30,
20956
+ group: "Settings"
20957
+ },
20958
+ {
20959
+ id: "skills",
20960
+ builtin: "skills",
20961
+ type: "route",
20962
+ name: "Skills",
20963
+ icon: /* @__PURE__ */ jsx82(Zap, { size: 20 }),
20964
+ order: 35,
20965
+ group: "Settings"
20966
+ },
20967
+ {
20968
+ id: "mcp",
20969
+ builtin: "mcp",
20970
+ type: "route",
20971
+ name: "MCP",
20972
+ icon: /* @__PURE__ */ jsx82(Plug2, { size: 20 }),
20973
+ order: 40,
20974
+ group: "Settings"
20975
+ },
20976
+ {
20977
+ id: "tools",
20978
+ builtin: "tools",
20979
+ type: "route",
20980
+ name: "Tools",
20981
+ icon: /* @__PURE__ */ jsx82(Wrench, { size: 20 }),
20982
+ order: 50,
20983
+ group: "Settings"
20984
+ },
20985
+ {
20986
+ id: "switch_tenant",
20987
+ builtin: "switch-tenant",
20988
+ type: "action",
20989
+ name: "Switch tenant",
20990
+ icon: /* @__PURE__ */ jsx82(Building23, { size: 20 }),
20991
+ order: 900,
20992
+ group: "Account"
20993
+ }
20994
+ ];
20890
20995
  var createWrapper = (Component) => {
20891
20996
  return () => /* @__PURE__ */ jsx82(Component, { ...{} });
20892
20997
  };
@@ -20956,120 +21061,13 @@ var WorkspaceResourceManager = ({
20956
21061
  }, []);
20957
21062
  const { user, logout, tenants, currentTenant, selectTenant, isLoading } = useAuth();
20958
21063
  const { setWorkspace, setProject } = useWorkspaceContext();
21064
+ const { config } = useLatticeChatShellContext();
20959
21065
  const [tenantModalOpen, setTenantModalOpen] = useState57(false);
20960
21066
  const [changePasswordOpen, setChangePasswordOpen] = useState57(false);
20961
21067
  const menuItems = useMemo19(() => {
20962
- return [
20963
- // Projects - opens in SideApp via route type
20964
- // ProjectCardList fetches its own data
20965
- {
20966
- id: "workspace_projects",
20967
- type: "route",
20968
- name: "Projects",
20969
- icon: /* @__PURE__ */ jsx82(FolderOpen2, { size: 20 }),
20970
- order: 0
20971
- },
20972
- // DataSource Group
20973
- {
20974
- id: "metrics",
20975
- builtin: "metrics",
20976
- type: "route",
20977
- name: "Metrics",
20978
- icon: /* @__PURE__ */ jsx82(Activity3, { size: 20 }),
20979
- order: 10,
20980
- group: "DataSource"
20981
- },
20982
- {
20983
- id: "database",
20984
- builtin: "database",
20985
- type: "route",
20986
- name: "Database",
20987
- icon: /* @__PURE__ */ jsx82(Database4, { size: 20 }),
20988
- order: 20,
20989
- group: "DataSource"
20990
- },
20991
- // Process Group
20992
- {
20993
- id: "topology-automations",
20994
- type: "route",
20995
- name: "Automations",
20996
- icon: /* @__PURE__ */ jsx82(Share2, { size: 20 }),
20997
- order: 25,
20998
- group: "Process"
20999
- },
21000
- {
21001
- id: "topology-runtimes",
21002
- type: "route",
21003
- name: "Runtime",
21004
- icon: /* @__PURE__ */ jsx82(History, { size: 20 }),
21005
- order: 26,
21006
- group: "Process"
21007
- },
21008
- {
21009
- id: "topology-inbox",
21010
- type: "route",
21011
- name: "Inbox",
21012
- icon: /* @__PURE__ */ jsx82(Inbox, { size: 20 }),
21013
- order: 27,
21014
- group: "Process"
21015
- },
21016
- {
21017
- id: "eval",
21018
- type: "route",
21019
- name: "Eval",
21020
- icon: /* @__PURE__ */ jsx82(FlaskConical3, { size: 20 }),
21021
- order: 28,
21022
- group: "Process"
21023
- },
21024
- // Settings Group
21025
- {
21026
- id: "assistants",
21027
- builtin: "assistants",
21028
- type: "route",
21029
- name: "Assistants",
21030
- icon: /* @__PURE__ */ jsx82(Bot2, { size: 20 }),
21031
- order: 30,
21032
- group: "Settings"
21033
- },
21034
- {
21035
- id: "skills",
21036
- builtin: "skills",
21037
- type: "route",
21038
- name: "Skills",
21039
- icon: /* @__PURE__ */ jsx82(Zap, { size: 20 }),
21040
- order: 35,
21041
- group: "Settings"
21042
- },
21043
- {
21044
- id: "mcp",
21045
- builtin: "mcp",
21046
- type: "route",
21047
- name: "MCP",
21048
- icon: /* @__PURE__ */ jsx82(Plug2, { size: 20 }),
21049
- order: 40,
21050
- group: "Settings"
21051
- },
21052
- {
21053
- id: "tools",
21054
- builtin: "tools",
21055
- type: "route",
21056
- name: "Tools",
21057
- icon: /* @__PURE__ */ jsx82(Wrench, { size: 20 }),
21058
- order: 50,
21059
- group: "Settings"
21060
- },
21061
- // Switch Tenant action
21062
- {
21063
- id: "switch_tenant",
21064
- builtin: "switch-tenant",
21065
- type: "action",
21066
- name: "Switch tenant",
21067
- icon: /* @__PURE__ */ jsx82(Building23, { size: 20 }),
21068
- order: 900,
21069
- group: "Account"
21070
- }
21071
- ];
21072
- }, [workspaceName]);
21068
+ const items = config.workspaceMenuItems?.length ? [...config.workspaceMenuItems] : [...DEFAULT_WORKSPACE_MENU_ITEMS];
21069
+ return items.sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
21070
+ }, [config.workspaceMenuItems]);
21073
21071
  const handleItemClick = (item) => {
21074
21072
  if (item.type === "action" && item.builtin === "switch-tenant") {
21075
21073
  setTenantModalOpen(true);
@@ -21089,26 +21087,23 @@ var WorkspaceResourceManager = ({
21089
21087
  "topology-inbox": "workspace_topology_inbox",
21090
21088
  eval: "workspace_eval"
21091
21089
  };
21092
- const componentKey = componentKeyMap[item.id];
21093
- if (componentKey) {
21094
- openContentApp({
21095
- component_key: componentKey,
21096
- data: {},
21097
- message: item.name
21098
- });
21099
- }
21090
+ const componentKey = componentKeyMap[item.id] ?? item.id;
21091
+ openContentApp({
21092
+ component_key: componentKey,
21093
+ data: {},
21094
+ message: item.name
21095
+ });
21100
21096
  }
21101
21097
  };
21102
21098
  useEffect40(() => {
21103
- if (!hasOpenedDefault.current) {
21099
+ if (!hasOpenedDefault.current && menuItems.length > 0) {
21104
21100
  hasOpenedDefault.current = true;
21105
- openContentApp({
21106
- component_key: "workspace_projects",
21107
- data: {},
21108
- message: "Projects"
21109
- });
21101
+ const firstRoute = menuItems.find((item) => item.type === "route");
21102
+ if (firstRoute) {
21103
+ handleItemClick(firstRoute);
21104
+ }
21110
21105
  }
21111
- }, [openContentApp]);
21106
+ }, []);
21112
21107
  const userMenuItems = /* @__PURE__ */ jsxs56("div", { style: { minWidth: 160 }, children: [
21113
21108
  /* @__PURE__ */ jsxs56("div", { style: { padding: "8px 12px", borderBottom: "1px solid #f0f0f0" }, children: [
21114
21109
  /* @__PURE__ */ jsx82("div", { style: { fontWeight: 500 }, children: user?.name || user?.email }),
@@ -21163,7 +21158,7 @@ var WorkspaceResourceManager = ({
21163
21158
  logo,
21164
21159
  logoText: workspaceName || "Workspace",
21165
21160
  showToggle: true,
21166
- defaultExpanded: true,
21161
+ defaultExpanded: config.workspaceMenuDefaultExpanded ?? true,
21167
21162
  collapsed: menuCollapsed,
21168
21163
  onCollapsedChange: setMenuCollapsed,
21169
21164
  footer: ({ isIconMode }) => user && /* @__PURE__ */ jsx82(
@@ -31161,7 +31156,6 @@ var DRAWER_STYLES2 = {
31161
31156
  }
31162
31157
  };
31163
31158
  var DEFAULT_MENU_ITEMS = [
31164
- // First: New Analysis (action)
31165
31159
  {
31166
31160
  id: "new-analysis",
31167
31161
  builtin: "new-analysis",
@@ -31170,7 +31164,6 @@ var DEFAULT_MENU_ITEMS = [
31170
31164
  icon: /* @__PURE__ */ jsx121(PlusCircle, { size: 20 }),
31171
31165
  order: 0
31172
31166
  },
31173
- // Second: Thread History (inline drawer)
31174
31167
  {
31175
31168
  id: "thread-history",
31176
31169
  builtin: "thread-history",
@@ -31184,7 +31177,6 @@ var DEFAULT_MENU_ITEMS = [
31184
31177
  inlineDefaultExpanded: true,
31185
31178
  content: /* @__PURE__ */ jsx121(ThreadHistoryMenuContent, {})
31186
31179
  }
31187
- // Project Files removed - now accessed via header toggle
31188
31180
  ];
31189
31181
  var ChatSidebar = ({
31190
31182
  onSettingsClick,
@@ -31206,10 +31198,7 @@ var ChatSidebar = ({
31206
31198
  } = config;
31207
31199
  const isExpandedMode = sidebarMode === "expanded";
31208
31200
  const menuItems = useMemo32(() => {
31209
- const items = [...DEFAULT_MENU_ITEMS];
31210
- for (const item of customMenuItems) {
31211
- items.push(item);
31212
- }
31201
+ const items = customMenuItems.length > 0 ? [...customMenuItems] : [...DEFAULT_MENU_ITEMS];
31213
31202
  return items.sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
31214
31203
  }, [customMenuItems]);
31215
31204
  const handleMenuClick = useCallback42(async (item) => {
@@ -32871,7 +32860,6 @@ import {
32871
32860
  Input as Input17,
32872
32861
  Modal as Modal23,
32873
32862
  Popconfirm as Popconfirm10,
32874
- Select as Select9,
32875
32863
  Spin as Spin21,
32876
32864
  Tag as Tag29,
32877
32865
  Typography as Typography58,
@@ -32880,11 +32868,6 @@ import {
32880
32868
  import { Edit2 as Edit24, Plus as Plus9, RadioTower, Trash2 as Trash29 } from "lucide-react";
32881
32869
  import { jsx as jsx126, jsxs as jsxs91 } from "react/jsx-runtime";
32882
32870
  var { Text: Text47, Title: Title17 } = Typography58;
32883
- var MAPPING_MODE_OPTIONS = [
32884
- { label: "User", value: "user" },
32885
- { label: "Group", value: "group" },
32886
- { label: "Hybrid", value: "hybrid" }
32887
- ];
32888
32871
  var ChannelInstallationsDrawerContent = () => {
32889
32872
  const { get, post, put, del } = useApi();
32890
32873
  const [installations, setInstallations] = useState80([]);
@@ -33006,22 +32989,6 @@ var ChannelInstallationsDrawerContent = () => {
33006
32989
  "ID: ",
33007
32990
  installation.id
33008
32991
  ] }),
33009
- /* @__PURE__ */ jsxs91(Text47, { style: { fontSize: 13 }, children: [
33010
- "Assistant ID: ",
33011
- installation.config.assistantId
33012
- ] }),
33013
- /* @__PURE__ */ jsxs91(Text47, { style: { fontSize: 13 }, children: [
33014
- "Mapping Mode: ",
33015
- installation.config.mappingMode
33016
- ] }),
33017
- installation.config.workspaceId ? /* @__PURE__ */ jsxs91(Text47, { style: { fontSize: 13 }, children: [
33018
- "Workspace ID: ",
33019
- installation.config.workspaceId
33020
- ] }) : null,
33021
- installation.config.projectId ? /* @__PURE__ */ jsxs91(Text47, { style: { fontSize: 13 }, children: [
33022
- "Project ID: ",
33023
- installation.config.projectId
33024
- ] }) : null,
33025
32992
  webhookPath ? /* @__PURE__ */ jsx126(Text47, { code: true, style: { fontSize: 12 }, children: webhookPath }) : /* @__PURE__ */ jsx126(Text47, { type: "secondary", style: { fontSize: 12 }, children: "Unsupported channel configuration UI" })
33026
32993
  ]
33027
32994
  }
@@ -33077,23 +33044,17 @@ var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCance
33077
33044
  const [form] = Form9.useForm();
33078
33045
  useEffect53(() => {
33079
33046
  if (installation) {
33047
+ const config = installation.config;
33080
33048
  form.setFieldsValue({
33081
33049
  name: installation.name,
33082
- appId: installation.config.appId,
33083
- appSecret: installation.config.appSecret,
33084
- verificationToken: installation.config.verificationToken,
33085
- encryptKey: installation.config.encryptKey,
33086
- mappingMode: installation.config.mappingMode,
33087
- assistantId: installation.config.assistantId,
33088
- workspaceId: installation.config.workspaceId,
33089
- projectId: installation.config.projectId
33050
+ appId: config.appId,
33051
+ appSecret: config.appSecret,
33052
+ verificationToken: config.verificationToken,
33053
+ encryptKey: config.encryptKey
33090
33054
  });
33091
33055
  return;
33092
33056
  }
33093
33057
  form.resetFields();
33094
- form.setFieldsValue({
33095
- mappingMode: "hybrid"
33096
- });
33097
33058
  }, [installation, form]);
33098
33059
  const handleSubmit = async () => {
33099
33060
  const values = await form.validateFields();
@@ -33101,11 +33062,7 @@ var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCance
33101
33062
  appId: values.appId,
33102
33063
  appSecret: values.appSecret,
33103
33064
  verificationToken: values.verificationToken,
33104
- encryptKey: values.encryptKey,
33105
- mappingMode: values.mappingMode,
33106
- assistantId: values.assistantId,
33107
- workspaceId: values.workspaceId,
33108
- projectId: values.projectId
33065
+ encryptKey: values.encryptKey
33109
33066
  };
33110
33067
  try {
33111
33068
  if (installation) {
@@ -33178,27 +33135,7 @@ var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCance
33178
33135
  }
33179
33136
  ),
33180
33137
  /* @__PURE__ */ jsx126(Form9.Item, { name: "verificationToken", label: "Verification Token", children: /* @__PURE__ */ jsx126(Input17, {}) }),
33181
- /* @__PURE__ */ jsx126(Form9.Item, { name: "encryptKey", label: "Encrypt Key", children: /* @__PURE__ */ jsx126(Input17, {}) }),
33182
- /* @__PURE__ */ jsx126(
33183
- Form9.Item,
33184
- {
33185
- name: "mappingMode",
33186
- label: "Mapping Mode",
33187
- rules: [{ required: true, message: "Mapping Mode is required" }],
33188
- children: /* @__PURE__ */ jsx126(Select9, { options: MAPPING_MODE_OPTIONS })
33189
- }
33190
- ),
33191
- /* @__PURE__ */ jsx126(
33192
- Form9.Item,
33193
- {
33194
- name: "assistantId",
33195
- label: "Assistant ID",
33196
- rules: [{ required: true, message: "Assistant ID is required" }],
33197
- children: /* @__PURE__ */ jsx126(Input17, {})
33198
- }
33199
- ),
33200
- /* @__PURE__ */ jsx126(Form9.Item, { name: "workspaceId", label: "Workspace ID", children: /* @__PURE__ */ jsx126(Input17, {}) }),
33201
- /* @__PURE__ */ jsx126(Form9.Item, { name: "projectId", label: "Project ID", children: /* @__PURE__ */ jsx126(Input17, {}) })
33138
+ /* @__PURE__ */ jsx126(Form9.Item, { name: "encryptKey", label: "Encrypt Key", children: /* @__PURE__ */ jsx126(Input17, {}) })
33202
33139
  ] })
33203
33140
  }
33204
33141
  );
@@ -33214,6 +33151,7 @@ export {
33214
33151
  AxiomLatticeProvider,
33215
33152
  ChangePasswordModal,
33216
33153
  ChannelInstallationsDrawerContent,
33154
+ ChatSidebar,
33217
33155
  ChatUIContext,
33218
33156
  ChatUIContextProvider,
33219
33157
  Chating,
@@ -33221,7 +33159,9 @@ export {
33221
33159
  ConversationContext,
33222
33160
  ConversationContextProvider,
33223
33161
  CreateAssistantModal_default as CreateAssistantModal,
33162
+ DEFAULT_MENU_ITEMS,
33224
33163
  DEFAULT_MIDDLEWARE_TYPES,
33164
+ DEFAULT_WORKSPACE_MENU_ITEMS,
33225
33165
  EvalPanel,
33226
33166
  EvalRunResults,
33227
33167
  EvalSuiteCardList,