@burdenoff/fe-libs 2026.920.1 → 2026.920.2

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