@burdenoff/fe-libs 2026.915.4 → 2026.917.1

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