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