@athenaintel/react 0.5.0 → 0.6.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.cjs CHANGED
@@ -4561,6 +4561,16 @@ const ChainOfThoughtByIndicesProvider = ({ startIndex, endIndex, children }) =>
4561
4561
  });
4562
4562
  return jsxRuntime.jsx(AuiProvider, { value: aui, children });
4563
4563
  };
4564
+ const ThreadListItemByIndexProvider = ({ index: index2, archived, children }) => {
4565
+ const aui = useAui({
4566
+ threadListItem: Derived({
4567
+ source: "threads",
4568
+ query: { type: "index", index: index2, archived },
4569
+ get: (aui2) => aui2.threads().item({ index: index2, archived })
4570
+ })
4571
+ });
4572
+ return jsxRuntime.jsx(AuiProvider, { value: aui, children });
4573
+ };
4564
4574
  const RuntimeAdapter = resource((runtime) => tapResource(RuntimeAdapterResource(runtime)));
4565
4575
  attachTransformScopes(RuntimeAdapter, (scopes, parent) => {
4566
4576
  const result = baseRuntimeAdapterTransformScopes(scopes, parent);
@@ -7640,7 +7650,7 @@ const toAppendMessage = (messages, message) => {
7640
7650
  startRun: message.startRun
7641
7651
  };
7642
7652
  };
7643
- const getThreadState$1 = (runtime, threadListItemState) => {
7653
+ const getThreadState = (runtime, threadListItemState) => {
7644
7654
  const lastMessage = runtime.messages.at(-1);
7645
7655
  return Object.freeze({
7646
7656
  threadId: threadListItemState.id,
@@ -7663,7 +7673,7 @@ class ThreadRuntimeImpl {
7663
7673
  __publicField(this, "_eventSubscriptionSubjects", /* @__PURE__ */ new Map());
7664
7674
  const stateBinding = new ShallowMemoizeSubject({
7665
7675
  path: threadBinding.path,
7666
- getState: () => getThreadState$1(threadBinding.getState(), threadListItemBinding.getState()),
7676
+ getState: () => getThreadState(threadBinding.getState(), threadListItemBinding.getState()),
7667
7677
  subscribe: (callback) => {
7668
7678
  const sub1 = threadBinding.subscribe(callback);
7669
7679
  const sub2 = threadListItemBinding.subscribe(callback);
@@ -8930,6 +8940,24 @@ const MessagePrimitiveParts$1 = ({ components, unstable_showEmptyOnNonTextEnd =
8930
8940
  return jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [partsElements, jsxRuntime.jsx(ConditionalEmpty, { components, enabled: unstable_showEmptyOnNonTextEnd })] });
8931
8941
  };
8932
8942
  MessagePrimitiveParts$1.displayName = "MessagePrimitive.Parts";
8943
+ const ThreadListPrimitiveItemByIndex = React.memo(({ index: index2, archived = false, components }) => {
8944
+ const ThreadListItemComponent = components.ThreadListItem;
8945
+ return jsxRuntime.jsx(ThreadListItemByIndexProvider, { index: index2, archived, children: jsxRuntime.jsx(ThreadListItemComponent, {}) });
8946
+ }, (prev, next) => prev.index === next.index && prev.archived === next.archived && prev.components.ThreadListItem === next.components.ThreadListItem);
8947
+ ThreadListPrimitiveItemByIndex.displayName = "ThreadListPrimitive.ItemByIndex";
8948
+ const ThreadListPrimitiveItems = ({ archived = false, components }) => {
8949
+ const contentLength = useAuiState((s) => archived ? s.threads.archivedThreadIds.length : s.threads.threadIds.length);
8950
+ const listElements = React.useMemo(() => {
8951
+ return Array.from({ length: contentLength }, (_, index2) => jsxRuntime.jsx(ThreadListPrimitiveItemByIndex, { index: index2, archived, components }, index2));
8952
+ }, [contentLength, archived, components]);
8953
+ return listElements;
8954
+ };
8955
+ ThreadListPrimitiveItems.displayName = "ThreadListPrimitive.Items";
8956
+ const ThreadListItemPrimitiveTitle = ({ fallback }) => {
8957
+ const title = useAuiState((s) => s.threadListItem.title);
8958
+ return jsxRuntime.jsx(jsxRuntime.Fragment, { children: title || fallback });
8959
+ };
8960
+ ThreadListItemPrimitiveTitle.displayName = "ThreadListItemPrimitive.Title";
8933
8961
  const useComposerSend$1 = () => {
8934
8962
  const aui = useAui();
8935
8963
  const disabled = useAuiState((s) => s.thread.isRunning || !s.composer.isEditing || s.composer.isEmpty);
@@ -16362,6 +16390,37 @@ const useThreadScrollToBottom = ({ behavior } = {}) => {
16362
16390
  return handleScrollToBottom;
16363
16391
  };
16364
16392
  const ThreadPrimitiveScrollToBottom = createActionButton("ThreadPrimitive.ScrollToBottom", useThreadScrollToBottom, ["behavior"]);
16393
+ const ThreadListPrimitiveNew = React.forwardRef(({ onClick, disabled, ...props }, forwardedRef) => {
16394
+ const isMain = useAuiState((s) => s.threads.newThreadId === s.threads.mainThreadId);
16395
+ const aui = useAui();
16396
+ return jsxRuntime.jsx(Primitive$1.button, { type: "button", ...isMain ? { "data-active": "true", "aria-current": "true" } : null, ...props, ref: forwardedRef, disabled, onClick: composeEventHandlers(onClick, () => {
16397
+ aui.threads().switchToNewThread();
16398
+ }) });
16399
+ });
16400
+ ThreadListPrimitiveNew.displayName = "ThreadListPrimitive.New";
16401
+ const ThreadListPrimitiveRoot = React.forwardRef((props, ref) => {
16402
+ return jsxRuntime.jsx(Primitive$1.div, { ...props, ref });
16403
+ });
16404
+ ThreadListPrimitiveRoot.displayName = "ThreadListPrimitive.Root";
16405
+ const ThreadListItemPrimitiveRoot = React.forwardRef((props, ref) => {
16406
+ const isMain = useAuiState((s) => s.threads.mainThreadId === s.threadListItem.id);
16407
+ return jsxRuntime.jsx(Primitive$1.div, { ...isMain ? { "data-active": "true", "aria-current": "true" } : null, ...props, ref });
16408
+ });
16409
+ ThreadListItemPrimitiveRoot.displayName = "ThreadListItemPrimitive.Root";
16410
+ const useThreadListItemArchive = () => {
16411
+ const aui = useAui();
16412
+ return React.useCallback(() => {
16413
+ aui.threadListItem().archive();
16414
+ }, [aui]);
16415
+ };
16416
+ const ThreadListItemPrimitiveArchive = createActionButton("ThreadListItemPrimitive.Archive", useThreadListItemArchive);
16417
+ const useThreadListItemTrigger = () => {
16418
+ const aui = useAui();
16419
+ return React.useCallback(() => {
16420
+ aui.threadListItem().switchTo();
16421
+ }, [aui]);
16422
+ };
16423
+ const ThreadListItemPrimitiveTrigger = createActionButton("ThreadListItemPrimitive.Trigger", useThreadListItemTrigger);
16365
16424
  const useScrollLock = (animatedElementRef, animationDuration) => {
16366
16425
  const scrollContainerRef = React.useRef(null);
16367
16426
  const cleanupRef = React.useRef(null);
@@ -20737,6 +20796,7 @@ const createConverter = (optimisticMessageCache) => (state, connectionMetadata)
20737
20796
  const useAthenaRuntime = (config2) => {
20738
20797
  const {
20739
20798
  apiUrl = DEFAULT_API_URL,
20799
+ resumeApiUrl,
20740
20800
  backendUrl = DEFAULT_BACKEND_URL,
20741
20801
  apiKey,
20742
20802
  token,
@@ -20747,9 +20807,9 @@ const useAthenaRuntime = (config2) => {
20747
20807
  workbench = [],
20748
20808
  knowledgeBase = [],
20749
20809
  systemPrompt,
20750
- threadId: threadIdProp,
20751
- initialMessages
20810
+ threadId: threadIdProp
20752
20811
  } = config2;
20812
+ const resolvedResumeApiUrl = resumeApiUrl ?? apiUrl.replace(/\/api\/chat$/, "/api/resume");
20753
20813
  const generatedIdRef = React.useRef(null);
20754
20814
  if (generatedIdRef.current === null) {
20755
20815
  generatedIdRef.current = crypto.randomUUID();
@@ -20765,10 +20825,12 @@ const useAthenaRuntime = (config2) => {
20765
20825
  tokenRef.current = token;
20766
20826
  const apiKeyRef = React.useRef(apiKey);
20767
20827
  apiKeyRef.current = apiKey;
20828
+ const isExistingThread = !!threadIdProp;
20768
20829
  const runtime = useAssistantTransportRuntime({
20769
- initialState: { messages: initialMessages ?? [] },
20830
+ initialState: { messages: [] },
20770
20831
  converter,
20771
20832
  api: apiUrl,
20833
+ resumeApi: resolvedResumeApiUrl,
20772
20834
  headers: async () => ({
20773
20835
  // Prefer parent-injected PropelAuth token over hardcoded API key
20774
20836
  ...tokenRef.current ? { Authorization: `Bearer ${tokenRef.current}` } : apiKeyRef.current ? { "X-API-KEY": apiKeyRef.current } : {},
@@ -20874,6 +20936,16 @@ const useAthenaRuntime = (config2) => {
20874
20936
  }
20875
20937
  }
20876
20938
  });
20939
+ const hasResumedRef = React.useRef(false);
20940
+ React.useEffect(() => {
20941
+ if (isExistingThread && !hasResumedRef.current) {
20942
+ hasResumedRef.current = true;
20943
+ try {
20944
+ runtime.thread.unstable_resumeRun({ parentId: null });
20945
+ } catch {
20946
+ }
20947
+ }
20948
+ }, [isExistingThread, runtime]);
20877
20949
  return runtime;
20878
20950
  };
20879
20951
  function r(e) {
@@ -24107,20 +24179,6 @@ function useAthenaConfig() {
24107
24179
  }
24108
24180
  return ctx;
24109
24181
  }
24110
- const ThreadLoadingContext = React.createContext(false);
24111
- function useThreadLoading() {
24112
- return React.useContext(ThreadLoadingContext);
24113
- }
24114
- const ThreadListContext = React.createContext(null);
24115
- function useThreadListStore() {
24116
- const store = React.useContext(ThreadListContext);
24117
- if (!store) {
24118
- throw new Error(
24119
- "[AthenaSDK] useThreadList must be used within an <AthenaProvider> that has thread management enabled."
24120
- );
24121
- }
24122
- return store;
24123
- }
24124
24182
  function getAuthHeaders(auth) {
24125
24183
  if (auth.token) {
24126
24184
  return { Authorization: `Bearer ${auth.token}` };
@@ -24145,36 +24203,6 @@ async function listThreads(backendUrl, auth, opts = {}) {
24145
24203
  }
24146
24204
  return res.json();
24147
24205
  }
24148
- function deserializeMessage(msg) {
24149
- if (msg && typeof msg === "object" && "lc" in msg && "kwargs" in msg && msg.type === "constructor") {
24150
- const kwargs = msg.kwargs;
24151
- if (Array.isArray(kwargs.tool_calls)) {
24152
- kwargs.tool_calls = kwargs.tool_calls.map((tc) => {
24153
- if (tc && typeof tc === "object" && "lc" in tc && "kwargs" in tc) {
24154
- return tc.kwargs;
24155
- }
24156
- return tc;
24157
- });
24158
- }
24159
- return kwargs;
24160
- }
24161
- return msg;
24162
- }
24163
- async function getThreadState(backendUrl, auth, threadId) {
24164
- const base2 = getAgoraBaseUrl(backendUrl);
24165
- const res = await fetch(`${base2}/api/unstable/threads/${threadId}`, {
24166
- method: "GET",
24167
- headers: { ...getAuthHeaders(auth) }
24168
- });
24169
- if (!res.ok) {
24170
- throw new Error(`[AthenaSDK] Failed to get thread state: ${res.status}`);
24171
- }
24172
- const data = await res.json();
24173
- if (Array.isArray(data.messages)) {
24174
- data.messages = data.messages.map(deserializeMessage);
24175
- }
24176
- return data;
24177
- }
24178
24206
  async function archiveThread(backendUrl, auth, threadId) {
24179
24207
  const base2 = getAgoraBaseUrl(backendUrl);
24180
24208
  const res = await fetch(`${base2}/api/conversations/threads/archive`, {
@@ -24186,53 +24214,67 @@ async function archiveThread(backendUrl, auth, threadId) {
24186
24214
  throw new Error(`[AthenaSDK] Failed to archive thread: ${res.status}`);
24187
24215
  }
24188
24216
  }
24189
- function createThreadListStore(config2) {
24190
- const auth = { apiKey: config2.apiKey, token: config2.token };
24191
- const store = create((set2, get2) => ({
24192
- threads: [],
24193
- activeThreadId: null,
24194
- isLoading: false,
24195
- error: null,
24196
- fetchThreads: async () => {
24197
- set2({ isLoading: true, error: null });
24217
+ const AthenaThreadIdContext = React.createContext(void 0);
24218
+ function useAthenaThreadId() {
24219
+ return React.useContext(AthenaThreadIdContext);
24220
+ }
24221
+ function useAthenaThreadListAdapter(config2) {
24222
+ const configRef = React.useRef(config2);
24223
+ React.useEffect(() => {
24224
+ configRef.current = config2;
24225
+ }, [config2]);
24226
+ const auth = React.useMemo(
24227
+ () => ({ apiKey: config2.apiKey, token: config2.token }),
24228
+ [config2.apiKey, config2.token]
24229
+ );
24230
+ const unstable_Provider = React.useCallback(
24231
+ function AthenaThreadProvider({ children }) {
24232
+ const aui = useAui();
24233
+ const remoteId = aui.threadListItem().getState().remoteId;
24234
+ return /* @__PURE__ */ jsxRuntime.jsx(AthenaThreadIdContext.Provider, { value: remoteId, children });
24235
+ },
24236
+ []
24237
+ );
24238
+ return React.useMemo(() => ({
24239
+ async list() {
24198
24240
  try {
24199
- const { threads } = await listThreads(config2.backendUrl, auth);
24200
- const sorted = [...threads].sort(
24201
- (a, b) => new Date(b.updated_at).getTime() - new Date(a.updated_at).getTime()
24202
- );
24203
- set2({ threads: sorted, isLoading: false });
24204
- } catch (e) {
24205
- set2({ error: e.message, isLoading: false });
24241
+ const { threads } = await listThreads(configRef.current.backendUrl, auth);
24242
+ return {
24243
+ threads: threads.map((t) => ({
24244
+ status: "regular",
24245
+ remoteId: t.thread_id,
24246
+ title: t.title || void 0
24247
+ }))
24248
+ };
24249
+ } catch (err) {
24250
+ console.error("[AthenaSDK] adapter.list() failed:", err);
24251
+ return { threads: [] };
24206
24252
  }
24207
24253
  },
24208
- switchThread: (threadId) => {
24209
- if (process.env.NODE_ENV !== "production") {
24210
- console.log("[AthenaThreads] switchThread called", { threadId, prev: get2().activeThreadId });
24211
- }
24212
- set2({ activeThreadId: threadId });
24254
+ async initialize(threadId) {
24255
+ return { remoteId: threadId, externalId: void 0 };
24213
24256
  },
24214
- newThread: async () => {
24215
- const localThreadId = `thread_${crypto.randomUUID()}`;
24216
- set2({ activeThreadId: localThreadId });
24217
- return localThreadId;
24257
+ async rename(_remoteId, _newTitle) {
24218
24258
  },
24219
- archiveThread: async (threadId) => {
24220
- var _a2;
24221
- try {
24222
- await archiveThread(config2.backendUrl, auth, threadId);
24223
- const { threads, activeThreadId } = get2();
24224
- const remaining = threads.filter((t) => t.thread_id !== threadId);
24225
- set2({
24226
- threads: remaining,
24227
- activeThreadId: activeThreadId === threadId ? ((_a2 = remaining[0]) == null ? void 0 : _a2.thread_id) ?? null : activeThreadId
24228
- });
24229
- } catch (e) {
24230
- set2({ error: e.message });
24231
- }
24232
- }
24233
- }));
24234
- store.getState().fetchThreads();
24235
- return store;
24259
+ async archive(remoteId) {
24260
+ await archiveThread(configRef.current.backendUrl, auth, remoteId);
24261
+ },
24262
+ async unarchive(_remoteId) {
24263
+ },
24264
+ async delete(remoteId) {
24265
+ await archiveThread(configRef.current.backendUrl, auth, remoteId);
24266
+ },
24267
+ async generateTitle(_remoteId, _messages) {
24268
+ return new Response("").body;
24269
+ },
24270
+ async fetch(remoteId) {
24271
+ return {
24272
+ status: "regular",
24273
+ remoteId
24274
+ };
24275
+ },
24276
+ unstable_Provider
24277
+ }), [auth, unstable_Provider]);
24236
24278
  }
24237
24279
  const THEME_TO_CSS = {
24238
24280
  primary: "--primary",
@@ -24406,7 +24448,7 @@ const themes = {
24406
24448
  radius: "0.625rem"
24407
24449
  }
24408
24450
  };
24409
- function AthenaRuntimeInner({
24451
+ function AthenaStandalone({
24410
24452
  children,
24411
24453
  apiUrl,
24412
24454
  backendUrl,
@@ -24420,13 +24462,10 @@ function AthenaRuntimeInner({
24420
24462
  workbench,
24421
24463
  knowledgeBase,
24422
24464
  systemPrompt,
24423
- threadId,
24424
- initialMessages
24465
+ threadId
24425
24466
  }) {
24426
24467
  const auiTools = React.useMemo(() => Tools({ toolkit: frontendTools }), [frontendTools]);
24427
- const aui = useAui({
24428
- tools: auiTools
24429
- });
24468
+ const aui = useAui({ tools: auiTools });
24430
24469
  const runtime = useAthenaRuntime({
24431
24470
  apiUrl,
24432
24471
  backendUrl,
@@ -24439,8 +24478,7 @@ function AthenaRuntimeInner({
24439
24478
  workbench,
24440
24479
  knowledgeBase,
24441
24480
  systemPrompt,
24442
- threadId,
24443
- initialMessages
24481
+ threadId
24444
24482
  });
24445
24483
  const athenaConfig = React.useMemo(
24446
24484
  () => ({ backendUrl, apiKey, token }),
@@ -24448,6 +24486,72 @@ function AthenaRuntimeInner({
24448
24486
  );
24449
24487
  return /* @__PURE__ */ jsxRuntime.jsx(AssistantRuntimeProvider, { aui, runtime, children: /* @__PURE__ */ jsxRuntime.jsx(AthenaContext.Provider, { value: athenaConfig, children: /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children }) }) });
24450
24488
  }
24489
+ function useAthenaRuntimeHook(config2) {
24490
+ const remoteId = useAthenaThreadId();
24491
+ return useAthenaRuntime({
24492
+ apiUrl: config2.apiUrl,
24493
+ backendUrl: config2.backendUrl,
24494
+ apiKey: config2.apiKey,
24495
+ token: config2.token,
24496
+ model: config2.model,
24497
+ agent: config2.agent,
24498
+ tools: config2.tools,
24499
+ frontendToolIds: config2.frontendToolIds,
24500
+ workbench: config2.workbench,
24501
+ knowledgeBase: config2.knowledgeBase,
24502
+ systemPrompt: config2.systemPrompt,
24503
+ threadId: remoteId
24504
+ });
24505
+ }
24506
+ function AthenaWithThreadList({
24507
+ children,
24508
+ apiUrl,
24509
+ backendUrl,
24510
+ apiKey,
24511
+ token,
24512
+ model,
24513
+ agent: agent2,
24514
+ tools,
24515
+ frontendToolIds,
24516
+ frontendTools,
24517
+ workbench,
24518
+ knowledgeBase,
24519
+ systemPrompt
24520
+ }) {
24521
+ const adapter = useAthenaThreadListAdapter({
24522
+ backendUrl,
24523
+ apiKey,
24524
+ token
24525
+ });
24526
+ const runtimeConfig = React.useMemo(() => ({
24527
+ apiUrl,
24528
+ backendUrl,
24529
+ apiKey,
24530
+ token,
24531
+ model,
24532
+ agent: agent2,
24533
+ tools,
24534
+ frontendToolIds,
24535
+ workbench,
24536
+ knowledgeBase,
24537
+ systemPrompt
24538
+ }), [apiUrl, backendUrl, apiKey, token, model, agent2, tools, frontendToolIds, workbench, knowledgeBase, systemPrompt]);
24539
+ const runtimeHook = React.useCallback(
24540
+ () => useAthenaRuntimeHook(runtimeConfig),
24541
+ [runtimeConfig]
24542
+ );
24543
+ const runtime = useRemoteThreadListRuntime({
24544
+ runtimeHook,
24545
+ adapter
24546
+ });
24547
+ const auiTools = React.useMemo(() => Tools({ toolkit: frontendTools }), [frontendTools]);
24548
+ const aui = useAui({ tools: auiTools });
24549
+ const athenaConfig = React.useMemo(
24550
+ () => ({ backendUrl, apiKey, token }),
24551
+ [backendUrl, apiKey, token]
24552
+ );
24553
+ return /* @__PURE__ */ jsxRuntime.jsx(AssistantRuntimeProvider, { aui, runtime, children: /* @__PURE__ */ jsxRuntime.jsx(AthenaContext.Provider, { value: athenaConfig, children: /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, { children }) }) });
24554
+ }
24451
24555
  function AthenaProvider({
24452
24556
  children,
24453
24557
  apiKey,
@@ -24470,75 +24574,46 @@ function AthenaProvider({
24470
24574
  const parentAuthToken = useParentAuth();
24471
24575
  const effectiveToken = tokenProp ?? parentAuthToken;
24472
24576
  const effectiveBackendUrl = backendUrl ?? DEFAULT_BACKEND_URL;
24473
- const threadListStoreRef = React.useRef(null);
24474
- if (enableThreadList && !threadListStoreRef.current) {
24475
- threadListStoreRef.current = createThreadListStore({
24476
- backendUrl: effectiveBackendUrl,
24477
- apiKey,
24478
- token: effectiveToken
24479
- });
24480
- }
24481
- const activeThreadId = threadListStoreRef.current ? useStore$1(threadListStoreRef.current, (s) => s.activeThreadId) : null;
24482
- const [displayedThreadId, setDisplayedThreadId] = React.useState(null);
24483
- const [loadedMessages, setLoadedMessages] = React.useState(void 0);
24484
- const [isLoadingThread, setIsLoadingThread] = React.useState(false);
24485
- React.useEffect(() => {
24486
- var _a2;
24487
- if (!enableThreadList) return;
24488
- if (activeThreadId === displayedThreadId) return;
24489
- const threads = ((_a2 = threadListStoreRef.current) == null ? void 0 : _a2.getState().threads) ?? [];
24490
- const isExistingThread = threads.some((t) => t.thread_id === activeThreadId);
24491
- if (!isExistingThread) {
24492
- setLoadedMessages(void 0);
24493
- setDisplayedThreadId(activeThreadId);
24494
- setIsLoadingThread(false);
24495
- return;
24496
- }
24497
- let cancelled = false;
24498
- setIsLoadingThread(true);
24499
- getThreadState(effectiveBackendUrl, { apiKey, token: effectiveToken }, activeThreadId).then((state) => {
24500
- if (cancelled) return;
24501
- setLoadedMessages(state.messages ?? []);
24502
- setDisplayedThreadId(activeThreadId);
24503
- setIsLoadingThread(false);
24504
- }).catch((err) => {
24505
- if (cancelled) return;
24506
- if (process.env.NODE_ENV !== "production") {
24507
- console.error("[AthenaSDK] Failed to load thread state:", err);
24577
+ let inner;
24578
+ if (enableThreadList) {
24579
+ inner = /* @__PURE__ */ jsxRuntime.jsx(
24580
+ AthenaWithThreadList,
24581
+ {
24582
+ apiUrl,
24583
+ backendUrl: effectiveBackendUrl,
24584
+ apiKey,
24585
+ token: effectiveToken,
24586
+ model,
24587
+ agent: agent2,
24588
+ tools,
24589
+ frontendToolIds: frontendToolNames,
24590
+ frontendTools,
24591
+ workbench,
24592
+ knowledgeBase,
24593
+ systemPrompt,
24594
+ children
24508
24595
  }
24509
- setLoadedMessages(void 0);
24510
- setDisplayedThreadId(activeThreadId);
24511
- setIsLoadingThread(false);
24512
- });
24513
- return () => {
24514
- cancelled = true;
24515
- };
24516
- }, [activeThreadId, displayedThreadId, enableThreadList, effectiveBackendUrl, apiKey, effectiveToken]);
24517
- const resolvedThreadId = threadIdProp ?? displayedThreadId ?? void 0;
24518
- const runtimeContent = /* @__PURE__ */ jsxRuntime.jsx(ThreadLoadingContext.Provider, { value: isLoadingThread, children: /* @__PURE__ */ jsxRuntime.jsx(
24519
- AthenaRuntimeInner,
24520
- {
24521
- apiUrl,
24522
- backendUrl: effectiveBackendUrl,
24523
- apiKey,
24524
- token: effectiveToken,
24525
- model,
24526
- agent: agent2,
24527
- tools,
24528
- frontendToolIds: frontendToolNames,
24529
- frontendTools,
24530
- workbench,
24531
- knowledgeBase,
24532
- systemPrompt,
24533
- threadId: resolvedThreadId,
24534
- initialMessages: loadedMessages,
24535
- children
24536
- },
24537
- resolvedThreadId ?? "__new__"
24538
- ) });
24539
- let inner = runtimeContent;
24540
- if (enableThreadList && threadListStoreRef.current) {
24541
- inner = /* @__PURE__ */ jsxRuntime.jsx(ThreadListContext.Provider, { value: threadListStoreRef.current, children: inner });
24596
+ );
24597
+ } else {
24598
+ inner = /* @__PURE__ */ jsxRuntime.jsx(
24599
+ AthenaStandalone,
24600
+ {
24601
+ apiUrl,
24602
+ backendUrl: effectiveBackendUrl,
24603
+ apiKey,
24604
+ token: effectiveToken,
24605
+ model,
24606
+ agent: agent2,
24607
+ tools,
24608
+ frontendToolIds: frontendToolNames,
24609
+ frontendTools,
24610
+ workbench,
24611
+ knowledgeBase,
24612
+ systemPrompt,
24613
+ threadId: threadIdProp,
24614
+ children
24615
+ }
24616
+ );
24542
24617
  }
24543
24618
  if (themeStyleVars) {
24544
24619
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "athena-themed", style: themeStyleVars, children: inner });
@@ -57336,10 +57411,10 @@ const HorizontalRule$1 = HorizontalRule.extend({
57336
57411
  };
57337
57412
  }
57338
57413
  });
57339
- const Image = Node3.create({
57414
+ const Image$1 = Node3.create({
57340
57415
  name: "image"
57341
57416
  });
57342
- const Image$1 = Image.extend({
57417
+ const Image$1$1 = Image$1.extend({
57343
57418
  /**
57344
57419
  * @return {{markdown: MarkdownNodeSpec}}
57345
57420
  */
@@ -57623,10 +57698,10 @@ const Italic$1 = Italic.extend({
57623
57698
  };
57624
57699
  }
57625
57700
  });
57626
- const Link = Mark2.create({
57701
+ const Link$1 = Mark2.create({
57627
57702
  name: "link"
57628
57703
  });
57629
- const Link$1 = Link.extend({
57704
+ const Link$1$1 = Link$1.extend({
57630
57705
  /**
57631
57706
  * @return {{markdown: MarkdownMarkSpec}}
57632
57707
  */
@@ -57663,7 +57738,7 @@ const Strike$1 = Strike.extend({
57663
57738
  };
57664
57739
  }
57665
57740
  });
57666
- const markdownExtensions = [Blockquote$1, BulletList$1, CodeBlock$1, HardBreak$1, Heading$1, HorizontalRule$1, HTMLNode, Image$1, ListItem$1, OrderedList$1, Paragraph$1, Table$1, TaskItem$1, TaskList$1, Text$1, Bold$1, Code$1$1, HTMLMark, Italic$1, Link$1, Strike$1];
57741
+ const markdownExtensions = [Blockquote$1, BulletList$1, CodeBlock$1, HardBreak$1, Heading$1, HorizontalRule$1, HTMLNode, Image$1$1, ListItem$1, OrderedList$1, Paragraph$1, Table$1, TaskItem$1, TaskList$1, Text$1, Bold$1, Code$1$1, HTMLMark, Italic$1, Link$1$1, Strike$1];
57667
57742
  function getMarkdownSpec(extension) {
57668
57743
  var _extension$storage, _markdownExtensions$f;
57669
57744
  const markdownSpec = (_extension$storage = extension.storage) === null || _extension$storage === void 0 ? void 0 : _extension$storage.markdown;
@@ -60476,41 +60551,41 @@ const createLucideIcon = (iconName, iconNode) => {
60476
60551
  * This source code is licensed under the ISC license.
60477
60552
  * See the LICENSE file in the root directory of this source tree.
60478
60553
  */
60479
- const __iconNode$E = [
60554
+ const __iconNode$J = [
60480
60555
  ["rect", { width: "20", height: "5", x: "2", y: "3", rx: "1", key: "1wp1u1" }],
60481
60556
  ["path", { d: "M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8", key: "1s80jp" }],
60482
60557
  ["path", { d: "M10 12h4", key: "a56b0p" }]
60483
60558
  ];
60484
- const Archive = createLucideIcon("archive", __iconNode$E);
60559
+ const Archive = createLucideIcon("archive", __iconNode$J);
60485
60560
  /**
60486
60561
  * @license lucide-react v0.575.0 - ISC
60487
60562
  *
60488
60563
  * This source code is licensed under the ISC license.
60489
60564
  * See the LICENSE file in the root directory of this source tree.
60490
60565
  */
60491
- const __iconNode$D = [
60566
+ const __iconNode$I = [
60492
60567
  ["path", { d: "M12 5v14", key: "s699le" }],
60493
60568
  ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
60494
60569
  ];
60495
- const ArrowDown = createLucideIcon("arrow-down", __iconNode$D);
60570
+ const ArrowDown = createLucideIcon("arrow-down", __iconNode$I);
60496
60571
  /**
60497
60572
  * @license lucide-react v0.575.0 - ISC
60498
60573
  *
60499
60574
  * This source code is licensed under the ISC license.
60500
60575
  * See the LICENSE file in the root directory of this source tree.
60501
60576
  */
60502
- const __iconNode$C = [
60577
+ const __iconNode$H = [
60503
60578
  ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
60504
60579
  ["path", { d: "M12 19V5", key: "x0mq9r" }]
60505
60580
  ];
60506
- const ArrowUp = createLucideIcon("arrow-up", __iconNode$C);
60581
+ const ArrowUp = createLucideIcon("arrow-up", __iconNode$H);
60507
60582
  /**
60508
60583
  * @license lucide-react v0.575.0 - ISC
60509
60584
  *
60510
60585
  * This source code is licensed under the ISC license.
60511
60586
  * See the LICENSE file in the root directory of this source tree.
60512
60587
  */
60513
- const __iconNode$B = [
60588
+ const __iconNode$G = [
60514
60589
  ["path", { d: "M12 7v14", key: "1akyts" }],
60515
60590
  [
60516
60591
  "path",
@@ -60520,14 +60595,14 @@ const __iconNode$B = [
60520
60595
  }
60521
60596
  ]
60522
60597
  ];
60523
- const BookOpen = createLucideIcon("book-open", __iconNode$B);
60598
+ const BookOpen = createLucideIcon("book-open", __iconNode$G);
60524
60599
  /**
60525
60600
  * @license lucide-react v0.575.0 - ISC
60526
60601
  *
60527
60602
  * This source code is licensed under the ISC license.
60528
60603
  * See the LICENSE file in the root directory of this source tree.
60529
60604
  */
60530
- const __iconNode$A = [
60605
+ const __iconNode$F = [
60531
60606
  ["path", { d: "M12 18V5", key: "adv99a" }],
60532
60607
  ["path", { d: "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4", key: "1e3is1" }],
60533
60608
  ["path", { d: "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5", key: "1gqd8o" }],
@@ -60537,148 +60612,148 @@ const __iconNode$A = [
60537
60612
  ["path", { d: "M6 18a4 4 0 0 1-2-7.464", key: "k1g0md" }],
60538
60613
  ["path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77", key: "q97ue3" }]
60539
60614
  ];
60540
- const Brain = createLucideIcon("brain", __iconNode$A);
60615
+ const Brain = createLucideIcon("brain", __iconNode$F);
60541
60616
  /**
60542
60617
  * @license lucide-react v0.575.0 - ISC
60543
60618
  *
60544
60619
  * This source code is licensed under the ISC license.
60545
60620
  * See the LICENSE file in the root directory of this source tree.
60546
60621
  */
60547
- const __iconNode$z = [
60622
+ const __iconNode$E = [
60548
60623
  ["path", { d: "M3 3v16a2 2 0 0 0 2 2h16", key: "c24i48" }],
60549
60624
  ["path", { d: "M18 17V9", key: "2bz60n" }],
60550
60625
  ["path", { d: "M13 17V5", key: "1frdt8" }],
60551
60626
  ["path", { d: "M8 17v-3", key: "17ska0" }]
60552
60627
  ];
60553
- const ChartColumn = createLucideIcon("chart-column", __iconNode$z);
60628
+ const ChartColumn = createLucideIcon("chart-column", __iconNode$E);
60554
60629
  /**
60555
60630
  * @license lucide-react v0.575.0 - ISC
60556
60631
  *
60557
60632
  * This source code is licensed under the ISC license.
60558
60633
  * See the LICENSE file in the root directory of this source tree.
60559
60634
  */
60560
- const __iconNode$y = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
60561
- const Check = createLucideIcon("check", __iconNode$y);
60635
+ const __iconNode$D = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
60636
+ const Check = createLucideIcon("check", __iconNode$D);
60562
60637
  /**
60563
60638
  * @license lucide-react v0.575.0 - ISC
60564
60639
  *
60565
60640
  * This source code is licensed under the ISC license.
60566
60641
  * See the LICENSE file in the root directory of this source tree.
60567
60642
  */
60568
- const __iconNode$x = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
60569
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$x);
60643
+ const __iconNode$C = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
60644
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$C);
60570
60645
  /**
60571
60646
  * @license lucide-react v0.575.0 - ISC
60572
60647
  *
60573
60648
  * This source code is licensed under the ISC license.
60574
60649
  * See the LICENSE file in the root directory of this source tree.
60575
60650
  */
60576
- const __iconNode$w = [
60651
+ const __iconNode$B = [
60577
60652
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
60578
60653
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
60579
60654
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
60580
60655
  ];
60581
- const CircleAlert = createLucideIcon("circle-alert", __iconNode$w);
60656
+ const CircleAlert = createLucideIcon("circle-alert", __iconNode$B);
60582
60657
  /**
60583
60658
  * @license lucide-react v0.575.0 - ISC
60584
60659
  *
60585
60660
  * This source code is licensed under the ISC license.
60586
60661
  * See the LICENSE file in the root directory of this source tree.
60587
60662
  */
60588
- const __iconNode$v = [
60663
+ const __iconNode$A = [
60589
60664
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
60590
60665
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
60591
60666
  ];
60592
- const CircleCheck = createLucideIcon("circle-check", __iconNode$v);
60667
+ const CircleCheck = createLucideIcon("circle-check", __iconNode$A);
60593
60668
  /**
60594
60669
  * @license lucide-react v0.575.0 - ISC
60595
60670
  *
60596
60671
  * This source code is licensed under the ISC license.
60597
60672
  * See the LICENSE file in the root directory of this source tree.
60598
60673
  */
60599
- const __iconNode$u = [
60674
+ const __iconNode$z = [
60600
60675
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
60601
60676
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
60602
60677
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
60603
60678
  ];
60604
- const CircleX = createLucideIcon("circle-x", __iconNode$u);
60679
+ const CircleX = createLucideIcon("circle-x", __iconNode$z);
60605
60680
  /**
60606
60681
  * @license lucide-react v0.575.0 - ISC
60607
60682
  *
60608
60683
  * This source code is licensed under the ISC license.
60609
60684
  * See the LICENSE file in the root directory of this source tree.
60610
60685
  */
60611
- const __iconNode$t = [
60686
+ const __iconNode$y = [
60612
60687
  ["path", { d: "m16 18 6-6-6-6", key: "eg8j8" }],
60613
60688
  ["path", { d: "m8 6-6 6 6 6", key: "ppft3o" }]
60614
60689
  ];
60615
- const Code = createLucideIcon("code", __iconNode$t);
60690
+ const Code = createLucideIcon("code", __iconNode$y);
60616
60691
  /**
60617
60692
  * @license lucide-react v0.575.0 - ISC
60618
60693
  *
60619
60694
  * This source code is licensed under the ISC license.
60620
60695
  * See the LICENSE file in the root directory of this source tree.
60621
60696
  */
60622
- const __iconNode$s = [
60697
+ const __iconNode$x = [
60623
60698
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
60624
60699
  ["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" }]
60625
60700
  ];
60626
- const Copy = createLucideIcon("copy", __iconNode$s);
60701
+ const Copy = createLucideIcon("copy", __iconNode$x);
60627
60702
  /**
60628
60703
  * @license lucide-react v0.575.0 - ISC
60629
60704
  *
60630
60705
  * This source code is licensed under the ISC license.
60631
60706
  * See the LICENSE file in the root directory of this source tree.
60632
60707
  */
60633
- const __iconNode$r = [
60708
+ const __iconNode$w = [
60634
60709
  ["ellipse", { cx: "12", cy: "5", rx: "9", ry: "3", key: "msslwz" }],
60635
60710
  ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5", key: "1wlel7" }],
60636
60711
  ["path", { d: "M3 12A9 3 0 0 0 21 12", key: "mv7ke4" }]
60637
60712
  ];
60638
- const Database = createLucideIcon("database", __iconNode$r);
60713
+ const Database = createLucideIcon("database", __iconNode$w);
60639
60714
  /**
60640
60715
  * @license lucide-react v0.575.0 - ISC
60641
60716
  *
60642
60717
  * This source code is licensed under the ISC license.
60643
60718
  * See the LICENSE file in the root directory of this source tree.
60644
60719
  */
60645
- const __iconNode$q = [
60720
+ const __iconNode$v = [
60646
60721
  ["path", { d: "M12 15V3", key: "m9g1x1" }],
60647
60722
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
60648
60723
  ["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
60649
60724
  ];
60650
- const Download = createLucideIcon("download", __iconNode$q);
60725
+ const Download = createLucideIcon("download", __iconNode$v);
60651
60726
  /**
60652
60727
  * @license lucide-react v0.575.0 - ISC
60653
60728
  *
60654
60729
  * This source code is licensed under the ISC license.
60655
60730
  * See the LICENSE file in the root directory of this source tree.
60656
60731
  */
60657
- const __iconNode$p = [
60732
+ const __iconNode$u = [
60658
60733
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
60659
60734
  ["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
60660
60735
  ["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
60661
60736
  ];
60662
- const Ellipsis = createLucideIcon("ellipsis", __iconNode$p);
60737
+ const Ellipsis = createLucideIcon("ellipsis", __iconNode$u);
60663
60738
  /**
60664
60739
  * @license lucide-react v0.575.0 - ISC
60665
60740
  *
60666
60741
  * This source code is licensed under the ISC license.
60667
60742
  * See the LICENSE file in the root directory of this source tree.
60668
60743
  */
60669
- const __iconNode$o = [
60744
+ const __iconNode$t = [
60670
60745
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
60671
60746
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
60672
60747
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
60673
60748
  ];
60674
- const ExternalLink = createLucideIcon("external-link", __iconNode$o);
60749
+ const ExternalLink = createLucideIcon("external-link", __iconNode$t);
60675
60750
  /**
60676
60751
  * @license lucide-react v0.575.0 - ISC
60677
60752
  *
60678
60753
  * This source code is licensed under the ISC license.
60679
60754
  * See the LICENSE file in the root directory of this source tree.
60680
60755
  */
60681
- const __iconNode$n = [
60756
+ const __iconNode$s = [
60682
60757
  [
60683
60758
  "path",
60684
60759
  {
@@ -60690,14 +60765,14 @@ const __iconNode$n = [
60690
60765
  ["path", { d: "M9 15h6", key: "cctwl0" }],
60691
60766
  ["path", { d: "M12 18v-6", key: "17g6i2" }]
60692
60767
  ];
60693
- const FilePlus = createLucideIcon("file-plus", __iconNode$n);
60768
+ const FilePlus = createLucideIcon("file-plus", __iconNode$s);
60694
60769
  /**
60695
60770
  * @license lucide-react v0.575.0 - ISC
60696
60771
  *
60697
60772
  * This source code is licensed under the ISC license.
60698
60773
  * See the LICENSE file in the root directory of this source tree.
60699
60774
  */
60700
- const __iconNode$m = [
60775
+ const __iconNode$r = [
60701
60776
  [
60702
60777
  "path",
60703
60778
  {
@@ -60711,14 +60786,14 @@ const __iconNode$m = [
60711
60786
  ["path", { d: "M8 17h2", key: "2yhykz" }],
60712
60787
  ["path", { d: "M14 17h2", key: "10kma7" }]
60713
60788
  ];
60714
- const FileSpreadsheet = createLucideIcon("file-spreadsheet", __iconNode$m);
60789
+ const FileSpreadsheet = createLucideIcon("file-spreadsheet", __iconNode$r);
60715
60790
  /**
60716
60791
  * @license lucide-react v0.575.0 - ISC
60717
60792
  *
60718
60793
  * This source code is licensed under the ISC license.
60719
60794
  * See the LICENSE file in the root directory of this source tree.
60720
60795
  */
60721
- const __iconNode$l = [
60796
+ const __iconNode$q = [
60722
60797
  [
60723
60798
  "path",
60724
60799
  {
@@ -60731,14 +60806,14 @@ const __iconNode$l = [
60731
60806
  ["path", { d: "M16 13H8", key: "t4e002" }],
60732
60807
  ["path", { d: "M16 17H8", key: "z1uh3a" }]
60733
60808
  ];
60734
- const FileText = createLucideIcon("file-text", __iconNode$l);
60809
+ const FileText = createLucideIcon("file-text", __iconNode$q);
60735
60810
  /**
60736
60811
  * @license lucide-react v0.575.0 - ISC
60737
60812
  *
60738
60813
  * This source code is licensed under the ISC license.
60739
60814
  * See the LICENSE file in the root directory of this source tree.
60740
60815
  */
60741
- const __iconNode$k = [
60816
+ const __iconNode$p = [
60742
60817
  [
60743
60818
  "path",
60744
60819
  {
@@ -60748,26 +60823,54 @@ const __iconNode$k = [
60748
60823
  ],
60749
60824
  ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }]
60750
60825
  ];
60751
- const File$1 = createLucideIcon("file", __iconNode$k);
60826
+ const File$1 = createLucideIcon("file", __iconNode$p);
60752
60827
  /**
60753
60828
  * @license lucide-react v0.575.0 - ISC
60754
60829
  *
60755
60830
  * This source code is licensed under the ISC license.
60756
60831
  * See the LICENSE file in the root directory of this source tree.
60757
60832
  */
60758
- const __iconNode$j = [
60833
+ const __iconNode$o = [
60834
+ [
60835
+ "path",
60836
+ {
60837
+ d: "m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",
60838
+ key: "usdka0"
60839
+ }
60840
+ ]
60841
+ ];
60842
+ const FolderOpen = createLucideIcon("folder-open", __iconNode$o);
60843
+ /**
60844
+ * @license lucide-react v0.575.0 - ISC
60845
+ *
60846
+ * This source code is licensed under the ISC license.
60847
+ * See the LICENSE file in the root directory of this source tree.
60848
+ */
60849
+ const __iconNode$n = [
60759
60850
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
60760
60851
  ["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
60761
60852
  ["path", { d: "M2 12h20", key: "9i4pu4" }]
60762
60853
  ];
60763
- const Globe = createLucideIcon("globe", __iconNode$j);
60854
+ const Globe = createLucideIcon("globe", __iconNode$n);
60764
60855
  /**
60765
60856
  * @license lucide-react v0.575.0 - ISC
60766
60857
  *
60767
60858
  * This source code is licensed under the ISC license.
60768
60859
  * See the LICENSE file in the root directory of this source tree.
60769
60860
  */
60770
- const __iconNode$i = [
60861
+ const __iconNode$m = [
60862
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
60863
+ ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
60864
+ ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
60865
+ ];
60866
+ const Image = createLucideIcon("image", __iconNode$m);
60867
+ /**
60868
+ * @license lucide-react v0.575.0 - ISC
60869
+ *
60870
+ * This source code is licensed under the ISC license.
60871
+ * See the LICENSE file in the root directory of this source tree.
60872
+ */
60873
+ const __iconNode$l = [
60771
60874
  [
60772
60875
  "path",
60773
60876
  {
@@ -60790,35 +60893,46 @@ const __iconNode$i = [
60790
60893
  }
60791
60894
  ]
60792
60895
  ];
60793
- const Layers = createLucideIcon("layers", __iconNode$i);
60896
+ const Layers = createLucideIcon("layers", __iconNode$l);
60794
60897
  /**
60795
60898
  * @license lucide-react v0.575.0 - ISC
60796
60899
  *
60797
60900
  * This source code is licensed under the ISC license.
60798
60901
  * See the LICENSE file in the root directory of this source tree.
60799
60902
  */
60800
- const __iconNode$h = [
60903
+ const __iconNode$k = [
60801
60904
  ["rect", { width: "7", height: "7", x: "3", y: "3", rx: "1", key: "1g98yp" }],
60802
60905
  ["rect", { width: "7", height: "7", x: "14", y: "3", rx: "1", key: "6d4xhi" }],
60803
60906
  ["rect", { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "nxv5o0" }],
60804
60907
  ["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }]
60805
60908
  ];
60806
- const LayoutGrid = createLucideIcon("layout-grid", __iconNode$h);
60909
+ const LayoutGrid = createLucideIcon("layout-grid", __iconNode$k);
60807
60910
  /**
60808
60911
  * @license lucide-react v0.575.0 - ISC
60809
60912
  *
60810
60913
  * This source code is licensed under the ISC license.
60811
60914
  * See the LICENSE file in the root directory of this source tree.
60812
60915
  */
60813
- const __iconNode$g = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
60814
- const LoaderCircle = createLucideIcon("loader-circle", __iconNode$g);
60916
+ const __iconNode$j = [
60917
+ ["path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", key: "1cjeqo" }],
60918
+ ["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }]
60919
+ ];
60920
+ const Link = createLucideIcon("link", __iconNode$j);
60815
60921
  /**
60816
60922
  * @license lucide-react v0.575.0 - ISC
60817
60923
  *
60818
60924
  * This source code is licensed under the ISC license.
60819
60925
  * See the LICENSE file in the root directory of this source tree.
60820
60926
  */
60821
- const __iconNode$f = [
60927
+ const __iconNode$i = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
60928
+ const LoaderCircle = createLucideIcon("loader-circle", __iconNode$i);
60929
+ /**
60930
+ * @license lucide-react v0.575.0 - ISC
60931
+ *
60932
+ * This source code is licensed under the ISC license.
60933
+ * See the LICENSE file in the root directory of this source tree.
60934
+ */
60935
+ const __iconNode$h = [
60822
60936
  ["path", { d: "M12 2v4", key: "3427ic" }],
60823
60937
  ["path", { d: "m16.2 7.8 2.9-2.9", key: "r700ao" }],
60824
60938
  ["path", { d: "M18 12h4", key: "wj9ykh" }],
@@ -60828,38 +60942,38 @@ const __iconNode$f = [
60828
60942
  ["path", { d: "M2 12h4", key: "j09sii" }],
60829
60943
  ["path", { d: "m4.9 4.9 2.9 2.9", key: "giyufr" }]
60830
60944
  ];
60831
- const Loader = createLucideIcon("loader", __iconNode$f);
60945
+ const Loader = createLucideIcon("loader", __iconNode$h);
60832
60946
  /**
60833
60947
  * @license lucide-react v0.575.0 - ISC
60834
60948
  *
60835
60949
  * This source code is licensed under the ISC license.
60836
60950
  * See the LICENSE file in the root directory of this source tree.
60837
60951
  */
60838
- const __iconNode$e = [
60952
+ const __iconNode$g = [
60839
60953
  ["path", { d: "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7", key: "132q7q" }],
60840
60954
  ["rect", { x: "2", y: "4", width: "20", height: "16", rx: "2", key: "izxlao" }]
60841
60955
  ];
60842
- const Mail = createLucideIcon("mail", __iconNode$e);
60956
+ const Mail = createLucideIcon("mail", __iconNode$g);
60843
60957
  /**
60844
60958
  * @license lucide-react v0.575.0 - ISC
60845
60959
  *
60846
60960
  * This source code is licensed under the ISC license.
60847
60961
  * See the LICENSE file in the root directory of this source tree.
60848
60962
  */
60849
- const __iconNode$d = [
60963
+ const __iconNode$f = [
60850
60964
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
60851
60965
  ["path", { d: "m21 3-7 7", key: "1l2asr" }],
60852
60966
  ["path", { d: "m3 21 7-7", key: "tjx5ai" }],
60853
60967
  ["path", { d: "M9 21H3v-6", key: "wtvkvv" }]
60854
60968
  ];
60855
- const Maximize2 = createLucideIcon("maximize-2", __iconNode$d);
60969
+ const Maximize2 = createLucideIcon("maximize-2", __iconNode$f);
60856
60970
  /**
60857
60971
  * @license lucide-react v0.575.0 - ISC
60858
60972
  *
60859
60973
  * This source code is licensed under the ISC license.
60860
60974
  * See the LICENSE file in the root directory of this source tree.
60861
60975
  */
60862
- const __iconNode$c = [
60976
+ const __iconNode$e = [
60863
60977
  [
60864
60978
  "path",
60865
60979
  {
@@ -60868,39 +60982,39 @@ const __iconNode$c = [
60868
60982
  }
60869
60983
  ]
60870
60984
  ];
60871
- const MessageSquare = createLucideIcon("message-square", __iconNode$c);
60985
+ const MessageSquare = createLucideIcon("message-square", __iconNode$e);
60872
60986
  /**
60873
60987
  * @license lucide-react v0.575.0 - ISC
60874
60988
  *
60875
60989
  * This source code is licensed under the ISC license.
60876
60990
  * See the LICENSE file in the root directory of this source tree.
60877
60991
  */
60878
- const __iconNode$b = [
60992
+ const __iconNode$d = [
60879
60993
  ["path", { d: "m14 10 7-7", key: "oa77jy" }],
60880
60994
  ["path", { d: "M20 10h-6V4", key: "mjg0md" }],
60881
60995
  ["path", { d: "m3 21 7-7", key: "tjx5ai" }],
60882
60996
  ["path", { d: "M4 14h6v6", key: "rmj7iw" }]
60883
60997
  ];
60884
- const Minimize2 = createLucideIcon("minimize-2", __iconNode$b);
60998
+ const Minimize2 = createLucideIcon("minimize-2", __iconNode$d);
60885
60999
  /**
60886
61000
  * @license lucide-react v0.575.0 - ISC
60887
61001
  *
60888
61002
  * This source code is licensed under the ISC license.
60889
61003
  * See the LICENSE file in the root directory of this source tree.
60890
61004
  */
60891
- const __iconNode$a = [
61005
+ const __iconNode$c = [
60892
61006
  ["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
60893
61007
  ["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
60894
61008
  ["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
60895
61009
  ];
60896
- const Monitor = createLucideIcon("monitor", __iconNode$a);
61010
+ const Monitor = createLucideIcon("monitor", __iconNode$c);
60897
61011
  /**
60898
61012
  * @license lucide-react v0.575.0 - ISC
60899
61013
  *
60900
61014
  * This source code is licensed under the ISC license.
60901
61015
  * See the LICENSE file in the root directory of this source tree.
60902
61016
  */
60903
- const __iconNode$9 = [
61017
+ const __iconNode$b = [
60904
61018
  ["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" }],
60905
61019
  ["path", { d: "M2 6h4", key: "aawbzj" }],
60906
61020
  ["path", { d: "M2 10h4", key: "l0bgd4" }],
@@ -60914,14 +61028,14 @@ const __iconNode$9 = [
60914
61028
  }
60915
61029
  ]
60916
61030
  ];
60917
- const NotebookPen = createLucideIcon("notebook-pen", __iconNode$9);
61031
+ const NotebookPen = createLucideIcon("notebook-pen", __iconNode$b);
60918
61032
  /**
60919
61033
  * @license lucide-react v0.575.0 - ISC
60920
61034
  *
60921
61035
  * This source code is licensed under the ISC license.
60922
61036
  * See the LICENSE file in the root directory of this source tree.
60923
61037
  */
60924
- const __iconNode$8 = [
61038
+ const __iconNode$a = [
60925
61039
  ["path", { d: "M13 21h8", key: "1jsn5i" }],
60926
61040
  [
60927
61041
  "path",
@@ -60931,61 +61045,61 @@ const __iconNode$8 = [
60931
61045
  }
60932
61046
  ]
60933
61047
  ];
60934
- const PenLine = createLucideIcon("pen-line", __iconNode$8);
61048
+ const PenLine = createLucideIcon("pen-line", __iconNode$a);
60935
61049
  /**
60936
61050
  * @license lucide-react v0.575.0 - ISC
60937
61051
  *
60938
61052
  * This source code is licensed under the ISC license.
60939
61053
  * See the LICENSE file in the root directory of this source tree.
60940
61054
  */
60941
- const __iconNode$7 = [
61055
+ const __iconNode$9 = [
60942
61056
  ["path", { d: "M5 12h14", key: "1ays0h" }],
60943
61057
  ["path", { d: "M12 5v14", key: "s699le" }]
60944
61058
  ];
60945
- const Plus = createLucideIcon("plus", __iconNode$7);
61059
+ const Plus = createLucideIcon("plus", __iconNode$9);
60946
61060
  /**
60947
61061
  * @license lucide-react v0.575.0 - ISC
60948
61062
  *
60949
61063
  * This source code is licensed under the ISC license.
60950
61064
  * See the LICENSE file in the root directory of this source tree.
60951
61065
  */
60952
- const __iconNode$6 = [
61066
+ const __iconNode$8 = [
60953
61067
  ["path", { d: "M2 3h20", key: "91anmk" }],
60954
61068
  ["path", { d: "M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3", key: "2k9sn8" }],
60955
61069
  ["path", { d: "m7 21 5-5 5 5", key: "bip4we" }]
60956
61070
  ];
60957
- const Presentation = createLucideIcon("presentation", __iconNode$6);
61071
+ const Presentation = createLucideIcon("presentation", __iconNode$8);
60958
61072
  /**
60959
61073
  * @license lucide-react v0.575.0 - ISC
60960
61074
  *
60961
61075
  * This source code is licensed under the ISC license.
60962
61076
  * See the LICENSE file in the root directory of this source tree.
60963
61077
  */
60964
- const __iconNode$5 = [
61078
+ const __iconNode$7 = [
60965
61079
  ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
60966
61080
  ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
60967
61081
  ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
60968
61082
  ["path", { d: "M8 16H3v5", key: "1cv678" }]
60969
61083
  ];
60970
- const RefreshCw = createLucideIcon("refresh-cw", __iconNode$5);
61084
+ const RefreshCw = createLucideIcon("refresh-cw", __iconNode$7);
60971
61085
  /**
60972
61086
  * @license lucide-react v0.575.0 - ISC
60973
61087
  *
60974
61088
  * This source code is licensed under the ISC license.
60975
61089
  * See the LICENSE file in the root directory of this source tree.
60976
61090
  */
60977
- const __iconNode$4 = [
61091
+ const __iconNode$6 = [
60978
61092
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
60979
61093
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
60980
61094
  ];
60981
- const Search = createLucideIcon("search", __iconNode$4);
61095
+ const Search = createLucideIcon("search", __iconNode$6);
60982
61096
  /**
60983
61097
  * @license lucide-react v0.575.0 - ISC
60984
61098
  *
60985
61099
  * This source code is licensed under the ISC license.
60986
61100
  * See the LICENSE file in the root directory of this source tree.
60987
61101
  */
60988
- const __iconNode$3 = [
61102
+ const __iconNode$5 = [
60989
61103
  [
60990
61104
  "path",
60991
61105
  {
@@ -60995,17 +61109,46 @@ const __iconNode$3 = [
60995
61109
  ],
60996
61110
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
60997
61111
  ];
60998
- const Settings = createLucideIcon("settings", __iconNode$3);
61112
+ const Settings = createLucideIcon("settings", __iconNode$5);
60999
61113
  /**
61000
61114
  * @license lucide-react v0.575.0 - ISC
61001
61115
  *
61002
61116
  * This source code is licensed under the ISC license.
61003
61117
  * See the LICENSE file in the root directory of this source tree.
61004
61118
  */
61005
- const __iconNode$2 = [
61119
+ const __iconNode$4 = [
61006
61120
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }]
61007
61121
  ];
61008
- const Square = createLucideIcon("square", __iconNode$2);
61122
+ const Square = createLucideIcon("square", __iconNode$4);
61123
+ /**
61124
+ * @license lucide-react v0.575.0 - ISC
61125
+ *
61126
+ * This source code is licensed under the ISC license.
61127
+ * See the LICENSE file in the root directory of this source tree.
61128
+ */
61129
+ const __iconNode$3 = [
61130
+ ["path", { d: "M12 19h8", key: "baeox8" }],
61131
+ ["path", { d: "m4 17 6-6-6-6", key: "1yngyt" }]
61132
+ ];
61133
+ const Terminal = createLucideIcon("terminal", __iconNode$3);
61134
+ /**
61135
+ * @license lucide-react v0.575.0 - ISC
61136
+ *
61137
+ * This source code is licensed under the ISC license.
61138
+ * See the LICENSE file in the root directory of this source tree.
61139
+ */
61140
+ const __iconNode$2 = [
61141
+ [
61142
+ "path",
61143
+ {
61144
+ d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
61145
+ key: "wmoenq"
61146
+ }
61147
+ ],
61148
+ ["path", { d: "M12 9v4", key: "juzpu7" }],
61149
+ ["path", { d: "M12 17h.01", key: "p32p05" }]
61150
+ ];
61151
+ const TriangleAlert = createLucideIcon("triangle-alert", __iconNode$2);
61009
61152
  /**
61010
61153
  * @license lucide-react v0.575.0 - ISC
61011
61154
  *
@@ -61128,6 +61271,8 @@ const TOOL_META = {
61128
61271
  // Workflows
61129
61272
  create_new_aop: { displayName: "Creating workflow", icon: Brain },
61130
61273
  execute_aop: { displayName: "Running workflow", icon: Brain },
61274
+ // Drive / Assets
61275
+ open_asset_in_workspace: { displayName: "Opening asset", icon: FolderOpen },
61131
61276
  // Preferences
61132
61277
  save_preference_as_memory: { displayName: "Saving preference", icon: Settings }
61133
61278
  };
@@ -61178,6 +61323,14 @@ function extractAssetId$1(result) {
61178
61323
  }
61179
61324
  return null;
61180
61325
  }
61326
+ function extractAssetIdFromArgs(argsText) {
61327
+ if (!argsText) return null;
61328
+ const parsed = tryParseJson$2(argsText);
61329
+ if (!parsed) return null;
61330
+ const id = parsed.asset_id ?? parsed.assetId;
61331
+ if (typeof id === "string" && id.startsWith("asset_")) return id;
61332
+ return null;
61333
+ }
61181
61334
  function toolMetaToAssetType(toolName) {
61182
61335
  const lower = toolName.toLowerCase();
61183
61336
  if (lower.includes("presentation") || lower.includes("pptx") || lower.includes("slide") || lower.includes("powerpoint"))
@@ -61186,13 +61339,16 @@ function toolMetaToAssetType(toolName) {
61186
61339
  return "spreadsheet";
61187
61340
  if (lower.includes("document") || lower.includes("doc") || lower.includes("markdown"))
61188
61341
  return "document";
61342
+ if (lower.includes("notebook"))
61343
+ return "notebook";
61189
61344
  return "unknown";
61190
61345
  }
61191
61346
  const CREATE_ASSET_TOOLS = [
61192
61347
  "create_powerpoint_deck",
61193
61348
  "create_document_from_markdown",
61194
61349
  "create_new_document",
61195
- "create_new_sheet"
61350
+ "create_new_sheet",
61351
+ "create_new_notebook"
61196
61352
  ];
61197
61353
  function isAssetTool(toolName, result) {
61198
61354
  return CREATE_ASSET_TOOLS.includes(toolName.toLowerCase()) || extractAssetId$1(result) !== null;
@@ -61541,6 +61697,22 @@ function AssetToolCard({
61541
61697
  ] })
61542
61698
  ] });
61543
61699
  }
61700
+ function AssetOpenLink({ assetId, toolName }) {
61701
+ const openAsset = useAssetPanelStore((s) => s.openAsset);
61702
+ const assetType = toolMetaToAssetType(toolName);
61703
+ return /* @__PURE__ */ jsxRuntime.jsx(
61704
+ "button",
61705
+ {
61706
+ onClick: (e) => {
61707
+ e.stopPropagation();
61708
+ openAsset(assetId, { type: assetType });
61709
+ },
61710
+ className: "flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground/50 transition-colors hover:bg-muted/50 hover:text-foreground",
61711
+ title: "Open asset",
61712
+ children: /* @__PURE__ */ jsxRuntime.jsx(Link, { className: "size-3" })
61713
+ }
61714
+ );
61715
+ }
61544
61716
  const ToolFallbackImpl = ({
61545
61717
  toolName,
61546
61718
  argsText,
@@ -61559,12 +61731,19 @@ const ToolFallbackImpl = ({
61559
61731
  }
61560
61732
  );
61561
61733
  }
61734
+ const isComplete = (status == null ? void 0 : status.type) === "complete" || !status;
61735
+ const resultAssetId = extractAssetId$1(result);
61736
+ const argsAssetId = extractAssetIdFromArgs(argsText);
61737
+ const fallbackAssetId = resultAssetId ?? argsAssetId;
61562
61738
  return /* @__PURE__ */ jsxRuntime.jsxs(
61563
61739
  ToolFallbackRoot,
61564
61740
  {
61565
61741
  className: cn(isCancelled && "border-muted-foreground/30 bg-muted/30"),
61566
61742
  children: [
61567
- /* @__PURE__ */ jsxRuntime.jsx(ToolFallbackTrigger, { toolName, argsText, result, status }),
61743
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center", children: [
61744
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(ToolFallbackTrigger, { toolName, argsText, result, status }) }),
61745
+ fallbackAssetId && isComplete && !isCancelled && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 pr-2", children: /* @__PURE__ */ jsxRuntime.jsx(AssetOpenLink, { assetId: fallbackAssetId, toolName }) })
61746
+ ] }),
61568
61747
  /* @__PURE__ */ jsxRuntime.jsxs(ToolFallbackContent, { children: [
61569
61748
  /* @__PURE__ */ jsxRuntime.jsx(ToolFallbackError, { status }),
61570
61749
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -62294,6 +62473,190 @@ const CreateEmailDraftToolUI = React.memo(
62294
62473
  CreateEmailDraftToolUIImpl
62295
62474
  );
62296
62475
  CreateEmailDraftToolUI.displayName = "CreateEmailDraftToolUI";
62476
+ const CreateNotebookToolUIImpl = (props) => /* @__PURE__ */ jsxRuntime.jsx(
62477
+ CreateAssetToolUIImpl,
62478
+ {
62479
+ icon: BookOpen,
62480
+ assetType: "notebook",
62481
+ runningLabel: "Creating notebook...",
62482
+ doneLabel: "Created notebook",
62483
+ ...props
62484
+ }
62485
+ );
62486
+ const CreateNotebookToolUI = React.memo(
62487
+ CreateNotebookToolUIImpl
62488
+ );
62489
+ CreateNotebookToolUI.displayName = "CreateNotebookToolUI";
62490
+ function parsePythonResult(result) {
62491
+ const data = normalizeResult(result);
62492
+ if (!data) return { stdout: null, stderr: null, value: null, error: null, exception: null, imagePng: null, createdAssets: [] };
62493
+ const inner = typeof data.result === "object" && data.result !== null ? data.result : data;
62494
+ const stdout = inner.stdout ?? null;
62495
+ const stderr = inner.stderr ?? null;
62496
+ const value = inner.value ?? null;
62497
+ const error2 = inner.error ?? null;
62498
+ let exception = null;
62499
+ if (inner.exception && typeof inner.exception === "object") {
62500
+ const exc = inner.exception;
62501
+ exception = {
62502
+ name: exc.name ?? "Error",
62503
+ value: exc.value ?? "",
62504
+ traceback: exc.traceback ?? ""
62505
+ };
62506
+ }
62507
+ let imagePng = null;
62508
+ if (inner.data && typeof inner.data === "object") {
62509
+ imagePng = inner.data.png ?? null;
62510
+ }
62511
+ const createdAssets = Array.isArray(data.created_assets) ? data.created_assets : [];
62512
+ return { stdout, stderr, value, error: error2, exception, imagePng, createdAssets };
62513
+ }
62514
+ const RunPythonCodeToolUIImpl = ({
62515
+ toolName,
62516
+ args,
62517
+ result,
62518
+ status
62519
+ }) => {
62520
+ var _a2;
62521
+ const typedArgs = args;
62522
+ const code2 = (typedArgs == null ? void 0 : typedArgs.code) ?? "";
62523
+ const summary = (typedArgs == null ? void 0 : typedArgs.summary) ?? null;
62524
+ const lines = code2 ? code2.split("\n").length : 0;
62525
+ const isRunning = (status == null ? void 0 : status.type) === "running";
62526
+ const isComplete = (status == null ? void 0 : status.type) === "complete";
62527
+ const errorMsg = (status == null ? void 0 : status.type) === "incomplete" ? status.error : null;
62528
+ const parsed = React.useMemo(() => isComplete ? parsePythonResult(result) : null, [result, isComplete]);
62529
+ const openAsset = useAssetPanelStore((s) => s.openAsset);
62530
+ const hasOutput = parsed && (parsed.stdout || parsed.stderr || parsed.value);
62531
+ const hasError = parsed && (parsed.error || parsed.exception);
62532
+ const hasImage = parsed == null ? void 0 : parsed.imagePng;
62533
+ return /* @__PURE__ */ jsxRuntime.jsxs(
62534
+ ToolCard,
62535
+ {
62536
+ icon: Code,
62537
+ status: (status == null ? void 0 : status.type) ?? "complete",
62538
+ title: isRunning ? "Running code..." : summary || `Executed ${lines} ${lines !== 1 ? "lines" : "line"}`,
62539
+ toolName,
62540
+ error: errorMsg,
62541
+ children: [
62542
+ code2 && /* @__PURE__ */ jsxRuntime.jsx(ExpandableSection, { label: "Show code", children: /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "whitespace-pre-wrap break-words text-[11px] leading-relaxed font-mono text-foreground/80", children: code2 }) }),
62543
+ isComplete && hasOutput && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-border/40 px-4 py-2.5", children: [
62544
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 mb-1", children: [
62545
+ /* @__PURE__ */ jsxRuntime.jsx(Terminal, { className: "size-3 text-muted-foreground" }),
62546
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] font-medium text-muted-foreground", children: "Output" })
62547
+ ] }),
62548
+ /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "max-h-48 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/30 p-2 text-[11px] leading-relaxed font-mono text-foreground/80", children: [parsed.value, parsed.stdout, parsed.stderr].filter(Boolean).join("\n") })
62549
+ ] }),
62550
+ isComplete && hasError && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-border/40 bg-red-50/50 px-4 py-2.5", children: [
62551
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 mb-1", children: [
62552
+ /* @__PURE__ */ jsxRuntime.jsx(TriangleAlert, { className: "size-3 text-red-500" }),
62553
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] font-medium text-red-600", children: parsed.exception ? `${parsed.exception.name}: ${parsed.exception.value}` : "Error" })
62554
+ ] }),
62555
+ /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "max-h-48 overflow-auto whitespace-pre-wrap break-words rounded-md bg-red-50 p-2 text-[11px] leading-relaxed font-mono text-red-600/80", children: ((_a2 = parsed.exception) == null ? void 0 : _a2.traceback) ?? parsed.error })
62556
+ ] }),
62557
+ isComplete && hasImage && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-border/40 px-4 py-2.5", children: [
62558
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 mb-1.5", children: [
62559
+ /* @__PURE__ */ jsxRuntime.jsx(Image, { className: "size-3 text-muted-foreground" }),
62560
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] font-medium text-muted-foreground", children: "Generated image" })
62561
+ ] }),
62562
+ /* @__PURE__ */ jsxRuntime.jsx(
62563
+ "img",
62564
+ {
62565
+ src: `data:image/png;base64,${parsed.imagePng}`,
62566
+ alt: "Python output",
62567
+ className: "max-w-full rounded-md border border-border/40"
62568
+ }
62569
+ )
62570
+ ] }),
62571
+ isComplete && parsed && parsed.createdAssets.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-border/40 px-4 py-2", children: [
62572
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] font-medium text-muted-foreground", children: "Created assets" }),
62573
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 flex flex-wrap gap-1.5", children: parsed.createdAssets.map((a) => /* @__PURE__ */ jsxRuntime.jsxs(
62574
+ "button",
62575
+ {
62576
+ onClick: () => openAsset(a.asset_id),
62577
+ className: "flex items-center gap-1 rounded-md border border-border/60 px-2 py-1 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground",
62578
+ children: [
62579
+ /* @__PURE__ */ jsxRuntime.jsx(ExternalLink, { className: "size-2.5" }),
62580
+ truncate(a.asset_id, 20)
62581
+ ]
62582
+ },
62583
+ a.asset_id
62584
+ )) })
62585
+ ] })
62586
+ ]
62587
+ }
62588
+ );
62589
+ };
62590
+ const RunPythonCodeToolUI = React.memo(
62591
+ RunPythonCodeToolUIImpl
62592
+ );
62593
+ RunPythonCodeToolUI.displayName = "RunPythonCodeToolUI";
62594
+ const OpenAssetToolUIImpl = ({
62595
+ toolName,
62596
+ args,
62597
+ result,
62598
+ status
62599
+ }) => {
62600
+ const typedArgs = args;
62601
+ const argsAssetId = (typedArgs == null ? void 0 : typedArgs.asset_id) ?? (typedArgs == null ? void 0 : typedArgs.assetId) ?? "";
62602
+ const resultAssetId = extractAssetId(result);
62603
+ const assetId = resultAssetId ?? (argsAssetId.startsWith("asset_") ? argsAssetId : null);
62604
+ const isRunning = (status == null ? void 0 : status.type) === "running";
62605
+ const isComplete = (status == null ? void 0 : status.type) === "complete" || !status;
62606
+ const isCancelled = (status == null ? void 0 : status.type) === "incomplete" && status.reason === "cancelled";
62607
+ const errorMsg = (status == null ? void 0 : status.type) === "incomplete" ? status.error : null;
62608
+ const openAsset = useAssetPanelStore((s) => s.openAsset);
62609
+ const wasCompleteAtMount = React.useRef(isComplete);
62610
+ React.useEffect(() => {
62611
+ if (isComplete && !isCancelled && assetId && !wasCompleteAtMount.current) {
62612
+ const store = useAssetPanelStore.getState();
62613
+ if (store.markAutoOpened(assetId)) {
62614
+ store.openAsset(assetId);
62615
+ }
62616
+ }
62617
+ }, [isComplete, isCancelled, assetId]);
62618
+ return /* @__PURE__ */ jsxRuntime.jsx(
62619
+ ToolCard,
62620
+ {
62621
+ icon: FolderOpen,
62622
+ status: (status == null ? void 0 : status.type) ?? "complete",
62623
+ title: isRunning ? "Opening asset..." : "Asset opened",
62624
+ subtitle: assetId ? truncate(assetId, 30) : void 0,
62625
+ toolName,
62626
+ error: errorMsg,
62627
+ children: assetId && isComplete && !isCancelled && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-border/40 px-4 py-2", children: /* @__PURE__ */ jsxRuntime.jsxs(
62628
+ "button",
62629
+ {
62630
+ onClick: () => openAsset(assetId),
62631
+ 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",
62632
+ children: [
62633
+ /* @__PURE__ */ jsxRuntime.jsx(ExternalLink, { className: "size-3" }),
62634
+ "Open asset"
62635
+ ]
62636
+ }
62637
+ ) })
62638
+ }
62639
+ );
62640
+ };
62641
+ const OpenAssetToolUI = React.memo(
62642
+ OpenAssetToolUIImpl
62643
+ );
62644
+ OpenAssetToolUI.displayName = "OpenAssetToolUI";
62645
+ function createAssetToolUI(config2) {
62646
+ const Component = (props) => /* @__PURE__ */ jsxRuntime.jsx(
62647
+ CreateAssetToolUIImpl,
62648
+ {
62649
+ icon: config2.icon,
62650
+ assetType: config2.assetType,
62651
+ runningLabel: config2.runningLabel,
62652
+ doneLabel: config2.doneLabel,
62653
+ ...props
62654
+ }
62655
+ );
62656
+ const Memoized = React.memo(Component);
62657
+ Memoized.displayName = `CreateAssetToolUI(${config2.assetType})`;
62658
+ return Memoized;
62659
+ }
62297
62660
  const TOOL_UI_REGISTRY = {
62298
62661
  search: WebSearchToolUI,
62299
62662
  browse: BrowseToolUI,
@@ -62304,7 +62667,10 @@ const TOOL_UI_REGISTRY = {
62304
62667
  create_new_document: CreateDocumentToolUI,
62305
62668
  create_document_from_markdown: CreateDocumentToolUI,
62306
62669
  create_new_sheet: CreateSheetToolUI,
62307
- create_powerpoint_deck: CreatePresentationToolUI
62670
+ create_powerpoint_deck: CreatePresentationToolUI,
62671
+ create_new_notebook: CreateNotebookToolUI,
62672
+ run_python_code: RunPythonCodeToolUI,
62673
+ open_asset_in_workspace: OpenAssetToolUI
62308
62674
  };
62309
62675
  const falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
62310
62676
  const cx = clsx;
@@ -62425,7 +62791,6 @@ const AthenaChat = ({
62425
62791
  toolUIs,
62426
62792
  mentionTools
62427
62793
  }) => {
62428
- const isLoadingThread = useThreadLoading();
62429
62794
  const tools = mentionTools ?? EMPTY_MENTION_TOOLS;
62430
62795
  const mergedToolUIs = React.useMemo(() => ({
62431
62796
  append_markdown_to_athena_document: AppendDocumentToolUI,
@@ -62437,43 +62802,40 @@ const AthenaChat = ({
62437
62802
  () => () => /* @__PURE__ */ jsxRuntime.jsx(AssistantMessage, { toolUIs: mergedToolUIs }),
62438
62803
  [mergedToolUIs]
62439
62804
  );
62440
- return /* @__PURE__ */ jsxRuntime.jsxs(
62805
+ return /* @__PURE__ */ jsxRuntime.jsx(
62441
62806
  ThreadPrimitiveRoot,
62442
62807
  {
62443
62808
  className: `aui-root aui-thread-root @container flex h-full flex-col bg-background ${className ?? ""}`,
62444
62809
  style: { ["--thread-max-width"]: maxWidth, position: "relative" },
62445
- children: [
62446
- isLoadingThread && /* @__PURE__ */ jsxRuntime.jsx(ThreadLoadingOverlay, {}),
62447
- /* @__PURE__ */ jsxRuntime.jsxs(
62448
- ThreadPrimitiveViewport,
62449
- {
62450
- turnAnchor: "top",
62451
- className: "aui-thread-viewport relative flex flex-1 flex-col overflow-x-auto overflow-y-scroll scroll-smooth px-4 pt-4",
62452
- children: [
62453
- /* @__PURE__ */ jsxRuntime.jsx(AuiIf, { condition: (s) => s.thread.isEmpty, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "aui-thread-welcome-root mx-auto my-auto flex w-full max-w-(--thread-max-width) grow flex-col", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "aui-thread-welcome-center flex w-full grow flex-col items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "aui-thread-welcome-message flex size-full flex-col justify-center px-4", children: [
62454
- /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "aui-thread-welcome-message-inner fade-in slide-in-from-bottom-1 animate-in fill-mode-both font-semibold text-2xl duration-200", children: welcomeMessage }),
62455
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "aui-thread-welcome-message-inner fade-in slide-in-from-bottom-1 animate-in fill-mode-both text-muted-foreground text-xl delay-75 duration-200", children: welcomeSubtext })
62456
- ] }) }) }) }),
62457
- /* @__PURE__ */ jsxRuntime.jsx(
62458
- ThreadPrimitiveMessages,
62459
- {
62460
- components: {
62461
- UserMessage,
62462
- AssistantMessage: AssistantMessageComponent
62463
- }
62810
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
62811
+ ThreadPrimitiveViewport,
62812
+ {
62813
+ turnAnchor: "top",
62814
+ className: "aui-thread-viewport relative flex flex-1 flex-col overflow-x-auto overflow-y-scroll scroll-smooth px-4 pt-4",
62815
+ children: [
62816
+ /* @__PURE__ */ jsxRuntime.jsx(AuiIf, { condition: (s) => s.thread.isEmpty, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "aui-thread-welcome-root mx-auto my-auto flex w-full max-w-(--thread-max-width) grow flex-col", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "aui-thread-welcome-center flex w-full grow flex-col items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "aui-thread-welcome-message flex size-full flex-col justify-center px-4", children: [
62817
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "aui-thread-welcome-message-inner fade-in slide-in-from-bottom-1 animate-in fill-mode-both font-semibold text-2xl duration-200", children: welcomeMessage }),
62818
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "aui-thread-welcome-message-inner fade-in slide-in-from-bottom-1 animate-in fill-mode-both text-muted-foreground text-xl delay-75 duration-200", children: welcomeSubtext })
62819
+ ] }) }) }) }),
62820
+ /* @__PURE__ */ jsxRuntime.jsx(
62821
+ ThreadPrimitiveMessages,
62822
+ {
62823
+ components: {
62824
+ UserMessage,
62825
+ AssistantMessage: AssistantMessageComponent
62464
62826
  }
62465
- ),
62466
- /* @__PURE__ */ jsxRuntime.jsxs(ThreadPrimitiveViewportFooter, { className: "aui-thread-viewport-footer sticky bottom-0 mx-auto mt-auto flex w-full max-w-(--thread-max-width) flex-col gap-4 overflow-visible rounded-t-3xl bg-background pb-4 md:pb-6", children: [
62467
- /* @__PURE__ */ jsxRuntime.jsx(ThreadScrollToBottom, {}),
62468
- /* @__PURE__ */ jsxRuntime.jsxs(ComposerPrimitiveRoot, { className: "aui-composer-root relative flex w-full flex-col rounded-2xl border border-input bg-background px-1 pt-2 outline-none transition-shadow focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/20", children: [
62469
- /* @__PURE__ */ jsxRuntime.jsx(TiptapComposer, { tools }),
62470
- /* @__PURE__ */ jsxRuntime.jsx(ComposerAction, {})
62471
- ] })
62827
+ }
62828
+ ),
62829
+ /* @__PURE__ */ jsxRuntime.jsxs(ThreadPrimitiveViewportFooter, { className: "aui-thread-viewport-footer sticky bottom-0 mx-auto mt-auto flex w-full max-w-(--thread-max-width) flex-col gap-4 overflow-visible rounded-t-3xl bg-background pb-4 md:pb-6", children: [
62830
+ /* @__PURE__ */ jsxRuntime.jsx(ThreadScrollToBottom, {}),
62831
+ /* @__PURE__ */ jsxRuntime.jsxs(ComposerPrimitiveRoot, { className: "aui-composer-root relative flex w-full flex-col rounded-2xl border border-input bg-background px-1 pt-2 outline-none transition-shadow focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/20", children: [
62832
+ /* @__PURE__ */ jsxRuntime.jsx(TiptapComposer, { tools }),
62833
+ /* @__PURE__ */ jsxRuntime.jsx(ComposerAction, {})
62472
62834
  ] })
62473
- ]
62474
- }
62475
- )
62476
- ]
62835
+ ] })
62836
+ ]
62837
+ }
62838
+ )
62477
62839
  }
62478
62840
  );
62479
62841
  };
@@ -62589,53 +62951,6 @@ const UserMessage = () => /* @__PURE__ */ jsxRuntime.jsx(
62589
62951
  children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "aui-user-message-content wrap-break-word rounded-2xl bg-muted px-4 py-2.5 text-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(MessagePrimitiveParts, { components: { Text: TiptapText } }) })
62590
62952
  }
62591
62953
  );
62592
- const ThreadLoadingOverlay = () => /* @__PURE__ */ jsxRuntime.jsxs(
62593
- "div",
62594
- {
62595
- className: "aui-thread-loading-overlay",
62596
- style: {
62597
- position: "absolute",
62598
- inset: 0,
62599
- zIndex: 50,
62600
- display: "flex",
62601
- flexDirection: "column",
62602
- alignItems: "center",
62603
- justifyContent: "center",
62604
- gap: 12,
62605
- background: "color-mix(in srgb, var(--background, #fff) 80%, transparent)",
62606
- backdropFilter: "blur(4px)",
62607
- WebkitBackdropFilter: "blur(4px)",
62608
- animation: "aui-overlay-in 0.2s ease-out"
62609
- },
62610
- children: [
62611
- /* @__PURE__ */ jsxRuntime.jsx(
62612
- "div",
62613
- {
62614
- style: {
62615
- width: 28,
62616
- height: 28,
62617
- border: "2.5px solid var(--border, #e5e5e5)",
62618
- borderTopColor: "var(--primary, #2563eb)",
62619
- borderRadius: "50%",
62620
- animation: "aui-spin 0.7s linear infinite"
62621
- }
62622
- }
62623
- ),
62624
- /* @__PURE__ */ jsxRuntime.jsx(
62625
- "span",
62626
- {
62627
- style: {
62628
- fontSize: 13,
62629
- fontWeight: 500,
62630
- color: "var(--muted-foreground, #888)"
62631
- },
62632
- children: "Loading conversation…"
62633
- }
62634
- ),
62635
- /* @__PURE__ */ jsxRuntime.jsx("style", { children: `@keyframes aui-spin { to { transform: rotate(360deg); } } @keyframes aui-overlay-in { from { opacity: 0; } to { opacity: 1; } }` })
62636
- ]
62637
- }
62638
- );
62639
62954
  const embedCache = /* @__PURE__ */ new Map();
62640
62955
  function useAssetEmbed(assetId, options = {
62641
62956
  backendUrl: ""
@@ -62706,6 +63021,7 @@ const ASSET_TYPE_CONFIG = {
62706
63021
  presentation: { icon: Presentation, label: "Presentation" },
62707
63022
  spreadsheet: { icon: FileSpreadsheet, label: "Spreadsheet" },
62708
63023
  document: { icon: FileText, label: "Document" },
63024
+ notebook: { icon: BookOpen, label: "Notebook" },
62709
63025
  unknown: { icon: File$1, label: "Asset" }
62710
63026
  };
62711
63027
  const AssetIframe = React.memo(
@@ -62942,66 +63258,29 @@ const AthenaLayout = ({
62942
63258
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(AssetPanel, {}) })
62943
63259
  ] });
62944
63260
  };
62945
- function useThreadList() {
62946
- const store = useThreadListStore();
62947
- return useStore$1(store);
62948
- }
62949
- function useActiveThreadId() {
62950
- const store = useThreadListStore();
62951
- return useStore$1(store, (s) => s.activeThreadId);
62952
- }
62953
63261
  function ThreadList({ className }) {
62954
- const {
62955
- threads,
62956
- activeThreadId,
62957
- isLoading,
62958
- fetchThreads,
62959
- switchThread,
62960
- newThread,
62961
- archiveThread: archiveThread2
62962
- } = useThreadList();
62963
- React.useEffect(() => {
62964
- fetchThreads();
62965
- }, [fetchThreads]);
62966
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-1", className), children: [
62967
- /* @__PURE__ */ jsxRuntime.jsxs(
62968
- "button",
63262
+ return /* @__PURE__ */ jsxRuntime.jsxs(ThreadListPrimitiveRoot, { className: cn("flex flex-col gap-1", className), children: [
63263
+ /* @__PURE__ */ jsxRuntime.jsxs(ThreadListPrimitiveNew, { className: "flex items-center gap-2 rounded-lg border border-border/60 px-3 py-2 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground", children: [
63264
+ /* @__PURE__ */ jsxRuntime.jsx(Plus, { className: "size-4" }),
63265
+ "New Chat"
63266
+ ] }),
63267
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-0.5", children: /* @__PURE__ */ jsxRuntime.jsx(
63268
+ ThreadListPrimitiveItems,
62969
63269
  {
62970
- onClick: () => newThread(),
62971
- className: "flex items-center gap-2 rounded-lg border border-border/60 px-3 py-2 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
62972
- children: [
62973
- /* @__PURE__ */ jsxRuntime.jsx(Plus, { className: "size-4" }),
62974
- "New Chat"
62975
- ]
63270
+ components: {
63271
+ ThreadListItem
63272
+ }
62976
63273
  }
62977
- ),
62978
- isLoading && threads.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center py-4 text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(LoaderCircle, { className: "size-4 animate-spin" }) }) : threads.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-2 py-4 text-center text-xs text-muted-foreground/60", children: "No conversations yet" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-0.5", children: threads.map((thread) => /* @__PURE__ */ jsxRuntime.jsxs(
62979
- "div",
62980
- {
62981
- className: cn(
62982
- "group flex items-center gap-2 rounded-lg px-3 py-2 text-sm transition-colors cursor-pointer",
62983
- activeThreadId === thread.thread_id ? "bg-muted/50 text-foreground" : "text-muted-foreground hover:bg-muted/30 hover:text-foreground"
62984
- ),
62985
- onClick: () => switchThread(thread.thread_id),
62986
- children: [
62987
- /* @__PURE__ */ jsxRuntime.jsx(MessageSquare, { className: "size-3.5 shrink-0" }),
62988
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate", children: thread.title || "Untitled" }),
62989
- /* @__PURE__ */ jsxRuntime.jsx(
62990
- "button",
62991
- {
62992
- onClick: (e) => {
62993
- e.stopPropagation();
62994
- archiveThread2(thread.thread_id);
62995
- },
62996
- className: "hidden size-5 items-center justify-center rounded text-muted-foreground/60 transition-colors hover:bg-muted hover:text-foreground group-hover:flex",
62997
- title: "Archive",
62998
- children: /* @__PURE__ */ jsxRuntime.jsx(Archive, { className: "size-3" })
62999
- }
63000
- )
63001
- ]
63002
- },
63003
- thread.thread_id
63004
- )) })
63274
+ ) })
63275
+ ] });
63276
+ }
63277
+ function ThreadListItem() {
63278
+ return /* @__PURE__ */ jsxRuntime.jsxs(ThreadListItemPrimitiveRoot, { className: "group", children: [
63279
+ /* @__PURE__ */ jsxRuntime.jsxs(ThreadListItemPrimitiveTrigger, { className: "flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm transition-colors cursor-pointer text-muted-foreground hover:bg-muted/30 hover:text-foreground data-[active]:bg-muted/50 data-[active]:text-foreground", children: [
63280
+ /* @__PURE__ */ jsxRuntime.jsx(MessageSquare, { className: "size-3.5 shrink-0" }),
63281
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate text-left", children: /* @__PURE__ */ jsxRuntime.jsx(ThreadListItemPrimitiveTitle, { fallback: "Untitled" }) })
63282
+ ] }),
63283
+ /* @__PURE__ */ jsxRuntime.jsx(ThreadListItemPrimitiveArchive, { className: "hidden size-5 items-center justify-center rounded text-muted-foreground/60 transition-colors hover:bg-muted hover:text-foreground group-hover:flex", children: /* @__PURE__ */ jsxRuntime.jsx(Archive, { className: "size-3" }) })
63005
63284
  ] });
63006
63285
  }
63007
63286
  function useAppendToComposer() {
@@ -63119,11 +63398,14 @@ exports.CollapsibleContent = CollapsibleContent;
63119
63398
  exports.CollapsibleTrigger = CollapsibleTrigger;
63120
63399
  exports.CreateDocumentToolUI = CreateDocumentToolUI;
63121
63400
  exports.CreateEmailDraftToolUI = CreateEmailDraftToolUI;
63401
+ exports.CreateNotebookToolUI = CreateNotebookToolUI;
63122
63402
  exports.CreatePresentationToolUI = CreatePresentationToolUI;
63123
63403
  exports.CreateSheetToolUI = CreateSheetToolUI;
63124
63404
  exports.DEFAULT_BACKEND_URL = DEFAULT_BACKEND_URL;
63125
63405
  exports.EmailSearchToolUI = EmailSearchToolUI;
63406
+ exports.OpenAssetToolUI = OpenAssetToolUI;
63126
63407
  exports.ReadAssetToolUI = ReadAssetToolUI;
63408
+ exports.RunPythonCodeToolUI = RunPythonCodeToolUI;
63127
63409
  exports.TOOL_UI_REGISTRY = TOOL_UI_REGISTRY;
63128
63410
  exports.ThreadList = ThreadList;
63129
63411
  exports.TiptapComposer = TiptapComposer;
@@ -63145,13 +63427,12 @@ exports.WebSearchToolUI = WebSearchToolUI;
63145
63427
  exports.buttonVariants = buttonVariants;
63146
63428
  exports.clearAutoOpenedAssets = clearAutoOpenedAssets;
63147
63429
  exports.cn = cn;
63148
- exports.createThreadListStore = createThreadListStore;
63430
+ exports.createAssetToolUI = createAssetToolUI;
63149
63431
  exports.getAssetInfo = getAssetInfo;
63150
63432
  exports.resetAssetAutoOpen = resetAssetAutoOpen;
63151
63433
  exports.themeToStyleVars = themeToStyleVars;
63152
63434
  exports.themes = themes;
63153
63435
  exports.tryParseJson = tryParseJson$1;
63154
- exports.useActiveThreadId = useActiveThreadId;
63155
63436
  exports.useAppendToComposer = useAppendToComposer;
63156
63437
  exports.useAssetEmbed = useAssetEmbed;
63157
63438
  exports.useAssetPanelStore = useAssetPanelStore;
@@ -63160,6 +63441,4 @@ exports.useAthenaRuntime = useAthenaRuntime;
63160
63441
  exports.useComposerAttachment = useComposerAttachment;
63161
63442
  exports.useMentionSuggestions = useMentionSuggestions;
63162
63443
  exports.useParentAuth = useParentAuth;
63163
- exports.useThreadList = useThreadList;
63164
- exports.useThreadLoading = useThreadLoading;
63165
63444
  //# sourceMappingURL=index.cjs.map