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