@athenaintel/react 0.14.0 → 0.15.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
@@ -21,9 +21,9 @@ var _focused, _cleanup, _setup, _a2, _provider, _providerCalled, _b, _online, _c
21
21
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
22
22
  import * as React from "react";
23
23
  import React__default, { useEffect, useSyncExternalStore, useCallback, useMemo, useState, useRef, useContext, createContext, useReducer, forwardRef, useImperativeHandle, Component, Fragment as Fragment$2, memo } from "react";
24
- import { fromThreadMessageLike, bindExternalStoreMessage, getExternalStoreMessages, INTERNAL, useAssistantTransportRuntime, Tools, useAui, useAuiState as useAuiState$1, AuiProvider, useRemoteThreadListRuntime, AssistantRuntimeProvider, MessagePartPrimitive, MessagePrimitive, useScrollLock, ActionBarPrimitive, AuiIf, ActionBarMorePrimitive, ThreadPrimitive, ComposerPrimitive, ErrorPrimitive, ThreadListPrimitive, ThreadListItemPrimitive } from "@assistant-ui/react";
25
- import { D as DEFAULT_API_URL, a as DEFAULT_BACKEND_URL, C as CLIENT_TOOL_INTERRUPT_SOURCE, b as CLIENT_TOOL_RESULT_STATUS_ERROR, c as CLIENT_TOOL_RESULT_STATUS_SUCCESS, r as readDeepAgentStreamValues, i as isDeepAgentStateHydrated, d as DEEP_AGENT_PROTOCOL_VERSION, e as DEEP_AGENT_PROTOCOL_STATE_KEY, f as DEEP_AGENT_PROTOCOL_VERSION_HEADER, g as convertDeepAgentState, h as deepAgentMaterialize, S as StatewireSuspended, j as readPersistedFailedSendStamps, Q as QuotaSafeLocalStorageSession, u as useFloating, o as offset, s as shift, l as limitShift, k as flip, m as size, n as arrow$1, p as hide, q as autoUpdate, t as cn, v as getAthenaEnvironmentUrls, w as deriveAthenaAppUrl, x as resolveStatewireSyncUrl, M as Mark, y as markPasteRule, z as mergeAttributes, P as Plugin, A as PluginKey, B as combineTransactionSteps, E as getChangedRanges, F as findChildrenInRange, G as getMarksBetween, H as getAttributes, I as Selection, J as SelectionRange, T as TextSelection, K as Fragment$1, L as Slice, N as DecorationSet, O as Decoration, R as keydownHandler, U as NodeSelection, V as Transform, W as Node$1, X as callOrReturn, Y as getExtensionField, Z as findParentNodeClosestToPos, _ as Schema, $ as Mark$1, a0 as Extension, a1 as index, a2 as DOMParser, a3 as getHTMLFromFragment, a4 as createLucideIcon, a5 as Wrench, a6 as Workflow, a7 as Users, a8 as Package, a9 as Monitor, aa as Mail, ab as LayoutGrid, ac as HardDrive, ad as Globe, ae as FolderKanban, af as Folder, ag as FileText, ah as Database, ai as Calendar, aj as BookOpen, ak as NodeViewWrapper, al as nodePasteRule, am as ReactNodeViewRenderer, an as useEditor, ao as EditorContent, ap as StarterKit, aq as useStore$1, ar as getFilteredItems, as as ChevronRight, at as useFloating$1, au as FloatingPortal, av as Suggestion, aw as ReactRenderer, ax as Store, ay as registerSource, az as addItems, aA as createItemCache, aB as createScopeRegistry, aC as createAthenaSpacesUrl, aD as DEFAULT_APP_URL, aE as Placeholder, aF as RefreshCw, aG as Check, aH as ChevronDown, aI as Code$2, aJ as Search, aK as Table$3, aL as Image$2, aM as Sheet, aN as Camera, aO as Copy, aP as ArrowUp, aQ as File$1 } from "./scope-registry-B9XYV-FT.js";
26
- import { aR, aS, aT } from "./scope-registry-B9XYV-FT.js";
24
+ import { fromThreadMessageLike, bindExternalStoreMessage, getExternalStoreMessages, INTERNAL, useAssistantTransportRuntime, Tools, useAui, useAuiState as useAuiState$1, AuiProvider, useRemoteThreadListRuntime, AssistantRuntimeProvider, MessagePartPrimitive, MessagePrimitive, useScrollLock, ActionBarPrimitive, AuiIf, ActionBarMorePrimitive, ErrorPrimitive, ThreadPrimitive, ThreadListPrimitive, ThreadListItemPrimitive } from "@assistant-ui/react";
25
+ import { D as DEFAULT_API_URL, a as DEFAULT_BACKEND_URL, C as CLIENT_TOOL_INTERRUPT_SOURCE, b as CLIENT_TOOL_RESULT_STATUS_ERROR, c as CLIENT_TOOL_RESULT_STATUS_SUCCESS, r as readDeepAgentStreamValues, i as isDeepAgentStateHydrated, d as DEEP_AGENT_PROTOCOL_VERSION, e as DEEP_AGENT_PROTOCOL_STATE_KEY, f as DEEP_AGENT_PROTOCOL_VERSION_HEADER, g as convertDeepAgentState, h as deepAgentMaterialize, S as StatewireSuspended, j as readPersistedFailedSendStamps, Q as QuotaSafeLocalStorageSession, u as useFloating, o as offset, s as shift, l as limitShift, k as flip, m as size, n as arrow$1, p as hide, q as autoUpdate, t as cn, v as getAthenaEnvironmentUrls, w as deriveAthenaAppUrl, x as resolveStatewireSyncUrl, M as Mark, y as markPasteRule, z as mergeAttributes, P as Plugin, A as PluginKey, B as combineTransactionSteps, E as getChangedRanges, F as findChildrenInRange, G as getMarksBetween, H as getAttributes, I as Selection, J as SelectionRange, T as TextSelection, K as Fragment$1, L as Slice, N as DecorationSet, O as Decoration, R as keydownHandler, U as NodeSelection, V as Transform, W as Node$1, X as callOrReturn, Y as getExtensionField, Z as findParentNodeClosestToPos, _ as Schema, $ as Mark$1, a0 as Extension, a1 as index, a2 as DOMParser, a3 as getHTMLFromFragment, a4 as createLucideIcon, a5 as Wrench, a6 as Workflow, a7 as Users, a8 as Package, a9 as Monitor, aa as Mail, ab as LayoutGrid, ac as HardDrive, ad as Globe, ae as FolderKanban, af as Folder, ag as FileText, ah as Database, ai as Calendar, aj as BookOpen, ak as NodeViewWrapper, al as nodePasteRule, am as ReactNodeViewRenderer, an as useEditor, ao as EditorContent, ap as StarterKit, aq as useStore$1, ar as getFilteredItems, as as ChevronRight, at as useFloating$1, au as FloatingPortal, av as Suggestion, aw as ReactRenderer, ax as Store, ay as registerSource, az as addItems, aA as createItemCache, aB as createScopeRegistry, aC as createAthenaSpacesUrl, aD as DEFAULT_APP_URL, aE as Placeholder, aF as RefreshCw, aG as Check, aH as ChevronDown, aI as Code$2, aJ as Search, aK as Table$3, aL as Image$2, aM as Sheet, aN as Camera, aO as Copy, aP as ChatThreadShell, aQ as ChatComposerDock, aR as ComposerSendOrStop, aS as ArrowUp, aT as ListPlus, aU as File$1 } from "./composer-send-or-stop-C5AVmcwO.js";
26
+ import { aV, aW, aX } from "./composer-send-or-stop-C5AVmcwO.js";
27
27
  import { A as AthenaAuthContext } from "./AthenaAuthContext-DQsdayH2.js";
28
28
  import { withKey } from "@assistant-ui/tap";
29
29
  import { StatewireSSE, StatewireWS } from "statewire";
@@ -31,7 +31,7 @@ import { useAuiState } from "@assistant-ui/store";
31
31
  import { StatewireThread, useStatewireSendCommand, useStatewireRuns, useStatewireState } from "@assistant-ui/react-statewire";
32
32
  import * as ReactDOM from "react-dom";
33
33
  import { A as AthenaContext, u as useAthenaConfig } from "./AthenaContext-MOslgOmE.js";
34
- const version$1 = "0.14.0";
34
+ const version$1 = "0.15.0";
35
35
  const packageJson = {
36
36
  version: version$1
37
37
  };
@@ -28966,6 +28966,7 @@ const TiptapComposer = ({ tools = [], rootCategories }) => {
28966
28966
  clearQuote();
28967
28967
  }
28968
28968
  } else {
28969
+ if (!markdown.trim()) return;
28969
28970
  aui.composer.setText(markdown);
28970
28971
  aui.composer.send({ steer: false });
28971
28972
  }
@@ -29059,7 +29060,8 @@ const TiptapComposer = ({ tools = [], rootCategories }) => {
29059
29060
  isEmpty: () => editor.isEmpty,
29060
29061
  insertText: (text2) => {
29061
29062
  editor.chain().focus().insertContentAt(editor.state.doc.content.size, text2).run();
29062
- }
29063
+ },
29064
+ submit: () => handleSubmitRef.current()
29063
29065
  } : null;
29064
29066
  }, [editor, composerEditorRef]);
29065
29067
  return /* @__PURE__ */ jsx(EditorContent, { editor });
@@ -29604,7 +29606,6 @@ const TOOL_META = {
29604
29606
  describe_database: { displayName: "Inspecting database", icon: Database },
29605
29607
  list_database_tables: { displayName: "Listing database tables", icon: Database },
29606
29608
  get_database_table_schema: { displayName: "Reading table schema", icon: Database, describer: (a) => a.table_name ?? "" },
29607
- computer_asset_exec: { displayName: "Running command", icon: Monitor },
29608
29609
  // Notebooks
29609
29610
  create_new_notebook: { displayName: "Creating notebook", icon: BookOpen },
29610
29611
  execute_cell: { displayName: "Running notebook cell", icon: Code$2 },
@@ -35000,6 +35001,11 @@ const SuggestionCard = ({
35000
35001
  }
35001
35002
  );
35002
35003
  };
35004
+ const AthenaChatWelcome = ({ welcomeMessage, welcomeSubtext, welcomeSuggestions }) => /* @__PURE__ */ jsx("div", { className: "aui-thread-welcome-root mx-auto my-auto flex w-full max-w-(--thread-max-width) grow flex-col", children: /* @__PURE__ */ jsx("div", { className: "aui-thread-welcome-center flex w-full grow flex-col items-center justify-center", children: /* @__PURE__ */ jsxs("div", { className: "aui-thread-welcome-message flex size-full flex-col justify-center px-4", children: [
35005
+ /* @__PURE__ */ 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 }),
35006
+ welcomeSubtext && /* @__PURE__ */ jsx("p", { className: "aui-thread-welcome-message-inner fade-in slide-in-from-bottom-1 animate-in fill-mode-both text-muted-foreground text-lg delay-75 duration-200", children: welcomeSubtext }),
35007
+ welcomeSuggestions.length > 0 && /* @__PURE__ */ jsx("div", { className: "mt-6 grid grid-cols-1 gap-2.5 sm:grid-cols-2", children: welcomeSuggestions.map((s, i) => /* @__PURE__ */ jsx(SuggestionCard, { suggestion: s, index: i }, s.title)) })
35008
+ ] }) }) });
35003
35009
  const AthenaChat = ({
35004
35010
  className,
35005
35011
  welcomeMessage = "Hello there!",
@@ -35054,56 +35060,64 @@ const AthenaChat = ({
35054
35060
  );
35055
35061
  const AssistantMessageComponent = (components == null ? void 0 : components.AssistantMessage) ?? AthenaDefaultAssistantMessage;
35056
35062
  const UserMessageComponent = (components == null ? void 0 : components.UserMessage) ?? AthenaDefaultUserMessage;
35057
- return /* @__PURE__ */ jsx(AthenaChatDefaultComponentsContext.Provider, { value: defaultComponentsContextValue, children: /* @__PURE__ */ jsx(AthenaChatErrorBoundary, { children: /* @__PURE__ */ jsxs(
35058
- ThreadPrimitive.Root,
35063
+ const messageComponents = useMemo(
35064
+ () => ({
35065
+ UserMessage: UserMessageComponent,
35066
+ AssistantMessage: AssistantMessageComponent
35067
+ }),
35068
+ [AssistantMessageComponent, UserMessageComponent]
35069
+ );
35070
+ return /* @__PURE__ */ jsx(AthenaChatDefaultComponentsContext.Provider, { value: defaultComponentsContextValue, children: /* @__PURE__ */ jsx(AthenaChatErrorBoundary, { children: /* @__PURE__ */ jsx(
35071
+ ChatThreadShell,
35059
35072
  {
35060
- className: `aui-root aui-thread-root @container flex h-full flex-col bg-background ${className ?? ""}`,
35061
- style: { ["--thread-max-width"]: maxWidth, position: "relative" },
35062
- children: [
35063
- /* @__PURE__ */ jsx(ThreadLoadingOverlay, {}),
35064
- /* @__PURE__ */ jsxs(
35065
- ThreadPrimitive.Viewport,
35066
- {
35067
- turnAnchor: "top",
35068
- className: "aui-thread-viewport relative flex flex-1 flex-col overflow-x-auto overflow-y-scroll scroll-smooth px-4 pt-4",
35069
- "data-aui-thread-viewport": "",
35070
- children: [
35071
- /* @__PURE__ */ jsx(ThreadScrollToTop, {}),
35072
- /* @__PURE__ */ jsx(AuiIf, { condition: (s) => s.thread.isEmpty, children: /* @__PURE__ */ jsx("div", { className: "aui-thread-welcome-root mx-auto my-auto flex w-full max-w-(--thread-max-width) grow flex-col", children: /* @__PURE__ */ jsx("div", { className: "aui-thread-welcome-center flex w-full grow flex-col items-center justify-center", children: /* @__PURE__ */ jsxs("div", { className: "aui-thread-welcome-message flex size-full flex-col justify-center px-4", children: [
35073
- /* @__PURE__ */ 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 }),
35074
- welcomeSubtext && /* @__PURE__ */ jsx("p", { className: "aui-thread-welcome-message-inner fade-in slide-in-from-bottom-1 animate-in fill-mode-both text-muted-foreground text-lg delay-75 duration-200", children: welcomeSubtext }),
35075
- welcomeSuggestions.length > 0 && /* @__PURE__ */ jsx("div", { className: "mt-6 grid grid-cols-1 gap-2.5 sm:grid-cols-2", children: welcomeSuggestions.map((s, i) => /* @__PURE__ */ jsx(SuggestionCard, { suggestion: s, index: i }, s.title)) })
35076
- ] }) }) }) }),
35077
- /* @__PURE__ */ jsx(
35078
- ThreadPrimitive.Messages,
35079
- {
35080
- components: {
35081
- UserMessage: UserMessageComponent,
35082
- AssistantMessage: AssistantMessageComponent
35083
- }
35084
- }
35085
- ),
35086
- /* @__PURE__ */ jsxs(ThreadPrimitive.ViewportFooter, { 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: [
35087
- /* @__PURE__ */ jsx(ThreadScrollToBottom, {}),
35088
- /* @__PURE__ */ jsx(StatewireLegacyReadOnlyBanner, {}),
35089
- /* @__PURE__ */ jsx(StatewireConnectionBanner, {}),
35090
- /* @__PURE__ */ jsx(StatewireErrorBanner, {}),
35091
- /* @__PURE__ */ jsx(StatewireApprovalCard, {}),
35092
- /* @__PURE__ */ jsx(StatewireQueuedMessages, {}),
35093
- /* @__PURE__ */ jsx(AttachmentProvider, { children: /* @__PURE__ */ jsx(ComposerEditorProvider, { children: /* @__PURE__ */ jsxs(QuoteProvider, { children: [
35094
- /* @__PURE__ */ jsx(QuotePostMessageBridge, {}),
35095
- /* @__PURE__ */ jsx(ComposerDropZone, { children: /* @__PURE__ */ jsxs(ComposerPrimitive.Root, { 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: [
35096
- /* @__PURE__ */ jsx(ComposerQuotePreview, {}),
35097
- /* @__PURE__ */ jsx(ComposerAttachmentPreview, {}),
35098
- /* @__PURE__ */ jsx(TiptapComposer, { tools }),
35099
- /* @__PURE__ */ jsx(ComposerAction, {})
35100
- ] }) })
35101
- ] }) }) })
35102
- ] })
35103
- ]
35104
- }
35105
- )
35106
- ]
35073
+ overlay: /* @__PURE__ */ jsx(ThreadLoadingOverlay, {}),
35074
+ panelClassName: cn(
35075
+ "aui-root aui-thread-root @container relative flex h-full flex-col bg-background",
35076
+ className
35077
+ ),
35078
+ maxWidth,
35079
+ turnAnchor: "top",
35080
+ viewportClassName: "aui-thread-viewport relative flex flex-1 flex-col overflow-x-auto overflow-y-scroll scroll-smooth px-4 pt-4",
35081
+ contentClassName: "flex w-full flex-1 flex-col",
35082
+ viewportOverlay: /* @__PURE__ */ jsx(ThreadScrollToTop, {}),
35083
+ welcome: /* @__PURE__ */ jsx(
35084
+ AthenaChatWelcome,
35085
+ {
35086
+ welcomeMessage,
35087
+ welcomeSubtext,
35088
+ welcomeSuggestions
35089
+ }
35090
+ ),
35091
+ components: messageComponents,
35092
+ runningIndicator: null,
35093
+ scrollToBottom: /* @__PURE__ */ jsx(ThreadScrollToBottom, {}),
35094
+ viewportFooterClassName: "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",
35095
+ viewportFooter: /* @__PURE__ */ jsxs(Fragment, { children: [
35096
+ /* @__PURE__ */ jsx(StatewireLegacyReadOnlyBanner, {}),
35097
+ /* @__PURE__ */ jsx(StatewireConnectionBanner, {}),
35098
+ /* @__PURE__ */ jsx(StatewireErrorBanner, {}),
35099
+ /* @__PURE__ */ jsx(StatewireApprovalCard, {}),
35100
+ /* @__PURE__ */ jsx(StatewireQueuedMessages, {}),
35101
+ /* @__PURE__ */ jsx(AttachmentProvider, { children: /* @__PURE__ */ jsx(ComposerEditorProvider, { children: /* @__PURE__ */ jsxs(QuoteProvider, { children: [
35102
+ /* @__PURE__ */ jsx(QuotePostMessageBridge, {}),
35103
+ /* @__PURE__ */ jsx(ComposerDropZone, { children: /* @__PURE__ */ jsx(
35104
+ ChatComposerDock,
35105
+ {
35106
+ className: "",
35107
+ surfaceClassName: "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",
35108
+ editorRowClassName: "",
35109
+ toolbarClassName: "aui-composer-action-wrapper relative mx-2 mb-2 flex items-center",
35110
+ beforeEditor: /* @__PURE__ */ jsxs(Fragment, { children: [
35111
+ /* @__PURE__ */ jsx(ComposerQuotePreview, {}),
35112
+ /* @__PURE__ */ jsx(ComposerAttachmentPreview, {})
35113
+ ] }),
35114
+ editor: /* @__PURE__ */ jsx(TiptapComposer, { tools }),
35115
+ toolbarStart: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsx(FileUploadButton, {}) }),
35116
+ toolbarEnd: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsx(AthenaComposerSendOrStop, {}) })
35117
+ }
35118
+ ) })
35119
+ ] }) }) })
35120
+ ] })
35107
35121
  }
35108
35122
  ) }) });
35109
35123
  };
@@ -35172,75 +35186,62 @@ const ThreadScrollToBottom = () => /* @__PURE__ */ jsx(ThreadPrimitive.ScrollToB
35172
35186
  children: /* @__PURE__ */ jsx(ArrowDown, {})
35173
35187
  }
35174
35188
  ) });
35175
- const ComposerAction = () => {
35176
- const { transport } = useAthenaConfig();
35177
- const queuesWhileRunning = allowsMidRunSend(transport);
35178
- return /* @__PURE__ */ jsxs("div", { className: "aui-composer-action-wrapper relative mx-2 mb-2 flex items-center justify-between", children: [
35179
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsx(FileUploadButton, {}) }),
35180
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
35181
- queuesWhileRunning ? /* @__PURE__ */ jsx(ComposerSendWithQuote, {}) : /* @__PURE__ */ jsx(AuiIf, { condition: (s) => !s.thread.isRunning, children: /* @__PURE__ */ jsx(ComposerSendWithQuote, {}) }),
35182
- /* @__PURE__ */ jsx(AuiIf, { condition: (s) => s.thread.isRunning, children: /* @__PURE__ */ jsx(ComposerPrimitive.Cancel, { asChild: true, children: /* @__PURE__ */ jsx(
35183
- Button,
35184
- {
35185
- type: "button",
35186
- variant: "default",
35187
- size: "icon",
35188
- className: "aui-composer-cancel size-8 rounded-full",
35189
- "aria-label": "Stop generating",
35190
- children: /* @__PURE__ */ jsx(Square, { className: "aui-composer-cancel-icon size-3 fill-current" })
35191
- }
35192
- ) }) })
35193
- ] })
35194
- ] });
35195
- };
35196
- const ComposerSendWithQuote = () => {
35197
- const aui = useAui();
35198
- const { appUrl, transport } = useAthenaConfig();
35199
- const { quote, clearQuote } = useQuote();
35200
- const { attachments, clearAttachments, isUploading } = useAttachments();
35201
- const editorRef = useComposerEditorRef();
35202
- const editorEmpty = useComposerEditorEmpty();
35203
- const isRunningThread = useAuiState$1((s) => s.thread.isRunning);
35204
- const isThreadRunning = allowsMidRunSend(transport) ? false : isRunningThread;
35205
- const hasExtras = !!quote || attachments.length > 0;
35206
- const handleSend = useCallback(() => {
35207
- var _a3;
35208
- if (isUploading || isThreadRunning) return;
35209
- const editor = editorRef.current;
35210
- if (!editor && !quote && attachments.length === 0) return;
35211
- const userText = ((_a3 = editor == null ? void 0 : editor.getMarkdown()) == null ? void 0 : _a3.trim()) ?? "";
35212
- if (hasExtras) {
35213
- const fullMessage = buildComposedMessage({
35214
- attachments,
35215
- quote,
35216
- userText,
35217
- appUrl
35218
- });
35219
- if (!fullMessage) return;
35220
- aui.composer.setText(fullMessage);
35221
- aui.composer.send({ steer: false });
35222
- clearQuote();
35223
- clearAttachments();
35224
- } else {
35225
- if (!userText) return;
35226
- aui.composer.setText(userText);
35227
- aui.composer.send({ steer: false });
35228
- }
35229
- editor == null ? void 0 : editor.clear();
35230
- }, [aui, quote, attachments, hasExtras, isUploading, isThreadRunning, clearQuote, clearAttachments, editorRef, appUrl]);
35189
+ const AthenaComposerSendButton = ({
35190
+ action,
35191
+ onSend,
35192
+ disabled,
35193
+ title
35194
+ }) => {
35195
+ const label = action === "queue" ? "Queue message" : "Send message";
35231
35196
  return /* @__PURE__ */ jsx(
35232
35197
  TooltipIconButton,
35233
35198
  {
35234
- tooltip: isUploading ? "Upload in progress..." : "Send message",
35199
+ tooltip: title ?? label,
35235
35200
  side: "bottom",
35236
35201
  type: "button",
35237
35202
  variant: "default",
35238
35203
  size: "icon",
35239
35204
  className: "aui-composer-send size-8 rounded-full",
35240
- "aria-label": "Send message",
35241
- onClick: handleSend,
35242
- disabled: isUploading || isThreadRunning || editorEmpty && !hasExtras,
35243
- children: /* @__PURE__ */ jsx(ArrowUp, { className: "aui-composer-send-icon size-4" })
35205
+ "aria-label": label,
35206
+ onClick: onSend,
35207
+ disabled,
35208
+ children: action === "queue" ? /* @__PURE__ */ jsx(ListPlus, { className: "aui-composer-send-icon size-4" }) : /* @__PURE__ */ jsx(ArrowUp, { className: "aui-composer-send-icon size-4" })
35209
+ }
35210
+ );
35211
+ };
35212
+ const AthenaComposerStopButton = ({ onStop, disabled, title }) => /* @__PURE__ */ jsx(
35213
+ Button,
35214
+ {
35215
+ type: "button",
35216
+ variant: "default",
35217
+ size: "icon",
35218
+ className: "aui-composer-cancel size-8 rounded-full",
35219
+ "aria-label": "Stop generating",
35220
+ title,
35221
+ onClick: onStop,
35222
+ disabled,
35223
+ children: /* @__PURE__ */ jsx(Square, { className: "aui-composer-cancel-icon size-3 fill-current" })
35224
+ }
35225
+ );
35226
+ const ATHENA_COMPOSER_COMPONENTS = {
35227
+ SendButton: AthenaComposerSendButton,
35228
+ StopButton: AthenaComposerStopButton
35229
+ };
35230
+ const AthenaComposerSendOrStop = () => {
35231
+ const { transport } = useAthenaConfig();
35232
+ const { quote } = useQuote();
35233
+ const { attachments, isUploading } = useAttachments();
35234
+ const editorRef = useComposerEditorRef();
35235
+ const editorEmpty = useComposerEditorEmpty();
35236
+ const hasDraft = !editorEmpty || !!quote || attachments.length > 0;
35237
+ return /* @__PURE__ */ jsx(
35238
+ ComposerSendOrStop,
35239
+ {
35240
+ composerRef: editorRef,
35241
+ hasDraft,
35242
+ canQueue: allowsMidRunSend(transport),
35243
+ sendBlockedReason: isUploading ? "Upload in progress..." : null,
35244
+ components: ATHENA_COMPOSER_COMPONENTS
35244
35245
  }
35245
35246
  );
35246
35247
  };
@@ -36526,7 +36527,7 @@ export {
36526
36527
  DEFAULT_AUTO_OPEN_TOOLS,
36527
36528
  DEFAULT_BACKEND_URL,
36528
36529
  DEFAULT_STATEWIRE_MODEL,
36529
- aR as DEFAULT_STATEWIRE_SYNC_URL,
36530
+ aV as DEFAULT_STATEWIRE_SYNC_URL,
36530
36531
  DescribeDatabaseToolUI,
36531
36532
  EmailSearchToolUI,
36532
36533
  ExpandableSection,
@@ -36585,9 +36586,9 @@ export {
36585
36586
  createAssetToolUI,
36586
36587
  createAthenaSpacesUrl,
36587
36588
  createThread,
36588
- aS as deriveAthenaApiUrl,
36589
+ aW as deriveAthenaApiUrl,
36589
36590
  deriveAthenaAppUrl,
36590
- aT as deriveStatewireSyncUrl,
36591
+ aX as deriveStatewireSyncUrl,
36591
36592
  formatToolName,
36592
36593
  getAssetInfo,
36593
36594
  getPostHogInstance,