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