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