@axiom-lattice/react-sdk 2.1.88 → 2.1.89

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
@@ -4201,12 +4201,12 @@ var FilePanelToggle = () => {
4201
4201
  };
4202
4202
 
4203
4203
  // src/components/Chat/PinToMenuButton.tsx
4204
- import React70, { useState as useState78 } from "react";
4205
- import { Button as Button56, Input as Input17, Modal as Modal21, Tooltip as Tooltip25, message as message19 } from "antd";
4204
+ import React71, { useState as useState78, useEffect as useEffect54, useCallback as useCallback40 } from "react";
4205
+ import { Button as Button56, Input as Input17, Modal as Modal21, Tooltip as Tooltip26, message as message19 } from "antd";
4206
4206
  import { Pin } from "lucide-react";
4207
4207
 
4208
4208
  // src/context/WorkspaceContext.tsx
4209
- import React69, {
4209
+ import React70, {
4210
4210
  createContext as createContext9,
4211
4211
  useContext as useContext11,
4212
4212
  useState as useState77,
@@ -4214,11 +4214,11 @@ import React69, {
4214
4214
  useEffect as useEffect53,
4215
4215
  useRef as useRef28
4216
4216
  } from "react";
4217
- import { WorkspaceClient, Client as Client2 } from "@axiom-lattice/client-sdk";
4217
+ import { WorkspaceClient, Client as Client3 } from "@axiom-lattice/client-sdk";
4218
4218
 
4219
4219
  // src/components/Chat/WorkspaceResourceManager.tsx
4220
- import { useMemo as useMemo33, useEffect as useEffect52, useRef as useRef27, useState as useState76 } from "react";
4221
- import { FolderOpen as FolderOpen3, Activity as Activity4, Database as Database6, Plug as Plug2, Bot as Bot5, Wrench, Zap as Zap2, LogOut as LogOut3, Building2 as Building23, Key, Share2, History, Inbox as Inbox3, FlaskConical as FlaskConical3 } from "lucide-react";
4220
+ import { useMemo as useMemo34, useEffect as useEffect52, useRef as useRef27, useState as useState76 } from "react";
4221
+ import { FolderOpen as FolderOpen3, Activity as Activity4, Database as Database7, Plug as Plug2, Bot as Bot5, Wrench as Wrench2, Zap as Zap2, LogOut as LogOut3, Building2 as Building23, Key, Share2, History, Inbox as Inbox3, FlaskConical as FlaskConical3 } from "lucide-react";
4222
4222
  import { Modal as Modal20, Avatar as Avatar12, Popover as Popover3, Button as Button55 } from "antd";
4223
4223
 
4224
4224
  // src/components/Chat/ColumnLayout.tsx
@@ -15336,7 +15336,7 @@ var AttachmentsCard = ({
15336
15336
  const { config } = useLatticeChatShellContext();
15337
15337
  const baseURL = config.baseURL;
15338
15338
  const fileBaseURL = `${baseURL}/api/assistants/${assistantId}/threads/${threadId}/sandbox/downloadfile?path=`;
15339
- const { Text: Text50 } = Typography21;
15339
+ const { Text: Text51 } = Typography21;
15340
15340
  const [showAll, setShowAll] = useState42(false);
15341
15341
  const openSideApp = useSideAppOpener();
15342
15342
  const getStyles = () => {
@@ -15410,7 +15410,7 @@ var AttachmentsCard = ({
15410
15410
  );
15411
15411
  };
15412
15412
  const renderFileDescription = (item) => /* @__PURE__ */ jsx43(Space16, { direction: "vertical", size: size === "small" ? 2 : 4, children: /* @__PURE__ */ jsx43(Space16, { children: /* @__PURE__ */ jsx43(
15413
- Text50,
15413
+ Text51,
15414
15414
  {
15415
15415
  type: "secondary",
15416
15416
  style: {
@@ -15484,7 +15484,7 @@ var AttachmentsCard = ({
15484
15484
  }
15485
15485
  ),
15486
15486
  item.files && /* @__PURE__ */ jsxs31("div", { style: { paddingLeft: "12px" }, children: [
15487
- /* @__PURE__ */ jsxs31(Text50, { type: "secondary", style: { fontSize: "12px" }, children: [
15487
+ /* @__PURE__ */ jsxs31(Text51, { type: "secondary", style: { fontSize: "12px" }, children: [
15488
15488
  "Contains ",
15489
15489
  item.files.length,
15490
15490
  " file(s)"
@@ -26540,6 +26540,7 @@ function parseAgent(raw) {
26540
26540
  id: nid(label),
26541
26541
  type: "agent",
26542
26542
  name: label,
26543
+ ref: typeof config.ref === "string" ? config.ref : label,
26543
26544
  input: { template: String(config.prompt ?? "") },
26544
26545
  output: { key: label, schema: toSchema(config.output) },
26545
26546
  ask: config.ask === true,
@@ -28521,12 +28522,12 @@ var TopologyInboxView = () => {
28521
28522
  };
28522
28523
 
28523
28524
  // src/components/Chat/WorkflowAutomationView.tsx
28524
- import { useEffect as useEffect48, useState as useState70, useCallback as useCallback37, useMemo as useMemo29, useRef as useRef25 } from "react";
28525
+ import { useEffect as useEffect48, useState as useState70, useCallback as useCallback37, useMemo as useMemo30, useRef as useRef25 } from "react";
28525
28526
  import {
28526
28527
  ReactFlowProvider as ReactFlowProvider6
28527
28528
  } from "@xyflow/react";
28528
28529
  import "@xyflow/react/dist/style.css";
28529
- import { Spin as Spin18, Empty as Empty16, Card as Card24, Typography as Typography53, Button as Button50, Input as Input14, Modal as Modal17, Popconfirm as Popconfirm6 } from "antd";
28530
+ import { Spin as Spin18, Empty as Empty16, Card as Card24, Typography as Typography54, Button as Button50, Input as Input14, Modal as Modal17, Popconfirm as Popconfirm6 } from "antd";
28530
28531
  import {
28531
28532
  PlusOutlined as PlusOutlined8,
28532
28533
  DeleteOutlined as DeleteOutlined4,
@@ -28770,12 +28771,455 @@ steps: []
28770
28771
  );
28771
28772
  };
28772
28773
 
28773
- // src/components/Chat/WorkflowAutomationView.tsx
28774
- import { Fragment as Fragment22, jsx as jsx111, jsxs as jsxs79 } from "react/jsx-runtime";
28774
+ // src/components/Chat/EnvironmentCard.tsx
28775
+ import { useMemo as useMemo29 } from "react";
28776
+ import {
28777
+ Wrench,
28778
+ Folders,
28779
+ Terminal as Terminal2,
28780
+ Globe as Globe3,
28781
+ Database as Database6,
28782
+ Sparkles as Sparkles2,
28783
+ Link as Link2,
28784
+ Clock as Clock4,
28785
+ GitBranch,
28786
+ MessageSquare as MessageSquare2,
28787
+ Puzzle as Puzzle2,
28788
+ Bell,
28789
+ CalendarCheck,
28790
+ Boxes,
28791
+ Settings as Settings3,
28792
+ Users as Users2
28793
+ } from "lucide-react";
28794
+ import { Typography as Typography53, Tooltip as Tooltip24 } from "antd";
28795
+ import { jsx as jsx111, jsxs as jsxs79 } from "react/jsx-runtime";
28775
28796
  var { Text: Text42 } = Typography53;
28776
- function extractDSL(graphDef) {
28797
+ function parseConfig(graphDef) {
28777
28798
  if (!graphDef || typeof graphDef !== "object") return null;
28778
28799
  const def = graphDef;
28800
+ return {
28801
+ modelKey: def.modelKey || def.model || void 0,
28802
+ tools: Array.isArray(def.tools) ? def.tools : [],
28803
+ middleware: Array.isArray(def.middleware) ? def.middleware.filter(
28804
+ (m) => m && typeof m === "object" && m.type
28805
+ ) : [],
28806
+ subAgents: Array.isArray(def.subAgents) ? def.subAgents : [],
28807
+ skillCategories: Array.isArray(def.skillCategories) ? def.skillCategories : [],
28808
+ runConfig: def.runConfig && typeof def.runConfig === "object" ? def.runConfig : void 0
28809
+ };
28810
+ }
28811
+ var MIDDLEWARE_ICONS = {
28812
+ filesystem: /* @__PURE__ */ jsx111(Folders, { size: 12 }),
28813
+ code_eval: /* @__PURE__ */ jsx111(Terminal2, { size: 12 }),
28814
+ browser: /* @__PURE__ */ jsx111(Globe3, { size: 12 }),
28815
+ sql: /* @__PURE__ */ jsx111(Database6, { size: 12 }),
28816
+ skill: /* @__PURE__ */ jsx111(Sparkles2, { size: 12 }),
28817
+ http: /* @__PURE__ */ jsx111(Link2, { size: 12 }),
28818
+ scheduler: /* @__PURE__ */ jsx111(Clock4, { size: 12 }),
28819
+ metrics: /* @__PURE__ */ jsx111(Bell, { size: 12 }),
28820
+ topology: /* @__PURE__ */ jsx111(GitBranch, { size: 12 }),
28821
+ ask_user_to_clarify: /* @__PURE__ */ jsx111(MessageSquare2, { size: 12 }),
28822
+ widget: /* @__PURE__ */ jsx111(Boxes, { size: 12 }),
28823
+ date: /* @__PURE__ */ jsx111(CalendarCheck, { size: 12 }),
28824
+ task: /* @__PURE__ */ jsx111(GitBranch, { size: 12 }),
28825
+ custom: /* @__PURE__ */ jsx111(Puzzle2, { size: 12 }),
28826
+ claw: /* @__PURE__ */ jsx111(Settings3, { size: 12 })
28827
+ };
28828
+ var MIDDLEWARE_COLORS = {
28829
+ filesystem: { bg: "rgba(34,197,94,0.08)", text: "#16a34a", border: "rgba(34,197,94,0.2)" },
28830
+ code_eval: { bg: "rgba(99,102,241,0.08)", text: "#4f46e5", border: "rgba(99,102,241,0.2)" },
28831
+ browser: { bg: "rgba(59,130,246,0.08)", text: "#2563eb", border: "rgba(59,130,246,0.2)" },
28832
+ sql: { bg: "rgba(249,115,22,0.08)", text: "#ea580c", border: "rgba(249,115,22,0.2)" },
28833
+ skill: { bg: "rgba(168,85,247,0.08)", text: "#9333ea", border: "rgba(168,85,247,0.2)" },
28834
+ http: { bg: "rgba(20,184,166,0.08)", text: "#0d9488", border: "rgba(20,184,166,0.2)" },
28835
+ scheduler: { bg: "rgba(245,158,11,0.08)", text: "#d97706", border: "rgba(245,158,11,0.2)" },
28836
+ metrics: { bg: "rgba(236,72,153,0.08)", text: "#db2777", border: "rgba(236,72,153,0.2)" },
28837
+ topology: { bg: "rgba(99,102,241,0.08)", text: "#4f46e5", border: "rgba(99,102,241,0.2)" },
28838
+ ask_user_to_clarify: { bg: "rgba(245,158,11,0.08)", text: "#d97706", border: "rgba(245,158,11,0.2)" },
28839
+ widget: { bg: "rgba(20,184,166,0.08)", text: "#0d9488", border: "rgba(20,184,166,0.2)" },
28840
+ date: { bg: "rgba(139,92,246,0.08)", text: "#7c3aed", border: "rgba(139,92,246,0.2)" },
28841
+ task: { bg: "rgba(99,102,241,0.08)", text: "#4f46e5", border: "rgba(99,102,241,0.2)" },
28842
+ custom: { bg: "rgba(107,114,128,0.08)", text: "#4b5563", border: "rgba(107,114,128,0.2)" },
28843
+ claw: { bg: "rgba(107,114,128,0.08)", text: "#4b5563", border: "rgba(107,114,128,0.2)" }
28844
+ };
28845
+ var DEFAULT_MW_COLOR = { bg: "rgba(107,114,128,0.08)", text: "#4b5563", border: "rgba(107,114,128,0.2)" };
28846
+ function getToolAcronym(name) {
28847
+ const parts = name.split(/[_\-]+/).filter(Boolean);
28848
+ if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();
28849
+ return parts.map((p) => p[0]).join("").toUpperCase().slice(0, 2);
28850
+ }
28851
+ var TOOL_COLORS = [
28852
+ { bg: "rgba(99,102,241,0.1)", text: "#6366f1" },
28853
+ { bg: "rgba(34,197,94,0.1)", text: "#22c55e" },
28854
+ { bg: "rgba(245,158,11,0.1)", text: "#f59e0b" },
28855
+ { bg: "rgba(59,130,246,0.1)", text: "#3b82f6" },
28856
+ { bg: "rgba(239,68,68,0.1)", text: "#ef4444" },
28857
+ { bg: "rgba(168,85,247,0.1)", text: "#a855f7" },
28858
+ { bg: "rgba(20,184,166,0.1)", text: "#14b8a6" },
28859
+ { bg: "rgba(236,72,153,0.1)", text: "#ec4899" }
28860
+ ];
28861
+ function getToolColor(index) {
28862
+ return TOOL_COLORS[index % TOOL_COLORS.length];
28863
+ }
28864
+ var Section = ({ icon, label, count, children }) => {
28865
+ return /* @__PURE__ */ jsxs79("div", { style: { marginBottom: 10 }, children: [
28866
+ /* @__PURE__ */ jsxs79(
28867
+ "div",
28868
+ {
28869
+ style: {
28870
+ display: "flex",
28871
+ alignItems: "center",
28872
+ gap: 6,
28873
+ marginBottom: 6
28874
+ },
28875
+ children: [
28876
+ /* @__PURE__ */ jsx111("span", { style: { color: "#6366f1", display: "flex", alignItems: "center" }, children: icon }),
28877
+ /* @__PURE__ */ jsx111(
28878
+ Text42,
28879
+ {
28880
+ strong: true,
28881
+ style: {
28882
+ fontSize: 11,
28883
+ color: "#52525b",
28884
+ textTransform: "uppercase",
28885
+ letterSpacing: "0.3px"
28886
+ },
28887
+ children: label
28888
+ }
28889
+ ),
28890
+ /* @__PURE__ */ jsx111(
28891
+ "span",
28892
+ {
28893
+ style: {
28894
+ fontSize: 9,
28895
+ fontWeight: 600,
28896
+ color: "#a1a1aa",
28897
+ background: "rgba(0,0,0,0.04)",
28898
+ borderRadius: 8,
28899
+ padding: "1px 6px",
28900
+ lineHeight: "16px"
28901
+ },
28902
+ children: count
28903
+ }
28904
+ )
28905
+ ]
28906
+ }
28907
+ ),
28908
+ children
28909
+ ] });
28910
+ };
28911
+ var EnvironmentCard = ({ graphDef }) => {
28912
+ const config = useMemo29(() => parseConfig(graphDef), [graphDef]);
28913
+ if (!config) return null;
28914
+ const enabledMiddleware = config.middleware.filter((m) => m.enabled !== false);
28915
+ const hasChannels = false;
28916
+ if (config.tools.length === 0 && enabledMiddleware.length === 0 && config.subAgents.length === 0) {
28917
+ return null;
28918
+ }
28919
+ return /* @__PURE__ */ jsx111("div", { style: { pointerEvents: "auto" }, children: /* @__PURE__ */ jsxs79(
28920
+ "div",
28921
+ {
28922
+ style: {
28923
+ background: "rgba(255,255,255,0.5)",
28924
+ borderRadius: 8,
28925
+ width: 250,
28926
+ transition: "all 0.25s ease",
28927
+ overflow: "hidden"
28928
+ },
28929
+ children: [
28930
+ /* @__PURE__ */ jsx111(
28931
+ "div",
28932
+ {
28933
+ style: {
28934
+ display: "flex",
28935
+ alignItems: "center",
28936
+ gap: 8,
28937
+ padding: "8px 12px",
28938
+ background: "rgba(99,102,241,0.02)",
28939
+ borderBottom: "1px solid rgba(0,0,0,0.03)"
28940
+ },
28941
+ children: /* @__PURE__ */ jsxs79("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
28942
+ /* @__PURE__ */ jsx111(
28943
+ "div",
28944
+ {
28945
+ style: {
28946
+ width: 24,
28947
+ height: 24,
28948
+ borderRadius: 6,
28949
+ background: "rgba(99,102,241,0.05)",
28950
+ display: "flex",
28951
+ alignItems: "center",
28952
+ justifyContent: "center",
28953
+ color: "#6366f1"
28954
+ },
28955
+ children: /* @__PURE__ */ jsx111(Settings3, { size: 13 })
28956
+ }
28957
+ ),
28958
+ /* @__PURE__ */ jsx111(Text42, { strong: true, style: { fontSize: 12, color: "#1a1a1a" }, children: "Environment" })
28959
+ ] })
28960
+ }
28961
+ ),
28962
+ /* @__PURE__ */ jsxs79(
28963
+ "div",
28964
+ {
28965
+ style: {
28966
+ padding: "10px 12px 12px",
28967
+ maxHeight: "calc(60vh - 48px)",
28968
+ overflowY: "auto"
28969
+ },
28970
+ children: [
28971
+ config.tools.length > 0 && /* @__PURE__ */ jsx111(
28972
+ Section,
28973
+ {
28974
+ icon: /* @__PURE__ */ jsx111(Wrench, { size: 12 }),
28975
+ label: "Tools",
28976
+ count: config.tools.length,
28977
+ children: /* @__PURE__ */ jsx111("div", { style: { display: "flex", flexWrap: "wrap", gap: 4 }, children: config.tools.map((tool, i) => {
28978
+ const c = getToolColor(i);
28979
+ return /* @__PURE__ */ jsx111(Tooltip24, { title: tool, placement: "top", children: /* @__PURE__ */ jsxs79(
28980
+ "div",
28981
+ {
28982
+ style: {
28983
+ display: "flex",
28984
+ alignItems: "center",
28985
+ gap: 4,
28986
+ padding: "3px 8px",
28987
+ borderRadius: 6,
28988
+ fontSize: 10,
28989
+ fontWeight: 500,
28990
+ color: c.text,
28991
+ background: c.bg,
28992
+ cursor: "default",
28993
+ whiteSpace: "nowrap",
28994
+ lineHeight: "16px"
28995
+ },
28996
+ children: [
28997
+ /* @__PURE__ */ jsx111(
28998
+ "span",
28999
+ {
29000
+ style: {
29001
+ fontWeight: 700,
29002
+ fontSize: 9,
29003
+ opacity: 0.7
29004
+ },
29005
+ children: getToolAcronym(tool)
29006
+ }
29007
+ ),
29008
+ /* @__PURE__ */ jsx111("span", { children: tool })
29009
+ ]
29010
+ }
29011
+ ) }, tool);
29012
+ }) })
29013
+ }
29014
+ ),
29015
+ enabledMiddleware.length > 0 && /* @__PURE__ */ jsx111(
29016
+ Section,
29017
+ {
29018
+ icon: /* @__PURE__ */ jsx111(Boxes, { size: 12 }),
29019
+ label: "Capabilities",
29020
+ count: enabledMiddleware.length,
29021
+ children: /* @__PURE__ */ jsx111("div", { style: { display: "flex", flexWrap: "wrap", gap: 4 }, children: enabledMiddleware.map((mw) => {
29022
+ const colors3 = MIDDLEWARE_COLORS[mw.type] || DEFAULT_MW_COLOR;
29023
+ const icon = MIDDLEWARE_ICONS[mw.type] || /* @__PURE__ */ jsx111(Settings3, { size: 12 });
29024
+ return /* @__PURE__ */ jsx111(
29025
+ Tooltip24,
29026
+ {
29027
+ title: mw.name || mw.type,
29028
+ placement: "top",
29029
+ children: /* @__PURE__ */ jsxs79(
29030
+ "div",
29031
+ {
29032
+ style: {
29033
+ display: "flex",
29034
+ alignItems: "center",
29035
+ gap: 4,
29036
+ padding: "3px 8px",
29037
+ borderRadius: 6,
29038
+ fontSize: 10,
29039
+ fontWeight: 500,
29040
+ color: colors3.text,
29041
+ background: colors3.bg,
29042
+ border: `1px solid ${colors3.border}`,
29043
+ cursor: "default",
29044
+ whiteSpace: "nowrap",
29045
+ lineHeight: "16px"
29046
+ },
29047
+ children: [
29048
+ icon,
29049
+ /* @__PURE__ */ jsx111("span", { children: mw.name || mw.type })
29050
+ ]
29051
+ }
29052
+ )
29053
+ },
29054
+ mw.type
29055
+ );
29056
+ }) })
29057
+ }
29058
+ ),
29059
+ config.subAgents.length > 0 && /* @__PURE__ */ jsx111(
29060
+ Section,
29061
+ {
29062
+ icon: /* @__PURE__ */ jsx111(Users2, { size: 12 }),
29063
+ label: "Sub-agents",
29064
+ count: config.subAgents.length,
29065
+ children: /* @__PURE__ */ jsx111("div", { style: { display: "flex", flexWrap: "wrap", gap: 4 }, children: config.subAgents.map((sa, i) => {
29066
+ const c = getToolColor(i + 3);
29067
+ return /* @__PURE__ */ jsx111(Tooltip24, { title: sa, placement: "top", children: /* @__PURE__ */ jsxs79(
29068
+ "div",
29069
+ {
29070
+ style: {
29071
+ display: "flex",
29072
+ alignItems: "center",
29073
+ gap: 4,
29074
+ padding: "3px 8px",
29075
+ borderRadius: 6,
29076
+ fontSize: 10,
29077
+ fontWeight: 500,
29078
+ color: c.text,
29079
+ background: c.bg,
29080
+ cursor: "default",
29081
+ whiteSpace: "nowrap",
29082
+ lineHeight: "16px"
29083
+ },
29084
+ children: [
29085
+ /* @__PURE__ */ jsx111(Users2, { size: 10 }),
29086
+ /* @__PURE__ */ jsx111("span", { children: sa })
29087
+ ]
29088
+ }
29089
+ ) }, sa);
29090
+ }) })
29091
+ }
29092
+ ),
29093
+ (config.modelKey || config.runConfig) && /* @__PURE__ */ jsx111(
29094
+ Section,
29095
+ {
29096
+ icon: /* @__PURE__ */ jsx111(Clock4, { size: 12 }),
29097
+ label: "Runtime",
29098
+ count: config.modelKey ? 1 : 0,
29099
+ children: /* @__PURE__ */ jsxs79("div", { style: { display: "flex", flexWrap: "wrap", gap: 4 }, children: [
29100
+ config.modelKey && /* @__PURE__ */ jsxs79(
29101
+ "div",
29102
+ {
29103
+ style: {
29104
+ display: "flex",
29105
+ alignItems: "center",
29106
+ gap: 4,
29107
+ padding: "3px 8px",
29108
+ borderRadius: 6,
29109
+ fontSize: 10,
29110
+ fontWeight: 500,
29111
+ color: "#4f46e5",
29112
+ background: "rgba(99,102,241,0.08)",
29113
+ border: "1px solid rgba(99,102,241,0.2)",
29114
+ cursor: "default",
29115
+ whiteSpace: "nowrap",
29116
+ lineHeight: "16px"
29117
+ },
29118
+ children: [
29119
+ /* @__PURE__ */ jsx111(Settings3, { size: 10 }),
29120
+ /* @__PURE__ */ jsxs79("span", { children: [
29121
+ "Model: ",
29122
+ config.modelKey
29123
+ ] })
29124
+ ]
29125
+ }
29126
+ ),
29127
+ Boolean(config.runConfig?.databaseKey) && /* @__PURE__ */ jsxs79(
29128
+ "div",
29129
+ {
29130
+ style: {
29131
+ display: "flex",
29132
+ alignItems: "center",
29133
+ gap: 4,
29134
+ padding: "3px 8px",
29135
+ borderRadius: 6,
29136
+ fontSize: 10,
29137
+ fontWeight: 500,
29138
+ color: "#ea580c",
29139
+ background: "rgba(249,115,22,0.08)",
29140
+ border: "1px solid rgba(249,115,22,0.2)",
29141
+ cursor: "default",
29142
+ whiteSpace: "nowrap",
29143
+ lineHeight: "16px"
29144
+ },
29145
+ children: [
29146
+ /* @__PURE__ */ jsx111(Database6, { size: 10 }),
29147
+ /* @__PURE__ */ jsxs79("span", { children: [
29148
+ "DB: ",
29149
+ String(config.runConfig?.databaseKey)
29150
+ ] })
29151
+ ]
29152
+ }
29153
+ ),
29154
+ config.skillCategories && config.skillCategories.length > 0 && /* @__PURE__ */ jsxs79(
29155
+ "div",
29156
+ {
29157
+ style: {
29158
+ display: "flex",
29159
+ alignItems: "center",
29160
+ gap: 4,
29161
+ padding: "3px 8px",
29162
+ borderRadius: 6,
29163
+ fontSize: 10,
29164
+ fontWeight: 500,
29165
+ color: "#9333ea",
29166
+ background: "rgba(168,85,247,0.08)",
29167
+ border: "1px solid rgba(168,85,247,0.2)",
29168
+ cursor: "default",
29169
+ whiteSpace: "nowrap",
29170
+ lineHeight: "16px"
29171
+ },
29172
+ children: [
29173
+ /* @__PURE__ */ jsx111(Sparkles2, { size: 10 }),
29174
+ /* @__PURE__ */ jsxs79("span", { children: [
29175
+ "Skills: ",
29176
+ config.skillCategories.join(", ")
29177
+ ] })
29178
+ ]
29179
+ }
29180
+ )
29181
+ ] })
29182
+ }
29183
+ ),
29184
+ hasChannels && /* @__PURE__ */ jsx111(
29185
+ Section,
29186
+ {
29187
+ icon: /* @__PURE__ */ jsx111(Globe3, { size: 12 }),
29188
+ label: "Channels",
29189
+ count: 0,
29190
+ children: /* @__PURE__ */ jsx111(
29191
+ Text42,
29192
+ {
29193
+ type: "secondary",
29194
+ style: { fontSize: 10, fontStyle: "italic" },
29195
+ children: "No channels configured"
29196
+ }
29197
+ )
29198
+ }
29199
+ )
29200
+ ]
29201
+ }
29202
+ )
29203
+ ]
29204
+ }
29205
+ ) });
29206
+ };
29207
+
29208
+ // src/components/Chat/WorkflowAutomationView.tsx
29209
+ import { Fragment as Fragment22, jsx as jsx112, jsxs as jsxs80 } from "react/jsx-runtime";
29210
+ var { Text: Text43 } = Typography54;
29211
+ function extractDSL(graphDef) {
29212
+ let def = null;
29213
+ if (typeof graphDef === "string") {
29214
+ try {
29215
+ def = JSON.parse(graphDef);
29216
+ } catch {
29217
+ return null;
29218
+ }
29219
+ } else if (graphDef && typeof graphDef === "object") {
29220
+ def = graphDef;
29221
+ }
29222
+ if (!def) return null;
28779
29223
  if (def.type !== "workflow") {
28780
29224
  console.warn("[extractDSL] type is not 'workflow':", def.type);
28781
29225
  return null;
@@ -28798,12 +29242,13 @@ function WorkflowFlowInner({
28798
29242
  onCreate,
28799
29243
  onDelete,
28800
29244
  dsl,
28801
- onSpecClick
29245
+ onSpecClick,
29246
+ environmentConfig
28802
29247
  }) {
28803
29248
  const selected = workflows.find((w) => w.id === selectedId);
28804
29249
  const [listOpen, setListOpen] = useState70(true);
28805
29250
  const [search, setSearch] = useState70("");
28806
- const filtered = useMemo29(() => {
29251
+ const filtered = useMemo30(() => {
28807
29252
  const q = search.trim().toLowerCase();
28808
29253
  if (!q) return workflows;
28809
29254
  return workflows.filter(
@@ -28822,19 +29267,19 @@ function WorkflowFlowInner({
28822
29267
  onSelect(id);
28823
29268
  setListOpen(false);
28824
29269
  };
28825
- return /* @__PURE__ */ jsx111("div", { style: { display: "flex", height: "100%", width: "100%" }, children: /* @__PURE__ */ jsxs79("div", { style: { flex: 1, position: "relative" }, children: [
28826
- selected ? /* @__PURE__ */ jsxs79(Fragment22, { children: [
28827
- dsl ? /* @__PURE__ */ jsx111(WorkflowCanvas_default, { dsl }) : /* @__PURE__ */ jsx111("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%" }, children: /* @__PURE__ */ jsx111(Spin18, { tip: "Loading workflow DSL..." }) }),
28828
- !listOpen && /* @__PURE__ */ jsx111("div", { style: {
29270
+ return /* @__PURE__ */ jsx112("div", { style: { display: "flex", height: "100%", width: "100%" }, children: /* @__PURE__ */ jsxs80("div", { style: { flex: 1, position: "relative" }, children: [
29271
+ selected ? /* @__PURE__ */ jsxs80(Fragment22, { children: [
29272
+ dsl ? /* @__PURE__ */ jsx112(WorkflowCanvas_default, { dsl }) : /* @__PURE__ */ jsx112("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%" }, children: /* @__PURE__ */ jsx112(Spin18, { tip: "Loading workflow DSL..." }) }),
29273
+ !listOpen && /* @__PURE__ */ jsx112("div", { style: {
28829
29274
  position: "absolute",
28830
29275
  top: 12,
28831
29276
  left: 12,
28832
29277
  zIndex: 10
28833
- }, children: /* @__PURE__ */ jsx111(
29278
+ }, children: /* @__PURE__ */ jsx112(
28834
29279
  Button50,
28835
29280
  {
28836
29281
  type: "default",
28837
- icon: /* @__PURE__ */ jsx111(MenuOutlined, {}),
29282
+ icon: /* @__PURE__ */ jsx112(MenuOutlined, {}),
28838
29283
  onClick: () => setListOpen(true),
28839
29284
  style: {
28840
29285
  width: 32,
@@ -28850,7 +29295,7 @@ function WorkflowFlowInner({
28850
29295
  }
28851
29296
  }
28852
29297
  ) }),
28853
- /* @__PURE__ */ jsxs79("div", { style: {
29298
+ /* @__PURE__ */ jsxs80("div", { style: {
28854
29299
  position: "absolute",
28855
29300
  top: 12,
28856
29301
  left: !listOpen ? 56 : 12,
@@ -28865,9 +29310,9 @@ function WorkflowFlowInner({
28865
29310
  boxShadow: "0 2px 12px rgba(0,0,0,0.08)",
28866
29311
  border: "1px solid #f0f0f0"
28867
29312
  }, children: [
28868
- /* @__PURE__ */ jsx111(Workflow2, { size: 16, color: "#6366f1" }),
28869
- /* @__PURE__ */ jsx111(Text42, { strong: true, style: { fontSize: 13 }, children: selected.name }),
28870
- /* @__PURE__ */ jsx111(
29313
+ /* @__PURE__ */ jsx112(Workflow2, { size: 16, color: "#6366f1" }),
29314
+ /* @__PURE__ */ jsx112(Text43, { strong: true, style: { fontSize: 13 }, children: selected.name }),
29315
+ /* @__PURE__ */ jsx112(
28871
29316
  InfoCircleOutlined6,
28872
29317
  {
28873
29318
  style: { color: "#6366f1", cursor: "pointer", fontSize: 15 },
@@ -28875,7 +29320,7 @@ function WorkflowFlowInner({
28875
29320
  }
28876
29321
  )
28877
29322
  ] }),
28878
- /* @__PURE__ */ jsx111("div", { style: {
29323
+ /* @__PURE__ */ jsx112("div", { style: {
28879
29324
  position: "absolute",
28880
29325
  top: 12,
28881
29326
  right: 12,
@@ -28888,7 +29333,7 @@ function WorkflowFlowInner({
28888
29333
  borderRadius: 10,
28889
29334
  boxShadow: "0 2px 12px rgba(0,0,0,0.08)",
28890
29335
  border: "1px solid #f0f0f0"
28891
- }, children: /* @__PURE__ */ jsx111(
29336
+ }, children: /* @__PURE__ */ jsx112(
28892
29337
  Popconfirm6,
28893
29338
  {
28894
29339
  title: "Delete workflow",
@@ -28897,12 +29342,24 @@ function WorkflowFlowInner({
28897
29342
  okText: "Delete",
28898
29343
  cancelText: "Cancel",
28899
29344
  okButtonProps: { danger: true },
28900
- children: /* @__PURE__ */ jsx111(DeleteOutlined4, { style: { color: "#ff4d4f", cursor: "pointer", fontSize: 15 } })
29345
+ children: /* @__PURE__ */ jsx112(DeleteOutlined4, { style: { color: "#ff4d4f", cursor: "pointer", fontSize: 15 } })
28901
29346
  }
28902
- ) })
28903
- ] }) : /* @__PURE__ */ jsx111("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%" }, children: /* @__PURE__ */ jsx111(Empty16, { description: "Select a workflow to view its graph" }) }),
28904
- listOpen && /* @__PURE__ */ jsxs79(Fragment22, { children: [
28905
- selectedId && /* @__PURE__ */ jsx111(
29347
+ ) }),
29348
+ !listOpen && /* @__PURE__ */ jsx112(
29349
+ "div",
29350
+ {
29351
+ style: {
29352
+ position: "absolute",
29353
+ top: 52,
29354
+ left: !listOpen ? 56 : 12,
29355
+ zIndex: 20
29356
+ },
29357
+ children: /* @__PURE__ */ jsx112(EnvironmentCard, { graphDef: environmentConfig }, selected.id)
29358
+ }
29359
+ )
29360
+ ] }) : /* @__PURE__ */ jsx112("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%" }, children: /* @__PURE__ */ jsx112(Empty16, { description: "Select a workflow to view its graph" }) }),
29361
+ listOpen && /* @__PURE__ */ jsxs80(Fragment22, { children: [
29362
+ selectedId && /* @__PURE__ */ jsx112(
28906
29363
  "div",
28907
29364
  {
28908
29365
  onClick: () => setListOpen(false),
@@ -28914,17 +29371,17 @@ function WorkflowFlowInner({
28914
29371
  }
28915
29372
  }
28916
29373
  ),
28917
- /* @__PURE__ */ jsxs79(
29374
+ /* @__PURE__ */ jsxs80(
28918
29375
  Card24,
28919
29376
  {
28920
29377
  size: "small",
28921
- title: /* @__PURE__ */ jsx111(Text42, { strong: true, style: { fontSize: 15, color: "#1a1a1a" }, children: "Workflows" }),
28922
- extra: /* @__PURE__ */ jsx111(
29378
+ title: /* @__PURE__ */ jsx112(Text43, { strong: true, style: { fontSize: 15, color: "#1a1a1a" }, children: "Workflows" }),
29379
+ extra: /* @__PURE__ */ jsx112(
28923
29380
  Button50,
28924
29381
  {
28925
29382
  type: "text",
28926
29383
  size: "small",
28927
- icon: /* @__PURE__ */ jsx111(PlusOutlined8, {}),
29384
+ icon: /* @__PURE__ */ jsx112(PlusOutlined8, {}),
28928
29385
  onClick: onCreate,
28929
29386
  style: { color: "#6366f1" }
28930
29387
  }
@@ -28947,10 +29404,10 @@ function WorkflowFlowInner({
28947
29404
  background: "rgba(255, 255, 255, 0.92)"
28948
29405
  },
28949
29406
  children: [
28950
- /* @__PURE__ */ jsx111("div", { style: { marginBottom: 12 }, children: /* @__PURE__ */ jsx111(
29407
+ /* @__PURE__ */ jsx112("div", { style: { marginBottom: 12 }, children: /* @__PURE__ */ jsx112(
28951
29408
  Input14,
28952
29409
  {
28953
- prefix: /* @__PURE__ */ jsx111(SearchOutlined2, { style: { color: "#bbb" } }),
29410
+ prefix: /* @__PURE__ */ jsx112(SearchOutlined2, { style: { color: "#bbb" } }),
28954
29411
  placeholder: "Filter workflows...",
28955
29412
  value: search,
28956
29413
  onChange: (e) => setSearch(e.target.value),
@@ -28962,7 +29419,7 @@ function WorkflowFlowInner({
28962
29419
  }
28963
29420
  }
28964
29421
  ) }),
28965
- filtered.length === 0 ? /* @__PURE__ */ jsxs79("div", { style: {
29422
+ filtered.length === 0 ? /* @__PURE__ */ jsxs80("div", { style: {
28966
29423
  display: "flex",
28967
29424
  flexDirection: "column",
28968
29425
  alignItems: "center",
@@ -28970,11 +29427,11 @@ function WorkflowFlowInner({
28970
29427
  padding: "32px 16px",
28971
29428
  color: "#bbb"
28972
29429
  }, children: [
28973
- /* @__PURE__ */ jsx111(Workflow2, { size: 28, style: { marginBottom: 10, opacity: 0.4 } }),
28974
- /* @__PURE__ */ jsx111(Text42, { type: "secondary", style: { fontSize: 13 }, children: search.trim() ? "No workflows match your search" : "No workflows yet" })
29430
+ /* @__PURE__ */ jsx112(Workflow2, { size: 28, style: { marginBottom: 10, opacity: 0.4 } }),
29431
+ /* @__PURE__ */ jsx112(Text43, { type: "secondary", style: { fontSize: 13 }, children: search.trim() ? "No workflows match your search" : "No workflows yet" })
28975
29432
  ] }) : filtered.map((w) => {
28976
29433
  const isSelected = selectedId === w.id;
28977
- return /* @__PURE__ */ jsxs79(
29434
+ return /* @__PURE__ */ jsxs80(
28978
29435
  "div",
28979
29436
  {
28980
29437
  onClick: () => handleSelect(w.id),
@@ -29007,7 +29464,7 @@ function WorkflowFlowInner({
29007
29464
  }
29008
29465
  },
29009
29466
  children: [
29010
- /* @__PURE__ */ jsx111("div", { style: {
29467
+ /* @__PURE__ */ jsx112("div", { style: {
29011
29468
  display: "flex",
29012
29469
  alignItems: "center",
29013
29470
  justifyContent: "center",
@@ -29017,10 +29474,10 @@ function WorkflowFlowInner({
29017
29474
  background: isSelected ? "rgba(99, 102, 241, 0.12)" : "rgba(0, 0, 0, 0.04)",
29018
29475
  flexShrink: 0,
29019
29476
  transition: "background 0.2s ease"
29020
- }, children: /* @__PURE__ */ jsx111(Workflow2, { size: 18, color: isSelected ? "#6366f1" : "#888" }) }),
29021
- /* @__PURE__ */ jsxs79("div", { style: { flex: 1, minWidth: 0 }, children: [
29022
- /* @__PURE__ */ jsx111(
29023
- Text42,
29477
+ }, children: /* @__PURE__ */ jsx112(Workflow2, { size: 18, color: isSelected ? "#6366f1" : "#888" }) }),
29478
+ /* @__PURE__ */ jsxs80("div", { style: { flex: 1, minWidth: 0 }, children: [
29479
+ /* @__PURE__ */ jsx112(
29480
+ Text43,
29024
29481
  {
29025
29482
  strong: true,
29026
29483
  ellipsis: { tooltip: w.name },
@@ -29032,7 +29489,7 @@ function WorkflowFlowInner({
29032
29489
  children: w.name
29033
29490
  }
29034
29491
  ),
29035
- w.description && /* @__PURE__ */ jsx111("div", { style: {
29492
+ w.description && /* @__PURE__ */ jsx112("div", { style: {
29036
29493
  fontSize: 12,
29037
29494
  color: "#999",
29038
29495
  whiteSpace: "nowrap",
@@ -29058,6 +29515,29 @@ var WorkflowAutomationView = () => {
29058
29515
  const [workflows, setWorkflows] = useState70([]);
29059
29516
  const [selectedId, setSelectedId] = useState70(null);
29060
29517
  const [dsl, setDsl] = useState70(null);
29518
+ const [graphDef, setGraphDef] = useState70(null);
29519
+ const [agentConfigs, setAgentConfigs] = useState70([]);
29520
+ const fetchAllAssistants = useCallback37(async () => {
29521
+ try {
29522
+ const res = await get("/api/assistants");
29523
+ if (res.success && res.data?.records) {
29524
+ const cfgs = [];
29525
+ for (const a of res.data.records) {
29526
+ if (!a.graphDefinition) continue;
29527
+ if (typeof a.graphDefinition === "string") {
29528
+ try {
29529
+ cfgs.push(JSON.parse(a.graphDefinition));
29530
+ } catch {
29531
+ }
29532
+ } else if (typeof a.graphDefinition === "object") {
29533
+ cfgs.push(a.graphDefinition);
29534
+ }
29535
+ }
29536
+ setAgentConfigs(cfgs);
29537
+ }
29538
+ } catch {
29539
+ }
29540
+ }, [get]);
29061
29541
  const [copilotOpen, setCopilotOpen] = useState70(true);
29062
29542
  const [copilotWidth, setCopilotWidth] = useState70(420);
29063
29543
  const resizingRef = useRef25(null);
@@ -29066,7 +29546,7 @@ var WorkflowAutomationView = () => {
29066
29546
  const [specModalOpen, setSpecModalOpen] = useState70(false);
29067
29547
  const [createModalOpen, setCreateModalOpen] = useState70(false);
29068
29548
  const [initialMessage, setInitialMessage] = useState70(null);
29069
- const workflowTools = useMemo29(
29549
+ const workflowTools = useMemo30(
29070
29550
  () => ["create_workflow", "update_workflow", "validate_workflow", "create_agent", "update_agent", "delete_agent"],
29071
29551
  []
29072
29552
  );
@@ -29101,11 +29581,26 @@ var WorkflowAutomationView = () => {
29101
29581
  try {
29102
29582
  const res = await get(`/api/assistants/${id}`);
29103
29583
  if (res.success && res.data) {
29104
- const wf = extractDSL(res.data.graphDefinition);
29584
+ const raw = res.data.graphDefinition;
29585
+ const wf = extractDSL(raw);
29105
29586
  setDsl(wf);
29587
+ if (!raw) {
29588
+ setGraphDef(null);
29589
+ } else if (typeof raw === "string") {
29590
+ try {
29591
+ setGraphDef(JSON.parse(raw));
29592
+ } catch {
29593
+ setGraphDef(null);
29594
+ }
29595
+ } else if (typeof raw === "object") {
29596
+ setGraphDef(raw);
29597
+ } else {
29598
+ setGraphDef(null);
29599
+ }
29106
29600
  }
29107
29601
  } catch {
29108
29602
  setDsl(null);
29603
+ setGraphDef(null);
29109
29604
  }
29110
29605
  }, [get]);
29111
29606
  useEffect48(() => {
@@ -29113,6 +29608,7 @@ var WorkflowAutomationView = () => {
29113
29608
  const load2 = async () => {
29114
29609
  try {
29115
29610
  await fetchWorkflows();
29611
+ await fetchAllAssistants();
29116
29612
  } catch (err) {
29117
29613
  if (!cancelled) {
29118
29614
  setError(err instanceof Error ? err.message : "Failed to load workflows");
@@ -29171,23 +29667,57 @@ var WorkflowAutomationView = () => {
29171
29667
  if (selectedId === id) setSelectedId(null);
29172
29668
  await fetchWorkflows();
29173
29669
  }, [del, fetchWorkflows, selectedId]);
29174
- const selectedWorkflow = useMemo29(
29670
+ const selectedWorkflow = useMemo30(
29175
29671
  () => workflows.find((w) => w.id === selectedId) || null,
29176
29672
  [workflows, selectedId]
29177
29673
  );
29178
- const workflowContext = useMemo29(
29674
+ const workflowContext = useMemo30(
29179
29675
  () => selectedId && selectedWorkflow ? { id: selectedId, name: selectedWorkflow.name, type: "workflow" } : null,
29180
29676
  [selectedId, selectedWorkflow]
29181
29677
  );
29678
+ const environmentConfig = useMemo30(() => {
29679
+ const refs = dsl?.nodes.filter((n) => n.type !== "terminal" && n.ref).map((n) => n.ref).filter((v, i, a) => a.indexOf(v) === i) ?? [];
29680
+ if (refs.length === 0) return graphDef;
29681
+ const matching = agentConfigs.filter((cfg) => {
29682
+ const key = cfg.key;
29683
+ return key && refs.includes(key);
29684
+ });
29685
+ if (matching.length === 0) return graphDef;
29686
+ const merged = { ...graphDef ?? {} };
29687
+ const allTools = new Set(merged.tools ?? []);
29688
+ const allMidd = [
29689
+ ...merged.middleware ?? []
29690
+ ];
29691
+ const allSubAgents = new Set(merged.subAgents ?? []);
29692
+ const seenMw = new Set(
29693
+ allMidd.map((m) => m.type).filter(Boolean)
29694
+ );
29695
+ for (const cfg of matching) {
29696
+ const c = cfg;
29697
+ for (const t of c.tools ?? []) allTools.add(t);
29698
+ for (const m of c.middleware ?? []) {
29699
+ const mt = m.type;
29700
+ if (mt && !seenMw.has(mt)) {
29701
+ allMidd.push(m);
29702
+ seenMw.add(mt);
29703
+ }
29704
+ }
29705
+ for (const sa of c.subAgents ?? []) allSubAgents.add(sa);
29706
+ }
29707
+ merged.tools = Array.from(allTools);
29708
+ merged.middleware = allMidd;
29709
+ merged.subAgents = Array.from(allSubAgents);
29710
+ return merged;
29711
+ }, [dsl, graphDef, agentConfigs]);
29182
29712
  if (initialLoading) {
29183
- return /* @__PURE__ */ jsx111("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%" }, children: /* @__PURE__ */ jsx111(Spin18, { size: "large", tip: "Loading workflows..." }) });
29713
+ return /* @__PURE__ */ jsx112("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100%" }, children: /* @__PURE__ */ jsx112(Spin18, { size: "large", tip: "Loading workflows..." }) });
29184
29714
  }
29185
29715
  if (error) {
29186
- return /* @__PURE__ */ jsx111(Empty16, { description: error });
29716
+ return /* @__PURE__ */ jsx112(Empty16, { description: error });
29187
29717
  }
29188
29718
  if (workflows.length === 0) {
29189
- return /* @__PURE__ */ jsxs79("div", { style: { width: "100%", height: "100%" }, children: [
29190
- /* @__PURE__ */ jsx111(
29719
+ return /* @__PURE__ */ jsxs80("div", { style: { width: "100%", height: "100%" }, children: [
29720
+ /* @__PURE__ */ jsx112(
29191
29721
  CreateWorkflowModal,
29192
29722
  {
29193
29723
  open: createModalOpen,
@@ -29196,19 +29726,19 @@ var WorkflowAutomationView = () => {
29196
29726
  type: "workflow"
29197
29727
  }
29198
29728
  ),
29199
- /* @__PURE__ */ jsx111(Empty16, { description: "No workflow definitions found.", children: /* @__PURE__ */ jsx111(
29729
+ /* @__PURE__ */ jsx112(Empty16, { description: "No workflow definitions found.", children: /* @__PURE__ */ jsx112(
29200
29730
  Button50,
29201
29731
  {
29202
29732
  type: "primary",
29203
- icon: /* @__PURE__ */ jsx111(PlusOutlined8, {}),
29733
+ icon: /* @__PURE__ */ jsx112(PlusOutlined8, {}),
29204
29734
  onClick: () => setCreateModalOpen(true),
29205
29735
  children: "Create Workflow"
29206
29736
  }
29207
29737
  ) })
29208
29738
  ] });
29209
29739
  }
29210
- return /* @__PURE__ */ jsxs79("div", { style: { width: "100%", height: "100%" }, children: [
29211
- /* @__PURE__ */ jsx111(
29740
+ return /* @__PURE__ */ jsxs80("div", { style: { width: "100%", height: "100%" }, children: [
29741
+ /* @__PURE__ */ jsx112(
29212
29742
  CreateWorkflowModal,
29213
29743
  {
29214
29744
  open: createModalOpen,
@@ -29217,7 +29747,7 @@ var WorkflowAutomationView = () => {
29217
29747
  type: "workflow"
29218
29748
  }
29219
29749
  ),
29220
- /* @__PURE__ */ jsx111(
29750
+ /* @__PURE__ */ jsx112(
29221
29751
  Modal17,
29222
29752
  {
29223
29753
  title: selectedWorkflow?.name,
@@ -29227,11 +29757,11 @@ var WorkflowAutomationView = () => {
29227
29757
  width: "85vw",
29228
29758
  centered: true,
29229
29759
  styles: { body: { maxHeight: "calc(85vh - 120px)", overflow: "auto", padding: "12px 24px 24px" } },
29230
- children: selectedWorkflow?.description ? /* @__PURE__ */ jsx111(MDResponse, { content: selectedWorkflow.description }) : /* @__PURE__ */ jsx111(Text42, { type: "secondary", children: "No description set." })
29760
+ children: selectedWorkflow?.description ? /* @__PURE__ */ jsx112(MDResponse, { content: selectedWorkflow.description }) : /* @__PURE__ */ jsx112(Text43, { type: "secondary", children: "No description set." })
29231
29761
  }
29232
29762
  ),
29233
- /* @__PURE__ */ jsx111(ReactFlowProvider6, { children: /* @__PURE__ */ jsxs79("div", { style: { height: "100%", width: "100%", position: "relative", overflow: "hidden" }, children: [
29234
- /* @__PURE__ */ jsx111(
29763
+ /* @__PURE__ */ jsx112(ReactFlowProvider6, { children: /* @__PURE__ */ jsxs80("div", { style: { height: "100%", width: "100%", position: "relative", overflow: "hidden" }, children: [
29764
+ /* @__PURE__ */ jsx112(
29235
29765
  WorkflowFlowInner,
29236
29766
  {
29237
29767
  workflows,
@@ -29240,16 +29770,17 @@ var WorkflowAutomationView = () => {
29240
29770
  onCreate: () => setCreateModalOpen(true),
29241
29771
  onDelete: handleDelete,
29242
29772
  dsl,
29243
- onSpecClick: () => setSpecModalOpen(true)
29773
+ onSpecClick: () => setSpecModalOpen(true),
29774
+ environmentConfig
29244
29775
  }
29245
29776
  ),
29246
- !copilotOpen && selectedId && /* @__PURE__ */ jsx111("div", { style: {
29777
+ !copilotOpen && selectedId && /* @__PURE__ */ jsx112("div", { style: {
29247
29778
  position: "absolute",
29248
29779
  right: 0,
29249
29780
  top: "50%",
29250
29781
  transform: "translateY(-50%)",
29251
29782
  zIndex: 20
29252
- }, children: /* @__PURE__ */ jsx111("div", { onClick: () => setCopilotOpen(true), style: {
29783
+ }, children: /* @__PURE__ */ jsx112("div", { onClick: () => setCopilotOpen(true), style: {
29253
29784
  writingMode: "vertical-rl",
29254
29785
  textOrientation: "mixed",
29255
29786
  padding: "16px 8px",
@@ -29261,7 +29792,7 @@ var WorkflowAutomationView = () => {
29261
29792
  fontWeight: 500,
29262
29793
  userSelect: "none"
29263
29794
  }, children: "Copilot" }) }),
29264
- copilotOpen && selectedId && /* @__PURE__ */ jsxs79("div", { style: {
29795
+ copilotOpen && selectedId && /* @__PURE__ */ jsxs80("div", { style: {
29265
29796
  position: "absolute",
29266
29797
  right: 16,
29267
29798
  top: 48,
@@ -29272,7 +29803,7 @@ var WorkflowAutomationView = () => {
29272
29803
  overflow: "hidden",
29273
29804
  boxShadow: "0 4px 24px rgba(0,0,0,0.12)"
29274
29805
  }, children: [
29275
- /* @__PURE__ */ jsx111(
29806
+ /* @__PURE__ */ jsx112(
29276
29807
  "div",
29277
29808
  {
29278
29809
  onMouseDown: handleResizeStart,
@@ -29288,7 +29819,7 @@ var WorkflowAutomationView = () => {
29288
29819
  }
29289
29820
  }
29290
29821
  ),
29291
- /* @__PURE__ */ jsx111(
29822
+ /* @__PURE__ */ jsx112(
29292
29823
  CopilotPanel,
29293
29824
  {
29294
29825
  workflowContext,
@@ -29309,17 +29840,17 @@ var WorkflowAutomationView = () => {
29309
29840
  };
29310
29841
 
29311
29842
  // src/components/Eval/EvalPanel.tsx
29312
- import React64, { useState as useState73, useMemo as useMemo30 } from "react";
29843
+ import React65, { useState as useState73, useMemo as useMemo31 } from "react";
29313
29844
  import { createStyles as createStyles34 } from "antd-style";
29314
- import { Button as Button53, Card as Card28, Typography as Typography57, Row as Row4, Col as Col4, Tag as Tag28, theme as theme15, Dropdown as Dropdown2, Popconfirm as Popconfirm10, message as message17 } from "antd";
29315
- import { Play as Play2, FlaskConical as FlaskConical2, TestTube2 as TestTube26, TrendingUp, CheckCircle as CheckCircle4, XCircle as XCircle3, ArrowRight as ArrowRight3, ChevronDown as ChevronDown5, Trash2 as Trash27, Clock as Clock4 } from "lucide-react";
29845
+ import { Button as Button53, Card as Card28, Typography as Typography58, Row as Row4, Col as Col4, Tag as Tag28, theme as theme15, Dropdown as Dropdown2, Popconfirm as Popconfirm10, message as message17 } from "antd";
29846
+ import { Play as Play2, FlaskConical as FlaskConical2, TestTube2 as TestTube26, TrendingUp, CheckCircle as CheckCircle4, XCircle as XCircle3, ArrowRight as ArrowRight3, ChevronDown as ChevronDown5, Trash2 as Trash27, Clock as Clock5 } from "lucide-react";
29316
29847
 
29317
29848
  // src/components/Eval/EvalSuiteCardList.tsx
29318
29849
  import { createStyles as createStyles31 } from "antd-style";
29319
- import { Card as Card25, Typography as Typography54, Row as Row3, Col as Col3, Empty as Empty17, Popconfirm as Popconfirm7, Spin as Spin19 } from "antd";
29850
+ import { Card as Card25, Typography as Typography55, Row as Row3, Col as Col3, Empty as Empty17, Popconfirm as Popconfirm7, Spin as Spin19 } from "antd";
29320
29851
  import { Trash2 as Trash24, TestTube2 as TestTube24 } from "lucide-react";
29321
- import { jsx as jsx112, jsxs as jsxs80 } from "react/jsx-runtime";
29322
- var { Text: Text43 } = Typography54;
29852
+ import { jsx as jsx113, jsxs as jsxs81 } from "react/jsx-runtime";
29853
+ var { Text: Text44 } = Typography55;
29323
29854
  var useStyle13 = createStyles31(({ token, css }) => ({
29324
29855
  card: css`
29325
29856
  border-radius: ${token.borderRadiusLG}px;
@@ -29381,26 +29912,26 @@ var EvalSuiteCardList = ({ projectId, onSelectSuite }) => {
29381
29912
  const { styles } = useStyle13();
29382
29913
  const { suites, loading, remove } = useEvalSuites(projectId);
29383
29914
  if (loading) {
29384
- return /* @__PURE__ */ jsx112("div", { style: { display: "flex", justifyContent: "center", padding: 48 }, children: /* @__PURE__ */ jsx112(Spin19, {}) });
29915
+ return /* @__PURE__ */ jsx113("div", { style: { display: "flex", justifyContent: "center", padding: 48 }, children: /* @__PURE__ */ jsx113(Spin19, {}) });
29385
29916
  }
29386
29917
  if (suites.length === 0) {
29387
- return /* @__PURE__ */ jsx112(Empty17, { image: Empty17.PRESENTED_IMAGE_SIMPLE, description: /* @__PURE__ */ jsx112(Text43, { type: "secondary", children: "No test suites yet" }) });
29918
+ return /* @__PURE__ */ jsx113(Empty17, { image: Empty17.PRESENTED_IMAGE_SIMPLE, description: /* @__PURE__ */ jsx113(Text44, { type: "secondary", children: "No test suites yet" }) });
29388
29919
  }
29389
- return /* @__PURE__ */ jsx112(Row3, { gutter: [16, 16], children: suites.map((s) => /* @__PURE__ */ jsx112(Col3, { xs: 24, sm: 12, md: 8, xl: 6, children: /* @__PURE__ */ jsx112(
29920
+ return /* @__PURE__ */ jsx113(Row3, { gutter: [16, 16], children: suites.map((s) => /* @__PURE__ */ jsx113(Col3, { xs: 24, sm: 12, md: 8, xl: 6, children: /* @__PURE__ */ jsx113(
29390
29921
  Card25,
29391
29922
  {
29392
29923
  className: styles.card,
29393
29924
  styles: { body: { padding: 0 } },
29394
29925
  size: "small",
29395
29926
  onClick: () => onSelectSuite(projectId, s.id),
29396
- children: /* @__PURE__ */ jsxs80("div", { className: styles.inner, children: [
29397
- /* @__PURE__ */ jsx112("div", { className: styles.icon, children: /* @__PURE__ */ jsx112(TestTube24, { size: 20, color: "#6366f1" }) }),
29398
- /* @__PURE__ */ jsxs80("div", { className: styles.header, children: [
29399
- /* @__PURE__ */ jsxs80("div", { children: [
29400
- /* @__PURE__ */ jsx112(Text43, { className: styles.title, children: s.name }),
29401
- /* @__PURE__ */ jsx112("div", { className: styles.subtitle, children: "Server-side agent testing" })
29927
+ children: /* @__PURE__ */ jsxs81("div", { className: styles.inner, children: [
29928
+ /* @__PURE__ */ jsx113("div", { className: styles.icon, children: /* @__PURE__ */ jsx113(TestTube24, { size: 20, color: "#6366f1" }) }),
29929
+ /* @__PURE__ */ jsxs81("div", { className: styles.header, children: [
29930
+ /* @__PURE__ */ jsxs81("div", { children: [
29931
+ /* @__PURE__ */ jsx113(Text44, { className: styles.title, children: s.name }),
29932
+ /* @__PURE__ */ jsx113("div", { className: styles.subtitle, children: "Server-side agent testing" })
29402
29933
  ] }),
29403
- /* @__PURE__ */ jsx112(
29934
+ /* @__PURE__ */ jsx113(
29404
29935
  Popconfirm7,
29405
29936
  {
29406
29937
  title: "Delete this suite?",
@@ -29409,13 +29940,13 @@ var EvalSuiteCardList = ({ projectId, onSelectSuite }) => {
29409
29940
  remove(projectId, s.id);
29410
29941
  },
29411
29942
  onCancel: (e) => e?.stopPropagation(),
29412
- children: /* @__PURE__ */ jsx112("div", { onClick: (e) => e.stopPropagation(), style: { cursor: "pointer" }, children: /* @__PURE__ */ jsx112(Trash24, { size: 14, color: "#999" }) })
29943
+ children: /* @__PURE__ */ jsx113("div", { onClick: (e) => e.stopPropagation(), style: { cursor: "pointer" }, children: /* @__PURE__ */ jsx113(Trash24, { size: 14, color: "#999" }) })
29413
29944
  }
29414
29945
  )
29415
29946
  ] }),
29416
- /* @__PURE__ */ jsx112("div", { className: styles.meta, children: /* @__PURE__ */ jsxs80("div", { className: styles.metaItem, children: [
29417
- /* @__PURE__ */ jsx112(TestTube24, { size: 14 }),
29418
- /* @__PURE__ */ jsxs80("span", { children: [
29947
+ /* @__PURE__ */ jsx113("div", { className: styles.meta, children: /* @__PURE__ */ jsxs81("div", { className: styles.metaItem, children: [
29948
+ /* @__PURE__ */ jsx113(TestTube24, { size: 14 }),
29949
+ /* @__PURE__ */ jsxs81("span", { children: [
29419
29950
  s.caseCount ?? 0,
29420
29951
  " test cases"
29421
29952
  ] })
@@ -29428,10 +29959,10 @@ var EvalSuiteCardList = ({ projectId, onSelectSuite }) => {
29428
29959
  // src/components/Eval/EvalSuiteDetail.tsx
29429
29960
  import { useState as useState71 } from "react";
29430
29961
  import { createStyles as createStyles32 } from "antd-style";
29431
- import { Button as Button51, Card as Card26, Typography as Typography55, Modal as Modal18, Form as Form8, Input as Input15, Select as Select7, Table as Table3, Popconfirm as Popconfirm8, Empty as Empty18 } from "antd";
29432
- import { Play, Plus as Plus6, Trash2 as Trash25, Bot as Bot3, MessageSquare as MessageSquare2, FlaskConical } from "lucide-react";
29433
- import { jsx as jsx113, jsxs as jsxs81 } from "react/jsx-runtime";
29434
- var { Text: Text44 } = Typography55;
29962
+ import { Button as Button51, Card as Card26, Typography as Typography56, Modal as Modal18, Form as Form8, Input as Input15, Select as Select7, Table as Table3, Popconfirm as Popconfirm8, Empty as Empty18 } from "antd";
29963
+ import { Play, Plus as Plus6, Trash2 as Trash25, Bot as Bot3, MessageSquare as MessageSquare3, FlaskConical } from "lucide-react";
29964
+ import { jsx as jsx114, jsxs as jsxs82 } from "react/jsx-runtime";
29965
+ var { Text: Text45 } = Typography56;
29435
29966
  var { TextArea: TextArea8 } = Input15;
29436
29967
  var useStyle14 = createStyles32(({ token, css }) => ({
29437
29968
  shell: css`
@@ -29559,22 +30090,22 @@ var EvalSuiteDetail = ({ projectId, suiteId, onBack, onRun }) => {
29559
30090
  };
29560
30091
  const columns = [
29561
30092
  {
29562
- title: /* @__PURE__ */ jsx113(MessageSquare2, { size: 14 }),
30093
+ title: /* @__PURE__ */ jsx114(MessageSquare3, { size: 14 }),
29563
30094
  key: "msg",
29564
30095
  render: (_, c) => {
29565
30096
  const rubricCount = c.rubrics?.length || 1;
29566
- return /* @__PURE__ */ jsxs81("div", { className: styles.caseRow, children: [
29567
- /* @__PURE__ */ jsx113("div", { className: styles.caseIcon, children: /* @__PURE__ */ jsx113(FlaskConical, { size: 14, color: "#6366f1" }) }),
29568
- /* @__PURE__ */ jsxs81("div", { className: styles.caseMeta, children: [
29569
- /* @__PURE__ */ jsx113("div", { className: styles.caseTitle, children: c.contentAssertion || "Untitled case" }),
29570
- /* @__PURE__ */ jsxs81("div", { className: styles.caseSub, children: [
29571
- /* @__PURE__ */ jsx113(Bot3, { size: 11 }),
29572
- /* @__PURE__ */ jsx113("span", { children: c.steps?.map((s) => s.agent_id).join(", ") || "\u2014" }),
29573
- /* @__PURE__ */ jsx113("span", { children: "\xB7" }),
29574
- /* @__PURE__ */ jsx113(MessageSquare2, { size: 11 }),
29575
- /* @__PURE__ */ jsx113("span", { style: { maxWidth: 200, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: c.inputMessage || "\u2014" }),
29576
- /* @__PURE__ */ jsx113("span", { children: "\xB7" }),
29577
- /* @__PURE__ */ jsxs81("span", { children: [
30097
+ return /* @__PURE__ */ jsxs82("div", { className: styles.caseRow, children: [
30098
+ /* @__PURE__ */ jsx114("div", { className: styles.caseIcon, children: /* @__PURE__ */ jsx114(FlaskConical, { size: 14, color: "#6366f1" }) }),
30099
+ /* @__PURE__ */ jsxs82("div", { className: styles.caseMeta, children: [
30100
+ /* @__PURE__ */ jsx114("div", { className: styles.caseTitle, children: c.contentAssertion || "Untitled case" }),
30101
+ /* @__PURE__ */ jsxs82("div", { className: styles.caseSub, children: [
30102
+ /* @__PURE__ */ jsx114(Bot3, { size: 11 }),
30103
+ /* @__PURE__ */ jsx114("span", { children: c.steps?.map((s) => s.agent_id).join(", ") || "\u2014" }),
30104
+ /* @__PURE__ */ jsx114("span", { children: "\xB7" }),
30105
+ /* @__PURE__ */ jsx114(MessageSquare3, { size: 11 }),
30106
+ /* @__PURE__ */ jsx114("span", { style: { maxWidth: 200, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: c.inputMessage || "\u2014" }),
30107
+ /* @__PURE__ */ jsx114("span", { children: "\xB7" }),
30108
+ /* @__PURE__ */ jsxs82("span", { children: [
29578
30109
  rubricCount,
29579
30110
  " rubric",
29580
30111
  rubricCount > 1 ? "s" : ""
@@ -29588,38 +30119,38 @@ var EvalSuiteDetail = ({ projectId, suiteId, onBack, onRun }) => {
29588
30119
  title: "",
29589
30120
  key: "actions",
29590
30121
  width: 40,
29591
- render: (_, c) => /* @__PURE__ */ jsx113(Popconfirm8, { title: "Delete?", onConfirm: () => removeCase(projectId, suiteId, c.id), children: /* @__PURE__ */ jsx113(Button51, { type: "text", danger: true, size: "small", icon: /* @__PURE__ */ jsx113(Trash25, { size: 14 }) }) })
30122
+ render: (_, c) => /* @__PURE__ */ jsx114(Popconfirm8, { title: "Delete?", onConfirm: () => removeCase(projectId, suiteId, c.id), children: /* @__PURE__ */ jsx114(Button51, { type: "text", danger: true, size: "small", icon: /* @__PURE__ */ jsx114(Trash25, { size: 14 }) }) })
29592
30123
  }
29593
30124
  ];
29594
- return /* @__PURE__ */ jsxs81("div", { className: styles.shell, children: [
29595
- /* @__PURE__ */ jsxs81("div", { className: styles.topBar, children: [
29596
- /* @__PURE__ */ jsxs81("div", { className: styles.topLeft, children: [
29597
- /* @__PURE__ */ jsx113("button", { className: styles.breadcrumb, onClick: onBack, children: "Suites" }),
29598
- /* @__PURE__ */ jsx113("span", { className: styles.breadcrumbSep, children: "/" }),
29599
- /* @__PURE__ */ jsx113("span", { className: styles.pageTitle, children: suite.name || "Suite" })
30125
+ return /* @__PURE__ */ jsxs82("div", { className: styles.shell, children: [
30126
+ /* @__PURE__ */ jsxs82("div", { className: styles.topBar, children: [
30127
+ /* @__PURE__ */ jsxs82("div", { className: styles.topLeft, children: [
30128
+ /* @__PURE__ */ jsx114("button", { className: styles.breadcrumb, onClick: onBack, children: "Suites" }),
30129
+ /* @__PURE__ */ jsx114("span", { className: styles.breadcrumbSep, children: "/" }),
30130
+ /* @__PURE__ */ jsx114("span", { className: styles.pageTitle, children: suite.name || "Suite" })
29600
30131
  ] }),
29601
- /* @__PURE__ */ jsx113("div", { className: styles.topRight, children: /* @__PURE__ */ jsx113(Button51, { type: "primary", icon: /* @__PURE__ */ jsx113(Play, { size: 16 }), onClick: async () => {
30132
+ /* @__PURE__ */ jsx114("div", { className: styles.topRight, children: /* @__PURE__ */ jsx114(Button51, { type: "primary", icon: /* @__PURE__ */ jsx114(Play, { size: 16 }), onClick: async () => {
29602
30133
  const r = await start(projectId);
29603
30134
  if (r?.run_id) onRun(r.run_id);
29604
30135
  }, children: "Run All Cases" }) })
29605
30136
  ] }),
29606
- /* @__PURE__ */ jsxs81("div", { className: styles.body, children: [
29607
- /* @__PURE__ */ jsxs81("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 16 }, children: [
29608
- /* @__PURE__ */ jsxs81(Text44, { strong: true, style: { fontSize: 15 }, children: [
30137
+ /* @__PURE__ */ jsxs82("div", { className: styles.body, children: [
30138
+ /* @__PURE__ */ jsxs82("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 16 }, children: [
30139
+ /* @__PURE__ */ jsxs82(Text45, { strong: true, style: { fontSize: 15 }, children: [
29609
30140
  "Test Cases (",
29610
30141
  cases.length,
29611
30142
  ")"
29612
30143
  ] }),
29613
- /* @__PURE__ */ jsx113(Button51, { type: "primary", icon: /* @__PURE__ */ jsx113(Plus6, { size: 16 }), onClick: () => {
30144
+ /* @__PURE__ */ jsx114(Button51, { type: "primary", icon: /* @__PURE__ */ jsx114(Plus6, { size: 16 }), onClick: () => {
29614
30145
  loadAgents();
29615
30146
  setModalOpen(true);
29616
30147
  }, children: "Add Case" })
29617
30148
  ] }),
29618
- cases.length === 0 ? /* @__PURE__ */ jsx113(Empty18, { description: "No test cases", style: { marginTop: 60 }, children: /* @__PURE__ */ jsx113(Button51, { type: "primary", icon: /* @__PURE__ */ jsx113(Plus6, { size: 16 }), onClick: () => {
30149
+ cases.length === 0 ? /* @__PURE__ */ jsx114(Empty18, { description: "No test cases", style: { marginTop: 60 }, children: /* @__PURE__ */ jsx114(Button51, { type: "primary", icon: /* @__PURE__ */ jsx114(Plus6, { size: 16 }), onClick: () => {
29619
30150
  loadAgents();
29620
30151
  setModalOpen(true);
29621
- }, children: "Add First Case" }) }) : /* @__PURE__ */ jsx113(Card26, { className: styles.tableCard, styles: { body: { padding: 0 } }, children: /* @__PURE__ */ jsx113(Table3, { dataSource: cases, rowKey: "id", columns, pagination: false, showHeader: false }) }),
29622
- /* @__PURE__ */ jsx113(
30152
+ }, children: "Add First Case" }) }) : /* @__PURE__ */ jsx114(Card26, { className: styles.tableCard, styles: { body: { padding: 0 } }, children: /* @__PURE__ */ jsx114(Table3, { dataSource: cases, rowKey: "id", columns, pagination: false, showHeader: false }) }),
30153
+ /* @__PURE__ */ jsx114(
29623
30154
  Modal18,
29624
30155
  {
29625
30156
  title: "Add Test Case",
@@ -29631,9 +30162,9 @@ var EvalSuiteDetail = ({ projectId, suiteId, onBack, onRun }) => {
29631
30162
  footer: null,
29632
30163
  width: 540,
29633
30164
  destroyOnClose: true,
29634
- children: /* @__PURE__ */ jsxs81(Form8, { form, layout: "vertical", onFinish: handleAdd, children: [
29635
- /* @__PURE__ */ jsx113(Form8.Item, { name: "inputMessage", label: "Input Message", rules: [{ required: true }], children: /* @__PURE__ */ jsx113(TextArea8, { rows: 2, placeholder: "What to send to the agent" }) }),
29636
- /* @__PURE__ */ jsx113(Form8.Item, { name: "agentId", label: "Agent", rules: [{ required: true }], children: /* @__PURE__ */ jsx113(
30165
+ children: /* @__PURE__ */ jsxs82(Form8, { form, layout: "vertical", onFinish: handleAdd, children: [
30166
+ /* @__PURE__ */ jsx114(Form8.Item, { name: "inputMessage", label: "Input Message", rules: [{ required: true }], children: /* @__PURE__ */ jsx114(TextArea8, { rows: 2, placeholder: "What to send to the agent" }) }),
30167
+ /* @__PURE__ */ jsx114(Form8.Item, { name: "agentId", label: "Agent", rules: [{ required: true }], children: /* @__PURE__ */ jsx114(
29637
30168
  Select7,
29638
30169
  {
29639
30170
  placeholder: "Select agent",
@@ -29645,17 +30176,17 @@ var EvalSuiteDetail = ({ projectId, suiteId, onBack, onRun }) => {
29645
30176
  }))
29646
30177
  }
29647
30178
  ) }),
29648
- /* @__PURE__ */ jsx113(Form8.Item, { name: "outputType", label: "Output Type", initialValue: "message_content", children: /* @__PURE__ */ jsx113(Select7, { options: [
30179
+ /* @__PURE__ */ jsx114(Form8.Item, { name: "outputType", label: "Output Type", initialValue: "message_content", children: /* @__PURE__ */ jsx114(Select7, { options: [
29649
30180
  { value: "message_content", label: "Message Content" },
29650
30181
  { value: "file_content", label: "File Content" }
29651
30182
  ] }) }),
29652
- /* @__PURE__ */ jsx113(Form8.Item, { name: "contentAssertion", label: "Expected Output", children: /* @__PURE__ */ jsx113(TextArea8, { rows: 2, placeholder: "Describe expected output" }) }),
29653
- /* @__PURE__ */ jsxs81("div", { style: { textAlign: "right" }, children: [
29654
- /* @__PURE__ */ jsx113(Button51, { onClick: () => {
30183
+ /* @__PURE__ */ jsx114(Form8.Item, { name: "contentAssertion", label: "Expected Output", children: /* @__PURE__ */ jsx114(TextArea8, { rows: 2, placeholder: "Describe expected output" }) }),
30184
+ /* @__PURE__ */ jsxs82("div", { style: { textAlign: "right" }, children: [
30185
+ /* @__PURE__ */ jsx114(Button51, { onClick: () => {
29655
30186
  form.resetFields();
29656
30187
  setModalOpen(false);
29657
30188
  }, style: { marginRight: 8 }, children: "Cancel" }),
29658
- /* @__PURE__ */ jsx113(Button51, { type: "primary", htmlType: "submit", children: "Add Case" })
30189
+ /* @__PURE__ */ jsx114(Button51, { type: "primary", htmlType: "submit", children: "Add Case" })
29659
30190
  ] })
29660
30191
  ] })
29661
30192
  }
@@ -29667,10 +30198,10 @@ var EvalSuiteDetail = ({ projectId, suiteId, onBack, onRun }) => {
29667
30198
  // src/components/Eval/EvalRunResults.tsx
29668
30199
  import { useEffect as useEffect49, useState as useState72 } from "react";
29669
30200
  import { createStyles as createStyles33 } from "antd-style";
29670
- import { Button as Button52, Card as Card27, Typography as Typography56, Progress as Progress3, Tag as Tag27, Table as Table4, Empty as Empty19, Popconfirm as Popconfirm9, message as message16 } from "antd";
30201
+ import { Button as Button52, Card as Card27, Typography as Typography57, Progress as Progress3, Tag as Tag27, Table as Table4, Empty as Empty19, Popconfirm as Popconfirm9, message as message16 } from "antd";
29671
30202
  import { CheckCircle as CheckCircle3, XCircle as XCircle2, Trash2 as Trash26 } from "lucide-react";
29672
- import { jsx as jsx114, jsxs as jsxs82 } from "react/jsx-runtime";
29673
- var { Text: Text45 } = Typography56;
30203
+ import { jsx as jsx115, jsxs as jsxs83 } from "react/jsx-runtime";
30204
+ var { Text: Text46 } = Typography57;
29674
30205
  var useStyle15 = createStyles33(({ token, css }) => ({
29675
30206
  shell: css`
29676
30207
  display: flex;
@@ -29760,22 +30291,22 @@ var EvalRunResults = ({ runId, onBack }) => {
29760
30291
  client.eval.runs.get(runId).then(setRun).catch(console.error);
29761
30292
  }, [runId, client]);
29762
30293
  if (!run) {
29763
- return /* @__PURE__ */ jsxs82("div", { className: styles.shell, children: [
29764
- /* @__PURE__ */ jsx114("div", { className: styles.topBar, children: /* @__PURE__ */ jsx114("div", { className: styles.topLeft, children: /* @__PURE__ */ jsx114("button", { className: styles.breadcrumb, onClick: onBack, children: "\u2190 Back" }) }) }),
29765
- /* @__PURE__ */ jsx114("div", { style: { display: "flex", justifyContent: "center", padding: 60 }, children: /* @__PURE__ */ jsx114(Text45, { type: "secondary", children: "Loading..." }) })
30294
+ return /* @__PURE__ */ jsxs83("div", { className: styles.shell, children: [
30295
+ /* @__PURE__ */ jsx115("div", { className: styles.topBar, children: /* @__PURE__ */ jsx115("div", { className: styles.topLeft, children: /* @__PURE__ */ jsx115("button", { className: styles.breadcrumb, onClick: onBack, children: "\u2190 Back" }) }) }),
30296
+ /* @__PURE__ */ jsx115("div", { style: { display: "flex", justifyContent: "center", padding: 60 }, children: /* @__PURE__ */ jsx115(Text46, { type: "secondary", children: "Loading..." }) })
29766
30297
  ] });
29767
30298
  }
29768
30299
  const isRunning = run.status === "running";
29769
30300
  const isLive = connected && streamingStatus === "running";
29770
30301
  const pct = run.totalCases > 0 ? Math.round((run.passedCases + run.failedCases) / run.totalCases * 100) : 100;
29771
- return /* @__PURE__ */ jsxs82("div", { className: styles.shell, children: [
29772
- /* @__PURE__ */ jsxs82("div", { className: styles.topBar, children: [
29773
- /* @__PURE__ */ jsxs82("div", { className: styles.topLeft, children: [
29774
- /* @__PURE__ */ jsx114("button", { className: styles.breadcrumb, onClick: onBack, children: "\u2190 Back" }),
29775
- /* @__PURE__ */ jsx114("span", { className: styles.pageTitle, children: "Run Results" }),
29776
- /* @__PURE__ */ jsx114(Tag27, { color: run.status === "completed" ? "success" : run.status === "running" ? "processing" : run.status === "failed" ? "error" : "warning", children: run.status })
30302
+ return /* @__PURE__ */ jsxs83("div", { className: styles.shell, children: [
30303
+ /* @__PURE__ */ jsxs83("div", { className: styles.topBar, children: [
30304
+ /* @__PURE__ */ jsxs83("div", { className: styles.topLeft, children: [
30305
+ /* @__PURE__ */ jsx115("button", { className: styles.breadcrumb, onClick: onBack, children: "\u2190 Back" }),
30306
+ /* @__PURE__ */ jsx115("span", { className: styles.pageTitle, children: "Run Results" }),
30307
+ /* @__PURE__ */ jsx115(Tag27, { color: run.status === "completed" ? "success" : run.status === "running" ? "processing" : run.status === "failed" ? "error" : "warning", children: run.status })
29777
30308
  ] }),
29778
- /* @__PURE__ */ jsx114(
30309
+ /* @__PURE__ */ jsx115(
29779
30310
  Popconfirm9,
29780
30311
  {
29781
30312
  title: "Delete this run?",
@@ -29787,63 +30318,63 @@ var EvalRunResults = ({ runId, onBack }) => {
29787
30318
  },
29788
30319
  okText: "Delete",
29789
30320
  okButtonProps: { danger: true },
29790
- children: /* @__PURE__ */ jsx114(Button52, { danger: true, icon: /* @__PURE__ */ jsx114(Trash26, { size: 16 }), children: "Delete Run" })
30321
+ children: /* @__PURE__ */ jsx115(Button52, { danger: true, icon: /* @__PURE__ */ jsx115(Trash26, { size: 16 }), children: "Delete Run" })
29791
30322
  }
29792
30323
  )
29793
30324
  ] }),
29794
- /* @__PURE__ */ jsxs82("div", { className: styles.body, children: [
29795
- (isRunning || isLive) && isLive && /* @__PURE__ */ jsxs82("div", { className: styles.progressWrap, children: [
29796
- /* @__PURE__ */ jsx114(Progress3, { percent: pct, status: "active", strokeColor: "#6366f1" }),
29797
- /* @__PURE__ */ jsxs82("div", { style: { display: "flex", justifyContent: "center", gap: 24, marginTop: 8 }, children: [
29798
- /* @__PURE__ */ jsxs82(Text45, { type: "secondary", style: { fontSize: 13 }, children: [
30325
+ /* @__PURE__ */ jsxs83("div", { className: styles.body, children: [
30326
+ (isRunning || isLive) && isLive && /* @__PURE__ */ jsxs83("div", { className: styles.progressWrap, children: [
30327
+ /* @__PURE__ */ jsx115(Progress3, { percent: pct, status: "active", strokeColor: "#6366f1" }),
30328
+ /* @__PURE__ */ jsxs83("div", { style: { display: "flex", justifyContent: "center", gap: 24, marginTop: 8 }, children: [
30329
+ /* @__PURE__ */ jsxs83(Text46, { type: "secondary", style: { fontSize: 13 }, children: [
29799
30330
  progress.completed,
29800
30331
  " / ",
29801
30332
  progress.total,
29802
30333
  " cases"
29803
30334
  ] }),
29804
- /* @__PURE__ */ jsxs82(Text45, { type: "success", style: { fontSize: 13 }, children: [
30335
+ /* @__PURE__ */ jsxs83(Text46, { type: "success", style: { fontSize: 13 }, children: [
29805
30336
  progress.passed,
29806
30337
  " passed"
29807
30338
  ] }),
29808
- /* @__PURE__ */ jsxs82(Text45, { type: "danger", style: { fontSize: 13 }, children: [
30339
+ /* @__PURE__ */ jsxs83(Text46, { type: "danger", style: { fontSize: 13 }, children: [
29809
30340
  progress.failed,
29810
30341
  " failed"
29811
30342
  ] })
29812
30343
  ] })
29813
30344
  ] }),
29814
- /* @__PURE__ */ jsxs82("div", { className: styles.summaryCard, children: [
29815
- /* @__PURE__ */ jsxs82("div", { className: styles.summaryRow, children: [
29816
- /* @__PURE__ */ jsxs82("div", { className: styles.summaryItem, children: [
29817
- /* @__PURE__ */ jsx114(Text45, { style: { color: "#6366f1", fontSize: 24, fontWeight: 700 }, children: run.totalCases }),
29818
- /* @__PURE__ */ jsx114("div", { className: styles.summaryLabel, children: "Total Cases" })
30345
+ /* @__PURE__ */ jsxs83("div", { className: styles.summaryCard, children: [
30346
+ /* @__PURE__ */ jsxs83("div", { className: styles.summaryRow, children: [
30347
+ /* @__PURE__ */ jsxs83("div", { className: styles.summaryItem, children: [
30348
+ /* @__PURE__ */ jsx115(Text46, { style: { color: "#6366f1", fontSize: 24, fontWeight: 700 }, children: run.totalCases }),
30349
+ /* @__PURE__ */ jsx115("div", { className: styles.summaryLabel, children: "Total Cases" })
29819
30350
  ] }),
29820
- /* @__PURE__ */ jsxs82("div", { className: styles.summaryItem, children: [
29821
- /* @__PURE__ */ jsx114(Text45, { style: { color: "#22c55e", fontSize: 24, fontWeight: 700 }, children: run.passedCases }),
29822
- /* @__PURE__ */ jsx114("div", { className: styles.summaryLabel, children: "Passed" })
30351
+ /* @__PURE__ */ jsxs83("div", { className: styles.summaryItem, children: [
30352
+ /* @__PURE__ */ jsx115(Text46, { style: { color: "#22c55e", fontSize: 24, fontWeight: 700 }, children: run.passedCases }),
30353
+ /* @__PURE__ */ jsx115("div", { className: styles.summaryLabel, children: "Passed" })
29823
30354
  ] }),
29824
- /* @__PURE__ */ jsxs82("div", { className: styles.summaryItem, children: [
29825
- /* @__PURE__ */ jsx114(Text45, { style: { color: "#ef4444", fontSize: 24, fontWeight: 700 }, children: run.failedCases }),
29826
- /* @__PURE__ */ jsx114("div", { className: styles.summaryLabel, children: "Failed" })
30355
+ /* @__PURE__ */ jsxs83("div", { className: styles.summaryItem, children: [
30356
+ /* @__PURE__ */ jsx115(Text46, { style: { color: "#ef4444", fontSize: 24, fontWeight: 700 }, children: run.failedCases }),
30357
+ /* @__PURE__ */ jsx115("div", { className: styles.summaryLabel, children: "Failed" })
29827
30358
  ] }),
29828
- /* @__PURE__ */ jsxs82("div", { className: styles.summaryItem, children: [
29829
- /* @__PURE__ */ jsx114(Text45, { style: { color: "#3b82f6", fontSize: 24, fontWeight: 700 }, children: typeof run.avgScore === "number" ? run.avgScore.toFixed(1) : "\u2014" }),
29830
- /* @__PURE__ */ jsx114("div", { className: styles.summaryLabel, children: "Avg Score" })
30359
+ /* @__PURE__ */ jsxs83("div", { className: styles.summaryItem, children: [
30360
+ /* @__PURE__ */ jsx115(Text46, { style: { color: "#3b82f6", fontSize: 24, fontWeight: 700 }, children: typeof run.avgScore === "number" ? run.avgScore.toFixed(1) : "\u2014" }),
30361
+ /* @__PURE__ */ jsx115("div", { className: styles.summaryLabel, children: "Avg Score" })
29831
30362
  ] }),
29832
- /* @__PURE__ */ jsxs82("div", { className: styles.summaryItem, children: [
29833
- /* @__PURE__ */ jsxs82(Text45, { style: { color: "#f59e0b", fontSize: 24, fontWeight: 700 }, children: [
30363
+ /* @__PURE__ */ jsxs83("div", { className: styles.summaryItem, children: [
30364
+ /* @__PURE__ */ jsxs83(Text46, { style: { color: "#f59e0b", fontSize: 24, fontWeight: 700 }, children: [
29834
30365
  run.totalCases > 0 ? Math.round(run.passedCases / run.totalCases * 100) : 0,
29835
30366
  "%"
29836
30367
  ] }),
29837
- /* @__PURE__ */ jsx114("div", { className: styles.summaryLabel, children: "Pass Rate" })
30368
+ /* @__PURE__ */ jsx115("div", { className: styles.summaryLabel, children: "Pass Rate" })
29838
30369
  ] })
29839
30370
  ] }),
29840
- run.error && /* @__PURE__ */ jsxs82(Text45, { type: "danger", style: { display: "block", marginTop: 16, fontSize: 13 }, children: [
30371
+ run.error && /* @__PURE__ */ jsxs83(Text46, { type: "danger", style: { display: "block", marginTop: 16, fontSize: 13 }, children: [
29841
30372
  "Error: ",
29842
30373
  run.error
29843
30374
  ] })
29844
30375
  ] }),
29845
- /* @__PURE__ */ jsx114(Text45, { strong: true, style: { fontSize: 15, display: "block", marginBottom: 12 }, children: "Case Results" }),
29846
- /* @__PURE__ */ jsx114(Card27, { className: styles.tableCard, styles: { body: { padding: 0 } }, children: (run.results || []).length === 0 ? /* @__PURE__ */ jsx114(Empty19, { description: "No results yet", style: { padding: 40 } }) : /* @__PURE__ */ jsx114(
30376
+ /* @__PURE__ */ jsx115(Text46, { strong: true, style: { fontSize: 15, display: "block", marginBottom: 12 }, children: "Case Results" }),
30377
+ /* @__PURE__ */ jsx115(Card27, { className: styles.tableCard, styles: { body: { padding: 0 } }, children: (run.results || []).length === 0 ? /* @__PURE__ */ jsx115(Empty19, { description: "No results yet", style: { padding: 40 } }) : /* @__PURE__ */ jsx115(
29847
30378
  Table4,
29848
30379
  {
29849
30380
  dataSource: run.results || [],
@@ -29851,22 +30382,22 @@ var EvalRunResults = ({ runId, onBack }) => {
29851
30382
  size: "small",
29852
30383
  pagination: false,
29853
30384
  expandable: {
29854
- expandedRowRender: (r) => /* @__PURE__ */ jsxs82("div", { style: { padding: "12px 16px 12px 56px", background: "#fafafa", borderRadius: 8, margin: "0 12px 8px" }, children: [
29855
- r.summary && /* @__PURE__ */ jsxs82("div", { style: { marginBottom: 8 }, children: [
29856
- /* @__PURE__ */ jsx114(Text45, { type: "secondary", style: { fontSize: 12 }, children: "Judge Summary" }),
29857
- /* @__PURE__ */ jsx114("div", { style: { fontSize: 13, marginTop: 4 }, children: r.summary })
30385
+ expandedRowRender: (r) => /* @__PURE__ */ jsxs83("div", { style: { padding: "12px 16px 12px 56px", background: "#fafafa", borderRadius: 8, margin: "0 12px 8px" }, children: [
30386
+ r.summary && /* @__PURE__ */ jsxs83("div", { style: { marginBottom: 8 }, children: [
30387
+ /* @__PURE__ */ jsx115(Text46, { type: "secondary", style: { fontSize: 12 }, children: "Judge Summary" }),
30388
+ /* @__PURE__ */ jsx115("div", { style: { fontSize: 13, marginTop: 4 }, children: r.summary })
29858
30389
  ] }),
29859
- r.dimensionResults && r.dimensionResults.length > 0 && /* @__PURE__ */ jsxs82("div", { children: [
29860
- /* @__PURE__ */ jsxs82(Text45, { type: "secondary", style: { fontSize: 12, marginBottom: 6, display: "block" }, children: [
30390
+ r.dimensionResults && r.dimensionResults.length > 0 && /* @__PURE__ */ jsxs83("div", { children: [
30391
+ /* @__PURE__ */ jsxs83(Text46, { type: "secondary", style: { fontSize: 12, marginBottom: 6, display: "block" }, children: [
29861
30392
  "Dimension Scores (",
29862
30393
  r.dimensionResults.length,
29863
30394
  " rubric",
29864
30395
  r.dimensionResults.length > 1 ? "s" : "",
29865
30396
  ")"
29866
30397
  ] }),
29867
- r.dimensionResults.map((d, i) => /* @__PURE__ */ jsxs82("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 4 }, children: [
29868
- /* @__PURE__ */ jsx114(Text45, { style: { fontSize: 13, width: 120 }, children: d.name }),
29869
- /* @__PURE__ */ jsx114(
30398
+ r.dimensionResults.map((d, i) => /* @__PURE__ */ jsxs83("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 4 }, children: [
30399
+ /* @__PURE__ */ jsx115(Text46, { style: { fontSize: 13, width: 120 }, children: d.name }),
30400
+ /* @__PURE__ */ jsx115(
29870
30401
  Progress3,
29871
30402
  {
29872
30403
  percent: d.score,
@@ -29875,10 +30406,10 @@ var EvalRunResults = ({ runId, onBack }) => {
29875
30406
  strokeColor: d.score >= 80 ? "#22c55e" : d.score >= 60 ? "#f59e0b" : "#ef4444"
29876
30407
  }
29877
30408
  ),
29878
- /* @__PURE__ */ jsx114(Text45, { style: { fontSize: 13, width: 40, textAlign: "right" }, children: d.score })
30409
+ /* @__PURE__ */ jsx115(Text46, { style: { fontSize: 13, width: 40, textAlign: "right" }, children: d.score })
29879
30410
  ] }, i))
29880
30411
  ] }),
29881
- !r.summary && !r.dimensionResults?.length && /* @__PURE__ */ jsx114(Text45, { type: "secondary", style: { fontSize: 13 }, children: "No detail available" })
30412
+ !r.summary && !r.dimensionResults?.length && /* @__PURE__ */ jsx115(Text46, { type: "secondary", style: { fontSize: 13 }, children: "No detail available" })
29882
30413
  ] }),
29883
30414
  rowExpandable: () => true
29884
30415
  },
@@ -29887,7 +30418,7 @@ var EvalRunResults = ({ runId, onBack }) => {
29887
30418
  title: "",
29888
30419
  key: "pass",
29889
30420
  width: 40,
29890
- render: (_, r) => r.pass ? /* @__PURE__ */ jsx114(CheckCircle3, { size: 16, color: "#22c55e" }) : /* @__PURE__ */ jsx114(XCircle2, { size: 16, color: "#ef4444" })
30421
+ render: (_, r) => r.pass ? /* @__PURE__ */ jsx115(CheckCircle3, { size: 16, color: "#22c55e" }) : /* @__PURE__ */ jsx115(XCircle2, { size: 16, color: "#ef4444" })
29891
30422
  },
29892
30423
  { title: "Suite", dataIndex: "suiteName", key: "suite", width: 100 },
29893
30424
  {
@@ -29897,16 +30428,16 @@ var EvalRunResults = ({ runId, onBack }) => {
29897
30428
  render: (_, r) => {
29898
30429
  const humanMsg = r.messages?.find((m) => m.role === "human");
29899
30430
  const text = humanMsg?.content || "\u2014";
29900
- return /* @__PURE__ */ jsx114(Text45, { style: { fontSize: 13 }, ellipsis: { tooltip: text }, children: text });
30431
+ return /* @__PURE__ */ jsx115(Text46, { style: { fontSize: 13 }, ellipsis: { tooltip: text }, children: text });
29901
30432
  }
29902
30433
  },
29903
30434
  {
29904
30435
  title: "Result",
29905
30436
  key: "result",
29906
30437
  render: (_, r) => {
29907
- if (r.error) return /* @__PURE__ */ jsx114(Text45, { type: "danger", style: { fontSize: 12 }, ellipsis: { tooltip: r.error }, children: r.error });
30438
+ if (r.error) return /* @__PURE__ */ jsx115(Text46, { type: "danger", style: { fontSize: 12 }, ellipsis: { tooltip: r.error }, children: r.error });
29908
30439
  const s = r.summary || "\u2014";
29909
- return /* @__PURE__ */ jsx114(Text45, { style: { fontSize: 13 }, ellipsis: { tooltip: s }, children: s });
30440
+ return /* @__PURE__ */ jsx115(Text46, { style: { fontSize: 13 }, ellipsis: { tooltip: s }, children: s });
29910
30441
  }
29911
30442
  },
29912
30443
  {
@@ -29916,7 +30447,7 @@ var EvalRunResults = ({ runId, onBack }) => {
29916
30447
  align: "center",
29917
30448
  render: (_, r) => {
29918
30449
  const n = r.dimensionResults?.length || 0;
29919
- return n > 0 ? /* @__PURE__ */ jsx114(Tag27, { children: n }) : /* @__PURE__ */ jsx114(Text45, { type: "secondary", children: "\u2014" });
30450
+ return n > 0 ? /* @__PURE__ */ jsx115(Tag27, { children: n }) : /* @__PURE__ */ jsx115(Text46, { type: "secondary", children: "\u2014" });
29920
30451
  }
29921
30452
  },
29922
30453
  {
@@ -29925,7 +30456,7 @@ var EvalRunResults = ({ runId, onBack }) => {
29925
30456
  key: "score",
29926
30457
  width: 80,
29927
30458
  align: "center",
29928
- render: (s) => /* @__PURE__ */ jsx114(Tag27, { color: s >= 80 ? "success" : "error", children: typeof s === "number" ? s.toFixed(1) : "\u2014" })
30459
+ render: (s) => /* @__PURE__ */ jsx115(Tag27, { color: s >= 80 ? "success" : "error", children: typeof s === "number" ? s.toFixed(1) : "\u2014" })
29929
30460
  }
29930
30461
  ]
29931
30462
  }
@@ -29935,8 +30466,8 @@ var EvalRunResults = ({ runId, onBack }) => {
29935
30466
  };
29936
30467
 
29937
30468
  // src/components/Eval/EvalPanel.tsx
29938
- import { jsx as jsx115, jsxs as jsxs83 } from "react/jsx-runtime";
29939
- var { Text: Text46, Title: Title15, Paragraph: Paragraph3 } = Typography57;
30469
+ import { jsx as jsx116, jsxs as jsxs84 } from "react/jsx-runtime";
30470
+ var { Text: Text47, Title: Title15, Paragraph: Paragraph3 } = Typography58;
29940
30471
  var useStyle16 = createStyles34(({ token, css }) => ({
29941
30472
  shell: css`
29942
30473
  display: flex;
@@ -30111,14 +30642,14 @@ var EvalPanel = () => {
30111
30642
  const [page, setPage] = useState73("dashboard");
30112
30643
  const [suiteId, setSuiteId] = useState73("");
30113
30644
  const [runId, setRunId] = useState73("");
30114
- React64.useEffect(() => {
30645
+ React65.useEffect(() => {
30115
30646
  if (!projectId && projects.length > 0) {
30116
30647
  setProjectId(projects[0].id);
30117
30648
  }
30118
30649
  }, [projects, projectId]);
30119
30650
  const { suites } = useEvalSuites(projectId);
30120
30651
  const { runs, start, remove } = useEvalRuns(projectId);
30121
- const stats = useMemo30(() => {
30652
+ const stats = useMemo31(() => {
30122
30653
  const totalCases = suites.reduce((s, x) => s + (x.caseCount ?? 0), 0);
30123
30654
  const latest = runs[0];
30124
30655
  const passRate = latest?.totalCases > 0 ? Math.round(latest.passedCases / latest.totalCases * 100) : null;
@@ -30129,105 +30660,105 @@ var EvalPanel = () => {
30129
30660
  if (sid !== void 0) setSuiteId(sid);
30130
30661
  if (rid !== void 0) setRunId(rid);
30131
30662
  };
30132
- const StatBox = ({ icon, bg, label, value }) => /* @__PURE__ */ jsx115(Card28, { className: styles.statCard, styles: { body: { padding: 0 } }, size: "small", children: /* @__PURE__ */ jsxs83("div", { className: styles.statInner, children: [
30133
- /* @__PURE__ */ jsx115("div", { className: styles.statIcon, style: { background: bg }, children: icon }),
30134
- /* @__PURE__ */ jsxs83("div", { children: [
30135
- /* @__PURE__ */ jsx115("div", { className: styles.statValue, children: value }),
30136
- /* @__PURE__ */ jsx115("div", { className: styles.statLabel, children: label })
30663
+ const StatBox = ({ icon, bg, label, value }) => /* @__PURE__ */ jsx116(Card28, { className: styles.statCard, styles: { body: { padding: 0 } }, size: "small", children: /* @__PURE__ */ jsxs84("div", { className: styles.statInner, children: [
30664
+ /* @__PURE__ */ jsx116("div", { className: styles.statIcon, style: { background: bg }, children: icon }),
30665
+ /* @__PURE__ */ jsxs84("div", { children: [
30666
+ /* @__PURE__ */ jsx116("div", { className: styles.statValue, children: value }),
30667
+ /* @__PURE__ */ jsx116("div", { className: styles.statLabel, children: label })
30137
30668
  ] })
30138
30669
  ] }) });
30139
30670
  if (page === "dashboard") {
30140
- return /* @__PURE__ */ jsxs83("div", { className: styles.shell, children: [
30141
- /* @__PURE__ */ jsxs83("div", { className: styles.topBar, children: [
30142
- /* @__PURE__ */ jsxs83("div", { className: styles.topLeft, children: [
30143
- /* @__PURE__ */ jsx115("div", { className: styles.pageIcon, children: /* @__PURE__ */ jsx115(FlaskConical2, { size: 20, color: token.colorPrimary }) }),
30144
- /* @__PURE__ */ jsx115("span", { className: styles.pageTitle, children: "Evaluation Dashboard" })
30671
+ return /* @__PURE__ */ jsxs84("div", { className: styles.shell, children: [
30672
+ /* @__PURE__ */ jsxs84("div", { className: styles.topBar, children: [
30673
+ /* @__PURE__ */ jsxs84("div", { className: styles.topLeft, children: [
30674
+ /* @__PURE__ */ jsx116("div", { className: styles.pageIcon, children: /* @__PURE__ */ jsx116(FlaskConical2, { size: 20, color: token.colorPrimary }) }),
30675
+ /* @__PURE__ */ jsx116("span", { className: styles.pageTitle, children: "Evaluation Dashboard" })
30145
30676
  ] }),
30146
- /* @__PURE__ */ jsxs83("div", { className: styles.topRight, children: [
30147
- /* @__PURE__ */ jsx115(
30677
+ /* @__PURE__ */ jsxs84("div", { className: styles.topRight, children: [
30678
+ /* @__PURE__ */ jsx116(
30148
30679
  Dropdown2,
30149
30680
  {
30150
30681
  menu: {
30151
30682
  items: projects.map((p) => ({
30152
30683
  key: p.id,
30153
- label: /* @__PURE__ */ jsxs83("div", { children: [
30154
- /* @__PURE__ */ jsx115("div", { children: p.name }),
30155
- /* @__PURE__ */ jsx115(Text46, { type: "secondary", style: { fontSize: 11 }, children: p.targetServerConfig?.base_url || "\u2014" })
30684
+ label: /* @__PURE__ */ jsxs84("div", { children: [
30685
+ /* @__PURE__ */ jsx116("div", { children: p.name }),
30686
+ /* @__PURE__ */ jsx116(Text47, { type: "secondary", style: { fontSize: 11 }, children: p.targetServerConfig?.base_url || "\u2014" })
30156
30687
  ] }),
30157
30688
  onClick: () => setProjectId(p.id)
30158
30689
  }))
30159
30690
  },
30160
- children: /* @__PURE__ */ jsxs83("div", { className: styles.projectBtn, children: [
30161
- /* @__PURE__ */ jsx115("div", { className: styles.projectDot }),
30162
- /* @__PURE__ */ jsxs83("div", { style: { textAlign: "left" }, children: [
30163
- /* @__PURE__ */ jsx115("div", { style: { lineHeight: 1.3 }, children: projects.find((p) => p.id === projectId)?.name || "Select Project" }),
30164
- /* @__PURE__ */ jsx115(Text46, { type: "secondary", style: { fontSize: 11 }, children: projects.find((p) => p.id === projectId)?.targetServerConfig?.base_url || "" })
30691
+ children: /* @__PURE__ */ jsxs84("div", { className: styles.projectBtn, children: [
30692
+ /* @__PURE__ */ jsx116("div", { className: styles.projectDot }),
30693
+ /* @__PURE__ */ jsxs84("div", { style: { textAlign: "left" }, children: [
30694
+ /* @__PURE__ */ jsx116("div", { style: { lineHeight: 1.3 }, children: projects.find((p) => p.id === projectId)?.name || "Select Project" }),
30695
+ /* @__PURE__ */ jsx116(Text47, { type: "secondary", style: { fontSize: 11 }, children: projects.find((p) => p.id === projectId)?.targetServerConfig?.base_url || "" })
30165
30696
  ] }),
30166
- /* @__PURE__ */ jsx115(ChevronDown5, { size: 14 })
30697
+ /* @__PURE__ */ jsx116(ChevronDown5, { size: 14 })
30167
30698
  ] })
30168
30699
  }
30169
30700
  ),
30170
- /* @__PURE__ */ jsx115(Button53, { type: "primary", icon: /* @__PURE__ */ jsx115(Play2, { size: 16 }), onClick: () => navTo("suites"), children: "Go to Suites" })
30701
+ /* @__PURE__ */ jsx116(Button53, { type: "primary", icon: /* @__PURE__ */ jsx116(Play2, { size: 16 }), onClick: () => navTo("suites"), children: "Go to Suites" })
30171
30702
  ] })
30172
30703
  ] }),
30173
- /* @__PURE__ */ jsxs83("div", { className: styles.body, children: [
30174
- /* @__PURE__ */ jsxs83(Row4, { gutter: [16, 16], className: styles.statRow, children: [
30175
- /* @__PURE__ */ jsx115(Col4, { span: 6, children: /* @__PURE__ */ jsx115(
30704
+ /* @__PURE__ */ jsxs84("div", { className: styles.body, children: [
30705
+ /* @__PURE__ */ jsxs84(Row4, { gutter: [16, 16], className: styles.statRow, children: [
30706
+ /* @__PURE__ */ jsx116(Col4, { span: 6, children: /* @__PURE__ */ jsx116(
30176
30707
  StatBox,
30177
30708
  {
30178
- icon: /* @__PURE__ */ jsx115(FlaskConical2, { size: 22, color: token.colorPrimary }),
30709
+ icon: /* @__PURE__ */ jsx116(FlaskConical2, { size: 22, color: token.colorPrimary }),
30179
30710
  bg: `${token.colorPrimary}14`,
30180
30711
  label: "Test Suites",
30181
30712
  value: stats.suiteCount
30182
30713
  }
30183
30714
  ) }),
30184
- /* @__PURE__ */ jsx115(Col4, { span: 6, children: /* @__PURE__ */ jsx115(
30715
+ /* @__PURE__ */ jsx116(Col4, { span: 6, children: /* @__PURE__ */ jsx116(
30185
30716
  StatBox,
30186
30717
  {
30187
- icon: /* @__PURE__ */ jsx115(TestTube26, { size: 22, color: token.colorSuccess }),
30718
+ icon: /* @__PURE__ */ jsx116(TestTube26, { size: 22, color: token.colorSuccess }),
30188
30719
  bg: `${token.colorSuccess}14`,
30189
30720
  label: "Test Cases",
30190
30721
  value: stats.totalCases
30191
30722
  }
30192
30723
  ) }),
30193
- /* @__PURE__ */ jsx115(Col4, { span: 6, children: /* @__PURE__ */ jsx115(
30724
+ /* @__PURE__ */ jsx116(Col4, { span: 6, children: /* @__PURE__ */ jsx116(
30194
30725
  StatBox,
30195
30726
  {
30196
- icon: /* @__PURE__ */ jsx115(TrendingUp, { size: 22, color: token.colorInfo }),
30727
+ icon: /* @__PURE__ */ jsx116(TrendingUp, { size: 22, color: token.colorInfo }),
30197
30728
  bg: `${token.colorInfo}14`,
30198
30729
  label: "Total Runs",
30199
30730
  value: stats.runCount
30200
30731
  }
30201
30732
  ) }),
30202
- /* @__PURE__ */ jsx115(Col4, { span: 6, children: /* @__PURE__ */ jsx115(
30733
+ /* @__PURE__ */ jsx116(Col4, { span: 6, children: /* @__PURE__ */ jsx116(
30203
30734
  StatBox,
30204
30735
  {
30205
- icon: stats.passRate !== null && stats.passRate >= 80 ? /* @__PURE__ */ jsx115(CheckCircle4, { size: 22, color: token.colorSuccess }) : /* @__PURE__ */ jsx115(XCircle3, { size: 22, color: token.colorWarning }),
30736
+ icon: stats.passRate !== null && stats.passRate >= 80 ? /* @__PURE__ */ jsx116(CheckCircle4, { size: 22, color: token.colorSuccess }) : /* @__PURE__ */ jsx116(XCircle3, { size: 22, color: token.colorWarning }),
30206
30737
  bg: stats.passRate !== null ? `${token.colorSuccess}14` : `${token.colorFill}`,
30207
30738
  label: "Latest Pass Rate",
30208
30739
  value: stats.passRate !== null ? `${stats.passRate}%` : "N/A"
30209
30740
  }
30210
30741
  ) })
30211
30742
  ] }),
30212
- /* @__PURE__ */ jsxs83("div", { className: styles.section, children: [
30213
- /* @__PURE__ */ jsxs83("div", { className: styles.sectionHead, children: [
30214
- /* @__PURE__ */ jsxs83("h3", { className: styles.sectionTitle, children: [
30215
- /* @__PURE__ */ jsx115(FlaskConical2, { size: 16 }),
30743
+ /* @__PURE__ */ jsxs84("div", { className: styles.section, children: [
30744
+ /* @__PURE__ */ jsxs84("div", { className: styles.sectionHead, children: [
30745
+ /* @__PURE__ */ jsxs84("h3", { className: styles.sectionTitle, children: [
30746
+ /* @__PURE__ */ jsx116(FlaskConical2, { size: 16 }),
30216
30747
  "Evaluation Suites"
30217
30748
  ] }),
30218
- /* @__PURE__ */ jsxs83(Button53, { size: "small", type: "text", onClick: () => navTo("suites"), children: [
30749
+ /* @__PURE__ */ jsxs84(Button53, { size: "small", type: "text", onClick: () => navTo("suites"), children: [
30219
30750
  "View All ",
30220
- /* @__PURE__ */ jsx115(ArrowRight3, { size: 14, style: { marginLeft: 4 } })
30751
+ /* @__PURE__ */ jsx116(ArrowRight3, { size: 14, style: { marginLeft: 4 } })
30221
30752
  ] })
30222
30753
  ] }),
30223
- /* @__PURE__ */ jsx115(EvalSuiteCardList, { projectId, onSelectSuite: (_, sid) => navTo("suite", sid) })
30754
+ /* @__PURE__ */ jsx116(EvalSuiteCardList, { projectId, onSelectSuite: (_, sid) => navTo("suite", sid) })
30224
30755
  ] }),
30225
- /* @__PURE__ */ jsxs83("div", { className: styles.section, children: [
30226
- /* @__PURE__ */ jsx115("div", { className: styles.sectionHead, children: /* @__PURE__ */ jsxs83("h3", { className: styles.sectionTitle, children: [
30227
- /* @__PURE__ */ jsx115(TrendingUp, { size: 16 }),
30756
+ /* @__PURE__ */ jsxs84("div", { className: styles.section, children: [
30757
+ /* @__PURE__ */ jsx116("div", { className: styles.sectionHead, children: /* @__PURE__ */ jsxs84("h3", { className: styles.sectionTitle, children: [
30758
+ /* @__PURE__ */ jsx116(TrendingUp, { size: 16 }),
30228
30759
  "Recent Runs"
30229
30760
  ] }) }),
30230
- /* @__PURE__ */ jsx115(Card28, { styles: { body: { padding: 0 } }, size: "small", children: runs.length === 0 ? /* @__PURE__ */ jsx115("div", { style: { padding: 40, textAlign: "center" }, children: /* @__PURE__ */ jsx115(Text46, { type: "secondary", children: "No runs yet. Go to Suites to run your first evaluation." }) }) : runs.slice(0, 5).map((r) => {
30761
+ /* @__PURE__ */ jsx116(Card28, { styles: { body: { padding: 0 } }, size: "small", children: runs.length === 0 ? /* @__PURE__ */ jsx116("div", { style: { padding: 40, textAlign: "center" }, children: /* @__PURE__ */ jsx116(Text47, { type: "secondary", children: "No runs yet. Go to Suites to run your first evaluation." }) }) : runs.slice(0, 5).map((r) => {
30231
30762
  const meta = statusMeta[r.status] || { color: "default", label: r.status };
30232
30763
  const createdAt = r.createdAt ? new Date(r.createdAt) : null;
30233
30764
  const completedAt = r.completedAt ? new Date(r.completedAt) : null;
@@ -30243,29 +30774,29 @@ var EvalPanel = () => {
30243
30774
  return `${Math.floor(ms / 6e4)}m ${Math.round(ms % 6e4 / 1e3)}s`;
30244
30775
  };
30245
30776
  const shortId = r.id?.slice(0, 8);
30246
- return /* @__PURE__ */ jsxs83("div", { className: styles.runRow, onClick: () => navTo("run", void 0, r.id), children: [
30247
- /* @__PURE__ */ jsxs83("div", { className: styles.runRowLeft, children: [
30248
- /* @__PURE__ */ jsx115(Text46, { code: true, style: { fontSize: 12, marginRight: 8 }, children: shortId }),
30249
- createdAt && /* @__PURE__ */ jsxs83(Text46, { type: "secondary", style: { fontSize: 12, minWidth: 120 }, children: [
30250
- /* @__PURE__ */ jsx115(Clock4, { size: 11, style: { marginRight: 3, verticalAlign: "middle" } }),
30777
+ return /* @__PURE__ */ jsxs84("div", { className: styles.runRow, onClick: () => navTo("run", void 0, r.id), children: [
30778
+ /* @__PURE__ */ jsxs84("div", { className: styles.runRowLeft, children: [
30779
+ /* @__PURE__ */ jsx116(Text47, { code: true, style: { fontSize: 12, marginRight: 8 }, children: shortId }),
30780
+ createdAt && /* @__PURE__ */ jsxs84(Text47, { type: "secondary", style: { fontSize: 12, minWidth: 120 }, children: [
30781
+ /* @__PURE__ */ jsx116(Clock5, { size: 11, style: { marginRight: 3, verticalAlign: "middle" } }),
30251
30782
  fmtDate(createdAt)
30252
30783
  ] }),
30253
- /* @__PURE__ */ jsxs83(Text46, { style: { fontSize: 13 }, children: [
30254
- /* @__PURE__ */ jsx115(Text46, { type: "success", children: r.passedCases }),
30255
- /* @__PURE__ */ jsx115(Text46, { type: "secondary", children: " passed " }),
30256
- /* @__PURE__ */ jsx115(Text46, { type: "danger", children: r.failedCases }),
30257
- /* @__PURE__ */ jsx115(Text46, { type: "secondary", children: " failed" })
30784
+ /* @__PURE__ */ jsxs84(Text47, { style: { fontSize: 13 }, children: [
30785
+ /* @__PURE__ */ jsx116(Text47, { type: "success", children: r.passedCases }),
30786
+ /* @__PURE__ */ jsx116(Text47, { type: "secondary", children: " passed " }),
30787
+ /* @__PURE__ */ jsx116(Text47, { type: "danger", children: r.failedCases }),
30788
+ /* @__PURE__ */ jsx116(Text47, { type: "secondary", children: " failed" })
30258
30789
  ] }),
30259
- passRate !== null && /* @__PURE__ */ jsxs83(Tag28, { color: passRate >= 80 ? "success" : passRate >= 50 ? "warning" : "error", children: [
30790
+ passRate !== null && /* @__PURE__ */ jsxs84(Tag28, { color: passRate >= 80 ? "success" : passRate >= 50 ? "warning" : "error", children: [
30260
30791
  passRate,
30261
30792
  "%"
30262
30793
  ] })
30263
30794
  ] }),
30264
- /* @__PURE__ */ jsxs83("div", { className: styles.runRowRight, style: { gap: 16 }, children: [
30265
- durationMs !== null && /* @__PURE__ */ jsx115(Text46, { type: "secondary", style: { fontSize: 12 }, children: fmtDuration(durationMs) }),
30266
- /* @__PURE__ */ jsx115(Tag28, { color: meta.color, style: { margin: 0 }, children: meta.label }),
30267
- /* @__PURE__ */ jsx115(Text46, { strong: true, style: { fontSize: 15, minWidth: 40, textAlign: "right" }, children: typeof r.avgScore === "number" ? r.avgScore.toFixed(1) : "\u2014" }),
30268
- /* @__PURE__ */ jsx115(
30795
+ /* @__PURE__ */ jsxs84("div", { className: styles.runRowRight, style: { gap: 16 }, children: [
30796
+ durationMs !== null && /* @__PURE__ */ jsx116(Text47, { type: "secondary", style: { fontSize: 12 }, children: fmtDuration(durationMs) }),
30797
+ /* @__PURE__ */ jsx116(Tag28, { color: meta.color, style: { margin: 0 }, children: meta.label }),
30798
+ /* @__PURE__ */ jsx116(Text47, { strong: true, style: { fontSize: 15, minWidth: 40, textAlign: "right" }, children: typeof r.avgScore === "number" ? r.avgScore.toFixed(1) : "\u2014" }),
30799
+ /* @__PURE__ */ jsx116(
30269
30800
  Popconfirm10,
30270
30801
  {
30271
30802
  title: "Delete this run?",
@@ -30278,13 +30809,13 @@ var EvalPanel = () => {
30278
30809
  onCancel: (e) => e?.stopPropagation(),
30279
30810
  okText: "Delete",
30280
30811
  okButtonProps: { danger: true },
30281
- children: /* @__PURE__ */ jsx115(
30812
+ children: /* @__PURE__ */ jsx116(
30282
30813
  Button53,
30283
30814
  {
30284
30815
  type: "text",
30285
30816
  size: "small",
30286
30817
  danger: true,
30287
- icon: /* @__PURE__ */ jsx115(Trash27, { size: 14 }),
30818
+ icon: /* @__PURE__ */ jsx116(Trash27, { size: 14 }),
30288
30819
  onClick: (e) => e.stopPropagation()
30289
30820
  }
30290
30821
  )
@@ -30307,23 +30838,23 @@ var EvalPanel = () => {
30307
30838
  setName("");
30308
30839
  setShowAdd(false);
30309
30840
  };
30310
- return /* @__PURE__ */ jsxs83("div", { className: styles.shell, children: [
30311
- /* @__PURE__ */ jsxs83("div", { className: styles.topBar, children: [
30312
- /* @__PURE__ */ jsxs83("div", { className: styles.topLeft, children: [
30313
- /* @__PURE__ */ jsx115("button", { className: styles.breadcrumb, onClick: () => navTo("dashboard"), children: "Dashboard" }),
30314
- /* @__PURE__ */ jsx115("span", { className: styles.breadcrumbSep, children: "/" }),
30315
- /* @__PURE__ */ jsx115("span", { className: styles.pageTitle, children: "Test Suites" })
30841
+ return /* @__PURE__ */ jsxs84("div", { className: styles.shell, children: [
30842
+ /* @__PURE__ */ jsxs84("div", { className: styles.topBar, children: [
30843
+ /* @__PURE__ */ jsxs84("div", { className: styles.topLeft, children: [
30844
+ /* @__PURE__ */ jsx116("button", { className: styles.breadcrumb, onClick: () => navTo("dashboard"), children: "Dashboard" }),
30845
+ /* @__PURE__ */ jsx116("span", { className: styles.breadcrumbSep, children: "/" }),
30846
+ /* @__PURE__ */ jsx116("span", { className: styles.pageTitle, children: "Test Suites" })
30316
30847
  ] }),
30317
- /* @__PURE__ */ jsxs83("div", { className: styles.topRight, children: [
30318
- /* @__PURE__ */ jsx115(Button53, { icon: /* @__PURE__ */ jsx115(Play2, { size: 16 }), onClick: () => setShowAdd(!showAdd), children: "New Suite" }),
30319
- /* @__PURE__ */ jsx115(Button53, { type: "primary", icon: /* @__PURE__ */ jsx115(Play2, { size: 16 }), onClick: async () => {
30848
+ /* @__PURE__ */ jsxs84("div", { className: styles.topRight, children: [
30849
+ /* @__PURE__ */ jsx116(Button53, { icon: /* @__PURE__ */ jsx116(Play2, { size: 16 }), onClick: () => setShowAdd(!showAdd), children: "New Suite" }),
30850
+ /* @__PURE__ */ jsx116(Button53, { type: "primary", icon: /* @__PURE__ */ jsx116(Play2, { size: 16 }), onClick: async () => {
30320
30851
  const r = await start(projectId);
30321
30852
  if (r?.run_id) navTo("run", void 0, r.run_id);
30322
30853
  }, children: "Run All" })
30323
30854
  ] })
30324
30855
  ] }),
30325
- showAdd && /* @__PURE__ */ jsxs83("div", { style: { padding: "12px 28px", borderBottom: `1px solid ${token.colorBorderSecondary}`, display: "flex", gap: 8 }, children: [
30326
- /* @__PURE__ */ jsx115(
30856
+ showAdd && /* @__PURE__ */ jsxs84("div", { style: { padding: "12px 28px", borderBottom: `1px solid ${token.colorBorderSecondary}`, display: "flex", gap: 8 }, children: [
30857
+ /* @__PURE__ */ jsx116(
30327
30858
  "input",
30328
30859
  {
30329
30860
  type: "text",
@@ -30342,15 +30873,15 @@ var EvalPanel = () => {
30342
30873
  }
30343
30874
  }
30344
30875
  ),
30345
- /* @__PURE__ */ jsx115(Button53, { type: "primary", size: "small", onClick: handleAdd, children: "Create" }),
30346
- /* @__PURE__ */ jsx115(Button53, { size: "small", onClick: () => setShowAdd(false), children: "Cancel" })
30876
+ /* @__PURE__ */ jsx116(Button53, { type: "primary", size: "small", onClick: handleAdd, children: "Create" }),
30877
+ /* @__PURE__ */ jsx116(Button53, { size: "small", onClick: () => setShowAdd(false), children: "Cancel" })
30347
30878
  ] }),
30348
- /* @__PURE__ */ jsx115("div", { className: styles.body, children: /* @__PURE__ */ jsx115(EvalSuiteCardList, { projectId, onSelectSuite: (_, sid) => navTo("suite", sid) }) })
30879
+ /* @__PURE__ */ jsx116("div", { className: styles.body, children: /* @__PURE__ */ jsx116(EvalSuiteCardList, { projectId, onSelectSuite: (_, sid) => navTo("suite", sid) }) })
30349
30880
  ] });
30350
30881
  };
30351
- if (page === "suites") return /* @__PURE__ */ jsx115(SuiteListPage, {});
30882
+ if (page === "suites") return /* @__PURE__ */ jsx116(SuiteListPage, {});
30352
30883
  if (page === "suite" && suiteId) {
30353
- return /* @__PURE__ */ jsx115(
30884
+ return /* @__PURE__ */ jsx116(
30354
30885
  EvalSuiteDetail,
30355
30886
  {
30356
30887
  projectId,
@@ -30361,29 +30892,30 @@ var EvalPanel = () => {
30361
30892
  );
30362
30893
  }
30363
30894
  if (page === "run" && runId) {
30364
- return /* @__PURE__ */ jsx115(EvalRunResults, { runId, onBack: () => navTo("dashboard") });
30895
+ return /* @__PURE__ */ jsx116(EvalRunResults, { runId, onBack: () => navTo("dashboard") });
30365
30896
  }
30366
30897
  return null;
30367
30898
  };
30368
30899
 
30369
30900
  // src/components/Chat/PersonalAssistantPage.tsx
30370
30901
  import { useEffect as useEffect50, useState as useState74, useCallback as useCallback38, useRef as useRef26 } from "react";
30371
- import { Card as Card29, Button as Button54, Input as Input16, Typography as Typography58, message as message18, Dropdown as Dropdown3, Modal as Modal19 } from "antd";
30902
+ import { Card as Card29, Button as Button54, Input as Input16, Typography as Typography59, message as message18, Dropdown as Dropdown3, Modal as Modal19 } from "antd";
30372
30903
  import { createStyles as createStyles35 } from "antd-style";
30373
- import { Bot as Bot4, Sparkles as Sparkles2, ArrowRight as ArrowRight4, ArrowLeft as ArrowLeft3, Smile, Zap, Heart, Lightbulb, Edit3, MoreHorizontal, Trash2 as Trash28 } from "lucide-react";
30904
+ import { Bot as Bot4, Sparkles as Sparkles3, ArrowRight as ArrowRight4, ArrowLeft as ArrowLeft3, Smile, Zap, Heart, Lightbulb, Edit3, MoreHorizontal, Trash2 as Trash28 } from "lucide-react";
30905
+ import { Client as Client2 } from "@axiom-lattice/client-sdk";
30374
30906
 
30375
30907
  // src/components/Chat/LatticeAgentWorkspace.tsx
30376
- import { jsx as jsx116 } from "react/jsx-runtime";
30908
+ import { jsx as jsx117 } from "react/jsx-runtime";
30377
30909
  var LatticeAgentWorkspace = ({
30378
30910
  workspaceId,
30379
30911
  projectId = "default",
30380
30912
  assistant_id,
30381
30913
  ...chatProps
30382
- }) => /* @__PURE__ */ jsx116(WorkspaceContextProvider, { workspaceId, projectId, children: /* @__PURE__ */ jsx116(AssistantContextProvider, { autoLoad: true, initialAssistantId: assistant_id, children: /* @__PURE__ */ jsx116(LatticeChat, { showProjectSelector: false, assistant_id, ...chatProps }) }) });
30914
+ }) => /* @__PURE__ */ jsx117(WorkspaceContextProvider, { workspaceId, projectId, children: /* @__PURE__ */ jsx117(AssistantContextProvider, { autoLoad: true, initialAssistantId: assistant_id, children: /* @__PURE__ */ jsx117(LatticeChat, { showProjectSelector: false, assistant_id, ...chatProps }) }) });
30383
30915
 
30384
30916
  // src/components/Chat/PersonalAssistantPage.tsx
30385
- import { Fragment as Fragment23, jsx as jsx117, jsxs as jsxs84 } from "react/jsx-runtime";
30386
- var { Title: Title16, Text: Text47, Paragraph: Paragraph4 } = Typography58;
30917
+ import { Fragment as Fragment23, jsx as jsx118, jsxs as jsxs85 } from "react/jsx-runtime";
30918
+ var { Title: Title16, Text: Text48, Paragraph: Paragraph4 } = Typography59;
30387
30919
  var useStyles19 = createStyles35(({ css, token }) => ({
30388
30920
  container: css` display: flex; flex-direction: column; height: 100%; padding: 24px; overflow-y: auto; `,
30389
30921
  setupWrap: css` max-width: 520px; margin: 30px auto 0; `,
@@ -30420,11 +30952,11 @@ var useStyles19 = createStyles35(({ css, token }) => ({
30420
30952
  chatFill: css` flex: 1; min-height: 0; `
30421
30953
  }));
30422
30954
  var PERSONALITIES = [
30423
- { key: "warm_caring", icon: /* @__PURE__ */ jsx117(Heart, { size: 20 }), bg: "#fef2f2", fg: "#ef4444", title: "Warm & Caring", desc: "Gentle, patient, emotionally supportive \u2014 like a close friend who always has your back." },
30424
- { key: "witty_playful", icon: /* @__PURE__ */ jsx117(Smile, { size: 20 }), bg: "#fefce8", fg: "#eab308", title: "Witty & Playful", desc: "Quick with a joke, a little mischievous, keeps things light." },
30425
- { key: "energetic_motivator", icon: /* @__PURE__ */ jsx117(Zap, { size: 20 }), bg: "#eff6ff", fg: "#3b82f6", title: "Energetic Motivator", desc: "High-energy hype machine. Celebrates wins, never lets you give up." },
30426
- { key: "wise_mentor", icon: /* @__PURE__ */ jsx117(Lightbulb, { size: 20 }), bg: "#f5f3ff", fg: "#8b5cf6", title: "Wise Mentor", desc: "Calm, thoughtful, insightful. Asks the right questions." },
30427
- { key: "custom", icon: /* @__PURE__ */ jsx117(Edit3, { size: 20 }), bg: "#f5f5f5", fg: "#737373", title: "Custom", desc: "Describe your own \u2014 a mix or something completely unique." }
30955
+ { key: "warm_caring", icon: /* @__PURE__ */ jsx118(Heart, { size: 20 }), bg: "#fef2f2", fg: "#ef4444", title: "Warm & Caring", desc: "Gentle, patient, emotionally supportive \u2014 like a close friend who always has your back." },
30956
+ { key: "witty_playful", icon: /* @__PURE__ */ jsx118(Smile, { size: 20 }), bg: "#fefce8", fg: "#eab308", title: "Witty & Playful", desc: "Quick with a joke, a little mischievous, keeps things light." },
30957
+ { key: "energetic_motivator", icon: /* @__PURE__ */ jsx118(Zap, { size: 20 }), bg: "#eff6ff", fg: "#3b82f6", title: "Energetic Motivator", desc: "High-energy hype machine. Celebrates wins, never lets you give up." },
30958
+ { key: "wise_mentor", icon: /* @__PURE__ */ jsx118(Lightbulb, { size: 20 }), bg: "#f5f3ff", fg: "#8b5cf6", title: "Wise Mentor", desc: "Calm, thoughtful, insightful. Asks the right questions." },
30959
+ { key: "custom", icon: /* @__PURE__ */ jsx118(Edit3, { size: 20 }), bg: "#f5f5f5", fg: "#737373", title: "Custom", desc: "Describe your own \u2014 a mix or something completely unique." }
30428
30960
  ];
30429
30961
  var PERSONALITY_MAP = {
30430
30962
  warm_caring: "\u4F60\u662F\u4E00\u4E2A\u6E29\u6696\u3001\u8D34\u5FC3\u7684\u966A\u4F34\u8005\u3002\u4F60\u8BF4\u8BDD\u6E29\u67D4\uFF0C\u6709\u8010\u5FC3\uFF0C\u5584\u4E8E\u503E\u542C\u3002\u4F60\u7684\u5B58\u5728\u5C31\u50CF\u4E00\u676F\u70ED\u8336\u2014\u2014\u5B89\u9759\u5730\u966A\u4F34\uFF0C\u4F46\u603B\u662F\u5728\u90A3\u91CC\u3002",
@@ -30471,6 +31003,7 @@ var PersonalAssistantPage = () => {
30471
31003
  }
30472
31004
  }, [name, personalityText, post]);
30473
31005
  const resolveThread = useCallback38(async (assistantId2) => {
31006
+ Client2.setWorkspaceContext(workspaceId || void 0, projectId || void 0);
30474
31007
  const day = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
30475
31008
  const list = await get(
30476
31009
  `/api/assistants/${assistantId2}/threads`
@@ -30482,7 +31015,7 @@ var PersonalAssistantPage = () => {
30482
31015
  { metadata: { label: day } }
30483
31016
  );
30484
31017
  return created.data.id;
30485
- }, [get, post]);
31018
+ }, [get, post, workspaceId, projectId]);
30486
31019
  const lastDate = useRef26("");
30487
31020
  useEffect50(() => {
30488
31021
  if (!assistantId) return;
@@ -30529,10 +31062,10 @@ var PersonalAssistantPage = () => {
30529
31062
  });
30530
31063
  }, [del, setPersonalAssistant]);
30531
31064
  const moreItems = [
30532
- { key: "delete", icon: /* @__PURE__ */ jsx117(Trash28, { size: 16 }), label: "Delete", danger: true, onClick: handleDelete }
31065
+ { key: "delete", icon: /* @__PURE__ */ jsx118(Trash28, { size: 16 }), label: "Delete", danger: true, onClick: handleDelete }
30533
31066
  ];
30534
31067
  if (chatMode && assistantId && threadId) {
30535
- return /* @__PURE__ */ jsx117(
31068
+ return /* @__PURE__ */ jsx118(
30536
31069
  LatticeAgentWorkspace,
30537
31070
  {
30538
31071
  assistant_id: assistantId,
@@ -30540,18 +31073,18 @@ var PersonalAssistantPage = () => {
30540
31073
  workspaceId,
30541
31074
  projectId,
30542
31075
  menu: null,
30543
- emptyPlaceholder: /* @__PURE__ */ jsxs84("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: "100%", color: "#999", gap: 8 }, children: [
30544
- /* @__PURE__ */ jsxs84(Text47, { type: "secondary", style: { fontSize: 16 }, children: [
31076
+ emptyPlaceholder: /* @__PURE__ */ jsxs85("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: "100%", color: "#999", gap: 8 }, children: [
31077
+ /* @__PURE__ */ jsxs85(Text48, { type: "secondary", style: { fontSize: 16 }, children: [
30545
31078
  "Today is ",
30546
31079
  (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", { weekday: "long", month: "long", day: "numeric", year: "numeric" })
30547
31080
  ] }),
30548
- /* @__PURE__ */ jsx117(Text47, { type: "secondary", children: "What can I help you with?" })
31081
+ /* @__PURE__ */ jsx118(Text48, { type: "secondary", children: "What can I help you with?" })
30549
31082
  ] }),
30550
- emptyStateGreeting: /* @__PURE__ */ jsxs84(Fragment23, { children: [
31083
+ emptyStateGreeting: /* @__PURE__ */ jsxs85(Fragment23, { children: [
30551
31084
  "Hey",
30552
- userName ? /* @__PURE__ */ jsxs84(Fragment23, { children: [
31085
+ userName ? /* @__PURE__ */ jsxs85(Fragment23, { children: [
30553
31086
  ", ",
30554
- /* @__PURE__ */ jsx117("span", { style: { color: "#6366f1", fontWeight: 600 }, children: userName })
31087
+ /* @__PURE__ */ jsx118("span", { style: { color: "#6366f1", fontWeight: 600 }, children: userName })
30555
31088
  ] }) : ""
30556
31089
  ] }),
30557
31090
  emptyStateQuestion: `Today is ${(/* @__PURE__ */ new Date()).toLocaleDateString("en-US", { weekday: "long", month: "long", day: "numeric", year: "numeric" })} \u2014 What can I help you with?`,
@@ -30560,22 +31093,22 @@ var PersonalAssistantPage = () => {
30560
31093
  showDatabaseSlot: false,
30561
31094
  showSkillSlot: false,
30562
31095
  showAgentSlot: false,
30563
- headerRight: /* @__PURE__ */ jsxs84(Fragment23, { children: [
30564
- /* @__PURE__ */ jsx117(FilePanelToggle, {}),
30565
- /* @__PURE__ */ jsx117(Dropdown3, { menu: { items: moreItems }, trigger: ["click"], placement: "bottomRight", children: /* @__PURE__ */ jsx117(Button54, { type: "text", icon: /* @__PURE__ */ jsx117(MoreHorizontal, { size: 18 }) }) })
31096
+ headerRight: /* @__PURE__ */ jsxs85(Fragment23, { children: [
31097
+ /* @__PURE__ */ jsx118(FilePanelToggle, {}),
31098
+ /* @__PURE__ */ jsx118(Dropdown3, { menu: { items: moreItems }, trigger: ["click"], placement: "bottomRight", children: /* @__PURE__ */ jsx118(Button54, { type: "text", icon: /* @__PURE__ */ jsx118(MoreHorizontal, { size: 18 }) }) })
30566
31099
  ] })
30567
31100
  }
30568
31101
  );
30569
31102
  }
30570
31103
  const can0 = name.trim().length > 0;
30571
31104
  const can1 = personalityKey !== null && (personalityKey !== "custom" || customPersonality.trim().length > 0);
30572
- return /* @__PURE__ */ jsx117("div", { className: styles.container, children: /* @__PURE__ */ jsxs84("div", { className: styles.setupWrap, children: [
30573
- /* @__PURE__ */ jsx117("div", { className: styles.stepIndicator, children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx117("div", { className: `${styles.stepDot} ${i === step ? styles.stepDotActive : i < step ? styles.stepDotDone : styles.stepDotPending}` }, i)) }),
30574
- step === 0 && /* @__PURE__ */ jsxs84(Card29, { className: styles.card, children: [
30575
- /* @__PURE__ */ jsx117("div", { className: styles.avatar, children: /* @__PURE__ */ jsx117(Sparkles2, { size: 26 }) }),
30576
- /* @__PURE__ */ jsx117(Title16, { level: 3, style: { textAlign: "center", margin: "0 0 4px" }, children: "What would you like to call them?" }),
30577
- /* @__PURE__ */ jsx117(Paragraph4, { type: "secondary", style: { textAlign: "center", margin: "0 0 24px" }, children: "This is the name you'll use every day \u2014 your go-to nickname for your AI sidekick." }),
30578
- /* @__PURE__ */ jsx117(
31105
+ return /* @__PURE__ */ jsx118("div", { className: styles.container, children: /* @__PURE__ */ jsxs85("div", { className: styles.setupWrap, children: [
31106
+ /* @__PURE__ */ jsx118("div", { className: styles.stepIndicator, children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx118("div", { className: `${styles.stepDot} ${i === step ? styles.stepDotActive : i < step ? styles.stepDotDone : styles.stepDotPending}` }, i)) }),
31107
+ step === 0 && /* @__PURE__ */ jsxs85(Card29, { className: styles.card, children: [
31108
+ /* @__PURE__ */ jsx118("div", { className: styles.avatar, children: /* @__PURE__ */ jsx118(Sparkles3, { size: 26 }) }),
31109
+ /* @__PURE__ */ jsx118(Title16, { level: 3, style: { textAlign: "center", margin: "0 0 4px" }, children: "What would you like to call them?" }),
31110
+ /* @__PURE__ */ jsx118(Paragraph4, { type: "secondary", style: { textAlign: "center", margin: "0 0 24px" }, children: "This is the name you'll use every day \u2014 your go-to nickname for your AI sidekick." }),
31111
+ /* @__PURE__ */ jsx118(
30579
31112
  Input16,
30580
31113
  {
30581
31114
  size: "large",
@@ -30587,13 +31120,13 @@ var PersonalAssistantPage = () => {
30587
31120
  style: { marginBottom: 20 }
30588
31121
  }
30589
31122
  ),
30590
- /* @__PURE__ */ jsx117(Button54, { type: "primary", block: true, size: "large", disabled: !can0, onClick: () => setStep(1), icon: /* @__PURE__ */ jsx117(ArrowRight4, { size: 18 }), children: "Next" })
31123
+ /* @__PURE__ */ jsx118(Button54, { type: "primary", block: true, size: "large", disabled: !can0, onClick: () => setStep(1), icon: /* @__PURE__ */ jsx118(ArrowRight4, { size: 18 }), children: "Next" })
30591
31124
  ] }),
30592
- step === 1 && /* @__PURE__ */ jsxs84(Card29, { className: styles.card, children: [
30593
- /* @__PURE__ */ jsx117("div", { className: styles.avatar, children: /* @__PURE__ */ jsx117(Smile, { size: 26 }) }),
30594
- /* @__PURE__ */ jsx117(Title16, { level: 3, style: { textAlign: "center", margin: "0 0 4px" }, children: "What's their vibe?" }),
30595
- /* @__PURE__ */ jsx117(Paragraph4, { type: "secondary", style: { textAlign: "center", margin: "0 0 20px" }, children: "Pick the personality that feels right. This shapes how they talk and support you." }),
30596
- /* @__PURE__ */ jsx117("div", { className: styles.personalityGrid, children: PERSONALITIES.map((p) => /* @__PURE__ */ jsxs84(
31125
+ step === 1 && /* @__PURE__ */ jsxs85(Card29, { className: styles.card, children: [
31126
+ /* @__PURE__ */ jsx118("div", { className: styles.avatar, children: /* @__PURE__ */ jsx118(Smile, { size: 26 }) }),
31127
+ /* @__PURE__ */ jsx118(Title16, { level: 3, style: { textAlign: "center", margin: "0 0 4px" }, children: "What's their vibe?" }),
31128
+ /* @__PURE__ */ jsx118(Paragraph4, { type: "secondary", style: { textAlign: "center", margin: "0 0 20px" }, children: "Pick the personality that feels right. This shapes how they talk and support you." }),
31129
+ /* @__PURE__ */ jsx118("div", { className: styles.personalityGrid, children: PERSONALITIES.map((p) => /* @__PURE__ */ jsxs85(
30597
31130
  "div",
30598
31131
  {
30599
31132
  className: `${styles.personalityOption} ${personalityKey === p.key ? styles.personalityOptionSelected : ""}`,
@@ -30602,16 +31135,16 @@ var PersonalAssistantPage = () => {
30602
31135
  if (p.key !== "custom") setCustomPersonality("");
30603
31136
  },
30604
31137
  children: [
30605
- /* @__PURE__ */ jsx117("div", { className: styles.personalityIcon, style: { background: p.bg, color: p.fg }, children: p.icon }),
30606
- /* @__PURE__ */ jsxs84("div", { style: { flex: 1 }, children: [
30607
- /* @__PURE__ */ jsx117(Text47, { strong: true, style: { fontSize: 15 }, children: p.title }),
30608
- /* @__PURE__ */ jsx117(Paragraph4, { type: "secondary", style: { margin: "4px 0 0", fontSize: 13, lineHeight: 1.5 }, children: p.desc })
31138
+ /* @__PURE__ */ jsx118("div", { className: styles.personalityIcon, style: { background: p.bg, color: p.fg }, children: p.icon }),
31139
+ /* @__PURE__ */ jsxs85("div", { style: { flex: 1 }, children: [
31140
+ /* @__PURE__ */ jsx118(Text48, { strong: true, style: { fontSize: 15 }, children: p.title }),
31141
+ /* @__PURE__ */ jsx118(Paragraph4, { type: "secondary", style: { margin: "4px 0 0", fontSize: 13, lineHeight: 1.5 }, children: p.desc })
30609
31142
  ] })
30610
31143
  ]
30611
31144
  },
30612
31145
  p.key
30613
31146
  )) }),
30614
- personalityKey === "custom" && /* @__PURE__ */ jsx117(
31147
+ personalityKey === "custom" && /* @__PURE__ */ jsx118(
30615
31148
  Input16.TextArea,
30616
31149
  {
30617
31150
  rows: 3,
@@ -30622,28 +31155,28 @@ var PersonalAssistantPage = () => {
30622
31155
  style: { marginTop: 12 }
30623
31156
  }
30624
31157
  ),
30625
- /* @__PURE__ */ jsxs84("div", { style: { display: "flex", gap: 12, marginTop: 20 }, children: [
30626
- /* @__PURE__ */ jsx117(Button54, { size: "large", icon: /* @__PURE__ */ jsx117(ArrowLeft3, { size: 18 }), onClick: () => setStep(0), children: "Back" }),
30627
- /* @__PURE__ */ jsx117(Button54, { type: "primary", block: true, size: "large", disabled: !can1, onClick: () => setStep(2), icon: /* @__PURE__ */ jsx117(ArrowRight4, { size: 18 }), children: "Next" })
31158
+ /* @__PURE__ */ jsxs85("div", { style: { display: "flex", gap: 12, marginTop: 20 }, children: [
31159
+ /* @__PURE__ */ jsx118(Button54, { size: "large", icon: /* @__PURE__ */ jsx118(ArrowLeft3, { size: 18 }), onClick: () => setStep(0), children: "Back" }),
31160
+ /* @__PURE__ */ jsx118(Button54, { type: "primary", block: true, size: "large", disabled: !can1, onClick: () => setStep(2), icon: /* @__PURE__ */ jsx118(ArrowRight4, { size: 18 }), children: "Next" })
30628
31161
  ] })
30629
31162
  ] }),
30630
- step === 2 && /* @__PURE__ */ jsxs84(Card29, { className: styles.card, children: [
30631
- /* @__PURE__ */ jsx117("div", { className: styles.avatar, children: /* @__PURE__ */ jsx117(Bot4, { size: 26 }) }),
30632
- /* @__PURE__ */ jsx117(Title16, { level: 3, style: { textAlign: "center", margin: "0 0 4px" }, children: "Almost ready!" }),
30633
- /* @__PURE__ */ jsx117(Paragraph4, { type: "secondary", style: { textAlign: "center", margin: "0 0 24px" }, children: "Your assistant will have private memory and learn about you over time." }),
30634
- /* @__PURE__ */ jsxs84(Card29, { size: "small", style: { background: "#fafafa", borderRadius: 12, marginBottom: 20 }, children: [
30635
- /* @__PURE__ */ jsx117(Text47, { type: "secondary", style: { fontSize: 12, textTransform: "uppercase", letterSpacing: 1 }, children: "Name" }),
30636
- /* @__PURE__ */ jsx117("br", {}),
30637
- /* @__PURE__ */ jsx117(Text47, { strong: true, style: { fontSize: 18 }, children: name || "(not set)" }),
30638
- /* @__PURE__ */ jsxs84("div", { style: { marginTop: 10 }, children: [
30639
- /* @__PURE__ */ jsx117(Text47, { type: "secondary", style: { fontSize: 12, textTransform: "uppercase", letterSpacing: 1 }, children: "Personality" }),
30640
- /* @__PURE__ */ jsx117("br", {}),
30641
- /* @__PURE__ */ jsx117(Text47, { style: { fontSize: 14 }, children: personalityKey === "custom" ? customPersonality.slice(0, 100) : PERSONALITIES.find((p) => p.key === personalityKey)?.title })
31163
+ step === 2 && /* @__PURE__ */ jsxs85(Card29, { className: styles.card, children: [
31164
+ /* @__PURE__ */ jsx118("div", { className: styles.avatar, children: /* @__PURE__ */ jsx118(Bot4, { size: 26 }) }),
31165
+ /* @__PURE__ */ jsx118(Title16, { level: 3, style: { textAlign: "center", margin: "0 0 4px" }, children: "Almost ready!" }),
31166
+ /* @__PURE__ */ jsx118(Paragraph4, { type: "secondary", style: { textAlign: "center", margin: "0 0 24px" }, children: "Your assistant will have private memory and learn about you over time." }),
31167
+ /* @__PURE__ */ jsxs85(Card29, { size: "small", style: { background: "#fafafa", borderRadius: 12, marginBottom: 20 }, children: [
31168
+ /* @__PURE__ */ jsx118(Text48, { type: "secondary", style: { fontSize: 12, textTransform: "uppercase", letterSpacing: 1 }, children: "Name" }),
31169
+ /* @__PURE__ */ jsx118("br", {}),
31170
+ /* @__PURE__ */ jsx118(Text48, { strong: true, style: { fontSize: 18 }, children: name || "(not set)" }),
31171
+ /* @__PURE__ */ jsxs85("div", { style: { marginTop: 10 }, children: [
31172
+ /* @__PURE__ */ jsx118(Text48, { type: "secondary", style: { fontSize: 12, textTransform: "uppercase", letterSpacing: 1 }, children: "Personality" }),
31173
+ /* @__PURE__ */ jsx118("br", {}),
31174
+ /* @__PURE__ */ jsx118(Text48, { style: { fontSize: 14 }, children: personalityKey === "custom" ? customPersonality.slice(0, 100) : PERSONALITIES.find((p) => p.key === personalityKey)?.title })
30642
31175
  ] })
30643
31176
  ] }),
30644
- /* @__PURE__ */ jsxs84("div", { style: { display: "flex", gap: 12 }, children: [
30645
- /* @__PURE__ */ jsx117(Button54, { size: "large", icon: /* @__PURE__ */ jsx117(ArrowLeft3, { size: 18 }), onClick: () => setStep(1), children: "Back" }),
30646
- /* @__PURE__ */ jsx117(Button54, { type: "primary", block: true, size: "large", loading: creating, onClick: handleCreate, icon: /* @__PURE__ */ jsx117(Sparkles2, { size: 18 }), children: "Create My Assistant" })
31177
+ /* @__PURE__ */ jsxs85("div", { style: { display: "flex", gap: 12 }, children: [
31178
+ /* @__PURE__ */ jsx118(Button54, { size: "large", icon: /* @__PURE__ */ jsx118(ArrowLeft3, { size: 18 }), onClick: () => setStep(1), children: "Back" }),
31179
+ /* @__PURE__ */ jsx118(Button54, { type: "primary", block: true, size: "large", loading: creating, onClick: handleCreate, icon: /* @__PURE__ */ jsx118(Sparkles3, { size: 18 }), children: "Create My Assistant" })
30647
31180
  ] })
30648
31181
  ] })
30649
31182
  ] }) });
@@ -30655,8 +31188,8 @@ import { Spin as Spin21 } from "antd";
30655
31188
  // src/components/Chat/AgentConversations.tsx
30656
31189
  import { Conversations } from "@ant-design/x";
30657
31190
  import { theme as theme16 } from "antd";
30658
- import { useMemo as useMemo31 } from "react";
30659
- import { jsx as jsx118 } from "react/jsx-runtime";
31191
+ import { useMemo as useMemo32 } from "react";
31192
+ import { jsx as jsx119 } from "react/jsx-runtime";
30660
31193
  var AgentConversations = ({
30661
31194
  enableThreadCreation = true,
30662
31195
  enableThreadList = true
@@ -30676,7 +31209,7 @@ var AgentConversations = ({
30676
31209
  background: "transparent",
30677
31210
  borderRadius: token.borderRadius
30678
31211
  };
30679
- const threadItems = useMemo31(() => {
31212
+ const threadItems = useMemo32(() => {
30680
31213
  return threads || [];
30681
31214
  }, [threads]);
30682
31215
  const items = threadItems.map((thread2) => ({
@@ -30695,7 +31228,7 @@ var AgentConversations = ({
30695
31228
  const creation = enableThreadCreation ? {
30696
31229
  onClick: newChatClick
30697
31230
  } : void 0;
30698
- return /* @__PURE__ */ jsx118(
31231
+ return /* @__PURE__ */ jsx119(
30699
31232
  Conversations,
30700
31233
  {
30701
31234
  creation,
@@ -30711,7 +31244,7 @@ var AgentConversations = ({
30711
31244
  };
30712
31245
 
30713
31246
  // src/components/Chat/CustomMenuPage.tsx
30714
- import { jsx as jsx119, jsxs as jsxs85 } from "react/jsx-runtime";
31247
+ import { jsx as jsx120, jsxs as jsxs86 } from "react/jsx-runtime";
30715
31248
  var IFRAME_STYLE = {
30716
31249
  width: "100%",
30717
31250
  height: "100%",
@@ -30721,24 +31254,24 @@ var AgentChatWithThread = ({ assistantId }) => {
30721
31254
  const { thread } = useConversationContext();
30722
31255
  const { menuCollapsed } = useChatUIContext();
30723
31256
  if (!thread) {
30724
- return /* @__PURE__ */ jsx119("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", height: "100%" }, children: /* @__PURE__ */ jsx119(Spin21, { tip: "Creating conversation..." }) });
31257
+ return /* @__PURE__ */ jsx120("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", height: "100%" }, children: /* @__PURE__ */ jsx120(Spin21, { tip: "Creating conversation..." }) });
30725
31258
  }
30726
- return /* @__PURE__ */ jsx119(
31259
+ return /* @__PURE__ */ jsx120(
30727
31260
  LatticeChat,
30728
31261
  {
30729
31262
  thread_id: thread.id,
30730
31263
  assistant_id: assistantId,
30731
31264
  showProjectSelector: false,
30732
- menu: menuCollapsed ? void 0 : /* @__PURE__ */ jsx119(AgentConversations, {})
31265
+ menu: menuCollapsed ? void 0 : /* @__PURE__ */ jsx120(AgentConversations, {})
30733
31266
  }
30734
31267
  );
30735
31268
  };
30736
31269
  var CustomMenuPage = ({ component_key }) => {
30737
31270
  const parsed = parseCustomMenuId(component_key);
30738
31271
  if (!parsed) {
30739
- return /* @__PURE__ */ jsxs85("div", { style: { padding: 24 }, children: [
30740
- /* @__PURE__ */ jsx119("p", { style: { color: "#999" }, children: "Invalid menu item" }),
30741
- /* @__PURE__ */ jsxs85("pre", { style: { fontSize: 11, color: "#aaa" }, children: [
31272
+ return /* @__PURE__ */ jsxs86("div", { style: { padding: 24 }, children: [
31273
+ /* @__PURE__ */ jsx120("p", { style: { color: "#999" }, children: "Invalid menu item" }),
31274
+ /* @__PURE__ */ jsxs86("pre", { style: { fontSize: 11, color: "#aaa" }, children: [
30742
31275
  "component_key: ",
30743
31276
  component_key || "(empty)"
30744
31277
  ] })
@@ -30746,39 +31279,39 @@ var CustomMenuPage = ({ component_key }) => {
30746
31279
  }
30747
31280
  switch (parsed.contentType) {
30748
31281
  case "agent":
30749
- return /* @__PURE__ */ jsx119(
31282
+ return /* @__PURE__ */ jsx120(
30750
31283
  WorkspaceContextProvider,
30751
31284
  {
30752
31285
  workspaceId: parsed.workspaceId || void 0,
30753
31286
  projectId: parsed.projectId || void 0,
30754
- children: /* @__PURE__ */ jsx119(
31287
+ children: /* @__PURE__ */ jsx120(
30755
31288
  AssistantContextProvider,
30756
31289
  {
30757
31290
  autoLoad: true,
30758
31291
  initialAssistantId: parsed.payload,
30759
- children: /* @__PURE__ */ jsx119(ConversationContextProvider, { children: /* @__PURE__ */ jsx119(AgentChatWithThread, { assistantId: parsed.payload }) })
31292
+ children: /* @__PURE__ */ jsx120(ConversationContextProvider, { children: /* @__PURE__ */ jsx120(AgentChatWithThread, { assistantId: parsed.payload }) })
30760
31293
  }
30761
31294
  )
30762
31295
  }
30763
31296
  );
30764
31297
  case "html": {
30765
31298
  const url = decodeURIComponent(parsed.payload);
30766
- return /* @__PURE__ */ jsx119("iframe", { src: url, style: IFRAME_STYLE, title: "Custom HTML Page" });
31299
+ return /* @__PURE__ */ jsx120("iframe", { src: url, style: IFRAME_STYLE, title: "Custom HTML Page" });
30767
31300
  }
30768
31301
  case "custom": {
30769
31302
  const element = getElement(parsed.payload);
30770
31303
  if (element?.side_app_view) {
30771
31304
  const Comp = element.side_app_view;
30772
- return /* @__PURE__ */ jsx119(Comp, { component_key: parsed.payload, data: void 0 });
31305
+ return /* @__PURE__ */ jsx120(Comp, { component_key: parsed.payload, data: void 0 });
30773
31306
  }
30774
- return /* @__PURE__ */ jsxs85("div", { style: { padding: 24, color: "#999" }, children: [
31307
+ return /* @__PURE__ */ jsxs86("div", { style: { padding: 24, color: "#999" }, children: [
30775
31308
  'Component "',
30776
31309
  parsed.payload,
30777
31310
  '" not found'
30778
31311
  ] });
30779
31312
  }
30780
31313
  default:
30781
- return /* @__PURE__ */ jsxs85("div", { style: { padding: 24, color: "#999" }, children: [
31314
+ return /* @__PURE__ */ jsxs86("div", { style: { padding: 24, color: "#999" }, children: [
30782
31315
  "Unknown content type: ",
30783
31316
  parsed.contentType
30784
31317
  ] });
@@ -30791,10 +31324,10 @@ import {
30791
31324
  AppstoreOutlined,
30792
31325
  MoreOutlined as MoreOutlined3
30793
31326
  } from "@ant-design/icons";
30794
- import { Dropdown as Dropdown4, Tooltip as Tooltip24 } from "antd";
31327
+ import { Dropdown as Dropdown4, Tooltip as Tooltip25 } from "antd";
30795
31328
  import { createStyles as createStyles36 } from "antd-style";
30796
- import { useEffect as useEffect51, useMemo as useMemo32, useState as useState75 } from "react";
30797
- import { Fragment as Fragment24, jsx as jsx120, jsxs as jsxs86 } from "react/jsx-runtime";
31329
+ import { useEffect as useEffect51, useMemo as useMemo33, useState as useState75 } from "react";
31330
+ import { Fragment as Fragment24, jsx as jsx121, jsxs as jsxs87 } from "react/jsx-runtime";
30798
31331
  var useStyle17 = createStyles36(({ token, css }) => {
30799
31332
  return {
30800
31333
  container: css`
@@ -30971,15 +31504,15 @@ var useStyle17 = createStyles36(({ token, css }) => {
30971
31504
  });
30972
31505
  var EmptySideAppView = ({ component_key, data }) => {
30973
31506
  if (data?.component) {
30974
- return /* @__PURE__ */ jsx120(Fragment24, { children: data.component });
31507
+ return /* @__PURE__ */ jsx121(Fragment24, { children: data.component });
30975
31508
  }
30976
- return /* @__PURE__ */ jsxs86("div", { children: [
30977
- /* @__PURE__ */ jsx120("p", { children: "Component view not found" }),
30978
- /* @__PURE__ */ jsx120("pre", { children: JSON.stringify({ component_key, data }, null, 2) })
31509
+ return /* @__PURE__ */ jsxs87("div", { children: [
31510
+ /* @__PURE__ */ jsx121("p", { children: "Component view not found" }),
31511
+ /* @__PURE__ */ jsx121("pre", { children: JSON.stringify({ component_key, data }, null, 2) })
30979
31512
  ] });
30980
31513
  };
30981
31514
  var getTabIcon = (componentKey) => {
30982
- return /* @__PURE__ */ jsx120(AppstoreOutlined, { style: { fontSize: 12, opacity: 0.6 } });
31515
+ return /* @__PURE__ */ jsx121(AppstoreOutlined, { style: { fontSize: 12, opacity: 0.6 } });
30983
31516
  };
30984
31517
  var SideAppViewBrowser = ({ region = "side" }) => {
30985
31518
  const { styles } = useStyle17();
@@ -31040,7 +31573,7 @@ var SideAppViewBrowser = ({ region = "side" }) => {
31040
31573
  add(
31041
31574
  key,
31042
31575
  selectedCard?.message || selectedCard?.data?.message || "Unnamed",
31043
- /* @__PURE__ */ jsx120(
31576
+ /* @__PURE__ */ jsx121(
31044
31577
  SideAppView,
31045
31578
  {
31046
31579
  component_key: selectedCard?.component_key || "",
@@ -31054,7 +31587,7 @@ var SideAppViewBrowser = ({ region = "side" }) => {
31054
31587
  const activeItem = items.find((item) => item.key === activeKey);
31055
31588
  const dropdownItems = items.map((item) => ({
31056
31589
  key: item.key,
31057
- label: /* @__PURE__ */ jsxs86(
31590
+ label: /* @__PURE__ */ jsxs87(
31058
31591
  "div",
31059
31592
  {
31060
31593
  style: {
@@ -31065,8 +31598,8 @@ var SideAppViewBrowser = ({ region = "side" }) => {
31065
31598
  },
31066
31599
  children: [
31067
31600
  getTabIcon(item.componentKey),
31068
- /* @__PURE__ */ jsx120("span", { style: { flex: 1 }, children: item.label }),
31069
- /* @__PURE__ */ jsx120(
31601
+ /* @__PURE__ */ jsx121("span", { style: { flex: 1 }, children: item.label }),
31602
+ /* @__PURE__ */ jsx121(
31070
31603
  CloseOutlined4,
31071
31604
  {
31072
31605
  style: { fontSize: 10, opacity: 0.5 },
@@ -31081,13 +31614,13 @@ var SideAppViewBrowser = ({ region = "side" }) => {
31081
31614
  ),
31082
31615
  onClick: () => switchTab(item.key)
31083
31616
  }));
31084
- const sideAppBrowserValue = useMemo32(
31617
+ const sideAppBrowserValue = useMemo33(
31085
31618
  () => ({ openApp }),
31086
31619
  [openApp]
31087
31620
  );
31088
- return /* @__PURE__ */ jsxs86("div", { className: styles.container, children: [
31089
- /* @__PURE__ */ jsxs86("div", { className: styles.header, children: [
31090
- /* @__PURE__ */ jsx120("div", { className: styles.tabsStrip, children: items.map((item) => /* @__PURE__ */ jsx120(Tooltip24, { title: item.label, placement: "bottom", children: /* @__PURE__ */ jsxs86(
31621
+ return /* @__PURE__ */ jsxs87("div", { className: styles.container, children: [
31622
+ /* @__PURE__ */ jsxs87("div", { className: styles.header, children: [
31623
+ /* @__PURE__ */ jsx121("div", { className: styles.tabsStrip, children: items.map((item) => /* @__PURE__ */ jsx121(Tooltip25, { title: item.label, placement: "bottom", children: /* @__PURE__ */ jsxs87(
31091
31624
  "div",
31092
31625
  {
31093
31626
  "data-tab-key": item.key,
@@ -31097,8 +31630,8 @@ var SideAppViewBrowser = ({ region = "side" }) => {
31097
31630
  onMouseLeave: () => setHoveredTab(null),
31098
31631
  children: [
31099
31632
  getTabIcon(item.componentKey),
31100
- /* @__PURE__ */ jsx120("span", { className: styles.tabLabel, children: item.label }),
31101
- /* @__PURE__ */ jsx120(
31633
+ /* @__PURE__ */ jsx121("span", { className: styles.tabLabel, children: item.label }),
31634
+ /* @__PURE__ */ jsx121(
31102
31635
  "span",
31103
31636
  {
31104
31637
  className: `${styles.closeIndicator} ${hoveredTab === item.key || item.key === activeKey ? "always-visible" : ""}`,
@@ -31106,48 +31639,48 @@ var SideAppViewBrowser = ({ region = "side" }) => {
31106
31639
  e.stopPropagation();
31107
31640
  remove(item.key);
31108
31641
  },
31109
- children: /* @__PURE__ */ jsx120(CloseOutlined4, { style: { fontSize: 10 } })
31642
+ children: /* @__PURE__ */ jsx121(CloseOutlined4, { style: { fontSize: 10 } })
31110
31643
  }
31111
31644
  )
31112
31645
  ]
31113
31646
  }
31114
31647
  ) }, item.key)) }),
31115
- /* @__PURE__ */ jsxs86("div", { className: styles.actions, children: [
31116
- items.length > 0 && /* @__PURE__ */ jsx120("div", { className: styles.tabCounter, children: items.length }),
31117
- items.length > 1 && /* @__PURE__ */ jsx120(
31648
+ /* @__PURE__ */ jsxs87("div", { className: styles.actions, children: [
31649
+ items.length > 0 && /* @__PURE__ */ jsx121("div", { className: styles.tabCounter, children: items.length }),
31650
+ items.length > 1 && /* @__PURE__ */ jsx121(
31118
31651
  Dropdown4,
31119
31652
  {
31120
31653
  menu: { items: dropdownItems },
31121
31654
  placement: "bottomRight",
31122
31655
  trigger: ["click"],
31123
- children: /* @__PURE__ */ jsx120("button", { className: styles.actionBtn, title: "All tabs", children: /* @__PURE__ */ jsx120(MoreOutlined3, {}) })
31656
+ children: /* @__PURE__ */ jsx121("button", { className: styles.actionBtn, title: "All tabs", children: /* @__PURE__ */ jsx121(MoreOutlined3, {}) })
31124
31657
  }
31125
31658
  ),
31126
- /* @__PURE__ */ jsx120(Tooltip24, { title: "Close", children: /* @__PURE__ */ jsx120("button", { className: styles.actionBtn, onClick: closeApp, children: /* @__PURE__ */ jsx120(CloseOutlined4, {}) }) })
31659
+ /* @__PURE__ */ jsx121(Tooltip25, { title: "Close", children: /* @__PURE__ */ jsx121("button", { className: styles.actionBtn, onClick: closeApp, children: /* @__PURE__ */ jsx121(CloseOutlined4, {}) }) })
31127
31660
  ] })
31128
31661
  ] }),
31129
- /* @__PURE__ */ jsx120("div", { className: styles.content, children: /* @__PURE__ */ jsx120(SideAppBrowserContext.Provider, { value: sideAppBrowserValue, children: activeItem ? /* @__PURE__ */ jsx120("div", { className: styles.contentWrapper, children: activeItem.children }, activeItem.key) : /* @__PURE__ */ jsxs86("div", { className: styles.emptyState, children: [
31130
- /* @__PURE__ */ jsx120(AppstoreOutlined, { className: "icon" }),
31131
- /* @__PURE__ */ jsx120("span", { children: "Select an app to start" })
31662
+ /* @__PURE__ */ jsx121("div", { className: styles.content, children: /* @__PURE__ */ jsx121(SideAppBrowserContext.Provider, { value: sideAppBrowserValue, children: activeItem ? /* @__PURE__ */ jsx121("div", { className: styles.contentWrapper, children: activeItem.children }, activeItem.key) : /* @__PURE__ */ jsxs87("div", { className: styles.emptyState, children: [
31663
+ /* @__PURE__ */ jsx121(AppstoreOutlined, { className: "icon" }),
31664
+ /* @__PURE__ */ jsx121("span", { children: "Select an app to start" })
31132
31665
  ] }) }) })
31133
31666
  ] });
31134
31667
  };
31135
31668
 
31136
31669
  // src/components/Chat/WorkspaceResourceManager.tsx
31137
- import { jsx as jsx121, jsxs as jsxs87 } from "react/jsx-runtime";
31670
+ import { jsx as jsx122, jsxs as jsxs88 } from "react/jsx-runtime";
31138
31671
  var DEFAULT_WORKSPACE_MENU_ITEMS = [
31139
31672
  {
31140
31673
  id: "personal_assistant",
31141
31674
  type: "route",
31142
31675
  name: "Personal Assistant",
31143
- icon: /* @__PURE__ */ jsx121(Bot5, { size: 20 }),
31676
+ icon: /* @__PURE__ */ jsx122(Bot5, { size: 20 }),
31144
31677
  order: -10
31145
31678
  },
31146
31679
  {
31147
31680
  id: "workspace_projects",
31148
31681
  type: "route",
31149
31682
  name: "Projects",
31150
- icon: /* @__PURE__ */ jsx121(FolderOpen3, { size: 20 }),
31683
+ icon: /* @__PURE__ */ jsx122(FolderOpen3, { size: 20 }),
31151
31684
  order: 0
31152
31685
  },
31153
31686
  {
@@ -31155,7 +31688,7 @@ var DEFAULT_WORKSPACE_MENU_ITEMS = [
31155
31688
  builtin: "metrics",
31156
31689
  type: "route",
31157
31690
  name: "Metrics",
31158
- icon: /* @__PURE__ */ jsx121(Activity4, { size: 20 }),
31691
+ icon: /* @__PURE__ */ jsx122(Activity4, { size: 20 }),
31159
31692
  order: 10,
31160
31693
  group: "DataSource"
31161
31694
  },
@@ -31164,7 +31697,7 @@ var DEFAULT_WORKSPACE_MENU_ITEMS = [
31164
31697
  builtin: "database",
31165
31698
  type: "route",
31166
31699
  name: "Database",
31167
- icon: /* @__PURE__ */ jsx121(Database6, { size: 20 }),
31700
+ icon: /* @__PURE__ */ jsx122(Database7, { size: 20 }),
31168
31701
  order: 20,
31169
31702
  group: "DataSource"
31170
31703
  },
@@ -31172,7 +31705,7 @@ var DEFAULT_WORKSPACE_MENU_ITEMS = [
31172
31705
  id: "topology-runtimes",
31173
31706
  type: "route",
31174
31707
  name: "Runtime",
31175
- icon: /* @__PURE__ */ jsx121(History, { size: 20 }),
31708
+ icon: /* @__PURE__ */ jsx122(History, { size: 20 }),
31176
31709
  order: 26,
31177
31710
  group: "Process"
31178
31711
  },
@@ -31180,7 +31713,7 @@ var DEFAULT_WORKSPACE_MENU_ITEMS = [
31180
31713
  id: "topology-inbox",
31181
31714
  type: "route",
31182
31715
  name: "Inbox",
31183
- icon: /* @__PURE__ */ jsx121(Inbox3, { size: 20 }),
31716
+ icon: /* @__PURE__ */ jsx122(Inbox3, { size: 20 }),
31184
31717
  order: 27,
31185
31718
  group: "Process"
31186
31719
  },
@@ -31188,7 +31721,7 @@ var DEFAULT_WORKSPACE_MENU_ITEMS = [
31188
31721
  id: "workflows",
31189
31722
  type: "route",
31190
31723
  name: "Automations",
31191
- icon: /* @__PURE__ */ jsx121(Share2, { size: 20 }),
31724
+ icon: /* @__PURE__ */ jsx122(Share2, { size: 20 }),
31192
31725
  order: 25,
31193
31726
  group: "Process"
31194
31727
  },
@@ -31196,7 +31729,7 @@ var DEFAULT_WORKSPACE_MENU_ITEMS = [
31196
31729
  id: "eval",
31197
31730
  type: "route",
31198
31731
  name: "Eval",
31199
- icon: /* @__PURE__ */ jsx121(FlaskConical3, { size: 20 }),
31732
+ icon: /* @__PURE__ */ jsx122(FlaskConical3, { size: 20 }),
31200
31733
  order: 28,
31201
31734
  group: "Process"
31202
31735
  },
@@ -31205,7 +31738,7 @@ var DEFAULT_WORKSPACE_MENU_ITEMS = [
31205
31738
  builtin: "assistants",
31206
31739
  type: "route",
31207
31740
  name: "Assistants",
31208
- icon: /* @__PURE__ */ jsx121(Bot5, { size: 20 }),
31741
+ icon: /* @__PURE__ */ jsx122(Bot5, { size: 20 }),
31209
31742
  order: 30,
31210
31743
  group: "Settings"
31211
31744
  },
@@ -31214,7 +31747,7 @@ var DEFAULT_WORKSPACE_MENU_ITEMS = [
31214
31747
  builtin: "skills",
31215
31748
  type: "route",
31216
31749
  name: "Skills",
31217
- icon: /* @__PURE__ */ jsx121(Zap2, { size: 20 }),
31750
+ icon: /* @__PURE__ */ jsx122(Zap2, { size: 20 }),
31218
31751
  order: 35,
31219
31752
  group: "Settings"
31220
31753
  },
@@ -31223,7 +31756,7 @@ var DEFAULT_WORKSPACE_MENU_ITEMS = [
31223
31756
  builtin: "mcp",
31224
31757
  type: "route",
31225
31758
  name: "MCP",
31226
- icon: /* @__PURE__ */ jsx121(Plug2, { size: 20 }),
31759
+ icon: /* @__PURE__ */ jsx122(Plug2, { size: 20 }),
31227
31760
  order: 40,
31228
31761
  group: "Settings"
31229
31762
  },
@@ -31232,7 +31765,7 @@ var DEFAULT_WORKSPACE_MENU_ITEMS = [
31232
31765
  builtin: "tools",
31233
31766
  type: "route",
31234
31767
  name: "Tools",
31235
- icon: /* @__PURE__ */ jsx121(Wrench, { size: 20 }),
31768
+ icon: /* @__PURE__ */ jsx122(Wrench2, { size: 20 }),
31236
31769
  order: 50,
31237
31770
  group: "Settings"
31238
31771
  },
@@ -31241,13 +31774,13 @@ var DEFAULT_WORKSPACE_MENU_ITEMS = [
31241
31774
  builtin: "switch-tenant",
31242
31775
  type: "action",
31243
31776
  name: "Switch tenant",
31244
- icon: /* @__PURE__ */ jsx121(Building23, { size: 20 }),
31777
+ icon: /* @__PURE__ */ jsx122(Building23, { size: 20 }),
31245
31778
  order: 900,
31246
31779
  group: "Account"
31247
31780
  }
31248
31781
  ];
31249
31782
  var createWrapper = (Component) => {
31250
- return () => /* @__PURE__ */ jsx121(Component, { ...{} });
31783
+ return () => /* @__PURE__ */ jsx122(Component, { ...{} });
31251
31784
  };
31252
31785
  var WorkspaceResourceManager = ({
31253
31786
  workspaceId,
@@ -31286,7 +31819,7 @@ var WorkspaceResourceManager = ({
31286
31819
  });
31287
31820
  regsiterElement("workspace_tools", {
31288
31821
  card_view: () => null,
31289
- side_app_view: createWrapper(() => /* @__PURE__ */ jsx121(
31822
+ side_app_view: createWrapper(() => /* @__PURE__ */ jsx122(
31290
31823
  ToolsList,
31291
31824
  {
31292
31825
  onToolSelect: (tool) => {
@@ -31345,7 +31878,7 @@ var WorkspaceResourceManager = ({
31345
31878
  });
31346
31879
  }
31347
31880
  }, [fetchedCustomMenuItems]);
31348
- const menuItems = useMemo33(() => {
31881
+ const menuItems = useMemo34(() => {
31349
31882
  const workspaceMenu = config.workspaceMenuItems?.length ? config.workspaceMenuItems : void 0;
31350
31883
  if (workspaceMenu) {
31351
31884
  return [...workspaceMenu].sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
@@ -31390,12 +31923,12 @@ var WorkspaceResourceManager = ({
31390
31923
  }
31391
31924
  }
31392
31925
  }, []);
31393
- const userMenuItems = /* @__PURE__ */ jsxs87("div", { style: { minWidth: 160 }, children: [
31394
- /* @__PURE__ */ jsxs87("div", { style: { padding: "8px 12px", borderBottom: "1px solid #f0f0f0" }, children: [
31395
- /* @__PURE__ */ jsx121("div", { style: { fontWeight: 500 }, children: user?.name || user?.email }),
31396
- /* @__PURE__ */ jsx121("div", { style: { fontSize: 12, color: "#666" }, children: user?.email })
31926
+ const userMenuItems = /* @__PURE__ */ jsxs88("div", { style: { minWidth: 160 }, children: [
31927
+ /* @__PURE__ */ jsxs88("div", { style: { padding: "8px 12px", borderBottom: "1px solid #f0f0f0" }, children: [
31928
+ /* @__PURE__ */ jsx122("div", { style: { fontWeight: 500 }, children: user?.name || user?.email }),
31929
+ /* @__PURE__ */ jsx122("div", { style: { fontSize: 12, color: "#666" }, children: user?.email })
31397
31930
  ] }),
31398
- /* @__PURE__ */ jsxs87(
31931
+ /* @__PURE__ */ jsxs88(
31399
31932
  Button55,
31400
31933
  {
31401
31934
  type: "text",
@@ -31403,12 +31936,12 @@ var WorkspaceResourceManager = ({
31403
31936
  style: { justifyContent: "flex-start", padding: "8px 12px" },
31404
31937
  onClick: () => setChangePasswordOpen(true),
31405
31938
  children: [
31406
- /* @__PURE__ */ jsx121(Key, { size: 16, style: { marginRight: 8 } }),
31939
+ /* @__PURE__ */ jsx122(Key, { size: 16, style: { marginRight: 8 } }),
31407
31940
  "Change Password"
31408
31941
  ]
31409
31942
  }
31410
31943
  ),
31411
- /* @__PURE__ */ jsxs87(
31944
+ /* @__PURE__ */ jsxs88(
31412
31945
  Button55,
31413
31946
  {
31414
31947
  type: "text",
@@ -31417,13 +31950,13 @@ var WorkspaceResourceManager = ({
31417
31950
  style: { justifyContent: "flex-start", padding: "8px 12px" },
31418
31951
  onClick: logout,
31419
31952
  children: [
31420
- /* @__PURE__ */ jsx121(LogOut3, { size: 16, style: { marginRight: 8 } }),
31953
+ /* @__PURE__ */ jsx122(LogOut3, { size: 16, style: { marginRight: 8 } }),
31421
31954
  "Logout"
31422
31955
  ]
31423
31956
  }
31424
31957
  )
31425
31958
  ] });
31426
- return /* @__PURE__ */ jsxs87(
31959
+ return /* @__PURE__ */ jsxs88(
31427
31960
  "div",
31428
31961
  {
31429
31962
  style: {
@@ -31433,10 +31966,10 @@ var WorkspaceResourceManager = ({
31433
31966
  height: "100%"
31434
31967
  },
31435
31968
  children: [
31436
- /* @__PURE__ */ jsx121(
31969
+ /* @__PURE__ */ jsx122(
31437
31970
  ColumnLayout,
31438
31971
  {
31439
- menu: /* @__PURE__ */ jsx121(
31972
+ menu: /* @__PURE__ */ jsx122(
31440
31973
  Menu,
31441
31974
  {
31442
31975
  items: menuItems,
@@ -31447,13 +31980,13 @@ var WorkspaceResourceManager = ({
31447
31980
  defaultExpanded: config.workspaceMenuDefaultExpanded ?? true,
31448
31981
  collapsed: menuCollapsed,
31449
31982
  onCollapsedChange: setMenuCollapsed,
31450
- footer: ({ isIconMode }) => user && /* @__PURE__ */ jsx121(
31983
+ footer: ({ isIconMode }) => user && /* @__PURE__ */ jsx122(
31451
31984
  Popover3,
31452
31985
  {
31453
31986
  content: userMenuItems,
31454
31987
  placement: "rightTop",
31455
31988
  trigger: "click",
31456
- children: /* @__PURE__ */ jsxs87(
31989
+ children: /* @__PURE__ */ jsxs88(
31457
31990
  "div",
31458
31991
  {
31459
31992
  style: {
@@ -31467,7 +32000,7 @@ var WorkspaceResourceManager = ({
31467
32000
  transition: "all 0.2s"
31468
32001
  },
31469
32002
  children: [
31470
- /* @__PURE__ */ jsx121(
32003
+ /* @__PURE__ */ jsx122(
31471
32004
  Avatar12,
31472
32005
  {
31473
32006
  size: isIconMode ? 32 : 36,
@@ -31479,8 +32012,8 @@ var WorkspaceResourceManager = ({
31479
32012
  children: (user.name?.charAt(0) || user.email.charAt(0)).toUpperCase()
31480
32013
  }
31481
32014
  ),
31482
- !isIconMode && /* @__PURE__ */ jsxs87("div", { style: { flex: 1, minWidth: 0 }, children: [
31483
- /* @__PURE__ */ jsx121(
32015
+ !isIconMode && /* @__PURE__ */ jsxs88("div", { style: { flex: 1, minWidth: 0 }, children: [
32016
+ /* @__PURE__ */ jsx122(
31484
32017
  "div",
31485
32018
  {
31486
32019
  style: {
@@ -31492,7 +32025,7 @@ var WorkspaceResourceManager = ({
31492
32025
  children: user.name || user.email
31493
32026
  }
31494
32027
  ),
31495
- /* @__PURE__ */ jsx121(
32028
+ /* @__PURE__ */ jsx122(
31496
32029
  "div",
31497
32030
  {
31498
32031
  style: {
@@ -31514,10 +32047,10 @@ var WorkspaceResourceManager = ({
31514
32047
  }
31515
32048
  ),
31516
32049
  logo,
31517
- main: /* @__PURE__ */ jsx121(SideAppViewBrowser, { region: "content" })
32050
+ main: /* @__PURE__ */ jsx122(SideAppViewBrowser, { region: "content" })
31518
32051
  }
31519
32052
  ),
31520
- /* @__PURE__ */ jsx121(
32053
+ /* @__PURE__ */ jsx122(
31521
32054
  Modal20,
31522
32055
  {
31523
32056
  open: tenantModalOpen,
@@ -31534,7 +32067,7 @@ var WorkspaceResourceManager = ({
31534
32067
  boxShadow: "none"
31535
32068
  }
31536
32069
  },
31537
- children: /* @__PURE__ */ jsx121(
32070
+ children: /* @__PURE__ */ jsx122(
31538
32071
  TenantSelector,
31539
32072
  {
31540
32073
  tenants: tenants.map((t) => t.tenant).filter(Boolean),
@@ -31549,7 +32082,7 @@ var WorkspaceResourceManager = ({
31549
32082
  )
31550
32083
  }
31551
32084
  ),
31552
- /* @__PURE__ */ jsx121(
32085
+ /* @__PURE__ */ jsx122(
31553
32086
  ChangePasswordModal,
31554
32087
  {
31555
32088
  open: changePasswordOpen,
@@ -31565,11 +32098,11 @@ var WorkspaceResourceUIContext = ({
31565
32098
  workspaceName,
31566
32099
  logo
31567
32100
  }) => {
31568
- return /* @__PURE__ */ jsx121(ChatUIContextProvider, { children: /* @__PURE__ */ jsx121(WorkspaceResourceManager, { workspaceId, workspaceName, logo }) });
32101
+ return /* @__PURE__ */ jsx122(ChatUIContextProvider, { children: /* @__PURE__ */ jsx122(WorkspaceResourceManager, { workspaceId, workspaceName, logo }) });
31569
32102
  };
31570
32103
 
31571
32104
  // src/context/WorkspaceContext.tsx
31572
- import { jsx as jsx122 } from "react/jsx-runtime";
32105
+ import { jsx as jsx123 } from "react/jsx-runtime";
31573
32106
  var WorkspaceContext = createContext9(null);
31574
32107
  var useWorkspaceContext = () => {
31575
32108
  const context = useContext11(WorkspaceContext);
@@ -31598,21 +32131,21 @@ var WorkspaceContextProvider = ({
31598
32131
  };
31599
32132
  const [workspaceId, setWorkspaceId] = useState77(getInitialWorkspaceId);
31600
32133
  const [projectId, setProjectId] = useState77(getInitialProjectId);
31601
- React69.useEffect(() => {
32134
+ React70.useEffect(() => {
31602
32135
  const wsId = getInitialWorkspaceId();
31603
32136
  const pjId = getInitialProjectId();
31604
32137
  if (wsId || pjId) {
31605
- Client2.setWorkspaceContext(wsId || void 0, pjId || void 0);
32138
+ Client3.setWorkspaceContext(wsId || void 0, pjId || void 0);
31606
32139
  }
31607
32140
  }, []);
31608
32141
  useEffect53(() => {
31609
- Client2.setWorkspaceContext(workspaceId || void 0, projectId || void 0);
32142
+ Client3.setWorkspaceContext(workspaceId || void 0, projectId || void 0);
31610
32143
  }, [workspaceId, projectId]);
31611
32144
  const [workspaces, setWorkspaces] = useState77([]);
31612
32145
  const [projects, setProjects] = useState77([]);
31613
32146
  const [loading, setLoading] = useState77(false);
31614
32147
  const [error, setError] = useState77(null);
31615
- const client = React69.useMemo(() => {
32148
+ const client = React70.useMemo(() => {
31616
32149
  const authApiKey = isAuthenticated ? sessionStorage.getItem("lattice_token") || config.apiKey || "" : config.apiKey || "";
31617
32150
  return new WorkspaceClient({
31618
32151
  baseURL: config.baseURL,
@@ -31896,7 +32429,7 @@ var WorkspaceContextProvider = ({
31896
32429
  await createProject(workspaceId, { name, description });
31897
32430
  }
31898
32431
  };
31899
- return /* @__PURE__ */ jsx122(WorkspaceContext.Provider, { value, children: projectId ? children : /* @__PURE__ */ jsx122(
32432
+ return /* @__PURE__ */ jsx123(WorkspaceContext.Provider, { value, children: projectId ? children : /* @__PURE__ */ jsx123(
31900
32433
  WorkspaceResourceUIContext,
31901
32434
  {
31902
32435
  workspaceId: workspaceId || "",
@@ -31906,20 +32439,54 @@ var WorkspaceContextProvider = ({
31906
32439
  };
31907
32440
 
31908
32441
  // src/components/Chat/PinToMenuButton.tsx
31909
- import { Fragment as Fragment25, jsx as jsx123, jsxs as jsxs88 } from "react/jsx-runtime";
32442
+ import { Fragment as Fragment25, jsx as jsx124, jsxs as jsxs89 } from "react/jsx-runtime";
31910
32443
  var MODAL_BODY_STYLE = {
31911
32444
  display: "flex",
31912
32445
  flexDirection: "column",
31913
32446
  gap: 12
31914
32447
  };
31915
32448
  var PinToMenuButton = ({ assistantId }) => {
31916
- const workspaceCtx = React70.useContext(WorkspaceContext);
31917
- const { post } = useApi();
32449
+ const workspaceCtx = React71.useContext(WorkspaceContext);
32450
+ const { config } = useLatticeChatShellContext();
32451
+ const { post, get, del } = useApi();
31918
32452
  const [open, setOpen] = useState78(false);
31919
32453
  const [group, setGroup] = useState78("");
31920
32454
  const [name, setName] = useState78("");
31921
32455
  const [loading, setLoading] = useState78(false);
31922
- if (!assistantId) return null;
32456
+ const [isPinned, setIsPinned] = useState78(false);
32457
+ const [pinnedItemId, setPinnedItemId] = useState78(null);
32458
+ const [checking, setChecking] = useState78(true);
32459
+ const checkPinned = useCallback40(async () => {
32460
+ if (!assistantId || !config.enableCustomMenu) {
32461
+ setChecking(false);
32462
+ return;
32463
+ }
32464
+ setChecking(true);
32465
+ try {
32466
+ const json = await get(
32467
+ "/api/menu-items?menuTarget=workspace"
32468
+ );
32469
+ if (json.success && json.data?.records) {
32470
+ const pinned = json.data.records.find(
32471
+ (item) => item.contentConfig?.agentId === assistantId
32472
+ );
32473
+ if (pinned) {
32474
+ setIsPinned(true);
32475
+ setPinnedItemId(pinned.id);
32476
+ } else {
32477
+ setIsPinned(false);
32478
+ setPinnedItemId(null);
32479
+ }
32480
+ }
32481
+ } catch {
32482
+ } finally {
32483
+ setChecking(false);
32484
+ }
32485
+ }, [assistantId, config.enableCustomMenu, get]);
32486
+ useEffect54(() => {
32487
+ checkPinned();
32488
+ }, [checkPinned]);
32489
+ if (!assistantId || !config.enableCustomMenu) return null;
31923
32490
  const handlePin = async () => {
31924
32491
  if (!name.trim()) {
31925
32492
  message19.warning("Please enter a menu name");
@@ -31945,6 +32512,7 @@ var PinToMenuButton = ({ assistantId }) => {
31945
32512
  setOpen(false);
31946
32513
  setGroup("");
31947
32514
  setName("");
32515
+ checkPinned();
31948
32516
  } else {
31949
32517
  message19.error(json.message || "Failed to pin");
31950
32518
  }
@@ -31954,17 +32522,43 @@ var PinToMenuButton = ({ assistantId }) => {
31954
32522
  setLoading(false);
31955
32523
  }
31956
32524
  };
31957
- return /* @__PURE__ */ jsxs88(Fragment25, { children: [
31958
- /* @__PURE__ */ jsx123(Tooltip25, { title: "Pin to Menu", children: /* @__PURE__ */ jsx123(
32525
+ const handleUnpin = async () => {
32526
+ if (!pinnedItemId) return;
32527
+ setLoading(true);
32528
+ try {
32529
+ const json = await del(`/api/menu-items/${pinnedItemId}`);
32530
+ if (json.success) {
32531
+ message19.success("Unpinned from menu");
32532
+ setIsPinned(false);
32533
+ setPinnedItemId(null);
32534
+ } else {
32535
+ message19.error(json.message || "Failed to unpin");
32536
+ }
32537
+ } catch {
32538
+ message19.error("Failed to unpin from menu");
32539
+ } finally {
32540
+ setLoading(false);
32541
+ }
32542
+ };
32543
+ const handleClick = () => {
32544
+ if (isPinned) {
32545
+ handleUnpin();
32546
+ } else {
32547
+ setOpen(true);
32548
+ }
32549
+ };
32550
+ return /* @__PURE__ */ jsxs89(Fragment25, { children: [
32551
+ /* @__PURE__ */ jsx124(Tooltip26, { title: isPinned ? "Unpin from Menu" : "Pin to Menu", children: /* @__PURE__ */ jsx124(
31959
32552
  Button56,
31960
32553
  {
31961
32554
  type: "text",
31962
32555
  size: "small",
31963
- icon: /* @__PURE__ */ jsx123(Pin, { size: 14 }),
31964
- onClick: () => setOpen(true)
32556
+ icon: isPinned ? /* @__PURE__ */ jsx124(Pin, { size: 14, fill: "currentColor" }) : /* @__PURE__ */ jsx124(Pin, { size: 14 }),
32557
+ onClick: handleClick,
32558
+ loading: checking || loading && isPinned
31965
32559
  }
31966
32560
  ) }),
31967
- /* @__PURE__ */ jsx123(
32561
+ /* @__PURE__ */ jsx124(
31968
32562
  Modal21,
31969
32563
  {
31970
32564
  title: "Pin to Menu",
@@ -31973,8 +32567,8 @@ var PinToMenuButton = ({ assistantId }) => {
31973
32567
  onCancel: () => setOpen(false),
31974
32568
  confirmLoading: loading,
31975
32569
  okText: "Pin",
31976
- children: /* @__PURE__ */ jsxs88("div", { style: MODAL_BODY_STYLE, children: [
31977
- /* @__PURE__ */ jsx123(
32570
+ children: /* @__PURE__ */ jsxs89("div", { style: MODAL_BODY_STYLE, children: [
32571
+ /* @__PURE__ */ jsx124(
31978
32572
  Input17,
31979
32573
  {
31980
32574
  placeholder: "Menu name (required)",
@@ -31982,7 +32576,7 @@ var PinToMenuButton = ({ assistantId }) => {
31982
32576
  onChange: (e) => setName(e.target.value)
31983
32577
  }
31984
32578
  ),
31985
- /* @__PURE__ */ jsx123(
32579
+ /* @__PURE__ */ jsx124(
31986
32580
  Input17,
31987
32581
  {
31988
32582
  placeholder: "Group (optional, e.g. Process)",
@@ -32000,11 +32594,11 @@ var PinToMenuButton = ({ assistantId }) => {
32000
32594
  import { createStyles as createStyles39 } from "antd-style";
32001
32595
 
32002
32596
  // src/components/Chat/ProjectSelector.tsx
32003
- import { useState as useState79, useCallback as useCallback40, useMemo as useMemo34, useRef as useRef29 } from "react";
32597
+ import { useState as useState79, useCallback as useCallback41, useMemo as useMemo35, useRef as useRef29 } from "react";
32004
32598
  import { Modal as Modal22, Input as Input18, Button as Button57, message as message20 } from "antd";
32005
32599
  import { createStyles as createStyles37 } from "antd-style";
32006
32600
  import { Folder, ChevronDown as ChevronDown6, Building2 as Building24 } from "lucide-react";
32007
- import { Fragment as Fragment26, jsx as jsx124, jsxs as jsxs89 } from "react/jsx-runtime";
32601
+ import { Fragment as Fragment26, jsx as jsx125, jsxs as jsxs90 } from "react/jsx-runtime";
32008
32602
  var PROJECT_NAME_MAX_LENGTH = 50;
32009
32603
  var useStyles20 = createStyles37(({ token, css }) => ({
32010
32604
  container: css`
@@ -32244,26 +32838,26 @@ var ProjectSelector = ({
32244
32838
  const [validationError, setValidationError] = useState79(null);
32245
32839
  const [isCreating, setIsCreating] = useState79(false);
32246
32840
  const projectNameInputRef = useRef29(null);
32247
- const currentProject = useMemo34(() => {
32841
+ const currentProject = useMemo35(() => {
32248
32842
  return projects.find((p) => p.id === projectId);
32249
32843
  }, [projects, projectId]);
32250
- const currentWorkspace = useMemo34(() => {
32844
+ const currentWorkspace = useMemo35(() => {
32251
32845
  return workspaces.find((w) => w.id === workspaceId);
32252
32846
  }, [workspaces, workspaceId]);
32253
- const handleSelectProject = useCallback40((selectedProjectId) => {
32847
+ const handleSelectProject = useCallback41((selectedProjectId) => {
32254
32848
  setProject(selectedProjectId);
32255
32849
  setIsProjectListOpen(false);
32256
32850
  }, [setProject]);
32257
- const handleWorkspaceClick = useCallback40(() => {
32851
+ const handleWorkspaceClick = useCallback41(() => {
32258
32852
  setProject(null);
32259
32853
  }, [setProject]);
32260
- const toggleProjectList = useCallback40(() => {
32854
+ const toggleProjectList = useCallback41(() => {
32261
32855
  setIsProjectListOpen((prev) => !prev);
32262
32856
  }, []);
32263
- const toggleWorkspaceList = useCallback40(() => {
32857
+ const toggleWorkspaceList = useCallback41(() => {
32264
32858
  setIsWorkspaceListOpen((prev) => !prev);
32265
32859
  }, []);
32266
- const validateProjectName = useCallback40((name) => {
32860
+ const validateProjectName = useCallback41((name) => {
32267
32861
  const trimmed = name.trim();
32268
32862
  if (!trimmed) return "Project name is required";
32269
32863
  if (trimmed.length > PROJECT_NAME_MAX_LENGTH) {
@@ -32271,7 +32865,7 @@ var ProjectSelector = ({
32271
32865
  }
32272
32866
  return null;
32273
32867
  }, []);
32274
- const handleOpenModal = useCallback40((e) => {
32868
+ const handleOpenModal = useCallback41((e) => {
32275
32869
  e.stopPropagation();
32276
32870
  if (!workspaceId) {
32277
32871
  message20.warning("Please select a workspace first");
@@ -32282,7 +32876,7 @@ var ProjectSelector = ({
32282
32876
  setIsModalOpen(true);
32283
32877
  setTimeout(() => projectNameInputRef.current?.input?.focus(), 100);
32284
32878
  }, [workspaceId]);
32285
- const handleCloseModal = useCallback40(() => {
32879
+ const handleCloseModal = useCallback41(() => {
32286
32880
  setIsModalOpen(false);
32287
32881
  setProjectName("");
32288
32882
  setValidationError(null);
@@ -32292,7 +32886,7 @@ var ProjectSelector = ({
32292
32886
  setProjectName(value);
32293
32887
  setValidationError(validateProjectName(value));
32294
32888
  };
32295
- const handleCreateProject = useCallback40(async () => {
32889
+ const handleCreateProject = useCallback41(async () => {
32296
32890
  if (!workspaceId) return;
32297
32891
  const trimmed = projectName.trim();
32298
32892
  const error = validateProjectName(trimmed);
@@ -32324,48 +32918,48 @@ var ProjectSelector = ({
32324
32918
  }
32325
32919
  };
32326
32920
  const isProjectNameValid = !validateProjectName(projectName.trim());
32327
- return /* @__PURE__ */ jsxs89(Fragment26, { children: [
32328
- /* @__PURE__ */ jsx124("div", { className: styles.container, children: /* @__PURE__ */ jsxs89("div", { className: styles.selectorWrapper, children: [
32329
- /* @__PURE__ */ jsx124("div", { style: { position: "relative" }, ref: workspaceDropdownRef, children: /* @__PURE__ */ jsx124(
32921
+ return /* @__PURE__ */ jsxs90(Fragment26, { children: [
32922
+ /* @__PURE__ */ jsx125("div", { className: styles.container, children: /* @__PURE__ */ jsxs90("div", { className: styles.selectorWrapper, children: [
32923
+ /* @__PURE__ */ jsx125("div", { style: { position: "relative" }, ref: workspaceDropdownRef, children: /* @__PURE__ */ jsx125(
32330
32924
  "button",
32331
32925
  {
32332
32926
  className: styles.workspaceButton,
32333
32927
  onClick: handleWorkspaceClick,
32334
32928
  title: currentWorkspace?.name || "Select Workspace",
32335
- children: /* @__PURE__ */ jsx124("div", { className: styles.workspaceButtonIcon, children: /* @__PURE__ */ jsx124(Building24, { size: 16 }) })
32929
+ children: /* @__PURE__ */ jsx125("div", { className: styles.workspaceButtonIcon, children: /* @__PURE__ */ jsx125(Building24, { size: 16 }) })
32336
32930
  }
32337
32931
  ) }),
32338
- /* @__PURE__ */ jsx124("span", { className: styles.divider, children: "/" }),
32339
- /* @__PURE__ */ jsxs89(
32932
+ /* @__PURE__ */ jsx125("span", { className: styles.divider, children: "/" }),
32933
+ /* @__PURE__ */ jsxs90(
32340
32934
  "div",
32341
32935
  {
32342
32936
  className: styles.projectTrigger,
32343
32937
  onClick: disableDropdown ? void 0 : toggleProjectList,
32344
32938
  style: { cursor: disableDropdown ? "default" : "pointer" },
32345
32939
  children: [
32346
- /* @__PURE__ */ jsx124("div", { className: styles.projectTriggerIcon, children: /* @__PURE__ */ jsx124(Folder, { size: 16 }) }),
32347
- /* @__PURE__ */ jsx124("div", { className: styles.projectTriggerInfo, children: /* @__PURE__ */ jsx124("div", { className: styles.projectTriggerName, children: currentProject?.name || "Select Project" }) }),
32348
- !disableDropdown && /* @__PURE__ */ jsx124("div", { className: `${styles.projectTriggerArrow} ${isProjectListOpen ? "expanded" : ""}`, children: /* @__PURE__ */ jsx124(ChevronDown6, { size: 14 }) })
32940
+ /* @__PURE__ */ jsx125("div", { className: styles.projectTriggerIcon, children: /* @__PURE__ */ jsx125(Folder, { size: 16 }) }),
32941
+ /* @__PURE__ */ jsx125("div", { className: styles.projectTriggerInfo, children: /* @__PURE__ */ jsx125("div", { className: styles.projectTriggerName, children: currentProject?.name || "Select Project" }) }),
32942
+ !disableDropdown && /* @__PURE__ */ jsx125("div", { className: `${styles.projectTriggerArrow} ${isProjectListOpen ? "expanded" : ""}`, children: /* @__PURE__ */ jsx125(ChevronDown6, { size: 14 }) })
32349
32943
  ]
32350
32944
  }
32351
32945
  ),
32352
- !disableDropdown && isProjectListOpen && /* @__PURE__ */ jsxs89("div", { className: styles.projectDropdown, children: [
32353
- projects.map((project) => /* @__PURE__ */ jsxs89(
32946
+ !disableDropdown && isProjectListOpen && /* @__PURE__ */ jsxs90("div", { className: styles.projectDropdown, children: [
32947
+ projects.map((project) => /* @__PURE__ */ jsxs90(
32354
32948
  "div",
32355
32949
  {
32356
32950
  className: `${styles.projectDropdownItem} ${project.id === projectId ? "active" : ""}`,
32357
32951
  onClick: () => handleSelectProject(project.id),
32358
32952
  children: [
32359
- /* @__PURE__ */ jsx124("div", { className: styles.projectDropdownItemIcon, children: /* @__PURE__ */ jsx124(Folder, { size: 14 }) }),
32360
- /* @__PURE__ */ jsx124("div", { className: project.id === projectId ? styles.projectDropdownItemNameActive : styles.projectDropdownItemName, children: project.name })
32953
+ /* @__PURE__ */ jsx125("div", { className: styles.projectDropdownItemIcon, children: /* @__PURE__ */ jsx125(Folder, { size: 14 }) }),
32954
+ /* @__PURE__ */ jsx125("div", { className: project.id === projectId ? styles.projectDropdownItemNameActive : styles.projectDropdownItemName, children: project.name })
32361
32955
  ]
32362
32956
  },
32363
32957
  project.id
32364
32958
  )),
32365
- projects.length === 0 && /* @__PURE__ */ jsx124("div", { className: styles.emptyState, children: "No projects" })
32959
+ projects.length === 0 && /* @__PURE__ */ jsx125("div", { className: styles.emptyState, children: "No projects" })
32366
32960
  ] })
32367
32961
  ] }) }),
32368
- /* @__PURE__ */ jsxs89(
32962
+ /* @__PURE__ */ jsxs90(
32369
32963
  Modal22,
32370
32964
  {
32371
32965
  title: "Create New Project",
@@ -32377,9 +32971,9 @@ var ProjectSelector = ({
32377
32971
  maskClosable: !isCreating,
32378
32972
  keyboard: true,
32379
32973
  closable: true,
32380
- footer: /* @__PURE__ */ jsxs89("div", { className: styles.modalFooter, children: [
32381
- /* @__PURE__ */ jsx124(Button57, { onClick: handleCloseModal, disabled: isCreating, children: "Cancel" }),
32382
- /* @__PURE__ */ jsx124(
32974
+ footer: /* @__PURE__ */ jsxs90("div", { className: styles.modalFooter, children: [
32975
+ /* @__PURE__ */ jsx125(Button57, { onClick: handleCloseModal, disabled: isCreating, children: "Cancel" }),
32976
+ /* @__PURE__ */ jsx125(
32383
32977
  Button57,
32384
32978
  {
32385
32979
  type: "primary",
@@ -32391,7 +32985,7 @@ var ProjectSelector = ({
32391
32985
  )
32392
32986
  ] }),
32393
32987
  children: [
32394
- /* @__PURE__ */ jsx124(
32988
+ /* @__PURE__ */ jsx125(
32395
32989
  Input18,
32396
32990
  {
32397
32991
  ref: projectNameInputRef,
@@ -32403,7 +32997,7 @@ var ProjectSelector = ({
32403
32997
  status: validationError ? "error" : void 0
32404
32998
  }
32405
32999
  ),
32406
- validationError && /* @__PURE__ */ jsx124("div", { style: { color: "#ff4d4f", fontSize: "12px", marginTop: "4px" }, children: validationError })
33000
+ validationError && /* @__PURE__ */ jsx125("div", { style: { color: "#ff4d4f", fontSize: "12px", marginTop: "4px" }, children: validationError })
32407
33001
  ]
32408
33002
  }
32409
33003
  )
@@ -32411,15 +33005,15 @@ var ProjectSelector = ({
32411
33005
  };
32412
33006
 
32413
33007
  // src/components/Chat/ToolPanelFiles.tsx
32414
- import { useCallback as useCallback41, useEffect as useEffect54, useMemo as useMemo35, useState as useState80 } from "react";
33008
+ import { useCallback as useCallback42, useEffect as useEffect55, useMemo as useMemo36, useState as useState80 } from "react";
32415
33009
  import { message as message21 } from "antd";
32416
33010
 
32417
33011
  // src/components/Chat/FileDirectoryPanel.tsx
32418
- import React72 from "react";
33012
+ import React73 from "react";
32419
33013
  import { Spin as Spin22 } from "antd";
32420
33014
  import { ChevronRight as ChevronRight8, FolderOpen as FolderOpen4, Upload } from "lucide-react";
32421
33015
  import { createStyles as createStyles38 } from "antd-style";
32422
- import { Fragment as Fragment27, jsx as jsx125, jsxs as jsxs90 } from "react/jsx-runtime";
33016
+ import { Fragment as Fragment27, jsx as jsx126, jsxs as jsxs91 } from "react/jsx-runtime";
32423
33017
  var useStyles21 = createStyles38(({ token, css }) => ({
32424
33018
  container: css`
32425
33019
  height: 100%;
@@ -32647,26 +33241,26 @@ var FileDirectoryPanel = ({
32647
33241
  onAssetClick
32648
33242
  }) => {
32649
33243
  const { styles } = useStyles21();
32650
- const renderEntry = React72.useCallback((entry, depth) => {
33244
+ const renderEntry = React73.useCallback((entry, depth) => {
32651
33245
  const entryName = getEntryName(entry);
32652
33246
  if (entry.is_dir) {
32653
33247
  const isExpanded = directoryExpanded[entry.path] || false;
32654
33248
  const children = directoryChildren[entry.path] || [];
32655
33249
  const isLoading = directoryLoading[entry.path] || false;
32656
- return /* @__PURE__ */ jsxs90("div", { className: styles.treeChildren, children: [
32657
- /* @__PURE__ */ jsxs90("div", { className: styles.treeRow, children: [
32658
- Array.from({ length: depth }).map((_, index) => /* @__PURE__ */ jsx125("span", { className: styles.treeIndent }, `${entry.path}-indent-${index}`)),
32659
- /* @__PURE__ */ jsx125(
33250
+ return /* @__PURE__ */ jsxs91("div", { className: styles.treeChildren, children: [
33251
+ /* @__PURE__ */ jsxs91("div", { className: styles.treeRow, children: [
33252
+ Array.from({ length: depth }).map((_, index) => /* @__PURE__ */ jsx126("span", { className: styles.treeIndent }, `${entry.path}-indent-${index}`)),
33253
+ /* @__PURE__ */ jsx126(
32660
33254
  "button",
32661
33255
  {
32662
33256
  type: "button",
32663
33257
  className: styles.treeToggle,
32664
33258
  "aria-label": `${isExpanded ? "collapse" : "expand"} ${entryName}`,
32665
33259
  onClick: () => void onToggleDirectory(entry.path),
32666
- children: /* @__PURE__ */ jsx125(ChevronRight8, { size: 14, style: { transform: isExpanded ? "rotate(90deg)" : void 0 } })
33260
+ children: /* @__PURE__ */ jsx126(ChevronRight8, { size: 14, style: { transform: isExpanded ? "rotate(90deg)" : void 0 } })
32667
33261
  }
32668
33262
  ),
32669
- /* @__PURE__ */ jsxs90(
33263
+ /* @__PURE__ */ jsxs91(
32670
33264
  "button",
32671
33265
  {
32672
33266
  type: "button",
@@ -32675,19 +33269,19 @@ var FileDirectoryPanel = ({
32675
33269
  onClick: () => void onToggleDirectory(entry.path),
32676
33270
  title: entryName,
32677
33271
  children: [
32678
- /* @__PURE__ */ jsx125("div", { className: styles.assetIcon, children: /* @__PURE__ */ jsx125(FolderOpen4, { size: 14 }) }),
32679
- /* @__PURE__ */ jsx125("div", { className: styles.assetInfo, children: /* @__PURE__ */ jsx125("div", { className: styles.assetName, children: entryName }) })
33272
+ /* @__PURE__ */ jsx126("div", { className: styles.assetIcon, children: /* @__PURE__ */ jsx126(FolderOpen4, { size: 14 }) }),
33273
+ /* @__PURE__ */ jsx126("div", { className: styles.assetInfo, children: /* @__PURE__ */ jsx126("div", { className: styles.assetName, children: entryName }) })
32680
33274
  ]
32681
33275
  }
32682
33276
  )
32683
33277
  ] }),
32684
- isExpanded ? isLoading ? /* @__PURE__ */ jsx125("div", { className: styles.loading, children: /* @__PURE__ */ jsx125(Spin22, { size: "small" }) }) : children.length > 0 ? children.map((child) => renderEntry(child, depth + 1)) : /* @__PURE__ */ jsx125("div", { className: styles.emptyState, children: "No files in this folder" }) : null
33278
+ isExpanded ? isLoading ? /* @__PURE__ */ jsx126("div", { className: styles.loading, children: /* @__PURE__ */ jsx126(Spin22, { size: "small" }) }) : children.length > 0 ? children.map((child) => renderEntry(child, depth + 1)) : /* @__PURE__ */ jsx126("div", { className: styles.emptyState, children: "No files in this folder" }) : null
32685
33279
  ] }, entry.path);
32686
33280
  }
32687
- return /* @__PURE__ */ jsxs90("div", { className: styles.treeRow, children: [
32688
- Array.from({ length: depth }).map((_, index) => /* @__PURE__ */ jsx125("span", { className: styles.treeIndent }, `${entry.path}-indent-${index}`)),
32689
- /* @__PURE__ */ jsx125("span", { className: styles.treeSpacer }),
32690
- /* @__PURE__ */ jsxs90(
33281
+ return /* @__PURE__ */ jsxs91("div", { className: styles.treeRow, children: [
33282
+ Array.from({ length: depth }).map((_, index) => /* @__PURE__ */ jsx126("span", { className: styles.treeIndent }, `${entry.path}-indent-${index}`)),
33283
+ /* @__PURE__ */ jsx126("span", { className: styles.treeSpacer }),
33284
+ /* @__PURE__ */ jsxs91(
32691
33285
  "button",
32692
33286
  {
32693
33287
  type: "button",
@@ -32696,10 +33290,10 @@ var FileDirectoryPanel = ({
32696
33290
  "aria-label": `open ${entryName}`,
32697
33291
  title: entryName,
32698
33292
  children: [
32699
- /* @__PURE__ */ jsx125("div", { className: styles.assetIcon, children: getFileIcon(entryName) }),
32700
- /* @__PURE__ */ jsxs90("div", { className: styles.assetInfo, children: [
32701
- /* @__PURE__ */ jsx125("div", { className: styles.assetName, children: entryName }),
32702
- /* @__PURE__ */ jsx125("div", { className: styles.assetMeta, children: formatDate5(entry.modified_at) })
33293
+ /* @__PURE__ */ jsx126("div", { className: styles.assetIcon, children: getFileIcon(entryName) }),
33294
+ /* @__PURE__ */ jsxs91("div", { className: styles.assetInfo, children: [
33295
+ /* @__PURE__ */ jsx126("div", { className: styles.assetName, children: entryName }),
33296
+ /* @__PURE__ */ jsx126("div", { className: styles.assetMeta, children: formatDate5(entry.modified_at) })
32703
33297
  ] })
32704
33298
  ]
32705
33299
  }
@@ -32707,20 +33301,20 @@ var FileDirectoryPanel = ({
32707
33301
  ] }, entry.path);
32708
33302
  }, [directoryChildren, directoryExpanded, directoryLoading, onAssetClick, onToggleDirectory, styles]);
32709
33303
  if (!projectId) {
32710
- return /* @__PURE__ */ jsx125("div", { className: styles.emptyState, children: "Please select a project to browse files" });
33304
+ return /* @__PURE__ */ jsx126("div", { className: styles.emptyState, children: "Please select a project to browse files" });
32711
33305
  }
32712
- return /* @__PURE__ */ jsxs90("div", { className: styles.container, children: [
32713
- /* @__PURE__ */ jsxs90("h3", { className: styles.header, children: [
32714
- /* @__PURE__ */ jsx125(FolderOpen4, { size: 16 }),
32715
- /* @__PURE__ */ jsx125("span", { children: "Files" })
33306
+ return /* @__PURE__ */ jsxs91("div", { className: styles.container, children: [
33307
+ /* @__PURE__ */ jsxs91("h3", { className: styles.header, children: [
33308
+ /* @__PURE__ */ jsx126(FolderOpen4, { size: 16 }),
33309
+ /* @__PURE__ */ jsx126("span", { children: "Files" })
32716
33310
  ] }),
32717
33311
  resourceFolders.map((folder) => {
32718
33312
  const entries = folderEntries[folder.name] || [];
32719
33313
  const isLoading = folderLoading[folder.name] || false;
32720
33314
  const itemCount = entries.length;
32721
- return /* @__PURE__ */ jsxs90("div", { className: styles.section, children: [
32722
- /* @__PURE__ */ jsxs90("div", { className: styles.sectionHeader, children: [
32723
- /* @__PURE__ */ jsx125(
33315
+ return /* @__PURE__ */ jsxs91("div", { className: styles.section, children: [
33316
+ /* @__PURE__ */ jsxs91("div", { className: styles.sectionHeader, children: [
33317
+ /* @__PURE__ */ jsx126(
32724
33318
  "span",
32725
33319
  {
32726
33320
  className: styles.sectionTitle,
@@ -32729,24 +33323,24 @@ var FileDirectoryPanel = ({
32729
33323
  children: folder.displayName || folder.name
32730
33324
  }
32731
33325
  ),
32732
- /* @__PURE__ */ jsx125("span", { className: styles.badge, children: itemCount })
33326
+ /* @__PURE__ */ jsx126("span", { className: styles.badge, children: itemCount })
32733
33327
  ] }),
32734
- isLoading ? /* @__PURE__ */ jsx125("div", { className: styles.loading, children: /* @__PURE__ */ jsx125(Spin22, { size: "small" }) }) : /* @__PURE__ */ jsxs90("div", { className: styles.assetList, children: [
33328
+ isLoading ? /* @__PURE__ */ jsx126("div", { className: styles.loading, children: /* @__PURE__ */ jsx126(Spin22, { size: "small" }) }) : /* @__PURE__ */ jsxs91("div", { className: styles.assetList, children: [
32735
33329
  entries.map((entry) => renderEntry(entry, 0)),
32736
- entries.length === 0 ? /* @__PURE__ */ jsx125("div", { className: styles.emptyState, children: "No files in this folder" }) : null,
32737
- folder.allowUpload ? /* @__PURE__ */ jsx125(
33330
+ entries.length === 0 ? /* @__PURE__ */ jsx126("div", { className: styles.emptyState, children: "No files in this folder" }) : null,
33331
+ folder.allowUpload ? /* @__PURE__ */ jsx126(
32738
33332
  "button",
32739
33333
  {
32740
33334
  type: "button",
32741
33335
  className: styles.uploadBtn,
32742
33336
  onClick: () => void onUploadFolder(folder.name),
32743
33337
  disabled: !workspaceId || !projectId || uploadingFolder === folder.name,
32744
- children: uploadingFolder === folder.name ? /* @__PURE__ */ jsxs90(Fragment27, { children: [
32745
- /* @__PURE__ */ jsx125(Spin22, { size: "small" }),
32746
- /* @__PURE__ */ jsx125("span", { children: "Uploading..." })
32747
- ] }) : /* @__PURE__ */ jsxs90(Fragment27, { children: [
32748
- /* @__PURE__ */ jsx125(Upload, { size: 14 }),
32749
- /* @__PURE__ */ jsx125("span", { children: "Upload" })
33338
+ children: uploadingFolder === folder.name ? /* @__PURE__ */ jsxs91(Fragment27, { children: [
33339
+ /* @__PURE__ */ jsx126(Spin22, { size: "small" }),
33340
+ /* @__PURE__ */ jsx126("span", { children: "Uploading..." })
33341
+ ] }) : /* @__PURE__ */ jsxs91(Fragment27, { children: [
33342
+ /* @__PURE__ */ jsx126(Upload, { size: 14 }),
33343
+ /* @__PURE__ */ jsx126("span", { children: "Upload" })
32750
33344
  ] })
32751
33345
  }
32752
33346
  ) : null
@@ -32757,7 +33351,7 @@ var FileDirectoryPanel = ({
32757
33351
  };
32758
33352
 
32759
33353
  // src/components/Chat/ToolPanelFiles.tsx
32760
- import { jsx as jsx126 } from "react/jsx-runtime";
33354
+ import { jsx as jsx127 } from "react/jsx-runtime";
32761
33355
  var ToolPanelFiles = () => {
32762
33356
  const { config } = useLatticeChatShellContext();
32763
33357
  const { openSideApp } = useChatUIContext();
@@ -32776,10 +33370,10 @@ var ToolPanelFiles = () => {
32776
33370
  const [directoryLoading, setDirectoryLoading] = useState80({});
32777
33371
  const [directoryExpanded, setDirectoryExpanded] = useState80({});
32778
33372
  const [uploadingFolder, setUploadingFolder] = useState80(null);
32779
- const resourceFolders = useMemo35(() => {
33373
+ const resourceFolders = useMemo36(() => {
32780
33374
  return config.resourceFolders && config.resourceFolders.length > 0 ? config.resourceFolders : [{ name: "/", displayName: "Project Assets", allowUpload: true }];
32781
33375
  }, [config.resourceFolders]);
32782
- const loadAssetsForFolder = useCallback41(
33376
+ const loadAssetsForFolder = useCallback42(
32783
33377
  async (folder, clearSubdirectoryCache = true) => {
32784
33378
  if (!workspaceId || !projectId) {
32785
33379
  setFolderEntries((prev) => ({ ...prev, [folder.name]: [] }));
@@ -32819,7 +33413,7 @@ var ToolPanelFiles = () => {
32819
33413
  },
32820
33414
  [workspaceId, projectId, listPathByFolder, currentAssistant?.id]
32821
33415
  );
32822
- const handleToggleDirectory = useCallback41(async (path) => {
33416
+ const handleToggleDirectory = useCallback42(async (path) => {
32823
33417
  const isExpanded = directoryExpanded[path] || false;
32824
33418
  if (isExpanded) {
32825
33419
  setDirectoryExpanded((prev) => ({ ...prev, [path]: false }));
@@ -32837,12 +33431,12 @@ var ToolPanelFiles = () => {
32837
33431
  setDirectoryLoading((prev) => ({ ...prev, [path]: false }));
32838
33432
  }
32839
33433
  }, [directoryExpanded, listPath, currentAssistant?.id]);
32840
- useEffect54(() => {
33434
+ useEffect55(() => {
32841
33435
  resourceFolders.forEach((folder) => {
32842
33436
  void loadAssetsForFolder(folder, false);
32843
33437
  });
32844
33438
  }, [resourceFolders, loadAssetsForFolder]);
32845
- const handleAssetClick = useCallback41((asset) => {
33439
+ const handleAssetClick = useCallback42((asset) => {
32846
33440
  const fileUrl = getFileViewUrl(asset.path, currentAssistant?.id);
32847
33441
  if (!fileUrl) {
32848
33442
  message21.warning("Please select a workspace and project first.");
@@ -32858,7 +33452,7 @@ var ToolPanelFiles = () => {
32858
33452
  message: `Preview: ${asset.name || asset.path}`
32859
33453
  });
32860
33454
  }, [getFileViewUrl, openSideApp, currentAssistant?.id]);
32861
- const handleUploadFolder = useCallback41(async (folderName) => {
33455
+ const handleUploadFolder = useCallback42(async (folderName) => {
32862
33456
  if (!workspaceId || !projectId) {
32863
33457
  message21.warning("Please select a workspace and project before uploading.");
32864
33458
  return;
@@ -32889,7 +33483,7 @@ var ToolPanelFiles = () => {
32889
33483
  };
32890
33484
  input.click();
32891
33485
  }, [workspaceId, projectId, uploadFileToFolder, resourceFolders, loadAssetsForFolder, currentAssistant?.id]);
32892
- return /* @__PURE__ */ jsx126(
33486
+ return /* @__PURE__ */ jsx127(
32893
33487
  FileDirectoryPanel,
32894
33488
  {
32895
33489
  workspaceId,
@@ -32910,7 +33504,7 @@ var ToolPanelFiles = () => {
32910
33504
  };
32911
33505
 
32912
33506
  // src/components/Chat/LatticeChat.tsx
32913
- import { Fragment as Fragment28, jsx as jsx127, jsxs as jsxs91 } from "react/jsx-runtime";
33507
+ import { Fragment as Fragment28, jsx as jsx128, jsxs as jsxs92 } from "react/jsx-runtime";
32914
33508
  var useStyles22 = createStyles39(({ css }) => ({
32915
33509
  wrapper: css`
32916
33510
  display: flex;
@@ -32943,29 +33537,29 @@ var LatticeChatContent = (props) => {
32943
33537
  const { config } = useLatticeChatShellContext();
32944
33538
  const { styles } = useStyles22();
32945
33539
  const showWorkspaceSelector = showProjectSelector ?? config.enableWorkspace;
32946
- const layoutHeader = /* @__PURE__ */ jsxs91("div", { className: styles.headerBar, children: [
32947
- /* @__PURE__ */ jsx127("div", { className: styles.headerLeft, children: showWorkspaceSelector ? /* @__PURE__ */ jsx127(ProjectSelector, {}) : null }),
32948
- /* @__PURE__ */ jsx127("div", { className: styles.headerRight, children: headerRight !== void 0 ? headerRight : /* @__PURE__ */ jsxs91(Fragment28, { children: [
32949
- /* @__PURE__ */ jsx127(PinToMenuButton, { assistantId }),
32950
- /* @__PURE__ */ jsx127(FilePanelToggle, {})
33540
+ const layoutHeader = /* @__PURE__ */ jsxs92("div", { className: styles.headerBar, children: [
33541
+ /* @__PURE__ */ jsx128("div", { className: styles.headerLeft, children: showWorkspaceSelector ? /* @__PURE__ */ jsx128(ProjectSelector, {}) : null }),
33542
+ /* @__PURE__ */ jsx128("div", { className: styles.headerRight, children: headerRight !== void 0 ? headerRight : /* @__PURE__ */ jsxs92(Fragment28, { children: [
33543
+ /* @__PURE__ */ jsx128(PinToMenuButton, { assistantId }),
33544
+ /* @__PURE__ */ jsx128(FilePanelToggle, {})
32951
33545
  ] }) })
32952
33546
  ] });
32953
- return /* @__PURE__ */ jsxs91("div", { className: styles.wrapper, children: [
33547
+ return /* @__PURE__ */ jsxs92("div", { className: styles.wrapper, children: [
32954
33548
  header,
32955
- /* @__PURE__ */ jsx127(
33549
+ /* @__PURE__ */ jsx128(
32956
33550
  ColumnLayout,
32957
33551
  {
32958
33552
  menu,
32959
33553
  header: layoutHeader,
32960
- main: thread_id ? /* @__PURE__ */ jsx127(Chating, { ...chatingProps }) : emptyPlaceholder ?? /* @__PURE__ */ jsx127("div", { children: "Please create a conversation first" }),
32961
- detail: /* @__PURE__ */ jsx127(SideAppViewBrowser, {}),
32962
- tools: /* @__PURE__ */ jsx127(ToolPanelFiles, {})
33554
+ main: thread_id ? /* @__PURE__ */ jsx128(Chating, { ...chatingProps }) : emptyPlaceholder ?? /* @__PURE__ */ jsx128("div", { children: "Please create a conversation first" }),
33555
+ detail: /* @__PURE__ */ jsx128(SideAppViewBrowser, {}),
33556
+ tools: /* @__PURE__ */ jsx128(ToolPanelFiles, {})
32963
33557
  }
32964
33558
  )
32965
33559
  ] });
32966
33560
  };
32967
33561
  var LatticeChat = (props) => {
32968
- return /* @__PURE__ */ jsx127(
33562
+ return /* @__PURE__ */ jsx128(
32969
33563
  AgentThreadProvider,
32970
33564
  {
32971
33565
  assistantId: props.assistant_id,
@@ -32975,7 +33569,7 @@ var LatticeChat = (props) => {
32975
33569
  enableReturnStateWhenStreamCompleted: true,
32976
33570
  enableResumeStream: true
32977
33571
  },
32978
- children: /* @__PURE__ */ jsx127(ChatUIContextProvider, { children: /* @__PURE__ */ jsx127(LatticeChatContent, { ...props }) })
33572
+ children: /* @__PURE__ */ jsx128(ChatUIContextProvider, { children: /* @__PURE__ */ jsx128(LatticeChatContent, { ...props }) })
32979
33573
  }
32980
33574
  );
32981
33575
  };
@@ -32984,7 +33578,7 @@ var LatticeChat = (props) => {
32984
33578
  import { useContext as useContext12 } from "react";
32985
33579
 
32986
33580
  // src/components/Chat/ChatSidebar.tsx
32987
- import { useState as useState81, useMemo as useMemo36, useCallback as useCallback43 } from "react";
33581
+ import { useState as useState81, useMemo as useMemo37, useCallback as useCallback44 } from "react";
32988
33582
  import { Drawer as Drawer3, Avatar as Avatar13, Popover as Popover4, Button as Button58 } from "antd";
32989
33583
  import {
32990
33584
  History as History2,
@@ -32995,11 +33589,11 @@ import {
32995
33589
  } from "lucide-react";
32996
33590
 
32997
33591
  // src/components/Chat/ThreadHistoryMenuContent.tsx
32998
- import React74, { useCallback as useCallback42 } from "react";
33592
+ import React75, { useCallback as useCallback43 } from "react";
32999
33593
  import { createStyles as createStyles40 } from "antd-style";
33000
- import { MessageSquare as MessageSquare3, Trash2 as Trash29 } from "lucide-react";
33594
+ import { MessageSquare as MessageSquare4, Trash2 as Trash29 } from "lucide-react";
33001
33595
  import { message as message22, Modal as Modal23 } from "antd";
33002
- import { jsx as jsx128, jsxs as jsxs92 } from "react/jsx-runtime";
33596
+ import { jsx as jsx129, jsxs as jsxs93 } from "react/jsx-runtime";
33003
33597
  var useStyles23 = createStyles40(({ token, css }) => ({
33004
33598
  container: css`
33005
33599
  padding: 4px;
@@ -33109,7 +33703,7 @@ var ThreadHistoryMenuContent = () => {
33109
33703
  deleteThread,
33110
33704
  isLoading
33111
33705
  } = useConversationContext();
33112
- const handleDeleteThread = useCallback42(
33706
+ const handleDeleteThread = useCallback43(
33113
33707
  async (e, threadIdToDelete) => {
33114
33708
  e.stopPropagation();
33115
33709
  Modal23.confirm({
@@ -33130,7 +33724,7 @@ var ThreadHistoryMenuContent = () => {
33130
33724
  },
33131
33725
  [deleteThread]
33132
33726
  );
33133
- const sortedThreads = React74.useMemo(() => {
33727
+ const sortedThreads = React75.useMemo(() => {
33134
33728
  return [...threads].sort((a, b) => {
33135
33729
  const dateA = a.updatedAt ? new Date(a.updatedAt).getTime() : 0;
33136
33730
  const dateB = b.updatedAt ? new Date(b.updatedAt).getTime() : 0;
@@ -33138,30 +33732,30 @@ var ThreadHistoryMenuContent = () => {
33138
33732
  });
33139
33733
  }, [threads]);
33140
33734
  if (isLoading) {
33141
- return /* @__PURE__ */ jsx128("div", { className: styles.container, children: /* @__PURE__ */ jsx128("div", { className: styles.loading, children: "Loading conversations..." }) });
33735
+ return /* @__PURE__ */ jsx129("div", { className: styles.container, children: /* @__PURE__ */ jsx129("div", { className: styles.loading, children: "Loading conversations..." }) });
33142
33736
  }
33143
- return /* @__PURE__ */ jsx128("div", { className: styles.container, children: sortedThreads.length === 0 ? /* @__PURE__ */ jsx128("div", { className: styles.emptyState, children: "No conversations yet" }) : /* @__PURE__ */ jsx128("div", { className: styles.threadList, children: sortedThreads.map((thread) => /* @__PURE__ */ jsxs92(
33737
+ return /* @__PURE__ */ jsx129("div", { className: styles.container, children: sortedThreads.length === 0 ? /* @__PURE__ */ jsx129("div", { className: styles.emptyState, children: "No conversations yet" }) : /* @__PURE__ */ jsx129("div", { className: styles.threadList, children: sortedThreads.map((thread) => /* @__PURE__ */ jsxs93(
33144
33738
  "div",
33145
33739
  {
33146
33740
  className: `${styles.threadItem} ${thread.id === threadId ? "active" : ""}`,
33147
33741
  onClick: () => selectThread(thread.id),
33148
33742
  title: thread.label,
33149
33743
  children: [
33150
- /* @__PURE__ */ jsx128("div", { className: styles.threadIcon, children: /* @__PURE__ */ jsx128(MessageSquare3, { size: 14 }) }),
33151
- /* @__PURE__ */ jsx128(
33744
+ /* @__PURE__ */ jsx129("div", { className: styles.threadIcon, children: /* @__PURE__ */ jsx129(MessageSquare4, { size: 14 }) }),
33745
+ /* @__PURE__ */ jsx129(
33152
33746
  "div",
33153
33747
  {
33154
33748
  className: thread.id === threadId ? styles.threadNameActive : styles.threadName,
33155
33749
  children: thread.label
33156
33750
  }
33157
33751
  ),
33158
- /* @__PURE__ */ jsx128(
33752
+ /* @__PURE__ */ jsx129(
33159
33753
  "button",
33160
33754
  {
33161
33755
  className: styles.deleteBtn,
33162
33756
  onClick: (e) => handleDeleteThread(e, thread.id),
33163
33757
  title: "Delete conversation",
33164
- children: /* @__PURE__ */ jsx128(Trash29, { size: 12 })
33758
+ children: /* @__PURE__ */ jsx129(Trash29, { size: 12 })
33165
33759
  }
33166
33760
  )
33167
33761
  ]
@@ -33171,7 +33765,7 @@ var ThreadHistoryMenuContent = () => {
33171
33765
  };
33172
33766
 
33173
33767
  // src/components/Chat/ChatSidebar.tsx
33174
- import { Fragment as Fragment29, jsx as jsx129, jsxs as jsxs93 } from "react/jsx-runtime";
33768
+ import { Fragment as Fragment29, jsx as jsx130, jsxs as jsxs94 } from "react/jsx-runtime";
33175
33769
  var DRAWER_STYLES2 = {
33176
33770
  wrapper: {
33177
33771
  background: "transparent",
@@ -33196,7 +33790,7 @@ var DEFAULT_MENU_ITEMS = [
33196
33790
  builtin: "new-analysis",
33197
33791
  type: "action",
33198
33792
  name: "New Analysis",
33199
- icon: /* @__PURE__ */ jsx129(PlusCircle, { size: 20 }),
33793
+ icon: /* @__PURE__ */ jsx130(PlusCircle, { size: 20 }),
33200
33794
  order: 0
33201
33795
  },
33202
33796
  {
@@ -33204,13 +33798,13 @@ var DEFAULT_MENU_ITEMS = [
33204
33798
  builtin: "thread-history",
33205
33799
  type: "drawer",
33206
33800
  name: "History",
33207
- icon: /* @__PURE__ */ jsx129(History2, { size: 20 }),
33801
+ icon: /* @__PURE__ */ jsx130(History2, { size: 20 }),
33208
33802
  order: 1,
33209
33803
  title: "Conversation History",
33210
33804
  width: 320,
33211
33805
  inline: true,
33212
33806
  inlineDefaultExpanded: true,
33213
- content: /* @__PURE__ */ jsx129(ThreadHistoryMenuContent, {})
33807
+ content: /* @__PURE__ */ jsx130(ThreadHistoryMenuContent, {})
33214
33808
  }
33215
33809
  ];
33216
33810
  var ChatSidebar = ({
@@ -33232,11 +33826,11 @@ var ChatSidebar = ({
33232
33826
  sidebarLogoIcon
33233
33827
  } = config;
33234
33828
  const isExpandedMode = sidebarMode === "expanded";
33235
- const menuItems = useMemo36(() => {
33829
+ const menuItems = useMemo37(() => {
33236
33830
  const items = customMenuItems.length > 0 ? [...customMenuItems] : [...DEFAULT_MENU_ITEMS];
33237
33831
  return items.sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
33238
33832
  }, [customMenuItems]);
33239
- const handleMenuClick = useCallback43(async (item) => {
33833
+ const handleMenuClick = useCallback44(async (item) => {
33240
33834
  if (item.builtin === "settings") {
33241
33835
  setSettingsModalOpen(true);
33242
33836
  onSettingsClick?.();
@@ -33259,30 +33853,30 @@ var ChatSidebar = ({
33259
33853
  }
33260
33854
  }
33261
33855
  }, [onSettingsClick, setSettingsModalOpen, createThread, logout]);
33262
- const handleCloseDrawer = useCallback43((itemId) => {
33856
+ const handleCloseDrawer = useCallback44((itemId) => {
33263
33857
  setDrawerStates((prev) => ({ ...prev, [itemId]: false }));
33264
33858
  }, []);
33265
- const handleNewAnalysis = useCallback43(async () => {
33859
+ const handleNewAnalysis = useCallback44(async () => {
33266
33860
  try {
33267
33861
  await createThread("New Analysis");
33268
33862
  } catch (error) {
33269
33863
  console.error("Failed to create new thread:", error);
33270
33864
  }
33271
33865
  }, [createThread]);
33272
- const renderDrawerContent = useCallback43((item) => {
33866
+ const renderDrawerContent = useCallback44((item) => {
33273
33867
  switch (item.builtin) {
33274
33868
  case "thread-history":
33275
- return /* @__PURE__ */ jsx129(ThreadHistoryMenuContent, {});
33869
+ return /* @__PURE__ */ jsx130(ThreadHistoryMenuContent, {});
33276
33870
  default:
33277
33871
  return item.content;
33278
33872
  }
33279
33873
  }, []);
33280
- const userMenuItems = /* @__PURE__ */ jsxs93("div", { style: { minWidth: 160 }, children: [
33281
- /* @__PURE__ */ jsxs93("div", { style: { padding: "8px 12px", borderBottom: "1px solid #f0f0f0" }, children: [
33282
- /* @__PURE__ */ jsx129("div", { style: { fontWeight: 500 }, children: user?.name || user?.email }),
33283
- /* @__PURE__ */ jsx129("div", { style: { fontSize: 12, color: "#666" }, children: user?.email })
33874
+ const userMenuItems = /* @__PURE__ */ jsxs94("div", { style: { minWidth: 160 }, children: [
33875
+ /* @__PURE__ */ jsxs94("div", { style: { padding: "8px 12px", borderBottom: "1px solid #f0f0f0" }, children: [
33876
+ /* @__PURE__ */ jsx130("div", { style: { fontWeight: 500 }, children: user?.name || user?.email }),
33877
+ /* @__PURE__ */ jsx130("div", { style: { fontSize: 12, color: "#666" }, children: user?.email })
33284
33878
  ] }),
33285
- /* @__PURE__ */ jsxs93(
33879
+ /* @__PURE__ */ jsxs94(
33286
33880
  Button58,
33287
33881
  {
33288
33882
  type: "text",
@@ -33290,12 +33884,12 @@ var ChatSidebar = ({
33290
33884
  style: { justifyContent: "flex-start", padding: "8px 12px" },
33291
33885
  onClick: () => setChangePasswordOpen(true),
33292
33886
  children: [
33293
- /* @__PURE__ */ jsx129(Key2, { size: 16, style: { marginRight: 8 } }),
33887
+ /* @__PURE__ */ jsx130(Key2, { size: 16, style: { marginRight: 8 } }),
33294
33888
  "Change Password"
33295
33889
  ]
33296
33890
  }
33297
33891
  ),
33298
- /* @__PURE__ */ jsxs93(
33892
+ /* @__PURE__ */ jsxs94(
33299
33893
  Button58,
33300
33894
  {
33301
33895
  type: "text",
@@ -33304,14 +33898,14 @@ var ChatSidebar = ({
33304
33898
  style: { justifyContent: "flex-start", padding: "8px 12px" },
33305
33899
  onClick: logout,
33306
33900
  children: [
33307
- /* @__PURE__ */ jsx129(LogOut4, { size: 16, style: { marginRight: 8 } }),
33901
+ /* @__PURE__ */ jsx130(LogOut4, { size: 16, style: { marginRight: 8 } }),
33308
33902
  "Logout"
33309
33903
  ]
33310
33904
  }
33311
33905
  )
33312
33906
  ] });
33313
- return /* @__PURE__ */ jsxs93(Fragment29, { children: [
33314
- /* @__PURE__ */ jsx129(
33907
+ return /* @__PURE__ */ jsxs94(Fragment29, { children: [
33908
+ /* @__PURE__ */ jsx130(
33315
33909
  Menu,
33316
33910
  {
33317
33911
  items: menuItems,
@@ -33325,13 +33919,13 @@ var ChatSidebar = ({
33325
33919
  forceIconMode: sideAppVisible,
33326
33920
  collapsed: menuCollapsed,
33327
33921
  onCollapsedChange: setMenuCollapsed,
33328
- footer: ({ isIconMode }) => user && /* @__PURE__ */ jsx129(
33922
+ footer: ({ isIconMode }) => user && /* @__PURE__ */ jsx130(
33329
33923
  Popover4,
33330
33924
  {
33331
33925
  content: userMenuItems,
33332
33926
  placement: "rightTop",
33333
33927
  trigger: "click",
33334
- children: /* @__PURE__ */ jsxs93(
33928
+ children: /* @__PURE__ */ jsxs94(
33335
33929
  "div",
33336
33930
  {
33337
33931
  style: {
@@ -33345,7 +33939,7 @@ var ChatSidebar = ({
33345
33939
  transition: "all 0.2s"
33346
33940
  },
33347
33941
  children: [
33348
- /* @__PURE__ */ jsx129(
33942
+ /* @__PURE__ */ jsx130(
33349
33943
  Avatar13,
33350
33944
  {
33351
33945
  size: isIconMode ? 32 : 36,
@@ -33357,8 +33951,8 @@ var ChatSidebar = ({
33357
33951
  children: (user.name?.charAt(0) || user.email.charAt(0)).toUpperCase()
33358
33952
  }
33359
33953
  ),
33360
- !isIconMode && /* @__PURE__ */ jsxs93("div", { style: { flex: 1, minWidth: 0 }, children: [
33361
- /* @__PURE__ */ jsx129(
33954
+ !isIconMode && /* @__PURE__ */ jsxs94("div", { style: { flex: 1, minWidth: 0 }, children: [
33955
+ /* @__PURE__ */ jsx130(
33362
33956
  "div",
33363
33957
  {
33364
33958
  style: {
@@ -33370,7 +33964,7 @@ var ChatSidebar = ({
33370
33964
  children: user.name || user.email
33371
33965
  }
33372
33966
  ),
33373
- /* @__PURE__ */ jsx129(
33967
+ /* @__PURE__ */ jsx130(
33374
33968
  "div",
33375
33969
  {
33376
33970
  style: {
@@ -33391,19 +33985,19 @@ var ChatSidebar = ({
33391
33985
  )
33392
33986
  }
33393
33987
  ),
33394
- /* @__PURE__ */ jsx129(
33988
+ /* @__PURE__ */ jsx130(
33395
33989
  ChangePasswordModal,
33396
33990
  {
33397
33991
  open: changePasswordOpen,
33398
33992
  onClose: () => setChangePasswordOpen(false)
33399
33993
  }
33400
33994
  ),
33401
- menuItems.filter((item) => item.type === "drawer" && !item.inline).map((item) => /* @__PURE__ */ jsx129(
33995
+ menuItems.filter((item) => item.type === "drawer" && !item.inline).map((item) => /* @__PURE__ */ jsx130(
33402
33996
  Drawer3,
33403
33997
  {
33404
- title: /* @__PURE__ */ jsxs93("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }, children: [
33405
- /* @__PURE__ */ jsx129("span", { style: { fontSize: 16, fontWeight: 600, textTransform: "uppercase", letterSpacing: 0.5 }, children: item.title || item.name }),
33406
- /* @__PURE__ */ jsx129(
33998
+ title: /* @__PURE__ */ jsxs94("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }, children: [
33999
+ /* @__PURE__ */ jsx130("span", { style: { fontSize: 16, fontWeight: 600, textTransform: "uppercase", letterSpacing: 0.5 }, children: item.title || item.name }),
34000
+ /* @__PURE__ */ jsx130(
33407
34001
  "button",
33408
34002
  {
33409
34003
  onClick: () => handleCloseDrawer(item.id),
@@ -33418,7 +34012,7 @@ var ChatSidebar = ({
33418
34012
  background: "rgba(255, 255, 255, 0.5)",
33419
34013
  cursor: "pointer"
33420
34014
  },
33421
- children: /* @__PURE__ */ jsx129(PanelLeftClose2, { size: 24 })
34015
+ children: /* @__PURE__ */ jsx130(PanelLeftClose2, { size: 24 })
33422
34016
  }
33423
34017
  )
33424
34018
  ] }),
@@ -33449,7 +34043,7 @@ var ChatSidebar = ({
33449
34043
  };
33450
34044
 
33451
34045
  // src/components/Chat/LatticeChatView.tsx
33452
- import { jsx as jsx130 } from "react/jsx-runtime";
34046
+ import { jsx as jsx131 } from "react/jsx-runtime";
33453
34047
  var LatticeChatView = (props) => {
33454
34048
  const shellContext = useContext12(LatticeChatShellContext);
33455
34049
  const { showSideMenu, sideMenuItems } = shellContext.config;
@@ -33458,7 +34052,7 @@ var LatticeChatView = (props) => {
33458
34052
  const {
33459
34053
  config: { baseURL }
33460
34054
  } = useLatticeChatShellContext();
33461
- return assistantId && thread ? /* @__PURE__ */ jsx130(
34055
+ return assistantId && thread ? /* @__PURE__ */ jsx131(
33462
34056
  AxiomLatticeProvider,
33463
34057
  {
33464
34058
  config: {
@@ -33467,14 +34061,14 @@ var LatticeChatView = (props) => {
33467
34061
  assistantId,
33468
34062
  transport: "sse"
33469
34063
  },
33470
- children: /* @__PURE__ */ jsx130(
34064
+ children: /* @__PURE__ */ jsx131(
33471
34065
  LatticeChat,
33472
34066
  {
33473
34067
  thread_id: thread?.id,
33474
34068
  assistant_id: assistantId,
33475
34069
  name: currentAssistant?.name,
33476
34070
  description: currentAssistant?.description,
33477
- menu: showSideMenu ? /* @__PURE__ */ jsx130(ChatSidebar, { customMenuItems: sideMenuItems }) : void 0
34071
+ menu: showSideMenu ? /* @__PURE__ */ jsx131(ChatSidebar, { customMenuItems: sideMenuItems }) : void 0
33478
34072
  }
33479
34073
  )
33480
34074
  }
@@ -33482,14 +34076,14 @@ var LatticeChatView = (props) => {
33482
34076
  };
33483
34077
 
33484
34078
  // src/components/Chat/SettingsModal.tsx
33485
- import { useState as useState82, useEffect as useEffect55, useRef as useRef30 } from "react";
34079
+ import { useState as useState82, useEffect as useEffect56, useRef as useRef30 } from "react";
33486
34080
  import {
33487
34081
  Modal as Modal24,
33488
34082
  Input as Input19,
33489
34083
  Button as Button59,
33490
34084
  message as message23,
33491
34085
  notification as notification5,
33492
- Typography as Typography59,
34086
+ Typography as Typography60,
33493
34087
  Alert as Alert9,
33494
34088
  Select as Select8,
33495
34089
  Switch as Switch4,
@@ -33509,8 +34103,8 @@ import {
33509
34103
  CloudServerOutlined
33510
34104
  } from "@ant-design/icons";
33511
34105
  import { createStyles as createStyles41 } from "antd-style";
33512
- import { Fragment as Fragment30, jsx as jsx131, jsxs as jsxs94 } from "react/jsx-runtime";
33513
- var { Text: Text48, Title: Title17 } = Typography59;
34106
+ import { Fragment as Fragment30, jsx as jsx132, jsxs as jsxs95 } from "react/jsx-runtime";
34107
+ var { Text: Text49, Title: Title17 } = Typography60;
33514
34108
  var { TextArea: TextArea9 } = Input19;
33515
34109
  var useStyles24 = createStyles41(({ token, css }) => ({
33516
34110
  // settingsModal: css`
@@ -33857,12 +34451,12 @@ var SETTINGS_MENU_ITEMS = [
33857
34451
  {
33858
34452
  key: "environment",
33859
34453
  label: "Environment Variables",
33860
- icon: /* @__PURE__ */ jsx131(EnvironmentOutlined, {})
34454
+ icon: /* @__PURE__ */ jsx132(EnvironmentOutlined, {})
33861
34455
  },
33862
34456
  {
33863
34457
  key: "models",
33864
34458
  label: "Model Configuration",
33865
- icon: /* @__PURE__ */ jsx131(ApiOutlined, {})
34459
+ icon: /* @__PURE__ */ jsx132(ApiOutlined, {})
33866
34460
  }
33867
34461
  ];
33868
34462
  var SettingsModal = ({
@@ -33896,7 +34490,7 @@ var SettingsModal = ({
33896
34490
  });
33897
34491
  const [serverConfigs, setServerConfigs] = useState82({});
33898
34492
  const connectionsRef = useRef30(connections);
33899
- useEffect55(() => {
34493
+ useEffect56(() => {
33900
34494
  connectionsRef.current = connections;
33901
34495
  }, [connections]);
33902
34496
  const [activeTabKey, setActiveTabKey] = useState82(
@@ -34098,7 +34692,7 @@ var SettingsModal = ({
34098
34692
  console.error("Failed to load models configuration:", error);
34099
34693
  }
34100
34694
  };
34101
- useEffect55(() => {
34695
+ useEffect56(() => {
34102
34696
  if (open && activeTabKey) {
34103
34697
  initializeServerConfig(activeTabKey);
34104
34698
  const connection = connections.find((c) => c.id === activeTabKey);
@@ -34107,7 +34701,7 @@ var SettingsModal = ({
34107
34701
  }
34108
34702
  }
34109
34703
  }, [open, activeTabKey]);
34110
- useEffect55(() => {
34704
+ useEffect56(() => {
34111
34705
  if (open && activeTabKey) {
34112
34706
  const connection = connections.find((c) => c.id === activeTabKey);
34113
34707
  if (connection?.connected) {
@@ -34318,25 +34912,25 @@ var SettingsModal = ({
34318
34912
  }
34319
34913
  }));
34320
34914
  };
34321
- return /* @__PURE__ */ jsxs94("div", { className: styles.formContainer, children: [
34322
- /* @__PURE__ */ jsx131(
34915
+ return /* @__PURE__ */ jsxs95("div", { className: styles.formContainer, children: [
34916
+ /* @__PURE__ */ jsx132(
34323
34917
  Alert9,
34324
34918
  {
34325
34919
  message: "Configuration Effect",
34326
- description: /* @__PURE__ */ jsxs94("div", { children: [
34327
- /* @__PURE__ */ jsxs94("div", { style: { marginBottom: 8 }, children: [
34328
- /* @__PURE__ */ jsx131(
34920
+ description: /* @__PURE__ */ jsxs95("div", { children: [
34921
+ /* @__PURE__ */ jsxs95("div", { style: { marginBottom: 8 }, children: [
34922
+ /* @__PURE__ */ jsx132(
34329
34923
  CheckCircleOutlined8,
34330
34924
  {
34331
34925
  style: { color: "#52c41a", marginRight: 8 }
34332
34926
  }
34333
34927
  ),
34334
- /* @__PURE__ */ jsx131("strong", { children: "Immediately effective:" }),
34928
+ /* @__PURE__ */ jsx132("strong", { children: "Immediately effective:" }),
34335
34929
  " QUEUE_SERVICE_TYPE, REDIS_URL, REDIS_PASSWORD, QUEUE_NAME"
34336
34930
  ] }),
34337
- /* @__PURE__ */ jsxs94("div", { children: [
34338
- /* @__PURE__ */ jsx131(ReloadOutlined6, { style: { color: "#faad14", marginRight: 8 } }),
34339
- /* @__PURE__ */ jsx131("strong", { children: "Requires restart:" }),
34931
+ /* @__PURE__ */ jsxs95("div", { children: [
34932
+ /* @__PURE__ */ jsx132(ReloadOutlined6, { style: { color: "#faad14", marginRight: 8 } }),
34933
+ /* @__PURE__ */ jsx132("strong", { children: "Requires restart:" }),
34340
34934
  " PORT (server must be restarted to change port)"
34341
34935
  ] })
34342
34936
  ] }),
@@ -34345,8 +34939,8 @@ var SettingsModal = ({
34345
34939
  className: styles.alertCard
34346
34940
  }
34347
34941
  ),
34348
- /* @__PURE__ */ jsx131("div", { style: { marginBottom: 24 }, children: /* @__PURE__ */ jsx131(Text48, { type: "secondary", style: { fontSize: 14, lineHeight: 1.6 }, children: "Configure environment variables in .env format (key=value). One variable per line. Leave password fields empty to keep current values." }) }),
34349
- /* @__PURE__ */ jsx131(
34942
+ /* @__PURE__ */ jsx132("div", { style: { marginBottom: 24 }, children: /* @__PURE__ */ jsx132(Text49, { type: "secondary", style: { fontSize: 14, lineHeight: 1.6 }, children: "Configure environment variables in .env format (key=value). One variable per line. Leave password fields empty to keep current values." }) }),
34943
+ /* @__PURE__ */ jsx132(
34350
34944
  TextArea9,
34351
34945
  {
34352
34946
  value: config.envText,
@@ -34423,10 +35017,10 @@ QUEUE_NAME=tasks`,
34423
35017
  }));
34424
35018
  }
34425
35019
  };
34426
- return /* @__PURE__ */ jsxs94("div", { className: styles.formContainer, children: [
34427
- /* @__PURE__ */ jsx131("div", { style: { marginBottom: 32 }, children: /* @__PURE__ */ jsx131(Text48, { type: "secondary", style: { fontSize: 14, lineHeight: 1.6 }, children: "Configure model lattices. Each model will be registered with the provided key and can be used by agents." }) }),
34428
- config.models.map((model, index) => /* @__PURE__ */ jsxs94("div", { className: styles.card, children: [
34429
- /* @__PURE__ */ jsxs94(
35020
+ return /* @__PURE__ */ jsxs95("div", { className: styles.formContainer, children: [
35021
+ /* @__PURE__ */ jsx132("div", { style: { marginBottom: 32 }, children: /* @__PURE__ */ jsx132(Text49, { type: "secondary", style: { fontSize: 14, lineHeight: 1.6 }, children: "Configure model lattices. Each model will be registered with the provided key and can be used by agents." }) }),
35022
+ config.models.map((model, index) => /* @__PURE__ */ jsxs95("div", { className: styles.card, children: [
35023
+ /* @__PURE__ */ jsxs95(
34430
35024
  "div",
34431
35025
  {
34432
35026
  style: {
@@ -34438,13 +35032,13 @@ QUEUE_NAME=tasks`,
34438
35032
  borderBottom: "1px solid rgba(0, 0, 0, 0.06)"
34439
35033
  },
34440
35034
  children: [
34441
- /* @__PURE__ */ jsxs94("div", { children: [
34442
- /* @__PURE__ */ jsxs94(Text48, { strong: true, style: { fontSize: 16 }, children: [
35035
+ /* @__PURE__ */ jsxs95("div", { children: [
35036
+ /* @__PURE__ */ jsxs95(Text49, { strong: true, style: { fontSize: 16 }, children: [
34443
35037
  "Model ",
34444
35038
  index + 1
34445
35039
  ] }),
34446
- model.key && /* @__PURE__ */ jsxs94(
34447
- Text48,
35040
+ model.key && /* @__PURE__ */ jsxs95(
35041
+ Text49,
34448
35042
  {
34449
35043
  type: "secondary",
34450
35044
  style: { marginLeft: 8, fontSize: 12 },
@@ -34456,7 +35050,7 @@ QUEUE_NAME=tasks`,
34456
35050
  }
34457
35051
  )
34458
35052
  ] }),
34459
- config.models.length > 1 && /* @__PURE__ */ jsx131(
35053
+ config.models.length > 1 && /* @__PURE__ */ jsx132(
34460
35054
  Button59,
34461
35055
  {
34462
35056
  type: "text",
@@ -34473,10 +35067,10 @@ QUEUE_NAME=tasks`,
34473
35067
  ]
34474
35068
  }
34475
35069
  ),
34476
- /* @__PURE__ */ jsxs94(Space39, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
34477
- /* @__PURE__ */ jsxs94("div", { children: [
34478
- /* @__PURE__ */ jsx131(Text48, { className: styles.formLabel, children: "Key *" }),
34479
- /* @__PURE__ */ jsx131(
35070
+ /* @__PURE__ */ jsxs95(Space39, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
35071
+ /* @__PURE__ */ jsxs95("div", { children: [
35072
+ /* @__PURE__ */ jsx132(Text49, { className: styles.formLabel, children: "Key *" }),
35073
+ /* @__PURE__ */ jsx132(
34480
35074
  Input19,
34481
35075
  {
34482
35076
  placeholder: "e.g., default, gpt-4, claude",
@@ -34485,11 +35079,11 @@ QUEUE_NAME=tasks`,
34485
35079
  style: { height: 40 }
34486
35080
  }
34487
35081
  ),
34488
- /* @__PURE__ */ jsx131(Text48, { className: styles.formDescription, children: "Unique identifier for this model" })
35082
+ /* @__PURE__ */ jsx132(Text49, { className: styles.formDescription, children: "Unique identifier for this model" })
34489
35083
  ] }),
34490
- /* @__PURE__ */ jsxs94("div", { children: [
34491
- /* @__PURE__ */ jsx131(Text48, { className: styles.formLabel, children: "Provider *" }),
34492
- /* @__PURE__ */ jsx131(
35084
+ /* @__PURE__ */ jsxs95("div", { children: [
35085
+ /* @__PURE__ */ jsx132(Text49, { className: styles.formLabel, children: "Provider *" }),
35086
+ /* @__PURE__ */ jsx132(
34493
35087
  Select8,
34494
35088
  {
34495
35089
  style: { width: "100%", height: 40 },
@@ -34505,9 +35099,9 @@ QUEUE_NAME=tasks`,
34505
35099
  }
34506
35100
  )
34507
35101
  ] }),
34508
- /* @__PURE__ */ jsxs94("div", { children: [
34509
- /* @__PURE__ */ jsx131(Text48, { className: styles.formLabel, children: "Model Name *" }),
34510
- /* @__PURE__ */ jsx131(
35102
+ /* @__PURE__ */ jsxs95("div", { children: [
35103
+ /* @__PURE__ */ jsx132(Text49, { className: styles.formLabel, children: "Model Name *" }),
35104
+ /* @__PURE__ */ jsx132(
34511
35105
  Input19,
34512
35106
  {
34513
35107
  placeholder: "e.g., gpt-4, claude-3-opus, kimi-k2-250905",
@@ -34517,9 +35111,9 @@ QUEUE_NAME=tasks`,
34517
35111
  }
34518
35112
  )
34519
35113
  ] }),
34520
- /* @__PURE__ */ jsxs94("div", { children: [
34521
- /* @__PURE__ */ jsx131(Text48, { className: styles.formLabel, children: "API Key" }),
34522
- /* @__PURE__ */ jsx131(
35114
+ /* @__PURE__ */ jsxs95("div", { children: [
35115
+ /* @__PURE__ */ jsx132(Text49, { className: styles.formLabel, children: "API Key" }),
35116
+ /* @__PURE__ */ jsx132(
34523
35117
  Input19.Password,
34524
35118
  {
34525
35119
  placeholder: "Enter your API key",
@@ -34528,11 +35122,11 @@ QUEUE_NAME=tasks`,
34528
35122
  style: { height: 40 }
34529
35123
  }
34530
35124
  ),
34531
- /* @__PURE__ */ jsx131(Text48, { className: styles.formDescription, children: "API key for the model provider. Leave empty to use environment variable." })
35125
+ /* @__PURE__ */ jsx132(Text49, { className: styles.formDescription, children: "API key for the model provider. Leave empty to use environment variable." })
34532
35126
  ] }),
34533
- /* @__PURE__ */ jsxs94("div", { children: [
34534
- /* @__PURE__ */ jsx131(Text48, { className: styles.formLabel, children: "Base URL" }),
34535
- /* @__PURE__ */ jsx131(
35127
+ /* @__PURE__ */ jsxs95("div", { children: [
35128
+ /* @__PURE__ */ jsx132(Text49, { className: styles.formLabel, children: "Base URL" }),
35129
+ /* @__PURE__ */ jsx132(
34536
35130
  Input19,
34537
35131
  {
34538
35132
  placeholder: "e.g., https://api.openai.com/v1",
@@ -34541,22 +35135,22 @@ QUEUE_NAME=tasks`,
34541
35135
  style: { height: 40 }
34542
35136
  }
34543
35137
  ),
34544
- /* @__PURE__ */ jsx131(Text48, { className: styles.formDescription, children: "Optional custom base URL for the API" })
35138
+ /* @__PURE__ */ jsx132(Text49, { className: styles.formDescription, children: "Optional custom base URL for the API" })
34545
35139
  ] }),
34546
- /* @__PURE__ */ jsx131("div", { children: /* @__PURE__ */ jsxs94(Space39, { children: [
34547
- /* @__PURE__ */ jsx131(
35140
+ /* @__PURE__ */ jsx132("div", { children: /* @__PURE__ */ jsxs95(Space39, { children: [
35141
+ /* @__PURE__ */ jsx132(
34548
35142
  Switch4,
34549
35143
  {
34550
35144
  checked: model.streaming,
34551
35145
  onChange: (checked) => handleModelChange(index, "streaming", checked)
34552
35146
  }
34553
35147
  ),
34554
- /* @__PURE__ */ jsx131(Text48, { children: "Enable Streaming" })
35148
+ /* @__PURE__ */ jsx132(Text49, { children: "Enable Streaming" })
34555
35149
  ] }) }),
34556
- /* @__PURE__ */ jsxs94("div", { style: { display: "flex", gap: 20 }, children: [
34557
- /* @__PURE__ */ jsxs94("div", { style: { flex: 1 }, children: [
34558
- /* @__PURE__ */ jsx131(Text48, { className: styles.formLabel, children: "Max Tokens" }),
34559
- /* @__PURE__ */ jsx131(
35150
+ /* @__PURE__ */ jsxs95("div", { style: { display: "flex", gap: 20 }, children: [
35151
+ /* @__PURE__ */ jsxs95("div", { style: { flex: 1 }, children: [
35152
+ /* @__PURE__ */ jsx132(Text49, { className: styles.formLabel, children: "Max Tokens" }),
35153
+ /* @__PURE__ */ jsx132(
34560
35154
  Input19,
34561
35155
  {
34562
35156
  type: "number",
@@ -34571,9 +35165,9 @@ QUEUE_NAME=tasks`,
34571
35165
  }
34572
35166
  )
34573
35167
  ] }),
34574
- /* @__PURE__ */ jsxs94("div", { style: { flex: 1 }, children: [
34575
- /* @__PURE__ */ jsx131(Text48, { className: styles.formLabel, children: "Temperature" }),
34576
- /* @__PURE__ */ jsx131(
35168
+ /* @__PURE__ */ jsxs95("div", { style: { flex: 1 }, children: [
35169
+ /* @__PURE__ */ jsx132(Text49, { className: styles.formLabel, children: "Temperature" }),
35170
+ /* @__PURE__ */ jsx132(
34577
35171
  Input19,
34578
35172
  {
34579
35173
  type: "number",
@@ -34592,7 +35186,7 @@ QUEUE_NAME=tasks`,
34592
35186
  ] })
34593
35187
  ] })
34594
35188
  ] }, index)),
34595
- /* @__PURE__ */ jsx131(
35189
+ /* @__PURE__ */ jsx132(
34596
35190
  Button59,
34597
35191
  {
34598
35192
  type: "dashed",
@@ -34620,8 +35214,8 @@ QUEUE_NAME=tasks`,
34620
35214
  );
34621
35215
  const currentConnection = connections.find((c) => c.id === activeTabKey);
34622
35216
  const renderTabLabel = (connection) => {
34623
- return /* @__PURE__ */ jsxs94("div", { style: { display: "flex", alignItems: "center" }, children: [
34624
- /* @__PURE__ */ jsx131(
35217
+ return /* @__PURE__ */ jsxs95("div", { style: { display: "flex", alignItems: "center" }, children: [
35218
+ /* @__PURE__ */ jsx132(
34625
35219
  CloudServerOutlined,
34626
35220
  {
34627
35221
  style: {
@@ -34630,14 +35224,14 @@ QUEUE_NAME=tasks`,
34630
35224
  }
34631
35225
  }
34632
35226
  ),
34633
- /* @__PURE__ */ jsx131("span", { children: connection.name }),
34634
- connection.connected && /* @__PURE__ */ jsx131(
35227
+ /* @__PURE__ */ jsx132("span", { children: connection.name }),
35228
+ connection.connected && /* @__PURE__ */ jsx132(
34635
35229
  CheckCircleFilled,
34636
35230
  {
34637
35231
  style: { color: "#52c41a", fontSize: 12, marginLeft: 8 }
34638
35232
  }
34639
35233
  ),
34640
- connection.error && !connection.connecting && /* @__PURE__ */ jsx131(
35234
+ connection.error && !connection.connecting && /* @__PURE__ */ jsx132(
34641
35235
  CloseCircleFilled,
34642
35236
  {
34643
35237
  style: { color: "#ff4d4f", fontSize: 12, marginLeft: 8 }
@@ -34648,35 +35242,35 @@ QUEUE_NAME=tasks`,
34648
35242
  const tabItems = connections.map((connection) => ({
34649
35243
  key: connection.id,
34650
35244
  label: renderTabLabel(connection),
34651
- children: /* @__PURE__ */ jsx131("div", { className: styles.tabContent, children: connection.connected ? /* @__PURE__ */ jsx131(Fragment30, { children: /* @__PURE__ */ jsxs94("div", { style: { display: "flex", height: "100%" }, children: [
34652
- /* @__PURE__ */ jsx131("div", { className: styles.sidebar, children: SETTINGS_MENU_ITEMS.map((item) => /* @__PURE__ */ jsxs94(
35245
+ children: /* @__PURE__ */ jsx132("div", { className: styles.tabContent, children: connection.connected ? /* @__PURE__ */ jsx132(Fragment30, { children: /* @__PURE__ */ jsxs95("div", { style: { display: "flex", height: "100%" }, children: [
35246
+ /* @__PURE__ */ jsx132("div", { className: styles.sidebar, children: SETTINGS_MENU_ITEMS.map((item) => /* @__PURE__ */ jsxs95(
34653
35247
  "div",
34654
35248
  {
34655
35249
  className: `${styles.menuItem} ${activeMenu === item.key ? "active" : ""}`,
34656
35250
  onClick: () => setActiveMenu(item.key),
34657
35251
  children: [
34658
- /* @__PURE__ */ jsx131("span", { className: styles.menuItemIcon, children: item.icon }),
34659
- /* @__PURE__ */ jsx131("span", { className: styles.menuItemText, children: item.label })
35252
+ /* @__PURE__ */ jsx132("span", { className: styles.menuItemIcon, children: item.icon }),
35253
+ /* @__PURE__ */ jsx132("span", { className: styles.menuItemText, children: item.label })
34660
35254
  ]
34661
35255
  },
34662
35256
  item.key
34663
35257
  )) }),
34664
- /* @__PURE__ */ jsxs94("div", { className: styles.content, children: [
34665
- /* @__PURE__ */ jsxs94("div", { className: styles.contentHeader, children: [
34666
- /* @__PURE__ */ jsxs94("div", { className: styles.contentHeaderLeft, children: [
34667
- /* @__PURE__ */ jsx131(Title17, { level: 3, className: styles.contentTitle, children: activeMenuItem?.label }),
34668
- /* @__PURE__ */ jsxs94(Text48, { className: styles.contentDescription, children: [
35258
+ /* @__PURE__ */ jsxs95("div", { className: styles.content, children: [
35259
+ /* @__PURE__ */ jsxs95("div", { className: styles.contentHeader, children: [
35260
+ /* @__PURE__ */ jsxs95("div", { className: styles.contentHeaderLeft, children: [
35261
+ /* @__PURE__ */ jsx132(Title17, { level: 3, className: styles.contentTitle, children: activeMenuItem?.label }),
35262
+ /* @__PURE__ */ jsxs95(Text49, { className: styles.contentDescription, children: [
34669
35263
  activeMenu === "environment" && "Manage environment variables for the gateway server",
34670
35264
  activeMenu === "models" && "Configure and register model lattices for use by agents"
34671
35265
  ] })
34672
35266
  ] }),
34673
- /* @__PURE__ */ jsxs94("div", { className: styles.contentHeaderRight, children: [
34674
- /* @__PURE__ */ jsx131(Button59, { onClick: onClose, children: "Cancel" }),
34675
- /* @__PURE__ */ jsx131(
35267
+ /* @__PURE__ */ jsxs95("div", { className: styles.contentHeaderRight, children: [
35268
+ /* @__PURE__ */ jsx132(Button59, { onClick: onClose, children: "Cancel" }),
35269
+ /* @__PURE__ */ jsx132(
34676
35270
  Button59,
34677
35271
  {
34678
35272
  type: "primary",
34679
- icon: /* @__PURE__ */ jsx131(SaveOutlined2, {}),
35273
+ icon: /* @__PURE__ */ jsx132(SaveOutlined2, {}),
34680
35274
  onClick: handleSave,
34681
35275
  loading,
34682
35276
  children: "Save Configuration"
@@ -34684,9 +35278,9 @@ QUEUE_NAME=tasks`,
34684
35278
  )
34685
35279
  ] })
34686
35280
  ] }),
34687
- /* @__PURE__ */ jsx131("div", { className: styles.contentBody, children: renderContent(connection.id) })
35281
+ /* @__PURE__ */ jsx132("div", { className: styles.contentBody, children: renderContent(connection.id) })
34688
35282
  ] })
34689
- ] }) }) : /* @__PURE__ */ jsx131(
35283
+ ] }) }) : /* @__PURE__ */ jsx132(
34690
35284
  "div",
34691
35285
  {
34692
35286
  style: {
@@ -34698,29 +35292,29 @@ QUEUE_NAME=tasks`,
34698
35292
  gap: 16,
34699
35293
  padding: 48
34700
35294
  },
34701
- children: connection.connecting ? /* @__PURE__ */ jsxs94(Fragment30, { children: [
34702
- /* @__PURE__ */ jsx131(LinkOutlined2, { style: { fontSize: 64, color: "#1890ff" }, spin: true }),
34703
- /* @__PURE__ */ jsx131(Title17, { level: 4, children: "Connecting..." }),
34704
- /* @__PURE__ */ jsxs94(Text48, { type: "secondary", style: { textAlign: "center" }, children: [
35295
+ children: connection.connecting ? /* @__PURE__ */ jsxs95(Fragment30, { children: [
35296
+ /* @__PURE__ */ jsx132(LinkOutlined2, { style: { fontSize: 64, color: "#1890ff" }, spin: true }),
35297
+ /* @__PURE__ */ jsx132(Title17, { level: 4, children: "Connecting..." }),
35298
+ /* @__PURE__ */ jsxs95(Text49, { type: "secondary", style: { textAlign: "center" }, children: [
34705
35299
  "Connecting to ",
34706
35300
  connection.url
34707
35301
  ] })
34708
- ] }) : /* @__PURE__ */ jsxs94(Fragment30, { children: [
34709
- /* @__PURE__ */ jsx131(LinkOutlined2, { style: { fontSize: 64, color: "#d9d9d9" } }),
34710
- /* @__PURE__ */ jsx131(Title17, { level: 4, type: "secondary", children: connection.error || "Not Connected" }),
34711
- /* @__PURE__ */ jsx131(
34712
- Text48,
35302
+ ] }) : /* @__PURE__ */ jsxs95(Fragment30, { children: [
35303
+ /* @__PURE__ */ jsx132(LinkOutlined2, { style: { fontSize: 64, color: "#d9d9d9" } }),
35304
+ /* @__PURE__ */ jsx132(Title17, { level: 4, type: "secondary", children: connection.error || "Not Connected" }),
35305
+ /* @__PURE__ */ jsx132(
35306
+ Text49,
34713
35307
  {
34714
35308
  type: "secondary",
34715
35309
  style: { textAlign: "center", maxWidth: 400 },
34716
35310
  children: connection.error ? `Failed to connect to ${connection.url}. Please check the server URL and try again.` : `Click "Reconnect" to connect to ${connection.url}`
34717
35311
  }
34718
35312
  ),
34719
- /* @__PURE__ */ jsx131(
35313
+ /* @__PURE__ */ jsx132(
34720
35314
  Button59,
34721
35315
  {
34722
35316
  type: "primary",
34723
- icon: /* @__PURE__ */ jsx131(LinkOutlined2, {}),
35317
+ icon: /* @__PURE__ */ jsx132(LinkOutlined2, {}),
34724
35318
  onClick: () => checkConnection(connection.id),
34725
35319
  loading: connection.connecting,
34726
35320
  style: { marginTop: 16 },
@@ -34732,8 +35326,8 @@ QUEUE_NAME=tasks`,
34732
35326
  ) }),
34733
35327
  closable: connections.length > 1
34734
35328
  }));
34735
- return /* @__PURE__ */ jsxs94(Fragment30, { children: [
34736
- /* @__PURE__ */ jsx131(
35329
+ return /* @__PURE__ */ jsxs95(Fragment30, { children: [
35330
+ /* @__PURE__ */ jsx132(
34737
35331
  Modal24,
34738
35332
  {
34739
35333
  open,
@@ -34742,7 +35336,7 @@ QUEUE_NAME=tasks`,
34742
35336
  width: "80%",
34743
35337
  footer: null,
34744
35338
  title: "Settings",
34745
- children: /* @__PURE__ */ jsx131("div", { children: /* @__PURE__ */ jsx131(
35339
+ children: /* @__PURE__ */ jsx132("div", { children: /* @__PURE__ */ jsx132(
34746
35340
  Tabs4,
34747
35341
  {
34748
35342
  activeKey: activeTabKey,
@@ -34756,7 +35350,7 @@ QUEUE_NAME=tasks`,
34756
35350
  }
34757
35351
  },
34758
35352
  items: tabItems,
34759
- addIcon: /* @__PURE__ */ jsxs94(
35353
+ addIcon: /* @__PURE__ */ jsxs95(
34760
35354
  "div",
34761
35355
  {
34762
35356
  style: {
@@ -34766,8 +35360,8 @@ QUEUE_NAME=tasks`,
34766
35360
  padding: "4px 8px"
34767
35361
  },
34768
35362
  children: [
34769
- /* @__PURE__ */ jsx131(PlusOutlined9, {}),
34770
- /* @__PURE__ */ jsx131("span", { children: "Add Server" })
35363
+ /* @__PURE__ */ jsx132(PlusOutlined9, {}),
35364
+ /* @__PURE__ */ jsx132("span", { children: "Add Server" })
34771
35365
  ]
34772
35366
  }
34773
35367
  )
@@ -34775,7 +35369,7 @@ QUEUE_NAME=tasks`,
34775
35369
  ) })
34776
35370
  }
34777
35371
  ),
34778
- /* @__PURE__ */ jsx131(
35372
+ /* @__PURE__ */ jsx132(
34779
35373
  Modal24,
34780
35374
  {
34781
35375
  title: "Add New Server",
@@ -34789,10 +35383,10 @@ QUEUE_NAME=tasks`,
34789
35383
  },
34790
35384
  confirmLoading: addingServer,
34791
35385
  className: styles.addServerModal,
34792
- children: /* @__PURE__ */ jsxs94(Space39, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
34793
- /* @__PURE__ */ jsxs94("div", { children: [
34794
- /* @__PURE__ */ jsx131(Text48, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server Name" }),
34795
- /* @__PURE__ */ jsx131(
35386
+ children: /* @__PURE__ */ jsxs95(Space39, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
35387
+ /* @__PURE__ */ jsxs95("div", { children: [
35388
+ /* @__PURE__ */ jsx132(Text49, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server Name" }),
35389
+ /* @__PURE__ */ jsx132(
34796
35390
  Input19,
34797
35391
  {
34798
35392
  placeholder: "e.g., Production Server",
@@ -34801,11 +35395,11 @@ QUEUE_NAME=tasks`,
34801
35395
  onPressEnter: handleAddServer
34802
35396
  }
34803
35397
  ),
34804
- /* @__PURE__ */ jsx131(Text48, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: Leave empty to use URL as name" })
35398
+ /* @__PURE__ */ jsx132(Text49, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: Leave empty to use URL as name" })
34805
35399
  ] }),
34806
- /* @__PURE__ */ jsxs94("div", { children: [
34807
- /* @__PURE__ */ jsx131(Text48, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server URL *" }),
34808
- /* @__PURE__ */ jsx131(
35400
+ /* @__PURE__ */ jsxs95("div", { children: [
35401
+ /* @__PURE__ */ jsx132(Text49, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server URL *" }),
35402
+ /* @__PURE__ */ jsx132(
34809
35403
  Input19,
34810
35404
  {
34811
35405
  placeholder: "e.g., http://localhost:4001",
@@ -34814,11 +35408,11 @@ QUEUE_NAME=tasks`,
34814
35408
  onPressEnter: handleAddServer
34815
35409
  }
34816
35410
  ),
34817
- /* @__PURE__ */ jsx131(Text48, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Enter the full URL of the gateway server" })
35411
+ /* @__PURE__ */ jsx132(Text49, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Enter the full URL of the gateway server" })
34818
35412
  ] }),
34819
- /* @__PURE__ */ jsxs94("div", { children: [
34820
- /* @__PURE__ */ jsx131(Text48, { strong: true, style: { display: "block", marginBottom: 8 }, children: "API Key" }),
34821
- /* @__PURE__ */ jsx131(
35413
+ /* @__PURE__ */ jsxs95("div", { children: [
35414
+ /* @__PURE__ */ jsx132(Text49, { strong: true, style: { display: "block", marginBottom: 8 }, children: "API Key" }),
35415
+ /* @__PURE__ */ jsx132(
34822
35416
  Input19.Password,
34823
35417
  {
34824
35418
  placeholder: "Optional: Enter API key for authentication",
@@ -34827,7 +35421,7 @@ QUEUE_NAME=tasks`,
34827
35421
  onPressEnter: handleAddServer
34828
35422
  }
34829
35423
  ),
34830
- /* @__PURE__ */ jsx131(Text48, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: API key for server authentication" })
35424
+ /* @__PURE__ */ jsx132(Text49, { type: "secondary", style: { fontSize: 12, marginTop: 4 }, children: "Optional: API key for server authentication" })
34831
35425
  ] })
34832
35426
  ] })
34833
35427
  }
@@ -34836,10 +35430,10 @@ QUEUE_NAME=tasks`,
34836
35430
  };
34837
35431
 
34838
35432
  // src/components/Chat/AgentServerSetting.tsx
34839
- import { jsx as jsx132 } from "react/jsx-runtime";
35433
+ import { jsx as jsx133 } from "react/jsx-runtime";
34840
35434
  var AgentServerSetting = () => {
34841
35435
  const { settingsModalOpen, setSettingsModalOpen } = useLatticeChatShellContext();
34842
- return /* @__PURE__ */ jsx132(
35436
+ return /* @__PURE__ */ jsx133(
34843
35437
  SettingsModal,
34844
35438
  {
34845
35439
  open: settingsModalOpen,
@@ -34849,24 +35443,24 @@ var AgentServerSetting = () => {
34849
35443
  };
34850
35444
 
34851
35445
  // src/components/Chat/LatticeChatShell.tsx
34852
- import { Fragment as Fragment31, jsx as jsx133, jsxs as jsxs95 } from "react/jsx-runtime";
35446
+ import { Fragment as Fragment31, jsx as jsx134, jsxs as jsxs96 } from "react/jsx-runtime";
34853
35447
  var ShellContent = ({
34854
35448
  initialAssistantId,
34855
35449
  enableWorkspace
34856
35450
  }) => {
34857
35451
  const { currentTenant } = useAuth();
34858
- return /* @__PURE__ */ jsx133(Fragment31, { children: enableWorkspace ? /* @__PURE__ */ jsxs95(WorkspaceContextProvider, { children: [
34859
- /* @__PURE__ */ jsx133(AssistantContextProvider, { autoLoad: true, initialAssistantId, children: /* @__PURE__ */ jsx133(ConversationContextProvider, { children: /* @__PURE__ */ jsx133(LatticeChatView, {}) }) }),
34860
- /* @__PURE__ */ jsx133(AgentServerSetting, {})
34861
- ] }) : /* @__PURE__ */ jsxs95(Fragment31, { children: [
34862
- /* @__PURE__ */ jsx133(AssistantContextProvider, { autoLoad: true, initialAssistantId, children: /* @__PURE__ */ jsx133(ConversationContextProvider, { children: /* @__PURE__ */ jsx133(LatticeChatView, {}) }) }),
34863
- /* @__PURE__ */ jsx133(AgentServerSetting, {})
35452
+ return /* @__PURE__ */ jsx134(Fragment31, { children: enableWorkspace ? /* @__PURE__ */ jsxs96(WorkspaceContextProvider, { children: [
35453
+ /* @__PURE__ */ jsx134(AssistantContextProvider, { autoLoad: true, initialAssistantId, children: /* @__PURE__ */ jsx134(ConversationContextProvider, { children: /* @__PURE__ */ jsx134(LatticeChatView, {}) }) }),
35454
+ /* @__PURE__ */ jsx134(AgentServerSetting, {})
35455
+ ] }) : /* @__PURE__ */ jsxs96(Fragment31, { children: [
35456
+ /* @__PURE__ */ jsx134(AssistantContextProvider, { autoLoad: true, initialAssistantId, children: /* @__PURE__ */ jsx134(ConversationContextProvider, { children: /* @__PURE__ */ jsx134(LatticeChatView, {}) }) }),
35457
+ /* @__PURE__ */ jsx134(AgentServerSetting, {})
34864
35458
  ] }) });
34865
35459
  };
34866
35460
  var LatticeChatShell = (props) => {
34867
35461
  const { enableAssistantCreation, enableAssistantEditing, enableWorkspace: enableWorkspaceProp, ...restProps } = props;
34868
35462
  const enableWorkspace = enableWorkspaceProp ?? restProps.initialConfig?.enableWorkspace ?? false;
34869
- return /* @__PURE__ */ jsx133(
35463
+ return /* @__PURE__ */ jsx134(
34870
35464
  LatticeChatShellContextProvider,
34871
35465
  {
34872
35466
  initialConfig: {
@@ -34875,7 +35469,7 @@ var LatticeChatShell = (props) => {
34875
35469
  enableWorkspace,
34876
35470
  ...restProps.initialConfig
34877
35471
  },
34878
- children: /* @__PURE__ */ jsx133(
35472
+ children: /* @__PURE__ */ jsx134(
34879
35473
  ShellContent,
34880
35474
  {
34881
35475
  initialAssistantId: restProps.initialConfig?.assistantId,
@@ -34887,7 +35481,7 @@ var LatticeChatShell = (props) => {
34887
35481
  };
34888
35482
 
34889
35483
  // src/components/Chat/ChannelInstallationsDrawerContent.tsx
34890
- import { useEffect as useEffect56, useState as useState83 } from "react";
35484
+ import { useEffect as useEffect57, useState as useState83 } from "react";
34891
35485
  import {
34892
35486
  Button as Button60,
34893
35487
  Card as Card30,
@@ -34897,12 +35491,12 @@ import {
34897
35491
  Popconfirm as Popconfirm12,
34898
35492
  Spin as Spin23,
34899
35493
  Tag as Tag30,
34900
- Typography as Typography60,
35494
+ Typography as Typography61,
34901
35495
  message as message24
34902
35496
  } from "antd";
34903
35497
  import { Edit2 as Edit24, Plus as Plus9, RadioTower, Trash2 as Trash210 } from "lucide-react";
34904
- import { jsx as jsx134, jsxs as jsxs96 } from "react/jsx-runtime";
34905
- var { Text: Text49, Title: Title18 } = Typography60;
35498
+ import { jsx as jsx135, jsxs as jsxs97 } from "react/jsx-runtime";
35499
+ var { Text: Text50, Title: Title18 } = Typography61;
34906
35500
  var ChannelInstallationsDrawerContent = () => {
34907
35501
  const { get, post, put, del } = useApi();
34908
35502
  const [installations, setInstallations] = useState83([]);
@@ -34929,7 +35523,7 @@ var ChannelInstallationsDrawerContent = () => {
34929
35523
  setLoading(false);
34930
35524
  }
34931
35525
  };
34932
- useEffect56(() => {
35526
+ useEffect57(() => {
34933
35527
  loadInstallations();
34934
35528
  }, []);
34935
35529
  const handleDelete = async (installation) => {
@@ -34950,8 +35544,8 @@ var ChannelInstallationsDrawerContent = () => {
34950
35544
  message24.error("Failed to delete installation");
34951
35545
  }
34952
35546
  };
34953
- return /* @__PURE__ */ jsxs96("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
34954
- /* @__PURE__ */ jsx134("div", { style: { padding: 16 }, children: /* @__PURE__ */ jsxs96(
35547
+ return /* @__PURE__ */ jsxs97("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
35548
+ /* @__PURE__ */ jsx135("div", { style: { padding: 16 }, children: /* @__PURE__ */ jsxs97(
34955
35549
  "div",
34956
35550
  {
34957
35551
  style: {
@@ -34960,12 +35554,12 @@ var ChannelInstallationsDrawerContent = () => {
34960
35554
  alignItems: "center"
34961
35555
  },
34962
35556
  children: [
34963
- /* @__PURE__ */ jsx134(Title18, { level: 5, style: { margin: 0 }, children: "Channel Installations" }),
34964
- /* @__PURE__ */ jsx134(
35557
+ /* @__PURE__ */ jsx135(Title18, { level: 5, style: { margin: 0 }, children: "Channel Installations" }),
35558
+ /* @__PURE__ */ jsx135(
34965
35559
  Button60,
34966
35560
  {
34967
35561
  type: "primary",
34968
- icon: /* @__PURE__ */ jsx134(Plus9, { size: 16 }),
35562
+ icon: /* @__PURE__ */ jsx135(Plus9, { size: 16 }),
34969
35563
  onClick: () => {
34970
35564
  setEditingInstallation(null);
34971
35565
  setFormModalOpen(true);
@@ -34976,7 +35570,7 @@ var ChannelInstallationsDrawerContent = () => {
34976
35570
  ]
34977
35571
  }
34978
35572
  ) }),
34979
- /* @__PURE__ */ jsx134("div", { style: { flex: 1, overflowY: "auto", padding: 16 }, children: loading ? /* @__PURE__ */ jsx134("div", { style: { display: "flex", justifyContent: "center", padding: 32 }, children: /* @__PURE__ */ jsx134(Spin23, {}) }) : installations.length === 0 ? /* @__PURE__ */ jsxs96(
35573
+ /* @__PURE__ */ jsx135("div", { style: { flex: 1, overflowY: "auto", padding: 16 }, children: loading ? /* @__PURE__ */ jsx135("div", { style: { display: "flex", justifyContent: "center", padding: 32 }, children: /* @__PURE__ */ jsx135(Spin23, {}) }) : installations.length === 0 ? /* @__PURE__ */ jsxs97(
34980
35574
  "div",
34981
35575
  {
34982
35576
  style: {
@@ -34987,15 +35581,15 @@ var ChannelInstallationsDrawerContent = () => {
34987
35581
  padding: "48px 16px"
34988
35582
  },
34989
35583
  children: [
34990
- /* @__PURE__ */ jsx134(RadioTower, { size: 48, style: { marginBottom: 16, opacity: 0.5 } }),
34991
- /* @__PURE__ */ jsx134(Text49, { strong: true, style: { fontSize: 15 }, children: "No channel installations" }),
34992
- /* @__PURE__ */ jsx134(Text49, { type: "secondary", style: { marginTop: 8 }, children: 'Click "Add Installation" to create one' })
35584
+ /* @__PURE__ */ jsx135(RadioTower, { size: 48, style: { marginBottom: 16, opacity: 0.5 } }),
35585
+ /* @__PURE__ */ jsx135(Text50, { strong: true, style: { fontSize: 15 }, children: "No channel installations" }),
35586
+ /* @__PURE__ */ jsx135(Text50, { type: "secondary", style: { marginTop: 8 }, children: 'Click "Add Installation" to create one' })
34993
35587
  ]
34994
35588
  }
34995
- ) : /* @__PURE__ */ jsx134("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: installations.map((installation) => {
35589
+ ) : /* @__PURE__ */ jsx135("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: installations.map((installation) => {
34996
35590
  const webhookPath = installation.channel === "lark" ? `/api/channels/lark/installations/${installation.id}/events` : null;
34997
- return /* @__PURE__ */ jsxs96(Card30, { size: "small", children: [
34998
- /* @__PURE__ */ jsxs96(
35591
+ return /* @__PURE__ */ jsxs97(Card30, { size: "small", children: [
35592
+ /* @__PURE__ */ jsxs97(
34999
35593
  "div",
35000
35594
  {
35001
35595
  style: {
@@ -35005,12 +35599,12 @@ var ChannelInstallationsDrawerContent = () => {
35005
35599
  marginBottom: 10
35006
35600
  },
35007
35601
  children: [
35008
- /* @__PURE__ */ jsx134(Text49, { strong: true, style: { fontSize: 15 }, children: installation.name || installation.id }),
35009
- /* @__PURE__ */ jsx134(Tag30, { color: "blue", children: installation.channel })
35602
+ /* @__PURE__ */ jsx135(Text50, { strong: true, style: { fontSize: 15 }, children: installation.name || installation.id }),
35603
+ /* @__PURE__ */ jsx135(Tag30, { color: "blue", children: installation.channel })
35010
35604
  ]
35011
35605
  }
35012
35606
  ),
35013
- /* @__PURE__ */ jsxs96(
35607
+ /* @__PURE__ */ jsxs97(
35014
35608
  "div",
35015
35609
  {
35016
35610
  style: {
@@ -35020,19 +35614,19 @@ var ChannelInstallationsDrawerContent = () => {
35020
35614
  marginBottom: 12
35021
35615
  },
35022
35616
  children: [
35023
- /* @__PURE__ */ jsxs96(Text49, { type: "secondary", style: { fontSize: 12 }, children: [
35617
+ /* @__PURE__ */ jsxs97(Text50, { type: "secondary", style: { fontSize: 12 }, children: [
35024
35618
  "ID: ",
35025
35619
  installation.id
35026
35620
  ] }),
35027
- webhookPath ? /* @__PURE__ */ jsx134(Text49, { code: true, style: { fontSize: 12 }, children: webhookPath }) : /* @__PURE__ */ jsx134(Text49, { type: "secondary", style: { fontSize: 12 }, children: "Unsupported channel configuration UI" })
35621
+ webhookPath ? /* @__PURE__ */ jsx135(Text50, { code: true, style: { fontSize: 12 }, children: webhookPath }) : /* @__PURE__ */ jsx135(Text50, { type: "secondary", style: { fontSize: 12 }, children: "Unsupported channel configuration UI" })
35028
35622
  ]
35029
35623
  }
35030
35624
  ),
35031
- /* @__PURE__ */ jsxs96("div", { style: { display: "flex", gap: 8 }, children: [
35032
- /* @__PURE__ */ jsx134(
35625
+ /* @__PURE__ */ jsxs97("div", { style: { display: "flex", gap: 8 }, children: [
35626
+ /* @__PURE__ */ jsx135(
35033
35627
  Button60,
35034
35628
  {
35035
- icon: /* @__PURE__ */ jsx134(Edit24, { size: 14 }),
35629
+ icon: /* @__PURE__ */ jsx135(Edit24, { size: 14 }),
35036
35630
  onClick: () => {
35037
35631
  setEditingInstallation(installation);
35038
35632
  setFormModalOpen(true);
@@ -35040,7 +35634,7 @@ var ChannelInstallationsDrawerContent = () => {
35040
35634
  children: "Edit"
35041
35635
  }
35042
35636
  ),
35043
- /* @__PURE__ */ jsx134(
35637
+ /* @__PURE__ */ jsx135(
35044
35638
  Popconfirm12,
35045
35639
  {
35046
35640
  title: "Delete Channel Installation",
@@ -35049,13 +35643,13 @@ var ChannelInstallationsDrawerContent = () => {
35049
35643
  okText: "Delete",
35050
35644
  okType: "danger",
35051
35645
  cancelText: "Cancel",
35052
- children: /* @__PURE__ */ jsx134(Button60, { danger: true, icon: /* @__PURE__ */ jsx134(Trash210, { size: 14 }), children: "Delete" })
35646
+ children: /* @__PURE__ */ jsx135(Button60, { danger: true, icon: /* @__PURE__ */ jsx135(Trash210, { size: 14 }), children: "Delete" })
35053
35647
  }
35054
35648
  )
35055
35649
  ] })
35056
35650
  ] }, installation.id);
35057
35651
  }) }) }),
35058
- formModalOpen ? /* @__PURE__ */ jsx134(
35652
+ formModalOpen ? /* @__PURE__ */ jsx135(
35059
35653
  LarkChannelInstallationFormModal,
35060
35654
  {
35061
35655
  installation: editingInstallation,
@@ -35077,7 +35671,7 @@ var ChannelInstallationsDrawerContent = () => {
35077
35671
  };
35078
35672
  var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCancel, onSave }) => {
35079
35673
  const [form] = Form9.useForm();
35080
- useEffect56(() => {
35674
+ useEffect57(() => {
35081
35675
  if (installation) {
35082
35676
  const config = installation.config;
35083
35677
  form.setFieldsValue({
@@ -35139,7 +35733,7 @@ var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCance
35139
35733
  );
35140
35734
  }
35141
35735
  };
35142
- return /* @__PURE__ */ jsx134(
35736
+ return /* @__PURE__ */ jsx135(
35143
35737
  Modal25,
35144
35738
  {
35145
35739
  open,
@@ -35148,29 +35742,29 @@ var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCance
35148
35742
  onOk: handleSubmit,
35149
35743
  okText: installation ? "Save" : "Create",
35150
35744
  destroyOnHidden: true,
35151
- children: /* @__PURE__ */ jsxs96(Form9, { form, layout: "vertical", children: [
35152
- /* @__PURE__ */ jsx134(Form9.Item, { label: "Channel", children: /* @__PURE__ */ jsx134(Input20, { value: "lark", disabled: true }) }),
35153
- /* @__PURE__ */ jsx134(Form9.Item, { name: "name", label: "Name", children: /* @__PURE__ */ jsx134(Input20, {}) }),
35154
- /* @__PURE__ */ jsx134(
35745
+ children: /* @__PURE__ */ jsxs97(Form9, { form, layout: "vertical", children: [
35746
+ /* @__PURE__ */ jsx135(Form9.Item, { label: "Channel", children: /* @__PURE__ */ jsx135(Input20, { value: "lark", disabled: true }) }),
35747
+ /* @__PURE__ */ jsx135(Form9.Item, { name: "name", label: "Name", children: /* @__PURE__ */ jsx135(Input20, {}) }),
35748
+ /* @__PURE__ */ jsx135(
35155
35749
  Form9.Item,
35156
35750
  {
35157
35751
  name: "appId",
35158
35752
  label: "App ID",
35159
35753
  rules: [{ required: true, message: "App ID is required" }],
35160
- children: /* @__PURE__ */ jsx134(Input20, {})
35754
+ children: /* @__PURE__ */ jsx135(Input20, {})
35161
35755
  }
35162
35756
  ),
35163
- /* @__PURE__ */ jsx134(
35757
+ /* @__PURE__ */ jsx135(
35164
35758
  Form9.Item,
35165
35759
  {
35166
35760
  name: "appSecret",
35167
35761
  label: "App Secret",
35168
35762
  rules: [{ required: true, message: "App Secret is required" }],
35169
- children: /* @__PURE__ */ jsx134(Input20, {})
35763
+ children: /* @__PURE__ */ jsx135(Input20, {})
35170
35764
  }
35171
35765
  ),
35172
- /* @__PURE__ */ jsx134(Form9.Item, { name: "verificationToken", label: "Verification Token", children: /* @__PURE__ */ jsx134(Input20, {}) }),
35173
- /* @__PURE__ */ jsx134(Form9.Item, { name: "encryptKey", label: "Encrypt Key", children: /* @__PURE__ */ jsx134(Input20, {}) })
35766
+ /* @__PURE__ */ jsx135(Form9.Item, { name: "verificationToken", label: "Verification Token", children: /* @__PURE__ */ jsx135(Input20, {}) }),
35767
+ /* @__PURE__ */ jsx135(Form9.Item, { name: "encryptKey", label: "Encrypt Key", children: /* @__PURE__ */ jsx135(Input20, {}) })
35174
35768
  ] })
35175
35769
  }
35176
35770
  );