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