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