@burdenoff/fe-libs 2026.1117.3 → 2026.1117.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shared/assistant/i18nManifest.d.ts +21 -1
- package/dist/shared/assistant/i18nManifest.js +22 -2
- package/dist/shared/assistant/index.d.ts +8 -0
- package/dist/shared/assistant/ui/AIAssistantPanel.js +195 -194
- package/dist/shared/assistant/ui/AssistantChatArea.js +1339 -1332
- package/dist/shared/assistant/ui/compact/AssistantLanguagePill.d.ts +12 -0
- package/dist/shared/assistant/ui/compact/AssistantLanguagePill.js +13 -14
- package/dist/shared/assistant/ui/compact/AssistantWindowHeader.d.ts +8 -2
- package/dist/shared/assistant/ui/compact/AssistantWindowHeader.js +45 -39
- package/dist/shared/assistant/ui/compact/AssistantWindowWelcome.d.ts +44 -0
- package/dist/shared/assistant/ui/compact/AssistantWindowWelcome.js +110 -0
- package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeCard.d.ts +29 -0
- package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeCard.js +84 -0
- package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeHero.d.ts +15 -0
- package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeHero.js +64 -0
- package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeSuggestions.d.ts +12 -0
- package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeSuggestions.js +31 -0
- package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeTips.d.ts +9 -0
- package/dist/shared/assistant/ui/compact/AssistantWindowWelcomeTips.js +37 -0
- package/dist/shared/assistant/ui/compact/windowTitle.d.ts +15 -0
- package/dist/shared/assistant/ui/compact/windowTitle.js +13 -0
- package/dist/shared/assistant/ui/compact/windowWelcome.d.ts +136 -0
- package/dist/shared/assistant/ui/compact/windowWelcome.js +119 -0
- package/dist/shared/assistant/ui/compact/windowWelcomeHooks.d.ts +49 -0
- package/dist/shared/assistant/ui/compact/windowWelcomeHooks.js +70 -0
- package/dist/shared/assistant/ui/composer/AssistantConnectSourceItem.d.ts +3 -1
- package/dist/shared/assistant/ui/composer/AssistantConnectSourceItem.js +27 -26
- package/dist/shared/assistant/ui/useVoiceSession.js +312 -301
- package/dist/shared/assistant/voice/handsFree.d.ts +16 -0
- package/dist/shared/assistant/voice/handsFree.js +2 -2
- package/dist/shared/assistant/voice/handsfree/audioTrackTransport.js +1 -0
- package/dist/shared/assistant/voice/handsfree/backendStreamTransport.d.ts +11 -0
- package/dist/shared/assistant/voice/handsfree/backendStreamTransport.js +118 -63
- package/dist/shared/assistant/voice/handsfree/bargeIn.d.ts +20 -1
- package/dist/shared/assistant/voice/handsfree/bargeIn.js +3 -3
- package/dist/shared/assistant/voice/handsfree/handsFreeController.d.ts +10 -1
- package/dist/shared/assistant/voice/handsfree/handsFreeController.js +103 -83
- package/dist/shared/assistant/voice/handsfree/sttTransport.d.ts +20 -0
- package/dist/shared/assistant/voice/handsfree/useHandsFreeInterrupt.d.ts +8 -0
- package/dist/shared/assistant/voice/handsfree/useHandsFreeInterrupt.js +31 -26
- package/dist/shared/assistant/voice/handsfree/webSpeechTransport.js +1 -0
- package/dist/shared-assistant.js +399 -391
- package/package.json +2 -1
- package/src/shared/tokens/tokens.css +523 -0
|
@@ -20,320 +20,321 @@ import { planWriteReply as se, promptWriteApproval as ce } from "../writeReplySe
|
|
|
20
20
|
import { isAssistantModeId as y } from "../modeIds.js";
|
|
21
21
|
import { AUTO_READ_MODE as b, autoSuggestions as le, classifyAssistantIntent as ue, escalationToUndo as de, isAutoRoutingOffered as fe, resolveAutoRoute as pe } from "../autoRouting.js";
|
|
22
22
|
import { AssistantEmptyState as me } from "./AssistantEmptyState.js";
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
92
|
-
import {
|
|
93
|
-
import {
|
|
94
|
-
import {
|
|
95
|
-
import {
|
|
96
|
-
import {
|
|
97
|
-
import {
|
|
98
|
-
import {
|
|
99
|
-
import {
|
|
100
|
-
import {
|
|
101
|
-
import {
|
|
102
|
-
import {
|
|
103
|
-
import {
|
|
104
|
-
import {
|
|
105
|
-
import {
|
|
106
|
-
import {
|
|
107
|
-
import {
|
|
108
|
-
import {
|
|
109
|
-
import {
|
|
110
|
-
import {
|
|
111
|
-
import {
|
|
112
|
-
import {
|
|
113
|
-
import {
|
|
114
|
-
import {
|
|
115
|
-
import {
|
|
116
|
-
import {
|
|
117
|
-
import {
|
|
118
|
-
import {
|
|
119
|
-
import {
|
|
120
|
-
import {
|
|
121
|
-
import {
|
|
122
|
-
import {
|
|
123
|
-
import {
|
|
124
|
-
import {
|
|
125
|
-
import {
|
|
126
|
-
import {
|
|
127
|
-
import {
|
|
128
|
-
import {
|
|
129
|
-
import {
|
|
130
|
-
import {
|
|
131
|
-
import {
|
|
132
|
-
import {
|
|
133
|
-
import {
|
|
134
|
-
import {
|
|
135
|
-
import {
|
|
136
|
-
import {
|
|
137
|
-
import {
|
|
138
|
-
import {
|
|
139
|
-
import {
|
|
140
|
-
import {
|
|
141
|
-
import {
|
|
142
|
-
import {
|
|
143
|
-
import {
|
|
144
|
-
import {
|
|
145
|
-
import {
|
|
146
|
-
import {
|
|
147
|
-
import {
|
|
148
|
-
import {
|
|
149
|
-
import {
|
|
150
|
-
import {
|
|
23
|
+
import { AssistantWindowWelcome as he } from "./compact/AssistantWindowWelcome.js";
|
|
24
|
+
import { AssistantSpokenTurnsNotice as x } from "./AssistantSpokenTurnsNotice.js";
|
|
25
|
+
import { AssistantHistoryArchivedNotice as ge, AssistantHistoryDeletedNotice as _e, AssistantHistoryLoadState as ve, AssistantHistoryPinLimitBanner as S, AssistantHistoryReadOnlyBanner as ye, AssistantHistoryShowEarlier as be } from "./AssistantHistoryNotices.js";
|
|
26
|
+
import { useAssistantPageChatManaged as xe } from "./assistantPageBar.js";
|
|
27
|
+
import { AssistantNothingToDeleteNotice as Se } from "./AssistantDeleteConversationDialog.js";
|
|
28
|
+
import { useConversationDeleteDialog as Ce } from "./conversationDeleteDialog.js";
|
|
29
|
+
import { assistantHistoryIsOn as we } from "./conversationDelete.js";
|
|
30
|
+
import { VoiceTranscriptDrawer as Te } from "./voice/VoiceTranscriptDrawer.js";
|
|
31
|
+
import { AssistantComposer as Ee } from "./composer/AssistantComposer.js";
|
|
32
|
+
import { assistantModeOptionName as De } from "./composer/AssistantModeMenu.js";
|
|
33
|
+
import { draftIsUnsent as Oe } from "./compact/compactChrome.js";
|
|
34
|
+
import { AssistantWaitingChangeRow as ke } from "./compact/AssistantWaitingChangeRow.js";
|
|
35
|
+
import { voiceStartedCueShows as Ae } from "../voice/voiceStartedCue.js";
|
|
36
|
+
import { countWaitingChanges as je, focusFirstWaitingCard as Me } from "./compact/waitingChange.js";
|
|
37
|
+
import { planModeSwitch as Ne } from "./composer/modeSwitchPlan.js";
|
|
38
|
+
import { AssistantAiDisclaimer as Pe } from "./AssistantAiDisclaimer.js";
|
|
39
|
+
import { AssistantCompactFooter as Fe } from "./composer/AssistantCompactFooter.js";
|
|
40
|
+
import { AiCreditBalance as Ie } from "./AiCreditBalance.js";
|
|
41
|
+
import { AssistantVoiceSession as Le } from "./voice/AssistantVoiceSession.js";
|
|
42
|
+
import { AssistantAvatarTab as Re } from "./avatar/AssistantAvatarTab.js";
|
|
43
|
+
import { AssistantCompactAvatar as ze } from "./avatar/AssistantCompactAvatar.js";
|
|
44
|
+
import { AssistantViewSwitch as Be } from "./compact/AssistantViewSwitch.js";
|
|
45
|
+
import { AssistantViewSwitchDock as Ve } from "./compact/AssistantViewSwitchDock.js";
|
|
46
|
+
import { useAssistantPageLayout as He } from "./assistantPageLayout.js";
|
|
47
|
+
import { assistantPageStartShows as Ue, setAssistantPageStartSlot as We, useAssistantPageStartOffered as Ge } from "./assistantPageStart.js";
|
|
48
|
+
import { useLiveAvatarTab as Ke, useLiveAvatarTabSeam as C } from "./assistantLiveAvatarSeam.js";
|
|
49
|
+
import { useAvatarCopy as qe } from "../avatar/useAvatarCopy.js";
|
|
50
|
+
import { voiceStartBlocker as Je, voiceStartBlockerLasts as Ye } from "./voice/voiceStartGate.js";
|
|
51
|
+
import { avatarAskBlocker as Xe, avatarAskWrites as Ze, avatarTabAskLine as Qe } from "./avatar/avatarAskGate.js";
|
|
52
|
+
import { createAvatarTabDraft as $e } from "./avatar/avatarTabDraft.js";
|
|
53
|
+
import { parseToolActivity as et } from "./AssistantToolActivity.js";
|
|
54
|
+
import { useVoiceSession as tt } from "./useVoiceSession.js";
|
|
55
|
+
import { useAssistantApiAccess as nt } from "../useAssistantApiAccess.js";
|
|
56
|
+
import { useAssistantAttachments as rt } from "../useAssistantAttachments.js";
|
|
57
|
+
import { useAttachmentUrlResolver as it } from "../useAttachmentCommitter.js";
|
|
58
|
+
import { VOICE_COMMIT_BUDGET_MS as at, settleAndCommitSpokenTurn as ot } from "../voiceCommit.js";
|
|
59
|
+
import { attachmentUrlIsStale as st, refreshStaleAttachmentUrls as ct } from "../attachmentCommit.js";
|
|
60
|
+
import { useConversationTurns as lt } from "../useConversationTurns.js";
|
|
61
|
+
import { resolveActiveModeSandbox as ut, useAssistantStore as w } from "../store.js";
|
|
62
|
+
import { abortAssistantTurn as dt, approvePendingWrite as ft, createAssistantSandbox as pt, createAssistantSession as mt, findExistingSandboxWithStatus as ht, getAssistantArtifacts as gt, getAssistantMessages as _t, getAssistantSession as vt, mintAssistantTurnStream as yt, modeRequiresConfirmWrites as bt, postClientToolResult as xt, promptGatewayRequestBytes as St, releaseSupersededAssistantSandboxes as Ct, sendAssistantPromptAsync as wt, waitForAssistantServiceReady as Tt, waitForSandboxRunning as Et, writeApprovalModeOf as Dt } from "../api.js";
|
|
63
|
+
import { createClientToolRunner as Ot, offerClientTools as kt } from "../../agent-tools/adapters/assistant.js";
|
|
64
|
+
import { sanitize as At } from "../progress.js";
|
|
65
|
+
import { createSandboxBusyGate as jt, gateDoneOnSandboxBusy as Mt } from "../sandboxBusy.js";
|
|
66
|
+
import { speechFeed as Nt } from "../speech/speechFeed.js";
|
|
67
|
+
import { requestReplyOnAvatar as Pt } from "../speech/replySpeechRequests.js";
|
|
68
|
+
import { isTurnSuperseded as Ft, markTurnSuperseded as It } from "../voice/supersededTurns.js";
|
|
69
|
+
import { NO_FIRST_TEXT as Lt, buildAssistantProgress as Rt, readAheadFor as zt, rememberSessionFloor as Bt, snapshotReplyFloor as Vt, startSessionReadAhead as Ht, takeRememberedSessionFloor as Ut, trackFirstText as Wt } from "../turnProgress.js";
|
|
70
|
+
import { getOrganizationId as Gt, getWorkspaceId as T } from "../context.js";
|
|
71
|
+
import { dispatchAssistantQuotaExhausted as Kt, notifyAiCreditsUpdated as qt } from "../aiCredits.js";
|
|
72
|
+
import { AssistantSendRefusal as Jt, classifyTurnFailure as Yt, turnConfirmsNoAction as Xt, turnOutcomeCopy as Zt } from "../turnOutcome.js";
|
|
73
|
+
import { QuarantineSet as Qt, WarmCancelled as $t, claimPreopenedSession as en, consumeWarm as tn, preopenKey as nn, preopenWanted as rn, prewarmTarget as an, settleWarmBeforeSend as on, startPreopen as sn, startWarm as cn, warmState as ln, withWarmProofs as un } from "../prewarm.js";
|
|
74
|
+
import { beginTurn as dn, describeTurn as fn, detectTurnDevice as pn, markTurn as E, restartAttempt as mn, turnClockMs as hn } from "../turnTimeline.js";
|
|
75
|
+
import { sendAssistantTurnTimings as gn, startTurnTimingReporting as _n } from "../turnTimingReporter.js";
|
|
76
|
+
import { countInlineImageCandidates as vn, countInlinedImageParts as yn, largestInlineCharsPerFile as bn, resolveAssistantInlineLimits as xn, toMessageAttachment as Sn } from "../attachments.js";
|
|
77
|
+
import { buildBoundedAttachmentTurn as Cn } from "../attachmentTurn.js";
|
|
78
|
+
import { assistantUsageLedger as wn, hasPendingUsageReports as Tn, reportUsageInBackground as En, retryPendingUsageReports as Dn, settleInFlightUsageReports as On, usageSendRefusal as kn } from "../usageReporting.js";
|
|
79
|
+
import { isMultimodalBodyRejection as An, isRecoverableAssistantError as jn } from "../transportErrors.js";
|
|
80
|
+
import { isTurnInFlight as Mn, planAbandonedTurn as Nn, planTurnAbort as Pn } from "../turnState.js";
|
|
81
|
+
import { useAssistantTr as Fn } from "../i18n.js";
|
|
82
|
+
import { isProdRuntime as In } from "../env.js";
|
|
83
|
+
import { useAssistantProduct as Ln } from "../product.js";
|
|
84
|
+
import { pollDelayMs as Rn } from "../voice/assistantPollSchedule.js";
|
|
85
|
+
import { holdAssistantActivity as zn } from "../keepAlive.js";
|
|
86
|
+
import { StaleSessionRestart as Bn, isStaleSessionRefusal as Vn } from "../staleSession.js";
|
|
87
|
+
import { noteAssistantTurnSent as Hn } from "../signInWarm.js";
|
|
88
|
+
import { keepAssistantSandboxAlive as Un } from "../useAssistantHeartbeat.js";
|
|
89
|
+
import { liveCoverage as Wn } from "../liveDeltas.js";
|
|
90
|
+
import { phraseSpeechEnabled as Gn } from "../voice/phraseSpeechConfig.js";
|
|
91
|
+
import { createLivePhraseSpeech as Kn } from "../voice/livePhraseSpeech.js";
|
|
92
|
+
import { createLiveRender as qn } from "../liveOverlay.js";
|
|
93
|
+
import { createSnapshotPoller as Jn } from "../snapshotPoller.js";
|
|
94
|
+
import { openTurnStream as Yn, turnStreamAvailable as Xn } from "../turnStream.js";
|
|
95
|
+
import { withIncompleteTurnNotice as Zn } from "../streamBudget.js";
|
|
96
|
+
import { isWriteModeAcknowledged as Qn, writeModeSendRefusalReason as $n } from "../writeModeConsent.js";
|
|
97
|
+
import { createAdminModeAccessGate as er, resolveAssistantSendModeAfterAccess as tr } from "../adminModeSendGate.js";
|
|
98
|
+
import { getAssistantDisplayContent as nr } from "../displayContent.js";
|
|
99
|
+
import { countSpokenTurns as rr, spokenMessagesSinceContinueNote as ir, spokenTurnText as ar } from "../spokenTurns.js";
|
|
100
|
+
import { toCaptionText as or } from "../voice/captionText.js";
|
|
101
|
+
import { buildContinuedFromVoiceNote as sr, buildVoiceTranscriptMarkdown as cr, voiceTranscriptFilename as lr } from "../voice/voiceTranscript.js";
|
|
102
|
+
import { downloadFile as ur } from "../exportConversation.js";
|
|
103
|
+
import { chatTurns as dr, isVoiceTurn as fr, voiceMarker as pr, voiceSessionIdOf as mr } from "../voice/turnVisibility.js";
|
|
104
|
+
import { VoiceChatEnded as hr, VoiceTurnTag as gr } from "./voice/VoiceTurnMarks.js";
|
|
105
|
+
import { revealSpokenMarkdown as _r } from "../voice/revealSpoken.js";
|
|
106
|
+
import { isAwaitingOwnConversation as vr, maySendSpokenTurn as yr, planTranscriptAutoOpen as br, planVoiceSessionBinding as xr, planVoiceSessionStart as Sr, planVoiceSpokenEntry as Cr, voiceBindingAtStart as wr, voiceBindingConversationId as Tr } from "../voice/voiceReopen.js";
|
|
107
|
+
import { transcriptAutoOpenSlot as Er } from "./transcriptAutoOpenSlot.js";
|
|
108
|
+
import { toVoiceReply as Dr } from "../voice/voiceReply.js";
|
|
109
|
+
import { beginApprovalInFlight as Or, endApprovalInFlight as kr, getApprovalInFlight as Ar, markLiveTurn as jr, newestModelReplyId as Mr, resolveApprovablePendingWrite as Nr, resolveRetryableMessageId as Pr, subscribeApprovalInFlight as Fr } from "../liveTurns.js";
|
|
110
|
+
import { createReadinessTracker as Ir, planAfterTransportFailure as Lr, planTrustedSandboxFailure as Rr } from "../sandboxReadiness.js";
|
|
111
|
+
import { couldBeLocalUiCommand as zr, isAlreadyThere as Br, matchLocalUiCommand as Vr, mayBeNavigationFollowUp as Hr, navDestinations as Ur, planThemeChange as Wr } from "../localUiCommands.js";
|
|
112
|
+
import { backDoneCopy as Gr, chooseDestinationCopy as Kr, chooseLinkedCopy as qr, entityNounText as Jr, linkNotOpenableCopy as Yr, navigationCommandCopy as Xr, navigationOutcomeCopy as Zr, offerExpiredCopy as Qr, offerKeptForUnsavedCopy as $r, offerNotAvailableCopy as ei, pickFromListCopy as ti, recordChoiceCopy as ni, recordKindsCopy as ri, themeCommandCopy as ii } from "../localUiCommandCopy.js";
|
|
113
|
+
import { offerAssentFor as ai } from "../localeCommands/assent.js";
|
|
114
|
+
import { appControlCopy as oi } from "../appControls/copy.js";
|
|
115
|
+
import { LANGUAGE_REPLY_DEADLINE_MS as si, languageConfirmationCopy as ci, languageReplyStep as li } from "../appControls/languageReply.js";
|
|
116
|
+
import { planAppControl as ui } from "../appControls/plan.js";
|
|
117
|
+
import { readControlSnapshot as di } from "../appControls/snapshot.js";
|
|
118
|
+
import { subscribeAssistantControls as fi } from "../appControls/registry.js";
|
|
119
|
+
import { useAssistantControl as pi } from "../appControls/useAssistantControl.js";
|
|
120
|
+
import { useControlConfirmDialog as mi } from "./controlConfirmDialog.js";
|
|
121
|
+
import { useLeaveConfirmAsking as hi } from "./leaveConfirm.js";
|
|
122
|
+
import { startFocusReturnAfterKeep as gi } from "./leaveConfirmFocus.js";
|
|
123
|
+
import { buildNavigationContext as _i, latestReplyOnSurface as vi, rememberPresentedList as yi } from "../uiActions/linkContext.js";
|
|
124
|
+
import { lookupNamedRecords as bi } from "../uiActions/recordNames.js";
|
|
125
|
+
import { navEntryIds as xi } from "../uiActions/resolveTarget.js";
|
|
126
|
+
import { buildUiCatalogue as Si, markUiCatalogueSent as Ci, uiCatalogueSent as wi, uiCatalogueSessionKey as Ti } from "../uiActions/uiCatalogue.js";
|
|
127
|
+
import { offerYesOnSurface as Ei } from "../uiActions/offerYesOnSurface.js";
|
|
128
|
+
import { UiOfferSession as Di, sandboxServesUiOffers as Oi, uiOfferHintKind as ki, uiOfferInTime as Ai } from "../uiActions/uiOffers.js";
|
|
129
|
+
import { parseNavIntent as ji } from "../uiActions/navIntent.js";
|
|
130
|
+
import { decideActOnResolve as Mi, n4LeaveGuard as Ni } from "../uiActions/actOnResolve.js";
|
|
131
|
+
import { AssistantUiOfferLinks as Pi } from "./AssistantUiOfferLink.js";
|
|
132
|
+
import { assistantBackStack as Fi, isBackRunnable as Ii } from "../uiActions/backStack.js";
|
|
133
|
+
import { subscribeDraftPathname as Li } from "../uiActions/draftPathname.js";
|
|
134
|
+
import { buildNavigateAction as Ri, destinationForPath as zi, labelForPath as Bi, newestAssistantOnSurface as Vi } from "../uiActions/navigateAction.js";
|
|
135
|
+
import { runNavigation as Hi } from "../uiActions/navigationOutcome.js";
|
|
136
|
+
import { assistantHistory as Ui } from "../history/historyEngine.js";
|
|
137
|
+
import { conversationHasHistory as Wi, isOtherScopeHistoryConversation as Gi, isReadOnlyHistoryConversation as Ki, isReusableHistoryDraft as qi } from "../history/historyList.js";
|
|
138
|
+
import { resumeContextFor as Ji } from "../history/historyResume.js";
|
|
139
|
+
import { useAssistantHistoryStatus as Yi } from "../history/historyStatus.js";
|
|
140
|
+
import { useHistoryRowControlsFor as Xi } from "../history/useHistoryRowControls.js";
|
|
141
|
+
import { getHistoryStamp as Zi, setHistoryBusyProbe as Qi } from "../history/stampRegistry.js";
|
|
142
|
+
import { resolveConversationDeleteTarget as $i } from "../conversationDeleteCommand.js";
|
|
143
|
+
import { useAssistantNavigate as ea } from "./AssistantMarkdownRenderer.js";
|
|
144
|
+
import { useAssistantSpeech as ta } from "./AssistantSpeechProvider.js";
|
|
145
|
+
import { useAssistantStopTurnLabel as na } from "../../providers/shell/useAssistantShellLabels.js";
|
|
146
|
+
import { useThemeOrNull as ra } from "../../providers/shell/ThemeProvider.js";
|
|
147
|
+
import { useVisibleNavItems as ia } from "../../../chrome/mobileTabBar/useVisibleNavItems.js";
|
|
148
|
+
import { useAskAboutStore as aa } from "../askAbout/askAboutStore.js";
|
|
149
|
+
import { readMessageFocus as oa, withFocusNote as sa } from "../askAbout/focus.js";
|
|
150
|
+
import { useCallback as D, useEffect as O, useLayoutEffect as ca, useMemo as k, useRef as A, useState as j, useSyncExternalStore as la } from "react";
|
|
151
|
+
import { Fragment as ua, jsx as M, jsxs as da } from "react/jsx-runtime";
|
|
151
152
|
// src/shared/assistant/ui/AssistantChatArea.tsx
|
|
152
|
-
var
|
|
153
|
+
var fa = 2500, pa = 300, ma = 2e4, ha = 1e4, ga = 1e4, _a = !1, va = {
|
|
153
154
|
committing: !1,
|
|
154
155
|
dictating: !1
|
|
155
|
-
},
|
|
156
|
+
}, ya = 6e3;
|
|
156
157
|
function N() {
|
|
157
158
|
return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
158
159
|
}
|
|
159
|
-
var
|
|
160
|
-
let P =
|
|
160
|
+
var ba = () => () => {}, xa = () => "off", Sa = { overflowY: "auto" }, Ca = ({ visible: Ca = !0, writeAccess: wa = "unknown", presentation: Ta = "classic", inputRef: Ea, onDraftDirtyChange: Da, surface: Oa, onWindowVoiceChange: ka, onOpenFull: Aa, onContinuedInChat: ja }) => {
|
|
161
|
+
let P = Fn(), Ma = na(), F = Ta === "compact", I = He(), Na = Ge(), Pa = D((e) => We("above", e), []), Fa = D((e) => We("below", e), []), Ia = F && Oa === "window", { product: L, modes: R, gatherPageContext: La, buildPrompt: Ra, reportTurnTimings: za, reportTokenUsage: Ba, localUiCommands: Va } = Ln(), z = Dt(Ln().writeApproval), Ha = D((e, t) => {
|
|
161
162
|
let n = w.getState(), r = t ?? n.sandboxesByMode[e]?.sandboxId ?? null;
|
|
162
163
|
return g({
|
|
163
164
|
mode: e,
|
|
164
165
|
productWriteApproval: z,
|
|
165
166
|
capabilities: r ? n.sandboxWriteCapabilities[r] : null
|
|
166
167
|
});
|
|
167
|
-
}, [z]), { getAccessToken:
|
|
168
|
-
Ya,
|
|
168
|
+
}, [z]), { getAccessToken: Ua, getWorkspaceToken: Wa, userId: B } = r(), { locale: V, isLocaleLoading: Ga } = n(), Ka = w((e) => e.voiceGraceMs), qa = w((e) => e.handsFreeInterrupt), Ja = w((e) => e.handsFreeStreamNoticeAccepted), Ya = w((e) => e.acceptHandsFreeStreamNotice), Xa = w((e) => e.assistantLanguage), Za = w((e) => e.replyLanguage), Qa = k(() => s(Xa, Za, V), [
|
|
169
169
|
Xa,
|
|
170
|
+
Za,
|
|
170
171
|
V
|
|
171
|
-
]),
|
|
172
|
+
]), $a = Qa.reply.english, eo = Qa.replyIsExplicit, to = Qa.reply.code, { conversations: no, activeConversationId: H, mode: U, processingByConversationId: ro, setMode: io, setConversationMode: ao, setActiveConversation: oo, createConversation: so, addMessage: W, updateMessage: co, patchMessage: lo, mergeMessageMetadata: uo, setConversationProcessing: fo, clearConversationProcessing: po, setBackendSessionId: mo, clearBackendSessionId: ho, setSandbox: go, clearSandbox: _o, acknowledgedWriteModes: vo, acknowledgeWriteMode: yo, autoRouting: bo, setAutoRouting: xo, routeConversation: So } = w(), G = no.find((e) => e.id === H), Co = lt(G), wo = Co.all, To = H ? ro[H] : void 0, Eo = Mn(To?.status), Do = Eo ? To?.messageId ?? null : null, Oo = To?.status === "error" ? To.messageId : null, ko = w((e) => e.sandboxWriteCapabilities), { panel: K, entries: Ao, retiredSandboxes: jo } = ee({
|
|
172
173
|
tr: P,
|
|
173
174
|
productWriteApproval: z
|
|
174
|
-
}),
|
|
175
|
+
}), Mo = p({
|
|
175
176
|
approve: (e, t) => K.approve(e, t),
|
|
176
177
|
decline: (e, t, n) => K.decline(e, t, n),
|
|
177
178
|
presented: (e, t) => K.presented(e, t)
|
|
178
|
-
}),
|
|
179
|
+
}), No = Mo.dismiss, Po = A(null);
|
|
179
180
|
O(() => {
|
|
180
|
-
|
|
181
|
-
let e =
|
|
182
|
-
|
|
181
|
+
No();
|
|
182
|
+
let e = Po.current;
|
|
183
|
+
Po.current = H, e && e !== H && K.withdraw(e, "conversation_closed"), H && K.openConversation(H);
|
|
183
184
|
}, [
|
|
184
185
|
H,
|
|
185
186
|
K,
|
|
186
|
-
|
|
187
|
+
No
|
|
187
188
|
]);
|
|
188
|
-
let
|
|
189
|
+
let Fo = Ki(G), Io = Xi(G)?.archivedAt != null, Lo = Yi((e) => H !== null && H in e.loadingIds), Ro = Yi((e) => H !== null && H in e.loadErrorIds), zo = Yi((e) => e.remoteDelete), [Bo, Vo] = j(() => Yi.getState().remoteDelete?.at ?? null), Ho = zo?.wasActive === !0 && zo.at !== Bo ? zo.at : null;
|
|
189
190
|
O(() => {
|
|
190
|
-
if (
|
|
191
|
-
let e = window.setTimeout(() =>
|
|
191
|
+
if (Ho === null) return;
|
|
192
|
+
let e = window.setTimeout(() => Vo(Ho), ga);
|
|
192
193
|
return () => window.clearTimeout(e);
|
|
193
|
-
}, [
|
|
194
|
-
let
|
|
195
|
-
loading:
|
|
196
|
-
canUseAdminModes:
|
|
197
|
-
})).current,
|
|
194
|
+
}, [Ho]);
|
|
195
|
+
let Uo = xe(), Wo = Yi((e) => e.pinLimit), Go = I && Uo && Wo !== void 0 && Wo.conversationId === H ? Wo : null, Ko = T(), { canUseApiCalls: qo, loading: Jo } = nt(Ko, B), Yo = A(er({
|
|
196
|
+
loading: Jo,
|
|
197
|
+
canUseAdminModes: qo
|
|
198
|
+
})).current, Xo = A(R);
|
|
198
199
|
O(() => {
|
|
199
|
-
|
|
200
|
+
Xo.current = R;
|
|
200
201
|
}, [R]);
|
|
201
|
-
let
|
|
202
|
+
let Zo = () => {
|
|
202
203
|
let e = w.getState().activeConversationId;
|
|
203
|
-
e &&
|
|
204
|
-
},
|
|
204
|
+
e && Ui.openConversation(e, { modes: Xo.current });
|
|
205
|
+
}, Qo = () => {
|
|
205
206
|
let e = w.getState().activeConversationId;
|
|
206
|
-
e &&
|
|
207
|
-
},
|
|
207
|
+
e && Ui.loadEarlier(e);
|
|
208
|
+
}, $o = A(Ua);
|
|
208
209
|
O(() => {
|
|
209
|
-
|
|
210
|
-
}, [
|
|
211
|
-
let
|
|
210
|
+
$o.current = Ua;
|
|
211
|
+
}, [Ua]);
|
|
212
|
+
let es = !!L && za !== !1;
|
|
212
213
|
O(() => {
|
|
213
|
-
if (
|
|
214
|
+
if (es) return _n({ send: (e) => gn(e, {
|
|
214
215
|
workspaceId: T(),
|
|
215
216
|
authContext: {
|
|
216
|
-
accessToken:
|
|
217
|
-
organizationId:
|
|
217
|
+
accessToken: $o.current(),
|
|
218
|
+
organizationId: Gt()
|
|
218
219
|
}
|
|
219
220
|
}) });
|
|
220
|
-
}, [
|
|
221
|
-
|
|
222
|
-
loading:
|
|
223
|
-
canUseAdminModes:
|
|
221
|
+
}, [es]), O(() => {
|
|
222
|
+
Yo.update({
|
|
223
|
+
loading: Jo,
|
|
224
|
+
canUseAdminModes: qo
|
|
224
225
|
});
|
|
225
226
|
}, [
|
|
227
|
+
Yo,
|
|
226
228
|
Jo,
|
|
227
|
-
qo
|
|
228
|
-
Ko
|
|
229
|
+
qo
|
|
229
230
|
]), O(() => () => {
|
|
230
|
-
|
|
231
|
-
}, [
|
|
232
|
-
let
|
|
231
|
+
Yo.abandon();
|
|
232
|
+
}, [Yo]);
|
|
233
|
+
let ts = k(() => R.filter((e) => !e.requiresAdmin || qo), [R, qo]), ns = fe(ts), rs = bo && ns, is = A(ns);
|
|
233
234
|
O(() => {
|
|
234
|
-
|
|
235
|
-
}, [
|
|
236
|
-
let
|
|
235
|
+
is.current = ns;
|
|
236
|
+
}, [ns]);
|
|
237
|
+
let as = A(null), os = A(!1), [ss, cs] = j(!1), ls = bn(R), [us, ds] = j(null), [fs, ps] = j(() => Er.openFor());
|
|
237
238
|
O(() => {
|
|
238
|
-
|
|
239
|
-
}, [
|
|
240
|
-
let
|
|
241
|
-
|
|
242
|
-
|
|
239
|
+
Er.setOpenFor(fs);
|
|
240
|
+
}, [fs]);
|
|
241
|
+
let ms = fs !== null && fs === H, q = Ke(), hs = C(), J = q.open && hs !== null, gs = q.close, _s = A(J);
|
|
242
|
+
ca(() => {
|
|
243
|
+
_s.current = J;
|
|
243
244
|
}, [J]);
|
|
244
|
-
let
|
|
245
|
-
e &&
|
|
245
|
+
let vs = D((e) => {
|
|
246
|
+
e && _s.current || e && I || ps(e ? w.getState().activeConversationId : null);
|
|
246
247
|
}, [I]);
|
|
247
248
|
O(() => {
|
|
248
|
-
|
|
249
|
+
ps((e) => e !== null && e !== H ? null : e);
|
|
249
250
|
}, [H]);
|
|
250
|
-
let
|
|
251
|
-
|
|
252
|
-
}, []),
|
|
251
|
+
let ys = A(void 0), [bs, xs] = j(!1), [Ss, Cs] = j(!1), ws = D((e) => {
|
|
252
|
+
ys.current = e, xs(vr(e));
|
|
253
|
+
}, []), Ts = A(null), Es = A(!1), Ds = D(() => {
|
|
253
254
|
let e = w.getState(), t = e.activeConversationId, n = t ? e.conversations.find((e) => e.id === t) : void 0;
|
|
254
255
|
return !t || !n ? null : {
|
|
255
256
|
id: t,
|
|
256
|
-
reusableDraft:
|
|
257
|
+
reusableDraft: qi(n, Zi()),
|
|
257
258
|
liveProposals: K.liveFor(t).count,
|
|
258
|
-
turnInFlight:
|
|
259
|
+
turnInFlight: Mn(e.processingByConversationId[t]?.status)
|
|
259
260
|
};
|
|
260
|
-
}, [K]),
|
|
261
|
+
}, [K]), Os = A({}), ks = A(un(Ir())), As = A(new Qt()), js = A(/* @__PURE__ */ new Set()), Ms = k(() => R.find((e) => e.id === U), [R, U]), Ns = w((e) => {
|
|
261
262
|
let t = e.sandboxesByMode[U]?.sandboxId;
|
|
262
263
|
return t ? e.sandboxWriteCapabilities[t] : void 0;
|
|
263
|
-
}),
|
|
264
|
+
}), Ps = Ms !== void 0 && g({
|
|
264
265
|
mode: U,
|
|
265
266
|
productWriteApproval: z,
|
|
266
|
-
capabilities:
|
|
267
|
-
}),
|
|
267
|
+
capabilities: Ns
|
|
268
|
+
}), Fs = U === "assistant" || Ms !== void 0 && !Ms.writeCapable && !bt(U) || Ps;
|
|
268
269
|
O(() => {
|
|
269
|
-
let e = R.find((e) => e.id === "assistant" || !e.requiresAdmin ||
|
|
270
|
-
U !== "assistant" &&
|
|
270
|
+
let e = R.find((e) => e.id === "assistant" || !e.requiresAdmin || qo)?.id ?? R[0]?.id ?? "assistant";
|
|
271
|
+
U !== "assistant" && Ms?.writeCapable && !Qn(vo, U) ? io(e) : Jo || (!Ms || Ms.requiresAdmin && !qo) && U !== e && io(e);
|
|
271
272
|
}, [
|
|
272
273
|
U,
|
|
273
|
-
|
|
274
|
-
Ko,
|
|
274
|
+
Ms,
|
|
275
275
|
qo,
|
|
276
|
-
|
|
277
|
-
|
|
276
|
+
Jo,
|
|
277
|
+
io,
|
|
278
|
+
vo,
|
|
278
279
|
R
|
|
279
280
|
]);
|
|
280
|
-
let
|
|
281
|
-
|
|
282
|
-
}, [
|
|
281
|
+
let Is = D((e, t, n, r) => {
|
|
282
|
+
fo(e, n, t, null, r);
|
|
283
|
+
}, [fo]), Ls = D(async (e, t, n, r, i, a = null) => {
|
|
283
284
|
let o = (e, t) => {
|
|
284
|
-
r &&
|
|
285
|
+
r && Is(r.conversationId, r.assistantMessageId, e, t), a && (a.step = t, a.onStep?.(t));
|
|
285
286
|
}, s = (e) => {
|
|
286
287
|
r && E(r.assistantMessageId, e);
|
|
287
288
|
}, c = () => {
|
|
288
289
|
s("bootAdopted"), a?.beginBoot();
|
|
289
290
|
}, l = () => a !== null && (a.signal.aborted || T() !== t), u = () => {
|
|
290
|
-
if (l()) throw new
|
|
291
|
+
if (l()) throw new $t("cancelled");
|
|
291
292
|
}, d = w.getState().sandboxesByMode[e]?.sandboxId ?? null, f = !1, p = !1, ee = !1, m = !1, h = !1, g = async (r) => {
|
|
292
|
-
if (i && !
|
|
293
|
+
if (i && !As.current.has(r) && ks.current.isFresh(r)) return f = !0, !0;
|
|
293
294
|
ee = !0;
|
|
294
295
|
let o = !1;
|
|
295
296
|
try {
|
|
296
|
-
await
|
|
297
|
+
await Et(r, t, n, 3e5), await Tt(r, t, e, n, 9e4, () => {
|
|
297
298
|
o = !0, c();
|
|
298
299
|
});
|
|
299
300
|
} catch {
|
|
300
|
-
if (l()) throw new
|
|
301
|
-
return
|
|
301
|
+
if (l()) throw new $t("cancelled");
|
|
302
|
+
return ks.current.invalidate(r), As.current.add(r), a?.dead.push(r), h = !0, !1;
|
|
302
303
|
}
|
|
303
|
-
return u(),
|
|
304
|
+
return u(), ks.current.markVerified(r), o && (m = !0), !0;
|
|
304
305
|
};
|
|
305
|
-
if (d && (
|
|
306
|
+
if (d && (go(e, d, "provisioning"), o("provisioning", "reusingEnvironment"), await g(d) || (go(e, null, "provisioning"), d = null)), !d) {
|
|
306
307
|
o("provisioning", "lookingForEnvironment");
|
|
307
|
-
let r = await
|
|
308
|
+
let r = await ht(t, L, e, In(), n, As.current, z);
|
|
308
309
|
u();
|
|
309
310
|
let i = r?.id ?? null;
|
|
310
311
|
if (i) {
|
|
311
|
-
|
|
312
|
+
go(e, i, "provisioning"), o("provisioning", "reusingEnvironment");
|
|
312
313
|
let t = r?.status === "PROVISIONING" || r?.status === "PENDING";
|
|
313
|
-
t && c(), await g(i) ? (d = i, t && (m = !0)) :
|
|
314
|
+
t && c(), await g(i) ? (d = i, t && (m = !0)) : go(e, null, "provisioning");
|
|
314
315
|
}
|
|
315
316
|
}
|
|
316
317
|
if (!d) {
|
|
317
|
-
if (a && !a.mayCreate) throw new
|
|
318
|
-
if (s("provisionStarted"), e === "api-calls" && !
|
|
319
|
-
o("provisioning", "startingEnvironment"),
|
|
320
|
-
let r = a ? [] : await
|
|
318
|
+
if (a && !a.mayCreate) throw new $t("no-create");
|
|
319
|
+
if (s("provisionStarted"), e === "api-calls" && !Ua()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
|
|
320
|
+
o("provisioning", "startingEnvironment"), go(e, null, "provisioning");
|
|
321
|
+
let r = a ? [] : await Ct(t, L, e, In(), n, As.current, z);
|
|
321
322
|
if (r.length > 0) {
|
|
322
323
|
let e = new Set(r);
|
|
323
|
-
for (let e of r)
|
|
324
|
+
for (let e of r) ks.current.invalidate(e), As.current.add(e);
|
|
324
325
|
let t = w.getState().sandboxesByMode;
|
|
325
|
-
for (let [n, r] of Object.entries(t)) y(n) && r?.sandboxId && e.has(r.sandboxId) &&
|
|
326
|
+
for (let [n, r] of Object.entries(t)) y(n) && r?.sandboxId && e.has(r.sandboxId) && _o(n);
|
|
326
327
|
}
|
|
327
328
|
s("createRequested");
|
|
328
329
|
let i = a?.beginCreate();
|
|
329
330
|
try {
|
|
330
|
-
d = await
|
|
331
|
+
d = await pt(L, e, t, In(), pa, n, { writeApproval: z });
|
|
331
332
|
} finally {
|
|
332
333
|
i?.();
|
|
333
334
|
}
|
|
334
|
-
p = !0, u(),
|
|
335
|
+
p = !0, u(), go(e, d, "provisioning"), await Et(d, t, n, 3e5), u(), s("sandboxRunning"), await Tt(d, t, e, n, 9e4), u(), s("serviceReady"), ks.current.markVerified(d);
|
|
335
336
|
}
|
|
336
|
-
return
|
|
337
|
+
return go(e, d, "running"), {
|
|
337
338
|
sandboxId: d,
|
|
338
339
|
sandboxIsNew: p,
|
|
339
340
|
sandboxProbed: ee,
|
|
@@ -342,64 +343,64 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
342
343
|
trustedFromCache: f
|
|
343
344
|
};
|
|
344
345
|
}, [
|
|
345
|
-
|
|
346
|
-
|
|
346
|
+
_o,
|
|
347
|
+
Ua,
|
|
347
348
|
L,
|
|
348
349
|
z,
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
]),
|
|
352
|
-
let s = await
|
|
353
|
-
for (let e of s.dead)
|
|
354
|
-
s.verified && !
|
|
355
|
-
let { sandboxId: c, sandboxIsNew: l, sandboxProbed: u, sandboxAdopted: d, deadSandboxProbe: f, trustedFromCache: p } = await
|
|
350
|
+
go,
|
|
351
|
+
Is
|
|
352
|
+
]), Rs = D(async function e(t, n, r, i, a, o = {}) {
|
|
353
|
+
let s = await on(i, r, (e) => Is(t, n, "provisioning", e), () => E(n, "prewarmJoined"));
|
|
354
|
+
for (let e of s.dead) ks.current.invalidate(e), As.current.add(e);
|
|
355
|
+
s.verified && !As.current.has(s.verified) && ks.current.markVerified(s.verified), s.joined && fn(n, { prewarm: s.joined });
|
|
356
|
+
let { sandboxId: c, sandboxIsNew: l, sandboxProbed: u, sandboxAdopted: d, deadSandboxProbe: f, trustedFromCache: p } = await Ls(r, i, a, {
|
|
356
357
|
conversationId: t,
|
|
357
358
|
assistantMessageId: n
|
|
358
|
-
}, o.trustCache !== !1), ee =
|
|
359
|
-
!s.waited && ee &&
|
|
359
|
+
}, o.trustCache !== !1), ee = tn(i, r, c);
|
|
360
|
+
!s.waited && ee && fn(n, { prewarm: "hit" });
|
|
360
361
|
let m = w.getState().conversations.find((e) => e.id === t)?.backendSessionId ?? null, h = !1, g = null, _ = null;
|
|
361
|
-
if (m && o.verifySession !== !0 && w.getState().sandboxWriteCapabilities[c]?.promptRejectsUnknownSession === !0 && w.getState().conversations.find((e) => e.id === t)?.mode === r && (_ =
|
|
362
|
-
let e =
|
|
362
|
+
if (m && o.verifySession !== !0 && w.getState().sandboxWriteCapabilities[c]?.promptRejectsUnknownSession === !0 && w.getState().conversations.find((e) => e.id === t)?.mode === r && (_ = Ut(c, m)), m && _ === null) {
|
|
363
|
+
let e = Ht(c, m, (e, t) => _t(e, i, t, r, a, { limit: 50 }));
|
|
363
364
|
try {
|
|
364
|
-
let t = await
|
|
365
|
+
let t = await vt(c, i, m, r, a);
|
|
365
366
|
if (t.mode !== r) throw Error(`Session mode mismatch: expected ${r}, received ${t.mode}`);
|
|
366
367
|
g = e;
|
|
367
368
|
} catch {
|
|
368
|
-
|
|
369
|
+
ho(t), m = null;
|
|
369
370
|
}
|
|
370
371
|
}
|
|
371
372
|
let te = !1;
|
|
372
373
|
if (!m) {
|
|
373
|
-
let e =
|
|
374
|
+
let e = en(nn({
|
|
374
375
|
workspaceId: i,
|
|
375
376
|
mode: r,
|
|
376
377
|
sandboxId: c,
|
|
377
378
|
userId: B
|
|
378
379
|
}), Date.now());
|
|
379
380
|
if (e) {
|
|
380
|
-
"pending" in e &&
|
|
381
|
+
"pending" in e && Is(t, n, "connecting", "preparingSession");
|
|
381
382
|
let o = "sessionId" in e ? e.sessionId : await e.pending;
|
|
382
|
-
if (o && !
|
|
383
|
-
(await
|
|
383
|
+
if (o && !As.current.has(c)) try {
|
|
384
|
+
(await vt(c, i, o, r, a)).mode === r && (m = o, te = !0, mo(t, m), h = !0);
|
|
384
385
|
} catch {}
|
|
385
386
|
}
|
|
386
387
|
}
|
|
387
388
|
if (!m) {
|
|
388
|
-
|
|
389
|
+
Is(t, n, "connecting", "preparingSession");
|
|
389
390
|
let s;
|
|
390
391
|
try {
|
|
391
|
-
s = await
|
|
392
|
+
s = await mt(c, i, r, a);
|
|
392
393
|
} catch (s) {
|
|
393
394
|
if (p) {
|
|
394
|
-
|
|
395
|
-
let l =
|
|
396
|
-
if (l === "check-network" && (l = await
|
|
397
|
-
p ||
|
|
395
|
+
ks.current.invalidate(c);
|
|
396
|
+
let l = Rr(s, o.isAbandoned?.() ?? !1), p = l === "check-network";
|
|
397
|
+
if (l === "check-network" && (l = await Lr(() => ht(i, L, r, In(), a, As.current, z))), l !== "rethrow" && o.isAbandoned?.() && (l = "rethrow"), l !== "rethrow") {
|
|
398
|
+
p || fn(n, { cacheProofFailed: !0 }), l === "replace" && (As.current.add(c), ho(t), _o(r), K.retireSandbox(c));
|
|
398
399
|
let s = await e(t, n, r, i, a, {
|
|
399
400
|
...o,
|
|
400
401
|
trustCache: !1
|
|
401
402
|
});
|
|
402
|
-
return p && (s.deadSandboxProbe || s.sandboxId !== c) &&
|
|
403
|
+
return p && (s.deadSandboxProbe || s.sandboxId !== c) && fn(n, { cacheProofFailed: !0 }), {
|
|
403
404
|
...s,
|
|
404
405
|
sandboxProbed: s.sandboxProbed || u,
|
|
405
406
|
sandboxAdopted: s.sandboxAdopted || d,
|
|
@@ -409,7 +410,7 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
409
410
|
}
|
|
410
411
|
throw s;
|
|
411
412
|
}
|
|
412
|
-
m = s.sessionId,
|
|
413
|
+
m = s.sessionId, mo(t, m), h = !0;
|
|
413
414
|
}
|
|
414
415
|
return {
|
|
415
416
|
sandboxId: c,
|
|
@@ -424,67 +425,67 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
424
425
|
knownFloor: _
|
|
425
426
|
};
|
|
426
427
|
}, [
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
428
|
+
Ls,
|
|
429
|
+
ho,
|
|
430
|
+
_o,
|
|
430
431
|
L,
|
|
431
432
|
z,
|
|
432
|
-
|
|
433
|
-
|
|
433
|
+
mo,
|
|
434
|
+
Is,
|
|
434
435
|
B,
|
|
435
436
|
K
|
|
436
|
-
]),
|
|
437
|
+
]), zs = D((e, t = !1) => {
|
|
437
438
|
let n = T();
|
|
438
439
|
if (!n) return;
|
|
439
|
-
let r = w.getState(), i = Date.now(), a =
|
|
440
|
+
let r = w.getState(), i = Date.now(), a = an({
|
|
440
441
|
autoRouting: r.autoRouting,
|
|
441
|
-
autoOffered:
|
|
442
|
+
autoOffered: is.current,
|
|
442
443
|
active: !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0,
|
|
443
444
|
selectedMode: r.mode,
|
|
444
445
|
autoReadMode: b,
|
|
445
|
-
modes:
|
|
446
|
+
modes: Xo.current,
|
|
446
447
|
acknowledgedWriteModes: r.acknowledgedWriteModes,
|
|
447
|
-
adminAccess:
|
|
448
|
+
adminAccess: Yo.read(),
|
|
448
449
|
dictated: e,
|
|
449
|
-
voiceProposalBound: (e) =>
|
|
450
|
-
turnInFlight: Object.values(r.processingByConversationId).some((e) =>
|
|
451
|
-
...
|
|
450
|
+
voiceProposalBound: (e) => Ha(e),
|
|
451
|
+
turnInFlight: Object.values(r.processingByConversationId).some((e) => Mn(e?.status)),
|
|
452
|
+
...ln(n),
|
|
452
453
|
now: i
|
|
453
454
|
});
|
|
454
455
|
if (!a) return;
|
|
455
|
-
let o =
|
|
456
|
-
accessToken:
|
|
457
|
-
workspaceToken:
|
|
456
|
+
let o = cn(n, a, i), s = {
|
|
457
|
+
accessToken: Ua(),
|
|
458
|
+
workspaceToken: Wa(),
|
|
458
459
|
userId: B,
|
|
459
|
-
organizationId:
|
|
460
|
+
organizationId: Gt()
|
|
460
461
|
};
|
|
461
|
-
|
|
462
|
+
Ls(a.mode, n, s, null, !0, o).then((e) => {
|
|
462
463
|
if (o.finish({
|
|
463
464
|
ok: !0,
|
|
464
465
|
sandboxId: e.sandboxId,
|
|
465
466
|
didWork: !e.trustedFromCache && (e.sandboxIsNew || e.sandboxProbed || e.sandboxAdopted),
|
|
466
467
|
booted: e.sandboxIsNew || e.sandboxAdopted,
|
|
467
468
|
dead: o.dead
|
|
468
|
-
}), o.signal.aborted || T() !== n ||
|
|
469
|
-
let r = w.getState(), i = !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0, c =
|
|
470
|
-
|
|
469
|
+
}), o.signal.aborted || T() !== n || As.current.has(e.sandboxId)) return;
|
|
470
|
+
let r = w.getState(), i = !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0, c = Zi();
|
|
471
|
+
rn({
|
|
471
472
|
active: i ? {
|
|
472
473
|
mode: i.mode,
|
|
473
474
|
backendSessionId: i.backendSessionId,
|
|
474
|
-
continuable: !
|
|
475
|
-
hasHistory:
|
|
475
|
+
continuable: !Ki(i) && !Gi(i, c),
|
|
476
|
+
hasHistory: Wi(i)
|
|
476
477
|
} : void 0,
|
|
477
478
|
mode: a.mode
|
|
478
|
-
}) &&
|
|
479
|
+
}) && sn(nn({
|
|
479
480
|
workspaceId: n,
|
|
480
481
|
mode: a.mode,
|
|
481
482
|
sandboxId: e.sandboxId,
|
|
482
483
|
userId: B
|
|
483
|
-
}), () =>
|
|
484
|
+
}), () => mt(e.sandboxId, n, a.mode, s).then((e) => e.sessionId), Date.now());
|
|
484
485
|
}, (e) => {
|
|
485
|
-
if (!(e instanceof
|
|
486
|
+
if (!(e instanceof $t) && !o.signal.aborted && T() === n) {
|
|
486
487
|
let e = w.getState().sandboxesByMode[a.mode]?.sandboxId ?? null;
|
|
487
|
-
e && (
|
|
488
|
+
e && (ks.current.invalidate(e), As.current.add(e), o.dead.push(e), _o(a.mode));
|
|
488
489
|
}
|
|
489
490
|
o.finish({
|
|
490
491
|
ok: !1,
|
|
@@ -494,68 +495,68 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
494
495
|
});
|
|
495
496
|
});
|
|
496
497
|
}, [
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
Ha,
|
|
498
|
+
Ls,
|
|
499
|
+
Yo,
|
|
500
|
+
_o,
|
|
501
501
|
Ua,
|
|
502
|
+
Wa,
|
|
502
503
|
B,
|
|
503
|
-
|
|
504
|
-
]),
|
|
505
|
-
O(() => () =>
|
|
506
|
-
let
|
|
504
|
+
Ha
|
|
505
|
+
]), Bs = A(!1), Vs = A(null), Hs = k(() => a(), []);
|
|
506
|
+
O(() => () => Hs.cancel(), [Hs]);
|
|
507
|
+
let Us = la(Fr, Ar, Ar)?.reference ?? null, [Ws, Gs] = j(0), Ks = A(/* @__PURE__ */ new Set()), qs = A(null), Js = D(() => {
|
|
507
508
|
let e = w.getState(), t = e.activeConversationId;
|
|
508
509
|
if (!t) return null;
|
|
509
|
-
let n = e.processingByConversationId[t], r =
|
|
510
|
-
if (!
|
|
510
|
+
let n = e.processingByConversationId[t], r = Mn(n?.status) ? n?.messageId ?? null : null;
|
|
511
|
+
if (!Pn({
|
|
511
512
|
interruptedTurnId: r,
|
|
512
513
|
activeTurnId: r,
|
|
513
|
-
alreadyRequested: r ?
|
|
514
|
+
alreadyRequested: r ? Ks.current.has(r) : !1
|
|
514
515
|
}).send || !r) return null;
|
|
515
|
-
|
|
516
|
-
let i =
|
|
517
|
-
return i && a && o &&
|
|
518
|
-
accessToken:
|
|
519
|
-
workspaceToken:
|
|
516
|
+
Ks.current.add(r);
|
|
517
|
+
let i = ut(e), a = T(), o = e.conversations.find((e) => e.id === t)?.backendSessionId;
|
|
518
|
+
return i && a && o && dt(i.sandboxId, a, o, i.mode, {
|
|
519
|
+
accessToken: Ua(),
|
|
520
|
+
workspaceToken: Wa(),
|
|
520
521
|
userId: B,
|
|
521
|
-
organizationId:
|
|
522
|
+
organizationId: Gt()
|
|
522
523
|
}), r;
|
|
523
524
|
}, [
|
|
524
525
|
B,
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
]),
|
|
528
|
-
let e =
|
|
529
|
-
return e && (
|
|
530
|
-
}, [
|
|
526
|
+
Ua,
|
|
527
|
+
Wa
|
|
528
|
+
]), Ys = D(() => {
|
|
529
|
+
let e = Js();
|
|
530
|
+
return e && (It(e), Nt.abort(e)), e;
|
|
531
|
+
}, [Js]), Xs = D(() => {
|
|
531
532
|
let e = w.getState().activeConversationId;
|
|
532
|
-
|
|
533
|
-
}, [
|
|
534
|
-
let t = w.getState(), n =
|
|
533
|
+
Ys(), e && K.declineForReply(e, "corrected", "spoken");
|
|
534
|
+
}, [Ys, K]), Zs = D(async (e) => {
|
|
535
|
+
let t = w.getState(), n = ut(t), r = T(), i = t.activeConversationId;
|
|
535
536
|
if (!n || !r || !i || oe(t.sandboxWriteCapabilities[n.sandboxId])) return;
|
|
536
|
-
let a = t.conversations.find((e) => e.id === i), o = a ?
|
|
537
|
+
let a = t.conversations.find((e) => e.id === i), o = a ? Nr(dr(a.messages), {
|
|
537
538
|
sessionId: a.backendSessionId,
|
|
538
539
|
sandboxId: n.sandboxId,
|
|
539
540
|
nowMs: Date.now()
|
|
540
541
|
}) : null;
|
|
541
542
|
if (o?.reference !== e) {
|
|
542
|
-
|
|
543
|
+
Gs((e) => e + 1);
|
|
543
544
|
return;
|
|
544
545
|
}
|
|
545
546
|
let s = {
|
|
546
547
|
conversationId: i,
|
|
547
548
|
reference: e
|
|
548
549
|
};
|
|
549
|
-
if (!
|
|
550
|
+
if (!Or(s)) return;
|
|
550
551
|
try {
|
|
551
|
-
await
|
|
552
|
-
accessToken:
|
|
553
|
-
workspaceToken:
|
|
552
|
+
await ft(n.sandboxId, r, e, n.mode, {
|
|
553
|
+
accessToken: Ua(),
|
|
554
|
+
workspaceToken: Wa(),
|
|
554
555
|
userId: B,
|
|
555
|
-
organizationId:
|
|
556
|
+
organizationId: Gt()
|
|
556
557
|
});
|
|
557
558
|
} catch (e) {
|
|
558
|
-
|
|
559
|
+
kr(s), W(i, {
|
|
559
560
|
id: N(),
|
|
560
561
|
role: "system",
|
|
561
562
|
content: e instanceof Error ? e.message : "The change could not be approved.",
|
|
@@ -563,70 +564,70 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
563
564
|
});
|
|
564
565
|
return;
|
|
565
566
|
}
|
|
566
|
-
|
|
567
|
+
kr(s), uo(i, o.messageId, { pendingWriteApprovedAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
567
568
|
let c = w.getState(), l = c.conversations.find((e) => e.id === i);
|
|
568
|
-
c.activeConversationId === i && l && c.mode === n.mode && l.backendSessionId === a?.backendSessionId &&
|
|
569
|
+
c.activeConversationId === i && l && c.mode === n.mode && l.backendSessionId === a?.backendSessionId && ut(c)?.sandboxId === n.sandboxId && !Mn(c.processingByConversationId[i]?.status) && Mr(dr(l.messages)) === o.messageId && nl.current(P("pendingWrite.approvedPrompt", "I approved that change — go ahead."), [], {
|
|
569
570
|
approvalFollowUp: { approvedReplyId: o.messageId },
|
|
570
571
|
targetConversationId: i
|
|
571
572
|
});
|
|
572
573
|
}, [
|
|
573
574
|
B,
|
|
574
575
|
W,
|
|
575
|
-
|
|
576
|
+
uo,
|
|
576
577
|
P
|
|
577
|
-
]),
|
|
578
|
-
let n =
|
|
578
|
+
]), Qs = ra(), { speakFinishedReply: $s, speakingMessageId: ec, stop: tc } = ta(), nc = A(null), rc = D((e, t) => {
|
|
579
|
+
let n = nc.current;
|
|
579
580
|
n?.token === e && n.exchange === null && (n.exchange = t);
|
|
580
|
-
}, []),
|
|
581
|
-
let t =
|
|
581
|
+
}, []), ic = D((e) => {
|
|
582
|
+
let t = nc.current;
|
|
582
583
|
e !== void 0 && t?.token === e && (t.handled = !0);
|
|
583
|
-
}, []),
|
|
584
|
-
|
|
585
|
-
}, [
|
|
586
|
-
theme:
|
|
587
|
-
navigate:
|
|
588
|
-
navItems:
|
|
589
|
-
options:
|
|
590
|
-
navPermissionsSettled:
|
|
591
|
-
navSimulating:
|
|
584
|
+
}, []), ac = D((e, t) => {
|
|
585
|
+
rc(e, t), _s.current && Pt(t);
|
|
586
|
+
}, [rc]), oc = ea(), { items: sc, permissionsSettled: cc, simulating: lc } = ia(), Y = A({
|
|
587
|
+
theme: Qs,
|
|
588
|
+
navigate: oc,
|
|
589
|
+
navItems: sc,
|
|
590
|
+
options: Va ?? {},
|
|
591
|
+
navPermissionsSettled: cc,
|
|
592
|
+
navSimulating: lc
|
|
592
593
|
});
|
|
593
594
|
O(() => {
|
|
594
595
|
Y.current = {
|
|
595
|
-
theme:
|
|
596
|
-
navigate:
|
|
597
|
-
navItems:
|
|
598
|
-
options:
|
|
599
|
-
navPermissionsSettled:
|
|
600
|
-
navSimulating:
|
|
596
|
+
theme: Qs,
|
|
597
|
+
navigate: oc,
|
|
598
|
+
navItems: sc,
|
|
599
|
+
options: Va ?? {},
|
|
600
|
+
navPermissionsSettled: cc,
|
|
601
|
+
navSimulating: lc
|
|
601
602
|
};
|
|
602
603
|
}, [
|
|
603
|
-
|
|
604
|
-
ac,
|
|
604
|
+
Qs,
|
|
605
605
|
oc,
|
|
606
|
-
Ba,
|
|
607
606
|
sc,
|
|
608
|
-
|
|
607
|
+
Va,
|
|
608
|
+
cc,
|
|
609
|
+
lc
|
|
609
610
|
]);
|
|
610
611
|
let X = A(!0);
|
|
611
612
|
O(() => (X.current = !0, () => {
|
|
612
613
|
X.current = !1;
|
|
613
614
|
}), []);
|
|
614
|
-
let
|
|
615
|
+
let uc = A({
|
|
615
616
|
tr: P,
|
|
616
617
|
locale: V
|
|
617
|
-
}),
|
|
618
|
-
|
|
619
|
-
let t =
|
|
620
|
-
t && (
|
|
621
|
-
if (
|
|
618
|
+
}), dc = A(null), [fc, pc] = j(null), mc = A(null), hc = D((e) => {
|
|
619
|
+
mc.current !== null && (window.clearTimeout(mc.current), mc.current = null);
|
|
620
|
+
let t = dc.current;
|
|
621
|
+
t && (dc.current = null, window.clearTimeout(t.deadline), X.current && pc(null), e && X.current && (mc.current = window.setTimeout(() => {
|
|
622
|
+
if (mc.current = null, !X.current) return;
|
|
622
623
|
let e = w.getState();
|
|
623
624
|
if (e.activeConversationId !== t.conversationId) return;
|
|
624
625
|
let n = e.conversations.find((e) => e.id === t.conversationId)?.messages.find((e) => e.id === t.messageId);
|
|
625
626
|
if (!n) return;
|
|
626
|
-
let r =
|
|
627
|
+
let r = uc.current, i = nr(n, null, r.tr);
|
|
627
628
|
if (i.kind !== "output") return;
|
|
628
|
-
let a =
|
|
629
|
-
|
|
629
|
+
let a = ci(n, r.tr);
|
|
630
|
+
Nt.publish(n.id, {
|
|
630
631
|
conversationId: t.conversationId,
|
|
631
632
|
channel: n.metadata?.voice === !0 ? "voice" : "chat",
|
|
632
633
|
voiceSessionId: n.metadata?.voiceSessionId,
|
|
@@ -635,44 +636,44 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
635
636
|
final: !0
|
|
636
637
|
});
|
|
637
638
|
}, 0)));
|
|
638
|
-
}, []),
|
|
639
|
+
}, []), gc = D(() => hc(!0), [hc]);
|
|
639
640
|
O(() => {
|
|
640
|
-
|
|
641
|
+
uc.current = {
|
|
641
642
|
tr: P,
|
|
642
643
|
locale: V
|
|
643
644
|
};
|
|
644
|
-
let e =
|
|
645
|
+
let e = dc.current;
|
|
645
646
|
if (!e) return;
|
|
646
|
-
let t =
|
|
647
|
+
let t = li({
|
|
647
648
|
wanted: e.wanted,
|
|
648
649
|
locale: V,
|
|
649
|
-
isLoading:
|
|
650
|
-
translatedNow:
|
|
650
|
+
isLoading: Ga(e.wanted),
|
|
651
|
+
translatedNow: oi(P, e.reply).translated
|
|
651
652
|
});
|
|
652
|
-
if (t === "write")
|
|
653
|
+
if (t === "write") gc();
|
|
653
654
|
else if (t === "grace") {
|
|
654
|
-
let e = window.setTimeout(
|
|
655
|
+
let e = window.setTimeout(gc, 400);
|
|
655
656
|
return () => window.clearTimeout(e);
|
|
656
657
|
}
|
|
657
658
|
}, [
|
|
658
659
|
P,
|
|
659
660
|
V,
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
]), O(() => () =>
|
|
664
|
-
let
|
|
661
|
+
Ga,
|
|
662
|
+
fc,
|
|
663
|
+
gc
|
|
664
|
+
]), O(() => () => hc(!1), [hc]);
|
|
665
|
+
let _c = A(null), [vc, yc] = j(!1), [bc, xc] = j(null), [Z] = j(() => new Di()), [Sc, Cc] = j(0), wc = D(() => Cc((e) => e + 1), []), Tc = D(() => {
|
|
665
666
|
let e = Y.current;
|
|
666
667
|
return {
|
|
667
|
-
destinations:
|
|
668
|
+
destinations: Ur(e.navItems),
|
|
668
669
|
permissionsSettled: e.navPermissionsSettled,
|
|
669
670
|
simulating: e.navSimulating
|
|
670
671
|
};
|
|
671
|
-
}, []),
|
|
672
|
+
}, []), Ec = A(B);
|
|
672
673
|
O(() => {
|
|
673
|
-
|
|
674
|
+
Ec.current = B;
|
|
674
675
|
}, [B]);
|
|
675
|
-
let
|
|
676
|
+
let Dc = D((e, t) => {
|
|
676
677
|
let n = Z.replyIdOf(e), r = n ? Z.turnFor(n) : void 0, i = Z.offer(e), a = {
|
|
677
678
|
ok: !1,
|
|
678
679
|
reason: "gone",
|
|
@@ -684,22 +685,22 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
684
685
|
let o = r.conversationId, s = w.getState().conversations.find((e) => e.id === o);
|
|
685
686
|
if (!s) return a;
|
|
686
687
|
let c = s.messages.find((e) => e.id === n), l = c?.metadata?.voice === !0 ? c.metadata.voiceSessionId : void 0, u = Z.liveOffersFor(n, {
|
|
687
|
-
registry:
|
|
688
|
-
actorId:
|
|
688
|
+
registry: Tc(),
|
|
689
|
+
actorId: Ec.current,
|
|
689
690
|
conversationId: o,
|
|
690
691
|
perfNow: performance.now()
|
|
691
692
|
}).find((t) => t.offer.offerId === e);
|
|
692
693
|
if (!u) {
|
|
693
|
-
let e =
|
|
694
|
+
let e = Ai(i, performance.now());
|
|
694
695
|
return {
|
|
695
696
|
ok: !1,
|
|
696
697
|
reason: e ? "unavailable" : "expired",
|
|
697
|
-
copy: e ?
|
|
698
|
+
copy: e ? ei(P, t || null) : Qr(P),
|
|
698
699
|
conversationId: o,
|
|
699
700
|
voiceSessionId: l
|
|
700
701
|
};
|
|
701
702
|
}
|
|
702
|
-
return Z.markUsed(e) ? (
|
|
703
|
+
return Z.markUsed(e) ? (wc(), {
|
|
703
704
|
ok: !0,
|
|
704
705
|
target: u.target,
|
|
705
706
|
conversationId: o,
|
|
@@ -707,10 +708,10 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
707
708
|
}) : a;
|
|
708
709
|
}, [
|
|
709
710
|
Z,
|
|
710
|
-
|
|
711
|
+
Tc,
|
|
711
712
|
P,
|
|
712
|
-
|
|
713
|
-
]),
|
|
713
|
+
wc
|
|
714
|
+
]), Oc = D((e, t, n, r, i) => {
|
|
714
715
|
let a = N();
|
|
715
716
|
W(e, {
|
|
716
717
|
id: a,
|
|
@@ -720,20 +721,20 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
720
721
|
metadata: {
|
|
721
722
|
lang: n.translated ? V : "en",
|
|
722
723
|
...i ? { localAction: i } : {},
|
|
723
|
-
...
|
|
724
|
+
...pr(t)
|
|
724
725
|
}
|
|
725
|
-
}), i &&
|
|
726
|
-
}, [W, V]),
|
|
726
|
+
}), i && Ui.recordCommittedEntries(e, [a], "NOTE", r);
|
|
727
|
+
}, [W, V]), kc = D((e, t) => (t.status === "kept" || t.status === "refused" && t.reason === "unsaved-changes") && Z.release(e), [Z]), Ac = A(null);
|
|
727
728
|
O(() => () => {
|
|
728
|
-
|
|
729
|
+
Ac.current?.(), Ac.current = null;
|
|
729
730
|
}, []);
|
|
730
|
-
let
|
|
731
|
-
|
|
732
|
-
}, []),
|
|
733
|
-
if (
|
|
734
|
-
let i =
|
|
731
|
+
let jc = D((e) => {
|
|
732
|
+
Ac.current?.(), Ac.current = X.current ? gi(document, e) : null;
|
|
733
|
+
}, []), Mc = D((e, t, n, r = !1) => {
|
|
734
|
+
if (_c.current !== null) return;
|
|
735
|
+
let i = Dc(e, n), a = T(), o = (e, t, n, r) => Oc(e, t, n, a, r);
|
|
735
736
|
if (!i.ok) {
|
|
736
|
-
i.copy && i.conversationId && o(i.conversationId, i.voiceSessionId, i.copy),
|
|
737
|
+
i.copy && i.conversationId && o(i.conversationId, i.voiceSessionId, i.copy), wc();
|
|
737
738
|
return;
|
|
738
739
|
}
|
|
739
740
|
let { target: s, conversationId: c, voiceSessionId: l } = i, u = {
|
|
@@ -741,7 +742,7 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
741
742
|
offerId: e
|
|
742
743
|
};
|
|
743
744
|
if (r) {
|
|
744
|
-
o(c, l,
|
|
745
|
+
o(c, l, Xr(P, s.label, !0), Ri({
|
|
745
746
|
destinationId: s.id,
|
|
746
747
|
path: s.path,
|
|
747
748
|
alreadyHere: !0,
|
|
@@ -751,16 +752,16 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
751
752
|
return;
|
|
752
753
|
}
|
|
753
754
|
let d = N();
|
|
754
|
-
|
|
755
|
+
_c.current = d, yc(!0);
|
|
755
756
|
let f = (t) => {
|
|
756
757
|
try {
|
|
757
|
-
if (
|
|
758
|
+
if (kc(e, t) && (wc(), t.status === "kept" && jc(e)), t.status === "kept" || !w.getState().conversations.some((e) => e.id === c)) return;
|
|
758
759
|
let n = t.status === "arrived" || t.status === "redirected" ? t.landedPath : null;
|
|
759
|
-
o(c, l,
|
|
760
|
+
o(c, l, Zr(P, t, {
|
|
760
761
|
page: s.label,
|
|
761
|
-
landed: n === null ? null :
|
|
762
|
+
landed: n === null ? null : Bi(Ur(Y.current.navItems), n),
|
|
762
763
|
path: s.path
|
|
763
|
-
}),
|
|
764
|
+
}), Ri({
|
|
764
765
|
destinationId: s.id,
|
|
765
766
|
path: s.path,
|
|
766
767
|
alreadyHere: !1,
|
|
@@ -769,10 +770,10 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
769
770
|
offer: u
|
|
770
771
|
}));
|
|
771
772
|
} finally {
|
|
772
|
-
|
|
773
|
+
_c.current === d && (_c.current = null, X.current && yc(!1));
|
|
773
774
|
}
|
|
774
775
|
};
|
|
775
|
-
|
|
776
|
+
Hi(Y.current.navigate, s.path, {
|
|
776
777
|
readPath: () => window.location.pathname + window.location.search,
|
|
777
778
|
now: () => Date.now(),
|
|
778
779
|
schedule: (e, t) => {
|
|
@@ -783,20 +784,20 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
783
784
|
surface: "offer"
|
|
784
785
|
}).then(f, () => f({ status: "unconfirmed" }));
|
|
785
786
|
}, [
|
|
786
|
-
Ec,
|
|
787
787
|
Dc,
|
|
788
|
-
P,
|
|
789
|
-
Cc,
|
|
790
788
|
Oc,
|
|
791
|
-
|
|
792
|
-
|
|
789
|
+
P,
|
|
790
|
+
wc,
|
|
791
|
+
kc,
|
|
792
|
+
jc
|
|
793
|
+
]), Nc = D((e, t) => Mc(e, "tap", t || null), [Mc]), Pc = D((e) => {
|
|
793
794
|
let { replyId: t, conversationId: n } = e, r = Z.turnFor(t);
|
|
794
795
|
if (!r) return;
|
|
795
|
-
let i = window.location.pathname + window.location.search, a =
|
|
796
|
+
let i = window.location.pathname + window.location.search, a = Ur(Y.current.navItems), o = Mi({
|
|
796
797
|
intent: e.intent,
|
|
797
798
|
live: Z.liveOffersFor(t, {
|
|
798
|
-
registry:
|
|
799
|
-
actorId:
|
|
799
|
+
registry: Tc(),
|
|
800
|
+
actorId: Ec.current,
|
|
800
801
|
conversationId: n,
|
|
801
802
|
perfNow: performance.now()
|
|
802
803
|
}),
|
|
@@ -808,50 +809,50 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
808
809
|
location: i,
|
|
809
810
|
conversationId: w.getState().activeConversationId,
|
|
810
811
|
workspaceId: T(),
|
|
811
|
-
actorId:
|
|
812
|
+
actorId: Ec.current ?? null
|
|
812
813
|
},
|
|
813
814
|
mounted: X.current,
|
|
814
815
|
visible: document.visibilityState === "visible",
|
|
815
|
-
unsavedChanges:
|
|
816
|
+
unsavedChanges: Ni(Y.current.options),
|
|
816
817
|
alreadyThere: ({ target: e }) => {
|
|
817
818
|
let t = a.find((t) => t.id === e.id);
|
|
818
|
-
return t ?
|
|
819
|
+
return t ? Br(t, i, a) : !1;
|
|
819
820
|
}
|
|
820
821
|
});
|
|
821
822
|
if (o.act === "navigate" || o.act === "already-here") {
|
|
822
|
-
|
|
823
|
+
Mc(o.offer.offer.offerId, "resolve", o.offer.target.label, o.act === "already-here");
|
|
823
824
|
return;
|
|
824
825
|
}
|
|
825
826
|
let [s] = o.unsaved ?? [], [c] = Z.liveOffersFor(t, {
|
|
826
|
-
registry:
|
|
827
|
-
actorId:
|
|
827
|
+
registry: Tc(),
|
|
828
|
+
actorId: Ec.current,
|
|
828
829
|
conversationId: n,
|
|
829
830
|
perfNow: performance.now()
|
|
830
831
|
});
|
|
831
|
-
o.hold === "R5-unsaved" && s && c &&
|
|
832
|
+
o.hold === "R5-unsaved" && s && c && Oc(n, e.voiceSessionId, $r(P, s.label, c.target.label), T());
|
|
832
833
|
}, [
|
|
833
834
|
Z,
|
|
834
|
-
|
|
835
|
+
Tc,
|
|
835
836
|
K,
|
|
836
|
-
|
|
837
|
-
|
|
837
|
+
Mc,
|
|
838
|
+
Oc,
|
|
838
839
|
P
|
|
839
|
-
]),
|
|
840
|
+
]), Fc = D((e) => {
|
|
840
841
|
let t = w.getState(), n = t.conversations.find((e) => e.id === t.activeConversationId);
|
|
841
|
-
return n ? Fi
|
|
842
|
-
}, []),
|
|
843
|
-
let { navItems: i, options: a, theme: o, navigate: s } = Y.current, c =
|
|
842
|
+
return n ? Ii(Fi, window.location.pathname, Vi(n.messages, e)) : !1;
|
|
843
|
+
}, []), Ic = Ce(), Lc = mi(), Rc = Ic?.request ?? null, zc = D((e, t, n = !1, r = !1) => {
|
|
844
|
+
let { navItems: i, options: a, theme: o, navigate: s } = Y.current, c = Ur(i), l = null, u = {
|
|
844
845
|
...a,
|
|
845
|
-
locale: t === void 0 ? V :
|
|
846
|
+
locale: t === void 0 ? V : Qa.input.code,
|
|
846
847
|
uiLocale: V,
|
|
847
|
-
inputLocale:
|
|
848
|
+
inputLocale: Qa.input.code
|
|
848
849
|
};
|
|
849
|
-
if (r ||
|
|
850
|
-
let e = w.getState(), n = e.conversations.find((t) => t.id === e.activeConversationId), r = n ?
|
|
850
|
+
if (r || Hr(e, u)) {
|
|
851
|
+
let e = w.getState(), n = e.conversations.find((t) => t.id === e.activeConversationId), r = n ? vi(n.messages, t, { lookThroughRefusedOffers: { ownsOffer: (e, t) => Z.offersFor(e.id).some((e) => e.offerId === t) } }) : null, o = n ? e.processingByConversationId[n.id] ?? null : null, s = o !== null && o.messageId === r?.id && Mn(o.status);
|
|
851
852
|
if (n && r && !s) {
|
|
852
853
|
let e = Z.liveOffersFor(r.id, {
|
|
853
|
-
registry:
|
|
854
|
-
actorId:
|
|
854
|
+
registry: Tc(),
|
|
855
|
+
actorId: Ec.current,
|
|
855
856
|
conversationId: n.id,
|
|
856
857
|
perfNow: performance.now()
|
|
857
858
|
}).flatMap(({ offer: e, target: t }) => {
|
|
@@ -861,14 +862,14 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
861
862
|
target: n
|
|
862
863
|
}] : [];
|
|
863
864
|
});
|
|
864
|
-
l =
|
|
865
|
+
l = _i({
|
|
865
866
|
reply: r,
|
|
866
|
-
text:
|
|
867
|
+
text: ar(r, o, P),
|
|
867
868
|
resolve: {
|
|
868
869
|
destinations: c,
|
|
869
870
|
entityRoutes: a.entityRoutes,
|
|
870
|
-
visibleNavIds:
|
|
871
|
-
nounLabel: (e) =>
|
|
871
|
+
visibleNavIds: xi(i),
|
|
872
|
+
nounLabel: (e) => Jr(P, e)
|
|
872
873
|
},
|
|
873
874
|
offers: e
|
|
874
875
|
});
|
|
@@ -878,18 +879,18 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
878
879
|
destinations: c,
|
|
879
880
|
sentenceOptions: u,
|
|
880
881
|
context: {
|
|
881
|
-
backRunnable:
|
|
882
|
+
backRunnable: Fc(t),
|
|
882
883
|
navigation: l,
|
|
883
884
|
skipRecords: n,
|
|
884
|
-
controls:
|
|
885
|
+
controls: di(),
|
|
885
886
|
executors: {
|
|
886
887
|
theme: o !== null,
|
|
887
888
|
navigation: s !== null,
|
|
888
|
-
conversationDelete:
|
|
889
|
+
conversationDelete: Rc !== null,
|
|
889
890
|
appControl: (e) => {
|
|
890
891
|
try {
|
|
891
|
-
let n =
|
|
892
|
-
return n !== null && (n.kind !== "confirm" ||
|
|
892
|
+
let n = ui(e, { voiceLive: t !== void 0 || Yl.current });
|
|
893
|
+
return n !== null && (n.kind !== "confirm" || Lc !== null);
|
|
893
894
|
} catch {
|
|
894
895
|
return !1;
|
|
895
896
|
}
|
|
@@ -898,34 +899,34 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
898
899
|
}
|
|
899
900
|
};
|
|
900
901
|
}, [
|
|
901
|
-
|
|
902
|
-
|
|
902
|
+
Fc,
|
|
903
|
+
Qa,
|
|
903
904
|
V,
|
|
904
905
|
P,
|
|
905
906
|
Z,
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
]),
|
|
910
|
-
let { destinations: r, sentenceOptions: i, context: a } =
|
|
911
|
-
return
|
|
912
|
-
}, [
|
|
913
|
-
if (
|
|
914
|
-
|
|
907
|
+
Tc,
|
|
908
|
+
Rc,
|
|
909
|
+
Lc
|
|
910
|
+
]), Bc = D((e, t, n = !1) => {
|
|
911
|
+
let { destinations: r, sentenceOptions: i, context: a } = zc(e, t, n);
|
|
912
|
+
return Vr(e, r, i, a);
|
|
913
|
+
}, [zc]), Vc = D((e) => {
|
|
914
|
+
if (Vs.current = e, Da?.(Oe(e)), Hs.cancel(), !e.text.trim() && !e.hasAttachments) {
|
|
915
|
+
Bs.current = !1;
|
|
915
916
|
return;
|
|
916
917
|
}
|
|
917
|
-
if (
|
|
918
|
+
if (Bs.current) return;
|
|
918
919
|
let t = () => {
|
|
919
|
-
|
|
920
|
+
Bs.current = !0, zs(!1);
|
|
920
921
|
};
|
|
921
|
-
e.hasAttachments || e.dictated ? t() :
|
|
922
|
-
if (!
|
|
922
|
+
e.hasAttachments || e.dictated ? t() : Hs.schedule(() => {
|
|
923
|
+
if (!Bs.current) {
|
|
923
924
|
try {
|
|
924
|
-
let { destinations: t, sentenceOptions: n, context: r } =
|
|
925
|
-
if (
|
|
925
|
+
let { destinations: t, sentenceOptions: n, context: r } = zc(e.text, void 0, !1, !0);
|
|
926
|
+
if (zr(e.text, t, n, r)) return;
|
|
926
927
|
} catch {
|
|
927
|
-
if (!
|
|
928
|
-
|
|
928
|
+
if (!_a) {
|
|
929
|
+
_a = !0;
|
|
929
930
|
try {
|
|
930
931
|
i.getLogger("assistant").warn("Draft command classification failed; using standard warm-up.");
|
|
931
932
|
} catch {}
|
|
@@ -935,36 +936,36 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
935
936
|
}
|
|
936
937
|
});
|
|
937
938
|
}, [
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
939
|
+
Hs,
|
|
940
|
+
Da,
|
|
941
|
+
zs,
|
|
942
|
+
zc
|
|
942
943
|
]);
|
|
943
944
|
O(() => {
|
|
944
945
|
let e = () => {
|
|
945
|
-
|
|
946
|
-
}, t =
|
|
946
|
+
Vs.current && Vc(Vs.current);
|
|
947
|
+
}, t = fi(e), n = Li(window, e), r = Fi.subscribe(e);
|
|
947
948
|
return () => {
|
|
948
|
-
t(), n(), r(),
|
|
949
|
+
t(), n(), r(), Hs.cancel();
|
|
949
950
|
};
|
|
950
|
-
}, [
|
|
951
|
-
|
|
951
|
+
}, [Hs, Vc]), O(() => {
|
|
952
|
+
Vs.current && Vc(Vs.current);
|
|
952
953
|
}, [
|
|
953
|
-
|
|
954
|
-
oc,
|
|
955
|
-
Ba,
|
|
954
|
+
Vc,
|
|
956
955
|
sc,
|
|
956
|
+
Va,
|
|
957
957
|
cc,
|
|
958
|
-
|
|
959
|
-
|
|
958
|
+
lc,
|
|
959
|
+
Qs,
|
|
960
|
+
oc,
|
|
960
961
|
U,
|
|
961
|
-
|
|
962
|
+
Sc,
|
|
962
963
|
H,
|
|
963
964
|
G?.messages,
|
|
964
|
-
|
|
965
|
+
To
|
|
965
966
|
]);
|
|
966
|
-
let
|
|
967
|
-
let n =
|
|
967
|
+
let Hc = D((e, t) => {
|
|
968
|
+
let n = Bc(e, t);
|
|
968
969
|
if (!n) return !1;
|
|
969
970
|
let { theme: r, navigate: i } = Y.current;
|
|
970
971
|
switch (n.kind) {
|
|
@@ -976,14 +977,14 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
976
977
|
case "link-not-openable":
|
|
977
978
|
case "back": return i !== null;
|
|
978
979
|
case "conversation-delete": return !1;
|
|
979
|
-
case "app-control": return
|
|
980
|
+
case "app-control": return ui(n.request, { voiceLive: t !== void 0 || Yl.current }) !== null;
|
|
980
981
|
case "open-record": return !1;
|
|
981
982
|
}
|
|
982
|
-
}, [
|
|
983
|
+
}, [Bc]), Uc = A(Hc);
|
|
983
984
|
O(() => {
|
|
984
|
-
|
|
985
|
-
}, [
|
|
986
|
-
let
|
|
985
|
+
Uc.current = Hc;
|
|
986
|
+
}, [Hc]);
|
|
987
|
+
let Wc = D((e, t) => {
|
|
987
988
|
let n = {
|
|
988
989
|
state: "none",
|
|
989
990
|
accept: null
|
|
@@ -992,16 +993,16 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
992
993
|
let o = w.getState(), s = o.conversations.find((t) => t.id === e);
|
|
993
994
|
if (!s) return n;
|
|
994
995
|
let c = o.processingByConversationId[s.id] ?? null, l = {
|
|
995
|
-
registry:
|
|
996
|
-
actorId:
|
|
996
|
+
registry: Tc(),
|
|
997
|
+
actorId: Ec.current,
|
|
997
998
|
conversationId: s.id,
|
|
998
999
|
perfNow: performance.now()
|
|
999
|
-
}, { state: u, reply: d } =
|
|
1000
|
+
}, { state: u, reply: d } = Ei(Z, {
|
|
1000
1001
|
...l,
|
|
1001
1002
|
messages: s.messages,
|
|
1002
1003
|
voiceSessionId: t,
|
|
1003
1004
|
processing: c,
|
|
1004
|
-
displayedText: (e) =>
|
|
1005
|
+
displayedText: (e) => ar(e, c, P),
|
|
1005
1006
|
productWriteApproval: z,
|
|
1006
1007
|
capabilitiesOf: (e) => w.getState().sandboxWriteCapabilities[e]
|
|
1007
1008
|
});
|
|
@@ -1009,7 +1010,7 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1009
1010
|
state: u,
|
|
1010
1011
|
accept: null
|
|
1011
1012
|
};
|
|
1012
|
-
let [f] = Z.liveOffersFor(d.id, l), p = f ?
|
|
1013
|
+
let [f] = Z.liveOffersFor(d.id, l), p = f ? Ur(a).find((e) => e.id === f.target.id) : void 0;
|
|
1013
1014
|
return !f || !p ? n : {
|
|
1014
1015
|
state: u,
|
|
1015
1016
|
accept: {
|
|
@@ -1019,10 +1020,10 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1019
1020
|
};
|
|
1020
1021
|
}, [
|
|
1021
1022
|
Z,
|
|
1022
|
-
|
|
1023
|
+
Tc,
|
|
1023
1024
|
z,
|
|
1024
1025
|
P
|
|
1025
|
-
]),
|
|
1026
|
+
]), Gc = D((e, t, n, r, i, a) => {
|
|
1026
1027
|
let o = P(n.key, n.fallback, r), s = n.fallback.replace(/\{\{\s*count\s*\}\}/g, String(r.count)), c = {
|
|
1027
1028
|
kind: "write-reply",
|
|
1028
1029
|
line: n.key
|
|
@@ -1034,7 +1035,7 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1034
1035
|
timestamp: l,
|
|
1035
1036
|
metadata: {
|
|
1036
1037
|
localAction: c,
|
|
1037
|
-
...
|
|
1038
|
+
...pr(i)
|
|
1038
1039
|
}
|
|
1039
1040
|
});
|
|
1040
1041
|
let d = N();
|
|
@@ -1046,55 +1047,55 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1046
1047
|
metadata: {
|
|
1047
1048
|
lang: o === s ? "en" : V,
|
|
1048
1049
|
localAction: c,
|
|
1049
|
-
...
|
|
1050
|
+
...pr(i)
|
|
1050
1051
|
}
|
|
1051
|
-
}),
|
|
1052
|
+
}), Ui.recordCommittedEntries(e, [u, d], "LOCAL_COMMAND", T()), a !== void 0 && ac(a, {
|
|
1052
1053
|
conversationId: e,
|
|
1053
1054
|
questionId: u,
|
|
1054
1055
|
replyId: d
|
|
1055
|
-
}),
|
|
1056
|
+
}), $s(e, d);
|
|
1056
1057
|
}, [
|
|
1057
1058
|
W,
|
|
1058
1059
|
V,
|
|
1059
|
-
|
|
1060
|
-
|
|
1060
|
+
ac,
|
|
1061
|
+
$s,
|
|
1061
1062
|
P
|
|
1062
|
-
]),
|
|
1063
|
+
]), Kc = A(() => void 0), [qc, Jc] = j(null);
|
|
1063
1064
|
O(() => {
|
|
1064
|
-
if (
|
|
1065
|
-
let e = window.setTimeout(() =>
|
|
1065
|
+
if (qc === null) return;
|
|
1066
|
+
let e = window.setTimeout(() => Jc(null), ya);
|
|
1066
1067
|
return () => window.clearTimeout(e);
|
|
1067
|
-
}, [
|
|
1068
|
-
let
|
|
1068
|
+
}, [qc]);
|
|
1069
|
+
let Yc = D(() => {
|
|
1069
1070
|
let e = w.getState();
|
|
1070
|
-
return
|
|
1071
|
-
}, [
|
|
1072
|
-
if (!
|
|
1073
|
-
let t = e !== void 0, n = w.getState(), r =
|
|
1071
|
+
return so(void 0, e.autoRouting && is.current ? b : e.mode, e.autoRouting ? { routedBy: "auto" } : void 0);
|
|
1072
|
+
}, [so]), Xc = D((e) => {
|
|
1073
|
+
if (!Rc) return !1;
|
|
1074
|
+
let t = e !== void 0, n = w.getState(), r = $i({
|
|
1074
1075
|
spoken: t,
|
|
1075
|
-
bound:
|
|
1076
|
+
bound: ys.current,
|
|
1076
1077
|
activeConversationId: n.activeConversationId,
|
|
1077
1078
|
conversations: n.conversations,
|
|
1078
|
-
historyOn:
|
|
1079
|
+
historyOn: we()
|
|
1079
1080
|
});
|
|
1080
|
-
if (r &&
|
|
1081
|
+
if (r && Rc(r), t) {
|
|
1081
1082
|
let e = r ? "Opened the delete confirmation. Choose Delete or Cancel on screen." : "There is no conversation to delete.", t = r ? P("deleteConversation.opened", "Opened the delete confirmation. Choose Delete or Cancel on screen.") : P("deleteConversation.nothing", "There is no conversation to delete.");
|
|
1082
|
-
|
|
1083
|
+
Kc.current({
|
|
1083
1084
|
id: `conversation-delete:${N()}`,
|
|
1084
1085
|
text: t,
|
|
1085
1086
|
lang: t === e ? "en" : V
|
|
1086
1087
|
});
|
|
1087
|
-
} else r ||
|
|
1088
|
+
} else r || Jc(Date.now());
|
|
1088
1089
|
return !0;
|
|
1089
1090
|
}, [
|
|
1090
|
-
|
|
1091
|
+
Rc,
|
|
1091
1092
|
V,
|
|
1092
1093
|
P
|
|
1093
|
-
]),
|
|
1094
|
-
if (e.kind === "conversation-delete") return
|
|
1094
|
+
]), Zc = D((e, t, n, r = !1, i) => {
|
|
1095
|
+
if (e.kind === "conversation-delete") return Xc(n);
|
|
1095
1096
|
let { theme: a, navigate: o } = Y.current, s = null, c = () => {
|
|
1096
|
-
let e = (r ? null : s ?? w.getState().activeConversationId) ??
|
|
1097
|
-
return r &&
|
|
1097
|
+
let e = (r ? null : s ?? w.getState().activeConversationId) ?? Yc();
|
|
1098
|
+
return r && ws(e), e;
|
|
1098
1099
|
}, l = (e, r) => {
|
|
1099
1100
|
let i = N();
|
|
1100
1101
|
return W(e, {
|
|
@@ -1104,7 +1105,7 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1104
1105
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1105
1106
|
metadata: {
|
|
1106
1107
|
localAction: r,
|
|
1107
|
-
...
|
|
1108
|
+
...pr(n)
|
|
1108
1109
|
}
|
|
1109
1110
|
}), i;
|
|
1110
1111
|
}, u = (e, t, r, a, o, s, c) => {
|
|
@@ -1117,35 +1118,35 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1117
1118
|
metadata: {
|
|
1118
1119
|
lang: r.translated ? V : "en",
|
|
1119
1120
|
localAction: a,
|
|
1120
|
-
...
|
|
1121
|
+
...pr(n)
|
|
1121
1122
|
}
|
|
1122
|
-
}),
|
|
1123
|
+
}), Ui.recordCommittedEntries(e, [t, l], "LOCAL_COMMAND", o), i !== void 0 && ac(i, {
|
|
1123
1124
|
conversationId: e,
|
|
1124
1125
|
questionId: t,
|
|
1125
1126
|
replyId: l
|
|
1126
|
-
}), s &&
|
|
1127
|
+
}), s && $s(e, l), l;
|
|
1127
1128
|
}, d = (e, t, n) => {
|
|
1128
1129
|
let r = c(), i = l(r, t), a = u(r, i, e, t, T(), !0);
|
|
1129
1130
|
return n?.(a), !0;
|
|
1130
1131
|
}, f = (e) => {
|
|
1131
|
-
let t = c(), n = T(), r = window.location.pathname, a =
|
|
1132
|
+
let t = c(), n = T(), r = window.location.pathname, a = Ri({
|
|
1132
1133
|
destinationId: e.destinationId,
|
|
1133
1134
|
path: e.registryPath,
|
|
1134
1135
|
alreadyHere: !1,
|
|
1135
1136
|
via: e.via,
|
|
1136
1137
|
offer: e.offer
|
|
1137
1138
|
}), s = l(t, a), d = i === void 0 ? void 0 : N();
|
|
1138
|
-
i !== void 0 && d !== void 0 && (
|
|
1139
|
+
i !== void 0 && d !== void 0 && (rc(i, {
|
|
1139
1140
|
conversationId: t,
|
|
1140
1141
|
questionId: s,
|
|
1141
1142
|
replyId: d
|
|
1142
|
-
}),
|
|
1143
|
+
}), xc(d));
|
|
1143
1144
|
let f = N();
|
|
1144
|
-
|
|
1145
|
+
_c.current = f, yc(!0);
|
|
1145
1146
|
let p = (i) => {
|
|
1146
1147
|
try {
|
|
1147
|
-
if (e.offer &&
|
|
1148
|
-
let a =
|
|
1148
|
+
if (e.offer && kc(e.offer.offerId, i) && wc(), i.status === "kept" || !w.getState().conversations.some((e) => e.id === t)) return;
|
|
1149
|
+
let a = Ur(Y.current.navItems), o = i.status === "arrived" || i.status === "redirected" ? i.landedPath : null, c = Ri({
|
|
1149
1150
|
destinationId: e.destinationId,
|
|
1150
1151
|
path: e.registryPath,
|
|
1151
1152
|
alreadyHere: !1,
|
|
@@ -1153,10 +1154,10 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1153
1154
|
outcome: i,
|
|
1154
1155
|
offer: e.offer
|
|
1155
1156
|
});
|
|
1156
|
-
|
|
1157
|
-
let l = e.via === "back" && i.status === "arrived" ?
|
|
1157
|
+
uo(t, s, { localAction: c });
|
|
1158
|
+
let l = e.via === "back" && i.status === "arrived" ? Gr(P, e.pageLabel()) : Zr(P, i, {
|
|
1158
1159
|
page: e.pageLabel(),
|
|
1159
|
-
landed: o === null ? null :
|
|
1160
|
+
landed: o === null ? null : Bi(a, o),
|
|
1160
1161
|
path: e.target
|
|
1161
1162
|
}), f = u(t, s, l, c, n, X.current, d);
|
|
1162
1163
|
i.status === "arrived" && e.onArrived?.({
|
|
@@ -1165,10 +1166,10 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1165
1166
|
landedPath: i.landedPath
|
|
1166
1167
|
});
|
|
1167
1168
|
} finally {
|
|
1168
|
-
|
|
1169
|
+
_c.current === f && (_c.current = null, X.current && yc(!1)), d !== void 0 && X.current && xc((e) => e === d ? null : e);
|
|
1169
1170
|
}
|
|
1170
1171
|
};
|
|
1171
|
-
return
|
|
1172
|
+
return Hi(o, e.target, {
|
|
1172
1173
|
readPath: () => window.location.pathname + window.location.search,
|
|
1173
1174
|
now: () => Date.now(),
|
|
1174
1175
|
schedule: (e, t) => {
|
|
@@ -1176,7 +1177,7 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1176
1177
|
},
|
|
1177
1178
|
isShellLess: () => !X.current
|
|
1178
1179
|
}).then(p, () => p({ status: "unconfirmed" })), !0;
|
|
1179
|
-
}, p = ({ replyId: e, fromPath: t, landedPath: n }) =>
|
|
1180
|
+
}, p = ({ replyId: e, fromPath: t, landedPath: n }) => Fi.push({
|
|
1180
1181
|
fromPath: t,
|
|
1181
1182
|
toPath: n,
|
|
1182
1183
|
replyMessageId: e,
|
|
@@ -1184,21 +1185,21 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1184
1185
|
});
|
|
1185
1186
|
if (e.kind === "theme") {
|
|
1186
1187
|
if (!a) return !1;
|
|
1187
|
-
let t =
|
|
1188
|
+
let t = Wr(e.request, {
|
|
1188
1189
|
mode: a.mode,
|
|
1189
1190
|
resolvedTheme: a.resolvedTheme
|
|
1190
1191
|
});
|
|
1191
1192
|
if (!t.alreadyApplied) try {
|
|
1192
1193
|
a.setMode(t.mode);
|
|
1193
1194
|
} catch {}
|
|
1194
|
-
return d(
|
|
1195
|
+
return d(ii(P, t, e.request.kind === "family"), {
|
|
1195
1196
|
kind: "theme",
|
|
1196
1197
|
mode: t.mode,
|
|
1197
1198
|
alreadyApplied: t.alreadyApplied
|
|
1198
1199
|
});
|
|
1199
1200
|
}
|
|
1200
1201
|
if (e.kind === "app-control") {
|
|
1201
|
-
let t =
|
|
1202
|
+
let t = ui(e.request, { voiceLive: n !== void 0 || Yl.current });
|
|
1202
1203
|
if (!t) return !1;
|
|
1203
1204
|
let r = (e) => ({
|
|
1204
1205
|
kind: "app-control",
|
|
@@ -1206,34 +1207,34 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1206
1207
|
outcome: e.outcome,
|
|
1207
1208
|
...e.reply.code === "language" ? { languageLabel: e.reply.label } : {}
|
|
1208
1209
|
}), i = (t) => {
|
|
1209
|
-
if (e.request.control === "language" &&
|
|
1210
|
-
let n = c(), i = r(t), a = l(n, i), o = u(n, a,
|
|
1211
|
-
return
|
|
1210
|
+
if (e.request.control === "language" && hc(!1), e.request.control === "language" && t.reply.code === "language" && !t.reply.already && t.outcome === "done") {
|
|
1211
|
+
let n = c(), i = r(t), a = l(n, i), o = u(n, a, oi((e, t) => t, t.reply), i, T(), !1);
|
|
1212
|
+
return dc.current = {
|
|
1212
1213
|
wanted: e.request.code,
|
|
1213
1214
|
reply: t.reply,
|
|
1214
1215
|
conversationId: n,
|
|
1215
1216
|
messageId: o,
|
|
1216
|
-
deadline: window.setTimeout(
|
|
1217
|
-
},
|
|
1217
|
+
deadline: window.setTimeout(gc, si)
|
|
1218
|
+
}, pc(o), !0;
|
|
1218
1219
|
}
|
|
1219
|
-
return d(
|
|
1220
|
+
return d(oi(P, t.reply), r(t));
|
|
1220
1221
|
};
|
|
1221
1222
|
if (t.kind === "reply") return i(t.run);
|
|
1222
1223
|
if (t.kind === "run") {
|
|
1223
1224
|
let e = t.run();
|
|
1224
1225
|
return t.silent && (e.outcome === "done" || e.outcome === "already") ? !0 : i(e);
|
|
1225
1226
|
}
|
|
1226
|
-
let a =
|
|
1227
|
+
let a = Lc;
|
|
1227
1228
|
if (!a) return !1;
|
|
1228
1229
|
let o = null;
|
|
1229
|
-
return d(
|
|
1230
|
+
return d(oi(P, t.ask.reply), r(t.ask), (e) => {
|
|
1230
1231
|
o = w.getState().conversations.find((t) => t.messages.some((t) => t.id === e))?.id ?? null;
|
|
1231
1232
|
}), a.request({
|
|
1232
1233
|
prompt: t.prompt,
|
|
1233
1234
|
onConfirm: () => {
|
|
1234
1235
|
let e = t.confirmed(), i = o, a = i !== null && w.getState().conversations.some((e) => e.id === i);
|
|
1235
1236
|
if (!i || !a) return;
|
|
1236
|
-
let s =
|
|
1237
|
+
let s = oi(P, e.reply);
|
|
1237
1238
|
W(i, {
|
|
1238
1239
|
id: N(),
|
|
1239
1240
|
role: "assistant",
|
|
@@ -1242,30 +1243,30 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1242
1243
|
metadata: {
|
|
1243
1244
|
lang: s.translated ? V : "en",
|
|
1244
1245
|
localAction: r(e),
|
|
1245
|
-
...
|
|
1246
|
+
...pr(n)
|
|
1246
1247
|
}
|
|
1247
1248
|
});
|
|
1248
1249
|
}
|
|
1249
1250
|
}), !0;
|
|
1250
1251
|
}
|
|
1251
1252
|
if (!o) return !1;
|
|
1252
|
-
if (e.kind === "choose-destination") return d(
|
|
1253
|
+
if (e.kind === "choose-destination") return d(Kr(P, e.candidates[0]?.label ?? e.query, e.candidates), {
|
|
1253
1254
|
kind: "choose-destination",
|
|
1254
1255
|
candidateIds: e.candidates.map((e) => e.id)
|
|
1255
|
-
}, (t) =>
|
|
1256
|
-
if (e.kind === "choose-linked") return d(
|
|
1256
|
+
}, (t) => yi(t, e.candidates));
|
|
1257
|
+
if (e.kind === "choose-linked") return d(qr(P, e.candidates), {
|
|
1257
1258
|
kind: "choose-destination",
|
|
1258
1259
|
candidateIds: e.candidates.map((e) => e.id)
|
|
1259
|
-
}, (t) =>
|
|
1260
|
+
}, (t) => yi(t, e.candidates));
|
|
1260
1261
|
if (e.kind === "pick-from-list") {
|
|
1261
1262
|
let t = e.candidates !== null && e.candidates.every((e) => e !== null) ? e.candidates : null;
|
|
1262
|
-
return d(
|
|
1263
|
+
return d(ti(P), t ? {
|
|
1263
1264
|
kind: "choose-destination",
|
|
1264
1265
|
candidateIds: t.map((e) => e.id)
|
|
1265
1266
|
} : e.candidateIds.length > 0 ? {
|
|
1266
1267
|
kind: "choose-destination",
|
|
1267
1268
|
candidateIds: [...e.candidateIds]
|
|
1268
|
-
} :
|
|
1269
|
+
} : Ri({
|
|
1269
1270
|
destinationId: "",
|
|
1270
1271
|
path: "",
|
|
1271
1272
|
alreadyHere: !1,
|
|
@@ -1274,9 +1275,9 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1274
1275
|
status: "refused",
|
|
1275
1276
|
reason: "not-routable"
|
|
1276
1277
|
}
|
|
1277
|
-
}), t ? (e) =>
|
|
1278
|
+
}), t ? (e) => yi(e, t) : void 0);
|
|
1278
1279
|
}
|
|
1279
|
-
if (e.kind === "link-not-openable") return d(
|
|
1280
|
+
if (e.kind === "link-not-openable") return d(Yr(P), Ri({
|
|
1280
1281
|
destinationId: "",
|
|
1281
1282
|
path: "",
|
|
1282
1283
|
alreadyHere: !1,
|
|
@@ -1289,7 +1290,7 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1289
1290
|
if (e.kind === "open-record") {
|
|
1290
1291
|
let r;
|
|
1291
1292
|
try {
|
|
1292
|
-
let { options: t, navItems: n } = Y.current, i = t.entityRoutes ?? [], a =
|
|
1293
|
+
let { options: t, navItems: n } = Y.current, i = t.entityRoutes ?? [], a = xi(n);
|
|
1293
1294
|
r = (t.records ?? []).flatMap((t) => {
|
|
1294
1295
|
let n = i.find((e) => e.id === t.entityRouteId), r = e.request.adapterIds.length === 0 || e.request.adapterIds.includes(t.id);
|
|
1295
1296
|
return n && r && (n.visibleWith === void 0 || a.has(n.visibleWith)) ? [{
|
|
@@ -1302,18 +1303,18 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1302
1303
|
}
|
|
1303
1304
|
if (r.length === 0) return !1;
|
|
1304
1305
|
let i = w.getState().activeConversationId, a = N();
|
|
1305
|
-
|
|
1306
|
+
_c.current = a, yc(!0);
|
|
1306
1307
|
let o = () => {
|
|
1307
|
-
|
|
1308
|
+
_c.current === a && (_c.current = null, X.current && yc(!1));
|
|
1308
1309
|
};
|
|
1309
1310
|
return (async () => {
|
|
1310
1311
|
let a = { kind: "none" }, c = !0;
|
|
1311
1312
|
try {
|
|
1312
|
-
a = await
|
|
1313
|
+
a = await bi({
|
|
1313
1314
|
name: e.request.name,
|
|
1314
1315
|
usable: r,
|
|
1315
|
-
nounOf: (e) =>
|
|
1316
|
-
timeoutMs:
|
|
1316
|
+
nounOf: (e) => Jr(P, e.noun),
|
|
1317
|
+
timeoutMs: fa
|
|
1317
1318
|
}), c = w.getState().conversations.some((e) => e.id === i);
|
|
1318
1319
|
} catch {
|
|
1319
1320
|
a = { kind: "none" };
|
|
@@ -1322,7 +1323,7 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1322
1323
|
}
|
|
1323
1324
|
if (!X.current) return;
|
|
1324
1325
|
if (a.kind === "none") {
|
|
1325
|
-
|
|
1326
|
+
nl.current(t, [], {
|
|
1326
1327
|
fromPerson: !0,
|
|
1327
1328
|
...n === void 0 ? {} : { voiceSessionId: n },
|
|
1328
1329
|
localRecordsChecked: !0
|
|
@@ -1343,16 +1344,16 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1343
1344
|
return;
|
|
1344
1345
|
}
|
|
1345
1346
|
let l = a.candidates[0];
|
|
1346
|
-
d(a.why === "kinds" ?
|
|
1347
|
+
d(a.why === "kinds" ? ri(P, a.nouns, a.candidates) : ni(P, a.nouns[0] ?? "", l?.label ?? e.request.name, a.candidates), {
|
|
1347
1348
|
kind: "choose-destination",
|
|
1348
1349
|
candidateIds: a.candidates.map((e) => e.id)
|
|
1349
|
-
}, (e) =>
|
|
1350
|
+
}, (e) => yi(e, a.candidates));
|
|
1350
1351
|
})().catch(() => void 0), !0;
|
|
1351
1352
|
}
|
|
1352
1353
|
if (e.kind === "back") {
|
|
1353
|
-
let e =
|
|
1354
|
+
let e = Fi.top();
|
|
1354
1355
|
if (!e) return !1;
|
|
1355
|
-
let t =
|
|
1356
|
+
let t = Ur(Y.current.navItems), n = zi(t, e.fromPath);
|
|
1356
1357
|
return f({
|
|
1357
1358
|
target: e.fromPath,
|
|
1358
1359
|
destinationId: n?.id ?? "",
|
|
@@ -1360,27 +1361,27 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1360
1361
|
via: "back",
|
|
1361
1362
|
pageLabel: () => n?.label ?? null,
|
|
1362
1363
|
onArrived: () => {
|
|
1363
|
-
|
|
1364
|
+
Fi.top() === e && Fi.pop();
|
|
1364
1365
|
}
|
|
1365
1366
|
});
|
|
1366
1367
|
}
|
|
1367
1368
|
let ee, m = e.destination;
|
|
1368
1369
|
if (e.via === "offer") {
|
|
1369
|
-
let t =
|
|
1370
|
-
if (!t.ok) return d(t.copy ??
|
|
1370
|
+
let t = Dc(e.offerId, e.destination.label);
|
|
1371
|
+
if (!t.ok) return d(t.copy ?? Qr(P), {
|
|
1371
1372
|
kind: "write-reply",
|
|
1372
1373
|
line: t.reason === "unavailable" ? "offer.notAvailable" : "offer.expired"
|
|
1373
1374
|
});
|
|
1374
1375
|
ee = {
|
|
1375
1376
|
trigger: e.trigger,
|
|
1376
1377
|
offerId: e.offerId
|
|
1377
|
-
}, m =
|
|
1378
|
+
}, m = Ur(Y.current.navItems).find((e) => e.id === t.target.id) ?? {
|
|
1378
1379
|
id: t.target.id,
|
|
1379
1380
|
label: t.target.label,
|
|
1380
1381
|
path: t.target.path
|
|
1381
1382
|
};
|
|
1382
1383
|
}
|
|
1383
|
-
return
|
|
1384
|
+
return Br(m, window.location.pathname + window.location.search, Ur(Y.current.navItems)) ? d(Xr(P, m.label, !0), Ri({
|
|
1384
1385
|
destinationId: m.id,
|
|
1385
1386
|
path: m.path,
|
|
1386
1387
|
alreadyHere: !0,
|
|
@@ -1397,54 +1398,54 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1397
1398
|
});
|
|
1398
1399
|
}, [
|
|
1399
1400
|
W,
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
Jc,
|
|
1403
|
-
hc,
|
|
1404
|
-
V,
|
|
1405
|
-
lo,
|
|
1406
|
-
nc,
|
|
1401
|
+
ws,
|
|
1402
|
+
Lc,
|
|
1407
1403
|
Yc,
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1404
|
+
gc,
|
|
1405
|
+
V,
|
|
1406
|
+
uo,
|
|
1407
|
+
rc,
|
|
1408
|
+
Xc,
|
|
1409
|
+
ac,
|
|
1410
|
+
hc,
|
|
1411
|
+
$s,
|
|
1411
1412
|
P,
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
]),
|
|
1416
|
-
|
|
1413
|
+
Dc,
|
|
1414
|
+
kc,
|
|
1415
|
+
wc
|
|
1416
|
+
]), Qc = D(async (e) => {
|
|
1417
|
+
os.current = !0, cs(!0);
|
|
1417
1418
|
try {
|
|
1418
1419
|
await K.declineForReply(e.conversationId, e.reason, e.origin);
|
|
1419
1420
|
} finally {
|
|
1420
|
-
|
|
1421
|
+
os.current = !1, X.current && cs(!1);
|
|
1421
1422
|
}
|
|
1422
1423
|
if (e.commandText !== null) {
|
|
1423
|
-
let t =
|
|
1424
|
-
if (t &&
|
|
1424
|
+
let t = Bc(e.commandText, e.options.voiceSessionId);
|
|
1425
|
+
if (t && Zc(t, e.content, e.options.voiceSessionId)) return;
|
|
1425
1426
|
}
|
|
1426
|
-
await
|
|
1427
|
+
await nl.current(e.content, e.attachments, e.options);
|
|
1427
1428
|
}, [
|
|
1428
|
-
|
|
1429
|
-
|
|
1429
|
+
Bc,
|
|
1430
|
+
Zc,
|
|
1430
1431
|
K
|
|
1431
1432
|
]), Q = D(async (n, r = [], i = {}) => {
|
|
1432
|
-
let a = i.voiceSessionId !== void 0, o = w.getState(), s = !1, c =
|
|
1433
|
-
if (a &&
|
|
1434
|
-
let e =
|
|
1433
|
+
let a = i.voiceSessionId !== void 0, o = w.getState(), s = !1, c = ys.current;
|
|
1434
|
+
if (a && vr(c)) {
|
|
1435
|
+
let e = Cr(c, o.activeConversationId, Ds());
|
|
1435
1436
|
if (e.kind === "gone") return;
|
|
1436
1437
|
let t = i.voiceEntry ?? e;
|
|
1437
|
-
t.kind === "adopt" &&
|
|
1438
|
+
t.kind === "adopt" && ws(t.conversationId), s = t.kind === "own", i = {
|
|
1438
1439
|
...i,
|
|
1439
1440
|
voiceEntry: t
|
|
1440
1441
|
};
|
|
1441
1442
|
}
|
|
1442
1443
|
let l = s ? null : o.activeConversationId, u = s ? null : o.activeConversationId ?? H;
|
|
1443
1444
|
if (u) {
|
|
1444
|
-
if (
|
|
1445
|
+
if (Mn(o.processingByConversationId[u]?.status)) {
|
|
1445
1446
|
if (i.avatarTabAsk !== void 0) return;
|
|
1446
1447
|
let e = o.processingByConversationId[u]?.messageId ?? null;
|
|
1447
|
-
e && i.correctsInFlightTurn === !0 && !
|
|
1448
|
+
e && i.correctsInFlightTurn === !0 && !Ks.current.has(e) && Ys(), e && Ks.current.has(e) && (qs.current = {
|
|
1448
1449
|
conversationId: u,
|
|
1449
1450
|
content: n,
|
|
1450
1451
|
attachments: r,
|
|
@@ -1452,40 +1453,40 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1452
1453
|
});
|
|
1453
1454
|
return;
|
|
1454
1455
|
}
|
|
1455
|
-
if (
|
|
1456
|
+
if (js.current.has(u)) return;
|
|
1456
1457
|
}
|
|
1457
|
-
if (
|
|
1458
|
-
let d = i.targetConversationId, f =
|
|
1458
|
+
if (as.current || Ar() !== null || os.current || _c.current !== null) return;
|
|
1459
|
+
let d = i.targetConversationId, f = Zi(), p = (e) => Ki(e) || Gi(e, f);
|
|
1459
1460
|
if (d !== void 0) {
|
|
1460
1461
|
let e = o.conversations.find((e) => e.id === d);
|
|
1461
1462
|
if (o.activeConversationId !== d || !e || e.mode !== o.mode || p(e)) return;
|
|
1462
1463
|
}
|
|
1463
1464
|
if (i.avatarTabAsk !== void 0) {
|
|
1464
1465
|
let e = l ? o.conversations.find((e) => e.id === l) : void 0, t = e && !p(e) ? e : void 0;
|
|
1465
|
-
if (
|
|
1466
|
-
auto: o.autoRouting &&
|
|
1466
|
+
if (Ze({
|
|
1467
|
+
auto: o.autoRouting && is.current && d === void 0,
|
|
1467
1468
|
selectedMode: o.mode,
|
|
1468
1469
|
conversation: t ? {
|
|
1469
1470
|
mode: t.mode,
|
|
1470
1471
|
routedBy: t.routedBy,
|
|
1471
|
-
hasHistory:
|
|
1472
|
+
hasHistory: Wi(t)
|
|
1472
1473
|
} : null,
|
|
1473
|
-
modeWrites: (e) =>
|
|
1474
|
+
modeWrites: (e) => Xo.current.find((t) => t.id === e)?.writeCapable === !0 || bt(e)
|
|
1474
1475
|
}) !== null) return;
|
|
1475
1476
|
}
|
|
1476
1477
|
if (i.fromPerson && i.writeReplyBound === void 0) {
|
|
1477
|
-
let e = d ?? l ?? null, t = i.voiceSessionId === void 0 ? "typed" : "spoken", a =
|
|
1478
|
+
let e = d ?? l ?? null, t = i.voiceSessionId === void 0 ? "typed" : "spoken", a = Wc(e, i.voiceSessionId), o = se({
|
|
1478
1479
|
text: n,
|
|
1479
|
-
locale: t === "spoken" ?
|
|
1480
|
+
locale: t === "spoken" ? Qa.input.code : V,
|
|
1480
1481
|
origin: t,
|
|
1481
1482
|
hasAttachments: r.length > 0 || i.focus !== void 0,
|
|
1482
1483
|
live: K.liveFor(e),
|
|
1483
|
-
matchesLocalCommand: (e) =>
|
|
1484
|
+
matchesLocalCommand: (e) => Bc(e, i.voiceSessionId) !== null,
|
|
1484
1485
|
offer: a.state,
|
|
1485
|
-
offerAssent: a.state !== "none" &&
|
|
1486
|
+
offerAssent: a.state !== "none" && ai({
|
|
1486
1487
|
text: n,
|
|
1487
1488
|
uiLocale: V,
|
|
1488
|
-
inputLocale:
|
|
1489
|
+
inputLocale: Qa.input.code,
|
|
1489
1490
|
commandLocales: Y.current.options.commandLocales,
|
|
1490
1491
|
manifest: Y.current.options.commandManifest,
|
|
1491
1492
|
leaveGuard: Y.current.options.leaveGuard
|
|
@@ -1493,14 +1494,14 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1493
1494
|
});
|
|
1494
1495
|
if (o.kind === "accept_offer") {
|
|
1495
1496
|
let e = a.accept;
|
|
1496
|
-
if (e &&
|
|
1497
|
+
if (e && Zc({
|
|
1497
1498
|
kind: "navigate",
|
|
1498
1499
|
destination: e.destination,
|
|
1499
1500
|
via: "offer",
|
|
1500
1501
|
offerId: e.offerId,
|
|
1501
1502
|
trigger: "yes"
|
|
1502
1503
|
}, n, i.voiceSessionId, s, i.avatarTabAsk)) {
|
|
1503
|
-
|
|
1504
|
+
ic(i.avatarTabAsk);
|
|
1504
1505
|
return;
|
|
1505
1506
|
}
|
|
1506
1507
|
o = {
|
|
@@ -1517,11 +1518,11 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1517
1518
|
};
|
|
1518
1519
|
}
|
|
1519
1520
|
if (o.kind === "local_reply") {
|
|
1520
|
-
e &&
|
|
1521
|
+
e && Gc(e, n, o.line, o.values, i.voiceSessionId, i.avatarTabAsk);
|
|
1521
1522
|
return;
|
|
1522
1523
|
}
|
|
1523
1524
|
let c = o.kind === "local" ? o.fallback : o.bound, u = o.declineAll;
|
|
1524
|
-
if (u !== null && e) return i.avatarTabAsk === void 0 ?
|
|
1525
|
+
if (u !== null && e) return i.avatarTabAsk === void 0 ? Qc({
|
|
1525
1526
|
conversationId: e,
|
|
1526
1527
|
reason: u,
|
|
1527
1528
|
origin: t,
|
|
@@ -1540,52 +1541,52 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1540
1541
|
}
|
|
1541
1542
|
let ee = i.writeReplyBound?.promptText ?? n;
|
|
1542
1543
|
if (i.fromPerson && r.length === 0 && i.focus === void 0 && i.writeReplyBound?.localCommands !== !1) {
|
|
1543
|
-
let e =
|
|
1544
|
-
if (e &&
|
|
1545
|
-
|
|
1544
|
+
let e = Bc(n, i.voiceSessionId, i.localRecordsChecked === !0);
|
|
1545
|
+
if (e && Zc(e, n, i.voiceSessionId, s, i.avatarTabAsk)) {
|
|
1546
|
+
ic(i.avatarTabAsk);
|
|
1546
1547
|
return;
|
|
1547
1548
|
}
|
|
1548
1549
|
}
|
|
1549
|
-
let m = l ? o.conversations.find((e) => e.id === l) : void 0, h = p(m) ? void 0 : m, g = o.autoRouting &&
|
|
1550
|
+
let m = l ? o.conversations.find((e) => e.id === l) : void 0, h = p(m) ? void 0 : m, g = o.autoRouting && is.current && d === void 0 ? pe({
|
|
1550
1551
|
intent: i.avatarTabAsk === void 0 ? i.autoIntent ?? ue(n) : "read",
|
|
1551
1552
|
dictated: a,
|
|
1552
|
-
voiceProposalBound: a &&
|
|
1553
|
+
voiceProposalBound: a && Ha("api-calls") && Qn(o.acknowledgedWriteModes, "api-calls"),
|
|
1553
1554
|
conversation: h ? {
|
|
1554
1555
|
mode: h.mode,
|
|
1555
1556
|
routedBy: h.routedBy,
|
|
1556
|
-
hasHistory:
|
|
1557
|
+
hasHistory: Wi(h)
|
|
1557
1558
|
} : null
|
|
1558
1559
|
}) : null;
|
|
1559
|
-
if (g &&
|
|
1560
|
-
|
|
1560
|
+
if (g && Xo.current.find((e) => e.id === g.mode)?.writeCapable && !Qn(o.acknowledgedWriteModes, g.mode)) {
|
|
1561
|
+
as.current = {
|
|
1561
1562
|
content: n,
|
|
1562
1563
|
attachments: r,
|
|
1563
1564
|
options: i
|
|
1564
|
-
},
|
|
1565
|
+
}, ds(g.mode);
|
|
1565
1566
|
return;
|
|
1566
1567
|
}
|
|
1567
1568
|
let _ = g ? g.mode : o.mode, te, ne, v = d ?? (s ? null : H), re = v ? w.getState().conversations.find((e) => e.id === v) : void 0, ie = g?.action === "escalate" && h ? {
|
|
1568
1569
|
mode: h.mode,
|
|
1569
1570
|
backendSessionId: h.backendSessionId ?? null
|
|
1570
1571
|
} : null;
|
|
1571
|
-
if (g) g.action === "new" || !h ? v =
|
|
1572
|
+
if (g) g.action === "new" || !h ? v = so(void 0, _, { routedBy: "auto" }) : (v = h.id, So(v, _));
|
|
1572
1573
|
else {
|
|
1573
1574
|
let e = o.autoRouting ? { routedBy: "auto" } : void 0;
|
|
1574
|
-
!v || p(re) || re && re.mode !== _ &&
|
|
1575
|
+
!v || p(re) || re && re.mode !== _ && Wi(re) ? v = so(void 0, _, e) : re && re.mode !== _ && (e ? So(v, _) : ao(v, _));
|
|
1575
1576
|
}
|
|
1576
1577
|
if (!v) return;
|
|
1577
|
-
a &&
|
|
1578
|
+
a && ys.current !== void 0 && v !== o.activeConversationId && ws(v), i.approvalFollowUp || (Os.current[v] = r);
|
|
1578
1579
|
let ae = () => w.getState().conversations.some((e) => e.id === v), y = T(), b = {
|
|
1579
|
-
accessToken:
|
|
1580
|
-
workspaceToken:
|
|
1580
|
+
accessToken: Ua(),
|
|
1581
|
+
workspaceToken: Wa(),
|
|
1581
1582
|
userId: B,
|
|
1582
|
-
organizationId:
|
|
1583
|
+
organizationId: Gt()
|
|
1583
1584
|
}, le = (e, t) => {
|
|
1584
|
-
!ae() && y &&
|
|
1585
|
-
accessToken:
|
|
1586
|
-
workspaceToken:
|
|
1585
|
+
!ae() && y && dt(e, y, t, _, {
|
|
1586
|
+
accessToken: Ua(),
|
|
1587
|
+
workspaceToken: Wa(),
|
|
1587
1588
|
userId: B,
|
|
1588
|
-
organizationId:
|
|
1589
|
+
organizationId: Gt()
|
|
1589
1590
|
});
|
|
1590
1591
|
}, fe = {
|
|
1591
1592
|
id: N(),
|
|
@@ -1593,17 +1594,17 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1593
1594
|
content: n,
|
|
1594
1595
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1595
1596
|
metadata: {
|
|
1596
|
-
...r.length ? { attachments: r.map(
|
|
1597
|
+
...r.length ? { attachments: r.map(Sn) } : {},
|
|
1597
1598
|
...i.focus ? { askAbout: i.focus } : {},
|
|
1598
1599
|
...i.approvalFollowUp ? {
|
|
1599
1600
|
approvalFollowUp: !0,
|
|
1600
1601
|
approvedReplyId: i.approvalFollowUp.approvedReplyId
|
|
1601
1602
|
} : {},
|
|
1602
|
-
...
|
|
1603
|
+
...pr(i.voiceSessionId)
|
|
1603
1604
|
}
|
|
1604
1605
|
};
|
|
1605
1606
|
W(v, fe);
|
|
1606
|
-
let me = i.fromPerson === !0 && r.length === 0 && i.focus === void 0 && i.approvalFollowUp === void 0 && ee === n ?
|
|
1607
|
+
let me = i.fromPerson === !0 && r.length === 0 && i.focus === void 0 && i.approvalFollowUp === void 0 && ee === n ? ji(n, a ? Qa.input.code : V) : null, he = {
|
|
1607
1608
|
location: window.location.pathname + window.location.search,
|
|
1608
1609
|
conversationId: w.getState().activeConversationId,
|
|
1609
1610
|
workspaceId: T(),
|
|
@@ -1615,38 +1616,38 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1615
1616
|
content: "",
|
|
1616
1617
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1617
1618
|
metadata: {
|
|
1618
|
-
lang:
|
|
1619
|
-
...
|
|
1619
|
+
lang: to,
|
|
1620
|
+
...pr(i.voiceSessionId)
|
|
1620
1621
|
}
|
|
1621
|
-
}),
|
|
1622
|
+
}), dn(x, {
|
|
1622
1623
|
channel: a ? "voice" : "chat",
|
|
1623
1624
|
mode: _,
|
|
1624
1625
|
product: L,
|
|
1625
|
-
language:
|
|
1626
|
-
device:
|
|
1626
|
+
language: to,
|
|
1627
|
+
device: pn(),
|
|
1627
1628
|
routedByAuto: !!g
|
|
1628
|
-
}, i.voiceTiming), E(x, "accepted"),
|
|
1629
|
+
}, i.voiceTiming), E(x, "accepted"), fo(v, "provisioning", x, null), jr(x), i.avatarTabAsk !== void 0 && ac(i.avatarTabAsk, {
|
|
1629
1630
|
conversationId: v,
|
|
1630
1631
|
questionId: fe.id,
|
|
1631
1632
|
replyId: x
|
|
1632
1633
|
});
|
|
1633
1634
|
let ge = () => {
|
|
1634
|
-
let e =
|
|
1635
|
+
let e = Nn({
|
|
1635
1636
|
turnId: x,
|
|
1636
|
-
abortRequested:
|
|
1637
|
+
abortRequested: Ks.current.has(x),
|
|
1637
1638
|
activeTurnId: w.getState().processingByConversationId[v]?.messageId ?? null,
|
|
1638
1639
|
conversationExists: ae()
|
|
1639
1640
|
});
|
|
1640
1641
|
return e.abandon && ye(), e;
|
|
1641
|
-
}, _e = (e, t, n, r, a = !1, o =
|
|
1642
|
-
|
|
1642
|
+
}, _e = (e, t, n, r, a = !1, o = to) => {
|
|
1643
|
+
lo(v, x, { content: At(e) }), uo(v, x, {
|
|
1643
1644
|
lang: o,
|
|
1644
1645
|
...t?.length ? { artifacts: t } : {},
|
|
1645
1646
|
...t?.length || n || r ? { mode: _ } : {},
|
|
1646
1647
|
...n ? { sessionId: n } : {},
|
|
1647
1648
|
...r ? { sandboxId: r } : {},
|
|
1648
1649
|
...a ? { incomplete: !0 } : {},
|
|
1649
|
-
...
|
|
1650
|
+
...pr(i.voiceSessionId)
|
|
1650
1651
|
});
|
|
1651
1652
|
}, ve = { session: null }, S = {
|
|
1652
1653
|
speech: null,
|
|
@@ -1657,94 +1658,94 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1657
1658
|
}, be = () => {
|
|
1658
1659
|
ye(), S.stream?.close(), S.stream = null, S.render = null;
|
|
1659
1660
|
}, xe = !1, Se = (e = !1) => {
|
|
1660
|
-
xe && (xe = !1,
|
|
1661
|
+
xe && (xe = !1, Nt.abort(x, e));
|
|
1661
1662
|
}, Ce = new e(), we = () => {}, Te = async (e = 1, o = !1) => {
|
|
1662
1663
|
E(x, "attemptStarted");
|
|
1663
1664
|
let s = null, c = null, l = !1;
|
|
1664
1665
|
try {
|
|
1665
|
-
let { sandboxId: e, sessionId: u, sessionIsNew: d, readAhead: f, sandboxIsNew: p, sandboxProbed: m, sandboxAdopted: h, deadSandboxProbe: g, sessionPreopened: re, knownFloor: ie } = await
|
|
1666
|
-
isAbandoned: () =>
|
|
1666
|
+
let { sandboxId: e, sessionId: u, sessionIsNew: d, readAhead: f, sandboxIsNew: p, sandboxProbed: m, sandboxAdopted: h, deadSandboxProbe: g, sessionPreopened: re, knownFloor: ie } = await Rs(v, x, _, y, b, {
|
|
1667
|
+
isAbandoned: () => Nn({
|
|
1667
1668
|
turnId: x,
|
|
1668
|
-
abortRequested:
|
|
1669
|
+
abortRequested: Ks.current.has(x),
|
|
1669
1670
|
activeTurnId: w.getState().processingByConversationId[v]?.messageId ?? null,
|
|
1670
1671
|
conversationExists: ae()
|
|
1671
1672
|
}).abandon,
|
|
1672
1673
|
...o ? { verifySession: !0 } : {}
|
|
1673
1674
|
});
|
|
1674
1675
|
if (s = e, we(), we = t(e, () => {
|
|
1675
|
-
|
|
1676
|
-
}), E(x, "runtimeReady"),
|
|
1676
|
+
Ks.current.add(x), It(x), Nt.abort(x);
|
|
1677
|
+
}), E(x, "runtimeReady"), fn(x, {
|
|
1677
1678
|
runtime: p ? "cold" : h ? "adopted" : m ? "probed" : re ? "preopened" : d ? "new-session" : "warm",
|
|
1678
1679
|
deadSandboxProbe: g
|
|
1679
|
-
}),
|
|
1680
|
+
}), fn(x, { session: re ? "preopened" : d ? "created" : "reused" }), c = u, ve.session = {
|
|
1680
1681
|
sandboxId: e,
|
|
1681
1682
|
sessionId: u
|
|
1682
1683
|
}, F) {
|
|
1683
1684
|
let e = ge();
|
|
1684
1685
|
if (e.abandon) {
|
|
1685
|
-
e.clearProcessing &&
|
|
1686
|
+
e.clearProcessing && po(v);
|
|
1686
1687
|
return;
|
|
1687
1688
|
}
|
|
1688
1689
|
}
|
|
1689
|
-
if (
|
|
1690
|
+
if ($n(_, te, w.getState().acknowledgedWriteModes, {
|
|
1690
1691
|
dictated: a,
|
|
1691
|
-
confirmsWrites:
|
|
1692
|
-
proposalBound:
|
|
1693
|
-
}) === "voice-in-write-mode") throw new
|
|
1694
|
-
let se =
|
|
1692
|
+
confirmsWrites: bt(_),
|
|
1693
|
+
proposalBound: Ha(_, e)
|
|
1694
|
+
}) === "voice-in-write-mode") throw new Jt("voice-in-write-mode", "Voice in a write mode");
|
|
1695
|
+
let se = Ji({
|
|
1695
1696
|
conversation: w.getState().conversations.find((e) => e.id === v),
|
|
1696
1697
|
content: n,
|
|
1697
1698
|
sessionIsNew: d,
|
|
1698
1699
|
sendingMode: _,
|
|
1699
1700
|
sendingModeConfig: te,
|
|
1700
|
-
modes:
|
|
1701
|
-
answerText: (e) =>
|
|
1701
|
+
modes: Xo.current,
|
|
1702
|
+
answerText: (e) => et(e).text
|
|
1702
1703
|
});
|
|
1703
|
-
if (be(),
|
|
1704
|
-
let t =
|
|
1705
|
-
mint: () =>
|
|
1704
|
+
if (be(), Xn()) {
|
|
1705
|
+
let t = Yn({
|
|
1706
|
+
mint: () => yt(e, y, u, _, b),
|
|
1706
1707
|
mark: (e) => E(x, e)
|
|
1707
1708
|
});
|
|
1708
|
-
S.stream = t,
|
|
1709
|
+
S.stream = t, Gn() && i.voiceSessionId !== void 0 && !ne.accumulatesNarration && (S.speech = Kn({
|
|
1709
1710
|
append: (e, t) => {
|
|
1710
|
-
ge().abandon || (E(x, "speechQueued"), xe = !0,
|
|
1711
|
+
ge().abandon || (E(x, "speechQueued"), xe = !0, Nt.append(x, {
|
|
1711
1712
|
conversationId: v,
|
|
1712
1713
|
channel: "voice",
|
|
1713
1714
|
voiceSessionId: i.voiceSessionId,
|
|
1714
1715
|
text: t,
|
|
1715
|
-
lang:
|
|
1716
|
+
lang: to,
|
|
1716
1717
|
final: !1
|
|
1717
1718
|
}, e));
|
|
1718
1719
|
},
|
|
1719
|
-
retract: () =>
|
|
1720
|
-
})), S.render =
|
|
1720
|
+
retract: () => Nt.retract(x)
|
|
1721
|
+
})), S.render = qn({
|
|
1721
1722
|
onLiveState: (e, t) => S.speech?.invalidate(e, t),
|
|
1722
1723
|
onRendered: (e, t, n) => S.speech?.update(e, t, n),
|
|
1723
1724
|
stream: t,
|
|
1724
1725
|
conversationId: v,
|
|
1725
1726
|
messageId: x,
|
|
1726
|
-
build: (e, t) =>
|
|
1727
|
+
build: (e, t) => At(Rt(e, t, { accumulateNarration: ne.accumulatesNarration }).content),
|
|
1727
1728
|
onFirstDelta: () => E(x, "firstDelta"),
|
|
1728
1729
|
onFirstVisible: () => E(x, "firstOutput")
|
|
1729
1730
|
});
|
|
1730
1731
|
}
|
|
1731
|
-
let ue = ie ?? await
|
|
1732
|
-
|
|
1733
|
-
let de =
|
|
1732
|
+
let ue = ie ?? await Vt(() => _t(e, y, u, _, b, { limit: 50 }), d, zt(f, e, u));
|
|
1733
|
+
Is(v, x, "streaming", "thinking");
|
|
1734
|
+
let de = La?.(), pe = ce(w.getState().sandboxWriteCapabilities[e]), Se = Y.current, Te = Ti(e, u), Ee = Se.options.uiCatalogue ? Si(Ur(Se.navItems), {
|
|
1734
1735
|
permissionsSettled: Se.navPermissionsSettled,
|
|
1735
1736
|
simulating: Se.navSimulating,
|
|
1736
|
-
sentBefore:
|
|
1737
|
-
}) : null, De = w.getState().sandboxWriteCapabilities[e]?.clientTools === !0 ?
|
|
1737
|
+
sentBefore: wi(Te)
|
|
1738
|
+
}) : null, De = w.getState().sandboxWriteCapabilities[e]?.clientTools === !0 ? kt({ writeCapable: te?.writeCapable === !0 || _ === "api-calls" }) : null, Oe = De?.manifest ?? [], ke = {
|
|
1738
1739
|
conversationId: v,
|
|
1739
1740
|
writeReply: pe === "proposal-v1" ? i.writeReplyBound?.writeReply ?? null : null,
|
|
1740
1741
|
...Ee ? { uiCatalogue: Ee } : {},
|
|
1741
1742
|
...Oe.length > 0 ? { clientTools: Oe } : {}
|
|
1742
|
-
}, { prompt: Ae, parts: je } =
|
|
1743
|
-
content:
|
|
1743
|
+
}, { prompt: Ae, parts: je } = Cn({
|
|
1744
|
+
content: sa(se ? `${se}${ee}` : ee, i.focus),
|
|
1744
1745
|
attachments: r,
|
|
1745
|
-
limits:
|
|
1746
|
-
wrapPrompt: (e) =>
|
|
1747
|
-
requestBytes: (t, n) =>
|
|
1746
|
+
limits: xn(te),
|
|
1747
|
+
wrapPrompt: (e) => Ra?.(_, e, $a, eo, a, { writeApproval: pe }) ?? e,
|
|
1748
|
+
requestBytes: (t, n) => St({
|
|
1748
1749
|
sandboxId: e,
|
|
1749
1750
|
workspaceId: y,
|
|
1750
1751
|
sessionId: u,
|
|
@@ -1755,18 +1756,18 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1755
1756
|
authContext: b,
|
|
1756
1757
|
...ke
|
|
1757
1758
|
})
|
|
1758
|
-
}), Me =
|
|
1759
|
-
l =
|
|
1759
|
+
}), Me = yn(je), Ne = Me > 0;
|
|
1760
|
+
l = vn(r) > Me;
|
|
1760
1761
|
let Pe = ge();
|
|
1761
1762
|
if (Pe.abandon) {
|
|
1762
|
-
Pe.clearProcessing &&
|
|
1763
|
+
Pe.clearProcessing && po(v);
|
|
1763
1764
|
return;
|
|
1764
1765
|
}
|
|
1765
1766
|
let Fe = (t) => Ce.dispatch({
|
|
1766
1767
|
prompt: Ae,
|
|
1767
1768
|
isAbandoned: () => ge().abandon,
|
|
1768
|
-
readMessages: (t) =>
|
|
1769
|
-
send: () =>
|
|
1769
|
+
readMessages: (t) => _t(e, y, u, _, b, { sinceMs: t }),
|
|
1770
|
+
send: () => wt(e, y, u, Ae, _, de, b, t?.length ? {
|
|
1770
1771
|
parts: t,
|
|
1771
1772
|
...ke
|
|
1772
1773
|
} : ke)
|
|
@@ -1774,12 +1775,12 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1774
1775
|
try {
|
|
1775
1776
|
await Fe(je);
|
|
1776
1777
|
} catch (e) {
|
|
1777
|
-
if (ie !== null && !o &&
|
|
1778
|
-
if (!Ce.canFailover() || !je || !
|
|
1778
|
+
if (ie !== null && !o && Vn(e)) throw new Bn();
|
|
1779
|
+
if (!Ce.canFailover() || !je || !An(e)) throw e;
|
|
1779
1780
|
await Fe(void 0), l ||= Ne;
|
|
1780
1781
|
}
|
|
1781
|
-
Ee &&
|
|
1782
|
-
let Ie = w.getState().sandboxWriteCapabilities[e], Le = Se.options.uiOffers === !0 &&
|
|
1782
|
+
Ee && Ci(Te);
|
|
1783
|
+
let Ie = w.getState().sandboxWriteCapabilities[e], Le = Se.options.uiOffers === !0 && Oi(Ie) ? B : null, Re = !!Le;
|
|
1783
1784
|
Le && Z.recordTurn({
|
|
1784
1785
|
replyId: x,
|
|
1785
1786
|
conversationId: v,
|
|
@@ -1790,97 +1791,97 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1790
1791
|
actorId: Le,
|
|
1791
1792
|
floorMs: ue
|
|
1792
1793
|
});
|
|
1793
|
-
let ze = De && Oe.length > 0 ?
|
|
1794
|
+
let ze = De && Oe.length > 0 ? Ot({
|
|
1794
1795
|
tools: De.tools,
|
|
1795
|
-
post: (t, n) =>
|
|
1796
|
+
post: (t, n) => xt(e, y, u, t, n, _, b)
|
|
1796
1797
|
}) : null, Be = ze ? (e) => ze.receive(e) : void 0, Ve = Re ? (e, t) => {
|
|
1797
|
-
Z.receive(x, e, t, performance.now()) &&
|
|
1798
|
-
} : void 0, He = (e) =>
|
|
1798
|
+
Z.receive(x, e, t, performance.now()) && wc();
|
|
1799
|
+
} : void 0, He = (e) => lo(v, x, { content: e }), Ue = (e) => l ? `${e}\n\n${P("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;
|
|
1799
1800
|
E(x, "promptSent");
|
|
1800
|
-
let We = null, Ge = !1, Ke =
|
|
1801
|
+
let We = null, Ge = !1, Ke = Lt, C = Rt([], ue);
|
|
1801
1802
|
S.render?.arm(ue);
|
|
1802
|
-
let qe = Date.now() + ne.streamBudgetMs, Je = Date.now(), Ye = Date.now(), Xe, Ze =
|
|
1803
|
+
let qe = Date.now() + ne.streamBudgetMs, Je = Date.now(), Ye = Date.now(), Xe, Ze = jt(), Qe = (e) => {
|
|
1803
1804
|
Xe = e;
|
|
1804
|
-
},
|
|
1805
|
+
}, $e = Jn(() => _t(e, y, u, _, b, {
|
|
1805
1806
|
limit: 50,
|
|
1806
1807
|
sinceMs: ue,
|
|
1807
1808
|
surfaceTurnTerminal: !0,
|
|
1808
1809
|
surfaceUiOffers: Ve,
|
|
1809
1810
|
surfaceClientToolRequests: Be,
|
|
1810
1811
|
surfaceSessionBusy: Qe
|
|
1811
|
-
})), tt = S.stream?.onIdle(() =>
|
|
1812
|
+
})), tt = S.stream?.onIdle(() => $e.startExtra());
|
|
1812
1813
|
try {
|
|
1813
1814
|
for (; Date.now() < qe;) {
|
|
1814
1815
|
le(e, u);
|
|
1815
1816
|
let t = ge();
|
|
1816
1817
|
if (t.abandon) {
|
|
1817
|
-
t.clearProcessing &&
|
|
1818
|
+
t.clearProcessing && po(v);
|
|
1818
1819
|
return;
|
|
1819
1820
|
}
|
|
1820
|
-
let n = Date.now(), r = await
|
|
1821
|
-
Re && Z.observeMessages(x, r) &&
|
|
1822
|
-
let i =
|
|
1821
|
+
let n = Date.now(), r = await $e.next();
|
|
1822
|
+
Re && Z.observeMessages(x, r) && wc(), C = Rt(r, ue, { accumulateNarration: ne.accumulatesNarration });
|
|
1823
|
+
let i = Mt(Ze, C.done, Xe, Date.now());
|
|
1823
1824
|
if (i !== C.done && (C = {
|
|
1824
1825
|
...C,
|
|
1825
1826
|
done: i
|
|
1826
|
-
}),
|
|
1827
|
+
}), lo(v, x, { content: At(C.content) }), C.hasRenderableOutput ? Ge || (Ge = !0, We !== null && E(x, "lastQuietPoll", We), E(x, "firstOutput")) : We = hn(), ne.accumulatesNarration) C.hasText && E(x, "firstText");
|
|
1827
1828
|
else {
|
|
1828
|
-
let e =
|
|
1829
|
+
let e = Wt(Ke, C, hn());
|
|
1829
1830
|
Ke = e.tracker, e.confirmedAt !== null && E(x, "firstText", e.confirmedAt);
|
|
1830
1831
|
}
|
|
1831
|
-
if (C.pendingWrite && !oe(w.getState().sandboxWriteCapabilities[e]) &&
|
|
1832
|
+
if (C.pendingWrite && !oe(w.getState().sandboxWriteCapabilities[e]) && uo(v, x, { pendingWrite: C.pendingWrite }), C.done && (S.stream ? fn(x, {
|
|
1832
1833
|
transport: S.stream.reachedOpen ? "sse" : "poll",
|
|
1833
|
-
live:
|
|
1834
|
-
}) :
|
|
1834
|
+
live: Wn(S.stream.live)
|
|
1835
|
+
}) : fn(x, {
|
|
1835
1836
|
transport: "poll",
|
|
1836
1837
|
live: "none"
|
|
1837
1838
|
}), ye()), C.done) {
|
|
1838
|
-
E(x, "answerDone"),
|
|
1839
|
+
E(x, "answerDone"), ks.current.markVerified(e), ne.continuesInBackground || Bt(e, u, r);
|
|
1839
1840
|
break;
|
|
1840
1841
|
}
|
|
1841
|
-
if (S.render?.refresh(r), Date.now() - Je > 3e4 && (
|
|
1842
|
-
let e = Math.max(0,
|
|
1842
|
+
if (S.render?.refresh(r), Date.now() - Je > 3e4 && (Un(e, y, b), Je = Date.now()), !$e.hasPending()) {
|
|
1843
|
+
let e = Math.max(0, Rn(Date.now() - Ye) - (Date.now() - n));
|
|
1843
1844
|
S.stream ? await S.stream.waitWake(e) : await new Promise((t) => setTimeout(t, e));
|
|
1844
1845
|
}
|
|
1845
1846
|
}
|
|
1846
1847
|
} finally {
|
|
1847
1848
|
ze?.dispose();
|
|
1848
1849
|
}
|
|
1849
|
-
if (tt?.(), be(), C.done || (
|
|
1850
|
+
if (tt?.(), be(), C.done || (fn(x, { outcome: "timedOut" }), C = {
|
|
1850
1851
|
...C,
|
|
1851
|
-
content:
|
|
1852
|
+
content: Zn(C.content, _, P, te)
|
|
1852
1853
|
}), (C.done || xe) && i.voiceSessionId !== void 0 && !ge().abandon) {
|
|
1853
|
-
let e =
|
|
1854
|
-
(e.trim() || xe) && ((l || !C.done) && He(e), E(x, "speechQueued"), xe = !0,
|
|
1854
|
+
let e = At(Ue(C.content));
|
|
1855
|
+
(e.trim() || xe) && ((l || !C.done) && He(e), E(x, "speechQueued"), xe = !0, Nt.publish(x, {
|
|
1855
1856
|
conversationId: v,
|
|
1856
1857
|
channel: "voice",
|
|
1857
1858
|
voiceSessionId: i.voiceSessionId,
|
|
1858
1859
|
text: e,
|
|
1859
|
-
lang:
|
|
1860
|
+
lang: to,
|
|
1860
1861
|
final: !0
|
|
1861
1862
|
}));
|
|
1862
1863
|
}
|
|
1863
|
-
let nt = ne.producesArtifacts ? await
|
|
1864
|
-
C.usedTools !== void 0 &&
|
|
1864
|
+
let nt = ne.producesArtifacts ? await gt(e, y, u, _, b).then((e) => e).catch(() => []) : void 0;
|
|
1865
|
+
C.usedTools !== void 0 && fn(x, { usedTools: C.usedTools }), l && (C = {
|
|
1865
1866
|
...C,
|
|
1866
1867
|
content: Ue(C.content)
|
|
1867
1868
|
});
|
|
1868
1869
|
let rt = !C.done;
|
|
1869
|
-
_e(C.content, nt, u, e, rt), C.tokens && (
|
|
1870
|
+
_e(C.content, nt, u, e, rt), C.tokens && (lo(v, x, { tokens: C.tokens }), Ba && En({
|
|
1870
1871
|
workspaceId: y,
|
|
1871
1872
|
sessionId: u,
|
|
1872
1873
|
messageId: C.messageId,
|
|
1873
1874
|
model: C.model,
|
|
1874
1875
|
tokens: C.tokens
|
|
1875
|
-
},
|
|
1876
|
-
e.ok &&
|
|
1876
|
+
}, Ba, { ledger: wn("panel", L) }).then((e) => {
|
|
1877
|
+
e.ok && qt(L);
|
|
1877
1878
|
})), C.done || le(e, u);
|
|
1878
1879
|
let it = ge();
|
|
1879
1880
|
if (it.abandon) {
|
|
1880
|
-
it.clearProcessing &&
|
|
1881
|
+
it.clearProcessing && po(v);
|
|
1881
1882
|
return;
|
|
1882
1883
|
}
|
|
1883
|
-
E(x, "complete"),
|
|
1884
|
+
E(x, "complete"), fn(x, { outcome: "answered" }), fo(v, "complete", x, null), Ui.recordCommittedEntries(v, [fe.id, x], "TURN", y), xe = !1, Re && me && C.done && Pc({
|
|
1884
1885
|
replyId: x,
|
|
1885
1886
|
conversationId: v,
|
|
1886
1887
|
voiceSessionId: i.voiceSessionId,
|
|
@@ -1888,140 +1889,140 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
1888
1889
|
atSend: he
|
|
1889
1890
|
});
|
|
1890
1891
|
} catch (t) {
|
|
1891
|
-
let n = t instanceof
|
|
1892
|
-
n ||
|
|
1893
|
-
let r =
|
|
1892
|
+
let n = t instanceof Bn;
|
|
1893
|
+
n || ks.current.invalidate(s ?? w.getState().sandboxesByMode[_]?.sandboxId ?? null);
|
|
1894
|
+
let r = Nn({
|
|
1894
1895
|
turnId: x,
|
|
1895
|
-
abortRequested:
|
|
1896
|
+
abortRequested: Ks.current.has(x),
|
|
1896
1897
|
activeTurnId: w.getState().processingByConversationId[v]?.messageId ?? null,
|
|
1897
1898
|
conversationExists: ae()
|
|
1898
1899
|
});
|
|
1899
1900
|
if (ye(), s && c && le(s, c), r.abandon) {
|
|
1900
|
-
r.clearProcessing &&
|
|
1901
|
+
r.clearProcessing && po(v);
|
|
1901
1902
|
return;
|
|
1902
1903
|
}
|
|
1903
|
-
if (n) return we(),
|
|
1904
|
-
if (e === 1 && Ce.canFailover() &&
|
|
1904
|
+
if (n) return we(), ho(v), be(), mn(x), Te(e, !0);
|
|
1905
|
+
if (e === 1 && Ce.canFailover() && jn(t)) {
|
|
1905
1906
|
we();
|
|
1906
1907
|
let e = s ?? w.getState().sandboxesByMode[_]?.sandboxId ?? null;
|
|
1907
|
-
return e && (
|
|
1908
|
+
return e && (As.current.add(e), ks.current.invalidate(e)), ho(v), _o(_), co(v, x, ""), uo(v, x, { pendingWrite: void 0 }), e && K.retireSandbox(e), be(), Se(!0), mn(x), Te(2);
|
|
1908
1909
|
}
|
|
1909
1910
|
throw t;
|
|
1910
1911
|
}
|
|
1911
1912
|
}, Ee = v;
|
|
1912
|
-
|
|
1913
|
-
let De =
|
|
1914
|
-
|
|
1913
|
+
js.current.add(Ee);
|
|
1914
|
+
let De = zn();
|
|
1915
|
+
Hn();
|
|
1915
1916
|
try {
|
|
1916
1917
|
if (!y) throw Object.assign(/* @__PURE__ */ Error("Assistant backend is unavailable without an active workspace context."), { extensions: {
|
|
1917
1918
|
code: "UNAUTHENTICATED",
|
|
1918
1919
|
authFailure: "WORKSPACE_CONTEXT_MISSING"
|
|
1919
1920
|
} });
|
|
1920
|
-
let e = await
|
|
1921
|
+
let e = await tr(_, () => Xo.current.find((e) => e.id === _), Yo);
|
|
1921
1922
|
te = e.config, ne = e.capabilities;
|
|
1922
1923
|
let t = te, n = ge();
|
|
1923
1924
|
if (n.abandon) {
|
|
1924
|
-
n.clearProcessing &&
|
|
1925
|
+
n.clearProcessing && po(v);
|
|
1925
1926
|
return;
|
|
1926
1927
|
}
|
|
1927
|
-
let r =
|
|
1928
|
+
let r = $n(_, t, w.getState().acknowledgedWriteModes, {
|
|
1928
1929
|
dictated: a,
|
|
1929
|
-
confirmsWrites:
|
|
1930
|
-
proposalBound:
|
|
1930
|
+
confirmsWrites: bt(_),
|
|
1931
|
+
proposalBound: Ha(_)
|
|
1931
1932
|
});
|
|
1932
|
-
if (r) throw new
|
|
1933
|
-
let i =
|
|
1934
|
-
if (
|
|
1935
|
-
let e = await
|
|
1936
|
-
if (!e.ok) throw
|
|
1933
|
+
if (r) throw new Jt(r, r === "confirm-write-mode" ? "Write mode not confirmed" : "Voice in a write mode");
|
|
1934
|
+
let i = wn("panel", L);
|
|
1935
|
+
if (Ba && await On(i, y), Ba && Tn(i, y)) {
|
|
1936
|
+
let e = await Dn(i, y, Ba);
|
|
1937
|
+
if (!e.ok) throw kn(e.kind);
|
|
1937
1938
|
let t = ge();
|
|
1938
1939
|
if (t.abandon) {
|
|
1939
|
-
t.clearProcessing &&
|
|
1940
|
+
t.clearProcessing && po(v);
|
|
1940
1941
|
return;
|
|
1941
1942
|
}
|
|
1942
1943
|
}
|
|
1943
1944
|
E(x, "cleared"), await Te();
|
|
1944
1945
|
} catch (e) {
|
|
1945
|
-
if (
|
|
1946
|
-
|
|
1946
|
+
if (ks.current.invalidate(w.getState().sandboxesByMode[_]?.sandboxId ?? null), !ae()) {
|
|
1947
|
+
po(v);
|
|
1947
1948
|
return;
|
|
1948
1949
|
}
|
|
1949
|
-
let t = ve.session?.sandboxId ?? null, n =
|
|
1950
|
+
let t = ve.session?.sandboxId ?? null, n = Yt(e, { confirmsNoAction: Xt({
|
|
1950
1951
|
mode: _,
|
|
1951
1952
|
capabilities: t ? w.getState().sandboxWriteCapabilities[t] : null
|
|
1952
1953
|
}) });
|
|
1953
|
-
|
|
1954
|
-
let r =
|
|
1955
|
-
|
|
1954
|
+
fn(x, { outcome: n.kind === "temporary" ? "failed" : "refused" }), n.offersUpgrade && Kt(L, "sandbox");
|
|
1955
|
+
let r = Zt(n, P, { locale: V });
|
|
1956
|
+
fo(v, "error", x, r.headline), lo(v, x, { content: r.text }), uo(v, x, {
|
|
1956
1957
|
lang: r.translated ? V : "en",
|
|
1957
|
-
...
|
|
1958
|
+
...pr(i.voiceSessionId)
|
|
1958
1959
|
});
|
|
1959
1960
|
} finally {
|
|
1960
|
-
we(),
|
|
1961
|
+
we(), js.current.delete(Ee), fn(x, { outcome: "stopped" }), E(x, "complete"), Se(), be();
|
|
1961
1962
|
let e = w.getState(), t = de(ie, _, e.conversations.find((e) => e.id === Ee), (t) => !!e.sandboxesByMode[t]?.sandboxId);
|
|
1962
|
-
t && (
|
|
1963
|
+
t && (So(Ee, t.mode), t.backendSessionId && mo(Ee, t.backendSessionId)), ve.session && ae() && K.afterTurn({
|
|
1963
1964
|
...ve.session,
|
|
1964
1965
|
conversationId: Ee
|
|
1965
1966
|
}, x);
|
|
1966
|
-
let n =
|
|
1967
|
-
|
|
1967
|
+
let n = qs.current;
|
|
1968
|
+
qs.current = null, n && n.conversationId === Ee && ae() && nl.current(n.content, n.attachments, n.options), De();
|
|
1968
1969
|
}
|
|
1969
1970
|
}, [
|
|
1970
1971
|
H,
|
|
1971
1972
|
W,
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1973
|
+
Ra,
|
|
1974
|
+
ho,
|
|
1975
|
+
_o,
|
|
1976
|
+
no,
|
|
1977
|
+
so,
|
|
1978
|
+
Rs,
|
|
1978
1979
|
K,
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1980
|
+
Ys,
|
|
1981
|
+
Gc,
|
|
1982
|
+
Qc,
|
|
1982
1983
|
V,
|
|
1983
|
-
|
|
1984
|
-
Va,
|
|
1985
|
-
Ia,
|
|
1984
|
+
Qa,
|
|
1986
1985
|
Ha,
|
|
1986
|
+
La,
|
|
1987
1987
|
Ua,
|
|
1988
|
-
|
|
1988
|
+
Wa,
|
|
1989
|
+
lo,
|
|
1989
1990
|
L,
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
$a,
|
|
1993
|
-
V,
|
|
1991
|
+
Yo,
|
|
1992
|
+
Ba,
|
|
1994
1993
|
eo,
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
1994
|
+
V,
|
|
1995
|
+
to,
|
|
1996
|
+
$a,
|
|
1997
|
+
So,
|
|
1998
|
+
Zc,
|
|
1999
|
+
Bc,
|
|
2000
|
+
ws,
|
|
2001
|
+
Ds,
|
|
2002
|
+
mo,
|
|
2003
|
+
ao,
|
|
2004
2004
|
fo,
|
|
2005
|
+
po,
|
|
2005
2006
|
P,
|
|
2006
|
-
|
|
2007
|
-
|
|
2007
|
+
Is,
|
|
2008
|
+
co,
|
|
2008
2009
|
B,
|
|
2009
2010
|
Z,
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2011
|
+
wc,
|
|
2012
|
+
Wc,
|
|
2013
|
+
Pc,
|
|
2014
|
+
ac,
|
|
2013
2015
|
ic,
|
|
2014
|
-
rc,
|
|
2015
2016
|
F
|
|
2016
|
-
]),
|
|
2017
|
+
]), $c = D((e, t) => {
|
|
2017
2018
|
Q(e, [], t ? { autoIntent: t } : {});
|
|
2018
|
-
}, [Q]),
|
|
2019
|
-
let e = [...
|
|
2019
|
+
}, [Q]), el = it(), tl = D(() => {
|
|
2020
|
+
let e = [...Co.chat].reverse().find((e) => e.role === "user" && !e.metadata?.localAction);
|
|
2020
2021
|
if (!e || e.metadata?.approvalFollowUp) return;
|
|
2021
|
-
let t = H ?
|
|
2022
|
-
if (t.some((e) =>
|
|
2022
|
+
let t = H ? Os.current[H] ?? [] : [], n = oa(e.metadata?.askAbout) ?? void 0, r = n ? { focus: n } : {};
|
|
2023
|
+
if (t.some((e) => st(e, Date.now()))) {
|
|
2023
2024
|
let n = H ?? void 0;
|
|
2024
|
-
|
|
2025
|
+
ct(t, el).then((t) => {
|
|
2025
2026
|
Q(e.content, t, {
|
|
2026
2027
|
...n === void 0 ? {} : { targetConversationId: n },
|
|
2027
2028
|
...r
|
|
@@ -2029,274 +2030,274 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
2029
2030
|
});
|
|
2030
2031
|
} else Q(e.content, t, r);
|
|
2031
2032
|
}, [
|
|
2032
|
-
|
|
2033
|
+
wo,
|
|
2033
2034
|
Q,
|
|
2034
2035
|
H,
|
|
2035
|
-
|
|
2036
|
-
]),
|
|
2036
|
+
el
|
|
2037
|
+
]), nl = A(Q);
|
|
2037
2038
|
O(() => {
|
|
2038
|
-
|
|
2039
|
+
nl.current = Q;
|
|
2039
2040
|
}, [Q]);
|
|
2040
|
-
let
|
|
2041
|
-
if (
|
|
2042
|
-
for (let e =
|
|
2043
|
-
let t =
|
|
2041
|
+
let rl = k(() => {
|
|
2042
|
+
if (Eo) return null;
|
|
2043
|
+
for (let e = wo.length - 1; e >= 0; --e) {
|
|
2044
|
+
let t = wo[e];
|
|
2044
2045
|
if (t?.role !== "assistant") continue;
|
|
2045
|
-
if (t.id ===
|
|
2046
|
-
if (!
|
|
2047
|
-
let n =
|
|
2046
|
+
if (t.id === fc) return null;
|
|
2047
|
+
if (!fr(t) || Ks.current.has(t.id) || Ft(t.id)) continue;
|
|
2048
|
+
let n = nr(t, To, P);
|
|
2048
2049
|
if (n.kind !== "output") return null;
|
|
2049
|
-
let r =
|
|
2050
|
-
return r ?
|
|
2050
|
+
let r = et(n.text).text.trim();
|
|
2051
|
+
return r ? Dr(t, r, To) : null;
|
|
2051
2052
|
}
|
|
2052
2053
|
return null;
|
|
2053
2054
|
}, [
|
|
2054
|
-
Co,
|
|
2055
|
-
To,
|
|
2056
2055
|
wo,
|
|
2057
|
-
|
|
2056
|
+
Eo,
|
|
2057
|
+
To,
|
|
2058
|
+
fc,
|
|
2058
2059
|
P
|
|
2059
|
-
]),
|
|
2060
|
+
]), il = k(() => rl ? or(rl.text) : null, [rl]), al = k(() => Co.chat.filter((e) => e.id !== fc), [Co.chat, fc]), ol = k(() => I ? Co.all.filter((e) => e.id !== fc) : al, [
|
|
2060
2061
|
I,
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
]), [
|
|
2062
|
+
Co.all,
|
|
2063
|
+
fc,
|
|
2064
|
+
al
|
|
2065
|
+
]), [sl, cl] = j(null), ll = w((e) => ut(e)?.sandboxId ?? null), ul = Nr(al, {
|
|
2065
2066
|
sessionId: G?.backendSessionId,
|
|
2066
|
-
sandboxId:
|
|
2067
|
+
sandboxId: ll,
|
|
2067
2068
|
nowMs: Date.now()
|
|
2068
|
-
}),
|
|
2069
|
+
}), dl = Pr(al), fl = (e) => {
|
|
2069
2070
|
if (ae(e.metadata).length > 0) return !0;
|
|
2070
2071
|
let t = e.metadata?.sandboxId;
|
|
2071
|
-
return oe(t ?
|
|
2072
|
-
},
|
|
2072
|
+
return oe(t ? ko[t] : null);
|
|
2073
|
+
}, pl = (e) => {
|
|
2073
2074
|
let t = ae(e.metadata);
|
|
2074
2075
|
return t.length === 0 || !H ? null : /* @__PURE__ */ M(d, {
|
|
2075
2076
|
refs: t,
|
|
2076
2077
|
conversationId: H,
|
|
2077
2078
|
panel: K,
|
|
2078
|
-
entries:
|
|
2079
|
-
capabilitiesOf: (e) =>
|
|
2080
|
-
turnInFlight:
|
|
2079
|
+
entries: Ao,
|
|
2080
|
+
capabilitiesOf: (e) => ko[e],
|
|
2081
|
+
turnInFlight: Eo,
|
|
2081
2082
|
tr: P,
|
|
2082
|
-
onReview:
|
|
2083
|
-
retiredSandboxes:
|
|
2083
|
+
onReview: Mo.review,
|
|
2084
|
+
retiredSandboxes: jo,
|
|
2084
2085
|
onReapply: () => void Q(P("writeProposal.reapplyPrompt", "That change wasn't saved because it changed after you read it. Fetch the latest version and reapply only your change on top of it."))
|
|
2085
2086
|
});
|
|
2086
|
-
},
|
|
2087
|
+
}, ml = (e) => {
|
|
2087
2088
|
if (!H) return null;
|
|
2088
2089
|
let t = Z.liveOffersFor(e, {
|
|
2089
2090
|
registry: {
|
|
2090
|
-
destinations:
|
|
2091
|
-
permissionsSettled:
|
|
2092
|
-
simulating:
|
|
2091
|
+
destinations: Ur(sc),
|
|
2092
|
+
permissionsSettled: cc,
|
|
2093
|
+
simulating: lc
|
|
2093
2094
|
},
|
|
2094
2095
|
actorId: B,
|
|
2095
2096
|
conversationId: H,
|
|
2096
2097
|
perfNow: performance.now()
|
|
2097
2098
|
}), n = t[0];
|
|
2098
|
-
return n ? /* @__PURE__ */ M(
|
|
2099
|
+
return n ? /* @__PURE__ */ M(Pi, {
|
|
2099
2100
|
offers: t.map(({ offer: e, target: t }) => ({
|
|
2100
2101
|
offerId: e.offerId,
|
|
2101
2102
|
label: t.label,
|
|
2102
2103
|
path: t.path
|
|
2103
2104
|
})),
|
|
2104
|
-
hint: t.length === 1 && z === "proposal-v1" ?
|
|
2105
|
-
onOpen:
|
|
2105
|
+
hint: t.length === 1 && z === "proposal-v1" ? ki(n.offer, Z.turnFor(e)) : "link",
|
|
2106
|
+
onOpen: Nc
|
|
2106
2107
|
}, n.offer.offerId) : null;
|
|
2107
|
-
},
|
|
2108
|
+
}, hl = (e) => e.role === "assistant" ? ml(e.id) : null;
|
|
2108
2109
|
O(() => {
|
|
2109
2110
|
let e = Z.nextExpiryInMs(performance.now());
|
|
2110
2111
|
if (e === null) return;
|
|
2111
|
-
let t = window.setTimeout(
|
|
2112
|
+
let t = window.setTimeout(wc, e + 1);
|
|
2112
2113
|
return () => window.clearTimeout(t);
|
|
2113
2114
|
}, [
|
|
2114
2115
|
Z,
|
|
2115
|
-
|
|
2116
|
-
|
|
2116
|
+
Sc,
|
|
2117
|
+
wc
|
|
2117
2118
|
]);
|
|
2118
|
-
let
|
|
2119
|
+
let gl = Mo.dialog.view ? Ao[Mo.dialog.view.proposalId] : void 0, _l = ul?.expiresAtMs ?? null;
|
|
2119
2120
|
O(() => {
|
|
2120
|
-
if (
|
|
2121
|
-
let e = window.setTimeout(() =>
|
|
2121
|
+
if (_l === null) return;
|
|
2122
|
+
let e = window.setTimeout(() => Gs((e) => e + 1), Math.max(0, _l - Date.now()));
|
|
2122
2123
|
return () => window.clearTimeout(e);
|
|
2123
|
-
}, [
|
|
2124
|
-
let
|
|
2124
|
+
}, [_l, Ws]);
|
|
2125
|
+
let vl = k(() => Co.voice.filter((e) => e.id !== fc && (e.role === "user" || e.role === "assistant")).map((e) => ({
|
|
2125
2126
|
id: e.id,
|
|
2126
2127
|
role: e.role,
|
|
2127
|
-
text:
|
|
2128
|
-
sessionId:
|
|
2128
|
+
text: ar(e, To, P),
|
|
2129
|
+
sessionId: mr(e),
|
|
2129
2130
|
timestamp: e.timestamp
|
|
2130
2131
|
})).filter((e) => e.text.length > 0), [
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2132
|
+
Co.voice,
|
|
2133
|
+
To,
|
|
2134
|
+
fc,
|
|
2134
2135
|
P
|
|
2135
|
-
]),
|
|
2136
|
-
if (
|
|
2136
|
+
]), yl = D(() => {
|
|
2137
|
+
if (vl.length === 0) return;
|
|
2137
2138
|
let e = /* @__PURE__ */ new Date();
|
|
2138
|
-
|
|
2139
|
+
ur(cr(vl, {
|
|
2139
2140
|
title: P("voiceSession.transcript", "Voice conversation"),
|
|
2140
2141
|
savedAt: P("voiceSession.savedAt", "Saved"),
|
|
2141
2142
|
session: P("voiceSession.sessionLabel", "Session"),
|
|
2142
2143
|
earlier: P("voiceSession.earlierLabel", "Earlier"),
|
|
2143
2144
|
you: P("voiceSession.speakerYou", "You"),
|
|
2144
2145
|
assistant: P("voiceSession.speakerAssistant", "Assistant")
|
|
2145
|
-
}, e),
|
|
2146
|
+
}, e), lr(L, e), "text/markdown");
|
|
2146
2147
|
}, [
|
|
2147
2148
|
L,
|
|
2148
|
-
|
|
2149
|
+
vl,
|
|
2149
2150
|
P
|
|
2150
|
-
]),
|
|
2151
|
-
|
|
2152
|
-
let [
|
|
2151
|
+
]), bl = rt({ perFileChars: ls }), xl = A(bl);
|
|
2152
|
+
xl.current = bl;
|
|
2153
|
+
let [Sl, Cl] = j(null), wl = Sl === null ? null : P("attachments.voiceDropped", "{{count}} attachment(s) couldn't be saved and weren't sent.", { count: Sl });
|
|
2153
2154
|
O(() => {
|
|
2154
|
-
if (
|
|
2155
|
-
let e = window.setTimeout(() =>
|
|
2155
|
+
if (Sl === null) return;
|
|
2156
|
+
let e = window.setTimeout(() => Cl(null), ha);
|
|
2156
2157
|
return () => window.clearTimeout(e);
|
|
2157
|
-
}, [
|
|
2158
|
-
let
|
|
2159
|
-
let i =
|
|
2158
|
+
}, [Sl]);
|
|
2159
|
+
let Tl = A(/* @__PURE__ */ new Set()), El = A(() => !1), Dl = D((e, t, n, r) => {
|
|
2160
|
+
let i = ys.current, a = Tr(i), o = () => {
|
|
2160
2161
|
let e = w.getState();
|
|
2161
|
-
return
|
|
2162
|
-
sessionLive:
|
|
2162
|
+
return yr({
|
|
2163
|
+
sessionLive: El.current(t),
|
|
2163
2164
|
boundAtSubmit: i,
|
|
2164
2165
|
activeConversationId: e.activeConversationId,
|
|
2165
2166
|
boundConversationExists: e.conversations.some((e) => e.id === a)
|
|
2166
2167
|
});
|
|
2167
2168
|
}, s = () => {
|
|
2168
|
-
let i =
|
|
2169
|
-
|
|
2169
|
+
let i = xl.current;
|
|
2170
|
+
ot({
|
|
2170
2171
|
draft: i,
|
|
2171
2172
|
maySend: o,
|
|
2172
|
-
budgetMs:
|
|
2173
|
+
budgetMs: at,
|
|
2173
2174
|
sendTurn: (i) => {
|
|
2174
2175
|
let a = {
|
|
2175
2176
|
...n,
|
|
2176
|
-
handedOver:
|
|
2177
|
+
handedOver: hn()
|
|
2177
2178
|
};
|
|
2178
|
-
|
|
2179
|
+
nl.current(e, i, {
|
|
2179
2180
|
fromPerson: !0,
|
|
2180
2181
|
voiceSessionId: t,
|
|
2181
2182
|
voiceTiming: a,
|
|
2182
2183
|
...r.correction ? { correctsInFlightTurn: !0 } : {}
|
|
2183
2184
|
});
|
|
2184
2185
|
},
|
|
2185
|
-
announceDropped: (e) =>
|
|
2186
|
+
announceDropped: (e) => Cl(e)
|
|
2186
2187
|
});
|
|
2187
2188
|
};
|
|
2188
|
-
if (o() &&
|
|
2189
|
-
|
|
2189
|
+
if (o() && Uc.current(e, t)) {
|
|
2190
|
+
nl.current(e, [], {
|
|
2190
2191
|
fromPerson: !0,
|
|
2191
2192
|
voiceSessionId: t,
|
|
2192
2193
|
voiceTiming: {
|
|
2193
2194
|
...n,
|
|
2194
|
-
handedOver:
|
|
2195
|
+
handedOver: hn()
|
|
2195
2196
|
}
|
|
2196
2197
|
});
|
|
2197
2198
|
return;
|
|
2198
2199
|
}
|
|
2199
|
-
if (!
|
|
2200
|
+
if (!xl.current.isBusy) {
|
|
2200
2201
|
s();
|
|
2201
2202
|
return;
|
|
2202
2203
|
}
|
|
2203
|
-
let c = Date.now(), l =
|
|
2204
|
-
let e =
|
|
2205
|
-
|
|
2204
|
+
let c = Date.now(), l = Tl.current, u = window.setInterval(() => {
|
|
2205
|
+
let e = xl.current.isBusy;
|
|
2206
|
+
xl.current.isCommitting || e && Date.now() - c < ma || (window.clearInterval(u), l.delete(u), s());
|
|
2206
2207
|
}, 200);
|
|
2207
2208
|
l.add(u);
|
|
2208
|
-
}, []),
|
|
2209
|
-
onSubmit:
|
|
2210
|
-
latestReply:
|
|
2211
|
-
language: o(
|
|
2212
|
-
graceMs:
|
|
2213
|
-
onSupersede:
|
|
2214
|
-
handsFreeStreamNoticeAccepted:
|
|
2215
|
-
onAcceptHandsFreeStreamNotice:
|
|
2216
|
-
handsFreeInterrupt:
|
|
2209
|
+
}, []), Ol = A(() => void 0), $ = tt({
|
|
2210
|
+
onSubmit: Dl,
|
|
2211
|
+
latestReply: rl,
|
|
2212
|
+
language: o(Xa, V).tag,
|
|
2213
|
+
graceMs: Ka,
|
|
2214
|
+
onSupersede: Xs,
|
|
2215
|
+
handsFreeStreamNoticeAccepted: Ja,
|
|
2216
|
+
onAcceptHandsFreeStreamNotice: Ya,
|
|
2217
|
+
handsFreeInterrupt: qa,
|
|
2217
2218
|
onBargeIn: () => {
|
|
2218
|
-
|
|
2219
|
+
Ol.current(), Ys();
|
|
2219
2220
|
}
|
|
2220
2221
|
});
|
|
2221
|
-
|
|
2222
|
-
let
|
|
2222
|
+
El.current = $.isCurrentSession;
|
|
2223
|
+
let kl = bs ? vl.filter((e) => e.sessionId !== void 0 && $.isCurrentSession(e.sessionId)) : vl, Al = $.answerLocally;
|
|
2223
2224
|
O(() => {
|
|
2224
|
-
|
|
2225
|
-
}, [
|
|
2226
|
-
let
|
|
2227
|
-
|
|
2225
|
+
Kc.current = Al;
|
|
2226
|
+
}, [Al]);
|
|
2227
|
+
let jl = $.active, Ml = k(() => v(Object.values(Ao), H, jo), [
|
|
2228
|
+
Ao,
|
|
2228
2229
|
H,
|
|
2229
|
-
|
|
2230
|
-
]), [
|
|
2230
|
+
jo
|
|
2231
|
+
]), [Nl, Pl] = j(null);
|
|
2231
2232
|
O(() => {
|
|
2232
|
-
|
|
2233
|
-
}, [
|
|
2234
|
-
let
|
|
2235
|
-
let e =
|
|
2233
|
+
jl || Pl(null);
|
|
2234
|
+
}, [jl]);
|
|
2235
|
+
let Fl = Mo.review, Il = D(() => {
|
|
2236
|
+
let e = Ml[Ml.length - 1];
|
|
2236
2237
|
if (!e) return;
|
|
2237
2238
|
let { view: t } = e;
|
|
2238
|
-
f(t) && m(t,
|
|
2239
|
+
f(t) && m(t, ko[e.session.sandboxId]).offerConfirm ? Fl(t) : Pl(t.proposalId);
|
|
2239
2240
|
}, [
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
]),
|
|
2241
|
+
Ml,
|
|
2242
|
+
ko,
|
|
2243
|
+
Fl
|
|
2244
|
+
]), Ll = jl ? _(Ml) : null, Rl = Nl ? Ao[Nl] : void 0, zl = jl && Rl && Rl.session.conversationId === H ? {
|
|
2244
2245
|
content: /* @__PURE__ */ M(d, {
|
|
2245
2246
|
refs: [{
|
|
2246
|
-
proposalId:
|
|
2247
|
-
sandboxId:
|
|
2248
|
-
sessionId:
|
|
2247
|
+
proposalId: Rl.view.proposalId,
|
|
2248
|
+
sandboxId: Rl.session.sandboxId,
|
|
2249
|
+
sessionId: Rl.session.sessionId
|
|
2249
2250
|
}],
|
|
2250
|
-
conversationId:
|
|
2251
|
+
conversationId: Rl.session.conversationId,
|
|
2251
2252
|
panel: K,
|
|
2252
|
-
entries:
|
|
2253
|
-
capabilitiesOf: (e) =>
|
|
2254
|
-
turnInFlight:
|
|
2253
|
+
entries: Ao,
|
|
2254
|
+
capabilitiesOf: (e) => ko[e],
|
|
2255
|
+
turnInFlight: Eo,
|
|
2255
2256
|
tr: P,
|
|
2256
|
-
onReview:
|
|
2257
|
-
retiredSandboxes:
|
|
2257
|
+
onReview: Fl,
|
|
2258
|
+
retiredSandboxes: jo
|
|
2258
2259
|
}),
|
|
2259
2260
|
closeLabel: re(P, h.trayClose),
|
|
2260
|
-
onClose: () =>
|
|
2261
|
-
} : null,
|
|
2262
|
-
|
|
2261
|
+
onClose: () => Pl(null)
|
|
2262
|
+
} : null, Bl = Mo.asking, Vl = Ic?.asking === !0, Hl = Lc?.asking === !0, Ul = hi(), Wl = $.holdListening, Gl = k(() => jl || J ? null : { run: () => ms ? { status: "already" } : (vs(!0), { status: "done" }) }, [
|
|
2263
|
+
jl,
|
|
2263
2264
|
J,
|
|
2264
|
-
|
|
2265
|
-
|
|
2265
|
+
ms,
|
|
2266
|
+
vs
|
|
2266
2267
|
]);
|
|
2267
|
-
|
|
2268
|
-
let
|
|
2268
|
+
pi("assistant.transcript", Gl);
|
|
2269
|
+
let Kl = k(() => jl ? null : { run: () => {
|
|
2269
2270
|
let e = w.getState(), t = e.conversations.find((t) => t.id === e.activeConversationId);
|
|
2270
2271
|
return t && t.messages.length === 0 ? { status: "already" } : (e.createConversation(), { status: "done" });
|
|
2271
|
-
} }, [
|
|
2272
|
-
|
|
2273
|
-
|
|
2272
|
+
} }, [jl]);
|
|
2273
|
+
pi("assistant.conversation.new", Kl), O(() => {
|
|
2274
|
+
Wl(jl && (Bl || Vl || Hl || Ul));
|
|
2274
2275
|
}, [
|
|
2275
|
-
|
|
2276
|
-
zl,
|
|
2276
|
+
jl,
|
|
2277
2277
|
Bl,
|
|
2278
2278
|
Vl,
|
|
2279
2279
|
Hl,
|
|
2280
|
-
Ul
|
|
2280
|
+
Ul,
|
|
2281
|
+
Wl
|
|
2281
2282
|
]);
|
|
2282
|
-
let
|
|
2283
|
+
let ql = A(null), Jl = $.announce;
|
|
2283
2284
|
O(() => {
|
|
2284
|
-
if (!
|
|
2285
|
-
|
|
2285
|
+
if (!jl) {
|
|
2286
|
+
ql.current = null;
|
|
2286
2287
|
return;
|
|
2287
2288
|
}
|
|
2288
|
-
let e =
|
|
2289
|
-
if (e === null)
|
|
2290
|
-
else for (let { view: t, session: n } of ne(
|
|
2289
|
+
let e = ql.current;
|
|
2290
|
+
if (e === null) ql.current = new Set(Object.keys(Ao));
|
|
2291
|
+
else for (let { view: t, session: n } of ne(Ml, e)) {
|
|
2291
2292
|
e.add(t.proposalId);
|
|
2292
|
-
let r =
|
|
2293
|
+
let r = ko[n.sandboxId];
|
|
2293
2294
|
if (!g({
|
|
2294
2295
|
mode: "api-calls",
|
|
2295
2296
|
productWriteApproval: z,
|
|
2296
2297
|
capabilities: r
|
|
2297
2298
|
})) continue;
|
|
2298
2299
|
let i = ie(t, m(t, r).offerConfirm, P), a = t.proposalId;
|
|
2299
|
-
|
|
2300
|
+
Jl({
|
|
2300
2301
|
id: `write-readback:${a}`,
|
|
2301
2302
|
text: i.text,
|
|
2302
2303
|
lang: i.translated ? V : "en",
|
|
@@ -2304,570 +2305,576 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
2304
2305
|
});
|
|
2305
2306
|
}
|
|
2306
2307
|
}, [
|
|
2307
|
-
Al,
|
|
2308
2308
|
jl,
|
|
2309
|
+
Ml,
|
|
2310
|
+
Ao,
|
|
2309
2311
|
ko,
|
|
2310
|
-
Oo,
|
|
2311
2312
|
z,
|
|
2312
2313
|
P,
|
|
2313
2314
|
V,
|
|
2314
|
-
|
|
2315
|
+
Jl,
|
|
2315
2316
|
K
|
|
2316
2317
|
]);
|
|
2317
|
-
let
|
|
2318
|
+
let Yl = A(!1);
|
|
2318
2319
|
O(() => {
|
|
2319
|
-
|
|
2320
|
-
}, [$.active]), O(() =>
|
|
2321
|
-
if (!
|
|
2322
|
-
let t =
|
|
2320
|
+
Yl.current = $.active;
|
|
2321
|
+
}, [$.active]), O(() => Qi((e) => {
|
|
2322
|
+
if (!Yl.current) return !1;
|
|
2323
|
+
let t = ys.current;
|
|
2323
2324
|
return typeof t == "string" ? t === e : w.getState().activeConversationId === e;
|
|
2324
2325
|
}), []);
|
|
2325
|
-
let
|
|
2326
|
-
let e = w.getState().activeConversationId, t =
|
|
2327
|
-
|
|
2326
|
+
let Xl = $.start, Zl = D(() => {
|
|
2327
|
+
let e = w.getState().activeConversationId, t = Sr(Ds());
|
|
2328
|
+
ws(wr(t, e)), zs(!0, t.kind === "own"), Xl();
|
|
2328
2329
|
}, [
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
]),
|
|
2330
|
+
ws,
|
|
2331
|
+
zs,
|
|
2332
|
+
Ds,
|
|
2333
|
+
Xl
|
|
2334
|
+
]), Ql = k(() => ir(G?.messages ?? []), [G?.messages]), $l = rr(Co.voice, To, P), eu = rr(Ql, To, P) > 0, tu = D(() => {
|
|
2334
2335
|
let e = w.getState().activeConversationId;
|
|
2335
|
-
if (!e ||
|
|
2336
|
-
let t = new Set(
|
|
2336
|
+
if (!e || vl.length === 0) return;
|
|
2337
|
+
let t = new Set(Ql.map((e) => e.id)), n = N();
|
|
2337
2338
|
W(e, {
|
|
2338
2339
|
id: n,
|
|
2339
2340
|
role: "system",
|
|
2340
|
-
content:
|
|
2341
|
+
content: sr(vl.filter((e) => t.has(e.id)), {
|
|
2341
2342
|
intro: P("voiceSession.continuedIntro", "Continued from a voice conversation. You asked about:"),
|
|
2342
2343
|
nothing: P("voiceSession.continuedNothing", "Continued from a voice conversation."),
|
|
2343
2344
|
more: (e) => P("voiceSession.continuedMore", "…and {{count}} more", { count: e })
|
|
2344
2345
|
}),
|
|
2345
2346
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2346
|
-
metadata: { continuedVoiceTurns:
|
|
2347
|
-
}),
|
|
2347
|
+
metadata: { continuedVoiceTurns: $l }
|
|
2348
|
+
}), Ui.recordCommittedEntries(e, [n], "NOTE", T()), vs(!1), $.end(), gs(), ja?.();
|
|
2348
2349
|
}, [
|
|
2349
|
-
|
|
2350
|
+
vl,
|
|
2351
|
+
$l,
|
|
2350
2352
|
Ql,
|
|
2351
|
-
Zl,
|
|
2352
2353
|
W,
|
|
2353
2354
|
P,
|
|
2354
2355
|
$,
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
]),
|
|
2356
|
+
vs,
|
|
2357
|
+
gs,
|
|
2358
|
+
ja
|
|
2359
|
+
]), nu = A({
|
|
2359
2360
|
conversationId: null,
|
|
2360
2361
|
count: 0
|
|
2361
2362
|
});
|
|
2362
2363
|
O(() => {
|
|
2363
|
-
$.active && (
|
|
2364
|
+
$.active && (nu.current = {
|
|
2364
2365
|
conversationId: H,
|
|
2365
|
-
count:
|
|
2366
|
+
count: $l
|
|
2366
2367
|
});
|
|
2367
2368
|
}, [$.active]);
|
|
2368
|
-
let [
|
|
2369
|
+
let [ru, iu] = j({}), [au, ou] = j({}), su = A(null), cu = $.active;
|
|
2369
2370
|
O(() => {
|
|
2370
2371
|
if (!I) return;
|
|
2371
|
-
if (
|
|
2372
|
-
|
|
2372
|
+
if (cu) {
|
|
2373
|
+
su.current ??= {
|
|
2373
2374
|
startedAt: Date.now(),
|
|
2374
2375
|
sessionId: null
|
|
2375
2376
|
};
|
|
2376
2377
|
return;
|
|
2377
2378
|
}
|
|
2378
|
-
let e =
|
|
2379
|
-
|
|
2379
|
+
let e = su.current;
|
|
2380
|
+
su.current = null;
|
|
2380
2381
|
let t = e?.sessionId;
|
|
2381
2382
|
if (e && t) {
|
|
2382
2383
|
let n = Math.max(1, Math.round((Date.now() - e.startedAt) / 1e3));
|
|
2383
|
-
|
|
2384
|
+
ou((e) => ({
|
|
2384
2385
|
...e,
|
|
2385
2386
|
[t]: n
|
|
2386
2387
|
}));
|
|
2387
2388
|
}
|
|
2388
|
-
}, [I,
|
|
2389
|
-
let
|
|
2389
|
+
}, [I, cu]);
|
|
2390
|
+
let lu = $.isCurrentSession;
|
|
2390
2391
|
O(() => {
|
|
2391
|
-
let e =
|
|
2392
|
+
let e = su.current;
|
|
2392
2393
|
if (!I || !e || e.sessionId) return;
|
|
2393
|
-
let t =
|
|
2394
|
+
let t = vl.find((e) => e.sessionId !== void 0 && lu(e.sessionId));
|
|
2394
2395
|
t?.sessionId && (e.sessionId = t.sessionId);
|
|
2395
2396
|
}, [
|
|
2396
2397
|
I,
|
|
2397
|
-
|
|
2398
|
-
|
|
2398
|
+
vl,
|
|
2399
|
+
lu
|
|
2399
2400
|
]);
|
|
2400
|
-
let
|
|
2401
|
-
|
|
2402
|
-
...
|
|
2403
|
-
[
|
|
2401
|
+
let uu = $.session.phase, du = ol[ol.length - 1], fu = I && $.active && (uu === "thinking" || uu === "speaking") && du?.role === "assistant" && fr(du) ? du.id : null, pu = $.spokenChunks, mu = fu !== null && ec === fu && pu ? _r(du?.content ?? "", pu.chunks.slice(0, pu.index + 1).join(" ").length) : null, [hu, gu] = j({});
|
|
2402
|
+
fu !== null && mu !== null && mu.length > (hu[fu]?.length ?? 0) && gu({
|
|
2403
|
+
...hu,
|
|
2404
|
+
[fu]: mu
|
|
2404
2405
|
});
|
|
2405
|
-
let
|
|
2406
|
-
if (
|
|
2406
|
+
let _u = fu === null ? null : hu[fu] ?? "", vu = D(() => {
|
|
2407
|
+
if (fu === null || _u === null || !H) return;
|
|
2407
2408
|
let e = w.getState();
|
|
2408
|
-
if (
|
|
2409
|
-
e.mergeMessageMetadata(H,
|
|
2409
|
+
if (_u === "") {
|
|
2410
|
+
e.mergeMessageMetadata(H, fu, { voiceNotSpoken: !0 });
|
|
2410
2411
|
return;
|
|
2411
2412
|
}
|
|
2412
|
-
if (
|
|
2413
|
-
let t =
|
|
2414
|
-
|
|
2413
|
+
if (ec !== fu) return;
|
|
2414
|
+
let t = _u;
|
|
2415
|
+
iu((e) => ({
|
|
2415
2416
|
...e,
|
|
2416
|
-
[
|
|
2417
|
-
})), e.mergeMessageMetadata(H,
|
|
2417
|
+
[fu]: t
|
|
2418
|
+
})), e.mergeMessageMetadata(H, fu, {
|
|
2418
2419
|
voiceInterrupted: !0,
|
|
2419
2420
|
voiceSpokenText: t
|
|
2420
2421
|
});
|
|
2421
2422
|
}, [
|
|
2422
|
-
|
|
2423
|
-
|
|
2423
|
+
fu,
|
|
2424
|
+
_u,
|
|
2424
2425
|
H,
|
|
2425
|
-
|
|
2426
|
+
ec
|
|
2426
2427
|
]);
|
|
2427
2428
|
O(() => {
|
|
2428
|
-
|
|
2429
|
-
}, [
|
|
2430
|
-
let
|
|
2431
|
-
if (!
|
|
2432
|
-
let r =
|
|
2433
|
-
if (e.role === "user") return { below: /* @__PURE__ */ ua
|
|
2429
|
+
Ol.current = vu;
|
|
2430
|
+
}, [vu]);
|
|
2431
|
+
let yu = (e, t, n) => {
|
|
2432
|
+
if (!fr(e)) return;
|
|
2433
|
+
let r = mr(e), i = n[t + 1], a = $.active && r !== void 0 && lu(r), o = (!i || !fr(i) || mr(i) !== r) && !a ? /* @__PURE__ */ M(hr, { seconds: r ? au[r] : void 0 }) : null;
|
|
2434
|
+
if (e.role === "user") return { below: /* @__PURE__ */ da(ua, { children: [/* @__PURE__ */ M(gr, { mark: "spoken" }), o] }) };
|
|
2434
2435
|
if (e.role !== "assistant") return o ? { below: o } : void 0;
|
|
2435
|
-
let s =
|
|
2436
|
+
let s = ru[e.id] ?? (e.metadata?.voiceInterrupted ? e.metadata.voiceSpokenText : void 0);
|
|
2436
2437
|
if (s !== void 0) return {
|
|
2437
2438
|
content: s,
|
|
2438
|
-
below: /* @__PURE__ */ ua
|
|
2439
|
+
below: /* @__PURE__ */ da(ua, { children: [/* @__PURE__ */ M(gr, { mark: "interrupted" }), o] })
|
|
2439
2440
|
};
|
|
2440
|
-
if (e.id ===
|
|
2441
|
-
let c = a || r !== void 0 &&
|
|
2442
|
-
return e.content.trim() !== "" && (c ?
|
|
2443
|
-
},
|
|
2444
|
-
let e =
|
|
2445
|
-
$.end(), n &&
|
|
2441
|
+
if (e.id === fu && _u !== null) return { content: _u };
|
|
2442
|
+
let c = a || r !== void 0 && au[r] !== void 0;
|
|
2443
|
+
return e.content.trim() !== "" && (c ? hu[e.id] !== void 0 : !e.metadata?.voiceNotSpoken) ? { below: /* @__PURE__ */ da(ua, { children: [/* @__PURE__ */ M(gr, { mark: "spokenAloud" }), o] }) } : o ? { below: o } : void 0;
|
|
2444
|
+
}, bu = D(() => {
|
|
2445
|
+
let e = nu.current, t = e.conversationId === H ? e.count : 0, n = $l > t;
|
|
2446
|
+
$.end(), n && vs(!0), vu();
|
|
2446
2447
|
}, [
|
|
2447
2448
|
H,
|
|
2448
|
-
|
|
2449
|
+
$l,
|
|
2449
2450
|
$,
|
|
2450
|
-
|
|
2451
|
-
|
|
2451
|
+
vs,
|
|
2452
|
+
vu
|
|
2452
2453
|
]);
|
|
2453
2454
|
O(() => {
|
|
2454
|
-
|
|
2455
|
+
Ca && Fs || !$.active || $.end();
|
|
2455
2456
|
}, [
|
|
2456
|
-
|
|
2457
|
-
|
|
2457
|
+
Ca,
|
|
2458
|
+
Fs,
|
|
2458
2459
|
$
|
|
2459
2460
|
]);
|
|
2460
|
-
let [
|
|
2461
|
+
let [xu, Su] = j(va), Cu = Je({
|
|
2461
2462
|
available: $.available,
|
|
2462
|
-
allowedInMode:
|
|
2463
|
-
readOnly:
|
|
2464
|
-
busy:
|
|
2465
|
-
committing:
|
|
2466
|
-
dictating:
|
|
2467
|
-
}),
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
}, [
|
|
2471
|
-
let
|
|
2472
|
-
|
|
2473
|
-
}, [
|
|
2463
|
+
allowedInMode: Fs,
|
|
2464
|
+
readOnly: Fo,
|
|
2465
|
+
busy: Eo || Us !== null || Lo || vc,
|
|
2466
|
+
committing: xu.committing,
|
|
2467
|
+
dictating: xu.dictating
|
|
2468
|
+
}), wu = qe();
|
|
2469
|
+
ca(() => {
|
|
2470
|
+
ka?.({ live: $.active });
|
|
2471
|
+
}, [ka, $.active]);
|
|
2472
|
+
let Tu = A(!1), Eu = D(() => {
|
|
2473
|
+
Tu.current = !0, Aa?.({ review: !0 });
|
|
2474
|
+
}, [Aa]);
|
|
2474
2475
|
O(() => {
|
|
2475
|
-
!
|
|
2476
|
-
}, [
|
|
2477
|
-
let
|
|
2476
|
+
!Ia && Tu.current && (Tu.current = !1, Me(hd.current));
|
|
2477
|
+
}, [Ia]);
|
|
2478
|
+
let Du = $.active;
|
|
2478
2479
|
O(() => {
|
|
2479
|
-
if (!
|
|
2480
|
-
else if (
|
|
2481
|
-
let e =
|
|
2482
|
-
|
|
2483
|
-
} else
|
|
2480
|
+
if (!Du) Es.current = !1, Ts.current = null;
|
|
2481
|
+
else if (bs) {
|
|
2482
|
+
let e = ys.current;
|
|
2483
|
+
vr(e) && (Ts.current = e.openAtStart), Es.current = !0;
|
|
2484
|
+
} else Es.current && (Es.current = !1, F && Ae({
|
|
2484
2485
|
pending: "own",
|
|
2485
|
-
openAtStart:
|
|
2486
|
-
},
|
|
2486
|
+
openAtStart: Ts.current
|
|
2487
|
+
}, ys.current) && Cs(!0));
|
|
2487
2488
|
}, [
|
|
2488
|
-
|
|
2489
|
-
|
|
2489
|
+
bs,
|
|
2490
|
+
Du,
|
|
2490
2491
|
F
|
|
2491
|
-
]),
|
|
2492
|
-
let [
|
|
2492
|
+
]), Ss && !$.active && Cs(!1);
|
|
2493
|
+
let [Ou, ku] = j(null);
|
|
2493
2494
|
O(() => {
|
|
2494
|
-
|
|
2495
|
+
Ou !== null && (J && Ou.conversationId === H || ku(null));
|
|
2495
2496
|
}, [
|
|
2496
2497
|
J,
|
|
2497
2498
|
H,
|
|
2498
|
-
|
|
2499
|
+
Ou
|
|
2499
2500
|
]);
|
|
2500
|
-
let
|
|
2501
|
-
|
|
2501
|
+
let Au = Ou !== null && ec === Ou.replyId, ju = A(!1), Mu = D(() => {
|
|
2502
|
+
ju.current = !0, Au && tc(), Zl();
|
|
2502
2503
|
}, [
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
]),
|
|
2507
|
-
|
|
2504
|
+
Zl,
|
|
2505
|
+
Au,
|
|
2506
|
+
tc
|
|
2507
|
+
]), Nu = D(() => {
|
|
2508
|
+
Au && tc(), Zl();
|
|
2508
2509
|
}, [
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2510
|
+
Zl,
|
|
2511
|
+
Au,
|
|
2512
|
+
tc
|
|
2512
2513
|
]);
|
|
2513
2514
|
O(() => {
|
|
2514
|
-
$.active || (
|
|
2515
|
+
$.active || (ju.current = !1);
|
|
2515
2516
|
}, [$.active]), O(() => {
|
|
2516
|
-
!J &&
|
|
2517
|
+
!J && ju.current && (ju.current = !1, $.active && bu());
|
|
2517
2518
|
}, [
|
|
2518
2519
|
J,
|
|
2519
2520
|
$.active,
|
|
2520
|
-
|
|
2521
|
+
bu
|
|
2521
2522
|
]), O(() => {
|
|
2522
|
-
J &&
|
|
2523
|
-
}, [J,
|
|
2524
|
-
let
|
|
2523
|
+
J && vs(!1);
|
|
2524
|
+
}, [J, vs]);
|
|
2525
|
+
let Pu = k(() => ({
|
|
2525
2526
|
live: $.active,
|
|
2526
|
-
blocked:
|
|
2527
|
-
impossible:
|
|
2528
|
-
start: F ?
|
|
2527
|
+
blocked: Cu === null ? null : wu.voiceStartBlocked(Cu),
|
|
2528
|
+
impossible: Ye(Cu),
|
|
2529
|
+
start: F ? Nu : Mu
|
|
2529
2530
|
}), [
|
|
2530
2531
|
$.active,
|
|
2531
|
-
Su,
|
|
2532
2532
|
Cu,
|
|
2533
|
+
wu,
|
|
2533
2534
|
F,
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
]), [
|
|
2537
|
-
|
|
2538
|
-
let
|
|
2535
|
+
Nu,
|
|
2536
|
+
Mu
|
|
2537
|
+
]), [Fu, Iu] = j("mini"), [Lu, Ru] = j(!1), zu = Ia && $.active && (Lu || J);
|
|
2538
|
+
zu !== Lu && Ru(zu);
|
|
2539
|
+
let Bu = F && !I && $.active && !J && (!Ia || Lu), Vu = Ca && q.covered !== !0 && !($.active && Fu !== "mini") && !(ms && !$.active) && !(Bl || Vl || Hl || Ul), Hu = hs?.ask, Uu = la(Hu?.subscribe ?? ba, Hu?.getSnapshot ?? xa, Hu?.getSnapshot ?? xa), Wu = Xe({
|
|
2539
2540
|
voiceLive: $.active,
|
|
2540
|
-
readOnly:
|
|
2541
|
-
writes:
|
|
2542
|
-
auto:
|
|
2541
|
+
readOnly: Fo,
|
|
2542
|
+
writes: Ze({
|
|
2543
|
+
auto: rs,
|
|
2543
2544
|
selectedMode: U,
|
|
2544
|
-
conversation: G && !
|
|
2545
|
+
conversation: G && !Fo ? {
|
|
2545
2546
|
mode: G.mode,
|
|
2546
2547
|
routedBy: G.routedBy,
|
|
2547
|
-
hasHistory:
|
|
2548
|
+
hasHistory: Wi(G)
|
|
2548
2549
|
} : null,
|
|
2549
|
-
modeWrites: (e) => R.find((t) => t.id === e)?.writeCapable === !0 ||
|
|
2550
|
+
modeWrites: (e) => R.find((t) => t.id === e)?.writeCapable === !0 || bt(e)
|
|
2550
2551
|
}),
|
|
2551
|
-
avatar:
|
|
2552
|
-
busy:
|
|
2553
|
-
committing:
|
|
2554
|
-
}),
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
}, [
|
|
2558
|
-
let
|
|
2552
|
+
avatar: Uu,
|
|
2553
|
+
busy: Eo || Us !== null || Lo || vc || us !== null || ss,
|
|
2554
|
+
committing: xu.committing
|
|
2555
|
+
}), Gu = A(Wu);
|
|
2556
|
+
ca(() => {
|
|
2557
|
+
Gu.current = Wu;
|
|
2558
|
+
}, [Wu]);
|
|
2559
|
+
let Ku = D((e) => {
|
|
2559
2560
|
let t = e.trim();
|
|
2560
|
-
if (t === "" ||
|
|
2561
|
-
|
|
2561
|
+
if (t === "" || Gu.current !== null) return { accepted: !1 };
|
|
2562
|
+
Au && tc();
|
|
2562
2563
|
let n = {
|
|
2563
2564
|
token: N(),
|
|
2564
2565
|
exchange: null,
|
|
2565
2566
|
handled: !1
|
|
2566
2567
|
};
|
|
2567
|
-
|
|
2568
|
+
nc.current = n;
|
|
2568
2569
|
try {
|
|
2569
2570
|
Q(t, [], {
|
|
2570
2571
|
fromPerson: !0,
|
|
2571
2572
|
avatarTabAsk: n.token,
|
|
2572
2573
|
localRecordsChecked: !0,
|
|
2573
|
-
...
|
|
2574
|
+
...rs ? { autoIntent: "read" } : {}
|
|
2574
2575
|
});
|
|
2575
2576
|
} finally {
|
|
2576
|
-
|
|
2577
|
+
nc.current = null;
|
|
2577
2578
|
}
|
|
2578
2579
|
let r = n.exchange;
|
|
2579
2580
|
return r === null ? n.handled ? {
|
|
2580
2581
|
accepted: !0,
|
|
2581
2582
|
recorded: !1
|
|
2582
|
-
} : { accepted: !1 } : (
|
|
2583
|
+
} : { accepted: !1 } : (ku(r), {
|
|
2583
2584
|
accepted: !0,
|
|
2584
2585
|
recorded: !0,
|
|
2585
2586
|
...r
|
|
2586
2587
|
});
|
|
2587
2588
|
}, [
|
|
2588
|
-
|
|
2589
|
+
rs,
|
|
2589
2590
|
Q,
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
]), [
|
|
2593
|
-
blocker:
|
|
2594
|
-
line:
|
|
2595
|
-
send:
|
|
2596
|
-
last:
|
|
2597
|
-
navigatingReplyId:
|
|
2598
|
-
draft:
|
|
2591
|
+
tc,
|
|
2592
|
+
Au
|
|
2593
|
+
]), [qu] = j(() => $e()), Ju = k(() => ({
|
|
2594
|
+
blocker: Wu,
|
|
2595
|
+
line: Qe(Wu, Cu),
|
|
2596
|
+
send: Ku,
|
|
2597
|
+
last: Ou,
|
|
2598
|
+
navigatingReplyId: bc,
|
|
2599
|
+
draft: qu
|
|
2599
2600
|
}), [
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
]),
|
|
2601
|
+
Wu,
|
|
2602
|
+
Cu,
|
|
2603
|
+
Ku,
|
|
2604
|
+
Ou,
|
|
2605
|
+
bc,
|
|
2606
|
+
qu
|
|
2607
|
+
]), Yu = q.setReplyEscape, Xu = J && Vu && Au;
|
|
2607
2608
|
O(() => {
|
|
2608
|
-
if (
|
|
2609
|
+
if (Yu && Xu) return Yu(tc), () => Yu(null);
|
|
2609
2610
|
}, [
|
|
2610
|
-
Ju,
|
|
2611
2611
|
Yu,
|
|
2612
|
-
|
|
2612
|
+
Xu,
|
|
2613
|
+
tc
|
|
2613
2614
|
]), O(() => {
|
|
2614
|
-
let e =
|
|
2615
|
+
let e = ys.current, t = Tr(e), n = w.getState(), r = xr({
|
|
2615
2616
|
sessionLive: $.active,
|
|
2616
2617
|
bound: e,
|
|
2617
2618
|
activeConversationId: n.activeConversationId,
|
|
2618
2619
|
boundConversationExists: n.conversations.some((e) => e.id === t)
|
|
2619
2620
|
});
|
|
2620
|
-
|
|
2621
|
+
ws(r.bound), r.end && $.end();
|
|
2621
2622
|
}, [
|
|
2622
2623
|
$,
|
|
2623
2624
|
H,
|
|
2624
|
-
|
|
2625
|
-
|
|
2625
|
+
no,
|
|
2626
|
+
ws
|
|
2626
2627
|
]), O(() => {
|
|
2627
|
-
let e =
|
|
2628
|
+
let e = br(Er.read(), {
|
|
2628
2629
|
activeConversationId: H,
|
|
2629
|
-
chatTurnCount:
|
|
2630
|
-
voiceTurnCount:
|
|
2630
|
+
chatTurnCount: al.length,
|
|
2631
|
+
voiceTurnCount: vl.length,
|
|
2631
2632
|
sessionLive: $.active,
|
|
2632
|
-
sessionBoundTo:
|
|
2633
|
-
turnInFlight:
|
|
2633
|
+
sessionBoundTo: ys.current,
|
|
2634
|
+
turnInFlight: Eo
|
|
2634
2635
|
});
|
|
2635
|
-
|
|
2636
|
+
Er.write(e.state), e.open && vs(!0);
|
|
2636
2637
|
}, [
|
|
2637
2638
|
H,
|
|
2638
|
-
|
|
2639
|
-
|
|
2639
|
+
al.length,
|
|
2640
|
+
vl.length,
|
|
2640
2641
|
$.active,
|
|
2641
|
-
|
|
2642
|
-
|
|
2642
|
+
Eo,
|
|
2643
|
+
vs
|
|
2643
2644
|
]), O(() => {
|
|
2644
2645
|
if (!$.active) {
|
|
2645
|
-
|
|
2646
|
-
for (let e of
|
|
2647
|
-
|
|
2646
|
+
xl.current.clear(), Cl(null), qs.current = null;
|
|
2647
|
+
for (let e of Tl.current) window.clearInterval(e);
|
|
2648
|
+
Tl.current.clear();
|
|
2648
2649
|
}
|
|
2649
2650
|
}, [$.active]), O(() => {
|
|
2650
|
-
let e =
|
|
2651
|
+
let e = Tl.current;
|
|
2651
2652
|
return () => {
|
|
2652
2653
|
for (let t of e) window.clearInterval(t);
|
|
2653
2654
|
e.clear();
|
|
2654
2655
|
};
|
|
2655
2656
|
}, []), O(() => {
|
|
2656
2657
|
let e = w.getState().consumePendingPrompt();
|
|
2657
|
-
return e &&
|
|
2658
|
+
return e && nl.current(e), w.subscribe((e, t) => {
|
|
2658
2659
|
if (e.pendingPrompt && e.pendingPrompt !== t.pendingPrompt) {
|
|
2659
2660
|
let e = w.getState().consumePendingPrompt();
|
|
2660
|
-
e &&
|
|
2661
|
+
e && nl.current(e);
|
|
2661
2662
|
}
|
|
2662
2663
|
});
|
|
2663
2664
|
}, []);
|
|
2664
|
-
let
|
|
2665
|
+
let Zu = D((e) => {
|
|
2665
2666
|
let t = H ? w.getState().conversations.find((e) => e.id === H) : void 0;
|
|
2666
|
-
if (t && t.mode !== e && K.withdraw(t.id, "mode_switched"), t &&
|
|
2667
|
+
if (t && t.mode !== e && K.withdraw(t.id, "mode_switched"), t && Wi(t)) {
|
|
2667
2668
|
if (t.mode !== e) {
|
|
2668
|
-
let t =
|
|
2669
|
-
n ?
|
|
2669
|
+
let t = Zi(), n = w.getState().conversations.find((n) => n.mode === e && qi(n, t) && !w.getState().processingByConversationId[n.id]);
|
|
2670
|
+
n ? oo(n.id) : so(void 0, e);
|
|
2670
2671
|
}
|
|
2671
|
-
} else H &&
|
|
2672
|
+
} else H && ao(H, e);
|
|
2672
2673
|
let n = w.getState().activeConversationId;
|
|
2673
|
-
n ?
|
|
2674
|
+
n ? ao(n, e) : xo(!1), io(e);
|
|
2674
2675
|
}, [
|
|
2675
2676
|
H,
|
|
2677
|
+
so,
|
|
2676
2678
|
oo,
|
|
2679
|
+
xo,
|
|
2677
2680
|
ao,
|
|
2678
|
-
bo,
|
|
2679
2681
|
io,
|
|
2680
|
-
ro,
|
|
2681
2682
|
K
|
|
2682
|
-
]),
|
|
2683
|
+
]), Qu = D(() => {
|
|
2683
2684
|
let e = w.getState(), t = e.activeConversationId ? e.conversations.find((t) => t.id === e.activeConversationId) : void 0;
|
|
2684
2685
|
if (!t) {
|
|
2685
|
-
|
|
2686
|
+
xo(!0), io(b);
|
|
2686
2687
|
return;
|
|
2687
2688
|
}
|
|
2688
2689
|
if (t.routedBy === "auto") {
|
|
2689
|
-
|
|
2690
|
+
xo(!0);
|
|
2690
2691
|
return;
|
|
2691
2692
|
}
|
|
2692
|
-
if (!
|
|
2693
|
-
|
|
2693
|
+
if (!Wi(t)) {
|
|
2694
|
+
So(t.id, b);
|
|
2694
2695
|
return;
|
|
2695
2696
|
}
|
|
2696
2697
|
K.withdraw(t.id, "mode_switched");
|
|
2697
|
-
let n =
|
|
2698
|
-
r ? (
|
|
2698
|
+
let n = Zi(), r = e.conversations.find((t) => t.routedBy === "auto" && qi(t, n) && !e.processingByConversationId[t.id]);
|
|
2699
|
+
r ? (oo(r.id), So(r.id, b)) : so(void 0, b, { routedBy: "auto" });
|
|
2699
2700
|
}, [
|
|
2701
|
+
so,
|
|
2702
|
+
So,
|
|
2700
2703
|
oo,
|
|
2701
2704
|
xo,
|
|
2702
|
-
|
|
2703
|
-
bo,
|
|
2704
|
-
ro,
|
|
2705
|
+
io,
|
|
2705
2706
|
K
|
|
2706
|
-
]),
|
|
2707
|
-
R.find((t) => t.id === e)?.writeCapable && !
|
|
2708
|
-
}, [
|
|
2709
|
-
let e =
|
|
2710
|
-
if (
|
|
2711
|
-
let t =
|
|
2712
|
-
|
|
2707
|
+
]), $u = D((e) => {
|
|
2708
|
+
R.find((t) => t.id === e)?.writeCapable && !Qn(w.getState().acknowledgedWriteModes, e) ? ds(e) : Zu(e);
|
|
2709
|
+
}, [Zu, R]), ed = D(() => {
|
|
2710
|
+
let e = us;
|
|
2711
|
+
if (ds(null), !e) return;
|
|
2712
|
+
let t = as.current;
|
|
2713
|
+
as.current = null, t ? (yo(e), Q(t.content, t.attachments, t.options)) : (yo(e), Zu(e));
|
|
2713
2714
|
}, [
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2715
|
+
us,
|
|
2716
|
+
yo,
|
|
2717
|
+
Zu,
|
|
2717
2718
|
Q
|
|
2718
|
-
]),
|
|
2719
|
-
|
|
2720
|
-
let e =
|
|
2721
|
-
|
|
2719
|
+
]), td = us === null ? void 0 : R.find((e) => e.id === us) ?? { id: us }, nd = D(() => {
|
|
2720
|
+
ds(null);
|
|
2721
|
+
let e = as.current;
|
|
2722
|
+
as.current = null, e && Q(e.content, e.attachments, {
|
|
2722
2723
|
...e.options,
|
|
2723
2724
|
autoIntent: "read"
|
|
2724
2725
|
});
|
|
2725
|
-
}, [Q]),
|
|
2726
|
-
let e = w.getState(), t = e.activeConversationId ? e.conversations.find((t) => t.id === e.activeConversationId) : void 0, n =
|
|
2726
|
+
}, [Q]), rd = D(() => Ys(), [Ys]), [id, ad] = j(null), od = D(() => {
|
|
2727
|
+
let e = w.getState(), t = e.activeConversationId ? e.conversations.find((t) => t.id === e.activeConversationId) : void 0, n = Vs.current;
|
|
2727
2728
|
return {
|
|
2728
2729
|
state: e,
|
|
2729
2730
|
conversation: t ? {
|
|
2730
2731
|
mode: t.mode,
|
|
2731
|
-
hasHistory:
|
|
2732
|
+
hasHistory: Wi(t),
|
|
2732
2733
|
routedByAuto: t.routedBy === "auto"
|
|
2733
2734
|
} : null,
|
|
2734
2735
|
waitingCount: t ? K.liveFor(t.id).count : 0,
|
|
2735
2736
|
hasDraft: n !== null && (n.text.trim() !== "" || n.hasAttachments)
|
|
2736
2737
|
};
|
|
2737
|
-
}, [K]),
|
|
2738
|
-
if (
|
|
2739
|
-
let { state: t, conversation: n, waitingCount: r, hasDraft: i } =
|
|
2738
|
+
}, [K]), sd = rs ? P("modeSelector.auto", "Auto") : void 0, cd = D((e) => {
|
|
2739
|
+
if (us !== null) return;
|
|
2740
|
+
let { state: t, conversation: n, waitingCount: r, hasDraft: i } = od(), a = R.find((t) => t.id === e), o = Ne({
|
|
2740
2741
|
target: {
|
|
2741
2742
|
kind: "mode",
|
|
2742
2743
|
mode: e,
|
|
2743
|
-
consentRequired: !!a?.writeCapable && !
|
|
2744
|
+
consentRequired: !!a?.writeCapable && !Qn(t.acknowledgedWriteModes, e)
|
|
2744
2745
|
},
|
|
2745
2746
|
conversation: n,
|
|
2746
2747
|
waitingCount: r,
|
|
2747
2748
|
hasDraft: i
|
|
2748
2749
|
});
|
|
2749
|
-
o.needsDialog ?
|
|
2750
|
+
o.needsDialog ? ad({
|
|
2750
2751
|
open: !0,
|
|
2751
2752
|
target: {
|
|
2752
2753
|
kind: "mode",
|
|
2753
2754
|
mode: e
|
|
2754
2755
|
},
|
|
2755
2756
|
plan: o,
|
|
2756
|
-
targetName:
|
|
2757
|
-
currentName:
|
|
2758
|
-
}) :
|
|
2757
|
+
targetName: De(P, a ?? { id: e }),
|
|
2758
|
+
currentName: sd
|
|
2759
|
+
}) : Zu(e);
|
|
2759
2760
|
}, [
|
|
2761
|
+
sd,
|
|
2760
2762
|
od,
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
Xu,
|
|
2763
|
+
us,
|
|
2764
|
+
Zu,
|
|
2764
2765
|
R,
|
|
2765
2766
|
P
|
|
2766
|
-
]),
|
|
2767
|
-
if (
|
|
2768
|
-
let { conversation: e, waitingCount: t, hasDraft: n } =
|
|
2767
|
+
]), ld = D(() => {
|
|
2768
|
+
if (us !== null) return;
|
|
2769
|
+
let { conversation: e, waitingCount: t, hasDraft: n } = od(), r = Ne({
|
|
2769
2770
|
target: { kind: "auto" },
|
|
2770
2771
|
conversation: e,
|
|
2771
2772
|
waitingCount: t,
|
|
2772
2773
|
hasDraft: n
|
|
2773
2774
|
});
|
|
2774
|
-
r.needsDialog ?
|
|
2775
|
+
r.needsDialog ? ad({
|
|
2775
2776
|
open: !0,
|
|
2776
2777
|
target: { kind: "auto" },
|
|
2777
2778
|
plan: r,
|
|
2778
2779
|
targetName: P("modeSelector.auto", "Auto")
|
|
2779
|
-
}) :
|
|
2780
|
+
}) : Qu();
|
|
2780
2781
|
}, [
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2782
|
+
Qu,
|
|
2783
|
+
od,
|
|
2784
|
+
us,
|
|
2784
2785
|
P
|
|
2785
|
-
]),
|
|
2786
|
-
let e =
|
|
2787
|
-
e?.open && (
|
|
2786
|
+
]), ud = D(() => {
|
|
2787
|
+
let e = id;
|
|
2788
|
+
e?.open && (ad({
|
|
2788
2789
|
...e,
|
|
2789
2790
|
open: !1
|
|
2790
|
-
}), e.target.kind === "auto" ?
|
|
2791
|
+
}), e.target.kind === "auto" ? Qu() : (e.plan.consent && yo(e.target.mode), Zu(e.target.mode)));
|
|
2791
2792
|
}, [
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
]),
|
|
2797
|
-
|
|
2793
|
+
yo,
|
|
2794
|
+
Qu,
|
|
2795
|
+
id,
|
|
2796
|
+
Zu
|
|
2797
|
+
]), dd = D(() => {
|
|
2798
|
+
ad((e) => e && {
|
|
2798
2799
|
...e,
|
|
2799
2800
|
open: !1
|
|
2800
2801
|
});
|
|
2801
|
-
}, []),
|
|
2802
|
-
consent:
|
|
2803
|
-
withdrawnCount:
|
|
2804
|
-
movesToNewConversation:
|
|
2805
|
-
draftKept:
|
|
2806
|
-
targetName:
|
|
2807
|
-
...
|
|
2808
|
-
} : void 0,
|
|
2802
|
+
}, []), fd = id ? {
|
|
2803
|
+
consent: id.plan.consent,
|
|
2804
|
+
withdrawnCount: id.plan.withdrawnCount,
|
|
2805
|
+
movesToNewConversation: id.plan.movesToNewConversation,
|
|
2806
|
+
draftKept: id.plan.draftKept,
|
|
2807
|
+
targetName: id.targetName,
|
|
2808
|
+
...id.currentName === void 0 ? {} : { currentName: id.currentName }
|
|
2809
|
+
} : void 0, pd = id?.target.kind === "mode" ? id.target.mode : null, md = pd === null ? void 0 : R.find((e) => e.id === pd) ?? { id: pd }, hd = A(null), gd = k(() => {
|
|
2809
2810
|
if (!F) return 0;
|
|
2810
|
-
let e = new Set(
|
|
2811
|
-
return
|
|
2811
|
+
let e = new Set(ol.flatMap((e) => ae(e.metadata).map((e) => e.proposalId)));
|
|
2812
|
+
return je(Ao, H, jo, e);
|
|
2812
2813
|
}, [
|
|
2813
2814
|
F,
|
|
2814
|
-
|
|
2815
|
+
ol,
|
|
2815
2816
|
H,
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
]),
|
|
2819
|
-
|
|
2820
|
-
}, []),
|
|
2821
|
-
empty:
|
|
2822
|
-
historyPending:
|
|
2817
|
+
Ao,
|
|
2818
|
+
jo
|
|
2819
|
+
]), _d = D(() => {
|
|
2820
|
+
Me(hd.current);
|
|
2821
|
+
}, []), vd = I && Na && Ue({
|
|
2822
|
+
empty: ol.length === 0,
|
|
2823
|
+
historyPending: Lo || Ro,
|
|
2823
2824
|
hasOlder: G?.sync?.hasOlder === !0
|
|
2824
|
-
}),
|
|
2825
|
-
ref:
|
|
2825
|
+
}), yd = vd ? /* @__PURE__ */ M("div", {
|
|
2826
|
+
ref: Pa,
|
|
2826
2827
|
className: "w-full shrink-0",
|
|
2827
2828
|
"data-testid": "assistant-page-start-above"
|
|
2828
|
-
}) :
|
|
2829
|
-
state:
|
|
2830
|
-
onRetry:
|
|
2831
|
-
}) :
|
|
2829
|
+
}) : ol.length === 0 && (Lo || Ro) ? /* @__PURE__ */ M(ve, {
|
|
2830
|
+
state: Lo ? "loading" : "failed",
|
|
2831
|
+
onRetry: Zo
|
|
2832
|
+
}) : ol.length === 0 && G?.sync?.hasOlder ? /* @__PURE__ */ M("div", {
|
|
2832
2833
|
className: "flex min-h-0 flex-1 flex-col",
|
|
2833
|
-
children: /* @__PURE__ */ M(
|
|
2834
|
-
onShowEarlier:
|
|
2835
|
-
disabled:
|
|
2834
|
+
children: /* @__PURE__ */ M(be, {
|
|
2835
|
+
onShowEarlier: Qo,
|
|
2836
|
+
disabled: Lo
|
|
2836
2837
|
})
|
|
2837
|
-
}) :
|
|
2838
|
+
}) : ol.length === 0 && F && !I ? /* @__PURE__ */ M(he, {
|
|
2839
|
+
mode: U,
|
|
2840
|
+
auto: rs && U === "assistant",
|
|
2841
|
+
voiceOffered: $.available && Fs,
|
|
2842
|
+
avatarOffered: !!(q.ids && q.compact),
|
|
2843
|
+
onSuggestionClick: $c
|
|
2844
|
+
}) : ol.length === 0 ? /* @__PURE__ */ M(me, {
|
|
2838
2845
|
mode: U,
|
|
2839
|
-
onSuggestionClick:
|
|
2840
|
-
explainsAuto:
|
|
2841
|
-
suggestions:
|
|
2842
|
-
}) : /* @__PURE__ */
|
|
2846
|
+
onSuggestionClick: $c,
|
|
2847
|
+
explainsAuto: rs,
|
|
2848
|
+
suggestions: rs && U === "assistant" ? le(R.find((e) => e.id === "assistant")?.suggestions ?? [], R.find((e) => e.id === "api-calls")?.suggestions ?? []) : void 0
|
|
2849
|
+
}) : /* @__PURE__ */ da("div", {
|
|
2843
2850
|
className: "flex min-h-0 flex-1 flex-col",
|
|
2844
|
-
children: [G?.sync?.hasOlder ? /* @__PURE__ */ M(
|
|
2845
|
-
onShowEarlier:
|
|
2846
|
-
disabled:
|
|
2851
|
+
children: [G?.sync?.hasOlder ? /* @__PURE__ */ M(be, {
|
|
2852
|
+
onShowEarlier: Qo,
|
|
2853
|
+
disabled: Lo
|
|
2847
2854
|
}) : null, /* @__PURE__ */ M(c, {
|
|
2848
|
-
onApprovePendingWrite:
|
|
2849
|
-
approvingWriteRef:
|
|
2850
|
-
approvableMessageId:
|
|
2851
|
-
retryableMessageId:
|
|
2852
|
-
messages:
|
|
2853
|
-
decorate: I ?
|
|
2854
|
-
processing:
|
|
2855
|
-
streamingMessageId:
|
|
2856
|
-
failedMessageId:
|
|
2857
|
-
onRetry:
|
|
2858
|
-
renderWriteProposals:
|
|
2859
|
-
hidesLegacyWriteCard:
|
|
2860
|
-
renderUiOffers:
|
|
2861
|
-
onStopTurn: F ? void 0 :
|
|
2862
|
-
stopTurnLabel: F ? void 0 :
|
|
2855
|
+
onApprovePendingWrite: Zs,
|
|
2856
|
+
approvingWriteRef: Us,
|
|
2857
|
+
approvableMessageId: ul?.messageId ?? null,
|
|
2858
|
+
retryableMessageId: dl,
|
|
2859
|
+
messages: ol,
|
|
2860
|
+
decorate: I ? yu : void 0,
|
|
2861
|
+
processing: To ?? null,
|
|
2862
|
+
streamingMessageId: Do,
|
|
2863
|
+
failedMessageId: Oo,
|
|
2864
|
+
onRetry: Us === null ? tl : void 0,
|
|
2865
|
+
renderWriteProposals: pl,
|
|
2866
|
+
hidesLegacyWriteCard: fl,
|
|
2867
|
+
renderUiOffers: hl,
|
|
2868
|
+
onStopTurn: F ? void 0 : rd,
|
|
2869
|
+
stopTurnLabel: F ? void 0 : Ma
|
|
2863
2870
|
})]
|
|
2864
2871
|
});
|
|
2865
|
-
return /* @__PURE__ */
|
|
2866
|
-
ref:
|
|
2872
|
+
return /* @__PURE__ */ da("div", {
|
|
2873
|
+
ref: hd,
|
|
2867
2874
|
className: "relative flex flex-1 flex-col overflow-hidden",
|
|
2868
|
-
style:
|
|
2875
|
+
style: vd ? Sa : void 0,
|
|
2869
2876
|
children: [
|
|
2870
|
-
/* @__PURE__ */
|
|
2877
|
+
/* @__PURE__ */ da("div", {
|
|
2871
2878
|
className: "contents",
|
|
2872
2879
|
inert: $.active && !I || J || void 0,
|
|
2873
2880
|
...q.ids ? F ? { id: q.ids.chatPanel } : {
|
|
@@ -2876,129 +2883,129 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
2876
2883
|
"aria-labelledby": q.ids.chatTab
|
|
2877
2884
|
} : {},
|
|
2878
2885
|
children: [
|
|
2879
|
-
|
|
2880
|
-
limit:
|
|
2881
|
-
onDismiss: () =>
|
|
2882
|
-
}) : /* @__PURE__ */ M(
|
|
2883
|
-
|
|
2884
|
-
count:
|
|
2885
|
-
onOpenTranscript: () =>
|
|
2886
|
+
Ho === null ? Go === null ? null : /* @__PURE__ */ M(S, {
|
|
2887
|
+
limit: Go.limit,
|
|
2888
|
+
onDismiss: () => Yi.getState().notePinLimit(void 0)
|
|
2889
|
+
}) : /* @__PURE__ */ M(_e, { onDismiss: () => Vo(Ho) }),
|
|
2890
|
+
vl.length > 0 && !$.active && !I ? /* @__PURE__ */ M(x, {
|
|
2891
|
+
count: vl.length,
|
|
2892
|
+
onOpenTranscript: () => vs(!0)
|
|
2886
2893
|
}) : null,
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2894
|
+
yd,
|
|
2895
|
+
Fo ? /* @__PURE__ */ M(ye, { onStartNew: () => so() }) : null,
|
|
2896
|
+
Io && H ? /* @__PURE__ */ M(ge, { onUnarchive: () => Ui.updateConversation(H, { archived: !1 }) }) : null,
|
|
2897
|
+
qc === null ? null : /* @__PURE__ */ M(Se, {
|
|
2891
2898
|
tr: P,
|
|
2892
|
-
onDismiss: () =>
|
|
2899
|
+
onDismiss: () => Jc(null)
|
|
2893
2900
|
}),
|
|
2894
|
-
|
|
2895
|
-
state:
|
|
2896
|
-
onRetry:
|
|
2901
|
+
ol.length > 0 && (Lo || Ro) ? /* @__PURE__ */ M(ve, {
|
|
2902
|
+
state: Lo ? "loading" : "failed",
|
|
2903
|
+
onRetry: Zo,
|
|
2897
2904
|
compact: !0
|
|
2898
2905
|
}) : null,
|
|
2899
|
-
/* @__PURE__ */ M(
|
|
2900
|
-
onStartVoiceSession: $.available &&
|
|
2906
|
+
/* @__PURE__ */ M(Ee, {
|
|
2907
|
+
onStartVoiceSession: $.available && Fs ? Zl : void 0,
|
|
2901
2908
|
onSend: (e, t) => {
|
|
2902
|
-
let n =
|
|
2909
|
+
let n = aa.getState().actions.take();
|
|
2903
2910
|
Q(e, t, {
|
|
2904
2911
|
fromPerson: !0,
|
|
2905
2912
|
...n ? { focus: n } : {}
|
|
2906
2913
|
});
|
|
2907
2914
|
},
|
|
2908
|
-
onDraftChange:
|
|
2909
|
-
inputRef: F ?
|
|
2910
|
-
viewSwitch: F && !I && q.ids && q.compact && !
|
|
2915
|
+
onDraftChange: Vc,
|
|
2916
|
+
inputRef: F ? Ea : void 0,
|
|
2917
|
+
viewSwitch: F && !I && q.ids && q.compact && !Bu ? /* @__PURE__ */ M(Be, {
|
|
2911
2918
|
selected: q.compact.view,
|
|
2912
2919
|
onSelect: q.compact.selectView,
|
|
2913
2920
|
ids: q.ids,
|
|
2914
2921
|
instance: "chat"
|
|
2915
2922
|
}) : void 0,
|
|
2916
|
-
aboveCard:
|
|
2917
|
-
count:
|
|
2918
|
-
onReview:
|
|
2919
|
-
opensFull:
|
|
2923
|
+
aboveCard: gd > 0 ? /* @__PURE__ */ M(ke, {
|
|
2924
|
+
count: gd,
|
|
2925
|
+
onReview: Ia && Aa ? Eu : _d,
|
|
2926
|
+
opensFull: Ia && Aa !== void 0
|
|
2920
2927
|
}) : void 0,
|
|
2921
|
-
disabled:
|
|
2922
|
-
readOnly:
|
|
2928
|
+
disabled: Eo || Us !== null || Lo || vc,
|
|
2929
|
+
readOnly: Fo,
|
|
2923
2930
|
placeholder: U === "api-calls" ? P("chatArea.placeholderActions", "What would you like me to do?") : P("chatArea.placeholderGeneral", "Ask me anything…"),
|
|
2924
2931
|
mode: U,
|
|
2925
|
-
writeAccessDenied:
|
|
2926
|
-
availableModes:
|
|
2927
|
-
attachmentCharsPerFile:
|
|
2928
|
-
onModeChange: F ?
|
|
2929
|
-
auto:
|
|
2930
|
-
active:
|
|
2931
|
-
onSelect: F ?
|
|
2932
|
+
writeAccessDenied: wa === "denied" && !!Ms?.writeCapable,
|
|
2933
|
+
availableModes: ts,
|
|
2934
|
+
attachmentCharsPerFile: ls,
|
|
2935
|
+
onModeChange: F ? cd : $u,
|
|
2936
|
+
auto: ns ? {
|
|
2937
|
+
active: rs,
|
|
2938
|
+
onSelect: F ? ld : Qu
|
|
2932
2939
|
} : void 0,
|
|
2933
|
-
suspendDictation: J || F && !
|
|
2934
|
-
entrance: I &&
|
|
2935
|
-
onVoiceStateChange: q.ids ||
|
|
2936
|
-
modeReadOnly:
|
|
2940
|
+
suspendDictation: J || F && !Ca,
|
|
2941
|
+
entrance: I && vd,
|
|
2942
|
+
onVoiceStateChange: q.ids || Ia ? Su : void 0,
|
|
2943
|
+
modeReadOnly: Ia || void 0,
|
|
2937
2944
|
voiceSessionActive: F ? $.active : void 0,
|
|
2938
2945
|
concealed: I && $.active,
|
|
2939
|
-
presentation:
|
|
2940
|
-
turnInFlight:
|
|
2941
|
-
turnId:
|
|
2942
|
-
onStop: F ?
|
|
2943
|
-
modeDisabledReason:
|
|
2946
|
+
presentation: Ta,
|
|
2947
|
+
turnInFlight: Eo,
|
|
2948
|
+
turnId: Eo ? To?.messageId ?? null : null,
|
|
2949
|
+
onStop: F ? rd : void 0,
|
|
2950
|
+
modeDisabledReason: Eo ? "replying" : "busy"
|
|
2944
2951
|
}),
|
|
2945
|
-
I ? /* @__PURE__ */ ua
|
|
2946
|
-
ref:
|
|
2952
|
+
I ? /* @__PURE__ */ da(ua, { children: [vd && !$.active ? /* @__PURE__ */ M("div", {
|
|
2953
|
+
ref: Fa,
|
|
2947
2954
|
className: "w-full shrink-0",
|
|
2948
2955
|
"data-testid": "assistant-page-start-below"
|
|
2949
2956
|
}) : null, /* @__PURE__ */ M("div", {
|
|
2950
|
-
ref:
|
|
2957
|
+
ref: cl,
|
|
2951
2958
|
className: "contents",
|
|
2952
2959
|
"data-testid": "assistant-page-voice-slot"
|
|
2953
2960
|
})] }) : null,
|
|
2954
|
-
F ? /* @__PURE__ */ M(
|
|
2961
|
+
F ? /* @__PURE__ */ M(Fe, { children: /* @__PURE__ */ M(Ie, {
|
|
2955
2962
|
productKey: L,
|
|
2956
|
-
enabled: !!
|
|
2963
|
+
enabled: !!Ba,
|
|
2957
2964
|
testId: "assistant-ai-credit-balance"
|
|
2958
|
-
}) }) : /* @__PURE__ */ ua
|
|
2965
|
+
}) }) : /* @__PURE__ */ da(ua, { children: [/* @__PURE__ */ M(Ie, {
|
|
2959
2966
|
productKey: L,
|
|
2960
|
-
enabled: !!
|
|
2967
|
+
enabled: !!Ba,
|
|
2961
2968
|
className: "px-3 pt-1 text-center",
|
|
2962
2969
|
testId: "assistant-ai-credit-balance"
|
|
2963
|
-
}), /* @__PURE__ */ M(
|
|
2970
|
+
}), /* @__PURE__ */ M(Pe, { className: "px-3 pb-2 pt-1" })] })
|
|
2964
2971
|
]
|
|
2965
2972
|
}),
|
|
2966
|
-
|
|
2967
|
-
turns:
|
|
2968
|
-
onClose: () =>
|
|
2969
|
-
onSave:
|
|
2970
|
-
onContinueInChat:
|
|
2973
|
+
ms && !$.active ? /* @__PURE__ */ M(Te, {
|
|
2974
|
+
turns: vl,
|
|
2975
|
+
onClose: () => vs(!1),
|
|
2976
|
+
onSave: yl,
|
|
2977
|
+
onContinueInChat: eu ? tu : void 0,
|
|
2971
2978
|
closeOnEscape: !0,
|
|
2972
|
-
onShowEarlier: G?.sync?.hasOlder ?
|
|
2973
|
-
showEarlierDisabled:
|
|
2974
|
-
renderAfterTurn:
|
|
2979
|
+
onShowEarlier: G?.sync?.hasOlder ? Qo : void 0,
|
|
2980
|
+
showEarlierDisabled: Lo,
|
|
2981
|
+
renderAfterTurn: ml
|
|
2975
2982
|
}) : null,
|
|
2976
|
-
|
|
2983
|
+
Bu && q.ids && q.compact ? /* @__PURE__ */ M(Ve, {
|
|
2977
2984
|
ids: q.ids,
|
|
2978
2985
|
compact: q.compact
|
|
2979
|
-
}) : J &&
|
|
2980
|
-
tab:
|
|
2981
|
-
CompactView:
|
|
2986
|
+
}) : J && hs && q.ids ? F && q.compact && hs.CompactView ? /* @__PURE__ */ M(ze, {
|
|
2987
|
+
tab: hs,
|
|
2988
|
+
CompactView: hs.CompactView,
|
|
2982
2989
|
ids: q.ids,
|
|
2983
2990
|
compact: q.compact,
|
|
2984
|
-
shown:
|
|
2985
|
-
voice:
|
|
2991
|
+
shown: Vu,
|
|
2992
|
+
voice: Pu,
|
|
2986
2993
|
...$.active ? { mute: {
|
|
2987
2994
|
muted: $.session.muted,
|
|
2988
2995
|
toggle: $.toggleMute
|
|
2989
2996
|
} } : {},
|
|
2990
|
-
...
|
|
2991
|
-
footer: /* @__PURE__ */ M(
|
|
2992
|
-
}) : /* @__PURE__ */ M(
|
|
2993
|
-
tab:
|
|
2997
|
+
...Hu ? { ask: Ju } : {},
|
|
2998
|
+
footer: /* @__PURE__ */ M(Fe, {})
|
|
2999
|
+
}) : /* @__PURE__ */ M(Re, {
|
|
3000
|
+
tab: hs,
|
|
2994
3001
|
id: q.ids.avatarPanel,
|
|
2995
3002
|
labelledBy: q.ids.avatarTab,
|
|
2996
3003
|
leaveHintId: q.ids.leaveHint,
|
|
2997
|
-
shown:
|
|
2998
|
-
voice:
|
|
2999
|
-
...
|
|
3004
|
+
shown: Vu,
|
|
3005
|
+
voice: Pu,
|
|
3006
|
+
...Hu ? { ask: Ju } : {}
|
|
3000
3007
|
}) : null,
|
|
3001
|
-
$.active && /* @__PURE__ */ M(
|
|
3008
|
+
$.active && /* @__PURE__ */ M(Le, {
|
|
3002
3009
|
session: $.session,
|
|
3003
3010
|
notice: $.notice,
|
|
3004
3011
|
privacyNotice: $.handsFree.privacyNotice,
|
|
@@ -3010,66 +3017,66 @@ var ya = () => () => {}, ba = () => "off", xa = { overflowY: "auto" }, Sa = ({ v
|
|
|
3010
3017
|
correcting: $.correcting,
|
|
3011
3018
|
onLetMeFinish: $.letMeFinish,
|
|
3012
3019
|
onImDone: $.imDone,
|
|
3013
|
-
turns:
|
|
3020
|
+
turns: kl,
|
|
3014
3021
|
spokenChunks: $.spokenChunks,
|
|
3015
|
-
attachments:
|
|
3016
|
-
onAttachFiles:
|
|
3017
|
-
onRemoveAttachment:
|
|
3018
|
-
onRetryAttachment:
|
|
3019
|
-
canAttachMore:
|
|
3020
|
-
preparingAttachments:
|
|
3021
|
-
attachmentsLocked:
|
|
3022
|
-
attachmentNotice:
|
|
3023
|
-
onSaveTranscript:
|
|
3024
|
-
onContinueInChat:
|
|
3022
|
+
attachments: bl.attachments,
|
|
3023
|
+
onAttachFiles: bl.addFiles,
|
|
3024
|
+
onRemoveAttachment: bl.remove,
|
|
3025
|
+
onRetryAttachment: bl.retry,
|
|
3026
|
+
canAttachMore: bl.canAddMore,
|
|
3027
|
+
preparingAttachments: bl.preparingCount,
|
|
3028
|
+
attachmentsLocked: bl.isCommitting,
|
|
3029
|
+
attachmentNotice: wl,
|
|
3030
|
+
onSaveTranscript: yl,
|
|
3031
|
+
onContinueInChat: tu,
|
|
3025
3032
|
onInterrupt: () => {
|
|
3026
|
-
|
|
3033
|
+
vu(), $.interrupt(), Ys();
|
|
3027
3034
|
},
|
|
3028
|
-
spoken:
|
|
3035
|
+
spoken: il,
|
|
3029
3036
|
onToggleMute: $.toggleMute,
|
|
3030
|
-
onEnd:
|
|
3031
|
-
proposalChip:
|
|
3037
|
+
onEnd: bu,
|
|
3038
|
+
proposalChip: Ll ? Ia && Aa ? {
|
|
3032
3039
|
label: P("waitingChange.reviewInFull", "Review in full assistant"),
|
|
3033
|
-
status: te(
|
|
3034
|
-
onOpen:
|
|
3040
|
+
status: te(Ll, P),
|
|
3041
|
+
onOpen: Aa
|
|
3035
3042
|
} : {
|
|
3036
|
-
label: te(
|
|
3037
|
-
onOpen:
|
|
3043
|
+
label: te(Ll, P),
|
|
3044
|
+
onOpen: Il
|
|
3038
3045
|
} : null,
|
|
3039
|
-
proposalTray:
|
|
3040
|
-
renderAfterTurn:
|
|
3041
|
-
onViewChange: q.ids ?
|
|
3042
|
-
...
|
|
3046
|
+
proposalTray: Ia ? null : zl,
|
|
3047
|
+
renderAfterTurn: ml,
|
|
3048
|
+
onViewChange: q.ids ? Iu : void 0,
|
|
3049
|
+
...Ia ? { view: J || Lu ? "mini" : "compact" } : I ? {
|
|
3043
3050
|
view: "page",
|
|
3044
|
-
pageSlot:
|
|
3051
|
+
pageSlot: sl
|
|
3045
3052
|
} : {},
|
|
3046
|
-
startedCue: F ?
|
|
3053
|
+
startedCue: F ? Ss ? P("window.voiceStartedCue", "Started a voice conversation. Your chat is in History.") : null : void 0
|
|
3047
3054
|
}),
|
|
3048
3055
|
/* @__PURE__ */ M(l, {
|
|
3049
|
-
open:
|
|
3050
|
-
mode:
|
|
3051
|
-
currentMode:
|
|
3052
|
-
onConfirm:
|
|
3053
|
-
onCancel:
|
|
3056
|
+
open: us !== null,
|
|
3057
|
+
mode: td,
|
|
3058
|
+
currentMode: Ms ?? { id: U },
|
|
3059
|
+
onConfirm: ed,
|
|
3060
|
+
onCancel: nd
|
|
3054
3061
|
}),
|
|
3055
3062
|
F ? /* @__PURE__ */ M(l, {
|
|
3056
|
-
open:
|
|
3057
|
-
mode:
|
|
3058
|
-
currentMode:
|
|
3059
|
-
switchPlan:
|
|
3060
|
-
onConfirm:
|
|
3061
|
-
onCancel:
|
|
3063
|
+
open: id?.open === !0,
|
|
3064
|
+
mode: md,
|
|
3065
|
+
currentMode: Ms ?? { id: U },
|
|
3066
|
+
switchPlan: fd,
|
|
3067
|
+
onConfirm: ud,
|
|
3068
|
+
onCancel: dd
|
|
3062
3069
|
}) : null,
|
|
3063
3070
|
/* @__PURE__ */ M(u, {
|
|
3064
|
-
...
|
|
3065
|
-
view:
|
|
3066
|
-
serverNow:
|
|
3067
|
-
arrivedAt:
|
|
3068
|
-
capabilities:
|
|
3069
|
-
turnInFlight:
|
|
3071
|
+
...Mo.dialog,
|
|
3072
|
+
view: gl?.view ?? Mo.dialog.view,
|
|
3073
|
+
serverNow: gl?.serverNow ?? NaN,
|
|
3074
|
+
arrivedAt: gl?.arrivedAt ?? NaN,
|
|
3075
|
+
capabilities: gl ? ko[gl.session.sandboxId] : null,
|
|
3076
|
+
turnInFlight: Eo,
|
|
3070
3077
|
tr: P
|
|
3071
3078
|
})
|
|
3072
3079
|
]
|
|
3073
3080
|
});
|
|
3074
3081
|
};
|
|
3075
|
-
export {
|
|
3082
|
+
export { Ca as AssistantChatArea };
|