@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.
- package/dist/shared/assistant/adminModeSendGate.d.ts +6 -5
- package/dist/shared/assistant/adminModeSendGate.d.ts.map +1 -1
- package/dist/shared/assistant/adminModeSendGate.js +11 -11
- package/dist/shared/assistant/api.d.ts +313 -28
- package/dist/shared/assistant/api.d.ts.map +1 -1
- package/dist/shared/assistant/api.js +351 -135
- package/dist/shared/assistant/autoRouting.d.ts +11 -3
- package/dist/shared/assistant/autoRouting.d.ts.map +1 -1
- package/dist/shared/assistant/autoRouting.js +7 -7
- package/dist/shared/assistant/capabilities.d.ts +28 -0
- package/dist/shared/assistant/capabilities.d.ts.map +1 -1
- package/dist/shared/assistant/capabilities.js +19 -10
- package/dist/shared/assistant/conversation.d.ts +24 -2
- package/dist/shared/assistant/conversation.d.ts.map +1 -1
- package/dist/shared/assistant/createSandboxAssistantTransport.d.ts.map +1 -1
- package/dist/shared/assistant/createSandboxAssistantTransport.js +67 -54
- package/dist/shared/assistant/history/historyList.js +1 -1
- package/dist/shared/assistant/history/historyMapping.d.ts.map +1 -1
- package/dist/shared/assistant/history/historyMapping.js +5 -1
- package/dist/shared/assistant/history/historyResume.js +7 -7
- package/dist/shared/assistant/i18nManifest.d.ts +53 -0
- package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
- package/dist/shared/assistant/i18nManifest.js +75 -16
- package/dist/shared/assistant/index.d.ts +15 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/modeCapabilities.js +1 -1
- package/dist/shared/assistant/operations.d.ts +22 -0
- package/dist/shared/assistant/operations.d.ts.map +1 -1
- package/dist/shared/assistant/operations.js +2 -2
- package/dist/shared/assistant/prewarm.d.ts +7 -0
- package/dist/shared/assistant/prewarm.d.ts.map +1 -1
- package/dist/shared/assistant/prewarm.js +1 -1
- package/dist/shared/assistant/product.d.ts +80 -2
- package/dist/shared/assistant/product.d.ts.map +1 -1
- package/dist/shared/assistant/product.js +10 -6
- package/dist/shared/assistant/proposalWriteRules.d.ts +40 -0
- package/dist/shared/assistant/proposalWriteRules.d.ts.map +1 -0
- package/dist/shared/assistant/proposalWriteRules.js +14 -0
- package/dist/shared/assistant/store.d.ts +17 -0
- package/dist/shared/assistant/store.d.ts.map +1 -1
- package/dist/shared/assistant/store.js +50 -43
- package/dist/shared/assistant/turnOutcome.d.ts +34 -2
- package/dist/shared/assistant/turnOutcome.d.ts.map +1 -1
- package/dist/shared/assistant/turnOutcome.js +28 -17
- package/dist/shared/assistant/turnOutcomeCopy.d.ts +29 -7
- package/dist/shared/assistant/turnOutcomeCopy.d.ts.map +1 -1
- package/dist/shared/assistant/turnOutcomeCopy.js +18 -6
- package/dist/shared/assistant/types.d.ts +5 -1
- package/dist/shared/assistant/types.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantApiCallsConsentDialog.js +4 -4
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +992 -718
- package/dist/shared/assistant/ui/AssistantConversationList.js +6 -6
- package/dist/shared/assistant/ui/AssistantLanguageMenu.js +6 -6
- package/dist/shared/assistant/ui/AssistantMessageItem.d.ts +8 -1
- package/dist/shared/assistant/ui/AssistantMessageItem.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantMessageItem.js +77 -76
- package/dist/shared/assistant/ui/AssistantMessageList.d.ts +13 -1
- package/dist/shared/assistant/ui/AssistantMessageList.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantMessageList.js +15 -13
- package/dist/shared/assistant/ui/AssistantReplyLanguageSelector.js +5 -5
- package/dist/shared/assistant/ui/AssistantSpeechProvider.js +209 -209
- package/dist/shared/assistant/ui/AssistantWriteConfirmDialog.d.ts +62 -0
- package/dist/shared/assistant/ui/AssistantWriteConfirmDialog.d.ts.map +1 -0
- package/dist/shared/assistant/ui/AssistantWriteConfirmDialog.js +253 -0
- package/dist/shared/assistant/ui/AssistantWriteProposalCard.d.ts +72 -0
- package/dist/shared/assistant/ui/AssistantWriteProposalCard.d.ts.map +1 -0
- package/dist/shared/assistant/ui/AssistantWriteProposalCard.js +439 -0
- package/dist/shared/assistant/ui/AssistantWriteProposalSlot.d.ts +40 -0
- package/dist/shared/assistant/ui/AssistantWriteProposalSlot.d.ts.map +1 -0
- package/dist/shared/assistant/ui/AssistantWriteProposalSlot.js +35 -0
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +8 -8
- package/dist/shared/assistant/ui/useVoiceSession.d.ts +28 -0
- package/dist/shared/assistant/ui/useVoiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/ui/useVoiceSession.js +159 -110
- package/dist/shared/assistant/ui/useWriteProposalConfirm.d.ts +61 -0
- package/dist/shared/assistant/ui/useWriteProposalConfirm.d.ts.map +1 -0
- package/dist/shared/assistant/ui/useWriteProposalConfirm.js +109 -0
- package/dist/shared/assistant/ui/useWriteProposals.d.ts +128 -0
- package/dist/shared/assistant/ui/useWriteProposals.d.ts.map +1 -0
- package/dist/shared/assistant/ui/useWriteProposals.js +240 -0
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts +17 -1
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +141 -109
- package/dist/shared/assistant/ui/writeProposalPresentation.d.ts +76 -0
- package/dist/shared/assistant/ui/writeProposalPresentation.d.ts.map +1 -0
- package/dist/shared/assistant/ui/writeProposalPresentation.js +110 -0
- package/dist/shared/assistant/usageReporting.d.ts +108 -0
- package/dist/shared/assistant/usageReporting.d.ts.map +1 -0
- package/dist/shared/assistant/usageReporting.js +155 -0
- package/dist/shared/assistant/useAssistantApiAccess.d.ts +49 -14
- package/dist/shared/assistant/useAssistantApiAccess.d.ts.map +1 -1
- package/dist/shared/assistant/useAssistantApiAccess.js +43 -25
- package/dist/shared/assistant/useAssistantHeartbeat.d.ts.map +1 -1
- package/dist/shared/assistant/useAssistantHeartbeat.js +5 -5
- package/dist/shared/assistant/useWorkspaceWriteAccess.d.ts +5 -6
- package/dist/shared/assistant/useWorkspaceWriteAccess.d.ts.map +1 -1
- package/dist/shared/assistant/voice/voiceSession.d.ts +46 -0
- package/dist/shared/assistant/voice/voiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/voice/voiceSession.js +35 -2
- package/dist/shared/assistant/writeConfirmSeam.d.ts +32 -0
- package/dist/shared/assistant/writeConfirmSeam.d.ts.map +1 -0
- package/dist/shared/assistant/writeConfirmSeam.js +23 -0
- package/dist/shared/assistant/writeModeConsent.d.ts +16 -8
- package/dist/shared/assistant/writeModeConsent.d.ts.map +1 -1
- package/dist/shared/assistant/writeModeConsent.js +2 -2
- package/dist/shared/assistant/writeProposalDiscovery.d.ts +187 -0
- package/dist/shared/assistant/writeProposalDiscovery.d.ts.map +1 -0
- package/dist/shared/assistant/writeProposalDiscovery.js +246 -0
- package/dist/shared/assistant/writeProposalErrorCopy.d.ts +135 -0
- package/dist/shared/assistant/writeProposalErrorCopy.d.ts.map +1 -0
- package/dist/shared/assistant/writeProposalErrorCopy.js +135 -0
- package/dist/shared/assistant/writeProposalVoice.d.ts +133 -0
- package/dist/shared/assistant/writeProposalVoice.d.ts.map +1 -0
- package/dist/shared/assistant/writeProposalVoice.js +66 -0
- package/dist/shared/assistant/writeProposals.d.ts +268 -0
- package/dist/shared/assistant/writeProposals.d.ts.map +1 -0
- package/dist/shared/assistant/writeProposals.js +445 -0
- package/dist/shared/assistant/writeReplyBinder.d.ts +166 -0
- package/dist/shared/assistant/writeReplyBinder.d.ts.map +1 -0
- package/dist/shared/assistant/writeReplyBinder.js +233 -0
- package/dist/shared/assistant/writeReplySend.d.ts +110 -0
- package/dist/shared/assistant/writeReplySend.d.ts.map +1 -0
- package/dist/shared/assistant/writeReplySend.js +93 -0
- package/dist/shared-assistant.js +168 -153
- package/dist/ui/modal-shell.d.ts +14 -1
- package/dist/ui/modal-shell.d.ts.map +1 -1
- package/dist/ui/modal-shell.js +8 -6
- 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,
|
|
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
|
|
5
|
-
import { spokenSoFar as
|
|
6
|
-
import { ASSISTANT_PANEL_ATTR as
|
|
7
|
-
import { AssistantAttachmentButton as
|
|
8
|
-
import { AssistantAttachmentChips as
|
|
9
|
-
import { AssistantVoiceOrb as
|
|
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
|
|
16
|
-
import { jsx as
|
|
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
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
let
|
|
22
|
-
|
|
23
|
-
}, [
|
|
24
|
-
|
|
25
|
-
}, []),
|
|
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" ?
|
|
28
|
+
document.visibilityState === "hidden" ? W() : G();
|
|
29
29
|
};
|
|
30
30
|
return document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e);
|
|
31
|
-
}, [
|
|
32
|
-
let e =
|
|
31
|
+
}, [W, G]), f(() => {
|
|
32
|
+
let e = G;
|
|
33
33
|
return window.addEventListener("focus", e), () => {
|
|
34
|
-
window.removeEventListener("focus", e),
|
|
34
|
+
window.removeEventListener("focus", e), H.current = !1;
|
|
35
35
|
};
|
|
36
36
|
}, []), f(() => {
|
|
37
|
-
|
|
38
|
-
}, []), e(
|
|
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:
|
|
45
|
+
session: N.current,
|
|
46
46
|
doc: document
|
|
47
47
|
}),
|
|
48
|
-
transcriptOpen:
|
|
48
|
+
transcriptOpen: z
|
|
49
49
|
});
|
|
50
50
|
if (t === "ignore") return;
|
|
51
|
-
e.preventDefault(), t === "close-transcript" ?
|
|
51
|
+
e.preventDefault(), t === "close-transcript" ? B(!1) : V ? O?.onClose() : E();
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
if (e.key !== "Tab" || !
|
|
55
|
-
let t = (
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
E,
|
|
63
|
+
I,
|
|
64
|
+
z,
|
|
65
|
+
V,
|
|
66
|
+
O
|
|
65
67
|
]);
|
|
66
|
-
let q =
|
|
67
|
-
snapshot:
|
|
68
|
-
capturing:
|
|
69
|
-
interrupting:
|
|
70
|
-
awaitingEndpoint:
|
|
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
|
|
74
|
-
case "endpoint-grace": return
|
|
75
|
-
case "interrupting": return
|
|
76
|
-
case "thinking": return
|
|
77
|
-
case "speaking": return
|
|
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
|
|
82
|
+
case "listening": return A ? k("voiceSession.muted", "Microphone off") : k("voiceSession.listening", "Listening…");
|
|
81
83
|
default: return Y;
|
|
82
84
|
}
|
|
83
|
-
})(), Z =
|
|
84
|
-
tr:
|
|
85
|
+
})(), Z = ee({
|
|
86
|
+
tr: k,
|
|
85
87
|
stage: Y,
|
|
86
|
-
muted:
|
|
88
|
+
muted: A,
|
|
87
89
|
label: X
|
|
88
|
-
}), Q =
|
|
89
|
-
return /* @__PURE__ */
|
|
90
|
-
ref:
|
|
91
|
-
className: `flex flex-col items-center justify-between bg-bg-sunken ${
|
|
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":
|
|
94
|
-
"aria-label":
|
|
95
|
+
"aria-modal": I || void 0,
|
|
96
|
+
"aria-label": k("voiceSession.title", "Voice conversation"),
|
|
95
97
|
"data-testid": "assistant-voice-session",
|
|
96
|
-
[
|
|
98
|
+
[l]: "",
|
|
97
99
|
children: [
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
ref:
|
|
100
|
+
/* @__PURE__ */ _("button", {
|
|
101
|
+
ref: M,
|
|
100
102
|
type: "button",
|
|
101
|
-
onClick:
|
|
102
|
-
className: `absolute ${
|
|
103
|
-
title:
|
|
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
|
|
106
|
-
className:
|
|
107
|
+
children: [/* @__PURE__ */ g(h, {
|
|
108
|
+
className: I ? "size-6" : L ? "size-4" : "size-5",
|
|
107
109
|
"aria-hidden": "true"
|
|
108
|
-
}), /* @__PURE__ */
|
|
109
|
-
className: `truncate whitespace-nowrap font-medium ${
|
|
110
|
-
children:
|
|
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__ */
|
|
114
|
-
className: `flex flex-col items-center ${
|
|
115
|
-
children: q ? /* @__PURE__ */
|
|
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:
|
|
120
|
+
children: de(y, k)
|
|
119
121
|
}) : null
|
|
120
122
|
}),
|
|
121
123
|
(() => {
|
|
122
|
-
let e = /* @__PURE__ */
|
|
123
|
-
session:
|
|
124
|
-
compact:
|
|
124
|
+
let e = /* @__PURE__ */ g(ne, {
|
|
125
|
+
session: v,
|
|
126
|
+
compact: L,
|
|
125
127
|
connecting: Y === "connecting",
|
|
126
|
-
onPress: n(Y) ?
|
|
127
|
-
label: n(Y) ?
|
|
128
|
-
}), t = r(Y) ?
|
|
129
|
-
return
|
|
130
|
-
spokenChunks:
|
|
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__ */
|
|
140
|
+
}) : /* @__PURE__ */ g(ie, {
|
|
139
141
|
state: Y,
|
|
140
142
|
userCaption: J || null,
|
|
141
|
-
spokenChunks:
|
|
142
|
-
assistantCaption:
|
|
143
|
-
expanded:
|
|
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__ */
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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
|
-
|
|
193
|
+
C(e), F((e) => e === "mini" ? "panel" : e);
|
|
162
194
|
},
|
|
163
|
-
onPickerOpen:
|
|
195
|
+
onPickerOpen: K,
|
|
164
196
|
direction: "down",
|
|
165
|
-
canAddMore:
|
|
197
|
+
canAddMore: ye
|
|
166
198
|
})
|
|
167
199
|
}) : null,
|
|
168
|
-
(
|
|
169
|
-
className: `absolute ${
|
|
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__ */
|
|
172
|
-
attachments:
|
|
173
|
-
onRemove:
|
|
174
|
-
onRetry:
|
|
175
|
-
preparingCount:
|
|
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__ */
|
|
210
|
+
/* @__PURE__ */ g("button", {
|
|
179
211
|
type: "button",
|
|
180
|
-
onClick: () =>
|
|
181
|
-
className: `absolute ${
|
|
182
|
-
"aria-pressed":
|
|
183
|
-
"aria-label":
|
|
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__ */
|
|
217
|
+
children: /* @__PURE__ */ g(ue, { className: I ? "size-6" : L ? "size-4" : "size-5" })
|
|
186
218
|
}),
|
|
187
|
-
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ g("button", {
|
|
188
220
|
type: "button",
|
|
189
|
-
onClick: () =>
|
|
190
|
-
className: `absolute ${
|
|
191
|
-
"aria-label":
|
|
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:
|
|
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
|
|
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
|
|
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 {
|
|
248
|
+
export { v as AssistantVoiceSession };
|