@burdenoff/fe-libs 2026.919.1 → 2026.920.2
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/adminModeSendGate.d.ts +43 -0
- package/dist/shared/assistant/adminModeSendGate.d.ts.map +1 -1
- package/dist/shared/assistant/adminModeSendGate.js +33 -18
- package/dist/shared/assistant/api.d.ts +17 -0
- package/dist/shared/assistant/api.d.ts.map +1 -1
- package/dist/shared/assistant/api.js +88 -66
- package/dist/shared/assistant/attachmentTurn.d.ts +21 -0
- package/dist/shared/assistant/attachmentTurn.d.ts.map +1 -0
- package/dist/shared/assistant/attachmentTurn.js +48 -0
- package/dist/shared/assistant/attachments.d.ts +85 -6
- package/dist/shared/assistant/attachments.d.ts.map +1 -1
- package/dist/shared/assistant/attachments.js +165 -112
- package/dist/shared/assistant/conversation.d.ts +21 -0
- package/dist/shared/assistant/conversation.d.ts.map +1 -1
- package/dist/shared/assistant/documentExtract.d.ts +11 -2
- package/dist/shared/assistant/documentExtract.d.ts.map +1 -1
- package/dist/shared/assistant/documentExtract.js +39 -37
- package/dist/shared/assistant/gatewayLimits.d.ts +10 -0
- package/dist/shared/assistant/gatewayLimits.d.ts.map +1 -1
- package/dist/shared/assistant/gatewayLimits.js +2 -2
- package/dist/shared/assistant/i18nManifest.d.ts +5 -0
- package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
- package/dist/shared/assistant/i18nManifest.js +6 -1
- package/dist/shared/assistant/index.d.ts +2 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/modeCapabilities.d.ts +25 -0
- package/dist/shared/assistant/modeCapabilities.d.ts.map +1 -1
- package/dist/shared/assistant/modeCapabilities.js +6 -2
- package/dist/shared/assistant/store.d.ts +26 -5
- package/dist/shared/assistant/store.d.ts.map +1 -1
- package/dist/shared/assistant/store.js +28 -18
- package/dist/shared/assistant/ui/AssistantApiCallsConsentDialog.d.ts +27 -10
- package/dist/shared/assistant/ui/AssistantApiCallsConsentDialog.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantApiCallsConsentDialog.js +22 -16
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +305 -272
- package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +12 -0
- package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts.map +1 -1
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +57 -57
- package/dist/shared/assistant/useAssistantAttachments.d.ts +12 -1
- package/dist/shared/assistant/useAssistantAttachments.d.ts.map +1 -1
- package/dist/shared/assistant/useAssistantAttachments.js +98 -98
- package/dist/shared/assistant/writeModeConsent.d.ts +99 -0
- package/dist/shared/assistant/writeModeConsent.d.ts.map +1 -0
- package/dist/shared/assistant/writeModeConsent.js +48 -0
- package/dist/shared-assistant.js +116 -114
- package/package.json +1 -1
|
@@ -4,58 +4,61 @@ import "../../../shared-providers-shell.js";
|
|
|
4
4
|
import { useAssistantProduct as n } from "../product.js";
|
|
5
5
|
import { useAssistantTr as r } from "../i18n.js";
|
|
6
6
|
import { describeQuotaError as i } from "../quota.js";
|
|
7
|
-
import { abortAssistantTurn as a, approvePendingWrite as o, createAssistantSandbox as s, createAssistantSession as ee, extendAssistantSandboxTTL as c, findExistingSandbox as l, getAssistantArtifacts as te, getAssistantMessages as ne, getAssistantSession as u,
|
|
8
|
-
import { getRawMessageCreatedAt as
|
|
9
|
-
import { findAssistantModeConfig as oe, resolveAssistantModeCapabilities as m } from "../modeCapabilities.js";
|
|
7
|
+
import { abortAssistantTurn as a, approvePendingWrite as o, createAssistantSandbox as s, createAssistantSession as ee, extendAssistantSandboxTTL as c, findExistingSandbox as l, getAssistantArtifacts as te, getAssistantMessages as ne, getAssistantSession as u, modeRequiresConfirmWrites as d, promptGatewayRequestBytes as re, releaseSupersededAssistantSandboxes as f, sendAssistantPromptAsync as ie, waitForAssistantServiceReady as p, waitForSandboxRunning as m } from "../api.js";
|
|
8
|
+
import { getRawMessageCreatedAt as ae, sanitize as oe } from "../progress.js";
|
|
10
9
|
import { withIncompleteTurnNotice as se } from "../streamBudget.js";
|
|
11
|
-
import { isVoiceTurn as
|
|
12
|
-
import { buildContinuedFromVoiceNote as
|
|
10
|
+
import { isVoiceTurn as h, voiceMarker as g, voiceSessionIdOf as _ } from "../voice/turnVisibility.js";
|
|
11
|
+
import { buildContinuedFromVoiceNote as ce, buildVoiceTranscriptMarkdown as le, voiceTranscriptFilename as v } from "../voice/voiceTranscript.js";
|
|
13
12
|
import { pollDelayMs as ue } from "../voice/assistantPollSchedule.js";
|
|
14
13
|
import { toCaptionText as de } from "../voice/captionText.js";
|
|
15
14
|
import { resolveAssistantLanguage as fe } from "../voice/languages.js";
|
|
16
15
|
import { resolveLanguagePair as pe } from "../voice/languagePair.js";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
16
|
+
import { countInlineImageCandidates as me, countInlinedImageParts as he, getSendableAttachments as ge, largestInlineCharsPerFile as _e, resolveAssistantInlineLimits as ve, toMessageAttachment as ye } from "../attachments.js";
|
|
17
|
+
import { createAdminModeAccessGate as be, resolveAssistantSendModeAfterAccess as xe } from "../adminModeSendGate.js";
|
|
18
|
+
import { buildBoundedAttachmentTurn as Se } from "../attachmentTurn.js";
|
|
19
|
+
import { isWriteModeAcknowledged as Ce, writeModeSendRefusal as we } from "../writeModeConsent.js";
|
|
20
|
+
import { resolveActiveModeSandbox as Te, useAssistantStore as y } from "../store.js";
|
|
21
|
+
import { isTurnInFlight as Ee, planAbandonedTurn as De, planTurnAbort as Oe } from "../turnState.js";
|
|
22
|
+
import { getAssistantDisplayContent as ke } from "../displayContent.js";
|
|
23
|
+
import { buildAssistantProgress as Ae } from "../turnProgress.js";
|
|
24
|
+
import { parseToolActivity as je } from "./AssistantToolActivity.js";
|
|
25
|
+
import { countSpokenTurns as Me, spokenTurnText as Ne } from "../spokenTurns.js";
|
|
26
|
+
import { useVoiceSession as Pe } from "./useVoiceSession.js";
|
|
27
|
+
import { getOrganizationId as Fe, getWorkspaceId as Ie } from "../context.js";
|
|
28
|
+
import { createReadinessTracker as Le } from "../sandboxReadiness.js";
|
|
29
|
+
import { AssistantSpokenTurnsNotice as Re } from "./AssistantSpokenTurnsNotice.js";
|
|
30
|
+
import { VoiceTranscriptDrawer as ze } from "./voice/VoiceTranscriptDrawer.js";
|
|
31
|
+
import { downloadFile as Be } from "../exportConversation.js";
|
|
32
|
+
import { AssistantEmptyState as Ve } from "./AssistantEmptyState.js";
|
|
33
|
+
import { AssistantMessageList as He } from "./AssistantMessageList.js";
|
|
34
|
+
import { AssistantVoiceSession as Ue } from "./voice/AssistantVoiceSession.js";
|
|
35
|
+
import { useAssistantApiAccess as We } from "../useAssistantApiAccess.js";
|
|
36
|
+
import { useConversationTurns as Ge } from "../useConversationTurns.js";
|
|
37
|
+
import { isMultimodalBodyRejection as Ke, isRecoverableAssistantError as qe } from "../transportErrors.js";
|
|
38
|
+
import { dispatchAssistantQuotaExhausted as Je, notifyAiCreditsUpdated as Ye } from "../aiCredits.js";
|
|
39
|
+
import { useAssistantAttachments as Xe } from "../useAssistantAttachments.js";
|
|
40
|
+
import { AssistantComposer as Ze } from "./composer/AssistantComposer.js";
|
|
41
|
+
import { isProdRuntime as Qe } from "../env.js";
|
|
42
|
+
import { AssistantApiCallsConsentDialog as $e } from "./AssistantApiCallsConsentDialog.js";
|
|
43
|
+
import { useCallback as b, useEffect as x, useMemo as S, useRef as C, useState as et } from "react";
|
|
44
|
+
import { jsx as w, jsxs as tt } from "react/jsx-runtime";
|
|
44
45
|
//#region src/shared/assistant/ui/AssistantChatArea.tsx
|
|
45
|
-
var
|
|
46
|
-
function
|
|
46
|
+
var nt = 600, rt = 2e4;
|
|
47
|
+
function it() {
|
|
47
48
|
return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
48
49
|
}
|
|
49
|
-
var
|
|
50
|
-
let T = r(), { product: E, modes: D, gatherPageContext:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
]),
|
|
50
|
+
var at = ({ visible: at = !0, writeAccess: ot = "unknown" }) => {
|
|
51
|
+
let T = r(), { product: E, modes: D, gatherPageContext: st, buildPrompt: ct, reportTokenUsage: lt } = n(), { getAccessToken: O, getWorkspaceToken: k, userId: A } = t(), { locale: ut } = e(), dt = y((e) => e.assistantLanguage), ft = y((e) => e.replyLanguage), pt = S(() => pe(dt, ft, ut), [
|
|
52
|
+
dt,
|
|
53
|
+
ft,
|
|
54
|
+
ut
|
|
55
|
+
]), mt = pt.reply.english, ht = pt.replyIsExplicit, gt = pt.reply.code, { conversations: _t, activeConversationId: j, mode: M, processingByConversationId: vt, setMode: yt, setConversationMode: bt, setActiveConversation: xt, createConversation: N, addMessage: P, updateMessage: St, patchMessage: F, mergeMessageMetadata: Ct, setConversationProcessing: I, clearConversationProcessing: wt, setBackendSessionId: Tt, clearBackendSessionId: Et, setSandbox: L, clearSandbox: Dt, acknowledgedWriteModes: Ot, acknowledgeWriteMode: kt } = y(), At = _t.find((e) => e.id === j), R = Ge(At), jt = R.all, z = j ? vt[j] : void 0, Mt = Ee(z?.status), Nt = Mt ? z?.messageId ?? null : null, Pt = z?.status === "error" ? z.messageId : null, { canUseApiCalls: B, loading: V } = We(Fe()), H = C(be({
|
|
55
56
|
loading: V,
|
|
56
57
|
canUseAdminModes: B
|
|
57
|
-
})).current;
|
|
58
|
+
})).current, Ft = C(D);
|
|
58
59
|
x(() => {
|
|
60
|
+
Ft.current = D;
|
|
61
|
+
}, [D]), x(() => {
|
|
59
62
|
H.update({
|
|
60
63
|
loading: V,
|
|
61
64
|
canUseAdminModes: B
|
|
@@ -67,35 +70,40 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
67
70
|
]), x(() => () => {
|
|
68
71
|
H.abandon();
|
|
69
72
|
}, [H]);
|
|
70
|
-
let
|
|
73
|
+
let It = S(() => D.filter((e) => !e.requiresAdmin || B), [D, B]), Lt = _e(D), [U, Rt] = et(null), [zt, Bt] = et(!1), Vt = C({}), W = C(Le()), Ht = C(/* @__PURE__ */ new Set()), Ut = C(/* @__PURE__ */ new Set()), G = S(() => D.find((e) => e.id === M), [D, M]), Wt = M === "assistant" || G !== void 0 && !G.writeCapable && !d(M);
|
|
71
74
|
x(() => {
|
|
72
|
-
|
|
75
|
+
if (M !== "assistant" && G?.writeCapable && !Ce(Ot, M)) {
|
|
76
|
+
yt("assistant");
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
V || (!G || G.requiresAdmin && !B) && M !== "assistant" && yt("assistant");
|
|
73
80
|
}, [
|
|
74
81
|
M,
|
|
75
|
-
|
|
82
|
+
G,
|
|
76
83
|
B,
|
|
77
84
|
V,
|
|
78
|
-
|
|
85
|
+
yt,
|
|
86
|
+
Ot
|
|
79
87
|
]);
|
|
80
|
-
let
|
|
88
|
+
let K = b((e, t, n, r) => {
|
|
81
89
|
I(e, n, t, null, r);
|
|
82
|
-
}, [I]),
|
|
90
|
+
}, [I]), Gt = b(async (e, t, n, r, i) => {
|
|
83
91
|
let a = y.getState().sandboxesByMode[n]?.sandboxId ?? null, o = async (e) => {
|
|
84
|
-
if (
|
|
92
|
+
if (W.current.isFresh(e)) return !0;
|
|
85
93
|
try {
|
|
86
|
-
return await
|
|
94
|
+
return await m(e, r, i, 3e5), await p(e, r, n, i, 9e4), W.current.markVerified(e), !0;
|
|
87
95
|
} catch {
|
|
88
|
-
return
|
|
96
|
+
return W.current.invalidate(e), Ht.current.add(e), !1;
|
|
89
97
|
}
|
|
90
98
|
};
|
|
91
|
-
if (a && (L(n, a, "provisioning"),
|
|
92
|
-
|
|
93
|
-
let s = await l(r, E, n,
|
|
94
|
-
s && (L(n, s, "provisioning"),
|
|
99
|
+
if (a && (L(n, a, "provisioning"), K(e, t, "provisioning", "reusingEnvironment"), await o(a) || (L(n, null, "provisioning"), a = null)), !a) {
|
|
100
|
+
K(e, t, "provisioning", "lookingForEnvironment");
|
|
101
|
+
let s = await l(r, E, n, Qe(), i, Ht.current);
|
|
102
|
+
s && (L(n, s, "provisioning"), K(e, t, "provisioning", "reusingEnvironment"), await o(s) ? a = s : L(n, null, "provisioning"));
|
|
95
103
|
}
|
|
96
104
|
if (!a) {
|
|
97
105
|
if (n === "api-calls" && !O()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
|
|
98
|
-
|
|
106
|
+
K(e, t, "provisioning", "startingEnvironment"), L(n, null, "provisioning"), await f(r, E, n, Qe(), i, Ht.current), a = await s(E, n, r, Qe(), nt, i), L(n, a, "provisioning"), await m(a, r, i, 3e5), await p(a, r, n, i, 9e4);
|
|
99
107
|
}
|
|
100
108
|
L(n, a, "running");
|
|
101
109
|
let c = y.getState().conversations.find((t) => t.id === e)?.backendSessionId ?? null;
|
|
@@ -103,72 +111,72 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
103
111
|
let e = await u(a, r, c, n, i);
|
|
104
112
|
if (e.mode !== n) throw Error(`Session mode mismatch: expected ${n}, received ${e.mode}`);
|
|
105
113
|
} catch {
|
|
106
|
-
|
|
114
|
+
Et(e), c = null;
|
|
107
115
|
}
|
|
108
|
-
return c || (
|
|
116
|
+
return c || (K(e, t, "connecting", "preparingSession"), c = (await ee(a, r, n, i)).sessionId, Tt(e, c)), {
|
|
109
117
|
sandboxId: a,
|
|
110
118
|
sessionId: c
|
|
111
119
|
};
|
|
112
120
|
}, [
|
|
113
|
-
|
|
121
|
+
Et,
|
|
114
122
|
O,
|
|
115
123
|
E,
|
|
116
|
-
|
|
124
|
+
Tt,
|
|
117
125
|
L,
|
|
118
|
-
|
|
119
|
-
]), [
|
|
126
|
+
K
|
|
127
|
+
]), [Kt, qt] = et(null), q = C(/* @__PURE__ */ new Set()), Jt = C(null), Yt = b(() => {
|
|
120
128
|
let e = y.getState(), t = e.activeConversationId;
|
|
121
129
|
if (!t) return;
|
|
122
|
-
let n = e.processingByConversationId[t], r =
|
|
123
|
-
if (!
|
|
130
|
+
let n = e.processingByConversationId[t], r = Ee(n?.status) ? n?.messageId ?? null : null;
|
|
131
|
+
if (!Oe({
|
|
124
132
|
interruptedTurnId: r,
|
|
125
133
|
activeTurnId: r,
|
|
126
|
-
alreadyRequested: r ?
|
|
134
|
+
alreadyRequested: r ? q.current.has(r) : !1
|
|
127
135
|
}).send || !r) return;
|
|
128
|
-
|
|
129
|
-
let i =
|
|
136
|
+
q.current.add(r);
|
|
137
|
+
let i = Te(e), o = Ie(), s = e.conversations.find((e) => e.id === t)?.backendSessionId;
|
|
130
138
|
!i || !o || !s || a(i.sandboxId, o, s, i.mode, {
|
|
131
139
|
accessToken: O(),
|
|
132
140
|
workspaceToken: k(),
|
|
133
141
|
userId: A,
|
|
134
|
-
organizationId:
|
|
142
|
+
organizationId: Fe()
|
|
135
143
|
});
|
|
136
144
|
}, [
|
|
137
145
|
A,
|
|
138
146
|
O,
|
|
139
147
|
k
|
|
140
|
-
]),
|
|
141
|
-
let t = y.getState(), n =
|
|
148
|
+
]), Xt = b(async (e) => {
|
|
149
|
+
let t = y.getState(), n = Te(t), r = Ie(), i = t.activeConversationId;
|
|
142
150
|
if (!(!n || !r || !i)) {
|
|
143
|
-
|
|
151
|
+
qt(e);
|
|
144
152
|
try {
|
|
145
153
|
await o(n.sandboxId, r, e, n.mode, {
|
|
146
154
|
accessToken: O(),
|
|
147
155
|
workspaceToken: k(),
|
|
148
156
|
userId: A,
|
|
149
|
-
organizationId:
|
|
157
|
+
organizationId: Fe()
|
|
150
158
|
});
|
|
151
159
|
} catch (e) {
|
|
152
|
-
|
|
153
|
-
id:
|
|
160
|
+
qt(null), P(i, {
|
|
161
|
+
id: it(),
|
|
154
162
|
role: "system",
|
|
155
163
|
content: e instanceof Error ? e.message : "The change could not be approved.",
|
|
156
164
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
157
165
|
});
|
|
158
166
|
return;
|
|
159
167
|
}
|
|
160
|
-
|
|
168
|
+
qt(null), Y.current(T("pendingWrite.approvedPrompt", "I approved that change — go ahead."));
|
|
161
169
|
}
|
|
162
170
|
}, [
|
|
163
171
|
A,
|
|
164
172
|
P,
|
|
165
173
|
T
|
|
166
|
-
]),
|
|
174
|
+
]), J = b(async (e, t = [], n = {}) => {
|
|
167
175
|
let r = n.voiceSessionId !== void 0, a = y.getState(), o = a.activeConversationId ?? j;
|
|
168
176
|
if (o) {
|
|
169
|
-
if (
|
|
177
|
+
if (Ee(a.processingByConversationId[o]?.status)) {
|
|
170
178
|
let r = a.processingByConversationId[o]?.messageId ?? null;
|
|
171
|
-
r &&
|
|
179
|
+
r && q.current.has(r) && (Jt.current = {
|
|
172
180
|
conversationId: o,
|
|
173
181
|
content: e,
|
|
174
182
|
attachments: t,
|
|
@@ -176,194 +184,212 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
176
184
|
});
|
|
177
185
|
return;
|
|
178
186
|
}
|
|
179
|
-
if (
|
|
187
|
+
if (Ut.current.has(o)) return;
|
|
180
188
|
}
|
|
181
|
-
let s = a.mode, ee
|
|
182
|
-
if (u ?
|
|
183
|
-
|
|
184
|
-
let
|
|
189
|
+
let s = a.mode, ee, l, u = j, f = u ? y.getState().conversations.find((e) => e.id === u) : void 0;
|
|
190
|
+
if (u ? f && f.mode !== s && (f.messages.length > 0 || f.backendSessionId) ? u = N(void 0, s) : f && f.mode !== s && bt(u, s) : u = N(void 0, s), !u) return;
|
|
191
|
+
Vt.current[u] = t;
|
|
192
|
+
let p = Ie(), m = {
|
|
185
193
|
accessToken: O(),
|
|
186
194
|
workspaceToken: k(),
|
|
187
195
|
userId: A,
|
|
188
|
-
organizationId:
|
|
189
|
-
},
|
|
190
|
-
id:
|
|
196
|
+
organizationId: Fe()
|
|
197
|
+
}, h = {
|
|
198
|
+
id: it(),
|
|
191
199
|
role: "user",
|
|
192
200
|
content: e,
|
|
193
201
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
194
202
|
metadata: {
|
|
195
203
|
...t.length ? { attachments: t.map(ye) } : {},
|
|
196
|
-
...
|
|
204
|
+
...g(n.voiceSessionId)
|
|
197
205
|
}
|
|
198
206
|
};
|
|
199
|
-
P(u,
|
|
200
|
-
let
|
|
207
|
+
P(u, h);
|
|
208
|
+
let _ = it();
|
|
201
209
|
P(u, {
|
|
202
|
-
id:
|
|
210
|
+
id: _,
|
|
203
211
|
role: "assistant",
|
|
204
212
|
content: "",
|
|
205
213
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
206
214
|
metadata: {
|
|
207
|
-
lang:
|
|
208
|
-
...
|
|
215
|
+
lang: gt,
|
|
216
|
+
...g(n.voiceSessionId)
|
|
209
217
|
}
|
|
210
|
-
}), I(u, "provisioning",
|
|
211
|
-
let
|
|
212
|
-
F(u,
|
|
218
|
+
}), I(u, "provisioning", _, null);
|
|
219
|
+
let ce = (e, t, r, i, a = gt) => {
|
|
220
|
+
F(u, _, { content: oe(e) }), Ct(u, _, {
|
|
213
221
|
lang: a,
|
|
214
222
|
...t?.length ? { artifacts: t } : {},
|
|
215
223
|
...t?.length || r || i ? { mode: s } : {},
|
|
216
224
|
...r ? { sessionId: r } : {},
|
|
217
225
|
...i ? { sandboxId: i } : {},
|
|
218
|
-
...
|
|
226
|
+
...g(n.voiceSessionId)
|
|
219
227
|
});
|
|
220
|
-
},
|
|
228
|
+
}, le = async (n = 1) => {
|
|
221
229
|
let i = !1;
|
|
222
230
|
try {
|
|
223
|
-
let { sandboxId: n, sessionId: a } = await
|
|
224
|
-
|
|
225
|
-
let d =
|
|
226
|
-
|
|
231
|
+
let { sandboxId: n, sessionId: a } = await Gt(u, _, s, p, m), o = (await ne(n, p, a, s, m, { limit: 50 }).catch(() => [])).reduce((e, t) => Math.max(e, ae(t)), 0);
|
|
232
|
+
K(u, _, "streaming", "thinking");
|
|
233
|
+
let d = st?.(), { prompt: f, parts: h } = Se({
|
|
234
|
+
content: e,
|
|
235
|
+
attachments: t,
|
|
236
|
+
limits: ve(ee),
|
|
237
|
+
wrapPrompt: (e) => ct?.(s, e, mt, ht, r) ?? e,
|
|
238
|
+
requestBytes: (e, t) => re({
|
|
239
|
+
sandboxId: n,
|
|
240
|
+
workspaceId: p,
|
|
241
|
+
sessionId: a,
|
|
242
|
+
mode: s,
|
|
243
|
+
prompt: e,
|
|
244
|
+
parts: t,
|
|
245
|
+
pageContext: d,
|
|
246
|
+
authContext: m
|
|
247
|
+
})
|
|
248
|
+
}), g = he(h), le = g > 0;
|
|
249
|
+
i = me(t) > g;
|
|
227
250
|
try {
|
|
228
|
-
await
|
|
251
|
+
await ie(n, p, a, f, s, d, m, h?.length ? { parts: h } : void 0);
|
|
229
252
|
} catch (e) {
|
|
230
|
-
if (!
|
|
231
|
-
await
|
|
253
|
+
if (!h || !Ke(e)) throw e;
|
|
254
|
+
await ie(n, p, a, f, s, d, m, void 0), i ||= le;
|
|
232
255
|
}
|
|
233
|
-
let v =
|
|
234
|
-
turnId:
|
|
235
|
-
abortRequested:
|
|
256
|
+
let v = Ae([], o), de = Date.now() + l.streamBudgetMs, fe = Date.now(), pe = Date.now(), ge = () => De({
|
|
257
|
+
turnId: _,
|
|
258
|
+
abortRequested: q.current.has(_),
|
|
236
259
|
activeTurnId: y.getState().processingByConversationId[u]?.messageId ?? null
|
|
237
260
|
});
|
|
238
261
|
for (; Date.now() < de;) {
|
|
239
|
-
let e =
|
|
262
|
+
let e = ge();
|
|
240
263
|
if (e.abandon) {
|
|
241
|
-
e.clearProcessing &&
|
|
264
|
+
e.clearProcessing && wt(u);
|
|
242
265
|
return;
|
|
243
266
|
}
|
|
244
|
-
if (v =
|
|
267
|
+
if (v = Ae(await ne(n, p, a, s, m, {
|
|
245
268
|
limit: 50,
|
|
246
269
|
sinceMs: o
|
|
247
|
-
}), o, { accumulateNarration: l.accumulatesNarration }), F(u,
|
|
248
|
-
Date.now() - fe > 3e4 && (await c(n,
|
|
270
|
+
}), o, { accumulateNarration: l.accumulatesNarration }), F(u, _, { content: oe(v.content) }), v.pendingWrite && Ct(u, _, { pendingWrite: v.pendingWrite }), v.done) break;
|
|
271
|
+
Date.now() - fe > 3e4 && (await c(n, p, 600, m).catch(() => void 0), fe = Date.now()), await new Promise((e) => setTimeout(e, ue(Date.now() - pe)));
|
|
249
272
|
}
|
|
250
|
-
let
|
|
273
|
+
let _e = l.producesArtifacts ? await te(n, p, a, s, m).then((e) => e).catch(() => []) : void 0;
|
|
251
274
|
if (v.done || (v = {
|
|
252
275
|
...v,
|
|
253
276
|
content: se(v.content, s, T, ee)
|
|
254
277
|
}), i && (v = {
|
|
255
278
|
...v,
|
|
256
279
|
content: `${v.content}\n\n${T("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._")}`
|
|
257
|
-
}),
|
|
258
|
-
F(u,
|
|
280
|
+
}), ce(v.content, _e, a, n), v.tokens) {
|
|
281
|
+
F(u, _, { tokens: v.tokens });
|
|
259
282
|
try {
|
|
260
|
-
await
|
|
261
|
-
workspaceId:
|
|
283
|
+
await lt?.({
|
|
284
|
+
workspaceId: p,
|
|
262
285
|
sessionId: a,
|
|
263
286
|
messageId: v.messageId,
|
|
264
287
|
model: v.model,
|
|
265
288
|
tokens: v.tokens
|
|
266
|
-
}),
|
|
289
|
+
}), Ye(E);
|
|
267
290
|
} catch {}
|
|
268
291
|
}
|
|
269
|
-
let
|
|
270
|
-
if (
|
|
271
|
-
|
|
292
|
+
let ye = ge();
|
|
293
|
+
if (ye.abandon) {
|
|
294
|
+
ye.clearProcessing && wt(u);
|
|
272
295
|
return;
|
|
273
296
|
}
|
|
274
|
-
I(u, "complete",
|
|
297
|
+
I(u, "complete", _, null);
|
|
275
298
|
} catch (e) {
|
|
276
|
-
let t =
|
|
277
|
-
turnId:
|
|
278
|
-
abortRequested:
|
|
299
|
+
let t = De({
|
|
300
|
+
turnId: _,
|
|
301
|
+
abortRequested: q.current.has(_),
|
|
279
302
|
activeTurnId: y.getState().processingByConversationId[u]?.messageId ?? null
|
|
280
303
|
});
|
|
281
304
|
if (t.abandon) {
|
|
282
|
-
t.clearProcessing &&
|
|
305
|
+
t.clearProcessing && wt(u);
|
|
283
306
|
return;
|
|
284
307
|
}
|
|
285
|
-
if (n === 1 &&
|
|
308
|
+
if (n === 1 && qe(e)) {
|
|
286
309
|
let e = y.getState().sandboxesByMode[s]?.sandboxId ?? null;
|
|
287
|
-
return e && (
|
|
310
|
+
return e && (Ht.current.add(e), W.current.invalidate(e)), Et(u), Dt(s), St(u, _, ""), Ct(u, _, { pendingWrite: void 0 }), le(2);
|
|
288
311
|
}
|
|
289
312
|
throw e;
|
|
290
313
|
}
|
|
291
314
|
}, v = u;
|
|
292
|
-
|
|
315
|
+
Ut.current.add(v);
|
|
293
316
|
try {
|
|
294
|
-
if (!
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
317
|
+
if (!p) throw Error("Assistant backend is unavailable without an active workspace context.");
|
|
318
|
+
let e = await xe(s, () => Ft.current.find((e) => e.id === s), H);
|
|
319
|
+
ee = e.config, l = e.capabilities;
|
|
320
|
+
let t = we(s, ee, y.getState().acknowledgedWriteModes, {
|
|
321
|
+
dictated: r,
|
|
322
|
+
confirmsWrites: d(s)
|
|
323
|
+
});
|
|
324
|
+
if (t) throw Error(t);
|
|
325
|
+
await le();
|
|
299
326
|
} catch (e) {
|
|
300
|
-
|
|
327
|
+
W.current.invalidate(y.getState().sandboxesByMode[s]?.sandboxId ?? null);
|
|
301
328
|
let t = i(e);
|
|
302
329
|
if (t) {
|
|
303
|
-
t.refusal === "exhausted" &&
|
|
330
|
+
t.refusal === "exhausted" && Je(E, "sandbox");
|
|
304
331
|
let e = [t.quotaName, t.traceId ? `reference ${t.traceId}` : null].filter(Boolean).join(" · "), n = t.refusal === "exhausted" ? "You've reached your sandbox limit on the current plan. Upgrade to start the AI assistant." : "This workspace has no sandbox allowance provisioned, so the AI assistant cannot start. Upgrading will not help — ask an administrator to provision it.";
|
|
305
|
-
|
|
332
|
+
ce(e ? `${n}\n\n${e}` : n, void 0, void 0, void 0, "en"), I(u, "error", _, null);
|
|
306
333
|
return;
|
|
307
334
|
}
|
|
308
335
|
let r = e instanceof Error ? e.message : "Something went wrong";
|
|
309
|
-
I(u, "error",
|
|
336
|
+
I(u, "error", _, r), F(u, _, { content: `Sorry, an error occurred: ${r}. Please try again.` }), Ct(u, _, {
|
|
310
337
|
lang: "en",
|
|
311
|
-
...
|
|
338
|
+
...g(n.voiceSessionId)
|
|
312
339
|
});
|
|
313
340
|
} finally {
|
|
314
|
-
|
|
315
|
-
let e =
|
|
316
|
-
|
|
341
|
+
Ut.current.delete(v);
|
|
342
|
+
let e = Jt.current;
|
|
343
|
+
Jt.current = null, e && e.conversationId === v && Y.current(e.content, e.attachments, e.options);
|
|
317
344
|
}
|
|
318
345
|
}, [
|
|
319
346
|
j,
|
|
320
347
|
P,
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
348
|
+
ct,
|
|
349
|
+
Et,
|
|
350
|
+
Dt,
|
|
351
|
+
_t,
|
|
325
352
|
N,
|
|
326
|
-
|
|
327
|
-
|
|
353
|
+
Gt,
|
|
354
|
+
st,
|
|
328
355
|
O,
|
|
329
356
|
k,
|
|
330
357
|
F,
|
|
331
358
|
E,
|
|
332
|
-
D,
|
|
333
359
|
H,
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
360
|
+
lt,
|
|
361
|
+
ht,
|
|
362
|
+
gt,
|
|
363
|
+
mt,
|
|
364
|
+
Tt,
|
|
365
|
+
bt,
|
|
340
366
|
I,
|
|
341
|
-
|
|
367
|
+
wt,
|
|
342
368
|
T,
|
|
343
|
-
|
|
344
|
-
|
|
369
|
+
K,
|
|
370
|
+
St,
|
|
345
371
|
A
|
|
346
|
-
]),
|
|
347
|
-
|
|
348
|
-
}, [
|
|
349
|
-
let e = [...R.chat].reverse().find((e) => e.role === "user"), t = j ?
|
|
350
|
-
e &&
|
|
372
|
+
]), Zt = b((e) => {
|
|
373
|
+
J(e);
|
|
374
|
+
}, [J]), Qt = b(() => {
|
|
375
|
+
let e = [...R.chat].reverse().find((e) => e.role === "user"), t = j ? Vt.current[j] ?? [] : [];
|
|
376
|
+
e && J(e.content, t);
|
|
351
377
|
}, [
|
|
352
|
-
|
|
353
|
-
|
|
378
|
+
jt,
|
|
379
|
+
J,
|
|
354
380
|
j
|
|
355
|
-
]),
|
|
381
|
+
]), Y = C(J);
|
|
356
382
|
x(() => {
|
|
357
|
-
|
|
358
|
-
}, [
|
|
359
|
-
let
|
|
360
|
-
if (
|
|
361
|
-
for (let e =
|
|
362
|
-
let t =
|
|
363
|
-
if (t?.role !== "assistant" || !
|
|
364
|
-
let n =
|
|
383
|
+
Y.current = J;
|
|
384
|
+
}, [J]);
|
|
385
|
+
let $t = S(() => {
|
|
386
|
+
if (Mt) return null;
|
|
387
|
+
for (let e = jt.length - 1; e >= 0; --e) {
|
|
388
|
+
let t = jt[e];
|
|
389
|
+
if (t?.role !== "assistant" || !h(t) || q.current.has(t.id)) continue;
|
|
390
|
+
let n = ke(t, z, T);
|
|
365
391
|
if (n.kind !== "output") return null;
|
|
366
|
-
let r =
|
|
392
|
+
let r = je(n.text).text.trim();
|
|
367
393
|
return r ? {
|
|
368
394
|
id: t.id,
|
|
369
395
|
text: r
|
|
@@ -371,24 +397,24 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
371
397
|
}
|
|
372
398
|
return null;
|
|
373
399
|
}, [
|
|
374
|
-
|
|
375
|
-
|
|
400
|
+
jt,
|
|
401
|
+
Mt,
|
|
376
402
|
z,
|
|
377
403
|
T
|
|
378
|
-
]),
|
|
404
|
+
]), en = S(() => $t ? de($t.text) : null, [$t]), tn = R.chat, X = S(() => R.voice.filter((e) => e.role === "user" || e.role === "assistant").map((e) => ({
|
|
379
405
|
id: e.id,
|
|
380
406
|
role: e.role,
|
|
381
|
-
text:
|
|
382
|
-
sessionId:
|
|
407
|
+
text: Ne(e, z, T),
|
|
408
|
+
sessionId: _(e),
|
|
383
409
|
timestamp: e.timestamp
|
|
384
410
|
})).filter((e) => e.text.length > 0), [
|
|
385
411
|
R.voice,
|
|
386
412
|
z,
|
|
387
413
|
T
|
|
388
|
-
]),
|
|
389
|
-
if (
|
|
414
|
+
]), nn = b(() => {
|
|
415
|
+
if (X.length === 0) return;
|
|
390
416
|
let e = /* @__PURE__ */ new Date();
|
|
391
|
-
|
|
417
|
+
Be(le(X, {
|
|
392
418
|
title: T("voiceSession.transcript", "Voice conversation"),
|
|
393
419
|
savedAt: T("voiceSession.savedAt", "Saved"),
|
|
394
420
|
session: T("voiceSession.sessionLabel", "Session"),
|
|
@@ -398,173 +424,180 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
398
424
|
}, e), v(E, e), "text/markdown");
|
|
399
425
|
}, [
|
|
400
426
|
E,
|
|
401
|
-
|
|
427
|
+
X,
|
|
402
428
|
T
|
|
403
|
-
]),
|
|
404
|
-
|
|
405
|
-
let Q =
|
|
429
|
+
]), Z = Xe({ perFileChars: Lt }), rn = C(Z);
|
|
430
|
+
rn.current = Z;
|
|
431
|
+
let Q = Pe({
|
|
406
432
|
onSubmit: b((e, t) => {
|
|
407
433
|
let n = () => {
|
|
408
|
-
let n =
|
|
409
|
-
|
|
434
|
+
let n = rn.current, r = ge(n.attachments);
|
|
435
|
+
Y.current(e, r, { voiceSessionId: t }), n.clear();
|
|
410
436
|
};
|
|
411
|
-
if (!
|
|
437
|
+
if (!rn.current.isBusy) {
|
|
412
438
|
n();
|
|
413
439
|
return;
|
|
414
440
|
}
|
|
415
441
|
let r = Date.now(), i = window.setInterval(() => {
|
|
416
|
-
|
|
442
|
+
rn.current.isBusy && Date.now() - r < rt || (window.clearInterval(i), n());
|
|
417
443
|
}, 200);
|
|
418
444
|
}, []),
|
|
419
|
-
latestReply:
|
|
420
|
-
language: fe(
|
|
421
|
-
}),
|
|
445
|
+
latestReply: $t,
|
|
446
|
+
language: fe(dt, ut).tag
|
|
447
|
+
}), an = S(() => (At?.messages ?? []).reduce((e, t) => Math.max(e, t.metadata?.continuedVoiceTurns ?? 0), 0), [At?.messages]), $ = Me(R.voice, z, T), on = $ > an, sn = b(() => {
|
|
422
448
|
let e = y.getState().activeConversationId;
|
|
423
|
-
!e ||
|
|
424
|
-
id:
|
|
449
|
+
!e || X.length === 0 || (P(e, {
|
|
450
|
+
id: it(),
|
|
425
451
|
role: "system",
|
|
426
|
-
content:
|
|
452
|
+
content: ce(X.slice(an), {
|
|
427
453
|
intro: T("voiceSession.continuedIntro", "Continued from a voice conversation. You asked about:"),
|
|
428
454
|
nothing: T("voiceSession.continuedNothing", "Continued from a voice conversation."),
|
|
429
455
|
more: (e) => T("voiceSession.continuedMore", "…and {{count}} more", { count: e })
|
|
430
456
|
}),
|
|
431
457
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
432
458
|
metadata: { continuedVoiceTurns: $ }
|
|
433
|
-
}),
|
|
459
|
+
}), Bt(!1), Q.end());
|
|
434
460
|
}, [
|
|
435
|
-
|
|
461
|
+
X,
|
|
436
462
|
$,
|
|
437
|
-
|
|
463
|
+
an,
|
|
438
464
|
P,
|
|
439
465
|
T,
|
|
440
466
|
Q
|
|
441
|
-
]),
|
|
467
|
+
]), cn = C(0);
|
|
442
468
|
x(() => {
|
|
443
|
-
Q.active && (
|
|
469
|
+
Q.active && (cn.current = $);
|
|
444
470
|
}, [Q.active]);
|
|
445
|
-
let
|
|
446
|
-
let e = $ >
|
|
447
|
-
Q.end(), e &&
|
|
471
|
+
let ln = b(() => {
|
|
472
|
+
let e = $ > cn.current;
|
|
473
|
+
Q.end(), e && Bt(!0);
|
|
448
474
|
}, [$, Q]);
|
|
449
475
|
x(() => {
|
|
450
|
-
!
|
|
451
|
-
}, [
|
|
452
|
-
|
|
476
|
+
(!at || !Wt) && Q.active && Q.end();
|
|
477
|
+
}, [
|
|
478
|
+
at,
|
|
479
|
+
Wt,
|
|
480
|
+
Q
|
|
481
|
+
]), x(() => {
|
|
482
|
+
Q.active || (rn.current.clear(), Jt.current = null);
|
|
453
483
|
}, [Q.active]), x(() => {
|
|
454
484
|
let e = y.getState().consumePendingPrompt();
|
|
455
|
-
return e &&
|
|
485
|
+
return e && Y.current(e), y.subscribe((e, t) => {
|
|
456
486
|
if (e.pendingPrompt && e.pendingPrompt !== t.pendingPrompt) {
|
|
457
487
|
let e = y.getState().consumePendingPrompt();
|
|
458
|
-
e &&
|
|
488
|
+
e && Y.current(e);
|
|
459
489
|
}
|
|
460
490
|
});
|
|
461
491
|
}, []);
|
|
462
|
-
let
|
|
492
|
+
let un = b((e) => {
|
|
463
493
|
let t = j ? y.getState().conversations.find((e) => e.id === j) : void 0;
|
|
464
494
|
if (t && (t.messages.length > 0 || t.backendSessionId)) {
|
|
465
495
|
if (t.mode !== e) {
|
|
466
496
|
let t = y.getState().conversations.find((t) => t.mode === e && t.messages.length === 0 && !t.backendSessionId && !y.getState().processingByConversationId[t.id]);
|
|
467
|
-
t ?
|
|
497
|
+
t ? xt(t.id) : N(void 0, e);
|
|
468
498
|
}
|
|
469
|
-
} else j &&
|
|
470
|
-
|
|
499
|
+
} else j && bt(j, e);
|
|
500
|
+
yt(e);
|
|
471
501
|
}, [
|
|
472
502
|
j,
|
|
473
503
|
N,
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
]),
|
|
478
|
-
if (D.find((t) => t.id === e)?.writeCapable && !y.getState().
|
|
479
|
-
|
|
504
|
+
xt,
|
|
505
|
+
bt,
|
|
506
|
+
yt
|
|
507
|
+
]), dn = b((e) => {
|
|
508
|
+
if (D.find((t) => t.id === e)?.writeCapable && !Ce(y.getState().acknowledgedWriteModes, e)) {
|
|
509
|
+
Rt(e);
|
|
480
510
|
return;
|
|
481
511
|
}
|
|
482
|
-
|
|
483
|
-
}, [
|
|
484
|
-
let e =
|
|
485
|
-
|
|
512
|
+
un(e);
|
|
513
|
+
}, [un, D]), fn = b(() => {
|
|
514
|
+
let e = U;
|
|
515
|
+
Rt(null), e && (kt(e), un(e));
|
|
486
516
|
}, [
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
]),
|
|
491
|
-
|
|
517
|
+
U,
|
|
518
|
+
kt,
|
|
519
|
+
un
|
|
520
|
+
]), pn = U === null ? void 0 : D.find((e) => e.id === U) ?? { id: U }, mn = b(() => {
|
|
521
|
+
Rt(null);
|
|
492
522
|
}, []);
|
|
493
|
-
return /* @__PURE__ */
|
|
523
|
+
return /* @__PURE__ */ tt("div", {
|
|
494
524
|
className: "relative flex flex-1 flex-col overflow-hidden",
|
|
495
525
|
children: [
|
|
496
|
-
/* @__PURE__ */
|
|
526
|
+
/* @__PURE__ */ tt("div", {
|
|
497
527
|
className: "contents",
|
|
498
528
|
inert: Q.active || void 0,
|
|
499
529
|
children: [
|
|
500
|
-
|
|
501
|
-
count:
|
|
502
|
-
onOpenTranscript: () =>
|
|
530
|
+
X.length > 0 && !Q.active ? /* @__PURE__ */ w(Re, {
|
|
531
|
+
count: X.length,
|
|
532
|
+
onOpenTranscript: () => Bt(!0)
|
|
503
533
|
}) : null,
|
|
504
|
-
|
|
534
|
+
tn.length === 0 ? /* @__PURE__ */ w(Ve, {
|
|
505
535
|
mode: M,
|
|
506
|
-
onSuggestionClick:
|
|
536
|
+
onSuggestionClick: Zt
|
|
507
537
|
}) : /* @__PURE__ */ w("div", {
|
|
508
538
|
className: "flex min-h-0 flex-1 flex-col",
|
|
509
|
-
children: /* @__PURE__ */ w(
|
|
510
|
-
onApprovePendingWrite:
|
|
511
|
-
approvingWriteRef:
|
|
512
|
-
messages:
|
|
539
|
+
children: /* @__PURE__ */ w(He, {
|
|
540
|
+
onApprovePendingWrite: Xt,
|
|
541
|
+
approvingWriteRef: Kt,
|
|
542
|
+
messages: tn,
|
|
513
543
|
processing: z ?? null,
|
|
514
|
-
streamingMessageId:
|
|
515
|
-
failedMessageId:
|
|
516
|
-
onRetry:
|
|
544
|
+
streamingMessageId: Nt,
|
|
545
|
+
failedMessageId: Pt,
|
|
546
|
+
onRetry: Qt
|
|
517
547
|
})
|
|
518
548
|
}),
|
|
519
|
-
/* @__PURE__ */ w(
|
|
520
|
-
onStartVoiceSession: Q.available &&
|
|
521
|
-
onSend: (e, t) => void
|
|
522
|
-
disabled:
|
|
549
|
+
/* @__PURE__ */ w(Ze, {
|
|
550
|
+
onStartVoiceSession: Q.available && Wt ? Q.start : void 0,
|
|
551
|
+
onSend: (e, t) => void J(e, t),
|
|
552
|
+
disabled: Mt,
|
|
523
553
|
placeholder: M === "api-calls" ? T("chatArea.placeholderActions", "What would you like me to do?") : T("chatArea.placeholderGeneral", "Ask me anything…"),
|
|
524
554
|
mode: M,
|
|
525
|
-
writeAccessDenied:
|
|
526
|
-
availableModes:
|
|
527
|
-
|
|
555
|
+
writeAccessDenied: ot === "denied" && !!G?.writeCapable,
|
|
556
|
+
availableModes: It,
|
|
557
|
+
attachmentCharsPerFile: Lt,
|
|
558
|
+
onModeChange: dn
|
|
528
559
|
})
|
|
529
560
|
]
|
|
530
561
|
}),
|
|
531
|
-
|
|
532
|
-
turns:
|
|
533
|
-
onClose: () =>
|
|
534
|
-
onSave:
|
|
535
|
-
onContinueInChat:
|
|
562
|
+
zt && !Q.active ? /* @__PURE__ */ w(ze, {
|
|
563
|
+
turns: X,
|
|
564
|
+
onClose: () => Bt(!1),
|
|
565
|
+
onSave: nn,
|
|
566
|
+
onContinueInChat: on ? sn : void 0,
|
|
536
567
|
closeOnEscape: !0
|
|
537
568
|
}) : null,
|
|
538
|
-
Q.active && /* @__PURE__ */ w(
|
|
569
|
+
Q.active && /* @__PURE__ */ w(Ue, {
|
|
539
570
|
session: Q.session,
|
|
540
571
|
notice: Q.notice,
|
|
541
572
|
capturing: Q.capturing,
|
|
542
573
|
interrupting: Q.interrupting,
|
|
543
574
|
awaitingEndpoint: Q.awaitingEndpoint,
|
|
544
|
-
turns:
|
|
575
|
+
turns: X,
|
|
545
576
|
spokenChunks: Q.spokenChunks,
|
|
546
|
-
attachments:
|
|
547
|
-
onAttachFiles:
|
|
548
|
-
onRemoveAttachment:
|
|
549
|
-
onRetryAttachment:
|
|
550
|
-
canAttachMore:
|
|
551
|
-
preparingAttachments:
|
|
552
|
-
onSaveTranscript:
|
|
553
|
-
onContinueInChat:
|
|
577
|
+
attachments: Z.attachments,
|
|
578
|
+
onAttachFiles: Z.addFiles,
|
|
579
|
+
onRemoveAttachment: Z.remove,
|
|
580
|
+
onRetryAttachment: Z.retry,
|
|
581
|
+
canAttachMore: Z.canAddMore,
|
|
582
|
+
preparingAttachments: Z.preparingCount,
|
|
583
|
+
onSaveTranscript: nn,
|
|
584
|
+
onContinueInChat: sn,
|
|
554
585
|
onInterrupt: () => {
|
|
555
|
-
Q.interrupt(),
|
|
586
|
+
Q.interrupt(), Yt();
|
|
556
587
|
},
|
|
557
|
-
spoken:
|
|
588
|
+
spoken: en,
|
|
558
589
|
onToggleMute: Q.toggleMute,
|
|
559
|
-
onEnd:
|
|
590
|
+
onEnd: ln
|
|
560
591
|
}),
|
|
561
|
-
/* @__PURE__ */ w(
|
|
562
|
-
open:
|
|
563
|
-
|
|
564
|
-
|
|
592
|
+
/* @__PURE__ */ w($e, {
|
|
593
|
+
open: U !== null,
|
|
594
|
+
mode: pn,
|
|
595
|
+
currentMode: G ?? { id: M },
|
|
596
|
+
onConfirm: fn,
|
|
597
|
+
onCancel: mn
|
|
565
598
|
})
|
|
566
599
|
]
|
|
567
600
|
});
|
|
568
601
|
};
|
|
569
602
|
//#endregion
|
|
570
|
-
export {
|
|
603
|
+
export { at as AssistantChatArea };
|