@burdenoff/fe-libs 2026.1003.2 → 2026.1003.3
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/chrome/mobileTabBar/selectTabs.d.ts.map +1 -1
- package/dist/chrome/mobileTabBar/selectTabs.js +9 -8
- package/dist/chrome/sideNavigation/NavItemRenderer.d.ts.map +1 -1
- package/dist/chrome/sideNavigation/NavItemRenderer.js +62 -61
- package/dist/shared/assistant/conversation.d.ts +20 -6
- package/dist/shared/assistant/conversation.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyMapping.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyMapping.js +43 -24
- package/dist/shared/assistant/i18nManifest.d.ts +9 -0
- package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
- package/dist/shared/assistant/i18nManifest.js +9 -0
- package/dist/shared/assistant/index.d.ts +3 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/localUiCommandCopy.d.ts +28 -0
- package/dist/shared/assistant/localUiCommandCopy.d.ts.map +1 -1
- package/dist/shared/assistant/localUiCommandCopy.js +54 -1
- package/dist/shared/assistant/localUiCommands.d.ts +33 -3
- package/dist/shared/assistant/localUiCommands.d.ts.map +1 -1
- package/dist/shared/assistant/localUiCommands.js +110 -59
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +788 -656
- package/dist/shared/assistant/ui/AssistantMarkdownRenderer.d.ts +18 -1
- package/dist/shared/assistant/ui/AssistantMarkdownRenderer.d.ts.map +1 -1
- package/dist/shared/assistant/ui/assistantOverlayState.d.ts +2 -1
- package/dist/shared/assistant/ui/assistantOverlayState.d.ts.map +1 -1
- package/dist/shared/assistant/ui/assistantOverlayState.js +1 -7
- package/dist/shared/assistant/uiActions/backStack.d.ts +35 -0
- package/dist/shared/assistant/uiActions/backStack.d.ts.map +1 -0
- package/dist/shared/assistant/uiActions/backStack.js +28 -0
- package/dist/shared/assistant/uiActions/navigateAction.d.ts +41 -0
- package/dist/shared/assistant/uiActions/navigateAction.d.ts.map +1 -0
- package/dist/shared/assistant/uiActions/navigateAction.js +40 -0
- package/dist/shared/assistant/uiActions/navigationOutcome.d.ts +52 -0
- package/dist/shared/assistant/uiActions/navigationOutcome.d.ts.map +1 -0
- package/dist/shared/assistant/uiActions/navigationOutcome.js +61 -0
- package/dist/shared/navigation/navTargetPath.d.ts +23 -0
- package/dist/shared/navigation/navTargetPath.d.ts.map +1 -0
- package/dist/shared/navigation/navTargetPath.js +6 -0
- package/dist/shared-assistant.js +19 -16
- package/package.json +1 -1
|
@@ -8,10 +8,10 @@ import { useAssistantNavigate as a } from "./AssistantMarkdownRenderer.js";
|
|
|
8
8
|
import { isAssistantModeId as o } from "../modeIds.js";
|
|
9
9
|
import { AUTO_READ_MODE as s, autoSuggestions as c, classifyAssistantIntent as l, escalationToUndo as u, isAutoRoutingOffered as d, resolveAutoRoute as f } from "../autoRouting.js";
|
|
10
10
|
import { getHistoryStamp as p, setHistoryBusyProbe as ee } from "../history/stampRegistry.js";
|
|
11
|
-
import { beginApprovalInFlight as m, endApprovalInFlight as h, getApprovalInFlight as
|
|
12
|
-
import { isWriteModeAcknowledged as
|
|
13
|
-
import { resolveActiveModeSandbox as
|
|
14
|
-
import { abortAssistantTurn as
|
|
11
|
+
import { beginApprovalInFlight as m, endApprovalInFlight as h, getApprovalInFlight as te, markLiveTurn as ne, newestModelReplyId as re, resolveApprovablePendingWrite as g, resolveRetryableMessageId as _, subscribeApprovalInFlight as v } from "../liveTurns.js";
|
|
12
|
+
import { isWriteModeAcknowledged as ie, writeModeSendRefusalReason as ae } from "../writeModeConsent.js";
|
|
13
|
+
import { resolveActiveModeSandbox as y, useAssistantStore as b } from "../store.js";
|
|
14
|
+
import { abortAssistantTurn as oe, approvePendingWrite as se, createAssistantSandbox as x, createAssistantSession as S, extendAssistantSandboxTTL as ce, findExistingSandboxWithStatus as le, getAssistantArtifacts as ue, getAssistantMessages as de, getAssistantSession as C, modeRequiresConfirmWrites as fe, promptGatewayRequestBytes as pe, releaseSupersededAssistantSandboxes as w, sendAssistantPromptAsync as me, waitForAssistantServiceReady as T, waitForSandboxRunning as he, writeApprovalModeOf as ge } from "../api.js";
|
|
15
15
|
import { sanitize as _e } from "../progress.js";
|
|
16
16
|
import { AssistantSendRefusal as ve, classifyTurnFailure as ye, turnConfirmsNoAction as be, turnOutcomeCopy as xe } from "../turnOutcome.js";
|
|
17
17
|
import { assistantUsageLedger as Se, hasPendingUsageReports as Ce, reportUsageWithRetry as we, retryPendingUsageReports as Te, usageSendRefusal as Ee } from "../usageReporting.js";
|
|
@@ -68,147 +68,150 @@ import { useConversationTurns as _n } from "../useConversationTurns.js";
|
|
|
68
68
|
import { sendAssistantTurnTimings as vn, startTurnTimingReporting as yn } from "../turnTimingReporter.js";
|
|
69
69
|
import { QuarantineSet as bn, WarmCancelled as xn, claimPreopenedSession as Sn, consumeWarm as Cn, preopenKey as wn, preopenWanted as Tn, prewarmTarget as En, settleWarmBeforeSend as Dn, startPreopen as On, startWarm as kn, warmState as An } from "../prewarm.js";
|
|
70
70
|
import { isAlreadyThere as jn, matchLocalUiCommand as Mn, navDestinations as Nn, planThemeChange as Pn } from "../localUiCommands.js";
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
71
|
+
import { backDoneCopy as Fn, chooseDestinationCopy as In, navigationCommandCopy as Ln, navigationOutcomeCopy as Rn, themeCommandCopy as zn } from "../localUiCommandCopy.js";
|
|
72
|
+
import { runNavigation as Bn } from "../uiActions/navigationOutcome.js";
|
|
73
|
+
import { assistantBackStack as Vn, isBackRunnable as Hn } from "../uiActions/backStack.js";
|
|
74
|
+
import { buildNavigateAction as Un, destinationForPath as Wn, labelForPath as Gn, newestAssistantOnSurface as Kn } from "../uiActions/navigateAction.js";
|
|
75
|
+
import { dispatchAssistantQuotaExhausted as qn, notifyAiCreditsUpdated as Jn } from "../aiCredits.js";
|
|
76
|
+
import { useAssistantAttachments as Yn } from "../useAssistantAttachments.js";
|
|
77
|
+
import { AssistantComposer as Xn } from "./composer/AssistantComposer.js";
|
|
78
|
+
import { isProdRuntime as Zn } from "../env.js";
|
|
79
|
+
import { AssistantApiCallsConsentDialog as Qn } from "./AssistantApiCallsConsentDialog.js";
|
|
80
|
+
import { useVisibleNavItems as $n } from "../../../chrome/mobileTabBar/useVisibleNavItems.js";
|
|
81
|
+
import { useCallback as j, useEffect as M, useMemo as er, useRef as N, useState as tr, useSyncExternalStore as nr } from "react";
|
|
82
|
+
import { jsx as P, jsxs as rr } from "react/jsx-runtime";
|
|
80
83
|
//#region src/shared/assistant/ui/AssistantChatArea.tsx
|
|
81
|
-
var
|
|
84
|
+
var ir = 600, ar = 2e4, or = 1e4, sr = 6e3;
|
|
82
85
|
function F() {
|
|
83
86
|
return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
84
87
|
}
|
|
85
|
-
var
|
|
86
|
-
let I = i(), { product: L, modes: R, gatherPageContext:
|
|
87
|
-
let n =
|
|
88
|
+
var cr = ({ visible: cr = !0, writeAccess: lr = "unknown" }) => {
|
|
89
|
+
let I = i(), { product: L, modes: R, gatherPageContext: ur, buildPrompt: dr, reportTurnTimings: fr, reportTokenUsage: pr, localUiCommands: mr } = r(), z = ge(r().writeApproval), hr = j((e, t) => {
|
|
90
|
+
let n = b.getState(), r = t ?? n.sandboxesByMode[e]?.sandboxId ?? null;
|
|
88
91
|
return et({
|
|
89
92
|
mode: e,
|
|
90
93
|
productWriteApproval: z,
|
|
91
94
|
capabilities: r ? n.sandboxWriteCapabilities[r] : null
|
|
92
95
|
});
|
|
93
|
-
}, [z]), { getAccessToken: B, getWorkspaceToken:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
+
}, [z]), { getAccessToken: B, getWorkspaceToken: gr, userId: V } = n(), { locale: H } = t(), _r = b((e) => e.assistantLanguage), vr = b((e) => e.replyLanguage), yr = er(() => Le(_r, vr, H), [
|
|
97
|
+
_r,
|
|
98
|
+
vr,
|
|
96
99
|
H
|
|
97
|
-
]),
|
|
100
|
+
]), br = yr.reply.english, xr = yr.replyIsExplicit, Sr = yr.reply.code, { conversations: Cr, activeConversationId: U, mode: W, processingByConversationId: wr, setMode: Tr, setConversationMode: Er, setActiveConversation: Dr, createConversation: G, addMessage: K, updateMessage: Or, patchMessage: kr, mergeMessageMetadata: Ar, setConversationProcessing: jr, clearConversationProcessing: Mr, setBackendSessionId: Nr, clearBackendSessionId: Pr, setSandbox: Fr, clearSandbox: Ir, acknowledgedWriteModes: Lr, acknowledgeWriteMode: Rr, autoRouting: zr, setAutoRouting: Br, routeConversation: Vr } = b(), Hr = Cr.find((e) => e.id === U), Ur = _n(Hr), Wr = Ur.all, q = U ? wr[U] : void 0, Gr = ut(q?.status), Kr = Gr ? q?.messageId ?? null : null, qr = q?.status === "error" ? q.messageId : null, Jr = b((e) => e.sandboxWriteCapabilities), { panel: J, entries: Yr, retiredSandboxes: Xr } = Gt({
|
|
98
101
|
tr: I,
|
|
99
102
|
productWriteApproval: z
|
|
100
|
-
}),
|
|
103
|
+
}), Zr = zt({
|
|
101
104
|
approve: (e, t) => J.approve(e, t),
|
|
102
105
|
decline: (e, t, n) => J.decline(e, t, n),
|
|
103
106
|
presented: (e, t) => J.presented(e, t)
|
|
104
|
-
}),
|
|
107
|
+
}), Qr = Zr.dismiss, $r = N(null);
|
|
105
108
|
M(() => {
|
|
106
|
-
|
|
107
|
-
let e =
|
|
108
|
-
|
|
109
|
+
Qr();
|
|
110
|
+
let e = $r.current;
|
|
111
|
+
$r.current = U, e && e !== U && J.withdraw(e, "conversation_closed"), U && J.openConversation(U);
|
|
109
112
|
}, [
|
|
110
113
|
U,
|
|
111
114
|
J,
|
|
112
|
-
|
|
115
|
+
Qr
|
|
113
116
|
]);
|
|
114
|
-
let
|
|
117
|
+
let ei = nn(Hr), ti = pn(Hr)?.archivedAt != null, ni = an((e) => U !== null && U in e.loadingIds), ri = an((e) => U !== null && U in e.loadErrorIds), ii = an((e) => e.remoteDelete), [ai, oi] = tr(() => an.getState().remoteDelete?.at ?? null), si = ii?.wasActive === !0 && ii.at !== ai ? ii.at : null;
|
|
115
118
|
M(() => {
|
|
116
|
-
if (
|
|
117
|
-
let e = window.setTimeout(() =>
|
|
119
|
+
if (si === null) return;
|
|
120
|
+
let e = window.setTimeout(() => oi(si), or);
|
|
118
121
|
return () => window.clearTimeout(e);
|
|
119
|
-
}, [
|
|
120
|
-
let { canUseApiCalls:
|
|
121
|
-
loading:
|
|
122
|
-
canUseAdminModes:
|
|
123
|
-
})).current,
|
|
122
|
+
}, [si]);
|
|
123
|
+
let { canUseApiCalls: ci, loading: li } = gn(A(), V), ui = N(st({
|
|
124
|
+
loading: li,
|
|
125
|
+
canUseAdminModes: ci
|
|
126
|
+
})).current, di = N(R);
|
|
124
127
|
M(() => {
|
|
125
|
-
|
|
128
|
+
di.current = R;
|
|
126
129
|
}, [R]);
|
|
127
|
-
let
|
|
128
|
-
let e =
|
|
129
|
-
e && on.openConversation(e, { modes:
|
|
130
|
-
},
|
|
131
|
-
let e =
|
|
130
|
+
let fi = () => {
|
|
131
|
+
let e = b.getState().activeConversationId;
|
|
132
|
+
e && on.openConversation(e, { modes: di.current });
|
|
133
|
+
}, pi = () => {
|
|
134
|
+
let e = b.getState().activeConversationId;
|
|
132
135
|
e && on.loadEarlier(e);
|
|
133
|
-
},
|
|
136
|
+
}, mi = N(B);
|
|
134
137
|
M(() => {
|
|
135
|
-
|
|
138
|
+
mi.current = B;
|
|
136
139
|
}, [B]);
|
|
137
|
-
let
|
|
140
|
+
let hi = !!L && fr !== !1;
|
|
138
141
|
M(() => {
|
|
139
|
-
if (
|
|
142
|
+
if (hi) return yn({ send: (e) => vn(e, {
|
|
140
143
|
workspaceId: A(),
|
|
141
144
|
authContext: {
|
|
142
|
-
accessToken:
|
|
145
|
+
accessToken: mi.current(),
|
|
143
146
|
organizationId: At()
|
|
144
147
|
}
|
|
145
148
|
}) });
|
|
146
|
-
}, [
|
|
147
|
-
|
|
148
|
-
loading:
|
|
149
|
-
canUseAdminModes:
|
|
149
|
+
}, [hi]), M(() => {
|
|
150
|
+
ui.update({
|
|
151
|
+
loading: li,
|
|
152
|
+
canUseAdminModes: ci
|
|
150
153
|
});
|
|
151
154
|
}, [
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
+
ui,
|
|
156
|
+
li,
|
|
157
|
+
ci
|
|
155
158
|
]), M(() => () => {
|
|
156
|
-
|
|
157
|
-
}, [
|
|
158
|
-
let
|
|
159
|
+
ui.abandon();
|
|
160
|
+
}, [ui]);
|
|
161
|
+
let gi = er(() => R.filter((e) => !e.requiresAdmin || ci), [R, ci]), _i = d(gi), vi = zr && _i, yi = N(_i);
|
|
159
162
|
M(() => {
|
|
160
|
-
|
|
161
|
-
}, [
|
|
162
|
-
let
|
|
163
|
-
|
|
163
|
+
yi.current = _i;
|
|
164
|
+
}, [_i]);
|
|
165
|
+
let bi = N(null), xi = N(!1), Si = Xe(R), [Ci, wi] = tr(null), [Ti, Ei] = tr(null), Di = Ti !== null && Ti === U, Oi = j((e) => {
|
|
166
|
+
Ei(e ? b.getState().activeConversationId : null);
|
|
164
167
|
}, []);
|
|
165
168
|
M(() => {
|
|
166
|
-
|
|
169
|
+
Ei((e) => e !== null && e !== U ? null : e);
|
|
167
170
|
}, [U]);
|
|
168
|
-
let
|
|
169
|
-
|
|
170
|
-
}, []),
|
|
171
|
-
let e =
|
|
171
|
+
let ki = N(void 0), [Ai, ji] = tr(!1), Mi = j((e) => {
|
|
172
|
+
ki.current = e, ji(ze(e));
|
|
173
|
+
}, []), Ni = j(() => {
|
|
174
|
+
let e = b.getState(), t = e.activeConversationId, n = t ? e.conversations.find((e) => e.id === t) : void 0;
|
|
172
175
|
return !t || !n ? null : {
|
|
173
176
|
id: t,
|
|
174
177
|
reusableDraft: rn(n, p()),
|
|
175
178
|
liveProposals: J.liveFor(t).count,
|
|
176
179
|
turnInFlight: ut(e.processingByConversationId[t]?.status)
|
|
177
180
|
};
|
|
178
|
-
}, [J]),
|
|
181
|
+
}, [J]), Pi = N({}), Y = N(Nt()), X = N(new bn()), Fi = N(/* @__PURE__ */ new Set()), Ii = er(() => R.find((e) => e.id === W), [R, W]), Li = b((e) => {
|
|
179
182
|
let t = e.sandboxesByMode[W]?.sandboxId;
|
|
180
183
|
return t ? e.sandboxWriteCapabilities[t] : void 0;
|
|
181
|
-
}),
|
|
184
|
+
}), Ri = Ii !== void 0 && et({
|
|
182
185
|
mode: W,
|
|
183
186
|
productWriteApproval: z,
|
|
184
|
-
capabilities:
|
|
185
|
-
}),
|
|
187
|
+
capabilities: Li
|
|
188
|
+
}), zi = W === "assistant" || Ii !== void 0 && !Ii.writeCapable && !fe(W) || Ri;
|
|
186
189
|
M(() => {
|
|
187
|
-
if (W !== "assistant" &&
|
|
188
|
-
|
|
190
|
+
if (W !== "assistant" && Ii?.writeCapable && !ie(Lr, W)) {
|
|
191
|
+
Tr("assistant");
|
|
189
192
|
return;
|
|
190
193
|
}
|
|
191
|
-
|
|
194
|
+
li || (!Ii || Ii.requiresAdmin && !ci) && W !== "assistant" && Tr("assistant");
|
|
192
195
|
}, [
|
|
193
196
|
W,
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
Ii,
|
|
198
|
+
ci,
|
|
199
|
+
li,
|
|
200
|
+
Tr,
|
|
201
|
+
Lr
|
|
199
202
|
]);
|
|
200
|
-
let
|
|
201
|
-
|
|
202
|
-
}, [
|
|
203
|
+
let Bi = j((e, t, n, r) => {
|
|
204
|
+
jr(e, n, t, null, r);
|
|
205
|
+
}, [jr]), Vi = j(async (e, t, n, r, i, a = null) => {
|
|
203
206
|
let s = (e, t) => {
|
|
204
|
-
r &&
|
|
207
|
+
r && Bi(r.conversationId, r.assistantMessageId, e, t), a && (a.step = t, a.onStep?.(t));
|
|
205
208
|
}, c = (e) => {
|
|
206
209
|
r && k(r.assistantMessageId, e);
|
|
207
210
|
}, l = () => {
|
|
208
211
|
c("bootAdopted"), a?.beginBoot();
|
|
209
212
|
}, u = () => a !== null && (a.signal.aborted || A() !== t), d = () => {
|
|
210
213
|
if (u()) throw new xn("cancelled");
|
|
211
|
-
}, f =
|
|
214
|
+
}, f = b.getState().sandboxesByMode[e]?.sandboxId ?? null, p = !1, ee = !1, m = !1, h = !1, te = !1, ne = async (r) => {
|
|
212
215
|
if (i && !X.current.has(r) && Y.current.isFresh(r)) return p = !0, !0;
|
|
213
216
|
m = !0;
|
|
214
217
|
let o = !1;
|
|
@@ -218,77 +221,77 @@ var $n = ({ visible: $n = !0, writeAccess: er = "unknown" }) => {
|
|
|
218
221
|
});
|
|
219
222
|
} catch {
|
|
220
223
|
if (u()) throw new xn("cancelled");
|
|
221
|
-
return Y.current.invalidate(r), X.current.add(r), a?.dead.push(r),
|
|
224
|
+
return Y.current.invalidate(r), X.current.add(r), a?.dead.push(r), te = !0, !1;
|
|
222
225
|
}
|
|
223
226
|
return d(), Y.current.markVerified(r), o && (h = !0), !0;
|
|
224
227
|
};
|
|
225
|
-
if (f && (
|
|
228
|
+
if (f && (Fr(e, f, "provisioning"), s("provisioning", "reusingEnvironment"), await ne(f) || (Fr(e, null, "provisioning"), f = null)), !f) {
|
|
226
229
|
s("provisioning", "lookingForEnvironment");
|
|
227
|
-
let r = await
|
|
230
|
+
let r = await le(t, L, e, Zn(), n, X.current, z);
|
|
228
231
|
d();
|
|
229
232
|
let i = r?.id ?? null;
|
|
230
233
|
if (i) {
|
|
231
|
-
|
|
234
|
+
Fr(e, i, "provisioning"), s("provisioning", "reusingEnvironment");
|
|
232
235
|
let t = r?.status === "PROVISIONING" || r?.status === "PENDING";
|
|
233
|
-
t && l(), await
|
|
236
|
+
t && l(), await ne(i) ? (f = i, t && (h = !0)) : Fr(e, null, "provisioning");
|
|
234
237
|
}
|
|
235
238
|
}
|
|
236
239
|
if (!f) {
|
|
237
240
|
if (a && !a.mayCreate) throw new xn("no-create");
|
|
238
241
|
if (c("provisionStarted"), e === "api-calls" && !B()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
|
|
239
|
-
s("provisioning", "startingEnvironment"),
|
|
240
|
-
let r = a ? [] : await w(t, L, e,
|
|
242
|
+
s("provisioning", "startingEnvironment"), Fr(e, null, "provisioning");
|
|
243
|
+
let r = a ? [] : await w(t, L, e, Zn(), n, X.current, z);
|
|
241
244
|
if (r.length > 0) {
|
|
242
245
|
let e = new Set(r);
|
|
243
246
|
for (let e of r) Y.current.invalidate(e), X.current.add(e);
|
|
244
|
-
let t =
|
|
245
|
-
for (let [n, r] of Object.entries(t)) o(n) && r?.sandboxId && e.has(r.sandboxId) &&
|
|
247
|
+
let t = b.getState().sandboxesByMode;
|
|
248
|
+
for (let [n, r] of Object.entries(t)) o(n) && r?.sandboxId && e.has(r.sandboxId) && Ir(n);
|
|
246
249
|
}
|
|
247
250
|
c("createRequested");
|
|
248
251
|
let i = a?.beginCreate();
|
|
249
252
|
try {
|
|
250
|
-
f = await
|
|
253
|
+
f = await x(L, e, t, Zn(), ir, n, { writeApproval: z });
|
|
251
254
|
} finally {
|
|
252
255
|
i?.();
|
|
253
256
|
}
|
|
254
|
-
ee = !0, d(),
|
|
257
|
+
ee = !0, d(), Fr(e, f, "provisioning"), await he(f, t, n, 3e5), d(), c("sandboxRunning"), await T(f, t, e, n, 9e4), d(), c("serviceReady"), Y.current.markVerified(f);
|
|
255
258
|
}
|
|
256
|
-
return
|
|
259
|
+
return Fr(e, f, "running"), {
|
|
257
260
|
sandboxId: f,
|
|
258
261
|
sandboxIsNew: ee,
|
|
259
262
|
sandboxProbed: m,
|
|
260
263
|
sandboxAdopted: h,
|
|
261
|
-
deadSandboxProbe:
|
|
264
|
+
deadSandboxProbe: te,
|
|
262
265
|
trustedFromCache: p
|
|
263
266
|
};
|
|
264
267
|
}, [
|
|
265
|
-
|
|
268
|
+
Ir,
|
|
266
269
|
B,
|
|
267
270
|
L,
|
|
268
271
|
z,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
]),
|
|
272
|
-
let s = await Dn(i, r, (e) =>
|
|
272
|
+
Fr,
|
|
273
|
+
Bi
|
|
274
|
+
]), Hi = j(async function e(t, n, r, i, a, o = {}) {
|
|
275
|
+
let s = await Dn(i, r, (e) => Bi(t, n, "provisioning", e), () => k(n, "prewarmJoined"));
|
|
273
276
|
for (let e of s.dead) Y.current.invalidate(e), X.current.add(e);
|
|
274
277
|
s.verified && !X.current.has(s.verified) && Y.current.markVerified(s.verified), s.joined && O(n, { prewarm: s.joined });
|
|
275
|
-
let { sandboxId: c, sandboxIsNew: l, sandboxProbed: u, sandboxAdopted: d, deadSandboxProbe: f, trustedFromCache: p } = await
|
|
278
|
+
let { sandboxId: c, sandboxIsNew: l, sandboxProbed: u, sandboxAdopted: d, deadSandboxProbe: f, trustedFromCache: p } = await Vi(r, i, a, {
|
|
276
279
|
conversationId: t,
|
|
277
280
|
assistantMessageId: n
|
|
278
281
|
}, o.trustCache !== !1), ee = Cn(i, r, c);
|
|
279
282
|
!s.waited && ee && O(n, { prewarm: "hit" });
|
|
280
|
-
let m =
|
|
283
|
+
let m = b.getState().conversations.find((e) => e.id === t)?.backendSessionId ?? null, h = !1, te = null;
|
|
281
284
|
if (m) {
|
|
282
|
-
let e = vt(c, m, (e, t) =>
|
|
285
|
+
let e = vt(c, m, (e, t) => de(e, i, t, r, a, { limit: 50 }));
|
|
283
286
|
try {
|
|
284
|
-
let t = await
|
|
287
|
+
let t = await C(c, i, m, r, a);
|
|
285
288
|
if (t.mode !== r) throw Error(`Session mode mismatch: expected ${r}, received ${t.mode}`);
|
|
286
|
-
|
|
289
|
+
te = e;
|
|
287
290
|
} catch {
|
|
288
|
-
|
|
291
|
+
Pr(t), m = null;
|
|
289
292
|
}
|
|
290
293
|
}
|
|
291
|
-
let
|
|
294
|
+
let ne = !1;
|
|
292
295
|
if (!m) {
|
|
293
296
|
let e = Sn(wn({
|
|
294
297
|
workspaceId: i,
|
|
@@ -297,24 +300,24 @@ var $n = ({ visible: $n = !0, writeAccess: er = "unknown" }) => {
|
|
|
297
300
|
userId: V
|
|
298
301
|
}), Date.now());
|
|
299
302
|
if (e) {
|
|
300
|
-
"pending" in e &&
|
|
303
|
+
"pending" in e && Bi(t, n, "connecting", "preparingSession");
|
|
301
304
|
let o = "sessionId" in e ? e.sessionId : await e.pending;
|
|
302
305
|
if (o && !X.current.has(c)) try {
|
|
303
|
-
(await
|
|
306
|
+
(await C(c, i, o, r, a)).mode === r && (m = o, ne = !0, Nr(t, m), h = !0);
|
|
304
307
|
} catch {}
|
|
305
308
|
}
|
|
306
309
|
}
|
|
307
310
|
if (!m) {
|
|
308
|
-
|
|
311
|
+
Bi(t, n, "connecting", "preparingSession");
|
|
309
312
|
let s;
|
|
310
313
|
try {
|
|
311
|
-
s = await
|
|
314
|
+
s = await S(c, i, r, a);
|
|
312
315
|
} catch (s) {
|
|
313
316
|
if (p) {
|
|
314
317
|
Y.current.invalidate(c);
|
|
315
318
|
let l = Ft(s, o.isAbandoned?.() ?? !1), p = l === "check-network";
|
|
316
|
-
if (l === "check-network" && (l = await Pt(() =>
|
|
317
|
-
p || O(n, { cacheProofFailed: !0 }), l === "replace" && (X.current.add(c),
|
|
319
|
+
if (l === "check-network" && (l = await Pt(() => le(i, L, r, Zn(), a, X.current, z))), l !== "rethrow" && o.isAbandoned?.() && (l = "rethrow"), l !== "rethrow") {
|
|
320
|
+
p || O(n, { cacheProofFailed: !0 }), l === "replace" && (X.current.add(c), Pr(t), Ir(r), J.retireSandbox(c));
|
|
318
321
|
let s = await e(t, n, r, i, a, {
|
|
319
322
|
...o,
|
|
320
323
|
trustCache: !1
|
|
@@ -329,43 +332,43 @@ var $n = ({ visible: $n = !0, writeAccess: er = "unknown" }) => {
|
|
|
329
332
|
}
|
|
330
333
|
throw s;
|
|
331
334
|
}
|
|
332
|
-
m = s.sessionId,
|
|
335
|
+
m = s.sessionId, Nr(t, m), h = !0;
|
|
333
336
|
}
|
|
334
337
|
return {
|
|
335
338
|
sandboxId: c,
|
|
336
339
|
sessionId: m,
|
|
337
340
|
sessionIsNew: h,
|
|
338
|
-
readAhead:
|
|
341
|
+
readAhead: te,
|
|
339
342
|
sandboxIsNew: l,
|
|
340
343
|
sandboxProbed: u,
|
|
341
344
|
sandboxAdopted: d,
|
|
342
345
|
deadSandboxProbe: f,
|
|
343
|
-
sessionPreopened:
|
|
346
|
+
sessionPreopened: ne
|
|
344
347
|
};
|
|
345
348
|
}, [
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
+
Vi,
|
|
350
|
+
Pr,
|
|
351
|
+
Ir,
|
|
349
352
|
L,
|
|
350
353
|
z,
|
|
351
|
-
|
|
352
|
-
|
|
354
|
+
Nr,
|
|
355
|
+
Bi,
|
|
353
356
|
V,
|
|
354
357
|
J
|
|
355
|
-
]),
|
|
358
|
+
]), Ui = j((e, t = !1) => {
|
|
356
359
|
let n = A();
|
|
357
360
|
if (!n) return;
|
|
358
|
-
let r =
|
|
361
|
+
let r = b.getState(), i = Date.now(), a = En({
|
|
359
362
|
autoRouting: r.autoRouting,
|
|
360
|
-
autoOffered:
|
|
363
|
+
autoOffered: yi.current,
|
|
361
364
|
active: !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0,
|
|
362
365
|
selectedMode: r.mode,
|
|
363
366
|
autoReadMode: s,
|
|
364
|
-
modes:
|
|
367
|
+
modes: di.current,
|
|
365
368
|
acknowledgedWriteModes: r.acknowledgedWriteModes,
|
|
366
|
-
adminAccess:
|
|
369
|
+
adminAccess: ui.read(),
|
|
367
370
|
dictated: e,
|
|
368
|
-
voiceProposalBound: (e) =>
|
|
371
|
+
voiceProposalBound: (e) => hr(e),
|
|
369
372
|
turnInFlight: Object.values(r.processingByConversationId).some((e) => ut(e?.status)),
|
|
370
373
|
...An(n),
|
|
371
374
|
now: i
|
|
@@ -373,11 +376,11 @@ var $n = ({ visible: $n = !0, writeAccess: er = "unknown" }) => {
|
|
|
373
376
|
if (!a) return;
|
|
374
377
|
let o = kn(n, a, i), c = {
|
|
375
378
|
accessToken: B(),
|
|
376
|
-
workspaceToken:
|
|
379
|
+
workspaceToken: gr(),
|
|
377
380
|
userId: V,
|
|
378
381
|
organizationId: At()
|
|
379
382
|
};
|
|
380
|
-
|
|
383
|
+
Vi(a.mode, n, c, null, !0, o).then((e) => {
|
|
381
384
|
if (o.finish({
|
|
382
385
|
ok: !0,
|
|
383
386
|
sandboxId: e.sandboxId,
|
|
@@ -385,7 +388,7 @@ var $n = ({ visible: $n = !0, writeAccess: er = "unknown" }) => {
|
|
|
385
388
|
booted: e.sandboxIsNew || e.sandboxAdopted,
|
|
386
389
|
dead: o.dead
|
|
387
390
|
}), o.signal.aborted || A() !== n || X.current.has(e.sandboxId)) return;
|
|
388
|
-
let r =
|
|
391
|
+
let r = b.getState(), i = !t && r.activeConversationId ? r.conversations.find((e) => e.id === r.activeConversationId) : void 0, s = p();
|
|
389
392
|
Tn({
|
|
390
393
|
active: i ? {
|
|
391
394
|
mode: i.mode,
|
|
@@ -399,11 +402,11 @@ var $n = ({ visible: $n = !0, writeAccess: er = "unknown" }) => {
|
|
|
399
402
|
mode: a.mode,
|
|
400
403
|
sandboxId: e.sandboxId,
|
|
401
404
|
userId: V
|
|
402
|
-
}), () =>
|
|
405
|
+
}), () => S(e.sandboxId, n, a.mode, c).then((e) => e.sessionId), Date.now());
|
|
403
406
|
}, (e) => {
|
|
404
407
|
if (!(e instanceof xn) && !o.signal.aborted && A() === n) {
|
|
405
|
-
let e =
|
|
406
|
-
e && (Y.current.invalidate(e), X.current.add(e), o.dead.push(e),
|
|
408
|
+
let e = b.getState().sandboxesByMode[a.mode]?.sandboxId ?? null;
|
|
409
|
+
e && (Y.current.invalidate(e), X.current.add(e), o.dead.push(e), Ir(a.mode));
|
|
407
410
|
}
|
|
408
411
|
o.finish({
|
|
409
412
|
ok: !1,
|
|
@@ -413,44 +416,44 @@ var $n = ({ visible: $n = !0, writeAccess: er = "unknown" }) => {
|
|
|
413
416
|
});
|
|
414
417
|
});
|
|
415
418
|
}, [
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
+
Vi,
|
|
420
|
+
ui,
|
|
421
|
+
Ir,
|
|
419
422
|
B,
|
|
420
|
-
|
|
423
|
+
gr,
|
|
421
424
|
V,
|
|
422
|
-
|
|
423
|
-
]),
|
|
424
|
-
let e =
|
|
425
|
+
hr
|
|
426
|
+
]), Wi = j(() => Ui(!1), [Ui]), Gi = nr(v, te, te)?.reference ?? null, [Ki, qi] = tr(0), Ji = N(/* @__PURE__ */ new Set()), Yi = N(null), Xi = j(() => {
|
|
427
|
+
let e = b.getState(), t = e.activeConversationId;
|
|
425
428
|
if (!t) return;
|
|
426
429
|
let n = e.processingByConversationId[t], r = ut(n?.status) ? n?.messageId ?? null : null;
|
|
427
430
|
if (!ft({
|
|
428
431
|
interruptedTurnId: r,
|
|
429
432
|
activeTurnId: r,
|
|
430
|
-
alreadyRequested: r ?
|
|
433
|
+
alreadyRequested: r ? Ji.current.has(r) : !1
|
|
431
434
|
}).send || !r) return;
|
|
432
|
-
|
|
433
|
-
let i =
|
|
434
|
-
!i || !a || !o ||
|
|
435
|
+
Ji.current.add(r);
|
|
436
|
+
let i = y(e), a = A(), o = e.conversations.find((e) => e.id === t)?.backendSessionId;
|
|
437
|
+
!i || !a || !o || oe(i.sandboxId, a, o, i.mode, {
|
|
435
438
|
accessToken: B(),
|
|
436
|
-
workspaceToken:
|
|
439
|
+
workspaceToken: gr(),
|
|
437
440
|
userId: V,
|
|
438
441
|
organizationId: At()
|
|
439
442
|
});
|
|
440
443
|
}, [
|
|
441
444
|
V,
|
|
442
445
|
B,
|
|
443
|
-
|
|
444
|
-
]),
|
|
445
|
-
let t =
|
|
446
|
+
gr
|
|
447
|
+
]), Zi = j(async (e) => {
|
|
448
|
+
let t = b.getState(), n = y(t), r = A(), i = t.activeConversationId;
|
|
446
449
|
if (!n || !r || !i || Ht(t.sandboxWriteCapabilities[n.sandboxId])) return;
|
|
447
|
-
let a = t.conversations.find((e) => e.id === i), o = a ?
|
|
450
|
+
let a = t.conversations.find((e) => e.id === i), o = a ? g(E(a.messages), {
|
|
448
451
|
sessionId: a.backendSessionId,
|
|
449
452
|
sandboxId: n.sandboxId,
|
|
450
453
|
nowMs: Date.now()
|
|
451
454
|
}) : null;
|
|
452
455
|
if (o?.reference !== e) {
|
|
453
|
-
|
|
456
|
+
qi((e) => e + 1);
|
|
454
457
|
return;
|
|
455
458
|
}
|
|
456
459
|
let s = {
|
|
@@ -459,9 +462,9 @@ var $n = ({ visible: $n = !0, writeAccess: er = "unknown" }) => {
|
|
|
459
462
|
};
|
|
460
463
|
if (!m(s)) return;
|
|
461
464
|
try {
|
|
462
|
-
await
|
|
465
|
+
await se(n.sandboxId, r, e, n.mode, {
|
|
463
466
|
accessToken: B(),
|
|
464
|
-
workspaceToken:
|
|
467
|
+
workspaceToken: gr(),
|
|
465
468
|
userId: V,
|
|
466
469
|
organizationId: At()
|
|
467
470
|
});
|
|
@@ -474,37 +477,69 @@ var $n = ({ visible: $n = !0, writeAccess: er = "unknown" }) => {
|
|
|
474
477
|
});
|
|
475
478
|
return;
|
|
476
479
|
}
|
|
477
|
-
h(s),
|
|
478
|
-
let c =
|
|
479
|
-
c.activeConversationId !== i || !l || c.mode !== n.mode || l.backendSessionId !== a?.backendSessionId ||
|
|
480
|
+
h(s), Ar(i, o.messageId, { pendingWriteApprovedAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
481
|
+
let c = b.getState(), l = c.conversations.find((e) => e.id === i);
|
|
482
|
+
c.activeConversationId !== i || !l || c.mode !== n.mode || l.backendSessionId !== a?.backendSessionId || y(c)?.sandboxId !== n.sandboxId || ut(c.processingByConversationId[i]?.status) || re(E(l.messages)) !== o.messageId || Ca.current(I("pendingWrite.approvedPrompt", "I approved that change — go ahead."), [], {
|
|
480
483
|
approvalFollowUp: { approvedReplyId: o.messageId },
|
|
481
484
|
targetConversationId: i
|
|
482
485
|
});
|
|
483
486
|
}, [
|
|
484
487
|
V,
|
|
485
488
|
K,
|
|
486
|
-
|
|
489
|
+
Ar,
|
|
487
490
|
I
|
|
488
|
-
]),
|
|
489
|
-
theme:
|
|
490
|
-
navigate:
|
|
491
|
-
navItems:
|
|
492
|
-
options:
|
|
491
|
+
]), Qi = e(), { speakFinishedReply: $i } = Ot(), ea = a(), { items: ta } = $n(), na = N({
|
|
492
|
+
theme: Qi,
|
|
493
|
+
navigate: ea,
|
|
494
|
+
navItems: ta,
|
|
495
|
+
options: mr ?? {}
|
|
493
496
|
});
|
|
494
497
|
M(() => {
|
|
495
|
-
|
|
496
|
-
theme:
|
|
497
|
-
navigate:
|
|
498
|
-
navItems:
|
|
499
|
-
options:
|
|
498
|
+
na.current = {
|
|
499
|
+
theme: Qi,
|
|
500
|
+
navigate: ea,
|
|
501
|
+
navItems: ta,
|
|
502
|
+
options: mr ?? {}
|
|
500
503
|
};
|
|
501
504
|
}, [
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
505
|
+
Qi,
|
|
506
|
+
ea,
|
|
507
|
+
ta,
|
|
508
|
+
mr
|
|
506
509
|
]);
|
|
507
|
-
let
|
|
510
|
+
let ra = N(!0);
|
|
511
|
+
M(() => (ra.current = !0, () => {
|
|
512
|
+
ra.current = !1;
|
|
513
|
+
}), []);
|
|
514
|
+
let ia = N(null), [aa, oa] = tr(!1), sa = j((e) => {
|
|
515
|
+
let t = b.getState(), n = t.conversations.find((e) => e.id === t.activeConversationId);
|
|
516
|
+
return n ? Hn(Vn, window.location.pathname, Kn(n.messages, e)) : !1;
|
|
517
|
+
}, []), ca = j((e, t) => {
|
|
518
|
+
let { navItems: n, options: r } = na.current;
|
|
519
|
+
return Mn(e, Nn(n), {
|
|
520
|
+
...r,
|
|
521
|
+
locale: t === void 0 ? H : yr.input.code
|
|
522
|
+
}, { backRunnable: sa(t) });
|
|
523
|
+
}, [
|
|
524
|
+
sa,
|
|
525
|
+
yr,
|
|
526
|
+
H
|
|
527
|
+
]), la = j((e, t) => {
|
|
528
|
+
let n = ca(e, t);
|
|
529
|
+
if (!n) return !1;
|
|
530
|
+
let { theme: r, navigate: i } = na.current;
|
|
531
|
+
switch (n.kind) {
|
|
532
|
+
case "theme": return r !== null;
|
|
533
|
+
case "navigate":
|
|
534
|
+
case "choose-destination":
|
|
535
|
+
case "back": return i !== null;
|
|
536
|
+
case "conversation-delete": return !1;
|
|
537
|
+
}
|
|
538
|
+
}, [ca]), ua = N(la);
|
|
539
|
+
M(() => {
|
|
540
|
+
ua.current = la;
|
|
541
|
+
}, [la]);
|
|
542
|
+
let da = j((e, t, n, r, i) => {
|
|
508
543
|
let a = I(n.key, n.fallback, r), o = n.fallback.replace(/\{\{\s*count\s*\}\}/g, String(r.count)), s = {
|
|
509
544
|
kind: "write-reply",
|
|
510
545
|
line: n.key
|
|
@@ -530,46 +565,118 @@ var $n = ({ visible: $n = !0, writeAccess: er = "unknown" }) => {
|
|
|
530
565
|
localAction: s,
|
|
531
566
|
...D(i)
|
|
532
567
|
}
|
|
533
|
-
}), on.recordCommittedEntries(e, [l, u], "LOCAL_COMMAND", A()),
|
|
568
|
+
}), on.recordCommittedEntries(e, [l, u], "LOCAL_COMMAND", A()), $i(e, u);
|
|
534
569
|
}, [
|
|
535
570
|
K,
|
|
536
571
|
H,
|
|
537
|
-
|
|
572
|
+
$i,
|
|
538
573
|
I
|
|
539
|
-
]),
|
|
574
|
+
]), fa = un(), pa = fa?.request ?? null, ma = N(() => void 0), [ha, ga] = tr(null);
|
|
540
575
|
M(() => {
|
|
541
|
-
if (
|
|
542
|
-
let e = window.setTimeout(() =>
|
|
576
|
+
if (ha === null) return;
|
|
577
|
+
let e = window.setTimeout(() => ga(null), sr);
|
|
543
578
|
return () => window.clearTimeout(e);
|
|
544
|
-
}, [
|
|
545
|
-
let
|
|
546
|
-
let e =
|
|
547
|
-
return G(void 0, e.autoRouting &&
|
|
548
|
-
}, [G]),
|
|
549
|
-
if (!
|
|
550
|
-
let t = e !== void 0, n =
|
|
579
|
+
}, [ha]);
|
|
580
|
+
let _a = j(() => {
|
|
581
|
+
let e = b.getState();
|
|
582
|
+
return G(void 0, e.autoRouting && yi.current ? s : e.mode, e.autoRouting ? { routedBy: "auto" } : void 0);
|
|
583
|
+
}, [G]), va = j((e) => {
|
|
584
|
+
if (!pa) return !1;
|
|
585
|
+
let t = e !== void 0, n = b.getState(), r = dn({
|
|
551
586
|
spoken: t,
|
|
552
|
-
bound:
|
|
587
|
+
bound: ki.current,
|
|
553
588
|
activeConversationId: n.activeConversationId,
|
|
554
589
|
conversations: n.conversations,
|
|
555
590
|
historyOn: ln()
|
|
556
591
|
});
|
|
557
|
-
if (r &&
|
|
592
|
+
if (r && pa(r), t) {
|
|
558
593
|
let e = r ? "Opened the delete confirmation. Choose Delete or Cancel on screen." : "There is no conversation to delete.", t = r ? I("deleteConversation.opened", "Opened the delete confirmation. Choose Delete or Cancel on screen.") : I("deleteConversation.nothing", "There is no conversation to delete.");
|
|
559
|
-
|
|
594
|
+
ma.current({
|
|
560
595
|
id: `conversation-delete:${F()}`,
|
|
561
596
|
text: t,
|
|
562
597
|
lang: t === e ? "en" : H
|
|
563
598
|
});
|
|
564
|
-
} else r ||
|
|
599
|
+
} else r || ga(Date.now());
|
|
565
600
|
return !0;
|
|
566
601
|
}, [
|
|
567
|
-
|
|
602
|
+
pa,
|
|
568
603
|
H,
|
|
569
604
|
I
|
|
570
|
-
]),
|
|
571
|
-
if (e.kind === "conversation-delete") return
|
|
572
|
-
let { theme: i, navigate: a } =
|
|
605
|
+
]), ya = j((e, t, n, r = !1) => {
|
|
606
|
+
if (e.kind === "conversation-delete") return va(n);
|
|
607
|
+
let { theme: i, navigate: a } = na.current, o = () => {
|
|
608
|
+
let e = (r ? null : b.getState().activeConversationId) ?? _a();
|
|
609
|
+
return r && Mi(e), e;
|
|
610
|
+
}, s = (e, r) => {
|
|
611
|
+
let i = F();
|
|
612
|
+
return K(e, {
|
|
613
|
+
id: i,
|
|
614
|
+
role: "user",
|
|
615
|
+
content: t,
|
|
616
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
617
|
+
metadata: {
|
|
618
|
+
localAction: r,
|
|
619
|
+
...D(n)
|
|
620
|
+
}
|
|
621
|
+
}), i;
|
|
622
|
+
}, c = (e, t, r, i, a, o) => {
|
|
623
|
+
let s = F();
|
|
624
|
+
return K(e, {
|
|
625
|
+
id: s,
|
|
626
|
+
role: "assistant",
|
|
627
|
+
content: r.text,
|
|
628
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
629
|
+
metadata: {
|
|
630
|
+
lang: r.translated ? H : "en",
|
|
631
|
+
localAction: i,
|
|
632
|
+
...D(n)
|
|
633
|
+
}
|
|
634
|
+
}), on.recordCommittedEntries(e, [t, s], "LOCAL_COMMAND", a), o && $i(e, s), s;
|
|
635
|
+
}, l = (e, t) => {
|
|
636
|
+
let n = o();
|
|
637
|
+
return c(n, s(n, t), e, t, A(), !0), !0;
|
|
638
|
+
}, u = (e) => {
|
|
639
|
+
let t = o(), n = A(), r = window.location.pathname, i = s(t, Un({
|
|
640
|
+
destinationId: e.destinationId,
|
|
641
|
+
path: e.registryPath,
|
|
642
|
+
alreadyHere: !1,
|
|
643
|
+
via: e.via
|
|
644
|
+
})), l = F();
|
|
645
|
+
ia.current = l, oa(!0);
|
|
646
|
+
let u = (a) => {
|
|
647
|
+
try {
|
|
648
|
+
if (!b.getState().conversations.some((e) => e.id === t)) return;
|
|
649
|
+
let o = Nn(na.current.navItems), s = a.status === "arrived" || a.status === "redirected" ? a.landedPath : null, l = Un({
|
|
650
|
+
destinationId: e.destinationId,
|
|
651
|
+
path: e.registryPath,
|
|
652
|
+
alreadyHere: !1,
|
|
653
|
+
via: e.via,
|
|
654
|
+
outcome: a
|
|
655
|
+
});
|
|
656
|
+
Ar(t, i, { localAction: l });
|
|
657
|
+
let u = c(t, i, e.via === "back" && a.status === "arrived" ? Fn(I, e.pageLabel()) : Rn(I, a, {
|
|
658
|
+
page: e.pageLabel(),
|
|
659
|
+
landed: s === null ? null : Gn(o, s),
|
|
660
|
+
path: e.target
|
|
661
|
+
}), l, n, ra.current);
|
|
662
|
+
a.status === "arrived" && e.onArrived?.({
|
|
663
|
+
replyId: u,
|
|
664
|
+
fromPath: r,
|
|
665
|
+
landedPath: a.landedPath
|
|
666
|
+
});
|
|
667
|
+
} finally {
|
|
668
|
+
ia.current === l && (ia.current = null, ra.current && oa(!1));
|
|
669
|
+
}
|
|
670
|
+
};
|
|
671
|
+
return Bn(a, e.target, {
|
|
672
|
+
readPath: () => window.location.pathname + window.location.search,
|
|
673
|
+
now: () => Date.now(),
|
|
674
|
+
schedule: (e, t) => {
|
|
675
|
+
window.setTimeout(e, t);
|
|
676
|
+
},
|
|
677
|
+
isShellLess: () => !ra.current
|
|
678
|
+
}).then(u, () => u({ status: "unconfirmed" })), !0;
|
|
679
|
+
};
|
|
573
680
|
if (e.kind === "theme") {
|
|
574
681
|
if (!i) return !1;
|
|
575
682
|
let t = Pn(e.request, {
|
|
@@ -579,78 +686,83 @@ var $n = ({ visible: $n = !0, writeAccess: er = "unknown" }) => {
|
|
|
579
686
|
if (!t.alreadyApplied) try {
|
|
580
687
|
i.setMode(t.mode);
|
|
581
688
|
} catch {}
|
|
582
|
-
|
|
689
|
+
return l(zn(I, t, e.request.kind === "family"), {
|
|
583
690
|
kind: "theme",
|
|
584
691
|
mode: t.mode,
|
|
585
692
|
alreadyApplied: t.alreadyApplied
|
|
586
|
-
};
|
|
587
|
-
} else {
|
|
588
|
-
if (!a) return !1;
|
|
589
|
-
if (e.kind === "navigate") {
|
|
590
|
-
let { destination: t } = e, n = jn(t, window.location.pathname + window.location.search, Nn(qi.current.navItems));
|
|
591
|
-
n || a(t.path), o = In(I, t.label, n), s = {
|
|
592
|
-
kind: "navigate",
|
|
593
|
-
destinationId: t.id,
|
|
594
|
-
path: t.path,
|
|
595
|
-
alreadyHere: n
|
|
596
|
-
};
|
|
597
|
-
} else o = Fn(I, e.candidates[0]?.label ?? e.query, e.candidates), s = {
|
|
598
|
-
kind: "choose-destination",
|
|
599
|
-
candidateIds: e.candidates.map((e) => e.id)
|
|
600
|
-
};
|
|
693
|
+
});
|
|
601
694
|
}
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
695
|
+
if (!a) return !1;
|
|
696
|
+
if (e.kind === "choose-destination") return l(In(I, e.candidates[0]?.label ?? e.query, e.candidates), {
|
|
697
|
+
kind: "choose-destination",
|
|
698
|
+
candidateIds: e.candidates.map((e) => e.id)
|
|
699
|
+
});
|
|
700
|
+
if (e.kind === "back") {
|
|
701
|
+
let e = Vn.top();
|
|
702
|
+
if (!e) return !1;
|
|
703
|
+
let t = Wn(Nn(na.current.navItems), e.fromPath);
|
|
704
|
+
return u({
|
|
705
|
+
target: e.fromPath,
|
|
706
|
+
destinationId: t?.id ?? "",
|
|
707
|
+
registryPath: t?.path ?? e.fromPath,
|
|
708
|
+
via: "back",
|
|
709
|
+
pageLabel: () => t?.label ?? null,
|
|
710
|
+
onArrived: () => {
|
|
711
|
+
Vn.top() === e && Vn.pop();
|
|
712
|
+
}
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
let { destination: d } = e;
|
|
716
|
+
return jn(d, window.location.pathname + window.location.search, Nn(na.current.navItems)) ? l(Ln(I, d.label, !0), Un({
|
|
717
|
+
destinationId: d.id,
|
|
718
|
+
path: d.path,
|
|
719
|
+
alreadyHere: !0,
|
|
720
|
+
via: "named"
|
|
721
|
+
})) : u({
|
|
722
|
+
target: d.path,
|
|
723
|
+
destinationId: d.id,
|
|
724
|
+
registryPath: d.path,
|
|
725
|
+
via: "named",
|
|
726
|
+
pageLabel: () => d.label,
|
|
727
|
+
onArrived: ({ replyId: e, fromPath: t, landedPath: n }) => Vn.push({
|
|
728
|
+
fromPath: t,
|
|
729
|
+
toPath: n,
|
|
730
|
+
replyMessageId: e,
|
|
731
|
+
at: Date.now()
|
|
732
|
+
})
|
|
614
733
|
});
|
|
615
|
-
let d = F();
|
|
616
|
-
return K(c, {
|
|
617
|
-
id: d,
|
|
618
|
-
role: "assistant",
|
|
619
|
-
content: o.text,
|
|
620
|
-
timestamp: l,
|
|
621
|
-
metadata: {
|
|
622
|
-
lang: o.translated ? H : "en",
|
|
623
|
-
localAction: s,
|
|
624
|
-
...D(n)
|
|
625
|
-
}
|
|
626
|
-
}), on.recordCommittedEntries(c, [u, d], "LOCAL_COMMAND", A()), Wi(c, d), !0;
|
|
627
734
|
}, [
|
|
628
735
|
K,
|
|
629
|
-
|
|
630
|
-
|
|
736
|
+
Mi,
|
|
737
|
+
_a,
|
|
631
738
|
H,
|
|
632
|
-
|
|
633
|
-
|
|
739
|
+
Ar,
|
|
740
|
+
va,
|
|
741
|
+
$i,
|
|
634
742
|
I
|
|
635
|
-
]),
|
|
636
|
-
|
|
743
|
+
]), ba = j(async (e) => {
|
|
744
|
+
xi.current = !0;
|
|
637
745
|
try {
|
|
638
746
|
await J.declineForReply(e.conversationId, e.reason, e.origin);
|
|
639
747
|
} finally {
|
|
640
|
-
|
|
748
|
+
xi.current = !1;
|
|
641
749
|
}
|
|
642
750
|
if (e.commandText !== null) {
|
|
643
|
-
let t =
|
|
644
|
-
if (t &&
|
|
751
|
+
let t = ca(e.commandText, e.options.voiceSessionId);
|
|
752
|
+
if (t && ya(t, e.content, e.options.voiceSessionId)) return;
|
|
645
753
|
}
|
|
646
|
-
await
|
|
647
|
-
}, [
|
|
648
|
-
|
|
754
|
+
await Ca.current(e.content, e.attachments, e.options);
|
|
755
|
+
}, [
|
|
756
|
+
ca,
|
|
757
|
+
ya,
|
|
758
|
+
J
|
|
759
|
+
]), Z = j(async (e, t = [], n = {}) => {
|
|
760
|
+
let r = n.voiceSessionId !== void 0, i = b.getState(), a = !1, o = ki.current;
|
|
649
761
|
if (r && ze(o)) {
|
|
650
|
-
let e = We(o, i.activeConversationId,
|
|
762
|
+
let e = We(o, i.activeConversationId, Ni());
|
|
651
763
|
if (e.kind === "gone") return;
|
|
652
764
|
let t = n.voiceEntry ?? e;
|
|
653
|
-
t.kind === "adopt" &&
|
|
765
|
+
t.kind === "adopt" && Mi(t.conversationId), a = t.kind === "own", n = {
|
|
654
766
|
...n,
|
|
655
767
|
voiceEntry: t
|
|
656
768
|
};
|
|
@@ -659,7 +771,7 @@ var $n = ({ visible: $n = !0, writeAccess: er = "unknown" }) => {
|
|
|
659
771
|
if (c) {
|
|
660
772
|
if (ut(i.processingByConversationId[c]?.status)) {
|
|
661
773
|
let r = i.processingByConversationId[c]?.messageId ?? null;
|
|
662
|
-
r &&
|
|
774
|
+
r && Ji.current.has(r) && (Yi.current = {
|
|
663
775
|
conversationId: c,
|
|
664
776
|
content: e,
|
|
665
777
|
attachments: t,
|
|
@@ -667,9 +779,9 @@ var $n = ({ visible: $n = !0, writeAccess: er = "unknown" }) => {
|
|
|
667
779
|
});
|
|
668
780
|
return;
|
|
669
781
|
}
|
|
670
|
-
if (
|
|
782
|
+
if (Fi.current.has(c)) return;
|
|
671
783
|
}
|
|
672
|
-
if (
|
|
784
|
+
if (bi.current || te() !== null || xi.current || ia.current !== null) return;
|
|
673
785
|
let d = n.targetConversationId, ee = p(), m = (e) => nn(e) || tn(e, ee);
|
|
674
786
|
if (d !== void 0) {
|
|
675
787
|
let e = i.conversations.find((e) => e.id === d);
|
|
@@ -678,18 +790,18 @@ var $n = ({ visible: $n = !0, writeAccess: er = "unknown" }) => {
|
|
|
678
790
|
if (n.fromPerson && n.writeReplyBound === void 0) {
|
|
679
791
|
let r = d ?? s ?? null, i = n.voiceSessionId === void 0 ? "typed" : "spoken", a = Ut({
|
|
680
792
|
text: e,
|
|
681
|
-
locale: i === "spoken" ?
|
|
793
|
+
locale: i === "spoken" ? yr.input.code : H,
|
|
682
794
|
origin: i,
|
|
683
795
|
hasAttachments: t.length > 0,
|
|
684
796
|
live: J.liveFor(r),
|
|
685
|
-
matchesLocalCommand: (e) =>
|
|
797
|
+
matchesLocalCommand: (e) => ca(e, n.voiceSessionId) !== null
|
|
686
798
|
});
|
|
687
799
|
if (a.kind === "local_reply") {
|
|
688
|
-
r &&
|
|
800
|
+
r && da(r, e, a.line, a.values, n.voiceSessionId);
|
|
689
801
|
return;
|
|
690
802
|
}
|
|
691
803
|
let o = a.kind === "local" ? a.fallback : a.bound, c = a.declineAll;
|
|
692
|
-
if (c !== null && r) return
|
|
804
|
+
if (c !== null && r) return ba({
|
|
693
805
|
conversationId: r,
|
|
694
806
|
reason: c,
|
|
695
807
|
origin: i,
|
|
@@ -708,47 +820,47 @@ var $n = ({ visible: $n = !0, writeAccess: er = "unknown" }) => {
|
|
|
708
820
|
}
|
|
709
821
|
let h = n.writeReplyBound?.promptText ?? e;
|
|
710
822
|
if (n.fromPerson && t.length === 0 && n.writeReplyBound?.localCommands !== !1) {
|
|
711
|
-
let t =
|
|
712
|
-
if (t &&
|
|
823
|
+
let t = ca(e, n.voiceSessionId);
|
|
824
|
+
if (t && ya(t, e, n.voiceSessionId, a)) return;
|
|
713
825
|
}
|
|
714
|
-
let
|
|
826
|
+
let re = s ? i.conversations.find((e) => e.id === s) : void 0, g = m(re) ? void 0 : re, _ = i.autoRouting && yi.current && d === void 0 ? f({
|
|
715
827
|
intent: n.autoIntent ?? l(e),
|
|
716
828
|
dictated: r,
|
|
717
|
-
voiceProposalBound: r &&
|
|
718
|
-
conversation:
|
|
719
|
-
mode:
|
|
720
|
-
routedBy:
|
|
721
|
-
hasHistory: en(
|
|
829
|
+
voiceProposalBound: r && hr("api-calls") && ie(i.acknowledgedWriteModes, "api-calls"),
|
|
830
|
+
conversation: g ? {
|
|
831
|
+
mode: g.mode,
|
|
832
|
+
routedBy: g.routedBy,
|
|
833
|
+
hasHistory: en(g)
|
|
722
834
|
} : null
|
|
723
835
|
}) : null;
|
|
724
|
-
if (
|
|
725
|
-
|
|
836
|
+
if (_ && di.current.find((e) => e.id === _.mode)?.writeCapable && !ie(i.acknowledgedWriteModes, _.mode)) {
|
|
837
|
+
bi.current = {
|
|
726
838
|
content: e,
|
|
727
839
|
attachments: t,
|
|
728
840
|
options: n
|
|
729
|
-
},
|
|
841
|
+
}, wi(_.mode);
|
|
730
842
|
return;
|
|
731
843
|
}
|
|
732
|
-
let
|
|
733
|
-
mode:
|
|
734
|
-
backendSessionId:
|
|
844
|
+
let v = _ ? _.mode : i.mode, y, se, x = d ?? (a ? null : U), S = x ? b.getState().conversations.find((e) => e.id === x) : void 0, le = _?.action === "escalate" && g ? {
|
|
845
|
+
mode: g.mode,
|
|
846
|
+
backendSessionId: g.backendSessionId ?? null
|
|
735
847
|
} : null;
|
|
736
|
-
if (
|
|
848
|
+
if (_) _.action === "new" || !g ? x = G(void 0, v, { routedBy: "auto" }) : (x = g.id, Vr(x, v));
|
|
737
849
|
else {
|
|
738
850
|
let e = i.autoRouting ? { routedBy: "auto" } : void 0;
|
|
739
|
-
!
|
|
851
|
+
!x || m(S) || S && S.mode !== v && en(S) ? x = G(void 0, v, e) : S && S.mode !== v && (e ? Vr(x, v) : Er(x, v));
|
|
740
852
|
}
|
|
741
|
-
if (!
|
|
742
|
-
r &&
|
|
743
|
-
let
|
|
853
|
+
if (!x) return;
|
|
854
|
+
r && ki.current !== void 0 && x !== i.activeConversationId && Mi(x), n.approvalFollowUp || (Pi.current[x] = t);
|
|
855
|
+
let C = () => b.getState().conversations.some((e) => e.id === x), w = A(), T = {
|
|
744
856
|
accessToken: B(),
|
|
745
|
-
workspaceToken:
|
|
857
|
+
workspaceToken: gr(),
|
|
746
858
|
userId: V,
|
|
747
859
|
organizationId: At()
|
|
748
860
|
}, he = (e, t) => {
|
|
749
|
-
|
|
861
|
+
C() || !w || oe(e, w, t, v, {
|
|
750
862
|
accessToken: B(),
|
|
751
|
-
workspaceToken:
|
|
863
|
+
workspaceToken: gr(),
|
|
752
864
|
userId: V,
|
|
753
865
|
organizationId: At()
|
|
754
866
|
});
|
|
@@ -766,35 +878,35 @@ var $n = ({ visible: $n = !0, writeAccess: er = "unknown" }) => {
|
|
|
766
878
|
...D(n.voiceSessionId)
|
|
767
879
|
}
|
|
768
880
|
};
|
|
769
|
-
K(
|
|
881
|
+
K(x, ge);
|
|
770
882
|
let E = F();
|
|
771
|
-
K(
|
|
883
|
+
K(x, {
|
|
772
884
|
id: E,
|
|
773
885
|
role: "assistant",
|
|
774
886
|
content: "",
|
|
775
887
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
776
888
|
metadata: {
|
|
777
|
-
lang:
|
|
889
|
+
lang: Sr,
|
|
778
890
|
...D(n.voiceSessionId)
|
|
779
891
|
}
|
|
780
892
|
}), wt(E, {
|
|
781
893
|
channel: r ? "voice" : "chat",
|
|
782
|
-
mode:
|
|
894
|
+
mode: v,
|
|
783
895
|
product: L,
|
|
784
|
-
language:
|
|
896
|
+
language: Sr,
|
|
785
897
|
device: Tt(),
|
|
786
|
-
routedByAuto: !!
|
|
787
|
-
}, n.voiceTiming), k(E, "accepted"),
|
|
898
|
+
routedByAuto: !!_
|
|
899
|
+
}, n.voiceTiming), k(E, "accepted"), jr(x, "provisioning", E, null), ne(E);
|
|
788
900
|
let Oe = () => dt({
|
|
789
901
|
turnId: E,
|
|
790
|
-
abortRequested:
|
|
791
|
-
activeTurnId:
|
|
792
|
-
conversationExists:
|
|
793
|
-
}), ke = (e, t, r, i, a = !1, o =
|
|
794
|
-
|
|
902
|
+
abortRequested: Ji.current.has(E),
|
|
903
|
+
activeTurnId: b.getState().processingByConversationId[x]?.messageId ?? null,
|
|
904
|
+
conversationExists: C()
|
|
905
|
+
}), ke = (e, t, r, i, a = !1, o = Sr) => {
|
|
906
|
+
kr(x, E, { content: _e(e) }), Ar(x, E, {
|
|
795
907
|
lang: o,
|
|
796
908
|
...t?.length ? { artifacts: t } : {},
|
|
797
|
-
...t?.length || r || i ? { mode:
|
|
909
|
+
...t?.length || r || i ? { mode: v } : {},
|
|
798
910
|
...r ? { sessionId: r } : {},
|
|
799
911
|
...i ? { sandboxId: i } : {},
|
|
800
912
|
...a ? { incomplete: !0 } : {},
|
|
@@ -806,11 +918,11 @@ var $n = ({ visible: $n = !0, writeAccess: er = "unknown" }) => {
|
|
|
806
918
|
k(E, "attemptStarted");
|
|
807
919
|
let a = null, o = null, s = !1;
|
|
808
920
|
try {
|
|
809
|
-
let { sandboxId: i, sessionId: c, sessionIsNew: l, readAhead: u, sandboxIsNew: d, sandboxProbed: f, sandboxAdopted: p, deadSandboxProbe: ee, sessionPreopened: m } = await
|
|
921
|
+
let { sandboxId: i, sessionId: c, sessionIsNew: l, readAhead: u, sandboxIsNew: d, sandboxProbed: f, sandboxAdopted: p, deadSandboxProbe: ee, sessionPreopened: m } = await Hi(x, E, v, w, T, { isAbandoned: () => dt({
|
|
810
922
|
turnId: E,
|
|
811
|
-
abortRequested:
|
|
812
|
-
activeTurnId:
|
|
813
|
-
conversationExists:
|
|
923
|
+
abortRequested: Ji.current.has(E),
|
|
924
|
+
activeTurnId: b.getState().processingByConversationId[x]?.messageId ?? null,
|
|
925
|
+
conversationExists: C()
|
|
814
926
|
}).abandon });
|
|
815
927
|
if (a = i, k(E, "runtimeReady"), O(E, {
|
|
816
928
|
runtime: d ? "cold" : p ? "adopted" : f ? "probed" : m ? "preopened" : l ? "new-session" : "warm",
|
|
@@ -818,246 +930,247 @@ var $n = ({ visible: $n = !0, writeAccess: er = "unknown" }) => {
|
|
|
818
930
|
}), o = c, je.session = {
|
|
819
931
|
sandboxId: i,
|
|
820
932
|
sessionId: c
|
|
821
|
-
},
|
|
933
|
+
}, ae(v, y, b.getState().acknowledgedWriteModes, {
|
|
822
934
|
dictated: r,
|
|
823
|
-
confirmsWrites: fe(
|
|
824
|
-
proposalBound:
|
|
935
|
+
confirmsWrites: fe(v),
|
|
936
|
+
proposalBound: hr(v, i)
|
|
825
937
|
}) === "voice-in-write-mode") throw new ve("voice-in-write-mode", "Voice in a write mode");
|
|
826
|
-
let
|
|
827
|
-
conversation:
|
|
938
|
+
let te = fn({
|
|
939
|
+
conversation: b.getState().conversations.find((e) => e.id === x),
|
|
828
940
|
content: e,
|
|
829
941
|
sessionIsNew: l,
|
|
830
|
-
sendingMode:
|
|
831
|
-
sendingModeConfig:
|
|
832
|
-
modes:
|
|
942
|
+
sendingMode: v,
|
|
943
|
+
sendingModeConfig: y,
|
|
944
|
+
modes: di.current,
|
|
833
945
|
answerText: (e) => bt(e).text
|
|
834
|
-
}),
|
|
835
|
-
|
|
836
|
-
let
|
|
837
|
-
conversationId:
|
|
838
|
-
writeReply:
|
|
839
|
-
}, { prompt:
|
|
840
|
-
content:
|
|
946
|
+
}), ne = await _t(() => de(i, w, c, v, T, { limit: 50 }), l, gt(u, i, c));
|
|
947
|
+
Bi(x, E, "streaming", "thinking");
|
|
948
|
+
let re = ur?.(), g = Wt(b.getState().sandboxWriteCapabilities[i]), _ = {
|
|
949
|
+
conversationId: x,
|
|
950
|
+
writeReply: g === "proposal-v1" ? n.writeReplyBound?.writeReply ?? null : null
|
|
951
|
+
}, { prompt: ie, parts: oe } = lt({
|
|
952
|
+
content: te ? `${te}${h}` : h,
|
|
841
953
|
attachments: t,
|
|
842
|
-
limits: Ze(
|
|
843
|
-
wrapPrompt: (e) =>
|
|
954
|
+
limits: Ze(y),
|
|
955
|
+
wrapPrompt: (e) => dr?.(v, e, br, xr, r, { writeApproval: g }) ?? e,
|
|
844
956
|
requestBytes: (e, t) => pe({
|
|
845
957
|
sandboxId: i,
|
|
846
958
|
workspaceId: w,
|
|
847
959
|
sessionId: c,
|
|
848
|
-
mode:
|
|
960
|
+
mode: v,
|
|
849
961
|
prompt: e,
|
|
850
962
|
parts: t,
|
|
851
|
-
pageContext:
|
|
963
|
+
pageContext: re,
|
|
852
964
|
authContext: T,
|
|
853
|
-
...
|
|
965
|
+
..._
|
|
854
966
|
})
|
|
855
|
-
}),
|
|
856
|
-
s = qe(t) >
|
|
967
|
+
}), S = Je(oe), le = S > 0;
|
|
968
|
+
s = qe(t) > S;
|
|
857
969
|
let ye = Oe();
|
|
858
970
|
if (ye.abandon) {
|
|
859
|
-
ye.clearProcessing &&
|
|
971
|
+
ye.clearProcessing && Mr(x);
|
|
860
972
|
return;
|
|
861
973
|
}
|
|
862
974
|
try {
|
|
863
|
-
await me(i, w, c,
|
|
864
|
-
parts:
|
|
865
|
-
...
|
|
866
|
-
} :
|
|
975
|
+
await me(i, w, c, ie, v, re, T, oe?.length ? {
|
|
976
|
+
parts: oe,
|
|
977
|
+
..._
|
|
978
|
+
} : _);
|
|
867
979
|
} catch (e) {
|
|
868
|
-
if (!
|
|
869
|
-
await me(i, w, c,
|
|
980
|
+
if (!oe || !jt(e)) throw e;
|
|
981
|
+
await me(i, w, c, ie, v, re, T, _), s ||= le;
|
|
870
982
|
}
|
|
871
|
-
let be = (e) =>
|
|
983
|
+
let be = (e) => kr(x, E, { content: e }), xe = (e) => s ? `${e}\n\n${I("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;
|
|
872
984
|
k(E, "promptSent");
|
|
873
|
-
let Ce = null, Te = !1, Ee = mt, D = ht([],
|
|
985
|
+
let Ce = null, Te = !1, Ee = mt, D = ht([], ne), Ne = Date.now() + se.streamBudgetMs, Fe = Date.now(), Ie = Date.now();
|
|
874
986
|
for (; Date.now() < Ne;) {
|
|
875
987
|
he(i, c);
|
|
876
988
|
let e = Oe();
|
|
877
989
|
if (e.abandon) {
|
|
878
|
-
e.clearProcessing &&
|
|
990
|
+
e.clearProcessing && Mr(x);
|
|
879
991
|
return;
|
|
880
992
|
}
|
|
881
|
-
if (D = ht(await
|
|
993
|
+
if (D = ht(await de(i, w, c, v, T, {
|
|
882
994
|
limit: 50,
|
|
883
|
-
sinceMs:
|
|
995
|
+
sinceMs: ne,
|
|
884
996
|
surfaceTurnTerminal: !0
|
|
885
|
-
}),
|
|
997
|
+
}), ne, { accumulateNarration: se.accumulatesNarration }), kr(x, E, { content: _e(D.content) }), D.hasRenderableOutput ? Te || (Te = !0, Ce !== null && k(E, "lastQuietPoll", Ce), k(E, "firstOutput")) : Ce = Dt(), se.accumulatesNarration) D.hasText && k(E, "firstText");
|
|
886
998
|
else {
|
|
887
999
|
let e = yt(Ee, D, Dt());
|
|
888
1000
|
Ee = e.tracker, e.confirmedAt !== null && k(E, "firstText", e.confirmedAt);
|
|
889
1001
|
}
|
|
890
|
-
if (D.pendingWrite && !Ht(
|
|
1002
|
+
if (D.pendingWrite && !Ht(b.getState().sandboxWriteCapabilities[i]) && Ar(x, E, { pendingWrite: D.pendingWrite }), D.done) {
|
|
891
1003
|
k(E, "answerDone"), Y.current.markVerified(i);
|
|
892
1004
|
break;
|
|
893
1005
|
}
|
|
894
|
-
Date.now() - Fe > 3e4 && (await
|
|
1006
|
+
Date.now() - Fe > 3e4 && (await ce(i, w, 600, T).catch(() => void 0), Fe = Date.now()), await new Promise((e) => setTimeout(e, Pe(Date.now() - Ie)));
|
|
895
1007
|
}
|
|
896
1008
|
if (D.done && n.voiceSessionId !== void 0 && !Oe().abandon) {
|
|
897
1009
|
let e = _e(xe(D.content));
|
|
898
1010
|
e.trim() && (s && be(e), k(E, "speechQueued"), Me = !0, Ae.publish(E, {
|
|
899
|
-
conversationId:
|
|
1011
|
+
conversationId: x,
|
|
900
1012
|
channel: "voice",
|
|
901
1013
|
voiceSessionId: n.voiceSessionId,
|
|
902
1014
|
text: e,
|
|
903
|
-
lang:
|
|
1015
|
+
lang: Sr,
|
|
904
1016
|
final: !0
|
|
905
1017
|
}));
|
|
906
1018
|
}
|
|
907
|
-
let Le =
|
|
1019
|
+
let Le = se.producesArtifacts ? await ue(i, w, c, v, T).then((e) => e).catch(() => []) : void 0;
|
|
908
1020
|
D.usedTools !== void 0 && O(E, { usedTools: D.usedTools }), D.done || (O(E, { outcome: "timedOut" }), D = {
|
|
909
1021
|
...D,
|
|
910
|
-
content: De(D.content,
|
|
1022
|
+
content: De(D.content, v, I, y)
|
|
911
1023
|
}), s && (D = {
|
|
912
1024
|
...D,
|
|
913
1025
|
content: xe(D.content)
|
|
914
1026
|
});
|
|
915
1027
|
let Re = !D.done;
|
|
916
|
-
ke(D.content, Le, c, i, Re), D.tokens && (
|
|
1028
|
+
ke(D.content, Le, c, i, Re), D.tokens && (kr(x, E, { tokens: D.tokens }), (pr ? await we({
|
|
917
1029
|
workspaceId: w,
|
|
918
1030
|
sessionId: c,
|
|
919
1031
|
messageId: D.messageId,
|
|
920
1032
|
model: D.model,
|
|
921
1033
|
tokens: D.tokens
|
|
922
|
-
},
|
|
1034
|
+
}, pr, { ledger: Se("panel", L) }) : { ok: !0 }).ok && Jn(L)), D.done || he(i, c);
|
|
923
1035
|
let ze = Oe();
|
|
924
1036
|
if (ze.abandon) {
|
|
925
|
-
ze.clearProcessing &&
|
|
1037
|
+
ze.clearProcessing && Mr(x);
|
|
926
1038
|
return;
|
|
927
1039
|
}
|
|
928
|
-
k(E, "complete"), O(E, { outcome: "answered" }),
|
|
1040
|
+
k(E, "complete"), O(E, { outcome: "answered" }), jr(x, "complete", E, null), on.recordCommittedEntries(x, [ge.id, E], "TURN", w), Me = !1;
|
|
929
1041
|
} catch (e) {
|
|
930
|
-
Y.current.invalidate(a ??
|
|
1042
|
+
Y.current.invalidate(a ?? b.getState().sandboxesByMode[v]?.sandboxId ?? null);
|
|
931
1043
|
let t = dt({
|
|
932
1044
|
turnId: E,
|
|
933
|
-
abortRequested:
|
|
934
|
-
activeTurnId:
|
|
935
|
-
conversationExists:
|
|
1045
|
+
abortRequested: Ji.current.has(E),
|
|
1046
|
+
activeTurnId: b.getState().processingByConversationId[x]?.messageId ?? null,
|
|
1047
|
+
conversationExists: C()
|
|
936
1048
|
});
|
|
937
1049
|
if (a && o && he(a, o), t.abandon) {
|
|
938
|
-
t.clearProcessing &&
|
|
1050
|
+
t.clearProcessing && Mr(x);
|
|
939
1051
|
return;
|
|
940
1052
|
}
|
|
941
1053
|
if (i === 1 && Mt(e)) {
|
|
942
|
-
let e = a ??
|
|
943
|
-
return e && (X.current.add(e), Y.current.invalidate(e)),
|
|
1054
|
+
let e = a ?? b.getState().sandboxesByMode[v]?.sandboxId ?? null;
|
|
1055
|
+
return e && (X.current.add(e), Y.current.invalidate(e)), Pr(x), Ir(v), Or(x, E, ""), Ar(x, E, { pendingWrite: void 0 }), e && J.retireSandbox(e), Ne(), Et(E), Fe(2);
|
|
944
1056
|
}
|
|
945
1057
|
throw e;
|
|
946
1058
|
}
|
|
947
|
-
}, Ie =
|
|
948
|
-
|
|
1059
|
+
}, Ie = x;
|
|
1060
|
+
Fi.current.add(Ie);
|
|
949
1061
|
try {
|
|
950
1062
|
if (!w) throw Object.assign(/* @__PURE__ */ Error("Assistant backend is unavailable without an active workspace context."), { extensions: {
|
|
951
1063
|
code: "UNAUTHENTICATED",
|
|
952
1064
|
authFailure: "WORKSPACE_CONTEXT_MISSING"
|
|
953
1065
|
} });
|
|
954
|
-
let e = await ct(
|
|
955
|
-
|
|
956
|
-
let t =
|
|
1066
|
+
let e = await ct(v, () => di.current.find((e) => e.id === v), ui);
|
|
1067
|
+
y = e.config, se = e.capabilities;
|
|
1068
|
+
let t = y, n = Oe();
|
|
957
1069
|
if (n.abandon) {
|
|
958
|
-
n.clearProcessing &&
|
|
1070
|
+
n.clearProcessing && Mr(x);
|
|
959
1071
|
return;
|
|
960
1072
|
}
|
|
961
|
-
let i =
|
|
1073
|
+
let i = ae(v, t, b.getState().acknowledgedWriteModes, {
|
|
962
1074
|
dictated: r,
|
|
963
|
-
confirmsWrites: fe(
|
|
964
|
-
proposalBound:
|
|
1075
|
+
confirmsWrites: fe(v),
|
|
1076
|
+
proposalBound: hr(v)
|
|
965
1077
|
});
|
|
966
1078
|
if (i) throw new ve(i, i === "confirm-write-mode" ? "Write mode not confirmed" : "Voice in a write mode");
|
|
967
1079
|
let a = Se("panel", L);
|
|
968
|
-
if (
|
|
969
|
-
let e = await Te(a, w,
|
|
1080
|
+
if (pr && Ce(a, w)) {
|
|
1081
|
+
let e = await Te(a, w, pr);
|
|
970
1082
|
if (!e.ok) throw Ee(e.kind);
|
|
971
1083
|
let t = Oe();
|
|
972
1084
|
if (t.abandon) {
|
|
973
|
-
t.clearProcessing &&
|
|
1085
|
+
t.clearProcessing && Mr(x);
|
|
974
1086
|
return;
|
|
975
1087
|
}
|
|
976
1088
|
}
|
|
977
1089
|
k(E, "cleared"), await Fe();
|
|
978
1090
|
} catch (e) {
|
|
979
|
-
if (Y.current.invalidate(
|
|
980
|
-
|
|
1091
|
+
if (Y.current.invalidate(b.getState().sandboxesByMode[v]?.sandboxId ?? null), !C()) {
|
|
1092
|
+
Mr(x);
|
|
981
1093
|
return;
|
|
982
1094
|
}
|
|
983
1095
|
let t = je.session?.sandboxId ?? null, r = ye(e, { confirmsNoAction: be({
|
|
984
|
-
mode:
|
|
985
|
-
capabilities: t ?
|
|
1096
|
+
mode: v,
|
|
1097
|
+
capabilities: t ? b.getState().sandboxWriteCapabilities[t] : null
|
|
986
1098
|
}) });
|
|
987
|
-
O(E, { outcome: r.kind === "temporary" ? "failed" : "refused" }), r.offersUpgrade &&
|
|
1099
|
+
O(E, { outcome: r.kind === "temporary" ? "failed" : "refused" }), r.offersUpgrade && qn(L, "sandbox");
|
|
988
1100
|
let i = xe(r, I, { locale: H });
|
|
989
|
-
|
|
1101
|
+
jr(x, "error", E, i.headline), kr(x, E, { content: i.text }), Ar(x, E, {
|
|
990
1102
|
lang: i.translated ? H : "en",
|
|
991
1103
|
...D(n.voiceSessionId)
|
|
992
1104
|
});
|
|
993
1105
|
} finally {
|
|
994
|
-
|
|
995
|
-
let e =
|
|
996
|
-
t && (
|
|
1106
|
+
Fi.current.delete(Ie), O(E, { outcome: "stopped" }), k(E, "complete"), Ne();
|
|
1107
|
+
let e = b.getState(), t = u(le, v, e.conversations.find((e) => e.id === Ie), (t) => !!e.sandboxesByMode[t]?.sandboxId);
|
|
1108
|
+
t && (Vr(Ie, t.mode), t.backendSessionId && Nr(Ie, t.backendSessionId)), je.session && C() && J.afterTurn({
|
|
997
1109
|
...je.session,
|
|
998
1110
|
conversationId: Ie
|
|
999
1111
|
}, E);
|
|
1000
|
-
let n =
|
|
1001
|
-
|
|
1112
|
+
let n = Yi.current;
|
|
1113
|
+
Yi.current = null, n && n.conversationId === Ie && C() && Ca.current(n.content, n.attachments, n.options);
|
|
1002
1114
|
}
|
|
1003
1115
|
}, [
|
|
1004
1116
|
U,
|
|
1005
1117
|
K,
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1118
|
+
dr,
|
|
1119
|
+
Pr,
|
|
1120
|
+
Ir,
|
|
1121
|
+
Cr,
|
|
1010
1122
|
G,
|
|
1011
|
-
|
|
1123
|
+
Hi,
|
|
1012
1124
|
J,
|
|
1013
|
-
|
|
1014
|
-
|
|
1125
|
+
da,
|
|
1126
|
+
ba,
|
|
1015
1127
|
H,
|
|
1128
|
+
yr,
|
|
1129
|
+
hr,
|
|
1016
1130
|
ur,
|
|
1017
|
-
or,
|
|
1018
|
-
tr,
|
|
1019
1131
|
B,
|
|
1020
|
-
|
|
1021
|
-
|
|
1132
|
+
gr,
|
|
1133
|
+
kr,
|
|
1022
1134
|
L,
|
|
1023
|
-
|
|
1024
|
-
ir,
|
|
1025
|
-
fr,
|
|
1026
|
-
H,
|
|
1135
|
+
ui,
|
|
1027
1136
|
pr,
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
na,
|
|
1031
|
-
Ci,
|
|
1032
|
-
wi,
|
|
1033
|
-
wr,
|
|
1034
|
-
_r,
|
|
1137
|
+
xr,
|
|
1138
|
+
H,
|
|
1035
1139
|
Sr,
|
|
1036
|
-
|
|
1140
|
+
br,
|
|
1141
|
+
Vr,
|
|
1142
|
+
ya,
|
|
1143
|
+
ca,
|
|
1144
|
+
Mi,
|
|
1145
|
+
Ni,
|
|
1146
|
+
Nr,
|
|
1147
|
+
Er,
|
|
1148
|
+
jr,
|
|
1149
|
+
Mr,
|
|
1037
1150
|
I,
|
|
1038
|
-
|
|
1039
|
-
|
|
1151
|
+
Bi,
|
|
1152
|
+
Or,
|
|
1040
1153
|
V
|
|
1041
|
-
]),
|
|
1154
|
+
]), xa = j((e, t) => {
|
|
1042
1155
|
Z(e, [], t ? { autoIntent: t } : {});
|
|
1043
|
-
}, [Z]),
|
|
1044
|
-
let e = [...
|
|
1156
|
+
}, [Z]), Sa = j(() => {
|
|
1157
|
+
let e = [...Ur.chat].reverse().find((e) => e.role === "user" && !e.metadata?.localAction);
|
|
1045
1158
|
if (!e || e.metadata?.approvalFollowUp) return;
|
|
1046
|
-
let t = U ?
|
|
1159
|
+
let t = U ? Pi.current[U] ?? [] : [];
|
|
1047
1160
|
Z(e.content, t);
|
|
1048
1161
|
}, [
|
|
1049
|
-
|
|
1162
|
+
Wr,
|
|
1050
1163
|
Z,
|
|
1051
1164
|
U
|
|
1052
|
-
]),
|
|
1165
|
+
]), Ca = N(Z);
|
|
1053
1166
|
M(() => {
|
|
1054
|
-
|
|
1167
|
+
Ca.current = Z;
|
|
1055
1168
|
}, [Z]);
|
|
1056
|
-
let
|
|
1057
|
-
if (
|
|
1058
|
-
for (let e =
|
|
1059
|
-
let t =
|
|
1060
|
-
if (t?.role !== "assistant" || !Oe(t) ||
|
|
1169
|
+
let wa = er(() => {
|
|
1170
|
+
if (Gr) return null;
|
|
1171
|
+
for (let e = Wr.length - 1; e >= 0; --e) {
|
|
1172
|
+
let t = Wr[e];
|
|
1173
|
+
if (t?.role !== "assistant" || !Oe(t) || Ji.current.has(t.id)) continue;
|
|
1061
1174
|
let n = pt(t, q, I);
|
|
1062
1175
|
if (n.kind !== "output") return null;
|
|
1063
1176
|
let r = bt(n.text).text.trim();
|
|
@@ -1068,48 +1181,48 @@ var $n = ({ visible: $n = !0, writeAccess: er = "unknown" }) => {
|
|
|
1068
1181
|
}
|
|
1069
1182
|
return null;
|
|
1070
1183
|
}, [
|
|
1071
|
-
|
|
1072
|
-
|
|
1184
|
+
Wr,
|
|
1185
|
+
Gr,
|
|
1073
1186
|
q,
|
|
1074
1187
|
I
|
|
1075
|
-
]),
|
|
1076
|
-
sessionId:
|
|
1077
|
-
sandboxId:
|
|
1188
|
+
]), Ta = er(() => wa ? Fe(wa.text) : null, [wa]), Ea = Ur.chat, Da = b((e) => y(e)?.sandboxId ?? null), Oa = g(Ea, {
|
|
1189
|
+
sessionId: Hr?.backendSessionId,
|
|
1190
|
+
sandboxId: Da,
|
|
1078
1191
|
nowMs: Date.now()
|
|
1079
|
-
}),
|
|
1192
|
+
}), ka = _(Ea), Aa = (e) => {
|
|
1080
1193
|
if (Vt(e.metadata).length > 0) return !0;
|
|
1081
1194
|
let t = e.metadata?.sandboxId;
|
|
1082
|
-
return Ht(t ?
|
|
1083
|
-
},
|
|
1195
|
+
return Ht(t ? Jr[t] : null);
|
|
1196
|
+
}, ja = (e) => {
|
|
1084
1197
|
let t = Vt(e.metadata);
|
|
1085
1198
|
return t.length === 0 || !U ? null : /* @__PURE__ */ P(Bt, {
|
|
1086
1199
|
refs: t,
|
|
1087
1200
|
conversationId: U,
|
|
1088
1201
|
panel: J,
|
|
1089
|
-
entries:
|
|
1090
|
-
capabilitiesOf: (e) =>
|
|
1091
|
-
turnInFlight:
|
|
1202
|
+
entries: Yr,
|
|
1203
|
+
capabilitiesOf: (e) => Jr[e],
|
|
1204
|
+
turnInFlight: Gr,
|
|
1092
1205
|
tr: I,
|
|
1093
|
-
onReview:
|
|
1094
|
-
retiredSandboxes:
|
|
1206
|
+
onReview: Zr.review,
|
|
1207
|
+
retiredSandboxes: Xr
|
|
1095
1208
|
});
|
|
1096
|
-
},
|
|
1209
|
+
}, Ma = Zr.dialog.view ? Yr[Zr.dialog.view.proposalId] : void 0, Na = Oa?.expiresAtMs ?? null;
|
|
1097
1210
|
M(() => {
|
|
1098
|
-
if (
|
|
1099
|
-
let e = window.setTimeout(() =>
|
|
1211
|
+
if (Na === null) return;
|
|
1212
|
+
let e = window.setTimeout(() => qi((e) => e + 1), Math.max(0, Na - Date.now()));
|
|
1100
1213
|
return () => window.clearTimeout(e);
|
|
1101
|
-
}, [
|
|
1102
|
-
let Q =
|
|
1214
|
+
}, [Na, Ki]);
|
|
1215
|
+
let Q = er(() => Ur.voice.filter((e) => e.role === "user" || e.role === "assistant").map((e) => ({
|
|
1103
1216
|
id: e.id,
|
|
1104
1217
|
role: e.role,
|
|
1105
1218
|
text: Ct(e, q, I),
|
|
1106
1219
|
sessionId: ke(e),
|
|
1107
1220
|
timestamp: e.timestamp
|
|
1108
1221
|
})).filter((e) => e.text.length > 0), [
|
|
1109
|
-
|
|
1222
|
+
Ur.voice,
|
|
1110
1223
|
q,
|
|
1111
1224
|
I
|
|
1112
|
-
]),
|
|
1225
|
+
]), Pa = j(() => {
|
|
1113
1226
|
if (Q.length === 0) return;
|
|
1114
1227
|
let e = /* @__PURE__ */ new Date();
|
|
1115
1228
|
$t(Me(Q, {
|
|
@@ -1124,14 +1237,14 @@ var $n = ({ visible: $n = !0, writeAccess: er = "unknown" }) => {
|
|
|
1124
1237
|
L,
|
|
1125
1238
|
Q,
|
|
1126
1239
|
I
|
|
1127
|
-
]),
|
|
1128
|
-
|
|
1129
|
-
let
|
|
1240
|
+
]), Fa = Yn({ perFileChars: Si }), Ia = N(Fa);
|
|
1241
|
+
Ia.current = Fa;
|
|
1242
|
+
let La = N(/* @__PURE__ */ new Set()), Ra = N(() => !1), $ = kt({
|
|
1130
1243
|
onSubmit: j((e, t, n) => {
|
|
1131
|
-
let r =
|
|
1132
|
-
let a =
|
|
1244
|
+
let r = ki.current, i = Ke(r), a = () => {
|
|
1245
|
+
let a = Ia.current, o = b.getState();
|
|
1133
1246
|
if (!Be({
|
|
1134
|
-
sessionLive:
|
|
1247
|
+
sessionLive: Ra.current(t),
|
|
1135
1248
|
boundAtSubmit: r,
|
|
1136
1249
|
activeConversationId: o.activeConversationId,
|
|
1137
1250
|
boundConversationExists: o.conversations.some((e) => e.id === i)
|
|
@@ -1143,98 +1256,117 @@ var $n = ({ visible: $n = !0, writeAccess: er = "unknown" }) => {
|
|
|
1143
1256
|
...n,
|
|
1144
1257
|
handedOver: Dt()
|
|
1145
1258
|
};
|
|
1146
|
-
|
|
1259
|
+
Ca.current(e, s, {
|
|
1147
1260
|
fromPerson: !0,
|
|
1148
1261
|
voiceSessionId: t,
|
|
1149
1262
|
voiceTiming: c
|
|
1150
1263
|
}), a.clear();
|
|
1151
1264
|
};
|
|
1152
|
-
if (
|
|
1265
|
+
if ((() => {
|
|
1266
|
+
let e = b.getState();
|
|
1267
|
+
return Be({
|
|
1268
|
+
sessionLive: Ra.current(t),
|
|
1269
|
+
boundAtSubmit: r,
|
|
1270
|
+
activeConversationId: e.activeConversationId,
|
|
1271
|
+
boundConversationExists: e.conversations.some((e) => e.id === i)
|
|
1272
|
+
});
|
|
1273
|
+
})() && ua.current(e, t)) {
|
|
1274
|
+
Ca.current(e, [], {
|
|
1275
|
+
fromPerson: !0,
|
|
1276
|
+
voiceSessionId: t,
|
|
1277
|
+
voiceTiming: {
|
|
1278
|
+
...n,
|
|
1279
|
+
handedOver: Dt()
|
|
1280
|
+
}
|
|
1281
|
+
});
|
|
1282
|
+
return;
|
|
1283
|
+
}
|
|
1284
|
+
if (!Ia.current.isBusy) {
|
|
1153
1285
|
a();
|
|
1154
1286
|
return;
|
|
1155
1287
|
}
|
|
1156
|
-
let o = Date.now(), s =
|
|
1157
|
-
|
|
1288
|
+
let o = Date.now(), s = La.current, c = window.setInterval(() => {
|
|
1289
|
+
Ia.current.isBusy && Date.now() - o < ar || (window.clearInterval(c), s.delete(c), a());
|
|
1158
1290
|
}, 200);
|
|
1159
1291
|
s.add(c);
|
|
1160
1292
|
}, []),
|
|
1161
|
-
latestReply:
|
|
1162
|
-
language: Ie(
|
|
1293
|
+
latestReply: wa,
|
|
1294
|
+
language: Ie(_r, H).tag
|
|
1163
1295
|
});
|
|
1164
|
-
|
|
1165
|
-
let
|
|
1296
|
+
Ra.current = $.isCurrentSession;
|
|
1297
|
+
let za = Ai ? Q.filter((e) => e.sessionId !== void 0 && $.isCurrentSession(e.sessionId)) : Q, Ba = $.answerLocally;
|
|
1166
1298
|
M(() => {
|
|
1167
|
-
|
|
1168
|
-
}, [
|
|
1169
|
-
let
|
|
1170
|
-
|
|
1299
|
+
ma.current = Ba;
|
|
1300
|
+
}, [Ba]);
|
|
1301
|
+
let Va = $.active, Ha = er(() => it(Object.values(Yr), U, Xr), [
|
|
1302
|
+
Yr,
|
|
1171
1303
|
U,
|
|
1172
|
-
|
|
1173
|
-
]), [
|
|
1304
|
+
Xr
|
|
1305
|
+
]), [Ua, Wa] = tr(null);
|
|
1174
1306
|
M(() => {
|
|
1175
|
-
|
|
1176
|
-
}, [
|
|
1177
|
-
let
|
|
1178
|
-
let e =
|
|
1307
|
+
Va || Wa(null);
|
|
1308
|
+
}, [Va]);
|
|
1309
|
+
let Ga = Zr.review, Ka = j(() => {
|
|
1310
|
+
let e = Ha[Ha.length - 1];
|
|
1179
1311
|
if (!e) return;
|
|
1180
1312
|
let { view: t } = e;
|
|
1181
|
-
if (Lt(t) && It(t,
|
|
1182
|
-
|
|
1313
|
+
if (Lt(t) && It(t, Jr[e.session.sandboxId]).offerConfirm) {
|
|
1314
|
+
Ga(t);
|
|
1183
1315
|
return;
|
|
1184
1316
|
}
|
|
1185
|
-
|
|
1317
|
+
Wa(t.proposalId);
|
|
1186
1318
|
}, [
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
]),
|
|
1319
|
+
Ha,
|
|
1320
|
+
Jr,
|
|
1321
|
+
Ga
|
|
1322
|
+
]), qa = Va ? tt(Ha) : null, Ja = Ua ? Yr[Ua] : void 0, Ya = Va && Ja && Ja.session.conversationId === U ? {
|
|
1191
1323
|
content: /* @__PURE__ */ P(Bt, {
|
|
1192
1324
|
refs: [{
|
|
1193
|
-
proposalId:
|
|
1194
|
-
sandboxId:
|
|
1195
|
-
sessionId:
|
|
1325
|
+
proposalId: Ja.view.proposalId,
|
|
1326
|
+
sandboxId: Ja.session.sandboxId,
|
|
1327
|
+
sessionId: Ja.session.sessionId
|
|
1196
1328
|
}],
|
|
1197
|
-
conversationId:
|
|
1329
|
+
conversationId: Ja.session.conversationId,
|
|
1198
1330
|
panel: J,
|
|
1199
|
-
entries:
|
|
1200
|
-
capabilitiesOf: (e) =>
|
|
1201
|
-
turnInFlight:
|
|
1331
|
+
entries: Yr,
|
|
1332
|
+
capabilitiesOf: (e) => Jr[e],
|
|
1333
|
+
turnInFlight: Gr,
|
|
1202
1334
|
tr: I,
|
|
1203
|
-
onReview:
|
|
1204
|
-
retiredSandboxes:
|
|
1335
|
+
onReview: Ga,
|
|
1336
|
+
retiredSandboxes: Xr
|
|
1205
1337
|
}),
|
|
1206
1338
|
closeLabel: at(I, $e.trayClose),
|
|
1207
|
-
onClose: () =>
|
|
1208
|
-
} : null,
|
|
1339
|
+
onClose: () => Wa(null)
|
|
1340
|
+
} : null, Xa = Zr.asking, Za = fa?.asking === !0, Qa = $.holdListening;
|
|
1209
1341
|
M(() => {
|
|
1210
|
-
|
|
1342
|
+
Qa(Va && (Xa || Za));
|
|
1211
1343
|
}, [
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1344
|
+
Va,
|
|
1345
|
+
Xa,
|
|
1346
|
+
Za,
|
|
1347
|
+
Qa
|
|
1216
1348
|
]);
|
|
1217
|
-
let
|
|
1349
|
+
let $a = N(null), eo = $.announce;
|
|
1218
1350
|
M(() => {
|
|
1219
|
-
if (!
|
|
1220
|
-
|
|
1351
|
+
if (!Va) {
|
|
1352
|
+
$a.current = null;
|
|
1221
1353
|
return;
|
|
1222
1354
|
}
|
|
1223
|
-
let e =
|
|
1355
|
+
let e = $a.current;
|
|
1224
1356
|
if (e === null) {
|
|
1225
|
-
|
|
1357
|
+
$a.current = new Set(Object.keys(Yr));
|
|
1226
1358
|
return;
|
|
1227
1359
|
}
|
|
1228
|
-
for (let { view: t, session: n } of rt(
|
|
1360
|
+
for (let { view: t, session: n } of rt(Ha, e)) {
|
|
1229
1361
|
e.add(t.proposalId);
|
|
1230
|
-
let r =
|
|
1362
|
+
let r = Jr[n.sandboxId];
|
|
1231
1363
|
if (!et({
|
|
1232
1364
|
mode: "api-calls",
|
|
1233
1365
|
productWriteApproval: z,
|
|
1234
1366
|
capabilities: r
|
|
1235
1367
|
})) continue;
|
|
1236
1368
|
let i = ot(t, It(t, r).offerConfirm, I), a = t.proposalId;
|
|
1237
|
-
|
|
1369
|
+
eo({
|
|
1238
1370
|
id: `write-readback:${a}`,
|
|
1239
1371
|
text: i.text,
|
|
1240
1372
|
lang: i.translated ? H : "en",
|
|
@@ -1242,36 +1374,36 @@ var $n = ({ visible: $n = !0, writeAccess: er = "unknown" }) => {
|
|
|
1242
1374
|
});
|
|
1243
1375
|
}
|
|
1244
1376
|
}, [
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1377
|
+
Va,
|
|
1378
|
+
Ha,
|
|
1379
|
+
Yr,
|
|
1380
|
+
Jr,
|
|
1249
1381
|
z,
|
|
1250
1382
|
I,
|
|
1251
1383
|
H,
|
|
1252
|
-
|
|
1384
|
+
eo,
|
|
1253
1385
|
J
|
|
1254
1386
|
]);
|
|
1255
|
-
let
|
|
1387
|
+
let to = N(!1);
|
|
1256
1388
|
M(() => {
|
|
1257
|
-
|
|
1389
|
+
to.current = $.active;
|
|
1258
1390
|
}, [$.active]), M(() => ee((e) => {
|
|
1259
|
-
if (!
|
|
1260
|
-
let t =
|
|
1261
|
-
return typeof t == "string" ? t === e :
|
|
1391
|
+
if (!to.current) return !1;
|
|
1392
|
+
let t = ki.current;
|
|
1393
|
+
return typeof t == "string" ? t === e : b.getState().activeConversationId === e;
|
|
1262
1394
|
}), []);
|
|
1263
|
-
let
|
|
1264
|
-
let e =
|
|
1265
|
-
|
|
1395
|
+
let no = $.start, ro = j(() => {
|
|
1396
|
+
let e = b.getState().activeConversationId, t = Ue(Ni());
|
|
1397
|
+
Mi(Ge(t, e)), Ui(!0, t.kind === "own"), no();
|
|
1266
1398
|
}, [
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
]),
|
|
1272
|
-
let e =
|
|
1399
|
+
Mi,
|
|
1400
|
+
Ui,
|
|
1401
|
+
Ni,
|
|
1402
|
+
no
|
|
1403
|
+
]), io = er(() => St(Hr?.messages ?? []), [Hr?.messages]), ao = xt(Ur.voice, q, I), oo = xt(io, q, I) > 0, so = j(() => {
|
|
1404
|
+
let e = b.getState().activeConversationId;
|
|
1273
1405
|
if (!e || Q.length === 0) return;
|
|
1274
|
-
let t = new Set(
|
|
1406
|
+
let t = new Set(io.map((e) => e.id)), n = F();
|
|
1275
1407
|
K(e, {
|
|
1276
1408
|
id: n,
|
|
1277
1409
|
role: "system",
|
|
@@ -1281,247 +1413,247 @@ var $n = ({ visible: $n = !0, writeAccess: er = "unknown" }) => {
|
|
|
1281
1413
|
more: (e) => I("voiceSession.continuedMore", "…and {{count}} more", { count: e })
|
|
1282
1414
|
}),
|
|
1283
1415
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1284
|
-
metadata: { continuedVoiceTurns:
|
|
1285
|
-
}), on.recordCommittedEntries(e, [n], "NOTE", A()),
|
|
1416
|
+
metadata: { continuedVoiceTurns: ao }
|
|
1417
|
+
}), on.recordCommittedEntries(e, [n], "NOTE", A()), Oi(!1), $.end();
|
|
1286
1418
|
}, [
|
|
1287
1419
|
Q,
|
|
1288
|
-
|
|
1289
|
-
|
|
1420
|
+
ao,
|
|
1421
|
+
io,
|
|
1290
1422
|
K,
|
|
1291
1423
|
I,
|
|
1292
1424
|
$,
|
|
1293
|
-
|
|
1294
|
-
]),
|
|
1425
|
+
Oi
|
|
1426
|
+
]), co = N({
|
|
1295
1427
|
conversationId: null,
|
|
1296
1428
|
count: 0
|
|
1297
1429
|
});
|
|
1298
1430
|
M(() => {
|
|
1299
|
-
$.active && (
|
|
1431
|
+
$.active && (co.current = {
|
|
1300
1432
|
conversationId: U,
|
|
1301
|
-
count:
|
|
1433
|
+
count: ao
|
|
1302
1434
|
});
|
|
1303
1435
|
}, [$.active]);
|
|
1304
|
-
let
|
|
1305
|
-
let e =
|
|
1306
|
-
$.end(), t &&
|
|
1436
|
+
let lo = j(() => {
|
|
1437
|
+
let e = co.current, t = ao > (e.conversationId === U ? e.count : 0);
|
|
1438
|
+
$.end(), t && Oi(!0);
|
|
1307
1439
|
}, [
|
|
1308
1440
|
U,
|
|
1309
|
-
|
|
1441
|
+
ao,
|
|
1310
1442
|
$,
|
|
1311
|
-
|
|
1443
|
+
Oi
|
|
1312
1444
|
]);
|
|
1313
1445
|
M(() => {
|
|
1314
|
-
(
|
|
1446
|
+
(!cr || !zi) && $.active && $.end();
|
|
1315
1447
|
}, [
|
|
1316
|
-
|
|
1317
|
-
|
|
1448
|
+
cr,
|
|
1449
|
+
zi,
|
|
1318
1450
|
$
|
|
1319
1451
|
]), M(() => {
|
|
1320
|
-
let e =
|
|
1452
|
+
let e = ki.current, t = Ke(e), n = b.getState(), r = He({
|
|
1321
1453
|
sessionLive: $.active,
|
|
1322
1454
|
bound: e,
|
|
1323
1455
|
activeConversationId: n.activeConversationId,
|
|
1324
1456
|
boundConversationExists: n.conversations.some((e) => e.id === t)
|
|
1325
1457
|
});
|
|
1326
|
-
|
|
1458
|
+
Mi(r.bound), r.end && $.end();
|
|
1327
1459
|
}, [
|
|
1328
1460
|
$,
|
|
1329
1461
|
U,
|
|
1330
|
-
|
|
1331
|
-
|
|
1462
|
+
Cr,
|
|
1463
|
+
Mi
|
|
1332
1464
|
]);
|
|
1333
|
-
let
|
|
1465
|
+
let uo = N(Re);
|
|
1334
1466
|
M(() => {
|
|
1335
|
-
let e = Ve(
|
|
1467
|
+
let e = Ve(uo.current, {
|
|
1336
1468
|
activeConversationId: U,
|
|
1337
|
-
chatTurnCount:
|
|
1469
|
+
chatTurnCount: Ea.length,
|
|
1338
1470
|
voiceTurnCount: Q.length,
|
|
1339
1471
|
sessionLive: $.active,
|
|
1340
|
-
sessionBoundTo:
|
|
1341
|
-
turnInFlight:
|
|
1472
|
+
sessionBoundTo: ki.current,
|
|
1473
|
+
turnInFlight: Gr
|
|
1342
1474
|
});
|
|
1343
|
-
|
|
1475
|
+
uo.current = e.state, e.open && Oi(!0);
|
|
1344
1476
|
}, [
|
|
1345
1477
|
U,
|
|
1346
|
-
|
|
1478
|
+
Ea.length,
|
|
1347
1479
|
Q.length,
|
|
1348
1480
|
$.active,
|
|
1349
|
-
|
|
1350
|
-
|
|
1481
|
+
Gr,
|
|
1482
|
+
Oi
|
|
1351
1483
|
]), M(() => {
|
|
1352
1484
|
if (!$.active) {
|
|
1353
|
-
|
|
1354
|
-
for (let e of
|
|
1355
|
-
|
|
1485
|
+
Ia.current.clear(), Yi.current = null;
|
|
1486
|
+
for (let e of La.current) window.clearInterval(e);
|
|
1487
|
+
La.current.clear();
|
|
1356
1488
|
}
|
|
1357
1489
|
}, [$.active]), M(() => {
|
|
1358
|
-
let e =
|
|
1490
|
+
let e = La.current;
|
|
1359
1491
|
return () => {
|
|
1360
1492
|
for (let t of e) window.clearInterval(t);
|
|
1361
1493
|
e.clear();
|
|
1362
1494
|
};
|
|
1363
1495
|
}, []), M(() => {
|
|
1364
|
-
let e =
|
|
1365
|
-
return e &&
|
|
1496
|
+
let e = b.getState().consumePendingPrompt();
|
|
1497
|
+
return e && Ca.current(e), b.subscribe((e, t) => {
|
|
1366
1498
|
if (e.pendingPrompt && e.pendingPrompt !== t.pendingPrompt) {
|
|
1367
|
-
let e =
|
|
1368
|
-
e &&
|
|
1499
|
+
let e = b.getState().consumePendingPrompt();
|
|
1500
|
+
e && Ca.current(e);
|
|
1369
1501
|
}
|
|
1370
1502
|
});
|
|
1371
1503
|
}, []);
|
|
1372
|
-
let
|
|
1373
|
-
let t = U ?
|
|
1504
|
+
let fo = j((e) => {
|
|
1505
|
+
let t = U ? b.getState().conversations.find((e) => e.id === U) : void 0;
|
|
1374
1506
|
if (t && t.mode !== e && J.withdraw(t.id, "mode_switched"), t && en(t)) {
|
|
1375
1507
|
if (t.mode !== e) {
|
|
1376
|
-
let t = p(), n =
|
|
1377
|
-
n ?
|
|
1508
|
+
let t = p(), n = b.getState().conversations.find((n) => n.mode === e && rn(n, t) && !b.getState().processingByConversationId[n.id]);
|
|
1509
|
+
n ? Dr(n.id) : G(void 0, e);
|
|
1378
1510
|
}
|
|
1379
|
-
} else U &&
|
|
1380
|
-
let n =
|
|
1381
|
-
n ?
|
|
1511
|
+
} else U && Er(U, e);
|
|
1512
|
+
let n = b.getState().activeConversationId;
|
|
1513
|
+
n ? Er(n, e) : Br(!1), Tr(e);
|
|
1382
1514
|
}, [
|
|
1383
1515
|
U,
|
|
1384
1516
|
G,
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1517
|
+
Dr,
|
|
1518
|
+
Br,
|
|
1519
|
+
Er,
|
|
1520
|
+
Tr,
|
|
1389
1521
|
J
|
|
1390
|
-
]),
|
|
1391
|
-
let e =
|
|
1522
|
+
]), po = j(() => {
|
|
1523
|
+
let e = b.getState(), t = e.activeConversationId ? e.conversations.find((t) => t.id === e.activeConversationId) : void 0;
|
|
1392
1524
|
if (!t) {
|
|
1393
|
-
|
|
1525
|
+
Br(!0), Tr(s);
|
|
1394
1526
|
return;
|
|
1395
1527
|
}
|
|
1396
1528
|
if (t.routedBy === "auto") {
|
|
1397
|
-
|
|
1529
|
+
Br(!0);
|
|
1398
1530
|
return;
|
|
1399
1531
|
}
|
|
1400
1532
|
if (!en(t)) {
|
|
1401
|
-
|
|
1533
|
+
Vr(t.id, s);
|
|
1402
1534
|
return;
|
|
1403
1535
|
}
|
|
1404
1536
|
J.withdraw(t.id, "mode_switched");
|
|
1405
1537
|
let n = p(), r = e.conversations.find((t) => t.routedBy === "auto" && rn(t, n) && !e.processingByConversationId[t.id]);
|
|
1406
|
-
r ? (
|
|
1538
|
+
r ? (Dr(r.id), Vr(r.id, s)) : G(void 0, s, { routedBy: "auto" });
|
|
1407
1539
|
}, [
|
|
1408
1540
|
G,
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1541
|
+
Vr,
|
|
1542
|
+
Dr,
|
|
1543
|
+
Br,
|
|
1544
|
+
Tr,
|
|
1413
1545
|
J
|
|
1414
|
-
]),
|
|
1415
|
-
if (R.find((t) => t.id === e)?.writeCapable && !
|
|
1416
|
-
|
|
1546
|
+
]), mo = j((e) => {
|
|
1547
|
+
if (R.find((t) => t.id === e)?.writeCapable && !ie(b.getState().acknowledgedWriteModes, e)) {
|
|
1548
|
+
wi(e);
|
|
1417
1549
|
return;
|
|
1418
1550
|
}
|
|
1419
|
-
|
|
1420
|
-
}, [
|
|
1421
|
-
let e =
|
|
1422
|
-
if (
|
|
1423
|
-
let t =
|
|
1424
|
-
if (
|
|
1425
|
-
|
|
1551
|
+
fo(e);
|
|
1552
|
+
}, [fo, R]), ho = j(() => {
|
|
1553
|
+
let e = Ci;
|
|
1554
|
+
if (wi(null), !e) return;
|
|
1555
|
+
let t = bi.current;
|
|
1556
|
+
if (bi.current = null, t) {
|
|
1557
|
+
Rr(e), Z(t.content, t.attachments, t.options);
|
|
1426
1558
|
return;
|
|
1427
1559
|
}
|
|
1428
|
-
|
|
1560
|
+
Rr(e), fo(e);
|
|
1429
1561
|
}, [
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1562
|
+
Ci,
|
|
1563
|
+
Rr,
|
|
1564
|
+
fo,
|
|
1433
1565
|
Z
|
|
1434
|
-
]),
|
|
1435
|
-
|
|
1436
|
-
let e =
|
|
1437
|
-
|
|
1566
|
+
]), go = Ci === null ? void 0 : R.find((e) => e.id === Ci) ?? { id: Ci }, _o = j(() => {
|
|
1567
|
+
wi(null);
|
|
1568
|
+
let e = bi.current;
|
|
1569
|
+
bi.current = null, e && Z(e.content, e.attachments, {
|
|
1438
1570
|
...e.options,
|
|
1439
1571
|
autoIntent: "read"
|
|
1440
1572
|
});
|
|
1441
1573
|
}, [Z]);
|
|
1442
|
-
return /* @__PURE__ */
|
|
1574
|
+
return /* @__PURE__ */ rr("div", {
|
|
1443
1575
|
className: "relative flex flex-1 flex-col overflow-hidden",
|
|
1444
1576
|
children: [
|
|
1445
|
-
/* @__PURE__ */
|
|
1577
|
+
/* @__PURE__ */ rr("div", {
|
|
1446
1578
|
className: "contents",
|
|
1447
1579
|
inert: $.active || void 0,
|
|
1448
1580
|
children: [
|
|
1449
|
-
|
|
1581
|
+
si === null ? null : /* @__PURE__ */ P(Jt, { onDismiss: () => oi(si) }),
|
|
1450
1582
|
Q.length > 0 && !$.active ? /* @__PURE__ */ P(Kt, {
|
|
1451
1583
|
count: Q.length,
|
|
1452
|
-
onOpenTranscript: () =>
|
|
1584
|
+
onOpenTranscript: () => Oi(!0)
|
|
1453
1585
|
}) : null,
|
|
1454
|
-
|
|
1455
|
-
state:
|
|
1456
|
-
onRetry:
|
|
1457
|
-
}) :
|
|
1586
|
+
Ea.length === 0 && (ni || ri) ? /* @__PURE__ */ P(Yt, {
|
|
1587
|
+
state: ni ? "loading" : "failed",
|
|
1588
|
+
onRetry: fi
|
|
1589
|
+
}) : Ea.length === 0 && Hr?.sync?.hasOlder ? /* @__PURE__ */ P("div", {
|
|
1458
1590
|
className: "flex min-h-0 flex-1 flex-col",
|
|
1459
1591
|
children: /* @__PURE__ */ P(Zt, {
|
|
1460
|
-
onShowEarlier:
|
|
1461
|
-
disabled:
|
|
1592
|
+
onShowEarlier: pi,
|
|
1593
|
+
disabled: ni
|
|
1462
1594
|
})
|
|
1463
|
-
}) :
|
|
1595
|
+
}) : Ea.length === 0 ? /* @__PURE__ */ P(sn, {
|
|
1464
1596
|
mode: W,
|
|
1465
|
-
onSuggestionClick:
|
|
1466
|
-
explainsAuto:
|
|
1467
|
-
suggestions:
|
|
1468
|
-
}) : /* @__PURE__ */
|
|
1597
|
+
onSuggestionClick: xa,
|
|
1598
|
+
explainsAuto: vi,
|
|
1599
|
+
suggestions: vi && W === "assistant" ? c(R.find((e) => e.id === "assistant")?.suggestions ?? [], R.find((e) => e.id === "api-calls")?.suggestions ?? []) : void 0
|
|
1600
|
+
}) : /* @__PURE__ */ rr("div", {
|
|
1469
1601
|
className: "flex min-h-0 flex-1 flex-col",
|
|
1470
|
-
children: [
|
|
1471
|
-
onShowEarlier:
|
|
1472
|
-
disabled:
|
|
1602
|
+
children: [Hr?.sync?.hasOlder ? /* @__PURE__ */ P(Zt, {
|
|
1603
|
+
onShowEarlier: pi,
|
|
1604
|
+
disabled: ni
|
|
1473
1605
|
}) : null, /* @__PURE__ */ P(mn, {
|
|
1474
|
-
onApprovePendingWrite:
|
|
1475
|
-
approvingWriteRef:
|
|
1476
|
-
approvableMessageId:
|
|
1477
|
-
retryableMessageId:
|
|
1478
|
-
messages:
|
|
1606
|
+
onApprovePendingWrite: Zi,
|
|
1607
|
+
approvingWriteRef: Gi,
|
|
1608
|
+
approvableMessageId: Oa?.messageId ?? null,
|
|
1609
|
+
retryableMessageId: ka,
|
|
1610
|
+
messages: Ea,
|
|
1479
1611
|
processing: q ?? null,
|
|
1480
|
-
streamingMessageId:
|
|
1481
|
-
failedMessageId:
|
|
1482
|
-
onRetry:
|
|
1483
|
-
renderWriteProposals:
|
|
1484
|
-
hidesLegacyWriteCard:
|
|
1612
|
+
streamingMessageId: Kr,
|
|
1613
|
+
failedMessageId: qr,
|
|
1614
|
+
onRetry: Gi === null ? Sa : void 0,
|
|
1615
|
+
renderWriteProposals: ja,
|
|
1616
|
+
hidesLegacyWriteCard: Aa
|
|
1485
1617
|
})]
|
|
1486
1618
|
}),
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1619
|
+
ei ? /* @__PURE__ */ P(Xt, { onStartNew: () => G() }) : null,
|
|
1620
|
+
ti && U ? /* @__PURE__ */ P(qt, { onUnarchive: () => on.updateConversation(U, { archived: !1 }) }) : null,
|
|
1621
|
+
ha === null ? null : /* @__PURE__ */ P(cn, {
|
|
1490
1622
|
tr: I,
|
|
1491
|
-
onDismiss: () =>
|
|
1623
|
+
onDismiss: () => ga(null)
|
|
1492
1624
|
}),
|
|
1493
|
-
|
|
1494
|
-
state:
|
|
1495
|
-
onRetry:
|
|
1625
|
+
Ea.length > 0 && (ni || ri) ? /* @__PURE__ */ P(Yt, {
|
|
1626
|
+
state: ni ? "loading" : "failed",
|
|
1627
|
+
onRetry: fi,
|
|
1496
1628
|
compact: !0
|
|
1497
1629
|
}) : null,
|
|
1498
|
-
/* @__PURE__ */ P(
|
|
1499
|
-
onStartVoiceSession: $.available &&
|
|
1630
|
+
/* @__PURE__ */ P(Xn, {
|
|
1631
|
+
onStartVoiceSession: $.available && zi ? ro : void 0,
|
|
1500
1632
|
onSend: (e, t) => void Z(e, t, { fromPerson: !0 }),
|
|
1501
|
-
onDraftStart:
|
|
1502
|
-
disabled:
|
|
1503
|
-
readOnly:
|
|
1633
|
+
onDraftStart: Wi,
|
|
1634
|
+
disabled: Gr || Gi !== null || ni || aa,
|
|
1635
|
+
readOnly: ei,
|
|
1504
1636
|
placeholder: W === "api-calls" ? I("chatArea.placeholderActions", "What would you like me to do?") : I("chatArea.placeholderGeneral", "Ask me anything…"),
|
|
1505
1637
|
mode: W,
|
|
1506
|
-
writeAccessDenied:
|
|
1507
|
-
availableModes:
|
|
1508
|
-
attachmentCharsPerFile:
|
|
1509
|
-
onModeChange:
|
|
1510
|
-
auto:
|
|
1511
|
-
active:
|
|
1512
|
-
onSelect:
|
|
1638
|
+
writeAccessDenied: lr === "denied" && !!Ii?.writeCapable,
|
|
1639
|
+
availableModes: gi,
|
|
1640
|
+
attachmentCharsPerFile: Si,
|
|
1641
|
+
onModeChange: mo,
|
|
1642
|
+
auto: _i ? {
|
|
1643
|
+
active: vi,
|
|
1644
|
+
onSelect: po
|
|
1513
1645
|
} : void 0
|
|
1514
1646
|
})
|
|
1515
1647
|
]
|
|
1516
1648
|
}),
|
|
1517
|
-
|
|
1649
|
+
Di && !$.active ? /* @__PURE__ */ P(Qt, {
|
|
1518
1650
|
turns: Q,
|
|
1519
|
-
onClose: () =>
|
|
1520
|
-
onSave:
|
|
1521
|
-
onContinueInChat:
|
|
1651
|
+
onClose: () => Oi(!1),
|
|
1652
|
+
onSave: Pa,
|
|
1653
|
+
onContinueInChat: oo ? so : void 0,
|
|
1522
1654
|
closeOnEscape: !0,
|
|
1523
|
-
onShowEarlier:
|
|
1524
|
-
showEarlierDisabled:
|
|
1655
|
+
onShowEarlier: Hr?.sync?.hasOlder ? pi : void 0,
|
|
1656
|
+
showEarlierDisabled: ni
|
|
1525
1657
|
}) : null,
|
|
1526
1658
|
$.active && /* @__PURE__ */ P(hn, {
|
|
1527
1659
|
session: $.session,
|
|
@@ -1529,46 +1661,46 @@ var $n = ({ visible: $n = !0, writeAccess: er = "unknown" }) => {
|
|
|
1529
1661
|
capturing: $.capturing,
|
|
1530
1662
|
interrupting: $.interrupting,
|
|
1531
1663
|
awaitingEndpoint: $.awaitingEndpoint,
|
|
1532
|
-
turns:
|
|
1664
|
+
turns: za,
|
|
1533
1665
|
spokenChunks: $.spokenChunks,
|
|
1534
|
-
attachments:
|
|
1535
|
-
onAttachFiles:
|
|
1536
|
-
onRemoveAttachment:
|
|
1537
|
-
onRetryAttachment:
|
|
1538
|
-
canAttachMore:
|
|
1539
|
-
preparingAttachments:
|
|
1540
|
-
onSaveTranscript:
|
|
1541
|
-
onContinueInChat:
|
|
1666
|
+
attachments: Fa.attachments,
|
|
1667
|
+
onAttachFiles: Fa.addFiles,
|
|
1668
|
+
onRemoveAttachment: Fa.remove,
|
|
1669
|
+
onRetryAttachment: Fa.retry,
|
|
1670
|
+
canAttachMore: Fa.canAddMore,
|
|
1671
|
+
preparingAttachments: Fa.preparingCount,
|
|
1672
|
+
onSaveTranscript: Pa,
|
|
1673
|
+
onContinueInChat: so,
|
|
1542
1674
|
onInterrupt: () => {
|
|
1543
|
-
$.interrupt(),
|
|
1675
|
+
$.interrupt(), Xi();
|
|
1544
1676
|
},
|
|
1545
|
-
spoken:
|
|
1677
|
+
spoken: Ta,
|
|
1546
1678
|
onToggleMute: $.toggleMute,
|
|
1547
|
-
onEnd:
|
|
1548
|
-
proposalChip:
|
|
1549
|
-
label: nt(
|
|
1550
|
-
onOpen:
|
|
1679
|
+
onEnd: lo,
|
|
1680
|
+
proposalChip: qa ? {
|
|
1681
|
+
label: nt(qa, I),
|
|
1682
|
+
onOpen: Ka
|
|
1551
1683
|
} : null,
|
|
1552
|
-
proposalTray:
|
|
1684
|
+
proposalTray: Ya
|
|
1553
1685
|
}),
|
|
1554
|
-
/* @__PURE__ */ P(
|
|
1555
|
-
open:
|
|
1556
|
-
mode:
|
|
1557
|
-
currentMode:
|
|
1558
|
-
onConfirm:
|
|
1559
|
-
onCancel:
|
|
1686
|
+
/* @__PURE__ */ P(Qn, {
|
|
1687
|
+
open: Ci !== null,
|
|
1688
|
+
mode: go,
|
|
1689
|
+
currentMode: Ii ?? { id: W },
|
|
1690
|
+
onConfirm: ho,
|
|
1691
|
+
onCancel: _o
|
|
1560
1692
|
}),
|
|
1561
1693
|
/* @__PURE__ */ P(Rt, {
|
|
1562
|
-
...
|
|
1563
|
-
view:
|
|
1564
|
-
serverNow:
|
|
1565
|
-
arrivedAt:
|
|
1566
|
-
capabilities:
|
|
1567
|
-
turnInFlight:
|
|
1694
|
+
...Zr.dialog,
|
|
1695
|
+
view: Ma?.view ?? Zr.dialog.view,
|
|
1696
|
+
serverNow: Ma?.serverNow ?? NaN,
|
|
1697
|
+
arrivedAt: Ma?.arrivedAt ?? NaN,
|
|
1698
|
+
capabilities: Ma ? Jr[Ma.session.sandboxId] : null,
|
|
1699
|
+
turnInFlight: Gr,
|
|
1568
1700
|
tr: I
|
|
1569
1701
|
})
|
|
1570
1702
|
]
|
|
1571
1703
|
});
|
|
1572
1704
|
};
|
|
1573
1705
|
//#endregion
|
|
1574
|
-
export {
|
|
1706
|
+
export { cr as AssistantChatArea };
|