@burdenoff/fe-libs 2026.1023.1 → 2026.1023.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/api.js +218 -217
- package/dist/shared/assistant/createSandboxAssistantTransport.js +99 -85
- package/dist/shared/assistant/history/historyMapping.js +26 -26
- package/dist/shared/assistant/index.d.ts +1 -0
- package/dist/shared/assistant/progress.d.ts +2 -0
- package/dist/shared/assistant/progress.js +13 -5
- package/dist/shared/assistant/promptDelivery.d.ts +24 -0
- package/dist/shared/assistant/promptDelivery.js +80 -0
- package/dist/shared/assistant/ui/AssistantChatArea.js +1526 -1516
- package/dist/shared-assistant.js +305 -304
- package/package.json +1 -1
|
@@ -6,298 +6,299 @@ import { useAssistantControl as r } from "../appControls/useAssistantControl.js"
|
|
|
6
6
|
import { useAssistantProduct as i } from "../product.js";
|
|
7
7
|
import { useAssistantTr as a } from "../i18n.js";
|
|
8
8
|
import { useAssistantNavigate as o } from "./AssistantMarkdownRenderer.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
92
|
-
import {
|
|
93
|
-
import {
|
|
94
|
-
import {
|
|
95
|
-
import {
|
|
96
|
-
import {
|
|
97
|
-
import {
|
|
98
|
-
import {
|
|
99
|
-
import {
|
|
100
|
-
import {
|
|
101
|
-
import {
|
|
102
|
-
import {
|
|
103
|
-
import {
|
|
104
|
-
import {
|
|
105
|
-
import {
|
|
106
|
-
import {
|
|
107
|
-
import {
|
|
108
|
-
import {
|
|
109
|
-
import {
|
|
110
|
-
import {
|
|
111
|
-
import {
|
|
112
|
-
import {
|
|
113
|
-
import {
|
|
114
|
-
import {
|
|
115
|
-
import {
|
|
116
|
-
import {
|
|
9
|
+
import { sanitize as s } from "../progress.js";
|
|
10
|
+
import { AssistantPromptDelivery as c, trackAssistantSandboxTurn as l } from "../promptDelivery.js";
|
|
11
|
+
import { isAssistantModeId as u } from "../modeIds.js";
|
|
12
|
+
import { AUTO_READ_MODE as d, autoSuggestions as f, classifyAssistantIntent as ee, escalationToUndo as te, isAutoRoutingOffered as p, resolveAutoRoute as ne } from "../autoRouting.js";
|
|
13
|
+
import { getHistoryStamp as re, setHistoryBusyProbe as ie } from "../history/stampRegistry.js";
|
|
14
|
+
import { beginApprovalInFlight as ae, endApprovalInFlight as oe, getApprovalInFlight as se, markLiveTurn as ce, newestModelReplyId as m, resolveApprovablePendingWrite as h, resolveRetryableMessageId as g, subscribeApprovalInFlight as le } from "../liveTurns.js";
|
|
15
|
+
import { isWriteModeAcknowledged as ue, writeModeSendRefusalReason as de } from "../writeModeConsent.js";
|
|
16
|
+
import { resolveActiveModeSandbox as fe, useAssistantStore as _ } from "../store.js";
|
|
17
|
+
import { abortAssistantTurn as pe, approvePendingWrite as v, createAssistantSandbox as me, createAssistantSession as he, extendAssistantSandboxTTL as ge, findExistingSandboxWithStatus as _e, getAssistantArtifacts as ve, getAssistantMessages as ye, getAssistantSession as y, mintAssistantTurnStream as be, modeRequiresConfirmWrites as xe, promptGatewayRequestBytes as Se, releaseSupersededAssistantSandboxes as Ce, sendAssistantPromptAsync as we, waitForAssistantServiceReady as Te, waitForSandboxRunning as Ee, writeApprovalModeOf as De } from "../api.js";
|
|
18
|
+
import { UiOfferSession as Oe, sandboxServesUiOffers as ke, uiOfferHintKind as b, uiOfferInTime as Ae } from "../uiActions/uiOffers.js";
|
|
19
|
+
import { AssistantSendRefusal as je, classifyTurnFailure as Me, turnConfirmsNoAction as Ne, turnOutcomeCopy as Pe } from "../turnOutcome.js";
|
|
20
|
+
import { assistantUsageLedger as Fe, hasPendingUsageReports as Ie, reportUsageWithRetry as Le, retryPendingUsageReports as Re, usageSendRefusal as ze } from "../usageReporting.js";
|
|
21
|
+
import { withIncompleteTurnNotice as Be } from "../streamBudget.js";
|
|
22
|
+
import { chatTurns as Ve, isVoiceTurn as He, voiceMarker as x, voiceSessionIdOf as S } from "../voice/turnVisibility.js";
|
|
23
|
+
import { speechFeed as Ue } from "../speech/speechFeed.js";
|
|
24
|
+
import { requestReplyOnAvatar as We } from "../speech/replySpeechRequests.js";
|
|
25
|
+
import { toVoiceReply as Ge } from "../voice/voiceReply.js";
|
|
26
|
+
import { isTurnSuperseded as Ke, markTurnSuperseded as qe } from "../voice/supersededTurns.js";
|
|
27
|
+
import { buildContinuedFromVoiceNote as Je, buildVoiceTranscriptMarkdown as Ye, voiceTranscriptFilename as Xe } from "../voice/voiceTranscript.js";
|
|
28
|
+
import { pollDelayMs as Ze } from "../voice/assistantPollSchedule.js";
|
|
29
|
+
import { toCaptionText as Qe } from "../voice/captionText.js";
|
|
30
|
+
import { resolveAssistantLanguage as $e } from "../voice/languages.js";
|
|
31
|
+
import { resolveLanguagePair as et } from "../voice/languagePair.js";
|
|
32
|
+
import { INITIAL_TRANSCRIPT_AUTO_OPEN as tt, isAwaitingOwnConversation as nt, maySendSpokenTurn as C, planTranscriptAutoOpen as rt, planVoiceSessionBinding as it, planVoiceSessionStart as at, planVoiceSpokenEntry as ot, voiceBindingAtStart as st, voiceBindingConversationId as ct } from "../voice/voiceReopen.js";
|
|
33
|
+
import { countInlineImageCandidates as lt, countInlinedImageParts as ut, largestInlineCharsPerFile as dt, resolveAssistantInlineLimits as ft, toMessageAttachment as pt } from "../attachments.js";
|
|
34
|
+
import { WRITE_PROPOSAL_VOICE_COPY as mt, isVoiceProposalBound as ht, voiceProposalChip as gt, voiceProposalChipText as _t, voiceReadbacksDue as vt, voiceWaitingProposals as yt, writeProposalVoiceLine as bt, writeProposalVoiceReadback as xt } from "../writeProposalVoice.js";
|
|
35
|
+
import { createAdminModeAccessGate as St, resolveAssistantSendModeAfterAccess as Ct } from "../adminModeSendGate.js";
|
|
36
|
+
import { buildBoundedAttachmentTurn as wt } from "../attachmentTurn.js";
|
|
37
|
+
import { useAvatarCopy as Tt } from "../avatar/useAvatarCopy.js";
|
|
38
|
+
import { attachmentUrlIsStale as Et, refreshStaleAttachmentUrls as Dt } from "../attachmentCommit.js";
|
|
39
|
+
import { VOICE_COMMIT_BUDGET_MS as Ot, settleAndCommitSpokenTurn as kt } from "../voiceCommit.js";
|
|
40
|
+
import { getOrganizationId as At, getWorkspaceId as w } from "../context.js";
|
|
41
|
+
import { useAttachmentUrlResolver as jt } from "../useAttachmentCommitter.js";
|
|
42
|
+
import { isTurnInFlight as Mt, planAbandonedTurn as Nt, planTurnAbort as Pt } from "../turnState.js";
|
|
43
|
+
import { backDoneCopy as Ft, chooseDestinationCopy as It, chooseLinkedCopy as Lt, entityNounText as Rt, linkNotOpenableCopy as zt, navigationCommandCopy as Bt, navigationOutcomeCopy as Vt, offerExpiredCopy as Ht, offerKeptForUnsavedCopy as Ut, offerNotAvailableCopy as Wt, pickFromListCopy as Gt, recordChoiceCopy as Kt, recordKindsCopy as qt, themeCommandCopy as Jt } from "../localUiCommandCopy.js";
|
|
44
|
+
import { appControlCopy as Yt } from "../appControls/copy.js";
|
|
45
|
+
import { LANGUAGE_REPLY_DEADLINE_MS as Xt, languageConfirmationCopy as Zt, languageReplyStep as Qt } from "../appControls/languageReply.js";
|
|
46
|
+
import { getAssistantDisplayContent as $t } from "../displayContent.js";
|
|
47
|
+
import { NO_FIRST_TEXT as en, buildAssistantProgress as tn, readAheadFor as nn, snapshotReplyFloor as rn, startSessionReadAhead as an, trackFirstText as on } from "../turnProgress.js";
|
|
48
|
+
import { parseToolActivity as sn } from "./AssistantToolActivity.js";
|
|
49
|
+
import { countSpokenTurns as cn, spokenMessagesSinceContinueNote as ln, spokenTurnText as un } from "../spokenTurns.js";
|
|
50
|
+
import { beginTurn as dn, describeTurn as fn, detectTurnDevice as pn, markTurn as T, restartAttempt as mn, turnClockMs as hn } from "../turnTimeline.js";
|
|
51
|
+
import { useAssistantSpeech as gn } from "./AssistantSpeechProvider.js";
|
|
52
|
+
import { useLiveAvatarTab as _n, useLiveAvatarTabSeam as vn } from "./assistantLiveAvatarSeam.js";
|
|
53
|
+
import { useVoiceSession as yn } from "./useVoiceSession.js";
|
|
54
|
+
import { isMultimodalBodyRejection as bn, isRecoverableAssistantError as xn } from "../transportErrors.js";
|
|
55
|
+
import { createReadinessTracker as Sn, planAfterTransportFailure as Cn, planTrustedSandboxFailure as wn } from "../sandboxReadiness.js";
|
|
56
|
+
import { writeProposalConfirmState as Tn } from "./writeProposalPresentation.js";
|
|
57
|
+
import { writeProposalUsesDialog as En } from "./AssistantWriteProposalCard.js";
|
|
58
|
+
import { AssistantWriteConfirmDialog as Dn } from "./AssistantWriteConfirmDialog.js";
|
|
59
|
+
import { useWriteProposalConfirm as On } from "./useWriteProposalConfirm.js";
|
|
60
|
+
import { AssistantWriteProposalSlot as kn } from "./AssistantWriteProposalSlot.js";
|
|
61
|
+
import { readWriteProposalRefs as An, writeProposalsEnabledFor as jn } from "../writeProposalDiscovery.js";
|
|
62
|
+
import { planWriteReply as Mn, promptWriteApproval as Nn } from "../writeReplySend.js";
|
|
63
|
+
import { useWriteProposals as Pn } from "./useWriteProposals.js";
|
|
64
|
+
import { AssistantSpokenTurnsNotice as Fn } from "./AssistantSpokenTurnsNotice.js";
|
|
65
|
+
import { AssistantHistoryArchivedNotice as In, AssistantHistoryDeletedNotice as Ln, AssistantHistoryLoadState as Rn, AssistantHistoryReadOnlyBanner as zn, AssistantHistoryShowEarlier as Bn } from "./AssistantHistoryNotices.js";
|
|
66
|
+
import { VoiceTranscriptDrawer as Vn } from "./voice/VoiceTranscriptDrawer.js";
|
|
67
|
+
import { downloadFile as Hn } from "../exportConversation.js";
|
|
68
|
+
import { conversationHasHistory as Un, isOtherScopeHistoryConversation as Wn, isReadOnlyHistoryConversation as Gn, isReusableHistoryDraft as Kn } from "../history/historyList.js";
|
|
69
|
+
import { useAssistantHistoryStatus as qn } from "../history/historyStatus.js";
|
|
70
|
+
import { assistantHistory as Jn } from "../history/historyEngine.js";
|
|
71
|
+
import { AssistantEmptyState as Yn } from "./AssistantEmptyState.js";
|
|
72
|
+
import { AssistantNothingToDeleteNotice as Xn } from "./AssistantDeleteConversationDialog.js";
|
|
73
|
+
import { assistantHistoryIsOn as Zn } from "./conversationDelete.js";
|
|
74
|
+
import { useConversationDeleteDialog as Qn } from "./conversationDeleteDialog.js";
|
|
75
|
+
import { useControlConfirmDialog as $n } from "./controlConfirmDialog.js";
|
|
76
|
+
import { useLeaveConfirmAsking as er } from "./leaveConfirm.js";
|
|
77
|
+
import { startFocusReturnAfterKeep as tr } from "./leaveConfirmFocus.js";
|
|
78
|
+
import { resolveConversationDeleteTarget as nr } from "../conversationDeleteCommand.js";
|
|
79
|
+
import { resumeContextFor as rr } from "../history/historyResume.js";
|
|
80
|
+
import { useHistoryRowControlsFor as ir } from "../history/useHistoryRowControls.js";
|
|
81
|
+
import { liveCoverage as ar } from "../liveDeltas.js";
|
|
82
|
+
import { createLiveRender as or } from "../liveOverlay.js";
|
|
83
|
+
import { AssistantMessageList as sr } from "./AssistantMessageList.js";
|
|
84
|
+
import { AssistantUiOfferLinks as cr } from "./AssistantUiOfferLink.js";
|
|
85
|
+
import { AssistantVoiceSession as lr } from "./voice/AssistantVoiceSession.js";
|
|
86
|
+
import { voiceStartBlocker as ur, voiceStartBlockerLasts as dr } from "./voice/voiceStartGate.js";
|
|
87
|
+
import { avatarAskBlocker as fr, avatarAskWrites as pr, avatarTabAskLine as mr } from "./avatar/avatarAskGate.js";
|
|
88
|
+
import { createAvatarTabDraft as hr } from "./avatar/avatarTabDraft.js";
|
|
89
|
+
import { AssistantAvatarTab as gr } from "./avatar/AssistantAvatarTab.js";
|
|
90
|
+
import { useAssistantApiAccess as _r } from "../useAssistantApiAccess.js";
|
|
91
|
+
import { useConversationTurns as vr } from "../useConversationTurns.js";
|
|
92
|
+
import { openTurnStream as yr, turnStreamAvailable as br } from "../turnStream.js";
|
|
93
|
+
import { createSnapshotPoller as xr } from "../snapshotPoller.js";
|
|
94
|
+
import { sendAssistantTurnTimings as Sr, startTurnTimingReporting as Cr } from "../turnTimingReporter.js";
|
|
95
|
+
import { QuarantineSet as wr, WarmCancelled as Tr, claimPreopenedSession as Er, consumeWarm as Dr, preopenKey as Or, preopenWanted as kr, prewarmTarget as Ar, settleWarmBeforeSend as jr, startPreopen as Mr, startWarm as Nr, warmState as Pr } from "../prewarm.js";
|
|
96
|
+
import { navEntryIds as Fr } from "../uiActions/resolveTarget.js";
|
|
97
|
+
import { lookupNamedRecords as Ir } from "../uiActions/recordNames.js";
|
|
98
|
+
import { isAlreadyThere as Lr, matchLocalUiCommand as Rr, mayBeNavigationFollowUp as zr, navDestinations as Br, planThemeChange as Vr } from "../localUiCommands.js";
|
|
99
|
+
import { offerAssentFor as Hr } from "../localeCommands/assent.js";
|
|
100
|
+
import { readControlSnapshot as Ur } from "../appControls/snapshot.js";
|
|
101
|
+
import { runNavigation as Wr } from "../uiActions/navigationOutcome.js";
|
|
102
|
+
import { assistantBackStack as Gr, isBackRunnable as Kr } from "../uiActions/backStack.js";
|
|
103
|
+
import { buildNavigateAction as qr, destinationForPath as Jr, labelForPath as Yr, newestAssistantOnSurface as Xr } from "../uiActions/navigateAction.js";
|
|
104
|
+
import { buildNavigationContext as Zr, latestReplyOnSurface as Qr, rememberPresentedList as $r } from "../uiActions/linkContext.js";
|
|
105
|
+
import { buildUiCatalogue as ei, markUiCatalogueSent as ti, uiCatalogueSent as ni, uiCatalogueSessionKey as ri } from "../uiActions/uiCatalogue.js";
|
|
106
|
+
import { offerYesOnSurface as ii } from "../uiActions/offerYesOnSurface.js";
|
|
107
|
+
import { parseNavIntent as ai } from "../uiActions/navIntent.js";
|
|
108
|
+
import { decideActOnResolve as oi, n4LeaveGuard as si } from "../uiActions/actOnResolve.js";
|
|
109
|
+
import { planAppControl as ci } from "../appControls/plan.js";
|
|
110
|
+
import { dispatchAssistantQuotaExhausted as li, notifyAiCreditsUpdated as ui } from "../aiCredits.js";
|
|
111
|
+
import { useAssistantAttachments as di } from "../useAssistantAttachments.js";
|
|
112
|
+
import { AssistantComposer as fi } from "./composer/AssistantComposer.js";
|
|
113
|
+
import { isProdRuntime as pi } from "../env.js";
|
|
114
|
+
import { AssistantApiCallsConsentDialog as mi } from "./AssistantApiCallsConsentDialog.js";
|
|
115
|
+
import { useVisibleNavItems as hi } from "../../../chrome/mobileTabBar/useVisibleNavItems.js";
|
|
116
|
+
import { useCallback as E, useEffect as D, useLayoutEffect as gi, useMemo as O, useRef as k, useState as A, useSyncExternalStore as _i } from "react";
|
|
117
|
+
import { jsx as j, jsxs as vi } from "react/jsx-runtime";
|
|
117
118
|
//#region src/shared/assistant/ui/AssistantChatArea.tsx
|
|
118
|
-
var
|
|
119
|
+
var yi = 2500, bi = 600, xi = 2e4, Si = 1e4, Ci = 1e4, wi = {
|
|
119
120
|
committing: !1,
|
|
120
121
|
dictating: !1
|
|
121
|
-
},
|
|
122
|
-
function
|
|
122
|
+
}, Ti = 6e3;
|
|
123
|
+
function M() {
|
|
123
124
|
return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
124
125
|
}
|
|
125
|
-
var
|
|
126
|
-
let
|
|
127
|
-
let n =
|
|
128
|
-
return
|
|
126
|
+
var Ei = () => () => {}, Di = () => "off", Oi = ({ visible: Oi = !0, writeAccess: ki = "unknown" }) => {
|
|
127
|
+
let N = a(), { product: P, modes: F, gatherPageContext: Ai, buildPrompt: ji, reportTurnTimings: Mi, reportTokenUsage: Ni, localUiCommands: Pi } = i(), I = De(i().writeApproval), Fi = E((e, t) => {
|
|
128
|
+
let n = _.getState(), r = t ?? n.sandboxesByMode[e]?.sandboxId ?? null;
|
|
129
|
+
return ht({
|
|
129
130
|
mode: e,
|
|
130
|
-
productWriteApproval:
|
|
131
|
+
productWriteApproval: I,
|
|
131
132
|
capabilities: r ? n.sandboxWriteCapabilities[r] : null
|
|
132
133
|
});
|
|
133
|
-
}, [
|
|
134
|
-
Vi,
|
|
134
|
+
}, [I]), { getAccessToken: L, getWorkspaceToken: Ii, userId: R } = n(), { locale: z, isLocaleLoading: Li } = e(), Ri = _((e) => e.voiceGraceMs), zi = _((e) => e.handsFreeInterrupt), Bi = _((e) => e.handsFreeStreamNoticeAccepted), Vi = _((e) => e.acceptHandsFreeStreamNotice), Hi = _((e) => e.assistantLanguage), Ui = _((e) => e.replyLanguage), Wi = O(() => et(Hi, Ui, z), [
|
|
135
135
|
Hi,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
136
|
+
Ui,
|
|
137
|
+
z
|
|
138
|
+
]), Gi = Wi.reply.english, Ki = Wi.replyIsExplicit, qi = Wi.reply.code, { conversations: Ji, activeConversationId: B, mode: V, processingByConversationId: Yi, setMode: Xi, setConversationMode: Zi, setActiveConversation: Qi, createConversation: $i, addMessage: H, updateMessage: ea, patchMessage: ta, mergeMessageMetadata: na, setConversationProcessing: ra, clearConversationProcessing: ia, setBackendSessionId: aa, clearBackendSessionId: oa, setSandbox: sa, clearSandbox: ca, acknowledgedWriteModes: la, acknowledgeWriteMode: ua, autoRouting: da, setAutoRouting: fa, routeConversation: pa } = _(), U = Ji.find((e) => e.id === B), ma = vr(U), ha = ma.all, ga = B ? Yi[B] : void 0, _a = Mt(ga?.status), va = _a ? ga?.messageId ?? null : null, ya = ga?.status === "error" ? ga.messageId : null, ba = _((e) => e.sandboxWriteCapabilities), { panel: W, entries: xa, retiredSandboxes: Sa } = Pn({
|
|
139
|
+
tr: N,
|
|
140
|
+
productWriteApproval: I
|
|
141
|
+
}), Ca = On({
|
|
142
|
+
approve: (e, t) => W.approve(e, t),
|
|
143
|
+
decline: (e, t, n) => W.decline(e, t, n),
|
|
144
|
+
presented: (e, t) => W.presented(e, t)
|
|
145
|
+
}), wa = Ca.dismiss, Ta = k(null);
|
|
146
|
+
D(() => {
|
|
147
|
+
wa();
|
|
148
|
+
let e = Ta.current;
|
|
149
|
+
Ta.current = B, e && e !== B && W.withdraw(e, "conversation_closed"), B && W.openConversation(B);
|
|
149
150
|
}, [
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
B,
|
|
152
|
+
W,
|
|
153
|
+
wa
|
|
153
154
|
]);
|
|
154
|
-
let
|
|
155
|
-
|
|
156
|
-
if (
|
|
157
|
-
let e = window.setTimeout(() =>
|
|
155
|
+
let Ea = Gn(U), Da = ir(U)?.archivedAt != null, Oa = qn((e) => B !== null && B in e.loadingIds), ka = qn((e) => B !== null && B in e.loadErrorIds), Aa = qn((e) => e.remoteDelete), [ja, Ma] = A(() => qn.getState().remoteDelete?.at ?? null), Na = Aa?.wasActive === !0 && Aa.at !== ja ? Aa.at : null;
|
|
156
|
+
D(() => {
|
|
157
|
+
if (Na === null) return;
|
|
158
|
+
let e = window.setTimeout(() => Ma(Na), Ci);
|
|
158
159
|
return () => window.clearTimeout(e);
|
|
159
|
-
}, [
|
|
160
|
-
let { canUseApiCalls:
|
|
161
|
-
loading:
|
|
162
|
-
canUseAdminModes:
|
|
163
|
-
})).current,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}, [
|
|
167
|
-
let
|
|
168
|
-
let e =
|
|
169
|
-
e &&
|
|
170
|
-
},
|
|
171
|
-
let e =
|
|
172
|
-
e &&
|
|
173
|
-
},
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}, [
|
|
177
|
-
let
|
|
178
|
-
|
|
179
|
-
if (
|
|
180
|
-
workspaceId:
|
|
160
|
+
}, [Na]);
|
|
161
|
+
let { canUseApiCalls: Pa, loading: Fa } = _r(w(), R), Ia = k(St({
|
|
162
|
+
loading: Fa,
|
|
163
|
+
canUseAdminModes: Pa
|
|
164
|
+
})).current, La = k(F);
|
|
165
|
+
D(() => {
|
|
166
|
+
La.current = F;
|
|
167
|
+
}, [F]);
|
|
168
|
+
let Ra = () => {
|
|
169
|
+
let e = _.getState().activeConversationId;
|
|
170
|
+
e && Jn.openConversation(e, { modes: La.current });
|
|
171
|
+
}, za = () => {
|
|
172
|
+
let e = _.getState().activeConversationId;
|
|
173
|
+
e && Jn.loadEarlier(e);
|
|
174
|
+
}, Ba = k(L);
|
|
175
|
+
D(() => {
|
|
176
|
+
Ba.current = L;
|
|
177
|
+
}, [L]);
|
|
178
|
+
let Va = !!P && Mi !== !1;
|
|
179
|
+
D(() => {
|
|
180
|
+
if (Va) return Cr({ send: (e) => Sr(e, {
|
|
181
|
+
workspaceId: w(),
|
|
181
182
|
authContext: {
|
|
182
|
-
accessToken:
|
|
183
|
-
organizationId:
|
|
183
|
+
accessToken: Ba.current(),
|
|
184
|
+
organizationId: At()
|
|
184
185
|
}
|
|
185
186
|
}) });
|
|
186
|
-
}, [
|
|
187
|
-
|
|
188
|
-
loading:
|
|
189
|
-
canUseAdminModes:
|
|
187
|
+
}, [Va]), D(() => {
|
|
188
|
+
Ia.update({
|
|
189
|
+
loading: Fa,
|
|
190
|
+
canUseAdminModes: Pa
|
|
190
191
|
});
|
|
191
192
|
}, [
|
|
193
|
+
Ia,
|
|
192
194
|
Fa,
|
|
193
|
-
Pa
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
e && ro.current || $a(e ? g.getState().activeConversationId : null);
|
|
195
|
+
Pa
|
|
196
|
+
]), D(() => () => {
|
|
197
|
+
Ia.abandon();
|
|
198
|
+
}, [Ia]);
|
|
199
|
+
let Ha = O(() => F.filter((e) => !e.requiresAdmin || Pa), [F, Pa]), Ua = p(Ha), Wa = da && Ua, Ga = k(Ua);
|
|
200
|
+
D(() => {
|
|
201
|
+
Ga.current = Ua;
|
|
202
|
+
}, [Ua]);
|
|
203
|
+
let Ka = k(null), qa = k(!1), [Ja, Ya] = A(!1), Xa = dt(F), [Za, Qa] = A(null), [$a, eo] = A(null), to = $a !== null && $a === B, G = _n(), no = vn(), K = G.open && no !== null, ro = G.close, io = k(K);
|
|
204
|
+
gi(() => {
|
|
205
|
+
io.current = K;
|
|
206
|
+
}, [K]);
|
|
207
|
+
let ao = E((e) => {
|
|
208
|
+
e && io.current || eo(e ? _.getState().activeConversationId : null);
|
|
208
209
|
}, []);
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}, [
|
|
212
|
-
let
|
|
213
|
-
|
|
214
|
-
}, []),
|
|
215
|
-
let e =
|
|
210
|
+
D(() => {
|
|
211
|
+
eo((e) => e !== null && e !== B ? null : e);
|
|
212
|
+
}, [B]);
|
|
213
|
+
let oo = k(void 0), [so, co] = A(!1), lo = E((e) => {
|
|
214
|
+
oo.current = e, co(nt(e));
|
|
215
|
+
}, []), uo = E(() => {
|
|
216
|
+
let e = _.getState(), t = e.activeConversationId, n = t ? e.conversations.find((e) => e.id === t) : void 0;
|
|
216
217
|
return !t || !n ? null : {
|
|
217
218
|
id: t,
|
|
218
|
-
reusableDraft:
|
|
219
|
-
liveProposals:
|
|
220
|
-
turnInFlight:
|
|
219
|
+
reusableDraft: Kn(n, re()),
|
|
220
|
+
liveProposals: W.liveFor(t).count,
|
|
221
|
+
turnInFlight: Mt(e.processingByConversationId[t]?.status)
|
|
221
222
|
};
|
|
222
|
-
}, [
|
|
223
|
-
let t = e.sandboxesByMode[
|
|
223
|
+
}, [W]), fo = k({}), q = k(Sn()), J = k(new wr()), po = k(/* @__PURE__ */ new Set()), mo = O(() => F.find((e) => e.id === V), [F, V]), ho = _((e) => {
|
|
224
|
+
let t = e.sandboxesByMode[V]?.sandboxId;
|
|
224
225
|
return t ? e.sandboxWriteCapabilities[t] : void 0;
|
|
225
|
-
}),
|
|
226
|
-
mode:
|
|
227
|
-
productWriteApproval:
|
|
228
|
-
capabilities:
|
|
229
|
-
}),
|
|
230
|
-
|
|
231
|
-
if (
|
|
232
|
-
|
|
226
|
+
}), go = mo !== void 0 && ht({
|
|
227
|
+
mode: V,
|
|
228
|
+
productWriteApproval: I,
|
|
229
|
+
capabilities: ho
|
|
230
|
+
}), _o = V === "assistant" || mo !== void 0 && !mo.writeCapable && !xe(V) || go;
|
|
231
|
+
D(() => {
|
|
232
|
+
if (V !== "assistant" && mo?.writeCapable && !ue(la, V)) {
|
|
233
|
+
Xi("assistant");
|
|
233
234
|
return;
|
|
234
235
|
}
|
|
235
|
-
|
|
236
|
+
Fa || (!mo || mo.requiresAdmin && !Pa) && V !== "assistant" && Xi("assistant");
|
|
236
237
|
}, [
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
Na,
|
|
238
|
+
V,
|
|
239
|
+
mo,
|
|
240
240
|
Pa,
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
Fa,
|
|
242
|
+
Xi,
|
|
243
|
+
la
|
|
243
244
|
]);
|
|
244
|
-
let
|
|
245
|
-
|
|
246
|
-
}, [
|
|
245
|
+
let vo = E((e, t, n, r) => {
|
|
246
|
+
ra(e, n, t, null, r);
|
|
247
|
+
}, [ra]), yo = E(async (e, t, n, r, i, a = null) => {
|
|
247
248
|
let o = (e, t) => {
|
|
248
|
-
r &&
|
|
249
|
-
},
|
|
250
|
-
r &&
|
|
251
|
-
},
|
|
252
|
-
|
|
253
|
-
},
|
|
254
|
-
if (
|
|
255
|
-
}, f =
|
|
256
|
-
if (i && !
|
|
249
|
+
r && vo(r.conversationId, r.assistantMessageId, e, t), a && (a.step = t, a.onStep?.(t));
|
|
250
|
+
}, s = (e) => {
|
|
251
|
+
r && T(r.assistantMessageId, e);
|
|
252
|
+
}, c = () => {
|
|
253
|
+
s("bootAdopted"), a?.beginBoot();
|
|
254
|
+
}, l = () => a !== null && (a.signal.aborted || w() !== t), d = () => {
|
|
255
|
+
if (l()) throw new Tr("cancelled");
|
|
256
|
+
}, f = _.getState().sandboxesByMode[e]?.sandboxId ?? null, ee = !1, te = !1, p = !1, ne = !1, re = !1, ie = async (r) => {
|
|
257
|
+
if (i && !J.current.has(r) && q.current.isFresh(r)) return ee = !0, !0;
|
|
257
258
|
p = !0;
|
|
258
259
|
let o = !1;
|
|
259
260
|
try {
|
|
260
|
-
await
|
|
261
|
-
o = !0,
|
|
261
|
+
await Ee(r, t, n, 3e5), await Te(r, t, e, n, 9e4, () => {
|
|
262
|
+
o = !0, c();
|
|
262
263
|
});
|
|
263
264
|
} catch {
|
|
264
|
-
if (
|
|
265
|
-
return
|
|
265
|
+
if (l()) throw new Tr("cancelled");
|
|
266
|
+
return q.current.invalidate(r), J.current.add(r), a?.dead.push(r), re = !0, !1;
|
|
266
267
|
}
|
|
267
|
-
return d(),
|
|
268
|
+
return d(), q.current.markVerified(r), o && (ne = !0), !0;
|
|
268
269
|
};
|
|
269
|
-
if (f && (
|
|
270
|
+
if (f && (sa(e, f, "provisioning"), o("provisioning", "reusingEnvironment"), await ie(f) || (sa(e, null, "provisioning"), f = null)), !f) {
|
|
270
271
|
o("provisioning", "lookingForEnvironment");
|
|
271
|
-
let r = await
|
|
272
|
+
let r = await _e(t, P, e, pi(), n, J.current, I);
|
|
272
273
|
d();
|
|
273
274
|
let i = r?.id ?? null;
|
|
274
275
|
if (i) {
|
|
275
|
-
|
|
276
|
+
sa(e, i, "provisioning"), o("provisioning", "reusingEnvironment");
|
|
276
277
|
let t = r?.status === "PROVISIONING" || r?.status === "PENDING";
|
|
277
|
-
t &&
|
|
278
|
+
t && c(), await ie(i) ? (f = i, t && (ne = !0)) : sa(e, null, "provisioning");
|
|
278
279
|
}
|
|
279
280
|
}
|
|
280
281
|
if (!f) {
|
|
281
|
-
if (a && !a.mayCreate) throw new
|
|
282
|
-
if (
|
|
283
|
-
o("provisioning", "startingEnvironment"),
|
|
284
|
-
let r = a ? [] : await
|
|
282
|
+
if (a && !a.mayCreate) throw new Tr("no-create");
|
|
283
|
+
if (s("provisionStarted"), e === "api-calls" && !L()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
|
|
284
|
+
o("provisioning", "startingEnvironment"), sa(e, null, "provisioning");
|
|
285
|
+
let r = a ? [] : await Ce(t, P, e, pi(), n, J.current, I);
|
|
285
286
|
if (r.length > 0) {
|
|
286
287
|
let e = new Set(r);
|
|
287
|
-
for (let e of r)
|
|
288
|
-
let t =
|
|
289
|
-
for (let [n, r] of Object.entries(t))
|
|
288
|
+
for (let e of r) q.current.invalidate(e), J.current.add(e);
|
|
289
|
+
let t = _.getState().sandboxesByMode;
|
|
290
|
+
for (let [n, r] of Object.entries(t)) u(n) && r?.sandboxId && e.has(r.sandboxId) && ca(n);
|
|
290
291
|
}
|
|
291
|
-
|
|
292
|
+
s("createRequested");
|
|
292
293
|
let i = a?.beginCreate();
|
|
293
294
|
try {
|
|
294
|
-
f = await
|
|
295
|
+
f = await me(P, e, t, pi(), bi, n, { writeApproval: I });
|
|
295
296
|
} finally {
|
|
296
297
|
i?.();
|
|
297
298
|
}
|
|
298
|
-
te = !0, d(),
|
|
299
|
+
te = !0, d(), sa(e, f, "provisioning"), await Ee(f, t, n, 3e5), d(), s("sandboxRunning"), await Te(f, t, e, n, 9e4), d(), s("serviceReady"), q.current.markVerified(f);
|
|
299
300
|
}
|
|
300
|
-
return
|
|
301
|
+
return sa(e, f, "running"), {
|
|
301
302
|
sandboxId: f,
|
|
302
303
|
sandboxIsNew: te,
|
|
303
304
|
sandboxProbed: p,
|
|
@@ -306,64 +307,64 @@ var Ti = () => () => {}, Ei = () => "off", Di = ({ visible: Di = !0, writeAccess
|
|
|
306
307
|
trustedFromCache: ee
|
|
307
308
|
};
|
|
308
309
|
}, [
|
|
309
|
-
|
|
310
|
+
ca,
|
|
311
|
+
L,
|
|
312
|
+
P,
|
|
310
313
|
I,
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
s.verified && !q.current.has(s.verified) && K.current.markVerified(s.verified), s.joined && dn(n, { prewarm: s.joined });
|
|
319
|
-
let { sandboxId: c, sandboxIsNew: l, sandboxProbed: u, sandboxAdopted: d, deadSandboxProbe: f, trustedFromCache: ee } = await vo(r, i, a, {
|
|
314
|
+
sa,
|
|
315
|
+
vo
|
|
316
|
+
]), bo = E(async function e(t, n, r, i, a, o = {}) {
|
|
317
|
+
let s = await jr(i, r, (e) => vo(t, n, "provisioning", e), () => T(n, "prewarmJoined"));
|
|
318
|
+
for (let e of s.dead) q.current.invalidate(e), J.current.add(e);
|
|
319
|
+
s.verified && !J.current.has(s.verified) && q.current.markVerified(s.verified), s.joined && fn(n, { prewarm: s.joined });
|
|
320
|
+
let { sandboxId: c, sandboxIsNew: l, sandboxProbed: u, sandboxAdopted: d, deadSandboxProbe: f, trustedFromCache: ee } = await yo(r, i, a, {
|
|
320
321
|
conversationId: t,
|
|
321
322
|
assistantMessageId: n
|
|
322
|
-
}, o.trustCache !== !1), te =
|
|
323
|
-
!s.waited && te &&
|
|
324
|
-
let p =
|
|
323
|
+
}, o.trustCache !== !1), te = Dr(i, r, c);
|
|
324
|
+
!s.waited && te && fn(n, { prewarm: "hit" });
|
|
325
|
+
let p = _.getState().conversations.find((e) => e.id === t)?.backendSessionId ?? null, ne = !1, re = null;
|
|
325
326
|
if (p) {
|
|
326
|
-
let e =
|
|
327
|
+
let e = an(c, p, (e, t) => ye(e, i, t, r, a, { limit: 50 }));
|
|
327
328
|
try {
|
|
328
|
-
let t = await
|
|
329
|
+
let t = await y(c, i, p, r, a);
|
|
329
330
|
if (t.mode !== r) throw Error(`Session mode mismatch: expected ${r}, received ${t.mode}`);
|
|
330
331
|
re = e;
|
|
331
332
|
} catch {
|
|
332
|
-
|
|
333
|
+
oa(t), p = null;
|
|
333
334
|
}
|
|
334
335
|
}
|
|
335
336
|
let ie = !1;
|
|
336
337
|
if (!p) {
|
|
337
|
-
let e =
|
|
338
|
+
let e = Er(Or({
|
|
338
339
|
workspaceId: i,
|
|
339
340
|
mode: r,
|
|
340
341
|
sandboxId: c,
|
|
341
|
-
userId:
|
|
342
|
+
userId: R
|
|
342
343
|
}), Date.now());
|
|
343
344
|
if (e) {
|
|
344
|
-
"pending" in e &&
|
|
345
|
+
"pending" in e && vo(t, n, "connecting", "preparingSession");
|
|
345
346
|
let o = "sessionId" in e ? e.sessionId : await e.pending;
|
|
346
|
-
if (o && !
|
|
347
|
-
(await
|
|
347
|
+
if (o && !J.current.has(c)) try {
|
|
348
|
+
(await y(c, i, o, r, a)).mode === r && (p = o, ie = !0, aa(t, p), ne = !0);
|
|
348
349
|
} catch {}
|
|
349
350
|
}
|
|
350
351
|
}
|
|
351
352
|
if (!p) {
|
|
352
|
-
|
|
353
|
+
vo(t, n, "connecting", "preparingSession");
|
|
353
354
|
let s;
|
|
354
355
|
try {
|
|
355
|
-
s = await
|
|
356
|
+
s = await he(c, i, r, a);
|
|
356
357
|
} catch (s) {
|
|
357
358
|
if (ee) {
|
|
358
|
-
|
|
359
|
-
let l =
|
|
360
|
-
if (l === "check-network" && (l = await
|
|
361
|
-
ee ||
|
|
359
|
+
q.current.invalidate(c);
|
|
360
|
+
let l = wn(s, o.isAbandoned?.() ?? !1), ee = l === "check-network";
|
|
361
|
+
if (l === "check-network" && (l = await Cn(() => _e(i, P, r, pi(), a, J.current, I))), l !== "rethrow" && o.isAbandoned?.() && (l = "rethrow"), l !== "rethrow") {
|
|
362
|
+
ee || fn(n, { cacheProofFailed: !0 }), l === "replace" && (J.current.add(c), oa(t), ca(r), W.retireSandbox(c));
|
|
362
363
|
let s = await e(t, n, r, i, a, {
|
|
363
364
|
...o,
|
|
364
365
|
trustCache: !1
|
|
365
366
|
});
|
|
366
|
-
return ee && (s.deadSandboxProbe || s.sandboxId !== c) &&
|
|
367
|
+
return ee && (s.deadSandboxProbe || s.sandboxId !== c) && fn(n, { cacheProofFailed: !0 }), {
|
|
367
368
|
...s,
|
|
368
369
|
sandboxProbed: s.sandboxProbed || u,
|
|
369
370
|
sandboxAdopted: s.sandboxAdopted || d,
|
|
@@ -373,7 +374,7 @@ var Ti = () => () => {}, Ei = () => "off", Di = ({ visible: Di = !0, writeAccess
|
|
|
373
374
|
}
|
|
374
375
|
throw s;
|
|
375
376
|
}
|
|
376
|
-
p = s.sessionId,
|
|
377
|
+
p = s.sessionId, aa(t, p), ne = !0;
|
|
377
378
|
}
|
|
378
379
|
return {
|
|
379
380
|
sandboxId: c,
|
|
@@ -387,67 +388,67 @@ var Ti = () => () => {}, Ei = () => "off", Di = ({ visible: Di = !0, writeAccess
|
|
|
387
388
|
sessionPreopened: ie
|
|
388
389
|
};
|
|
389
390
|
}, [
|
|
390
|
-
|
|
391
|
+
yo,
|
|
392
|
+
oa,
|
|
393
|
+
ca,
|
|
394
|
+
P,
|
|
395
|
+
I,
|
|
391
396
|
aa,
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
L,
|
|
398
|
-
U
|
|
399
|
-
]), bo = T((e, t = !1) => {
|
|
400
|
-
let n = C();
|
|
397
|
+
vo,
|
|
398
|
+
R,
|
|
399
|
+
W
|
|
400
|
+
]), xo = E((e, t = !1) => {
|
|
401
|
+
let n = w();
|
|
401
402
|
if (!n) return;
|
|
402
|
-
let r =
|
|
403
|
+
let r = _.getState(), i = Date.now(), a = Ar({
|
|
403
404
|
autoRouting: r.autoRouting,
|
|
404
|
-
autoOffered:
|
|
405
|
+
autoOffered: Ga.current,
|
|
405
406
|
active: !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0,
|
|
406
407
|
selectedMode: r.mode,
|
|
407
|
-
autoReadMode:
|
|
408
|
-
modes:
|
|
408
|
+
autoReadMode: d,
|
|
409
|
+
modes: La.current,
|
|
409
410
|
acknowledgedWriteModes: r.acknowledgedWriteModes,
|
|
410
|
-
adminAccess:
|
|
411
|
+
adminAccess: Ia.read(),
|
|
411
412
|
dictated: e,
|
|
412
|
-
voiceProposalBound: (e) =>
|
|
413
|
-
turnInFlight: Object.values(r.processingByConversationId).some((e) =>
|
|
414
|
-
...
|
|
413
|
+
voiceProposalBound: (e) => Fi(e),
|
|
414
|
+
turnInFlight: Object.values(r.processingByConversationId).some((e) => Mt(e?.status)),
|
|
415
|
+
...Pr(n),
|
|
415
416
|
now: i
|
|
416
417
|
});
|
|
417
418
|
if (!a) return;
|
|
418
|
-
let o =
|
|
419
|
-
accessToken:
|
|
420
|
-
workspaceToken:
|
|
421
|
-
userId:
|
|
422
|
-
organizationId:
|
|
419
|
+
let o = Nr(n, a, i), s = {
|
|
420
|
+
accessToken: L(),
|
|
421
|
+
workspaceToken: Ii(),
|
|
422
|
+
userId: R,
|
|
423
|
+
organizationId: At()
|
|
423
424
|
};
|
|
424
|
-
|
|
425
|
+
yo(a.mode, n, s, null, !0, o).then((e) => {
|
|
425
426
|
if (o.finish({
|
|
426
427
|
ok: !0,
|
|
427
428
|
sandboxId: e.sandboxId,
|
|
428
429
|
didWork: !e.trustedFromCache && (e.sandboxIsNew || e.sandboxProbed || e.sandboxAdopted),
|
|
429
430
|
booted: e.sandboxIsNew || e.sandboxAdopted,
|
|
430
431
|
dead: o.dead
|
|
431
|
-
}), o.signal.aborted ||
|
|
432
|
-
let r =
|
|
433
|
-
|
|
432
|
+
}), o.signal.aborted || w() !== n || J.current.has(e.sandboxId)) return;
|
|
433
|
+
let r = _.getState(), i = !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0, c = re();
|
|
434
|
+
kr({
|
|
434
435
|
active: i ? {
|
|
435
436
|
mode: i.mode,
|
|
436
437
|
backendSessionId: i.backendSessionId,
|
|
437
|
-
continuable: !
|
|
438
|
-
hasHistory:
|
|
438
|
+
continuable: !Gn(i) && !Wn(i, c),
|
|
439
|
+
hasHistory: Un(i)
|
|
439
440
|
} : void 0,
|
|
440
441
|
mode: a.mode
|
|
441
|
-
}) &&
|
|
442
|
+
}) && Mr(Or({
|
|
442
443
|
workspaceId: n,
|
|
443
444
|
mode: a.mode,
|
|
444
445
|
sandboxId: e.sandboxId,
|
|
445
|
-
userId:
|
|
446
|
-
}), () =>
|
|
446
|
+
userId: R
|
|
447
|
+
}), () => he(e.sandboxId, n, a.mode, s).then((e) => e.sessionId), Date.now());
|
|
447
448
|
}, (e) => {
|
|
448
|
-
if (!(e instanceof
|
|
449
|
-
let e =
|
|
450
|
-
e && (
|
|
449
|
+
if (!(e instanceof Tr) && !o.signal.aborted && w() === n) {
|
|
450
|
+
let e = _.getState().sandboxesByMode[a.mode]?.sandboxId ?? null;
|
|
451
|
+
e && (q.current.invalidate(e), J.current.add(e), o.dead.push(e), ca(a.mode));
|
|
451
452
|
}
|
|
452
453
|
o.finish({
|
|
453
454
|
ok: !1,
|
|
@@ -457,137 +458,137 @@ var Ti = () => () => {}, Ei = () => "off", Di = ({ visible: Di = !0, writeAccess
|
|
|
457
458
|
});
|
|
458
459
|
});
|
|
459
460
|
}, [
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
I,
|
|
464
|
-
Fi,
|
|
461
|
+
yo,
|
|
462
|
+
Ia,
|
|
463
|
+
ca,
|
|
465
464
|
L,
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
465
|
+
Ii,
|
|
466
|
+
R,
|
|
467
|
+
Fi
|
|
468
|
+
]), So = E(() => xo(!1), [xo]), Co = _i(le, se, se)?.reference ?? null, [wo, To] = A(0), Eo = k(/* @__PURE__ */ new Set()), Do = k(null), Oo = E(() => {
|
|
469
|
+
let e = _.getState(), t = e.activeConversationId;
|
|
469
470
|
if (!t) return null;
|
|
470
|
-
let n = e.processingByConversationId[t], r =
|
|
471
|
-
if (!
|
|
471
|
+
let n = e.processingByConversationId[t], r = Mt(n?.status) ? n?.messageId ?? null : null;
|
|
472
|
+
if (!Pt({
|
|
472
473
|
interruptedTurnId: r,
|
|
473
474
|
activeTurnId: r,
|
|
474
|
-
alreadyRequested: r ?
|
|
475
|
+
alreadyRequested: r ? Eo.current.has(r) : !1
|
|
475
476
|
}).send || !r) return null;
|
|
476
|
-
|
|
477
|
-
let i =
|
|
478
|
-
return !i || !a || !o ||
|
|
479
|
-
accessToken:
|
|
480
|
-
workspaceToken:
|
|
481
|
-
userId:
|
|
482
|
-
organizationId:
|
|
477
|
+
Eo.current.add(r);
|
|
478
|
+
let i = fe(e), a = w(), o = e.conversations.find((e) => e.id === t)?.backendSessionId;
|
|
479
|
+
return !i || !a || !o || pe(i.sandboxId, a, o, i.mode, {
|
|
480
|
+
accessToken: L(),
|
|
481
|
+
workspaceToken: Ii(),
|
|
482
|
+
userId: R,
|
|
483
|
+
organizationId: At()
|
|
483
484
|
}), r;
|
|
484
485
|
}, [
|
|
486
|
+
R,
|
|
485
487
|
L,
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
let a = t.conversations.find((e) => e.id === i), o = a ? m(Be(a.messages), {
|
|
488
|
+
Ii
|
|
489
|
+
]), ko = E(() => {
|
|
490
|
+
let e = Oo();
|
|
491
|
+
return e && (qe(e), Ue.abort(e)), e;
|
|
492
|
+
}, [Oo]), Ao = E(() => {
|
|
493
|
+
let e = _.getState().activeConversationId;
|
|
494
|
+
ko(), e && W.declineForReply(e, "corrected", "spoken");
|
|
495
|
+
}, [ko, W]), jo = E(async (e) => {
|
|
496
|
+
let t = _.getState(), n = fe(t), r = w(), i = t.activeConversationId;
|
|
497
|
+
if (!n || !r || !i || jn(t.sandboxWriteCapabilities[n.sandboxId])) return;
|
|
498
|
+
let a = t.conversations.find((e) => e.id === i), o = a ? h(Ve(a.messages), {
|
|
498
499
|
sessionId: a.backendSessionId,
|
|
499
500
|
sandboxId: n.sandboxId,
|
|
500
501
|
nowMs: Date.now()
|
|
501
502
|
}) : null;
|
|
502
503
|
if (o?.reference !== e) {
|
|
503
|
-
|
|
504
|
+
To((e) => e + 1);
|
|
504
505
|
return;
|
|
505
506
|
}
|
|
506
507
|
let s = {
|
|
507
508
|
conversationId: i,
|
|
508
509
|
reference: e
|
|
509
510
|
};
|
|
510
|
-
if (!
|
|
511
|
+
if (!ae(s)) return;
|
|
511
512
|
try {
|
|
512
|
-
await
|
|
513
|
-
accessToken:
|
|
514
|
-
workspaceToken:
|
|
515
|
-
userId:
|
|
516
|
-
organizationId:
|
|
513
|
+
await v(n.sandboxId, r, e, n.mode, {
|
|
514
|
+
accessToken: L(),
|
|
515
|
+
workspaceToken: Ii(),
|
|
516
|
+
userId: R,
|
|
517
|
+
organizationId: At()
|
|
517
518
|
});
|
|
518
519
|
} catch (e) {
|
|
519
|
-
|
|
520
|
-
id:
|
|
520
|
+
oe(s), H(i, {
|
|
521
|
+
id: M(),
|
|
521
522
|
role: "system",
|
|
522
523
|
content: e instanceof Error ? e.message : "The change could not be approved.",
|
|
523
524
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
524
525
|
});
|
|
525
526
|
return;
|
|
526
527
|
}
|
|
527
|
-
|
|
528
|
-
let c =
|
|
529
|
-
c.activeConversationId !== i || !l || c.mode !== n.mode || l.backendSessionId !== a?.backendSessionId ||
|
|
528
|
+
oe(s), na(i, o.messageId, { pendingWriteApprovedAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
529
|
+
let c = _.getState(), l = c.conversations.find((e) => e.id === i);
|
|
530
|
+
c.activeConversationId !== i || !l || c.mode !== n.mode || l.backendSessionId !== a?.backendSessionId || fe(c)?.sandboxId !== n.sandboxId || Mt(c.processingByConversationId[i]?.status) || m(Ve(l.messages)) !== o.messageId || Ps.current(N("pendingWrite.approvedPrompt", "I approved that change — go ahead."), [], {
|
|
530
531
|
approvalFollowUp: { approvedReplyId: o.messageId },
|
|
531
532
|
targetConversationId: i
|
|
532
533
|
});
|
|
533
534
|
}, [
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
]),
|
|
539
|
-
let n =
|
|
535
|
+
R,
|
|
536
|
+
H,
|
|
537
|
+
na,
|
|
538
|
+
N
|
|
539
|
+
]), Mo = t(), { speakFinishedReply: No, speakingMessageId: Po, stop: Fo } = gn(), Io = k(null), Lo = E((e, t) => {
|
|
540
|
+
let n = Io.current;
|
|
540
541
|
n?.token === e && n.exchange === null && (n.exchange = t);
|
|
541
|
-
}, []),
|
|
542
|
-
let t =
|
|
542
|
+
}, []), Ro = E((e) => {
|
|
543
|
+
let t = Io.current;
|
|
543
544
|
e !== void 0 && t?.token === e && (t.handled = !0);
|
|
544
|
-
}, []),
|
|
545
|
-
|
|
546
|
-
}, [
|
|
547
|
-
theme:
|
|
548
|
-
navigate:
|
|
549
|
-
navItems:
|
|
550
|
-
options:
|
|
551
|
-
navPermissionsSettled:
|
|
552
|
-
navSimulating:
|
|
545
|
+
}, []), zo = E((e, t) => {
|
|
546
|
+
Lo(e, t), io.current && We(t);
|
|
547
|
+
}, [Lo]), Bo = o(), { items: Vo, permissionsSettled: Ho, simulating: Uo } = hi(), Y = k({
|
|
548
|
+
theme: Mo,
|
|
549
|
+
navigate: Bo,
|
|
550
|
+
navItems: Vo,
|
|
551
|
+
options: Pi ?? {},
|
|
552
|
+
navPermissionsSettled: Ho,
|
|
553
|
+
navSimulating: Uo
|
|
553
554
|
});
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
theme:
|
|
557
|
-
navigate:
|
|
558
|
-
navItems:
|
|
559
|
-
options:
|
|
560
|
-
navPermissionsSettled:
|
|
561
|
-
navSimulating:
|
|
555
|
+
D(() => {
|
|
556
|
+
Y.current = {
|
|
557
|
+
theme: Mo,
|
|
558
|
+
navigate: Bo,
|
|
559
|
+
navItems: Vo,
|
|
560
|
+
options: Pi ?? {},
|
|
561
|
+
navPermissionsSettled: Ho,
|
|
562
|
+
navSimulating: Uo
|
|
562
563
|
};
|
|
563
564
|
}, [
|
|
564
|
-
|
|
565
|
-
zo,
|
|
565
|
+
Mo,
|
|
566
566
|
Bo,
|
|
567
|
-
Ni,
|
|
568
567
|
Vo,
|
|
569
|
-
|
|
568
|
+
Pi,
|
|
569
|
+
Ho,
|
|
570
|
+
Uo
|
|
570
571
|
]);
|
|
571
|
-
let
|
|
572
|
-
|
|
573
|
-
|
|
572
|
+
let X = k(!0);
|
|
573
|
+
D(() => (X.current = !0, () => {
|
|
574
|
+
X.current = !1;
|
|
574
575
|
}), []);
|
|
575
|
-
let
|
|
576
|
-
tr:
|
|
577
|
-
locale:
|
|
578
|
-
}),
|
|
579
|
-
|
|
580
|
-
let t =
|
|
581
|
-
t && (
|
|
582
|
-
if (
|
|
583
|
-
let e =
|
|
576
|
+
let Wo = k({
|
|
577
|
+
tr: N,
|
|
578
|
+
locale: z
|
|
579
|
+
}), Go = k(null), [Ko, qo] = A(null), Jo = k(null), Yo = E((e) => {
|
|
580
|
+
Jo.current !== null && (window.clearTimeout(Jo.current), Jo.current = null);
|
|
581
|
+
let t = Go.current;
|
|
582
|
+
t && (Go.current = null, window.clearTimeout(t.deadline), X.current && qo(null), !(!e || !X.current) && (Jo.current = window.setTimeout(() => {
|
|
583
|
+
if (Jo.current = null, !X.current) return;
|
|
584
|
+
let e = _.getState();
|
|
584
585
|
if (e.activeConversationId !== t.conversationId) return;
|
|
585
586
|
let n = e.conversations.find((e) => e.id === t.conversationId)?.messages.find((e) => e.id === t.messageId);
|
|
586
587
|
if (!n) return;
|
|
587
|
-
let r =
|
|
588
|
+
let r = Wo.current, i = $t(n, null, r.tr);
|
|
588
589
|
if (i.kind !== "output") return;
|
|
589
|
-
let a =
|
|
590
|
-
|
|
590
|
+
let a = Zt(n, r.tr);
|
|
591
|
+
Ue.publish(n.id, {
|
|
591
592
|
conversationId: t.conversationId,
|
|
592
593
|
channel: n.metadata?.voice === !0 ? "voice" : "chat",
|
|
593
594
|
voiceSessionId: n.metadata?.voiceSessionId,
|
|
@@ -596,48 +597,48 @@ var Ti = () => () => {}, Ei = () => "off", Di = ({ visible: Di = !0, writeAccess
|
|
|
596
597
|
final: !0
|
|
597
598
|
});
|
|
598
599
|
}, 0)));
|
|
599
|
-
}, []),
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
tr:
|
|
603
|
-
locale:
|
|
600
|
+
}, []), Xo = E(() => Yo(!0), [Yo]);
|
|
601
|
+
D(() => {
|
|
602
|
+
Wo.current = {
|
|
603
|
+
tr: N,
|
|
604
|
+
locale: z
|
|
604
605
|
};
|
|
605
|
-
let e =
|
|
606
|
+
let e = Go.current;
|
|
606
607
|
if (!e) return;
|
|
607
|
-
let t =
|
|
608
|
+
let t = Qt({
|
|
608
609
|
wanted: e.wanted,
|
|
609
|
-
locale:
|
|
610
|
-
isLoading:
|
|
611
|
-
translatedNow:
|
|
610
|
+
locale: z,
|
|
611
|
+
isLoading: Li(e.wanted),
|
|
612
|
+
translatedNow: Yt(N, e.reply).translated
|
|
612
613
|
});
|
|
613
614
|
if (t === "write") {
|
|
614
|
-
|
|
615
|
+
Xo();
|
|
615
616
|
return;
|
|
616
617
|
}
|
|
617
618
|
if (t === "grace") {
|
|
618
|
-
let e = window.setTimeout(
|
|
619
|
+
let e = window.setTimeout(Xo, 400);
|
|
619
620
|
return () => window.clearTimeout(e);
|
|
620
621
|
}
|
|
621
622
|
}, [
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
]),
|
|
628
|
-
let
|
|
629
|
-
let e =
|
|
623
|
+
N,
|
|
624
|
+
z,
|
|
625
|
+
Li,
|
|
626
|
+
Ko,
|
|
627
|
+
Xo
|
|
628
|
+
]), D(() => () => Yo(!1), [Yo]);
|
|
629
|
+
let Zo = k(null), [Qo, $o] = A(!1), [es, ts] = A(null), [Z] = A(() => new Oe()), [ns, rs] = A(0), is = E(() => rs((e) => e + 1), []), as = E(() => {
|
|
630
|
+
let e = Y.current;
|
|
630
631
|
return {
|
|
631
|
-
destinations:
|
|
632
|
+
destinations: Br(e.navItems),
|
|
632
633
|
permissionsSettled: e.navPermissionsSettled,
|
|
633
634
|
simulating: e.navSimulating
|
|
634
635
|
};
|
|
635
|
-
}, []),
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
}, [
|
|
639
|
-
let
|
|
640
|
-
let n =
|
|
636
|
+
}, []), os = k(R);
|
|
637
|
+
D(() => {
|
|
638
|
+
os.current = R;
|
|
639
|
+
}, [R]);
|
|
640
|
+
let ss = E((e, t) => {
|
|
641
|
+
let n = Z.replyIdOf(e), r = n ? Z.turnFor(n) : void 0, i = Z.offer(e), a = {
|
|
641
642
|
ok: !1,
|
|
642
643
|
reason: "gone",
|
|
643
644
|
copy: null,
|
|
@@ -645,59 +646,59 @@ var Ti = () => () => {}, Ei = () => "off", Di = ({ visible: Di = !0, writeAccess
|
|
|
645
646
|
voiceSessionId: void 0
|
|
646
647
|
};
|
|
647
648
|
if (!n || !r || !i || i.used) return a;
|
|
648
|
-
let o = r.conversationId, s =
|
|
649
|
+
let o = r.conversationId, s = _.getState().conversations.find((e) => e.id === o);
|
|
649
650
|
if (!s) return a;
|
|
650
|
-
let c = s.messages.find((e) => e.id === n), l = c?.metadata?.voice === !0 ? c.metadata.voiceSessionId : void 0, u =
|
|
651
|
-
registry:
|
|
652
|
-
actorId:
|
|
651
|
+
let c = s.messages.find((e) => e.id === n), l = c?.metadata?.voice === !0 ? c.metadata.voiceSessionId : void 0, u = Z.liveOffersFor(n, {
|
|
652
|
+
registry: as(),
|
|
653
|
+
actorId: os.current,
|
|
653
654
|
conversationId: o,
|
|
654
655
|
perfNow: performance.now()
|
|
655
656
|
}).find((t) => t.offer.offerId === e);
|
|
656
657
|
if (!u) {
|
|
657
|
-
let e =
|
|
658
|
+
let e = Ae(i, performance.now());
|
|
658
659
|
return {
|
|
659
660
|
ok: !1,
|
|
660
661
|
reason: e ? "unavailable" : "expired",
|
|
661
|
-
copy: e ?
|
|
662
|
+
copy: e ? Wt(N, t || null) : Ht(N),
|
|
662
663
|
conversationId: o,
|
|
663
664
|
voiceSessionId: l
|
|
664
665
|
};
|
|
665
666
|
}
|
|
666
|
-
return
|
|
667
|
+
return Z.markUsed(e) ? (is(), {
|
|
667
668
|
ok: !0,
|
|
668
669
|
target: u.target,
|
|
669
670
|
conversationId: o,
|
|
670
671
|
voiceSessionId: l
|
|
671
672
|
}) : a;
|
|
672
673
|
}, [
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
]),
|
|
678
|
-
let a =
|
|
679
|
-
|
|
674
|
+
Z,
|
|
675
|
+
as,
|
|
676
|
+
N,
|
|
677
|
+
is
|
|
678
|
+
]), cs = E((e, t, n, r, i) => {
|
|
679
|
+
let a = M();
|
|
680
|
+
H(e, {
|
|
680
681
|
id: a,
|
|
681
682
|
role: "system",
|
|
682
683
|
content: n.text,
|
|
683
684
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
684
685
|
metadata: {
|
|
685
|
-
lang: n.translated ?
|
|
686
|
+
lang: n.translated ? z : "en",
|
|
686
687
|
...i ? { localAction: i } : {},
|
|
687
|
-
...
|
|
688
|
+
...x(t)
|
|
688
689
|
}
|
|
689
|
-
}), i &&
|
|
690
|
-
}, [
|
|
691
|
-
|
|
692
|
-
|
|
690
|
+
}), i && Jn.recordCommittedEntries(e, [a], "NOTE", r);
|
|
691
|
+
}, [H, z]), ls = E((e, t) => (t.status === "kept" || t.status === "refused" && t.reason === "unsaved-changes") && Z.release(e), [Z]), us = k(null);
|
|
692
|
+
D(() => () => {
|
|
693
|
+
us.current?.(), us.current = null;
|
|
693
694
|
}, []);
|
|
694
|
-
let
|
|
695
|
-
|
|
696
|
-
}, []),
|
|
697
|
-
if (
|
|
698
|
-
let i =
|
|
695
|
+
let ds = E((e) => {
|
|
696
|
+
us.current?.(), us.current = X.current ? tr(document, e) : null;
|
|
697
|
+
}, []), fs = E((e, t, n, r = !1) => {
|
|
698
|
+
if (Zo.current !== null) return;
|
|
699
|
+
let i = ss(e, n), a = w(), o = (e, t, n, r) => cs(e, t, n, a, r);
|
|
699
700
|
if (!i.ok) {
|
|
700
|
-
i.copy && i.conversationId && o(i.conversationId, i.voiceSessionId, i.copy),
|
|
701
|
+
i.copy && i.conversationId && o(i.conversationId, i.voiceSessionId, i.copy), is();
|
|
701
702
|
return;
|
|
702
703
|
}
|
|
703
704
|
let { target: s, conversationId: c, voiceSessionId: l } = i, u = {
|
|
@@ -705,7 +706,7 @@ var Ti = () => () => {}, Ei = () => "off", Di = ({ visible: Di = !0, writeAccess
|
|
|
705
706
|
offerId: e
|
|
706
707
|
};
|
|
707
708
|
if (r) {
|
|
708
|
-
o(c, l,
|
|
709
|
+
o(c, l, Bt(N, s.label, !0), qr({
|
|
709
710
|
destinationId: s.id,
|
|
710
711
|
path: s.path,
|
|
711
712
|
alreadyHere: !0,
|
|
@@ -714,17 +715,17 @@ var Ti = () => () => {}, Ei = () => "off", Di = ({ visible: Di = !0, writeAccess
|
|
|
714
715
|
}));
|
|
715
716
|
return;
|
|
716
717
|
}
|
|
717
|
-
let d =
|
|
718
|
-
|
|
718
|
+
let d = M();
|
|
719
|
+
Zo.current = d, $o(!0);
|
|
719
720
|
let f = (t) => {
|
|
720
721
|
try {
|
|
721
|
-
if (
|
|
722
|
+
if (ls(e, t) && (is(), t.status === "kept" && ds(e)), t.status === "kept" || !_.getState().conversations.some((e) => e.id === c)) return;
|
|
722
723
|
let n = t.status === "arrived" || t.status === "redirected" ? t.landedPath : null;
|
|
723
|
-
o(c, l,
|
|
724
|
+
o(c, l, Vt(N, t, {
|
|
724
725
|
page: s.label,
|
|
725
|
-
landed: n === null ? null :
|
|
726
|
+
landed: n === null ? null : Yr(Br(Y.current.navItems), n),
|
|
726
727
|
path: s.path
|
|
727
|
-
}),
|
|
728
|
+
}), qr({
|
|
728
729
|
destinationId: s.id,
|
|
729
730
|
path: s.path,
|
|
730
731
|
alreadyHere: !1,
|
|
@@ -733,89 +734,89 @@ var Ti = () => () => {}, Ei = () => "off", Di = ({ visible: Di = !0, writeAccess
|
|
|
733
734
|
offer: u
|
|
734
735
|
}));
|
|
735
736
|
} finally {
|
|
736
|
-
|
|
737
|
+
Zo.current === d && (Zo.current = null, X.current && $o(!1));
|
|
737
738
|
}
|
|
738
739
|
};
|
|
739
|
-
|
|
740
|
+
Wr(Y.current.navigate, s.path, {
|
|
740
741
|
readPath: () => window.location.pathname + window.location.search,
|
|
741
742
|
now: () => Date.now(),
|
|
742
743
|
schedule: (e, t) => {
|
|
743
744
|
window.setTimeout(e, t);
|
|
744
745
|
},
|
|
745
|
-
isShellLess: () => !
|
|
746
|
+
isShellLess: () => !X.current,
|
|
746
747
|
initiator: t === "tap" ? "person" : "assistant",
|
|
747
748
|
surface: "offer"
|
|
748
749
|
}).then(f, () => f({ status: "unconfirmed" }));
|
|
749
750
|
}, [
|
|
750
|
-
os,
|
|
751
751
|
ss,
|
|
752
|
-
M,
|
|
753
|
-
rs,
|
|
754
752
|
cs,
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
753
|
+
N,
|
|
754
|
+
is,
|
|
755
|
+
ls,
|
|
756
|
+
ds
|
|
757
|
+
]), ps = E((e, t) => fs(e, "tap", t || null), [fs]), ms = E((e) => {
|
|
758
|
+
let { replyId: t, conversationId: n } = e, r = Z.turnFor(t);
|
|
758
759
|
if (!r) return;
|
|
759
|
-
let i = window.location.pathname + window.location.search, a =
|
|
760
|
+
let i = window.location.pathname + window.location.search, a = Br(Y.current.navItems), o = oi({
|
|
760
761
|
intent: e.intent,
|
|
761
|
-
live:
|
|
762
|
-
registry:
|
|
763
|
-
actorId:
|
|
762
|
+
live: Z.liveOffersFor(t, {
|
|
763
|
+
registry: as(),
|
|
764
|
+
actorId: os.current,
|
|
764
765
|
conversationId: n,
|
|
765
766
|
perfNow: performance.now()
|
|
766
767
|
}),
|
|
767
|
-
unusedCount:
|
|
768
|
-
pendingProposals:
|
|
768
|
+
unusedCount: Z.offersFor(t).filter((e) => !e.used).length,
|
|
769
|
+
pendingProposals: W.liveFor(n).count,
|
|
769
770
|
turnWriteCapable: r.writeCapable,
|
|
770
771
|
atSend: e.atSend,
|
|
771
772
|
now: {
|
|
772
773
|
location: i,
|
|
773
|
-
conversationId:
|
|
774
|
-
workspaceId:
|
|
775
|
-
actorId:
|
|
774
|
+
conversationId: _.getState().activeConversationId,
|
|
775
|
+
workspaceId: w(),
|
|
776
|
+
actorId: os.current ?? null
|
|
776
777
|
},
|
|
777
|
-
mounted:
|
|
778
|
+
mounted: X.current,
|
|
778
779
|
visible: document.visibilityState === "visible",
|
|
779
|
-
unsavedChanges:
|
|
780
|
+
unsavedChanges: si(Y.current.options),
|
|
780
781
|
alreadyThere: ({ target: e }) => {
|
|
781
782
|
let t = a.find((t) => t.id === e.id);
|
|
782
|
-
return t ?
|
|
783
|
+
return t ? Lr(t, i, a) : !1;
|
|
783
784
|
}
|
|
784
785
|
});
|
|
785
786
|
if (o.act === "navigate" || o.act === "already-here") {
|
|
786
|
-
|
|
787
|
+
fs(o.offer.offer.offerId, "resolve", o.offer.target.label, o.act === "already-here");
|
|
787
788
|
return;
|
|
788
789
|
}
|
|
789
|
-
let [s] = o.unsaved ?? [], [c] =
|
|
790
|
-
registry:
|
|
791
|
-
actorId:
|
|
790
|
+
let [s] = o.unsaved ?? [], [c] = Z.liveOffersFor(t, {
|
|
791
|
+
registry: as(),
|
|
792
|
+
actorId: os.current,
|
|
792
793
|
conversationId: n,
|
|
793
794
|
perfNow: performance.now()
|
|
794
795
|
});
|
|
795
|
-
o.hold === "R5-unsaved" && s && c &&
|
|
796
|
+
o.hold === "R5-unsaved" && s && c && cs(n, e.voiceSessionId, Ut(N, s.label, c.target.label), w());
|
|
796
797
|
}, [
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
]),
|
|
804
|
-
let t =
|
|
805
|
-
return n ? Gr
|
|
806
|
-
}, []),
|
|
807
|
-
let { navItems: r, options: i } =
|
|
798
|
+
Z,
|
|
799
|
+
as,
|
|
800
|
+
W,
|
|
801
|
+
fs,
|
|
802
|
+
cs,
|
|
803
|
+
N
|
|
804
|
+
]), hs = E((e) => {
|
|
805
|
+
let t = _.getState(), n = t.conversations.find((e) => e.id === t.activeConversationId);
|
|
806
|
+
return n ? Kr(Gr, window.location.pathname, Xr(n.messages, e)) : !1;
|
|
807
|
+
}, []), gs = E((e, t, n = !1) => {
|
|
808
|
+
let { navItems: r, options: i } = Y.current, a = Br(r), o = null, s = {
|
|
808
809
|
...i,
|
|
809
|
-
locale: t === void 0 ?
|
|
810
|
-
uiLocale:
|
|
811
|
-
inputLocale:
|
|
810
|
+
locale: t === void 0 ? z : Wi.input.code,
|
|
811
|
+
uiLocale: z,
|
|
812
|
+
inputLocale: Wi.input.code
|
|
812
813
|
};
|
|
813
|
-
if (
|
|
814
|
-
let e =
|
|
814
|
+
if (zr(e, s)) {
|
|
815
|
+
let e = _.getState(), n = e.conversations.find((t) => t.id === e.activeConversationId), s = n ? Qr(n.messages, t, { lookThroughRefusedOffers: { ownsOffer: (e, t) => Z.offersFor(e.id).some((e) => e.offerId === t) } }) : null, c = n ? e.processingByConversationId[n.id] ?? null : null, l = c !== null && c.messageId === s?.id && Mt(c.status);
|
|
815
816
|
if (n && s && !l) {
|
|
816
|
-
let e =
|
|
817
|
-
registry:
|
|
818
|
-
actorId:
|
|
817
|
+
let e = Z.liveOffersFor(s.id, {
|
|
818
|
+
registry: as(),
|
|
819
|
+
actorId: os.current,
|
|
819
820
|
conversationId: n.id,
|
|
820
821
|
perfNow: performance.now()
|
|
821
822
|
}).flatMap(({ offer: e, target: t }) => {
|
|
@@ -825,36 +826,36 @@ var Ti = () => () => {}, Ei = () => "off", Di = ({ visible: Di = !0, writeAccess
|
|
|
825
826
|
target: n
|
|
826
827
|
}] : [];
|
|
827
828
|
});
|
|
828
|
-
o =
|
|
829
|
+
o = Zr({
|
|
829
830
|
reply: s,
|
|
830
|
-
text:
|
|
831
|
+
text: un(s, c, N),
|
|
831
832
|
resolve: {
|
|
832
833
|
destinations: a,
|
|
833
834
|
entityRoutes: i.entityRoutes,
|
|
834
|
-
visibleNavIds:
|
|
835
|
-
nounLabel: (e) =>
|
|
835
|
+
visibleNavIds: Fr(r),
|
|
836
|
+
nounLabel: (e) => Rt(N, e)
|
|
836
837
|
},
|
|
837
838
|
offers: e
|
|
838
839
|
});
|
|
839
840
|
}
|
|
840
841
|
}
|
|
841
|
-
return
|
|
842
|
-
backRunnable:
|
|
842
|
+
return Rr(e, a, s, {
|
|
843
|
+
backRunnable: hs(t),
|
|
843
844
|
navigation: o,
|
|
844
845
|
skipRecords: n,
|
|
845
|
-
controls:
|
|
846
|
+
controls: Ur()
|
|
846
847
|
});
|
|
847
848
|
}, [
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
]),
|
|
855
|
-
let n =
|
|
849
|
+
hs,
|
|
850
|
+
Wi,
|
|
851
|
+
z,
|
|
852
|
+
N,
|
|
853
|
+
Z,
|
|
854
|
+
as
|
|
855
|
+
]), _s = E((e, t) => {
|
|
856
|
+
let n = gs(e, t);
|
|
856
857
|
if (!n) return !1;
|
|
857
|
-
let { theme: r, navigate: i } =
|
|
858
|
+
let { theme: r, navigate: i } = Y.current;
|
|
858
859
|
switch (n.kind) {
|
|
859
860
|
case "theme": return r !== null;
|
|
860
861
|
case "navigate":
|
|
@@ -864,40 +865,40 @@ var Ti = () => () => {}, Ei = () => "off", Di = ({ visible: Di = !0, writeAccess
|
|
|
864
865
|
case "link-not-openable":
|
|
865
866
|
case "back": return i !== null;
|
|
866
867
|
case "conversation-delete": return !1;
|
|
867
|
-
case "app-control": return
|
|
868
|
+
case "app-control": return ci(n.request, { voiceLive: t !== void 0 || bc.current }) !== null;
|
|
868
869
|
case "open-record": return !1;
|
|
869
870
|
}
|
|
870
|
-
}, [
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
}, [
|
|
874
|
-
let
|
|
871
|
+
}, [gs]), vs = k(_s);
|
|
872
|
+
D(() => {
|
|
873
|
+
vs.current = _s;
|
|
874
|
+
}, [_s]);
|
|
875
|
+
let ys = E((e, t) => {
|
|
875
876
|
let n = {
|
|
876
877
|
state: "none",
|
|
877
878
|
accept: null
|
|
878
|
-
}, { navigate: r, options: i, navItems: a } =
|
|
879
|
+
}, { navigate: r, options: i, navItems: a } = Y.current;
|
|
879
880
|
if (!e || r === null || i.uiOffers !== !0) return n;
|
|
880
|
-
let o =
|
|
881
|
+
let o = _.getState(), s = o.conversations.find((t) => t.id === e);
|
|
881
882
|
if (!s) return n;
|
|
882
883
|
let c = o.processingByConversationId[s.id] ?? null, l = {
|
|
883
|
-
registry:
|
|
884
|
-
actorId:
|
|
884
|
+
registry: as(),
|
|
885
|
+
actorId: os.current,
|
|
885
886
|
conversationId: s.id,
|
|
886
887
|
perfNow: performance.now()
|
|
887
|
-
}, { state: u, reply: d } =
|
|
888
|
+
}, { state: u, reply: d } = ii(Z, {
|
|
888
889
|
...l,
|
|
889
890
|
messages: s.messages,
|
|
890
891
|
voiceSessionId: t,
|
|
891
892
|
processing: c,
|
|
892
|
-
displayedText: (e) =>
|
|
893
|
-
productWriteApproval:
|
|
894
|
-
capabilitiesOf: (e) =>
|
|
893
|
+
displayedText: (e) => un(e, c, N),
|
|
894
|
+
productWriteApproval: I,
|
|
895
|
+
capabilitiesOf: (e) => _.getState().sandboxWriteCapabilities[e]
|
|
895
896
|
});
|
|
896
897
|
if (u !== "acceptable" || !d) return {
|
|
897
898
|
state: u,
|
|
898
899
|
accept: null
|
|
899
900
|
};
|
|
900
|
-
let [f] =
|
|
901
|
+
let [f] = Z.liveOffersFor(d.id, l), ee = f ? Br(a).find((e) => e.id === f.target.id) : void 0;
|
|
901
902
|
return !f || !ee ? n : {
|
|
902
903
|
state: u,
|
|
903
904
|
accept: {
|
|
@@ -906,134 +907,134 @@ var Ti = () => () => {}, Ei = () => "off", Di = ({ visible: Di = !0, writeAccess
|
|
|
906
907
|
}
|
|
907
908
|
};
|
|
908
909
|
}, [
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
]),
|
|
914
|
-
let o =
|
|
910
|
+
Z,
|
|
911
|
+
as,
|
|
912
|
+
I,
|
|
913
|
+
N
|
|
914
|
+
]), bs = E((e, t, n, r, i, a) => {
|
|
915
|
+
let o = N(n.key, n.fallback, r), s = n.fallback.replace(/\{\{\s*count\s*\}\}/g, String(r.count)), c = {
|
|
915
916
|
kind: "write-reply",
|
|
916
917
|
line: n.key
|
|
917
|
-
}, l = (/* @__PURE__ */ new Date()).toISOString(), u =
|
|
918
|
-
|
|
918
|
+
}, l = (/* @__PURE__ */ new Date()).toISOString(), u = M();
|
|
919
|
+
H(e, {
|
|
919
920
|
id: u,
|
|
920
921
|
role: "user",
|
|
921
922
|
content: t,
|
|
922
923
|
timestamp: l,
|
|
923
924
|
metadata: {
|
|
924
925
|
localAction: c,
|
|
925
|
-
...
|
|
926
|
+
...x(i)
|
|
926
927
|
}
|
|
927
928
|
});
|
|
928
|
-
let d =
|
|
929
|
-
|
|
929
|
+
let d = M();
|
|
930
|
+
H(e, {
|
|
930
931
|
id: d,
|
|
931
932
|
role: "assistant",
|
|
932
933
|
content: o,
|
|
933
934
|
timestamp: l,
|
|
934
935
|
metadata: {
|
|
935
|
-
lang: o === s ? "en" :
|
|
936
|
+
lang: o === s ? "en" : z,
|
|
936
937
|
localAction: c,
|
|
937
|
-
...
|
|
938
|
+
...x(i)
|
|
938
939
|
}
|
|
939
|
-
}),
|
|
940
|
+
}), Jn.recordCommittedEntries(e, [u, d], "LOCAL_COMMAND", w()), a !== void 0 && zo(a, {
|
|
940
941
|
conversationId: e,
|
|
941
942
|
questionId: u,
|
|
942
943
|
replyId: d
|
|
943
|
-
}),
|
|
944
|
+
}), No(e, d);
|
|
944
945
|
}, [
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
]),
|
|
951
|
-
|
|
952
|
-
if (
|
|
953
|
-
let e = window.setTimeout(() =>
|
|
946
|
+
H,
|
|
947
|
+
z,
|
|
948
|
+
zo,
|
|
949
|
+
No,
|
|
950
|
+
N
|
|
951
|
+
]), xs = Qn(), Ss = $n(), Cs = xs?.request ?? null, ws = k(() => void 0), [Ts, Es] = A(null);
|
|
952
|
+
D(() => {
|
|
953
|
+
if (Ts === null) return;
|
|
954
|
+
let e = window.setTimeout(() => Es(null), Ti);
|
|
954
955
|
return () => window.clearTimeout(e);
|
|
955
|
-
}, [
|
|
956
|
-
let
|
|
957
|
-
let e =
|
|
958
|
-
return
|
|
959
|
-
}, [
|
|
960
|
-
if (!
|
|
961
|
-
let t = e !== void 0, n =
|
|
956
|
+
}, [Ts]);
|
|
957
|
+
let Ds = E(() => {
|
|
958
|
+
let e = _.getState();
|
|
959
|
+
return $i(void 0, e.autoRouting && Ga.current ? d : e.mode, e.autoRouting ? { routedBy: "auto" } : void 0);
|
|
960
|
+
}, [$i]), Os = E((e) => {
|
|
961
|
+
if (!Cs) return !1;
|
|
962
|
+
let t = e !== void 0, n = _.getState(), r = nr({
|
|
962
963
|
spoken: t,
|
|
963
|
-
bound:
|
|
964
|
+
bound: oo.current,
|
|
964
965
|
activeConversationId: n.activeConversationId,
|
|
965
966
|
conversations: n.conversations,
|
|
966
|
-
historyOn:
|
|
967
|
+
historyOn: Zn()
|
|
967
968
|
});
|
|
968
|
-
if (r &&
|
|
969
|
-
let e = r ? "Opened the delete confirmation. Choose Delete or Cancel on screen." : "There is no conversation to delete.", t = r ?
|
|
970
|
-
|
|
971
|
-
id: `conversation-delete:${
|
|
969
|
+
if (r && Cs(r), t) {
|
|
970
|
+
let e = r ? "Opened the delete confirmation. Choose Delete or Cancel on screen." : "There is no conversation to delete.", t = r ? N("deleteConversation.opened", "Opened the delete confirmation. Choose Delete or Cancel on screen.") : N("deleteConversation.nothing", "There is no conversation to delete.");
|
|
971
|
+
ws.current({
|
|
972
|
+
id: `conversation-delete:${M()}`,
|
|
972
973
|
text: t,
|
|
973
|
-
lang: t === e ? "en" :
|
|
974
|
+
lang: t === e ? "en" : z
|
|
974
975
|
});
|
|
975
|
-
} else r ||
|
|
976
|
+
} else r || Es(Date.now());
|
|
976
977
|
return !0;
|
|
977
978
|
}, [
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
]),
|
|
982
|
-
if (e.kind === "conversation-delete") return
|
|
983
|
-
let { theme: a, navigate: o } =
|
|
984
|
-
let e = (r ? null : s ??
|
|
985
|
-
return r &&
|
|
979
|
+
Cs,
|
|
980
|
+
z,
|
|
981
|
+
N
|
|
982
|
+
]), ks = E((e, t, n, r = !1, i) => {
|
|
983
|
+
if (e.kind === "conversation-delete") return Os(n);
|
|
984
|
+
let { theme: a, navigate: o } = Y.current, s = null, c = () => {
|
|
985
|
+
let e = (r ? null : s ?? _.getState().activeConversationId) ?? Ds();
|
|
986
|
+
return r && lo(e), e;
|
|
986
987
|
}, l = (e, r) => {
|
|
987
|
-
let i =
|
|
988
|
-
return
|
|
988
|
+
let i = M();
|
|
989
|
+
return H(e, {
|
|
989
990
|
id: i,
|
|
990
991
|
role: "user",
|
|
991
992
|
content: t,
|
|
992
993
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
993
994
|
metadata: {
|
|
994
995
|
localAction: r,
|
|
995
|
-
...
|
|
996
|
+
...x(n)
|
|
996
997
|
}
|
|
997
998
|
}), i;
|
|
998
999
|
}, u = (e, t, r, a, o, s, c) => {
|
|
999
|
-
let l = c ??
|
|
1000
|
-
return
|
|
1000
|
+
let l = c ?? M();
|
|
1001
|
+
return H(e, {
|
|
1001
1002
|
id: l,
|
|
1002
1003
|
role: "assistant",
|
|
1003
1004
|
content: r.text,
|
|
1004
1005
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1005
1006
|
metadata: {
|
|
1006
|
-
lang: r.translated ?
|
|
1007
|
+
lang: r.translated ? z : "en",
|
|
1007
1008
|
localAction: a,
|
|
1008
|
-
...
|
|
1009
|
+
...x(n)
|
|
1009
1010
|
}
|
|
1010
|
-
}),
|
|
1011
|
+
}), Jn.recordCommittedEntries(e, [t, l], "LOCAL_COMMAND", o), i !== void 0 && zo(i, {
|
|
1011
1012
|
conversationId: e,
|
|
1012
1013
|
questionId: t,
|
|
1013
1014
|
replyId: l
|
|
1014
|
-
}), s &&
|
|
1015
|
+
}), s && No(e, l), l;
|
|
1015
1016
|
}, d = (e, t, n) => {
|
|
1016
|
-
let r = c(), i = u(r, l(r, t), e, t,
|
|
1017
|
+
let r = c(), i = u(r, l(r, t), e, t, w(), !0);
|
|
1017
1018
|
return n?.(i), !0;
|
|
1018
1019
|
}, f = (e) => {
|
|
1019
|
-
let t = c(), n =
|
|
1020
|
+
let t = c(), n = w(), r = window.location.pathname, a = l(t, qr({
|
|
1020
1021
|
destinationId: e.destinationId,
|
|
1021
1022
|
path: e.registryPath,
|
|
1022
1023
|
alreadyHere: !1,
|
|
1023
1024
|
via: e.via,
|
|
1024
1025
|
offer: e.offer
|
|
1025
|
-
})), s = i === void 0 ? void 0 :
|
|
1026
|
-
i !== void 0 && s !== void 0 && (
|
|
1026
|
+
})), s = i === void 0 ? void 0 : M();
|
|
1027
|
+
i !== void 0 && s !== void 0 && (Lo(i, {
|
|
1027
1028
|
conversationId: t,
|
|
1028
1029
|
questionId: a,
|
|
1029
1030
|
replyId: s
|
|
1030
|
-
}),
|
|
1031
|
-
let d =
|
|
1032
|
-
|
|
1031
|
+
}), ts(s));
|
|
1032
|
+
let d = M();
|
|
1033
|
+
Zo.current = d, $o(!0);
|
|
1033
1034
|
let f = (i) => {
|
|
1034
1035
|
try {
|
|
1035
|
-
if (e.offer &&
|
|
1036
|
-
let o =
|
|
1036
|
+
if (e.offer && ls(e.offer.offerId, i) && is(), i.status === "kept" || !_.getState().conversations.some((e) => e.id === t)) return;
|
|
1037
|
+
let o = Br(Y.current.navItems), c = i.status === "arrived" || i.status === "redirected" ? i.landedPath : null, l = qr({
|
|
1037
1038
|
destinationId: e.destinationId,
|
|
1038
1039
|
path: e.registryPath,
|
|
1039
1040
|
alreadyHere: !1,
|
|
@@ -1041,30 +1042,30 @@ var Ti = () => () => {}, Ei = () => "off", Di = ({ visible: Di = !0, writeAccess
|
|
|
1041
1042
|
outcome: i,
|
|
1042
1043
|
offer: e.offer
|
|
1043
1044
|
});
|
|
1044
|
-
|
|
1045
|
-
let d = u(t, a, e.via === "back" && i.status === "arrived" ?
|
|
1045
|
+
na(t, a, { localAction: l });
|
|
1046
|
+
let d = u(t, a, e.via === "back" && i.status === "arrived" ? Ft(N, e.pageLabel()) : Vt(N, i, {
|
|
1046
1047
|
page: e.pageLabel(),
|
|
1047
|
-
landed: c === null ? null :
|
|
1048
|
+
landed: c === null ? null : Yr(o, c),
|
|
1048
1049
|
path: e.target
|
|
1049
|
-
}), l, n,
|
|
1050
|
+
}), l, n, X.current, s);
|
|
1050
1051
|
i.status === "arrived" && e.onArrived?.({
|
|
1051
1052
|
replyId: d,
|
|
1052
1053
|
fromPath: r,
|
|
1053
1054
|
landedPath: i.landedPath
|
|
1054
1055
|
});
|
|
1055
1056
|
} finally {
|
|
1056
|
-
|
|
1057
|
+
Zo.current === d && (Zo.current = null, X.current && $o(!1)), s !== void 0 && X.current && ts((e) => e === s ? null : e);
|
|
1057
1058
|
}
|
|
1058
1059
|
};
|
|
1059
|
-
return
|
|
1060
|
+
return Wr(o, e.target, {
|
|
1060
1061
|
readPath: () => window.location.pathname + window.location.search,
|
|
1061
1062
|
now: () => Date.now(),
|
|
1062
1063
|
schedule: (e, t) => {
|
|
1063
1064
|
window.setTimeout(e, t);
|
|
1064
1065
|
},
|
|
1065
|
-
isShellLess: () => !
|
|
1066
|
+
isShellLess: () => !X.current
|
|
1066
1067
|
}).then(f, () => f({ status: "unconfirmed" })), !0;
|
|
1067
|
-
}, ee = ({ replyId: e, fromPath: t, landedPath: n }) =>
|
|
1068
|
+
}, ee = ({ replyId: e, fromPath: t, landedPath: n }) => Gr.push({
|
|
1068
1069
|
fromPath: t,
|
|
1069
1070
|
toPath: n,
|
|
1070
1071
|
replyMessageId: e,
|
|
@@ -1072,21 +1073,21 @@ var Ti = () => () => {}, Ei = () => "off", Di = ({ visible: Di = !0, writeAccess
|
|
|
1072
1073
|
});
|
|
1073
1074
|
if (e.kind === "theme") {
|
|
1074
1075
|
if (!a) return !1;
|
|
1075
|
-
let t =
|
|
1076
|
+
let t = Vr(e.request, {
|
|
1076
1077
|
mode: a.mode,
|
|
1077
1078
|
resolvedTheme: a.resolvedTheme
|
|
1078
1079
|
});
|
|
1079
1080
|
if (!t.alreadyApplied) try {
|
|
1080
1081
|
a.setMode(t.mode);
|
|
1081
1082
|
} catch {}
|
|
1082
|
-
return d(
|
|
1083
|
+
return d(Jt(N, t, e.request.kind === "family"), {
|
|
1083
1084
|
kind: "theme",
|
|
1084
1085
|
mode: t.mode,
|
|
1085
1086
|
alreadyApplied: t.alreadyApplied
|
|
1086
1087
|
});
|
|
1087
1088
|
}
|
|
1088
1089
|
if (e.kind === "app-control") {
|
|
1089
|
-
let t =
|
|
1090
|
+
let t = ci(e.request, { voiceLive: n !== void 0 || bc.current });
|
|
1090
1091
|
if (!t) return !1;
|
|
1091
1092
|
let r = (e) => ({
|
|
1092
1093
|
kind: "app-control",
|
|
@@ -1094,66 +1095,66 @@ var Ti = () => () => {}, Ei = () => "off", Di = ({ visible: Di = !0, writeAccess
|
|
|
1094
1095
|
outcome: e.outcome,
|
|
1095
1096
|
...e.reply.code === "language" ? { languageLabel: e.reply.label } : {}
|
|
1096
1097
|
}), i = (t) => {
|
|
1097
|
-
if (e.request.control === "language" &&
|
|
1098
|
-
let n = c(), i = r(t), a = u(n, l(n, i),
|
|
1099
|
-
return
|
|
1098
|
+
if (e.request.control === "language" && Yo(!1), e.request.control === "language" && t.reply.code === "language" && !t.reply.already && t.outcome === "done") {
|
|
1099
|
+
let n = c(), i = r(t), a = u(n, l(n, i), Yt((e, t) => t, t.reply), i, w(), !1);
|
|
1100
|
+
return Go.current = {
|
|
1100
1101
|
wanted: e.request.code,
|
|
1101
1102
|
reply: t.reply,
|
|
1102
1103
|
conversationId: n,
|
|
1103
1104
|
messageId: a,
|
|
1104
|
-
deadline: window.setTimeout(
|
|
1105
|
-
},
|
|
1105
|
+
deadline: window.setTimeout(Xo, Xt)
|
|
1106
|
+
}, qo(a), !0;
|
|
1106
1107
|
}
|
|
1107
|
-
return d(
|
|
1108
|
+
return d(Yt(N, t.reply), r(t));
|
|
1108
1109
|
};
|
|
1109
1110
|
if (t.kind === "reply") return i(t.run);
|
|
1110
1111
|
if (t.kind === "run") {
|
|
1111
1112
|
let e = t.run();
|
|
1112
1113
|
return t.silent && (e.outcome === "done" || e.outcome === "already") ? !0 : i(e);
|
|
1113
1114
|
}
|
|
1114
|
-
let a =
|
|
1115
|
+
let a = Ss;
|
|
1115
1116
|
if (!a) return !1;
|
|
1116
1117
|
let o = null;
|
|
1117
|
-
return d(
|
|
1118
|
-
o =
|
|
1118
|
+
return d(Yt(N, t.ask.reply), r(t.ask), (e) => {
|
|
1119
|
+
o = _.getState().conversations.find((t) => t.messages.some((t) => t.id === e))?.id ?? null;
|
|
1119
1120
|
}), a.request({
|
|
1120
1121
|
prompt: t.prompt,
|
|
1121
1122
|
onConfirm: () => {
|
|
1122
|
-
let e = t.confirmed(), i = o, a = i !== null &&
|
|
1123
|
+
let e = t.confirmed(), i = o, a = i !== null && _.getState().conversations.some((e) => e.id === i);
|
|
1123
1124
|
if (!i || !a) return;
|
|
1124
|
-
let s =
|
|
1125
|
-
|
|
1126
|
-
id:
|
|
1125
|
+
let s = Yt(N, e.reply);
|
|
1126
|
+
H(i, {
|
|
1127
|
+
id: M(),
|
|
1127
1128
|
role: "assistant",
|
|
1128
1129
|
content: s.text,
|
|
1129
1130
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1130
1131
|
metadata: {
|
|
1131
|
-
lang: s.translated ?
|
|
1132
|
+
lang: s.translated ? z : "en",
|
|
1132
1133
|
localAction: r(e),
|
|
1133
|
-
...
|
|
1134
|
+
...x(n)
|
|
1134
1135
|
}
|
|
1135
1136
|
});
|
|
1136
1137
|
}
|
|
1137
1138
|
}), !0;
|
|
1138
1139
|
}
|
|
1139
1140
|
if (!o) return !1;
|
|
1140
|
-
if (e.kind === "choose-destination") return d(
|
|
1141
|
+
if (e.kind === "choose-destination") return d(It(N, e.candidates[0]?.label ?? e.query, e.candidates), {
|
|
1141
1142
|
kind: "choose-destination",
|
|
1142
1143
|
candidateIds: e.candidates.map((e) => e.id)
|
|
1143
|
-
}, (t) =>
|
|
1144
|
-
if (e.kind === "choose-linked") return d(
|
|
1144
|
+
}, (t) => $r(t, e.candidates));
|
|
1145
|
+
if (e.kind === "choose-linked") return d(Lt(N, e.candidates), {
|
|
1145
1146
|
kind: "choose-destination",
|
|
1146
1147
|
candidateIds: e.candidates.map((e) => e.id)
|
|
1147
|
-
}, (t) =>
|
|
1148
|
+
}, (t) => $r(t, e.candidates));
|
|
1148
1149
|
if (e.kind === "pick-from-list") {
|
|
1149
1150
|
let t = e.candidates !== null && e.candidates.every((e) => e !== null) ? e.candidates : null;
|
|
1150
|
-
return d(
|
|
1151
|
+
return d(Gt(N), t ? {
|
|
1151
1152
|
kind: "choose-destination",
|
|
1152
1153
|
candidateIds: t.map((e) => e.id)
|
|
1153
1154
|
} : e.candidateIds.length > 0 ? {
|
|
1154
1155
|
kind: "choose-destination",
|
|
1155
1156
|
candidateIds: [...e.candidateIds]
|
|
1156
|
-
} :
|
|
1157
|
+
} : qr({
|
|
1157
1158
|
destinationId: "",
|
|
1158
1159
|
path: "",
|
|
1159
1160
|
alreadyHere: !1,
|
|
@@ -1162,9 +1163,9 @@ var Ti = () => () => {}, Ei = () => "off", Di = ({ visible: Di = !0, writeAccess
|
|
|
1162
1163
|
status: "refused",
|
|
1163
1164
|
reason: "not-routable"
|
|
1164
1165
|
}
|
|
1165
|
-
}), t ? (e) =>
|
|
1166
|
+
}), t ? (e) => $r(e, t) : void 0);
|
|
1166
1167
|
}
|
|
1167
|
-
if (e.kind === "link-not-openable") return d(
|
|
1168
|
+
if (e.kind === "link-not-openable") return d(zt(N), qr({
|
|
1168
1169
|
destinationId: "",
|
|
1169
1170
|
path: "",
|
|
1170
1171
|
alreadyHere: !1,
|
|
@@ -1177,7 +1178,7 @@ var Ti = () => () => {}, Ei = () => "off", Di = ({ visible: Di = !0, writeAccess
|
|
|
1177
1178
|
if (e.kind === "open-record") {
|
|
1178
1179
|
let r;
|
|
1179
1180
|
try {
|
|
1180
|
-
let { options: t, navItems: n } =
|
|
1181
|
+
let { options: t, navItems: n } = Y.current, i = t.entityRoutes ?? [], a = Fr(n);
|
|
1181
1182
|
r = (t.records ?? []).flatMap((t) => {
|
|
1182
1183
|
let n = i.find((e) => e.id === t.entityRouteId), r = e.request.adapterIds.length === 0 || e.request.adapterIds.includes(t.id);
|
|
1183
1184
|
return n && r && (n.visibleWith === void 0 || a.has(n.visibleWith)) ? [{
|
|
@@ -1189,28 +1190,28 @@ var Ti = () => () => {}, Ei = () => "off", Di = ({ visible: Di = !0, writeAccess
|
|
|
1189
1190
|
return !1;
|
|
1190
1191
|
}
|
|
1191
1192
|
if (r.length === 0) return !1;
|
|
1192
|
-
let i =
|
|
1193
|
-
|
|
1193
|
+
let i = _.getState().activeConversationId, a = M();
|
|
1194
|
+
Zo.current = a, $o(!0);
|
|
1194
1195
|
let o = () => {
|
|
1195
|
-
|
|
1196
|
+
Zo.current === a && (Zo.current = null, X.current && $o(!1));
|
|
1196
1197
|
};
|
|
1197
1198
|
return (async () => {
|
|
1198
1199
|
let a = { kind: "none" }, c = !0;
|
|
1199
1200
|
try {
|
|
1200
|
-
a = await
|
|
1201
|
+
a = await Ir({
|
|
1201
1202
|
name: e.request.name,
|
|
1202
1203
|
usable: r,
|
|
1203
|
-
nounOf: (e) =>
|
|
1204
|
-
timeoutMs:
|
|
1205
|
-
}), c =
|
|
1204
|
+
nounOf: (e) => Rt(N, e.noun),
|
|
1205
|
+
timeoutMs: yi
|
|
1206
|
+
}), c = _.getState().conversations.some((e) => e.id === i);
|
|
1206
1207
|
} catch {
|
|
1207
1208
|
a = { kind: "none" };
|
|
1208
1209
|
} finally {
|
|
1209
1210
|
o();
|
|
1210
1211
|
}
|
|
1211
|
-
if (!
|
|
1212
|
+
if (!X.current) return;
|
|
1212
1213
|
if (a.kind === "none") {
|
|
1213
|
-
|
|
1214
|
+
Ps.current(t, [], {
|
|
1214
1215
|
fromPerson: !0,
|
|
1215
1216
|
...n === void 0 ? {} : { voiceSessionId: n },
|
|
1216
1217
|
localRecordsChecked: !0
|
|
@@ -1231,16 +1232,16 @@ var Ti = () => () => {}, Ei = () => "off", Di = ({ visible: Di = !0, writeAccess
|
|
|
1231
1232
|
return;
|
|
1232
1233
|
}
|
|
1233
1234
|
let l = a.candidates[0];
|
|
1234
|
-
d(a.why === "kinds" ?
|
|
1235
|
+
d(a.why === "kinds" ? qt(N, a.nouns, a.candidates) : Kt(N, a.nouns[0] ?? "", l?.label ?? e.request.name, a.candidates), {
|
|
1235
1236
|
kind: "choose-destination",
|
|
1236
1237
|
candidateIds: a.candidates.map((e) => e.id)
|
|
1237
|
-
}, (e) =>
|
|
1238
|
+
}, (e) => $r(e, a.candidates));
|
|
1238
1239
|
})().catch(() => void 0), !0;
|
|
1239
1240
|
}
|
|
1240
1241
|
if (e.kind === "back") {
|
|
1241
|
-
let e =
|
|
1242
|
+
let e = Gr.top();
|
|
1242
1243
|
if (!e) return !1;
|
|
1243
|
-
let t =
|
|
1244
|
+
let t = Jr(Br(Y.current.navItems), e.fromPath);
|
|
1244
1245
|
return f({
|
|
1245
1246
|
target: e.fromPath,
|
|
1246
1247
|
destinationId: t?.id ?? "",
|
|
@@ -1248,27 +1249,27 @@ var Ti = () => () => {}, Ei = () => "off", Di = ({ visible: Di = !0, writeAccess
|
|
|
1248
1249
|
via: "back",
|
|
1249
1250
|
pageLabel: () => t?.label ?? null,
|
|
1250
1251
|
onArrived: () => {
|
|
1251
|
-
|
|
1252
|
+
Gr.top() === e && Gr.pop();
|
|
1252
1253
|
}
|
|
1253
1254
|
});
|
|
1254
1255
|
}
|
|
1255
1256
|
let te, p = e.destination;
|
|
1256
1257
|
if (e.via === "offer") {
|
|
1257
|
-
let t =
|
|
1258
|
-
if (!t.ok) return d(t.copy ??
|
|
1258
|
+
let t = ss(e.offerId, e.destination.label);
|
|
1259
|
+
if (!t.ok) return d(t.copy ?? Ht(N), {
|
|
1259
1260
|
kind: "write-reply",
|
|
1260
1261
|
line: t.reason === "unavailable" ? "offer.notAvailable" : "offer.expired"
|
|
1261
1262
|
});
|
|
1262
1263
|
te = {
|
|
1263
1264
|
trigger: e.trigger,
|
|
1264
1265
|
offerId: e.offerId
|
|
1265
|
-
}, p =
|
|
1266
|
+
}, p = Br(Y.current.navItems).find((e) => e.id === t.target.id) ?? {
|
|
1266
1267
|
id: t.target.id,
|
|
1267
1268
|
label: t.target.label,
|
|
1268
1269
|
path: t.target.path
|
|
1269
1270
|
};
|
|
1270
1271
|
}
|
|
1271
|
-
return
|
|
1272
|
+
return Lr(p, window.location.pathname + window.location.search, Br(Y.current.navItems)) ? d(Bt(N, p.label, !0), qr({
|
|
1272
1273
|
destinationId: p.id,
|
|
1273
1274
|
path: p.path,
|
|
1274
1275
|
alreadyHere: !0,
|
|
@@ -1284,119 +1285,119 @@ var Ti = () => () => {}, Ei = () => "off", Di = ({ visible: Di = !0, writeAccess
|
|
|
1284
1285
|
onArrived: ee
|
|
1285
1286
|
});
|
|
1286
1287
|
}, [
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
Es,
|
|
1291
|
-
Yo,
|
|
1292
|
-
R,
|
|
1293
|
-
ta,
|
|
1294
|
-
Io,
|
|
1288
|
+
H,
|
|
1289
|
+
lo,
|
|
1290
|
+
Ss,
|
|
1295
1291
|
Ds,
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1292
|
+
Xo,
|
|
1293
|
+
z,
|
|
1294
|
+
na,
|
|
1295
|
+
Lo,
|
|
1296
|
+
Os,
|
|
1297
|
+
zo,
|
|
1298
|
+
Yo,
|
|
1299
|
+
No,
|
|
1300
|
+
N,
|
|
1301
|
+
ss,
|
|
1302
|
+
ls,
|
|
1303
|
+
is
|
|
1304
|
+
]), As = E(async (e) => {
|
|
1305
|
+
qa.current = !0, Ya(!0);
|
|
1305
1306
|
try {
|
|
1306
|
-
await
|
|
1307
|
+
await W.declineForReply(e.conversationId, e.reason, e.origin);
|
|
1307
1308
|
} finally {
|
|
1308
|
-
|
|
1309
|
+
qa.current = !1, X.current && Ya(!1);
|
|
1309
1310
|
}
|
|
1310
1311
|
if (e.commandText !== null) {
|
|
1311
|
-
let t =
|
|
1312
|
-
if (t &&
|
|
1312
|
+
let t = gs(e.commandText, e.options.voiceSessionId);
|
|
1313
|
+
if (t && ks(t, e.content, e.options.voiceSessionId)) return;
|
|
1313
1314
|
}
|
|
1314
|
-
await
|
|
1315
|
+
await Ps.current(e.content, e.attachments, e.options);
|
|
1315
1316
|
}, [
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
]),
|
|
1320
|
-
let r = n.voiceSessionId !== void 0, i =
|
|
1321
|
-
if (r &&
|
|
1322
|
-
let e =
|
|
1317
|
+
gs,
|
|
1318
|
+
ks,
|
|
1319
|
+
W
|
|
1320
|
+
]), Q = E(async (e, t = [], n = {}) => {
|
|
1321
|
+
let r = n.voiceSessionId !== void 0, i = _.getState(), a = !1, o = oo.current;
|
|
1322
|
+
if (r && nt(o)) {
|
|
1323
|
+
let e = ot(o, i.activeConversationId, uo());
|
|
1323
1324
|
if (e.kind === "gone") return;
|
|
1324
1325
|
let t = n.voiceEntry ?? e;
|
|
1325
|
-
t.kind === "adopt" &&
|
|
1326
|
+
t.kind === "adopt" && lo(t.conversationId), a = t.kind === "own", n = {
|
|
1326
1327
|
...n,
|
|
1327
1328
|
voiceEntry: t
|
|
1328
1329
|
};
|
|
1329
1330
|
}
|
|
1330
|
-
let
|
|
1331
|
-
if (
|
|
1332
|
-
if (
|
|
1331
|
+
let u = a ? null : i.activeConversationId, d = a ? null : i.activeConversationId ?? B;
|
|
1332
|
+
if (d) {
|
|
1333
|
+
if (Mt(i.processingByConversationId[d]?.status)) {
|
|
1333
1334
|
if (n.avatarTabAsk !== void 0) return;
|
|
1334
|
-
let r = i.processingByConversationId[
|
|
1335
|
-
r && n.correctsInFlightTurn === !0 && !
|
|
1336
|
-
conversationId:
|
|
1335
|
+
let r = i.processingByConversationId[d]?.messageId ?? null;
|
|
1336
|
+
r && n.correctsInFlightTurn === !0 && !Eo.current.has(r) && ko(), r && Eo.current.has(r) && (Do.current = {
|
|
1337
|
+
conversationId: d,
|
|
1337
1338
|
content: e,
|
|
1338
1339
|
attachments: t,
|
|
1339
1340
|
options: n
|
|
1340
1341
|
});
|
|
1341
1342
|
return;
|
|
1342
1343
|
}
|
|
1343
|
-
if (
|
|
1344
|
+
if (po.current.has(d)) return;
|
|
1344
1345
|
}
|
|
1345
|
-
if (
|
|
1346
|
-
let
|
|
1347
|
-
if (
|
|
1348
|
-
let e = i.conversations.find((e) => e.id ===
|
|
1349
|
-
if (i.activeConversationId !==
|
|
1346
|
+
if (Ka.current || se() !== null || qa.current || Zo.current !== null) return;
|
|
1347
|
+
let f = n.targetConversationId, p = re(), ie = (e) => Gn(e) || Wn(e, p);
|
|
1348
|
+
if (f !== void 0) {
|
|
1349
|
+
let e = i.conversations.find((e) => e.id === f);
|
|
1350
|
+
if (i.activeConversationId !== f || !e || e.mode !== i.mode || ie(e)) return;
|
|
1350
1351
|
}
|
|
1351
1352
|
if (n.avatarTabAsk !== void 0) {
|
|
1352
|
-
let e =
|
|
1353
|
-
if (
|
|
1354
|
-
auto: i.autoRouting &&
|
|
1353
|
+
let e = u ? i.conversations.find((e) => e.id === u) : void 0, t = e && !ie(e) ? e : void 0;
|
|
1354
|
+
if (pr({
|
|
1355
|
+
auto: i.autoRouting && Ga.current && f === void 0,
|
|
1355
1356
|
selectedMode: i.mode,
|
|
1356
1357
|
conversation: t ? {
|
|
1357
1358
|
mode: t.mode,
|
|
1358
1359
|
routedBy: t.routedBy,
|
|
1359
|
-
hasHistory:
|
|
1360
|
+
hasHistory: Un(t)
|
|
1360
1361
|
} : null,
|
|
1361
|
-
modeWrites: (e) =>
|
|
1362
|
+
modeWrites: (e) => La.current.find((t) => t.id === e)?.writeCapable === !0 || xe(e)
|
|
1362
1363
|
}) !== null) return;
|
|
1363
1364
|
}
|
|
1364
1365
|
if (n.fromPerson && n.writeReplyBound === void 0) {
|
|
1365
|
-
let r =
|
|
1366
|
+
let r = f ?? u ?? null, i = n.voiceSessionId === void 0 ? "typed" : "spoken", o = ys(r, n.voiceSessionId), s = Mn({
|
|
1366
1367
|
text: e,
|
|
1367
|
-
locale: i === "spoken" ?
|
|
1368
|
+
locale: i === "spoken" ? Wi.input.code : z,
|
|
1368
1369
|
origin: i,
|
|
1369
1370
|
hasAttachments: t.length > 0,
|
|
1370
|
-
live:
|
|
1371
|
-
matchesLocalCommand: (e) =>
|
|
1371
|
+
live: W.liveFor(r),
|
|
1372
|
+
matchesLocalCommand: (e) => gs(e, n.voiceSessionId) !== null,
|
|
1372
1373
|
offer: o.state,
|
|
1373
|
-
offerAssent: o.state !== "none" &&
|
|
1374
|
+
offerAssent: o.state !== "none" && Hr({
|
|
1374
1375
|
text: e,
|
|
1375
|
-
uiLocale:
|
|
1376
|
-
inputLocale:
|
|
1377
|
-
commandLocales:
|
|
1378
|
-
manifest:
|
|
1379
|
-
leaveGuard:
|
|
1376
|
+
uiLocale: z,
|
|
1377
|
+
inputLocale: Wi.input.code,
|
|
1378
|
+
commandLocales: Y.current.options.commandLocales,
|
|
1379
|
+
manifest: Y.current.options.commandManifest,
|
|
1380
|
+
leaveGuard: Y.current.options.leaveGuard
|
|
1380
1381
|
})
|
|
1381
1382
|
});
|
|
1382
|
-
if (
|
|
1383
|
+
if (s.kind === "accept_offer") {
|
|
1383
1384
|
let t = o.accept;
|
|
1384
|
-
if (t &&
|
|
1385
|
+
if (t && ks({
|
|
1385
1386
|
kind: "navigate",
|
|
1386
1387
|
destination: t.destination,
|
|
1387
1388
|
via: "offer",
|
|
1388
1389
|
offerId: t.offerId,
|
|
1389
1390
|
trigger: "yes"
|
|
1390
1391
|
}, e, n.voiceSessionId, a, n.avatarTabAsk)) {
|
|
1391
|
-
|
|
1392
|
+
Ro(n.avatarTabAsk);
|
|
1392
1393
|
return;
|
|
1393
1394
|
}
|
|
1394
|
-
|
|
1395
|
+
s = {
|
|
1395
1396
|
kind: "send",
|
|
1396
1397
|
declineAll: null,
|
|
1397
1398
|
bound: {
|
|
1398
1399
|
writeReply: {
|
|
1399
|
-
kind:
|
|
1400
|
+
kind: s.viaAssent === !0 ? "other" : "affirm",
|
|
1400
1401
|
origin: i
|
|
1401
1402
|
},
|
|
1402
1403
|
promptText: e,
|
|
@@ -1404,1150 +1405,1159 @@ var Ti = () => () => {}, Ei = () => "off", Di = ({ visible: Di = !0, writeAccess
|
|
|
1404
1405
|
}
|
|
1405
1406
|
};
|
|
1406
1407
|
}
|
|
1407
|
-
if (
|
|
1408
|
-
r &&
|
|
1408
|
+
if (s.kind === "local_reply") {
|
|
1409
|
+
r && bs(r, e, s.line, s.values, n.voiceSessionId, n.avatarTabAsk);
|
|
1409
1410
|
return;
|
|
1410
1411
|
}
|
|
1411
|
-
let
|
|
1412
|
-
if (
|
|
1412
|
+
let c = s.kind === "local" ? s.fallback : s.bound, l = s.declineAll;
|
|
1413
|
+
if (l !== null && r) return n.avatarTabAsk === void 0 ? As({
|
|
1413
1414
|
conversationId: r,
|
|
1414
|
-
reason:
|
|
1415
|
+
reason: l,
|
|
1415
1416
|
origin: i,
|
|
1416
|
-
commandText:
|
|
1417
|
+
commandText: s.kind === "local" ? s.commandText : null,
|
|
1417
1418
|
content: e,
|
|
1418
1419
|
attachments: t,
|
|
1419
1420
|
options: {
|
|
1420
1421
|
...n,
|
|
1421
|
-
writeReplyBound:
|
|
1422
|
+
writeReplyBound: c
|
|
1422
1423
|
}
|
|
1423
1424
|
}) : void 0;
|
|
1424
1425
|
n = {
|
|
1425
1426
|
...n,
|
|
1426
|
-
writeReplyBound:
|
|
1427
|
+
writeReplyBound: c
|
|
1427
1428
|
};
|
|
1428
1429
|
}
|
|
1429
|
-
let
|
|
1430
|
+
let ae = n.writeReplyBound?.promptText ?? e;
|
|
1430
1431
|
if (n.fromPerson && t.length === 0 && n.writeReplyBound?.localCommands !== !1) {
|
|
1431
|
-
let t =
|
|
1432
|
-
if (t &&
|
|
1433
|
-
|
|
1432
|
+
let t = gs(e, n.voiceSessionId, n.localRecordsChecked === !0);
|
|
1433
|
+
if (t && ks(t, e, n.voiceSessionId, a, n.avatarTabAsk)) {
|
|
1434
|
+
Ro(n.avatarTabAsk);
|
|
1434
1435
|
return;
|
|
1435
1436
|
}
|
|
1436
1437
|
}
|
|
1437
|
-
let
|
|
1438
|
-
intent: n.avatarTabAsk === void 0 ? n.autoIntent ??
|
|
1438
|
+
let oe = u ? i.conversations.find((e) => e.id === u) : void 0, m = ie(oe) ? void 0 : oe, h = i.autoRouting && Ga.current && f === void 0 ? ne({
|
|
1439
|
+
intent: n.avatarTabAsk === void 0 ? n.autoIntent ?? ee(e) : "read",
|
|
1439
1440
|
dictated: r,
|
|
1440
|
-
voiceProposalBound: r &&
|
|
1441
|
-
conversation:
|
|
1442
|
-
mode:
|
|
1443
|
-
routedBy:
|
|
1444
|
-
hasHistory:
|
|
1441
|
+
voiceProposalBound: r && Fi("api-calls") && ue(i.acknowledgedWriteModes, "api-calls"),
|
|
1442
|
+
conversation: m ? {
|
|
1443
|
+
mode: m.mode,
|
|
1444
|
+
routedBy: m.routedBy,
|
|
1445
|
+
hasHistory: Un(m)
|
|
1445
1446
|
} : null
|
|
1446
1447
|
}) : null;
|
|
1447
|
-
if (
|
|
1448
|
-
|
|
1448
|
+
if (h && La.current.find((e) => e.id === h.mode)?.writeCapable && !ue(i.acknowledgedWriteModes, h.mode)) {
|
|
1449
|
+
Ka.current = {
|
|
1449
1450
|
content: e,
|
|
1450
1451
|
attachments: t,
|
|
1451
1452
|
options: n
|
|
1452
|
-
},
|
|
1453
|
+
}, Qa(h.mode);
|
|
1453
1454
|
return;
|
|
1454
1455
|
}
|
|
1455
|
-
let
|
|
1456
|
-
mode:
|
|
1457
|
-
backendSessionId:
|
|
1456
|
+
let g = h ? h.mode : i.mode, le, fe, v = f ?? (a ? null : B), me = v ? _.getState().conversations.find((e) => e.id === v) : void 0, he = h?.action === "escalate" && m ? {
|
|
1457
|
+
mode: m.mode,
|
|
1458
|
+
backendSessionId: m.backendSessionId ?? null
|
|
1458
1459
|
} : null;
|
|
1459
|
-
if (
|
|
1460
|
+
if (h) h.action === "new" || !m ? v = $i(void 0, g, { routedBy: "auto" }) : (v = m.id, pa(v, g));
|
|
1460
1461
|
else {
|
|
1461
1462
|
let e = i.autoRouting ? { routedBy: "auto" } : void 0;
|
|
1462
|
-
!
|
|
1463
|
+
!v || ie(me) || me && me.mode !== g && Un(me) ? v = $i(void 0, g, e) : me && me.mode !== g && (e ? pa(v, g) : Zi(v, g));
|
|
1463
1464
|
}
|
|
1464
|
-
if (!
|
|
1465
|
-
r &&
|
|
1466
|
-
let
|
|
1467
|
-
accessToken:
|
|
1468
|
-
workspaceToken:
|
|
1469
|
-
userId:
|
|
1470
|
-
organizationId:
|
|
1471
|
-
},
|
|
1472
|
-
|
|
1473
|
-
accessToken:
|
|
1474
|
-
workspaceToken:
|
|
1475
|
-
userId:
|
|
1476
|
-
organizationId:
|
|
1465
|
+
if (!v) return;
|
|
1466
|
+
r && oo.current !== void 0 && v !== i.activeConversationId && lo(v), n.approvalFollowUp || (fo.current[v] = t);
|
|
1467
|
+
let _e = () => _.getState().conversations.some((e) => e.id === v), y = w(), Ce = {
|
|
1468
|
+
accessToken: L(),
|
|
1469
|
+
workspaceToken: Ii(),
|
|
1470
|
+
userId: R,
|
|
1471
|
+
organizationId: At()
|
|
1472
|
+
}, Te = (e, t) => {
|
|
1473
|
+
_e() || !y || pe(e, y, t, g, {
|
|
1474
|
+
accessToken: L(),
|
|
1475
|
+
workspaceToken: Ii(),
|
|
1476
|
+
userId: R,
|
|
1477
|
+
organizationId: At()
|
|
1477
1478
|
});
|
|
1478
|
-
},
|
|
1479
|
-
id:
|
|
1479
|
+
}, Ee = {
|
|
1480
|
+
id: M(),
|
|
1480
1481
|
role: "user",
|
|
1481
1482
|
content: e,
|
|
1482
1483
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1483
1484
|
metadata: {
|
|
1484
|
-
...t.length ? { attachments: t.map(
|
|
1485
|
+
...t.length ? { attachments: t.map(pt) } : {},
|
|
1485
1486
|
...n.approvalFollowUp ? {
|
|
1486
1487
|
approvalFollowUp: !0,
|
|
1487
1488
|
approvedReplyId: n.approvalFollowUp.approvedReplyId
|
|
1488
1489
|
} : {},
|
|
1489
|
-
...
|
|
1490
|
+
...x(n.voiceSessionId)
|
|
1490
1491
|
}
|
|
1491
1492
|
};
|
|
1492
|
-
|
|
1493
|
-
let
|
|
1493
|
+
H(v, Ee);
|
|
1494
|
+
let De = n.fromPerson === !0 && t.length === 0 && n.approvalFollowUp === void 0 && ae === e ? ai(e, r ? Wi.input.code : z) : null, Oe = {
|
|
1494
1495
|
location: window.location.pathname + window.location.search,
|
|
1495
|
-
conversationId:
|
|
1496
|
-
workspaceId:
|
|
1497
|
-
actorId:
|
|
1498
|
-
},
|
|
1499
|
-
|
|
1500
|
-
id:
|
|
1496
|
+
conversationId: _.getState().activeConversationId,
|
|
1497
|
+
workspaceId: w(),
|
|
1498
|
+
actorId: R ?? null
|
|
1499
|
+
}, b = M();
|
|
1500
|
+
H(v, {
|
|
1501
|
+
id: b,
|
|
1501
1502
|
role: "assistant",
|
|
1502
1503
|
content: "",
|
|
1503
1504
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1504
1505
|
metadata: {
|
|
1505
|
-
lang:
|
|
1506
|
-
...
|
|
1506
|
+
lang: qi,
|
|
1507
|
+
...x(n.voiceSessionId)
|
|
1507
1508
|
}
|
|
1508
|
-
}),
|
|
1509
|
+
}), dn(b, {
|
|
1509
1510
|
channel: r ? "voice" : "chat",
|
|
1510
|
-
mode:
|
|
1511
|
-
product:
|
|
1512
|
-
language:
|
|
1513
|
-
device:
|
|
1514
|
-
routedByAuto: !!
|
|
1515
|
-
}, n.voiceTiming),
|
|
1516
|
-
conversationId:
|
|
1517
|
-
questionId:
|
|
1518
|
-
replyId:
|
|
1511
|
+
mode: g,
|
|
1512
|
+
product: P,
|
|
1513
|
+
language: qi,
|
|
1514
|
+
device: pn(),
|
|
1515
|
+
routedByAuto: !!h
|
|
1516
|
+
}, n.voiceTiming), T(b, "accepted"), ra(v, "provisioning", b, null), ce(b), n.avatarTabAsk !== void 0 && zo(n.avatarTabAsk, {
|
|
1517
|
+
conversationId: v,
|
|
1518
|
+
questionId: Ee.id,
|
|
1519
|
+
replyId: b
|
|
1519
1520
|
});
|
|
1520
|
-
let
|
|
1521
|
-
let e =
|
|
1522
|
-
turnId:
|
|
1523
|
-
abortRequested:
|
|
1524
|
-
activeTurnId:
|
|
1525
|
-
conversationExists:
|
|
1521
|
+
let Ae = () => {
|
|
1522
|
+
let e = Nt({
|
|
1523
|
+
turnId: b,
|
|
1524
|
+
abortRequested: Eo.current.has(b),
|
|
1525
|
+
activeTurnId: _.getState().processingByConversationId[v]?.messageId ?? null,
|
|
1526
|
+
conversationExists: _e()
|
|
1526
1527
|
});
|
|
1527
|
-
return e.abandon &&
|
|
1528
|
-
},
|
|
1529
|
-
|
|
1528
|
+
return e.abandon && We(), e;
|
|
1529
|
+
}, Ve = (e, t, r, i, a = !1, o = qi) => {
|
|
1530
|
+
ta(v, b, { content: s(e) }), na(v, b, {
|
|
1530
1531
|
lang: o,
|
|
1531
1532
|
...t?.length ? { artifacts: t } : {},
|
|
1532
|
-
...t?.length || r || i ? { mode:
|
|
1533
|
+
...t?.length || r || i ? { mode: g } : {},
|
|
1533
1534
|
...r ? { sessionId: r } : {},
|
|
1534
1535
|
...i ? { sandboxId: i } : {},
|
|
1535
1536
|
...a ? { incomplete: !0 } : {},
|
|
1536
|
-
...
|
|
1537
|
+
...x(n.voiceSessionId)
|
|
1537
1538
|
});
|
|
1538
|
-
},
|
|
1539
|
+
}, He = { session: null }, S = {
|
|
1539
1540
|
stream: null,
|
|
1540
1541
|
render: null
|
|
1541
|
-
}, Ue = () => {
|
|
1542
|
-
x.render?.end();
|
|
1543
1542
|
}, We = () => {
|
|
1544
|
-
|
|
1545
|
-
}, Ge =
|
|
1546
|
-
|
|
1547
|
-
},
|
|
1548
|
-
|
|
1549
|
-
|
|
1543
|
+
S.render?.end();
|
|
1544
|
+
}, Ge = () => {
|
|
1545
|
+
We(), S.stream?.close(), S.stream = null, S.render = null;
|
|
1546
|
+
}, Ke = !1, Je = () => {
|
|
1547
|
+
Ke && (Ke = !1, Ue.abort(b));
|
|
1548
|
+
}, Ye = new c(), Xe = () => {}, Qe = async (i = 1) => {
|
|
1549
|
+
T(b, "attemptStarted");
|
|
1550
|
+
let a = null, o = null, c = !1;
|
|
1550
1551
|
try {
|
|
1551
|
-
let { sandboxId: i, sessionId:
|
|
1552
|
-
turnId:
|
|
1553
|
-
abortRequested:
|
|
1554
|
-
activeTurnId:
|
|
1555
|
-
conversationExists:
|
|
1552
|
+
let { sandboxId: i, sessionId: u, sessionIsNew: d, readAhead: f, sandboxIsNew: ee, sandboxProbed: te, sandboxAdopted: p, deadSandboxProbe: ne, sessionPreopened: re } = await bo(v, b, g, y, Ce, { isAbandoned: () => Nt({
|
|
1553
|
+
turnId: b,
|
|
1554
|
+
abortRequested: Eo.current.has(b),
|
|
1555
|
+
activeTurnId: _.getState().processingByConversationId[v]?.messageId ?? null,
|
|
1556
|
+
conversationExists: _e()
|
|
1556
1557
|
}).abandon });
|
|
1557
|
-
if (a = i,
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1558
|
+
if (a = i, Xe(), Xe = l(i, () => {
|
|
1559
|
+
Eo.current.add(b), qe(b), Ue.abort(b);
|
|
1560
|
+
}), T(b, "runtimeReady"), fn(b, {
|
|
1561
|
+
runtime: ee ? "cold" : p ? "adopted" : te ? "probed" : re ? "preopened" : d ? "new-session" : "warm",
|
|
1562
|
+
deadSandboxProbe: ne
|
|
1563
|
+
}), fn(b, { session: re ? "preopened" : d ? "created" : "reused" }), o = u, He.session = {
|
|
1561
1564
|
sandboxId: i,
|
|
1562
|
-
sessionId:
|
|
1563
|
-
},
|
|
1565
|
+
sessionId: u
|
|
1566
|
+
}, de(g, le, _.getState().acknowledgedWriteModes, {
|
|
1564
1567
|
dictated: r,
|
|
1565
|
-
confirmsWrites:
|
|
1566
|
-
proposalBound:
|
|
1567
|
-
}) === "voice-in-write-mode") throw new
|
|
1568
|
-
let
|
|
1569
|
-
conversation:
|
|
1568
|
+
confirmsWrites: xe(g),
|
|
1569
|
+
proposalBound: Fi(g, i)
|
|
1570
|
+
}) === "voice-in-write-mode") throw new je("voice-in-write-mode", "Voice in a write mode");
|
|
1571
|
+
let ie = rr({
|
|
1572
|
+
conversation: _.getState().conversations.find((e) => e.id === v),
|
|
1570
1573
|
content: e,
|
|
1571
|
-
sessionIsNew:
|
|
1572
|
-
sendingMode:
|
|
1573
|
-
sendingModeConfig:
|
|
1574
|
-
modes:
|
|
1575
|
-
answerText: (e) =>
|
|
1574
|
+
sessionIsNew: d,
|
|
1575
|
+
sendingMode: g,
|
|
1576
|
+
sendingModeConfig: le,
|
|
1577
|
+
modes: La.current,
|
|
1578
|
+
answerText: (e) => sn(e).text
|
|
1576
1579
|
});
|
|
1577
|
-
if (
|
|
1578
|
-
let e =
|
|
1579
|
-
mint: () =>
|
|
1580
|
-
mark: (e) =>
|
|
1580
|
+
if (Ge(), br()) {
|
|
1581
|
+
let e = yr({
|
|
1582
|
+
mint: () => be(i, y, u, g, Ce),
|
|
1583
|
+
mark: (e) => T(b, e)
|
|
1581
1584
|
});
|
|
1582
|
-
|
|
1585
|
+
S.stream = e, S.render = or({
|
|
1583
1586
|
stream: e,
|
|
1584
|
-
conversationId:
|
|
1585
|
-
messageId:
|
|
1586
|
-
build: (e, t) =>
|
|
1587
|
-
onFirstDelta: () =>
|
|
1588
|
-
onFirstVisible: () =>
|
|
1587
|
+
conversationId: v,
|
|
1588
|
+
messageId: b,
|
|
1589
|
+
build: (e, t) => s(tn(e, t, { accumulateNarration: fe.accumulatesNarration }).content),
|
|
1590
|
+
onFirstDelta: () => T(b, "firstDelta"),
|
|
1591
|
+
onFirstVisible: () => T(b, "firstOutput")
|
|
1589
1592
|
});
|
|
1590
1593
|
}
|
|
1591
|
-
let
|
|
1592
|
-
|
|
1593
|
-
let
|
|
1594
|
+
let oe = await rn(() => ye(i, y, u, g, Ce, { limit: 50 }), d, nn(f, i, u));
|
|
1595
|
+
vo(v, b, "streaming", "thinking");
|
|
1596
|
+
let se = Ai?.(), ce = Nn(_.getState().sandboxWriteCapabilities[i]), m = Y.current, h = ri(i, u), ue = m.options.uiCatalogue ? ei(Br(m.navItems), {
|
|
1594
1597
|
permissionsSettled: m.navPermissionsSettled,
|
|
1595
1598
|
simulating: m.navSimulating,
|
|
1596
|
-
sentBefore:
|
|
1597
|
-
}) : null,
|
|
1598
|
-
conversationId:
|
|
1599
|
-
writeReply:
|
|
1600
|
-
...
|
|
1601
|
-
}, { prompt:
|
|
1602
|
-
content:
|
|
1599
|
+
sentBefore: ni(h)
|
|
1600
|
+
}) : null, pe = {
|
|
1601
|
+
conversationId: v,
|
|
1602
|
+
writeReply: ce === "proposal-v1" ? n.writeReplyBound?.writeReply ?? null : null,
|
|
1603
|
+
...ue ? { uiCatalogue: ue } : {}
|
|
1604
|
+
}, { prompt: me, parts: he } = wt({
|
|
1605
|
+
content: ie ? `${ie}${ae}` : ae,
|
|
1603
1606
|
attachments: t,
|
|
1604
|
-
limits:
|
|
1605
|
-
wrapPrompt: (e) =>
|
|
1606
|
-
requestBytes: (e, t) =>
|
|
1607
|
+
limits: ft(le),
|
|
1608
|
+
wrapPrompt: (e) => ji?.(g, e, Gi, Ki, r, { writeApproval: ce }) ?? e,
|
|
1609
|
+
requestBytes: (e, t) => Se({
|
|
1607
1610
|
sandboxId: i,
|
|
1608
|
-
workspaceId:
|
|
1609
|
-
sessionId:
|
|
1610
|
-
mode:
|
|
1611
|
+
workspaceId: y,
|
|
1612
|
+
sessionId: u,
|
|
1613
|
+
mode: g,
|
|
1611
1614
|
prompt: e,
|
|
1612
1615
|
parts: t,
|
|
1613
|
-
pageContext:
|
|
1614
|
-
authContext:
|
|
1615
|
-
...
|
|
1616
|
+
pageContext: se,
|
|
1617
|
+
authContext: Ce,
|
|
1618
|
+
...pe
|
|
1616
1619
|
})
|
|
1617
|
-
}), Me =
|
|
1618
|
-
|
|
1619
|
-
let
|
|
1620
|
-
if (
|
|
1621
|
-
|
|
1620
|
+
}), Me = ut(he), Ne = Me > 0;
|
|
1621
|
+
c = lt(t) > Me;
|
|
1622
|
+
let Pe = Ae();
|
|
1623
|
+
if (Pe.abandon) {
|
|
1624
|
+
Pe.clearProcessing && ia(v);
|
|
1622
1625
|
return;
|
|
1623
1626
|
}
|
|
1627
|
+
let Ie = (e) => Ye.dispatch({
|
|
1628
|
+
prompt: me,
|
|
1629
|
+
isAbandoned: () => Ae().abandon,
|
|
1630
|
+
readMessages: (e) => ye(i, y, u, g, Ce, { sinceMs: e }),
|
|
1631
|
+
send: () => we(i, y, u, me, g, se, Ce, e?.length ? {
|
|
1632
|
+
parts: e,
|
|
1633
|
+
...pe
|
|
1634
|
+
} : pe)
|
|
1635
|
+
});
|
|
1624
1636
|
try {
|
|
1625
|
-
await
|
|
1626
|
-
parts: je,
|
|
1627
|
-
...fe
|
|
1628
|
-
} : fe);
|
|
1637
|
+
await Ie(he);
|
|
1629
1638
|
} catch (e) {
|
|
1630
|
-
if (!
|
|
1631
|
-
await
|
|
1639
|
+
if (!Ye.canFailover() || !he || !bn(e)) throw e;
|
|
1640
|
+
await Ie(void 0), c ||= Ne;
|
|
1632
1641
|
}
|
|
1633
|
-
|
|
1634
|
-
let
|
|
1635
|
-
|
|
1636
|
-
replyId:
|
|
1637
|
-
conversationId:
|
|
1642
|
+
ue && ti(h);
|
|
1643
|
+
let Re = _.getState().sandboxWriteCapabilities[i], ze = m.options.uiOffers === !0 && ke(Re) ? R : null, x = !!ze;
|
|
1644
|
+
ze && Z.recordTurn({
|
|
1645
|
+
replyId: b,
|
|
1646
|
+
conversationId: v,
|
|
1638
1647
|
sandboxId: i,
|
|
1639
|
-
sessionId:
|
|
1640
|
-
mode:
|
|
1641
|
-
writeCapable:
|
|
1642
|
-
actorId:
|
|
1643
|
-
floorMs:
|
|
1648
|
+
sessionId: u,
|
|
1649
|
+
mode: g,
|
|
1650
|
+
writeCapable: le?.writeCapable === !0,
|
|
1651
|
+
actorId: ze,
|
|
1652
|
+
floorMs: oe
|
|
1644
1653
|
});
|
|
1645
|
-
let
|
|
1646
|
-
|
|
1647
|
-
} : void 0,
|
|
1648
|
-
|
|
1649
|
-
let
|
|
1650
|
-
|
|
1651
|
-
let
|
|
1654
|
+
let Je = x ? (e, t) => {
|
|
1655
|
+
Z.receive(b, e, t, performance.now()) && is();
|
|
1656
|
+
} : void 0, Qe = (e) => ta(v, b, { content: e }), $e = (e) => c ? `${e}\n\n${N("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;
|
|
1657
|
+
T(b, "promptSent");
|
|
1658
|
+
let et = null, tt = !1, nt = en, C = tn([], oe);
|
|
1659
|
+
S.render?.arm(oe);
|
|
1660
|
+
let rt = Date.now() + fe.streamBudgetMs, it = Date.now(), at = Date.now(), ot = xr(() => ye(i, y, u, g, Ce, {
|
|
1652
1661
|
limit: 50,
|
|
1653
|
-
sinceMs:
|
|
1662
|
+
sinceMs: oe,
|
|
1654
1663
|
surfaceTurnTerminal: !0,
|
|
1655
|
-
surfaceUiOffers:
|
|
1656
|
-
})),
|
|
1657
|
-
for (; Date.now() <
|
|
1658
|
-
|
|
1659
|
-
let e =
|
|
1664
|
+
surfaceUiOffers: Je
|
|
1665
|
+
})), st = S.stream?.onIdle(() => ot.startExtra());
|
|
1666
|
+
for (; Date.now() < rt;) {
|
|
1667
|
+
Te(i, u);
|
|
1668
|
+
let e = Ae();
|
|
1660
1669
|
if (e.abandon) {
|
|
1661
|
-
e.clearProcessing &&
|
|
1670
|
+
e.clearProcessing && ia(v);
|
|
1662
1671
|
return;
|
|
1663
1672
|
}
|
|
1664
|
-
let t = await
|
|
1665
|
-
if (
|
|
1673
|
+
let t = await ot.next();
|
|
1674
|
+
if (x && Z.observeMessages(b, t) && is(), C = tn(t, oe, { accumulateNarration: fe.accumulatesNarration }), ta(v, b, { content: s(C.content) }), C.hasRenderableOutput ? tt || (tt = !0, et !== null && T(b, "lastQuietPoll", et), T(b, "firstOutput")) : et = hn(), fe.accumulatesNarration) C.hasText && T(b, "firstText");
|
|
1666
1675
|
else {
|
|
1667
|
-
let e =
|
|
1668
|
-
|
|
1676
|
+
let e = on(nt, C, hn());
|
|
1677
|
+
nt = e.tracker, e.confirmedAt !== null && T(b, "firstText", e.confirmedAt);
|
|
1669
1678
|
}
|
|
1670
|
-
if (
|
|
1671
|
-
transport:
|
|
1672
|
-
live:
|
|
1673
|
-
}) :
|
|
1679
|
+
if (C.pendingWrite && !jn(_.getState().sandboxWriteCapabilities[i]) && na(v, b, { pendingWrite: C.pendingWrite }), C.done && (S.stream ? fn(b, {
|
|
1680
|
+
transport: S.stream.reachedOpen ? "sse" : "poll",
|
|
1681
|
+
live: ar(S.stream.live)
|
|
1682
|
+
}) : fn(b, {
|
|
1674
1683
|
transport: "poll",
|
|
1675
1684
|
live: "none"
|
|
1676
|
-
}),
|
|
1677
|
-
|
|
1685
|
+
}), We()), C.done) {
|
|
1686
|
+
T(b, "answerDone"), q.current.markVerified(i);
|
|
1678
1687
|
break;
|
|
1679
1688
|
}
|
|
1680
|
-
if (
|
|
1681
|
-
let e =
|
|
1682
|
-
|
|
1689
|
+
if (S.render?.refresh(t), Date.now() - it > 3e4 && (await ge(i, y, 600, Ce).catch(() => void 0), it = Date.now()), !ot.hasPending()) {
|
|
1690
|
+
let e = Ze(Date.now() - at);
|
|
1691
|
+
S.stream ? await S.stream.waitWake(e) : await new Promise((t) => setTimeout(t, e));
|
|
1683
1692
|
}
|
|
1684
1693
|
}
|
|
1685
|
-
if (
|
|
1686
|
-
let e =
|
|
1687
|
-
e.trim() && (
|
|
1688
|
-
conversationId:
|
|
1694
|
+
if (st?.(), Ge(), C.done && n.voiceSessionId !== void 0 && !Ae().abandon) {
|
|
1695
|
+
let e = s($e(C.content));
|
|
1696
|
+
e.trim() && (c && Qe(e), T(b, "speechQueued"), Ke = !0, Ue.publish(b, {
|
|
1697
|
+
conversationId: v,
|
|
1689
1698
|
channel: "voice",
|
|
1690
1699
|
voiceSessionId: n.voiceSessionId,
|
|
1691
1700
|
text: e,
|
|
1692
|
-
lang:
|
|
1701
|
+
lang: qi,
|
|
1693
1702
|
final: !0
|
|
1694
1703
|
}));
|
|
1695
1704
|
}
|
|
1696
|
-
let
|
|
1697
|
-
|
|
1698
|
-
...
|
|
1699
|
-
content:
|
|
1700
|
-
}),
|
|
1701
|
-
...
|
|
1702
|
-
content:
|
|
1705
|
+
let ct = fe.producesArtifacts ? await ve(i, y, u, g, Ce).then((e) => e).catch(() => []) : void 0;
|
|
1706
|
+
C.usedTools !== void 0 && fn(b, { usedTools: C.usedTools }), C.done || (fn(b, { outcome: "timedOut" }), C = {
|
|
1707
|
+
...C,
|
|
1708
|
+
content: Be(C.content, g, N, le)
|
|
1709
|
+
}), c && (C = {
|
|
1710
|
+
...C,
|
|
1711
|
+
content: $e(C.content)
|
|
1703
1712
|
});
|
|
1704
|
-
let
|
|
1705
|
-
|
|
1706
|
-
workspaceId:
|
|
1707
|
-
sessionId:
|
|
1708
|
-
messageId:
|
|
1709
|
-
model:
|
|
1710
|
-
tokens:
|
|
1711
|
-
},
|
|
1712
|
-
let
|
|
1713
|
-
if (
|
|
1714
|
-
|
|
1713
|
+
let dt = !C.done;
|
|
1714
|
+
Ve(C.content, ct, u, i, dt), C.tokens && (ta(v, b, { tokens: C.tokens }), (Ni ? await Le({
|
|
1715
|
+
workspaceId: y,
|
|
1716
|
+
sessionId: u,
|
|
1717
|
+
messageId: C.messageId,
|
|
1718
|
+
model: C.model,
|
|
1719
|
+
tokens: C.tokens
|
|
1720
|
+
}, Ni, { ledger: Fe("panel", P) }) : { ok: !0 }).ok && ui(P)), C.done || Te(i, u);
|
|
1721
|
+
let pt = Ae();
|
|
1722
|
+
if (pt.abandon) {
|
|
1723
|
+
pt.clearProcessing && ia(v);
|
|
1715
1724
|
return;
|
|
1716
1725
|
}
|
|
1717
|
-
|
|
1718
|
-
replyId:
|
|
1719
|
-
conversationId:
|
|
1726
|
+
T(b, "complete"), fn(b, { outcome: "answered" }), ra(v, "complete", b, null), Jn.recordCommittedEntries(v, [Ee.id, b], "TURN", y), Ke = !1, x && De && C.done && ms({
|
|
1727
|
+
replyId: b,
|
|
1728
|
+
conversationId: v,
|
|
1720
1729
|
voiceSessionId: n.voiceSessionId,
|
|
1721
|
-
intent:
|
|
1722
|
-
atSend:
|
|
1730
|
+
intent: De,
|
|
1731
|
+
atSend: Oe
|
|
1723
1732
|
});
|
|
1724
1733
|
} catch (e) {
|
|
1725
|
-
|
|
1726
|
-
let t =
|
|
1727
|
-
turnId:
|
|
1728
|
-
abortRequested:
|
|
1729
|
-
activeTurnId:
|
|
1730
|
-
conversationExists:
|
|
1734
|
+
q.current.invalidate(a ?? _.getState().sandboxesByMode[g]?.sandboxId ?? null);
|
|
1735
|
+
let t = Nt({
|
|
1736
|
+
turnId: b,
|
|
1737
|
+
abortRequested: Eo.current.has(b),
|
|
1738
|
+
activeTurnId: _.getState().processingByConversationId[v]?.messageId ?? null,
|
|
1739
|
+
conversationExists: _e()
|
|
1731
1740
|
});
|
|
1732
|
-
if (
|
|
1733
|
-
t.clearProcessing &&
|
|
1741
|
+
if (We(), a && o && Te(a, o), t.abandon) {
|
|
1742
|
+
t.clearProcessing && ia(v);
|
|
1734
1743
|
return;
|
|
1735
1744
|
}
|
|
1736
|
-
if (i === 1 &&
|
|
1737
|
-
|
|
1738
|
-
|
|
1745
|
+
if (i === 1 && Ye.canFailover() && xn(e)) {
|
|
1746
|
+
Xe();
|
|
1747
|
+
let e = a ?? _.getState().sandboxesByMode[g]?.sandboxId ?? null;
|
|
1748
|
+
return e && (J.current.add(e), q.current.invalidate(e)), oa(v), ca(g), ea(v, b, ""), na(v, b, { pendingWrite: void 0 }), e && W.retireSandbox(e), Ge(), Je(), mn(b), Qe(2);
|
|
1739
1749
|
}
|
|
1740
1750
|
throw e;
|
|
1741
1751
|
}
|
|
1742
|
-
},
|
|
1743
|
-
|
|
1752
|
+
}, $e = v;
|
|
1753
|
+
po.current.add($e);
|
|
1744
1754
|
try {
|
|
1745
|
-
if (!
|
|
1755
|
+
if (!y) throw Object.assign(/* @__PURE__ */ Error("Assistant backend is unavailable without an active workspace context."), { extensions: {
|
|
1746
1756
|
code: "UNAUTHENTICATED",
|
|
1747
1757
|
authFailure: "WORKSPACE_CONTEXT_MISSING"
|
|
1748
1758
|
} });
|
|
1749
|
-
let e = await
|
|
1750
|
-
|
|
1751
|
-
let t =
|
|
1759
|
+
let e = await Ct(g, () => La.current.find((e) => e.id === g), Ia);
|
|
1760
|
+
le = e.config, fe = e.capabilities;
|
|
1761
|
+
let t = le, n = Ae();
|
|
1752
1762
|
if (n.abandon) {
|
|
1753
|
-
n.clearProcessing &&
|
|
1763
|
+
n.clearProcessing && ia(v);
|
|
1754
1764
|
return;
|
|
1755
1765
|
}
|
|
1756
|
-
let i =
|
|
1766
|
+
let i = de(g, t, _.getState().acknowledgedWriteModes, {
|
|
1757
1767
|
dictated: r,
|
|
1758
|
-
confirmsWrites:
|
|
1759
|
-
proposalBound:
|
|
1768
|
+
confirmsWrites: xe(g),
|
|
1769
|
+
proposalBound: Fi(g)
|
|
1760
1770
|
});
|
|
1761
|
-
if (i) throw new
|
|
1762
|
-
let a =
|
|
1763
|
-
if (
|
|
1764
|
-
let e = await
|
|
1765
|
-
if (!e.ok) throw
|
|
1766
|
-
let t =
|
|
1771
|
+
if (i) throw new je(i, i === "confirm-write-mode" ? "Write mode not confirmed" : "Voice in a write mode");
|
|
1772
|
+
let a = Fe("panel", P);
|
|
1773
|
+
if (Ni && Ie(a, y)) {
|
|
1774
|
+
let e = await Re(a, y, Ni);
|
|
1775
|
+
if (!e.ok) throw ze(e.kind);
|
|
1776
|
+
let t = Ae();
|
|
1767
1777
|
if (t.abandon) {
|
|
1768
|
-
t.clearProcessing &&
|
|
1778
|
+
t.clearProcessing && ia(v);
|
|
1769
1779
|
return;
|
|
1770
1780
|
}
|
|
1771
1781
|
}
|
|
1772
|
-
|
|
1782
|
+
T(b, "cleared"), await Qe();
|
|
1773
1783
|
} catch (e) {
|
|
1774
|
-
if (
|
|
1775
|
-
|
|
1784
|
+
if (q.current.invalidate(_.getState().sandboxesByMode[g]?.sandboxId ?? null), !_e()) {
|
|
1785
|
+
ia(v);
|
|
1776
1786
|
return;
|
|
1777
1787
|
}
|
|
1778
|
-
let t =
|
|
1779
|
-
mode:
|
|
1780
|
-
capabilities: t ?
|
|
1788
|
+
let t = He.session?.sandboxId ?? null, r = Me(e, { confirmsNoAction: Ne({
|
|
1789
|
+
mode: g,
|
|
1790
|
+
capabilities: t ? _.getState().sandboxWriteCapabilities[t] : null
|
|
1781
1791
|
}) });
|
|
1782
|
-
|
|
1783
|
-
let i =
|
|
1784
|
-
|
|
1785
|
-
lang: i.translated ?
|
|
1786
|
-
...
|
|
1792
|
+
fn(b, { outcome: r.kind === "temporary" ? "failed" : "refused" }), r.offersUpgrade && li(P, "sandbox");
|
|
1793
|
+
let i = Pe(r, N, { locale: z });
|
|
1794
|
+
ra(v, "error", b, i.headline), ta(v, b, { content: i.text }), na(v, b, {
|
|
1795
|
+
lang: i.translated ? z : "en",
|
|
1796
|
+
...x(n.voiceSessionId)
|
|
1787
1797
|
});
|
|
1788
1798
|
} finally {
|
|
1789
|
-
|
|
1790
|
-
let e =
|
|
1791
|
-
t && (
|
|
1792
|
-
...
|
|
1793
|
-
conversationId:
|
|
1794
|
-
},
|
|
1795
|
-
let n =
|
|
1796
|
-
|
|
1799
|
+
Xe(), po.current.delete($e), fn(b, { outcome: "stopped" }), T(b, "complete"), Je(), Ge();
|
|
1800
|
+
let e = _.getState(), t = te(he, g, e.conversations.find((e) => e.id === $e), (t) => !!e.sandboxesByMode[t]?.sandboxId);
|
|
1801
|
+
t && (pa($e, t.mode), t.backendSessionId && aa($e, t.backendSessionId)), He.session && _e() && W.afterTurn({
|
|
1802
|
+
...He.session,
|
|
1803
|
+
conversationId: $e
|
|
1804
|
+
}, b);
|
|
1805
|
+
let n = Do.current;
|
|
1806
|
+
Do.current = null, n && n.conversationId === $e && _e() && Ps.current(n.content, n.attachments, n.options);
|
|
1797
1807
|
}
|
|
1798
1808
|
}, [
|
|
1809
|
+
B,
|
|
1810
|
+
H,
|
|
1811
|
+
ji,
|
|
1812
|
+
oa,
|
|
1813
|
+
ca,
|
|
1814
|
+
Ji,
|
|
1815
|
+
$i,
|
|
1816
|
+
bo,
|
|
1817
|
+
W,
|
|
1818
|
+
ko,
|
|
1819
|
+
bs,
|
|
1820
|
+
As,
|
|
1799
1821
|
z,
|
|
1800
|
-
|
|
1822
|
+
Wi,
|
|
1823
|
+
Fi,
|
|
1801
1824
|
Ai,
|
|
1802
|
-
|
|
1803
|
-
|
|
1825
|
+
L,
|
|
1826
|
+
Ii,
|
|
1827
|
+
ta,
|
|
1828
|
+
P,
|
|
1829
|
+
Ia,
|
|
1830
|
+
Ni,
|
|
1831
|
+
Ki,
|
|
1832
|
+
z,
|
|
1804
1833
|
qi,
|
|
1805
|
-
Qi,
|
|
1806
|
-
yo,
|
|
1807
|
-
U,
|
|
1808
|
-
Oo,
|
|
1809
|
-
ys,
|
|
1810
|
-
ks,
|
|
1811
|
-
R,
|
|
1812
|
-
Ui,
|
|
1813
|
-
Pi,
|
|
1814
|
-
ki,
|
|
1815
|
-
I,
|
|
1816
|
-
Fi,
|
|
1817
|
-
ea,
|
|
1818
|
-
N,
|
|
1819
|
-
Fa,
|
|
1820
|
-
Mi,
|
|
1821
1834
|
Gi,
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
fa,
|
|
1826
|
-
Os,
|
|
1827
|
-
hs,
|
|
1828
|
-
co,
|
|
1835
|
+
pa,
|
|
1836
|
+
ks,
|
|
1837
|
+
gs,
|
|
1829
1838
|
lo,
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1839
|
+
uo,
|
|
1840
|
+
aa,
|
|
1841
|
+
Zi,
|
|
1833
1842
|
ra,
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1843
|
+
ia,
|
|
1844
|
+
N,
|
|
1845
|
+
vo,
|
|
1846
|
+
ea,
|
|
1847
|
+
R,
|
|
1848
|
+
Z,
|
|
1849
|
+
is,
|
|
1850
|
+
ys,
|
|
1851
|
+
ms,
|
|
1852
|
+
zo,
|
|
1853
|
+
Ro
|
|
1854
|
+
]), js = E((e, t) => {
|
|
1855
|
+
Q(e, [], t ? { autoIntent: t } : {});
|
|
1856
|
+
}, [Q]), Ms = jt(), Ns = E(() => {
|
|
1857
|
+
let e = [...ma.chat].reverse().find((e) => e.role === "user" && !e.metadata?.localAction);
|
|
1848
1858
|
if (!e || e.metadata?.approvalFollowUp) return;
|
|
1849
|
-
let t =
|
|
1850
|
-
if (t.some((e) =>
|
|
1851
|
-
let n =
|
|
1852
|
-
|
|
1853
|
-
|
|
1859
|
+
let t = B ? fo.current[B] ?? [] : [];
|
|
1860
|
+
if (t.some((e) => Et(e, Date.now()))) {
|
|
1861
|
+
let n = B ?? void 0;
|
|
1862
|
+
Dt(t, Ms).then((t) => {
|
|
1863
|
+
Q(e.content, t, n === void 0 ? void 0 : { targetConversationId: n });
|
|
1854
1864
|
});
|
|
1855
1865
|
return;
|
|
1856
1866
|
}
|
|
1857
|
-
|
|
1867
|
+
Q(e.content, t);
|
|
1858
1868
|
}, [
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
]),
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
}, [
|
|
1867
|
-
let
|
|
1868
|
-
if (
|
|
1869
|
-
for (let e =
|
|
1870
|
-
let t =
|
|
1869
|
+
ha,
|
|
1870
|
+
Q,
|
|
1871
|
+
B,
|
|
1872
|
+
Ms
|
|
1873
|
+
]), Ps = k(Q);
|
|
1874
|
+
D(() => {
|
|
1875
|
+
Ps.current = Q;
|
|
1876
|
+
}, [Q]);
|
|
1877
|
+
let Fs = O(() => {
|
|
1878
|
+
if (_a) return null;
|
|
1879
|
+
for (let e = ha.length - 1; e >= 0; --e) {
|
|
1880
|
+
let t = ha[e];
|
|
1871
1881
|
if (t?.role !== "assistant") continue;
|
|
1872
|
-
if (t.id ===
|
|
1873
|
-
if (!
|
|
1874
|
-
let n =
|
|
1882
|
+
if (t.id === Ko) return null;
|
|
1883
|
+
if (!He(t) || Eo.current.has(t.id) || Ke(t.id)) continue;
|
|
1884
|
+
let n = $t(t, ga, N);
|
|
1875
1885
|
if (n.kind !== "output") return null;
|
|
1876
|
-
let r =
|
|
1877
|
-
return r ?
|
|
1886
|
+
let r = sn(n.text).text.trim();
|
|
1887
|
+
return r ? Ge(t, r, ga) : null;
|
|
1878
1888
|
}
|
|
1879
1889
|
return null;
|
|
1880
1890
|
}, [
|
|
1881
|
-
ma,
|
|
1882
|
-
ga,
|
|
1883
1891
|
ha,
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1892
|
+
_a,
|
|
1893
|
+
ga,
|
|
1894
|
+
Ko,
|
|
1895
|
+
N
|
|
1896
|
+
]), Is = O(() => Fs ? Qe(Fs.text) : null, [Fs]), Ls = O(() => ma.chat.filter((e) => e.id !== Ko), [ma.chat, Ko]), Rs = _((e) => fe(e)?.sandboxId ?? null), zs = h(Ls, {
|
|
1897
|
+
sessionId: U?.backendSessionId,
|
|
1898
|
+
sandboxId: Rs,
|
|
1889
1899
|
nowMs: Date.now()
|
|
1890
|
-
}),
|
|
1891
|
-
if (
|
|
1900
|
+
}), Bs = g(Ls), Vs = (e) => {
|
|
1901
|
+
if (An(e.metadata).length > 0) return !0;
|
|
1892
1902
|
let t = e.metadata?.sandboxId;
|
|
1893
|
-
return
|
|
1894
|
-
},
|
|
1895
|
-
let t =
|
|
1896
|
-
return t.length === 0 || !
|
|
1903
|
+
return jn(t ? ba[t] : null);
|
|
1904
|
+
}, Hs = (e) => {
|
|
1905
|
+
let t = An(e.metadata);
|
|
1906
|
+
return t.length === 0 || !B ? null : /* @__PURE__ */ j(kn, {
|
|
1897
1907
|
refs: t,
|
|
1898
|
-
conversationId:
|
|
1899
|
-
panel:
|
|
1900
|
-
entries:
|
|
1901
|
-
capabilitiesOf: (e) =>
|
|
1902
|
-
turnInFlight:
|
|
1903
|
-
tr:
|
|
1904
|
-
onReview:
|
|
1905
|
-
retiredSandboxes:
|
|
1908
|
+
conversationId: B,
|
|
1909
|
+
panel: W,
|
|
1910
|
+
entries: xa,
|
|
1911
|
+
capabilitiesOf: (e) => ba[e],
|
|
1912
|
+
turnInFlight: _a,
|
|
1913
|
+
tr: N,
|
|
1914
|
+
onReview: Ca.review,
|
|
1915
|
+
retiredSandboxes: Sa
|
|
1906
1916
|
});
|
|
1907
|
-
},
|
|
1908
|
-
if (!
|
|
1909
|
-
let t =
|
|
1917
|
+
}, Us = (e) => {
|
|
1918
|
+
if (!B) return null;
|
|
1919
|
+
let t = Z.liveOffersFor(e, {
|
|
1910
1920
|
registry: {
|
|
1911
|
-
destinations:
|
|
1912
|
-
permissionsSettled:
|
|
1913
|
-
simulating:
|
|
1921
|
+
destinations: Br(Vo),
|
|
1922
|
+
permissionsSettled: Ho,
|
|
1923
|
+
simulating: Uo
|
|
1914
1924
|
},
|
|
1915
|
-
actorId:
|
|
1916
|
-
conversationId:
|
|
1925
|
+
actorId: R,
|
|
1926
|
+
conversationId: B,
|
|
1917
1927
|
perfNow: performance.now()
|
|
1918
1928
|
}), n = t[0];
|
|
1919
|
-
return n ? /* @__PURE__ */
|
|
1929
|
+
return n ? /* @__PURE__ */ j(cr, {
|
|
1920
1930
|
offers: t.map(({ offer: e, target: t }) => ({
|
|
1921
1931
|
offerId: e.offerId,
|
|
1922
1932
|
label: t.label,
|
|
1923
1933
|
path: t.path
|
|
1924
1934
|
})),
|
|
1925
|
-
hint: t.length === 1 &&
|
|
1926
|
-
onOpen:
|
|
1935
|
+
hint: t.length === 1 && I === "proposal-v1" ? b(n.offer, Z.turnFor(e)) : "link",
|
|
1936
|
+
onOpen: ps
|
|
1927
1937
|
}, n.offer.offerId) : null;
|
|
1928
|
-
},
|
|
1929
|
-
|
|
1930
|
-
let e =
|
|
1938
|
+
}, Ws = (e) => e.role === "assistant" ? Us(e.id) : null;
|
|
1939
|
+
D(() => {
|
|
1940
|
+
let e = Z.nextExpiryInMs(performance.now());
|
|
1931
1941
|
if (e === null) return;
|
|
1932
|
-
let t = window.setTimeout(
|
|
1942
|
+
let t = window.setTimeout(is, e + 1);
|
|
1933
1943
|
return () => window.clearTimeout(t);
|
|
1934
1944
|
}, [
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1945
|
+
Z,
|
|
1946
|
+
ns,
|
|
1947
|
+
is
|
|
1938
1948
|
]);
|
|
1939
|
-
let
|
|
1940
|
-
|
|
1941
|
-
if (
|
|
1942
|
-
let e = window.setTimeout(() =>
|
|
1949
|
+
let Gs = Ca.dialog.view ? xa[Ca.dialog.view.proposalId] : void 0, Ks = zs?.expiresAtMs ?? null;
|
|
1950
|
+
D(() => {
|
|
1951
|
+
if (Ks === null) return;
|
|
1952
|
+
let e = window.setTimeout(() => To((e) => e + 1), Math.max(0, Ks - Date.now()));
|
|
1943
1953
|
return () => window.clearTimeout(e);
|
|
1944
|
-
}, [
|
|
1945
|
-
let
|
|
1954
|
+
}, [Ks, wo]);
|
|
1955
|
+
let qs = O(() => ma.voice.filter((e) => e.id !== Ko && (e.role === "user" || e.role === "assistant")).map((e) => ({
|
|
1946
1956
|
id: e.id,
|
|
1947
1957
|
role: e.role,
|
|
1948
|
-
text:
|
|
1949
|
-
sessionId:
|
|
1958
|
+
text: un(e, ga, N),
|
|
1959
|
+
sessionId: S(e),
|
|
1950
1960
|
timestamp: e.timestamp
|
|
1951
1961
|
})).filter((e) => e.text.length > 0), [
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
]),
|
|
1957
|
-
if (
|
|
1962
|
+
ma.voice,
|
|
1963
|
+
ga,
|
|
1964
|
+
Ko,
|
|
1965
|
+
N
|
|
1966
|
+
]), Js = E(() => {
|
|
1967
|
+
if (qs.length === 0) return;
|
|
1958
1968
|
let e = /* @__PURE__ */ new Date();
|
|
1959
|
-
|
|
1960
|
-
title:
|
|
1961
|
-
savedAt:
|
|
1962
|
-
session:
|
|
1963
|
-
earlier:
|
|
1964
|
-
you:
|
|
1965
|
-
assistant:
|
|
1966
|
-
}, e),
|
|
1969
|
+
Hn(Ye(qs, {
|
|
1970
|
+
title: N("voiceSession.transcript", "Voice conversation"),
|
|
1971
|
+
savedAt: N("voiceSession.savedAt", "Saved"),
|
|
1972
|
+
session: N("voiceSession.sessionLabel", "Session"),
|
|
1973
|
+
earlier: N("voiceSession.earlierLabel", "Earlier"),
|
|
1974
|
+
you: N("voiceSession.speakerYou", "You"),
|
|
1975
|
+
assistant: N("voiceSession.speakerAssistant", "Assistant")
|
|
1976
|
+
}, e), Xe(P, e), "text/markdown");
|
|
1967
1977
|
}, [
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
]),
|
|
1972
|
-
|
|
1973
|
-
let [
|
|
1974
|
-
|
|
1975
|
-
if (
|
|
1976
|
-
let e = window.setTimeout(() =>
|
|
1978
|
+
P,
|
|
1979
|
+
qs,
|
|
1980
|
+
N
|
|
1981
|
+
]), Ys = di({ perFileChars: Xa }), Xs = k(Ys);
|
|
1982
|
+
Xs.current = Ys;
|
|
1983
|
+
let [Zs, Qs] = A(null), $s = Zs === null ? null : N("attachments.voiceDropped", "{{count}} attachment(s) couldn't be saved and weren't sent.", { count: Zs });
|
|
1984
|
+
D(() => {
|
|
1985
|
+
if (Zs === null) return;
|
|
1986
|
+
let e = window.setTimeout(() => Qs(null), Si);
|
|
1977
1987
|
return () => window.clearTimeout(e);
|
|
1978
|
-
}, [
|
|
1979
|
-
let
|
|
1980
|
-
onSubmit:
|
|
1981
|
-
let i =
|
|
1982
|
-
let e =
|
|
1983
|
-
return
|
|
1984
|
-
sessionLive:
|
|
1988
|
+
}, [Zs]);
|
|
1989
|
+
let ec = k(/* @__PURE__ */ new Set()), tc = k(() => !1), $ = yn({
|
|
1990
|
+
onSubmit: E((e, t, n, r) => {
|
|
1991
|
+
let i = oo.current, a = ct(i), o = () => {
|
|
1992
|
+
let e = _.getState();
|
|
1993
|
+
return C({
|
|
1994
|
+
sessionLive: tc.current(t),
|
|
1985
1995
|
boundAtSubmit: i,
|
|
1986
1996
|
activeConversationId: e.activeConversationId,
|
|
1987
1997
|
boundConversationExists: e.conversations.some((e) => e.id === a)
|
|
1988
1998
|
});
|
|
1989
1999
|
}, s = () => {
|
|
1990
|
-
let i =
|
|
1991
|
-
|
|
2000
|
+
let i = Xs.current;
|
|
2001
|
+
kt({
|
|
1992
2002
|
draft: i,
|
|
1993
2003
|
maySend: o,
|
|
1994
|
-
budgetMs:
|
|
2004
|
+
budgetMs: Ot,
|
|
1995
2005
|
sendTurn: (i) => {
|
|
1996
2006
|
let a = {
|
|
1997
2007
|
...n,
|
|
1998
|
-
handedOver:
|
|
2008
|
+
handedOver: hn()
|
|
1999
2009
|
};
|
|
2000
|
-
|
|
2010
|
+
Ps.current(e, i, {
|
|
2001
2011
|
fromPerson: !0,
|
|
2002
2012
|
voiceSessionId: t,
|
|
2003
2013
|
voiceTiming: a,
|
|
2004
2014
|
...r.correction ? { correctsInFlightTurn: !0 } : {}
|
|
2005
2015
|
});
|
|
2006
2016
|
},
|
|
2007
|
-
announceDropped: (e) =>
|
|
2017
|
+
announceDropped: (e) => Qs(e)
|
|
2008
2018
|
});
|
|
2009
2019
|
};
|
|
2010
|
-
if (o() &&
|
|
2011
|
-
|
|
2020
|
+
if (o() && vs.current(e, t)) {
|
|
2021
|
+
Ps.current(e, [], {
|
|
2012
2022
|
fromPerson: !0,
|
|
2013
2023
|
voiceSessionId: t,
|
|
2014
2024
|
voiceTiming: {
|
|
2015
2025
|
...n,
|
|
2016
|
-
handedOver:
|
|
2026
|
+
handedOver: hn()
|
|
2017
2027
|
}
|
|
2018
2028
|
});
|
|
2019
2029
|
return;
|
|
2020
2030
|
}
|
|
2021
|
-
if (!
|
|
2031
|
+
if (!Xs.current.isBusy) {
|
|
2022
2032
|
s();
|
|
2023
2033
|
return;
|
|
2024
2034
|
}
|
|
2025
|
-
let c = Date.now(), l =
|
|
2026
|
-
let e =
|
|
2027
|
-
|
|
2035
|
+
let c = Date.now(), l = ec.current, u = window.setInterval(() => {
|
|
2036
|
+
let e = Xs.current.isBusy;
|
|
2037
|
+
Xs.current.isCommitting || e && Date.now() - c < xi || (window.clearInterval(u), l.delete(u), s());
|
|
2028
2038
|
}, 200);
|
|
2029
2039
|
l.add(u);
|
|
2030
2040
|
}, []),
|
|
2031
|
-
latestReply:
|
|
2032
|
-
language:
|
|
2033
|
-
graceMs:
|
|
2034
|
-
onSupersede:
|
|
2035
|
-
handsFreeStreamNoticeAccepted:
|
|
2036
|
-
onAcceptHandsFreeStreamNotice:
|
|
2037
|
-
handsFreeInterrupt:
|
|
2038
|
-
onBargeIn:
|
|
2041
|
+
latestReply: Fs,
|
|
2042
|
+
language: $e(Hi, z).tag,
|
|
2043
|
+
graceMs: Ri,
|
|
2044
|
+
onSupersede: Ao,
|
|
2045
|
+
handsFreeStreamNoticeAccepted: Bi,
|
|
2046
|
+
onAcceptHandsFreeStreamNotice: Vi,
|
|
2047
|
+
handsFreeInterrupt: zi,
|
|
2048
|
+
onBargeIn: ko
|
|
2039
2049
|
});
|
|
2040
|
-
|
|
2041
|
-
let
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
}, [
|
|
2045
|
-
let
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
]), [
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
}, [
|
|
2053
|
-
let
|
|
2054
|
-
let e =
|
|
2050
|
+
tc.current = $.isCurrentSession;
|
|
2051
|
+
let nc = so ? qs.filter((e) => e.sessionId !== void 0 && $.isCurrentSession(e.sessionId)) : qs, rc = $.answerLocally;
|
|
2052
|
+
D(() => {
|
|
2053
|
+
ws.current = rc;
|
|
2054
|
+
}, [rc]);
|
|
2055
|
+
let ic = $.active, ac = O(() => yt(Object.values(xa), B, Sa), [
|
|
2056
|
+
xa,
|
|
2057
|
+
B,
|
|
2058
|
+
Sa
|
|
2059
|
+
]), [oc, sc] = A(null);
|
|
2060
|
+
D(() => {
|
|
2061
|
+
ic || sc(null);
|
|
2062
|
+
}, [ic]);
|
|
2063
|
+
let cc = Ca.review, lc = E(() => {
|
|
2064
|
+
let e = ac[ac.length - 1];
|
|
2055
2065
|
if (!e) return;
|
|
2056
2066
|
let { view: t } = e;
|
|
2057
|
-
if (
|
|
2058
|
-
|
|
2067
|
+
if (En(t) && Tn(t, ba[e.session.sandboxId]).offerConfirm) {
|
|
2068
|
+
cc(t);
|
|
2059
2069
|
return;
|
|
2060
2070
|
}
|
|
2061
|
-
|
|
2071
|
+
sc(t.proposalId);
|
|
2062
2072
|
}, [
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
]),
|
|
2067
|
-
content: /* @__PURE__ */
|
|
2073
|
+
ac,
|
|
2074
|
+
ba,
|
|
2075
|
+
cc
|
|
2076
|
+
]), uc = ic ? gt(ac) : null, dc = oc ? xa[oc] : void 0, fc = ic && dc && dc.session.conversationId === B ? {
|
|
2077
|
+
content: /* @__PURE__ */ j(kn, {
|
|
2068
2078
|
refs: [{
|
|
2069
|
-
proposalId:
|
|
2070
|
-
sandboxId:
|
|
2071
|
-
sessionId:
|
|
2079
|
+
proposalId: dc.view.proposalId,
|
|
2080
|
+
sandboxId: dc.session.sandboxId,
|
|
2081
|
+
sessionId: dc.session.sessionId
|
|
2072
2082
|
}],
|
|
2073
|
-
conversationId:
|
|
2074
|
-
panel:
|
|
2075
|
-
entries:
|
|
2076
|
-
capabilitiesOf: (e) =>
|
|
2077
|
-
turnInFlight:
|
|
2078
|
-
tr:
|
|
2079
|
-
onReview:
|
|
2080
|
-
retiredSandboxes:
|
|
2083
|
+
conversationId: dc.session.conversationId,
|
|
2084
|
+
panel: W,
|
|
2085
|
+
entries: xa,
|
|
2086
|
+
capabilitiesOf: (e) => ba[e],
|
|
2087
|
+
turnInFlight: _a,
|
|
2088
|
+
tr: N,
|
|
2089
|
+
onReview: cc,
|
|
2090
|
+
retiredSandboxes: Sa
|
|
2081
2091
|
}),
|
|
2082
|
-
closeLabel:
|
|
2083
|
-
onClose: () =>
|
|
2084
|
-
} : null,
|
|
2085
|
-
r("assistant.transcript",
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
])), r("assistant.conversation.new",
|
|
2091
|
-
let e =
|
|
2092
|
+
closeLabel: bt(N, mt.trayClose),
|
|
2093
|
+
onClose: () => sc(null)
|
|
2094
|
+
} : null, pc = Ca.asking, mc = xs?.asking === !0, hc = Ss?.asking === !0, gc = er(), _c = $.holdListening;
|
|
2095
|
+
r("assistant.transcript", O(() => ic || K ? null : { run: () => to ? { status: "already" } : (ao(!0), { status: "done" }) }, [
|
|
2096
|
+
ic,
|
|
2097
|
+
K,
|
|
2098
|
+
to,
|
|
2099
|
+
ao
|
|
2100
|
+
])), r("assistant.conversation.new", O(() => ic ? null : { run: () => {
|
|
2101
|
+
let e = _.getState(), t = e.conversations.find((t) => t.id === e.activeConversationId);
|
|
2092
2102
|
return t && t.messages.length === 0 ? { status: "already" } : (e.createConversation(), { status: "done" });
|
|
2093
|
-
} }, [
|
|
2094
|
-
|
|
2103
|
+
} }, [ic])), D(() => {
|
|
2104
|
+
_c(ic && (pc || mc || hc || gc));
|
|
2095
2105
|
}, [
|
|
2096
|
-
|
|
2097
|
-
dc,
|
|
2098
|
-
fc,
|
|
2106
|
+
ic,
|
|
2099
2107
|
pc,
|
|
2100
2108
|
mc,
|
|
2101
|
-
hc
|
|
2109
|
+
hc,
|
|
2110
|
+
gc,
|
|
2111
|
+
_c
|
|
2102
2112
|
]);
|
|
2103
|
-
let
|
|
2104
|
-
|
|
2105
|
-
if (!
|
|
2106
|
-
|
|
2113
|
+
let vc = k(null), yc = $.announce;
|
|
2114
|
+
D(() => {
|
|
2115
|
+
if (!ic) {
|
|
2116
|
+
vc.current = null;
|
|
2107
2117
|
return;
|
|
2108
2118
|
}
|
|
2109
|
-
let e =
|
|
2119
|
+
let e = vc.current;
|
|
2110
2120
|
if (e === null) {
|
|
2111
|
-
|
|
2121
|
+
vc.current = new Set(Object.keys(xa));
|
|
2112
2122
|
return;
|
|
2113
2123
|
}
|
|
2114
|
-
for (let { view: t, session: n } of
|
|
2124
|
+
for (let { view: t, session: n } of vt(ac, e)) {
|
|
2115
2125
|
e.add(t.proposalId);
|
|
2116
|
-
let r =
|
|
2117
|
-
if (!
|
|
2126
|
+
let r = ba[n.sandboxId];
|
|
2127
|
+
if (!ht({
|
|
2118
2128
|
mode: "api-calls",
|
|
2119
|
-
productWriteApproval:
|
|
2129
|
+
productWriteApproval: I,
|
|
2120
2130
|
capabilities: r
|
|
2121
2131
|
})) continue;
|
|
2122
|
-
let i =
|
|
2123
|
-
|
|
2132
|
+
let i = xt(t, Tn(t, r).offerConfirm, N), a = t.proposalId;
|
|
2133
|
+
yc({
|
|
2124
2134
|
id: `write-readback:${a}`,
|
|
2125
2135
|
text: i.text,
|
|
2126
|
-
lang: i.translated ?
|
|
2127
|
-
stillWanted: () =>
|
|
2136
|
+
lang: i.translated ? z : "en",
|
|
2137
|
+
stillWanted: () => W.entry(a)?.view.status === "pending"
|
|
2128
2138
|
});
|
|
2129
2139
|
}
|
|
2130
2140
|
}, [
|
|
2131
|
-
|
|
2132
|
-
|
|
2141
|
+
ic,
|
|
2142
|
+
ac,
|
|
2143
|
+
xa,
|
|
2133
2144
|
ba,
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
U
|
|
2145
|
+
I,
|
|
2146
|
+
N,
|
|
2147
|
+
z,
|
|
2148
|
+
yc,
|
|
2149
|
+
W
|
|
2140
2150
|
]);
|
|
2141
|
-
let
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
}, [$.active]),
|
|
2145
|
-
if (!
|
|
2146
|
-
let t =
|
|
2147
|
-
return typeof t == "string" ? t === e :
|
|
2151
|
+
let bc = k(!1);
|
|
2152
|
+
D(() => {
|
|
2153
|
+
bc.current = $.active;
|
|
2154
|
+
}, [$.active]), D(() => ie((e) => {
|
|
2155
|
+
if (!bc.current) return !1;
|
|
2156
|
+
let t = oo.current;
|
|
2157
|
+
return typeof t == "string" ? t === e : _.getState().activeConversationId === e;
|
|
2148
2158
|
}), []);
|
|
2149
|
-
let
|
|
2150
|
-
let e =
|
|
2151
|
-
|
|
2159
|
+
let xc = $.start, Sc = E(() => {
|
|
2160
|
+
let e = _.getState().activeConversationId, t = at(uo());
|
|
2161
|
+
lo(st(t, e)), xo(!0, t.kind === "own"), xc();
|
|
2152
2162
|
}, [
|
|
2153
|
-
co,
|
|
2154
|
-
bo,
|
|
2155
2163
|
lo,
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
let
|
|
2161
|
-
|
|
2164
|
+
xo,
|
|
2165
|
+
uo,
|
|
2166
|
+
xc
|
|
2167
|
+
]), Cc = O(() => ln(U?.messages ?? []), [U?.messages]), wc = cn(ma.voice, ga, N), Tc = cn(Cc, ga, N) > 0, Ec = E(() => {
|
|
2168
|
+
let e = _.getState().activeConversationId;
|
|
2169
|
+
if (!e || qs.length === 0) return;
|
|
2170
|
+
let t = new Set(Cc.map((e) => e.id)), n = M();
|
|
2171
|
+
H(e, {
|
|
2162
2172
|
id: n,
|
|
2163
2173
|
role: "system",
|
|
2164
|
-
content:
|
|
2165
|
-
intro:
|
|
2166
|
-
nothing:
|
|
2167
|
-
more: (e) =>
|
|
2174
|
+
content: Je(qs.filter((e) => t.has(e.id)), {
|
|
2175
|
+
intro: N("voiceSession.continuedIntro", "Continued from a voice conversation. You asked about:"),
|
|
2176
|
+
nothing: N("voiceSession.continuedNothing", "Continued from a voice conversation."),
|
|
2177
|
+
more: (e) => N("voiceSession.continuedMore", "…and {{count}} more", { count: e })
|
|
2168
2178
|
}),
|
|
2169
2179
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2170
|
-
metadata: { continuedVoiceTurns:
|
|
2171
|
-
}),
|
|
2180
|
+
metadata: { continuedVoiceTurns: wc }
|
|
2181
|
+
}), Jn.recordCommittedEntries(e, [n], "NOTE", w()), ao(!1), $.end(), ro();
|
|
2172
2182
|
}, [
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2183
|
+
qs,
|
|
2184
|
+
wc,
|
|
2185
|
+
Cc,
|
|
2186
|
+
H,
|
|
2187
|
+
N,
|
|
2178
2188
|
$,
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
]),
|
|
2189
|
+
ao,
|
|
2190
|
+
ro
|
|
2191
|
+
]), Dc = k({
|
|
2182
2192
|
conversationId: null,
|
|
2183
2193
|
count: 0
|
|
2184
2194
|
});
|
|
2185
|
-
|
|
2186
|
-
$.active && (
|
|
2187
|
-
conversationId:
|
|
2188
|
-
count:
|
|
2195
|
+
D(() => {
|
|
2196
|
+
$.active && (Dc.current = {
|
|
2197
|
+
conversationId: B,
|
|
2198
|
+
count: wc
|
|
2189
2199
|
});
|
|
2190
2200
|
}, [$.active]);
|
|
2191
|
-
let
|
|
2192
|
-
let e =
|
|
2193
|
-
$.end(), t &&
|
|
2201
|
+
let Oc = E(() => {
|
|
2202
|
+
let e = Dc.current, t = wc > (e.conversationId === B ? e.count : 0);
|
|
2203
|
+
$.end(), t && ao(!0);
|
|
2194
2204
|
}, [
|
|
2195
|
-
|
|
2196
|
-
|
|
2205
|
+
B,
|
|
2206
|
+
wc,
|
|
2197
2207
|
$,
|
|
2198
|
-
|
|
2208
|
+
ao
|
|
2199
2209
|
]);
|
|
2200
|
-
|
|
2201
|
-
(!
|
|
2210
|
+
D(() => {
|
|
2211
|
+
(!Oi || !_o) && $.active && $.end();
|
|
2202
2212
|
}, [
|
|
2203
|
-
|
|
2204
|
-
|
|
2213
|
+
Oi,
|
|
2214
|
+
_o,
|
|
2205
2215
|
$
|
|
2206
2216
|
]);
|
|
2207
|
-
let [
|
|
2217
|
+
let [kc, Ac] = A(wi), jc = ur({
|
|
2208
2218
|
available: $.available,
|
|
2209
|
-
allowedInMode:
|
|
2210
|
-
readOnly:
|
|
2211
|
-
busy:
|
|
2212
|
-
committing:
|
|
2213
|
-
dictating:
|
|
2214
|
-
}),
|
|
2215
|
-
|
|
2216
|
-
|
|
2219
|
+
allowedInMode: _o,
|
|
2220
|
+
readOnly: Ea,
|
|
2221
|
+
busy: _a || Co !== null || Oa || Qo,
|
|
2222
|
+
committing: kc.committing,
|
|
2223
|
+
dictating: kc.dictating
|
|
2224
|
+
}), Mc = Tt(), [Nc, Pc] = A(null);
|
|
2225
|
+
D(() => {
|
|
2226
|
+
Nc !== null && (!K || Nc.conversationId !== B) && Pc(null);
|
|
2217
2227
|
}, [
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2228
|
+
K,
|
|
2229
|
+
B,
|
|
2230
|
+
Nc
|
|
2221
2231
|
]);
|
|
2222
|
-
let
|
|
2223
|
-
|
|
2232
|
+
let Fc = Nc !== null && Po === Nc.replyId, Ic = k(!1), Lc = E(() => {
|
|
2233
|
+
Ic.current = !0, Fc && Fo(), Sc();
|
|
2224
2234
|
}, [
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2235
|
+
Sc,
|
|
2236
|
+
Fc,
|
|
2237
|
+
Fo
|
|
2228
2238
|
]);
|
|
2229
|
-
|
|
2230
|
-
$.active || (
|
|
2231
|
-
}, [$.active]),
|
|
2232
|
-
|
|
2239
|
+
D(() => {
|
|
2240
|
+
$.active || (Ic.current = !1);
|
|
2241
|
+
}, [$.active]), D(() => {
|
|
2242
|
+
K || !Ic.current || (Ic.current = !1, $.active && Oc());
|
|
2233
2243
|
}, [
|
|
2234
|
-
|
|
2244
|
+
K,
|
|
2235
2245
|
$.active,
|
|
2236
|
-
|
|
2237
|
-
]),
|
|
2238
|
-
|
|
2239
|
-
}, [
|
|
2240
|
-
let
|
|
2246
|
+
Oc
|
|
2247
|
+
]), D(() => {
|
|
2248
|
+
K && ao(!1);
|
|
2249
|
+
}, [K, ao]);
|
|
2250
|
+
let Rc = O(() => ({
|
|
2241
2251
|
live: $.active,
|
|
2242
|
-
blocked:
|
|
2243
|
-
impossible:
|
|
2244
|
-
start:
|
|
2252
|
+
blocked: jc === null ? null : Mc.voiceStartBlocked(jc),
|
|
2253
|
+
impossible: dr(jc),
|
|
2254
|
+
start: Lc
|
|
2245
2255
|
}), [
|
|
2246
2256
|
$.active,
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
]), [
|
|
2257
|
+
jc,
|
|
2258
|
+
Mc,
|
|
2259
|
+
Lc
|
|
2260
|
+
]), [zc, Bc] = A("mini"), Vc = Oi && G.covered !== !0 && !($.active && zc !== "mini") && !(to && !$.active) && !(pc || mc || hc || gc), Hc = no?.ask, Uc = _i(Hc?.subscribe ?? Ei, Hc?.getSnapshot ?? Di, Hc?.getSnapshot ?? Di), Wc = fr({
|
|
2251
2261
|
voiceLive: $.active,
|
|
2252
|
-
readOnly:
|
|
2253
|
-
writes:
|
|
2254
|
-
auto:
|
|
2255
|
-
selectedMode:
|
|
2256
|
-
conversation:
|
|
2257
|
-
mode:
|
|
2258
|
-
routedBy:
|
|
2259
|
-
hasHistory:
|
|
2262
|
+
readOnly: Ea,
|
|
2263
|
+
writes: pr({
|
|
2264
|
+
auto: Wa,
|
|
2265
|
+
selectedMode: V,
|
|
2266
|
+
conversation: U && !Ea ? {
|
|
2267
|
+
mode: U.mode,
|
|
2268
|
+
routedBy: U.routedBy,
|
|
2269
|
+
hasHistory: Un(U)
|
|
2260
2270
|
} : null,
|
|
2261
|
-
modeWrites: (e) =>
|
|
2271
|
+
modeWrites: (e) => F.find((t) => t.id === e)?.writeCapable === !0 || xe(e)
|
|
2262
2272
|
}),
|
|
2263
|
-
avatar:
|
|
2264
|
-
busy:
|
|
2265
|
-
committing:
|
|
2266
|
-
}),
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
}, [
|
|
2270
|
-
let
|
|
2273
|
+
avatar: Uc,
|
|
2274
|
+
busy: _a || Co !== null || Oa || Qo || Za !== null || Ja,
|
|
2275
|
+
committing: kc.committing
|
|
2276
|
+
}), Gc = k(Wc);
|
|
2277
|
+
gi(() => {
|
|
2278
|
+
Gc.current = Wc;
|
|
2279
|
+
}, [Wc]);
|
|
2280
|
+
let Kc = E((e) => {
|
|
2271
2281
|
let t = e.trim();
|
|
2272
|
-
if (t === "" ||
|
|
2273
|
-
|
|
2282
|
+
if (t === "" || Gc.current !== null) return { accepted: !1 };
|
|
2283
|
+
Fc && Fo();
|
|
2274
2284
|
let n = {
|
|
2275
|
-
token:
|
|
2285
|
+
token: M(),
|
|
2276
2286
|
exchange: null,
|
|
2277
2287
|
handled: !1
|
|
2278
2288
|
};
|
|
2279
|
-
|
|
2289
|
+
Io.current = n;
|
|
2280
2290
|
try {
|
|
2281
|
-
|
|
2291
|
+
Q(t, [], {
|
|
2282
2292
|
fromPerson: !0,
|
|
2283
2293
|
avatarTabAsk: n.token,
|
|
2284
2294
|
localRecordsChecked: !0,
|
|
2285
|
-
...
|
|
2295
|
+
...Wa ? { autoIntent: "read" } : {}
|
|
2286
2296
|
});
|
|
2287
2297
|
} finally {
|
|
2288
|
-
|
|
2298
|
+
Io.current = null;
|
|
2289
2299
|
}
|
|
2290
2300
|
let r = n.exchange;
|
|
2291
2301
|
return r === null ? n.handled ? {
|
|
2292
2302
|
accepted: !0,
|
|
2293
2303
|
recorded: !1
|
|
2294
|
-
} : { accepted: !1 } : (
|
|
2304
|
+
} : { accepted: !1 } : (Pc(r), {
|
|
2295
2305
|
accepted: !0,
|
|
2296
2306
|
recorded: !0,
|
|
2297
2307
|
...r
|
|
2298
2308
|
});
|
|
2299
2309
|
}, [
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
]), [
|
|
2305
|
-
blocker:
|
|
2306
|
-
line:
|
|
2307
|
-
send:
|
|
2308
|
-
last:
|
|
2309
|
-
navigatingReplyId:
|
|
2310
|
-
draft:
|
|
2310
|
+
Wa,
|
|
2311
|
+
Q,
|
|
2312
|
+
Fo,
|
|
2313
|
+
Fc
|
|
2314
|
+
]), [qc] = A(() => hr()), Jc = O(() => ({
|
|
2315
|
+
blocker: Wc,
|
|
2316
|
+
line: mr(Wc, jc),
|
|
2317
|
+
send: Kc,
|
|
2318
|
+
last: Nc,
|
|
2319
|
+
navigatingReplyId: es,
|
|
2320
|
+
draft: qc
|
|
2311
2321
|
}), [
|
|
2312
|
-
Hc,
|
|
2313
|
-
kc,
|
|
2314
2322
|
Wc,
|
|
2315
2323
|
jc,
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2324
|
+
Kc,
|
|
2325
|
+
Nc,
|
|
2326
|
+
es,
|
|
2327
|
+
qc
|
|
2328
|
+
]), Yc = G.setReplyEscape, Xc = K && Vc && Fc;
|
|
2329
|
+
D(() => {
|
|
2330
|
+
if (!(!Yc || !Xc)) return Yc(Fo), () => Yc(null);
|
|
2321
2331
|
}, [
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
]),
|
|
2326
|
-
let e =
|
|
2332
|
+
Yc,
|
|
2333
|
+
Xc,
|
|
2334
|
+
Fo
|
|
2335
|
+
]), D(() => {
|
|
2336
|
+
let e = oo.current, t = ct(e), n = _.getState(), r = it({
|
|
2327
2337
|
sessionLive: $.active,
|
|
2328
2338
|
bound: e,
|
|
2329
2339
|
activeConversationId: n.activeConversationId,
|
|
2330
2340
|
boundConversationExists: n.conversations.some((e) => e.id === t)
|
|
2331
2341
|
});
|
|
2332
|
-
|
|
2342
|
+
lo(r.bound), r.end && $.end();
|
|
2333
2343
|
}, [
|
|
2334
2344
|
$,
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2345
|
+
B,
|
|
2346
|
+
Ji,
|
|
2347
|
+
lo
|
|
2338
2348
|
]);
|
|
2339
|
-
let
|
|
2340
|
-
|
|
2341
|
-
let e =
|
|
2342
|
-
activeConversationId:
|
|
2343
|
-
chatTurnCount:
|
|
2344
|
-
voiceTurnCount:
|
|
2349
|
+
let Zc = k(tt);
|
|
2350
|
+
D(() => {
|
|
2351
|
+
let e = rt(Zc.current, {
|
|
2352
|
+
activeConversationId: B,
|
|
2353
|
+
chatTurnCount: Ls.length,
|
|
2354
|
+
voiceTurnCount: qs.length,
|
|
2345
2355
|
sessionLive: $.active,
|
|
2346
|
-
sessionBoundTo:
|
|
2347
|
-
turnInFlight:
|
|
2356
|
+
sessionBoundTo: oo.current,
|
|
2357
|
+
turnInFlight: _a
|
|
2348
2358
|
});
|
|
2349
|
-
|
|
2359
|
+
Zc.current = e.state, e.open && ao(!0);
|
|
2350
2360
|
}, [
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2361
|
+
B,
|
|
2362
|
+
Ls.length,
|
|
2363
|
+
qs.length,
|
|
2354
2364
|
$.active,
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
]),
|
|
2365
|
+
_a,
|
|
2366
|
+
ao
|
|
2367
|
+
]), D(() => {
|
|
2358
2368
|
if (!$.active) {
|
|
2359
|
-
|
|
2360
|
-
for (let e of
|
|
2361
|
-
|
|
2369
|
+
Xs.current.clear(), Qs(null), Do.current = null;
|
|
2370
|
+
for (let e of ec.current) window.clearInterval(e);
|
|
2371
|
+
ec.current.clear();
|
|
2362
2372
|
}
|
|
2363
|
-
}, [$.active]),
|
|
2364
|
-
let e =
|
|
2373
|
+
}, [$.active]), D(() => {
|
|
2374
|
+
let e = ec.current;
|
|
2365
2375
|
return () => {
|
|
2366
2376
|
for (let t of e) window.clearInterval(t);
|
|
2367
2377
|
e.clear();
|
|
2368
2378
|
};
|
|
2369
|
-
}, []),
|
|
2370
|
-
let e =
|
|
2371
|
-
return e &&
|
|
2379
|
+
}, []), D(() => {
|
|
2380
|
+
let e = _.getState().consumePendingPrompt();
|
|
2381
|
+
return e && Ps.current(e), _.subscribe((e, t) => {
|
|
2372
2382
|
if (e.pendingPrompt && e.pendingPrompt !== t.pendingPrompt) {
|
|
2373
|
-
let e =
|
|
2374
|
-
e &&
|
|
2383
|
+
let e = _.getState().consumePendingPrompt();
|
|
2384
|
+
e && Ps.current(e);
|
|
2375
2385
|
}
|
|
2376
2386
|
});
|
|
2377
2387
|
}, []);
|
|
2378
|
-
let
|
|
2379
|
-
let t =
|
|
2380
|
-
if (t && t.mode !== e &&
|
|
2388
|
+
let Qc = E((e) => {
|
|
2389
|
+
let t = B ? _.getState().conversations.find((e) => e.id === B) : void 0;
|
|
2390
|
+
if (t && t.mode !== e && W.withdraw(t.id, "mode_switched"), t && Un(t)) {
|
|
2381
2391
|
if (t.mode !== e) {
|
|
2382
|
-
let t =
|
|
2383
|
-
n ?
|
|
2392
|
+
let t = re(), n = _.getState().conversations.find((n) => n.mode === e && Kn(n, t) && !_.getState().processingByConversationId[n.id]);
|
|
2393
|
+
n ? Qi(n.id) : $i(void 0, e);
|
|
2384
2394
|
}
|
|
2385
|
-
} else
|
|
2386
|
-
let n =
|
|
2387
|
-
n ?
|
|
2395
|
+
} else B && Zi(B, e);
|
|
2396
|
+
let n = _.getState().activeConversationId;
|
|
2397
|
+
n ? Zi(n, e) : fa(!1), Xi(e);
|
|
2388
2398
|
}, [
|
|
2389
|
-
|
|
2399
|
+
B,
|
|
2400
|
+
$i,
|
|
2390
2401
|
Qi,
|
|
2402
|
+
fa,
|
|
2391
2403
|
Zi,
|
|
2392
|
-
da,
|
|
2393
2404
|
Xi,
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
let e = g.getState(), t = e.activeConversationId ? e.conversations.find((t) => t.id === e.activeConversationId) : void 0;
|
|
2405
|
+
W
|
|
2406
|
+
]), $c = E(() => {
|
|
2407
|
+
let e = _.getState(), t = e.activeConversationId ? e.conversations.find((t) => t.id === e.activeConversationId) : void 0;
|
|
2398
2408
|
if (!t) {
|
|
2399
|
-
|
|
2409
|
+
fa(!0), Xi(d);
|
|
2400
2410
|
return;
|
|
2401
2411
|
}
|
|
2402
2412
|
if (t.routedBy === "auto") {
|
|
2403
|
-
|
|
2413
|
+
fa(!0);
|
|
2404
2414
|
return;
|
|
2405
2415
|
}
|
|
2406
|
-
if (!
|
|
2407
|
-
|
|
2416
|
+
if (!Un(t)) {
|
|
2417
|
+
pa(t.id, d);
|
|
2408
2418
|
return;
|
|
2409
2419
|
}
|
|
2410
|
-
|
|
2411
|
-
let n =
|
|
2412
|
-
r ? (
|
|
2420
|
+
W.withdraw(t.id, "mode_switched");
|
|
2421
|
+
let n = re(), r = e.conversations.find((t) => t.routedBy === "auto" && Kn(t, n) && !e.processingByConversationId[t.id]);
|
|
2422
|
+
r ? (Qi(r.id), pa(r.id, d)) : $i(void 0, d, { routedBy: "auto" });
|
|
2413
2423
|
}, [
|
|
2424
|
+
$i,
|
|
2425
|
+
pa,
|
|
2414
2426
|
Qi,
|
|
2415
2427
|
fa,
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
if (P.find((t) => t.id === e)?.writeCapable && !ce(g.getState().acknowledgedWriteModes, e)) {
|
|
2422
|
-
Za(e);
|
|
2428
|
+
Xi,
|
|
2429
|
+
W
|
|
2430
|
+
]), el = E((e) => {
|
|
2431
|
+
if (F.find((t) => t.id === e)?.writeCapable && !ue(_.getState().acknowledgedWriteModes, e)) {
|
|
2432
|
+
Qa(e);
|
|
2423
2433
|
return;
|
|
2424
2434
|
}
|
|
2425
|
-
|
|
2426
|
-
}, [
|
|
2427
|
-
let e =
|
|
2428
|
-
if (
|
|
2429
|
-
let t =
|
|
2430
|
-
if (
|
|
2431
|
-
|
|
2435
|
+
Qc(e);
|
|
2436
|
+
}, [Qc, F]), tl = E(() => {
|
|
2437
|
+
let e = Za;
|
|
2438
|
+
if (Qa(null), !e) return;
|
|
2439
|
+
let t = Ka.current;
|
|
2440
|
+
if (Ka.current = null, t) {
|
|
2441
|
+
ua(e), Q(t.content, t.attachments, t.options);
|
|
2432
2442
|
return;
|
|
2433
2443
|
}
|
|
2434
|
-
|
|
2444
|
+
ua(e), Qc(e);
|
|
2435
2445
|
}, [
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
]),
|
|
2441
|
-
|
|
2442
|
-
let e =
|
|
2443
|
-
|
|
2446
|
+
Za,
|
|
2447
|
+
ua,
|
|
2448
|
+
Qc,
|
|
2449
|
+
Q
|
|
2450
|
+
]), nl = Za === null ? void 0 : F.find((e) => e.id === Za) ?? { id: Za }, rl = E(() => {
|
|
2451
|
+
Qa(null);
|
|
2452
|
+
let e = Ka.current;
|
|
2453
|
+
Ka.current = null, e && Q(e.content, e.attachments, {
|
|
2444
2454
|
...e.options,
|
|
2445
2455
|
autoIntent: "read"
|
|
2446
2456
|
});
|
|
2447
|
-
}, [
|
|
2448
|
-
return /* @__PURE__ */
|
|
2457
|
+
}, [Q]);
|
|
2458
|
+
return /* @__PURE__ */ vi("div", {
|
|
2449
2459
|
className: "relative flex flex-1 flex-col overflow-hidden",
|
|
2450
2460
|
children: [
|
|
2451
|
-
/* @__PURE__ */
|
|
2461
|
+
/* @__PURE__ */ vi("div", {
|
|
2452
2462
|
className: "contents",
|
|
2453
|
-
inert: $.active ||
|
|
2454
|
-
...
|
|
2463
|
+
inert: $.active || K || void 0,
|
|
2464
|
+
...G.ids ? {
|
|
2455
2465
|
role: "tabpanel",
|
|
2456
|
-
id:
|
|
2457
|
-
"aria-labelledby":
|
|
2466
|
+
id: G.ids.chatPanel,
|
|
2467
|
+
"aria-labelledby": G.ids.chatTab
|
|
2458
2468
|
} : {},
|
|
2459
2469
|
children: [
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
count:
|
|
2463
|
-
onOpenTranscript: () =>
|
|
2470
|
+
Na === null ? null : /* @__PURE__ */ j(Ln, { onDismiss: () => Ma(Na) }),
|
|
2471
|
+
qs.length > 0 && !$.active ? /* @__PURE__ */ j(Fn, {
|
|
2472
|
+
count: qs.length,
|
|
2473
|
+
onOpenTranscript: () => ao(!0)
|
|
2464
2474
|
}) : null,
|
|
2465
|
-
|
|
2466
|
-
state:
|
|
2467
|
-
onRetry:
|
|
2468
|
-
}) :
|
|
2475
|
+
Ls.length === 0 && (Oa || ka) ? /* @__PURE__ */ j(Rn, {
|
|
2476
|
+
state: Oa ? "loading" : "failed",
|
|
2477
|
+
onRetry: Ra
|
|
2478
|
+
}) : Ls.length === 0 && U?.sync?.hasOlder ? /* @__PURE__ */ j("div", {
|
|
2469
2479
|
className: "flex min-h-0 flex-1 flex-col",
|
|
2470
|
-
children: /* @__PURE__ */
|
|
2471
|
-
onShowEarlier:
|
|
2472
|
-
disabled:
|
|
2480
|
+
children: /* @__PURE__ */ j(Bn, {
|
|
2481
|
+
onShowEarlier: za,
|
|
2482
|
+
disabled: Oa
|
|
2473
2483
|
})
|
|
2474
|
-
}) :
|
|
2475
|
-
mode:
|
|
2476
|
-
onSuggestionClick:
|
|
2477
|
-
explainsAuto:
|
|
2478
|
-
suggestions:
|
|
2479
|
-
}) : /* @__PURE__ */
|
|
2484
|
+
}) : Ls.length === 0 ? /* @__PURE__ */ j(Yn, {
|
|
2485
|
+
mode: V,
|
|
2486
|
+
onSuggestionClick: js,
|
|
2487
|
+
explainsAuto: Wa,
|
|
2488
|
+
suggestions: Wa && V === "assistant" ? f(F.find((e) => e.id === "assistant")?.suggestions ?? [], F.find((e) => e.id === "api-calls")?.suggestions ?? []) : void 0
|
|
2489
|
+
}) : /* @__PURE__ */ vi("div", {
|
|
2480
2490
|
className: "flex min-h-0 flex-1 flex-col",
|
|
2481
|
-
children: [
|
|
2482
|
-
onShowEarlier:
|
|
2483
|
-
disabled:
|
|
2484
|
-
}) : null, /* @__PURE__ */
|
|
2485
|
-
onApprovePendingWrite:
|
|
2486
|
-
approvingWriteRef:
|
|
2487
|
-
approvableMessageId:
|
|
2488
|
-
retryableMessageId:
|
|
2489
|
-
messages:
|
|
2490
|
-
processing:
|
|
2491
|
-
streamingMessageId:
|
|
2492
|
-
failedMessageId:
|
|
2493
|
-
onRetry:
|
|
2494
|
-
renderWriteProposals:
|
|
2495
|
-
hidesLegacyWriteCard:
|
|
2496
|
-
renderUiOffers:
|
|
2491
|
+
children: [U?.sync?.hasOlder ? /* @__PURE__ */ j(Bn, {
|
|
2492
|
+
onShowEarlier: za,
|
|
2493
|
+
disabled: Oa
|
|
2494
|
+
}) : null, /* @__PURE__ */ j(sr, {
|
|
2495
|
+
onApprovePendingWrite: jo,
|
|
2496
|
+
approvingWriteRef: Co,
|
|
2497
|
+
approvableMessageId: zs?.messageId ?? null,
|
|
2498
|
+
retryableMessageId: Bs,
|
|
2499
|
+
messages: Ls,
|
|
2500
|
+
processing: ga ?? null,
|
|
2501
|
+
streamingMessageId: va,
|
|
2502
|
+
failedMessageId: ya,
|
|
2503
|
+
onRetry: Co === null ? Ns : void 0,
|
|
2504
|
+
renderWriteProposals: Hs,
|
|
2505
|
+
hidesLegacyWriteCard: Vs,
|
|
2506
|
+
renderUiOffers: Ws
|
|
2497
2507
|
})]
|
|
2498
2508
|
}),
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
tr:
|
|
2503
|
-
onDismiss: () =>
|
|
2509
|
+
Ea ? /* @__PURE__ */ j(zn, { onStartNew: () => $i() }) : null,
|
|
2510
|
+
Da && B ? /* @__PURE__ */ j(In, { onUnarchive: () => Jn.updateConversation(B, { archived: !1 }) }) : null,
|
|
2511
|
+
Ts === null ? null : /* @__PURE__ */ j(Xn, {
|
|
2512
|
+
tr: N,
|
|
2513
|
+
onDismiss: () => Es(null)
|
|
2504
2514
|
}),
|
|
2505
|
-
|
|
2506
|
-
state:
|
|
2507
|
-
onRetry:
|
|
2515
|
+
Ls.length > 0 && (Oa || ka) ? /* @__PURE__ */ j(Rn, {
|
|
2516
|
+
state: Oa ? "loading" : "failed",
|
|
2517
|
+
onRetry: Ra,
|
|
2508
2518
|
compact: !0
|
|
2509
2519
|
}) : null,
|
|
2510
|
-
/* @__PURE__ */
|
|
2511
|
-
onStartVoiceSession: $.available &&
|
|
2512
|
-
onSend: (e, t) => void
|
|
2513
|
-
onDraftStart:
|
|
2514
|
-
disabled:
|
|
2515
|
-
readOnly:
|
|
2516
|
-
placeholder:
|
|
2517
|
-
mode:
|
|
2518
|
-
writeAccessDenied:
|
|
2519
|
-
availableModes:
|
|
2520
|
-
attachmentCharsPerFile:
|
|
2521
|
-
onModeChange:
|
|
2522
|
-
auto:
|
|
2523
|
-
active:
|
|
2524
|
-
onSelect:
|
|
2520
|
+
/* @__PURE__ */ j(fi, {
|
|
2521
|
+
onStartVoiceSession: $.available && _o ? Sc : void 0,
|
|
2522
|
+
onSend: (e, t) => void Q(e, t, { fromPerson: !0 }),
|
|
2523
|
+
onDraftStart: So,
|
|
2524
|
+
disabled: _a || Co !== null || Oa || Qo,
|
|
2525
|
+
readOnly: Ea,
|
|
2526
|
+
placeholder: V === "api-calls" ? N("chatArea.placeholderActions", "What would you like me to do?") : N("chatArea.placeholderGeneral", "Ask me anything…"),
|
|
2527
|
+
mode: V,
|
|
2528
|
+
writeAccessDenied: ki === "denied" && !!mo?.writeCapable,
|
|
2529
|
+
availableModes: Ha,
|
|
2530
|
+
attachmentCharsPerFile: Xa,
|
|
2531
|
+
onModeChange: el,
|
|
2532
|
+
auto: Ua ? {
|
|
2533
|
+
active: Wa,
|
|
2534
|
+
onSelect: $c
|
|
2525
2535
|
} : void 0,
|
|
2526
|
-
suspendDictation:
|
|
2527
|
-
onVoiceStateChange:
|
|
2536
|
+
suspendDictation: K,
|
|
2537
|
+
onVoiceStateChange: G.ids ? Ac : void 0
|
|
2528
2538
|
})
|
|
2529
2539
|
]
|
|
2530
2540
|
}),
|
|
2531
|
-
|
|
2532
|
-
turns:
|
|
2533
|
-
onClose: () =>
|
|
2534
|
-
onSave:
|
|
2535
|
-
onContinueInChat:
|
|
2541
|
+
to && !$.active ? /* @__PURE__ */ j(Vn, {
|
|
2542
|
+
turns: qs,
|
|
2543
|
+
onClose: () => ao(!1),
|
|
2544
|
+
onSave: Js,
|
|
2545
|
+
onContinueInChat: Tc ? Ec : void 0,
|
|
2536
2546
|
closeOnEscape: !0,
|
|
2537
|
-
onShowEarlier:
|
|
2538
|
-
showEarlierDisabled:
|
|
2539
|
-
renderAfterTurn:
|
|
2547
|
+
onShowEarlier: U?.sync?.hasOlder ? za : void 0,
|
|
2548
|
+
showEarlierDisabled: Oa,
|
|
2549
|
+
renderAfterTurn: Us
|
|
2540
2550
|
}) : null,
|
|
2541
|
-
|
|
2542
|
-
tab:
|
|
2543
|
-
id:
|
|
2544
|
-
labelledBy:
|
|
2545
|
-
leaveHintId:
|
|
2546
|
-
shown:
|
|
2547
|
-
voice:
|
|
2548
|
-
...
|
|
2551
|
+
K && no && G.ids ? /* @__PURE__ */ j(gr, {
|
|
2552
|
+
tab: no,
|
|
2553
|
+
id: G.ids.avatarPanel,
|
|
2554
|
+
labelledBy: G.ids.avatarTab,
|
|
2555
|
+
leaveHintId: G.ids.leaveHint,
|
|
2556
|
+
shown: Vc,
|
|
2557
|
+
voice: Rc,
|
|
2558
|
+
...Hc ? { ask: Jc } : {}
|
|
2549
2559
|
}) : null,
|
|
2550
|
-
$.active && /* @__PURE__ */
|
|
2560
|
+
$.active && /* @__PURE__ */ j(lr, {
|
|
2551
2561
|
session: $.session,
|
|
2552
2562
|
notice: $.notice,
|
|
2553
2563
|
privacyNotice: $.handsFree.privacyNotice,
|
|
@@ -2558,50 +2568,50 @@ var Ti = () => () => {}, Ei = () => "off", Di = ({ visible: Di = !0, writeAccess
|
|
|
2558
2568
|
correcting: $.correcting,
|
|
2559
2569
|
onLetMeFinish: $.letMeFinish,
|
|
2560
2570
|
onImDone: $.imDone,
|
|
2561
|
-
turns:
|
|
2571
|
+
turns: nc,
|
|
2562
2572
|
spokenChunks: $.spokenChunks,
|
|
2563
|
-
attachments:
|
|
2564
|
-
onAttachFiles:
|
|
2565
|
-
onRemoveAttachment:
|
|
2566
|
-
onRetryAttachment:
|
|
2567
|
-
canAttachMore:
|
|
2568
|
-
preparingAttachments:
|
|
2569
|
-
attachmentsLocked:
|
|
2570
|
-
attachmentNotice:
|
|
2571
|
-
onSaveTranscript:
|
|
2572
|
-
onContinueInChat:
|
|
2573
|
+
attachments: Ys.attachments,
|
|
2574
|
+
onAttachFiles: Ys.addFiles,
|
|
2575
|
+
onRemoveAttachment: Ys.remove,
|
|
2576
|
+
onRetryAttachment: Ys.retry,
|
|
2577
|
+
canAttachMore: Ys.canAddMore,
|
|
2578
|
+
preparingAttachments: Ys.preparingCount,
|
|
2579
|
+
attachmentsLocked: Ys.isCommitting,
|
|
2580
|
+
attachmentNotice: $s,
|
|
2581
|
+
onSaveTranscript: Js,
|
|
2582
|
+
onContinueInChat: Ec,
|
|
2573
2583
|
onInterrupt: () => {
|
|
2574
|
-
$.interrupt(),
|
|
2584
|
+
$.interrupt(), ko();
|
|
2575
2585
|
},
|
|
2576
|
-
spoken:
|
|
2586
|
+
spoken: Is,
|
|
2577
2587
|
onToggleMute: $.toggleMute,
|
|
2578
|
-
onEnd:
|
|
2579
|
-
proposalChip:
|
|
2580
|
-
label:
|
|
2581
|
-
onOpen:
|
|
2588
|
+
onEnd: Oc,
|
|
2589
|
+
proposalChip: uc ? {
|
|
2590
|
+
label: _t(uc, N),
|
|
2591
|
+
onOpen: lc
|
|
2582
2592
|
} : null,
|
|
2583
|
-
proposalTray:
|
|
2584
|
-
renderAfterTurn:
|
|
2585
|
-
onViewChange:
|
|
2593
|
+
proposalTray: fc,
|
|
2594
|
+
renderAfterTurn: Us,
|
|
2595
|
+
onViewChange: G.ids ? Bc : void 0
|
|
2586
2596
|
}),
|
|
2587
|
-
/* @__PURE__ */
|
|
2588
|
-
open:
|
|
2589
|
-
mode:
|
|
2590
|
-
currentMode:
|
|
2591
|
-
onConfirm:
|
|
2592
|
-
onCancel:
|
|
2597
|
+
/* @__PURE__ */ j(mi, {
|
|
2598
|
+
open: Za !== null,
|
|
2599
|
+
mode: nl,
|
|
2600
|
+
currentMode: mo ?? { id: V },
|
|
2601
|
+
onConfirm: tl,
|
|
2602
|
+
onCancel: rl
|
|
2593
2603
|
}),
|
|
2594
|
-
/* @__PURE__ */
|
|
2595
|
-
...
|
|
2596
|
-
view:
|
|
2597
|
-
serverNow:
|
|
2598
|
-
arrivedAt:
|
|
2599
|
-
capabilities:
|
|
2600
|
-
turnInFlight:
|
|
2601
|
-
tr:
|
|
2604
|
+
/* @__PURE__ */ j(Dn, {
|
|
2605
|
+
...Ca.dialog,
|
|
2606
|
+
view: Gs?.view ?? Ca.dialog.view,
|
|
2607
|
+
serverNow: Gs?.serverNow ?? NaN,
|
|
2608
|
+
arrivedAt: Gs?.arrivedAt ?? NaN,
|
|
2609
|
+
capabilities: Gs ? ba[Gs.session.sandboxId] : null,
|
|
2610
|
+
turnInFlight: _a,
|
|
2611
|
+
tr: N
|
|
2602
2612
|
})
|
|
2603
2613
|
]
|
|
2604
2614
|
});
|
|
2605
2615
|
};
|
|
2606
2616
|
//#endregion
|
|
2607
|
-
export {
|
|
2617
|
+
export { Oi as AssistantChatArea };
|