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