@burdenoff/fe-libs 2026.914.2 → 2026.915.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 (43) hide show
  1. package/dist/shared/assistant/i18nManifest.d.ts +335 -0
  2. package/dist/shared/assistant/i18nManifest.d.ts.map +1 -0
  3. package/dist/shared/assistant/i18nManifest.js +210 -0
  4. package/dist/shared/assistant/index.d.ts +2 -0
  5. package/dist/shared/assistant/index.d.ts.map +1 -1
  6. package/dist/shared/assistant/modeCopy.d.ts +27 -0
  7. package/dist/shared/assistant/modeCopy.d.ts.map +1 -0
  8. package/dist/shared/assistant/modeCopy.js +9 -0
  9. package/dist/shared/assistant/speech/browserSpeechEngine.d.ts.map +1 -1
  10. package/dist/shared/assistant/speech/browserSpeechEngine.js +53 -26
  11. package/dist/shared/assistant/speech/createSpeechEngine.d.ts +25 -2
  12. package/dist/shared/assistant/speech/createSpeechEngine.d.ts.map +1 -1
  13. package/dist/shared/assistant/speech/createSpeechEngine.js +36 -13
  14. package/dist/shared/assistant/speech/hostedTtsProtocol.d.ts +25 -1
  15. package/dist/shared/assistant/speech/hostedTtsProtocol.d.ts.map +1 -1
  16. package/dist/shared/assistant/speech/hostedTtsProtocol.js +15 -8
  17. package/dist/shared/assistant/speech/hostedTtsSpeechEngine.d.ts +16 -1
  18. package/dist/shared/assistant/speech/hostedTtsSpeechEngine.d.ts.map +1 -1
  19. package/dist/shared/assistant/speech/hostedTtsSpeechEngine.js +84 -52
  20. package/dist/shared/assistant/speech/hostedVoiceCatalogue.d.ts.map +1 -1
  21. package/dist/shared/assistant/speech/hostedVoiceCatalogue.js +2 -1
  22. package/dist/shared/assistant/speech/index.d.ts +1 -1
  23. package/dist/shared/assistant/speech/index.d.ts.map +1 -1
  24. package/dist/shared/assistant/speech/routingSpeechEngine.d.ts.map +1 -1
  25. package/dist/shared/assistant/speech/routingSpeechEngine.js +41 -20
  26. package/dist/shared/assistant/speech/types.d.ts +10 -0
  27. package/dist/shared/assistant/speech/types.d.ts.map +1 -1
  28. package/dist/shared/assistant/ui/AssistantMessageItem.d.ts.map +1 -1
  29. package/dist/shared/assistant/ui/AssistantMessageItem.js +1 -1
  30. package/dist/shared/assistant/ui/AssistantPendingWriteCard.d.ts.map +1 -1
  31. package/dist/shared/assistant/ui/AssistantPendingWriteCard.js +1 -1
  32. package/dist/shared/assistant/ui/AssistantSpeechProvider.d.ts.map +1 -1
  33. package/dist/shared/assistant/ui/AssistantSpeechProvider.js +209 -190
  34. package/dist/shared/assistant/ui/composer/AssistantModeSelector.d.ts +7 -3
  35. package/dist/shared/assistant/ui/composer/AssistantModeSelector.d.ts.map +1 -1
  36. package/dist/shared/assistant/ui/composer/AssistantModeSelector.js +30 -29
  37. package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts.map +1 -1
  38. package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +1 -1
  39. package/dist/shared/assistant/voice/speechVoices.d.ts +15 -0
  40. package/dist/shared/assistant/voice/speechVoices.d.ts.map +1 -1
  41. package/dist/shared/assistant/voice/speechVoices.js +31 -26
  42. package/dist/shared-assistant.js +102 -100
  43. package/package.json +1 -1
@@ -1,23 +1,23 @@
1
1
  import { useI18n as e } from "../../providers/shell/I18nProvider.js";
2
2
  import { useAssistantTr as t } from "../i18n.js";
3
3
  import { isVoiceTurn as n } from "../voice/turnVisibility.js";
4
- import { getSpeechEngine as r } from "../speech/createSpeechEngine.js";
5
- import { VOICE_LIST_TIMEOUT_MS as i, languageDisplayName as a, selectVoiceForLocale as o, speechGate as s, speechLangForLocale as c, voiceAvailability as ee, voicesForLocale as l } from "../voice/speechVoices.js";
6
- import { chunkForSpeech as te, toSpeakableText as u } from "../voice/speakableText.js";
7
- import { voicePreviewText as d } from "../voice/voicePreview.js";
8
- import { findAssistantLanguage as ne } from "../voice/languages.js";
9
- import { resolveLanguagePair as re } from "../voice/languagePair.js";
10
- import { speechLabelsFor as ie } from "../voice/speechLabels.js";
11
- import { resolveSpeechLocale as ae } from "../voice/replyLanguage.js";
12
- import { IDLE_PLAYBACK as oe, isSpeakingMessage as f, publishedChunks as se, speechPlaybackReducer as ce } from "../voice/speechPlayback.js";
13
- import { useAssistantStore as p } from "../store.js";
4
+ import { VOICE_LIST_TIMEOUT_MS as r, languageDisplayName as i, selectVoiceForLocale as a, speechGate as o, speechLangForLocale as s, voiceAvailability as c, voicesForLocale as l } from "../voice/speechVoices.js";
5
+ import { getSpeechEngine as u, subscribeSpeechEngine as d } from "../speech/createSpeechEngine.js";
6
+ import { chunkForSpeech as ee, toSpeakableText as f } from "../voice/speakableText.js";
7
+ import { voicePreviewText as te } from "../voice/voicePreview.js";
8
+ import { findAssistantLanguage as p } from "../voice/languages.js";
9
+ import { resolveLanguagePair as ne } from "../voice/languagePair.js";
10
+ import { speechLabelsFor as re } from "../voice/speechLabels.js";
11
+ import { resolveSpeechLocale as ie } from "../voice/replyLanguage.js";
12
+ import { IDLE_PLAYBACK as ae, isSpeakingMessage as oe, publishedChunks as se, speechPlaybackReducer as ce } from "../voice/speechPlayback.js";
13
+ import { useAssistantStore as m } from "../store.js";
14
14
  import { isTurnInFlight as le } from "../turnState.js";
15
15
  import { parseToolActivity as ue } from "./AssistantToolActivity.js";
16
16
  import "../speech/index.js";
17
- import { createContext as m, useCallback as h, useContext as g, useEffect as _, useMemo as v, useReducer as de, useRef as y, useState as b } from "react";
18
- import { jsx as fe } from "react/jsx-runtime";
17
+ import { createContext as de, useCallback as h, useContext as g, useEffect as _, useMemo as v, useReducer as fe, useRef as y, useState as b, useSyncExternalStore as pe } from "react";
18
+ import { jsx as me } from "react/jsx-runtime";
19
19
  //#region src/shared/assistant/ui/AssistantSpeechProvider.tsx
20
- var pe = {
20
+ var he = {
21
21
  codeBlock: "",
22
22
  image: "",
23
23
  link: "",
@@ -26,7 +26,7 @@ var pe = {
26
26
  emailAt: "at",
27
27
  emailDot: "dot",
28
28
  nestedItem: ""
29
- }, me = 4e3, x = m({
29
+ }, ge = 4e3, x = de({
30
30
  isSupported: !1,
31
31
  availability: "unsupported",
32
32
  isBlocked: !0,
@@ -51,192 +51,209 @@ var pe = {
51
51
  function S() {
52
52
  return g(x);
53
53
  }
54
- var C = ({ children: m, visible: g = !0, engine: S = r() }) => {
55
- let C = t(), { locale: w } = e(), [T, E] = de(ce, oe), [D, O] = b(() => S.listVoices()), [k, he] = b(!1), [A, j] = b(() => /* @__PURE__ */ new Map()), M = y(0), N = y(null);
54
+ var C = ({ children: de, visible: g = !0, engine: S }) => {
55
+ let C = pe(d, u, u), w = S ?? C, T = t(), { locale: E } = e(), [D, O] = fe(ce, ae), [k, A] = b(() => w.listVoices()), [j, M] = b(!1), [N, P] = b(() => /* @__PURE__ */ new Map()), F = y(0), I = y(null);
56
56
  _(() => () => {
57
- N.current !== null && clearTimeout(N.current);
57
+ I.current !== null && clearTimeout(I.current);
58
58
  }, []);
59
- let [P, F] = b(null), I = y(null), L = y(() => {}), R = h(() => {
60
- I.current?.(), I.current = null;
61
- }, []), z = p((e) => e.autoSpeakEnabled), B = p((e) => e.setAutoSpeak), [V, ge] = b(!1), H = y(!1), U = h((e) => {
62
- H.current = e;
63
- }, []), _e = p((e) => e.activeConversationId), W = v(() => S.isSupported(), [S]);
59
+ let [L, R] = b(null), z = y(null), B = y(() => {}), V = h(() => {
60
+ z.current?.(), z.current = null;
61
+ }, []), H = m((e) => e.autoSpeakEnabled), U = m((e) => e.setAutoSpeak), [W, _e] = b(!1), ve = y(!1), ye = h((e) => {
62
+ ve.current = e;
63
+ }, []), be = m((e) => e.activeConversationId), G = v(() => w.isSupported(), [w]);
64
64
  _(() => {
65
- if (!W) return;
65
+ if (!G) return;
66
66
  let e = () => {
67
- O(S.listVoices()), j((e) => e.size === 0 ? e : /* @__PURE__ */ new Map());
67
+ A(w.listVoices()), P((e) => e.size === 0 ? e : /* @__PURE__ */ new Map());
68
68
  };
69
- return e(), S.subscribeVoices(e);
70
- }, [S, W]);
71
- let ve = p((e) => e.assistantLanguage), ye = p((e) => e.replyLanguage), G = p((e) => e.preferredVoices), be = p((e) => e.setPreferredVoice), K = v(() => re(ve, ye, w).reply, [
72
- ve,
73
- ye,
74
- w
75
- ]), q = K.code, J = h((e) => ne(e)?.tag ?? c(e), []), xe = h((e) => ne(e)?.rate ?? .9, []), Y = v(() => ee(W, D, K.tag, k), [
76
- W,
77
- D,
78
- K,
79
- k
80
- ]), X = v(() => ({
81
- codeBlock: C("speech.codeBlock", "Code block"),
82
- image: C("speech.image", "image"),
83
- link: C("speech.link", "link"),
84
- largeTable: C("speech.largeTable", "Table with {{rows}} rows and {{columns}} columns"),
85
- truncated: C("speech.truncated", "The rest of this message is not read aloud"),
86
- nestedItem: C("speech.nestedItem", "Sub-item {{ordinal}}"),
87
- emailAt: C("speech.emailAt", "at"),
88
- emailDot: C("speech.emailDot", "dot")
89
- }), [C]), Z = h(() => {
90
- R(), S.cancel(), E({ type: "stop" });
91
- }, [R, S]), Se = h((e) => {
92
- let t = S.listVoices().find((t) => t.name === e) ?? null;
93
- t && (Z(), S.speak([d(q)], {
94
- voice: t,
95
- lang: J(q)
96
- }));
97
- }, [
98
- S,
69
+ return e(), w.subscribeVoices(e);
70
+ }, [w, G]);
71
+ let xe = m((e) => e.assistantLanguage), Se = m((e) => e.replyLanguage), K = m((e) => e.preferredVoices), Ce = m((e) => e.setPreferredVoice), q = v(() => ne(xe, Se, E).reply, [
72
+ xe,
73
+ Se,
74
+ E
75
+ ]), J = q.code, Y = h((e) => p(e)?.tag ?? s(e), []), we = h((e) => p(e)?.rate ?? .9, []), X = v(() => c(G, k, q.tag, j), [
76
+ G,
77
+ k,
99
78
  q,
79
+ j
80
+ ]), Te = v(() => ({
81
+ codeBlock: T("speech.codeBlock", "Code block"),
82
+ image: T("speech.image", "image"),
83
+ link: T("speech.link", "link"),
84
+ largeTable: T("speech.largeTable", "Table with {{rows}} rows and {{columns}} columns"),
85
+ truncated: T("speech.truncated", "The rest of this message is not read aloud"),
86
+ nestedItem: T("speech.nestedItem", "Sub-item {{ordinal}}"),
87
+ emailAt: T("speech.emailAt", "at"),
88
+ emailDot: T("speech.emailDot", "dot")
89
+ }), [T]), Z = h(() => {
90
+ V(), w.cancel(), O({ type: "stop" });
91
+ }, [V, w]), Ee = h((e) => {
92
+ let t = w.listVoices().find((t) => t.name === e) ?? null;
93
+ if (t) {
94
+ Z();
95
+ try {
96
+ w.speak([te(J)], {
97
+ voice: t,
98
+ lang: Y(J),
99
+ fallback: !1
100
+ });
101
+ } catch {}
102
+ }
103
+ }, [
104
+ w,
105
+ J,
100
106
  Z,
101
- J
102
- ]), Ce = h((e) => A.get(e) ?? null, [A]), we = h((e, t, n) => {
103
- R();
104
- let r = !1, a = () => {}, o = (i) => {
105
- if (!r) {
106
- if (r = !0, I.current = null, clearTimeout(s), a(), i.length === 0) {
107
- he(!0);
107
+ Y
108
+ ]), De = h((e) => N.get(e) ?? null, [N]), Oe = h((e, t, n) => {
109
+ V();
110
+ let i = !1, a = () => {}, o = (r) => {
111
+ if (!i) {
112
+ if (i = !0, z.current = null, clearTimeout(s), a(), r.length === 0) {
113
+ M(!0);
108
114
  return;
109
115
  }
110
- O(i), L.current(e, t, i, n);
116
+ A(r), B.current(e, t, r, n);
111
117
  }
112
- }, s = setTimeout(() => o(S.listVoices()), i);
113
- a = S.subscribeVoices(() => o(S.listVoices())), I.current = () => {
114
- r || (r = !0, clearTimeout(s), a(), I.current = null);
118
+ }, s = setTimeout(() => o(w.listVoices()), r);
119
+ a = w.subscribeVoices(() => o(w.listVoices())), z.current = () => {
120
+ i || (i = !0, clearTimeout(s), a(), z.current = null);
115
121
  };
116
- }, [R, S]), Q = h((e, t, n, r) => {
117
- let i = n;
118
- if (i.length === 0) {
119
- let e = S.listVoices();
120
- e.length > 0 && (i = e, O(e));
122
+ }, [V, w]), Q = h((e, t, n, r) => {
123
+ let s = n;
124
+ if (s.length === 0) {
125
+ let e = w.listVoices();
126
+ e.length > 0 && (s = e, A(e));
121
127
  }
122
- let c = J(r), l = s(ee(!0, i, r, k));
123
- if (l === "block") {
124
- let t = C("speech.noVoiceForReply", "This reply is in {{language}}, and no {{language}} voice is installed on this device.", { language: a(c, w) });
125
- j((n) => new Map(n).set(e, t));
128
+ let l = Y(r), u = o(c(!0, s, r, j));
129
+ if (u === "block") {
130
+ let t = T("speech.noVoiceForReply", "This reply is in {{language}}, and no {{language}} voice is installed on this device.", { language: i(l, E) });
131
+ P((n) => new Map(n).set(e, t));
126
132
  return;
127
133
  }
128
- if (l === "wait-for-voices") {
129
- we(e, t, r);
134
+ if (u === "wait-for-voices") {
135
+ Oe(e, t, r);
130
136
  return;
131
137
  }
132
- j((t) => {
138
+ P((t) => {
133
139
  if (!t.has(e)) return t;
134
140
  let n = new Map(t);
135
141
  return n.delete(e), n;
136
142
  });
137
- let u = M.current + 1;
138
- M.current = u, E({
143
+ let d = F.current + 1;
144
+ F.current = d, O({
139
145
  type: "start",
140
146
  messageId: e,
141
- requestId: u
147
+ requestId: d
142
148
  });
143
- let d = te(t);
144
- F({
145
- requestId: u,
146
- chunks: d,
149
+ let f = ee(t);
150
+ R({
151
+ requestId: d,
152
+ chunks: f,
147
153
  index: -1
148
- }), N.current !== null && clearTimeout(N.current), N.current = setTimeout(() => {
149
- F((e) => e?.requestId === u && e.index < 0 ? null : e);
150
- }, me), S.speak(d, {
151
- voice: o(i, c, G[r]),
152
- lang: c,
153
- rate: xe(r)
154
- }, {
155
- onChunkStart: (e) => {
156
- M.current === u && N.current !== null && (clearTimeout(N.current), N.current = null), F((t) => t?.requestId === u ? {
157
- ...t,
158
- index: e
159
- } : M.current === u ? {
160
- requestId: u,
161
- chunks: d,
162
- index: e
163
- } : t);
164
- },
165
- onEnd: () => E({
166
- type: "finished",
167
- requestId: u
168
- }),
169
- onError: () => E({
154
+ }), I.current !== null && clearTimeout(I.current), I.current = setTimeout(() => {
155
+ R((e) => e?.requestId === d && e.index < 0 ? null : e);
156
+ }, ge);
157
+ let te = () => {
158
+ F.current === d && I.current !== null && (clearTimeout(I.current), I.current = null), O({
170
159
  type: "failed",
171
- requestId: u
172
- })
173
- });
160
+ requestId: d
161
+ });
162
+ };
163
+ try {
164
+ w.speak(f, {
165
+ voice: a(s, l, K[r]),
166
+ lang: l,
167
+ rate: we(r)
168
+ }, {
169
+ onChunkStart: (e) => {
170
+ F.current === d && I.current !== null && (clearTimeout(I.current), I.current = null), R((t) => t?.requestId === d ? {
171
+ ...t,
172
+ index: e
173
+ } : F.current === d ? {
174
+ requestId: d,
175
+ chunks: f,
176
+ index: e
177
+ } : t);
178
+ },
179
+ onEnd: () => O({
180
+ type: "finished",
181
+ requestId: d
182
+ }),
183
+ onError: () => O({
184
+ type: "failed",
185
+ requestId: d
186
+ })
187
+ });
188
+ } catch {
189
+ te();
190
+ }
174
191
  }, [
175
- S,
176
192
  w,
177
- G,
178
- xe,
179
- J,
180
- C,
181
- k,
182
- we
193
+ E,
194
+ K,
195
+ we,
196
+ Y,
197
+ T,
198
+ j,
199
+ Oe
183
200
  ]);
184
201
  _(() => {
185
- L.current = Q;
202
+ B.current = Q;
186
203
  }, [Q]);
187
204
  let $ = h((e, t, n) => {
188
- if (!W) return;
189
- let r = ae(u(t, { labels: pe }), n ?? q), i = u(t, { labels: ie(r, X) });
190
- i && Q(e, i, D, r);
205
+ if (!G) return;
206
+ let r = ie(f(t, { labels: he }), n ?? J), i = f(t, { labels: re(r, Te) });
207
+ i && Q(e, i, k, r);
191
208
  }, [
192
- W,
193
- X,
194
- q,
209
+ G,
210
+ Te,
211
+ J,
195
212
  Q,
196
- D
197
- ]), Te = h((e, t, n) => {
198
- if (f(T, e)) {
213
+ k
214
+ ]), ke = h((e, t, n) => {
215
+ if (oe(D, e)) {
199
216
  Z();
200
217
  return;
201
218
  }
202
219
  $(e, t, n);
203
220
  }, [
204
- T,
221
+ D,
205
222
  $,
206
223
  Z
207
224
  ]);
208
225
  _(() => {
209
226
  g || Z();
210
227
  }, [g, Z]), _(() => {
211
- Z(), j(/* @__PURE__ */ new Map());
212
- }, [_e, Z]), _(() => {
213
- j((e) => e.size === 0 ? e : /* @__PURE__ */ new Map()), Z();
214
- }, [q, Z]), _(() => () => {
215
- I.current?.(), I.current = null, S.cancel();
216
- }, [S]), _(() => {
228
+ Z(), P(/* @__PURE__ */ new Map());
229
+ }, [be, Z]), _(() => {
230
+ P((e) => e.size === 0 ? e : /* @__PURE__ */ new Map()), Z();
231
+ }, [J, Z]), _(() => () => {
232
+ z.current?.(), z.current = null, w.cancel();
233
+ }, [w]), _(() => {
217
234
  if (typeof window > "u") return;
218
- let e = () => S.cancel();
235
+ let e = () => w.cancel();
219
236
  return window.addEventListener("pagehide", e), () => window.removeEventListener("pagehide", e);
220
- }, [S]), _(() => {
221
- if (typeof document > "u" || !W) return;
237
+ }, [w]), _(() => {
238
+ if (typeof document > "u" || !G) return;
222
239
  let e = () => {
223
240
  if (document.visibilityState !== "visible") return;
224
- let e = S.listVoices();
225
- e.length > 0 && R(), O(e), he(!1), j((e) => e.size === 0 ? e : /* @__PURE__ */ new Map());
241
+ let e = w.listVoices();
242
+ e.length > 0 && V(), A(e), M(!1), P((e) => e.size === 0 ? e : /* @__PURE__ */ new Map());
226
243
  };
227
244
  return document.addEventListener("visibilitychange", e), window.addEventListener("focus", e), () => {
228
245
  document.removeEventListener("visibilitychange", e), window.removeEventListener("focus", e);
229
246
  };
230
247
  }, [
231
- R,
232
- S,
233
- W
248
+ V,
249
+ w,
250
+ G
234
251
  ]);
235
- let Ee = y($);
252
+ let Ae = y($);
236
253
  _(() => {
237
- Ee.current = $;
254
+ Ae.current = $;
238
255
  }, [$]), _(() => {
239
- if (!(!z && !V || !g || !W)) return p.subscribe((e, t) => {
256
+ if (!(!H && !W || !g || !G)) return m.subscribe((e, t) => {
240
257
  let r = e.activeConversationId;
241
258
  if (!r || r !== t.activeConversationId) return;
242
259
  let i = e.processingByConversationId[r], a = t.processingByConversationId[r];
@@ -244,65 +261,67 @@ var C = ({ children: m, visible: g = !0, engine: S = r() }) => {
244
261
  let o = i.messageId ?? a?.messageId ?? null;
245
262
  if (!o) return;
246
263
  let s = e.conversations.find((e) => e.id === r)?.messages.find((e) => e.id === o);
247
- if (!s || s.role !== "assistant" || n(s) !== V || H.current) return;
264
+ if (!s || s.role !== "assistant" || n(s) !== W || ve.current) return;
248
265
  let { text: c } = ue(s.content);
249
- c.trim() && Ee.current(o, c, s.metadata?.lang);
266
+ if (c.trim()) try {
267
+ Ae.current(o, c, s.metadata?.lang);
268
+ } catch {}
250
269
  });
251
270
  }, [
252
- z,
253
- V,
271
+ H,
254
272
  W,
273
+ G,
255
274
  g
256
275
  ]);
257
- let De = v(() => l(D, K.tag), [D, K]), Oe = v(() => o(D, K.tag, G[q]), [
258
- D,
276
+ let je = v(() => l(k, q.tag), [k, q]), Me = v(() => a(k, q.tag, K[J]), [
277
+ k,
278
+ q,
259
279
  K,
260
- G,
261
- q
262
- ]), ke = v(() => ({
263
- isSupported: W,
264
- availability: Y,
265
- isBlocked: Y === "no-voices",
266
- disabledReason: Y === "no-voices" ? C("speech.noVoicesOnDevice", "This device has no speech voices installed. Add one in your device speech or accessibility settings.") : null,
267
- blockedFor: Ce,
268
- voiceChoices: De,
269
- spokenChunks: se(T, P),
270
- activeVoiceName: Oe?.name ?? null,
271
- preferredVoiceName: G[q] ?? null,
272
- setVoice: (e) => be(q, e),
273
- speakingMessageId: T.status === "speaking" ? T.messageId : null,
274
- isSpeaking: (e) => f(T, e),
275
- toggle: Te,
280
+ J
281
+ ]), Ne = v(() => ({
282
+ isSupported: G,
283
+ availability: X,
284
+ isBlocked: X === "no-voices",
285
+ disabledReason: X === "no-voices" ? T("speech.noVoicesOnDevice", "This device has no speech voices installed. Add one in your device speech or accessibility settings.") : null,
286
+ blockedFor: De,
287
+ voiceChoices: je,
288
+ spokenChunks: se(D, L),
289
+ activeVoiceName: Me?.name ?? null,
290
+ preferredVoiceName: K[J] ?? null,
291
+ setVoice: (e) => Ce(J, e),
292
+ speakingMessageId: D.status === "speaking" ? D.messageId : null,
293
+ isSpeaking: (e) => oe(D, e),
294
+ toggle: ke,
276
295
  stop: Z,
277
- autoSpeakEnabled: z,
278
- setAutoSpeak: B,
279
- sessionSpeaking: V,
280
- setSessionSpeaking: ge,
281
- setSessionMicOpen: U,
282
- previewVoice: Se
296
+ autoSpeakEnabled: H,
297
+ setAutoSpeak: U,
298
+ sessionSpeaking: W,
299
+ setSessionSpeaking: _e,
300
+ setSessionMicOpen: ye,
301
+ previewVoice: Ee
283
302
  }), [
284
- W,
285
- Y,
286
- Ce,
287
- De,
288
- Oe,
289
303
  G,
290
- be,
291
- q,
292
- T,
293
- Te,
304
+ X,
305
+ De,
306
+ je,
307
+ Me,
308
+ K,
309
+ Ce,
310
+ J,
311
+ D,
312
+ ke,
294
313
  Z,
295
- z,
296
- B,
297
- V,
314
+ H,
298
315
  U,
299
- Se,
300
- C,
301
- P
316
+ W,
317
+ ye,
318
+ Ee,
319
+ T,
320
+ L
302
321
  ]);
303
- return /* @__PURE__ */ fe(x.Provider, {
304
- value: ke,
305
- children: m
322
+ return /* @__PURE__ */ me(x.Provider, {
323
+ value: Ne,
324
+ children: de
306
325
  });
307
326
  };
308
327
  //#endregion
@@ -10,9 +10,13 @@ interface Props {
10
10
  disabled?: boolean;
11
11
  }
12
12
  /**
13
- * Per-mode presentation metadata. The i18n key + English fallback provide the
14
- * relabelled display name ('Ask' / 'Take action') while the mode ID stays the
15
- * transport-level value ('general' / 'api-calls' / 'vibe-plugins').
13
+ * Per-mode presentation metadata: the icon, and the shared English name used
14
+ * when a product's `label` is empty ('Ask' / 'Take action'), while the mode ID
15
+ * stays the transport-level value ('general' / 'api-calls' / 'vibe-plugins').
16
+ *
17
+ * ★ `i18nKey` is NOT the key the pill requests — that is `mode.<id>`, below.
18
+ * Nothing passes `i18nKey` to a translator; it is kept only because this table
19
+ * is published. Seed from `i18nManifest.ts`, never from this field.
16
20
  */
17
21
  export declare const ASSISTANT_MODE_META: Record<AssistantMode, {
18
22
  i18nKey: string;
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantModeSelector.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/composer/AssistantModeSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,EAAE,EAAsB,MAAM,OAAO,CAAC;AACzE,OAAO,EAA8B,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAI9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,UAAU,KAAK;IACb,IAAI,EAAE,aAAa,CAAC;IACpB,iFAAiF;IACjF,cAAc,EAAE,mBAAmB,EAAE,CAAC;IACtC,YAAY,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CACtC,aAAa,EACb;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,CAUxD,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,GAChB,MAAM,GAAG,IAAI,CAgBf;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,KAAK,CAkI3C,CAAC"}
1
+ {"version":3,"file":"AssistantModeSelector.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/composer/AssistantModeSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,EAAE,EAAsB,MAAM,OAAO,CAAC;AACzE,OAAO,EAA8B,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAI9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,UAAU,KAAK;IACb,IAAI,EAAE,aAAa,CAAC;IACpB,iFAAiF;IACjF,cAAc,EAAE,mBAAmB,EAAE,CAAC;IACtC,YAAY,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CACtC,aAAa,EACb;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,CAsBxD,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,GAChB,MAAM,GAAG,IAAI,CAgBf;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,KAAK,CAkI3C,CAAC"}
@@ -1,31 +1,32 @@
1
1
  import { useAssistantTr as e } from "../../i18n.js";
2
- import { useCallback as t, useRef as n } from "react";
3
- import { ShieldCheck as r, Sparkles as i, Zap as a } from "lucide-react";
4
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
2
+ import { ASSISTANT_MODE_FALLBACK_LABELS as t } from "../../modeCopy.js";
3
+ import { useCallback as n, useRef as r } from "react";
4
+ import { ShieldCheck as i, Sparkles as a, Zap as o } from "lucide-react";
5
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
5
6
  //#region src/shared/assistant/ui/composer/AssistantModeSelector.tsx
6
- var c = {
7
+ var l = {
7
8
  general: {
8
9
  i18nKey: "mode.ask",
9
- fallback: "Ask",
10
- icon: i
10
+ fallback: t.general,
11
+ icon: a
11
12
  },
12
13
  assistant: {
13
14
  i18nKey: "mode.ask",
14
- fallback: "Ask",
15
- icon: i
15
+ fallback: t.assistant,
16
+ icon: a
16
17
  },
17
18
  "api-calls": {
18
19
  i18nKey: "mode.takeAction",
19
- fallback: "Take action",
20
- icon: r
20
+ fallback: t["api-calls"],
21
+ icon: i
21
22
  },
22
23
  "vibe-plugins": {
23
24
  i18nKey: "mode.build",
24
- fallback: "Build",
25
- icon: a
25
+ fallback: t["vibe-plugins"],
26
+ icon: o
26
27
  }
27
28
  };
28
- function l(e, t, n) {
29
+ function u(e, t, n) {
29
30
  switch (e) {
30
31
  case "Home": return 0;
31
32
  case "End": return n;
@@ -36,21 +37,21 @@ function l(e, t, n) {
36
37
  default: return null;
37
38
  }
38
39
  }
39
- var u = ({ mode: r, availableModes: i, onModeChange: a, disabled: u = !1 }) => {
40
- let d = e(), f = n(null), p = t((e) => {
41
- if (u) return;
42
- let t = e.target?.closest("[data-mode-id]")?.dataset.modeId, n = t ? i.findIndex((e) => e.id === t) : -1, o = n >= 0 ? n : i.findIndex((e) => e.id === r), s = l(e.key, o, i.length - 1);
43
- if (s === null) return;
40
+ var d = ({ mode: t, availableModes: i, onModeChange: a, disabled: o = !1 }) => {
41
+ let d = e(), f = r(null), p = n((e) => {
42
+ if (o) return;
43
+ let n = e.target?.closest("[data-mode-id]")?.dataset.modeId, r = n ? i.findIndex((e) => e.id === n) : -1, s = r >= 0 ? r : i.findIndex((e) => e.id === t), c = u(e.key, s, i.length - 1);
44
+ if (c === null) return;
44
45
  e.preventDefault();
45
- let c = i[s];
46
- c && (f.current?.querySelector(`[data-mode-id="${c.id}"]`)?.focus(), c.id !== r && a(c.id));
46
+ let l = i[c];
47
+ l && (f.current?.querySelector(`[data-mode-id="${l.id}"]`)?.focus(), l.id !== t && a(l.id));
47
48
  }, [
48
49
  i,
49
- u,
50
- r,
50
+ o,
51
+ t,
51
52
  a
52
53
  ]);
53
- return i.length < 2 ? null : /* @__PURE__ */ o("div", {
54
+ return i.length < 2 ? null : /* @__PURE__ */ s("div", {
54
55
  ref: f,
55
56
  role: "radiogroup",
56
57
  "aria-label": d("modeSelector.ariaLabel", "Select assistant mode"),
@@ -58,24 +59,24 @@ var u = ({ mode: r, availableModes: i, onModeChange: a, disabled: u = !1 }) => {
58
59
  className: "inline-flex max-w-full items-center gap-1 overflow-x-auto rounded-full border border-border-subtle bg-bg-elevated p-1 [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
59
60
  "data-testid": "assistant-mode-selector",
60
61
  children: i.map((e) => {
61
- let t = c[e.id], n = t.icon, i = e.id === r;
62
- return /* @__PURE__ */ s("button", {
62
+ let n = l[e.id], r = n.icon, i = e.id === t;
63
+ return /* @__PURE__ */ c("button", {
63
64
  type: "button",
64
65
  role: "radio",
65
66
  "aria-checked": i,
66
67
  tabIndex: i ? 0 : -1,
67
- disabled: u,
68
+ disabled: o,
68
69
  onClick: () => a(e.id),
69
70
  "data-mode-id": e.id,
70
71
  className: `flex shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full px-3 py-1.5 text-[13px] font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:opacity-50 ${i ? "bg-action-primary-bg text-action-primary-text shadow-sm" : "text-text-secondary hover:bg-bg-surface hover:text-text-primary"}`,
71
72
  "data-testid": `assistant-mode-option-${e.id}`,
72
- children: [/* @__PURE__ */ o(n, {
73
+ children: [/* @__PURE__ */ s(r, {
73
74
  className: "size-3.5",
74
75
  "aria-hidden": "true"
75
- }), /* @__PURE__ */ o("span", { children: d(`mode.${e.id}`, e.label || t.fallback) })]
76
+ }), /* @__PURE__ */ s("span", { children: d(`mode.${e.id}`, e.label || n.fallback) })]
76
77
  }, e.id);
77
78
  })
78
79
  });
79
80
  };
80
81
  //#endregion
81
- export { c as ASSISTANT_MODE_META, u as AssistantModeSelector, l as nextModeIndex };
82
+ export { l as ASSISTANT_MODE_META, d as AssistantModeSelector, u as nextModeIndex };
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantVoiceSession.d.ts","sourceRoot":"","sources":["../../../../../src/shared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,CAAC;IACzB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACnC,gEAAgE;IAChE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACpC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,KAAK,IAAI,CAAC;IACjD,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,iBAAiB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,0EAA0E;IAC1E,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,4DAA4D;IAC5D,YAAY,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC1D,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,mFAAmF;IACnF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,KAAK,CAukB3C,CAAC"}
@@ -165,7 +165,7 @@ var _ = ({ session: _, turns: y = [], onSaveTranscript: b, onContinueInChat: x,
165
165
  onClick: () => W((e) => !e),
166
166
  className: `absolute ${B ? "bottom-6 right-6 size-14" : V ? "right-2 top-2 size-8" : "bottom-3 right-3 size-11"} flex items-center justify-center rounded-full bg-bg-elevated text-text-secondary transition-colors hover:bg-bg-raised hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong`,
167
167
  "aria-pressed": U,
168
- "aria-label": N("voiceSession.transcript", "Voice transcript"),
168
+ "aria-label": N("voiceSession.transcriptTitle", "Voice transcript"),
169
169
  "data-testid": "assistant-voice-transcript-toggle",
170
170
  children: /* @__PURE__ */ h(ae, { className: B ? "size-6" : V ? "size-4" : "size-5" })
171
171
  }),