@burdenoff/fe-libs 2026.919.1 → 2026.920.2

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