@axiom-lattice/react-sdk 2.1.31 → 2.1.32

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.d.mts CHANGED
@@ -817,11 +817,21 @@ interface LatticeChatShellConfig {
817
817
  */
818
818
  globalSharedSandboxURL?: string;
819
819
  /**
820
- * Available middleware types that can be configured for agents
821
- * Each middleware type defines its name, description, and default configuration
822
- * If not provided, default middleware types will be used
823
- */
820
+ * Available middleware types that can be configured for agents
821
+ * Each middleware type defines its name, description, and default configuration
822
+ * If not provided, default middleware types will be used
823
+ */
824
824
  availableMiddlewareTypes?: MiddlewareTypeDefinition[];
825
+ /**
826
+ * Whether users can create new assistants
827
+ * Defaults to true
828
+ */
829
+ enableAssistantCreation?: boolean;
830
+ /**
831
+ * Whether users can edit existing assistants
832
+ * Defaults to true
833
+ */
834
+ enableAssistantEditing?: boolean;
825
835
  }
826
836
  /**
827
837
  * Lattice Chat Shell context value interface
@@ -945,7 +955,16 @@ interface AgentConversationsProps {
945
955
  }
946
956
  declare const AgentConversations: React__default.FC<AgentConversationsProps>;
947
957
 
948
- type LatticeChatShellProps = Omit<LatticeChatShellContextProviderProps, "children">;
958
+ type LatticeChatShellProps = Omit<LatticeChatShellContextProviderProps, "children"> & {
959
+ /**
960
+ * Whether users can create new assistants (default: true)
961
+ */
962
+ enableAssistantCreation?: boolean;
963
+ /**
964
+ * Whether users can edit existing assistants (default: true)
965
+ */
966
+ enableAssistantEditing?: boolean;
967
+ };
949
968
  /**
950
969
  * Lattice Chat Shell component
951
970
  * Provides a complete chat interface with conversation management
@@ -1045,7 +1064,7 @@ declare const SkillNode: React__default.FC<NodeProps<Node<SkillNodeData>>>;
1045
1064
  interface CreateAssistantModalProps {
1046
1065
  open: boolean;
1047
1066
  onCancel: () => void;
1048
- onSuccess?: () => void;
1067
+ onSuccess?: (assistant: Assistant) => void;
1049
1068
  }
1050
1069
  declare const CreateAssistantModal: React__default.FC<CreateAssistantModalProps>;
1051
1070
 
package/dist/index.d.ts CHANGED
@@ -817,11 +817,21 @@ interface LatticeChatShellConfig {
817
817
  */
818
818
  globalSharedSandboxURL?: string;
819
819
  /**
820
- * Available middleware types that can be configured for agents
821
- * Each middleware type defines its name, description, and default configuration
822
- * If not provided, default middleware types will be used
823
- */
820
+ * Available middleware types that can be configured for agents
821
+ * Each middleware type defines its name, description, and default configuration
822
+ * If not provided, default middleware types will be used
823
+ */
824
824
  availableMiddlewareTypes?: MiddlewareTypeDefinition[];
825
+ /**
826
+ * Whether users can create new assistants
827
+ * Defaults to true
828
+ */
829
+ enableAssistantCreation?: boolean;
830
+ /**
831
+ * Whether users can edit existing assistants
832
+ * Defaults to true
833
+ */
834
+ enableAssistantEditing?: boolean;
825
835
  }
826
836
  /**
827
837
  * Lattice Chat Shell context value interface
@@ -945,7 +955,16 @@ interface AgentConversationsProps {
945
955
  }
946
956
  declare const AgentConversations: React__default.FC<AgentConversationsProps>;
947
957
 
948
- type LatticeChatShellProps = Omit<LatticeChatShellContextProviderProps, "children">;
958
+ type LatticeChatShellProps = Omit<LatticeChatShellContextProviderProps, "children"> & {
959
+ /**
960
+ * Whether users can create new assistants (default: true)
961
+ */
962
+ enableAssistantCreation?: boolean;
963
+ /**
964
+ * Whether users can edit existing assistants (default: true)
965
+ */
966
+ enableAssistantEditing?: boolean;
967
+ };
949
968
  /**
950
969
  * Lattice Chat Shell component
951
970
  * Provides a complete chat interface with conversation management
@@ -1045,7 +1064,7 @@ declare const SkillNode: React__default.FC<NodeProps<Node<SkillNodeData>>>;
1045
1064
  interface CreateAssistantModalProps {
1046
1065
  open: boolean;
1047
1066
  onCancel: () => void;
1048
- onSuccess?: () => void;
1067
+ onSuccess?: (assistant: Assistant) => void;
1049
1068
  }
1050
1069
  declare const CreateAssistantModal: React__default.FC<CreateAssistantModalProps>;
1051
1070
 
package/dist/index.js CHANGED
@@ -2218,6 +2218,8 @@ var DEFAULT_CONFIG = {
2218
2218
  enableThreadCreation: true,
2219
2219
  enableThreadList: true,
2220
2220
  showSideMenu: true,
2221
+ enableAssistantCreation: true,
2222
+ enableAssistantEditing: true,
2221
2223
  availableMiddlewareTypes: DEFAULT_MIDDLEWARE_TYPES
2222
2224
  };
2223
2225
  var LatticeChatShellContext = (0, import_react10.createContext)({
@@ -7332,7 +7334,7 @@ var import_react42 = require("react");
7332
7334
  // src/components/Chat/ChatSidebar.tsx
7333
7335
  var import_react41 = require("react");
7334
7336
  var import_antd40 = require("antd");
7335
- var import_icons26 = require("@ant-design/icons");
7337
+ var import_lucide_react = require("lucide-react");
7336
7338
  var import_antd_style13 = require("antd-style");
7337
7339
 
7338
7340
  // src/components/Chat/AssistantFlow.tsx
@@ -7818,7 +7820,7 @@ var AssistantNode = ({
7818
7820
  e.currentTarget.style.boxShadow = `0 1px 4px rgba(0, 0, 0, 0.08)`;
7819
7821
  },
7820
7822
  children: [
7821
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
7823
+ onConfigure && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
7822
7824
  "div",
7823
7825
  {
7824
7826
  onClick: (e) => {
@@ -8627,13 +8629,16 @@ var AgentConfigPanel = ({
8627
8629
  allAssistants,
8628
8630
  visible,
8629
8631
  onClose,
8630
- onSave
8632
+ onSave,
8633
+ onDelete
8631
8634
  }) => {
8632
8635
  const [form] = import_antd32.Form.useForm();
8633
8636
  const { token } = import_antd32.theme.useToken();
8634
8637
  const { config } = useLatticeChatShellContext();
8635
8638
  const [toolsLoading, setToolsLoading] = (0, import_react31.useState)(false);
8636
8639
  const [saving, setSaving] = (0, import_react31.useState)(false);
8640
+ const [deleting, setDeleting] = (0, import_react31.useState)(false);
8641
+ const [isDeleteModalOpen, setIsDeleteModalOpen] = (0, import_react31.useState)(false);
8637
8642
  const [tools, setTools] = (0, import_react31.useState)([]);
8638
8643
  const [selectedTools, setSelectedTools] = (0, import_react31.useState)([]);
8639
8644
  const [selectedSubAgents, setSelectedSubAgents] = (0, import_react31.useState)([]);
@@ -8749,6 +8754,20 @@ var AgentConfigPanel = ({
8749
8754
  setSaving(false);
8750
8755
  }
8751
8756
  };
8757
+ const handleDelete = async () => {
8758
+ if (!assistant) return;
8759
+ setDeleting(true);
8760
+ try {
8761
+ await onDelete?.(assistant);
8762
+ setIsDeleteModalOpen(false);
8763
+ onClose();
8764
+ } catch (error) {
8765
+ setIsDeleteModalOpen(false);
8766
+ import_antd32.message.error(error instanceof Error ? error.message : "Failed to delete assistant");
8767
+ } finally {
8768
+ setDeleting(false);
8769
+ }
8770
+ };
8752
8771
  const handleMiddlewareToggle = (middlewareId) => {
8753
8772
  setMiddleware(
8754
8773
  (prev) => prev.map((m) => {
@@ -8899,15 +8918,27 @@ var AgentConfigPanel = ({
8899
8918
  /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text16, { strong: true, style: { fontSize: 14 }, children: assistant.name }),
8900
8919
  /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_antd32.Tag, { color: "blue", style: { margin: 0, fontSize: 10 }, children: "Config" })
8901
8920
  ] }),
8902
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
8903
- import_antd32.Button,
8904
- {
8905
- type: "text",
8906
- size: "small",
8907
- icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_icons19.CloseOutlined, {}),
8908
- onClick: onClose
8909
- }
8910
- )
8921
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_antd32.Space, { children: [
8922
+ onDelete && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_antd32.Tooltip, { title: "Delete Assistant", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
8923
+ import_antd32.Button,
8924
+ {
8925
+ type: "text",
8926
+ size: "small",
8927
+ danger: true,
8928
+ icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_icons19.DeleteOutlined, {}),
8929
+ onClick: () => setIsDeleteModalOpen(true)
8930
+ }
8931
+ ) }),
8932
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
8933
+ import_antd32.Button,
8934
+ {
8935
+ type: "text",
8936
+ size: "small",
8937
+ icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_icons19.CloseOutlined, {}),
8938
+ onClick: onClose
8939
+ }
8940
+ )
8941
+ ] })
8911
8942
  ]
8912
8943
  }
8913
8944
  ),
@@ -9186,10 +9217,10 @@ var AgentConfigPanel = ({
9186
9217
  alignItems: "center"
9187
9218
  },
9188
9219
  children: [
9189
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text16, { type: "secondary", style: { fontSize: 12 }, children: "Changes will be saved to the agent" }),
9220
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text16, { type: "secondary", style: { fontSize: 12 }, children: onSave ? "Changes will be saved to the agent" : "Viewing agent configuration" }),
9190
9221
  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_antd32.Space, { children: [
9191
9222
  /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_antd32.Button, { onClick: onClose, size: "small", children: "Close" }),
9192
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
9223
+ onSave && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
9193
9224
  import_antd32.Button,
9194
9225
  {
9195
9226
  type: "primary",
@@ -9278,6 +9309,33 @@ var AgentConfigPanel = ({
9278
9309
  )
9279
9310
  ]
9280
9311
  }
9312
+ ),
9313
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
9314
+ import_antd32.Modal,
9315
+ {
9316
+ title: "Delete Assistant",
9317
+ open: isDeleteModalOpen,
9318
+ onCancel: () => setIsDeleteModalOpen(false),
9319
+ footer: [
9320
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_antd32.Button, { onClick: () => setIsDeleteModalOpen(false), children: "Cancel" }, "cancel"),
9321
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
9322
+ import_antd32.Button,
9323
+ {
9324
+ type: "primary",
9325
+ danger: true,
9326
+ loading: deleting,
9327
+ onClick: handleDelete,
9328
+ children: "Delete"
9329
+ },
9330
+ "delete"
9331
+ )
9332
+ ],
9333
+ children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Text16, { children: [
9334
+ "Are you sure you want to delete ",
9335
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Text16, { strong: true, children: assistant.name }),
9336
+ "? This action cannot be undone."
9337
+ ] })
9338
+ }
9281
9339
  )
9282
9340
  ]
9283
9341
  }
@@ -9339,7 +9397,7 @@ var CreateAssistantModal = ({
9339
9397
  description: "Assistant created successfully"
9340
9398
  });
9341
9399
  form.resetFields();
9342
- onSuccess?.();
9400
+ onSuccess?.(data.data);
9343
9401
  onCancel();
9344
9402
  } else {
9345
9403
  import_antd33.message.error(data.message || "Failed to create assistant");
@@ -9473,6 +9531,7 @@ var import_antd34 = require("antd");
9473
9531
  var import_icons21 = require("@ant-design/icons");
9474
9532
  var import_jsx_runtime50 = require("react/jsx-runtime");
9475
9533
  var AssistantFlowInner = ({ onChat }) => {
9534
+ const { setCenter, fitView } = (0, import_react34.useReactFlow)();
9476
9535
  const [nodes, setNodes, onNodesChange] = (0, import_react34.useNodesState)([]);
9477
9536
  const [edges, setEdges, onEdgesChange] = (0, import_react34.useEdgesState)([]);
9478
9537
  const [assistants, setAssistants] = (0, import_react33.useState)([]);
@@ -9482,6 +9541,7 @@ var AssistantFlowInner = ({ onChat }) => {
9482
9541
  const [isCreateModalOpen, setIsCreateModalOpen] = (0, import_react33.useState)(false);
9483
9542
  const { config } = useLatticeChatShellContext();
9484
9543
  const { token } = import_antd34.theme.useToken();
9544
+ const { enableAssistantCreation = true, enableAssistantEditing = true } = config;
9485
9545
  const nodeTypes = (0, import_react33.useMemo)(
9486
9546
  () => ({
9487
9547
  assistant: AssistantNode_default
@@ -9494,6 +9554,7 @@ var AssistantFlowInner = ({ onChat }) => {
9494
9554
  }, []);
9495
9555
  const handleClosePanel = (0, import_react33.useCallback)(() => {
9496
9556
  setConfigPanelVisible(false);
9557
+ setSelectedAssistant(null);
9497
9558
  }, []);
9498
9559
  const fetchAssistants = async () => {
9499
9560
  setAssistantsLoading(true);
@@ -9672,7 +9733,7 @@ var AssistantFlowInner = ({ onChat }) => {
9672
9733
  type: "assistant",
9673
9734
  data: {
9674
9735
  assistant,
9675
- onConfigure: () => handleConfigure(assistant),
9736
+ onConfigure: enableAssistantEditing ? () => handleConfigure(assistant) : void 0,
9676
9737
  onChat
9677
9738
  },
9678
9739
  position: { x, y }
@@ -9702,7 +9763,7 @@ var AssistantFlowInner = ({ onChat }) => {
9702
9763
  type: "assistant",
9703
9764
  data: {
9704
9765
  assistant,
9705
- onConfigure: () => handleConfigure(assistant),
9766
+ onConfigure: enableAssistantEditing ? () => handleConfigure(assistant) : void 0,
9706
9767
  onChat
9707
9768
  },
9708
9769
  position: { x, y }
@@ -9763,9 +9824,82 @@ var AssistantFlowInner = ({ onChat }) => {
9763
9824
  throw error;
9764
9825
  }
9765
9826
  };
9766
- const handleAssistantCreated = async () => {
9767
- await fetchAssistants();
9827
+ const handleDeleteAssistant = async (assistant) => {
9828
+ try {
9829
+ const headers = {};
9830
+ if (config.apiKey) {
9831
+ headers["Authorization"] = `Bearer ${config.apiKey}`;
9832
+ }
9833
+ const response = await fetch(
9834
+ `${config.baseURL}/api/assistants/${assistant.id}`,
9835
+ {
9836
+ method: "DELETE",
9837
+ headers,
9838
+ body: JSON.stringify({})
9839
+ }
9840
+ );
9841
+ const data = await response.json();
9842
+ if (response.ok && data.success) {
9843
+ setAssistants((prev) => prev.filter((a) => a.id !== assistant.id));
9844
+ if (selectedAssistant?.id === assistant.id) {
9845
+ setSelectedAssistant(null);
9846
+ setConfigPanelVisible(false);
9847
+ }
9848
+ import_antd34.notification.success({
9849
+ message: "Deleted",
9850
+ description: "Assistant deleted successfully"
9851
+ });
9852
+ } else {
9853
+ import_antd34.message.error(data.message || "Failed to delete assistant");
9854
+ throw new Error(data.message || "Failed to delete assistant");
9855
+ }
9856
+ } catch (error) {
9857
+ console.error("Failed to delete assistant:", error);
9858
+ import_antd34.message.error(error instanceof Error ? error.message : "Failed to delete assistant");
9859
+ throw error;
9860
+ }
9768
9861
  };
9862
+ const handleAssistantCreated = (createdAssistant) => {
9863
+ setAssistants((prev) => {
9864
+ const exists = prev.some((a) => a.id === createdAssistant.id);
9865
+ if (exists) {
9866
+ return prev.map((a) => a.id === createdAssistant.id ? createdAssistant : a);
9867
+ }
9868
+ return [...prev, createdAssistant];
9869
+ });
9870
+ lastCreatedAssistantRef.current = createdAssistant;
9871
+ };
9872
+ (0, import_react33.useEffect)(() => {
9873
+ if (selectedAssistant) {
9874
+ const node = nodes.find((n) => n.id === selectedAssistant.id);
9875
+ if (node) {
9876
+ setCenter(node.position.x + 140, node.position.y + 100, { zoom: 1, duration: 800 });
9877
+ }
9878
+ }
9879
+ }, [selectedAssistant, nodes, setCenter]);
9880
+ (0, import_react33.useEffect)(() => {
9881
+ if (assistants.length > 0 && selectedAssistant) {
9882
+ const assistant = assistants.find((a) => a.id === selectedAssistant.id);
9883
+ if (assistant && !configPanelVisible) {
9884
+ setConfigPanelVisible(true);
9885
+ }
9886
+ }
9887
+ }, [assistants, selectedAssistant, configPanelVisible]);
9888
+ const lastCreatedAssistantRef = (0, import_react33.useRef)(null);
9889
+ (0, import_react33.useEffect)(() => {
9890
+ if (lastCreatedAssistantRef.current && !assistants.find((a) => a.id === lastCreatedAssistantRef.current?.id)) {
9891
+ lastCreatedAssistantRef.current = null;
9892
+ }
9893
+ if (lastCreatedAssistantRef.current) {
9894
+ const node = nodes.find((n) => n.id === lastCreatedAssistantRef.current.id);
9895
+ if (node) {
9896
+ setCenter(node.position.x + 140, node.position.y + 100, { zoom: 1, duration: 800 });
9897
+ setSelectedAssistant(lastCreatedAssistantRef.current);
9898
+ setConfigPanelVisible(true);
9899
+ lastCreatedAssistantRef.current = null;
9900
+ }
9901
+ }
9902
+ }, [nodes, setCenter]);
9769
9903
  if (assistantsLoading) {
9770
9904
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
9771
9905
  "div",
@@ -9808,7 +9942,7 @@ var AssistantFlowInner = ({ onChat }) => {
9808
9942
  ]
9809
9943
  }
9810
9944
  ),
9811
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
9945
+ enableAssistantCreation && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
9812
9946
  "div",
9813
9947
  {
9814
9948
  style: {
@@ -9848,7 +9982,8 @@ var AssistantFlowInner = ({ onChat }) => {
9848
9982
  assistant: selectedAssistant,
9849
9983
  allAssistants: assistants,
9850
9984
  onClose: handleClosePanel,
9851
- onSave: handleSaveConfig
9985
+ onSave: handleSaveConfig,
9986
+ onDelete: handleDeleteAssistant
9852
9987
  }
9853
9988
  ),
9854
9989
  /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
@@ -11874,8 +12009,9 @@ var useStyles4 = (0, import_antd_style13.createStyles)(({ token, css }) => ({
11874
12009
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
11875
12010
  }
11876
12011
 
11877
- .anticon {
11878
- font-size: 22px;
12012
+ .lucide {
12013
+ width: 22px;
12014
+ height: 22px;
11879
12015
  }
11880
12016
  `
11881
12017
  }));
@@ -11910,7 +12046,7 @@ var ChatSidebar = ({
11910
12046
  onClick: handleAssistantFlowClick,
11911
12047
  title: "Assistant Flow Canvas",
11912
12048
  "aria-label": "Assistant Flow Canvas",
11913
- children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_icons26.ApartmentOutlined, {})
12049
+ children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react.Bot, {})
11914
12050
  }
11915
12051
  ),
11916
12052
  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
@@ -11920,7 +12056,7 @@ var ChatSidebar = ({
11920
12056
  onClick: handleSkillFlowClick,
11921
12057
  title: "Skill Flow Canvas",
11922
12058
  "aria-label": "Skill Flow Canvas",
11923
- children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_icons26.StarOutlined, {})
12059
+ children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react.BrainCircuit, {})
11924
12060
  }
11925
12061
  ),
11926
12062
  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
@@ -11930,7 +12066,7 @@ var ChatSidebar = ({
11930
12066
  onClick: handleToolsClick,
11931
12067
  title: "Tools List",
11932
12068
  "aria-label": "Tools List",
11933
- children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_icons26.ToolOutlined, {})
12069
+ children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react.Wrench, {})
11934
12070
  }
11935
12071
  ),
11936
12072
  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
@@ -11940,7 +12076,7 @@ var ChatSidebar = ({
11940
12076
  onClick: handleSettingsClick,
11941
12077
  title: "Settings",
11942
12078
  "aria-label": "Settings",
11943
- children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_icons26.SettingOutlined, {})
12079
+ children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react.Settings, {})
11944
12080
  }
11945
12081
  )
11946
12082
  ] }) }),
@@ -12056,7 +12192,7 @@ var LatticeChatView = (props) => {
12056
12192
  // src/components/Chat/SettingsModal.tsx
12057
12193
  var import_react43 = require("react");
12058
12194
  var import_antd41 = require("antd");
12059
- var import_icons27 = require("@ant-design/icons");
12195
+ var import_icons26 = require("@ant-design/icons");
12060
12196
  var import_antd_style14 = require("antd-style");
12061
12197
  var import_jsx_runtime57 = require("react/jsx-runtime");
12062
12198
  var { Text: Text20, Title: Title4 } = import_antd41.Typography;
@@ -12407,12 +12543,12 @@ var SETTINGS_MENU_ITEMS = [
12407
12543
  {
12408
12544
  key: "environment",
12409
12545
  label: "Environment Variables",
12410
- icon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons27.EnvironmentOutlined, {})
12546
+ icon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons26.EnvironmentOutlined, {})
12411
12547
  },
12412
12548
  {
12413
12549
  key: "models",
12414
12550
  label: "Model Configuration",
12415
- icon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons27.ApiOutlined, {})
12551
+ icon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons26.ApiOutlined, {})
12416
12552
  }
12417
12553
  ];
12418
12554
  var SettingsModal = ({
@@ -12876,7 +13012,7 @@ var SettingsModal = ({
12876
13012
  description: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { children: [
12877
13013
  /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { style: { marginBottom: 8 }, children: [
12878
13014
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
12879
- import_icons27.CheckCircleOutlined,
13015
+ import_icons26.CheckCircleOutlined,
12880
13016
  {
12881
13017
  style: { color: "#52c41a", marginRight: 8 }
12882
13018
  }
@@ -12885,7 +13021,7 @@ var SettingsModal = ({
12885
13021
  " QUEUE_SERVICE_TYPE, REDIS_URL, REDIS_PASSWORD, QUEUE_NAME"
12886
13022
  ] }),
12887
13023
  /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { children: [
12888
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons27.ReloadOutlined, { style: { color: "#faad14", marginRight: 8 } }),
13024
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons26.ReloadOutlined, { style: { color: "#faad14", marginRight: 8 } }),
12889
13025
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("strong", { children: "Requires restart:" }),
12890
13026
  " PORT (server must be restarted to change port)"
12891
13027
  ] })
@@ -13172,7 +13308,7 @@ QUEUE_NAME=tasks`,
13172
13308
  const renderTabLabel = (connection) => {
13173
13309
  return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { style: { display: "flex", alignItems: "center" }, children: [
13174
13310
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
13175
- import_icons27.CloudServerOutlined,
13311
+ import_icons26.CloudServerOutlined,
13176
13312
  {
13177
13313
  style: {
13178
13314
  marginRight: 8,
@@ -13182,13 +13318,13 @@ QUEUE_NAME=tasks`,
13182
13318
  ),
13183
13319
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { children: connection.name }),
13184
13320
  connection.connected && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
13185
- import_icons27.CheckCircleFilled,
13321
+ import_icons26.CheckCircleFilled,
13186
13322
  {
13187
13323
  style: { color: "#52c41a", fontSize: 12, marginLeft: 8 }
13188
13324
  }
13189
13325
  ),
13190
13326
  connection.error && !connection.connecting && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
13191
- import_icons27.CloseCircleFilled,
13327
+ import_icons26.CloseCircleFilled,
13192
13328
  {
13193
13329
  style: { color: "#ff4d4f", fontSize: 12, marginLeft: 8 }
13194
13330
  }
@@ -13226,7 +13362,7 @@ QUEUE_NAME=tasks`,
13226
13362
  import_antd41.Button,
13227
13363
  {
13228
13364
  type: "primary",
13229
- icon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons27.SaveOutlined, {}),
13365
+ icon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons26.SaveOutlined, {}),
13230
13366
  onClick: handleSave,
13231
13367
  loading,
13232
13368
  children: "Save Configuration"
@@ -13249,14 +13385,14 @@ QUEUE_NAME=tasks`,
13249
13385
  padding: 48
13250
13386
  },
13251
13387
  children: connection.connecting ? /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
13252
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons27.LinkOutlined, { style: { fontSize: 64, color: "#1890ff" }, spin: true }),
13388
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons26.LinkOutlined, { style: { fontSize: 64, color: "#1890ff" }, spin: true }),
13253
13389
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Title4, { level: 4, children: "Connecting..." }),
13254
13390
  /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Text20, { type: "secondary", style: { textAlign: "center" }, children: [
13255
13391
  "Connecting to ",
13256
13392
  connection.url
13257
13393
  ] })
13258
13394
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
13259
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons27.LinkOutlined, { style: { fontSize: 64, color: "#d9d9d9" } }),
13395
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons26.LinkOutlined, { style: { fontSize: 64, color: "#d9d9d9" } }),
13260
13396
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Title4, { level: 4, type: "secondary", children: connection.error || "Not Connected" }),
13261
13397
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
13262
13398
  Text20,
@@ -13270,7 +13406,7 @@ QUEUE_NAME=tasks`,
13270
13406
  import_antd41.Button,
13271
13407
  {
13272
13408
  type: "primary",
13273
- icon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons27.LinkOutlined, {}),
13409
+ icon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons26.LinkOutlined, {}),
13274
13410
  onClick: () => checkConnection(connection.id),
13275
13411
  loading: connection.connecting,
13276
13412
  style: { marginTop: 16 },
@@ -13316,7 +13452,7 @@ QUEUE_NAME=tasks`,
13316
13452
  padding: "4px 8px"
13317
13453
  },
13318
13454
  children: [
13319
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons27.PlusOutlined, {}),
13455
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_icons26.PlusOutlined, {}),
13320
13456
  /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { children: "Add Server" })
13321
13457
  ]
13322
13458
  }
@@ -13401,11 +13537,21 @@ var AgentServerSetting = () => {
13401
13537
  // src/components/Chat/LatticeChatShell.tsx
13402
13538
  var import_jsx_runtime59 = require("react/jsx-runtime");
13403
13539
  var LatticeChatShell = (props) => {
13404
- const { initialConfig } = props;
13405
- return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(LatticeChatShellContextProvider, { ...props, children: [
13406
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(AssistantContextProvider, { autoLoad: true, initialAssistantId: initialConfig?.assistantId, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ConversationContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(LatticeChatView, {}) }) }),
13407
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(AgentServerSetting, {})
13408
- ] });
13540
+ const { enableAssistantCreation, enableAssistantEditing, ...restProps } = props;
13541
+ return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
13542
+ LatticeChatShellContextProvider,
13543
+ {
13544
+ initialConfig: {
13545
+ enableAssistantCreation,
13546
+ enableAssistantEditing,
13547
+ ...restProps.initialConfig
13548
+ },
13549
+ children: [
13550
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(AssistantContextProvider, { autoLoad: true, initialAssistantId: restProps.initialConfig?.assistantId, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ConversationContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(LatticeChatView, {}) }) }),
13551
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(AgentServerSetting, {})
13552
+ ]
13553
+ }
13554
+ );
13409
13555
  };
13410
13556
  // Annotate the CommonJS export names for ESM import in node:
13411
13557
  0 && (module.exports = {