@athenaintel/react 0.1.0 → 0.3.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.js CHANGED
@@ -1360,7 +1360,7 @@ const createStoreImpl = (createState) => {
1360
1360
  };
1361
1361
  const createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);
1362
1362
  const identity = (arg) => arg;
1363
- function useStore(api, selector = identity) {
1363
+ function useStore$1(api, selector = identity) {
1364
1364
  const slice2 = React__default.useSyncExternalStore(
1365
1365
  api.subscribe,
1366
1366
  React__default.useCallback(() => selector(api.getState()), [api, selector]),
@@ -1371,7 +1371,7 @@ function useStore(api, selector = identity) {
1371
1371
  }
1372
1372
  const createImpl = (createState) => {
1373
1373
  const api = createStore(createState);
1374
- const useBoundStore = (selector) => useStore(api, selector);
1374
+ const useBoundStore = (selector) => useStore$1(api, selector);
1375
1375
  Object.assign(useBoundStore, api);
1376
1376
  return useBoundStore;
1377
1377
  };
@@ -6416,10 +6416,10 @@ class ThreadMessageConverter {
6416
6416
  constructor() {
6417
6417
  __publicField(this, "cache", /* @__PURE__ */ new WeakMap());
6418
6418
  }
6419
- convertMessages(messages, converter2) {
6419
+ convertMessages(messages, converter) {
6420
6420
  return messages.map((m, idx) => {
6421
6421
  const cached = this.cache.get(m);
6422
- const newMessage = converter2(cached, m, idx);
6422
+ const newMessage = converter(cached, m, idx);
6423
6423
  this.cache.set(m, newMessage);
6424
6424
  return newMessage;
6425
6425
  });
@@ -9073,8 +9073,8 @@ function useRunManager(config2) {
9073
9073
  cancel
9074
9074
  };
9075
9075
  }
9076
- function useConvertedState(converter2, agentState, pendingCommands, isSending, toolStatuses) {
9077
- return useMemo(() => converter2(agentState, { pendingCommands, isSending, toolStatuses }), [converter2, agentState, pendingCommands, isSending, toolStatuses]);
9076
+ function useConvertedState(converter, agentState, pendingCommands, isSending, toolStatuses) {
9077
+ return useMemo(() => converter(agentState, { pendingCommands, isSending, toolStatuses }), [converter, agentState, pendingCommands, isSending, toolStatuses]);
9078
9078
  }
9079
9079
  const convertAppendMessageToCommand = (message) => {
9080
9080
  var _a2;
@@ -20575,7 +20575,6 @@ const safeStringify = (value) => {
20575
20575
  return "[Unable to serialize tool result]";
20576
20576
  }
20577
20577
  };
20578
- const optimisticMessageCache = /* @__PURE__ */ new Map();
20579
20578
  const commandsToMessages = (commands) => {
20580
20579
  return commands.flatMap((c) => {
20581
20580
  if (c.type === "add-message") {
@@ -20620,7 +20619,7 @@ const getTrackingIdFromMessage = (msg) => {
20620
20619
  }
20621
20620
  return void 0;
20622
20621
  };
20623
- const converter = (state, connectionMetadata) => {
20622
+ const createConverter = (optimisticMessageCache) => (state, connectionMetadata) => {
20624
20623
  const validatedState = parseLangGraphState(state);
20625
20624
  const backendTrackingIds = /* @__PURE__ */ new Set();
20626
20625
  for (const msg of validatedState.messages) {
@@ -20732,11 +20731,17 @@ const useAthenaRuntime = (config2) => {
20732
20731
  systemPrompt,
20733
20732
  threadId: threadIdProp
20734
20733
  } = config2;
20735
- const threadId = useMemo(() => threadIdProp ?? crypto.randomUUID(), [threadIdProp]);
20734
+ const generatedIdRef = useRef(null);
20735
+ if (generatedIdRef.current === null) {
20736
+ generatedIdRef.current = crypto.randomUUID();
20737
+ }
20738
+ const threadId = threadIdProp ?? generatedIdRef.current;
20736
20739
  const enabledTools = useMemo(
20737
20740
  () => Array.from(/* @__PURE__ */ new Set([...tools, ...frontendToolIds])),
20738
20741
  [tools, frontendToolIds]
20739
20742
  );
20743
+ const optimisticMessageCache = useRef(/* @__PURE__ */ new Map()).current;
20744
+ const converter = useMemo(() => createConverter(optimisticMessageCache), [optimisticMessageCache]);
20740
20745
  const tokenRef = useRef(token);
20741
20746
  tokenRef.current = token;
20742
20747
  const apiKeyRef = useRef(apiKey);
@@ -20752,49 +20757,57 @@ const useAthenaRuntime = (config2) => {
20752
20757
  Accept: "text/event-stream"
20753
20758
  }),
20754
20759
  onResponse: () => {
20755
- console.log("[AthenaSDK] Stream connected");
20760
+ if (process.env.NODE_ENV !== "production") {
20761
+ console.log("[AthenaSDK] Stream connected");
20762
+ }
20756
20763
  },
20757
20764
  onFinish: () => {
20758
- console.log("[AthenaSDK] Stream completed");
20765
+ if (process.env.NODE_ENV !== "production") {
20766
+ console.log("[AthenaSDK] Stream completed");
20767
+ }
20759
20768
  },
20760
20769
  onError: (error2, { commands, updateState }) => {
20761
20770
  const pendingCommands = commandsToMessages(commands);
20762
20771
  const isInvalidStringLength = error2 instanceof RangeError && /Invalid string length/i.test(error2.message);
20763
20772
  const userErrorMessage = isInvalidStringLength ? "The response was too large to process. Try reducing the amount of content in a single request or starting a new chat." : error2.message;
20764
20773
  updateState((state) => {
20765
- const newState = {
20766
- ...state,
20767
- messages: [...state.messages, ...pendingCommands]
20768
- };
20769
- const lastAssistantMessage = newState.messages.filter((m) => m.type === "ai").at(-1);
20770
- if (lastAssistantMessage) {
20771
- lastAssistantMessage.status = {
20772
- type: "incomplete",
20773
- reason: "error",
20774
- error: userErrorMessage
20774
+ const messages = [...state.messages, ...pendingCommands];
20775
+ const lastAiIdx = messages.findLastIndex((m) => m.type === "ai");
20776
+ if (lastAiIdx !== -1) {
20777
+ messages[lastAiIdx] = {
20778
+ ...messages[lastAiIdx],
20779
+ status: {
20780
+ type: "incomplete",
20781
+ reason: "error",
20782
+ error: userErrorMessage
20783
+ }
20775
20784
  };
20776
20785
  }
20777
- return newState;
20786
+ return { ...state, messages };
20778
20787
  });
20779
- console.error("[AthenaSDK] Error:", error2.message);
20788
+ if (process.env.NODE_ENV !== "production") {
20789
+ console.error("[AthenaSDK] Error:", error2.message);
20790
+ }
20780
20791
  },
20781
20792
  onCancel: async ({ commands, updateState }) => {
20782
20793
  const pendingCommands = commandsToMessages(commands);
20783
20794
  updateState((state) => {
20784
- const newState = {
20785
- ...state,
20786
- messages: [...state.messages, ...pendingCommands]
20787
- };
20788
- const lastAssistantMessage = newState.messages.filter((m) => m.type === "ai").at(-1);
20789
- if (lastAssistantMessage) {
20790
- lastAssistantMessage.status = {
20791
- type: "incomplete",
20792
- reason: "cancelled"
20795
+ const messages = [...state.messages, ...pendingCommands];
20796
+ const lastAiIdx = messages.findLastIndex((m) => m.type === "ai");
20797
+ if (lastAiIdx !== -1) {
20798
+ messages[lastAiIdx] = {
20799
+ ...messages[lastAiIdx],
20800
+ status: {
20801
+ type: "incomplete",
20802
+ reason: "cancelled"
20803
+ }
20793
20804
  };
20794
20805
  }
20795
- return newState;
20806
+ return { ...state, messages };
20796
20807
  });
20797
- console.log("[AthenaSDK] Cancelled");
20808
+ if (process.env.NODE_ENV !== "production") {
20809
+ console.log("[AthenaSDK] Cancelled");
20810
+ }
20798
20811
  },
20799
20812
  capabilities: {
20800
20813
  edit: false
@@ -20839,10 +20852,7 @@ const useAthenaRuntime = (config2) => {
20839
20852
  },
20840
20853
  get threadId() {
20841
20854
  return threadId;
20842
- },
20843
- credentials: "include",
20844
- mode: "cors",
20845
- cache: "no-store"
20855
+ }
20846
20856
  }
20847
20857
  });
20848
20858
  return runtime;
@@ -24070,6 +24080,14 @@ function TooltipContent({
24070
24080
  }
24071
24081
  ) });
24072
24082
  }
24083
+ const AthenaContext = createContext(null);
24084
+ function useAthenaConfig() {
24085
+ const ctx = useContext(AthenaContext);
24086
+ if (!ctx) {
24087
+ throw new Error("[AthenaSDK] useAthenaConfig must be used within <AthenaProvider>");
24088
+ }
24089
+ return ctx;
24090
+ }
24073
24091
  function AthenaProvider({
24074
24092
  children,
24075
24093
  apiKey,
@@ -24085,15 +24103,17 @@ function AthenaProvider({
24085
24103
  systemPrompt,
24086
24104
  threadId
24087
24105
  }) {
24088
- const frontendToolNames = Object.keys(frontendTools);
24106
+ const frontendToolNames = useMemo(() => Object.keys(frontendTools), [frontendTools]);
24107
+ const auiTools = useMemo(() => Tools({ toolkit: frontendTools }), [frontendTools]);
24089
24108
  const aui = useAui({
24090
- tools: Tools({ toolkit: frontendTools })
24109
+ tools: auiTools
24091
24110
  });
24092
24111
  const parentAuthToken = useParentAuth();
24093
24112
  const effectiveToken = tokenProp ?? parentAuthToken;
24113
+ const effectiveBackendUrl = backendUrl ?? DEFAULT_BACKEND_URL;
24094
24114
  const runtime = useAthenaRuntime({
24095
24115
  apiUrl,
24096
- backendUrl,
24116
+ backendUrl: effectiveBackendUrl,
24097
24117
  apiKey,
24098
24118
  token: effectiveToken,
24099
24119
  model,
@@ -24105,7 +24125,11 @@ function AthenaProvider({
24105
24125
  systemPrompt,
24106
24126
  threadId
24107
24127
  });
24108
- return /* @__PURE__ */ jsx(AssistantRuntimeProvider, { aui, runtime, children: /* @__PURE__ */ jsx(TooltipProvider, { children }) });
24128
+ const athenaConfig = useMemo(
24129
+ () => ({ backendUrl: effectiveBackendUrl, apiKey, token: effectiveToken }),
24130
+ [effectiveBackendUrl, apiKey, effectiveToken]
24131
+ );
24132
+ return /* @__PURE__ */ jsx(AssistantRuntimeProvider, { aui, runtime, children: /* @__PURE__ */ jsx(AthenaContext.Provider, { value: athenaConfig, children: /* @__PURE__ */ jsx(TooltipProvider, { children }) }) });
24109
24133
  }
24110
24134
  function OrderedMap(content) {
24111
24135
  this.content = content;
@@ -59489,6 +59513,31 @@ class Store {
59489
59513
  return this.atom.subscribe(toObserver(observerOrFn));
59490
59514
  }
59491
59515
  }
59516
+ function defaultCompare(a, b) {
59517
+ return a === b;
59518
+ }
59519
+ function useStore(atom, selector, compare = defaultCompare) {
59520
+ const subscribe = useCallback(
59521
+ (handleStoreChange) => {
59522
+ if (!atom) {
59523
+ return () => {
59524
+ };
59525
+ }
59526
+ const { unsubscribe } = atom.subscribe(handleStoreChange);
59527
+ return unsubscribe;
59528
+ },
59529
+ [atom]
59530
+ );
59531
+ const boundGetSnapshot = useCallback(() => atom == null ? void 0 : atom.get(), [atom]);
59532
+ const selectedSnapshot = withSelectorExports.useSyncExternalStoreWithSelector(
59533
+ subscribe,
59534
+ boundGetSnapshot,
59535
+ boundGetSnapshot,
59536
+ selector,
59537
+ compare
59538
+ );
59539
+ return selectedSnapshot;
59540
+ }
59492
59541
  function createScopeRegistry() {
59493
59542
  return { entries: /* @__PURE__ */ new Map() };
59494
59543
  }
@@ -59524,52 +59573,13 @@ function getFilteredItems(cache, scope, query) {
59524
59573
  }
59525
59574
  return results;
59526
59575
  }
59527
- function toolsToMenuItems(tools) {
59528
- return tools.map((t) => ({
59529
- id: t.id,
59530
- name: t.name,
59531
- type: t.type,
59532
- fallbackIcon: t.icon ?? (t.type === "toolkit" ? "🧰" : "🔧"),
59533
- description: t.description,
59534
- visibleInScopes: /* @__PURE__ */ new Set(["root"])
59535
- }));
59536
- }
59537
- function useMentionSuggestions(tools) {
59538
- const store = useMemo(() => {
59539
- const registry = createScopeRegistry();
59540
- const cache = createItemCache();
59541
- registerSource(registry, "root", async () => ({
59542
- items: [],
59543
- pagination: { hasMore: false }
59544
- }));
59545
- const items = toolsToMenuItems(tools);
59546
- addItems(cache, items, "root");
59547
- return new Store({ registry, cache });
59548
- }, []);
59549
- useMemo(() => {
59550
- const { cache } = store.state;
59551
- for (const item of cache.items.values()) {
59552
- item.visibleInScopes.delete("root");
59553
- }
59554
- for (const [id, item] of cache.items) {
59555
- if (item.visibleInScopes.size === 0) {
59556
- cache.items.delete(id);
59557
- }
59558
- }
59559
- const items = toolsToMenuItems(tools);
59560
- addItems(cache, items, "root");
59561
- }, [tools, store]);
59562
- return store;
59563
- }
59564
- function selectItems(store, scope, query) {
59565
- const { cache } = store.state;
59566
- const items = getFilteredItems(cache, scope, query);
59567
- return { items, isFetching: false, hasMore: false };
59568
- }
59569
59576
  const MentionSuggestionList = forwardRef(({ store, query, command: command2, closeMenu }, ref) => {
59570
59577
  const [selectedIndex, setSelectedIndex] = useState(0);
59571
59578
  const scrollContainerRef = useRef(null);
59572
- const { items, isFetching } = selectItems(store, "root", query);
59579
+ const { items, isFetching } = useStore(store, (state) => ({
59580
+ items: getFilteredItems(state.cache, "root", query),
59581
+ isFetching: false
59582
+ }));
59573
59583
  useEffect(() => {
59574
59584
  setSelectedIndex(0);
59575
59585
  }, [query]);
@@ -59632,7 +59642,10 @@ const MentionSuggestionList = forwardRef(({ store, query, command: command2, clo
59632
59642
  },
59633
59643
  item.id
59634
59644
  )),
59635
- isFetching
59645
+ isFetching && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 px-2 py-1.5 text-sm text-muted-foreground", children: [
59646
+ /* @__PURE__ */ jsx("span", { className: "h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
59647
+ "Loading..."
59648
+ ] })
59636
59649
  ] }) });
59637
59650
  });
59638
59651
  MentionSuggestionList.displayName = "MentionSuggestionList";
@@ -59708,6 +59721,9 @@ const MentionSuggestionsExtension = Extension.create({
59708
59721
  };
59709
59722
  },
59710
59723
  addProseMirrorPlugins() {
59724
+ if (!this.options.store) {
59725
+ throw new Error("[MentionSuggestionsExtension] A `store` option is required.");
59726
+ }
59711
59727
  return [
59712
59728
  index_default({
59713
59729
  editor: this.editor,
@@ -59819,6 +59835,45 @@ const MentionSuggestionsExtension = Extension.create({
59819
59835
  ];
59820
59836
  }
59821
59837
  });
59838
+ function toolsToMenuItems(tools) {
59839
+ return tools.map((t) => ({
59840
+ id: t.id,
59841
+ name: t.name,
59842
+ type: t.type,
59843
+ fallbackIcon: t.icon ?? (t.type === "toolkit" ? "🧰" : "🔧"),
59844
+ description: t.description,
59845
+ visibleInScopes: /* @__PURE__ */ new Set(["root"])
59846
+ }));
59847
+ }
59848
+ function useMentionSuggestions(tools) {
59849
+ const storeRef = useRef(null);
59850
+ if (!storeRef.current) {
59851
+ const registry = createScopeRegistry();
59852
+ const cache = createItemCache();
59853
+ registerSource(registry, "root", async () => ({
59854
+ items: [],
59855
+ pagination: { hasMore: false }
59856
+ }));
59857
+ const items = toolsToMenuItems(tools);
59858
+ addItems(cache, items, "root");
59859
+ storeRef.current = new Store({ registry, cache });
59860
+ }
59861
+ const store = storeRef.current;
59862
+ useEffect(() => {
59863
+ store.setState((prev) => {
59864
+ const newCache = createItemCache();
59865
+ for (const [id, item] of prev.cache.items) {
59866
+ if (item.visibleInScopes.size > 0 && !item.visibleInScopes.has("root")) {
59867
+ newCache.items.set(id, { ...item, visibleInScopes: new Set(item.visibleInScopes) });
59868
+ }
59869
+ }
59870
+ const items = toolsToMenuItems(tools);
59871
+ addItems(newCache, items, "root");
59872
+ return { ...prev, cache: newCache };
59873
+ });
59874
+ }, [tools, store]);
59875
+ return store;
59876
+ }
59822
59877
  const TiptapComposer = ({ tools = [] }) => {
59823
59878
  const composerRuntime = useComposerRuntime();
59824
59879
  const editorRef = useRef(null);
@@ -60007,29 +60062,29 @@ const createLucideIcon = (iconName, iconNode) => {
60007
60062
  * This source code is licensed under the ISC license.
60008
60063
  * See the LICENSE file in the root directory of this source tree.
60009
60064
  */
60010
- const __iconNode$s = [
60065
+ const __iconNode$B = [
60011
60066
  ["path", { d: "M12 5v14", key: "s699le" }],
60012
60067
  ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
60013
60068
  ];
60014
- const ArrowDown = createLucideIcon("arrow-down", __iconNode$s);
60069
+ const ArrowDown = createLucideIcon("arrow-down", __iconNode$B);
60015
60070
  /**
60016
60071
  * @license lucide-react v0.575.0 - ISC
60017
60072
  *
60018
60073
  * This source code is licensed under the ISC license.
60019
60074
  * See the LICENSE file in the root directory of this source tree.
60020
60075
  */
60021
- const __iconNode$r = [
60076
+ const __iconNode$A = [
60022
60077
  ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
60023
60078
  ["path", { d: "M12 19V5", key: "x0mq9r" }]
60024
60079
  ];
60025
- const ArrowUp = createLucideIcon("arrow-up", __iconNode$r);
60080
+ const ArrowUp = createLucideIcon("arrow-up", __iconNode$A);
60026
60081
  /**
60027
60082
  * @license lucide-react v0.575.0 - ISC
60028
60083
  *
60029
60084
  * This source code is licensed under the ISC license.
60030
60085
  * See the LICENSE file in the root directory of this source tree.
60031
60086
  */
60032
- const __iconNode$q = [
60087
+ const __iconNode$z = [
60033
60088
  ["path", { d: "M12 7v14", key: "1akyts" }],
60034
60089
  [
60035
60090
  "path",
@@ -60039,14 +60094,14 @@ const __iconNode$q = [
60039
60094
  }
60040
60095
  ]
60041
60096
  ];
60042
- const BookOpen = createLucideIcon("book-open", __iconNode$q);
60097
+ const BookOpen = createLucideIcon("book-open", __iconNode$z);
60043
60098
  /**
60044
60099
  * @license lucide-react v0.575.0 - ISC
60045
60100
  *
60046
60101
  * This source code is licensed under the ISC license.
60047
60102
  * See the LICENSE file in the root directory of this source tree.
60048
60103
  */
60049
- const __iconNode$p = [
60104
+ const __iconNode$y = [
60050
60105
  ["path", { d: "M12 18V5", key: "adv99a" }],
60051
60106
  ["path", { d: "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4", key: "1e3is1" }],
60052
60107
  ["path", { d: "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5", key: "1gqd8o" }],
@@ -60056,148 +60111,148 @@ const __iconNode$p = [
60056
60111
  ["path", { d: "M6 18a4 4 0 0 1-2-7.464", key: "k1g0md" }],
60057
60112
  ["path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77", key: "q97ue3" }]
60058
60113
  ];
60059
- const Brain = createLucideIcon("brain", __iconNode$p);
60114
+ const Brain = createLucideIcon("brain", __iconNode$y);
60060
60115
  /**
60061
60116
  * @license lucide-react v0.575.0 - ISC
60062
60117
  *
60063
60118
  * This source code is licensed under the ISC license.
60064
60119
  * See the LICENSE file in the root directory of this source tree.
60065
60120
  */
60066
- const __iconNode$o = [
60121
+ const __iconNode$x = [
60067
60122
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
60068
60123
  ["path", { d: "M18 17V9", key: "2bz60n" }],
60069
60124
  ["path", { d: "M13 17V5", key: "1frdt8" }],
60070
60125
  ["path", { d: "M8 17v-3", key: "17ska0" }]
60071
60126
  ];
60072
- const ChartColumn = createLucideIcon("chart-column", __iconNode$o);
60127
+ const ChartColumn = createLucideIcon("chart-column", __iconNode$x);
60073
60128
  /**
60074
60129
  * @license lucide-react v0.575.0 - ISC
60075
60130
  *
60076
60131
  * This source code is licensed under the ISC license.
60077
60132
  * See the LICENSE file in the root directory of this source tree.
60078
60133
  */
60079
- const __iconNode$n = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
60080
- const Check = createLucideIcon("check", __iconNode$n);
60134
+ const __iconNode$w = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
60135
+ const Check = createLucideIcon("check", __iconNode$w);
60081
60136
  /**
60082
60137
  * @license lucide-react v0.575.0 - ISC
60083
60138
  *
60084
60139
  * This source code is licensed under the ISC license.
60085
60140
  * See the LICENSE file in the root directory of this source tree.
60086
60141
  */
60087
- const __iconNode$m = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
60088
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$m);
60142
+ const __iconNode$v = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
60143
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$v);
60089
60144
  /**
60090
60145
  * @license lucide-react v0.575.0 - ISC
60091
60146
  *
60092
60147
  * This source code is licensed under the ISC license.
60093
60148
  * See the LICENSE file in the root directory of this source tree.
60094
60149
  */
60095
- const __iconNode$l = [
60150
+ const __iconNode$u = [
60096
60151
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
60097
60152
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
60098
60153
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
60099
60154
  ];
60100
- const CircleAlert = createLucideIcon("circle-alert", __iconNode$l);
60155
+ const CircleAlert = createLucideIcon("circle-alert", __iconNode$u);
60101
60156
  /**
60102
60157
  * @license lucide-react v0.575.0 - ISC
60103
60158
  *
60104
60159
  * This source code is licensed under the ISC license.
60105
60160
  * See the LICENSE file in the root directory of this source tree.
60106
60161
  */
60107
- const __iconNode$k = [
60162
+ const __iconNode$t = [
60108
60163
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
60109
60164
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
60110
60165
  ];
60111
- const CircleCheck = createLucideIcon("circle-check", __iconNode$k);
60166
+ const CircleCheck = createLucideIcon("circle-check", __iconNode$t);
60112
60167
  /**
60113
60168
  * @license lucide-react v0.575.0 - ISC
60114
60169
  *
60115
60170
  * This source code is licensed under the ISC license.
60116
60171
  * See the LICENSE file in the root directory of this source tree.
60117
60172
  */
60118
- const __iconNode$j = [
60173
+ const __iconNode$s = [
60119
60174
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
60120
60175
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
60121
60176
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
60122
60177
  ];
60123
- const CircleX = createLucideIcon("circle-x", __iconNode$j);
60178
+ const CircleX = createLucideIcon("circle-x", __iconNode$s);
60124
60179
  /**
60125
60180
  * @license lucide-react v0.575.0 - ISC
60126
60181
  *
60127
60182
  * This source code is licensed under the ISC license.
60128
60183
  * See the LICENSE file in the root directory of this source tree.
60129
60184
  */
60130
- const __iconNode$i = [
60185
+ const __iconNode$r = [
60131
60186
  ["path", { d: "m16 18 6-6-6-6", key: "eg8j8" }],
60132
60187
  ["path", { d: "m8 6-6 6 6 6", key: "ppft3o" }]
60133
60188
  ];
60134
- const Code = createLucideIcon("code", __iconNode$i);
60189
+ const Code = createLucideIcon("code", __iconNode$r);
60135
60190
  /**
60136
60191
  * @license lucide-react v0.575.0 - ISC
60137
60192
  *
60138
60193
  * This source code is licensed under the ISC license.
60139
60194
  * See the LICENSE file in the root directory of this source tree.
60140
60195
  */
60141
- const __iconNode$h = [
60196
+ const __iconNode$q = [
60142
60197
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
60143
60198
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
60144
60199
  ];
60145
- const Copy = createLucideIcon("copy", __iconNode$h);
60200
+ const Copy = createLucideIcon("copy", __iconNode$q);
60146
60201
  /**
60147
60202
  * @license lucide-react v0.575.0 - ISC
60148
60203
  *
60149
60204
  * This source code is licensed under the ISC license.
60150
60205
  * See the LICENSE file in the root directory of this source tree.
60151
60206
  */
60152
- const __iconNode$g = [
60207
+ const __iconNode$p = [
60153
60208
  ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
60154
60209
  ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
60155
60210
  ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
60156
60211
  ];
60157
- const Database = createLucideIcon("database", __iconNode$g);
60212
+ const Database = createLucideIcon("database", __iconNode$p);
60158
60213
  /**
60159
60214
  * @license lucide-react v0.575.0 - ISC
60160
60215
  *
60161
60216
  * This source code is licensed under the ISC license.
60162
60217
  * See the LICENSE file in the root directory of this source tree.
60163
60218
  */
60164
- const __iconNode$f = [
60219
+ const __iconNode$o = [
60165
60220
  ["path", { d: "M12 15V3", key: "m9g1x1" }],
60166
60221
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
60167
60222
  ["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
60168
60223
  ];
60169
- const Download = createLucideIcon("download", __iconNode$f);
60224
+ const Download = createLucideIcon("download", __iconNode$o);
60170
60225
  /**
60171
60226
  * @license lucide-react v0.575.0 - ISC
60172
60227
  *
60173
60228
  * This source code is licensed under the ISC license.
60174
60229
  * See the LICENSE file in the root directory of this source tree.
60175
60230
  */
60176
- const __iconNode$e = [
60231
+ const __iconNode$n = [
60177
60232
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
60178
60233
  ["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
60179
60234
  ["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
60180
60235
  ];
60181
- const Ellipsis = createLucideIcon("ellipsis", __iconNode$e);
60236
+ const Ellipsis = createLucideIcon("ellipsis", __iconNode$n);
60182
60237
  /**
60183
60238
  * @license lucide-react v0.575.0 - ISC
60184
60239
  *
60185
60240
  * This source code is licensed under the ISC license.
60186
60241
  * See the LICENSE file in the root directory of this source tree.
60187
60242
  */
60188
- const __iconNode$d = [
60243
+ const __iconNode$m = [
60189
60244
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
60190
60245
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
60191
60246
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
60192
60247
  ];
60193
- const ExternalLink = createLucideIcon("external-link", __iconNode$d);
60248
+ const ExternalLink = createLucideIcon("external-link", __iconNode$m);
60194
60249
  /**
60195
60250
  * @license lucide-react v0.575.0 - ISC
60196
60251
  *
60197
60252
  * This source code is licensed under the ISC license.
60198
60253
  * See the LICENSE file in the root directory of this source tree.
60199
60254
  */
60200
- const __iconNode$c = [
60255
+ const __iconNode$l = [
60201
60256
  [
60202
60257
  "path",
60203
60258
  {
@@ -60209,14 +60264,35 @@ const __iconNode$c = [
60209
60264
  ["path", { d: "M9 15h6", key: "cctwl0" }],
60210
60265
  ["path", { d: "M12 18v-6", key: "17g6i2" }]
60211
60266
  ];
60212
- const FilePlus = createLucideIcon("file-plus", __iconNode$c);
60267
+ const FilePlus = createLucideIcon("file-plus", __iconNode$l);
60213
60268
  /**
60214
60269
  * @license lucide-react v0.575.0 - ISC
60215
60270
  *
60216
60271
  * This source code is licensed under the ISC license.
60217
60272
  * See the LICENSE file in the root directory of this source tree.
60218
60273
  */
60219
- const __iconNode$b = [
60274
+ const __iconNode$k = [
60275
+ [
60276
+ "path",
60277
+ {
60278
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
60279
+ key: "1oefj6"
60280
+ }
60281
+ ],
60282
+ ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }],
60283
+ ["path", { d: "M8 13h2", key: "yr2amv" }],
60284
+ ["path", { d: "M14 13h2", key: "un5t4a" }],
60285
+ ["path", { d: "M8 17h2", key: "2yhykz" }],
60286
+ ["path", { d: "M14 17h2", key: "10kma7" }]
60287
+ ];
60288
+ const FileSpreadsheet = createLucideIcon("file-spreadsheet", __iconNode$k);
60289
+ /**
60290
+ * @license lucide-react v0.575.0 - ISC
60291
+ *
60292
+ * This source code is licensed under the ISC license.
60293
+ * See the LICENSE file in the root directory of this source tree.
60294
+ */
60295
+ const __iconNode$j = [
60220
60296
  [
60221
60297
  "path",
60222
60298
  {
@@ -60229,26 +60305,94 @@ const __iconNode$b = [
60229
60305
  ["path", { d: "M16 13H8", key: "t4e002" }],
60230
60306
  ["path", { d: "M16 17H8", key: "z1uh3a" }]
60231
60307
  ];
60232
- const FileText = createLucideIcon("file-text", __iconNode$b);
60308
+ const FileText = createLucideIcon("file-text", __iconNode$j);
60233
60309
  /**
60234
60310
  * @license lucide-react v0.575.0 - ISC
60235
60311
  *
60236
60312
  * This source code is licensed under the ISC license.
60237
60313
  * See the LICENSE file in the root directory of this source tree.
60238
60314
  */
60239
- const __iconNode$a = [
60315
+ const __iconNode$i = [
60316
+ [
60317
+ "path",
60318
+ {
60319
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
60320
+ key: "1oefj6"
60321
+ }
60322
+ ],
60323
+ ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }]
60324
+ ];
60325
+ const File$1 = createLucideIcon("file", __iconNode$i);
60326
+ /**
60327
+ * @license lucide-react v0.575.0 - ISC
60328
+ *
60329
+ * This source code is licensed under the ISC license.
60330
+ * See the LICENSE file in the root directory of this source tree.
60331
+ */
60332
+ const __iconNode$h = [
60240
60333
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
60241
60334
  ["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
60242
60335
  ["path", { d: "M2 12h20", key: "9i4pu4" }]
60243
60336
  ];
60244
- const Globe = createLucideIcon("globe", __iconNode$a);
60337
+ const Globe = createLucideIcon("globe", __iconNode$h);
60245
60338
  /**
60246
60339
  * @license lucide-react v0.575.0 - ISC
60247
60340
  *
60248
60341
  * This source code is licensed under the ISC license.
60249
60342
  * See the LICENSE file in the root directory of this source tree.
60250
60343
  */
60251
- const __iconNode$9 = [
60344
+ const __iconNode$g = [
60345
+ [
60346
+ "path",
60347
+ {
60348
+ d: "M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",
60349
+ key: "zw3jo"
60350
+ }
60351
+ ],
60352
+ [
60353
+ "path",
60354
+ {
60355
+ d: "M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",
60356
+ key: "1wduqc"
60357
+ }
60358
+ ],
60359
+ [
60360
+ "path",
60361
+ {
60362
+ d: "M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",
60363
+ key: "kqbvx6"
60364
+ }
60365
+ ]
60366
+ ];
60367
+ const Layers = createLucideIcon("layers", __iconNode$g);
60368
+ /**
60369
+ * @license lucide-react v0.575.0 - ISC
60370
+ *
60371
+ * This source code is licensed under the ISC license.
60372
+ * See the LICENSE file in the root directory of this source tree.
60373
+ */
60374
+ const __iconNode$f = [
60375
+ ["rect", { width: "7", height: "7", x: "3", y: "3", rx: "1", key: "1g98yp" }],
60376
+ ["rect", { width: "7", height: "7", x: "14", y: "3", rx: "1", key: "6d4xhi" }],
60377
+ ["rect", { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "nxv5o0" }],
60378
+ ["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }]
60379
+ ];
60380
+ const LayoutGrid = createLucideIcon("layout-grid", __iconNode$f);
60381
+ /**
60382
+ * @license lucide-react v0.575.0 - ISC
60383
+ *
60384
+ * This source code is licensed under the ISC license.
60385
+ * See the LICENSE file in the root directory of this source tree.
60386
+ */
60387
+ const __iconNode$e = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
60388
+ const LoaderCircle = createLucideIcon("loader-circle", __iconNode$e);
60389
+ /**
60390
+ * @license lucide-react v0.575.0 - ISC
60391
+ *
60392
+ * This source code is licensed under the ISC license.
60393
+ * See the LICENSE file in the root directory of this source tree.
60394
+ */
60395
+ const __iconNode$d = [
60252
60396
  ["path", { d: "M12 2v4", key: "3427ic" }],
60253
60397
  ["path", { d: "m16.2 7.8 2.9-2.9", key: "r700ao" }],
60254
60398
  ["path", { d: "M18 12h4", key: "wj9ykh" }],
@@ -60258,37 +60402,63 @@ const __iconNode$9 = [
60258
60402
  ["path", { d: "M2 12h4", key: "j09sii" }],
60259
60403
  ["path", { d: "m4.9 4.9 2.9 2.9", key: "giyufr" }]
60260
60404
  ];
60261
- const Loader = createLucideIcon("loader", __iconNode$9);
60405
+ const Loader = createLucideIcon("loader", __iconNode$d);
60262
60406
  /**
60263
60407
  * @license lucide-react v0.575.0 - ISC
60264
60408
  *
60265
60409
  * This source code is licensed under the ISC license.
60266
60410
  * See the LICENSE file in the root directory of this source tree.
60267
60411
  */
60268
- const __iconNode$8 = [
60412
+ const __iconNode$c = [
60269
60413
  ["path", { d: "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7", key: "132q7q" }],
60270
60414
  ["rect", { x: "2", y: "4", width: "20", height: "16", rx: "2", key: "izxlao" }]
60271
60415
  ];
60272
- const Mail = createLucideIcon("mail", __iconNode$8);
60416
+ const Mail = createLucideIcon("mail", __iconNode$c);
60273
60417
  /**
60274
60418
  * @license lucide-react v0.575.0 - ISC
60275
60419
  *
60276
60420
  * This source code is licensed under the ISC license.
60277
60421
  * See the LICENSE file in the root directory of this source tree.
60278
60422
  */
60279
- const __iconNode$7 = [
60423
+ const __iconNode$b = [
60424
+ ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
60425
+ ["path", { d: "m21 3-7 7", key: "1l2asr" }],
60426
+ ["path", { d: "m3 21 7-7", key: "tjx5ai" }],
60427
+ ["path", { d: "M9 21H3v-6", key: "wtvkvv" }]
60428
+ ];
60429
+ const Maximize2 = createLucideIcon("maximize-2", __iconNode$b);
60430
+ /**
60431
+ * @license lucide-react v0.575.0 - ISC
60432
+ *
60433
+ * This source code is licensed under the ISC license.
60434
+ * See the LICENSE file in the root directory of this source tree.
60435
+ */
60436
+ const __iconNode$a = [
60437
+ ["path", { d: "m14 10 7-7", key: "oa77jy" }],
60438
+ ["path", { d: "M20 10h-6V4", key: "mjg0md" }],
60439
+ ["path", { d: "m3 21 7-7", key: "tjx5ai" }],
60440
+ ["path", { d: "M4 14h6v6", key: "rmj7iw" }]
60441
+ ];
60442
+ const Minimize2 = createLucideIcon("minimize-2", __iconNode$a);
60443
+ /**
60444
+ * @license lucide-react v0.575.0 - ISC
60445
+ *
60446
+ * This source code is licensed under the ISC license.
60447
+ * See the LICENSE file in the root directory of this source tree.
60448
+ */
60449
+ const __iconNode$9 = [
60280
60450
  ["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
60281
60451
  ["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
60282
60452
  ["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
60283
60453
  ];
60284
- const Monitor = createLucideIcon("monitor", __iconNode$7);
60454
+ const Monitor = createLucideIcon("monitor", __iconNode$9);
60285
60455
  /**
60286
60456
  * @license lucide-react v0.575.0 - ISC
60287
60457
  *
60288
60458
  * This source code is licensed under the ISC license.
60289
60459
  * See the LICENSE file in the root directory of this source tree.
60290
60460
  */
60291
- const __iconNode$6 = [
60461
+ const __iconNode$8 = [
60292
60462
  ["path", { d: "M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4", key: "re6nr2" }],
60293
60463
  ["path", { d: "M2 6h4", key: "aawbzj" }],
60294
60464
  ["path", { d: "M2 10h4", key: "l0bgd4" }],
@@ -60302,14 +60472,14 @@ const __iconNode$6 = [
60302
60472
  }
60303
60473
  ]
60304
60474
  ];
60305
- const NotebookPen = createLucideIcon("notebook-pen", __iconNode$6);
60475
+ const NotebookPen = createLucideIcon("notebook-pen", __iconNode$8);
60306
60476
  /**
60307
60477
  * @license lucide-react v0.575.0 - ISC
60308
60478
  *
60309
60479
  * This source code is licensed under the ISC license.
60310
60480
  * See the LICENSE file in the root directory of this source tree.
60311
60481
  */
60312
- const __iconNode$5 = [
60482
+ const __iconNode$7 = [
60313
60483
  ["path", { d: "M13 21h8", key: "1jsn5i" }],
60314
60484
  [
60315
60485
  "path",
@@ -60319,38 +60489,50 @@ const __iconNode$5 = [
60319
60489
  }
60320
60490
  ]
60321
60491
  ];
60322
- const PenLine = createLucideIcon("pen-line", __iconNode$5);
60492
+ const PenLine = createLucideIcon("pen-line", __iconNode$7);
60323
60493
  /**
60324
60494
  * @license lucide-react v0.575.0 - ISC
60325
60495
  *
60326
60496
  * This source code is licensed under the ISC license.
60327
60497
  * See the LICENSE file in the root directory of this source tree.
60328
60498
  */
60329
- const __iconNode$4 = [
60499
+ const __iconNode$6 = [
60500
+ ["path", { d: "M2 3h20", key: "91anmk" }],
60501
+ ["path", { d: "M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3", key: "2k9sn8" }],
60502
+ ["path", { d: "m7 21 5-5 5 5", key: "bip4we" }]
60503
+ ];
60504
+ const Presentation = createLucideIcon("presentation", __iconNode$6);
60505
+ /**
60506
+ * @license lucide-react v0.575.0 - ISC
60507
+ *
60508
+ * This source code is licensed under the ISC license.
60509
+ * See the LICENSE file in the root directory of this source tree.
60510
+ */
60511
+ const __iconNode$5 = [
60330
60512
  ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
60331
60513
  ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
60332
60514
  ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
60333
60515
  ["path", { d: "M8 16H3v5", key: "1cv678" }]
60334
60516
  ];
60335
- const RefreshCw = createLucideIcon("refresh-cw", __iconNode$4);
60517
+ const RefreshCw = createLucideIcon("refresh-cw", __iconNode$5);
60336
60518
  /**
60337
60519
  * @license lucide-react v0.575.0 - ISC
60338
60520
  *
60339
60521
  * This source code is licensed under the ISC license.
60340
60522
  * See the LICENSE file in the root directory of this source tree.
60341
60523
  */
60342
- const __iconNode$3 = [
60524
+ const __iconNode$4 = [
60343
60525
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
60344
60526
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
60345
60527
  ];
60346
- const Search = createLucideIcon("search", __iconNode$3);
60528
+ const Search = createLucideIcon("search", __iconNode$4);
60347
60529
  /**
60348
60530
  * @license lucide-react v0.575.0 - ISC
60349
60531
  *
60350
60532
  * This source code is licensed under the ISC license.
60351
60533
  * See the LICENSE file in the root directory of this source tree.
60352
60534
  */
60353
- const __iconNode$2 = [
60535
+ const __iconNode$3 = [
60354
60536
  [
60355
60537
  "path",
60356
60538
  {
@@ -60360,24 +60542,24 @@ const __iconNode$2 = [
60360
60542
  ],
60361
60543
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
60362
60544
  ];
60363
- const Settings = createLucideIcon("settings", __iconNode$2);
60545
+ const Settings = createLucideIcon("settings", __iconNode$3);
60364
60546
  /**
60365
60547
  * @license lucide-react v0.575.0 - ISC
60366
60548
  *
60367
60549
  * This source code is licensed under the ISC license.
60368
60550
  * See the LICENSE file in the root directory of this source tree.
60369
60551
  */
60370
- const __iconNode$1 = [
60552
+ const __iconNode$2 = [
60371
60553
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }]
60372
60554
  ];
60373
- const Square = createLucideIcon("square", __iconNode$1);
60555
+ const Square = createLucideIcon("square", __iconNode$2);
60374
60556
  /**
60375
60557
  * @license lucide-react v0.575.0 - ISC
60376
60558
  *
60377
60559
  * This source code is licensed under the ISC license.
60378
60560
  * See the LICENSE file in the root directory of this source tree.
60379
60561
  */
60380
- const __iconNode = [
60562
+ const __iconNode$1 = [
60381
60563
  [
60382
60564
  "path",
60383
60565
  {
@@ -60386,7 +60568,18 @@ const __iconNode = [
60386
60568
  }
60387
60569
  ]
60388
60570
  ];
60389
- const Wrench = createLucideIcon("wrench", __iconNode);
60571
+ const Wrench = createLucideIcon("wrench", __iconNode$1);
60572
+ /**
60573
+ * @license lucide-react v0.575.0 - ISC
60574
+ *
60575
+ * This source code is licensed under the ISC license.
60576
+ * See the LICENSE file in the root directory of this source tree.
60577
+ */
60578
+ const __iconNode = [
60579
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
60580
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
60581
+ ];
60582
+ const X = createLucideIcon("x", __iconNode);
60390
60583
  function Collapsible({ ...props }) {
60391
60584
  return /* @__PURE__ */ jsx(Root$2, { "data-slot": "collapsible", ...props });
60392
60585
  }
@@ -60396,37 +60589,94 @@ function CollapsibleTrigger({ ...props }) {
60396
60589
  function CollapsibleContent({ ...props }) {
60397
60590
  return /* @__PURE__ */ jsx(CollapsibleContent$1, { "data-slot": "collapsible-content", ...props });
60398
60591
  }
60592
+ const useAssetPanelStore = create((set2, get2) => ({
60593
+ isOpen: false,
60594
+ tabs: [],
60595
+ activeTabId: null,
60596
+ viewMode: "tabs",
60597
+ isFullscreen: false,
60598
+ autoOpenGeneration: 0,
60599
+ autoOpenedAssets: /* @__PURE__ */ new Map(),
60600
+ openAsset: (assetId, meta) => set2((s) => {
60601
+ const existing = s.tabs.find((t) => t.id === assetId);
60602
+ if (existing) {
60603
+ const tabs = meta ? s.tabs.map(
60604
+ (t) => t.id === assetId ? { ...t, name: meta.name ?? t.name, type: meta.type ?? t.type } : t
60605
+ ) : s.tabs;
60606
+ return { isOpen: true, tabs, activeTabId: assetId };
60607
+ }
60608
+ const newTab = {
60609
+ id: assetId,
60610
+ name: (meta == null ? void 0 : meta.name) ?? null,
60611
+ type: (meta == null ? void 0 : meta.type) ?? "unknown"
60612
+ };
60613
+ return { isOpen: true, tabs: [...s.tabs, newTab], activeTabId: assetId };
60614
+ }),
60615
+ closeTab: (assetId) => set2((s) => {
60616
+ var _a2;
60617
+ const tabs = s.tabs.filter((t) => t.id !== assetId);
60618
+ if (tabs.length === 0) {
60619
+ return { isOpen: false, tabs: [], activeTabId: null, isFullscreen: false };
60620
+ }
60621
+ const activeTabId = s.activeTabId === assetId ? ((_a2 = tabs[Math.min(s.tabs.findIndex((t) => t.id === assetId), tabs.length - 1)]) == null ? void 0 : _a2.id) ?? null : s.activeTabId;
60622
+ return { tabs, activeTabId };
60623
+ }),
60624
+ setActiveTab: (assetId) => set2({ activeTabId: assetId, viewMode: "tabs" }),
60625
+ setViewMode: (mode) => set2({ viewMode: mode }),
60626
+ closePanel: () => set2({ isOpen: false, tabs: [], activeTabId: null, viewMode: "tabs", isFullscreen: false }),
60627
+ toggleFullscreen: () => set2((s) => ({ isFullscreen: !s.isFullscreen })),
60628
+ resetAutoOpen: () => set2((s) => ({ autoOpenGeneration: s.autoOpenGeneration + 1 })),
60629
+ markAutoOpened: (assetId) => {
60630
+ const state = get2();
60631
+ if (state.autoOpenedAssets.get(assetId) === state.autoOpenGeneration) {
60632
+ return false;
60633
+ }
60634
+ state.autoOpenedAssets.set(assetId, state.autoOpenGeneration);
60635
+ return true;
60636
+ }
60637
+ }));
60399
60638
  const ANIMATION_DURATION = 200;
60400
60639
  const TOOL_META = {
60401
- search: { displayName: "Web Search", icon: Search, describer: (a) => a.query ? `"${a.query}"` : "" },
60402
- browse: { displayName: "Browse Page", icon: Globe, describer: (a) => a.url ?? "" },
60403
- search_email: { displayName: "Email Search", icon: Mail, describer: (a) => a.query ? `"${a.query}"` : "" },
60404
- unified_email_search: { displayName: "Email Search", icon: Mail, describer: (a) => a.query ? `"${a.query}"` : "" },
60405
- create_email_draft: { displayName: "Create Email Draft", icon: Mail },
60406
- unified_email_create_draft: { displayName: "Create Email Draft", icon: Mail },
60407
- edit_email_draft: { displayName: "Edit Email Draft", icon: Mail },
60408
- unified_edit_email_draft: { displayName: "Edit Email Draft", icon: Mail },
60409
- search_contacts: { displayName: "Search Contacts", icon: Search },
60410
- search_calendar_events: { displayName: "Search Calendar", icon: Search },
60411
- read_full_asset: { displayName: "Read Asset", icon: BookOpen },
60412
- create_new_document: { displayName: "Create Document", icon: FileText },
60413
- create_document_from_markdown: { displayName: "Create Document", icon: FileText },
60414
- append_markdown_to_athena_document: { displayName: "Write to Document", icon: PenLine },
60415
- replace_markdown_in_athena_document: { displayName: "Update Document", icon: PenLine },
60416
- create_new_sheet: { displayName: "Create Spreadsheet", icon: ChartColumn },
60417
- update_sheet_range: { displayName: "Update Spreadsheet", icon: ChartColumn },
60418
- run_python_code: { displayName: "Run Python", icon: Code },
60419
- run_sql_query_tool: { displayName: "Run SQL Query", icon: Database },
60420
- create_database: { displayName: "Create Database", icon: Database },
60421
- run_database_sql: { displayName: "Run Database Query", icon: Database },
60422
- computer_asset_exec: { displayName: "Run Command", icon: Monitor },
60423
- create_new_notebook: { displayName: "Create Notebook", icon: BookOpen },
60424
- execute_cell: { displayName: "Execute Cell", icon: Code },
60425
- create_new_aop: { displayName: "Create AOP", icon: Brain },
60426
- execute_aop: { displayName: "Execute AOP", icon: Brain },
60427
- list_contents: { displayName: "List Files", icon: Search },
60428
- search_assets: { displayName: "Search Assets", icon: Search },
60429
- save_preference_as_memory: { displayName: "Save Preference", icon: Settings }
60640
+ // Search & Browse
60641
+ search: { displayName: "Searching the web", icon: Search, describer: (a) => a.query ? `"${a.query}"` : "" },
60642
+ browse: { displayName: "Reading webpage", icon: Globe, describer: (a) => a.url ?? "" },
60643
+ search_email: { displayName: "Searching emails", icon: Mail, describer: (a) => a.query ? `"${a.query}"` : "" },
60644
+ unified_email_search: { displayName: "Searching emails", icon: Mail, describer: (a) => a.query ? `"${a.query}"` : "" },
60645
+ search_contacts: { displayName: "Looking up contacts", icon: Search },
60646
+ search_calendar_events: { displayName: "Checking calendar", icon: Search },
60647
+ search_assets: { displayName: "Searching files", icon: Search },
60648
+ list_contents: { displayName: "Browsing files", icon: Search },
60649
+ // Email
60650
+ create_email_draft: { displayName: "Drafting email", icon: Mail },
60651
+ unified_email_create_draft: { displayName: "Drafting email", icon: Mail },
60652
+ edit_email_draft: { displayName: "Editing email draft", icon: Mail },
60653
+ unified_edit_email_draft: { displayName: "Editing email draft", icon: Mail },
60654
+ // Documents
60655
+ read_full_asset: { displayName: "Reading document", icon: BookOpen },
60656
+ create_new_document: { displayName: "Creating document", icon: FileText },
60657
+ create_document_from_markdown: { displayName: "Creating document", icon: FileText },
60658
+ append_markdown_to_athena_document: { displayName: "Updating document", icon: PenLine },
60659
+ replace_markdown_in_athena_document: { displayName: "Updating document", icon: PenLine },
60660
+ // Spreadsheets
60661
+ create_new_sheet: { displayName: "Creating spreadsheet", icon: ChartColumn },
60662
+ update_sheet_range: { displayName: "Updating spreadsheet", icon: ChartColumn },
60663
+ // Presentations
60664
+ create_powerpoint_deck: { displayName: "Building presentation", icon: Monitor },
60665
+ execute_presentation_code: { displayName: "Generating slides", icon: Monitor },
60666
+ // Code & Data
60667
+ run_python_code: { displayName: "Running analysis", icon: Code },
60668
+ run_sql_query_tool: { displayName: "Querying data", icon: Database },
60669
+ create_database: { displayName: "Setting up database", icon: Database },
60670
+ run_database_sql: { displayName: "Querying database", icon: Database },
60671
+ computer_asset_exec: { displayName: "Running command", icon: Monitor },
60672
+ // Notebooks
60673
+ create_new_notebook: { displayName: "Creating notebook", icon: BookOpen },
60674
+ execute_cell: { displayName: "Running notebook cell", icon: Code },
60675
+ // Workflows
60676
+ create_new_aop: { displayName: "Creating workflow", icon: Brain },
60677
+ execute_aop: { displayName: "Running workflow", icon: Brain },
60678
+ // Preferences
60679
+ save_preference_as_memory: { displayName: "Saving preference", icon: Settings }
60430
60680
  };
60431
60681
  function getToolMeta(toolName) {
60432
60682
  if (TOOL_META[toolName]) return TOOL_META[toolName];
@@ -60463,6 +60713,59 @@ function isResultSuccess(result) {
60463
60713
  }
60464
60714
  return false;
60465
60715
  }
60716
+ function extractAssetId$1(result) {
60717
+ if (!result) return null;
60718
+ try {
60719
+ const obj = typeof result === "string" ? JSON.parse(result) : result;
60720
+ if (typeof obj === "object" && obj !== null) {
60721
+ const id = obj.asset_id ?? obj.assetId ?? obj.id;
60722
+ if (typeof id === "string" && id.startsWith("asset_")) return id;
60723
+ }
60724
+ } catch {
60725
+ }
60726
+ return null;
60727
+ }
60728
+ function toolMetaToAssetType(toolName) {
60729
+ const lower = toolName.toLowerCase();
60730
+ if (lower.includes("presentation") || lower.includes("pptx") || lower.includes("slide") || lower.includes("powerpoint"))
60731
+ return "presentation";
60732
+ if (lower.includes("sheet") || lower.includes("spreadsheet"))
60733
+ return "spreadsheet";
60734
+ if (lower.includes("document") || lower.includes("doc") || lower.includes("markdown"))
60735
+ return "document";
60736
+ return "unknown";
60737
+ }
60738
+ const CREATE_ASSET_TOOLS = [
60739
+ "create_powerpoint_deck",
60740
+ "create_document_from_markdown",
60741
+ "create_new_document",
60742
+ "create_new_sheet"
60743
+ ];
60744
+ function isAssetTool(toolName, result) {
60745
+ return CREATE_ASSET_TOOLS.includes(toolName.toLowerCase()) || extractAssetId$1(result) !== null;
60746
+ }
60747
+ function extractTitle(argsText, result) {
60748
+ if (argsText) {
60749
+ const args = tryParseJson$2(argsText);
60750
+ if (args) {
60751
+ const t = args.title ?? args.name ?? args.filename ?? args.sheet_name;
60752
+ if (t) return t;
60753
+ }
60754
+ }
60755
+ if (result) {
60756
+ try {
60757
+ const obj = typeof result === "string" ? JSON.parse(result) : result;
60758
+ if (typeof obj === "object" && obj !== null) {
60759
+ return obj.title ?? obj.name;
60760
+ }
60761
+ } catch {
60762
+ }
60763
+ }
60764
+ return null;
60765
+ }
60766
+ function clearAutoOpenedAssets() {
60767
+ useAssetPanelStore.getState().resetAutoOpen();
60768
+ }
60466
60769
  function ToolFallbackRoot({
60467
60770
  className,
60468
60771
  open: controlledOpen,
@@ -60496,7 +60799,7 @@ function ToolFallbackRoot({
60496
60799
  open: isOpen,
60497
60800
  onOpenChange: handleOpenChange,
60498
60801
  className: cn(
60499
- "aui-tool-fallback-root group/tool-fallback-root w-full rounded-xl border border-border/60 bg-background py-2.5 shadow-sm",
60802
+ "aui-tool-fallback-root group/tool-fallback-root my-3 w-full rounded-xl border border-border/60 bg-background py-2.5 shadow-sm",
60500
60803
  className
60501
60804
  ),
60502
60805
  style: {
@@ -60528,7 +60831,7 @@ function ToolFallbackTrigger({
60528
60831
  if (!parsed) return null;
60529
60832
  const desc = meta.describer(parsed);
60530
60833
  return desc || null;
60531
- }, [toolName, argsText, isRunning, meta]);
60834
+ }, [toolName, argsText, isRunning]);
60532
60835
  const resultMessage = useMemo(() => {
60533
60836
  if (!isComplete) return null;
60534
60837
  return extractResultMessage(result);
@@ -60567,16 +60870,16 @@ function ToolFallbackTrigger({
60567
60870
  ),
60568
60871
  children: [
60569
60872
  /* @__PURE__ */ jsx("span", { children: isRunning ? /* @__PURE__ */ jsxs(Fragment$2, { children: [
60570
- /* @__PURE__ */ jsx("b", { children: meta.displayName }),
60873
+ meta.displayName,
60571
60874
  "..."
60572
- ] }) : /* @__PURE__ */ jsx("b", { children: meta.displayName }) }),
60875
+ ] }) : meta.displayName }),
60573
60876
  isRunning && /* @__PURE__ */ jsxs(
60574
60877
  "span",
60575
60878
  {
60576
60879
  "aria-hidden": true,
60577
60880
  className: "shimmer pointer-events-none absolute inset-0 motion-reduce:animate-none",
60578
60881
  children: [
60579
- /* @__PURE__ */ jsx("b", { children: meta.displayName }),
60882
+ meta.displayName,
60580
60883
  "..."
60581
60884
  ]
60582
60885
  }
@@ -60692,6 +60995,99 @@ function ToolFallbackError({
60692
60995
  /* @__PURE__ */ jsx("p", { className: "mt-0.5 text-xs text-destructive/80", children: errorText })
60693
60996
  ] });
60694
60997
  }
60998
+ function AssetToolCard({
60999
+ toolName,
61000
+ argsText,
61001
+ result,
61002
+ status
61003
+ }) {
61004
+ const [detailsOpen, setDetailsOpen] = useState(false);
61005
+ const openAsset = useAssetPanelStore((s) => s.openAsset);
61006
+ const meta = getToolMeta(toolName);
61007
+ const ToolIcon = meta.icon;
61008
+ const isComplete = (status == null ? void 0 : status.type) === "complete" || !status;
61009
+ const isRunning = (status == null ? void 0 : status.type) === "running";
61010
+ const isCancelled = (status == null ? void 0 : status.type) === "incomplete" && status.reason === "cancelled";
61011
+ const assetId = extractAssetId$1(result);
61012
+ const title = extractTitle(argsText, result);
61013
+ const assetType = toolMetaToAssetType(toolName);
61014
+ const wasCompleteAtMount = useRef(isComplete);
61015
+ useEffect(() => {
61016
+ if (isComplete && !isCancelled && assetId && !wasCompleteAtMount.current) {
61017
+ const store = useAssetPanelStore.getState();
61018
+ if (store.markAutoOpened(assetId)) {
61019
+ store.openAsset(assetId, {
61020
+ name: title ?? void 0,
61021
+ type: assetType
61022
+ });
61023
+ }
61024
+ }
61025
+ }, [isComplete, isCancelled, assetId, title, assetType]);
61026
+ const success = isComplete && isResultSuccess(result);
61027
+ return /* @__PURE__ */ jsxs("div", { className: cn(
61028
+ "aui-tool-fallback-root my-3 w-full rounded-xl border border-border/60 bg-background py-2.5 shadow-sm",
61029
+ isCancelled && "border-muted-foreground/30 bg-muted/30"
61030
+ ), children: [
61031
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2.5 px-3 text-sm", children: [
61032
+ /* @__PURE__ */ jsx(
61033
+ "div",
61034
+ {
61035
+ className: cn(
61036
+ "flex size-7 shrink-0 items-center justify-center rounded-lg",
61037
+ isRunning && "bg-blue-50 text-blue-600",
61038
+ isComplete && success && "bg-emerald-50 text-emerald-600",
61039
+ isComplete && !success && "bg-muted text-muted-foreground"
61040
+ ),
61041
+ children: isRunning ? /* @__PURE__ */ jsx(Loader, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ jsx(ToolIcon, { className: "size-3.5" })
61042
+ }
61043
+ ),
61044
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 grow flex-col items-start gap-0.5 text-left", children: [
61045
+ /* @__PURE__ */ jsxs("span", { className: "leading-tight font-medium", children: [
61046
+ meta.displayName,
61047
+ isRunning && "..."
61048
+ ] }),
61049
+ !isRunning && title && /* @__PURE__ */ jsx("span", { className: "max-w-full truncate text-xs leading-snug text-muted-foreground", children: title })
61050
+ ] }),
61051
+ assetId && isComplete && !isCancelled && CREATE_ASSET_TOOLS.includes(toolName.toLowerCase()) && /* @__PURE__ */ jsxs(
61052
+ "button",
61053
+ {
61054
+ onClick: () => openAsset(assetId, { name: title ?? void 0, type: assetType }),
61055
+ className: "flex shrink-0 items-center gap-1 rounded-md border border-border/60 px-2 py-0.5 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground",
61056
+ children: [
61057
+ /* @__PURE__ */ jsx(ExternalLink, { className: "size-2.5" }),
61058
+ "Open"
61059
+ ]
61060
+ }
61061
+ ),
61062
+ isComplete && success && /* @__PURE__ */ jsx(CircleCheck, { className: "size-3.5 shrink-0 text-emerald-500" }),
61063
+ !isCancelled && /* @__PURE__ */ jsx(
61064
+ "button",
61065
+ {
61066
+ onClick: () => setDetailsOpen((o) => !o),
61067
+ className: cn(
61068
+ "flex size-5 shrink-0 items-center justify-center rounded transition-all",
61069
+ detailsOpen ? "bg-primary/5 text-primary" : "text-muted-foreground/40 hover:bg-muted/50 hover:text-muted-foreground"
61070
+ ),
61071
+ title: "Show details",
61072
+ children: /* @__PURE__ */ jsx(
61073
+ ChevronDown,
61074
+ {
61075
+ className: cn(
61076
+ "size-3 transition-transform duration-200",
61077
+ detailsOpen && "rotate-180"
61078
+ )
61079
+ }
61080
+ )
61081
+ }
61082
+ )
61083
+ ] }),
61084
+ (status == null ? void 0 : status.type) === "incomplete" && /* @__PURE__ */ jsx("div", { className: "px-3 pt-2", children: /* @__PURE__ */ jsx(ToolFallbackError, { status }) }),
61085
+ detailsOpen && !isCancelled && /* @__PURE__ */ jsxs("div", { className: "mt-2.5 flex flex-col gap-2 border-t border-border/50 px-3 pt-2", children: [
61086
+ /* @__PURE__ */ jsx(ToolFallbackArgs, { argsText }),
61087
+ /* @__PURE__ */ jsx(ToolFallbackResult, { result })
61088
+ ] })
61089
+ ] });
61090
+ }
60695
61091
  const ToolFallbackImpl = ({
60696
61092
  toolName,
60697
61093
  argsText,
@@ -60699,6 +61095,17 @@ const ToolFallbackImpl = ({
60699
61095
  status
60700
61096
  }) => {
60701
61097
  const isCancelled = (status == null ? void 0 : status.type) === "incomplete" && status.reason === "cancelled";
61098
+ if (isAssetTool(toolName, result)) {
61099
+ return /* @__PURE__ */ jsx(
61100
+ AssetToolCard,
61101
+ {
61102
+ toolName,
61103
+ argsText,
61104
+ result,
61105
+ status
61106
+ }
61107
+ );
61108
+ }
60702
61109
  return /* @__PURE__ */ jsxs(
60703
61110
  ToolFallbackRoot,
60704
61111
  {
@@ -61063,11 +61470,15 @@ function normalizeResult(result) {
61063
61470
  function truncate(text2, max2) {
61064
61471
  return text2.length > max2 ? `${text2.slice(0, max2)}...` : text2;
61065
61472
  }
61473
+ function formatToolName(name) {
61474
+ return name.replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
61475
+ }
61066
61476
  function ToolCard({
61067
61477
  icon: Icon2,
61068
61478
  status,
61069
61479
  title,
61070
61480
  subtitle,
61481
+ toolName,
61071
61482
  badge,
61072
61483
  error: error2,
61073
61484
  children
@@ -61075,7 +61486,7 @@ function ToolCard({
61075
61486
  const isRunning = status === "running";
61076
61487
  const isComplete = status === "complete";
61077
61488
  const isError = status === "incomplete";
61078
- return /* @__PURE__ */ jsxs("div", { className: "my-1.5 w-full overflow-hidden rounded-xl border border-border/60 bg-background shadow-sm", children: [
61489
+ return /* @__PURE__ */ jsxs("div", { className: "my-3 w-full overflow-hidden rounded-xl border border-border/60 bg-background shadow-sm", children: [
61079
61490
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 px-4 py-3", children: [
61080
61491
  /* @__PURE__ */ jsx(
61081
61492
  "div",
@@ -61091,11 +61502,12 @@ function ToolCard({
61091
61502
  ),
61092
61503
  /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
61093
61504
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
61094
- /* @__PURE__ */ jsx("span", { className: "text-[13px] font-semibold text-foreground", children: title }),
61505
+ /* @__PURE__ */ jsx("span", { className: "text-[13px] font-medium text-foreground", children: title }),
61095
61506
  isComplete && !error2 && /* @__PURE__ */ jsx(CircleCheck, { className: "size-3.5 text-emerald-500" })
61096
61507
  ] }),
61097
61508
  subtitle && /* @__PURE__ */ jsx("p", { className: "truncate text-[12px] text-muted-foreground", children: subtitle })
61098
61509
  ] }),
61510
+ toolName && /* @__PURE__ */ jsx("span", { className: "shrink-0 rounded-md bg-muted/60 px-1.5 py-0.5 text-[10px] font-mono text-muted-foreground", children: formatToolName(toolName) }),
61099
61511
  badge && /* @__PURE__ */ jsx("span", { className: "shrink-0 rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground", children: badge }),
61100
61512
  isRunning && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
61101
61513
  /* @__PURE__ */ jsx("div", { className: "h-1.5 w-10 animate-pulse rounded-full bg-blue-100" }),
@@ -61149,6 +61561,7 @@ function parseSearchResults(data) {
61149
61561
  });
61150
61562
  }
61151
61563
  const WebSearchToolUIImpl = ({
61564
+ toolName,
61152
61565
  args,
61153
61566
  result,
61154
61567
  status
@@ -61167,11 +61580,12 @@ const WebSearchToolUIImpl = ({
61167
61580
  status: (status == null ? void 0 : status.type) ?? "complete",
61168
61581
  title: isRunning ? "Searching the web..." : "Web search",
61169
61582
  subtitle: query ? truncate(query, 80) : void 0,
61583
+ toolName,
61170
61584
  badge: isComplete && results.length > 0 ? `${results.length} results` : void 0,
61171
61585
  error: errorMsg,
61172
61586
  children: isComplete && results.length > 0 && /* @__PURE__ */ jsx(ExpandableSection, { label: "Show search results", children: /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2.5", children: results.map((r2, i) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5", children: [
61173
61587
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
61174
- r2.url ? /* @__PURE__ */ jsx(
61588
+ r2.url && /^https?:\/\//i.test(r2.url) ? /* @__PURE__ */ jsx(
61175
61589
  "a",
61176
61590
  {
61177
61591
  href: r2.url,
@@ -61180,7 +61594,7 @@ const WebSearchToolUIImpl = ({
61180
61594
  className: "text-[12px] font-medium text-blue-600 hover:underline",
61181
61595
  children: r2.title || r2.url
61182
61596
  }
61183
- ) : /* @__PURE__ */ jsx("span", { className: "text-[12px] font-medium text-foreground", children: r2.title || "Result" }),
61597
+ ) : /* @__PURE__ */ jsx("span", { className: "text-[12px] font-medium text-foreground", children: r2.title || r2.url || "Result" }),
61184
61598
  r2.url && /* @__PURE__ */ jsx(ExternalLink, { className: "size-3 shrink-0 text-muted-foreground" })
61185
61599
  ] }),
61186
61600
  r2.url && /* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: truncate(r2.url, 60) }),
@@ -61194,6 +61608,7 @@ const WebSearchToolUI = memo(
61194
61608
  );
61195
61609
  WebSearchToolUI.displayName = "WebSearchToolUI";
61196
61610
  const BrowseToolUIImpl = ({
61611
+ toolName,
61197
61612
  args,
61198
61613
  result,
61199
61614
  status
@@ -61222,6 +61637,7 @@ const BrowseToolUIImpl = ({
61222
61637
  status: (status == null ? void 0 : status.type) ?? "complete",
61223
61638
  title: isRunning ? "Browsing page..." : pageTitle ? truncate(pageTitle, 50) : "Browsed page",
61224
61639
  subtitle: displayUrl,
61640
+ toolName,
61225
61641
  error: errorMsg,
61226
61642
  children: isComplete && pageContent && /* @__PURE__ */ jsx(ExpandableSection, { label: "Show page content", children: /* @__PURE__ */ jsx("pre", { className: "whitespace-pre-wrap break-words text-[11px] leading-relaxed text-muted-foreground", children: truncate(pageContent, 3e3) }) })
61227
61643
  }
@@ -61245,6 +61661,7 @@ function parseEmailResults(data) {
61245
61661
  });
61246
61662
  }
61247
61663
  const EmailSearchToolUIImpl = ({
61664
+ toolName,
61248
61665
  args,
61249
61666
  result,
61250
61667
  status
@@ -61263,6 +61680,7 @@ const EmailSearchToolUIImpl = ({
61263
61680
  status: (status == null ? void 0 : status.type) ?? "complete",
61264
61681
  title: isRunning ? "Searching emails..." : "Email search",
61265
61682
  subtitle: query ? truncate(query, 80) : void 0,
61683
+ toolName,
61266
61684
  badge: isComplete && emails.length > 0 ? `${emails.length} emails` : void 0,
61267
61685
  error: errorMsg,
61268
61686
  children: isComplete && emails.length > 0 && /* @__PURE__ */ jsx(ExpandableSection, { label: "Show email results", children: /* @__PURE__ */ jsx("div", { className: "flex flex-col divide-y divide-border/30", children: emails.map((email, i) => /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-0.5 py-2", i === 0 && "pt-0"), children: [
@@ -61280,33 +61698,124 @@ const EmailSearchToolUI = memo(
61280
61698
  EmailSearchToolUIImpl
61281
61699
  );
61282
61700
  EmailSearchToolUI.displayName = "EmailSearchToolUI";
61283
- const CreateDocumentToolUIImpl = ({
61701
+ function extractAssetId(result) {
61702
+ const data = normalizeResult(result);
61703
+ if (!data) return null;
61704
+ const id = data.asset_id ?? data.assetId ?? data.id;
61705
+ if (typeof id === "string" && id.startsWith("asset_")) return id;
61706
+ return null;
61707
+ }
61708
+ function resetAssetAutoOpen() {
61709
+ useAssetPanelStore.getState().resetAutoOpen();
61710
+ }
61711
+ function CreateAssetToolUIImpl({
61712
+ icon: Icon2,
61713
+ assetType,
61714
+ runningLabel,
61715
+ doneLabel,
61716
+ toolName,
61284
61717
  args,
61285
61718
  result,
61286
61719
  status
61287
- }) => {
61720
+ }) {
61288
61721
  const typedArgs = args;
61289
- const docName = (typedArgs == null ? void 0 : typedArgs.name) ?? (typedArgs == null ? void 0 : typedArgs.title) ?? (typedArgs == null ? void 0 : typedArgs.document_name) ?? "";
61722
+ const name = (typedArgs == null ? void 0 : typedArgs.name) ?? (typedArgs == null ? void 0 : typedArgs.title) ?? (typedArgs == null ? void 0 : typedArgs.document_name) ?? (typedArgs == null ? void 0 : typedArgs.sheet_name) ?? "";
61290
61723
  const data = useMemo(() => normalizeResult(result), [result]);
61291
61724
  const createdName = (data == null ? void 0 : data.name) ?? (data == null ? void 0 : data.title) ?? (data == null ? void 0 : data.asset_name);
61725
+ const assetId = extractAssetId(result);
61292
61726
  const isRunning = (status == null ? void 0 : status.type) === "running";
61727
+ const isComplete = (status == null ? void 0 : status.type) === "complete" || !status;
61728
+ const isCancelled = (status == null ? void 0 : status.type) === "incomplete" && status.reason === "cancelled";
61293
61729
  const errorMsg = (status == null ? void 0 : status.type) === "incomplete" ? status.error : null;
61730
+ const openAsset = useAssetPanelStore((s) => s.openAsset);
61731
+ const wasCompleteAtMount = useRef(isComplete);
61732
+ useEffect(() => {
61733
+ if (isComplete && !isCancelled && assetId && !wasCompleteAtMount.current) {
61734
+ const store = useAssetPanelStore.getState();
61735
+ if (store.markAutoOpened(assetId)) {
61736
+ store.openAsset(assetId, {
61737
+ name: createdName || name || void 0,
61738
+ type: assetType
61739
+ });
61740
+ }
61741
+ }
61742
+ }, [isComplete, isCancelled, assetId, createdName, name, assetType]);
61743
+ const handleOpen = () => {
61744
+ if (assetId) {
61745
+ openAsset(assetId, {
61746
+ name: createdName || name || void 0,
61747
+ type: assetType
61748
+ });
61749
+ }
61750
+ };
61294
61751
  return /* @__PURE__ */ jsx(
61295
61752
  ToolCard,
61296
61753
  {
61297
- icon: FilePlus,
61754
+ icon: Icon2,
61298
61755
  status: (status == null ? void 0 : status.type) ?? "complete",
61299
- title: isRunning ? "Creating document..." : "Created document",
61300
- subtitle: createdName || docName || void 0,
61301
- error: errorMsg
61756
+ title: isRunning ? runningLabel : doneLabel,
61757
+ subtitle: createdName || name || void 0,
61758
+ toolName,
61759
+ error: errorMsg,
61760
+ children: assetId && isComplete && !isCancelled && /* @__PURE__ */ jsx("div", { className: "border-t border-border/40 px-4 py-2", children: /* @__PURE__ */ jsxs(
61761
+ "button",
61762
+ {
61763
+ onClick: handleOpen,
61764
+ className: "flex items-center gap-1.5 rounded-md border border-border/60 px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground",
61765
+ children: [
61766
+ /* @__PURE__ */ jsx(ExternalLink, { className: "size-3" }),
61767
+ "Open ",
61768
+ assetType === "unknown" ? "asset" : assetType
61769
+ ]
61770
+ }
61771
+ ) })
61302
61772
  }
61303
61773
  );
61304
- };
61774
+ }
61775
+ const CreateDocumentToolUIImpl = (props) => /* @__PURE__ */ jsx(
61776
+ CreateAssetToolUIImpl,
61777
+ {
61778
+ icon: FilePlus,
61779
+ assetType: "document",
61780
+ runningLabel: "Creating document...",
61781
+ doneLabel: "Created document",
61782
+ ...props
61783
+ }
61784
+ );
61305
61785
  const CreateDocumentToolUI = memo(
61306
61786
  CreateDocumentToolUIImpl
61307
61787
  );
61308
61788
  CreateDocumentToolUI.displayName = "CreateDocumentToolUI";
61789
+ const CreateSheetToolUIImpl = (props) => /* @__PURE__ */ jsx(
61790
+ CreateAssetToolUIImpl,
61791
+ {
61792
+ icon: ChartColumn,
61793
+ assetType: "spreadsheet",
61794
+ runningLabel: "Creating spreadsheet...",
61795
+ doneLabel: "Created spreadsheet",
61796
+ ...props
61797
+ }
61798
+ );
61799
+ const CreateSheetToolUI = memo(
61800
+ CreateSheetToolUIImpl
61801
+ );
61802
+ CreateSheetToolUI.displayName = "CreateSheetToolUI";
61803
+ const CreatePresentationToolUIImpl = (props) => /* @__PURE__ */ jsx(
61804
+ CreateAssetToolUIImpl,
61805
+ {
61806
+ icon: Presentation,
61807
+ assetType: "presentation",
61808
+ runningLabel: "Creating presentation...",
61809
+ doneLabel: "Created presentation",
61810
+ ...props
61811
+ }
61812
+ );
61813
+ const CreatePresentationToolUI = memo(
61814
+ CreatePresentationToolUIImpl
61815
+ );
61816
+ CreatePresentationToolUI.displayName = "CreatePresentationToolUI";
61309
61817
  const CreateEmailDraftToolUIImpl = ({
61818
+ toolName,
61310
61819
  args,
61311
61820
  result,
61312
61821
  status
@@ -61322,6 +61831,7 @@ const CreateEmailDraftToolUIImpl = ({
61322
61831
  icon: Mail,
61323
61832
  status: (status == null ? void 0 : status.type) ?? "complete",
61324
61833
  title: isRunning ? "Creating email draft..." : "Email draft created",
61834
+ toolName,
61325
61835
  subtitle: subject ? truncate(subject, 60) : to ? `To: ${truncate(to, 40)}` : void 0,
61326
61836
  error: errorMsg
61327
61837
  }
@@ -61339,7 +61849,9 @@ const TOOL_UI_REGISTRY = {
61339
61849
  create_email_draft: CreateEmailDraftToolUI,
61340
61850
  unified_email_create_draft: CreateEmailDraftToolUI,
61341
61851
  create_new_document: CreateDocumentToolUI,
61342
- create_document_from_markdown: CreateDocumentToolUI
61852
+ create_document_from_markdown: CreateDocumentToolUI,
61853
+ create_new_sheet: CreateSheetToolUI,
61854
+ create_powerpoint_deck: CreatePresentationToolUI
61343
61855
  };
61344
61856
  const falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
61345
61857
  const cx = clsx;
@@ -61451,14 +61963,7 @@ const TooltipIconButton = forwardRef(
61451
61963
  }
61452
61964
  );
61453
61965
  TooltipIconButton.displayName = "TooltipIconButton";
61454
- const SAMPLE_TOOLS = [
61455
- { id: "search_web", name: "Search Web", description: "Search the internet for information", icon: "🔍", type: "tool" },
61456
- { id: "read_file", name: "Read File", description: "Read contents of a file", icon: "📄", type: "tool" },
61457
- { id: "write_file", name: "Write File", description: "Write contents to a file", icon: "✏️", type: "tool" },
61458
- { id: "run_code", name: "Run Code", description: "Execute code in a sandbox", icon: "▶️", type: "tool" },
61459
- { id: "code_toolkit", name: "Code Toolkit", description: "Full suite of coding tools", icon: "🧰", type: "toolkit" },
61460
- { id: "research_toolkit", name: "Research Toolkit", description: "Research and analysis tools", icon: "📚", type: "toolkit" }
61461
- ];
61966
+ const EMPTY_MENTION_TOOLS = [];
61462
61967
  const AthenaChat = ({
61463
61968
  className,
61464
61969
  welcomeMessage = "Hello there!",
@@ -61467,13 +61972,17 @@ const AthenaChat = ({
61467
61972
  toolUIs,
61468
61973
  mentionTools
61469
61974
  }) => {
61470
- const tools = mentionTools ?? SAMPLE_TOOLS;
61471
- const mergedToolUIs = {
61975
+ const tools = mentionTools ?? EMPTY_MENTION_TOOLS;
61976
+ const mergedToolUIs = useMemo(() => ({
61472
61977
  append_markdown_to_athena_document: AppendDocumentToolUI,
61473
61978
  read_full_asset: ReadAssetToolUI,
61474
61979
  ...TOOL_UI_REGISTRY,
61475
61980
  ...toolUIs
61476
- };
61981
+ }), [toolUIs]);
61982
+ const AssistantMessageComponent = useMemo(
61983
+ () => () => /* @__PURE__ */ jsx(AssistantMessage, { toolUIs: mergedToolUIs }),
61984
+ [mergedToolUIs]
61985
+ );
61477
61986
  return /* @__PURE__ */ jsx(
61478
61987
  ThreadPrimitiveRoot,
61479
61988
  {
@@ -61494,7 +62003,7 @@ const AthenaChat = ({
61494
62003
  {
61495
62004
  components: {
61496
62005
  UserMessage,
61497
- AssistantMessage: () => /* @__PURE__ */ jsx(AssistantMessage, { toolUIs: mergedToolUIs })
62006
+ AssistantMessage: AssistantMessageComponent
61498
62007
  }
61499
62008
  }
61500
62009
  ),
@@ -61623,9 +62132,317 @@ const UserMessage = () => /* @__PURE__ */ jsx(
61623
62132
  children: /* @__PURE__ */ jsx("div", { className: "aui-user-message-content wrap-break-word rounded-2xl bg-muted px-4 py-2.5 text-foreground", children: /* @__PURE__ */ jsx(MessagePrimitiveParts, { components: { Text: TiptapText } }) })
61624
62133
  }
61625
62134
  );
62135
+ const embedCache = /* @__PURE__ */ new Map();
62136
+ function useAssetEmbed(assetId, options = {
62137
+ backendUrl: ""
62138
+ }) {
62139
+ const { readOnly = false, expiresInSeconds = 60 * 60 * 24 * 30, backendUrl, apiKey, token } = options;
62140
+ const [embedUrl, setEmbedUrl] = useState(null);
62141
+ const [isLoading, setIsLoading] = useState(false);
62142
+ const [error2, setError] = useState(null);
62143
+ const abortRef = useRef(null);
62144
+ useEffect(() => {
62145
+ var _a2;
62146
+ if (!assetId || !backendUrl) {
62147
+ setEmbedUrl(null);
62148
+ setIsLoading(false);
62149
+ setError(null);
62150
+ return;
62151
+ }
62152
+ const cacheKey = `${assetId}:${readOnly}:${token ?? apiKey ?? "anon"}`;
62153
+ const cached = embedCache.get(cacheKey);
62154
+ if (cached && cached.expiresAt > Date.now() / 1e3) {
62155
+ setEmbedUrl(cached.url);
62156
+ setIsLoading(false);
62157
+ setError(null);
62158
+ return;
62159
+ }
62160
+ const agoraBase = backendUrl.replace(/\/api\/assistant-ui\/?$/, "");
62161
+ const endpoint = `${agoraBase}/api/embed/generate-token`;
62162
+ (_a2 = abortRef.current) == null ? void 0 : _a2.abort();
62163
+ const controller = new AbortController();
62164
+ abortRef.current = controller;
62165
+ setIsLoading(true);
62166
+ setError(null);
62167
+ const headers = { "Content-Type": "application/json" };
62168
+ if (token) {
62169
+ headers["Authorization"] = `Bearer ${token}`;
62170
+ } else if (apiKey) {
62171
+ headers["X-API-KEY"] = apiKey;
62172
+ }
62173
+ fetch(endpoint, {
62174
+ method: "POST",
62175
+ headers,
62176
+ body: JSON.stringify({
62177
+ asset_id: assetId,
62178
+ read_only: readOnly,
62179
+ expires_in_seconds: expiresInSeconds
62180
+ }),
62181
+ signal: controller.signal
62182
+ }).then(async (res) => {
62183
+ if (!res.ok) {
62184
+ const text2 = await res.text().catch(() => "");
62185
+ throw new Error(`Failed to generate embed token (${res.status}): ${text2}`);
62186
+ }
62187
+ return res.json();
62188
+ }).then((data) => {
62189
+ embedCache.set(`${assetId}:${readOnly}:${token ?? apiKey ?? "anon"}`, { url: data.embed_url, expiresAt: data.expires_at });
62190
+ setEmbedUrl(data.embed_url);
62191
+ setIsLoading(false);
62192
+ }).catch((err) => {
62193
+ if (err.name === "AbortError") return;
62194
+ setError(err.message);
62195
+ setIsLoading(false);
62196
+ });
62197
+ return () => controller.abort();
62198
+ }, [assetId, readOnly, expiresInSeconds, backendUrl, apiKey, token]);
62199
+ return { embedUrl, isLoading, error: error2 };
62200
+ }
62201
+ const ASSET_TYPE_CONFIG = {
62202
+ presentation: { icon: Presentation, label: "Presentation" },
62203
+ spreadsheet: { icon: FileSpreadsheet, label: "Spreadsheet" },
62204
+ document: { icon: FileText, label: "Document" },
62205
+ unknown: { icon: File$1, label: "Asset" }
62206
+ };
62207
+ const AssetIframe = memo(
62208
+ ({ tabId, tabName }) => {
62209
+ const { backendUrl, apiKey, token } = useAthenaConfig();
62210
+ const { embedUrl, isLoading, error: error2 } = useAssetEmbed(tabId, {
62211
+ backendUrl,
62212
+ apiKey,
62213
+ token
62214
+ });
62215
+ if (isLoading) {
62216
+ return /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
62217
+ /* @__PURE__ */ jsx(LoaderCircle, { className: "mx-auto size-6 animate-spin text-muted-foreground" }),
62218
+ /* @__PURE__ */ jsx("p", { className: "mt-2 text-xs text-muted-foreground", children: "Loading..." })
62219
+ ] }) });
62220
+ }
62221
+ if (error2) {
62222
+ return /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center p-4", children: /* @__PURE__ */ jsxs("div", { className: "max-w-sm text-center", children: [
62223
+ /* @__PURE__ */ jsx(CircleAlert, { className: "mx-auto size-5 text-red-400" }),
62224
+ /* @__PURE__ */ jsx("p", { className: "mt-1.5 text-xs font-medium text-foreground", children: "Failed to load" }),
62225
+ /* @__PURE__ */ jsx("p", { className: "mt-0.5 line-clamp-2 break-words text-[10px] text-muted-foreground", children: error2 })
62226
+ ] }) });
62227
+ }
62228
+ if (!embedUrl) return null;
62229
+ return /* @__PURE__ */ jsx(
62230
+ "iframe",
62231
+ {
62232
+ src: embedUrl,
62233
+ width: "100%",
62234
+ height: "100%",
62235
+ frameBorder: "0",
62236
+ allow: "fullscreen",
62237
+ title: tabName ?? `Asset ${tabId}`,
62238
+ className: "h-full w-full"
62239
+ }
62240
+ );
62241
+ }
62242
+ );
62243
+ AssetIframe.displayName = "AssetIframe";
62244
+ const PanelContent = () => {
62245
+ const { tabs, activeTabId, viewMode, closeTab } = useAssetPanelStore();
62246
+ const isTiled = viewMode === "tiled" && tabs.length >= 2;
62247
+ const gridClass = useMemo(() => {
62248
+ const n = tabs.length;
62249
+ if (n <= 1) return "";
62250
+ if (n === 2) return "grid grid-cols-2 grid-rows-1";
62251
+ if (n <= 4) return "grid grid-cols-2 grid-rows-2";
62252
+ if (n <= 6) return "grid grid-cols-3 grid-rows-2";
62253
+ return "grid grid-cols-3 grid-rows-3";
62254
+ }, [tabs.length]);
62255
+ return /* @__PURE__ */ jsx(
62256
+ "div",
62257
+ {
62258
+ className: `flex-1 overflow-hidden ${isTiled ? `${gridClass} gap-px bg-border/60` : ""}`,
62259
+ children: tabs.map((tab) => {
62260
+ const isActive2 = tab.id === activeTabId;
62261
+ const config2 = ASSET_TYPE_CONFIG[tab.type];
62262
+ const TypeIcon = config2.icon;
62263
+ if (isTiled) {
62264
+ return /* @__PURE__ */ jsxs(
62265
+ "div",
62266
+ {
62267
+ className: "flex min-h-0 min-w-0 flex-col bg-background",
62268
+ children: [
62269
+ /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1.5 border-b px-2 py-1", children: [
62270
+ /* @__PURE__ */ jsx(TypeIcon, { className: "size-3 shrink-0 text-muted-foreground" }),
62271
+ /* @__PURE__ */ jsx("span", { className: "flex-1 truncate text-[11px] font-medium text-foreground", children: tab.name ?? config2.label }),
62272
+ /* @__PURE__ */ jsx(
62273
+ "button",
62274
+ {
62275
+ onClick: () => closeTab(tab.id),
62276
+ className: "shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
62277
+ children: /* @__PURE__ */ jsx(X, { className: "size-2.5" })
62278
+ }
62279
+ )
62280
+ ] }),
62281
+ /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ jsx(AssetIframe, { tabId: tab.id, tabName: tab.name }) })
62282
+ ]
62283
+ },
62284
+ tab.id
62285
+ );
62286
+ }
62287
+ return /* @__PURE__ */ jsx(
62288
+ "div",
62289
+ {
62290
+ className: isActive2 ? "h-full w-full" : "hidden",
62291
+ children: /* @__PURE__ */ jsx(AssetIframe, { tabId: tab.id, tabName: tab.name })
62292
+ },
62293
+ tab.id
62294
+ );
62295
+ })
62296
+ }
62297
+ );
62298
+ };
62299
+ const TabBar = () => {
62300
+ const { tabs, activeTabId, setActiveTab, closeTab, viewMode } = useAssetPanelStore();
62301
+ if (tabs.length <= 1 || viewMode === "tiled") return null;
62302
+ return /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-0 overflow-x-auto border-b bg-muted/30", children: tabs.map((tab) => {
62303
+ const config2 = ASSET_TYPE_CONFIG[tab.type];
62304
+ const TypeIcon = config2.icon;
62305
+ const isActive2 = tab.id === activeTabId;
62306
+ return /* @__PURE__ */ jsxs(
62307
+ "div",
62308
+ {
62309
+ className: `group flex max-w-[180px] shrink-0 cursor-pointer items-center gap-1.5 border-r border-border/40 px-3 py-1.5 text-xs ${isActive2 ? "border-b-2 border-b-primary bg-background text-foreground" : "text-muted-foreground hover:bg-background/50 hover:text-foreground"}`,
62310
+ onClick: () => setActiveTab(tab.id),
62311
+ children: [
62312
+ /* @__PURE__ */ jsx(TypeIcon, { className: "size-3 shrink-0" }),
62313
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: tab.name ?? config2.label }),
62314
+ /* @__PURE__ */ jsx(
62315
+ "button",
62316
+ {
62317
+ onClick: (e) => {
62318
+ e.stopPropagation();
62319
+ closeTab(tab.id);
62320
+ },
62321
+ className: "ml-auto shrink-0 rounded p-0.5 opacity-0 transition-opacity hover:bg-muted group-hover:opacity-100",
62322
+ children: /* @__PURE__ */ jsx(X, { className: "size-2.5" })
62323
+ }
62324
+ )
62325
+ ]
62326
+ },
62327
+ tab.id
62328
+ );
62329
+ }) });
62330
+ };
62331
+ const PanelHeader = ({ fullscreen }) => {
62332
+ const {
62333
+ closePanel,
62334
+ toggleFullscreen,
62335
+ tabs,
62336
+ activeTabId,
62337
+ viewMode,
62338
+ setViewMode
62339
+ } = useAssetPanelStore();
62340
+ const activeTab = tabs.find((t) => t.id === activeTabId);
62341
+ const config2 = ASSET_TYPE_CONFIG[(activeTab == null ? void 0 : activeTab.type) ?? "unknown"];
62342
+ const TypeIcon = config2.icon;
62343
+ const isTiled = viewMode === "tiled";
62344
+ return /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-2 border-b px-4 py-2.5", children: [
62345
+ !isTiled && /* @__PURE__ */ jsx(TypeIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
62346
+ /* @__PURE__ */ jsx("p", { className: "flex-1 truncate text-sm font-semibold text-foreground", children: isTiled ? `${tabs.length} Assets` : (activeTab == null ? void 0 : activeTab.name) ?? config2.label }),
62347
+ tabs.length >= 2 && /* @__PURE__ */ jsx(
62348
+ "button",
62349
+ {
62350
+ onClick: () => setViewMode(isTiled ? "tabs" : "tiled"),
62351
+ className: `flex size-7 items-center justify-center rounded-lg transition-colors ${isTiled ? "bg-primary/10 text-primary" : "text-muted-foreground hover:bg-accent hover:text-foreground"}`,
62352
+ title: isTiled ? "Switch to tabs" : "Tile all assets",
62353
+ children: isTiled ? /* @__PURE__ */ jsx(Layers, { className: "size-3.5" }) : /* @__PURE__ */ jsx(LayoutGrid, { className: "size-3.5" })
62354
+ }
62355
+ ),
62356
+ /* @__PURE__ */ jsx(
62357
+ "button",
62358
+ {
62359
+ onClick: toggleFullscreen,
62360
+ className: "flex size-7 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
62361
+ title: fullscreen ? "Exit fullscreen" : "Fullscreen",
62362
+ children: fullscreen ? /* @__PURE__ */ jsx(Minimize2, { className: "size-3.5" }) : /* @__PURE__ */ jsx(Maximize2, { className: "size-3.5" })
62363
+ }
62364
+ ),
62365
+ /* @__PURE__ */ jsx(
62366
+ "button",
62367
+ {
62368
+ onClick: closePanel,
62369
+ className: "flex size-7 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
62370
+ title: "Close all",
62371
+ children: /* @__PURE__ */ jsx(X, { className: "size-4" })
62372
+ }
62373
+ )
62374
+ ] });
62375
+ };
62376
+ const AssetPanel = () => {
62377
+ const isFullscreen = useAssetPanelStore((s) => s.isFullscreen);
62378
+ const content = /* @__PURE__ */ jsxs(Fragment$2, { children: [
62379
+ /* @__PURE__ */ jsx(PanelHeader, { fullscreen: isFullscreen }),
62380
+ /* @__PURE__ */ jsx(TabBar, {}),
62381
+ /* @__PURE__ */ jsx(PanelContent, {})
62382
+ ] });
62383
+ if (isFullscreen) {
62384
+ return /* @__PURE__ */ jsx("div", { className: "fixed inset-0 z-50 flex flex-col bg-background", children: content });
62385
+ }
62386
+ return /* @__PURE__ */ jsx("div", { className: "flex h-full flex-col bg-background", children: content });
62387
+ };
62388
+ const AthenaLayout = ({
62389
+ children,
62390
+ defaultChatPercent = 50,
62391
+ minPercent = 25
62392
+ }) => {
62393
+ const isOpen = useAssetPanelStore((s) => s.isOpen);
62394
+ const [chatPercent, setChatPercent] = useState(defaultChatPercent);
62395
+ const containerRef = useRef(null);
62396
+ const dragging = useRef(false);
62397
+ const onPointerDown = useCallback(
62398
+ (e) => {
62399
+ e.preventDefault();
62400
+ dragging.current = true;
62401
+ e.target.setPointerCapture(e.pointerId);
62402
+ },
62403
+ []
62404
+ );
62405
+ const onPointerMove = useCallback(
62406
+ (e) => {
62407
+ if (!dragging.current || !containerRef.current) return;
62408
+ const rect = containerRef.current.getBoundingClientRect();
62409
+ const pct = (e.clientX - rect.left) / rect.width * 100;
62410
+ setChatPercent(Math.max(minPercent, Math.min(100 - minPercent, pct)));
62411
+ },
62412
+ [minPercent]
62413
+ );
62414
+ const onPointerUp = useCallback(() => {
62415
+ dragging.current = false;
62416
+ }, []);
62417
+ if (!isOpen) {
62418
+ return /* @__PURE__ */ jsx("div", { className: "flex h-full w-full flex-col", children });
62419
+ }
62420
+ return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: "flex h-full w-full", children: [
62421
+ /* @__PURE__ */ jsx(
62422
+ "div",
62423
+ {
62424
+ className: "flex h-full flex-col overflow-hidden",
62425
+ style: { width: `${chatPercent}%` },
62426
+ children
62427
+ }
62428
+ ),
62429
+ /* @__PURE__ */ jsx(
62430
+ "div",
62431
+ {
62432
+ className: "flex h-full w-1 shrink-0 cursor-col-resize items-center bg-border/40 transition-colors hover:bg-border active:bg-primary/30",
62433
+ onPointerDown,
62434
+ onPointerMove,
62435
+ onPointerUp
62436
+ }
62437
+ ),
62438
+ /* @__PURE__ */ jsx("div", { className: "flex h-full flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsx(AssetPanel, {}) })
62439
+ ] });
62440
+ };
61626
62441
  export {
61627
62442
  AppendDocumentToolUI,
62443
+ AssetPanel,
61628
62444
  AthenaChat,
62445
+ AthenaLayout,
61629
62446
  AthenaProvider,
61630
62447
  BrowseToolUI,
61631
62448
  Button,
@@ -61634,6 +62451,9 @@ export {
61634
62451
  CollapsibleTrigger,
61635
62452
  CreateDocumentToolUI,
61636
62453
  CreateEmailDraftToolUI,
62454
+ CreatePresentationToolUI,
62455
+ CreateSheetToolUI,
62456
+ DEFAULT_BACKEND_URL,
61637
62457
  EmailSearchToolUI,
61638
62458
  ReadAssetToolUI,
61639
62459
  TOOL_UI_REGISTRY,
@@ -61653,9 +62473,14 @@ export {
61653
62473
  TooltipTrigger,
61654
62474
  WebSearchToolUI,
61655
62475
  buttonVariants,
62476
+ clearAutoOpenedAssets,
61656
62477
  cn,
61657
62478
  getAssetInfo,
62479
+ resetAssetAutoOpen,
61658
62480
  tryParseJson$1 as tryParseJson,
62481
+ useAssetEmbed,
62482
+ useAssetPanelStore,
62483
+ useAthenaConfig,
61659
62484
  useAthenaRuntime,
61660
62485
  useMentionSuggestions,
61661
62486
  useParentAuth