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