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