@axiom-lattice/react-sdk 3.0.1 → 3.1.0

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
@@ -4099,7 +4099,6 @@ var ConversationContextProvider = ({
4099
4099
  if (!assistantId || !client.assistantId) {
4100
4100
  throw new Error("No assistant selected");
4101
4101
  }
4102
- setIsLoading(true);
4103
4102
  setError(null);
4104
4103
  try {
4105
4104
  const existingThread = await client.threads.get(newThread.id);
@@ -4110,16 +4109,18 @@ var ConversationContextProvider = ({
4110
4109
  label: newThread.label
4111
4110
  }
4112
4111
  });
4113
- await loadThreads();
4112
+ setThreads(
4113
+ (prev) => prev.map(
4114
+ (t4) => t4.id === newThread.id ? { ...t4, label: newThread.label } : t4
4115
+ )
4116
+ );
4114
4117
  } catch (err) {
4115
4118
  const error2 = err instanceof Error ? err : new Error(String(err));
4116
4119
  setError(error2);
4117
4120
  throw error2;
4118
- } finally {
4119
- setIsLoading(false);
4120
4121
  }
4121
4122
  },
4122
- [assistantId, client, loadThreads]
4123
+ [assistantId, client]
4123
4124
  );
4124
4125
  const getThreadById = useCallback8(
4125
4126
  (targetThreadId) => {
@@ -5884,11 +5885,11 @@ var FilePanelToggle = () => {
5884
5885
 
5885
5886
  // src/components/Chat/PinToMenuButton.tsx
5886
5887
  import React136, { useState as useState133, useCallback as useCallback70, useEffect as useEffect106 } from "react";
5887
- import { Button as Button84, Input as Input35, Modal as Modal46, Tooltip as Tooltip33, AutoComplete, message as message42 } from "antd";
5888
+ import { Button as Button85, Input as Input36, Modal as Modal46, Tooltip as Tooltip33, AutoComplete, message as message42 } from "antd";
5888
5889
  import { Pin } from "lucide-react";
5889
5890
 
5890
5891
  // src/components/Chat/WorkspaceResourceManager.tsx
5891
- import React135, { useMemo as useMemo56, useEffect as useEffect105, useRef as useRef54, useState as useState132, useCallback as useCallback69 } from "react";
5892
+ import React135, { useMemo as useMemo56, useEffect as useEffect105, useRef as useRef55, useState as useState132, useCallback as useCallback69 } from "react";
5892
5893
  import { FolderOpen as FolderOpen3, Activity as Activity5, Database as Database8, Plug as Plug4, Bot as Bot12, Wrench as Wrench3, Zap as Zap3, Share2, History as History2, Inbox as Inbox3, FlaskConical as FlaskConical10, PinOff, Layers as Layers3, ArrowRightLeft as ArrowRightLeft2, ListChecks as ListChecks3, KeyRound as KeyRound2 } from "lucide-react";
5893
5894
  import { Modal as Modal45, Avatar as Avatar11, Popover as Popover5, message as message41 } from "antd";
5894
5895
 
@@ -65310,12 +65311,12 @@ function graticuleY(x06, x12, dx) {
65310
65311
  };
65311
65312
  }
65312
65313
  function graticule() {
65313
- var x12, x06, X13, X03, y12, y06, Y13, Y03, dx = 10, dy = dx, DX2 = 90, DY2 = 360, x4, y4, X7, Y4, precision = 2.5;
65314
+ var x12, x06, X13, X03, y12, y06, Y13, Y03, dx = 10, dy = dx, DX2 = 90, DY2 = 360, x4, y4, X8, Y4, precision = 2.5;
65314
65315
  function graticule2() {
65315
65316
  return { type: "MultiLineString", coordinates: lines() };
65316
65317
  }
65317
65318
  function lines() {
65318
- return range(ceil(X03 / DX2) * DX2, X13, DX2).map(X7).concat(range(ceil(Y03 / DY2) * DY2, Y13, DY2).map(Y4)).concat(range(ceil(x06 / dx) * dx, x12, dx).filter(function(x5) {
65319
+ return range(ceil(X03 / DX2) * DX2, X13, DX2).map(X8).concat(range(ceil(Y03 / DY2) * DY2, Y13, DY2).map(Y4)).concat(range(ceil(x06 / dx) * dx, x12, dx).filter(function(x5) {
65319
65320
  return abs4(x5 % DX2) > epsilon7;
65320
65321
  }).map(x4)).concat(range(ceil(y06 / dy) * dy, y12, dy).filter(function(y5) {
65321
65322
  return abs4(y5 % DY2) > epsilon7;
@@ -65330,9 +65331,9 @@ function graticule() {
65330
65331
  return {
65331
65332
  type: "Polygon",
65332
65333
  coordinates: [
65333
- X7(X03).concat(
65334
+ X8(X03).concat(
65334
65335
  Y4(Y13).slice(1),
65335
- X7(X13).reverse().slice(1),
65336
+ X8(X13).reverse().slice(1),
65336
65337
  Y4(Y03).reverse().slice(1)
65337
65338
  )
65338
65339
  ]
@@ -65377,7 +65378,7 @@ function graticule() {
65377
65378
  precision = +_2;
65378
65379
  x4 = graticuleX(y06, y12, 90);
65379
65380
  y4 = graticuleY(x06, x12, precision);
65380
- X7 = graticuleX(Y03, Y13, 90);
65381
+ X8 = graticuleX(Y03, Y13, 90);
65381
65382
  Y4 = graticuleY(X03, X13, precision);
65382
65383
  return graticule2;
65383
65384
  };
@@ -68060,9 +68061,9 @@ var gamma_default = (function sourceRandomGamma(source) {
68060
68061
  var beta_default = (function sourceRandomBeta(source) {
68061
68062
  var G3 = gamma_default.source(source);
68062
68063
  function randomBeta(alpha, beta) {
68063
- var X7 = G3(alpha), Y4 = G3(beta);
68064
+ var X8 = G3(alpha), Y4 = G3(beta);
68064
68065
  return function() {
68065
- var x4 = X7();
68066
+ var x4 = X8();
68066
68067
  return x4 === 0 ? 0 : x4 / (x4 + Y4());
68067
68068
  };
68068
68069
  }
@@ -108022,7 +108023,7 @@ var PersonalAssistantPage = () => {
108022
108023
  };
108023
108024
 
108024
108025
  // src/components/Chat/CustomMenuPage.tsx
108025
- import { useEffect as useEffect101, useRef as useRef52 } from "react";
108026
+ import { useEffect as useEffect101, useRef as useRef53 } from "react";
108026
108027
 
108027
108028
  // src/components/Chat/ChatSidebar.tsx
108028
108029
  import { useState as useState126, useMemo as useMemo54, useCallback as useCallback66 } from "react";
@@ -108033,17 +108034,64 @@ import {
108033
108034
  } from "lucide-react";
108034
108035
 
108035
108036
  // src/components/Chat/ThreadHistoryMenuContent.tsx
108036
- import React126, { useCallback as useCallback65, useState as useState125 } from "react";
108037
+ import React126, { useCallback as useCallback65, useRef as useRef52, useState as useState125 } from "react";
108037
108038
  import { createStyles as createStyles66 } from "antd-style";
108038
- import { MessageSquare as MessageSquare6, Trash2 as Trash217 } from "lucide-react";
108039
- import { message as message39, Modal as Modal42 } from "antd";
108040
- import { jsx as jsx195, jsxs as jsxs150 } from "react/jsx-runtime";
108039
+ import { Check as Check5, MessageSquare as MessageSquare6, Pencil as Pencil4, Trash2 as Trash217, X as X7 } from "lucide-react";
108040
+ import { Button as Button79, Input as Input34, message as message39, Modal as Modal42, Select as Select23 } from "antd";
108041
+ import {
108042
+ SortAscendingOutlined,
108043
+ SortDescendingOutlined
108044
+ } from "@ant-design/icons";
108045
+
108046
+ // src/components/Chat/threadSort.ts
108047
+ function filterThreads(threads, query) {
108048
+ const q2 = query.trim().toLowerCase();
108049
+ if (!q2) return threads;
108050
+ return threads.filter(
108051
+ (thread) => (thread.label || "").toLowerCase().includes(q2)
108052
+ );
108053
+ }
108054
+ var getTime = (thread, sortKey) => {
108055
+ const raw = sortKey === "created" ? thread.createdAt : thread.updatedAt;
108056
+ if (!raw) return null;
108057
+ const time2 = Date.parse(raw);
108058
+ return Number.isNaN(time2) ? null : time2;
108059
+ };
108060
+ function sortThreads(threads, sortKey = "updated", direction = "desc") {
108061
+ return [...threads].sort((a4, b10) => {
108062
+ if (sortKey === "name") {
108063
+ const na = a4.label || "";
108064
+ const nb = b10.label || "";
108065
+ return direction === "asc" ? na.localeCompare(nb) : nb.localeCompare(na);
108066
+ }
108067
+ const ta = getTime(a4, sortKey);
108068
+ const tb = getTime(b10, sortKey);
108069
+ if (ta === null && tb === null) return 0;
108070
+ if (ta === null) return 1;
108071
+ if (tb === null) return -1;
108072
+ return direction === "asc" ? ta - tb : tb - ta;
108073
+ });
108074
+ }
108075
+
108076
+ // src/components/Chat/ThreadHistoryMenuContent.tsx
108077
+ import { Fragment as Fragment53, jsx as jsx195, jsxs as jsxs150 } from "react/jsx-runtime";
108041
108078
  var useStyles50 = createStyles66(({ token, css }) => ({
108042
108079
  container: css`
108043
108080
  padding: 4px;
108044
108081
  font-size: 13px;
108045
108082
  background: transparent;
108046
108083
  `,
108084
+ toolbar: css`
108085
+ display: flex;
108086
+ flex-direction: column;
108087
+ gap: 6px;
108088
+ margin-bottom: 12px;
108089
+ `,
108090
+ toolbarRow: css`
108091
+ display: flex;
108092
+ align-items: center;
108093
+ gap: 6px;
108094
+ `,
108047
108095
  threadList: css`
108048
108096
  display: flex;
108049
108097
  flex-direction: column;
@@ -108102,7 +108150,7 @@ var useStyles50 = createStyles66(({ token, css }) => ({
108102
108150
  text-overflow: ellipsis;
108103
108151
  white-space: nowrap;
108104
108152
  `,
108105
- deleteBtn: css`
108153
+ actionBtn: css`
108106
108154
  display: flex;
108107
108155
  align-items: center;
108108
108156
  justify-content: center;
@@ -108121,11 +108169,41 @@ var useStyles50 = createStyles66(({ token, css }) => ({
108121
108169
  color: ${token.colorPrimary};
108122
108170
  }
108123
108171
 
108172
+ &:disabled {
108173
+ cursor: not-allowed;
108174
+ opacity: 0.4;
108175
+
108176
+ &:hover {
108177
+ background: transparent;
108178
+ color: ${token.colorTextSecondary};
108179
+ }
108180
+ }
108181
+
108124
108182
  svg {
108125
108183
  width: 16px;
108126
108184
  height: 16px;
108127
108185
  }
108128
108186
  `,
108187
+ actionBtnVisible: css`
108188
+ opacity: 1;
108189
+ `,
108190
+ renameInput: css`
108191
+ flex: 1;
108192
+ min-width: 0;
108193
+ font-size: 12px;
108194
+ font-weight: 500;
108195
+ color: ${token.colorText};
108196
+ padding: 2px 6px;
108197
+ border: 1px solid ${token.colorPrimary};
108198
+ border-radius: 4px;
108199
+ background: ${token.colorBgContainer};
108200
+ box-sizing: border-box;
108201
+
108202
+ &:focus {
108203
+ outline: none;
108204
+ box-shadow: 0 0 0 2px ${token.colorPrimaryBg};
108205
+ }
108206
+ `,
108129
108207
  emptyState: css`
108130
108208
  padding: 16px;
108131
108209
  text-align: center;
@@ -108146,10 +108224,19 @@ var ThreadHistoryMenuContent = () => {
108146
108224
  threadId,
108147
108225
  selectThread,
108148
108226
  deleteThread,
108227
+ updateThread,
108149
108228
  isLoading
108150
108229
  } = useConversationContext();
108151
108230
  const [threadToDelete, setThreadToDelete] = useState125(null);
108152
108231
  const [deleting, setDeleting] = useState125(false);
108232
+ const [editingId, setEditingId] = useState125(null);
108233
+ const [editValue, setEditValue] = useState125("");
108234
+ const [renaming, setRenaming] = useState125(false);
108235
+ const [searchQuery, setSearchQuery] = useState125("");
108236
+ const [sortKey, setSortKey] = useState125("updated");
108237
+ const [sortDirection, setSortDirection] = useState125("desc");
108238
+ const skipBlurRef = useRef52(false);
108239
+ const submittingRef = useRef52(false);
108153
108240
  const handleDeleteThread = useCallback65(
108154
108241
  (e8, threadIdToDelete) => {
108155
108242
  e8.stopPropagation();
@@ -108170,18 +108257,107 @@ var ThreadHistoryMenuContent = () => {
108170
108257
  setDeleting(false);
108171
108258
  }
108172
108259
  }, [threadToDelete, deleteThread]);
108173
- const sortedThreads = React126.useMemo(() => {
108174
- return [...threads].sort((a4, b10) => {
108175
- const dateA = a4.updatedAt ? new Date(a4.updatedAt).getTime() : 0;
108176
- const dateB = b10.updatedAt ? new Date(b10.updatedAt).getTime() : 0;
108177
- return dateB - dateA;
108178
- });
108179
- }, [threads]);
108180
- if (isLoading) {
108181
- return /* @__PURE__ */ jsx195("div", { className: styles.container, children: /* @__PURE__ */ jsx195("div", { className: styles.loading, children: "Loading conversations..." }) });
108182
- }
108260
+ const startRename = useCallback65((e8, thread) => {
108261
+ e8.stopPropagation();
108262
+ setEditingId(thread.id);
108263
+ setEditValue(thread.label);
108264
+ }, []);
108265
+ const finishRename = useCallback65(
108266
+ async (thread) => {
108267
+ if (submittingRef.current) return;
108268
+ const trimmed = editValue.trim();
108269
+ if (!trimmed || trimmed === thread.label) {
108270
+ setEditingId(null);
108271
+ return;
108272
+ }
108273
+ submittingRef.current = true;
108274
+ setRenaming(true);
108275
+ try {
108276
+ await updateThread({ ...thread, label: trimmed });
108277
+ message39.success("Conversation renamed");
108278
+ } catch (error) {
108279
+ message39.error("Failed to rename conversation");
108280
+ } finally {
108281
+ submittingRef.current = false;
108282
+ setRenaming(false);
108283
+ setEditingId(null);
108284
+ }
108285
+ },
108286
+ [editValue, updateThread]
108287
+ );
108288
+ const cancelRename = useCallback65(() => {
108289
+ skipBlurRef.current = true;
108290
+ setEditingId(null);
108291
+ }, []);
108292
+ const handleRenameKeyDown = useCallback65(
108293
+ (e8) => {
108294
+ if (e8.key === "Enter") {
108295
+ e8.preventDefault();
108296
+ e8.currentTarget.blur();
108297
+ } else if (e8.key === "Escape") {
108298
+ e8.preventDefault();
108299
+ cancelRename();
108300
+ }
108301
+ },
108302
+ [cancelRename]
108303
+ );
108304
+ const handleRenameBlur = useCallback65(
108305
+ (thread) => {
108306
+ if (skipBlurRef.current) {
108307
+ skipBlurRef.current = false;
108308
+ return;
108309
+ }
108310
+ finishRename(thread);
108311
+ },
108312
+ [finishRename]
108313
+ );
108314
+ const visibleThreads = React126.useMemo(
108315
+ () => sortThreads(
108316
+ filterThreads(threads, searchQuery),
108317
+ sortKey,
108318
+ sortDirection
108319
+ ),
108320
+ [threads, searchQuery, sortKey, sortDirection]
108321
+ );
108183
108322
  return /* @__PURE__ */ jsxs150("div", { className: styles.container, children: [
108184
- sortedThreads.length === 0 ? /* @__PURE__ */ jsx195("div", { className: styles.emptyState, children: "No conversations yet" }) : /* @__PURE__ */ jsx195("div", { className: styles.threadList, children: sortedThreads.map((thread) => /* @__PURE__ */ jsxs150(
108323
+ /* @__PURE__ */ jsxs150("div", { className: styles.toolbar, children: [
108324
+ /* @__PURE__ */ jsx195(
108325
+ Input34,
108326
+ {
108327
+ size: "small",
108328
+ placeholder: "Search conversations\u2026",
108329
+ allowClear: true,
108330
+ value: searchQuery,
108331
+ onChange: (e8) => setSearchQuery(e8.target.value)
108332
+ }
108333
+ ),
108334
+ /* @__PURE__ */ jsxs150("div", { className: styles.toolbarRow, children: [
108335
+ /* @__PURE__ */ jsx195(
108336
+ Select23,
108337
+ {
108338
+ size: "small",
108339
+ style: { flex: 1, minWidth: 0 },
108340
+ value: sortKey,
108341
+ onChange: (value) => setSortKey(value),
108342
+ options: [
108343
+ { value: "name", label: "Name" },
108344
+ { value: "updated", label: "Updated" },
108345
+ { value: "created", label: "Created" }
108346
+ ]
108347
+ }
108348
+ ),
108349
+ /* @__PURE__ */ jsx195(
108350
+ Button79,
108351
+ {
108352
+ size: "small",
108353
+ icon: sortDirection === "asc" ? /* @__PURE__ */ jsx195(SortAscendingOutlined, {}) : /* @__PURE__ */ jsx195(SortDescendingOutlined, {}),
108354
+ onClick: () => setSortDirection((d3) => d3 === "asc" ? "desc" : "asc"),
108355
+ title: sortDirection === "asc" ? "Ascending" : "Descending"
108356
+ }
108357
+ )
108358
+ ] })
108359
+ ] }),
108360
+ isLoading ? /* @__PURE__ */ jsx195("div", { className: styles.loading, children: "Loading conversations..." }) : visibleThreads.length === 0 ? /* @__PURE__ */ jsx195("div", { className: styles.emptyState, children: searchQuery.trim() ? `No conversations match "${searchQuery.trim()}"` : "No conversations yet" }) : /* @__PURE__ */ jsx195("div", { className: styles.threadList, children: visibleThreads.map((thread) => /* @__PURE__ */ jsxs150(
108185
108361
  "div",
108186
108362
  {
108187
108363
  className: `${styles.threadItem} ${thread.id === threadId ? "active" : ""}`,
@@ -108189,22 +108365,76 @@ var ThreadHistoryMenuContent = () => {
108189
108365
  title: thread.label,
108190
108366
  children: [
108191
108367
  /* @__PURE__ */ jsx195("div", { className: styles.threadIcon, children: /* @__PURE__ */ jsx195(MessageSquare6, { size: 14 }) }),
108192
- /* @__PURE__ */ jsx195(
108368
+ editingId === thread.id ? /* @__PURE__ */ jsx195(
108369
+ "input",
108370
+ {
108371
+ className: styles.renameInput,
108372
+ "aria-label": "Conversation name",
108373
+ value: editValue,
108374
+ autoFocus: true,
108375
+ disabled: renaming,
108376
+ onClick: (e8) => e8.stopPropagation(),
108377
+ onFocus: (e8) => e8.target.select(),
108378
+ onChange: (e8) => setEditValue(e8.target.value),
108379
+ onKeyDown: (e8) => handleRenameKeyDown(e8),
108380
+ onBlur: () => handleRenameBlur(thread)
108381
+ }
108382
+ ) : /* @__PURE__ */ jsx195(
108193
108383
  "div",
108194
108384
  {
108195
108385
  className: thread.id === threadId ? styles.threadNameActive : styles.threadName,
108196
108386
  children: thread.label
108197
108387
  }
108198
108388
  ),
108199
- /* @__PURE__ */ jsx195(
108200
- "button",
108201
- {
108202
- className: styles.deleteBtn,
108203
- onClick: (e8) => handleDeleteThread(e8, thread.id),
108204
- title: "Delete conversation",
108205
- children: /* @__PURE__ */ jsx195(Trash217, { size: 12 })
108206
- }
108207
- )
108389
+ editingId === thread.id ? /* @__PURE__ */ jsxs150(Fragment53, { children: [
108390
+ /* @__PURE__ */ jsx195(
108391
+ "button",
108392
+ {
108393
+ className: `${styles.actionBtn} ${styles.actionBtnVisible}`,
108394
+ title: "Save name",
108395
+ disabled: renaming,
108396
+ onMouseDown: (e8) => e8.preventDefault(),
108397
+ onClick: (e8) => {
108398
+ e8.stopPropagation();
108399
+ finishRename(thread);
108400
+ },
108401
+ children: /* @__PURE__ */ jsx195(Check5, { size: 12 })
108402
+ }
108403
+ ),
108404
+ /* @__PURE__ */ jsx195(
108405
+ "button",
108406
+ {
108407
+ className: `${styles.actionBtn} ${styles.actionBtnVisible}`,
108408
+ title: "Cancel rename",
108409
+ disabled: renaming,
108410
+ onMouseDown: (e8) => e8.preventDefault(),
108411
+ onClick: (e8) => {
108412
+ e8.stopPropagation();
108413
+ cancelRename();
108414
+ },
108415
+ children: /* @__PURE__ */ jsx195(X7, { size: 12 })
108416
+ }
108417
+ )
108418
+ ] }) : /* @__PURE__ */ jsxs150(Fragment53, { children: [
108419
+ /* @__PURE__ */ jsx195(
108420
+ "button",
108421
+ {
108422
+ className: styles.actionBtn,
108423
+ onClick: (e8) => startRename(e8, thread),
108424
+ title: "Rename conversation",
108425
+ children: /* @__PURE__ */ jsx195(Pencil4, { size: 12 })
108426
+ }
108427
+ ),
108428
+ /* @__PURE__ */ jsx195(
108429
+ "button",
108430
+ {
108431
+ className: styles.actionBtn,
108432
+ onClick: (e8) => handleDeleteThread(e8, thread.id),
108433
+ title: "Delete conversation",
108434
+ children: /* @__PURE__ */ jsx195(Trash217, { size: 12 })
108435
+ }
108436
+ )
108437
+ ] })
108208
108438
  ]
108209
108439
  },
108210
108440
  thread.id
@@ -108226,7 +108456,7 @@ var ThreadHistoryMenuContent = () => {
108226
108456
  };
108227
108457
 
108228
108458
  // src/components/Chat/ChatSidebar.tsx
108229
- import { Fragment as Fragment53, jsx as jsx196, jsxs as jsxs151 } from "react/jsx-runtime";
108459
+ import { Fragment as Fragment54, jsx as jsx196, jsxs as jsxs151 } from "react/jsx-runtime";
108230
108460
  var DEFAULT_MENU_ITEMS = [
108231
108461
  {
108232
108462
  id: "new-analysis",
@@ -108310,7 +108540,7 @@ var ChatSidebar = ({
108310
108540
  onLogout: logout
108311
108541
  }
108312
108542
  );
108313
- return /* @__PURE__ */ jsxs151(Fragment53, { children: [
108543
+ return /* @__PURE__ */ jsxs151(Fragment54, { children: [
108314
108544
  /* @__PURE__ */ jsx196(
108315
108545
  Menu,
108316
108546
  {
@@ -108450,8 +108680,8 @@ var EmbeddedChatSidebar = ({
108450
108680
  }) => {
108451
108681
  const { menuCollapsed, setMenuCollapsed } = useChatUIContext();
108452
108682
  const { sidebarDefaultExpanded } = useLatticeChatShellContext().config;
108453
- const wasMobileRef = useRef52(isMobile);
108454
- const desktopCollapsedRef = useRef52(void 0);
108683
+ const wasMobileRef = useRef53(isMobile);
108684
+ const desktopCollapsedRef = useRef53(void 0);
108455
108685
  useEffect101(() => {
108456
108686
  if (wasMobileRef.current === isMobile) {
108457
108687
  return;
@@ -108563,7 +108793,7 @@ var CustomMenuPage = ({ component_key, data }) => {
108563
108793
 
108564
108794
  // src/components/Chat/SharesPage.tsx
108565
108795
  import { useEffect as useEffect102, useState as useState127 } from "react";
108566
- import { Table as Table4, Button as Button79, Dropdown as Dropdown6, message as message40, Modal as Modal44, Tag as Tag44, Typography as Typography87 } from "antd";
108796
+ import { Table as Table4, Button as Button80, Dropdown as Dropdown6, message as message40, Modal as Modal44, Tag as Tag44, Typography as Typography87 } from "antd";
108567
108797
  import { CopyOutlined as CopyOutlined5, StopOutlined as StopOutlined3, MoreOutlined as MoreOutlined3 } from "@ant-design/icons";
108568
108798
  import { jsx as jsx198, jsxs as jsxs153 } from "react/jsx-runtime";
108569
108799
  var { Text: Text77 } = Typography87;
@@ -108671,7 +108901,7 @@ ${pwdText}`.trim());
108671
108901
  ]
108672
108902
  ]
108673
108903
  },
108674
- children: /* @__PURE__ */ jsx198(Button79, { type: "text", size: "small", icon: /* @__PURE__ */ jsx198(MoreOutlined3, {}) })
108904
+ children: /* @__PURE__ */ jsx198(Button80, { type: "text", size: "small", icon: /* @__PURE__ */ jsx198(MoreOutlined3, {}) })
108675
108905
  }
108676
108906
  )
108677
108907
  }
@@ -108706,12 +108936,12 @@ ${pwdText}`.trim());
108706
108936
 
108707
108937
  // src/components/Migration/MigrationPage.tsx
108708
108938
  import { useState as useState130 } from "react";
108709
- import { Button as Button82, Space as Space54, Typography as Typography90, theme as theme17 } from "antd";
108939
+ import { Button as Button83, Space as Space54, Typography as Typography90, theme as theme17 } from "antd";
108710
108940
  import { Download, Upload as Upload4, ArrowLeft as ArrowLeft5 } from "lucide-react";
108711
108941
 
108712
108942
  // src/components/Migration/ExportStep.tsx
108713
108943
  import { useEffect as useEffect103, useState as useState128, useCallback as useCallback67 } from "react";
108714
- import { Checkbox as Checkbox11, Button as Button80, Space as Space52, Card as Card27, Alert as Alert14, Tag as Tag45, Steps as Steps4, Typography as Typography88, theme as theme15 } from "antd";
108944
+ import { Checkbox as Checkbox11, Button as Button81, Space as Space52, Card as Card27, Alert as Alert14, Tag as Tag45, Steps as Steps4, Typography as Typography88, theme as theme15 } from "antd";
108715
108945
  import {
108716
108946
  Bot as Bot11,
108717
108947
  Zap as Zap2,
@@ -108832,7 +109062,7 @@ var ExportStep = ({ onExported, exportJobId }) => {
108832
109062
  /* @__PURE__ */ jsx199(Text78, { type: "secondary", style: { display: "block", marginBottom: 24 }, children: "Your configuration has been exported to a tar.gz archive." }),
108833
109063
  error && /* @__PURE__ */ jsx199(Alert14, { type: "error", message: error, style: { marginBottom: 16 }, closable: true }),
108834
109064
  /* @__PURE__ */ jsx199(
108835
- Button80,
109065
+ Button81,
108836
109066
  {
108837
109067
  type: "primary",
108838
109068
  size: "large",
@@ -108869,7 +109099,7 @@ var ExportStep = ({ onExported, exportJobId }) => {
108869
109099
  "CASCADE parents: ",
108870
109100
  needsConfirm.cascadeAdditions.map((d3) => /* @__PURE__ */ jsx199(Tag45, { children: d3 }, d3))
108871
109101
  ] }),
108872
- /* @__PURE__ */ jsx199(Button80, { type: "primary", size: "small", onClick: handleConfirm, loading: exportLoading, children: "Include and export" })
109102
+ /* @__PURE__ */ jsx199(Button81, { type: "primary", size: "small", onClick: handleConfirm, loading: exportLoading, children: "Include and export" })
108873
109103
  ] }),
108874
109104
  style: { marginBottom: 16 }
108875
109105
  }
@@ -108884,7 +109114,7 @@ var ExportStep = ({ onExported, exportJobId }) => {
108884
109114
  borderRadius: token.borderRadiusLG,
108885
109115
  border: `1px solid ${token.colorBorderSecondary}`
108886
109116
  }, children: [
108887
- /* @__PURE__ */ jsx199(Button80, { size: "small", icon: /* @__PURE__ */ jsx199(ArrowLeft4, { size: 14 }), onClick: () => setStep("types"), children: "Back" }),
109117
+ /* @__PURE__ */ jsx199(Button81, { size: "small", icon: /* @__PURE__ */ jsx199(ArrowLeft4, { size: 14 }), onClick: () => setStep("types"), children: "Back" }),
108888
109118
  /* @__PURE__ */ jsxs154(Space52, { children: [
108889
109119
  /* @__PURE__ */ jsxs154(Text78, { type: "secondary", children: [
108890
109120
  totalSelected,
@@ -108892,7 +109122,7 @@ var ExportStep = ({ onExported, exportJobId }) => {
108892
109122
  totalEntities,
108893
109123
  " selected"
108894
109124
  ] }),
108895
- /* @__PURE__ */ jsxs154(Button80, { type: "primary", onClick: handleExportWithIds, loading: exportLoading, disabled: totalSelected === 0, children: [
109125
+ /* @__PURE__ */ jsxs154(Button81, { type: "primary", onClick: handleExportWithIds, loading: exportLoading, disabled: totalSelected === 0, children: [
108896
109126
  "Export ",
108897
109127
  totalSelected,
108898
109128
  " entities"
@@ -108925,7 +109155,7 @@ var ExportStep = ({ onExported, exportJobId }) => {
108925
109155
  ] }),
108926
109156
  /* @__PURE__ */ jsxs154(Space52, { size: "small", children: [
108927
109157
  /* @__PURE__ */ jsx199(
108928
- Button80,
109158
+ Button81,
108929
109159
  {
108930
109160
  size: "small",
108931
109161
  type: allSelected ? "default" : "primary",
@@ -108934,7 +109164,7 @@ var ExportStep = ({ onExported, exportJobId }) => {
108934
109164
  children: "Select all"
108935
109165
  }
108936
109166
  ),
108937
- /* @__PURE__ */ jsx199(Button80, { size: "small", onClick: () => handleDeselectAllInType(type2), children: "Clear" })
109167
+ /* @__PURE__ */ jsx199(Button81, { size: "small", onClick: () => handleDeselectAllInType(type2), children: "Clear" })
108938
109168
  ] })
108939
109169
  ] }),
108940
109170
  /* @__PURE__ */ jsx199("div", { style: { padding: 16 }, children: /* @__PURE__ */ jsx199(
@@ -109027,8 +109257,8 @@ var ExportStep = ({ onExported, exportJobId }) => {
109027
109257
  ),
109028
109258
  error && /* @__PURE__ */ jsx199(Alert14, { type: "error", message: error, style: { marginBottom: 16 }, closable: true }),
109029
109259
  /* @__PURE__ */ jsxs154(Space52, { style: { marginBottom: 16 }, children: [
109030
- /* @__PURE__ */ jsx199(Button80, { size: "small", onClick: selectAll, children: "Select all" }),
109031
- /* @__PURE__ */ jsx199(Button80, { size: "small", onClick: deselectAll, children: "Clear" })
109260
+ /* @__PURE__ */ jsx199(Button81, { size: "small", onClick: selectAll, children: "Select all" }),
109261
+ /* @__PURE__ */ jsx199(Button81, { size: "small", onClick: deselectAll, children: "Clear" })
109032
109262
  ] }),
109033
109263
  coreTypes.length > 0 && /* @__PURE__ */ jsxs154("div", { style: { marginBottom: 20 }, children: [
109034
109264
  /* @__PURE__ */ jsx199(Text78, { type: "secondary", style: { display: "block", marginBottom: 10 }, children: "Core" }),
@@ -109039,7 +109269,7 @@ var ExportStep = ({ onExported, exportJobId }) => {
109039
109269
  renderTypeGrid(pluginTypes)
109040
109270
  ] }),
109041
109271
  /* @__PURE__ */ jsxs154(
109042
- Button80,
109272
+ Button81,
109043
109273
  {
109044
109274
  type: "primary",
109045
109275
  size: "large",
@@ -109059,13 +109289,13 @@ var ExportStep = ({ onExported, exportJobId }) => {
109059
109289
 
109060
109290
  // src/components/Migration/ImportStep.tsx
109061
109291
  import { useState as useState129 } from "react";
109062
- import { Upload as AntUpload, Button as Button81, Alert as Alert15, Progress as Progress5, Typography as Typography89, theme as theme16, Space as Space53, Steps as Steps5 } from "antd";
109292
+ import { Upload as AntUpload, Button as Button82, Alert as Alert15, Progress as Progress5, Typography as Typography89, theme as theme16, Space as Space53, Steps as Steps5 } from "antd";
109063
109293
  import { Upload as Upload3, CheckCircle as CheckCircle6, XCircle as XCircle5, MinusCircle } from "lucide-react";
109064
109294
 
109065
109295
  // src/components/Migration/ConflictResolver.tsx
109066
109296
  import React131 from "react";
109067
- import { Table as Table5, Select as Select23, Tag as Tag46, Input as Input34 } from "antd";
109068
- import { Fragment as Fragment54, jsx as jsx200, jsxs as jsxs155 } from "react/jsx-runtime";
109297
+ import { Table as Table5, Select as Select24, Tag as Tag46, Input as Input35 } from "antd";
109298
+ import { Fragment as Fragment55, jsx as jsx200, jsxs as jsxs155 } from "react/jsx-runtime";
109069
109299
  var ConflictResolver = ({
109070
109300
  conflicts,
109071
109301
  insertions,
@@ -109096,22 +109326,22 @@ var ConflictResolver = ({
109096
109326
  {
109097
109327
  title: "Action",
109098
109328
  width: 200,
109099
- render: (_2, r5) => /* @__PURE__ */ jsxs155(Fragment54, { children: [
109329
+ render: (_2, r5) => /* @__PURE__ */ jsxs155(Fragment55, { children: [
109100
109330
  /* @__PURE__ */ jsxs155(
109101
- Select23,
109331
+ Select24,
109102
109332
  {
109103
109333
  value: resolutions[r5._exportId]?.action ?? "skip",
109104
109334
  style: { width: 140 },
109105
109335
  onChange: (val) => handleResolution(r5._exportId, val),
109106
109336
  children: [
109107
- /* @__PURE__ */ jsx200(Select23.Option, { value: "skip", children: "Skip" }),
109108
- /* @__PURE__ */ jsx200(Select23.Option, { value: "overwrite", children: "Overwrite" }),
109109
- /* @__PURE__ */ jsx200(Select23.Option, { value: "rename", children: "Rename" })
109337
+ /* @__PURE__ */ jsx200(Select24.Option, { value: "skip", children: "Skip" }),
109338
+ /* @__PURE__ */ jsx200(Select24.Option, { value: "overwrite", children: "Overwrite" }),
109339
+ /* @__PURE__ */ jsx200(Select24.Option, { value: "rename", children: "Rename" })
109110
109340
  ]
109111
109341
  }
109112
109342
  ),
109113
109343
  resolutions[r5._exportId]?.action === "rename" && /* @__PURE__ */ jsx200(
109114
- Input34,
109344
+ Input35,
109115
109345
  {
109116
109346
  size: "small",
109117
109347
  placeholder: "New ID",
@@ -109161,7 +109391,7 @@ var ConflictResolver = ({
109161
109391
  };
109162
109392
 
109163
109393
  // src/components/Migration/ImportStep.tsx
109164
- import { Fragment as Fragment55, jsx as jsx201, jsxs as jsxs156 } from "react/jsx-runtime";
109394
+ import { Fragment as Fragment56, jsx as jsx201, jsxs as jsxs156 } from "react/jsx-runtime";
109165
109395
  var { Dragger: Dragger2 } = AntUpload;
109166
109396
  var { Text: Text79, Title: Title17 } = Typography89;
109167
109397
  var ImportStep = ({ onComplete }) => {
@@ -109227,7 +109457,7 @@ var ImportStep = ({ onComplete }) => {
109227
109457
  " failed"
109228
109458
  ] })
109229
109459
  ] }),
109230
- /* @__PURE__ */ jsx201("div", { style: { marginTop: 24 }, children: /* @__PURE__ */ jsx201(Button81, { type: "primary", onClick: onComplete, children: "Done" }) })
109460
+ /* @__PURE__ */ jsx201("div", { style: { marginTop: 24 }, children: /* @__PURE__ */ jsx201(Button82, { type: "primary", onClick: onComplete, children: "Done" }) })
109231
109461
  ] })
109232
109462
  ] });
109233
109463
  }
@@ -109276,7 +109506,7 @@ var ImportStep = ({ onComplete }) => {
109276
109506
  style: { marginBottom: 16 }
109277
109507
  }
109278
109508
  ),
109279
- previewResult && /* @__PURE__ */ jsxs156(Fragment55, { children: [
109509
+ previewResult && /* @__PURE__ */ jsxs156(Fragment56, { children: [
109280
109510
  /* @__PURE__ */ jsx201("div", { style: {
109281
109511
  marginBottom: 16,
109282
109512
  padding: "12px 16px",
@@ -109299,7 +109529,7 @@ var ImportStep = ({ onComplete }) => {
109299
109529
  }
109300
109530
  ),
109301
109531
  /* @__PURE__ */ jsx201(
109302
- Button81,
109532
+ Button82,
109303
109533
  {
109304
109534
  type: "primary",
109305
109535
  size: "large",
@@ -109401,7 +109631,7 @@ var MigrationPage = () => {
109401
109631
  }
109402
109632
  return /* @__PURE__ */ jsxs157("div", { style: { padding: "0 0 24px" }, children: [
109403
109633
  /* @__PURE__ */ jsxs157("div", { style: { display: "flex", alignItems: "center", gap: 12, marginBottom: 24 }, children: [
109404
- /* @__PURE__ */ jsx202(Button82, { type: "text", icon: /* @__PURE__ */ jsx202(ArrowLeft5, { size: 18 }), onClick: () => setMode("choose"), children: "Back" }),
109634
+ /* @__PURE__ */ jsx202(Button83, { type: "text", icon: /* @__PURE__ */ jsx202(ArrowLeft5, { size: 18 }), onClick: () => setMode("choose"), children: "Back" }),
109405
109635
  /* @__PURE__ */ jsx202(Title18, { level: 4, style: { margin: 0 }, children: mode2 === "export" ? "Export Configuration" : "Import Configuration" })
109406
109636
  ] }),
109407
109637
  mode2 === "export" && /* @__PURE__ */ jsx202(
@@ -109423,8 +109653,8 @@ import {
109423
109653
  } from "@ant-design/icons";
109424
109654
  import { Dropdown as Dropdown7, Tooltip as Tooltip32 } from "antd";
109425
109655
  import { createStyles as createStyles67 } from "antd-style";
109426
- import { useCallback as useCallback68, useEffect as useEffect104, useMemo as useMemo55, useRef as useRef53, useState as useState131 } from "react";
109427
- import { Fragment as Fragment56, jsx as jsx203, jsxs as jsxs158 } from "react/jsx-runtime";
109656
+ import { useCallback as useCallback68, useEffect as useEffect104, useMemo as useMemo55, useRef as useRef54, useState as useState131 } from "react";
109657
+ import { Fragment as Fragment57, jsx as jsx203, jsxs as jsxs158 } from "react/jsx-runtime";
109428
109658
  var useStyle17 = createStyles67(({ token, css }) => {
109429
109659
  return {
109430
109660
  container: css`
@@ -109695,7 +109925,7 @@ var useStyle17 = createStyles67(({ token, css }) => {
109695
109925
  });
109696
109926
  var EmptySideAppView = ({ component_key, data }) => {
109697
109927
  if (data?.component) {
109698
- return /* @__PURE__ */ jsx203(Fragment56, { children: data.component });
109928
+ return /* @__PURE__ */ jsx203(Fragment57, { children: data.component });
109699
109929
  }
109700
109930
  return /* @__PURE__ */ jsxs158("div", { children: [
109701
109931
  /* @__PURE__ */ jsx203("p", { children: "Component view not found" }),
@@ -109726,7 +109956,7 @@ var SideAppViewBrowser = ({ region = "side", compact = true, showCloseButton = t
109726
109956
  const [expanded, setExpanded] = useState131(false);
109727
109957
  const [isLeaving, setIsLeaving] = useState131(false);
109728
109958
  const [autoPeek, setAutoPeek] = useState131(false);
109729
- const collapseTimerRef = useRef53(null);
109959
+ const collapseTimerRef = useRef54(null);
109730
109960
  const handleMouseEnter = useCallback68(() => {
109731
109961
  if (collapseTimerRef.current) {
109732
109962
  clearTimeout(collapseTimerRef.current);
@@ -110123,8 +110353,8 @@ var WorkspaceResourceManager = ({
110123
110353
  const client = useClient("__GLOBAL__");
110124
110354
  const { logoUrl, tenantName } = useTenantBranding();
110125
110355
  const [tenantSettingsOpen, setTenantSettingsOpen] = useState132(false);
110126
- const hasOpenedDefault = useRef54(false);
110127
- const hasRegistered = useRef54(false);
110356
+ const hasOpenedDefault = useRef55(false);
110357
+ const hasRegistered = useRef55(false);
110128
110358
  useEffect105(() => {
110129
110359
  if (!hasRegistered.current) {
110130
110360
  hasRegistered.current = true;
@@ -110487,7 +110717,7 @@ var WorkspaceResourceUIContext = ({
110487
110717
  };
110488
110718
 
110489
110719
  // src/components/Chat/PinToMenuButton.tsx
110490
- import { Fragment as Fragment57, jsx as jsx205, jsxs as jsxs160 } from "react/jsx-runtime";
110720
+ import { Fragment as Fragment58, jsx as jsx205, jsxs as jsxs160 } from "react/jsx-runtime";
110491
110721
  function buildPinContentConfig(params) {
110492
110722
  const { contentType, assistantId, contentConfig, workspaceId, projectId } = params;
110493
110723
  if (contentType === "agent") {
@@ -110707,9 +110937,9 @@ var PinToMenuButton = ({
110707
110937
  setOpen(true);
110708
110938
  }
110709
110939
  };
110710
- return /* @__PURE__ */ jsxs160(Fragment57, { children: [
110940
+ return /* @__PURE__ */ jsxs160(Fragment58, { children: [
110711
110941
  /* @__PURE__ */ jsx205(Tooltip33, { title: isPinned ? "Unpin from Menu" : "Pin to Menu", children: label ? /* @__PURE__ */ jsx205(
110712
- Button84,
110942
+ Button85,
110713
110943
  {
110714
110944
  type: "text",
110715
110945
  size,
@@ -110720,7 +110950,7 @@ var PinToMenuButton = ({
110720
110950
  children: label
110721
110951
  }
110722
110952
  ) : /* @__PURE__ */ jsx205(
110723
- Button84,
110953
+ Button85,
110724
110954
  {
110725
110955
  type: "text",
110726
110956
  size,
@@ -110741,7 +110971,7 @@ var PinToMenuButton = ({
110741
110971
  okText: "Pin",
110742
110972
  children: /* @__PURE__ */ jsxs160("div", { style: MODAL_BODY_STYLE, children: [
110743
110973
  /* @__PURE__ */ jsx205(
110744
- Input35,
110974
+ Input36,
110745
110975
  {
110746
110976
  placeholder: "Menu name (required)",
110747
110977
  value: name,
@@ -110768,16 +110998,85 @@ var PinToMenuButton = ({
110768
110998
  import { createStyles as createStyles69 } from "antd-style";
110769
110999
 
110770
111000
  // src/components/Chat/ToolPanelFiles.tsx
110771
- import { useCallback as useCallback72, useEffect as useEffect108, useMemo as useMemo57, useState as useState135 } from "react";
111001
+ import { useCallback as useCallback72, useEffect as useEffect108, useMemo as useMemo58, useState as useState135 } from "react";
110772
111002
  import { message as message44 } from "antd";
110773
111003
 
110774
111004
  // src/components/Chat/FileDirectoryPanel.tsx
110775
- import React137, { useState as useState134, useCallback as useCallback71, useEffect as useEffect107 } from "react";
110776
- import { Spin as Spin34, Dropdown as Dropdown8, Button as Button85, Input as Input36, Modal as Modal47, AutoComplete as AutoComplete2, message as message43 } from "antd";
111005
+ import React137, { useState as useState134, useCallback as useCallback71, useEffect as useEffect107, useMemo as useMemo57 } from "react";
111006
+ import { Spin as Spin34, Dropdown as Dropdown8, Button as Button86, Input as Input37, Modal as Modal47, AutoComplete as AutoComplete2, message as message43, Select as Select25 } from "antd";
110777
111007
  import { ChevronRight as ChevronRight8, FolderOpen as FolderOpen4, Upload as Upload5, Pin as Pin2 } from "lucide-react";
110778
111008
  import { createStyles as createStyles68 } from "antd-style";
110779
- import { MoreOutlined as MoreOutlined5, LinkOutlined as LinkOutlined5, DownloadOutlined as DownloadOutlined4, EyeOutlined } from "@ant-design/icons";
110780
- import { Fragment as Fragment58, jsx as jsx206, jsxs as jsxs161 } from "react/jsx-runtime";
111009
+
111010
+ // src/components/Chat/fileItemSort.ts
111011
+ var getFileName = (path2) => {
111012
+ if (!path2) return "";
111013
+ const parts = path2.split("/").filter(Boolean);
111014
+ return parts[parts.length - 1] ?? "";
111015
+ };
111016
+ var getTime2 = (item, sortKey) => {
111017
+ if (sortKey === "name") return null;
111018
+ const raw = sortKey === "created" ? item.created_at : item.modified_at;
111019
+ if (!raw) return null;
111020
+ const time2 = Date.parse(raw);
111021
+ return Number.isNaN(time2) ? null : time2;
111022
+ };
111023
+ function sortFileItems(items3, sortKey = "name", direction = "asc") {
111024
+ return [...items3].sort((a4, b10) => {
111025
+ if (!!a4.is_dir !== !!b10.is_dir) {
111026
+ return a4.is_dir ? -1 : 1;
111027
+ }
111028
+ if (sortKey === "name") {
111029
+ const na = getFileName(a4.path);
111030
+ const nb = getFileName(b10.path);
111031
+ return direction === "asc" ? na.localeCompare(nb) : nb.localeCompare(na);
111032
+ }
111033
+ const ta = getTime2(a4, sortKey);
111034
+ const tb = getTime2(b10, sortKey);
111035
+ if (ta === null && tb === null) return 0;
111036
+ if (ta === null) return 1;
111037
+ if (tb === null) return -1;
111038
+ return direction === "asc" ? ta - tb : tb - ta;
111039
+ });
111040
+ }
111041
+ function filterFileItems(files, query) {
111042
+ const q2 = query.trim().toLowerCase();
111043
+ if (!q2) return files;
111044
+ return files.filter((file) => {
111045
+ const path2 = (file.path || "").toLowerCase();
111046
+ const name = getFileName(file.path).toLowerCase();
111047
+ return path2.includes(q2) || name.includes(q2);
111048
+ });
111049
+ }
111050
+ function buildFileTree(files) {
111051
+ const root4 = [];
111052
+ files.forEach((file) => {
111053
+ const parts = (file.path || "").split("/").filter(Boolean);
111054
+ if (parts.length === 0) return;
111055
+ let current = root4;
111056
+ parts.forEach((part, index3) => {
111057
+ const isFile = index3 === parts.length - 1;
111058
+ const path2 = "/" + parts.slice(0, index3 + 1).join("/");
111059
+ let node = current.find((n4) => n4.path === path2);
111060
+ if (!node) {
111061
+ node = isFile ? { ...file, path: path2, name: part } : { path: path2, name: part, is_dir: true, children: [] };
111062
+ current.push(node);
111063
+ }
111064
+ if (!isFile) {
111065
+ current = node.children ?? (node.children = []);
111066
+ }
111067
+ });
111068
+ });
111069
+ return root4;
111070
+ }
111071
+ function sortFileTree(nodes, sortKey = "name", direction = "asc") {
111072
+ return sortFileItems(nodes, sortKey, direction).map(
111073
+ (node) => node.children ? { ...node, children: sortFileTree(node.children, sortKey, direction) } : node
111074
+ );
111075
+ }
111076
+
111077
+ // src/components/Chat/FileDirectoryPanel.tsx
111078
+ import { MoreOutlined as MoreOutlined5, LinkOutlined as LinkOutlined5, DownloadOutlined as DownloadOutlined4, EyeOutlined, SortAscendingOutlined as SortAscendingOutlined2, SortDescendingOutlined as SortDescendingOutlined2 } from "@ant-design/icons";
111079
+ import { Fragment as Fragment59, jsx as jsx206, jsxs as jsxs161 } from "react/jsx-runtime";
110781
111080
  var useStyles51 = createStyles68(({ token, css }) => ({
110782
111081
  container: css`
110783
111082
  height: 100%;
@@ -110807,6 +111106,17 @@ var useStyles51 = createStyles68(({ token, css }) => ({
110807
111106
  color: ${token.colorTextSecondary};
110808
111107
  }
110809
111108
  `,
111109
+ toolbar: css`
111110
+ display: flex;
111111
+ flex-direction: column;
111112
+ gap: 6px;
111113
+ margin-bottom: 12px;
111114
+ `,
111115
+ toolbarRow: css`
111116
+ display: flex;
111117
+ align-items: center;
111118
+ gap: 6px;
111119
+ `,
110810
111120
  section: css`
110811
111121
  margin-bottom: 12px;
110812
111122
  `,
@@ -110985,12 +111295,12 @@ var formatDate8 = (dateStr) => {
110985
111295
  const date2 = new Date(dateStr);
110986
111296
  return date2.toLocaleDateString("en-US", { month: "short", day: "numeric" });
110987
111297
  };
110988
- var getFileName = (path2) => {
111298
+ var getFileName2 = (path2) => {
110989
111299
  if (!path2) return "";
110990
111300
  const parts = path2.split(/[/\\]/);
110991
111301
  return parts[parts.length - 1];
110992
111302
  };
110993
- var getEntryName = (entry) => getFileName(entry.name || entry.path);
111303
+ var getEntryName = (entry) => getFileName2(entry.name || entry.path);
110994
111304
  var MODAL_BODY_STYLE2 = {
110995
111305
  display: "flex",
110996
111306
  flexDirection: "column",
@@ -111013,7 +111323,7 @@ var FileDirectoryPanel = ({
111013
111323
  }) => {
111014
111324
  const { styles } = useStyles51();
111015
111325
  const { currentAssistant } = useAssistantContext();
111016
- const { getFileDownloadUrl, getDirectFileUrl } = useWorkspaceContext();
111326
+ const { getFileDownloadUrl, getDirectFileUrl, listPathByFolder } = useWorkspaceContext();
111017
111327
  const { openSideApp } = useChatUIContext();
111018
111328
  const { currentTenant } = useAuth();
111019
111329
  const tenantId = currentTenant?.id || "";
@@ -111029,6 +111339,11 @@ var FileDirectoryPanel = ({
111029
111339
  const [pinName, setPinName] = useState134("");
111030
111340
  const [pinGroup, setPinGroup] = useState134("");
111031
111341
  const [pinLoading, setPinLoading] = useState134(false);
111342
+ const [searchQuery, setSearchQuery] = useState134("");
111343
+ const [sortKey, setSortKey] = useState134("name");
111344
+ const [sortDirection, setSortDirection] = useState134("asc");
111345
+ const [searchFiles, setSearchFiles] = useState134(null);
111346
+ const [searchLoading, setSearchLoading] = useState134(false);
111032
111347
  useEffect107(() => {
111033
111348
  if (pinModalPath) {
111034
111349
  fetchExistingGroups(get4).then((apiGroups) => {
@@ -111036,6 +111351,34 @@ var FileDirectoryPanel = ({
111036
111351
  });
111037
111352
  }
111038
111353
  }, [pinModalPath]);
111354
+ useEffect107(() => {
111355
+ const q2 = searchQuery.trim();
111356
+ if (!q2) {
111357
+ setSearchFiles(null);
111358
+ setSearchLoading(false);
111359
+ return;
111360
+ }
111361
+ let cancelled = false;
111362
+ setSearchLoading(true);
111363
+ collectAllWorkspaceFiles(
111364
+ listPathByFolder,
111365
+ resourceFolders.map((folder) => folder.name),
111366
+ currentAssistant?.id
111367
+ ).then((all) => {
111368
+ if (!cancelled) setSearchFiles(filterFileItems(all, q2));
111369
+ }).catch(() => {
111370
+ if (!cancelled) setSearchFiles([]);
111371
+ }).finally(() => {
111372
+ if (!cancelled) setSearchLoading(false);
111373
+ });
111374
+ return () => {
111375
+ cancelled = true;
111376
+ };
111377
+ }, [searchQuery, listPathByFolder, resourceFolders, currentAssistant?.id]);
111378
+ const searchTree = useMemo57(() => {
111379
+ if (!searchFiles) return null;
111380
+ return sortFileTree(buildFileTree(searchFiles), sortKey, sortDirection);
111381
+ }, [searchFiles, sortKey, sortDirection]);
111039
111382
  const handleDropdownOpen = useCallback71(
111040
111383
  (filePath, open) => {
111041
111384
  if (!open || !enableCustomMenu) return;
@@ -111218,11 +111561,11 @@ var FileDirectoryPanel = ({
111218
111561
  }
111219
111562
  ]
111220
111563
  },
111221
- children: /* @__PURE__ */ jsx206(Button85, { type: "text", size: "small", icon: /* @__PURE__ */ jsx206(MoreOutlined5, {}) })
111564
+ children: /* @__PURE__ */ jsx206(Button86, { type: "text", size: "small", icon: /* @__PURE__ */ jsx206(MoreOutlined5, {}) })
111222
111565
  }
111223
111566
  )
111224
111567
  ] }),
111225
- isExpanded ? isLoading ? /* @__PURE__ */ jsx206("div", { className: styles.loading, children: /* @__PURE__ */ jsx206(Spin34, { size: "small" }) }) : children2.length > 0 ? children2.map((child) => renderEntry(child, depth + 1)) : /* @__PURE__ */ jsx206("div", { className: styles.emptyState, children: "No files in this folder" }) : null
111568
+ isExpanded ? isLoading ? /* @__PURE__ */ jsx206("div", { className: styles.loading, children: /* @__PURE__ */ jsx206(Spin34, { size: "small" }) }) : children2.length > 0 ? sortFileItems(children2, sortKey, sortDirection).map((child) => renderEntry(child, depth + 1)) : /* @__PURE__ */ jsx206("div", { className: styles.emptyState, children: "No files in this folder" }) : null
111226
111569
  ] }, entry.path);
111227
111570
  }
111228
111571
  return /* @__PURE__ */ jsxs161("div", { className: styles.treeRow, children: [
@@ -111301,7 +111644,7 @@ var FileDirectoryPanel = ({
111301
111644
  ]
111302
111645
  },
111303
111646
  children: /* @__PURE__ */ jsx206(
111304
- Button85,
111647
+ Button86,
111305
111648
  {
111306
111649
  type: "text",
111307
111650
  size: "small",
@@ -111311,7 +111654,75 @@ var FileDirectoryPanel = ({
111311
111654
  }
111312
111655
  )
111313
111656
  ] }, entry.path);
111314
- }, [directoryChildren, directoryExpanded, directoryLoading, onAssetClick, onToggleDirectory, styles, getFileDownloadUrl, currentAssistant?.id, enableCustomMenu, pinStates, handleDropdownOpen, handleUnpin]);
111657
+ }, [directoryChildren, directoryExpanded, directoryLoading, onAssetClick, onToggleDirectory, styles, getFileDownloadUrl, currentAssistant?.id, enableCustomMenu, pinStates, handleDropdownOpen, handleUnpin, sortKey, sortDirection]);
111658
+ const renderSearchNode = (node, depth) => {
111659
+ if (!node.is_dir) {
111660
+ return renderEntry(node, depth);
111661
+ }
111662
+ const entryName = getEntryName(node);
111663
+ return /* @__PURE__ */ jsxs161("div", { className: styles.treeChildren, children: [
111664
+ /* @__PURE__ */ jsxs161("div", { className: styles.treeRow, children: [
111665
+ Array.from({ length: depth }).map((_2, index3) => /* @__PURE__ */ jsx206("span", { className: styles.treeIndent }, `${node.path}-indent-${index3}`)),
111666
+ /* @__PURE__ */ jsx206("span", { className: styles.treeSpacer }),
111667
+ /* @__PURE__ */ jsxs161("button", { type: "button", className: styles.assetItem, title: entryName, children: [
111668
+ /* @__PURE__ */ jsx206("div", { className: styles.assetIcon, children: /* @__PURE__ */ jsx206(FolderOpen4, { size: 14 }) }),
111669
+ /* @__PURE__ */ jsx206("div", { className: styles.assetInfo, children: /* @__PURE__ */ jsx206("div", { className: styles.assetName, children: entryName }) })
111670
+ ] }),
111671
+ /* @__PURE__ */ jsx206(
111672
+ Dropdown8,
111673
+ {
111674
+ trigger: ["click"],
111675
+ onOpenChange: (open) => handleDropdownOpen(node.path, open),
111676
+ menu: {
111677
+ items: [
111678
+ ...enableCustomMenu ? pinStates[node.path]?.isPinned ? [{
111679
+ key: "unpin",
111680
+ icon: /* @__PURE__ */ jsx206(Pin2, { size: 14 }),
111681
+ label: "Unpin from Menu",
111682
+ onClick: () => {
111683
+ const s4 = pinStates[node.path];
111684
+ if (s4?.pinnedId) handleUnpin(node.path, s4.pinnedId);
111685
+ }
111686
+ }] : [{
111687
+ key: "pin",
111688
+ icon: /* @__PURE__ */ jsx206(Pin2, { size: 14 }),
111689
+ label: "Pin to Menu",
111690
+ onClick: () => {
111691
+ setPinModalPath(node.path);
111692
+ setPinName(entryName);
111693
+ setPinGroup("");
111694
+ }
111695
+ }] : [],
111696
+ {
111697
+ key: "preview",
111698
+ icon: /* @__PURE__ */ jsx206(EyeOutlined, {}),
111699
+ label: "Preview",
111700
+ onClick: () => {
111701
+ const url = getDirectFileUrl(node.path);
111702
+ if (url) {
111703
+ openSideApp({
111704
+ component_key: "attachments",
111705
+ data: { file_id: node.path, url },
111706
+ message: entryName
111707
+ });
111708
+ }
111709
+ }
111710
+ },
111711
+ {
111712
+ key: "share",
111713
+ icon: /* @__PURE__ */ jsx206(LinkOutlined5, {}),
111714
+ label: "Share",
111715
+ onClick: () => setSharePath(node.path)
111716
+ }
111717
+ ]
111718
+ },
111719
+ children: /* @__PURE__ */ jsx206(Button86, { type: "text", size: "small", icon: /* @__PURE__ */ jsx206(MoreOutlined5, {}) })
111720
+ }
111721
+ )
111722
+ ] }),
111723
+ node.children && node.children.length > 0 ? sortFileItems(node.children, sortKey, sortDirection).map((child) => renderSearchNode(child, depth + 1)) : null
111724
+ ] }, node.path);
111725
+ };
111315
111726
  if (!projectId) {
111316
111727
  return /* @__PURE__ */ jsx206("div", { className: styles.emptyState, children: "Please select a project to browse files" });
111317
111728
  }
@@ -111320,7 +111731,48 @@ var FileDirectoryPanel = ({
111320
111731
  /* @__PURE__ */ jsx206(FolderOpen4, { size: 16 }),
111321
111732
  /* @__PURE__ */ jsx206("span", { children: "Files" })
111322
111733
  ] }),
111323
- resourceFolders.map((folder) => {
111734
+ /* @__PURE__ */ jsxs161("div", { className: styles.toolbar, children: [
111735
+ /* @__PURE__ */ jsx206(
111736
+ Input37,
111737
+ {
111738
+ size: "small",
111739
+ placeholder: "Search files\u2026",
111740
+ allowClear: true,
111741
+ value: searchQuery,
111742
+ onChange: (e8) => setSearchQuery(e8.target.value)
111743
+ }
111744
+ ),
111745
+ /* @__PURE__ */ jsxs161("div", { className: styles.toolbarRow, children: [
111746
+ /* @__PURE__ */ jsx206(
111747
+ Select25,
111748
+ {
111749
+ size: "small",
111750
+ style: { flex: 1, minWidth: 0 },
111751
+ value: sortKey,
111752
+ onChange: (value) => setSortKey(value),
111753
+ options: [
111754
+ { value: "name", label: "Name" },
111755
+ { value: "created", label: "Created" },
111756
+ { value: "modified", label: "Modified" }
111757
+ ]
111758
+ }
111759
+ ),
111760
+ /* @__PURE__ */ jsx206(
111761
+ Button86,
111762
+ {
111763
+ size: "small",
111764
+ icon: sortDirection === "asc" ? /* @__PURE__ */ jsx206(SortAscendingOutlined2, {}) : /* @__PURE__ */ jsx206(SortDescendingOutlined2, {}),
111765
+ onClick: () => setSortDirection((d3) => d3 === "asc" ? "desc" : "asc"),
111766
+ title: sortDirection === "asc" ? "Ascending" : "Descending"
111767
+ }
111768
+ )
111769
+ ] })
111770
+ ] }),
111771
+ searchFiles !== null ? /* @__PURE__ */ jsx206("div", { className: styles.assetList, children: searchLoading ? /* @__PURE__ */ jsx206("div", { className: styles.loading, children: /* @__PURE__ */ jsx206(Spin34, { size: "small" }) }) : searchTree && searchTree.length > 0 ? searchTree.map((node) => renderSearchNode(node, 0)) : /* @__PURE__ */ jsxs161("div", { className: styles.emptyState, children: [
111772
+ 'No files match "',
111773
+ searchQuery.trim(),
111774
+ '"'
111775
+ ] }) }) : resourceFolders.map((folder) => {
111324
111776
  const entries = folderEntries[folder.name] || [];
111325
111777
  const isLoading = folderLoading[folder.name] || false;
111326
111778
  const itemCount = entries.length;
@@ -111338,7 +111790,7 @@ var FileDirectoryPanel = ({
111338
111790
  /* @__PURE__ */ jsx206("span", { className: styles.badge, children: itemCount })
111339
111791
  ] }),
111340
111792
  isLoading ? /* @__PURE__ */ jsx206("div", { className: styles.loading, children: /* @__PURE__ */ jsx206(Spin34, { size: "small" }) }) : /* @__PURE__ */ jsxs161("div", { className: styles.assetList, children: [
111341
- entries.map((entry) => renderEntry(entry, 0)),
111793
+ sortFileItems(entries, sortKey, sortDirection).map((entry) => renderEntry(entry, 0)),
111342
111794
  entries.length === 0 ? /* @__PURE__ */ jsx206("div", { className: styles.emptyState, children: "No files in this folder" }) : null,
111343
111795
  folder.allowUpload ? /* @__PURE__ */ jsx206(
111344
111796
  "button",
@@ -111347,10 +111799,10 @@ var FileDirectoryPanel = ({
111347
111799
  className: styles.uploadBtn,
111348
111800
  onClick: () => void onUploadFolder(folder.name),
111349
111801
  disabled: !workspaceId || !projectId || uploadingFolder === folder.name,
111350
- children: uploadingFolder === folder.name ? /* @__PURE__ */ jsxs161(Fragment58, { children: [
111802
+ children: uploadingFolder === folder.name ? /* @__PURE__ */ jsxs161(Fragment59, { children: [
111351
111803
  /* @__PURE__ */ jsx206(Spin34, { size: "small" }),
111352
111804
  /* @__PURE__ */ jsx206("span", { children: "Uploading..." })
111353
- ] }) : /* @__PURE__ */ jsxs161(Fragment58, { children: [
111805
+ ] }) : /* @__PURE__ */ jsxs161(Fragment59, { children: [
111354
111806
  /* @__PURE__ */ jsx206(Upload5, { size: 14 }),
111355
111807
  /* @__PURE__ */ jsx206("span", { children: "Upload" })
111356
111808
  ] })
@@ -111380,7 +111832,7 @@ var FileDirectoryPanel = ({
111380
111832
  okText: "Pin",
111381
111833
  children: /* @__PURE__ */ jsxs161("div", { style: MODAL_BODY_STYLE2, children: [
111382
111834
  /* @__PURE__ */ jsx206(
111383
- Input36,
111835
+ Input37,
111384
111836
  {
111385
111837
  placeholder: "Menu name (required)",
111386
111838
  value: pinName,
@@ -111424,7 +111876,7 @@ var ToolPanelFiles = () => {
111424
111876
  const [directoryLoading, setDirectoryLoading] = useState135({});
111425
111877
  const [directoryExpanded, setDirectoryExpanded] = useState135({});
111426
111878
  const [uploadingFolder, setUploadingFolder] = useState135(null);
111427
- const resourceFolders = useMemo57(() => {
111879
+ const resourceFolders = useMemo58(() => {
111428
111880
  return config.resourceFolders && config.resourceFolders.length > 0 ? config.resourceFolders : [{ name: "/", displayName: "Project Assets", allowUpload: true }];
111429
111881
  }, [config.resourceFolders]);
111430
111882
  const loadAssetsForFolder = useCallback72(
@@ -111560,7 +112012,7 @@ var ToolPanelFiles = () => {
111560
112012
  };
111561
112013
 
111562
112014
  // src/components/Chat/LatticeChat.tsx
111563
- import { Fragment as Fragment59, jsx as jsx208, jsxs as jsxs162 } from "react/jsx-runtime";
112015
+ import { Fragment as Fragment60, jsx as jsx208, jsxs as jsxs162 } from "react/jsx-runtime";
111564
112016
  var useStyles52 = createStyles69(({ css }) => ({
111565
112017
  wrapper: css`
111566
112018
  display: flex;
@@ -111595,7 +112047,7 @@ var LatticeChatContent = (props) => {
111595
112047
  const showWorkspaceSelector = showProjectSelector ?? config.enableWorkspace;
111596
112048
  const layoutHeader = /* @__PURE__ */ jsxs162("div", { className: styles.headerBar, children: [
111597
112049
  /* @__PURE__ */ jsx208("div", { className: styles.headerLeft, children: headerSelector ?? (showWorkspaceSelector ? /* @__PURE__ */ jsx208(ProjectSelector2, {}) : null) }),
111598
- /* @__PURE__ */ jsx208("div", { className: styles.headerRight, children: headerRight !== void 0 ? headerRight : /* @__PURE__ */ jsxs162(Fragment59, { children: [
112050
+ /* @__PURE__ */ jsx208("div", { className: styles.headerRight, children: headerRight !== void 0 ? headerRight : /* @__PURE__ */ jsxs162(Fragment60, { children: [
111599
112051
  /* @__PURE__ */ jsx208(PinToMenuButton, { assistantId }),
111600
112052
  /* @__PURE__ */ jsx208(TasksButton, {}),
111601
112053
  /* @__PURE__ */ jsx208(FilePanelToggle, {})
@@ -111634,7 +112086,7 @@ var LatticeChat = (props) => {
111634
112086
  // src/components/Chat/AgentConversations.tsx
111635
112087
  import { Conversations } from "@ant-design/x";
111636
112088
  import { theme as theme18 } from "antd";
111637
- import { useMemo as useMemo58 } from "react";
112089
+ import { useMemo as useMemo59 } from "react";
111638
112090
  import { jsx as jsx209 } from "react/jsx-runtime";
111639
112091
  var AgentConversations = ({
111640
112092
  enableThreadCreation = true,
@@ -111655,7 +112107,7 @@ var AgentConversations = ({
111655
112107
  background: "transparent",
111656
112108
  borderRadius: token.borderRadius
111657
112109
  };
111658
- const threadItems = useMemo58(() => {
112110
+ const threadItems = useMemo59(() => {
111659
112111
  return threads || [];
111660
112112
  }, [threads]);
111661
112113
  const items3 = threadItems.map((thread2) => ({
@@ -111724,15 +112176,15 @@ var LatticeChatView = (props) => {
111724
112176
  };
111725
112177
 
111726
112178
  // src/components/Chat/SettingsModal.tsx
111727
- import { useState as useState136, useEffect as useEffect109, useRef as useRef55 } from "react";
112179
+ import { useState as useState136, useEffect as useEffect109, useRef as useRef56 } from "react";
111728
112180
  import {
111729
112181
  Modal as Modal48,
111730
- Input as Input37,
111731
- Button as Button86,
112182
+ Input as Input38,
112183
+ Button as Button87,
111732
112184
  message as message45,
111733
112185
  Typography as Typography91,
111734
112186
  Alert as Alert16,
111735
- Select as Select24,
112187
+ Select as Select26,
111736
112188
  Switch as Switch11,
111737
112189
  Space as Space55,
111738
112190
  Tabs as Tabs5
@@ -111750,9 +112202,9 @@ import {
111750
112202
  CloudServerOutlined
111751
112203
  } from "@ant-design/icons";
111752
112204
  import { createStyles as createStyles70 } from "antd-style";
111753
- import { Fragment as Fragment60, jsx as jsx211, jsxs as jsxs163 } from "react/jsx-runtime";
112205
+ import { Fragment as Fragment61, jsx as jsx211, jsxs as jsxs163 } from "react/jsx-runtime";
111754
112206
  var { Text: Text81, Title: Title19 } = Typography91;
111755
- var { TextArea: TextArea12 } = Input37;
112207
+ var { TextArea: TextArea12 } = Input38;
111756
112208
  var useStyles53 = createStyles70(({ token, css }) => ({
111757
112209
  // settingsModal: css`
111758
112210
  // .ant-modal {
@@ -112136,7 +112588,7 @@ var SettingsModal = ({
112136
112588
  return [];
112137
112589
  });
112138
112590
  const [serverConfigs, setServerConfigs] = useState136({});
112139
- const connectionsRef = useRef55(connections);
112591
+ const connectionsRef = useRef56(connections);
112140
112592
  useEffect109(() => {
112141
112593
  connectionsRef.current = connections;
112142
112594
  }, [connections]);
@@ -112686,7 +113138,7 @@ QUEUE_NAME=tasks`,
112686
113138
  )
112687
113139
  ] }),
112688
113140
  config.models.length > 1 && /* @__PURE__ */ jsx211(
112689
- Button86,
113141
+ Button87,
112690
113142
  {
112691
113143
  type: "text",
112692
113144
  danger: true,
@@ -112706,7 +113158,7 @@ QUEUE_NAME=tasks`,
112706
113158
  /* @__PURE__ */ jsxs163("div", { children: [
112707
113159
  /* @__PURE__ */ jsx211(Text81, { className: styles.formLabel, children: "Key *" }),
112708
113160
  /* @__PURE__ */ jsx211(
112709
- Input37,
113161
+ Input38,
112710
113162
  {
112711
113163
  placeholder: "e.g., default, gpt-4, claude",
112712
113164
  value: model.key,
@@ -112719,7 +113171,7 @@ QUEUE_NAME=tasks`,
112719
113171
  /* @__PURE__ */ jsxs163("div", { children: [
112720
113172
  /* @__PURE__ */ jsx211(Text81, { className: styles.formLabel, children: "Provider *" }),
112721
113173
  /* @__PURE__ */ jsx211(
112722
- Select24,
113174
+ Select26,
112723
113175
  {
112724
113176
  style: { width: "100%", height: 40 },
112725
113177
  value: model.provider,
@@ -112737,7 +113189,7 @@ QUEUE_NAME=tasks`,
112737
113189
  /* @__PURE__ */ jsxs163("div", { children: [
112738
113190
  /* @__PURE__ */ jsx211(Text81, { className: styles.formLabel, children: "Model Name *" }),
112739
113191
  /* @__PURE__ */ jsx211(
112740
- Input37,
113192
+ Input38,
112741
113193
  {
112742
113194
  placeholder: "e.g., gpt-4, claude-3-opus, kimi-k2-250905",
112743
113195
  value: model.model,
@@ -112749,7 +113201,7 @@ QUEUE_NAME=tasks`,
112749
113201
  /* @__PURE__ */ jsxs163("div", { children: [
112750
113202
  /* @__PURE__ */ jsx211(Text81, { className: styles.formLabel, children: "API Key" }),
112751
113203
  /* @__PURE__ */ jsx211(
112752
- Input37.Password,
113204
+ Input38.Password,
112753
113205
  {
112754
113206
  placeholder: "Enter your API key",
112755
113207
  value: model.apiKey,
@@ -112762,7 +113214,7 @@ QUEUE_NAME=tasks`,
112762
113214
  /* @__PURE__ */ jsxs163("div", { children: [
112763
113215
  /* @__PURE__ */ jsx211(Text81, { className: styles.formLabel, children: "Base URL" }),
112764
113216
  /* @__PURE__ */ jsx211(
112765
- Input37,
113217
+ Input38,
112766
113218
  {
112767
113219
  placeholder: "e.g., https://api.openai.com/v1",
112768
113220
  value: model.baseURL,
@@ -112786,7 +113238,7 @@ QUEUE_NAME=tasks`,
112786
113238
  /* @__PURE__ */ jsxs163("div", { style: { flex: 1 }, children: [
112787
113239
  /* @__PURE__ */ jsx211(Text81, { className: styles.formLabel, children: "Max Tokens" }),
112788
113240
  /* @__PURE__ */ jsx211(
112789
- Input37,
113241
+ Input38,
112790
113242
  {
112791
113243
  type: "number",
112792
113244
  placeholder: "e.g., 4096",
@@ -112803,7 +113255,7 @@ QUEUE_NAME=tasks`,
112803
113255
  /* @__PURE__ */ jsxs163("div", { style: { flex: 1 }, children: [
112804
113256
  /* @__PURE__ */ jsx211(Text81, { className: styles.formLabel, children: "Temperature" }),
112805
113257
  /* @__PURE__ */ jsx211(
112806
- Input37,
113258
+ Input38,
112807
113259
  {
112808
113260
  type: "number",
112809
113261
  step: "0.1",
@@ -112822,7 +113274,7 @@ QUEUE_NAME=tasks`,
112822
113274
  ] })
112823
113275
  ] }, index3)),
112824
113276
  /* @__PURE__ */ jsx211(
112825
- Button86,
113277
+ Button87,
112826
113278
  {
112827
113279
  type: "dashed",
112828
113280
  onClick: handleAddModel,
@@ -112877,7 +113329,7 @@ QUEUE_NAME=tasks`,
112877
113329
  const tabItems = connections.map((connection) => ({
112878
113330
  key: connection.id,
112879
113331
  label: renderTabLabel(connection),
112880
- children: /* @__PURE__ */ jsx211("div", { className: styles.tabContent, children: connection.connected ? /* @__PURE__ */ jsx211(Fragment60, { children: /* @__PURE__ */ jsxs163("div", { style: { display: "flex", height: "100%" }, children: [
113332
+ children: /* @__PURE__ */ jsx211("div", { className: styles.tabContent, children: connection.connected ? /* @__PURE__ */ jsx211(Fragment61, { children: /* @__PURE__ */ jsxs163("div", { style: { display: "flex", height: "100%" }, children: [
112881
113333
  /* @__PURE__ */ jsx211("div", { className: styles.sidebar, children: SETTINGS_MENU_ITEMS.map((item) => /* @__PURE__ */ jsxs163(
112882
113334
  "div",
112883
113335
  {
@@ -112900,9 +113352,9 @@ QUEUE_NAME=tasks`,
112900
113352
  ] })
112901
113353
  ] }),
112902
113354
  /* @__PURE__ */ jsxs163("div", { className: styles.contentHeaderRight, children: [
112903
- /* @__PURE__ */ jsx211(Button86, { onClick: onClose, children: "Cancel" }),
113355
+ /* @__PURE__ */ jsx211(Button87, { onClick: onClose, children: "Cancel" }),
112904
113356
  /* @__PURE__ */ jsx211(
112905
- Button86,
113357
+ Button87,
112906
113358
  {
112907
113359
  type: "primary",
112908
113360
  icon: /* @__PURE__ */ jsx211(SaveOutlined2, {}),
@@ -112927,14 +113379,14 @@ QUEUE_NAME=tasks`,
112927
113379
  gap: 16,
112928
113380
  padding: 48
112929
113381
  },
112930
- children: connection.connecting ? /* @__PURE__ */ jsxs163(Fragment60, { children: [
113382
+ children: connection.connecting ? /* @__PURE__ */ jsxs163(Fragment61, { children: [
112931
113383
  /* @__PURE__ */ jsx211(LinkOutlined6, { style: { fontSize: 64, color: "#1890ff" }, spin: true }),
112932
113384
  /* @__PURE__ */ jsx211(Title19, { level: 4, children: "Connecting..." }),
112933
113385
  /* @__PURE__ */ jsxs163(Text81, { type: "secondary", style: { textAlign: "center" }, children: [
112934
113386
  "Connecting to ",
112935
113387
  connection.url
112936
113388
  ] })
112937
- ] }) : /* @__PURE__ */ jsxs163(Fragment60, { children: [
113389
+ ] }) : /* @__PURE__ */ jsxs163(Fragment61, { children: [
112938
113390
  /* @__PURE__ */ jsx211(LinkOutlined6, { style: { fontSize: 64, color: "#d9d9d9" } }),
112939
113391
  /* @__PURE__ */ jsx211(Title19, { level: 4, type: "secondary", children: connection.error || "Not Connected" }),
112940
113392
  /* @__PURE__ */ jsx211(
@@ -112946,7 +113398,7 @@ QUEUE_NAME=tasks`,
112946
113398
  }
112947
113399
  ),
112948
113400
  /* @__PURE__ */ jsx211(
112949
- Button86,
113401
+ Button87,
112950
113402
  {
112951
113403
  type: "primary",
112952
113404
  icon: /* @__PURE__ */ jsx211(LinkOutlined6, {}),
@@ -112961,7 +113413,7 @@ QUEUE_NAME=tasks`,
112961
113413
  ) }),
112962
113414
  closable: connections.length > 1
112963
113415
  }));
112964
- return /* @__PURE__ */ jsxs163(Fragment60, { children: [
113416
+ return /* @__PURE__ */ jsxs163(Fragment61, { children: [
112965
113417
  /* @__PURE__ */ jsx211(
112966
113418
  Modal48,
112967
113419
  {
@@ -113022,7 +113474,7 @@ QUEUE_NAME=tasks`,
113022
113474
  /* @__PURE__ */ jsxs163("div", { children: [
113023
113475
  /* @__PURE__ */ jsx211(Text81, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server Name" }),
113024
113476
  /* @__PURE__ */ jsx211(
113025
- Input37,
113477
+ Input38,
113026
113478
  {
113027
113479
  placeholder: "e.g., Production Server",
113028
113480
  value: newServerName,
@@ -113035,7 +113487,7 @@ QUEUE_NAME=tasks`,
113035
113487
  /* @__PURE__ */ jsxs163("div", { children: [
113036
113488
  /* @__PURE__ */ jsx211(Text81, { strong: true, style: { display: "block", marginBottom: 8 }, children: "Server URL *" }),
113037
113489
  /* @__PURE__ */ jsx211(
113038
- Input37,
113490
+ Input38,
113039
113491
  {
113040
113492
  placeholder: "e.g., http://localhost:4001",
113041
113493
  value: newServerUrl,
@@ -113048,7 +113500,7 @@ QUEUE_NAME=tasks`,
113048
113500
  /* @__PURE__ */ jsxs163("div", { children: [
113049
113501
  /* @__PURE__ */ jsx211(Text81, { strong: true, style: { display: "block", marginBottom: 8 }, children: "API Key" }),
113050
113502
  /* @__PURE__ */ jsx211(
113051
- Input37.Password,
113503
+ Input38.Password,
113052
113504
  {
113053
113505
  placeholder: "Optional: Enter API key for authentication",
113054
113506
  value: newServerApiKey,
@@ -113078,7 +113530,7 @@ var AgentServerSetting = () => {
113078
113530
  };
113079
113531
 
113080
113532
  // src/components/Chat/LatticeChatShell.tsx
113081
- import { Fragment as Fragment61, jsx as jsx213, jsxs as jsxs164 } from "react/jsx-runtime";
113533
+ import { Fragment as Fragment62, jsx as jsx213, jsxs as jsxs164 } from "react/jsx-runtime";
113082
113534
  var ChatContent = ({ initialAssistantId }) => /* @__PURE__ */ jsx213(AssistantContextProvider, { autoLoad: true, initialAssistantId, children: /* @__PURE__ */ jsx213(ConversationContextProvider, { children: /* @__PURE__ */ jsx213(LatticeChatView, {}) }) });
113083
113535
  var WorkspaceAwareContent = ({ initialAssistantId }) => {
113084
113536
  const { workspaceId, projectId } = useWorkspaceContext();
@@ -113092,7 +113544,7 @@ var ShellContent = ({
113092
113544
  enableWorkspace
113093
113545
  }) => {
113094
113546
  const { currentTenant } = useAuth();
113095
- return /* @__PURE__ */ jsxs164(Fragment61, { children: [
113547
+ return /* @__PURE__ */ jsxs164(Fragment62, { children: [
113096
113548
  enableWorkspace ? /* @__PURE__ */ jsx213(WorkspaceContextProvider, { children: /* @__PURE__ */ jsx213(WorkspaceAwareContent, { initialAssistantId }) }) : /* @__PURE__ */ jsx213(ChatContent, { initialAssistantId }),
113097
113549
  /* @__PURE__ */ jsx213(AgentServerSetting, {})
113098
113550
  ] });
@@ -113131,10 +113583,10 @@ var LatticeChatShell = (props) => {
113131
113583
  // src/components/Chat/ChannelInstallationsDrawerContent.tsx
113132
113584
  import { useEffect as useEffect110, useState as useState137 } from "react";
113133
113585
  import {
113134
- Button as Button87,
113586
+ Button as Button88,
113135
113587
  Card as Card28,
113136
113588
  Form as Form18,
113137
- Input as Input38,
113589
+ Input as Input39,
113138
113590
  Modal as Modal49,
113139
113591
  Popconfirm as Popconfirm13,
113140
113592
  Spin as Spin35,
@@ -113204,7 +113656,7 @@ var ChannelInstallationsDrawerContent = () => {
113204
113656
  children: [
113205
113657
  /* @__PURE__ */ jsx214(Title20, { level: 5, style: { margin: 0 }, children: "Channel Installations" }),
113206
113658
  /* @__PURE__ */ jsx214(
113207
- Button87,
113659
+ Button88,
113208
113660
  {
113209
113661
  type: "primary",
113210
113662
  icon: /* @__PURE__ */ jsx214(Plus12, { size: 16 }),
@@ -113272,7 +113724,7 @@ var ChannelInstallationsDrawerContent = () => {
113272
113724
  ),
113273
113725
  /* @__PURE__ */ jsxs165("div", { style: { display: "flex", gap: 8 }, children: [
113274
113726
  /* @__PURE__ */ jsx214(
113275
- Button87,
113727
+ Button88,
113276
113728
  {
113277
113729
  icon: /* @__PURE__ */ jsx214(Edit24, { size: 14 }),
113278
113730
  onClick: () => {
@@ -113291,7 +113743,7 @@ var ChannelInstallationsDrawerContent = () => {
113291
113743
  okText: "Delete",
113292
113744
  okType: "danger",
113293
113745
  cancelText: "Cancel",
113294
- children: /* @__PURE__ */ jsx214(Button87, { danger: true, icon: /* @__PURE__ */ jsx214(Trash218, { size: 14 }), children: "Delete" })
113746
+ children: /* @__PURE__ */ jsx214(Button88, { danger: true, icon: /* @__PURE__ */ jsx214(Trash218, { size: 14 }), children: "Delete" })
113295
113747
  }
113296
113748
  )
113297
113749
  ] })
@@ -113391,15 +113843,15 @@ var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCance
113391
113843
  okText: installation ? "Save" : "Create",
113392
113844
  destroyOnHidden: true,
113393
113845
  children: /* @__PURE__ */ jsxs165(Form18, { form, layout: "vertical", children: [
113394
- /* @__PURE__ */ jsx214(Form18.Item, { label: "Channel", children: /* @__PURE__ */ jsx214(Input38, { value: "lark", disabled: true }) }),
113395
- /* @__PURE__ */ jsx214(Form18.Item, { name: "name", label: "Name", children: /* @__PURE__ */ jsx214(Input38, {}) }),
113846
+ /* @__PURE__ */ jsx214(Form18.Item, { label: "Channel", children: /* @__PURE__ */ jsx214(Input39, { value: "lark", disabled: true }) }),
113847
+ /* @__PURE__ */ jsx214(Form18.Item, { name: "name", label: "Name", children: /* @__PURE__ */ jsx214(Input39, {}) }),
113396
113848
  /* @__PURE__ */ jsx214(
113397
113849
  Form18.Item,
113398
113850
  {
113399
113851
  name: "appId",
113400
113852
  label: "App ID",
113401
113853
  rules: [{ required: true, message: "App ID is required" }],
113402
- children: /* @__PURE__ */ jsx214(Input38, {})
113854
+ children: /* @__PURE__ */ jsx214(Input39, {})
113403
113855
  }
113404
113856
  ),
113405
113857
  /* @__PURE__ */ jsx214(
@@ -113408,23 +113860,23 @@ var LarkChannelInstallationFormModal = ({ installation, open, post, put, onCance
113408
113860
  name: "appSecret",
113409
113861
  label: "App Secret",
113410
113862
  rules: [{ required: true, message: "App Secret is required" }],
113411
- children: /* @__PURE__ */ jsx214(Input38, {})
113863
+ children: /* @__PURE__ */ jsx214(Input39, {})
113412
113864
  }
113413
113865
  ),
113414
- /* @__PURE__ */ jsx214(Form18.Item, { name: "verificationToken", label: "Verification Token", children: /* @__PURE__ */ jsx214(Input38, {}) }),
113415
- /* @__PURE__ */ jsx214(Form18.Item, { name: "encryptKey", label: "Encrypt Key", children: /* @__PURE__ */ jsx214(Input38, {}) })
113866
+ /* @__PURE__ */ jsx214(Form18.Item, { name: "verificationToken", label: "Verification Token", children: /* @__PURE__ */ jsx214(Input39, {}) }),
113867
+ /* @__PURE__ */ jsx214(Form18.Item, { name: "encryptKey", label: "Encrypt Key", children: /* @__PURE__ */ jsx214(Input39, {}) })
113416
113868
  ] })
113417
113869
  }
113418
113870
  );
113419
113871
  };
113420
113872
 
113421
113873
  // src/components/Chat/AssistantFlow.tsx
113422
- import { useMemo as useMemo60, useEffect as useEffect111, useState as useState138, useCallback as useCallback73, useRef as useRef56 } from "react";
113874
+ import { useMemo as useMemo61, useEffect as useEffect111, useState as useState138, useCallback as useCallback73, useRef as useRef57 } from "react";
113423
113875
  import { createStyles as createStyles71 } from "antd-style";
113424
113876
 
113425
113877
  // src/components/Chat/AssistantNode.tsx
113426
- import { useMemo as useMemo59 } from "react";
113427
- import { Avatar as Avatar12, Typography as Typography93, theme as theme19, Tag as Tag49, Tooltip as Tooltip34, Space as Space56, Button as Button88 } from "antd";
113878
+ import { useMemo as useMemo60 } from "react";
113879
+ import { Avatar as Avatar12, Typography as Typography93, theme as theme19, Tag as Tag49, Tooltip as Tooltip34, Space as Space56, Button as Button89 } from "antd";
113428
113880
  import {
113429
113881
  UserOutlined as UserOutlined5,
113430
113882
  ToolOutlined as ToolOutlined5,
@@ -113435,7 +113887,7 @@ import {
113435
113887
  MessageOutlined
113436
113888
  } from "@ant-design/icons";
113437
113889
  import { Play as Play5, Square, RotateCcw } from "lucide-react";
113438
- import { Fragment as Fragment62, jsx as jsx215, jsxs as jsxs166 } from "react/jsx-runtime";
113890
+ import { Fragment as Fragment63, jsx as jsx215, jsxs as jsxs166 } from "react/jsx-runtime";
113439
113891
  var { Text: Text83 } = Typography93;
113440
113892
  var LOCAL_STATUS_DOTS = {
113441
113893
  missing: "#8c8c8c",
@@ -113486,7 +113938,7 @@ var AssistantNode = ({
113486
113938
  const localStatus = localA2A?.status;
113487
113939
  const statusDotColor = localStatus ? LOCAL_STATUS_DOTS[localStatus] : "#52c41a";
113488
113940
  const initials = assistant.name?.split(" ").map((n4) => n4.charAt(0)).join("").toUpperCase().slice(0, 2) || "A";
113489
- const { modelKey, tools, agentType, prompt, subAgents } = useMemo59(() => {
113941
+ const { modelKey, tools, agentType, prompt, subAgents } = useMemo60(() => {
113490
113942
  if (!assistant.graphDefinition) {
113491
113943
  return {
113492
113944
  modelKey: void 0,
@@ -114095,9 +114547,9 @@ var AssistantNode = ({
114095
114547
  )
114096
114548
  }
114097
114549
  ),
114098
- localA2A && onLocalA2AAction && /* @__PURE__ */ jsx215(Space56, { size: 6, wrap: true, style: { paddingTop: 4 }, children: localA2A.status === "missing" || localA2A.status === "disabled" ? /* @__PURE__ */ jsx215(Text83, { type: "secondary", style: { fontSize: 11 }, children: localA2A.status === "missing" ? "Not Installed" : "Disabled" }) : localA2A.status === "starting" ? /* @__PURE__ */ jsx215(Text83, { type: "secondary", style: { fontSize: 11 }, children: "Starting..." }) : /* @__PURE__ */ jsxs166(Fragment62, { children: [
114550
+ localA2A && onLocalA2AAction && /* @__PURE__ */ jsx215(Space56, { size: 6, wrap: true, style: { paddingTop: 4 }, children: localA2A.status === "missing" || localA2A.status === "disabled" ? /* @__PURE__ */ jsx215(Text83, { type: "secondary", style: { fontSize: 11 }, children: localA2A.status === "missing" ? "Not Installed" : "Disabled" }) : localA2A.status === "starting" ? /* @__PURE__ */ jsx215(Text83, { type: "secondary", style: { fontSize: 11 }, children: "Starting..." }) : /* @__PURE__ */ jsxs166(Fragment63, { children: [
114099
114551
  localA2A.status === "running" ? /* @__PURE__ */ jsx215(
114100
- Button88,
114552
+ Button89,
114101
114553
  {
114102
114554
  size: "small",
114103
114555
  icon: /* @__PURE__ */ jsx215(Square, { size: 12 }),
@@ -114109,7 +114561,7 @@ var AssistantNode = ({
114109
114561
  children: "Stop"
114110
114562
  }
114111
114563
  ) : /* @__PURE__ */ jsx215(
114112
- Button88,
114564
+ Button89,
114113
114565
  {
114114
114566
  size: "small",
114115
114567
  icon: /* @__PURE__ */ jsx215(Play5, { size: 12 }),
@@ -114122,7 +114574,7 @@ var AssistantNode = ({
114122
114574
  }
114123
114575
  ),
114124
114576
  /* @__PURE__ */ jsx215(
114125
- Button88,
114577
+ Button89,
114126
114578
  {
114127
114579
  size: "small",
114128
114580
  icon: /* @__PURE__ */ jsx215(RotateCcw, { size: 12 }),
@@ -114267,7 +114719,7 @@ var AssistantNode = ({
114267
114719
  var AssistantNode_default = AssistantNode;
114268
114720
 
114269
114721
  // src/components/Chat/AssistantFlow.tsx
114270
- import { Button as Button89, message as message47, theme as theme20 } from "antd";
114722
+ import { Button as Button90, message as message47, theme as theme20 } from "antd";
114271
114723
  import { PlusOutlined as PlusOutlined13 } from "@ant-design/icons";
114272
114724
  import { jsx as jsx216, jsxs as jsxs167 } from "react/jsx-runtime";
114273
114725
  var useStyles54 = createStyles71(({ token, css }) => ({
@@ -114319,17 +114771,17 @@ var AssistantFlowInner = ({ onChat }) => {
114319
114771
  const { refresh: refreshAssistants } = useAssistantContext();
114320
114772
  const { token } = theme20.useToken();
114321
114773
  const { enableAssistantCreation = true, enableAssistantEditing = true } = config;
114322
- const localStatesByAssistantId = useMemo60(() => {
114774
+ const localStatesByAssistantId = useMemo61(() => {
114323
114775
  const map4 = /* @__PURE__ */ new Map();
114324
114776
  localStates.forEach((state) => {
114325
114777
  map4.set(state.runtimeId, state);
114326
114778
  });
114327
114779
  return map4;
114328
114780
  }, [localStates]);
114329
- const displayAssistants = useMemo60(() => {
114781
+ const displayAssistants = useMemo61(() => {
114330
114782
  return assistants;
114331
114783
  }, [assistants]);
114332
- const nodeTypes3 = useMemo60(
114784
+ const nodeTypes3 = useMemo61(
114333
114785
  () => ({
114334
114786
  assistant: AssistantNode_default
114335
114787
  }),
@@ -114726,7 +115178,7 @@ var AssistantFlowInner = ({ onChat }) => {
114726
115178
  }
114727
115179
  }
114728
115180
  }, [assistants, selectedAssistant, configPanelVisible]);
114729
- const lastCreatedAssistantRef = useRef56(null);
115181
+ const lastCreatedAssistantRef = useRef57(null);
114730
115182
  useEffect111(() => {
114731
115183
  if (lastCreatedAssistantRef.current && !assistants.find((a4) => a4.id === lastCreatedAssistantRef.current?.id)) {
114732
115184
  lastCreatedAssistantRef.current = null;
@@ -114779,7 +115231,7 @@ var AssistantFlowInner = ({ onChat }) => {
114779
115231
  zIndex: 10
114780
115232
  },
114781
115233
  children: /* @__PURE__ */ jsx216(
114782
- Button89,
115234
+ Button90,
114783
115235
  {
114784
115236
  type: "primary",
114785
115237
  size: "large",