@athenaintel/react 0.42.1 → 0.43.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.
Files changed (147) hide show
  1. package/README.md +46 -7
  2. package/dist/agent-runtime/src/conversation-list-groups.d.ts +74 -0
  3. package/dist/agent-runtime/src/index.d.ts +3 -2
  4. package/dist/agent-runtime/src/messages.cjs +38 -7
  5. package/dist/agent-runtime/src/messages.cjs.map +1 -1
  6. package/dist/agent-runtime/src/messages.d.ts +26 -8
  7. package/dist/agent-runtime/src/messages.js +38 -7
  8. package/dist/agent-runtime/src/messages.js.map +1 -1
  9. package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs +10 -0
  10. package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -1
  11. package/dist/agent-runtime/src/quota-safe-local-storage-session.d.ts +7 -0
  12. package/dist/agent-runtime/src/quota-safe-local-storage-session.js +10 -0
  13. package/dist/agent-runtime/src/quota-safe-local-storage-session.js.map +1 -1
  14. package/dist/agent-runtime/src/session-lane-scope.cjs +25 -0
  15. package/dist/agent-runtime/src/session-lane-scope.cjs.map +1 -0
  16. package/dist/agent-runtime/src/session-lane-scope.d.ts +59 -0
  17. package/dist/agent-runtime/src/session-lane-scope.js +25 -0
  18. package/dist/agent-runtime/src/session-lane-scope.js.map +1 -0
  19. package/dist/agent-runtime/src/subagent-transcripts.cjs +2 -2
  20. package/dist/agent-runtime/src/subagent-transcripts.cjs.map +1 -1
  21. package/dist/agent-runtime/src/subagent-transcripts.d.ts +2 -2
  22. package/dist/agent-runtime/src/subagent-transcripts.js +3 -3
  23. package/dist/agent-runtime/src/subagent-transcripts.js.map +1 -1
  24. package/dist/agent-runtime/src/tool-metadata.cjs +0 -8
  25. package/dist/agent-runtime/src/tool-metadata.cjs.map +1 -1
  26. package/dist/agent-runtime/src/tool-metadata.js +0 -8
  27. package/dist/agent-runtime/src/tool-metadata.js.map +1 -1
  28. package/dist/agent-runtime/src/tool-names.cjs +4 -0
  29. package/dist/agent-runtime/src/tool-names.cjs.map +1 -1
  30. package/dist/agent-runtime/src/tool-names.d.ts +7 -0
  31. package/dist/agent-runtime/src/tool-names.js +4 -0
  32. package/dist/agent-runtime/src/tool-names.js.map +1 -1
  33. package/dist/agent-runtime/src/use-deep-agent-runtime.cjs +18 -1
  34. package/dist/agent-runtime/src/use-deep-agent-runtime.cjs.map +1 -1
  35. package/dist/agent-runtime/src/use-deep-agent-runtime.d.ts +19 -10
  36. package/dist/agent-runtime/src/use-deep-agent-runtime.js +19 -2
  37. package/dist/agent-runtime/src/use-deep-agent-runtime.js.map +1 -1
  38. package/dist/agent-runtime/src/use-deep-agent-thread.cjs +28 -10
  39. package/dist/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
  40. package/dist/agent-runtime/src/use-deep-agent-thread.d.ts +35 -3
  41. package/dist/agent-runtime/src/use-deep-agent-thread.js +28 -10
  42. package/dist/agent-runtime/src/use-deep-agent-thread.js.map +1 -1
  43. package/dist/agent-runtime/src/use-deep-agent-voice.cjs +50 -15
  44. package/dist/agent-runtime/src/use-deep-agent-voice.cjs.map +1 -1
  45. package/dist/agent-runtime/src/use-deep-agent-voice.d.ts +8 -0
  46. package/dist/agent-runtime/src/use-deep-agent-voice.js +50 -15
  47. package/dist/agent-runtime/src/use-deep-agent-voice.js.map +1 -1
  48. package/dist/agent-runtime/src/voice-presentation.cjs +2 -0
  49. package/dist/agent-runtime/src/voice-presentation.cjs.map +1 -1
  50. package/dist/agent-runtime/src/voice-presentation.js +2 -0
  51. package/dist/agent-runtime/src/voice-presentation.js.map +1 -1
  52. package/dist/catalog/runtime-catalog.js +1 -1
  53. package/dist/chat/AthenaChat.cjs +125 -103
  54. package/dist/chat/AthenaChat.cjs.map +1 -1
  55. package/dist/chat/AthenaChat.d.ts +9 -0
  56. package/dist/chat/AthenaChat.js +126 -104
  57. package/dist/chat/AthenaChat.js.map +1 -1
  58. package/dist/chat/chat-voice-controls.cjs +128 -0
  59. package/dist/chat/chat-voice-controls.cjs.map +1 -0
  60. package/dist/chat/chat-voice-controls.d.ts +19 -0
  61. package/dist/chat/chat-voice-controls.js +128 -0
  62. package/dist/chat/chat-voice-controls.js.map +1 -0
  63. package/dist/chat/super-grouping/SuperGroupingCard.cjs +8 -2
  64. package/dist/chat/super-grouping/SuperGroupingCard.cjs.map +1 -1
  65. package/dist/chat/super-grouping/SuperGroupingCard.d.ts +6 -1
  66. package/dist/chat/super-grouping/SuperGroupingCard.js +8 -2
  67. package/dist/chat/super-grouping/SuperGroupingCard.js.map +1 -1
  68. package/dist/chat/super-grouping/ToolTimeline.cjs +27 -0
  69. package/dist/chat/super-grouping/ToolTimeline.cjs.map +1 -1
  70. package/dist/chat/super-grouping/ToolTimeline.d.ts +5 -1
  71. package/dist/chat/super-grouping/ToolTimeline.js +27 -0
  72. package/dist/chat/super-grouping/ToolTimeline.js.map +1 -1
  73. package/dist/chat/super-grouping/index.d.ts +1 -0
  74. package/dist/chat/super-grouping/timeline-step.cjs +61 -2
  75. package/dist/chat/super-grouping/timeline-step.cjs.map +1 -1
  76. package/dist/chat/super-grouping/timeline-step.d.ts +13 -1
  77. package/dist/chat/super-grouping/timeline-step.js +61 -2
  78. package/dist/chat/super-grouping/timeline-step.js.map +1 -1
  79. package/dist/chat/use-statewire-approval-request.js +1 -1
  80. package/dist/chat-ui/composer/tiptap-composer.cjs +42 -22
  81. package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
  82. package/dist/chat-ui/composer/tiptap-composer.d.ts +1 -0
  83. package/dist/chat-ui/composer/tiptap-composer.js +43 -23
  84. package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
  85. package/dist/chat-ui/mentions/mention-chip.cjs +144 -35
  86. package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -1
  87. package/dist/chat-ui/mentions/mention-chip.d.ts +17 -1
  88. package/dist/chat-ui/mentions/mention-chip.js +146 -37
  89. package/dist/chat-ui/mentions/mention-chip.js.map +1 -1
  90. package/dist/chat-ui/mentions/suggestions/data/api-client.cjs +2 -1
  91. package/dist/chat-ui/mentions/suggestions/data/api-client.cjs.map +1 -1
  92. package/dist/chat-ui/mentions/suggestions/data/api-client.d.ts +3 -1
  93. package/dist/chat-ui/mentions/suggestions/data/api-client.js +2 -1
  94. package/dist/chat-ui/mentions/suggestions/data/api-client.js.map +1 -1
  95. package/dist/chat-ui/mentions/use-account-workspace-id.cjs +29 -51
  96. package/dist/chat-ui/mentions/use-account-workspace-id.cjs.map +1 -1
  97. package/dist/chat-ui/mentions/use-account-workspace-id.d.ts +2 -2
  98. package/dist/chat-ui/mentions/use-account-workspace-id.js +30 -52
  99. package/dist/chat-ui/mentions/use-account-workspace-id.js.map +1 -1
  100. package/dist/chat-ui/mentions/use-mention-asset.cjs +140 -0
  101. package/dist/chat-ui/mentions/use-mention-asset.cjs.map +1 -0
  102. package/dist/chat-ui/mentions/use-mention-asset.d.ts +16 -0
  103. package/dist/chat-ui/mentions/use-mention-asset.js +140 -0
  104. package/dist/chat-ui/mentions/use-mention-asset.js.map +1 -0
  105. package/dist/chat-ui/rich-text/chat-link.cjs +5 -4
  106. package/dist/chat-ui/rich-text/chat-link.cjs.map +1 -1
  107. package/dist/chat-ui/rich-text/chat-link.d.ts +2 -3
  108. package/dist/chat-ui/rich-text/chat-link.js +6 -5
  109. package/dist/chat-ui/rich-text/chat-link.js.map +1 -1
  110. package/dist/chat-ui/rich-text/chat-node-views.cjs +1 -0
  111. package/dist/chat-ui/rich-text/chat-node-views.cjs.map +1 -1
  112. package/dist/chat-ui/rich-text/chat-node-views.js +1 -0
  113. package/dist/chat-ui/rich-text/chat-node-views.js.map +1 -1
  114. package/dist/chat-ui/thread/composer-send-or-stop.cjs +2 -1
  115. package/dist/chat-ui/thread/composer-send-or-stop.cjs.map +1 -1
  116. package/dist/chat-ui/thread/composer-send-or-stop.d.ts +2 -0
  117. package/dist/chat-ui/thread/composer-send-or-stop.js +2 -1
  118. package/dist/chat-ui/thread/composer-send-or-stop.js.map +1 -1
  119. package/dist/diagnostics/athena-diagnostics.cjs.map +1 -1
  120. package/dist/diagnostics/athena-diagnostics.d.ts +1 -1
  121. package/dist/diagnostics/athena-diagnostics.js.map +1 -1
  122. package/dist/index.d.ts +1 -1
  123. package/dist/react/package.json.cjs +1 -1
  124. package/dist/react/package.json.js +1 -1
  125. package/dist/references/src/tool-option-schemas.d.ts +0 -34
  126. package/dist/runtime/statewire-session-key.cjs.map +1 -1
  127. package/dist/runtime/statewire-session-key.d.ts +8 -5
  128. package/dist/runtime/statewire-session-key.js.map +1 -1
  129. package/dist/runtime/useAthenaStatewireRuntime.cjs +5 -2
  130. package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
  131. package/dist/runtime/useAthenaStatewireRuntime.js +5 -2
  132. package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
  133. package/dist/styles.css +1 -1
  134. package/dist/threads/statewire-thread-list.cjs +6 -2
  135. package/dist/threads/statewire-thread-list.cjs.map +1 -1
  136. package/dist/threads/statewire-thread-list.js +6 -2
  137. package/dist/threads/statewire-thread-list.js.map +1 -1
  138. package/dist/tools/tool-summary.cjs +0 -2
  139. package/dist/tools/tool-summary.cjs.map +1 -1
  140. package/dist/tools/tool-summary.js +0 -2
  141. package/dist/tools/tool-summary.js.map +1 -1
  142. package/dist/voice/use-chat-voice-enabled.cjs +43 -0
  143. package/dist/voice/use-chat-voice-enabled.cjs.map +1 -0
  144. package/dist/voice/use-chat-voice-enabled.d.ts +9 -0
  145. package/dist/voice/use-chat-voice-enabled.js +43 -0
  146. package/dist/voice/use-chat-voice-enabled.js.map +1 -0
  147. package/package.json +4 -8
@@ -47,7 +47,7 @@ import { useComposerKeyboardHint, ComposerKeyboardHint } from "./composer-keyboa
47
47
  import { usePrefersReducedMotion } from "../lib/use-prefers-reduced-motion.js";
48
48
  import { useStatewireSessionLane } from "../runtime/statewire-session-lane.js";
49
49
  import { AthenaAuthContext } from "../auth/AthenaAuthContext.js";
50
- import { useAuiState, ActionBarPrimitive, ActionBarMorePrimitive, MessagePrimitive, ThreadPrimitive, AuiIf, ErrorPrimitive, useAui } from "@assistant-ui/react";
50
+ import { useAuiState, ActionBarPrimitive, ActionBarMorePrimitive, MessagePrimitive, AuiIf, ErrorPrimitive, ThreadPrimitive, useAui } from "@assistant-ui/react";
51
51
  import { MoreHorizontalIcon, DownloadIcon, ExternalLinkIcon, BrainIcon, ChevronRightIcon, CheckIcon, CopyIcon, RefreshCwIcon, AlertCircleIcon, ArrowUpIcon, PencilIcon } from "lucide-react";
52
52
  import { useMemo, useContext, useState, useRef, useEffect, createContext, useCallback } from "react";
53
53
  import { useAthenaThreadId, AthenaStatewireThreadIdContext, useAthenaStatewireThreadId } from "../threads/thread-id-context.js";
@@ -68,6 +68,10 @@ import { getToolkitDisplayInfo } from "../toolkits/index.js";
68
68
  import { runActivityKey, runActivityVerb, isToolCallInFlight, runActivityLabel, runProgressKey, runElapsedLabel, isRunActivityStalled } from "./run-activity.js";
69
69
  import { readMessageCreatedAt, parseMessageTime, isSameCalendarDay, formatDayLabel, formatMessageTime, formatMessageDateTime } from "./message-time.js";
70
70
  import { ThreadScrollToBottom } from "./thread-scroll-to-bottom.js";
71
+ import { QueryClientProvider } from "@tanstack/react-query";
72
+ import { useCatalogQueryClient } from "../catalog/runtime-catalog.js";
73
+ import { isStatewireChannelLive } from "../runtime/statewire-lifecycle.js";
74
+ import { useComposerChatVoice, ChatVoiceButton, ChatVoiceStatus } from "./chat-voice-controls.js";
71
75
  import { TASK_TOOL_NAME } from "../agent-runtime/src/tool-names.js";
72
76
  import { useTurnToolCallsAwaitingApproval } from "../agent-runtime/src/subagents.js";
73
77
  import { isGithubWakeMessage } from "../agent-runtime/src/github-wake-event.js";
@@ -144,7 +148,11 @@ const withNestedPtcMessages = (ToolUI) => {
144
148
  };
145
149
  return ToolUIWithNestedPtcMessages;
146
150
  };
147
- const AthenaChat = ({
151
+ const AthenaChat = (props) => {
152
+ const queryClient = useCatalogQueryClient();
153
+ return /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx(AthenaChatContent, { ...props }) });
154
+ };
155
+ const AthenaChatContent = ({
148
156
  className,
149
157
  welcomeMessage = "Hello there!",
150
158
  welcomeSubtext = "What can I help you with?",
@@ -157,7 +165,8 @@ const AthenaChat = ({
157
165
  components,
158
166
  groupToolCalls = true,
159
167
  composer: composerSlots,
160
- dictation = true
168
+ dictation = true,
169
+ voice = true
161
170
  }) => {
162
171
  var _a, _b, _c, _d, _e, _f;
163
172
  const athenaConfig = useAthenaConfig();
@@ -299,6 +308,7 @@ const AthenaChat = ({
299
308
  tools,
300
309
  slots: composerSlots,
301
310
  dictation,
311
+ voice: readOnly ? false : voice,
302
312
  welcomeSuggestionCount: welcomeSuggestions.length
303
313
  }
304
314
  )
@@ -357,7 +367,7 @@ const ATHENA_CHAT_MENTION_CATEGORIES = [
357
367
  "projects",
358
368
  "folders"
359
369
  ];
360
- const AthenaChatComposer = ({ tools, slots, dictation, welcomeSuggestionCount }) => {
370
+ const AthenaChatComposer = ({ tools, slots, dictation, voice: voiceOptions, welcomeSuggestionCount }) => {
361
371
  const aui = useAui();
362
372
  const threadId = useAthenaStatewireThreadId();
363
373
  const { appUrl } = useAthenaConfig();
@@ -382,6 +392,7 @@ const AthenaChatComposer = ({ tools, slots, dictation, welcomeSuggestionCount })
382
392
  return ((_a = state.optional.thread) == null ? void 0 : _a.isRunning) ?? false;
383
393
  });
384
394
  const connection = useDeepAgentConnection();
395
+ const { voice, active: voiceActive, enabled: voiceEnabled, audioRef } = useComposerChatVoice({ options: voiceOptions });
385
396
  const runLive = useAuiState((state) => {
386
397
  const thread = state.optional.thread;
387
398
  return thread ? readRunLive(thread, connection) : false;
@@ -418,7 +429,7 @@ const AthenaChatComposer = ({ tools, slots, dictation, welcomeSuggestionCount })
418
429
  onAutoEnd: appendSpokenText
419
430
  });
420
431
  const recording = dictationEnabled && dictationCtl.isActive;
421
- const showMic = dictationEnabled && dictationCtl.isSupported;
432
+ const showMic = dictationEnabled && dictationCtl.isSupported && !voiceActive;
422
433
  const { isActive: dictationActive, cancel: cancelDictation } = dictationCtl;
423
434
  useEffect(() => {
424
435
  if (!dictationEnabled && dictationActive) cancelDictation();
@@ -468,8 +479,13 @@ const AthenaChatComposer = ({ tools, slots, dictation, welcomeSuggestionCount })
468
479
  [appUrl, aui, clearAttachments, clearQuote, threadId]
469
480
  );
470
481
  const interceptSubmit = useCallback(
471
- (text, draftMarkdown) => attachmentsRef.current.length > 0 || quoteRef.current !== null ? sendComposed({ text, draftMarkdown }) : false,
472
- [sendComposed]
482
+ async (text, draftMarkdown) => {
483
+ if (attachmentsRef.current.length > 0 || quoteRef.current !== null) {
484
+ return sendComposed({ text, draftMarkdown });
485
+ }
486
+ return voice.phase === "live" && text.length > 0 ? voice.sendUserText(text) : false;
487
+ },
488
+ [sendComposed, voice.phase, voice.sendUserText]
473
489
  );
474
490
  const hasPendingExtras = useCallback(
475
491
  () => attachmentsRef.current.length > 0 || quoteRef.current !== null,
@@ -541,104 +557,110 @@ const AthenaChatComposer = ({ tools, slots, dictation, welcomeSuggestionCount })
541
557
  aui.composer.setText(send.text);
542
558
  aui.composer.send({ steer: false });
543
559
  }, [appendSpokenText, aui, dictationCtl, isRunning, sendComposed, sessionLane, slots, threadId]);
544
- return /* @__PURE__ */ jsx(ComposerDropZone, { onDragActiveChange: setDragActive, children: /* @__PURE__ */ jsx(
545
- "div",
546
- {
547
- className: cn("aui-composer-entrance", entrance.className),
548
- style: entrance.style,
549
- onFocus: keyboardHint.onFocus,
550
- children: /* @__PURE__ */ jsx(
551
- ChatComposerDock,
552
- {
553
- appearance: "paper",
554
- dragActive,
555
- aboveSurface: /* @__PURE__ */ jsx(ThreadScrollToBottom, {}),
556
- beforeEditor: /* @__PURE__ */ jsxs(Fragment, { children: [
557
- /* @__PURE__ */ jsx(ComposerQuotePreview, {}),
558
- /* @__PURE__ */ jsx(ComposerAttachmentPreview, {})
559
- ] }),
560
- editor: /* @__PURE__ */ jsxs(Fragment, { children: [
561
- /* @__PURE__ */ jsx("div", { className: cn(recording && "hidden"), children: /* @__PURE__ */ jsx(
562
- TiptapComposer,
563
- {
564
- ref: composerRef,
565
- threadId,
566
- appearance: "paper",
567
- placeholder: (runLive ? slots == null ? void 0 : slots.runningPlaceholder : void 0) ?? (slots == null ? void 0 : slots.placeholder) ?? DEFAULT_COMPOSER_PLACEHOLDER,
568
- tools,
569
- rootCategories,
570
- onDraftStateChange,
571
- waitForHostUploads,
572
- interceptSubmit,
573
- hasPendingExtras,
574
- holdPendingExtras,
575
- onAttachmentError: setComposerNotice,
576
- fileIntake,
577
- onSubmitted: keyboardHint.onSubmitted
578
- }
579
- ) }),
580
- notice && /* @__PURE__ */ jsx("p", { className: "aui-composer-notice px-1.5 pb-1 text-destructive text-xs", role: "alert", children: notice }),
581
- recording && /* @__PURE__ */ jsx(
582
- DictationStrip,
583
- {
584
- status: dictationCtl.status,
585
- transcript: dictationCtl.transcript,
586
- stream: dictationCtl.stream,
587
- stoppingLabel: dictationCtl.engine.stoppingLabel
588
- }
589
- ),
590
- dictationEnabled && dictationCtl.status === DICTATION_STATUSES.error && dictationCtl.error && /* @__PURE__ */ jsx("p", { className: "aui-dictation-error px-1.5 pb-1 text-destructive text-xs", role: "alert", children: dictationCtl.error.message })
591
- ] }),
592
- toolbarStart: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", children: recording ? /* @__PURE__ */ jsx(DictationCancelButton, { onClick: dictationCtl.cancel }) : /* @__PURE__ */ jsxs(Fragment, { children: [
593
- /* @__PURE__ */ jsx(FileUploadButton, { className: "aui-composer-attach size-8 rounded-full p-0 disabled:opacity-30" }),
594
- /* @__PURE__ */ jsx(
595
- AthenaComposerMentionButton,
596
- {
597
- onClick: () => {
598
- var _a, _b;
599
- return (_b = (_a = composerRef.current) == null ? void 0 : _a.openMentionMenu) == null ? void 0 : _b.call(_a);
560
+ return /* @__PURE__ */ jsxs(ComposerDropZone, { onDragActiveChange: setDragActive, children: [
561
+ /* @__PURE__ */ jsx("audio", { ref: audioRef, autoPlay: true, playsInline: true }),
562
+ /* @__PURE__ */ jsx(
563
+ "div",
564
+ {
565
+ className: cn("aui-composer-entrance", entrance.className),
566
+ style: entrance.style,
567
+ onFocus: keyboardHint.onFocus,
568
+ children: /* @__PURE__ */ jsx(
569
+ ChatComposerDock,
570
+ {
571
+ appearance: "paper",
572
+ dragActive,
573
+ aboveSurface: /* @__PURE__ */ jsx(ThreadScrollToBottom, {}),
574
+ beforeEditor: /* @__PURE__ */ jsxs(Fragment, { children: [
575
+ /* @__PURE__ */ jsx(ChatVoiceStatus, { voice }),
576
+ /* @__PURE__ */ jsx(ComposerQuotePreview, {}),
577
+ /* @__PURE__ */ jsx(ComposerAttachmentPreview, {})
578
+ ] }),
579
+ editor: /* @__PURE__ */ jsxs(Fragment, { children: [
580
+ /* @__PURE__ */ jsx("div", { className: cn(recording && "hidden"), children: /* @__PURE__ */ jsx(
581
+ TiptapComposer,
582
+ {
583
+ ref: composerRef,
584
+ threadId,
585
+ appearance: "paper",
586
+ placeholder: (runLive ? slots == null ? void 0 : slots.runningPlaceholder : void 0) ?? (slots == null ? void 0 : slots.placeholder) ?? DEFAULT_COMPOSER_PLACEHOLDER,
587
+ tools,
588
+ rootCategories,
589
+ onDraftStateChange,
590
+ waitForHostUploads,
591
+ interceptSubmit,
592
+ hasPendingExtras,
593
+ holdPendingExtras,
594
+ onAttachmentError: setComposerNotice,
595
+ fileIntake,
596
+ onSubmitted: keyboardHint.onSubmitted
600
597
  }
601
- }
602
- ),
603
- /* @__PURE__ */ jsx(AthenaChatModeMenu, {}),
604
- slots == null ? void 0 : slots.toolbarStart
605
- ] }) }),
606
- toolbarEnd: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", children: recording ? /* @__PURE__ */ jsxs(Fragment, { children: [
607
- /* @__PURE__ */ jsx(
608
- DictationStopButton,
609
- {
610
- onClick: () => void stopDictation(),
611
- disabled: dictationCtl.status === DICTATION_STATUSES.stopping
612
- }
613
- ),
614
- /* @__PURE__ */ jsx(
615
- AthenaComposerSendButton,
616
- {
617
- action: isRunning ? "queue" : "send",
618
- onSend: () => void sendDictation(),
619
- disabled: dictationCtl.status !== DICTATION_STATUSES.listening || isUploading,
620
- title: isUploading ? "Upload in progress..." : void 0
621
- }
622
- )
623
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
624
- slots == null ? void 0 : slots.toolbarEnd,
625
- showMic && /* @__PURE__ */ jsx(DictationMicButton, { onClick: dictationCtl.start, disabled: isUploading }),
626
- /* @__PURE__ */ jsx(
627
- ComposerSendOrStop,
628
- {
629
- composerRef,
630
- hasDraft: hasText || hasExtras,
631
- sendBlockedReason: isUploading ? "Upload in progress..." : null,
632
- onBeforeSend: slots == null ? void 0 : slots.onBeforeSend,
633
- components: ATHENA_COMPOSER_COMPONENTS
634
- }
635
- )
636
- ] }) }),
637
- belowSurface: /* @__PURE__ */ jsx(ComposerKeyboardHint, { visible: keyboardHint.visible })
638
- }
639
- )
640
- }
641
- ) });
598
+ ) }),
599
+ notice && /* @__PURE__ */ jsx("p", { className: "aui-composer-notice px-1.5 pb-1 text-destructive text-xs", role: "alert", children: notice }),
600
+ recording && /* @__PURE__ */ jsx(
601
+ DictationStrip,
602
+ {
603
+ status: dictationCtl.status,
604
+ transcript: dictationCtl.transcript,
605
+ stream: dictationCtl.stream,
606
+ stoppingLabel: dictationCtl.engine.stoppingLabel
607
+ }
608
+ ),
609
+ dictationEnabled && dictationCtl.status === DICTATION_STATUSES.error && dictationCtl.error && /* @__PURE__ */ jsx("p", { className: "aui-dictation-error px-1.5 pb-1 text-destructive text-xs", role: "alert", children: dictationCtl.error.message })
610
+ ] }),
611
+ toolbarStart: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", children: recording ? /* @__PURE__ */ jsx(DictationCancelButton, { onClick: dictationCtl.cancel }) : /* @__PURE__ */ jsxs(Fragment, { children: [
612
+ /* @__PURE__ */ jsx(FileUploadButton, { className: "aui-composer-attach size-8 rounded-full p-0 disabled:opacity-30" }),
613
+ /* @__PURE__ */ jsx(
614
+ AthenaComposerMentionButton,
615
+ {
616
+ onClick: () => {
617
+ var _a, _b;
618
+ return (_b = (_a = composerRef.current) == null ? void 0 : _a.openMentionMenu) == null ? void 0 : _b.call(_a);
619
+ }
620
+ }
621
+ ),
622
+ /* @__PURE__ */ jsx(AthenaChatModeMenu, {}),
623
+ slots == null ? void 0 : slots.toolbarStart
624
+ ] }) }),
625
+ toolbarEnd: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", children: recording ? /* @__PURE__ */ jsxs(Fragment, { children: [
626
+ /* @__PURE__ */ jsx(
627
+ DictationStopButton,
628
+ {
629
+ onClick: () => void stopDictation(),
630
+ disabled: dictationCtl.status === DICTATION_STATUSES.stopping
631
+ }
632
+ ),
633
+ /* @__PURE__ */ jsx(
634
+ AthenaComposerSendButton,
635
+ {
636
+ action: isRunning ? "queue" : "send",
637
+ onSend: () => void sendDictation(),
638
+ disabled: dictationCtl.status !== DICTATION_STATUSES.listening || isUploading,
639
+ title: isUploading ? "Upload in progress..." : void 0
640
+ }
641
+ )
642
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
643
+ slots == null ? void 0 : slots.toolbarEnd,
644
+ showMic && /* @__PURE__ */ jsx(DictationMicButton, { onClick: dictationCtl.start, disabled: isUploading }),
645
+ voiceEnabled && /* @__PURE__ */ jsx(ChatVoiceButton, { voice, disabled: isUploading || dictationCtl.isActive || !isStatewireChannelLive(connection) }),
646
+ /* @__PURE__ */ jsx(
647
+ ComposerSendOrStop,
648
+ {
649
+ composerRef,
650
+ hasDraft: hasText || hasExtras,
651
+ liveVoice: voice.phase === "live" && !hasExtras,
652
+ sendBlockedReason: isUploading ? "Upload in progress..." : null,
653
+ onBeforeSend: slots == null ? void 0 : slots.onBeforeSend,
654
+ components: ATHENA_COMPOSER_COMPONENTS
655
+ }
656
+ )
657
+ ] }) }),
658
+ belowSurface: /* @__PURE__ */ jsx(ComposerKeyboardHint, { visible: keyboardHint.visible })
659
+ }
660
+ )
661
+ }
662
+ )
663
+ ] });
642
664
  };
643
665
  const MessageError = () => /* @__PURE__ */ jsx(MessagePrimitive.Error, { children: /* @__PURE__ */ jsxs(ErrorPrimitive.Root, { className: "aui-message-error-root mt-2 flex items-start gap-2 rounded-md border border-destructive bg-destructive/10 p-3 text-destructive text-sm dark:bg-destructive/5 dark:text-red-200", children: [
644
666
  /* @__PURE__ */ jsx(AlertCircleIcon, { className: "mt-0.5 size-4 shrink-0" }),