@axiom-lattice/react-sdk 2.1.87 → 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
@@ -5174,7 +5174,7 @@ var ColumnLayout = ({
5174
5174
  closeTools
5175
5175
  } = useChatUIContext();
5176
5176
  const isMobile = useMediaQuery("(max-width: 768px)");
5177
- const isMenuCollapsed = menuCollapsed ?? (isMobile || detailVisible);
5177
+ const isMenuCollapsed = detailVisible || (menuCollapsed ?? isMobile);
5178
5178
  const isAutoCollapsed = detailVisible && !isMobile;
5179
5179
  const menuStateClass = isMenuCollapsed ? "collapsed" : "expanded";
5180
5180
  const hasSidePanelsOpen = detailVisible || toolsVisible;
@@ -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%",
@@ -30719,25 +31252,26 @@ var IFRAME_STYLE = {
30719
31252
  };
30720
31253
  var AgentChatWithThread = ({ assistantId }) => {
30721
31254
  const { thread } = useConversationContext();
31255
+ const { menuCollapsed } = useChatUIContext();
30722
31256
  if (!thread) {
30723
- 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..." }) });
30724
31258
  }
30725
- return /* @__PURE__ */ jsx119(
31259
+ return /* @__PURE__ */ jsx120(
30726
31260
  LatticeChat,
30727
31261
  {
30728
31262
  thread_id: thread.id,
30729
31263
  assistant_id: assistantId,
30730
31264
  showProjectSelector: false,
30731
- menu: /* @__PURE__ */ jsx119(AgentConversations, {})
31265
+ menu: menuCollapsed ? void 0 : /* @__PURE__ */ jsx120(AgentConversations, {})
30732
31266
  }
30733
31267
  );
30734
31268
  };
30735
31269
  var CustomMenuPage = ({ component_key }) => {
30736
31270
  const parsed = parseCustomMenuId(component_key);
30737
31271
  if (!parsed) {
30738
- return /* @__PURE__ */ jsxs85("div", { style: { padding: 24 }, children: [
30739
- /* @__PURE__ */ jsx119("p", { style: { color: "#999" }, children: "Invalid menu item" }),
30740
- /* @__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: [
30741
31275
  "component_key: ",
30742
31276
  component_key || "(empty)"
30743
31277
  ] })
@@ -30745,39 +31279,39 @@ var CustomMenuPage = ({ component_key }) => {
30745
31279
  }
30746
31280
  switch (parsed.contentType) {
30747
31281
  case "agent":
30748
- return /* @__PURE__ */ jsx119(
31282
+ return /* @__PURE__ */ jsx120(
30749
31283
  WorkspaceContextProvider,
30750
31284
  {
30751
31285
  workspaceId: parsed.workspaceId || void 0,
30752
31286
  projectId: parsed.projectId || void 0,
30753
- children: /* @__PURE__ */ jsx119(
31287
+ children: /* @__PURE__ */ jsx120(
30754
31288
  AssistantContextProvider,
30755
31289
  {
30756
31290
  autoLoad: true,
30757
31291
  initialAssistantId: parsed.payload,
30758
- children: /* @__PURE__ */ jsx119(ConversationContextProvider, { children: /* @__PURE__ */ jsx119(AgentChatWithThread, { assistantId: parsed.payload }) })
31292
+ children: /* @__PURE__ */ jsx120(ConversationContextProvider, { children: /* @__PURE__ */ jsx120(AgentChatWithThread, { assistantId: parsed.payload }) })
30759
31293
  }
30760
31294
  )
30761
31295
  }
30762
31296
  );
30763
31297
  case "html": {
30764
31298
  const url = decodeURIComponent(parsed.payload);
30765
- 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" });
30766
31300
  }
30767
31301
  case "custom": {
30768
31302
  const element = getElement(parsed.payload);
30769
31303
  if (element?.side_app_view) {
30770
31304
  const Comp = element.side_app_view;
30771
- return /* @__PURE__ */ jsx119(Comp, { component_key: parsed.payload, data: void 0 });
31305
+ return /* @__PURE__ */ jsx120(Comp, { component_key: parsed.payload, data: void 0 });
30772
31306
  }
30773
- return /* @__PURE__ */ jsxs85("div", { style: { padding: 24, color: "#999" }, children: [
31307
+ return /* @__PURE__ */ jsxs86("div", { style: { padding: 24, color: "#999" }, children: [
30774
31308
  'Component "',
30775
31309
  parsed.payload,
30776
31310
  '" not found'
30777
31311
  ] });
30778
31312
  }
30779
31313
  default:
30780
- return /* @__PURE__ */ jsxs85("div", { style: { padding: 24, color: "#999" }, children: [
31314
+ return /* @__PURE__ */ jsxs86("div", { style: { padding: 24, color: "#999" }, children: [
30781
31315
  "Unknown content type: ",
30782
31316
  parsed.contentType
30783
31317
  ] });
@@ -30790,10 +31324,10 @@ import {
30790
31324
  AppstoreOutlined,
30791
31325
  MoreOutlined as MoreOutlined3
30792
31326
  } from "@ant-design/icons";
30793
- import { Dropdown as Dropdown4, Tooltip as Tooltip24 } from "antd";
31327
+ import { Dropdown as Dropdown4, Tooltip as Tooltip25 } from "antd";
30794
31328
  import { createStyles as createStyles36 } from "antd-style";
30795
- import { useEffect as useEffect51, useMemo as useMemo32, useState as useState75 } from "react";
30796
- 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";
30797
31331
  var useStyle17 = createStyles36(({ token, css }) => {
30798
31332
  return {
30799
31333
  container: css`
@@ -30970,15 +31504,15 @@ var useStyle17 = createStyles36(({ token, css }) => {
30970
31504
  });
30971
31505
  var EmptySideAppView = ({ component_key, data }) => {
30972
31506
  if (data?.component) {
30973
- return /* @__PURE__ */ jsx120(Fragment24, { children: data.component });
31507
+ return /* @__PURE__ */ jsx121(Fragment24, { children: data.component });
30974
31508
  }
30975
- return /* @__PURE__ */ jsxs86("div", { children: [
30976
- /* @__PURE__ */ jsx120("p", { children: "Component view not found" }),
30977
- /* @__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) })
30978
31512
  ] });
30979
31513
  };
30980
31514
  var getTabIcon = (componentKey) => {
30981
- return /* @__PURE__ */ jsx120(AppstoreOutlined, { style: { fontSize: 12, opacity: 0.6 } });
31515
+ return /* @__PURE__ */ jsx121(AppstoreOutlined, { style: { fontSize: 12, opacity: 0.6 } });
30982
31516
  };
30983
31517
  var SideAppViewBrowser = ({ region = "side" }) => {
30984
31518
  const { styles } = useStyle17();
@@ -31039,7 +31573,7 @@ var SideAppViewBrowser = ({ region = "side" }) => {
31039
31573
  add(
31040
31574
  key,
31041
31575
  selectedCard?.message || selectedCard?.data?.message || "Unnamed",
31042
- /* @__PURE__ */ jsx120(
31576
+ /* @__PURE__ */ jsx121(
31043
31577
  SideAppView,
31044
31578
  {
31045
31579
  component_key: selectedCard?.component_key || "",
@@ -31053,7 +31587,7 @@ var SideAppViewBrowser = ({ region = "side" }) => {
31053
31587
  const activeItem = items.find((item) => item.key === activeKey);
31054
31588
  const dropdownItems = items.map((item) => ({
31055
31589
  key: item.key,
31056
- label: /* @__PURE__ */ jsxs86(
31590
+ label: /* @__PURE__ */ jsxs87(
31057
31591
  "div",
31058
31592
  {
31059
31593
  style: {
@@ -31064,8 +31598,8 @@ var SideAppViewBrowser = ({ region = "side" }) => {
31064
31598
  },
31065
31599
  children: [
31066
31600
  getTabIcon(item.componentKey),
31067
- /* @__PURE__ */ jsx120("span", { style: { flex: 1 }, children: item.label }),
31068
- /* @__PURE__ */ jsx120(
31601
+ /* @__PURE__ */ jsx121("span", { style: { flex: 1 }, children: item.label }),
31602
+ /* @__PURE__ */ jsx121(
31069
31603
  CloseOutlined4,
31070
31604
  {
31071
31605
  style: { fontSize: 10, opacity: 0.5 },
@@ -31080,13 +31614,13 @@ var SideAppViewBrowser = ({ region = "side" }) => {
31080
31614
  ),
31081
31615
  onClick: () => switchTab(item.key)
31082
31616
  }));
31083
- const sideAppBrowserValue = useMemo32(
31617
+ const sideAppBrowserValue = useMemo33(
31084
31618
  () => ({ openApp }),
31085
31619
  [openApp]
31086
31620
  );
31087
- return /* @__PURE__ */ jsxs86("div", { className: styles.container, children: [
31088
- /* @__PURE__ */ jsxs86("div", { className: styles.header, children: [
31089
- /* @__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(
31090
31624
  "div",
31091
31625
  {
31092
31626
  "data-tab-key": item.key,
@@ -31096,8 +31630,8 @@ var SideAppViewBrowser = ({ region = "side" }) => {
31096
31630
  onMouseLeave: () => setHoveredTab(null),
31097
31631
  children: [
31098
31632
  getTabIcon(item.componentKey),
31099
- /* @__PURE__ */ jsx120("span", { className: styles.tabLabel, children: item.label }),
31100
- /* @__PURE__ */ jsx120(
31633
+ /* @__PURE__ */ jsx121("span", { className: styles.tabLabel, children: item.label }),
31634
+ /* @__PURE__ */ jsx121(
31101
31635
  "span",
31102
31636
  {
31103
31637
  className: `${styles.closeIndicator} ${hoveredTab === item.key || item.key === activeKey ? "always-visible" : ""}`,
@@ -31105,48 +31639,48 @@ var SideAppViewBrowser = ({ region = "side" }) => {
31105
31639
  e.stopPropagation();
31106
31640
  remove(item.key);
31107
31641
  },
31108
- children: /* @__PURE__ */ jsx120(CloseOutlined4, { style: { fontSize: 10 } })
31642
+ children: /* @__PURE__ */ jsx121(CloseOutlined4, { style: { fontSize: 10 } })
31109
31643
  }
31110
31644
  )
31111
31645
  ]
31112
31646
  }
31113
31647
  ) }, item.key)) }),
31114
- /* @__PURE__ */ jsxs86("div", { className: styles.actions, children: [
31115
- items.length > 0 && /* @__PURE__ */ jsx120("div", { className: styles.tabCounter, children: items.length }),
31116
- 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(
31117
31651
  Dropdown4,
31118
31652
  {
31119
31653
  menu: { items: dropdownItems },
31120
31654
  placement: "bottomRight",
31121
31655
  trigger: ["click"],
31122
- 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, {}) })
31123
31657
  }
31124
31658
  ),
31125
- /* @__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, {}) }) })
31126
31660
  ] })
31127
31661
  ] }),
31128
- /* @__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: [
31129
- /* @__PURE__ */ jsx120(AppstoreOutlined, { className: "icon" }),
31130
- /* @__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" })
31131
31665
  ] }) }) })
31132
31666
  ] });
31133
31667
  };
31134
31668
 
31135
31669
  // src/components/Chat/WorkspaceResourceManager.tsx
31136
- import { jsx as jsx121, jsxs as jsxs87 } from "react/jsx-runtime";
31670
+ import { jsx as jsx122, jsxs as jsxs88 } from "react/jsx-runtime";
31137
31671
  var DEFAULT_WORKSPACE_MENU_ITEMS = [
31138
31672
  {
31139
31673
  id: "personal_assistant",
31140
31674
  type: "route",
31141
31675
  name: "Personal Assistant",
31142
- icon: /* @__PURE__ */ jsx121(Bot5, { size: 20 }),
31676
+ icon: /* @__PURE__ */ jsx122(Bot5, { size: 20 }),
31143
31677
  order: -10
31144
31678
  },
31145
31679
  {
31146
31680
  id: "workspace_projects",
31147
31681
  type: "route",
31148
31682
  name: "Projects",
31149
- icon: /* @__PURE__ */ jsx121(FolderOpen3, { size: 20 }),
31683
+ icon: /* @__PURE__ */ jsx122(FolderOpen3, { size: 20 }),
31150
31684
  order: 0
31151
31685
  },
31152
31686
  {
@@ -31154,7 +31688,7 @@ var DEFAULT_WORKSPACE_MENU_ITEMS = [
31154
31688
  builtin: "metrics",
31155
31689
  type: "route",
31156
31690
  name: "Metrics",
31157
- icon: /* @__PURE__ */ jsx121(Activity4, { size: 20 }),
31691
+ icon: /* @__PURE__ */ jsx122(Activity4, { size: 20 }),
31158
31692
  order: 10,
31159
31693
  group: "DataSource"
31160
31694
  },
@@ -31163,7 +31697,7 @@ var DEFAULT_WORKSPACE_MENU_ITEMS = [
31163
31697
  builtin: "database",
31164
31698
  type: "route",
31165
31699
  name: "Database",
31166
- icon: /* @__PURE__ */ jsx121(Database6, { size: 20 }),
31700
+ icon: /* @__PURE__ */ jsx122(Database7, { size: 20 }),
31167
31701
  order: 20,
31168
31702
  group: "DataSource"
31169
31703
  },
@@ -31171,7 +31705,7 @@ var DEFAULT_WORKSPACE_MENU_ITEMS = [
31171
31705
  id: "topology-runtimes",
31172
31706
  type: "route",
31173
31707
  name: "Runtime",
31174
- icon: /* @__PURE__ */ jsx121(History, { size: 20 }),
31708
+ icon: /* @__PURE__ */ jsx122(History, { size: 20 }),
31175
31709
  order: 26,
31176
31710
  group: "Process"
31177
31711
  },
@@ -31179,7 +31713,7 @@ var DEFAULT_WORKSPACE_MENU_ITEMS = [
31179
31713
  id: "topology-inbox",
31180
31714
  type: "route",
31181
31715
  name: "Inbox",
31182
- icon: /* @__PURE__ */ jsx121(Inbox3, { size: 20 }),
31716
+ icon: /* @__PURE__ */ jsx122(Inbox3, { size: 20 }),
31183
31717
  order: 27,
31184
31718
  group: "Process"
31185
31719
  },
@@ -31187,7 +31721,7 @@ var DEFAULT_WORKSPACE_MENU_ITEMS = [
31187
31721
  id: "workflows",
31188
31722
  type: "route",
31189
31723
  name: "Automations",
31190
- icon: /* @__PURE__ */ jsx121(Share2, { size: 20 }),
31724
+ icon: /* @__PURE__ */ jsx122(Share2, { size: 20 }),
31191
31725
  order: 25,
31192
31726
  group: "Process"
31193
31727
  },
@@ -31195,7 +31729,7 @@ var DEFAULT_WORKSPACE_MENU_ITEMS = [
31195
31729
  id: "eval",
31196
31730
  type: "route",
31197
31731
  name: "Eval",
31198
- icon: /* @__PURE__ */ jsx121(FlaskConical3, { size: 20 }),
31732
+ icon: /* @__PURE__ */ jsx122(FlaskConical3, { size: 20 }),
31199
31733
  order: 28,
31200
31734
  group: "Process"
31201
31735
  },
@@ -31204,7 +31738,7 @@ var DEFAULT_WORKSPACE_MENU_ITEMS = [
31204
31738
  builtin: "assistants",
31205
31739
  type: "route",
31206
31740
  name: "Assistants",
31207
- icon: /* @__PURE__ */ jsx121(Bot5, { size: 20 }),
31741
+ icon: /* @__PURE__ */ jsx122(Bot5, { size: 20 }),
31208
31742
  order: 30,
31209
31743
  group: "Settings"
31210
31744
  },
@@ -31213,7 +31747,7 @@ var DEFAULT_WORKSPACE_MENU_ITEMS = [
31213
31747
  builtin: "skills",
31214
31748
  type: "route",
31215
31749
  name: "Skills",
31216
- icon: /* @__PURE__ */ jsx121(Zap2, { size: 20 }),
31750
+ icon: /* @__PURE__ */ jsx122(Zap2, { size: 20 }),
31217
31751
  order: 35,
31218
31752
  group: "Settings"
31219
31753
  },
@@ -31222,7 +31756,7 @@ var DEFAULT_WORKSPACE_MENU_ITEMS = [
31222
31756
  builtin: "mcp",
31223
31757
  type: "route",
31224
31758
  name: "MCP",
31225
- icon: /* @__PURE__ */ jsx121(Plug2, { size: 20 }),
31759
+ icon: /* @__PURE__ */ jsx122(Plug2, { size: 20 }),
31226
31760
  order: 40,
31227
31761
  group: "Settings"
31228
31762
  },
@@ -31231,7 +31765,7 @@ var DEFAULT_WORKSPACE_MENU_ITEMS = [
31231
31765
  builtin: "tools",
31232
31766
  type: "route",
31233
31767
  name: "Tools",
31234
- icon: /* @__PURE__ */ jsx121(Wrench, { size: 20 }),
31768
+ icon: /* @__PURE__ */ jsx122(Wrench2, { size: 20 }),
31235
31769
  order: 50,
31236
31770
  group: "Settings"
31237
31771
  },
@@ -31240,13 +31774,13 @@ var DEFAULT_WORKSPACE_MENU_ITEMS = [
31240
31774
  builtin: "switch-tenant",
31241
31775
  type: "action",
31242
31776
  name: "Switch tenant",
31243
- icon: /* @__PURE__ */ jsx121(Building23, { size: 20 }),
31777
+ icon: /* @__PURE__ */ jsx122(Building23, { size: 20 }),
31244
31778
  order: 900,
31245
31779
  group: "Account"
31246
31780
  }
31247
31781
  ];
31248
31782
  var createWrapper = (Component) => {
31249
- return () => /* @__PURE__ */ jsx121(Component, { ...{} });
31783
+ return () => /* @__PURE__ */ jsx122(Component, { ...{} });
31250
31784
  };
31251
31785
  var WorkspaceResourceManager = ({
31252
31786
  workspaceId,
@@ -31285,7 +31819,7 @@ var WorkspaceResourceManager = ({
31285
31819
  });
31286
31820
  regsiterElement("workspace_tools", {
31287
31821
  card_view: () => null,
31288
- side_app_view: createWrapper(() => /* @__PURE__ */ jsx121(
31822
+ side_app_view: createWrapper(() => /* @__PURE__ */ jsx122(
31289
31823
  ToolsList,
31290
31824
  {
31291
31825
  onToolSelect: (tool) => {
@@ -31319,17 +31853,14 @@ var WorkspaceResourceManager = ({
31319
31853
  const { user, logout, tenants, currentTenant, selectTenant, isLoading } = useAuth();
31320
31854
  const { setWorkspace, setProject } = useWorkspaceContext();
31321
31855
  const { config } = useLatticeChatShellContext();
31856
+ const { get } = useApi();
31322
31857
  const [tenantModalOpen, setTenantModalOpen] = useState76(false);
31323
31858
  const [changePasswordOpen, setChangePasswordOpen] = useState76(false);
31324
31859
  const [fetchedCustomMenuItems, setFetchedCustomMenuItems] = useState76([]);
31325
31860
  useEffect52(() => {
31326
31861
  const fetchCustomMenu = async () => {
31327
31862
  try {
31328
- const baseUrl = config.baseURL || "";
31329
- const headers = {};
31330
- if (currentTenant?.id) headers["x-tenant-id"] = currentTenant.id;
31331
- const response = await fetch(`${baseUrl}/api/menu-items?menuTarget=workspace`, { headers });
31332
- const json = await response.json();
31863
+ const json = await get("/api/menu-items?menuTarget=workspace");
31333
31864
  if (json.success && json.data?.records) {
31334
31865
  const items = json.data.records.map(menuItemToSideMenuItemConfig);
31335
31866
  setFetchedCustomMenuItems(items);
@@ -31338,7 +31869,7 @@ var WorkspaceResourceManager = ({
31338
31869
  }
31339
31870
  };
31340
31871
  fetchCustomMenu();
31341
- }, [config.baseURL, currentTenant?.id]);
31872
+ }, [get]);
31342
31873
  useEffect52(() => {
31343
31874
  for (const item of fetchedCustomMenuItems) {
31344
31875
  regsiterElement(item.id, {
@@ -31347,7 +31878,7 @@ var WorkspaceResourceManager = ({
31347
31878
  });
31348
31879
  }
31349
31880
  }, [fetchedCustomMenuItems]);
31350
- const menuItems = useMemo33(() => {
31881
+ const menuItems = useMemo34(() => {
31351
31882
  const workspaceMenu = config.workspaceMenuItems?.length ? config.workspaceMenuItems : void 0;
31352
31883
  if (workspaceMenu) {
31353
31884
  return [...workspaceMenu].sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
@@ -31392,12 +31923,12 @@ var WorkspaceResourceManager = ({
31392
31923
  }
31393
31924
  }
31394
31925
  }, []);
31395
- const userMenuItems = /* @__PURE__ */ jsxs87("div", { style: { minWidth: 160 }, children: [
31396
- /* @__PURE__ */ jsxs87("div", { style: { padding: "8px 12px", borderBottom: "1px solid #f0f0f0" }, children: [
31397
- /* @__PURE__ */ jsx121("div", { style: { fontWeight: 500 }, children: user?.name || user?.email }),
31398
- /* @__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 })
31399
31930
  ] }),
31400
- /* @__PURE__ */ jsxs87(
31931
+ /* @__PURE__ */ jsxs88(
31401
31932
  Button55,
31402
31933
  {
31403
31934
  type: "text",
@@ -31405,12 +31936,12 @@ var WorkspaceResourceManager = ({
31405
31936
  style: { justifyContent: "flex-start", padding: "8px 12px" },
31406
31937
  onClick: () => setChangePasswordOpen(true),
31407
31938
  children: [
31408
- /* @__PURE__ */ jsx121(Key, { size: 16, style: { marginRight: 8 } }),
31939
+ /* @__PURE__ */ jsx122(Key, { size: 16, style: { marginRight: 8 } }),
31409
31940
  "Change Password"
31410
31941
  ]
31411
31942
  }
31412
31943
  ),
31413
- /* @__PURE__ */ jsxs87(
31944
+ /* @__PURE__ */ jsxs88(
31414
31945
  Button55,
31415
31946
  {
31416
31947
  type: "text",
@@ -31419,13 +31950,13 @@ var WorkspaceResourceManager = ({
31419
31950
  style: { justifyContent: "flex-start", padding: "8px 12px" },
31420
31951
  onClick: logout,
31421
31952
  children: [
31422
- /* @__PURE__ */ jsx121(LogOut3, { size: 16, style: { marginRight: 8 } }),
31953
+ /* @__PURE__ */ jsx122(LogOut3, { size: 16, style: { marginRight: 8 } }),
31423
31954
  "Logout"
31424
31955
  ]
31425
31956
  }
31426
31957
  )
31427
31958
  ] });
31428
- return /* @__PURE__ */ jsxs87(
31959
+ return /* @__PURE__ */ jsxs88(
31429
31960
  "div",
31430
31961
  {
31431
31962
  style: {
@@ -31435,10 +31966,10 @@ var WorkspaceResourceManager = ({
31435
31966
  height: "100%"
31436
31967
  },
31437
31968
  children: [
31438
- /* @__PURE__ */ jsx121(
31969
+ /* @__PURE__ */ jsx122(
31439
31970
  ColumnLayout,
31440
31971
  {
31441
- menu: /* @__PURE__ */ jsx121(
31972
+ menu: /* @__PURE__ */ jsx122(
31442
31973
  Menu,
31443
31974
  {
31444
31975
  items: menuItems,
@@ -31449,13 +31980,13 @@ var WorkspaceResourceManager = ({
31449
31980
  defaultExpanded: config.workspaceMenuDefaultExpanded ?? true,
31450
31981
  collapsed: menuCollapsed,
31451
31982
  onCollapsedChange: setMenuCollapsed,
31452
- footer: ({ isIconMode }) => user && /* @__PURE__ */ jsx121(
31983
+ footer: ({ isIconMode }) => user && /* @__PURE__ */ jsx122(
31453
31984
  Popover3,
31454
31985
  {
31455
31986
  content: userMenuItems,
31456
31987
  placement: "rightTop",
31457
31988
  trigger: "click",
31458
- children: /* @__PURE__ */ jsxs87(
31989
+ children: /* @__PURE__ */ jsxs88(
31459
31990
  "div",
31460
31991
  {
31461
31992
  style: {
@@ -31469,7 +32000,7 @@ var WorkspaceResourceManager = ({
31469
32000
  transition: "all 0.2s"
31470
32001
  },
31471
32002
  children: [
31472
- /* @__PURE__ */ jsx121(
32003
+ /* @__PURE__ */ jsx122(
31473
32004
  Avatar12,
31474
32005
  {
31475
32006
  size: isIconMode ? 32 : 36,
@@ -31481,8 +32012,8 @@ var WorkspaceResourceManager = ({
31481
32012
  children: (user.name?.charAt(0) || user.email.charAt(0)).toUpperCase()
31482
32013
  }
31483
32014
  ),
31484
- !isIconMode && /* @__PURE__ */ jsxs87("div", { style: { flex: 1, minWidth: 0 }, children: [
31485
- /* @__PURE__ */ jsx121(
32015
+ !isIconMode && /* @__PURE__ */ jsxs88("div", { style: { flex: 1, minWidth: 0 }, children: [
32016
+ /* @__PURE__ */ jsx122(
31486
32017
  "div",
31487
32018
  {
31488
32019
  style: {
@@ -31494,7 +32025,7 @@ var WorkspaceResourceManager = ({
31494
32025
  children: user.name || user.email
31495
32026
  }
31496
32027
  ),
31497
- /* @__PURE__ */ jsx121(
32028
+ /* @__PURE__ */ jsx122(
31498
32029
  "div",
31499
32030
  {
31500
32031
  style: {
@@ -31516,10 +32047,10 @@ var WorkspaceResourceManager = ({
31516
32047
  }
31517
32048
  ),
31518
32049
  logo,
31519
- main: /* @__PURE__ */ jsx121(SideAppViewBrowser, { region: "content" })
32050
+ main: /* @__PURE__ */ jsx122(SideAppViewBrowser, { region: "content" })
31520
32051
  }
31521
32052
  ),
31522
- /* @__PURE__ */ jsx121(
32053
+ /* @__PURE__ */ jsx122(
31523
32054
  Modal20,
31524
32055
  {
31525
32056
  open: tenantModalOpen,
@@ -31536,7 +32067,7 @@ var WorkspaceResourceManager = ({
31536
32067
  boxShadow: "none"
31537
32068
  }
31538
32069
  },
31539
- children: /* @__PURE__ */ jsx121(
32070
+ children: /* @__PURE__ */ jsx122(
31540
32071
  TenantSelector,
31541
32072
  {
31542
32073
  tenants: tenants.map((t) => t.tenant).filter(Boolean),
@@ -31551,7 +32082,7 @@ var WorkspaceResourceManager = ({
31551
32082
  )
31552
32083
  }
31553
32084
  ),
31554
- /* @__PURE__ */ jsx121(
32085
+ /* @__PURE__ */ jsx122(
31555
32086
  ChangePasswordModal,
31556
32087
  {
31557
32088
  open: changePasswordOpen,
@@ -31567,11 +32098,11 @@ var WorkspaceResourceUIContext = ({
31567
32098
  workspaceName,
31568
32099
  logo
31569
32100
  }) => {
31570
- return /* @__PURE__ */ jsx121(ChatUIContextProvider, { children: /* @__PURE__ */ jsx121(WorkspaceResourceManager, { workspaceId, workspaceName, logo }) });
32101
+ return /* @__PURE__ */ jsx122(ChatUIContextProvider, { children: /* @__PURE__ */ jsx122(WorkspaceResourceManager, { workspaceId, workspaceName, logo }) });
31571
32102
  };
31572
32103
 
31573
32104
  // src/context/WorkspaceContext.tsx
31574
- import { jsx as jsx122 } from "react/jsx-runtime";
32105
+ import { jsx as jsx123 } from "react/jsx-runtime";
31575
32106
  var WorkspaceContext = createContext9(null);
31576
32107
  var useWorkspaceContext = () => {
31577
32108
  const context = useContext11(WorkspaceContext);
@@ -31600,21 +32131,21 @@ var WorkspaceContextProvider = ({
31600
32131
  };
31601
32132
  const [workspaceId, setWorkspaceId] = useState77(getInitialWorkspaceId);
31602
32133
  const [projectId, setProjectId] = useState77(getInitialProjectId);
31603
- React69.useEffect(() => {
32134
+ React70.useEffect(() => {
31604
32135
  const wsId = getInitialWorkspaceId();
31605
32136
  const pjId = getInitialProjectId();
31606
32137
  if (wsId || pjId) {
31607
- Client2.setWorkspaceContext(wsId || void 0, pjId || void 0);
32138
+ Client3.setWorkspaceContext(wsId || void 0, pjId || void 0);
31608
32139
  }
31609
32140
  }, []);
31610
32141
  useEffect53(() => {
31611
- Client2.setWorkspaceContext(workspaceId || void 0, projectId || void 0);
32142
+ Client3.setWorkspaceContext(workspaceId || void 0, projectId || void 0);
31612
32143
  }, [workspaceId, projectId]);
31613
32144
  const [workspaces, setWorkspaces] = useState77([]);
31614
32145
  const [projects, setProjects] = useState77([]);
31615
32146
  const [loading, setLoading] = useState77(false);
31616
32147
  const [error, setError] = useState77(null);
31617
- const client = React69.useMemo(() => {
32148
+ const client = React70.useMemo(() => {
31618
32149
  const authApiKey = isAuthenticated ? sessionStorage.getItem("lattice_token") || config.apiKey || "" : config.apiKey || "";
31619
32150
  return new WorkspaceClient({
31620
32151
  baseURL: config.baseURL,
@@ -31898,7 +32429,7 @@ var WorkspaceContextProvider = ({
31898
32429
  await createProject(workspaceId, { name, description });
31899
32430
  }
31900
32431
  };
31901
- return /* @__PURE__ */ jsx122(WorkspaceContext.Provider, { value, children: projectId ? children : /* @__PURE__ */ jsx122(
32432
+ return /* @__PURE__ */ jsx123(WorkspaceContext.Provider, { value, children: projectId ? children : /* @__PURE__ */ jsx123(
31902
32433
  WorkspaceResourceUIContext,
31903
32434
  {
31904
32435
  workspaceId: workspaceId || "",
@@ -31908,21 +32439,54 @@ var WorkspaceContextProvider = ({
31908
32439
  };
31909
32440
 
31910
32441
  // src/components/Chat/PinToMenuButton.tsx
31911
- 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";
31912
32443
  var MODAL_BODY_STYLE = {
31913
32444
  display: "flex",
31914
32445
  flexDirection: "column",
31915
32446
  gap: 12
31916
32447
  };
31917
32448
  var PinToMenuButton = ({ assistantId }) => {
31918
- const { currentTenant } = useAuth();
31919
- const workspaceCtx = React70.useContext(WorkspaceContext);
32449
+ const workspaceCtx = React71.useContext(WorkspaceContext);
31920
32450
  const { config } = useLatticeChatShellContext();
32451
+ const { post, get, del } = useApi();
31921
32452
  const [open, setOpen] = useState78(false);
31922
32453
  const [group, setGroup] = useState78("");
31923
32454
  const [name, setName] = useState78("");
31924
32455
  const [loading, setLoading] = useState78(false);
31925
- 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;
31926
32490
  const handlePin = async () => {
31927
32491
  if (!name.trim()) {
31928
32492
  message19.warning("Please enter a menu name");
@@ -31930,9 +32494,6 @@ var PinToMenuButton = ({ assistantId }) => {
31930
32494
  }
31931
32495
  setLoading(true);
31932
32496
  try {
31933
- const baseUrl = config.baseURL || "";
31934
- const headers = { "Content-Type": "application/json" };
31935
- if (currentTenant?.id) headers["x-tenant-id"] = currentTenant.id;
31936
32497
  const body = {
31937
32498
  menuTarget: "workspace",
31938
32499
  contentType: "agent",
@@ -31945,17 +32506,13 @@ var PinToMenuButton = ({ assistantId }) => {
31945
32506
  name: name.trim(),
31946
32507
  sortOrder: 0
31947
32508
  };
31948
- const response = await fetch(`${baseUrl}/api/menu-items`, {
31949
- method: "POST",
31950
- headers,
31951
- body: JSON.stringify(body)
31952
- });
31953
- const json = await response.json();
32509
+ const json = await post("/api/menu-items", body);
31954
32510
  if (json.success) {
31955
32511
  message19.success("Pinned to menu");
31956
32512
  setOpen(false);
31957
32513
  setGroup("");
31958
32514
  setName("");
32515
+ checkPinned();
31959
32516
  } else {
31960
32517
  message19.error(json.message || "Failed to pin");
31961
32518
  }
@@ -31965,17 +32522,43 @@ var PinToMenuButton = ({ assistantId }) => {
31965
32522
  setLoading(false);
31966
32523
  }
31967
32524
  };
31968
- return /* @__PURE__ */ jsxs88(Fragment25, { children: [
31969
- /* @__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(
31970
32552
  Button56,
31971
32553
  {
31972
32554
  type: "text",
31973
32555
  size: "small",
31974
- icon: /* @__PURE__ */ jsx123(Pin, { size: 14 }),
31975
- 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
31976
32559
  }
31977
32560
  ) }),
31978
- /* @__PURE__ */ jsx123(
32561
+ /* @__PURE__ */ jsx124(
31979
32562
  Modal21,
31980
32563
  {
31981
32564
  title: "Pin to Menu",
@@ -31984,8 +32567,8 @@ var PinToMenuButton = ({ assistantId }) => {
31984
32567
  onCancel: () => setOpen(false),
31985
32568
  confirmLoading: loading,
31986
32569
  okText: "Pin",
31987
- children: /* @__PURE__ */ jsxs88("div", { style: MODAL_BODY_STYLE, children: [
31988
- /* @__PURE__ */ jsx123(
32570
+ children: /* @__PURE__ */ jsxs89("div", { style: MODAL_BODY_STYLE, children: [
32571
+ /* @__PURE__ */ jsx124(
31989
32572
  Input17,
31990
32573
  {
31991
32574
  placeholder: "Menu name (required)",
@@ -31993,7 +32576,7 @@ var PinToMenuButton = ({ assistantId }) => {
31993
32576
  onChange: (e) => setName(e.target.value)
31994
32577
  }
31995
32578
  ),
31996
- /* @__PURE__ */ jsx123(
32579
+ /* @__PURE__ */ jsx124(
31997
32580
  Input17,
31998
32581
  {
31999
32582
  placeholder: "Group (optional, e.g. Process)",
@@ -32011,11 +32594,11 @@ var PinToMenuButton = ({ assistantId }) => {
32011
32594
  import { createStyles as createStyles39 } from "antd-style";
32012
32595
 
32013
32596
  // src/components/Chat/ProjectSelector.tsx
32014
- 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";
32015
32598
  import { Modal as Modal22, Input as Input18, Button as Button57, message as message20 } from "antd";
32016
32599
  import { createStyles as createStyles37 } from "antd-style";
32017
32600
  import { Folder, ChevronDown as ChevronDown6, Building2 as Building24 } from "lucide-react";
32018
- 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";
32019
32602
  var PROJECT_NAME_MAX_LENGTH = 50;
32020
32603
  var useStyles20 = createStyles37(({ token, css }) => ({
32021
32604
  container: css`
@@ -32255,26 +32838,26 @@ var ProjectSelector = ({
32255
32838
  const [validationError, setValidationError] = useState79(null);
32256
32839
  const [isCreating, setIsCreating] = useState79(false);
32257
32840
  const projectNameInputRef = useRef29(null);
32258
- const currentProject = useMemo34(() => {
32841
+ const currentProject = useMemo35(() => {
32259
32842
  return projects.find((p) => p.id === projectId);
32260
32843
  }, [projects, projectId]);
32261
- const currentWorkspace = useMemo34(() => {
32844
+ const currentWorkspace = useMemo35(() => {
32262
32845
  return workspaces.find((w) => w.id === workspaceId);
32263
32846
  }, [workspaces, workspaceId]);
32264
- const handleSelectProject = useCallback40((selectedProjectId) => {
32847
+ const handleSelectProject = useCallback41((selectedProjectId) => {
32265
32848
  setProject(selectedProjectId);
32266
32849
  setIsProjectListOpen(false);
32267
32850
  }, [setProject]);
32268
- const handleWorkspaceClick = useCallback40(() => {
32851
+ const handleWorkspaceClick = useCallback41(() => {
32269
32852
  setProject(null);
32270
32853
  }, [setProject]);
32271
- const toggleProjectList = useCallback40(() => {
32854
+ const toggleProjectList = useCallback41(() => {
32272
32855
  setIsProjectListOpen((prev) => !prev);
32273
32856
  }, []);
32274
- const toggleWorkspaceList = useCallback40(() => {
32857
+ const toggleWorkspaceList = useCallback41(() => {
32275
32858
  setIsWorkspaceListOpen((prev) => !prev);
32276
32859
  }, []);
32277
- const validateProjectName = useCallback40((name) => {
32860
+ const validateProjectName = useCallback41((name) => {
32278
32861
  const trimmed = name.trim();
32279
32862
  if (!trimmed) return "Project name is required";
32280
32863
  if (trimmed.length > PROJECT_NAME_MAX_LENGTH) {
@@ -32282,7 +32865,7 @@ var ProjectSelector = ({
32282
32865
  }
32283
32866
  return null;
32284
32867
  }, []);
32285
- const handleOpenModal = useCallback40((e) => {
32868
+ const handleOpenModal = useCallback41((e) => {
32286
32869
  e.stopPropagation();
32287
32870
  if (!workspaceId) {
32288
32871
  message20.warning("Please select a workspace first");
@@ -32293,7 +32876,7 @@ var ProjectSelector = ({
32293
32876
  setIsModalOpen(true);
32294
32877
  setTimeout(() => projectNameInputRef.current?.input?.focus(), 100);
32295
32878
  }, [workspaceId]);
32296
- const handleCloseModal = useCallback40(() => {
32879
+ const handleCloseModal = useCallback41(() => {
32297
32880
  setIsModalOpen(false);
32298
32881
  setProjectName("");
32299
32882
  setValidationError(null);
@@ -32303,7 +32886,7 @@ var ProjectSelector = ({
32303
32886
  setProjectName(value);
32304
32887
  setValidationError(validateProjectName(value));
32305
32888
  };
32306
- const handleCreateProject = useCallback40(async () => {
32889
+ const handleCreateProject = useCallback41(async () => {
32307
32890
  if (!workspaceId) return;
32308
32891
  const trimmed = projectName.trim();
32309
32892
  const error = validateProjectName(trimmed);
@@ -32335,48 +32918,48 @@ var ProjectSelector = ({
32335
32918
  }
32336
32919
  };
32337
32920
  const isProjectNameValid = !validateProjectName(projectName.trim());
32338
- return /* @__PURE__ */ jsxs89(Fragment26, { children: [
32339
- /* @__PURE__ */ jsx124("div", { className: styles.container, children: /* @__PURE__ */ jsxs89("div", { className: styles.selectorWrapper, children: [
32340
- /* @__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(
32341
32924
  "button",
32342
32925
  {
32343
32926
  className: styles.workspaceButton,
32344
32927
  onClick: handleWorkspaceClick,
32345
32928
  title: currentWorkspace?.name || "Select Workspace",
32346
- 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 }) })
32347
32930
  }
32348
32931
  ) }),
32349
- /* @__PURE__ */ jsx124("span", { className: styles.divider, children: "/" }),
32350
- /* @__PURE__ */ jsxs89(
32932
+ /* @__PURE__ */ jsx125("span", { className: styles.divider, children: "/" }),
32933
+ /* @__PURE__ */ jsxs90(
32351
32934
  "div",
32352
32935
  {
32353
32936
  className: styles.projectTrigger,
32354
32937
  onClick: disableDropdown ? void 0 : toggleProjectList,
32355
32938
  style: { cursor: disableDropdown ? "default" : "pointer" },
32356
32939
  children: [
32357
- /* @__PURE__ */ jsx124("div", { className: styles.projectTriggerIcon, children: /* @__PURE__ */ jsx124(Folder, { size: 16 }) }),
32358
- /* @__PURE__ */ jsx124("div", { className: styles.projectTriggerInfo, children: /* @__PURE__ */ jsx124("div", { className: styles.projectTriggerName, children: currentProject?.name || "Select Project" }) }),
32359
- !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 }) })
32360
32943
  ]
32361
32944
  }
32362
32945
  ),
32363
- !disableDropdown && isProjectListOpen && /* @__PURE__ */ jsxs89("div", { className: styles.projectDropdown, children: [
32364
- projects.map((project) => /* @__PURE__ */ jsxs89(
32946
+ !disableDropdown && isProjectListOpen && /* @__PURE__ */ jsxs90("div", { className: styles.projectDropdown, children: [
32947
+ projects.map((project) => /* @__PURE__ */ jsxs90(
32365
32948
  "div",
32366
32949
  {
32367
32950
  className: `${styles.projectDropdownItem} ${project.id === projectId ? "active" : ""}`,
32368
32951
  onClick: () => handleSelectProject(project.id),
32369
32952
  children: [
32370
- /* @__PURE__ */ jsx124("div", { className: styles.projectDropdownItemIcon, children: /* @__PURE__ */ jsx124(Folder, { size: 14 }) }),
32371
- /* @__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 })
32372
32955
  ]
32373
32956
  },
32374
32957
  project.id
32375
32958
  )),
32376
- 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" })
32377
32960
  ] })
32378
32961
  ] }) }),
32379
- /* @__PURE__ */ jsxs89(
32962
+ /* @__PURE__ */ jsxs90(
32380
32963
  Modal22,
32381
32964
  {
32382
32965
  title: "Create New Project",
@@ -32388,9 +32971,9 @@ var ProjectSelector = ({
32388
32971
  maskClosable: !isCreating,
32389
32972
  keyboard: true,
32390
32973
  closable: true,
32391
- footer: /* @__PURE__ */ jsxs89("div", { className: styles.modalFooter, children: [
32392
- /* @__PURE__ */ jsx124(Button57, { onClick: handleCloseModal, disabled: isCreating, children: "Cancel" }),
32393
- /* @__PURE__ */ jsx124(
32974
+ footer: /* @__PURE__ */ jsxs90("div", { className: styles.modalFooter, children: [
32975
+ /* @__PURE__ */ jsx125(Button57, { onClick: handleCloseModal, disabled: isCreating, children: "Cancel" }),
32976
+ /* @__PURE__ */ jsx125(
32394
32977
  Button57,
32395
32978
  {
32396
32979
  type: "primary",
@@ -32402,7 +32985,7 @@ var ProjectSelector = ({
32402
32985
  )
32403
32986
  ] }),
32404
32987
  children: [
32405
- /* @__PURE__ */ jsx124(
32988
+ /* @__PURE__ */ jsx125(
32406
32989
  Input18,
32407
32990
  {
32408
32991
  ref: projectNameInputRef,
@@ -32414,7 +32997,7 @@ var ProjectSelector = ({
32414
32997
  status: validationError ? "error" : void 0
32415
32998
  }
32416
32999
  ),
32417
- 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 })
32418
33001
  ]
32419
33002
  }
32420
33003
  )
@@ -32422,15 +33005,15 @@ var ProjectSelector = ({
32422
33005
  };
32423
33006
 
32424
33007
  // src/components/Chat/ToolPanelFiles.tsx
32425
- 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";
32426
33009
  import { message as message21 } from "antd";
32427
33010
 
32428
33011
  // src/components/Chat/FileDirectoryPanel.tsx
32429
- import React72 from "react";
33012
+ import React73 from "react";
32430
33013
  import { Spin as Spin22 } from "antd";
32431
33014
  import { ChevronRight as ChevronRight8, FolderOpen as FolderOpen4, Upload } from "lucide-react";
32432
33015
  import { createStyles as createStyles38 } from "antd-style";
32433
- 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";
32434
33017
  var useStyles21 = createStyles38(({ token, css }) => ({
32435
33018
  container: css`
32436
33019
  height: 100%;
@@ -32658,26 +33241,26 @@ var FileDirectoryPanel = ({
32658
33241
  onAssetClick
32659
33242
  }) => {
32660
33243
  const { styles } = useStyles21();
32661
- const renderEntry = React72.useCallback((entry, depth) => {
33244
+ const renderEntry = React73.useCallback((entry, depth) => {
32662
33245
  const entryName = getEntryName(entry);
32663
33246
  if (entry.is_dir) {
32664
33247
  const isExpanded = directoryExpanded[entry.path] || false;
32665
33248
  const children = directoryChildren[entry.path] || [];
32666
33249
  const isLoading = directoryLoading[entry.path] || false;
32667
- return /* @__PURE__ */ jsxs90("div", { className: styles.treeChildren, children: [
32668
- /* @__PURE__ */ jsxs90("div", { className: styles.treeRow, children: [
32669
- Array.from({ length: depth }).map((_, index) => /* @__PURE__ */ jsx125("span", { className: styles.treeIndent }, `${entry.path}-indent-${index}`)),
32670
- /* @__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(
32671
33254
  "button",
32672
33255
  {
32673
33256
  type: "button",
32674
33257
  className: styles.treeToggle,
32675
33258
  "aria-label": `${isExpanded ? "collapse" : "expand"} ${entryName}`,
32676
33259
  onClick: () => void onToggleDirectory(entry.path),
32677
- 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 } })
32678
33261
  }
32679
33262
  ),
32680
- /* @__PURE__ */ jsxs90(
33263
+ /* @__PURE__ */ jsxs91(
32681
33264
  "button",
32682
33265
  {
32683
33266
  type: "button",
@@ -32686,19 +33269,19 @@ var FileDirectoryPanel = ({
32686
33269
  onClick: () => void onToggleDirectory(entry.path),
32687
33270
  title: entryName,
32688
33271
  children: [
32689
- /* @__PURE__ */ jsx125("div", { className: styles.assetIcon, children: /* @__PURE__ */ jsx125(FolderOpen4, { size: 14 }) }),
32690
- /* @__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 }) })
32691
33274
  ]
32692
33275
  }
32693
33276
  )
32694
33277
  ] }),
32695
- 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
32696
33279
  ] }, entry.path);
32697
33280
  }
32698
- return /* @__PURE__ */ jsxs90("div", { className: styles.treeRow, children: [
32699
- Array.from({ length: depth }).map((_, index) => /* @__PURE__ */ jsx125("span", { className: styles.treeIndent }, `${entry.path}-indent-${index}`)),
32700
- /* @__PURE__ */ jsx125("span", { className: styles.treeSpacer }),
32701
- /* @__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(
32702
33285
  "button",
32703
33286
  {
32704
33287
  type: "button",
@@ -32707,10 +33290,10 @@ var FileDirectoryPanel = ({
32707
33290
  "aria-label": `open ${entryName}`,
32708
33291
  title: entryName,
32709
33292
  children: [
32710
- /* @__PURE__ */ jsx125("div", { className: styles.assetIcon, children: getFileIcon(entryName) }),
32711
- /* @__PURE__ */ jsxs90("div", { className: styles.assetInfo, children: [
32712
- /* @__PURE__ */ jsx125("div", { className: styles.assetName, children: entryName }),
32713
- /* @__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) })
32714
33297
  ] })
32715
33298
  ]
32716
33299
  }
@@ -32718,20 +33301,20 @@ var FileDirectoryPanel = ({
32718
33301
  ] }, entry.path);
32719
33302
  }, [directoryChildren, directoryExpanded, directoryLoading, onAssetClick, onToggleDirectory, styles]);
32720
33303
  if (!projectId) {
32721
- 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" });
32722
33305
  }
32723
- return /* @__PURE__ */ jsxs90("div", { className: styles.container, children: [
32724
- /* @__PURE__ */ jsxs90("h3", { className: styles.header, children: [
32725
- /* @__PURE__ */ jsx125(FolderOpen4, { size: 16 }),
32726
- /* @__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" })
32727
33310
  ] }),
32728
33311
  resourceFolders.map((folder) => {
32729
33312
  const entries = folderEntries[folder.name] || [];
32730
33313
  const isLoading = folderLoading[folder.name] || false;
32731
33314
  const itemCount = entries.length;
32732
- return /* @__PURE__ */ jsxs90("div", { className: styles.section, children: [
32733
- /* @__PURE__ */ jsxs90("div", { className: styles.sectionHeader, children: [
32734
- /* @__PURE__ */ jsx125(
33315
+ return /* @__PURE__ */ jsxs91("div", { className: styles.section, children: [
33316
+ /* @__PURE__ */ jsxs91("div", { className: styles.sectionHeader, children: [
33317
+ /* @__PURE__ */ jsx126(
32735
33318
  "span",
32736
33319
  {
32737
33320
  className: styles.sectionTitle,
@@ -32740,24 +33323,24 @@ var FileDirectoryPanel = ({
32740
33323
  children: folder.displayName || folder.name
32741
33324
  }
32742
33325
  ),
32743
- /* @__PURE__ */ jsx125("span", { className: styles.badge, children: itemCount })
33326
+ /* @__PURE__ */ jsx126("span", { className: styles.badge, children: itemCount })
32744
33327
  ] }),
32745
- 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: [
32746
33329
  entries.map((entry) => renderEntry(entry, 0)),
32747
- entries.length === 0 ? /* @__PURE__ */ jsx125("div", { className: styles.emptyState, children: "No files in this folder" }) : null,
32748
- 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(
32749
33332
  "button",
32750
33333
  {
32751
33334
  type: "button",
32752
33335
  className: styles.uploadBtn,
32753
33336
  onClick: () => void onUploadFolder(folder.name),
32754
33337
  disabled: !workspaceId || !projectId || uploadingFolder === folder.name,
32755
- children: uploadingFolder === folder.name ? /* @__PURE__ */ jsxs90(Fragment27, { children: [
32756
- /* @__PURE__ */ jsx125(Spin22, { size: "small" }),
32757
- /* @__PURE__ */ jsx125("span", { children: "Uploading..." })
32758
- ] }) : /* @__PURE__ */ jsxs90(Fragment27, { children: [
32759
- /* @__PURE__ */ jsx125(Upload, { size: 14 }),
32760
- /* @__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" })
32761
33344
  ] })
32762
33345
  }
32763
33346
  ) : null
@@ -32768,7 +33351,7 @@ var FileDirectoryPanel = ({
32768
33351
  };
32769
33352
 
32770
33353
  // src/components/Chat/ToolPanelFiles.tsx
32771
- import { jsx as jsx126 } from "react/jsx-runtime";
33354
+ import { jsx as jsx127 } from "react/jsx-runtime";
32772
33355
  var ToolPanelFiles = () => {
32773
33356
  const { config } = useLatticeChatShellContext();
32774
33357
  const { openSideApp } = useChatUIContext();
@@ -32787,10 +33370,10 @@ var ToolPanelFiles = () => {
32787
33370
  const [directoryLoading, setDirectoryLoading] = useState80({});
32788
33371
  const [directoryExpanded, setDirectoryExpanded] = useState80({});
32789
33372
  const [uploadingFolder, setUploadingFolder] = useState80(null);
32790
- const resourceFolders = useMemo35(() => {
33373
+ const resourceFolders = useMemo36(() => {
32791
33374
  return config.resourceFolders && config.resourceFolders.length > 0 ? config.resourceFolders : [{ name: "/", displayName: "Project Assets", allowUpload: true }];
32792
33375
  }, [config.resourceFolders]);
32793
- const loadAssetsForFolder = useCallback41(
33376
+ const loadAssetsForFolder = useCallback42(
32794
33377
  async (folder, clearSubdirectoryCache = true) => {
32795
33378
  if (!workspaceId || !projectId) {
32796
33379
  setFolderEntries((prev) => ({ ...prev, [folder.name]: [] }));
@@ -32830,7 +33413,7 @@ var ToolPanelFiles = () => {
32830
33413
  },
32831
33414
  [workspaceId, projectId, listPathByFolder, currentAssistant?.id]
32832
33415
  );
32833
- const handleToggleDirectory = useCallback41(async (path) => {
33416
+ const handleToggleDirectory = useCallback42(async (path) => {
32834
33417
  const isExpanded = directoryExpanded[path] || false;
32835
33418
  if (isExpanded) {
32836
33419
  setDirectoryExpanded((prev) => ({ ...prev, [path]: false }));
@@ -32848,12 +33431,12 @@ var ToolPanelFiles = () => {
32848
33431
  setDirectoryLoading((prev) => ({ ...prev, [path]: false }));
32849
33432
  }
32850
33433
  }, [directoryExpanded, listPath, currentAssistant?.id]);
32851
- useEffect54(() => {
33434
+ useEffect55(() => {
32852
33435
  resourceFolders.forEach((folder) => {
32853
33436
  void loadAssetsForFolder(folder, false);
32854
33437
  });
32855
33438
  }, [resourceFolders, loadAssetsForFolder]);
32856
- const handleAssetClick = useCallback41((asset) => {
33439
+ const handleAssetClick = useCallback42((asset) => {
32857
33440
  const fileUrl = getFileViewUrl(asset.path, currentAssistant?.id);
32858
33441
  if (!fileUrl) {
32859
33442
  message21.warning("Please select a workspace and project first.");
@@ -32869,7 +33452,7 @@ var ToolPanelFiles = () => {
32869
33452
  message: `Preview: ${asset.name || asset.path}`
32870
33453
  });
32871
33454
  }, [getFileViewUrl, openSideApp, currentAssistant?.id]);
32872
- const handleUploadFolder = useCallback41(async (folderName) => {
33455
+ const handleUploadFolder = useCallback42(async (folderName) => {
32873
33456
  if (!workspaceId || !projectId) {
32874
33457
  message21.warning("Please select a workspace and project before uploading.");
32875
33458
  return;
@@ -32900,7 +33483,7 @@ var ToolPanelFiles = () => {
32900
33483
  };
32901
33484
  input.click();
32902
33485
  }, [workspaceId, projectId, uploadFileToFolder, resourceFolders, loadAssetsForFolder, currentAssistant?.id]);
32903
- return /* @__PURE__ */ jsx126(
33486
+ return /* @__PURE__ */ jsx127(
32904
33487
  FileDirectoryPanel,
32905
33488
  {
32906
33489
  workspaceId,
@@ -32921,7 +33504,7 @@ var ToolPanelFiles = () => {
32921
33504
  };
32922
33505
 
32923
33506
  // src/components/Chat/LatticeChat.tsx
32924
- 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";
32925
33508
  var useStyles22 = createStyles39(({ css }) => ({
32926
33509
  wrapper: css`
32927
33510
  display: flex;
@@ -32954,29 +33537,29 @@ var LatticeChatContent = (props) => {
32954
33537
  const { config } = useLatticeChatShellContext();
32955
33538
  const { styles } = useStyles22();
32956
33539
  const showWorkspaceSelector = showProjectSelector ?? config.enableWorkspace;
32957
- const layoutHeader = /* @__PURE__ */ jsxs91("div", { className: styles.headerBar, children: [
32958
- /* @__PURE__ */ jsx127("div", { className: styles.headerLeft, children: showWorkspaceSelector ? /* @__PURE__ */ jsx127(ProjectSelector, {}) : null }),
32959
- /* @__PURE__ */ jsx127("div", { className: styles.headerRight, children: headerRight !== void 0 ? headerRight : /* @__PURE__ */ jsxs91(Fragment28, { children: [
32960
- /* @__PURE__ */ jsx127(PinToMenuButton, { assistantId }),
32961
- /* @__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, {})
32962
33545
  ] }) })
32963
33546
  ] });
32964
- return /* @__PURE__ */ jsxs91("div", { className: styles.wrapper, children: [
33547
+ return /* @__PURE__ */ jsxs92("div", { className: styles.wrapper, children: [
32965
33548
  header,
32966
- /* @__PURE__ */ jsx127(
33549
+ /* @__PURE__ */ jsx128(
32967
33550
  ColumnLayout,
32968
33551
  {
32969
33552
  menu,
32970
33553
  header: layoutHeader,
32971
- main: thread_id ? /* @__PURE__ */ jsx127(Chating, { ...chatingProps }) : emptyPlaceholder ?? /* @__PURE__ */ jsx127("div", { children: "Please create a conversation first" }),
32972
- detail: /* @__PURE__ */ jsx127(SideAppViewBrowser, {}),
32973
- 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, {})
32974
33557
  }
32975
33558
  )
32976
33559
  ] });
32977
33560
  };
32978
33561
  var LatticeChat = (props) => {
32979
- return /* @__PURE__ */ jsx127(
33562
+ return /* @__PURE__ */ jsx128(
32980
33563
  AgentThreadProvider,
32981
33564
  {
32982
33565
  assistantId: props.assistant_id,
@@ -32986,7 +33569,7 @@ var LatticeChat = (props) => {
32986
33569
  enableReturnStateWhenStreamCompleted: true,
32987
33570
  enableResumeStream: true
32988
33571
  },
32989
- children: /* @__PURE__ */ jsx127(ChatUIContextProvider, { children: /* @__PURE__ */ jsx127(LatticeChatContent, { ...props }) })
33572
+ children: /* @__PURE__ */ jsx128(ChatUIContextProvider, { children: /* @__PURE__ */ jsx128(LatticeChatContent, { ...props }) })
32990
33573
  }
32991
33574
  );
32992
33575
  };
@@ -32995,7 +33578,7 @@ var LatticeChat = (props) => {
32995
33578
  import { useContext as useContext12 } from "react";
32996
33579
 
32997
33580
  // src/components/Chat/ChatSidebar.tsx
32998
- 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";
32999
33582
  import { Drawer as Drawer3, Avatar as Avatar13, Popover as Popover4, Button as Button58 } from "antd";
33000
33583
  import {
33001
33584
  History as History2,
@@ -33006,11 +33589,11 @@ import {
33006
33589
  } from "lucide-react";
33007
33590
 
33008
33591
  // src/components/Chat/ThreadHistoryMenuContent.tsx
33009
- import React74, { useCallback as useCallback42 } from "react";
33592
+ import React75, { useCallback as useCallback43 } from "react";
33010
33593
  import { createStyles as createStyles40 } from "antd-style";
33011
- import { MessageSquare as MessageSquare3, Trash2 as Trash29 } from "lucide-react";
33594
+ import { MessageSquare as MessageSquare4, Trash2 as Trash29 } from "lucide-react";
33012
33595
  import { message as message22, Modal as Modal23 } from "antd";
33013
- import { jsx as jsx128, jsxs as jsxs92 } from "react/jsx-runtime";
33596
+ import { jsx as jsx129, jsxs as jsxs93 } from "react/jsx-runtime";
33014
33597
  var useStyles23 = createStyles40(({ token, css }) => ({
33015
33598
  container: css`
33016
33599
  padding: 4px;
@@ -33120,7 +33703,7 @@ var ThreadHistoryMenuContent = () => {
33120
33703
  deleteThread,
33121
33704
  isLoading
33122
33705
  } = useConversationContext();
33123
- const handleDeleteThread = useCallback42(
33706
+ const handleDeleteThread = useCallback43(
33124
33707
  async (e, threadIdToDelete) => {
33125
33708
  e.stopPropagation();
33126
33709
  Modal23.confirm({
@@ -33141,7 +33724,7 @@ var ThreadHistoryMenuContent = () => {
33141
33724
  },
33142
33725
  [deleteThread]
33143
33726
  );
33144
- const sortedThreads = React74.useMemo(() => {
33727
+ const sortedThreads = React75.useMemo(() => {
33145
33728
  return [...threads].sort((a, b) => {
33146
33729
  const dateA = a.updatedAt ? new Date(a.updatedAt).getTime() : 0;
33147
33730
  const dateB = b.updatedAt ? new Date(b.updatedAt).getTime() : 0;
@@ -33149,30 +33732,30 @@ var ThreadHistoryMenuContent = () => {
33149
33732
  });
33150
33733
  }, [threads]);
33151
33734
  if (isLoading) {
33152
- 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..." }) });
33153
33736
  }
33154
- 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(
33155
33738
  "div",
33156
33739
  {
33157
33740
  className: `${styles.threadItem} ${thread.id === threadId ? "active" : ""}`,
33158
33741
  onClick: () => selectThread(thread.id),
33159
33742
  title: thread.label,
33160
33743
  children: [
33161
- /* @__PURE__ */ jsx128("div", { className: styles.threadIcon, children: /* @__PURE__ */ jsx128(MessageSquare3, { size: 14 }) }),
33162
- /* @__PURE__ */ jsx128(
33744
+ /* @__PURE__ */ jsx129("div", { className: styles.threadIcon, children: /* @__PURE__ */ jsx129(MessageSquare4, { size: 14 }) }),
33745
+ /* @__PURE__ */ jsx129(
33163
33746
  "div",
33164
33747
  {
33165
33748
  className: thread.id === threadId ? styles.threadNameActive : styles.threadName,
33166
33749
  children: thread.label
33167
33750
  }
33168
33751
  ),
33169
- /* @__PURE__ */ jsx128(
33752
+ /* @__PURE__ */ jsx129(
33170
33753
  "button",
33171
33754
  {
33172
33755
  className: styles.deleteBtn,
33173
33756
  onClick: (e) => handleDeleteThread(e, thread.id),
33174
33757
  title: "Delete conversation",
33175
- children: /* @__PURE__ */ jsx128(Trash29, { size: 12 })
33758
+ children: /* @__PURE__ */ jsx129(Trash29, { size: 12 })
33176
33759
  }
33177
33760
  )
33178
33761
  ]
@@ -33182,7 +33765,7 @@ var ThreadHistoryMenuContent = () => {
33182
33765
  };
33183
33766
 
33184
33767
  // src/components/Chat/ChatSidebar.tsx
33185
- 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";
33186
33769
  var DRAWER_STYLES2 = {
33187
33770
  wrapper: {
33188
33771
  background: "transparent",
@@ -33207,7 +33790,7 @@ var DEFAULT_MENU_ITEMS = [
33207
33790
  builtin: "new-analysis",
33208
33791
  type: "action",
33209
33792
  name: "New Analysis",
33210
- icon: /* @__PURE__ */ jsx129(PlusCircle, { size: 20 }),
33793
+ icon: /* @__PURE__ */ jsx130(PlusCircle, { size: 20 }),
33211
33794
  order: 0
33212
33795
  },
33213
33796
  {
@@ -33215,13 +33798,13 @@ var DEFAULT_MENU_ITEMS = [
33215
33798
  builtin: "thread-history",
33216
33799
  type: "drawer",
33217
33800
  name: "History",
33218
- icon: /* @__PURE__ */ jsx129(History2, { size: 20 }),
33801
+ icon: /* @__PURE__ */ jsx130(History2, { size: 20 }),
33219
33802
  order: 1,
33220
33803
  title: "Conversation History",
33221
33804
  width: 320,
33222
33805
  inline: true,
33223
33806
  inlineDefaultExpanded: true,
33224
- content: /* @__PURE__ */ jsx129(ThreadHistoryMenuContent, {})
33807
+ content: /* @__PURE__ */ jsx130(ThreadHistoryMenuContent, {})
33225
33808
  }
33226
33809
  ];
33227
33810
  var ChatSidebar = ({
@@ -33243,11 +33826,11 @@ var ChatSidebar = ({
33243
33826
  sidebarLogoIcon
33244
33827
  } = config;
33245
33828
  const isExpandedMode = sidebarMode === "expanded";
33246
- const menuItems = useMemo36(() => {
33829
+ const menuItems = useMemo37(() => {
33247
33830
  const items = customMenuItems.length > 0 ? [...customMenuItems] : [...DEFAULT_MENU_ITEMS];
33248
33831
  return items.sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
33249
33832
  }, [customMenuItems]);
33250
- const handleMenuClick = useCallback43(async (item) => {
33833
+ const handleMenuClick = useCallback44(async (item) => {
33251
33834
  if (item.builtin === "settings") {
33252
33835
  setSettingsModalOpen(true);
33253
33836
  onSettingsClick?.();
@@ -33270,30 +33853,30 @@ var ChatSidebar = ({
33270
33853
  }
33271
33854
  }
33272
33855
  }, [onSettingsClick, setSettingsModalOpen, createThread, logout]);
33273
- const handleCloseDrawer = useCallback43((itemId) => {
33856
+ const handleCloseDrawer = useCallback44((itemId) => {
33274
33857
  setDrawerStates((prev) => ({ ...prev, [itemId]: false }));
33275
33858
  }, []);
33276
- const handleNewAnalysis = useCallback43(async () => {
33859
+ const handleNewAnalysis = useCallback44(async () => {
33277
33860
  try {
33278
33861
  await createThread("New Analysis");
33279
33862
  } catch (error) {
33280
33863
  console.error("Failed to create new thread:", error);
33281
33864
  }
33282
33865
  }, [createThread]);
33283
- const renderDrawerContent = useCallback43((item) => {
33866
+ const renderDrawerContent = useCallback44((item) => {
33284
33867
  switch (item.builtin) {
33285
33868
  case "thread-history":
33286
- return /* @__PURE__ */ jsx129(ThreadHistoryMenuContent, {});
33869
+ return /* @__PURE__ */ jsx130(ThreadHistoryMenuContent, {});
33287
33870
  default:
33288
33871
  return item.content;
33289
33872
  }
33290
33873
  }, []);
33291
- const userMenuItems = /* @__PURE__ */ jsxs93("div", { style: { minWidth: 160 }, children: [
33292
- /* @__PURE__ */ jsxs93("div", { style: { padding: "8px 12px", borderBottom: "1px solid #f0f0f0" }, children: [
33293
- /* @__PURE__ */ jsx129("div", { style: { fontWeight: 500 }, children: user?.name || user?.email }),
33294
- /* @__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 })
33295
33878
  ] }),
33296
- /* @__PURE__ */ jsxs93(
33879
+ /* @__PURE__ */ jsxs94(
33297
33880
  Button58,
33298
33881
  {
33299
33882
  type: "text",
@@ -33301,12 +33884,12 @@ var ChatSidebar = ({
33301
33884
  style: { justifyContent: "flex-start", padding: "8px 12px" },
33302
33885
  onClick: () => setChangePasswordOpen(true),
33303
33886
  children: [
33304
- /* @__PURE__ */ jsx129(Key2, { size: 16, style: { marginRight: 8 } }),
33887
+ /* @__PURE__ */ jsx130(Key2, { size: 16, style: { marginRight: 8 } }),
33305
33888
  "Change Password"
33306
33889
  ]
33307
33890
  }
33308
33891
  ),
33309
- /* @__PURE__ */ jsxs93(
33892
+ /* @__PURE__ */ jsxs94(
33310
33893
  Button58,
33311
33894
  {
33312
33895
  type: "text",
@@ -33315,14 +33898,14 @@ var ChatSidebar = ({
33315
33898
  style: { justifyContent: "flex-start", padding: "8px 12px" },
33316
33899
  onClick: logout,
33317
33900
  children: [
33318
- /* @__PURE__ */ jsx129(LogOut4, { size: 16, style: { marginRight: 8 } }),
33901
+ /* @__PURE__ */ jsx130(LogOut4, { size: 16, style: { marginRight: 8 } }),
33319
33902
  "Logout"
33320
33903
  ]
33321
33904
  }
33322
33905
  )
33323
33906
  ] });
33324
- return /* @__PURE__ */ jsxs93(Fragment29, { children: [
33325
- /* @__PURE__ */ jsx129(
33907
+ return /* @__PURE__ */ jsxs94(Fragment29, { children: [
33908
+ /* @__PURE__ */ jsx130(
33326
33909
  Menu,
33327
33910
  {
33328
33911
  items: menuItems,
@@ -33336,13 +33919,13 @@ var ChatSidebar = ({
33336
33919
  forceIconMode: sideAppVisible,
33337
33920
  collapsed: menuCollapsed,
33338
33921
  onCollapsedChange: setMenuCollapsed,
33339
- footer: ({ isIconMode }) => user && /* @__PURE__ */ jsx129(
33922
+ footer: ({ isIconMode }) => user && /* @__PURE__ */ jsx130(
33340
33923
  Popover4,
33341
33924
  {
33342
33925
  content: userMenuItems,
33343
33926
  placement: "rightTop",
33344
33927
  trigger: "click",
33345
- children: /* @__PURE__ */ jsxs93(
33928
+ children: /* @__PURE__ */ jsxs94(
33346
33929
  "div",
33347
33930
  {
33348
33931
  style: {
@@ -33356,7 +33939,7 @@ var ChatSidebar = ({
33356
33939
  transition: "all 0.2s"
33357
33940
  },
33358
33941
  children: [
33359
- /* @__PURE__ */ jsx129(
33942
+ /* @__PURE__ */ jsx130(
33360
33943
  Avatar13,
33361
33944
  {
33362
33945
  size: isIconMode ? 32 : 36,
@@ -33368,8 +33951,8 @@ var ChatSidebar = ({
33368
33951
  children: (user.name?.charAt(0) || user.email.charAt(0)).toUpperCase()
33369
33952
  }
33370
33953
  ),
33371
- !isIconMode && /* @__PURE__ */ jsxs93("div", { style: { flex: 1, minWidth: 0 }, children: [
33372
- /* @__PURE__ */ jsx129(
33954
+ !isIconMode && /* @__PURE__ */ jsxs94("div", { style: { flex: 1, minWidth: 0 }, children: [
33955
+ /* @__PURE__ */ jsx130(
33373
33956
  "div",
33374
33957
  {
33375
33958
  style: {
@@ -33381,7 +33964,7 @@ var ChatSidebar = ({
33381
33964
  children: user.name || user.email
33382
33965
  }
33383
33966
  ),
33384
- /* @__PURE__ */ jsx129(
33967
+ /* @__PURE__ */ jsx130(
33385
33968
  "div",
33386
33969
  {
33387
33970
  style: {
@@ -33402,19 +33985,19 @@ var ChatSidebar = ({
33402
33985
  )
33403
33986
  }
33404
33987
  ),
33405
- /* @__PURE__ */ jsx129(
33988
+ /* @__PURE__ */ jsx130(
33406
33989
  ChangePasswordModal,
33407
33990
  {
33408
33991
  open: changePasswordOpen,
33409
33992
  onClose: () => setChangePasswordOpen(false)
33410
33993
  }
33411
33994
  ),
33412
- 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(
33413
33996
  Drawer3,
33414
33997
  {
33415
- title: /* @__PURE__ */ jsxs93("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }, children: [
33416
- /* @__PURE__ */ jsx129("span", { style: { fontSize: 16, fontWeight: 600, textTransform: "uppercase", letterSpacing: 0.5 }, children: item.title || item.name }),
33417
- /* @__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(
33418
34001
  "button",
33419
34002
  {
33420
34003
  onClick: () => handleCloseDrawer(item.id),
@@ -33429,7 +34012,7 @@ var ChatSidebar = ({
33429
34012
  background: "rgba(255, 255, 255, 0.5)",
33430
34013
  cursor: "pointer"
33431
34014
  },
33432
- children: /* @__PURE__ */ jsx129(PanelLeftClose2, { size: 24 })
34015
+ children: /* @__PURE__ */ jsx130(PanelLeftClose2, { size: 24 })
33433
34016
  }
33434
34017
  )
33435
34018
  ] }),
@@ -33460,7 +34043,7 @@ var ChatSidebar = ({
33460
34043
  };
33461
34044
 
33462
34045
  // src/components/Chat/LatticeChatView.tsx
33463
- import { jsx as jsx130 } from "react/jsx-runtime";
34046
+ import { jsx as jsx131 } from "react/jsx-runtime";
33464
34047
  var LatticeChatView = (props) => {
33465
34048
  const shellContext = useContext12(LatticeChatShellContext);
33466
34049
  const { showSideMenu, sideMenuItems } = shellContext.config;
@@ -33469,7 +34052,7 @@ var LatticeChatView = (props) => {
33469
34052
  const {
33470
34053
  config: { baseURL }
33471
34054
  } = useLatticeChatShellContext();
33472
- return assistantId && thread ? /* @__PURE__ */ jsx130(
34055
+ return assistantId && thread ? /* @__PURE__ */ jsx131(
33473
34056
  AxiomLatticeProvider,
33474
34057
  {
33475
34058
  config: {
@@ -33478,14 +34061,14 @@ var LatticeChatView = (props) => {
33478
34061
  assistantId,
33479
34062
  transport: "sse"
33480
34063
  },
33481
- children: /* @__PURE__ */ jsx130(
34064
+ children: /* @__PURE__ */ jsx131(
33482
34065
  LatticeChat,
33483
34066
  {
33484
34067
  thread_id: thread?.id,
33485
34068
  assistant_id: assistantId,
33486
34069
  name: currentAssistant?.name,
33487
34070
  description: currentAssistant?.description,
33488
- menu: showSideMenu ? /* @__PURE__ */ jsx130(ChatSidebar, { customMenuItems: sideMenuItems }) : void 0
34071
+ menu: showSideMenu ? /* @__PURE__ */ jsx131(ChatSidebar, { customMenuItems: sideMenuItems }) : void 0
33489
34072
  }
33490
34073
  )
33491
34074
  }
@@ -33493,14 +34076,14 @@ var LatticeChatView = (props) => {
33493
34076
  };
33494
34077
 
33495
34078
  // src/components/Chat/SettingsModal.tsx
33496
- 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";
33497
34080
  import {
33498
34081
  Modal as Modal24,
33499
34082
  Input as Input19,
33500
34083
  Button as Button59,
33501
34084
  message as message23,
33502
34085
  notification as notification5,
33503
- Typography as Typography59,
34086
+ Typography as Typography60,
33504
34087
  Alert as Alert9,
33505
34088
  Select as Select8,
33506
34089
  Switch as Switch4,
@@ -33520,8 +34103,8 @@ import {
33520
34103
  CloudServerOutlined
33521
34104
  } from "@ant-design/icons";
33522
34105
  import { createStyles as createStyles41 } from "antd-style";
33523
- import { Fragment as Fragment30, jsx as jsx131, jsxs as jsxs94 } from "react/jsx-runtime";
33524
- 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;
33525
34108
  var { TextArea: TextArea9 } = Input19;
33526
34109
  var useStyles24 = createStyles41(({ token, css }) => ({
33527
34110
  // settingsModal: css`
@@ -33868,12 +34451,12 @@ var SETTINGS_MENU_ITEMS = [
33868
34451
  {
33869
34452
  key: "environment",
33870
34453
  label: "Environment Variables",
33871
- icon: /* @__PURE__ */ jsx131(EnvironmentOutlined, {})
34454
+ icon: /* @__PURE__ */ jsx132(EnvironmentOutlined, {})
33872
34455
  },
33873
34456
  {
33874
34457
  key: "models",
33875
34458
  label: "Model Configuration",
33876
- icon: /* @__PURE__ */ jsx131(ApiOutlined, {})
34459
+ icon: /* @__PURE__ */ jsx132(ApiOutlined, {})
33877
34460
  }
33878
34461
  ];
33879
34462
  var SettingsModal = ({
@@ -33907,7 +34490,7 @@ var SettingsModal = ({
33907
34490
  });
33908
34491
  const [serverConfigs, setServerConfigs] = useState82({});
33909
34492
  const connectionsRef = useRef30(connections);
33910
- useEffect55(() => {
34493
+ useEffect56(() => {
33911
34494
  connectionsRef.current = connections;
33912
34495
  }, [connections]);
33913
34496
  const [activeTabKey, setActiveTabKey] = useState82(
@@ -34109,7 +34692,7 @@ var SettingsModal = ({
34109
34692
  console.error("Failed to load models configuration:", error);
34110
34693
  }
34111
34694
  };
34112
- useEffect55(() => {
34695
+ useEffect56(() => {
34113
34696
  if (open && activeTabKey) {
34114
34697
  initializeServerConfig(activeTabKey);
34115
34698
  const connection = connections.find((c) => c.id === activeTabKey);
@@ -34118,7 +34701,7 @@ var SettingsModal = ({
34118
34701
  }
34119
34702
  }
34120
34703
  }, [open, activeTabKey]);
34121
- useEffect55(() => {
34704
+ useEffect56(() => {
34122
34705
  if (open && activeTabKey) {
34123
34706
  const connection = connections.find((c) => c.id === activeTabKey);
34124
34707
  if (connection?.connected) {
@@ -34329,25 +34912,25 @@ var SettingsModal = ({
34329
34912
  }
34330
34913
  }));
34331
34914
  };
34332
- return /* @__PURE__ */ jsxs94("div", { className: styles.formContainer, children: [
34333
- /* @__PURE__ */ jsx131(
34915
+ return /* @__PURE__ */ jsxs95("div", { className: styles.formContainer, children: [
34916
+ /* @__PURE__ */ jsx132(
34334
34917
  Alert9,
34335
34918
  {
34336
34919
  message: "Configuration Effect",
34337
- description: /* @__PURE__ */ jsxs94("div", { children: [
34338
- /* @__PURE__ */ jsxs94("div", { style: { marginBottom: 8 }, children: [
34339
- /* @__PURE__ */ jsx131(
34920
+ description: /* @__PURE__ */ jsxs95("div", { children: [
34921
+ /* @__PURE__ */ jsxs95("div", { style: { marginBottom: 8 }, children: [
34922
+ /* @__PURE__ */ jsx132(
34340
34923
  CheckCircleOutlined8,
34341
34924
  {
34342
34925
  style: { color: "#52c41a", marginRight: 8 }
34343
34926
  }
34344
34927
  ),
34345
- /* @__PURE__ */ jsx131("strong", { children: "Immediately effective:" }),
34928
+ /* @__PURE__ */ jsx132("strong", { children: "Immediately effective:" }),
34346
34929
  " QUEUE_SERVICE_TYPE, REDIS_URL, REDIS_PASSWORD, QUEUE_NAME"
34347
34930
  ] }),
34348
- /* @__PURE__ */ jsxs94("div", { children: [
34349
- /* @__PURE__ */ jsx131(ReloadOutlined6, { style: { color: "#faad14", marginRight: 8 } }),
34350
- /* @__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:" }),
34351
34934
  " PORT (server must be restarted to change port)"
34352
34935
  ] })
34353
34936
  ] }),
@@ -34356,8 +34939,8 @@ var SettingsModal = ({
34356
34939
  className: styles.alertCard
34357
34940
  }
34358
34941
  ),
34359
- /* @__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." }) }),
34360
- /* @__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(
34361
34944
  TextArea9,
34362
34945
  {
34363
34946
  value: config.envText,
@@ -34434,10 +35017,10 @@ QUEUE_NAME=tasks`,
34434
35017
  }));
34435
35018
  }
34436
35019
  };
34437
- return /* @__PURE__ */ jsxs94("div", { className: styles.formContainer, children: [
34438
- /* @__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." }) }),
34439
- config.models.map((model, index) => /* @__PURE__ */ jsxs94("div", { className: styles.card, children: [
34440
- /* @__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(
34441
35024
  "div",
34442
35025
  {
34443
35026
  style: {
@@ -34449,13 +35032,13 @@ QUEUE_NAME=tasks`,
34449
35032
  borderBottom: "1px solid rgba(0, 0, 0, 0.06)"
34450
35033
  },
34451
35034
  children: [
34452
- /* @__PURE__ */ jsxs94("div", { children: [
34453
- /* @__PURE__ */ jsxs94(Text48, { strong: true, style: { fontSize: 16 }, children: [
35035
+ /* @__PURE__ */ jsxs95("div", { children: [
35036
+ /* @__PURE__ */ jsxs95(Text49, { strong: true, style: { fontSize: 16 }, children: [
34454
35037
  "Model ",
34455
35038
  index + 1
34456
35039
  ] }),
34457
- model.key && /* @__PURE__ */ jsxs94(
34458
- Text48,
35040
+ model.key && /* @__PURE__ */ jsxs95(
35041
+ Text49,
34459
35042
  {
34460
35043
  type: "secondary",
34461
35044
  style: { marginLeft: 8, fontSize: 12 },
@@ -34467,7 +35050,7 @@ QUEUE_NAME=tasks`,
34467
35050
  }
34468
35051
  )
34469
35052
  ] }),
34470
- config.models.length > 1 && /* @__PURE__ */ jsx131(
35053
+ config.models.length > 1 && /* @__PURE__ */ jsx132(
34471
35054
  Button59,
34472
35055
  {
34473
35056
  type: "text",
@@ -34484,10 +35067,10 @@ QUEUE_NAME=tasks`,
34484
35067
  ]
34485
35068
  }
34486
35069
  ),
34487
- /* @__PURE__ */ jsxs94(Space39, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
34488
- /* @__PURE__ */ jsxs94("div", { children: [
34489
- /* @__PURE__ */ jsx131(Text48, { className: styles.formLabel, children: "Key *" }),
34490
- /* @__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(
34491
35074
  Input19,
34492
35075
  {
34493
35076
  placeholder: "e.g., default, gpt-4, claude",
@@ -34496,11 +35079,11 @@ QUEUE_NAME=tasks`,
34496
35079
  style: { height: 40 }
34497
35080
  }
34498
35081
  ),
34499
- /* @__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" })
34500
35083
  ] }),
34501
- /* @__PURE__ */ jsxs94("div", { children: [
34502
- /* @__PURE__ */ jsx131(Text48, { className: styles.formLabel, children: "Provider *" }),
34503
- /* @__PURE__ */ jsx131(
35084
+ /* @__PURE__ */ jsxs95("div", { children: [
35085
+ /* @__PURE__ */ jsx132(Text49, { className: styles.formLabel, children: "Provider *" }),
35086
+ /* @__PURE__ */ jsx132(
34504
35087
  Select8,
34505
35088
  {
34506
35089
  style: { width: "100%", height: 40 },
@@ -34516,9 +35099,9 @@ QUEUE_NAME=tasks`,
34516
35099
  }
34517
35100
  )
34518
35101
  ] }),
34519
- /* @__PURE__ */ jsxs94("div", { children: [
34520
- /* @__PURE__ */ jsx131(Text48, { className: styles.formLabel, children: "Model Name *" }),
34521
- /* @__PURE__ */ jsx131(
35102
+ /* @__PURE__ */ jsxs95("div", { children: [
35103
+ /* @__PURE__ */ jsx132(Text49, { className: styles.formLabel, children: "Model Name *" }),
35104
+ /* @__PURE__ */ jsx132(
34522
35105
  Input19,
34523
35106
  {
34524
35107
  placeholder: "e.g., gpt-4, claude-3-opus, kimi-k2-250905",
@@ -34528,9 +35111,9 @@ QUEUE_NAME=tasks`,
34528
35111
  }
34529
35112
  )
34530
35113
  ] }),
34531
- /* @__PURE__ */ jsxs94("div", { children: [
34532
- /* @__PURE__ */ jsx131(Text48, { className: styles.formLabel, children: "API Key" }),
34533
- /* @__PURE__ */ jsx131(
35114
+ /* @__PURE__ */ jsxs95("div", { children: [
35115
+ /* @__PURE__ */ jsx132(Text49, { className: styles.formLabel, children: "API Key" }),
35116
+ /* @__PURE__ */ jsx132(
34534
35117
  Input19.Password,
34535
35118
  {
34536
35119
  placeholder: "Enter your API key",
@@ -34539,11 +35122,11 @@ QUEUE_NAME=tasks`,
34539
35122
  style: { height: 40 }
34540
35123
  }
34541
35124
  ),
34542
- /* @__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." })
34543
35126
  ] }),
34544
- /* @__PURE__ */ jsxs94("div", { children: [
34545
- /* @__PURE__ */ jsx131(Text48, { className: styles.formLabel, children: "Base URL" }),
34546
- /* @__PURE__ */ jsx131(
35127
+ /* @__PURE__ */ jsxs95("div", { children: [
35128
+ /* @__PURE__ */ jsx132(Text49, { className: styles.formLabel, children: "Base URL" }),
35129
+ /* @__PURE__ */ jsx132(
34547
35130
  Input19,
34548
35131
  {
34549
35132
  placeholder: "e.g., https://api.openai.com/v1",
@@ -34552,22 +35135,22 @@ QUEUE_NAME=tasks`,
34552
35135
  style: { height: 40 }
34553
35136
  }
34554
35137
  ),
34555
- /* @__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" })
34556
35139
  ] }),
34557
- /* @__PURE__ */ jsx131("div", { children: /* @__PURE__ */ jsxs94(Space39, { children: [
34558
- /* @__PURE__ */ jsx131(
35140
+ /* @__PURE__ */ jsx132("div", { children: /* @__PURE__ */ jsxs95(Space39, { children: [
35141
+ /* @__PURE__ */ jsx132(
34559
35142
  Switch4,
34560
35143
  {
34561
35144
  checked: model.streaming,
34562
35145
  onChange: (checked) => handleModelChange(index, "streaming", checked)
34563
35146
  }
34564
35147
  ),
34565
- /* @__PURE__ */ jsx131(Text48, { children: "Enable Streaming" })
35148
+ /* @__PURE__ */ jsx132(Text49, { children: "Enable Streaming" })
34566
35149
  ] }) }),
34567
- /* @__PURE__ */ jsxs94("div", { style: { display: "flex", gap: 20 }, children: [
34568
- /* @__PURE__ */ jsxs94("div", { style: { flex: 1 }, children: [
34569
- /* @__PURE__ */ jsx131(Text48, { className: styles.formLabel, children: "Max Tokens" }),
34570
- /* @__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(
34571
35154
  Input19,
34572
35155
  {
34573
35156
  type: "number",
@@ -34582,9 +35165,9 @@ QUEUE_NAME=tasks`,
34582
35165
  }
34583
35166
  )
34584
35167
  ] }),
34585
- /* @__PURE__ */ jsxs94("div", { style: { flex: 1 }, children: [
34586
- /* @__PURE__ */ jsx131(Text48, { className: styles.formLabel, children: "Temperature" }),
34587
- /* @__PURE__ */ jsx131(
35168
+ /* @__PURE__ */ jsxs95("div", { style: { flex: 1 }, children: [
35169
+ /* @__PURE__ */ jsx132(Text49, { className: styles.formLabel, children: "Temperature" }),
35170
+ /* @__PURE__ */ jsx132(
34588
35171
  Input19,
34589
35172
  {
34590
35173
  type: "number",
@@ -34603,7 +35186,7 @@ QUEUE_NAME=tasks`,
34603
35186
  ] })
34604
35187
  ] })
34605
35188
  ] }, index)),
34606
- /* @__PURE__ */ jsx131(
35189
+ /* @__PURE__ */ jsx132(
34607
35190
  Button59,
34608
35191
  {
34609
35192
  type: "dashed",
@@ -34631,8 +35214,8 @@ QUEUE_NAME=tasks`,
34631
35214
  );
34632
35215
  const currentConnection = connections.find((c) => c.id === activeTabKey);
34633
35216
  const renderTabLabel = (connection) => {
34634
- return /* @__PURE__ */ jsxs94("div", { style: { display: "flex", alignItems: "center" }, children: [
34635
- /* @__PURE__ */ jsx131(
35217
+ return /* @__PURE__ */ jsxs95("div", { style: { display: "flex", alignItems: "center" }, children: [
35218
+ /* @__PURE__ */ jsx132(
34636
35219
  CloudServerOutlined,
34637
35220
  {
34638
35221
  style: {
@@ -34641,14 +35224,14 @@ QUEUE_NAME=tasks`,
34641
35224
  }
34642
35225
  }
34643
35226
  ),
34644
- /* @__PURE__ */ jsx131("span", { children: connection.name }),
34645
- connection.connected && /* @__PURE__ */ jsx131(
35227
+ /* @__PURE__ */ jsx132("span", { children: connection.name }),
35228
+ connection.connected && /* @__PURE__ */ jsx132(
34646
35229
  CheckCircleFilled,
34647
35230
  {
34648
35231
  style: { color: "#52c41a", fontSize: 12, marginLeft: 8 }
34649
35232
  }
34650
35233
  ),
34651
- connection.error && !connection.connecting && /* @__PURE__ */ jsx131(
35234
+ connection.error && !connection.connecting && /* @__PURE__ */ jsx132(
34652
35235
  CloseCircleFilled,
34653
35236
  {
34654
35237
  style: { color: "#ff4d4f", fontSize: 12, marginLeft: 8 }
@@ -34659,35 +35242,35 @@ QUEUE_NAME=tasks`,
34659
35242
  const tabItems = connections.map((connection) => ({
34660
35243
  key: connection.id,
34661
35244
  label: renderTabLabel(connection),
34662
- children: /* @__PURE__ */ jsx131("div", { className: styles.tabContent, children: connection.connected ? /* @__PURE__ */ jsx131(Fragment30, { children: /* @__PURE__ */ jsxs94("div", { style: { display: "flex", height: "100%" }, children: [
34663
- /* @__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(
34664
35247
  "div",
34665
35248
  {
34666
35249
  className: `${styles.menuItem} ${activeMenu === item.key ? "active" : ""}`,
34667
35250
  onClick: () => setActiveMenu(item.key),
34668
35251
  children: [
34669
- /* @__PURE__ */ jsx131("span", { className: styles.menuItemIcon, children: item.icon }),
34670
- /* @__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 })
34671
35254
  ]
34672
35255
  },
34673
35256
  item.key
34674
35257
  )) }),
34675
- /* @__PURE__ */ jsxs94("div", { className: styles.content, children: [
34676
- /* @__PURE__ */ jsxs94("div", { className: styles.contentHeader, children: [
34677
- /* @__PURE__ */ jsxs94("div", { className: styles.contentHeaderLeft, children: [
34678
- /* @__PURE__ */ jsx131(Title17, { level: 3, className: styles.contentTitle, children: activeMenuItem?.label }),
34679
- /* @__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: [
34680
35263
  activeMenu === "environment" && "Manage environment variables for the gateway server",
34681
35264
  activeMenu === "models" && "Configure and register model lattices for use by agents"
34682
35265
  ] })
34683
35266
  ] }),
34684
- /* @__PURE__ */ jsxs94("div", { className: styles.contentHeaderRight, children: [
34685
- /* @__PURE__ */ jsx131(Button59, { onClick: onClose, children: "Cancel" }),
34686
- /* @__PURE__ */ jsx131(
35267
+ /* @__PURE__ */ jsxs95("div", { className: styles.contentHeaderRight, children: [
35268
+ /* @__PURE__ */ jsx132(Button59, { onClick: onClose, children: "Cancel" }),
35269
+ /* @__PURE__ */ jsx132(
34687
35270
  Button59,
34688
35271
  {
34689
35272
  type: "primary",
34690
- icon: /* @__PURE__ */ jsx131(SaveOutlined2, {}),
35273
+ icon: /* @__PURE__ */ jsx132(SaveOutlined2, {}),
34691
35274
  onClick: handleSave,
34692
35275
  loading,
34693
35276
  children: "Save Configuration"
@@ -34695,9 +35278,9 @@ QUEUE_NAME=tasks`,
34695
35278
  )
34696
35279
  ] })
34697
35280
  ] }),
34698
- /* @__PURE__ */ jsx131("div", { className: styles.contentBody, children: renderContent(connection.id) })
35281
+ /* @__PURE__ */ jsx132("div", { className: styles.contentBody, children: renderContent(connection.id) })
34699
35282
  ] })
34700
- ] }) }) : /* @__PURE__ */ jsx131(
35283
+ ] }) }) : /* @__PURE__ */ jsx132(
34701
35284
  "div",
34702
35285
  {
34703
35286
  style: {
@@ -34709,29 +35292,29 @@ QUEUE_NAME=tasks`,
34709
35292
  gap: 16,
34710
35293
  padding: 48
34711
35294
  },
34712
- children: connection.connecting ? /* @__PURE__ */ jsxs94(Fragment30, { children: [
34713
- /* @__PURE__ */ jsx131(LinkOutlined2, { style: { fontSize: 64, color: "#1890ff" }, spin: true }),
34714
- /* @__PURE__ */ jsx131(Title17, { level: 4, children: "Connecting..." }),
34715
- /* @__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: [
34716
35299
  "Connecting to ",
34717
35300
  connection.url
34718
35301
  ] })
34719
- ] }) : /* @__PURE__ */ jsxs94(Fragment30, { children: [
34720
- /* @__PURE__ */ jsx131(LinkOutlined2, { style: { fontSize: 64, color: "#d9d9d9" } }),
34721
- /* @__PURE__ */ jsx131(Title17, { level: 4, type: "secondary", children: connection.error || "Not Connected" }),
34722
- /* @__PURE__ */ jsx131(
34723
- 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,
34724
35307
  {
34725
35308
  type: "secondary",
34726
35309
  style: { textAlign: "center", maxWidth: 400 },
34727
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}`
34728
35311
  }
34729
35312
  ),
34730
- /* @__PURE__ */ jsx131(
35313
+ /* @__PURE__ */ jsx132(
34731
35314
  Button59,
34732
35315
  {
34733
35316
  type: "primary",
34734
- icon: /* @__PURE__ */ jsx131(LinkOutlined2, {}),
35317
+ icon: /* @__PURE__ */ jsx132(LinkOutlined2, {}),
34735
35318
  onClick: () => checkConnection(connection.id),
34736
35319
  loading: connection.connecting,
34737
35320
  style: { marginTop: 16 },
@@ -34743,8 +35326,8 @@ QUEUE_NAME=tasks`,
34743
35326
  ) }),
34744
35327
  closable: connections.length > 1
34745
35328
  }));
34746
- return /* @__PURE__ */ jsxs94(Fragment30, { children: [
34747
- /* @__PURE__ */ jsx131(
35329
+ return /* @__PURE__ */ jsxs95(Fragment30, { children: [
35330
+ /* @__PURE__ */ jsx132(
34748
35331
  Modal24,
34749
35332
  {
34750
35333
  open,
@@ -34753,7 +35336,7 @@ QUEUE_NAME=tasks`,
34753
35336
  width: "80%",
34754
35337
  footer: null,
34755
35338
  title: "Settings",
34756
- children: /* @__PURE__ */ jsx131("div", { children: /* @__PURE__ */ jsx131(
35339
+ children: /* @__PURE__ */ jsx132("div", { children: /* @__PURE__ */ jsx132(
34757
35340
  Tabs4,
34758
35341
  {
34759
35342
  activeKey: activeTabKey,
@@ -34767,7 +35350,7 @@ QUEUE_NAME=tasks`,
34767
35350
  }
34768
35351
  },
34769
35352
  items: tabItems,
34770
- addIcon: /* @__PURE__ */ jsxs94(
35353
+ addIcon: /* @__PURE__ */ jsxs95(
34771
35354
  "div",
34772
35355
  {
34773
35356
  style: {
@@ -34777,8 +35360,8 @@ QUEUE_NAME=tasks`,
34777
35360
  padding: "4px 8px"
34778
35361
  },
34779
35362
  children: [
34780
- /* @__PURE__ */ jsx131(PlusOutlined9, {}),
34781
- /* @__PURE__ */ jsx131("span", { children: "Add Server" })
35363
+ /* @__PURE__ */ jsx132(PlusOutlined9, {}),
35364
+ /* @__PURE__ */ jsx132("span", { children: "Add Server" })
34782
35365
  ]
34783
35366
  }
34784
35367
  )
@@ -34786,7 +35369,7 @@ QUEUE_NAME=tasks`,
34786
35369
  ) })
34787
35370
  }
34788
35371
  ),
34789
- /* @__PURE__ */ jsx131(
35372
+ /* @__PURE__ */ jsx132(
34790
35373
  Modal24,
34791
35374
  {
34792
35375
  title: "Add New Server",
@@ -34800,10 +35383,10 @@ QUEUE_NAME=tasks`,
34800
35383
  },
34801
35384
  confirmLoading: addingServer,
34802
35385
  className: styles.addServerModal,
34803
- children: /* @__PURE__ */ jsxs94(Space39, { direction: "vertical", style: { width: "100%" }, size: "large", children: [
34804
- /* @__PURE__ */ jsxs94("div", { children: [
34805
- /* @__PURE__ */ jsx131(Text48, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server Name" }),
34806
- /* @__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(
34807
35390
  Input19,
34808
35391
  {
34809
35392
  placeholder: "e.g., Production Server",
@@ -34812,11 +35395,11 @@ QUEUE_NAME=tasks`,
34812
35395
  onPressEnter: handleAddServer
34813
35396
  }
34814
35397
  ),
34815
- /* @__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" })
34816
35399
  ] }),
34817
- /* @__PURE__ */ jsxs94("div", { children: [
34818
- /* @__PURE__ */ jsx131(Text48, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server URL *" }),
34819
- /* @__PURE__ */ jsx131(
35400
+ /* @__PURE__ */ jsxs95("div", { children: [
35401
+ /* @__PURE__ */ jsx132(Text49, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server URL *" }),
35402
+ /* @__PURE__ */ jsx132(
34820
35403
  Input19,
34821
35404
  {
34822
35405
  placeholder: "e.g., http://localhost:4001",
@@ -34825,11 +35408,11 @@ QUEUE_NAME=tasks`,
34825
35408
  onPressEnter: handleAddServer
34826
35409
  }
34827
35410
  ),
34828
- /* @__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" })
34829
35412
  ] }),
34830
- /* @__PURE__ */ jsxs94("div", { children: [
34831
- /* @__PURE__ */ jsx131(Text48, { strong: true, style: { display: "block", marginBottom: 8 }, children: "API Key" }),
34832
- /* @__PURE__ */ jsx131(
35413
+ /* @__PURE__ */ jsxs95("div", { children: [
35414
+ /* @__PURE__ */ jsx132(Text49, { strong: true, style: { display: "block", marginBottom: 8 }, children: "API Key" }),
35415
+ /* @__PURE__ */ jsx132(
34833
35416
  Input19.Password,
34834
35417
  {
34835
35418
  placeholder: "Optional: Enter API key for authentication",
@@ -34838,7 +35421,7 @@ QUEUE_NAME=tasks`,
34838
35421
  onPressEnter: handleAddServer
34839
35422
  }
34840
35423
  ),
34841
- /* @__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" })
34842
35425
  ] })
34843
35426
  ] })
34844
35427
  }
@@ -34847,10 +35430,10 @@ QUEUE_NAME=tasks`,
34847
35430
  };
34848
35431
 
34849
35432
  // src/components/Chat/AgentServerSetting.tsx
34850
- import { jsx as jsx132 } from "react/jsx-runtime";
35433
+ import { jsx as jsx133 } from "react/jsx-runtime";
34851
35434
  var AgentServerSetting = () => {
34852
35435
  const { settingsModalOpen, setSettingsModalOpen } = useLatticeChatShellContext();
34853
- return /* @__PURE__ */ jsx132(
35436
+ return /* @__PURE__ */ jsx133(
34854
35437
  SettingsModal,
34855
35438
  {
34856
35439
  open: settingsModalOpen,
@@ -34860,24 +35443,24 @@ var AgentServerSetting = () => {
34860
35443
  };
34861
35444
 
34862
35445
  // src/components/Chat/LatticeChatShell.tsx
34863
- 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";
34864
35447
  var ShellContent = ({
34865
35448
  initialAssistantId,
34866
35449
  enableWorkspace
34867
35450
  }) => {
34868
35451
  const { currentTenant } = useAuth();
34869
- return /* @__PURE__ */ jsx133(Fragment31, { children: enableWorkspace ? /* @__PURE__ */ jsxs95(WorkspaceContextProvider, { children: [
34870
- /* @__PURE__ */ jsx133(AssistantContextProvider, { autoLoad: true, initialAssistantId, children: /* @__PURE__ */ jsx133(ConversationContextProvider, { children: /* @__PURE__ */ jsx133(LatticeChatView, {}) }) }),
34871
- /* @__PURE__ */ jsx133(AgentServerSetting, {})
34872
- ] }) : /* @__PURE__ */ jsxs95(Fragment31, { children: [
34873
- /* @__PURE__ */ jsx133(AssistantContextProvider, { autoLoad: true, initialAssistantId, children: /* @__PURE__ */ jsx133(ConversationContextProvider, { children: /* @__PURE__ */ jsx133(LatticeChatView, {}) }) }),
34874
- /* @__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, {})
34875
35458
  ] }) });
34876
35459
  };
34877
35460
  var LatticeChatShell = (props) => {
34878
35461
  const { enableAssistantCreation, enableAssistantEditing, enableWorkspace: enableWorkspaceProp, ...restProps } = props;
34879
35462
  const enableWorkspace = enableWorkspaceProp ?? restProps.initialConfig?.enableWorkspace ?? false;
34880
- return /* @__PURE__ */ jsx133(
35463
+ return /* @__PURE__ */ jsx134(
34881
35464
  LatticeChatShellContextProvider,
34882
35465
  {
34883
35466
  initialConfig: {
@@ -34886,7 +35469,7 @@ var LatticeChatShell = (props) => {
34886
35469
  enableWorkspace,
34887
35470
  ...restProps.initialConfig
34888
35471
  },
34889
- children: /* @__PURE__ */ jsx133(
35472
+ children: /* @__PURE__ */ jsx134(
34890
35473
  ShellContent,
34891
35474
  {
34892
35475
  initialAssistantId: restProps.initialConfig?.assistantId,
@@ -34898,7 +35481,7 @@ var LatticeChatShell = (props) => {
34898
35481
  };
34899
35482
 
34900
35483
  // src/components/Chat/ChannelInstallationsDrawerContent.tsx
34901
- import { useEffect as useEffect56, useState as useState83 } from "react";
35484
+ import { useEffect as useEffect57, useState as useState83 } from "react";
34902
35485
  import {
34903
35486
  Button as Button60,
34904
35487
  Card as Card30,
@@ -34908,12 +35491,12 @@ import {
34908
35491
  Popconfirm as Popconfirm12,
34909
35492
  Spin as Spin23,
34910
35493
  Tag as Tag30,
34911
- Typography as Typography60,
35494
+ Typography as Typography61,
34912
35495
  message as message24
34913
35496
  } from "antd";
34914
35497
  import { Edit2 as Edit24, Plus as Plus9, RadioTower, Trash2 as Trash210 } from "lucide-react";
34915
- import { jsx as jsx134, jsxs as jsxs96 } from "react/jsx-runtime";
34916
- 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;
34917
35500
  var ChannelInstallationsDrawerContent = () => {
34918
35501
  const { get, post, put, del } = useApi();
34919
35502
  const [installations, setInstallations] = useState83([]);
@@ -34940,7 +35523,7 @@ var ChannelInstallationsDrawerContent = () => {
34940
35523
  setLoading(false);
34941
35524
  }
34942
35525
  };
34943
- useEffect56(() => {
35526
+ useEffect57(() => {
34944
35527
  loadInstallations();
34945
35528
  }, []);
34946
35529
  const handleDelete = async (installation) => {
@@ -34961,8 +35544,8 @@ var ChannelInstallationsDrawerContent = () => {
34961
35544
  message24.error("Failed to delete installation");
34962
35545
  }
34963
35546
  };
34964
- return /* @__PURE__ */ jsxs96("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
34965
- /* @__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(
34966
35549
  "div",
34967
35550
  {
34968
35551
  style: {
@@ -34971,12 +35554,12 @@ var ChannelInstallationsDrawerContent = () => {
34971
35554
  alignItems: "center"
34972
35555
  },
34973
35556
  children: [
34974
- /* @__PURE__ */ jsx134(Title18, { level: 5, style: { margin: 0 }, children: "Channel Installations" }),
34975
- /* @__PURE__ */ jsx134(
35557
+ /* @__PURE__ */ jsx135(Title18, { level: 5, style: { margin: 0 }, children: "Channel Installations" }),
35558
+ /* @__PURE__ */ jsx135(
34976
35559
  Button60,
34977
35560
  {
34978
35561
  type: "primary",
34979
- icon: /* @__PURE__ */ jsx134(Plus9, { size: 16 }),
35562
+ icon: /* @__PURE__ */ jsx135(Plus9, { size: 16 }),
34980
35563
  onClick: () => {
34981
35564
  setEditingInstallation(null);
34982
35565
  setFormModalOpen(true);
@@ -34987,7 +35570,7 @@ var ChannelInstallationsDrawerContent = () => {
34987
35570
  ]
34988
35571
  }
34989
35572
  ) }),
34990
- /* @__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(
34991
35574
  "div",
34992
35575
  {
34993
35576
  style: {
@@ -34998,15 +35581,15 @@ var ChannelInstallationsDrawerContent = () => {
34998
35581
  padding: "48px 16px"
34999
35582
  },
35000
35583
  children: [
35001
- /* @__PURE__ */ jsx134(RadioTower, { size: 48, style: { marginBottom: 16, opacity: 0.5 } }),
35002
- /* @__PURE__ */ jsx134(Text49, { strong: true, style: { fontSize: 15 }, children: "No channel installations" }),
35003
- /* @__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' })
35004
35587
  ]
35005
35588
  }
35006
- ) : /* @__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) => {
35007
35590
  const webhookPath = installation.channel === "lark" ? `/api/channels/lark/installations/${installation.id}/events` : null;
35008
- return /* @__PURE__ */ jsxs96(Card30, { size: "small", children: [
35009
- /* @__PURE__ */ jsxs96(
35591
+ return /* @__PURE__ */ jsxs97(Card30, { size: "small", children: [
35592
+ /* @__PURE__ */ jsxs97(
35010
35593
  "div",
35011
35594
  {
35012
35595
  style: {
@@ -35016,12 +35599,12 @@ var ChannelInstallationsDrawerContent = () => {
35016
35599
  marginBottom: 10
35017
35600
  },
35018
35601
  children: [
35019
- /* @__PURE__ */ jsx134(Text49, { strong: true, style: { fontSize: 15 }, children: installation.name || installation.id }),
35020
- /* @__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 })
35021
35604
  ]
35022
35605
  }
35023
35606
  ),
35024
- /* @__PURE__ */ jsxs96(
35607
+ /* @__PURE__ */ jsxs97(
35025
35608
  "div",
35026
35609
  {
35027
35610
  style: {
@@ -35031,19 +35614,19 @@ var ChannelInstallationsDrawerContent = () => {
35031
35614
  marginBottom: 12
35032
35615
  },
35033
35616
  children: [
35034
- /* @__PURE__ */ jsxs96(Text49, { type: "secondary", style: { fontSize: 12 }, children: [
35617
+ /* @__PURE__ */ jsxs97(Text50, { type: "secondary", style: { fontSize: 12 }, children: [
35035
35618
  "ID: ",
35036
35619
  installation.id
35037
35620
  ] }),
35038
- 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" })
35039
35622
  ]
35040
35623
  }
35041
35624
  ),
35042
- /* @__PURE__ */ jsxs96("div", { style: { display: "flex", gap: 8 }, children: [
35043
- /* @__PURE__ */ jsx134(
35625
+ /* @__PURE__ */ jsxs97("div", { style: { display: "flex", gap: 8 }, children: [
35626
+ /* @__PURE__ */ jsx135(
35044
35627
  Button60,
35045
35628
  {
35046
- icon: /* @__PURE__ */ jsx134(Edit24, { size: 14 }),
35629
+ icon: /* @__PURE__ */ jsx135(Edit24, { size: 14 }),
35047
35630
  onClick: () => {
35048
35631
  setEditingInstallation(installation);
35049
35632
  setFormModalOpen(true);
@@ -35051,7 +35634,7 @@ var ChannelInstallationsDrawerContent = () => {
35051
35634
  children: "Edit"
35052
35635
  }
35053
35636
  ),
35054
- /* @__PURE__ */ jsx134(
35637
+ /* @__PURE__ */ jsx135(
35055
35638
  Popconfirm12,
35056
35639
  {
35057
35640
  title: "Delete Channel Installation",
@@ -35060,13 +35643,13 @@ var ChannelInstallationsDrawerContent = () => {
35060
35643
  okText: "Delete",
35061
35644
  okType: "danger",
35062
35645
  cancelText: "Cancel",
35063
- 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" })
35064
35647
  }
35065
35648
  )
35066
35649
  ] })
35067
35650
  ] }, installation.id);
35068
35651
  }) }) }),
35069
- formModalOpen ? /* @__PURE__ */ jsx134(
35652
+ formModalOpen ? /* @__PURE__ */ jsx135(
35070
35653
  LarkChannelInstallationFormModal,
35071
35654
  {
35072
35655
  installation: editingInstallation,
@@ -35088,7 +35671,7 @@ var ChannelInstallationsDrawerContent = () => {
35088
35671
  };
35089
35672
  var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCancel, onSave }) => {
35090
35673
  const [form] = Form9.useForm();
35091
- useEffect56(() => {
35674
+ useEffect57(() => {
35092
35675
  if (installation) {
35093
35676
  const config = installation.config;
35094
35677
  form.setFieldsValue({
@@ -35150,7 +35733,7 @@ var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCance
35150
35733
  );
35151
35734
  }
35152
35735
  };
35153
- return /* @__PURE__ */ jsx134(
35736
+ return /* @__PURE__ */ jsx135(
35154
35737
  Modal25,
35155
35738
  {
35156
35739
  open,
@@ -35159,29 +35742,29 @@ var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCance
35159
35742
  onOk: handleSubmit,
35160
35743
  okText: installation ? "Save" : "Create",
35161
35744
  destroyOnHidden: true,
35162
- children: /* @__PURE__ */ jsxs96(Form9, { form, layout: "vertical", children: [
35163
- /* @__PURE__ */ jsx134(Form9.Item, { label: "Channel", children: /* @__PURE__ */ jsx134(Input20, { value: "lark", disabled: true }) }),
35164
- /* @__PURE__ */ jsx134(Form9.Item, { name: "name", label: "Name", children: /* @__PURE__ */ jsx134(Input20, {}) }),
35165
- /* @__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(
35166
35749
  Form9.Item,
35167
35750
  {
35168
35751
  name: "appId",
35169
35752
  label: "App ID",
35170
35753
  rules: [{ required: true, message: "App ID is required" }],
35171
- children: /* @__PURE__ */ jsx134(Input20, {})
35754
+ children: /* @__PURE__ */ jsx135(Input20, {})
35172
35755
  }
35173
35756
  ),
35174
- /* @__PURE__ */ jsx134(
35757
+ /* @__PURE__ */ jsx135(
35175
35758
  Form9.Item,
35176
35759
  {
35177
35760
  name: "appSecret",
35178
35761
  label: "App Secret",
35179
35762
  rules: [{ required: true, message: "App Secret is required" }],
35180
- children: /* @__PURE__ */ jsx134(Input20, {})
35763
+ children: /* @__PURE__ */ jsx135(Input20, {})
35181
35764
  }
35182
35765
  ),
35183
- /* @__PURE__ */ jsx134(Form9.Item, { name: "verificationToken", label: "Verification Token", children: /* @__PURE__ */ jsx134(Input20, {}) }),
35184
- /* @__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, {}) })
35185
35768
  ] })
35186
35769
  }
35187
35770
  );