@burdenoff/fe-libs 2026.928.3 → 2026.930.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 (129) hide show
  1. package/dist/shared/assistant/adminModeSendGate.d.ts +6 -5
  2. package/dist/shared/assistant/adminModeSendGate.d.ts.map +1 -1
  3. package/dist/shared/assistant/adminModeSendGate.js +11 -11
  4. package/dist/shared/assistant/api.d.ts +313 -28
  5. package/dist/shared/assistant/api.d.ts.map +1 -1
  6. package/dist/shared/assistant/api.js +351 -135
  7. package/dist/shared/assistant/autoRouting.d.ts +11 -3
  8. package/dist/shared/assistant/autoRouting.d.ts.map +1 -1
  9. package/dist/shared/assistant/autoRouting.js +7 -7
  10. package/dist/shared/assistant/capabilities.d.ts +28 -0
  11. package/dist/shared/assistant/capabilities.d.ts.map +1 -1
  12. package/dist/shared/assistant/capabilities.js +19 -10
  13. package/dist/shared/assistant/conversation.d.ts +24 -2
  14. package/dist/shared/assistant/conversation.d.ts.map +1 -1
  15. package/dist/shared/assistant/createSandboxAssistantTransport.d.ts.map +1 -1
  16. package/dist/shared/assistant/createSandboxAssistantTransport.js +67 -54
  17. package/dist/shared/assistant/history/historyList.js +1 -1
  18. package/dist/shared/assistant/history/historyMapping.d.ts.map +1 -1
  19. package/dist/shared/assistant/history/historyMapping.js +5 -1
  20. package/dist/shared/assistant/history/historyResume.js +7 -7
  21. package/dist/shared/assistant/i18nManifest.d.ts +53 -0
  22. package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
  23. package/dist/shared/assistant/i18nManifest.js +75 -16
  24. package/dist/shared/assistant/index.d.ts +15 -0
  25. package/dist/shared/assistant/index.d.ts.map +1 -1
  26. package/dist/shared/assistant/modeCapabilities.js +1 -1
  27. package/dist/shared/assistant/operations.d.ts +22 -0
  28. package/dist/shared/assistant/operations.d.ts.map +1 -1
  29. package/dist/shared/assistant/operations.js +2 -2
  30. package/dist/shared/assistant/prewarm.d.ts +7 -0
  31. package/dist/shared/assistant/prewarm.d.ts.map +1 -1
  32. package/dist/shared/assistant/prewarm.js +1 -1
  33. package/dist/shared/assistant/product.d.ts +80 -2
  34. package/dist/shared/assistant/product.d.ts.map +1 -1
  35. package/dist/shared/assistant/product.js +10 -6
  36. package/dist/shared/assistant/proposalWriteRules.d.ts +40 -0
  37. package/dist/shared/assistant/proposalWriteRules.d.ts.map +1 -0
  38. package/dist/shared/assistant/proposalWriteRules.js +14 -0
  39. package/dist/shared/assistant/store.d.ts +17 -0
  40. package/dist/shared/assistant/store.d.ts.map +1 -1
  41. package/dist/shared/assistant/store.js +50 -43
  42. package/dist/shared/assistant/turnOutcome.d.ts +34 -2
  43. package/dist/shared/assistant/turnOutcome.d.ts.map +1 -1
  44. package/dist/shared/assistant/turnOutcome.js +28 -17
  45. package/dist/shared/assistant/turnOutcomeCopy.d.ts +29 -7
  46. package/dist/shared/assistant/turnOutcomeCopy.d.ts.map +1 -1
  47. package/dist/shared/assistant/turnOutcomeCopy.js +18 -6
  48. package/dist/shared/assistant/types.d.ts +5 -1
  49. package/dist/shared/assistant/types.d.ts.map +1 -1
  50. package/dist/shared/assistant/ui/AssistantApiCallsConsentDialog.js +4 -4
  51. package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
  52. package/dist/shared/assistant/ui/AssistantChatArea.js +992 -718
  53. package/dist/shared/assistant/ui/AssistantConversationList.js +6 -6
  54. package/dist/shared/assistant/ui/AssistantLanguageMenu.js +6 -6
  55. package/dist/shared/assistant/ui/AssistantMessageItem.d.ts +8 -1
  56. package/dist/shared/assistant/ui/AssistantMessageItem.d.ts.map +1 -1
  57. package/dist/shared/assistant/ui/AssistantMessageItem.js +77 -76
  58. package/dist/shared/assistant/ui/AssistantMessageList.d.ts +13 -1
  59. package/dist/shared/assistant/ui/AssistantMessageList.d.ts.map +1 -1
  60. package/dist/shared/assistant/ui/AssistantMessageList.js +15 -13
  61. package/dist/shared/assistant/ui/AssistantReplyLanguageSelector.js +5 -5
  62. package/dist/shared/assistant/ui/AssistantSpeechProvider.js +209 -209
  63. package/dist/shared/assistant/ui/AssistantWriteConfirmDialog.d.ts +62 -0
  64. package/dist/shared/assistant/ui/AssistantWriteConfirmDialog.d.ts.map +1 -0
  65. package/dist/shared/assistant/ui/AssistantWriteConfirmDialog.js +253 -0
  66. package/dist/shared/assistant/ui/AssistantWriteProposalCard.d.ts +72 -0
  67. package/dist/shared/assistant/ui/AssistantWriteProposalCard.d.ts.map +1 -0
  68. package/dist/shared/assistant/ui/AssistantWriteProposalCard.js +439 -0
  69. package/dist/shared/assistant/ui/AssistantWriteProposalSlot.d.ts +40 -0
  70. package/dist/shared/assistant/ui/AssistantWriteProposalSlot.d.ts.map +1 -0
  71. package/dist/shared/assistant/ui/AssistantWriteProposalSlot.js +35 -0
  72. package/dist/shared/assistant/ui/composer/AssistantComposer.js +8 -8
  73. package/dist/shared/assistant/ui/useVoiceSession.d.ts +28 -0
  74. package/dist/shared/assistant/ui/useVoiceSession.d.ts.map +1 -1
  75. package/dist/shared/assistant/ui/useVoiceSession.js +159 -110
  76. package/dist/shared/assistant/ui/useWriteProposalConfirm.d.ts +61 -0
  77. package/dist/shared/assistant/ui/useWriteProposalConfirm.d.ts.map +1 -0
  78. package/dist/shared/assistant/ui/useWriteProposalConfirm.js +109 -0
  79. package/dist/shared/assistant/ui/useWriteProposals.d.ts +128 -0
  80. package/dist/shared/assistant/ui/useWriteProposals.d.ts.map +1 -0
  81. package/dist/shared/assistant/ui/useWriteProposals.js +240 -0
  82. package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts +17 -1
  83. package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts.map +1 -1
  84. package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +141 -109
  85. package/dist/shared/assistant/ui/writeProposalPresentation.d.ts +76 -0
  86. package/dist/shared/assistant/ui/writeProposalPresentation.d.ts.map +1 -0
  87. package/dist/shared/assistant/ui/writeProposalPresentation.js +110 -0
  88. package/dist/shared/assistant/usageReporting.d.ts +108 -0
  89. package/dist/shared/assistant/usageReporting.d.ts.map +1 -0
  90. package/dist/shared/assistant/usageReporting.js +155 -0
  91. package/dist/shared/assistant/useAssistantApiAccess.d.ts +49 -14
  92. package/dist/shared/assistant/useAssistantApiAccess.d.ts.map +1 -1
  93. package/dist/shared/assistant/useAssistantApiAccess.js +43 -25
  94. package/dist/shared/assistant/useAssistantHeartbeat.d.ts.map +1 -1
  95. package/dist/shared/assistant/useAssistantHeartbeat.js +5 -5
  96. package/dist/shared/assistant/useWorkspaceWriteAccess.d.ts +5 -6
  97. package/dist/shared/assistant/useWorkspaceWriteAccess.d.ts.map +1 -1
  98. package/dist/shared/assistant/voice/voiceSession.d.ts +46 -0
  99. package/dist/shared/assistant/voice/voiceSession.d.ts.map +1 -1
  100. package/dist/shared/assistant/voice/voiceSession.js +35 -2
  101. package/dist/shared/assistant/writeConfirmSeam.d.ts +32 -0
  102. package/dist/shared/assistant/writeConfirmSeam.d.ts.map +1 -0
  103. package/dist/shared/assistant/writeConfirmSeam.js +23 -0
  104. package/dist/shared/assistant/writeModeConsent.d.ts +16 -8
  105. package/dist/shared/assistant/writeModeConsent.d.ts.map +1 -1
  106. package/dist/shared/assistant/writeModeConsent.js +2 -2
  107. package/dist/shared/assistant/writeProposalDiscovery.d.ts +187 -0
  108. package/dist/shared/assistant/writeProposalDiscovery.d.ts.map +1 -0
  109. package/dist/shared/assistant/writeProposalDiscovery.js +246 -0
  110. package/dist/shared/assistant/writeProposalErrorCopy.d.ts +135 -0
  111. package/dist/shared/assistant/writeProposalErrorCopy.d.ts.map +1 -0
  112. package/dist/shared/assistant/writeProposalErrorCopy.js +135 -0
  113. package/dist/shared/assistant/writeProposalVoice.d.ts +133 -0
  114. package/dist/shared/assistant/writeProposalVoice.d.ts.map +1 -0
  115. package/dist/shared/assistant/writeProposalVoice.js +66 -0
  116. package/dist/shared/assistant/writeProposals.d.ts +268 -0
  117. package/dist/shared/assistant/writeProposals.d.ts.map +1 -0
  118. package/dist/shared/assistant/writeProposals.js +445 -0
  119. package/dist/shared/assistant/writeReplyBinder.d.ts +166 -0
  120. package/dist/shared/assistant/writeReplyBinder.d.ts.map +1 -0
  121. package/dist/shared/assistant/writeReplyBinder.js +233 -0
  122. package/dist/shared/assistant/writeReplySend.d.ts +110 -0
  123. package/dist/shared/assistant/writeReplySend.d.ts.map +1 -0
  124. package/dist/shared/assistant/writeReplySend.js +93 -0
  125. package/dist/shared-assistant.js +168 -153
  126. package/dist/ui/modal-shell.d.ts +14 -1
  127. package/dist/ui/modal-shell.d.ts.map +1 -1
  128. package/dist/ui/modal-shell.js +8 -6
  129. package/package.json +1 -1
@@ -0,0 +1,240 @@
1
+ import { useAuthToken as e } from "../../providers/shell/AuthTokenProvider.js";
2
+ import "../../../shared-providers-shell.js";
3
+ import { useAssistantStore as t } from "../store.js";
4
+ import { readSandboxWriteCapabilitiesOnce as n } from "../api.js";
5
+ import { writeProposalErrorLine as r } from "../writeProposalErrorCopy.js";
6
+ import { getOrganizationId as i, getWorkspaceId as a } from "../context.js";
7
+ import { writeProposalConfirmState as o } from "./writeProposalPresentation.js";
8
+ import { WRITE_PROPOSAL_SANDBOX_MODE as s, createSandboxWriteProposalClient as c } from "../writeProposals.js";
9
+ import { createWriteProposalDiscovery as l, readWriteProposalRefs as u, writeProposalSessionsToReopen as d, writeProposalsEnabledFor as f } from "../writeProposalDiscovery.js";
10
+ import { WRITE_REPLY_DECLINE_WAIT_MS as p, settleWithin as m, writeReplyLiveState as h } from "../writeReplySend.js";
11
+ import { useEffect as g, useMemo as _, useRef as v, useState as y } from "react";
12
+ //#region src/shared/assistant/ui/useWriteProposals.ts
13
+ var b = new Set([
14
+ "succeeded",
15
+ "failed",
16
+ "outcome_unknown",
17
+ "declined",
18
+ "superseded",
19
+ "expired"
20
+ ]), x = (e) => `${e.sandboxId}\u0000${e.sessionId}`;
21
+ function S(e) {
22
+ return {
23
+ accessToken: e.getAccessToken(),
24
+ workspaceToken: e.getWorkspaceToken(),
25
+ userId: e.userId,
26
+ organizationId: i()
27
+ };
28
+ }
29
+ function C() {
30
+ return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
31
+ }
32
+ function w(e) {
33
+ let t = /* @__PURE__ */ new Set();
34
+ for (let n of e.messages) for (let e of u(n.metadata)) t.add(e.proposalId);
35
+ return t;
36
+ }
37
+ function T(e, t, n) {
38
+ if (n) {
39
+ let t = e.messages.find((e) => e.id === n);
40
+ if (t?.role === "assistant") return t;
41
+ }
42
+ for (let n = e.messages.length - 1; n >= 0; --n) {
43
+ let r = e.messages[n];
44
+ if (r?.role === "assistant" && r.metadata?.sessionId === t.sessionId && r.metadata?.sandboxId === t.sandboxId) return r;
45
+ }
46
+ return null;
47
+ }
48
+ function E(e) {
49
+ let t = /* @__PURE__ */ new Map();
50
+ for (let n of e) {
51
+ if (n.view.status !== "pending") continue;
52
+ let e = `${x(n.session)}\u0000${n.session.conversationId}`, r = t.get(e) ?? {
53
+ session: n.session,
54
+ proposalIds: []
55
+ };
56
+ r.proposalIds.push(n.view.proposalId), t.set(e, r);
57
+ }
58
+ return t;
59
+ }
60
+ function D(i) {
61
+ let { getAccessToken: D, getWorkspaceToken: O, userId: k } = e(), A = v({
62
+ tr: i.tr,
63
+ productWriteApproval: i.productWriteApproval ?? "legacy",
64
+ getAccessToken: D,
65
+ getWorkspaceToken: O,
66
+ userId: k
67
+ });
68
+ g(() => {
69
+ A.current = {
70
+ tr: i.tr,
71
+ productWriteApproval: i.productWriteApproval ?? "legacy",
72
+ getAccessToken: D,
73
+ getWorkspaceToken: O,
74
+ userId: k
75
+ };
76
+ });
77
+ let [j, M] = y({}), N = v({}), P = v(/* @__PURE__ */ new Map()), F = v(/* @__PURE__ */ new Set()), I = v(null), L = v(/* @__PURE__ */ new Set()), R = v(/* @__PURE__ */ new Map()), z = v(/* @__PURE__ */ new Set()), [B, V] = y(() => /* @__PURE__ */ new Set());
78
+ g(() => {
79
+ let e = F.current, n = (e) => {
80
+ if (e.length === 0) return;
81
+ let t = { ...N.current };
82
+ for (let n of e) {
83
+ let e = t[n.view.proposalId];
84
+ e && b.has(e.view.status) && !b.has(n.view.status) || (t[n.view.proposalId] = n);
85
+ }
86
+ N.current = t, M(t);
87
+ }, i = (e, n, r) => {
88
+ let i = t.getState(), a = i.conversations.find((t) => t.id === e.conversationId);
89
+ if (!a) return;
90
+ let o = w(a), s = n.filter((e) => !o.has(e.proposalId) && (e.status === "pending" || e.status === "executing"));
91
+ if (s.length === 0) return;
92
+ let c = T(a, e, r);
93
+ c && i.mergeMessageMetadata(a.id, c.id, { writeProposalRefs: [...u(c.metadata), ...s.map((t) => ({
94
+ proposalId: t.proposalId,
95
+ sandboxId: e.sandboxId,
96
+ sessionId: e.sessionId
97
+ }))] });
98
+ }, o = l({
99
+ client: c({
100
+ getWorkspaceId: a,
101
+ getAuthContext: () => S(A.current)
102
+ }),
103
+ capabilitiesOf: (e) => t.getState().sandboxWriteCapabilities[e],
104
+ actorOf: () => A.current.userId,
105
+ onList: (e, t, r) => {
106
+ P.current.set(x(e), t.serverNow), n(t.proposals.map((n) => ({
107
+ view: n,
108
+ serverNow: t.serverNow,
109
+ session: e
110
+ }))), i(e, t.proposals, r.turnMessageId);
111
+ },
112
+ onView: (e, t) => {
113
+ n([{
114
+ view: t,
115
+ serverNow: P.current.get(x(e)) ?? N.current[t.proposalId]?.serverNow ?? NaN,
116
+ session: e
117
+ }]);
118
+ },
119
+ onError: (e, n, i) => {
120
+ let a = r(n, i), { tr: o } = A.current;
121
+ t.getState().addMessage(e.conversationId, {
122
+ id: C(),
123
+ role: "system",
124
+ content: o(a.key, a.fallback),
125
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
126
+ });
127
+ }
128
+ });
129
+ I.current = o;
130
+ let s = R.current;
131
+ return () => {
132
+ o.dispose(), I.current === o && (I.current = null), e.clear(), s.clear();
133
+ };
134
+ }, []), g(() => t.subscribe((e, t) => {
135
+ if (e.sandboxWriteCapabilities === t.sandboxWriteCapabilities) return;
136
+ let n = R.current;
137
+ for (let [t, r] of [...n]) {
138
+ let i = e.sandboxWriteCapabilities[r.sandboxId];
139
+ i && (n.delete(t), f(i) && (F.current.add(x(r)), I.current?.discover(r, "open")));
140
+ }
141
+ }), []);
142
+ let H = (e, t) => {
143
+ let n = I.current;
144
+ if (!n) return;
145
+ let r = L.current, i = e.filter((e) => !r.has(e.view.proposalId));
146
+ for (let { session: e, proposalIds: a } of E(i).values()) {
147
+ for (let e of a) r.add(e);
148
+ n.declineAll(e, t, "system");
149
+ }
150
+ }, U = v(H);
151
+ return g(() => {
152
+ U.current = H;
153
+ }), g(() => t.subscribe((e, t) => {
154
+ if (e.conversations === t.conversations) return;
155
+ let n = new Set(e.conversations.map((e) => e.id)), r = Object.values(N.current).filter((e) => !n.has(e.session.conversationId));
156
+ r.length > 0 && U.current(r, "conversation_closed");
157
+ }), []), {
158
+ panel: _(() => {
159
+ let e = (e) => t.getState().sandboxWriteCapabilities[e], r = (e) => {
160
+ let t = A.current;
161
+ if (t.productWriteApproval !== "proposal-v1") return;
162
+ let r = z.current;
163
+ if (r.has(e)) return;
164
+ let i = a();
165
+ i && (r.add(e), n(e, i, s, S(t)).finally(() => r.delete(e)));
166
+ };
167
+ return {
168
+ afterTurn: (e, t) => {
169
+ I.current?.discover(e, "turn", { turnMessageId: t });
170
+ },
171
+ openConversation: (n) => {
172
+ let i = I.current;
173
+ if (!i) return;
174
+ let a = R.current;
175
+ for (let [e, t] of [...a]) t.conversationId !== n && a.delete(e);
176
+ let o = t.getState().conversations.find((e) => e.id === n);
177
+ if (o) for (let { session: t, issuing: n } of d(o)) {
178
+ let o = e(t.sandboxId);
179
+ if (f(o)) {
180
+ i.discover(t, "open");
181
+ continue;
182
+ }
183
+ o || (a.set(`${x(t)}\u0000${t.conversationId}`, t), n && r(t.sandboxId));
184
+ }
185
+ },
186
+ ensureKnown: (t, n) => {
187
+ let r = I.current;
188
+ if (!r || N.current[t.proposalId] || !f(e(t.sandboxId))) return;
189
+ let i = x(t);
190
+ F.current.has(i) || (F.current.add(i), r.discover({
191
+ sandboxId: t.sandboxId,
192
+ sessionId: t.sessionId,
193
+ conversationId: n
194
+ }, "mount"));
195
+ },
196
+ approve: async (e, t) => {
197
+ let n = N.current[e.proposalId], r = I.current;
198
+ !n || !r || await r.approve(n.session, e, t);
199
+ },
200
+ decline: async (e, t, n) => {
201
+ let r = N.current[e.proposalId], i = I.current;
202
+ !r || !i || await i.decline(r.session, e, t, "button", n);
203
+ },
204
+ presented: async (e, t) => {
205
+ let n = N.current[e.proposalId], r = I.current;
206
+ !n || !r || await r.presented(n.session, e, t);
207
+ },
208
+ entry: (e) => N.current[e],
209
+ liveFor: (t) => {
210
+ let n = I.current;
211
+ return h(t ? Object.values(N.current).filter((e) => e.session.conversationId === t && !n?.isRetired(e.session.sandboxId)).map((t) => ({
212
+ status: t.view.status,
213
+ sandboxId: t.session.sandboxId,
214
+ offersConfirm: o(t.view, e(t.session.sandboxId)).offerConfirm
215
+ })) : []);
216
+ },
217
+ declineForReply: async (e, t, n) => {
218
+ let r = I.current;
219
+ if (!r) return;
220
+ let i = n;
221
+ await m([...E(Object.values(N.current).filter((t) => t.session.conversationId === e && !r.isRetired(t.session.sandboxId))).values()].map(({ session: e }) => r.declineAll(e, t, i, { report: !0 })), p);
222
+ },
223
+ withdraw: (e, t) => {
224
+ U.current(Object.values(N.current).filter((t) => t.session.conversationId === e), t);
225
+ },
226
+ retireSandbox: (e) => {
227
+ let t = I.current;
228
+ !t || t.isRetired(e) || (U.current(Object.values(N.current).filter((t) => t.session.sandboxId === e), "sandbox_replaced"), t.retire(e), V((t) => {
229
+ let n = new Set(t);
230
+ return n.add(e), n;
231
+ }));
232
+ }
233
+ };
234
+ }, []),
235
+ entries: j,
236
+ retiredSandboxes: B
237
+ };
238
+ }
239
+ //#endregion
240
+ export { D as useWriteProposals };
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import { FC, ReactNode } from 'react';
2
2
  import { AssistantAttachment } from '../../attachments';
3
3
  import { VoiceSessionSnapshot } from '../../voice/voiceSession';
4
4
  import { VoiceSessionNotice } from '../useVoiceSession';
@@ -46,6 +46,22 @@ interface Props {
46
46
  interrupting?: boolean;
47
47
  /** Quiet has fallen and the two-second correction window is running. */
48
48
  awaitingEndpoint?: boolean;
49
+ /**
50
+ * ★ BOFF-7803 FE9: a change of this conversation waiting for its on-screen
51
+ * button. The thread's card is covered (and inert) while the session runs,
52
+ * so the session shows a chip for it, which opens the card here or its
53
+ * confirmation dialog. Voice never confirms it: only the button does.
54
+ */
55
+ proposalChip?: {
56
+ label: string;
57
+ onOpen: () => void;
58
+ } | null;
59
+ /** The waiting change's card, while the person has it open from the chip. */
60
+ proposalTray?: {
61
+ content: ReactNode;
62
+ closeLabel: string;
63
+ onClose: () => void;
64
+ } | null;
49
65
  }
50
66
  /**
51
67
  * Full-screen voice conversation (BOFF-7120).
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantVoiceSession.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/voice/AssistantVoiceSession.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4C,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAI1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAyB7D,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,gFAAgF;AAChF,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAElD,UAAU,KAAK;IACb,OAAO,EAAE,oBAAoB,CAAC;IAC9B,iEAAiE;IACjE,KAAK,CAAC,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC;IAC3C,wCAAwC;IACxC,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,IAAI,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,CAqqB3C,CAAC"}
1
+ {"version":3,"file":"AssistantVoiceSession.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/voice/AssistantVoiceSession.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,EAAE,EACP,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAyB7D,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,gFAAgF;AAChF,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAElD,UAAU,KAAK;IACb,OAAO,EAAE,oBAAoB,CAAC;IAC9B,iEAAiE;IACjE,KAAK,CAAC,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC;IAC3C,wCAAwC;IACxC,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,IAAI,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;IAC3B;;;;;OAKG;IACH,YAAY,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;IAC5D,6EAA6E;IAC7E,YAAY,CAAC,EAAE;QACb,OAAO,EAAE,SAAS,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,MAAM,IAAI,CAAC;KACrB,GAAG,IAAI,CAAC;CACV;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC,KAAK,CAuuB3C,CAAC"}
@@ -1,133 +1,135 @@
1
1
  import { useReturnFocus as e } from "../../../hooks/useReturnFocus.js";
2
2
  import { useAssistantTr as t } from "../../i18n.js";
3
3
  import { micIsInterrupt as n, showsAssistantCaption as r, voiceStageState as i } from "../../voice/voiceStageState.js";
4
- import { VOICE_THINKING_LABEL as a, composeVoiceStatus as ee, voiceStatusSuffix as te } from "../../voice/voiceStatus.js";
5
- import { spokenSoFar as o } from "../../voice/voiceSession.js";
6
- import { ASSISTANT_PANEL_ATTR as ne, ASSISTANT_VOICE_SESSION_ATTR as s } from "../panelOverlays.js";
7
- import { AssistantAttachmentButton as c } from "../composer/AssistantAttachmentButton.js";
8
- import { AssistantAttachmentChips as l } from "../composer/AssistantAttachmentChips.js";
9
- import { AssistantVoiceOrb as u } from "./AssistantVoiceOrb.js";
4
+ import { VOICE_THINKING_LABEL as a, composeVoiceStatus as o, voiceStatusSuffix as ee } from "../../voice/voiceStatus.js";
5
+ import { spokenSoFar as s } from "../../voice/voiceSession.js";
6
+ import { ASSISTANT_PANEL_ATTR as c, ASSISTANT_VOICE_SESSION_ATTR as l } from "../panelOverlays.js";
7
+ import { AssistantAttachmentButton as u } from "../composer/AssistantAttachmentButton.js";
8
+ import { AssistantAttachmentChips as te } from "../composer/AssistantAttachmentChips.js";
9
+ import { AssistantVoiceOrb as ne } from "./AssistantVoiceOrb.js";
10
10
  import { VoiceMiniController as re } from "./VoiceMiniController.js";
11
11
  import { VoiceStage as ie } from "./VoiceStage.js";
12
12
  import { VoiceTranscriptDrawer as ae } from "./VoiceTranscriptDrawer.js";
13
13
  import { escapeBelongsToLayerAbove as oe, voiceSessionEscapeAction as se } from "./voiceSessionEscape.js";
14
14
  import { useCallback as d, useEffect as f, useRef as p, useState as m } from "react";
15
- import { Maximize2 as ce, Minimize2 as le, ScrollText as ue, X as de } from "lucide-react";
16
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
15
+ import { Maximize2 as ce, Minimize2 as le, ScrollText as ue, X as h } from "lucide-react";
16
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
17
17
  //#region src/shared/assistant/ui/voice/AssistantVoiceSession.tsx
18
- var _ = ({ session: _, turns: fe = [], onSaveTranscript: pe, onContinueInChat: me, notice: b = null, spoken: x, onInterrupt: he, onToggleMute: S, attachments: C = [], onAttachFiles: w, onRemoveAttachment: ge, onRetryAttachment: _e, canAttachMore: ve = !0, preparingAttachments: T = 0, spokenChunks: E = null, onEnd: D, capturing: O = !0, interrupting: k = !1, awaitingEndpoint: A = !1 }) => {
19
- let j = t(), { muted: M, error: N } = _, P = p(null), F = p(null), [I, L] = m("mini"), R = I === "full", z = I === "mini", B = I === "mini" ? "panel" : I === "panel" ? "full" : "mini", [V, H] = m(!1), U = p(!1), W = p(S);
20
- W.current = S;
21
- let G = d(() => {
22
- _.phase === "listening" && (M || U.current || o(_) || (U.current = !0, W.current()));
23
- }, [M, _]), K = d(() => {
24
- U.current && (U.current = !1, W.current());
25
- }, []), ye = G;
18
+ var v = ({ session: v, turns: pe = [], onSaveTranscript: me, onContinueInChat: he, notice: y = null, spoken: b, onInterrupt: ge, onToggleMute: x, attachments: S = [], onAttachFiles: C, onRemoveAttachment: _e, onRetryAttachment: ve, canAttachMore: ye = !0, preparingAttachments: w = 0, spokenChunks: T = null, onEnd: E, capturing: be = !0, interrupting: xe = !1, awaitingEndpoint: Se = !1, proposalChip: D = null, proposalTray: O = null }) => {
19
+ let k = t(), { muted: A, error: j } = v, M = p(null), N = p(null), [P, F] = m("mini"), I = P === "full", L = P === "mini", R = P === "mini" ? "panel" : P === "panel" ? "full" : "mini", [z, B] = m(!1), V = O !== null && !L, H = p(!1), U = p(x);
20
+ U.current = x;
21
+ let W = d(() => {
22
+ v.phase === "listening" && (A || H.current || s(v) || (H.current = !0, U.current()));
23
+ }, [A, v]), G = d(() => {
24
+ H.current && (H.current = !1, U.current());
25
+ }, []), K = W;
26
26
  f(() => {
27
27
  let e = () => {
28
- document.visibilityState === "hidden" ? G() : K();
28
+ document.visibilityState === "hidden" ? W() : G();
29
29
  };
30
30
  return document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e);
31
- }, [G, K]), f(() => {
32
- let e = K;
31
+ }, [W, G]), f(() => {
32
+ let e = G;
33
33
  return window.addEventListener("focus", e), () => {
34
- window.removeEventListener("focus", e), U.current = !1;
34
+ window.removeEventListener("focus", e), H.current = !1;
35
35
  };
36
36
  }, []), f(() => {
37
- P.current?.focus();
38
- }, []), e(F, { fallbackSelector: `[${ne}]` }), f(() => {
37
+ M.current?.focus();
38
+ }, []), e(N, { fallbackSelector: `[${c}]` }), f(() => {
39
39
  let e = (e) => {
40
40
  if (e.key === "Escape") {
41
41
  let t = se({
42
42
  defaultPrevented: e.defaultPrevented,
43
43
  layerAbove: oe({
44
44
  target: e.target,
45
- session: F.current,
45
+ session: N.current,
46
46
  doc: document
47
47
  }),
48
- transcriptOpen: V
48
+ transcriptOpen: z
49
49
  });
50
50
  if (t === "ignore") return;
51
- e.preventDefault(), t === "close-transcript" ? H(!1) : D();
51
+ e.preventDefault(), t === "close-transcript" ? B(!1) : V ? O?.onClose() : E();
52
52
  return;
53
53
  }
54
- if (e.key !== "Tab" || !R) return;
55
- let t = (V ? F.current?.querySelector("[data-testid=\"assistant-voice-transcript\"]") : F.current)?.querySelectorAll("button:not([disabled])");
54
+ if (e.key !== "Tab" || !I) return;
55
+ let t = (z ? N.current?.querySelector("[data-testid=\"assistant-voice-transcript\"]") : N.current)?.querySelectorAll("button:not([disabled])");
56
56
  if (!t || t.length === 0) return;
57
57
  let n = t[0], r = t[t.length - 1];
58
58
  !n || !r || (e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus()));
59
59
  };
60
60
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
61
61
  }, [
62
- D,
63
- R,
64
- V
62
+ E,
63
+ I,
64
+ z,
65
+ V,
66
+ O
65
67
  ]);
66
- let q = b !== null && N === null, J = o(_), Y = i({
67
- snapshot: _,
68
- capturing: O,
69
- interrupting: k,
70
- awaitingEndpoint: A
68
+ let q = y !== null && j === null, J = s(v), Y = i({
69
+ snapshot: v,
70
+ capturing: be,
71
+ interrupting: xe,
72
+ awaitingEndpoint: Se
71
73
  }), X = (() => {
72
74
  switch (Y) {
73
- case "connecting": return j("voiceSession.connecting", "Starting the microphone…");
74
- case "endpoint-grace": return j("voiceSession.endpointGrace", "Still listening — take your time");
75
- case "interrupting": return j("voiceSession.interrupting", "Stopped — go ahead");
76
- case "thinking": return j(a.key, a.fallback);
77
- case "speaking": return j("voiceSession.speaking", "Speaking — tap to stop");
75
+ case "connecting": return k("voiceSession.connecting", "Starting the microphone…");
76
+ case "endpoint-grace": return k("voiceSession.endpointGrace", "Still listening — take your time");
77
+ case "interrupting": return k("voiceSession.interrupting", "Stopped — go ahead");
78
+ case "thinking": return k(a.key, a.fallback);
79
+ case "speaking": return k("voiceSession.speaking", "Speaking — tap to stop");
78
80
  case "mic-error":
79
81
  case "ended": return "";
80
- case "listening": return M ? j("voiceSession.muted", "Microphone off") : j("voiceSession.listening", "Listening…");
82
+ case "listening": return A ? k("voiceSession.muted", "Microphone off") : k("voiceSession.listening", "Listening…");
81
83
  default: return Y;
82
84
  }
83
- })(), Z = te({
84
- tr: j,
85
+ })(), Z = ee({
86
+ tr: k,
85
87
  stage: Y,
86
- muted: M,
88
+ muted: A,
87
89
  label: X
88
- }), Q = ee(X, Z), $ = Y === "thinking";
89
- return /* @__PURE__ */ g("div", {
90
- ref: F,
91
- className: `flex flex-col items-center justify-between bg-bg-sunken ${I === "full" ? "fixed inset-x-0 bottom-0 top-14 z-[60] px-6 py-8" : I === "panel" ? "absolute inset-0 z-20 px-4 py-6" : "absolute inset-x-0 bottom-0 z-20 h-[11.25rem] border-t border-border-subtle px-3 py-3 shadow-lg"}`,
90
+ }), Q = o(X, Z), $ = Y === "thinking";
91
+ return /* @__PURE__ */ _("div", {
92
+ ref: N,
93
+ className: `flex flex-col items-center justify-between bg-bg-sunken ${P === "full" ? "fixed inset-x-0 bottom-0 top-14 z-[60] px-6 py-8" : P === "panel" ? "absolute inset-0 z-20 px-4 py-6" : "absolute inset-x-0 bottom-0 z-20 h-[11.25rem] border-t border-border-subtle px-3 py-3 shadow-lg"}`,
92
94
  role: "dialog",
93
- "aria-modal": R || void 0,
94
- "aria-label": j("voiceSession.title", "Voice conversation"),
95
+ "aria-modal": I || void 0,
96
+ "aria-label": k("voiceSession.title", "Voice conversation"),
95
97
  "data-testid": "assistant-voice-session",
96
- [s]: "",
98
+ [l]: "",
97
99
  children: [
98
- /* @__PURE__ */ g("button", {
99
- ref: P,
100
+ /* @__PURE__ */ _("button", {
101
+ ref: M,
100
102
  type: "button",
101
- onClick: D,
102
- className: `absolute ${R ? "right-6 top-6 h-14 gap-2 px-5 text-base" : z ? "right-12 top-2 h-8 gap-1.5 px-2.5 text-xs" : "right-3 top-3 h-11 gap-2 px-4 text-sm"} flex items-center justify-center rounded-full border border-border-default bg-bg-elevated text-text-secondary hover:bg-bg-sunken transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong`,
103
- title: j("voiceSession.end", "End the voice conversation"),
103
+ onClick: E,
104
+ className: `absolute ${I ? "right-6 top-6 h-14 gap-2 px-5 text-base" : L ? "right-12 top-2 h-8 gap-1.5 px-2.5 text-xs" : "right-3 top-3 h-11 gap-2 px-4 text-sm"} flex items-center justify-center rounded-full border border-border-default bg-bg-elevated text-text-secondary hover:bg-bg-sunken transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong`,
105
+ title: k("voiceSession.end", "End the voice conversation"),
104
106
  "data-testid": "assistant-voice-end",
105
- children: [/* @__PURE__ */ h(de, {
106
- className: R ? "size-6" : z ? "size-4" : "size-5",
107
+ children: [/* @__PURE__ */ g(h, {
108
+ className: I ? "size-6" : L ? "size-4" : "size-5",
107
109
  "aria-hidden": "true"
108
- }), /* @__PURE__ */ h("span", {
109
- className: `truncate whitespace-nowrap font-medium ${z ? "max-w-[3.5rem] text-xs" : "max-w-[7rem]"}`,
110
- children: j("voiceSession.endShort", "End")
110
+ }), /* @__PURE__ */ g("span", {
111
+ className: `truncate whitespace-nowrap font-medium ${L ? "max-w-[3.5rem] text-xs" : "max-w-[7rem]"}`,
112
+ children: k("voiceSession.endShort", "End")
111
113
  })]
112
114
  }),
113
- /* @__PURE__ */ h("div", {
114
- className: `flex flex-col items-center ${z ? "px-3" : `min-h-[1.5rem] ${q ? R ? "pt-14" : "pt-10" : ""}`}`,
115
- children: q ? /* @__PURE__ */ h("p", {
115
+ /* @__PURE__ */ g("div", {
116
+ className: `flex flex-col items-center ${L ? "px-3" : `min-h-[1.5rem] ${q ? I ? "pt-14" : "pt-10" : ""}`}`,
117
+ children: q ? /* @__PURE__ */ g("p", {
116
118
  className: "max-w-xs text-center text-xs text-status-warning",
117
119
  "data-testid": "assistant-voice-notice",
118
- children: v(b, j)
120
+ children: de(y, k)
119
121
  }) : null
120
122
  }),
121
123
  (() => {
122
- let e = /* @__PURE__ */ h(u, {
123
- session: _,
124
- compact: z,
124
+ let e = /* @__PURE__ */ g(ne, {
125
+ session: v,
126
+ compact: L,
125
127
  connecting: Y === "connecting",
126
- onPress: n(Y) ? he : S,
127
- label: n(Y) ? j("voiceSession.interrupt", "Stop the assistant and speak") : M ? j("voiceSession.unmute", "Turn the microphone on") : j("voiceSession.mute", "Turn the microphone off")
128
- }), t = r(Y) ? x : J || null, i = N === null ? null : y(N, j);
129
- return z ? /* @__PURE__ */ h(re, {
130
- spokenChunks: E,
128
+ onPress: n(Y) ? ge : x,
129
+ label: n(Y) ? k("voiceSession.interrupt", "Stop the assistant and speak") : A ? k("voiceSession.unmute", "Turn the microphone on") : k("voiceSession.mute", "Turn the microphone off")
130
+ }), t = r(Y) ? b : J || null, i = j === null ? null : fe(j, k);
131
+ return L ? /* @__PURE__ */ g(re, {
132
+ spokenChunks: T,
131
133
  state: Y,
132
134
  caption: t,
133
135
  statusText: Q,
@@ -135,12 +137,12 @@ var _ = ({ session: _, turns: fe = [], onSaveTranscript: pe, onContinueInChat: m
135
137
  rotateStatus: $,
136
138
  errorText: i,
137
139
  control: e
138
- }) : /* @__PURE__ */ h(ie, {
140
+ }) : /* @__PURE__ */ g(ie, {
139
141
  state: Y,
140
142
  userCaption: J || null,
141
- spokenChunks: E,
142
- assistantCaption: x,
143
- expanded: R,
143
+ spokenChunks: T,
144
+ assistantCaption: b,
145
+ expanded: I,
144
146
  statusText: Q,
145
147
  statusSuffix: Z,
146
148
  rotateStatus: $,
@@ -148,54 +150,84 @@ var _ = ({ session: _, turns: fe = [], onSaveTranscript: pe, onContinueInChat: m
148
150
  control: e
149
151
  });
150
152
  })(),
151
- V ? /* @__PURE__ */ h(ae, {
152
- turns: fe,
153
- onClose: () => H(!1),
154
- onSave: pe,
155
- onContinueInChat: me
153
+ D && !V ? /* @__PURE__ */ g("div", {
154
+ className: L ? "absolute left-20 right-36 top-2 flex justify-center" : `flex w-full justify-center ${I ? "max-w-[calc(100%-12rem)]" : "max-w-[calc(100%-8rem)]"}`,
155
+ children: /* @__PURE__ */ g("button", {
156
+ type: "button",
157
+ onClick: () => {
158
+ F("panel"), D.onOpen();
159
+ },
160
+ className: `max-w-full truncate rounded-full border border-border-default bg-bg-elevated font-medium text-text-primary transition-colors hover:bg-bg-raised focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${L ? "h-8 px-3 text-xs" : "h-10 px-4 text-sm"}`,
161
+ "data-testid": "assistant-voice-proposal-chip",
162
+ children: D.label
163
+ })
164
+ }) : null,
165
+ O && V ? /* @__PURE__ */ _("div", {
166
+ className: `absolute z-10 flex flex-col gap-2 overflow-y-auto rounded-lg border border-border-subtle bg-bg-elevated shadow-lg ${I ? "inset-x-6 bottom-24 top-24 mx-auto max-w-xl p-4" : "inset-x-3 bottom-16 top-16 p-3"}`,
167
+ "data-testid": "assistant-voice-proposal-tray",
168
+ children: [/* @__PURE__ */ g("div", {
169
+ className: "flex justify-end",
170
+ children: /* @__PURE__ */ g("button", {
171
+ type: "button",
172
+ onClick: O.onClose,
173
+ className: "flex size-8 items-center justify-center rounded-full 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",
174
+ "aria-label": O.closeLabel,
175
+ "data-testid": "assistant-voice-proposal-tray-close",
176
+ children: /* @__PURE__ */ g(h, {
177
+ className: "size-4",
178
+ "aria-hidden": "true"
179
+ })
180
+ })
181
+ }), O.content]
156
182
  }) : null,
157
- w ? /* @__PURE__ */ h("div", {
158
- className: `absolute ${R ? "left-6 top-6" : z ? "left-11 top-2" : "left-3 top-3"}`,
159
- children: /* @__PURE__ */ h(c, {
183
+ z ? /* @__PURE__ */ g(ae, {
184
+ turns: pe,
185
+ onClose: () => B(!1),
186
+ onSave: me,
187
+ onContinueInChat: he
188
+ }) : null,
189
+ C ? /* @__PURE__ */ g("div", {
190
+ className: `absolute ${I ? "left-6 top-6" : L ? "left-11 top-2" : "left-3 top-3"}`,
191
+ children: /* @__PURE__ */ g(u, {
160
192
  onFiles: (e) => {
161
- w(e), L((e) => e === "mini" ? "panel" : e);
193
+ C(e), F((e) => e === "mini" ? "panel" : e);
162
194
  },
163
- onPickerOpen: ye,
195
+ onPickerOpen: K,
164
196
  direction: "down",
165
- canAddMore: ve
197
+ canAddMore: ye
166
198
  })
167
199
  }) : null,
168
- (C.length > 0 || T > 0) && !z ? /* @__PURE__ */ h("div", {
169
- className: `absolute ${R ? "bottom-24 left-24 right-24" : "bottom-16 left-16 right-16"}`,
200
+ (S.length > 0 || w > 0) && !L ? /* @__PURE__ */ g("div", {
201
+ className: `absolute ${I ? "bottom-24 left-24 right-24" : "bottom-16 left-16 right-16"}`,
170
202
  "data-testid": "assistant-voice-attachments",
171
- children: /* @__PURE__ */ h(l, {
172
- attachments: C,
173
- onRemove: ge ?? (() => void 0),
174
- onRetry: _e ?? (() => void 0),
175
- preparingCount: T
203
+ children: /* @__PURE__ */ g(te, {
204
+ attachments: S,
205
+ onRemove: _e ?? (() => void 0),
206
+ onRetry: ve ?? (() => void 0),
207
+ preparingCount: w
176
208
  })
177
209
  }) : null,
178
- /* @__PURE__ */ h("button", {
210
+ /* @__PURE__ */ g("button", {
179
211
  type: "button",
180
- onClick: () => H((e) => !e),
181
- className: `absolute ${R ? "bottom-6 right-6 size-14" : z ? "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`,
182
- "aria-pressed": V,
183
- "aria-label": j("voiceSession.transcriptTitle", "Voice transcript"),
212
+ onClick: () => B((e) => !e),
213
+ className: `absolute ${I ? "bottom-6 right-6 size-14" : L ? "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`,
214
+ "aria-pressed": z,
215
+ "aria-label": k("voiceSession.transcriptTitle", "Voice transcript"),
184
216
  "data-testid": "assistant-voice-transcript-toggle",
185
- children: /* @__PURE__ */ h(ue, { className: R ? "size-6" : z ? "size-4" : "size-5" })
217
+ children: /* @__PURE__ */ g(ue, { className: I ? "size-6" : L ? "size-4" : "size-5" })
186
218
  }),
187
- /* @__PURE__ */ h("button", {
219
+ /* @__PURE__ */ g("button", {
188
220
  type: "button",
189
- onClick: () => L(B),
190
- className: `absolute ${R ? "bottom-6 left-6 size-14" : z ? "left-2 top-2 size-8" : "bottom-3 left-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`,
191
- "aria-label": B === "panel" ? j("voiceSession.expandPanel", "Show the conversation in the panel") : B === "full" ? j("voiceSession.expand", "Expand the conversation to full screen") : j("voiceSession.collapse", "Shrink to the compact controller"),
221
+ onClick: () => F(R),
222
+ className: `absolute ${I ? "bottom-6 left-6 size-14" : L ? "left-2 top-2 size-8" : "bottom-3 left-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`,
223
+ "aria-label": R === "panel" ? k("voiceSession.expandPanel", "Show the conversation in the panel") : R === "full" ? k("voiceSession.expand", "Expand the conversation to full screen") : k("voiceSession.collapse", "Shrink to the compact controller"),
192
224
  "data-testid": "assistant-voice-expand",
193
- children: R ? /* @__PURE__ */ h(le, { className: "size-5" }) : /* @__PURE__ */ h(ce, { className: z ? "size-4" : "size-5" })
225
+ children: I ? /* @__PURE__ */ g(le, { className: "size-5" }) : /* @__PURE__ */ g(ce, { className: L ? "size-4" : "size-5" })
194
226
  })
195
227
  ]
196
228
  });
197
229
  };
198
- function v(e, t) {
230
+ function de(e, t) {
199
231
  switch (e) {
200
232
  case "network": return t("voiceSession.noticeNetwork", "Speech recognition lost its connection. Check your network — it will retry.");
201
233
  case "not-capturing": return t("voiceSession.noticeNotCapturing", "The microphone did not start. Check that this site is allowed to use it, then try again.");
@@ -204,7 +236,7 @@ function v(e, t) {
204
236
  default: return e;
205
237
  }
206
238
  }
207
- function y(e, t) {
239
+ function fe(e, t) {
208
240
  switch (e) {
209
241
  case "mic-denied": return t("voiceSession.micDenied", "Microphone access is blocked. Allow it in your browser settings to talk.");
210
242
  case "no-speech-support": return t("voiceSession.noSpeechSupport", "This browser cannot listen. Try a different browser, or type instead.");
@@ -213,4 +245,4 @@ function y(e, t) {
213
245
  }
214
246
  }
215
247
  //#endregion
216
- export { _ as AssistantVoiceSession };
248
+ export { v as AssistantVoiceSession };