@burdenoff/fe-libs 2026.1006.2 → 2026.1007.2

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 (257) hide show
  1. package/dist/button/Button.d.ts +1 -1
  2. package/dist/button.d.ts +1 -1
  3. package/dist/chrome/AutoBreadcrumbs.d.ts +1 -1
  4. package/dist/chrome/BrandMark.d.ts +1 -1
  5. package/dist/chrome/ContextSwitcher.d.ts.map +1 -1
  6. package/dist/chrome/ContextSwitcher.js +93 -89
  7. package/dist/chrome/DynamicFooter.d.ts +1 -1
  8. package/dist/chrome/GlobalSearch.d.ts.map +1 -1
  9. package/dist/chrome/GlobalSearch.js +94 -96
  10. package/dist/chrome/HeaderThemeSwitcher.d.ts +1 -1
  11. package/dist/chrome/MobileTabBar.d.ts +1 -1
  12. package/dist/chrome/NativePageTransition.d.ts +1 -1
  13. package/dist/chrome/NativeTopBar.d.ts +1 -1
  14. package/dist/chrome/NavCustomizeDialog.d.ts +1 -1
  15. package/dist/chrome/NotificationCenter.d.ts.map +1 -1
  16. package/dist/chrome/NotificationCenter.js +62 -62
  17. package/dist/chrome/PageHeader.d.ts +1 -1
  18. package/dist/chrome/PersonaSurfaceControls.d.ts +2 -2
  19. package/dist/chrome/ProductSideNav.d.ts +1 -1
  20. package/dist/chrome/ShortcutHelpDialog.d.ts.map +1 -1
  21. package/dist/chrome/ShortcutHelpDialog.js +103 -97
  22. package/dist/chrome/ThemePreferences.d.ts +1 -1
  23. package/dist/chrome/notificationCenter/NotificationPanel.d.ts.map +1 -1
  24. package/dist/chrome/notificationCenter/NotificationPanel.js +28 -17
  25. package/dist/chrome/notificationCenter/usePanelChrome.d.ts +0 -1
  26. package/dist/chrome/notificationCenter/usePanelChrome.d.ts.map +1 -1
  27. package/dist/chrome/notificationCenter/usePanelChrome.js +1 -10
  28. package/dist/chrome/shellOverlayLayer.d.ts +42 -0
  29. package/dist/chrome/shellOverlayLayer.d.ts.map +1 -0
  30. package/dist/chrome/shellOverlayLayer.js +4 -0
  31. package/dist/chrome.d.ts +1 -1
  32. package/dist/config/eslint.config.d.ts +1 -1
  33. package/dist/connections.d.ts +1 -1
  34. package/dist/credentials.d.ts +1 -1
  35. package/dist/form/Checkbox.d.ts +1 -1
  36. package/dist/form/Form.d.ts +1 -1
  37. package/dist/form/FormDescription.d.ts +1 -1
  38. package/dist/form/FormField.d.ts +3 -3
  39. package/dist/form/FormLabel.d.ts +1 -1
  40. package/dist/form/FormMessage.d.ts +1 -1
  41. package/dist/form/FormSection.d.ts +1 -1
  42. package/dist/form/Input.d.ts +1 -1
  43. package/dist/form/Radio.d.ts +2 -2
  44. package/dist/form/Select.d.ts +7 -7
  45. package/dist/form/Textarea.d.ts +1 -1
  46. package/dist/form.d.ts +1 -1
  47. package/dist/shared/assistant/appControls/languageReply.d.ts +28 -0
  48. package/dist/shared/assistant/appControls/languageReply.d.ts.map +1 -0
  49. package/dist/shared/assistant/appControls/languageReply.js +17 -0
  50. package/dist/shared/assistant/appControls/text.d.ts +7 -1
  51. package/dist/shared/assistant/appControls/text.d.ts.map +1 -1
  52. package/dist/shared/assistant/appControls/text.js +4 -3
  53. package/dist/shared/assistant/conversation.d.ts +2 -0
  54. package/dist/shared/assistant/conversation.d.ts.map +1 -1
  55. package/dist/shared/assistant/displayContent.d.ts.map +1 -1
  56. package/dist/shared/assistant/displayContent.js +14 -11
  57. package/dist/shared/assistant/history/historyMapping.d.ts.map +1 -1
  58. package/dist/shared/assistant/history/historyMapping.js +10 -5
  59. package/dist/shared/assistant/i18n.d.ts +1 -1
  60. package/dist/shared/assistant/index.d.ts +1 -0
  61. package/dist/shared/assistant/index.d.ts.map +1 -1
  62. package/dist/shared/assistant/product.d.ts +1 -1
  63. package/dist/shared/assistant/ui/AIAssistantPanel.js +8 -8
  64. package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
  65. package/dist/shared/assistant/ui/AssistantChatArea.js +1012 -939
  66. package/dist/shared/assistant/ui/AssistantMessageItem.d.ts.map +1 -1
  67. package/dist/shared/assistant/ui/AssistantMessageItem.js +105 -97
  68. package/dist/shared/assistant/ui/AssistantMoreMenu.d.ts.map +1 -1
  69. package/dist/shared/assistant/ui/AssistantMoreMenu.js +112 -108
  70. package/dist/shared/assistant/ui/AssistantOverlay.d.ts +2 -2
  71. package/dist/shared/assistant/ui/WorkflowAssistantPanel.d.ts +1 -1
  72. package/dist/shared/assistant/ui/composer/AssistantAttachmentButton.d.ts.map +1 -1
  73. package/dist/shared/assistant/ui/composer/AssistantAttachmentButton.js +66 -62
  74. package/dist/shared/assistant/ui/controlConfirmDialog.js +4 -4
  75. package/dist/shared/assistant/ui/useDropdownEscape.d.ts +8 -30
  76. package/dist/shared/assistant/ui/useDropdownEscape.d.ts.map +1 -1
  77. package/dist/shared/assistant/ui/useDropdownEscape.js +6 -20
  78. package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +7 -7
  79. package/dist/shared/assistant/uiActions/recordNames.d.ts +18 -6
  80. package/dist/shared/assistant/uiActions/recordNames.d.ts.map +1 -1
  81. package/dist/shared/assistant/uiActions/recordNames.js +42 -37
  82. package/dist/shared/components/AccessDenied.d.ts +2 -2
  83. package/dist/shared/components/AppErrorBoundary.d.ts +1 -1
  84. package/dist/shared/components/ConditionalShell.d.ts +1 -1
  85. package/dist/shared/components/ContextConversationWidget.d.ts +1 -1
  86. package/dist/shared/components/ErrorFallback.d.ts +1 -1
  87. package/dist/shared/components/EscapeLayer.d.ts +15 -0
  88. package/dist/shared/components/EscapeLayer.d.ts.map +1 -0
  89. package/dist/shared/components/EscapeLayer.js +31 -0
  90. package/dist/shared/components/KeyboardHelpDialogWrapper.d.ts +1 -1
  91. package/dist/shared/components/LoadingFallback.d.ts +3 -3
  92. package/dist/shared/components/MicrofrontendErrorBoundary.d.ts +1 -1
  93. package/dist/shared/components/PWAInstallBanner.d.ts +1 -1
  94. package/dist/shared/components/ProductAccessGuard.d.ts +1 -1
  95. package/dist/shared/components/QuotaMeter.d.ts +1 -1
  96. package/dist/shared/components/RequireAuth.d.ts +2 -2
  97. package/dist/shared/components/SSORedirectGuard.d.ts +1 -1
  98. package/dist/shared/components/SearchPage.d.ts +1 -1
  99. package/dist/shared/components/UpgradeInlineBanner.d.ts +1 -1
  100. package/dist/shared/components/UpgradePromptModal.d.ts +1 -1
  101. package/dist/shared/components/contextConversationWidget/Composer.d.ts +1 -1
  102. package/dist/shared/components/contextConversationWidget/MessageItem.d.ts +1 -1
  103. package/dist/shared/components/contextConversationWidget/MessageList.d.ts +1 -1
  104. package/dist/shared/components/contextConversationWidget/NoWorkspaceCard.d.ts +1 -1
  105. package/dist/shared/components/contextConversationWidget/PendingAttachmentsBar.d.ts +1 -1
  106. package/dist/shared/components/contextConversationWidget/ReplyBanner.d.ts +1 -1
  107. package/dist/shared/components/contextConversationWidget/WidgetHeader.d.ts +1 -1
  108. package/dist/shared/components/searchPage/FiltersPanel.d.ts +1 -1
  109. package/dist/shared/components/searchPage/Pagination.d.ts +1 -1
  110. package/dist/shared/components/searchPage/ResultsHeader.d.ts +1 -1
  111. package/dist/shared/components/searchPage/ResultsList.d.ts +1 -1
  112. package/dist/shared/components/searchPage/SearchInput.d.ts +1 -1
  113. package/dist/shared/components/searchPage/SearchToolbar.d.ts +1 -1
  114. package/dist/shared/config/eslint.config.d.ts +1 -1
  115. package/dist/shared/events/index.d.ts +1 -1
  116. package/dist/shared/events/sinks/RybbitSink.d.ts +1 -1
  117. package/dist/shared/feature-flags/FeatureFlagProvider.d.ts +1 -1
  118. package/dist/shared/feature-flags/FeatureGate.d.ts +1 -1
  119. package/dist/shared/geography/GeographyProvider.d.ts +1 -1
  120. package/dist/shared/graphql/GatewayContext.d.ts +1 -1
  121. package/dist/shared/help/HelpProvider.d.ts +1 -1
  122. package/dist/shared/motion/AnimatedCounter.d.ts +1 -1
  123. package/dist/shared/motion/MotionCard.d.ts +1 -1
  124. package/dist/shared/motion/MotionCollapse.d.ts +1 -1
  125. package/dist/shared/motion/MotionFade.d.ts +1 -1
  126. package/dist/shared/motion/MotionItem.d.ts +1 -1
  127. package/dist/shared/motion/MotionList.d.ts +1 -1
  128. package/dist/shared/motion/MotionPage.d.ts +1 -1
  129. package/dist/shared/native/SafeAreaView.d.ts +1 -1
  130. package/dist/shared/pages/AiPage.d.ts +1 -1
  131. package/dist/shared/pages/LegalPage.d.ts +1 -1
  132. package/dist/shared/pages/NotFoundPage.d.ts +1 -1
  133. package/dist/shared/pages/SearchPage.d.ts +1 -1
  134. package/dist/shared/pages/searchPage/ActiveFilterChips.d.ts +1 -1
  135. package/dist/shared/pages/searchPage/FiltersPanel.d.ts +1 -1
  136. package/dist/shared/pages/searchPage/ResultsList.d.ts +1 -1
  137. package/dist/shared/pages/searchPage/ResultsStatus.d.ts +1 -1
  138. package/dist/shared/pages/searchPage/SearchInput.d.ts +1 -1
  139. package/dist/shared/pages/searchPage/SearchPagination.d.ts +1 -1
  140. package/dist/shared/pages/searchPage/SearchToolbar.d.ts +1 -1
  141. package/dist/shared/plugins/PluginRuntimeProvider.d.ts +1 -1
  142. package/dist/shared/plugins/iframe-mount/PluginIframe.d.ts +1 -1
  143. package/dist/shared/plugins/iframe-mount/PluginMount.d.ts +1 -1
  144. package/dist/shared/providers/AppShellProvider.d.ts +1 -1
  145. package/dist/shared/providers/MicrofrontendProvider.d.ts +1 -1
  146. package/dist/shared/providers/index.d.ts +1 -1
  147. package/dist/shared/providers/shell/ActiveContextProvider.d.ts +1 -1
  148. package/dist/shared/providers/shell/AppShellContext.d.ts +1 -1
  149. package/dist/shared/providers/shell/AuthProvider.d.ts +1 -1
  150. package/dist/shared/providers/shell/AuthTokenProvider.d.ts +1 -1
  151. package/dist/shared/providers/shell/ContextManagerProvider.d.ts +1 -1
  152. package/dist/shared/providers/shell/FeatureFlagsProvider.d.ts +1 -1
  153. package/dist/shared/providers/shell/GatewayRouter.d.ts +1 -1
  154. package/dist/shared/providers/shell/GlobalUiProvider.d.ts +1 -1
  155. package/dist/shared/providers/shell/I18nProvider.d.ts +1 -1
  156. package/dist/shared/providers/shell/MultiGatewayProvider.d.ts +1 -1
  157. package/dist/shared/providers/shell/ObservabilityProvider.d.ts +1 -1
  158. package/dist/shared/providers/shell/PageConversationContextProvider.d.ts +1 -1
  159. package/dist/shared/providers/shell/PermissionProvider.d.ts +1 -1
  160. package/dist/shared/providers/shell/PersonaSurfaceProvider.d.ts +1 -1
  161. package/dist/shared/providers/shell/ProfileGeographyBridge.d.ts +1 -1
  162. package/dist/shared/providers/shell/ProfileI18nBridge.d.ts +1 -1
  163. package/dist/shared/providers/shell/ShellUiProvider.d.ts +1 -1
  164. package/dist/shared/providers/shell/ThemeProvider.d.ts +1 -1
  165. package/dist/shared/tours/TourPermissionsBoundary.d.ts +1 -1
  166. package/dist/shared/tours/TourPlayer.d.ts +1 -1
  167. package/dist/shared/tours/TourPlayerProvider.d.ts +1 -1
  168. package/dist/shared/tours/TourTrigger.d.ts +1 -1
  169. package/dist/shared/tours/ToursContext.d.ts +1 -1
  170. package/dist/shared/tours/tourTrigger/TourListItemDesktop.d.ts +1 -1
  171. package/dist/shared/tours/tourTrigger/TourListItemMobile.d.ts +1 -1
  172. package/dist/shared/tours/tourTrigger/TourLoadError.d.ts +1 -1
  173. package/dist/shared/tours/tourTrigger/TourStatusChip.d.ts +1 -1
  174. package/dist/shared/utils/appHelpers.d.ts +1 -1
  175. package/dist/shared-assistant.d.ts +1 -1
  176. package/dist/shared-assistant.js +151 -150
  177. package/dist/shared-components.d.ts +1 -1
  178. package/dist/shared-config.d.ts +1 -1
  179. package/dist/shared-events.d.ts +1 -1
  180. package/dist/shared-feature-flags.d.ts +1 -1
  181. package/dist/shared-geography.d.ts +1 -1
  182. package/dist/shared-graphql.d.ts +1 -1
  183. package/dist/shared-hooks-shell.d.ts +1 -1
  184. package/dist/shared-hooks.d.ts +1 -1
  185. package/dist/shared-keyboard.d.ts +1 -1
  186. package/dist/shared-logger.d.ts +1 -1
  187. package/dist/shared-motion.d.ts +1 -1
  188. package/dist/shared-native.d.ts +1 -1
  189. package/dist/shared-pages.d.ts +1 -1
  190. package/dist/shared-plugins.d.ts +1 -1
  191. package/dist/shared-providers-shell.d.ts +1 -1
  192. package/dist/shared-providers.d.ts +1 -1
  193. package/dist/shared-shims.d.ts +1 -1
  194. package/dist/shared-tours.d.ts +1 -1
  195. package/dist/shared-utils.d.ts +1 -1
  196. package/dist/shared.d.ts +1 -1
  197. package/dist/sharing.d.ts +1 -1
  198. package/dist/shell-native.d.ts +1 -1
  199. package/dist/storage/SaveToFilesButton.d.ts +1 -1
  200. package/dist/storage/SaveToFilesDialog.d.ts +1 -1
  201. package/dist/storage/StorageFolderPicker.d.ts +1 -1
  202. package/dist/tag/TagBadge.d.ts +1 -1
  203. package/dist/tag/TagsWidget.d.ts +1 -1
  204. package/dist/tag/tagsWidget/TagBadgeList.d.ts +1 -1
  205. package/dist/tag/tagsWidget/TagSearchPopover.d.ts +1 -1
  206. package/dist/tag.d.ts +1 -1
  207. package/dist/ui/accordion.d.ts +4 -4
  208. package/dist/ui/action-sheet.d.ts +1 -1
  209. package/dist/ui/alert-dialog.d.ts +11 -11
  210. package/dist/ui/aurora-background.d.ts +1 -1
  211. package/dist/ui/badge.d.ts +1 -1
  212. package/dist/ui/bottom-sheet.d.ts +8 -8
  213. package/dist/ui/branded-splash.d.ts +1 -1
  214. package/dist/ui/button.d.ts +1 -1
  215. package/dist/ui/card.d.ts +6 -6
  216. package/dist/ui/checkbox.d.ts +1 -1
  217. package/dist/ui/command.d.ts +9 -9
  218. package/dist/ui/cta-overflow-menu.d.ts +1 -1
  219. package/dist/ui/dialog.d.ts +10 -10
  220. package/dist/ui/dropdown-menu.d.ts +9 -9
  221. package/dist/ui/emphasis-panel.d.ts +1 -1
  222. package/dist/ui/empty-state.d.ts +1 -1
  223. package/dist/ui/entity-id-modal.d.ts +1 -1
  224. package/dist/ui/glass-card.d.ts +1 -1
  225. package/dist/ui/gradient-text.d.ts +1 -1
  226. package/dist/ui/guidance.d.ts +2 -2
  227. package/dist/ui/illustration.d.ts +2 -2
  228. package/dist/ui/input.d.ts +1 -1
  229. package/dist/ui/label.d.ts +1 -1
  230. package/dist/ui/modal-shell.d.ts +1 -1
  231. package/dist/ui/modern-landing.d.ts +1 -1
  232. package/dist/ui/native-welcome.d.ts +1 -1
  233. package/dist/ui/offline-banner.d.ts +1 -1
  234. package/dist/ui/optional-fields.d.ts +1 -1
  235. package/dist/ui/pagination.d.ts +1 -1
  236. package/dist/ui/popover.d.ts +4 -4
  237. package/dist/ui/pull-to-refresh.d.ts +1 -1
  238. package/dist/ui/pwa-update-toast.d.ts +1 -1
  239. package/dist/ui/responsive-dialog.d.ts +8 -8
  240. package/dist/ui/responsive-stack.d.ts +1 -1
  241. package/dist/ui/responsive-table.d.ts +1 -1
  242. package/dist/ui/scroll-area.d.ts +2 -2
  243. package/dist/ui/select.d.ts +8 -8
  244. package/dist/ui/separator.d.ts +1 -1
  245. package/dist/ui/sheet.d.ts +8 -8
  246. package/dist/ui/show-more.d.ts +1 -1
  247. package/dist/ui/skeleton.d.ts +1 -1
  248. package/dist/ui/sonner.d.ts +1 -1
  249. package/dist/ui/spinner.d.ts +1 -1
  250. package/dist/ui/stepper.d.ts +1 -1
  251. package/dist/ui/switch.d.ts +1 -1
  252. package/dist/ui/table.d.ts +8 -8
  253. package/dist/ui/tabs.d.ts +4 -4
  254. package/dist/ui/textarea.d.ts +1 -1
  255. package/dist/ui/tooltip.d.ts +1 -1
  256. package/dist/ui.d.ts +1 -1
  257. package/package.json +7 -4
@@ -12,266 +12,267 @@ import { getHistoryStamp as ee, setHistoryBusyProbe as m } from "../history/stam
12
12
  import { beginApprovalInFlight as te, endApprovalInFlight as ne, getApprovalInFlight as h, markLiveTurn as re, newestModelReplyId as g, resolveApprovablePendingWrite as _, resolveRetryableMessageId as v, subscribeApprovalInFlight as ie } from "../liveTurns.js";
13
13
  import { isWriteModeAcknowledged as ae, writeModeSendRefusalReason as oe } from "../writeModeConsent.js";
14
14
  import { resolveActiveModeSandbox as se, useAssistantStore as y } from "../store.js";
15
- import { abortAssistantTurn as ce, approvePendingWrite as b, createAssistantSandbox as le, createAssistantSession as ue, extendAssistantSandboxTTL as de, findExistingSandboxWithStatus as fe, getAssistantArtifacts as pe, getAssistantMessages as me, getAssistantSession as x, mintAssistantTurnStream as he, modeRequiresConfirmWrites as ge, promptGatewayRequestBytes as _e, releaseSupersededAssistantSandboxes as S, sendAssistantPromptAsync as ve, waitForAssistantServiceReady as ye, waitForSandboxRunning as be, writeApprovalModeOf as C } from "../api.js";
16
- import { sanitize as xe } from "../progress.js";
17
- import { AssistantSendRefusal as Se, classifyTurnFailure as Ce, turnConfirmsNoAction as we, turnOutcomeCopy as Te } from "../turnOutcome.js";
18
- import { assistantUsageLedger as Ee, hasPendingUsageReports as De, reportUsageWithRetry as Oe, retryPendingUsageReports as ke, usageSendRefusal as Ae } from "../usageReporting.js";
19
- import { withIncompleteTurnNotice as je } from "../streamBudget.js";
20
- import { chatTurns as Me, isVoiceTurn as Ne, voiceMarker as w, voiceSessionIdOf as Pe } from "../voice/turnVisibility.js";
21
- import { speechFeed as Fe } from "../speech/speechFeed.js";
22
- import { isTurnSuperseded as T, markTurnSuperseded as Ie } from "../voice/supersededTurns.js";
23
- import { buildContinuedFromVoiceNote as Le, buildVoiceTranscriptMarkdown as Re, voiceTranscriptFilename as ze } from "../voice/voiceTranscript.js";
24
- import { pollDelayMs as Be } from "../voice/assistantPollSchedule.js";
25
- import { toCaptionText as E } from "../voice/captionText.js";
26
- import { resolveAssistantLanguage as Ve } from "../voice/languages.js";
27
- import { resolveLanguagePair as He } from "../voice/languagePair.js";
28
- import { INITIAL_TRANSCRIPT_AUTO_OPEN as Ue, isAwaitingOwnConversation as We, maySendSpokenTurn as Ge, planTranscriptAutoOpen as Ke, planVoiceSessionBinding as qe, planVoiceSessionStart as Je, planVoiceSpokenEntry as Ye, voiceBindingAtStart as Xe, voiceBindingConversationId as Ze } from "../voice/voiceReopen.js";
29
- import { countInlineImageCandidates as Qe, countInlinedImageParts as $e, getSendableAttachments as et, largestInlineCharsPerFile as tt, resolveAssistantInlineLimits as nt, toMessageAttachment as rt } from "../attachments.js";
30
- import { WRITE_PROPOSAL_VOICE_COPY as it, isVoiceProposalBound as at, voiceProposalChip as ot, voiceProposalChipText as st, voiceReadbacksDue as ct, voiceWaitingProposals as lt, writeProposalVoiceLine as ut, writeProposalVoiceReadback as dt } from "../writeProposalVoice.js";
31
- import { createAdminModeAccessGate as ft, resolveAssistantSendModeAfterAccess as pt } from "../adminModeSendGate.js";
32
- import { buildBoundedAttachmentTurn as mt } from "../attachmentTurn.js";
33
- import { isTurnInFlight as ht, planAbandonedTurn as gt, planTurnAbort as _t } from "../turnState.js";
34
- import { getAssistantDisplayContent as vt } from "../displayContent.js";
35
- import { NO_FIRST_TEXT as yt, buildAssistantProgress as bt, readAheadFor as xt, snapshotReplyFloor as St, startSessionReadAhead as Ct, trackFirstText as wt } from "../turnProgress.js";
36
- import { parseToolActivity as Tt } from "./AssistantToolActivity.js";
37
- import { countSpokenTurns as Et, spokenMessagesSinceContinueNote as Dt, spokenTurnText as Ot } from "../spokenTurns.js";
38
- import { beginTurn as kt, describeTurn as D, detectTurnDevice as At, markTurn as O, restartAttempt as jt, turnClockMs as Mt } from "../turnTimeline.js";
39
- import { useAssistantSpeech as Nt } from "./AssistantSpeechProvider.js";
40
- import { useVoiceSession as Pt } from "./useVoiceSession.js";
41
- import { getOrganizationId as Ft, getWorkspaceId as k } from "../context.js";
42
- import { isMultimodalBodyRejection as It, isRecoverableAssistantError as Lt } from "../transportErrors.js";
43
- import { createReadinessTracker as Rt, planAfterTransportFailure as zt, planTrustedSandboxFailure as Bt } from "../sandboxReadiness.js";
44
- import { writeProposalConfirmState as Vt } from "./writeProposalPresentation.js";
45
- import { writeProposalUsesDialog as Ht } from "./AssistantWriteProposalCard.js";
46
- import { AssistantWriteConfirmDialog as Ut } from "./AssistantWriteConfirmDialog.js";
47
- import { useWriteProposalConfirm as Wt } from "./useWriteProposalConfirm.js";
48
- import { AssistantWriteProposalSlot as Gt } from "./AssistantWriteProposalSlot.js";
49
- import { readWriteProposalRefs as Kt, writeProposalsEnabledFor as qt } from "../writeProposalDiscovery.js";
50
- import { planWriteReply as Jt, promptWriteApproval as Yt } from "../writeReplySend.js";
51
- import { useWriteProposals as Xt } from "./useWriteProposals.js";
52
- import { AssistantSpokenTurnsNotice as Zt } from "./AssistantSpokenTurnsNotice.js";
53
- import { AssistantHistoryArchivedNotice as Qt, AssistantHistoryDeletedNotice as $t, AssistantHistoryLoadState as en, AssistantHistoryReadOnlyBanner as tn, AssistantHistoryShowEarlier as nn } from "./AssistantHistoryNotices.js";
54
- import { VoiceTranscriptDrawer as rn } from "./voice/VoiceTranscriptDrawer.js";
55
- import { downloadFile as an } from "../exportConversation.js";
56
- import { conversationHasHistory as on, isOtherScopeHistoryConversation as sn, isReadOnlyHistoryConversation as cn, isReusableHistoryDraft as ln } from "../history/historyList.js";
57
- import { useAssistantHistoryStatus as un } from "../history/historyStatus.js";
58
- import { assistantHistory as dn } from "../history/historyEngine.js";
59
- import { AssistantEmptyState as fn } from "./AssistantEmptyState.js";
60
- import { AssistantNothingToDeleteNotice as pn } from "./AssistantDeleteConversationDialog.js";
61
- import { assistantHistoryIsOn as mn } from "./conversationDelete.js";
62
- import { useConversationDeleteDialog as hn } from "./conversationDeleteDialog.js";
63
- import { backDoneCopy as gn, chooseDestinationCopy as _n, chooseLinkedCopy as vn, entityNounText as yn, linkNotOpenableCopy as bn, navigationCommandCopy as xn, navigationOutcomeCopy as Sn, pickFromListCopy as Cn, recordChoiceCopy as wn, recordKindsCopy as Tn, themeCommandCopy as En } from "../localUiCommandCopy.js";
64
- import { appControlCopy as Dn } from "../appControls/copy.js";
65
- import { useControlConfirmDialog as On } from "./controlConfirmDialog.js";
66
- import { resolveConversationDeleteTarget as kn } from "../conversationDeleteCommand.js";
67
- import { resumeContextFor as An } from "../history/historyResume.js";
68
- import { useHistoryRowControlsFor as jn } from "../history/useHistoryRowControls.js";
69
- import { liveCoverage as Mn } from "../liveDeltas.js";
70
- import { createLiveRender as Nn } from "../liveOverlay.js";
71
- import { AssistantMessageList as Pn } from "./AssistantMessageList.js";
72
- import { AssistantVoiceSession as Fn } from "./voice/AssistantVoiceSession.js";
73
- import { useAssistantApiAccess as In } from "../useAssistantApiAccess.js";
74
- import { useConversationTurns as Ln } from "../useConversationTurns.js";
75
- import { openTurnStream as Rn, turnStreamAvailable as zn } from "../turnStream.js";
76
- import { createSnapshotPoller as Bn } from "../snapshotPoller.js";
77
- import { sendAssistantTurnTimings as Vn, startTurnTimingReporting as Hn } from "../turnTimingReporter.js";
78
- import { QuarantineSet as Un, WarmCancelled as Wn, claimPreopenedSession as Gn, consumeWarm as Kn, preopenKey as qn, preopenWanted as Jn, prewarmTarget as Yn, settleWarmBeforeSend as Xn, startPreopen as Zn, startWarm as Qn, warmState as $n } from "../prewarm.js";
79
- import { isThereRequest as er, parseChoice as tr } from "../uiActions/deixis.js";
80
- import { navEntryIds as nr } from "../uiActions/resolveTarget.js";
81
- import { lookupNamedRecords as rr } from "../uiActions/recordNames.js";
82
- import { isAlreadyThere as ir, matchLocalUiCommand as ar, navDestinations as or, normaliseUtterance as sr, planThemeChange as cr } from "../localUiCommands.js";
83
- import { runNavigation as lr } from "../uiActions/navigationOutcome.js";
84
- import { assistantBackStack as ur, isBackRunnable as dr } from "../uiActions/backStack.js";
85
- import { buildNavigateAction as fr, destinationForPath as pr, labelForPath as mr, newestAssistantOnSurface as hr } from "../uiActions/navigateAction.js";
86
- import { buildNavigationContext as gr, latestReplyOnSurface as _r, rememberPresentedList as vr } from "../uiActions/linkContext.js";
87
- import { buildUiCatalogue as yr } from "../uiActions/uiCatalogue.js";
88
- import { readControlSnapshot as br } from "../appControls/snapshot.js";
89
- import { planAppControl as xr } from "../appControls/plan.js";
90
- import { dispatchAssistantQuotaExhausted as Sr, notifyAiCreditsUpdated as Cr } from "../aiCredits.js";
91
- import { useAssistantAttachments as wr } from "../useAssistantAttachments.js";
92
- import { AssistantComposer as Tr } from "./composer/AssistantComposer.js";
93
- import { isProdRuntime as Er } from "../env.js";
94
- import { AssistantApiCallsConsentDialog as Dr } from "./AssistantApiCallsConsentDialog.js";
95
- import { useVisibleNavItems as Or } from "../../../chrome/mobileTabBar/useVisibleNavItems.js";
96
- import { useCallback as A, useEffect as j, useMemo as kr, useRef as M, useState as Ar, useSyncExternalStore as jr } from "react";
97
- import { jsx as N, jsxs as Mr } from "react/jsx-runtime";
15
+ import { abortAssistantTurn as ce, approvePendingWrite as b, createAssistantSandbox as le, createAssistantSession as ue, extendAssistantSandboxTTL as de, findExistingSandboxWithStatus as fe, getAssistantArtifacts as pe, getAssistantMessages as me, getAssistantSession as x, mintAssistantTurnStream as he, modeRequiresConfirmWrites as ge, promptGatewayRequestBytes as _e, releaseSupersededAssistantSandboxes as ve, sendAssistantPromptAsync as ye, waitForAssistantServiceReady as be, waitForSandboxRunning as xe, writeApprovalModeOf as S } from "../api.js";
16
+ import { sanitize as Se } from "../progress.js";
17
+ import { AssistantSendRefusal as Ce, classifyTurnFailure as we, turnConfirmsNoAction as Te, turnOutcomeCopy as Ee } from "../turnOutcome.js";
18
+ import { assistantUsageLedger as De, hasPendingUsageReports as Oe, reportUsageWithRetry as ke, retryPendingUsageReports as Ae, usageSendRefusal as je } from "../usageReporting.js";
19
+ import { withIncompleteTurnNotice as Me } from "../streamBudget.js";
20
+ import { chatTurns as Ne, isVoiceTurn as Pe, voiceMarker as C, voiceSessionIdOf as Fe } from "../voice/turnVisibility.js";
21
+ import { speechFeed as Ie } from "../speech/speechFeed.js";
22
+ import { isTurnSuperseded as w, markTurnSuperseded as Le } from "../voice/supersededTurns.js";
23
+ import { buildContinuedFromVoiceNote as Re, buildVoiceTranscriptMarkdown as ze, voiceTranscriptFilename as Be } from "../voice/voiceTranscript.js";
24
+ import { pollDelayMs as Ve } from "../voice/assistantPollSchedule.js";
25
+ import { toCaptionText as T } from "../voice/captionText.js";
26
+ import { resolveAssistantLanguage as He } from "../voice/languages.js";
27
+ import { resolveLanguagePair as Ue } from "../voice/languagePair.js";
28
+ import { INITIAL_TRANSCRIPT_AUTO_OPEN as We, isAwaitingOwnConversation as Ge, maySendSpokenTurn as Ke, planTranscriptAutoOpen as qe, planVoiceSessionBinding as Je, planVoiceSessionStart as Ye, planVoiceSpokenEntry as Xe, voiceBindingAtStart as Ze, voiceBindingConversationId as Qe } from "../voice/voiceReopen.js";
29
+ import { countInlineImageCandidates as $e, countInlinedImageParts as et, getSendableAttachments as tt, largestInlineCharsPerFile as nt, resolveAssistantInlineLimits as rt, toMessageAttachment as it } from "../attachments.js";
30
+ import { WRITE_PROPOSAL_VOICE_COPY as at, isVoiceProposalBound as ot, voiceProposalChip as st, voiceProposalChipText as ct, voiceReadbacksDue as lt, voiceWaitingProposals as ut, writeProposalVoiceLine as dt, writeProposalVoiceReadback as ft } from "../writeProposalVoice.js";
31
+ import { createAdminModeAccessGate as pt, resolveAssistantSendModeAfterAccess as mt } from "../adminModeSendGate.js";
32
+ import { buildBoundedAttachmentTurn as ht } from "../attachmentTurn.js";
33
+ import { isTurnInFlight as gt, planAbandonedTurn as _t, planTurnAbort as vt } from "../turnState.js";
34
+ import { backDoneCopy as yt, chooseDestinationCopy as bt, chooseLinkedCopy as xt, entityNounText as St, linkNotOpenableCopy as Ct, navigationCommandCopy as wt, navigationOutcomeCopy as Tt, pickFromListCopy as Et, recordChoiceCopy as Dt, recordKindsCopy as Ot, themeCommandCopy as kt } from "../localUiCommandCopy.js";
35
+ import { appControlCopy as At } from "../appControls/copy.js";
36
+ import { LANGUAGE_REPLY_DEADLINE_MS as jt, languageConfirmationCopy as Mt, languageReplyStep as Nt } from "../appControls/languageReply.js";
37
+ import { getAssistantDisplayContent as Pt } from "../displayContent.js";
38
+ import { NO_FIRST_TEXT as Ft, buildAssistantProgress as It, readAheadFor as Lt, snapshotReplyFloor as Rt, startSessionReadAhead as zt, trackFirstText as Bt } from "../turnProgress.js";
39
+ import { parseToolActivity as Vt } from "./AssistantToolActivity.js";
40
+ import { countSpokenTurns as Ht, spokenMessagesSinceContinueNote as Ut, spokenTurnText as Wt } from "../spokenTurns.js";
41
+ import { beginTurn as Gt, describeTurn as E, detectTurnDevice as Kt, markTurn as D, restartAttempt as qt, turnClockMs as Jt } from "../turnTimeline.js";
42
+ import { useAssistantSpeech as Yt } from "./AssistantSpeechProvider.js";
43
+ import { useVoiceSession as Xt } from "./useVoiceSession.js";
44
+ import { getOrganizationId as Zt, getWorkspaceId as O } from "../context.js";
45
+ import { isMultimodalBodyRejection as Qt, isRecoverableAssistantError as $t } from "../transportErrors.js";
46
+ import { createReadinessTracker as en, planAfterTransportFailure as tn, planTrustedSandboxFailure as nn } from "../sandboxReadiness.js";
47
+ import { writeProposalConfirmState as rn } from "./writeProposalPresentation.js";
48
+ import { writeProposalUsesDialog as an } from "./AssistantWriteProposalCard.js";
49
+ import { AssistantWriteConfirmDialog as on } from "./AssistantWriteConfirmDialog.js";
50
+ import { useWriteProposalConfirm as sn } from "./useWriteProposalConfirm.js";
51
+ import { AssistantWriteProposalSlot as cn } from "./AssistantWriteProposalSlot.js";
52
+ import { readWriteProposalRefs as ln, writeProposalsEnabledFor as un } from "../writeProposalDiscovery.js";
53
+ import { planWriteReply as dn, promptWriteApproval as fn } from "../writeReplySend.js";
54
+ import { useWriteProposals as pn } from "./useWriteProposals.js";
55
+ import { AssistantSpokenTurnsNotice as mn } from "./AssistantSpokenTurnsNotice.js";
56
+ import { AssistantHistoryArchivedNotice as hn, AssistantHistoryDeletedNotice as gn, AssistantHistoryLoadState as _n, AssistantHistoryReadOnlyBanner as vn, AssistantHistoryShowEarlier as yn } from "./AssistantHistoryNotices.js";
57
+ import { VoiceTranscriptDrawer as bn } from "./voice/VoiceTranscriptDrawer.js";
58
+ import { downloadFile as xn } from "../exportConversation.js";
59
+ import { conversationHasHistory as Sn, isOtherScopeHistoryConversation as Cn, isReadOnlyHistoryConversation as wn, isReusableHistoryDraft as Tn } from "../history/historyList.js";
60
+ import { useAssistantHistoryStatus as En } from "../history/historyStatus.js";
61
+ import { assistantHistory as Dn } from "../history/historyEngine.js";
62
+ import { AssistantEmptyState as On } from "./AssistantEmptyState.js";
63
+ import { AssistantNothingToDeleteNotice as kn } from "./AssistantDeleteConversationDialog.js";
64
+ import { assistantHistoryIsOn as An } from "./conversationDelete.js";
65
+ import { useConversationDeleteDialog as jn } from "./conversationDeleteDialog.js";
66
+ import { useControlConfirmDialog as Mn } from "./controlConfirmDialog.js";
67
+ import { resolveConversationDeleteTarget as Nn } from "../conversationDeleteCommand.js";
68
+ import { resumeContextFor as Pn } from "../history/historyResume.js";
69
+ import { useHistoryRowControlsFor as Fn } from "../history/useHistoryRowControls.js";
70
+ import { liveCoverage as In } from "../liveDeltas.js";
71
+ import { createLiveRender as Ln } from "../liveOverlay.js";
72
+ import { AssistantMessageList as Rn } from "./AssistantMessageList.js";
73
+ import { AssistantVoiceSession as zn } from "./voice/AssistantVoiceSession.js";
74
+ import { useAssistantApiAccess as Bn } from "../useAssistantApiAccess.js";
75
+ import { useConversationTurns as Vn } from "../useConversationTurns.js";
76
+ import { openTurnStream as Hn, turnStreamAvailable as Un } from "../turnStream.js";
77
+ import { createSnapshotPoller as Wn } from "../snapshotPoller.js";
78
+ import { sendAssistantTurnTimings as Gn, startTurnTimingReporting as Kn } from "../turnTimingReporter.js";
79
+ import { QuarantineSet as qn, WarmCancelled as Jn, claimPreopenedSession as Yn, consumeWarm as Xn, preopenKey as Zn, preopenWanted as Qn, prewarmTarget as $n, settleWarmBeforeSend as er, startPreopen as tr, startWarm as nr, warmState as rr } from "../prewarm.js";
80
+ import { isThereRequest as ir, parseChoice as ar } from "../uiActions/deixis.js";
81
+ import { navEntryIds as or } from "../uiActions/resolveTarget.js";
82
+ import { lookupNamedRecords as sr } from "../uiActions/recordNames.js";
83
+ import { isAlreadyThere as cr, matchLocalUiCommand as lr, navDestinations as ur, normaliseUtterance as dr, planThemeChange as fr } from "../localUiCommands.js";
84
+ import { runNavigation as pr } from "../uiActions/navigationOutcome.js";
85
+ import { assistantBackStack as mr, isBackRunnable as hr } from "../uiActions/backStack.js";
86
+ import { buildNavigateAction as gr, destinationForPath as _r, labelForPath as vr, newestAssistantOnSurface as yr } from "../uiActions/navigateAction.js";
87
+ import { buildNavigationContext as br, latestReplyOnSurface as xr, rememberPresentedList as Sr } from "../uiActions/linkContext.js";
88
+ import { buildUiCatalogue as Cr } from "../uiActions/uiCatalogue.js";
89
+ import { readControlSnapshot as wr } from "../appControls/snapshot.js";
90
+ import { planAppControl as Tr } from "../appControls/plan.js";
91
+ import { dispatchAssistantQuotaExhausted as Er, notifyAiCreditsUpdated as Dr } from "../aiCredits.js";
92
+ import { useAssistantAttachments as Or } from "../useAssistantAttachments.js";
93
+ import { AssistantComposer as kr } from "./composer/AssistantComposer.js";
94
+ import { isProdRuntime as Ar } from "../env.js";
95
+ import { AssistantApiCallsConsentDialog as jr } from "./AssistantApiCallsConsentDialog.js";
96
+ import { useVisibleNavItems as Mr } from "../../../chrome/mobileTabBar/useVisibleNavItems.js";
97
+ import { useCallback as k, useEffect as A, useMemo as j, useRef as M, useState as Nr, useSyncExternalStore as Pr } from "react";
98
+ import { jsx as N, jsxs as Fr } from "react/jsx-runtime";
98
99
  //#region src/shared/assistant/ui/AssistantChatArea.tsx
99
- var Nr = 2500, Pr = 600, Fr = 2e4, Ir = 1e4, Lr = 6e3;
100
+ var Ir = 2500, Lr = 600, Rr = 2e4, zr = 1e4, Br = 6e3;
100
101
  function P() {
101
102
  return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
102
103
  }
103
- var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
104
- let F = a(), { product: I, modes: L, gatherPageContext: Br, buildPrompt: Vr, reportTurnTimings: Hr, reportTokenUsage: Ur, localUiCommands: Wr } = i(), R = C(i().writeApproval), Gr = A((e, t) => {
104
+ var Vr = ({ visible: Vr = !0, writeAccess: Hr = "unknown" }) => {
105
+ let F = a(), { product: I, modes: L, gatherPageContext: Ur, buildPrompt: Wr, reportTurnTimings: Gr, reportTokenUsage: Kr, localUiCommands: qr } = i(), R = S(i().writeApproval), Jr = k((e, t) => {
105
106
  let n = y.getState(), r = t ?? n.sandboxesByMode[e]?.sandboxId ?? null;
106
- return at({
107
+ return ot({
107
108
  mode: e,
108
109
  productWriteApproval: R,
109
110
  capabilities: r ? n.sandboxWriteCapabilities[r] : null
110
111
  });
111
- }, [R]), { getAccessToken: z, getWorkspaceToken: Kr, userId: B } = n(), { locale: V } = t(), qr = y((e) => e.voiceGraceMs), Jr = y((e) => e.handsFreeInterrupt), Yr = y((e) => e.assistantLanguage), Xr = y((e) => e.replyLanguage), Zr = kr(() => He(Yr, Xr, V), [
112
- Yr,
113
- Xr,
112
+ }, [R]), { getAccessToken: z, getWorkspaceToken: Yr, userId: B } = n(), { locale: V, isLoading: Xr } = t(), Zr = y((e) => e.voiceGraceMs), Qr = y((e) => e.handsFreeInterrupt), $r = y((e) => e.assistantLanguage), ei = y((e) => e.replyLanguage), ti = j(() => Ue($r, ei, V), [
113
+ $r,
114
+ ei,
114
115
  V
115
- ]), Qr = Zr.reply.english, $r = Zr.replyIsExplicit, ei = Zr.reply.code, { conversations: ti, activeConversationId: H, mode: U, processingByConversationId: ni, setMode: ri, setConversationMode: ii, setActiveConversation: ai, createConversation: W, addMessage: G, updateMessage: oi, patchMessage: si, mergeMessageMetadata: ci, setConversationProcessing: li, clearConversationProcessing: ui, setBackendSessionId: di, clearBackendSessionId: fi, setSandbox: pi, clearSandbox: mi, acknowledgedWriteModes: hi, acknowledgeWriteMode: gi, autoRouting: _i, setAutoRouting: vi, routeConversation: yi } = y(), bi = ti.find((e) => e.id === H), xi = Ln(bi), Si = xi.all, K = H ? ni[H] : void 0, Ci = ht(K?.status), wi = Ci ? K?.messageId ?? null : null, Ti = K?.status === "error" ? K.messageId : null, Ei = y((e) => e.sandboxWriteCapabilities), { panel: q, entries: Di, retiredSandboxes: Oi } = Xt({
116
+ ]), ni = ti.reply.english, ri = ti.replyIsExplicit, ii = ti.reply.code, { conversations: ai, activeConversationId: H, mode: U, processingByConversationId: oi, setMode: si, setConversationMode: ci, setActiveConversation: li, createConversation: ui, addMessage: W, updateMessage: di, patchMessage: fi, mergeMessageMetadata: pi, setConversationProcessing: mi, clearConversationProcessing: hi, setBackendSessionId: gi, clearBackendSessionId: _i, setSandbox: vi, clearSandbox: yi, acknowledgedWriteModes: bi, acknowledgeWriteMode: xi, autoRouting: Si, setAutoRouting: Ci, routeConversation: wi } = y(), Ti = ai.find((e) => e.id === H), Ei = Vn(Ti), Di = Ei.all, G = H ? oi[H] : void 0, Oi = gt(G?.status), ki = Oi ? G?.messageId ?? null : null, Ai = G?.status === "error" ? G.messageId : null, ji = y((e) => e.sandboxWriteCapabilities), { panel: K, entries: Mi, retiredSandboxes: Ni } = pn({
116
117
  tr: F,
117
118
  productWriteApproval: R
118
- }), ki = Wt({
119
- approve: (e, t) => q.approve(e, t),
120
- decline: (e, t, n) => q.decline(e, t, n),
121
- presented: (e, t) => q.presented(e, t)
122
- }), Ai = ki.dismiss, ji = M(null);
123
- j(() => {
124
- Ai();
125
- let e = ji.current;
126
- ji.current = H, e && e !== H && q.withdraw(e, "conversation_closed"), H && q.openConversation(H);
119
+ }), Pi = sn({
120
+ approve: (e, t) => K.approve(e, t),
121
+ decline: (e, t, n) => K.decline(e, t, n),
122
+ presented: (e, t) => K.presented(e, t)
123
+ }), Fi = Pi.dismiss, Ii = M(null);
124
+ A(() => {
125
+ Fi();
126
+ let e = Ii.current;
127
+ Ii.current = H, e && e !== H && K.withdraw(e, "conversation_closed"), H && K.openConversation(H);
127
128
  }, [
128
129
  H,
129
- q,
130
- Ai
130
+ K,
131
+ Fi
131
132
  ]);
132
- let Mi = cn(bi), Ni = jn(bi)?.archivedAt != null, Pi = un((e) => H !== null && H in e.loadingIds), Fi = un((e) => H !== null && H in e.loadErrorIds), Ii = un((e) => e.remoteDelete), [Li, Ri] = Ar(() => un.getState().remoteDelete?.at ?? null), zi = Ii?.wasActive === !0 && Ii.at !== Li ? Ii.at : null;
133
- j(() => {
134
- if (zi === null) return;
135
- let e = window.setTimeout(() => Ri(zi), Ir);
133
+ let Li = wn(Ti), Ri = Fn(Ti)?.archivedAt != null, zi = En((e) => H !== null && H in e.loadingIds), Bi = En((e) => H !== null && H in e.loadErrorIds), Vi = En((e) => e.remoteDelete), [Hi, Ui] = Nr(() => En.getState().remoteDelete?.at ?? null), Wi = Vi?.wasActive === !0 && Vi.at !== Hi ? Vi.at : null;
134
+ A(() => {
135
+ if (Wi === null) return;
136
+ let e = window.setTimeout(() => Ui(Wi), zr);
136
137
  return () => window.clearTimeout(e);
137
- }, [zi]);
138
- let { canUseApiCalls: Bi, loading: Vi } = In(k(), B), Hi = M(ft({
139
- loading: Vi,
140
- canUseAdminModes: Bi
141
- })).current, Ui = M(L);
142
- j(() => {
143
- Ui.current = L;
138
+ }, [Wi]);
139
+ let { canUseApiCalls: Gi, loading: Ki } = Bn(O(), B), qi = M(pt({
140
+ loading: Ki,
141
+ canUseAdminModes: Gi
142
+ })).current, Ji = M(L);
143
+ A(() => {
144
+ Ji.current = L;
144
145
  }, [L]);
145
- let Wi = () => {
146
+ let Yi = () => {
146
147
  let e = y.getState().activeConversationId;
147
- e && dn.openConversation(e, { modes: Ui.current });
148
- }, Gi = () => {
148
+ e && Dn.openConversation(e, { modes: Ji.current });
149
+ }, Xi = () => {
149
150
  let e = y.getState().activeConversationId;
150
- e && dn.loadEarlier(e);
151
- }, Ki = M(z);
152
- j(() => {
153
- Ki.current = z;
151
+ e && Dn.loadEarlier(e);
152
+ }, Zi = M(z);
153
+ A(() => {
154
+ Zi.current = z;
154
155
  }, [z]);
155
- let qi = !!I && Hr !== !1;
156
- j(() => {
157
- if (qi) return Hn({ send: (e) => Vn(e, {
158
- workspaceId: k(),
156
+ let Qi = !!I && Gr !== !1;
157
+ A(() => {
158
+ if (Qi) return Kn({ send: (e) => Gn(e, {
159
+ workspaceId: O(),
159
160
  authContext: {
160
- accessToken: Ki.current(),
161
- organizationId: Ft()
161
+ accessToken: Zi.current(),
162
+ organizationId: Zt()
162
163
  }
163
164
  }) });
164
- }, [qi]), j(() => {
165
- Hi.update({
166
- loading: Vi,
167
- canUseAdminModes: Bi
165
+ }, [Qi]), A(() => {
166
+ qi.update({
167
+ loading: Ki,
168
+ canUseAdminModes: Gi
168
169
  });
169
170
  }, [
170
- Hi,
171
- Vi,
172
- Bi
173
- ]), j(() => () => {
174
- Hi.abandon();
175
- }, [Hi]);
176
- let Ji = kr(() => L.filter((e) => !e.requiresAdmin || Bi), [L, Bi]), Yi = f(Ji), Xi = _i && Yi, Zi = M(Yi);
177
- j(() => {
178
- Zi.current = Yi;
179
- }, [Yi]);
180
- let Qi = M(null), $i = M(!1), ea = tt(L), [ta, na] = Ar(null), [ra, ia] = Ar(null), aa = ra !== null && ra === H, oa = A((e) => {
181
- ia(e ? y.getState().activeConversationId : null);
171
+ qi,
172
+ Ki,
173
+ Gi
174
+ ]), A(() => () => {
175
+ qi.abandon();
176
+ }, [qi]);
177
+ let $i = j(() => L.filter((e) => !e.requiresAdmin || Gi), [L, Gi]), ea = f($i), ta = Si && ea, na = M(ea);
178
+ A(() => {
179
+ na.current = ea;
180
+ }, [ea]);
181
+ let ra = M(null), ia = M(!1), aa = nt(L), [oa, sa] = Nr(null), [ca, la] = Nr(null), ua = ca !== null && ca === H, da = k((e) => {
182
+ la(e ? y.getState().activeConversationId : null);
182
183
  }, []);
183
- j(() => {
184
- ia((e) => e !== null && e !== H ? null : e);
184
+ A(() => {
185
+ la((e) => e !== null && e !== H ? null : e);
185
186
  }, [H]);
186
- let sa = M(void 0), [ca, la] = Ar(!1), ua = A((e) => {
187
- sa.current = e, la(We(e));
188
- }, []), da = A(() => {
187
+ let fa = M(void 0), [pa, ma] = Nr(!1), ha = k((e) => {
188
+ fa.current = e, ma(Ge(e));
189
+ }, []), ga = k(() => {
189
190
  let e = y.getState(), t = e.activeConversationId, n = t ? e.conversations.find((e) => e.id === t) : void 0;
190
191
  return !t || !n ? null : {
191
192
  id: t,
192
- reusableDraft: ln(n, ee()),
193
- liveProposals: q.liveFor(t).count,
194
- turnInFlight: ht(e.processingByConversationId[t]?.status)
193
+ reusableDraft: Tn(n, ee()),
194
+ liveProposals: K.liveFor(t).count,
195
+ turnInFlight: gt(e.processingByConversationId[t]?.status)
195
196
  };
196
- }, [q]), fa = M({}), J = M(Rt()), Y = M(new Un()), pa = M(/* @__PURE__ */ new Set()), ma = kr(() => L.find((e) => e.id === U), [L, U]), ha = y((e) => {
197
+ }, [K]), _a = M({}), q = M(en()), J = M(new qn()), va = M(/* @__PURE__ */ new Set()), ya = j(() => L.find((e) => e.id === U), [L, U]), ba = y((e) => {
197
198
  let t = e.sandboxesByMode[U]?.sandboxId;
198
199
  return t ? e.sandboxWriteCapabilities[t] : void 0;
199
- }), ga = ma !== void 0 && at({
200
+ }), xa = ya !== void 0 && ot({
200
201
  mode: U,
201
202
  productWriteApproval: R,
202
- capabilities: ha
203
- }), _a = U === "assistant" || ma !== void 0 && !ma.writeCapable && !ge(U) || ga;
204
- j(() => {
205
- if (U !== "assistant" && ma?.writeCapable && !ae(hi, U)) {
206
- ri("assistant");
203
+ capabilities: ba
204
+ }), Sa = U === "assistant" || ya !== void 0 && !ya.writeCapable && !ge(U) || xa;
205
+ A(() => {
206
+ if (U !== "assistant" && ya?.writeCapable && !ae(bi, U)) {
207
+ si("assistant");
207
208
  return;
208
209
  }
209
- Vi || (!ma || ma.requiresAdmin && !Bi) && U !== "assistant" && ri("assistant");
210
+ Ki || (!ya || ya.requiresAdmin && !Gi) && U !== "assistant" && si("assistant");
210
211
  }, [
211
212
  U,
212
- ma,
213
- Bi,
214
- Vi,
215
- ri,
216
- hi
213
+ ya,
214
+ Gi,
215
+ Ki,
216
+ si,
217
+ bi
217
218
  ]);
218
- let va = A((e, t, n, r) => {
219
- li(e, n, t, null, r);
220
- }, [li]), ya = A(async (e, t, n, r, i, a = null) => {
219
+ let Ca = k((e, t, n, r) => {
220
+ mi(e, n, t, null, r);
221
+ }, [mi]), wa = k(async (e, t, n, r, i, a = null) => {
221
222
  let o = (e, t) => {
222
- r && va(r.conversationId, r.assistantMessageId, e, t), a && (a.step = t, a.onStep?.(t));
223
+ r && Ca(r.conversationId, r.assistantMessageId, e, t), a && (a.step = t, a.onStep?.(t));
223
224
  }, c = (e) => {
224
- r && O(r.assistantMessageId, e);
225
+ r && D(r.assistantMessageId, e);
225
226
  }, l = () => {
226
227
  c("bootAdopted"), a?.beginBoot();
227
- }, u = () => a !== null && (a.signal.aborted || k() !== t), d = () => {
228
- if (u()) throw new Wn("cancelled");
228
+ }, u = () => a !== null && (a.signal.aborted || O() !== t), d = () => {
229
+ if (u()) throw new Jn("cancelled");
229
230
  }, f = y.getState().sandboxesByMode[e]?.sandboxId ?? null, p = !1, ee = !1, m = !1, te = !1, ne = !1, h = async (r) => {
230
- if (i && !Y.current.has(r) && J.current.isFresh(r)) return p = !0, !0;
231
+ if (i && !J.current.has(r) && q.current.isFresh(r)) return p = !0, !0;
231
232
  m = !0;
232
233
  let o = !1;
233
234
  try {
234
- await be(r, t, n, 3e5), await ye(r, t, e, n, 9e4, () => {
235
+ await xe(r, t, n, 3e5), await be(r, t, e, n, 9e4, () => {
235
236
  o = !0, l();
236
237
  });
237
238
  } catch {
238
- if (u()) throw new Wn("cancelled");
239
- return J.current.invalidate(r), Y.current.add(r), a?.dead.push(r), ne = !0, !1;
239
+ if (u()) throw new Jn("cancelled");
240
+ return q.current.invalidate(r), J.current.add(r), a?.dead.push(r), ne = !0, !1;
240
241
  }
241
- return d(), J.current.markVerified(r), o && (te = !0), !0;
242
+ return d(), q.current.markVerified(r), o && (te = !0), !0;
242
243
  };
243
- if (f && (pi(e, f, "provisioning"), o("provisioning", "reusingEnvironment"), await h(f) || (pi(e, null, "provisioning"), f = null)), !f) {
244
+ if (f && (vi(e, f, "provisioning"), o("provisioning", "reusingEnvironment"), await h(f) || (vi(e, null, "provisioning"), f = null)), !f) {
244
245
  o("provisioning", "lookingForEnvironment");
245
- let r = await fe(t, I, e, Er(), n, Y.current, R);
246
+ let r = await fe(t, I, e, Ar(), n, J.current, R);
246
247
  d();
247
248
  let i = r?.id ?? null;
248
249
  if (i) {
249
- pi(e, i, "provisioning"), o("provisioning", "reusingEnvironment");
250
+ vi(e, i, "provisioning"), o("provisioning", "reusingEnvironment");
250
251
  let t = r?.status === "PROVISIONING" || r?.status === "PENDING";
251
- t && l(), await h(i) ? (f = i, t && (te = !0)) : pi(e, null, "provisioning");
252
+ t && l(), await h(i) ? (f = i, t && (te = !0)) : vi(e, null, "provisioning");
252
253
  }
253
254
  }
254
255
  if (!f) {
255
- if (a && !a.mayCreate) throw new Wn("no-create");
256
+ if (a && !a.mayCreate) throw new Jn("no-create");
256
257
  if (c("provisionStarted"), e === "api-calls" && !z()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
257
- o("provisioning", "startingEnvironment"), pi(e, null, "provisioning");
258
- let r = a ? [] : await S(t, I, e, Er(), n, Y.current, R);
258
+ o("provisioning", "startingEnvironment"), vi(e, null, "provisioning");
259
+ let r = a ? [] : await ve(t, I, e, Ar(), n, J.current, R);
259
260
  if (r.length > 0) {
260
261
  let e = new Set(r);
261
- for (let e of r) J.current.invalidate(e), Y.current.add(e);
262
+ for (let e of r) q.current.invalidate(e), J.current.add(e);
262
263
  let t = y.getState().sandboxesByMode;
263
- for (let [n, r] of Object.entries(t)) s(n) && r?.sandboxId && e.has(r.sandboxId) && mi(n);
264
+ for (let [n, r] of Object.entries(t)) s(n) && r?.sandboxId && e.has(r.sandboxId) && yi(n);
264
265
  }
265
266
  c("createRequested");
266
267
  let i = a?.beginCreate();
267
268
  try {
268
- f = await le(I, e, t, Er(), Pr, n, { writeApproval: R });
269
+ f = await le(I, e, t, Ar(), Lr, n, { writeApproval: R });
269
270
  } finally {
270
271
  i?.();
271
272
  }
272
- ee = !0, d(), pi(e, f, "provisioning"), await be(f, t, n, 3e5), d(), c("sandboxRunning"), await ye(f, t, e, n, 9e4), d(), c("serviceReady"), J.current.markVerified(f);
273
+ ee = !0, d(), vi(e, f, "provisioning"), await xe(f, t, n, 3e5), d(), c("sandboxRunning"), await be(f, t, e, n, 9e4), d(), c("serviceReady"), q.current.markVerified(f);
273
274
  }
274
- return pi(e, f, "running"), {
275
+ return vi(e, f, "running"), {
275
276
  sandboxId: f,
276
277
  sandboxIsNew: ee,
277
278
  sandboxProbed: m,
@@ -280,64 +281,64 @@ var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
280
281
  trustedFromCache: p
281
282
  };
282
283
  }, [
283
- mi,
284
+ yi,
284
285
  z,
285
286
  I,
286
287
  R,
287
- pi,
288
- va
289
- ]), ba = A(async function e(t, n, r, i, a, o = {}) {
290
- let s = await Xn(i, r, (e) => va(t, n, "provisioning", e), () => O(n, "prewarmJoined"));
291
- for (let e of s.dead) J.current.invalidate(e), Y.current.add(e);
292
- s.verified && !Y.current.has(s.verified) && J.current.markVerified(s.verified), s.joined && D(n, { prewarm: s.joined });
293
- let { sandboxId: c, sandboxIsNew: l, sandboxProbed: u, sandboxAdopted: d, deadSandboxProbe: f, trustedFromCache: p } = await ya(r, i, a, {
288
+ vi,
289
+ Ca
290
+ ]), Ta = k(async function e(t, n, r, i, a, o = {}) {
291
+ let s = await er(i, r, (e) => Ca(t, n, "provisioning", e), () => D(n, "prewarmJoined"));
292
+ for (let e of s.dead) q.current.invalidate(e), J.current.add(e);
293
+ s.verified && !J.current.has(s.verified) && q.current.markVerified(s.verified), s.joined && E(n, { prewarm: s.joined });
294
+ let { sandboxId: c, sandboxIsNew: l, sandboxProbed: u, sandboxAdopted: d, deadSandboxProbe: f, trustedFromCache: p } = await wa(r, i, a, {
294
295
  conversationId: t,
295
296
  assistantMessageId: n
296
- }, o.trustCache !== !1), ee = Kn(i, r, c);
297
- !s.waited && ee && D(n, { prewarm: "hit" });
297
+ }, o.trustCache !== !1), ee = Xn(i, r, c);
298
+ !s.waited && ee && E(n, { prewarm: "hit" });
298
299
  let m = y.getState().conversations.find((e) => e.id === t)?.backendSessionId ?? null, te = !1, ne = null;
299
300
  if (m) {
300
- let e = Ct(c, m, (e, t) => me(e, i, t, r, a, { limit: 50 }));
301
+ let e = zt(c, m, (e, t) => me(e, i, t, r, a, { limit: 50 }));
301
302
  try {
302
303
  let t = await x(c, i, m, r, a);
303
304
  if (t.mode !== r) throw Error(`Session mode mismatch: expected ${r}, received ${t.mode}`);
304
305
  ne = e;
305
306
  } catch {
306
- fi(t), m = null;
307
+ _i(t), m = null;
307
308
  }
308
309
  }
309
310
  let h = !1;
310
311
  if (!m) {
311
- let e = Gn(qn({
312
+ let e = Yn(Zn({
312
313
  workspaceId: i,
313
314
  mode: r,
314
315
  sandboxId: c,
315
316
  userId: B
316
317
  }), Date.now());
317
318
  if (e) {
318
- "pending" in e && va(t, n, "connecting", "preparingSession");
319
+ "pending" in e && Ca(t, n, "connecting", "preparingSession");
319
320
  let o = "sessionId" in e ? e.sessionId : await e.pending;
320
- if (o && !Y.current.has(c)) try {
321
- (await x(c, i, o, r, a)).mode === r && (m = o, h = !0, di(t, m), te = !0);
321
+ if (o && !J.current.has(c)) try {
322
+ (await x(c, i, o, r, a)).mode === r && (m = o, h = !0, gi(t, m), te = !0);
322
323
  } catch {}
323
324
  }
324
325
  }
325
326
  if (!m) {
326
- va(t, n, "connecting", "preparingSession");
327
+ Ca(t, n, "connecting", "preparingSession");
327
328
  let s;
328
329
  try {
329
330
  s = await ue(c, i, r, a);
330
331
  } catch (s) {
331
332
  if (p) {
332
- J.current.invalidate(c);
333
- let l = Bt(s, o.isAbandoned?.() ?? !1), p = l === "check-network";
334
- if (l === "check-network" && (l = await zt(() => fe(i, I, r, Er(), a, Y.current, R))), l !== "rethrow" && o.isAbandoned?.() && (l = "rethrow"), l !== "rethrow") {
335
- p || D(n, { cacheProofFailed: !0 }), l === "replace" && (Y.current.add(c), fi(t), mi(r), q.retireSandbox(c));
333
+ q.current.invalidate(c);
334
+ let l = nn(s, o.isAbandoned?.() ?? !1), p = l === "check-network";
335
+ if (l === "check-network" && (l = await tn(() => fe(i, I, r, Ar(), a, J.current, R))), l !== "rethrow" && o.isAbandoned?.() && (l = "rethrow"), l !== "rethrow") {
336
+ p || E(n, { cacheProofFailed: !0 }), l === "replace" && (J.current.add(c), _i(t), yi(r), K.retireSandbox(c));
336
337
  let s = await e(t, n, r, i, a, {
337
338
  ...o,
338
339
  trustCache: !1
339
340
  });
340
- return p && (s.deadSandboxProbe || s.sandboxId !== c) && D(n, { cacheProofFailed: !0 }), {
341
+ return p && (s.deadSandboxProbe || s.sandboxId !== c) && E(n, { cacheProofFailed: !0 }), {
341
342
  ...s,
342
343
  sandboxProbed: s.sandboxProbed || u,
343
344
  sandboxAdopted: s.sandboxAdopted || d,
@@ -347,7 +348,7 @@ var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
347
348
  }
348
349
  throw s;
349
350
  }
350
- m = s.sessionId, di(t, m), te = !0;
351
+ m = s.sessionId, gi(t, m), te = !0;
351
352
  }
352
353
  return {
353
354
  sandboxId: c,
@@ -361,67 +362,67 @@ var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
361
362
  sessionPreopened: h
362
363
  };
363
364
  }, [
364
- ya,
365
- fi,
366
- mi,
365
+ wa,
366
+ _i,
367
+ yi,
367
368
  I,
368
369
  R,
369
- di,
370
- va,
370
+ gi,
371
+ Ca,
371
372
  B,
372
- q
373
- ]), xa = A((e, t = !1) => {
374
- let n = k();
373
+ K
374
+ ]), Ea = k((e, t = !1) => {
375
+ let n = O();
375
376
  if (!n) return;
376
- let r = y.getState(), i = Date.now(), a = Yn({
377
+ let r = y.getState(), i = Date.now(), a = $n({
377
378
  autoRouting: r.autoRouting,
378
- autoOffered: Zi.current,
379
+ autoOffered: na.current,
379
380
  active: !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0,
380
381
  selectedMode: r.mode,
381
382
  autoReadMode: c,
382
- modes: Ui.current,
383
+ modes: Ji.current,
383
384
  acknowledgedWriteModes: r.acknowledgedWriteModes,
384
- adminAccess: Hi.read(),
385
+ adminAccess: qi.read(),
385
386
  dictated: e,
386
- voiceProposalBound: (e) => Gr(e),
387
- turnInFlight: Object.values(r.processingByConversationId).some((e) => ht(e?.status)),
388
- ...$n(n),
387
+ voiceProposalBound: (e) => Jr(e),
388
+ turnInFlight: Object.values(r.processingByConversationId).some((e) => gt(e?.status)),
389
+ ...rr(n),
389
390
  now: i
390
391
  });
391
392
  if (!a) return;
392
- let o = Qn(n, a, i), s = {
393
+ let o = nr(n, a, i), s = {
393
394
  accessToken: z(),
394
- workspaceToken: Kr(),
395
+ workspaceToken: Yr(),
395
396
  userId: B,
396
- organizationId: Ft()
397
+ organizationId: Zt()
397
398
  };
398
- ya(a.mode, n, s, null, !0, o).then((e) => {
399
+ wa(a.mode, n, s, null, !0, o).then((e) => {
399
400
  if (o.finish({
400
401
  ok: !0,
401
402
  sandboxId: e.sandboxId,
402
403
  didWork: !e.trustedFromCache && (e.sandboxIsNew || e.sandboxProbed || e.sandboxAdopted),
403
404
  booted: e.sandboxIsNew || e.sandboxAdopted,
404
405
  dead: o.dead
405
- }), o.signal.aborted || k() !== n || Y.current.has(e.sandboxId)) return;
406
+ }), o.signal.aborted || O() !== n || J.current.has(e.sandboxId)) return;
406
407
  let r = y.getState(), i = !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0, c = ee();
407
- Jn({
408
+ Qn({
408
409
  active: i ? {
409
410
  mode: i.mode,
410
411
  backendSessionId: i.backendSessionId,
411
- continuable: !cn(i) && !sn(i, c),
412
- hasHistory: on(i)
412
+ continuable: !wn(i) && !Cn(i, c),
413
+ hasHistory: Sn(i)
413
414
  } : void 0,
414
415
  mode: a.mode
415
- }) && Zn(qn({
416
+ }) && tr(Zn({
416
417
  workspaceId: n,
417
418
  mode: a.mode,
418
419
  sandboxId: e.sandboxId,
419
420
  userId: B
420
421
  }), () => ue(e.sandboxId, n, a.mode, s).then((e) => e.sessionId), Date.now());
421
422
  }, (e) => {
422
- if (!(e instanceof Wn) && !o.signal.aborted && k() === n) {
423
+ if (!(e instanceof Jn) && !o.signal.aborted && O() === n) {
423
424
  let e = y.getState().sandboxesByMode[a.mode]?.sandboxId ?? null;
424
- e && (J.current.invalidate(e), Y.current.add(e), o.dead.push(e), mi(a.mode));
425
+ e && (q.current.invalidate(e), J.current.add(e), o.dead.push(e), yi(a.mode));
425
426
  }
426
427
  o.finish({
427
428
  ok: !1,
@@ -431,50 +432,50 @@ var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
431
432
  });
432
433
  });
433
434
  }, [
434
- ya,
435
- Hi,
436
- mi,
435
+ wa,
436
+ qi,
437
+ yi,
437
438
  z,
438
- Kr,
439
+ Yr,
439
440
  B,
440
- Gr
441
- ]), Sa = A(() => xa(!1), [xa]), Ca = jr(ie, h, h)?.reference ?? null, [wa, Ta] = Ar(0), Ea = M(/* @__PURE__ */ new Set()), Da = M(null), Oa = A(() => {
441
+ Jr
442
+ ]), Da = k(() => Ea(!1), [Ea]), Oa = Pr(ie, h, h)?.reference ?? null, [ka, Aa] = Nr(0), ja = M(/* @__PURE__ */ new Set()), Ma = M(null), Na = k(() => {
442
443
  let e = y.getState(), t = e.activeConversationId;
443
444
  if (!t) return null;
444
- let n = e.processingByConversationId[t], r = ht(n?.status) ? n?.messageId ?? null : null;
445
- if (!_t({
445
+ let n = e.processingByConversationId[t], r = gt(n?.status) ? n?.messageId ?? null : null;
446
+ if (!vt({
446
447
  interruptedTurnId: r,
447
448
  activeTurnId: r,
448
- alreadyRequested: r ? Ea.current.has(r) : !1
449
+ alreadyRequested: r ? ja.current.has(r) : !1
449
450
  }).send || !r) return null;
450
- Ea.current.add(r);
451
- let i = se(e), a = k(), o = e.conversations.find((e) => e.id === t)?.backendSessionId;
451
+ ja.current.add(r);
452
+ let i = se(e), a = O(), o = e.conversations.find((e) => e.id === t)?.backendSessionId;
452
453
  return !i || !a || !o || ce(i.sandboxId, a, o, i.mode, {
453
454
  accessToken: z(),
454
- workspaceToken: Kr(),
455
+ workspaceToken: Yr(),
455
456
  userId: B,
456
- organizationId: Ft()
457
+ organizationId: Zt()
457
458
  }), r;
458
459
  }, [
459
460
  B,
460
461
  z,
461
- Kr
462
- ]), ka = A(() => {
463
- let e = Oa();
464
- return e && (Ie(e), Fe.abort(e)), e;
465
- }, [Oa]), Aa = A(() => {
462
+ Yr
463
+ ]), Pa = k(() => {
464
+ let e = Na();
465
+ return e && (Le(e), Ie.abort(e)), e;
466
+ }, [Na]), Fa = k(() => {
466
467
  let e = y.getState().activeConversationId;
467
- ka(), e && q.declineForReply(e, "corrected", "spoken");
468
- }, [ka, q]), ja = A(async (e) => {
469
- let t = y.getState(), n = se(t), r = k(), i = t.activeConversationId;
470
- if (!n || !r || !i || qt(t.sandboxWriteCapabilities[n.sandboxId])) return;
471
- let a = t.conversations.find((e) => e.id === i), o = a ? _(Me(a.messages), {
468
+ Pa(), e && K.declineForReply(e, "corrected", "spoken");
469
+ }, [Pa, K]), Ia = k(async (e) => {
470
+ let t = y.getState(), n = se(t), r = O(), i = t.activeConversationId;
471
+ if (!n || !r || !i || un(t.sandboxWriteCapabilities[n.sandboxId])) return;
472
+ let a = t.conversations.find((e) => e.id === i), o = a ? _(Ne(a.messages), {
472
473
  sessionId: a.backendSessionId,
473
474
  sandboxId: n.sandboxId,
474
475
  nowMs: Date.now()
475
476
  }) : null;
476
477
  if (o?.reference !== e) {
477
- Ta((e) => e + 1);
478
+ Aa((e) => e + 1);
478
479
  return;
479
480
  }
480
481
  let s = {
@@ -485,12 +486,12 @@ var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
485
486
  try {
486
487
  await b(n.sandboxId, r, e, n.mode, {
487
488
  accessToken: z(),
488
- workspaceToken: Kr(),
489
+ workspaceToken: Yr(),
489
490
  userId: B,
490
- organizationId: Ft()
491
+ organizationId: Zt()
491
492
  });
492
493
  } catch (e) {
493
- ne(s), G(i, {
494
+ ne(s), W(i, {
494
495
  id: P(),
495
496
  role: "system",
496
497
  content: e instanceof Error ? e.message : "The change could not be approved.",
@@ -498,82 +499,135 @@ var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
498
499
  });
499
500
  return;
500
501
  }
501
- ne(s), ci(i, o.messageId, { pendingWriteApprovedAt: (/* @__PURE__ */ new Date()).toISOString() });
502
+ ne(s), pi(i, o.messageId, { pendingWriteApprovedAt: (/* @__PURE__ */ new Date()).toISOString() });
502
503
  let c = y.getState(), l = c.conversations.find((e) => e.id === i);
503
- c.activeConversationId !== i || !l || c.mode !== n.mode || l.backendSessionId !== a?.backendSessionId || se(c)?.sandboxId !== n.sandboxId || ht(c.processingByConversationId[i]?.status) || g(Me(l.messages)) !== o.messageId || oo.current(F("pendingWrite.approvedPrompt", "I approved that change — go ahead."), [], {
504
+ c.activeConversationId !== i || !l || c.mode !== n.mode || l.backendSessionId !== a?.backendSessionId || se(c)?.sandboxId !== n.sandboxId || gt(c.processingByConversationId[i]?.status) || g(Ne(l.messages)) !== o.messageId || vo.current(F("pendingWrite.approvedPrompt", "I approved that change — go ahead."), [], {
504
505
  approvalFollowUp: { approvedReplyId: o.messageId },
505
506
  targetConversationId: i
506
507
  });
507
508
  }, [
508
509
  B,
509
- G,
510
- ci,
510
+ W,
511
+ pi,
511
512
  F
512
- ]), Ma = e(), { speakFinishedReply: Na } = Nt(), Pa = o(), { items: Fa, permissionsSettled: Ia, simulating: La } = Or(), Ra = M({
513
- theme: Ma,
514
- navigate: Pa,
515
- navItems: Fa,
516
- options: Wr ?? {},
517
- navPermissionsSettled: Ia,
518
- navSimulating: La
513
+ ]), La = e(), { speakFinishedReply: Ra } = Yt(), za = o(), { items: Ba, permissionsSettled: Va, simulating: Ha } = Mr(), Ua = M({
514
+ theme: La,
515
+ navigate: za,
516
+ navItems: Ba,
517
+ options: qr ?? {},
518
+ navPermissionsSettled: Va,
519
+ navSimulating: Ha
519
520
  });
520
- j(() => {
521
- Ra.current = {
522
- theme: Ma,
523
- navigate: Pa,
524
- navItems: Fa,
525
- options: Wr ?? {},
526
- navPermissionsSettled: Ia,
527
- navSimulating: La
521
+ A(() => {
522
+ Ua.current = {
523
+ theme: La,
524
+ navigate: za,
525
+ navItems: Ba,
526
+ options: qr ?? {},
527
+ navPermissionsSettled: Va,
528
+ navSimulating: Ha
528
529
  };
529
530
  }, [
530
- Ma,
531
- Pa,
532
- Fa,
533
- Wr,
534
- Ia,
535
- La
531
+ La,
532
+ za,
533
+ Ba,
534
+ qr,
535
+ Va,
536
+ Ha
536
537
  ]);
537
- let za = M(!0);
538
- j(() => (za.current = !0, () => {
539
- za.current = !1;
538
+ let Y = M(!0);
539
+ A(() => (Y.current = !0, () => {
540
+ Y.current = !1;
540
541
  }), []);
541
- let Ba = M(null), [Va, Ha] = Ar(!1), Ua = A((e) => {
542
+ let Wa = M({
543
+ tr: F,
544
+ locale: V
545
+ }), Ga = M(null), [Ka, qa] = Nr(null), Ja = M(null), Ya = k((e) => {
546
+ Ja.current !== null && (window.clearTimeout(Ja.current), Ja.current = null);
547
+ let t = Ga.current;
548
+ t && (Ga.current = null, window.clearTimeout(t.deadline), Y.current && qa(null), !(!e || !Y.current) && (Ja.current = window.setTimeout(() => {
549
+ if (Ja.current = null, !Y.current) return;
550
+ let e = y.getState();
551
+ if (e.activeConversationId !== t.conversationId) return;
552
+ let n = e.conversations.find((e) => e.id === t.conversationId)?.messages.find((e) => e.id === t.messageId);
553
+ if (!n) return;
554
+ let r = Wa.current, i = Pt(n, null, r.tr);
555
+ if (i.kind !== "output") return;
556
+ let a = Mt(n, r.tr);
557
+ Ie.publish(n.id, {
558
+ conversationId: t.conversationId,
559
+ channel: n.metadata?.voice === !0 ? "voice" : "chat",
560
+ voiceSessionId: n.metadata?.voiceSessionId,
561
+ text: i.text,
562
+ lang: a?.translated ? r.locale : n.metadata?.lang,
563
+ final: !0
564
+ });
565
+ }, 0)));
566
+ }, []), Xa = k(() => Ya(!0), [Ya]);
567
+ A(() => {
568
+ Wa.current = {
569
+ tr: F,
570
+ locale: V
571
+ };
572
+ let e = Ga.current;
573
+ if (!e) return;
574
+ let t = Nt({
575
+ wanted: e.wanted,
576
+ locale: V,
577
+ isLoading: Xr,
578
+ translatedNow: At(F, e.reply).translated
579
+ });
580
+ if (t === "write") {
581
+ Xa();
582
+ return;
583
+ }
584
+ if (t === "grace") {
585
+ let e = window.setTimeout(Xa, 400);
586
+ return () => window.clearTimeout(e);
587
+ }
588
+ }, [
589
+ F,
590
+ V,
591
+ Xr,
592
+ Ka,
593
+ Xa
594
+ ]), A(() => () => Ya(!1), [Ya]);
595
+ let Za = M(null), [Qa, $a] = Nr(!1), eo = k((e) => {
542
596
  let t = y.getState(), n = t.conversations.find((e) => e.id === t.activeConversationId);
543
- return n ? dr(ur, window.location.pathname, hr(n.messages, e)) : !1;
544
- }, []), Wa = A((e, t, n = !1) => {
545
- let { navItems: r, options: i } = Ra.current, a = or(r), o = null, s = sr(e);
546
- if (er(s) || tr(s) !== null) {
547
- let e = y.getState(), n = e.conversations.find((t) => t.id === e.activeConversationId), s = n ? _r(n.messages, t) : null, c = n ? e.processingByConversationId[n.id] ?? null : null, l = c !== null && c.messageId === s?.id && ht(c.status);
548
- n && s && !l && (o = gr({
597
+ return n ? hr(mr, window.location.pathname, yr(n.messages, e)) : !1;
598
+ }, []), to = k((e, t, n = !1) => {
599
+ let { navItems: r, options: i } = Ua.current, a = ur(r), o = null, s = dr(e);
600
+ if (ir(s) || ar(s) !== null) {
601
+ let e = y.getState(), n = e.conversations.find((t) => t.id === e.activeConversationId), s = n ? xr(n.messages, t) : null, c = n ? e.processingByConversationId[n.id] ?? null : null, l = c !== null && c.messageId === s?.id && gt(c.status);
602
+ n && s && !l && (o = br({
549
603
  reply: s,
550
- text: Ot(s, c, F),
604
+ text: Wt(s, c, F),
551
605
  resolve: {
552
606
  destinations: a,
553
607
  entityRoutes: i.entityRoutes,
554
- visibleNavIds: nr(r),
555
- nounLabel: (e) => yn(F, e)
608
+ visibleNavIds: or(r),
609
+ nounLabel: (e) => St(F, e)
556
610
  }
557
611
  }));
558
612
  }
559
- return ar(e, a, {
613
+ return lr(e, a, {
560
614
  ...i,
561
- locale: t === void 0 ? V : Zr.input.code
615
+ locale: t === void 0 ? V : ti.input.code
562
616
  }, {
563
- backRunnable: Ua(t),
617
+ backRunnable: eo(t),
564
618
  navigation: o,
565
619
  skipRecords: n,
566
- controls: br()
620
+ controls: wr()
567
621
  });
568
622
  }, [
569
- Ua,
570
- Zr,
623
+ eo,
624
+ ti,
571
625
  V,
572
626
  F
573
- ]), Ga = A((e, t) => {
574
- let n = Wa(e, t);
627
+ ]), no = k((e, t) => {
628
+ let n = to(e, t);
575
629
  if (!n) return !1;
576
- let { theme: r, navigate: i } = Ra.current;
630
+ let { theme: r, navigate: i } = Ua.current;
577
631
  switch (n.kind) {
578
632
  case "theme": return r !== null;
579
633
  case "navigate":
@@ -583,30 +637,30 @@ var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
583
637
  case "link-not-openable":
584
638
  case "back": return i !== null;
585
639
  case "conversation-delete": return !1;
586
- case "app-control": return xr(n.request, { voiceLive: t !== void 0 || zo.current }) !== null;
640
+ case "app-control": return Tr(n.request, { voiceLive: t !== void 0 || Xo.current }) !== null;
587
641
  case "open-record": return !1;
588
642
  }
589
- }, [Wa]), Ka = M(Ga);
590
- j(() => {
591
- Ka.current = Ga;
592
- }, [Ga]);
593
- let qa = A((e, t, n, r, i) => {
643
+ }, [to]), ro = M(no);
644
+ A(() => {
645
+ ro.current = no;
646
+ }, [no]);
647
+ let io = k((e, t, n, r, i) => {
594
648
  let a = F(n.key, n.fallback, r), o = n.fallback.replace(/\{\{\s*count\s*\}\}/g, String(r.count)), s = {
595
649
  kind: "write-reply",
596
650
  line: n.key
597
651
  }, c = (/* @__PURE__ */ new Date()).toISOString(), l = P();
598
- G(e, {
652
+ W(e, {
599
653
  id: l,
600
654
  role: "user",
601
655
  content: t,
602
656
  timestamp: c,
603
657
  metadata: {
604
658
  localAction: s,
605
- ...w(i)
659
+ ...C(i)
606
660
  }
607
661
  });
608
662
  let u = P();
609
- G(e, {
663
+ W(e, {
610
664
  id: u,
611
665
  role: "assistant",
612
666
  content: a,
@@ -614,65 +668,65 @@ var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
614
668
  metadata: {
615
669
  lang: a === o ? "en" : V,
616
670
  localAction: s,
617
- ...w(i)
671
+ ...C(i)
618
672
  }
619
- }), dn.recordCommittedEntries(e, [l, u], "LOCAL_COMMAND", k()), Na(e, u);
673
+ }), Dn.recordCommittedEntries(e, [l, u], "LOCAL_COMMAND", O()), Ra(e, u);
620
674
  }, [
621
- G,
675
+ W,
622
676
  V,
623
- Na,
677
+ Ra,
624
678
  F
625
- ]), Ja = hn(), Ya = On(), Xa = Ja?.request ?? null, Za = M(() => void 0), [Qa, $a] = Ar(null);
626
- j(() => {
627
- if (Qa === null) return;
628
- let e = window.setTimeout(() => $a(null), Lr);
679
+ ]), ao = jn(), oo = Mn(), so = ao?.request ?? null, co = M(() => void 0), [lo, uo] = Nr(null);
680
+ A(() => {
681
+ if (lo === null) return;
682
+ let e = window.setTimeout(() => uo(null), Br);
629
683
  return () => window.clearTimeout(e);
630
- }, [Qa]);
631
- let eo = A(() => {
684
+ }, [lo]);
685
+ let fo = k(() => {
632
686
  let e = y.getState();
633
- return W(void 0, e.autoRouting && Zi.current ? c : e.mode, e.autoRouting ? { routedBy: "auto" } : void 0);
634
- }, [W]), to = A((e) => {
635
- if (!Xa) return !1;
636
- let t = e !== void 0, n = y.getState(), r = kn({
687
+ return ui(void 0, e.autoRouting && na.current ? c : e.mode, e.autoRouting ? { routedBy: "auto" } : void 0);
688
+ }, [ui]), po = k((e) => {
689
+ if (!so) return !1;
690
+ let t = e !== void 0, n = y.getState(), r = Nn({
637
691
  spoken: t,
638
- bound: sa.current,
692
+ bound: fa.current,
639
693
  activeConversationId: n.activeConversationId,
640
694
  conversations: n.conversations,
641
- historyOn: mn()
695
+ historyOn: An()
642
696
  });
643
- if (r && Xa(r), t) {
697
+ if (r && so(r), t) {
644
698
  let e = r ? "Opened the delete confirmation. Choose Delete or Cancel on screen." : "There is no conversation to delete.", t = r ? F("deleteConversation.opened", "Opened the delete confirmation. Choose Delete or Cancel on screen.") : F("deleteConversation.nothing", "There is no conversation to delete.");
645
- Za.current({
699
+ co.current({
646
700
  id: `conversation-delete:${P()}`,
647
701
  text: t,
648
702
  lang: t === e ? "en" : V
649
703
  });
650
- } else r || $a(Date.now());
704
+ } else r || uo(Date.now());
651
705
  return !0;
652
706
  }, [
653
- Xa,
707
+ so,
654
708
  V,
655
709
  F
656
- ]), no = A((e, t, n, r = !1) => {
657
- if (e.kind === "conversation-delete") return to(n);
658
- let { theme: i, navigate: a } = Ra.current, o = null, s = () => {
659
- let e = (r ? null : o ?? y.getState().activeConversationId) ?? eo();
660
- return r && ua(e), e;
710
+ ]), mo = k((e, t, n, r = !1) => {
711
+ if (e.kind === "conversation-delete") return po(n);
712
+ let { theme: i, navigate: a } = Ua.current, o = null, s = () => {
713
+ let e = (r ? null : o ?? y.getState().activeConversationId) ?? fo();
714
+ return r && ha(e), e;
661
715
  }, c = (e, r) => {
662
716
  let i = P();
663
- return G(e, {
717
+ return W(e, {
664
718
  id: i,
665
719
  role: "user",
666
720
  content: t,
667
721
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
668
722
  metadata: {
669
723
  localAction: r,
670
- ...w(n)
724
+ ...C(n)
671
725
  }
672
726
  }), i;
673
727
  }, l = (e, t, r, i, a, o) => {
674
728
  let s = P();
675
- return G(e, {
729
+ return W(e, {
676
730
  id: s,
677
731
  role: "assistant",
678
732
  content: r.text,
@@ -680,54 +734,54 @@ var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
680
734
  metadata: {
681
735
  lang: r.translated ? V : "en",
682
736
  localAction: i,
683
- ...w(n)
737
+ ...C(n)
684
738
  }
685
- }), dn.recordCommittedEntries(e, [t, s], "LOCAL_COMMAND", a), o && Na(e, s), s;
739
+ }), Dn.recordCommittedEntries(e, [t, s], "LOCAL_COMMAND", a), o && Ra(e, s), s;
686
740
  }, u = (e, t, n) => {
687
- let r = s(), i = l(r, c(r, t), e, t, k(), !0);
741
+ let r = s(), i = l(r, c(r, t), e, t, O(), !0);
688
742
  return n?.(i), !0;
689
743
  }, d = (e) => {
690
- let t = s(), n = k(), r = window.location.pathname, i = c(t, fr({
744
+ let t = s(), n = O(), r = window.location.pathname, i = c(t, gr({
691
745
  destinationId: e.destinationId,
692
746
  path: e.registryPath,
693
747
  alreadyHere: !1,
694
748
  via: e.via
695
749
  })), o = P();
696
- Ba.current = o, Ha(!0);
750
+ Za.current = o, $a(!0);
697
751
  let u = (a) => {
698
752
  try {
699
753
  if (!y.getState().conversations.some((e) => e.id === t)) return;
700
- let o = or(Ra.current.navItems), s = a.status === "arrived" || a.status === "redirected" ? a.landedPath : null, c = fr({
754
+ let o = ur(Ua.current.navItems), s = a.status === "arrived" || a.status === "redirected" ? a.landedPath : null, c = gr({
701
755
  destinationId: e.destinationId,
702
756
  path: e.registryPath,
703
757
  alreadyHere: !1,
704
758
  via: e.via,
705
759
  outcome: a
706
760
  });
707
- ci(t, i, { localAction: c });
708
- let u = l(t, i, e.via === "back" && a.status === "arrived" ? gn(F, e.pageLabel()) : Sn(F, a, {
761
+ pi(t, i, { localAction: c });
762
+ let u = l(t, i, e.via === "back" && a.status === "arrived" ? yt(F, e.pageLabel()) : Tt(F, a, {
709
763
  page: e.pageLabel(),
710
- landed: s === null ? null : mr(o, s),
764
+ landed: s === null ? null : vr(o, s),
711
765
  path: e.target
712
- }), c, n, za.current);
766
+ }), c, n, Y.current);
713
767
  a.status === "arrived" && e.onArrived?.({
714
768
  replyId: u,
715
769
  fromPath: r,
716
770
  landedPath: a.landedPath
717
771
  });
718
772
  } finally {
719
- Ba.current === o && (Ba.current = null, za.current && Ha(!1));
773
+ Za.current === o && (Za.current = null, Y.current && $a(!1));
720
774
  }
721
775
  };
722
- return lr(a, e.target, {
776
+ return pr(a, e.target, {
723
777
  readPath: () => window.location.pathname + window.location.search,
724
778
  now: () => Date.now(),
725
779
  schedule: (e, t) => {
726
780
  window.setTimeout(e, t);
727
781
  },
728
- isShellLess: () => !za.current
782
+ isShellLess: () => !Y.current
729
783
  }).then(u, () => u({ status: "unconfirmed" })), !0;
730
- }, f = ({ replyId: e, fromPath: t, landedPath: n }) => ur.push({
784
+ }, f = ({ replyId: e, fromPath: t, landedPath: n }) => mr.push({
731
785
  fromPath: t,
732
786
  toPath: n,
733
787
  replyMessageId: e,
@@ -735,44 +789,57 @@ var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
735
789
  });
736
790
  if (e.kind === "theme") {
737
791
  if (!i) return !1;
738
- let t = cr(e.request, {
792
+ let t = fr(e.request, {
739
793
  mode: i.mode,
740
794
  resolvedTheme: i.resolvedTheme
741
795
  });
742
796
  if (!t.alreadyApplied) try {
743
797
  i.setMode(t.mode);
744
798
  } catch {}
745
- return u(En(F, t, e.request.kind === "family"), {
799
+ return u(kt(F, t, e.request.kind === "family"), {
746
800
  kind: "theme",
747
801
  mode: t.mode,
748
802
  alreadyApplied: t.alreadyApplied
749
803
  });
750
804
  }
751
805
  if (e.kind === "app-control") {
752
- let t = xr(e.request, { voiceLive: n !== void 0 || zo.current });
806
+ let t = Tr(e.request, { voiceLive: n !== void 0 || Xo.current });
753
807
  if (!t) return !1;
754
808
  let r = (e) => ({
755
809
  kind: "app-control",
756
810
  control: t.control,
757
- outcome: e.outcome
758
- }), i = (e) => u(Dn(F, e.reply), r(e));
811
+ outcome: e.outcome,
812
+ ...e.reply.code === "language" ? { languageLabel: e.reply.label } : {}
813
+ }), i = (t) => {
814
+ if (e.request.control === "language" && Ya(!1), e.request.control === "language" && t.reply.code === "language" && !t.reply.already && t.outcome === "done") {
815
+ let n = s(), i = r(t), a = l(n, c(n, i), At((e, t) => t, t.reply), i, O(), !1);
816
+ return Ga.current = {
817
+ wanted: e.request.code,
818
+ reply: t.reply,
819
+ conversationId: n,
820
+ messageId: a,
821
+ deadline: window.setTimeout(Xa, jt)
822
+ }, qa(a), !0;
823
+ }
824
+ return u(At(F, t.reply), r(t));
825
+ };
759
826
  if (t.kind === "reply") return i(t.run);
760
827
  if (t.kind === "run") {
761
828
  let e = t.run();
762
829
  return t.silent && (e.outcome === "done" || e.outcome === "already") ? !0 : i(e);
763
830
  }
764
- let a = Ya;
831
+ let a = oo;
765
832
  if (!a) return !1;
766
833
  let o = null;
767
- return u(Dn(F, t.ask.reply), r(t.ask), (e) => {
834
+ return u(At(F, t.ask.reply), r(t.ask), (e) => {
768
835
  o = y.getState().conversations.find((t) => t.messages.some((t) => t.id === e))?.id ?? null;
769
836
  }), a.request({
770
837
  prompt: t.prompt,
771
838
  onConfirm: () => {
772
839
  let e = t.confirmed(), i = o, a = i !== null && y.getState().conversations.some((e) => e.id === i);
773
840
  if (!i || !a) return;
774
- let s = Dn(F, e.reply);
775
- G(i, {
841
+ let s = At(F, e.reply);
842
+ W(i, {
776
843
  id: P(),
777
844
  role: "assistant",
778
845
  content: s.text,
@@ -780,30 +847,30 @@ var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
780
847
  metadata: {
781
848
  lang: s.translated ? V : "en",
782
849
  localAction: r(e),
783
- ...w(n)
850
+ ...C(n)
784
851
  }
785
852
  });
786
853
  }
787
854
  }), !0;
788
855
  }
789
856
  if (!a) return !1;
790
- if (e.kind === "choose-destination") return u(_n(F, e.candidates[0]?.label ?? e.query, e.candidates), {
857
+ if (e.kind === "choose-destination") return u(bt(F, e.candidates[0]?.label ?? e.query, e.candidates), {
791
858
  kind: "choose-destination",
792
859
  candidateIds: e.candidates.map((e) => e.id)
793
- }, (t) => vr(t, e.candidates));
794
- if (e.kind === "choose-linked") return u(vn(F, e.candidates), {
860
+ }, (t) => Sr(t, e.candidates));
861
+ if (e.kind === "choose-linked") return u(xt(F, e.candidates), {
795
862
  kind: "choose-destination",
796
863
  candidateIds: e.candidates.map((e) => e.id)
797
- }, (t) => vr(t, e.candidates));
864
+ }, (t) => Sr(t, e.candidates));
798
865
  if (e.kind === "pick-from-list") {
799
866
  let t = e.candidates !== null && e.candidates.every((e) => e !== null) ? e.candidates : null;
800
- return u(Cn(F), t ? {
867
+ return u(Et(F), t ? {
801
868
  kind: "choose-destination",
802
869
  candidateIds: t.map((e) => e.id)
803
870
  } : e.candidateIds.length > 0 ? {
804
871
  kind: "choose-destination",
805
872
  candidateIds: [...e.candidateIds]
806
- } : fr({
873
+ } : gr({
807
874
  destinationId: "",
808
875
  path: "",
809
876
  alreadyHere: !1,
@@ -812,9 +879,9 @@ var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
812
879
  status: "refused",
813
880
  reason: "not-routable"
814
881
  }
815
- }), t ? (e) => vr(e, t) : void 0);
882
+ }), t ? (e) => Sr(e, t) : void 0);
816
883
  }
817
- if (e.kind === "link-not-openable") return u(bn(F), fr({
884
+ if (e.kind === "link-not-openable") return u(Ct(F), gr({
818
885
  destinationId: "",
819
886
  path: "",
820
887
  alreadyHere: !1,
@@ -827,7 +894,7 @@ var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
827
894
  if (e.kind === "open-record") {
828
895
  let r;
829
896
  try {
830
- let { options: t, navItems: n } = Ra.current, i = t.entityRoutes ?? [], a = nr(n);
897
+ let { options: t, navItems: n } = Ua.current, i = t.entityRoutes ?? [], a = or(n);
831
898
  r = (t.records ?? []).flatMap((t) => {
832
899
  let n = i.find((e) => e.id === t.entityRouteId), r = e.request.adapterIds.length === 0 || e.request.adapterIds.includes(t.id);
833
900
  return n && r && (n.visibleWith === void 0 || a.has(n.visibleWith)) ? [{
@@ -840,27 +907,27 @@ var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
840
907
  }
841
908
  if (r.length === 0) return !1;
842
909
  let i = y.getState().activeConversationId, a = P();
843
- Ba.current = a, Ha(!0);
910
+ Za.current = a, $a(!0);
844
911
  let s = () => {
845
- Ba.current === a && (Ba.current = null, za.current && Ha(!1));
912
+ Za.current === a && (Za.current = null, Y.current && $a(!1));
846
913
  };
847
914
  return (async () => {
848
915
  let a = { kind: "none" }, c = !0;
849
916
  try {
850
- a = await rr({
917
+ a = await sr({
851
918
  name: e.request.name,
852
919
  usable: r,
853
- nounOf: (e) => yn(F, e.noun),
854
- timeoutMs: Nr
920
+ nounOf: (e) => St(F, e.noun),
921
+ timeoutMs: Ir
855
922
  }), c = y.getState().conversations.some((e) => e.id === i);
856
923
  } catch {
857
924
  a = { kind: "none" };
858
925
  } finally {
859
926
  s();
860
927
  }
861
- if (!za.current) return;
928
+ if (!Y.current) return;
862
929
  if (a.kind === "none") {
863
- oo.current(t, [], {
930
+ vo.current(t, [], {
864
931
  fromPerson: !0,
865
932
  ...n === void 0 ? {} : { voiceSessionId: n },
866
933
  localRecordsChecked: !0
@@ -881,16 +948,16 @@ var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
881
948
  return;
882
949
  }
883
950
  let l = a.candidates[0];
884
- u(a.why === "kinds" ? Tn(F, a.nouns, a.candidates) : wn(F, a.nouns[0] ?? "", l?.label ?? e.request.name, a.candidates), {
951
+ u(a.why === "kinds" ? Ot(F, a.nouns, a.candidates) : Dt(F, a.nouns[0] ?? "", l?.label ?? e.request.name, a.candidates), {
885
952
  kind: "choose-destination",
886
953
  candidateIds: a.candidates.map((e) => e.id)
887
- }, (e) => vr(e, a.candidates));
954
+ }, (e) => Sr(e, a.candidates));
888
955
  })().catch(() => void 0), !0;
889
956
  }
890
957
  if (e.kind === "back") {
891
- let e = ur.top();
958
+ let e = mr.top();
892
959
  if (!e) return !1;
893
- let t = pr(or(Ra.current.navItems), e.fromPath);
960
+ let t = _r(ur(Ua.current.navItems), e.fromPath);
894
961
  return d({
895
962
  target: e.fromPath,
896
963
  destinationId: t?.id ?? "",
@@ -898,12 +965,12 @@ var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
898
965
  via: "back",
899
966
  pageLabel: () => t?.label ?? null,
900
967
  onArrived: () => {
901
- ur.top() === e && ur.pop();
968
+ mr.top() === e && mr.pop();
902
969
  }
903
970
  });
904
971
  }
905
972
  let { destination: p } = e;
906
- return ir(p, window.location.pathname + window.location.search, or(Ra.current.navItems)) ? u(xn(F, p.label, !0), fr({
973
+ return cr(p, window.location.pathname + window.location.search, ur(Ua.current.navItems)) ? u(wt(F, p.label, !0), gr({
907
974
  destinationId: p.id,
908
975
  path: p.path,
909
976
  alreadyHere: !0,
@@ -917,47 +984,49 @@ var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
917
984
  onArrived: f
918
985
  });
919
986
  }, [
920
- G,
921
- ua,
922
- Ya,
923
- eo,
987
+ W,
988
+ ha,
989
+ oo,
990
+ fo,
991
+ Xa,
924
992
  V,
925
- ci,
926
- to,
927
- Na,
993
+ pi,
994
+ po,
995
+ Ya,
996
+ Ra,
928
997
  F
929
- ]), ro = A(async (e) => {
930
- $i.current = !0;
998
+ ]), ho = k(async (e) => {
999
+ ia.current = !0;
931
1000
  try {
932
- await q.declineForReply(e.conversationId, e.reason, e.origin);
1001
+ await K.declineForReply(e.conversationId, e.reason, e.origin);
933
1002
  } finally {
934
- $i.current = !1;
1003
+ ia.current = !1;
935
1004
  }
936
1005
  if (e.commandText !== null) {
937
- let t = Wa(e.commandText, e.options.voiceSessionId);
938
- if (t && no(t, e.content, e.options.voiceSessionId)) return;
1006
+ let t = to(e.commandText, e.options.voiceSessionId);
1007
+ if (t && mo(t, e.content, e.options.voiceSessionId)) return;
939
1008
  }
940
- await oo.current(e.content, e.attachments, e.options);
1009
+ await vo.current(e.content, e.attachments, e.options);
941
1010
  }, [
942
- Wa,
943
- no,
944
- q
945
- ]), X = A(async (e, t = [], n = {}) => {
946
- let r = n.voiceSessionId !== void 0, i = y.getState(), a = !1, o = sa.current;
947
- if (r && We(o)) {
948
- let e = Ye(o, i.activeConversationId, da());
1011
+ to,
1012
+ mo,
1013
+ K
1014
+ ]), X = k(async (e, t = [], n = {}) => {
1015
+ let r = n.voiceSessionId !== void 0, i = y.getState(), a = !1, o = fa.current;
1016
+ if (r && Ge(o)) {
1017
+ let e = Xe(o, i.activeConversationId, ga());
949
1018
  if (e.kind === "gone") return;
950
1019
  let t = n.voiceEntry ?? e;
951
- t.kind === "adopt" && ua(t.conversationId), a = t.kind === "own", n = {
1020
+ t.kind === "adopt" && ha(t.conversationId), a = t.kind === "own", n = {
952
1021
  ...n,
953
1022
  voiceEntry: t
954
1023
  };
955
1024
  }
956
1025
  let s = a ? null : i.activeConversationId, c = a ? null : i.activeConversationId ?? H;
957
1026
  if (c) {
958
- if (ht(i.processingByConversationId[c]?.status)) {
1027
+ if (gt(i.processingByConversationId[c]?.status)) {
959
1028
  let r = i.processingByConversationId[c]?.messageId ?? null;
960
- r && n.correctsInFlightTurn === !0 && !Ea.current.has(r) && ka(), r && Ea.current.has(r) && (Da.current = {
1029
+ r && n.correctsInFlightTurn === !0 && !ja.current.has(r) && Pa(), r && ja.current.has(r) && (Ma.current = {
961
1030
  conversationId: c,
962
1031
  content: e,
963
1032
  attachments: t,
@@ -965,29 +1034,29 @@ var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
965
1034
  });
966
1035
  return;
967
1036
  }
968
- if (pa.current.has(c)) return;
1037
+ if (va.current.has(c)) return;
969
1038
  }
970
- if (Qi.current || h() !== null || $i.current || Ba.current !== null) return;
971
- let l = n.targetConversationId, f = ee(), m = (e) => cn(e) || sn(e, f);
1039
+ if (ra.current || h() !== null || ia.current || Za.current !== null) return;
1040
+ let l = n.targetConversationId, f = ee(), m = (e) => wn(e) || Cn(e, f);
972
1041
  if (l !== void 0) {
973
1042
  let e = i.conversations.find((e) => e.id === l);
974
1043
  if (i.activeConversationId !== l || !e || e.mode !== i.mode || m(e)) return;
975
1044
  }
976
1045
  if (n.fromPerson && n.writeReplyBound === void 0) {
977
- let r = l ?? s ?? null, i = n.voiceSessionId === void 0 ? "typed" : "spoken", a = Jt({
1046
+ let r = l ?? s ?? null, i = n.voiceSessionId === void 0 ? "typed" : "spoken", a = dn({
978
1047
  text: e,
979
- locale: i === "spoken" ? Zr.input.code : V,
1048
+ locale: i === "spoken" ? ti.input.code : V,
980
1049
  origin: i,
981
1050
  hasAttachments: t.length > 0,
982
- live: q.liveFor(r),
983
- matchesLocalCommand: (e) => Wa(e, n.voiceSessionId) !== null
1051
+ live: K.liveFor(r),
1052
+ matchesLocalCommand: (e) => to(e, n.voiceSessionId) !== null
984
1053
  });
985
1054
  if (a.kind === "local_reply") {
986
- r && qa(r, e, a.line, a.values, n.voiceSessionId);
1055
+ r && io(r, e, a.line, a.values, n.voiceSessionId);
987
1056
  return;
988
1057
  }
989
1058
  let o = a.kind === "local" ? a.fallback : a.bound, c = a.declineAll;
990
- if (c !== null && r) return ro({
1059
+ if (c !== null && r) return ho({
991
1060
  conversationId: r,
992
1061
  reason: c,
993
1062
  origin: i,
@@ -1006,168 +1075,168 @@ var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
1006
1075
  }
1007
1076
  let te = n.writeReplyBound?.promptText ?? e;
1008
1077
  if (n.fromPerson && t.length === 0 && n.writeReplyBound?.localCommands !== !1) {
1009
- let t = Wa(e, n.voiceSessionId, n.localRecordsChecked === !0);
1010
- if (t && no(t, e, n.voiceSessionId, a)) return;
1078
+ let t = to(e, n.voiceSessionId, n.localRecordsChecked === !0);
1079
+ if (t && mo(t, e, n.voiceSessionId, a)) return;
1011
1080
  }
1012
- let ne = s ? i.conversations.find((e) => e.id === s) : void 0, g = m(ne) ? void 0 : ne, _ = i.autoRouting && Zi.current && l === void 0 ? p({
1081
+ let ne = s ? i.conversations.find((e) => e.id === s) : void 0, g = m(ne) ? void 0 : ne, _ = i.autoRouting && na.current && l === void 0 ? p({
1013
1082
  intent: n.autoIntent ?? u(e),
1014
1083
  dictated: r,
1015
- voiceProposalBound: r && Gr("api-calls") && ae(i.acknowledgedWriteModes, "api-calls"),
1084
+ voiceProposalBound: r && Jr("api-calls") && ae(i.acknowledgedWriteModes, "api-calls"),
1016
1085
  conversation: g ? {
1017
1086
  mode: g.mode,
1018
1087
  routedBy: g.routedBy,
1019
- hasHistory: on(g)
1088
+ hasHistory: Sn(g)
1020
1089
  } : null
1021
1090
  }) : null;
1022
- if (_ && Ui.current.find((e) => e.id === _.mode)?.writeCapable && !ae(i.acknowledgedWriteModes, _.mode)) {
1023
- Qi.current = {
1091
+ if (_ && Ji.current.find((e) => e.id === _.mode)?.writeCapable && !ae(i.acknowledgedWriteModes, _.mode)) {
1092
+ ra.current = {
1024
1093
  content: e,
1025
1094
  attachments: t,
1026
1095
  options: n
1027
- }, na(_.mode);
1096
+ }, sa(_.mode);
1028
1097
  return;
1029
1098
  }
1030
1099
  let v = _ ? _.mode : i.mode, ie, se, b = l ?? (a ? null : H), le = b ? y.getState().conversations.find((e) => e.id === b) : void 0, ue = _?.action === "escalate" && g ? {
1031
1100
  mode: g.mode,
1032
1101
  backendSessionId: g.backendSessionId ?? null
1033
1102
  } : null;
1034
- if (_) _.action === "new" || !g ? b = W(void 0, v, { routedBy: "auto" }) : (b = g.id, yi(b, v));
1103
+ if (_) _.action === "new" || !g ? b = ui(void 0, v, { routedBy: "auto" }) : (b = g.id, wi(b, v));
1035
1104
  else {
1036
1105
  let e = i.autoRouting ? { routedBy: "auto" } : void 0;
1037
- !b || m(le) || le && le.mode !== v && on(le) ? b = W(void 0, v, e) : le && le.mode !== v && (e ? yi(b, v) : ii(b, v));
1106
+ !b || m(le) || le && le.mode !== v && Sn(le) ? b = ui(void 0, v, e) : le && le.mode !== v && (e ? wi(b, v) : ci(b, v));
1038
1107
  }
1039
1108
  if (!b) return;
1040
- r && sa.current !== void 0 && b !== i.activeConversationId && ua(b), n.approvalFollowUp || (fa.current[b] = t);
1041
- let fe = () => y.getState().conversations.some((e) => e.id === b), x = k(), S = {
1109
+ r && fa.current !== void 0 && b !== i.activeConversationId && ha(b), n.approvalFollowUp || (_a.current[b] = t);
1110
+ let fe = () => y.getState().conversations.some((e) => e.id === b), x = O(), ve = {
1042
1111
  accessToken: z(),
1043
- workspaceToken: Kr(),
1112
+ workspaceToken: Yr(),
1044
1113
  userId: B,
1045
- organizationId: Ft()
1046
- }, ye = (e, t) => {
1114
+ organizationId: Zt()
1115
+ }, be = (e, t) => {
1047
1116
  fe() || !x || ce(e, x, t, v, {
1048
1117
  accessToken: z(),
1049
- workspaceToken: Kr(),
1118
+ workspaceToken: Yr(),
1050
1119
  userId: B,
1051
- organizationId: Ft()
1120
+ organizationId: Zt()
1052
1121
  });
1053
- }, be = {
1122
+ }, xe = {
1054
1123
  id: P(),
1055
1124
  role: "user",
1056
1125
  content: e,
1057
1126
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1058
1127
  metadata: {
1059
- ...t.length ? { attachments: t.map(rt) } : {},
1128
+ ...t.length ? { attachments: t.map(it) } : {},
1060
1129
  ...n.approvalFollowUp ? {
1061
1130
  approvalFollowUp: !0,
1062
1131
  approvedReplyId: n.approvalFollowUp.approvedReplyId
1063
1132
  } : {},
1064
- ...w(n.voiceSessionId)
1133
+ ...C(n.voiceSessionId)
1065
1134
  }
1066
1135
  };
1067
- G(b, be);
1068
- let C = P();
1069
- G(b, {
1070
- id: C,
1136
+ W(b, xe);
1137
+ let S = P();
1138
+ W(b, {
1139
+ id: S,
1071
1140
  role: "assistant",
1072
1141
  content: "",
1073
1142
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1074
1143
  metadata: {
1075
- lang: ei,
1076
- ...w(n.voiceSessionId)
1144
+ lang: ii,
1145
+ ...C(n.voiceSessionId)
1077
1146
  }
1078
- }), kt(C, {
1147
+ }), Gt(S, {
1079
1148
  channel: r ? "voice" : "chat",
1080
1149
  mode: v,
1081
1150
  product: I,
1082
- language: ei,
1083
- device: At(),
1151
+ language: ii,
1152
+ device: Kt(),
1084
1153
  routedByAuto: !!_
1085
- }, n.voiceTiming), O(C, "accepted"), li(b, "provisioning", C, null), re(C);
1086
- let Me = () => {
1087
- let e = gt({
1088
- turnId: C,
1089
- abortRequested: Ea.current.has(C),
1154
+ }, n.voiceTiming), D(S, "accepted"), mi(b, "provisioning", S, null), re(S);
1155
+ let Ne = () => {
1156
+ let e = _t({
1157
+ turnId: S,
1158
+ abortRequested: ja.current.has(S),
1090
1159
  activeTurnId: y.getState().processingByConversationId[b]?.messageId ?? null,
1091
1160
  conversationExists: fe()
1092
1161
  });
1093
- return e.abandon && Ie(), e;
1094
- }, Ne = (e, t, r, i, a = !1, o = ei) => {
1095
- si(b, C, { content: xe(e) }), ci(b, C, {
1162
+ return e.abandon && Le(), e;
1163
+ }, Pe = (e, t, r, i, a = !1, o = ii) => {
1164
+ fi(b, S, { content: Se(e) }), pi(b, S, {
1096
1165
  lang: o,
1097
1166
  ...t?.length ? { artifacts: t } : {},
1098
1167
  ...t?.length || r || i ? { mode: v } : {},
1099
1168
  ...r ? { sessionId: r } : {},
1100
1169
  ...i ? { sandboxId: i } : {},
1101
1170
  ...a ? { incomplete: !0 } : {},
1102
- ...w(n.voiceSessionId)
1171
+ ...C(n.voiceSessionId)
1103
1172
  });
1104
- }, Pe = { session: null }, T = {
1173
+ }, Fe = { session: null }, w = {
1105
1174
  stream: null,
1106
1175
  render: null
1107
- }, Ie = () => {
1108
- T.render?.end();
1109
1176
  }, Le = () => {
1110
- Ie(), T.stream?.close(), T.stream = null, T.render = null;
1111
- }, Re = !1, ze = () => {
1112
- Re && (Re = !1, Fe.abort(C));
1113
- }, E = async (i = 1) => {
1114
- O(C, "attemptStarted");
1177
+ w.render?.end();
1178
+ }, Re = () => {
1179
+ Le(), w.stream?.close(), w.stream = null, w.render = null;
1180
+ }, ze = !1, Be = () => {
1181
+ ze && (ze = !1, Ie.abort(S));
1182
+ }, T = async (i = 1) => {
1183
+ D(S, "attemptStarted");
1115
1184
  let a = null, o = null, s = !1;
1116
1185
  try {
1117
- let { sandboxId: i, sessionId: c, sessionIsNew: l, readAhead: u, sandboxIsNew: d, sandboxProbed: f, sandboxAdopted: p, deadSandboxProbe: ee, sessionPreopened: m } = await ba(b, C, v, x, S, { isAbandoned: () => gt({
1118
- turnId: C,
1119
- abortRequested: Ea.current.has(C),
1186
+ let { sandboxId: i, sessionId: c, sessionIsNew: l, readAhead: u, sandboxIsNew: d, sandboxProbed: f, sandboxAdopted: p, deadSandboxProbe: ee, sessionPreopened: m } = await Ta(b, S, v, x, ve, { isAbandoned: () => _t({
1187
+ turnId: S,
1188
+ abortRequested: ja.current.has(S),
1120
1189
  activeTurnId: y.getState().processingByConversationId[b]?.messageId ?? null,
1121
1190
  conversationExists: fe()
1122
1191
  }).abandon });
1123
- if (a = i, O(C, "runtimeReady"), D(C, {
1192
+ if (a = i, D(S, "runtimeReady"), E(S, {
1124
1193
  runtime: d ? "cold" : p ? "adopted" : f ? "probed" : m ? "preopened" : l ? "new-session" : "warm",
1125
1194
  deadSandboxProbe: ee
1126
- }), D(C, { session: m ? "preopened" : l ? "created" : "reused" }), o = c, Pe.session = {
1195
+ }), E(S, { session: m ? "preopened" : l ? "created" : "reused" }), o = c, Fe.session = {
1127
1196
  sandboxId: i,
1128
1197
  sessionId: c
1129
1198
  }, oe(v, ie, y.getState().acknowledgedWriteModes, {
1130
1199
  dictated: r,
1131
1200
  confirmsWrites: ge(v),
1132
- proposalBound: Gr(v, i)
1133
- }) === "voice-in-write-mode") throw new Se("voice-in-write-mode", "Voice in a write mode");
1134
- let ne = An({
1201
+ proposalBound: Jr(v, i)
1202
+ }) === "voice-in-write-mode") throw new Ce("voice-in-write-mode", "Voice in a write mode");
1203
+ let ne = Pn({
1135
1204
  conversation: y.getState().conversations.find((e) => e.id === b),
1136
1205
  content: e,
1137
1206
  sessionIsNew: l,
1138
1207
  sendingMode: v,
1139
1208
  sendingModeConfig: ie,
1140
- modes: Ui.current,
1141
- answerText: (e) => Tt(e).text
1209
+ modes: Ji.current,
1210
+ answerText: (e) => Vt(e).text
1142
1211
  });
1143
- if (Le(), zn()) {
1144
- let e = Rn({
1145
- mint: () => he(i, x, c, v, S),
1146
- mark: (e) => O(C, e)
1212
+ if (Re(), Un()) {
1213
+ let e = Hn({
1214
+ mint: () => he(i, x, c, v, ve),
1215
+ mark: (e) => D(S, e)
1147
1216
  });
1148
- T.stream = e, T.render = Nn({
1217
+ w.stream = e, w.render = Ln({
1149
1218
  stream: e,
1150
1219
  conversationId: b,
1151
- messageId: C,
1152
- build: (e, t) => xe(bt(e, t, { accumulateNarration: se.accumulatesNarration }).content),
1153
- onFirstDelta: () => O(C, "firstDelta"),
1154
- onFirstVisible: () => O(C, "firstOutput")
1220
+ messageId: S,
1221
+ build: (e, t) => Se(It(e, t, { accumulateNarration: se.accumulatesNarration }).content),
1222
+ onFirstDelta: () => D(S, "firstDelta"),
1223
+ onFirstVisible: () => D(S, "firstOutput")
1155
1224
  });
1156
1225
  }
1157
- let h = await St(() => me(i, x, c, v, S, { limit: 50 }), l, xt(u, i, c));
1158
- va(b, C, "streaming", "thinking");
1159
- let re = Br?.(), g = Yt(y.getState().sandboxWriteCapabilities[i]), _ = Ra.current, ae = _.options.uiCatalogue ? yr(or(_.navItems), {
1226
+ let h = await Rt(() => me(i, x, c, v, ve, { limit: 50 }), l, Lt(u, i, c));
1227
+ Ca(b, S, "streaming", "thinking");
1228
+ let re = Ur?.(), g = fn(y.getState().sandboxWriteCapabilities[i]), _ = Ua.current, ae = _.options.uiCatalogue ? Cr(ur(_.navItems), {
1160
1229
  permissionsSettled: _.navPermissionsSettled,
1161
1230
  simulating: _.navSimulating
1162
1231
  }) : null, ce = {
1163
1232
  conversationId: b,
1164
1233
  writeReply: g === "proposal-v1" ? n.writeReplyBound?.writeReply ?? null : null,
1165
1234
  ...ae ? { uiCatalogue: ae } : {}
1166
- }, { prompt: le, parts: ue } = mt({
1235
+ }, { prompt: le, parts: ue } = ht({
1167
1236
  content: ne ? `${ne}${te}` : te,
1168
1237
  attachments: t,
1169
- limits: nt(ie),
1170
- wrapPrompt: (e) => Vr?.(v, e, Qr, $r, r, { writeApproval: g }) ?? e,
1238
+ limits: rt(ie),
1239
+ wrapPrompt: (e) => Wr?.(v, e, ni, ri, r, { writeApproval: g }) ?? e,
1171
1240
  requestBytes: (e, t) => _e({
1172
1241
  sandboxId: i,
1173
1242
  workspaceId: x,
@@ -1176,232 +1245,234 @@ var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
1176
1245
  prompt: e,
1177
1246
  parts: t,
1178
1247
  pageContext: re,
1179
- authContext: S,
1248
+ authContext: ve,
1180
1249
  ...ce
1181
1250
  })
1182
- }), Ce = $e(ue), we = Ce > 0;
1183
- s = Qe(t) > Ce;
1184
- let Te = Me();
1185
- if (Te.abandon) {
1186
- Te.clearProcessing && ui(b);
1251
+ }), we = et(ue), Te = we > 0;
1252
+ s = $e(t) > we;
1253
+ let Ee = Ne();
1254
+ if (Ee.abandon) {
1255
+ Ee.clearProcessing && hi(b);
1187
1256
  return;
1188
1257
  }
1189
1258
  try {
1190
- await ve(i, x, c, le, v, re, S, ue?.length ? {
1259
+ await ye(i, x, c, le, v, re, ve, ue?.length ? {
1191
1260
  parts: ue,
1192
1261
  ...ce
1193
1262
  } : ce);
1194
1263
  } catch (e) {
1195
- if (!ue || !It(e)) throw e;
1196
- await ve(i, x, c, le, v, re, S, ce), s ||= we;
1264
+ if (!ue || !Qt(e)) throw e;
1265
+ await ye(i, x, c, le, v, re, ve, ce), s ||= Te;
1197
1266
  }
1198
- let De = (e) => si(b, C, { content: e }), ke = (e) => s ? `${e}\n\n${F("attachments.imagesNotSent", "_Your photo was too large to include with this message, so the answer above is from the text and the file link only. Try a smaller or more tightly cropped photo._")}` : e;
1199
- O(C, "promptSent");
1200
- let Ae = null, w = !1, ze = yt, E = bt([], h);
1201
- T.render?.arm(h);
1202
- let Ve = Date.now() + se.streamBudgetMs, He = Date.now(), Ue = Date.now(), We = Bn(() => me(i, x, c, v, S, {
1267
+ let Oe = (e) => fi(b, S, { content: e }), Ae = (e) => s ? `${e}\n\n${F("attachments.imagesNotSent", "_Your photo was too large to include with this message, so the answer above is from the text and the file link only. Try a smaller or more tightly cropped photo._")}` : e;
1268
+ D(S, "promptSent");
1269
+ let je = null, C = !1, Be = Ft, T = It([], h);
1270
+ w.render?.arm(h);
1271
+ let He = Date.now() + se.streamBudgetMs, Ue = Date.now(), We = Date.now(), Ge = Wn(() => me(i, x, c, v, ve, {
1203
1272
  limit: 50,
1204
1273
  sinceMs: h,
1205
1274
  surfaceTurnTerminal: !0
1206
- })), Ge = T.stream?.onIdle(() => We.startExtra());
1207
- for (; Date.now() < Ve;) {
1208
- ye(i, c);
1209
- let e = Me();
1275
+ })), Ke = w.stream?.onIdle(() => Ge.startExtra());
1276
+ for (; Date.now() < He;) {
1277
+ be(i, c);
1278
+ let e = Ne();
1210
1279
  if (e.abandon) {
1211
- e.clearProcessing && ui(b);
1280
+ e.clearProcessing && hi(b);
1212
1281
  return;
1213
1282
  }
1214
- let t = await We.next();
1215
- if (E = bt(t, h, { accumulateNarration: se.accumulatesNarration }), si(b, C, { content: xe(E.content) }), E.hasRenderableOutput ? w || (w = !0, Ae !== null && O(C, "lastQuietPoll", Ae), O(C, "firstOutput")) : Ae = Mt(), se.accumulatesNarration) E.hasText && O(C, "firstText");
1283
+ let t = await Ge.next();
1284
+ if (T = It(t, h, { accumulateNarration: se.accumulatesNarration }), fi(b, S, { content: Se(T.content) }), T.hasRenderableOutput ? C || (C = !0, je !== null && D(S, "lastQuietPoll", je), D(S, "firstOutput")) : je = Jt(), se.accumulatesNarration) T.hasText && D(S, "firstText");
1216
1285
  else {
1217
- let e = wt(ze, E, Mt());
1218
- ze = e.tracker, e.confirmedAt !== null && O(C, "firstText", e.confirmedAt);
1286
+ let e = Bt(Be, T, Jt());
1287
+ Be = e.tracker, e.confirmedAt !== null && D(S, "firstText", e.confirmedAt);
1219
1288
  }
1220
- if (E.pendingWrite && !qt(y.getState().sandboxWriteCapabilities[i]) && ci(b, C, { pendingWrite: E.pendingWrite }), E.done && (T.stream ? D(C, {
1221
- transport: T.stream.reachedOpen ? "sse" : "poll",
1222
- live: Mn(T.stream.live)
1223
- }) : D(C, {
1289
+ if (T.pendingWrite && !un(y.getState().sandboxWriteCapabilities[i]) && pi(b, S, { pendingWrite: T.pendingWrite }), T.done && (w.stream ? E(S, {
1290
+ transport: w.stream.reachedOpen ? "sse" : "poll",
1291
+ live: In(w.stream.live)
1292
+ }) : E(S, {
1224
1293
  transport: "poll",
1225
1294
  live: "none"
1226
- }), Ie()), E.done) {
1227
- O(C, "answerDone"), J.current.markVerified(i);
1295
+ }), Le()), T.done) {
1296
+ D(S, "answerDone"), q.current.markVerified(i);
1228
1297
  break;
1229
1298
  }
1230
- if (T.render?.refresh(t), Date.now() - He > 3e4 && (await de(i, x, 600, S).catch(() => void 0), He = Date.now()), !We.hasPending()) {
1231
- let e = Be(Date.now() - Ue);
1232
- T.stream ? await T.stream.waitWake(e) : await new Promise((t) => setTimeout(t, e));
1299
+ if (w.render?.refresh(t), Date.now() - Ue > 3e4 && (await de(i, x, 600, ve).catch(() => void 0), Ue = Date.now()), !Ge.hasPending()) {
1300
+ let e = Ve(Date.now() - We);
1301
+ w.stream ? await w.stream.waitWake(e) : await new Promise((t) => setTimeout(t, e));
1233
1302
  }
1234
1303
  }
1235
- if (Ge?.(), Le(), E.done && n.voiceSessionId !== void 0 && !Me().abandon) {
1236
- let e = xe(ke(E.content));
1237
- e.trim() && (s && De(e), O(C, "speechQueued"), Re = !0, Fe.publish(C, {
1304
+ if (Ke?.(), Re(), T.done && n.voiceSessionId !== void 0 && !Ne().abandon) {
1305
+ let e = Se(Ae(T.content));
1306
+ e.trim() && (s && Oe(e), D(S, "speechQueued"), ze = !0, Ie.publish(S, {
1238
1307
  conversationId: b,
1239
1308
  channel: "voice",
1240
1309
  voiceSessionId: n.voiceSessionId,
1241
1310
  text: e,
1242
- lang: ei,
1311
+ lang: ii,
1243
1312
  final: !0
1244
1313
  }));
1245
1314
  }
1246
- let Ke = se.producesArtifacts ? await pe(i, x, c, v, S).then((e) => e).catch(() => []) : void 0;
1247
- E.usedTools !== void 0 && D(C, { usedTools: E.usedTools }), E.done || (D(C, { outcome: "timedOut" }), E = {
1248
- ...E,
1249
- content: je(E.content, v, F, ie)
1250
- }), s && (E = {
1251
- ...E,
1252
- content: ke(E.content)
1315
+ let qe = se.producesArtifacts ? await pe(i, x, c, v, ve).then((e) => e).catch(() => []) : void 0;
1316
+ T.usedTools !== void 0 && E(S, { usedTools: T.usedTools }), T.done || (E(S, { outcome: "timedOut" }), T = {
1317
+ ...T,
1318
+ content: Me(T.content, v, F, ie)
1319
+ }), s && (T = {
1320
+ ...T,
1321
+ content: Ae(T.content)
1253
1322
  });
1254
- let qe = !E.done;
1255
- Ne(E.content, Ke, c, i, qe), E.tokens && (si(b, C, { tokens: E.tokens }), (Ur ? await Oe({
1323
+ let Je = !T.done;
1324
+ Pe(T.content, qe, c, i, Je), T.tokens && (fi(b, S, { tokens: T.tokens }), (Kr ? await ke({
1256
1325
  workspaceId: x,
1257
1326
  sessionId: c,
1258
- messageId: E.messageId,
1259
- model: E.model,
1260
- tokens: E.tokens
1261
- }, Ur, { ledger: Ee("panel", I) }) : { ok: !0 }).ok && Cr(I)), E.done || ye(i, c);
1262
- let Je = Me();
1263
- if (Je.abandon) {
1264
- Je.clearProcessing && ui(b);
1327
+ messageId: T.messageId,
1328
+ model: T.model,
1329
+ tokens: T.tokens
1330
+ }, Kr, { ledger: De("panel", I) }) : { ok: !0 }).ok && Dr(I)), T.done || be(i, c);
1331
+ let Ye = Ne();
1332
+ if (Ye.abandon) {
1333
+ Ye.clearProcessing && hi(b);
1265
1334
  return;
1266
1335
  }
1267
- O(C, "complete"), D(C, { outcome: "answered" }), li(b, "complete", C, null), dn.recordCommittedEntries(b, [be.id, C], "TURN", x), Re = !1;
1336
+ D(S, "complete"), E(S, { outcome: "answered" }), mi(b, "complete", S, null), Dn.recordCommittedEntries(b, [xe.id, S], "TURN", x), ze = !1;
1268
1337
  } catch (e) {
1269
- J.current.invalidate(a ?? y.getState().sandboxesByMode[v]?.sandboxId ?? null);
1270
- let t = gt({
1271
- turnId: C,
1272
- abortRequested: Ea.current.has(C),
1338
+ q.current.invalidate(a ?? y.getState().sandboxesByMode[v]?.sandboxId ?? null);
1339
+ let t = _t({
1340
+ turnId: S,
1341
+ abortRequested: ja.current.has(S),
1273
1342
  activeTurnId: y.getState().processingByConversationId[b]?.messageId ?? null,
1274
1343
  conversationExists: fe()
1275
1344
  });
1276
- if (Ie(), a && o && ye(a, o), t.abandon) {
1277
- t.clearProcessing && ui(b);
1345
+ if (Le(), a && o && be(a, o), t.abandon) {
1346
+ t.clearProcessing && hi(b);
1278
1347
  return;
1279
1348
  }
1280
- if (i === 1 && Lt(e)) {
1349
+ if (i === 1 && $t(e)) {
1281
1350
  let e = a ?? y.getState().sandboxesByMode[v]?.sandboxId ?? null;
1282
- return e && (Y.current.add(e), J.current.invalidate(e)), fi(b), mi(v), oi(b, C, ""), ci(b, C, { pendingWrite: void 0 }), e && q.retireSandbox(e), Le(), ze(), jt(C), E(2);
1351
+ return e && (J.current.add(e), q.current.invalidate(e)), _i(b), yi(v), di(b, S, ""), pi(b, S, { pendingWrite: void 0 }), e && K.retireSandbox(e), Re(), Be(), qt(S), T(2);
1283
1352
  }
1284
1353
  throw e;
1285
1354
  }
1286
- }, Ve = b;
1287
- pa.current.add(Ve);
1355
+ }, He = b;
1356
+ va.current.add(He);
1288
1357
  try {
1289
1358
  if (!x) throw Object.assign(/* @__PURE__ */ Error("Assistant backend is unavailable without an active workspace context."), { extensions: {
1290
1359
  code: "UNAUTHENTICATED",
1291
1360
  authFailure: "WORKSPACE_CONTEXT_MISSING"
1292
1361
  } });
1293
- let e = await pt(v, () => Ui.current.find((e) => e.id === v), Hi);
1362
+ let e = await mt(v, () => Ji.current.find((e) => e.id === v), qi);
1294
1363
  ie = e.config, se = e.capabilities;
1295
- let t = ie, n = Me();
1364
+ let t = ie, n = Ne();
1296
1365
  if (n.abandon) {
1297
- n.clearProcessing && ui(b);
1366
+ n.clearProcessing && hi(b);
1298
1367
  return;
1299
1368
  }
1300
1369
  let i = oe(v, t, y.getState().acknowledgedWriteModes, {
1301
1370
  dictated: r,
1302
1371
  confirmsWrites: ge(v),
1303
- proposalBound: Gr(v)
1372
+ proposalBound: Jr(v)
1304
1373
  });
1305
- if (i) throw new Se(i, i === "confirm-write-mode" ? "Write mode not confirmed" : "Voice in a write mode");
1306
- let a = Ee("panel", I);
1307
- if (Ur && De(a, x)) {
1308
- let e = await ke(a, x, Ur);
1309
- if (!e.ok) throw Ae(e.kind);
1310
- let t = Me();
1374
+ if (i) throw new Ce(i, i === "confirm-write-mode" ? "Write mode not confirmed" : "Voice in a write mode");
1375
+ let a = De("panel", I);
1376
+ if (Kr && Oe(a, x)) {
1377
+ let e = await Ae(a, x, Kr);
1378
+ if (!e.ok) throw je(e.kind);
1379
+ let t = Ne();
1311
1380
  if (t.abandon) {
1312
- t.clearProcessing && ui(b);
1381
+ t.clearProcessing && hi(b);
1313
1382
  return;
1314
1383
  }
1315
1384
  }
1316
- O(C, "cleared"), await E();
1385
+ D(S, "cleared"), await T();
1317
1386
  } catch (e) {
1318
- if (J.current.invalidate(y.getState().sandboxesByMode[v]?.sandboxId ?? null), !fe()) {
1319
- ui(b);
1387
+ if (q.current.invalidate(y.getState().sandboxesByMode[v]?.sandboxId ?? null), !fe()) {
1388
+ hi(b);
1320
1389
  return;
1321
1390
  }
1322
- let t = Pe.session?.sandboxId ?? null, r = Ce(e, { confirmsNoAction: we({
1391
+ let t = Fe.session?.sandboxId ?? null, r = we(e, { confirmsNoAction: Te({
1323
1392
  mode: v,
1324
1393
  capabilities: t ? y.getState().sandboxWriteCapabilities[t] : null
1325
1394
  }) });
1326
- D(C, { outcome: r.kind === "temporary" ? "failed" : "refused" }), r.offersUpgrade && Sr(I, "sandbox");
1327
- let i = Te(r, F, { locale: V });
1328
- li(b, "error", C, i.headline), si(b, C, { content: i.text }), ci(b, C, {
1395
+ E(S, { outcome: r.kind === "temporary" ? "failed" : "refused" }), r.offersUpgrade && Er(I, "sandbox");
1396
+ let i = Ee(r, F, { locale: V });
1397
+ mi(b, "error", S, i.headline), fi(b, S, { content: i.text }), pi(b, S, {
1329
1398
  lang: i.translated ? V : "en",
1330
- ...w(n.voiceSessionId)
1399
+ ...C(n.voiceSessionId)
1331
1400
  });
1332
1401
  } finally {
1333
- pa.current.delete(Ve), D(C, { outcome: "stopped" }), O(C, "complete"), ze(), Le();
1334
- let e = y.getState(), t = d(ue, v, e.conversations.find((e) => e.id === Ve), (t) => !!e.sandboxesByMode[t]?.sandboxId);
1335
- t && (yi(Ve, t.mode), t.backendSessionId && di(Ve, t.backendSessionId)), Pe.session && fe() && q.afterTurn({
1336
- ...Pe.session,
1337
- conversationId: Ve
1338
- }, C);
1339
- let n = Da.current;
1340
- Da.current = null, n && n.conversationId === Ve && fe() && oo.current(n.content, n.attachments, n.options);
1402
+ va.current.delete(He), E(S, { outcome: "stopped" }), D(S, "complete"), Be(), Re();
1403
+ let e = y.getState(), t = d(ue, v, e.conversations.find((e) => e.id === He), (t) => !!e.sandboxesByMode[t]?.sandboxId);
1404
+ t && (wi(He, t.mode), t.backendSessionId && gi(He, t.backendSessionId)), Fe.session && fe() && K.afterTurn({
1405
+ ...Fe.session,
1406
+ conversationId: He
1407
+ }, S);
1408
+ let n = Ma.current;
1409
+ Ma.current = null, n && n.conversationId === He && fe() && vo.current(n.content, n.attachments, n.options);
1341
1410
  }
1342
1411
  }, [
1343
1412
  H,
1344
- G,
1345
- Vr,
1346
- fi,
1347
- mi,
1348
- ti,
1349
1413
  W,
1350
- ba,
1351
- q,
1352
- ka,
1353
- qa,
1354
- ro,
1414
+ Wr,
1415
+ _i,
1416
+ yi,
1417
+ ai,
1418
+ ui,
1419
+ Ta,
1420
+ K,
1421
+ Pa,
1422
+ io,
1423
+ ho,
1355
1424
  V,
1356
- Zr,
1357
- Gr,
1358
- Br,
1425
+ ti,
1426
+ Jr,
1427
+ Ur,
1359
1428
  z,
1360
- Kr,
1361
- si,
1429
+ Yr,
1430
+ fi,
1362
1431
  I,
1363
- Hi,
1364
- Ur,
1365
- $r,
1432
+ qi,
1433
+ Kr,
1434
+ ri,
1366
1435
  V,
1367
- ei,
1368
- Qr,
1369
- yi,
1370
- no,
1371
- Wa,
1372
- ua,
1373
- da,
1374
- di,
1375
1436
  ii,
1376
- li,
1377
- ui,
1437
+ ni,
1438
+ wi,
1439
+ mo,
1440
+ to,
1441
+ ha,
1442
+ ga,
1443
+ gi,
1444
+ ci,
1445
+ mi,
1446
+ hi,
1378
1447
  F,
1379
- va,
1380
- oi,
1448
+ Ca,
1449
+ di,
1381
1450
  B
1382
- ]), io = A((e, t) => {
1451
+ ]), go = k((e, t) => {
1383
1452
  X(e, [], t ? { autoIntent: t } : {});
1384
- }, [X]), ao = A(() => {
1385
- let e = [...xi.chat].reverse().find((e) => e.role === "user" && !e.metadata?.localAction);
1453
+ }, [X]), _o = k(() => {
1454
+ let e = [...Ei.chat].reverse().find((e) => e.role === "user" && !e.metadata?.localAction);
1386
1455
  if (!e || e.metadata?.approvalFollowUp) return;
1387
- let t = H ? fa.current[H] ?? [] : [];
1456
+ let t = H ? _a.current[H] ?? [] : [];
1388
1457
  X(e.content, t);
1389
1458
  }, [
1390
- Si,
1459
+ Di,
1391
1460
  X,
1392
1461
  H
1393
- ]), oo = M(X);
1394
- j(() => {
1395
- oo.current = X;
1462
+ ]), vo = M(X);
1463
+ A(() => {
1464
+ vo.current = X;
1396
1465
  }, [X]);
1397
- let so = kr(() => {
1398
- if (Ci) return null;
1399
- for (let e = Si.length - 1; e >= 0; --e) {
1400
- let t = Si[e];
1401
- if (t?.role !== "assistant" || !Ne(t) || Ea.current.has(t.id) || T(t.id)) continue;
1402
- let n = vt(t, K, F);
1466
+ let yo = j(() => {
1467
+ if (Oi) return null;
1468
+ for (let e = Di.length - 1; e >= 0; --e) {
1469
+ let t = Di[e];
1470
+ if (t?.role !== "assistant") continue;
1471
+ if (t.id === Ka) return null;
1472
+ if (!Pe(t) || ja.current.has(t.id) || w(t.id)) continue;
1473
+ let n = Pt(t, G, F);
1403
1474
  if (n.kind !== "output") return null;
1404
- let r = Tt(n.text).text.trim();
1475
+ let r = Vt(n.text).text.trim();
1405
1476
  return r ? {
1406
1477
  id: t.id,
1407
1478
  text: r
@@ -1409,70 +1480,72 @@ var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
1409
1480
  }
1410
1481
  return null;
1411
1482
  }, [
1412
- Si,
1413
- Ci,
1414
- K,
1483
+ Di,
1484
+ Oi,
1485
+ G,
1486
+ Ka,
1415
1487
  F
1416
- ]), co = kr(() => so ? E(so.text) : null, [so]), lo = xi.chat, uo = y((e) => se(e)?.sandboxId ?? null), fo = _(lo, {
1417
- sessionId: bi?.backendSessionId,
1418
- sandboxId: uo,
1488
+ ]), bo = j(() => yo ? T(yo.text) : null, [yo]), xo = j(() => Ei.chat.filter((e) => e.id !== Ka), [Ei.chat, Ka]), So = y((e) => se(e)?.sandboxId ?? null), Co = _(xo, {
1489
+ sessionId: Ti?.backendSessionId,
1490
+ sandboxId: So,
1419
1491
  nowMs: Date.now()
1420
- }), po = v(lo), mo = (e) => {
1421
- if (Kt(e.metadata).length > 0) return !0;
1492
+ }), wo = v(xo), To = (e) => {
1493
+ if (ln(e.metadata).length > 0) return !0;
1422
1494
  let t = e.metadata?.sandboxId;
1423
- return qt(t ? Ei[t] : null);
1424
- }, ho = (e) => {
1425
- let t = Kt(e.metadata);
1426
- return t.length === 0 || !H ? null : /* @__PURE__ */ N(Gt, {
1495
+ return un(t ? ji[t] : null);
1496
+ }, Eo = (e) => {
1497
+ let t = ln(e.metadata);
1498
+ return t.length === 0 || !H ? null : /* @__PURE__ */ N(cn, {
1427
1499
  refs: t,
1428
1500
  conversationId: H,
1429
- panel: q,
1430
- entries: Di,
1431
- capabilitiesOf: (e) => Ei[e],
1432
- turnInFlight: Ci,
1501
+ panel: K,
1502
+ entries: Mi,
1503
+ capabilitiesOf: (e) => ji[e],
1504
+ turnInFlight: Oi,
1433
1505
  tr: F,
1434
- onReview: ki.review,
1435
- retiredSandboxes: Oi
1506
+ onReview: Pi.review,
1507
+ retiredSandboxes: Ni
1436
1508
  });
1437
- }, go = ki.dialog.view ? Di[ki.dialog.view.proposalId] : void 0, _o = fo?.expiresAtMs ?? null;
1438
- j(() => {
1439
- if (_o === null) return;
1440
- let e = window.setTimeout(() => Ta((e) => e + 1), Math.max(0, _o - Date.now()));
1509
+ }, Do = Pi.dialog.view ? Mi[Pi.dialog.view.proposalId] : void 0, Oo = Co?.expiresAtMs ?? null;
1510
+ A(() => {
1511
+ if (Oo === null) return;
1512
+ let e = window.setTimeout(() => Aa((e) => e + 1), Math.max(0, Oo - Date.now()));
1441
1513
  return () => window.clearTimeout(e);
1442
- }, [_o, wa]);
1443
- let Z = kr(() => xi.voice.filter((e) => e.role === "user" || e.role === "assistant").map((e) => ({
1514
+ }, [Oo, ka]);
1515
+ let Z = j(() => Ei.voice.filter((e) => e.id !== Ka && (e.role === "user" || e.role === "assistant")).map((e) => ({
1444
1516
  id: e.id,
1445
1517
  role: e.role,
1446
- text: Ot(e, K, F),
1447
- sessionId: Pe(e),
1518
+ text: Wt(e, G, F),
1519
+ sessionId: Fe(e),
1448
1520
  timestamp: e.timestamp
1449
1521
  })).filter((e) => e.text.length > 0), [
1450
- xi.voice,
1451
- K,
1522
+ Ei.voice,
1523
+ G,
1524
+ Ka,
1452
1525
  F
1453
- ]), vo = A(() => {
1526
+ ]), ko = k(() => {
1454
1527
  if (Z.length === 0) return;
1455
1528
  let e = /* @__PURE__ */ new Date();
1456
- an(Re(Z, {
1529
+ xn(ze(Z, {
1457
1530
  title: F("voiceSession.transcript", "Voice conversation"),
1458
1531
  savedAt: F("voiceSession.savedAt", "Saved"),
1459
1532
  session: F("voiceSession.sessionLabel", "Session"),
1460
1533
  earlier: F("voiceSession.earlierLabel", "Earlier"),
1461
1534
  you: F("voiceSession.speakerYou", "You"),
1462
1535
  assistant: F("voiceSession.speakerAssistant", "Assistant")
1463
- }, e), ze(I, e), "text/markdown");
1536
+ }, e), Be(I, e), "text/markdown");
1464
1537
  }, [
1465
1538
  I,
1466
1539
  Z,
1467
1540
  F
1468
- ]), yo = wr({ perFileChars: ea }), bo = M(yo);
1469
- bo.current = yo;
1470
- let xo = M(/* @__PURE__ */ new Set()), So = M(() => !1), Q = Pt({
1471
- onSubmit: A((e, t, n, r) => {
1472
- let i = sa.current, a = Ze(i), o = () => {
1473
- let o = bo.current, s = y.getState();
1474
- if (!Ge({
1475
- sessionLive: So.current(t),
1541
+ ]), Ao = Or({ perFileChars: aa }), jo = M(Ao);
1542
+ jo.current = Ao;
1543
+ let Mo = M(/* @__PURE__ */ new Set()), No = M(() => !1), Q = Xt({
1544
+ onSubmit: k((e, t, n, r) => {
1545
+ let i = fa.current, a = Qe(i), o = () => {
1546
+ let o = jo.current, s = y.getState();
1547
+ if (!Ke({
1548
+ sessionLive: No.current(t),
1476
1549
  boundAtSubmit: i,
1477
1550
  activeConversationId: s.activeConversationId,
1478
1551
  boundConversationExists: s.conversations.some((e) => e.id === a)
@@ -1480,11 +1553,11 @@ var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
1480
1553
  o.clear();
1481
1554
  return;
1482
1555
  }
1483
- let c = et(o.attachments), l = {
1556
+ let c = tt(o.attachments), l = {
1484
1557
  ...n,
1485
- handedOver: Mt()
1558
+ handedOver: Jt()
1486
1559
  };
1487
- oo.current(e, c, {
1560
+ vo.current(e, c, {
1488
1561
  fromPerson: !0,
1489
1562
  voiceSessionId: t,
1490
1563
  voiceTiming: l,
@@ -1493,410 +1566,410 @@ var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
1493
1566
  };
1494
1567
  if ((() => {
1495
1568
  let e = y.getState();
1496
- return Ge({
1497
- sessionLive: So.current(t),
1569
+ return Ke({
1570
+ sessionLive: No.current(t),
1498
1571
  boundAtSubmit: i,
1499
1572
  activeConversationId: e.activeConversationId,
1500
1573
  boundConversationExists: e.conversations.some((e) => e.id === a)
1501
1574
  });
1502
- })() && Ka.current(e, t)) {
1503
- oo.current(e, [], {
1575
+ })() && ro.current(e, t)) {
1576
+ vo.current(e, [], {
1504
1577
  fromPerson: !0,
1505
1578
  voiceSessionId: t,
1506
1579
  voiceTiming: {
1507
1580
  ...n,
1508
- handedOver: Mt()
1581
+ handedOver: Jt()
1509
1582
  }
1510
1583
  });
1511
1584
  return;
1512
1585
  }
1513
- if (!bo.current.isBusy) {
1586
+ if (!jo.current.isBusy) {
1514
1587
  o();
1515
1588
  return;
1516
1589
  }
1517
- let s = Date.now(), c = xo.current, l = window.setInterval(() => {
1518
- bo.current.isBusy && Date.now() - s < Fr || (window.clearInterval(l), c.delete(l), o());
1590
+ let s = Date.now(), c = Mo.current, l = window.setInterval(() => {
1591
+ jo.current.isBusy && Date.now() - s < Rr || (window.clearInterval(l), c.delete(l), o());
1519
1592
  }, 200);
1520
1593
  c.add(l);
1521
1594
  }, []),
1522
- latestReply: so,
1523
- language: Ve(Yr, V).tag,
1524
- graceMs: qr,
1525
- onSupersede: Aa,
1526
- handsFreeInterrupt: Jr,
1527
- onBargeIn: ka
1595
+ latestReply: yo,
1596
+ language: He($r, V).tag,
1597
+ graceMs: Zr,
1598
+ onSupersede: Fa,
1599
+ handsFreeInterrupt: Qr,
1600
+ onBargeIn: Pa
1528
1601
  });
1529
- So.current = Q.isCurrentSession;
1530
- let Co = ca ? Z.filter((e) => e.sessionId !== void 0 && Q.isCurrentSession(e.sessionId)) : Z, wo = Q.answerLocally;
1531
- j(() => {
1532
- Za.current = wo;
1533
- }, [wo]);
1534
- let $ = Q.active, To = kr(() => lt(Object.values(Di), H, Oi), [
1535
- Di,
1602
+ No.current = Q.isCurrentSession;
1603
+ let Po = pa ? Z.filter((e) => e.sessionId !== void 0 && Q.isCurrentSession(e.sessionId)) : Z, Fo = Q.answerLocally;
1604
+ A(() => {
1605
+ co.current = Fo;
1606
+ }, [Fo]);
1607
+ let $ = Q.active, Io = j(() => ut(Object.values(Mi), H, Ni), [
1608
+ Mi,
1536
1609
  H,
1537
- Oi
1538
- ]), [Eo, Do] = Ar(null);
1539
- j(() => {
1540
- $ || Do(null);
1610
+ Ni
1611
+ ]), [Lo, Ro] = Nr(null);
1612
+ A(() => {
1613
+ $ || Ro(null);
1541
1614
  }, [$]);
1542
- let Oo = ki.review, ko = A(() => {
1543
- let e = To[To.length - 1];
1615
+ let zo = Pi.review, Bo = k(() => {
1616
+ let e = Io[Io.length - 1];
1544
1617
  if (!e) return;
1545
1618
  let { view: t } = e;
1546
- if (Ht(t) && Vt(t, Ei[e.session.sandboxId]).offerConfirm) {
1547
- Oo(t);
1619
+ if (an(t) && rn(t, ji[e.session.sandboxId]).offerConfirm) {
1620
+ zo(t);
1548
1621
  return;
1549
1622
  }
1550
- Do(t.proposalId);
1623
+ Ro(t.proposalId);
1551
1624
  }, [
1552
- To,
1553
- Ei,
1554
- Oo
1555
- ]), Ao = $ ? ot(To) : null, jo = Eo ? Di[Eo] : void 0, Mo = $ && jo && jo.session.conversationId === H ? {
1556
- content: /* @__PURE__ */ N(Gt, {
1625
+ Io,
1626
+ ji,
1627
+ zo
1628
+ ]), Vo = $ ? st(Io) : null, Ho = Lo ? Mi[Lo] : void 0, Uo = $ && Ho && Ho.session.conversationId === H ? {
1629
+ content: /* @__PURE__ */ N(cn, {
1557
1630
  refs: [{
1558
- proposalId: jo.view.proposalId,
1559
- sandboxId: jo.session.sandboxId,
1560
- sessionId: jo.session.sessionId
1631
+ proposalId: Ho.view.proposalId,
1632
+ sandboxId: Ho.session.sandboxId,
1633
+ sessionId: Ho.session.sessionId
1561
1634
  }],
1562
- conversationId: jo.session.conversationId,
1563
- panel: q,
1564
- entries: Di,
1565
- capabilitiesOf: (e) => Ei[e],
1566
- turnInFlight: Ci,
1635
+ conversationId: Ho.session.conversationId,
1636
+ panel: K,
1637
+ entries: Mi,
1638
+ capabilitiesOf: (e) => ji[e],
1639
+ turnInFlight: Oi,
1567
1640
  tr: F,
1568
- onReview: Oo,
1569
- retiredSandboxes: Oi
1641
+ onReview: zo,
1642
+ retiredSandboxes: Ni
1570
1643
  }),
1571
- closeLabel: ut(F, it.trayClose),
1572
- onClose: () => Do(null)
1573
- } : null, No = ki.asking, Po = Ja?.asking === !0, Fo = Ya?.asking === !0, Io = Q.holdListening;
1574
- r("assistant.transcript", kr(() => $ ? null : { run: () => aa ? { status: "already" } : (oa(!0), { status: "done" }) }, [
1644
+ closeLabel: dt(F, at.trayClose),
1645
+ onClose: () => Ro(null)
1646
+ } : null, Wo = Pi.asking, Go = ao?.asking === !0, Ko = oo?.asking === !0, qo = Q.holdListening;
1647
+ r("assistant.transcript", j(() => $ ? null : { run: () => ua ? { status: "already" } : (da(!0), { status: "done" }) }, [
1575
1648
  $,
1576
- aa,
1577
- oa
1578
- ])), r("assistant.conversation.new", kr(() => $ ? null : { run: () => {
1649
+ ua,
1650
+ da
1651
+ ])), r("assistant.conversation.new", j(() => $ ? null : { run: () => {
1579
1652
  let e = y.getState(), t = e.conversations.find((t) => t.id === e.activeConversationId);
1580
1653
  return t && t.messages.length === 0 ? { status: "already" } : (e.createConversation(), { status: "done" });
1581
- } }, [$])), j(() => {
1582
- Io($ && (No || Po || Fo));
1654
+ } }, [$])), A(() => {
1655
+ qo($ && (Wo || Go || Ko));
1583
1656
  }, [
1584
1657
  $,
1585
- No,
1586
- Po,
1587
- Fo,
1588
- Io
1658
+ Wo,
1659
+ Go,
1660
+ Ko,
1661
+ qo
1589
1662
  ]);
1590
- let Lo = M(null), Ro = Q.announce;
1591
- j(() => {
1663
+ let Jo = M(null), Yo = Q.announce;
1664
+ A(() => {
1592
1665
  if (!$) {
1593
- Lo.current = null;
1666
+ Jo.current = null;
1594
1667
  return;
1595
1668
  }
1596
- let e = Lo.current;
1669
+ let e = Jo.current;
1597
1670
  if (e === null) {
1598
- Lo.current = new Set(Object.keys(Di));
1671
+ Jo.current = new Set(Object.keys(Mi));
1599
1672
  return;
1600
1673
  }
1601
- for (let { view: t, session: n } of ct(To, e)) {
1674
+ for (let { view: t, session: n } of lt(Io, e)) {
1602
1675
  e.add(t.proposalId);
1603
- let r = Ei[n.sandboxId];
1604
- if (!at({
1676
+ let r = ji[n.sandboxId];
1677
+ if (!ot({
1605
1678
  mode: "api-calls",
1606
1679
  productWriteApproval: R,
1607
1680
  capabilities: r
1608
1681
  })) continue;
1609
- let i = dt(t, Vt(t, r).offerConfirm, F), a = t.proposalId;
1610
- Ro({
1682
+ let i = ft(t, rn(t, r).offerConfirm, F), a = t.proposalId;
1683
+ Yo({
1611
1684
  id: `write-readback:${a}`,
1612
1685
  text: i.text,
1613
1686
  lang: i.translated ? V : "en",
1614
- stillWanted: () => q.entry(a)?.view.status === "pending"
1687
+ stillWanted: () => K.entry(a)?.view.status === "pending"
1615
1688
  });
1616
1689
  }
1617
1690
  }, [
1618
1691
  $,
1619
- To,
1620
- Di,
1621
- Ei,
1692
+ Io,
1693
+ Mi,
1694
+ ji,
1622
1695
  R,
1623
1696
  F,
1624
1697
  V,
1625
- Ro,
1626
- q
1698
+ Yo,
1699
+ K
1627
1700
  ]);
1628
- let zo = M(!1);
1629
- j(() => {
1630
- zo.current = Q.active;
1631
- }, [Q.active]), j(() => m((e) => {
1632
- if (!zo.current) return !1;
1633
- let t = sa.current;
1701
+ let Xo = M(!1);
1702
+ A(() => {
1703
+ Xo.current = Q.active;
1704
+ }, [Q.active]), A(() => m((e) => {
1705
+ if (!Xo.current) return !1;
1706
+ let t = fa.current;
1634
1707
  return typeof t == "string" ? t === e : y.getState().activeConversationId === e;
1635
1708
  }), []);
1636
- let Bo = Q.start, Vo = A(() => {
1637
- let e = y.getState().activeConversationId, t = Je(da());
1638
- ua(Xe(t, e)), xa(!0, t.kind === "own"), Bo();
1709
+ let Zo = Q.start, Qo = k(() => {
1710
+ let e = y.getState().activeConversationId, t = Ye(ga());
1711
+ ha(Ze(t, e)), Ea(!0, t.kind === "own"), Zo();
1639
1712
  }, [
1640
- ua,
1641
- xa,
1642
- da,
1643
- Bo
1644
- ]), Ho = kr(() => Dt(bi?.messages ?? []), [bi?.messages]), Uo = Et(xi.voice, K, F), Wo = Et(Ho, K, F) > 0, Go = A(() => {
1713
+ ha,
1714
+ Ea,
1715
+ ga,
1716
+ Zo
1717
+ ]), $o = j(() => Ut(Ti?.messages ?? []), [Ti?.messages]), es = Ht(Ei.voice, G, F), ts = Ht($o, G, F) > 0, ns = k(() => {
1645
1718
  let e = y.getState().activeConversationId;
1646
1719
  if (!e || Z.length === 0) return;
1647
- let t = new Set(Ho.map((e) => e.id)), n = P();
1648
- G(e, {
1720
+ let t = new Set($o.map((e) => e.id)), n = P();
1721
+ W(e, {
1649
1722
  id: n,
1650
1723
  role: "system",
1651
- content: Le(Z.filter((e) => t.has(e.id)), {
1724
+ content: Re(Z.filter((e) => t.has(e.id)), {
1652
1725
  intro: F("voiceSession.continuedIntro", "Continued from a voice conversation. You asked about:"),
1653
1726
  nothing: F("voiceSession.continuedNothing", "Continued from a voice conversation."),
1654
1727
  more: (e) => F("voiceSession.continuedMore", "…and {{count}} more", { count: e })
1655
1728
  }),
1656
1729
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
1657
- metadata: { continuedVoiceTurns: Uo }
1658
- }), dn.recordCommittedEntries(e, [n], "NOTE", k()), oa(!1), Q.end();
1730
+ metadata: { continuedVoiceTurns: es }
1731
+ }), Dn.recordCommittedEntries(e, [n], "NOTE", O()), da(!1), Q.end();
1659
1732
  }, [
1660
1733
  Z,
1661
- Uo,
1662
- Ho,
1663
- G,
1734
+ es,
1735
+ $o,
1736
+ W,
1664
1737
  F,
1665
1738
  Q,
1666
- oa
1667
- ]), Ko = M({
1739
+ da
1740
+ ]), rs = M({
1668
1741
  conversationId: null,
1669
1742
  count: 0
1670
1743
  });
1671
- j(() => {
1672
- Q.active && (Ko.current = {
1744
+ A(() => {
1745
+ Q.active && (rs.current = {
1673
1746
  conversationId: H,
1674
- count: Uo
1747
+ count: es
1675
1748
  });
1676
1749
  }, [Q.active]);
1677
- let qo = A(() => {
1678
- let e = Ko.current, t = Uo > (e.conversationId === H ? e.count : 0);
1679
- Q.end(), t && oa(!0);
1750
+ let is = k(() => {
1751
+ let e = rs.current, t = es > (e.conversationId === H ? e.count : 0);
1752
+ Q.end(), t && da(!0);
1680
1753
  }, [
1681
1754
  H,
1682
- Uo,
1755
+ es,
1683
1756
  Q,
1684
- oa
1757
+ da
1685
1758
  ]);
1686
- j(() => {
1687
- (!Rr || !_a) && Q.active && Q.end();
1759
+ A(() => {
1760
+ (!Vr || !Sa) && Q.active && Q.end();
1688
1761
  }, [
1689
- Rr,
1690
- _a,
1762
+ Vr,
1763
+ Sa,
1691
1764
  Q
1692
- ]), j(() => {
1693
- let e = sa.current, t = Ze(e), n = y.getState(), r = qe({
1765
+ ]), A(() => {
1766
+ let e = fa.current, t = Qe(e), n = y.getState(), r = Je({
1694
1767
  sessionLive: Q.active,
1695
1768
  bound: e,
1696
1769
  activeConversationId: n.activeConversationId,
1697
1770
  boundConversationExists: n.conversations.some((e) => e.id === t)
1698
1771
  });
1699
- ua(r.bound), r.end && Q.end();
1772
+ ha(r.bound), r.end && Q.end();
1700
1773
  }, [
1701
1774
  Q,
1702
1775
  H,
1703
- ti,
1704
- ua
1776
+ ai,
1777
+ ha
1705
1778
  ]);
1706
- let Jo = M(Ue);
1707
- j(() => {
1708
- let e = Ke(Jo.current, {
1779
+ let as = M(We);
1780
+ A(() => {
1781
+ let e = qe(as.current, {
1709
1782
  activeConversationId: H,
1710
- chatTurnCount: lo.length,
1783
+ chatTurnCount: xo.length,
1711
1784
  voiceTurnCount: Z.length,
1712
1785
  sessionLive: Q.active,
1713
- sessionBoundTo: sa.current,
1714
- turnInFlight: Ci
1786
+ sessionBoundTo: fa.current,
1787
+ turnInFlight: Oi
1715
1788
  });
1716
- Jo.current = e.state, e.open && oa(!0);
1789
+ as.current = e.state, e.open && da(!0);
1717
1790
  }, [
1718
1791
  H,
1719
- lo.length,
1792
+ xo.length,
1720
1793
  Z.length,
1721
1794
  Q.active,
1722
- Ci,
1723
- oa
1724
- ]), j(() => {
1795
+ Oi,
1796
+ da
1797
+ ]), A(() => {
1725
1798
  if (!Q.active) {
1726
- bo.current.clear(), Da.current = null;
1727
- for (let e of xo.current) window.clearInterval(e);
1728
- xo.current.clear();
1799
+ jo.current.clear(), Ma.current = null;
1800
+ for (let e of Mo.current) window.clearInterval(e);
1801
+ Mo.current.clear();
1729
1802
  }
1730
- }, [Q.active]), j(() => {
1731
- let e = xo.current;
1803
+ }, [Q.active]), A(() => {
1804
+ let e = Mo.current;
1732
1805
  return () => {
1733
1806
  for (let t of e) window.clearInterval(t);
1734
1807
  e.clear();
1735
1808
  };
1736
- }, []), j(() => {
1809
+ }, []), A(() => {
1737
1810
  let e = y.getState().consumePendingPrompt();
1738
- return e && oo.current(e), y.subscribe((e, t) => {
1811
+ return e && vo.current(e), y.subscribe((e, t) => {
1739
1812
  if (e.pendingPrompt && e.pendingPrompt !== t.pendingPrompt) {
1740
1813
  let e = y.getState().consumePendingPrompt();
1741
- e && oo.current(e);
1814
+ e && vo.current(e);
1742
1815
  }
1743
1816
  });
1744
1817
  }, []);
1745
- let Yo = A((e) => {
1818
+ let os = k((e) => {
1746
1819
  let t = H ? y.getState().conversations.find((e) => e.id === H) : void 0;
1747
- if (t && t.mode !== e && q.withdraw(t.id, "mode_switched"), t && on(t)) {
1820
+ if (t && t.mode !== e && K.withdraw(t.id, "mode_switched"), t && Sn(t)) {
1748
1821
  if (t.mode !== e) {
1749
- let t = ee(), n = y.getState().conversations.find((n) => n.mode === e && ln(n, t) && !y.getState().processingByConversationId[n.id]);
1750
- n ? ai(n.id) : W(void 0, e);
1822
+ let t = ee(), n = y.getState().conversations.find((n) => n.mode === e && Tn(n, t) && !y.getState().processingByConversationId[n.id]);
1823
+ n ? li(n.id) : ui(void 0, e);
1751
1824
  }
1752
- } else H && ii(H, e);
1825
+ } else H && ci(H, e);
1753
1826
  let n = y.getState().activeConversationId;
1754
- n ? ii(n, e) : vi(!1), ri(e);
1827
+ n ? ci(n, e) : Ci(!1), si(e);
1755
1828
  }, [
1756
1829
  H,
1757
- W,
1758
- ai,
1759
- vi,
1760
- ii,
1761
- ri,
1762
- q
1763
- ]), Xo = A(() => {
1830
+ ui,
1831
+ li,
1832
+ Ci,
1833
+ ci,
1834
+ si,
1835
+ K
1836
+ ]), ss = k(() => {
1764
1837
  let e = y.getState(), t = e.activeConversationId ? e.conversations.find((t) => t.id === e.activeConversationId) : void 0;
1765
1838
  if (!t) {
1766
- vi(!0), ri(c);
1839
+ Ci(!0), si(c);
1767
1840
  return;
1768
1841
  }
1769
1842
  if (t.routedBy === "auto") {
1770
- vi(!0);
1843
+ Ci(!0);
1771
1844
  return;
1772
1845
  }
1773
- if (!on(t)) {
1774
- yi(t.id, c);
1846
+ if (!Sn(t)) {
1847
+ wi(t.id, c);
1775
1848
  return;
1776
1849
  }
1777
- q.withdraw(t.id, "mode_switched");
1778
- let n = ee(), r = e.conversations.find((t) => t.routedBy === "auto" && ln(t, n) && !e.processingByConversationId[t.id]);
1779
- r ? (ai(r.id), yi(r.id, c)) : W(void 0, c, { routedBy: "auto" });
1850
+ K.withdraw(t.id, "mode_switched");
1851
+ let n = ee(), r = e.conversations.find((t) => t.routedBy === "auto" && Tn(t, n) && !e.processingByConversationId[t.id]);
1852
+ r ? (li(r.id), wi(r.id, c)) : ui(void 0, c, { routedBy: "auto" });
1780
1853
  }, [
1781
- W,
1782
- yi,
1783
- ai,
1784
- vi,
1785
- ri,
1786
- q
1787
- ]), Zo = A((e) => {
1854
+ ui,
1855
+ wi,
1856
+ li,
1857
+ Ci,
1858
+ si,
1859
+ K
1860
+ ]), cs = k((e) => {
1788
1861
  if (L.find((t) => t.id === e)?.writeCapable && !ae(y.getState().acknowledgedWriteModes, e)) {
1789
- na(e);
1862
+ sa(e);
1790
1863
  return;
1791
1864
  }
1792
- Yo(e);
1793
- }, [Yo, L]), Qo = A(() => {
1794
- let e = ta;
1795
- if (na(null), !e) return;
1796
- let t = Qi.current;
1797
- if (Qi.current = null, t) {
1798
- gi(e), X(t.content, t.attachments, t.options);
1865
+ os(e);
1866
+ }, [os, L]), ls = k(() => {
1867
+ let e = oa;
1868
+ if (sa(null), !e) return;
1869
+ let t = ra.current;
1870
+ if (ra.current = null, t) {
1871
+ xi(e), X(t.content, t.attachments, t.options);
1799
1872
  return;
1800
1873
  }
1801
- gi(e), Yo(e);
1874
+ xi(e), os(e);
1802
1875
  }, [
1803
- ta,
1804
- gi,
1805
- Yo,
1876
+ oa,
1877
+ xi,
1878
+ os,
1806
1879
  X
1807
- ]), $o = ta === null ? void 0 : L.find((e) => e.id === ta) ?? { id: ta }, es = A(() => {
1808
- na(null);
1809
- let e = Qi.current;
1810
- Qi.current = null, e && X(e.content, e.attachments, {
1880
+ ]), us = oa === null ? void 0 : L.find((e) => e.id === oa) ?? { id: oa }, ds = k(() => {
1881
+ sa(null);
1882
+ let e = ra.current;
1883
+ ra.current = null, e && X(e.content, e.attachments, {
1811
1884
  ...e.options,
1812
1885
  autoIntent: "read"
1813
1886
  });
1814
1887
  }, [X]);
1815
- return /* @__PURE__ */ Mr("div", {
1888
+ return /* @__PURE__ */ Fr("div", {
1816
1889
  className: "relative flex flex-1 flex-col overflow-hidden",
1817
1890
  children: [
1818
- /* @__PURE__ */ Mr("div", {
1891
+ /* @__PURE__ */ Fr("div", {
1819
1892
  className: "contents",
1820
1893
  inert: Q.active || void 0,
1821
1894
  children: [
1822
- zi === null ? null : /* @__PURE__ */ N($t, { onDismiss: () => Ri(zi) }),
1823
- Z.length > 0 && !Q.active ? /* @__PURE__ */ N(Zt, {
1895
+ Wi === null ? null : /* @__PURE__ */ N(gn, { onDismiss: () => Ui(Wi) }),
1896
+ Z.length > 0 && !Q.active ? /* @__PURE__ */ N(mn, {
1824
1897
  count: Z.length,
1825
- onOpenTranscript: () => oa(!0)
1898
+ onOpenTranscript: () => da(!0)
1826
1899
  }) : null,
1827
- lo.length === 0 && (Pi || Fi) ? /* @__PURE__ */ N(en, {
1828
- state: Pi ? "loading" : "failed",
1829
- onRetry: Wi
1830
- }) : lo.length === 0 && bi?.sync?.hasOlder ? /* @__PURE__ */ N("div", {
1900
+ xo.length === 0 && (zi || Bi) ? /* @__PURE__ */ N(_n, {
1901
+ state: zi ? "loading" : "failed",
1902
+ onRetry: Yi
1903
+ }) : xo.length === 0 && Ti?.sync?.hasOlder ? /* @__PURE__ */ N("div", {
1831
1904
  className: "flex min-h-0 flex-1 flex-col",
1832
- children: /* @__PURE__ */ N(nn, {
1833
- onShowEarlier: Gi,
1834
- disabled: Pi
1905
+ children: /* @__PURE__ */ N(yn, {
1906
+ onShowEarlier: Xi,
1907
+ disabled: zi
1835
1908
  })
1836
- }) : lo.length === 0 ? /* @__PURE__ */ N(fn, {
1909
+ }) : xo.length === 0 ? /* @__PURE__ */ N(On, {
1837
1910
  mode: U,
1838
- onSuggestionClick: io,
1839
- explainsAuto: Xi,
1840
- suggestions: Xi && U === "assistant" ? l(L.find((e) => e.id === "assistant")?.suggestions ?? [], L.find((e) => e.id === "api-calls")?.suggestions ?? []) : void 0
1841
- }) : /* @__PURE__ */ Mr("div", {
1911
+ onSuggestionClick: go,
1912
+ explainsAuto: ta,
1913
+ suggestions: ta && U === "assistant" ? l(L.find((e) => e.id === "assistant")?.suggestions ?? [], L.find((e) => e.id === "api-calls")?.suggestions ?? []) : void 0
1914
+ }) : /* @__PURE__ */ Fr("div", {
1842
1915
  className: "flex min-h-0 flex-1 flex-col",
1843
- children: [bi?.sync?.hasOlder ? /* @__PURE__ */ N(nn, {
1844
- onShowEarlier: Gi,
1845
- disabled: Pi
1846
- }) : null, /* @__PURE__ */ N(Pn, {
1847
- onApprovePendingWrite: ja,
1848
- approvingWriteRef: Ca,
1849
- approvableMessageId: fo?.messageId ?? null,
1850
- retryableMessageId: po,
1851
- messages: lo,
1852
- processing: K ?? null,
1853
- streamingMessageId: wi,
1854
- failedMessageId: Ti,
1855
- onRetry: Ca === null ? ao : void 0,
1856
- renderWriteProposals: ho,
1857
- hidesLegacyWriteCard: mo
1916
+ children: [Ti?.sync?.hasOlder ? /* @__PURE__ */ N(yn, {
1917
+ onShowEarlier: Xi,
1918
+ disabled: zi
1919
+ }) : null, /* @__PURE__ */ N(Rn, {
1920
+ onApprovePendingWrite: Ia,
1921
+ approvingWriteRef: Oa,
1922
+ approvableMessageId: Co?.messageId ?? null,
1923
+ retryableMessageId: wo,
1924
+ messages: xo,
1925
+ processing: G ?? null,
1926
+ streamingMessageId: ki,
1927
+ failedMessageId: Ai,
1928
+ onRetry: Oa === null ? _o : void 0,
1929
+ renderWriteProposals: Eo,
1930
+ hidesLegacyWriteCard: To
1858
1931
  })]
1859
1932
  }),
1860
- Mi ? /* @__PURE__ */ N(tn, { onStartNew: () => W() }) : null,
1861
- Ni && H ? /* @__PURE__ */ N(Qt, { onUnarchive: () => dn.updateConversation(H, { archived: !1 }) }) : null,
1862
- Qa === null ? null : /* @__PURE__ */ N(pn, {
1933
+ Li ? /* @__PURE__ */ N(vn, { onStartNew: () => ui() }) : null,
1934
+ Ri && H ? /* @__PURE__ */ N(hn, { onUnarchive: () => Dn.updateConversation(H, { archived: !1 }) }) : null,
1935
+ lo === null ? null : /* @__PURE__ */ N(kn, {
1863
1936
  tr: F,
1864
- onDismiss: () => $a(null)
1937
+ onDismiss: () => uo(null)
1865
1938
  }),
1866
- lo.length > 0 && (Pi || Fi) ? /* @__PURE__ */ N(en, {
1867
- state: Pi ? "loading" : "failed",
1868
- onRetry: Wi,
1939
+ xo.length > 0 && (zi || Bi) ? /* @__PURE__ */ N(_n, {
1940
+ state: zi ? "loading" : "failed",
1941
+ onRetry: Yi,
1869
1942
  compact: !0
1870
1943
  }) : null,
1871
- /* @__PURE__ */ N(Tr, {
1872
- onStartVoiceSession: Q.available && _a ? Vo : void 0,
1944
+ /* @__PURE__ */ N(kr, {
1945
+ onStartVoiceSession: Q.available && Sa ? Qo : void 0,
1873
1946
  onSend: (e, t) => void X(e, t, { fromPerson: !0 }),
1874
- onDraftStart: Sa,
1875
- disabled: Ci || Ca !== null || Pi || Va,
1876
- readOnly: Mi,
1947
+ onDraftStart: Da,
1948
+ disabled: Oi || Oa !== null || zi || Qa,
1949
+ readOnly: Li,
1877
1950
  placeholder: U === "api-calls" ? F("chatArea.placeholderActions", "What would you like me to do?") : F("chatArea.placeholderGeneral", "Ask me anything…"),
1878
1951
  mode: U,
1879
- writeAccessDenied: zr === "denied" && !!ma?.writeCapable,
1880
- availableModes: Ji,
1881
- attachmentCharsPerFile: ea,
1882
- onModeChange: Zo,
1883
- auto: Yi ? {
1884
- active: Xi,
1885
- onSelect: Xo
1952
+ writeAccessDenied: Hr === "denied" && !!ya?.writeCapable,
1953
+ availableModes: $i,
1954
+ attachmentCharsPerFile: aa,
1955
+ onModeChange: cs,
1956
+ auto: ea ? {
1957
+ active: ta,
1958
+ onSelect: ss
1886
1959
  } : void 0
1887
1960
  })
1888
1961
  ]
1889
1962
  }),
1890
- aa && !Q.active ? /* @__PURE__ */ N(rn, {
1963
+ ua && !Q.active ? /* @__PURE__ */ N(bn, {
1891
1964
  turns: Z,
1892
- onClose: () => oa(!1),
1893
- onSave: vo,
1894
- onContinueInChat: Wo ? Go : void 0,
1965
+ onClose: () => da(!1),
1966
+ onSave: ko,
1967
+ onContinueInChat: ts ? ns : void 0,
1895
1968
  closeOnEscape: !0,
1896
- onShowEarlier: bi?.sync?.hasOlder ? Gi : void 0,
1897
- showEarlierDisabled: Pi
1969
+ onShowEarlier: Ti?.sync?.hasOlder ? Xi : void 0,
1970
+ showEarlierDisabled: zi
1898
1971
  }) : null,
1899
- Q.active && /* @__PURE__ */ N(Fn, {
1972
+ Q.active && /* @__PURE__ */ N(zn, {
1900
1973
  session: Q.session,
1901
1974
  notice: Q.notice,
1902
1975
  capturing: Q.capturing,
@@ -1906,46 +1979,46 @@ var Rr = ({ visible: Rr = !0, writeAccess: zr = "unknown" }) => {
1906
1979
  correcting: Q.correcting,
1907
1980
  onLetMeFinish: Q.letMeFinish,
1908
1981
  onImDone: Q.imDone,
1909
- turns: Co,
1982
+ turns: Po,
1910
1983
  spokenChunks: Q.spokenChunks,
1911
- attachments: yo.attachments,
1912
- onAttachFiles: yo.addFiles,
1913
- onRemoveAttachment: yo.remove,
1914
- onRetryAttachment: yo.retry,
1915
- canAttachMore: yo.canAddMore,
1916
- preparingAttachments: yo.preparingCount,
1917
- onSaveTranscript: vo,
1918
- onContinueInChat: Go,
1984
+ attachments: Ao.attachments,
1985
+ onAttachFiles: Ao.addFiles,
1986
+ onRemoveAttachment: Ao.remove,
1987
+ onRetryAttachment: Ao.retry,
1988
+ canAttachMore: Ao.canAddMore,
1989
+ preparingAttachments: Ao.preparingCount,
1990
+ onSaveTranscript: ko,
1991
+ onContinueInChat: ns,
1919
1992
  onInterrupt: () => {
1920
- Q.interrupt(), ka();
1993
+ Q.interrupt(), Pa();
1921
1994
  },
1922
- spoken: co,
1995
+ spoken: bo,
1923
1996
  onToggleMute: Q.toggleMute,
1924
- onEnd: qo,
1925
- proposalChip: Ao ? {
1926
- label: st(Ao, F),
1927
- onOpen: ko
1997
+ onEnd: is,
1998
+ proposalChip: Vo ? {
1999
+ label: ct(Vo, F),
2000
+ onOpen: Bo
1928
2001
  } : null,
1929
- proposalTray: Mo
2002
+ proposalTray: Uo
1930
2003
  }),
1931
- /* @__PURE__ */ N(Dr, {
1932
- open: ta !== null,
1933
- mode: $o,
1934
- currentMode: ma ?? { id: U },
1935
- onConfirm: Qo,
1936
- onCancel: es
2004
+ /* @__PURE__ */ N(jr, {
2005
+ open: oa !== null,
2006
+ mode: us,
2007
+ currentMode: ya ?? { id: U },
2008
+ onConfirm: ls,
2009
+ onCancel: ds
1937
2010
  }),
1938
- /* @__PURE__ */ N(Ut, {
1939
- ...ki.dialog,
1940
- view: go?.view ?? ki.dialog.view,
1941
- serverNow: go?.serverNow ?? NaN,
1942
- arrivedAt: go?.arrivedAt ?? NaN,
1943
- capabilities: go ? Ei[go.session.sandboxId] : null,
1944
- turnInFlight: Ci,
2011
+ /* @__PURE__ */ N(on, {
2012
+ ...Pi.dialog,
2013
+ view: Do?.view ?? Pi.dialog.view,
2014
+ serverNow: Do?.serverNow ?? NaN,
2015
+ arrivedAt: Do?.arrivedAt ?? NaN,
2016
+ capabilities: Do ? ji[Do.session.sandboxId] : null,
2017
+ turnInFlight: Oi,
1945
2018
  tr: F
1946
2019
  })
1947
2020
  ]
1948
2021
  });
1949
2022
  };
1950
2023
  //#endregion
1951
- export { Rr as AssistantChatArea };
2024
+ export { Vr as AssistantChatArea };