@burdenoff/fe-libs 2026.1005.1 → 2026.1005.3

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