@burdenoff/fe-libs 2026.905.8 → 2026.906.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shared/assistant/index.d.ts +1 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantLanguageMenu.d.ts +27 -0
- package/dist/shared/assistant/ui/AssistantLanguageMenu.d.ts.map +1 -0
- package/dist/shared/assistant/ui/AssistantLanguageMenu.js +91 -0
- package/dist/shared/assistant/ui/AssistantMoreMenu.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantMoreMenu.js +1 -1
- package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts.map +1 -1
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +107 -114
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/ui/voice/AssistantVoiceSession.js +54 -53
- package/dist/shared/assistant/ui/voice/VoiceMiniController.d.ts +14 -0
- package/dist/shared/assistant/ui/voice/VoiceMiniController.d.ts.map +1 -1
- package/dist/shared/assistant/ui/voice/VoiceMiniController.js +29 -22
- package/dist/shared-assistant.js +41 -40
- package/package.json +1 -1
|
@@ -81,6 +81,7 @@ export * from './ui/AssistantMarkdownImage';
|
|
|
81
81
|
export * from './ui/AssistantMarkdownRenderer';
|
|
82
82
|
export * from './ui/AssistantMessageAttachments';
|
|
83
83
|
export * from './ui/AssistantPendingWriteCard';
|
|
84
|
+
export * from './ui/AssistantLanguageMenu';
|
|
84
85
|
export * from './ui/AssistantReplyLanguageSelector';
|
|
85
86
|
export * from './ui/AssistantSpeakButton';
|
|
86
87
|
export * from './ui/AssistantSpokenTurnsNotice';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAGH,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AE1C,cAAc,iCAAiC,CAAC;AAGhD,cAAc,OAAO,CAAC;AACtB,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Language, in ONE place.
|
|
4
|
+
*
|
|
5
|
+
* ★★ This replaces two controls that looked identical and lived apart: a globe
|
|
6
|
+
* chip in the composer (the language you SPEAK) and a separate row in this menu
|
|
7
|
+
* (the language the assistant ANSWERS in). Same icon, same kind of list, no
|
|
8
|
+
* visible words telling them apart — so they read as the same setting shown
|
|
9
|
+
* twice, and the person who commissioned the split read them that way too.
|
|
10
|
+
*
|
|
11
|
+
* ★ They are not quite the same, and the difference is worth keeping: reply
|
|
12
|
+
* language also chooses the VOICE, and a farmer may dictate in Tamil but want
|
|
13
|
+
* the answer in English to forward to a buyer. But that is an override, not a
|
|
14
|
+
* peer setting — so it is subordinate here rather than living somewhere else
|
|
15
|
+
* entirely.
|
|
16
|
+
*
|
|
17
|
+
* ★★ The default couples them. `replyLanguage: null` means MATCH THE INPUT, so
|
|
18
|
+
* a user who picks Tamil gets Tamil answers without touching the second row.
|
|
19
|
+
* The second row exists to BREAK that coupling, and announces the language it
|
|
20
|
+
* currently resolves to so "Match my language" is never a mystery.
|
|
21
|
+
*
|
|
22
|
+
* ★ Both stay native `<select>`s. On a phone that opens the OS picker, which
|
|
23
|
+
* already scrolls, searches and localises itself — worth far more across nine
|
|
24
|
+
* Indic languages than a custom dropdown that reimplements all three badly.
|
|
25
|
+
*/
|
|
26
|
+
export declare const AssistantLanguageMenu: FC;
|
|
27
|
+
//# sourceMappingURL=AssistantLanguageMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AssistantLanguageMenu.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantLanguageMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAWzC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,qBAAqB,EAAE,EAyGnC,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { useI18n as e } from "../../providers/shell/I18nProvider.js";
|
|
2
|
+
import { ASSISTANT_LANGUAGES as t } from "../voice/languages.js";
|
|
3
|
+
import { resolveLanguagePair as n } from "../voice/languagePair.js";
|
|
4
|
+
import { useAssistantTr as r } from "../i18n.js";
|
|
5
|
+
import { useAssistantStore as i } from "../store.js";
|
|
6
|
+
import { useMemo as a } from "react";
|
|
7
|
+
import { Languages as o } from "lucide-react";
|
|
8
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
|
+
//#region src/shared/assistant/ui/AssistantLanguageMenu.tsx
|
|
10
|
+
var l = "__match__", u = () => {
|
|
11
|
+
let u = r(), { locale: d } = e(), f = i((e) => e.assistantLanguage), p = i((e) => e.setAssistantLanguage), m = i((e) => e.replyLanguage), h = i((e) => e.setReplyLanguage), g = a(() => n(f, m, d), [
|
|
12
|
+
f,
|
|
13
|
+
m,
|
|
14
|
+
d
|
|
15
|
+
]), _ = u("language.inputLabel", "Language"), v = u("language.replyLabel", "Assistant replies in"), y = f ?? "";
|
|
16
|
+
return /* @__PURE__ */ c("div", {
|
|
17
|
+
"data-testid": "assistant-language-menu",
|
|
18
|
+
children: [/* @__PURE__ */ c("label", {
|
|
19
|
+
className: "relative flex cursor-pointer items-center gap-2.5 px-3 py-2 text-xs text-text-primary transition-colors hover:bg-bg-elevated focus-within:ring-2 focus-within:ring-border-strong",
|
|
20
|
+
title: `${_}: ${g.input.label}`,
|
|
21
|
+
"data-testid": "assistant-input-language",
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ s(o, {
|
|
24
|
+
className: "size-3.5 flex-shrink-0 text-text-secondary",
|
|
25
|
+
"aria-hidden": "true"
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ s("span", {
|
|
28
|
+
className: "flex-1",
|
|
29
|
+
children: _
|
|
30
|
+
}),
|
|
31
|
+
/* @__PURE__ */ s("span", {
|
|
32
|
+
className: "text-text-muted",
|
|
33
|
+
children: g.input.label
|
|
34
|
+
}),
|
|
35
|
+
/* @__PURE__ */ c("select", {
|
|
36
|
+
"aria-label": _,
|
|
37
|
+
value: y,
|
|
38
|
+
onChange: (e) => {
|
|
39
|
+
let t = e.target.value;
|
|
40
|
+
p(t === "" ? null : t);
|
|
41
|
+
},
|
|
42
|
+
className: "absolute inset-0 cursor-pointer opacity-0",
|
|
43
|
+
children: [/* @__PURE__ */ s("option", {
|
|
44
|
+
value: "",
|
|
45
|
+
children: u("voice.languageFollowApp", "Same as interface")
|
|
46
|
+
}), t.map((e) => /* @__PURE__ */ s("option", {
|
|
47
|
+
value: e.code,
|
|
48
|
+
children: e.label
|
|
49
|
+
}, e.code))]
|
|
50
|
+
})
|
|
51
|
+
]
|
|
52
|
+
}), /* @__PURE__ */ c("label", {
|
|
53
|
+
className: "relative flex cursor-pointer items-center gap-2.5 py-2 pl-9 pr-3 text-xs text-text-secondary transition-colors hover:bg-bg-elevated focus-within:ring-2 focus-within:ring-border-strong",
|
|
54
|
+
title: `${v}: ${g.reply.english}`,
|
|
55
|
+
"data-testid": "assistant-reply-language",
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ s("span", {
|
|
58
|
+
className: "flex-1",
|
|
59
|
+
children: v
|
|
60
|
+
}),
|
|
61
|
+
/* @__PURE__ */ s("span", {
|
|
62
|
+
className: "text-text-muted",
|
|
63
|
+
children: m === null ? `${u("language.replyMatch", "Match my language")} (${g.reply.label})` : g.reply.label
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ c("select", {
|
|
66
|
+
"aria-label": v,
|
|
67
|
+
value: m ?? l,
|
|
68
|
+
onChange: (e) => {
|
|
69
|
+
let t = e.target.value;
|
|
70
|
+
h(t === l ? null : t);
|
|
71
|
+
},
|
|
72
|
+
className: "absolute inset-0 cursor-pointer opacity-0",
|
|
73
|
+
children: [/* @__PURE__ */ c("option", {
|
|
74
|
+
value: l,
|
|
75
|
+
children: [
|
|
76
|
+
u("language.replyMatch", "Match my language"),
|
|
77
|
+
" (",
|
|
78
|
+
g.input.label,
|
|
79
|
+
")"
|
|
80
|
+
]
|
|
81
|
+
}), t.map((e) => /* @__PURE__ */ s("option", {
|
|
82
|
+
value: e.code,
|
|
83
|
+
children: e.label
|
|
84
|
+
}, e.code))]
|
|
85
|
+
})
|
|
86
|
+
]
|
|
87
|
+
})]
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
//#endregion
|
|
91
|
+
export { u as AssistantLanguageMenu };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantMoreMenu.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantMoreMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAgB7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"AssistantMoreMenu.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantMoreMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAgB7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,iBAAiB,EAAE,EAoM/B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useAssistantTr as e } from "../i18n.js";
|
|
2
2
|
import { useAssistantStore as t } from "../store.js";
|
|
3
3
|
import { useAssistantSpeech as n } from "./AssistantSpeechProvider.js";
|
|
4
|
-
import {
|
|
4
|
+
import { AssistantLanguageMenu as r } from "./AssistantLanguageMenu.js";
|
|
5
5
|
import { AssistantVoiceSelector as i } from "./composer/AssistantVoiceSelector.js";
|
|
6
6
|
import { downloadFile as a, exportConversation as o } from "../exportConversation.js";
|
|
7
7
|
import { useEffect as s, useRef as c, useState as l } from "react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantComposer.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/composer/AssistantComposer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,EAAE,EAER,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAG9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAQjD,OAAO,EAGL,KAAK,mBAAmB,EAEzB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"AssistantComposer.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/composer/AssistantComposer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,EAAE,EAER,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAG9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAQjD,OAAO,EAGL,KAAK,mBAAmB,EAEzB,MAAM,mBAAmB,CAAC;AAO3B,UAAU,KAAK;IACb;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,mBAAmB,EAAE,KAAK,IAAI,CAAC;IACtE,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,aAAa,CAAC;IACpB,qDAAqD;IACrD,cAAc,EAAE,mBAAmB,EAAE,CAAC;IACtC,YAAY,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IAC5C;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC;AAID;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,KAAK,CAuZvC,CAAC"}
|
|
@@ -1,185 +1,178 @@
|
|
|
1
1
|
import { useI18n as e } from "../../../providers/shell/I18nProvider.js";
|
|
2
2
|
import { useVoiceInput as t } from "../../voice/useVoiceInput.js";
|
|
3
|
-
import { languageDisplayName as
|
|
4
|
-
import { resolveAssistantLanguage as
|
|
3
|
+
import { languageDisplayName as ee } from "../../voice/speechVoices.js";
|
|
4
|
+
import { resolveAssistantLanguage as n } from "../../voice/languages.js";
|
|
5
5
|
import { useAssistantTr as r } from "../../i18n.js";
|
|
6
6
|
import { getSendableAttachments as i } from "../../attachments.js";
|
|
7
7
|
import { useAssistantStore as a } from "../../store.js";
|
|
8
8
|
import { AssistantAttachmentButton as o } from "./AssistantAttachmentButton.js";
|
|
9
9
|
import { AssistantAttachmentChips as s } from "./AssistantAttachmentChips.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
10
|
+
import { AssistantModeSelector as c } from "./AssistantModeSelector.js";
|
|
11
|
+
import { AssistantVoiceButton as te } from "./AssistantVoiceButton.js";
|
|
12
|
+
import { AssistantVoiceSessionButton as ne } from "../voice/AssistantVoiceSessionButton.js";
|
|
13
|
+
import { useAssistantAttachments as re } from "../../useAssistantAttachments.js";
|
|
14
|
+
import { useCallback as l, useLayoutEffect as ie, useMemo as u, useRef as d, useState as f } from "react";
|
|
15
|
+
import { ArrowUp as p, Loader2 as m } from "lucide-react";
|
|
16
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
18
17
|
//#region src/shared/assistant/ui/composer/AssistantComposer.tsx
|
|
19
|
-
var
|
|
20
|
-
let
|
|
21
|
-
|
|
22
|
-
}, []),
|
|
23
|
-
onFinalize:
|
|
24
|
-
language:
|
|
25
|
-
}),
|
|
26
|
-
|
|
27
|
-
let e =
|
|
28
|
-
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight,
|
|
29
|
-
}, [
|
|
18
|
+
var _ = 200, v = ({ writeAccessDenied: v = !1, onSend: y, disabled: b = !1, placeholder: x, mode: S, availableModes: C, onModeChange: ae, onStartVoiceSession: w }) => {
|
|
19
|
+
let T = r(), { locale: E } = e(), D = d(null), [O, k] = f(""), [A, j] = f(!1), M = d(0), { attachments: N, isBusy: P, preparingCount: F, sendBlocker: I, rejection: L, addFiles: R, remove: z, retry: B, clear: V, clearRejection: H, canAddMore: U } = re(), oe = l((e) => {
|
|
20
|
+
k((t) => t ? `${t.replace(/\s+$/, "")} ${e}` : e);
|
|
21
|
+
}, []), W = a((e) => e.assistantLanguage), G = t({
|
|
22
|
+
onFinalize: oe,
|
|
23
|
+
language: u(() => n(W, E), [W, E]).tag
|
|
24
|
+
}), K = x ?? T("composer.placeholder", "Ask me anything…"), q = O.trim(), J = i(N), Y = N.filter((e) => e.status === "error"), X = (q.length > 0 || J.length > 0) && !b && I === null;
|
|
25
|
+
ie(() => {
|
|
26
|
+
let e = D.current;
|
|
27
|
+
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, _)}px`);
|
|
28
|
+
}, [O]);
|
|
30
29
|
let Z = l(() => {
|
|
31
|
-
X && (
|
|
30
|
+
X && (G.isActive && G.stop(), y(O.trim(), J), k(""), V());
|
|
32
31
|
}, [
|
|
33
32
|
X,
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
y,
|
|
34
|
+
O,
|
|
36
35
|
J,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
]),
|
|
36
|
+
V,
|
|
37
|
+
G
|
|
38
|
+
]), se = l((e) => {
|
|
40
39
|
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Z());
|
|
41
|
-
}, [Z]),
|
|
40
|
+
}, [Z]), ce = l((e) => {
|
|
42
41
|
let t = Array.from(e.clipboardData?.files ?? []);
|
|
43
|
-
t.length !== 0 && (e.preventDefault(),
|
|
44
|
-
}, [
|
|
45
|
-
Array.from(e.dataTransfer?.types ?? []).includes("Files") && (
|
|
46
|
-
}, []),
|
|
47
|
-
|
|
48
|
-
}, []),
|
|
42
|
+
t.length !== 0 && (e.preventDefault(), R(t));
|
|
43
|
+
}, [R]), le = l((e) => {
|
|
44
|
+
Array.from(e.dataTransfer?.types ?? []).includes("Files") && (M.current += 1, j(!0));
|
|
45
|
+
}, []), ue = l(() => {
|
|
46
|
+
M.current = Math.max(0, M.current - 1), M.current === 0 && j(!1);
|
|
47
|
+
}, []), Q = l((e) => {
|
|
49
48
|
Array.from(e.dataTransfer?.types ?? []).includes("Files") && e.preventDefault();
|
|
50
|
-
}, []),
|
|
51
|
-
e.preventDefault(),
|
|
52
|
-
}, [
|
|
49
|
+
}, []), de = l((e) => {
|
|
50
|
+
e.preventDefault(), M.current = 0, j(!1), R(e.dataTransfer?.files ?? null);
|
|
51
|
+
}, [R]), fe = (e) => {
|
|
53
52
|
switch (e) {
|
|
54
|
-
case "too-many": return
|
|
55
|
-
case "too-large": return
|
|
56
|
-
case "empty": return
|
|
57
|
-
case "unreadable": return
|
|
58
|
-
case "unsupported-image": return
|
|
53
|
+
case "too-many": return T("attachments.tooMany", "You can attach up to {{max}} files per message.", { max: 5 });
|
|
54
|
+
case "too-large": return T("attachments.tooLarge", "That file is larger than 10 MB.");
|
|
55
|
+
case "empty": return T("attachments.empty", "That file is empty.");
|
|
56
|
+
case "unreadable": return T("attachments.unreadable", "That file could not be read.");
|
|
57
|
+
case "unsupported-image": return T("attachments.unsupportedImage", "This device can't read that image format, so it can't be resized to send. Save it as JPEG and try again.");
|
|
59
58
|
}
|
|
60
59
|
}, $ = (() => {
|
|
61
|
-
switch (
|
|
62
|
-
case "not-allowed": return
|
|
63
|
-
case "audio-capture": return
|
|
64
|
-
case "network": return
|
|
65
|
-
case "language-not-supported": return
|
|
66
|
-
case "unknown": return
|
|
60
|
+
switch (G.error) {
|
|
61
|
+
case "not-allowed": return T("voice.denied", "Microphone access is blocked. Allow it in your browser settings to dictate.");
|
|
62
|
+
case "audio-capture": return T("voice.noMic", "No microphone was found.");
|
|
63
|
+
case "network": return T("voice.network", "Speech recognition is offline right now.");
|
|
64
|
+
case "language-not-supported": return T("voice.languageNotSupported", "This browser cannot recognise spoken {{language}}. Try a different browser, or type instead.", { language: ee(G.language, E) });
|
|
65
|
+
case "unknown": return T("voice.failed", "Dictation stopped unexpectedly.");
|
|
67
66
|
default: return null;
|
|
68
67
|
}
|
|
69
68
|
})();
|
|
70
|
-
return /* @__PURE__ */
|
|
69
|
+
return /* @__PURE__ */ g("div", {
|
|
71
70
|
className: "flex-shrink-0 px-3 pb-3 pt-1.5",
|
|
72
71
|
children: [
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
onDragEnter:
|
|
75
|
-
onDragLeave:
|
|
76
|
-
onDragOver:
|
|
77
|
-
onDrop:
|
|
78
|
-
className: `rounded-2xl border p-2 shadow-sm transition-colors focus-within:border-action-primary-bg focus-within:ring-2 focus-within:ring-action-primary-bg/15 ${
|
|
72
|
+
/* @__PURE__ */ g("div", {
|
|
73
|
+
onDragEnter: le,
|
|
74
|
+
onDragLeave: ue,
|
|
75
|
+
onDragOver: Q,
|
|
76
|
+
onDrop: de,
|
|
77
|
+
className: `rounded-2xl border p-2 shadow-sm transition-colors focus-within:border-action-primary-bg focus-within:ring-2 focus-within:ring-action-primary-bg/15 ${A ? "border-action-primary-bg border-dashed bg-action-primary-bg/5" : "border-border-default bg-bg-sunken"}`,
|
|
79
78
|
"data-testid": "assistant-composer",
|
|
80
79
|
children: [
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
attachments:
|
|
83
|
-
onRemove:
|
|
84
|
-
onRetry:
|
|
85
|
-
disabled:
|
|
86
|
-
preparingCount:
|
|
80
|
+
/* @__PURE__ */ h(s, {
|
|
81
|
+
attachments: N,
|
|
82
|
+
onRemove: z,
|
|
83
|
+
onRetry: B,
|
|
84
|
+
disabled: b,
|
|
85
|
+
preparingCount: F
|
|
87
86
|
}),
|
|
88
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ g("div", {
|
|
89
88
|
className: "flex items-end gap-2",
|
|
90
89
|
children: [
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
onFiles:
|
|
93
|
-
canAddMore:
|
|
94
|
-
disabled:
|
|
90
|
+
/* @__PURE__ */ h(o, {
|
|
91
|
+
onFiles: R,
|
|
92
|
+
canAddMore: U,
|
|
93
|
+
disabled: b
|
|
95
94
|
}),
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
ref:
|
|
98
|
-
value:
|
|
99
|
-
onChange: (e) =>
|
|
100
|
-
onKeyDown:
|
|
101
|
-
onPaste:
|
|
102
|
-
disabled:
|
|
103
|
-
placeholder:
|
|
95
|
+
/* @__PURE__ */ h("textarea", {
|
|
96
|
+
ref: D,
|
|
97
|
+
value: O,
|
|
98
|
+
onChange: (e) => k(e.target.value),
|
|
99
|
+
onKeyDown: se,
|
|
100
|
+
onPaste: ce,
|
|
101
|
+
disabled: b,
|
|
102
|
+
placeholder: A ? T("composer.dropHere", "Drop files to attach") : K,
|
|
104
103
|
rows: 1,
|
|
105
104
|
className: "min-h-[36px] flex-1 resize-none self-center bg-transparent px-1 py-2 text-[15px] leading-relaxed text-text-primary placeholder:text-text-muted focus:outline-none disabled:opacity-50",
|
|
106
|
-
"aria-label":
|
|
105
|
+
"aria-label": T("chatInput.ariaLabel", "Message input"),
|
|
107
106
|
"data-testid": "assistant-input"
|
|
108
107
|
}),
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
disabled:
|
|
114
|
-
}),
|
|
115
|
-
K.isSupported && /* @__PURE__ */ m(ne, {
|
|
116
|
-
isListening: K.isListening,
|
|
117
|
-
isStarting: K.isStarting,
|
|
118
|
-
onToggle: K.toggle,
|
|
119
|
-
disabled: y
|
|
108
|
+
G.isSupported && /* @__PURE__ */ h(te, {
|
|
109
|
+
isListening: G.isListening,
|
|
110
|
+
isStarting: G.isStarting,
|
|
111
|
+
onToggle: G.toggle,
|
|
112
|
+
disabled: b
|
|
120
113
|
}),
|
|
121
|
-
|
|
122
|
-
onStart:
|
|
123
|
-
disabled:
|
|
124
|
-
}) : /* @__PURE__ */
|
|
114
|
+
w && q.length === 0 && N.length === 0 && !G.isActive ? /* @__PURE__ */ h(ne, {
|
|
115
|
+
onStart: w,
|
|
116
|
+
disabled: b
|
|
117
|
+
}) : /* @__PURE__ */ h("button", {
|
|
125
118
|
type: "button",
|
|
126
119
|
onClick: Z,
|
|
127
120
|
disabled: !X,
|
|
128
121
|
className: `flex size-9 flex-shrink-0 items-center justify-center rounded-full shadow-sm transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong ${X ? "bg-action-primary-bg text-action-primary-text hover:scale-105 hover:bg-action-primary-bg-hover" : "bg-bg-elevated text-text-muted"}`,
|
|
129
|
-
"aria-label":
|
|
122
|
+
"aria-label": T("chatInput.send", "Send message"),
|
|
130
123
|
"data-testid": "assistant-send",
|
|
131
|
-
children:
|
|
124
|
+
children: b || P ? /* @__PURE__ */ h(m, { className: "size-4 animate-spin" }) : /* @__PURE__ */ h(p, { className: "size-4" })
|
|
132
125
|
})
|
|
133
126
|
]
|
|
134
127
|
}),
|
|
135
|
-
|
|
128
|
+
C.length > 1 && /* @__PURE__ */ h("div", {
|
|
136
129
|
className: "mt-2 px-0.5",
|
|
137
|
-
children: /* @__PURE__ */
|
|
138
|
-
mode:
|
|
139
|
-
availableModes:
|
|
140
|
-
onModeChange:
|
|
141
|
-
disabled:
|
|
130
|
+
children: /* @__PURE__ */ h(c, {
|
|
131
|
+
mode: S,
|
|
132
|
+
availableModes: C,
|
|
133
|
+
onModeChange: ae,
|
|
134
|
+
disabled: b
|
|
142
135
|
})
|
|
143
136
|
})
|
|
144
137
|
]
|
|
145
138
|
}),
|
|
146
|
-
|
|
139
|
+
v ? /* @__PURE__ */ h("p", {
|
|
147
140
|
className: "mt-1.5 px-1 text-center text-[11px] text-status-warning",
|
|
148
141
|
"data-testid": "assistant-write-access-warning",
|
|
149
|
-
children:
|
|
142
|
+
children: T("composer.writeAccessDenied", "Changes may not save — your role in this workspace does not currently allow edits. You can still plan and review an action.")
|
|
150
143
|
}) : null,
|
|
151
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ h("div", {
|
|
152
145
|
className: "mt-1.5 px-1 text-center text-[11px]",
|
|
153
146
|
"aria-live": "polite",
|
|
154
|
-
children:
|
|
147
|
+
children: G.isStarting && !G.isListening ? /* @__PURE__ */ h("p", {
|
|
155
148
|
className: "text-text-muted",
|
|
156
149
|
"data-testid": "assistant-voice-starting",
|
|
157
|
-
children:
|
|
158
|
-
}) :
|
|
150
|
+
children: T("voice.starting", "Starting the microphone…")
|
|
151
|
+
}) : G.isListening ? /* @__PURE__ */ g("p", {
|
|
159
152
|
className: "text-status-error-text",
|
|
160
153
|
"data-testid": "assistant-voice-status",
|
|
161
|
-
children: [/* @__PURE__ */
|
|
162
|
-
}) : $ ? /* @__PURE__ */
|
|
154
|
+
children: [/* @__PURE__ */ h("span", { className: "mr-1 inline-block size-1.5 rounded-full bg-status-error-text align-middle motion-safe:animate-pulse" }), G.interim || T("voice.listening", "Listening… speak now, tap the square to stop")]
|
|
155
|
+
}) : $ ? /* @__PURE__ */ h("p", {
|
|
163
156
|
className: "text-status-error-text",
|
|
164
157
|
"data-testid": "assistant-voice-error",
|
|
165
158
|
children: $
|
|
166
|
-
}) :
|
|
159
|
+
}) : L ? /* @__PURE__ */ h("button", {
|
|
167
160
|
type: "button",
|
|
168
|
-
onClick:
|
|
161
|
+
onClick: H,
|
|
169
162
|
className: "text-status-error-text underline-offset-2 hover:underline",
|
|
170
163
|
"data-testid": "assistant-attachment-rejection",
|
|
171
|
-
children:
|
|
172
|
-
}) :
|
|
164
|
+
children: fe(L)
|
|
165
|
+
}) : I === "failed" ? /* @__PURE__ */ h("p", {
|
|
173
166
|
className: "text-status-error-text",
|
|
174
167
|
"data-testid": "assistant-attachment-blocked",
|
|
175
|
-
children: Y.length === 1 ?
|
|
176
|
-
}) : /* @__PURE__ */
|
|
168
|
+
children: Y.length === 1 ? T("attachments.blockedOne", "{{name}} didn't upload. Retry or remove it before sending.", { name: Y[0].filename }) : T("attachments.blockedMany", "{{count}} attachments didn't upload. Retry or remove them before sending.", { count: Y.length })
|
|
169
|
+
}) : /* @__PURE__ */ h("p", {
|
|
177
170
|
className: "text-text-muted",
|
|
178
|
-
children:
|
|
171
|
+
children: T("composer.hint", "Enter to send · Shift+Enter for newline · drag or paste files to attach")
|
|
179
172
|
})
|
|
180
173
|
})
|
|
181
174
|
]
|
|
182
175
|
});
|
|
183
176
|
};
|
|
184
177
|
//#endregion
|
|
185
|
-
export {
|
|
178
|
+
export { v as AssistantComposer };
|
|
@@ -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;AAO7D,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;A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AI,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,CAuiB3C,CAAC"}
|
|
@@ -5,35 +5,35 @@ import { AssistantAttachmentButton as i } from "../composer/AssistantAttachmentB
|
|
|
5
5
|
import { AssistantAttachmentChips as ee } from "../composer/AssistantAttachmentChips.js";
|
|
6
6
|
import { AssistantVoiceOrb as a } from "./AssistantVoiceOrb.js";
|
|
7
7
|
import { VoiceMiniController as te } from "./VoiceMiniController.js";
|
|
8
|
-
import { VoiceStage as
|
|
9
|
-
import { VoiceTranscriptDrawer as
|
|
10
|
-
import { useCallback as
|
|
11
|
-
import { Maximize2 as
|
|
12
|
-
import { jsx as
|
|
8
|
+
import { VoiceStage as ne } from "./VoiceStage.js";
|
|
9
|
+
import { VoiceTranscriptDrawer as o } from "./VoiceTranscriptDrawer.js";
|
|
10
|
+
import { useCallback as re, useEffect as s, useRef as c, useState as l } from "react";
|
|
11
|
+
import { Maximize2 as u, Minimize2 as d, ScrollText as f, X as p } from "lucide-react";
|
|
12
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
13
13
|
//#region src/shared/assistant/ui/voice/AssistantVoiceSession.tsx
|
|
14
|
-
var
|
|
15
|
-
let F = r(), { muted: I, error: L } =
|
|
16
|
-
J.current =
|
|
17
|
-
let oe =
|
|
18
|
-
I || q.current || n(
|
|
19
|
-
}, [I,
|
|
20
|
-
|
|
14
|
+
var g = ({ session: g, turns: y = [], onSaveTranscript: b, onContinueInChat: x, notice: S = null, spoken: C, onInterrupt: w, onToggleMute: T, attachments: E = [], onAttachFiles: D, onRemoveAttachment: O, onRetryAttachment: k, canAttachMore: ie = !0, preparingAttachments: A = 0, spokenChunks: j = null, onEnd: M, capturing: ae = !0, interrupting: N = !1, awaitingEndpoint: P = !1 }) => {
|
|
15
|
+
let F = r(), { muted: I, error: L } = g, R = c(null), z = c(null), [B, V] = l("mini"), H = B === "full", U = B === "mini", W = B === "mini" ? "panel" : B === "panel" ? "full" : "mini", [G, K] = l(!1), q = c(!1), J = c(T);
|
|
16
|
+
J.current = T;
|
|
17
|
+
let oe = re(() => {
|
|
18
|
+
I || q.current || n(g) || (q.current = !0, J.current());
|
|
19
|
+
}, [I, g]);
|
|
20
|
+
s(() => {
|
|
21
21
|
let e = () => {
|
|
22
22
|
q.current && (q.current = !1, J.current());
|
|
23
23
|
};
|
|
24
24
|
return window.addEventListener("focus", e), () => {
|
|
25
25
|
window.removeEventListener("focus", e), q.current = !1;
|
|
26
26
|
};
|
|
27
|
-
}, []),
|
|
27
|
+
}, []), s(() => {
|
|
28
28
|
R.current?.focus();
|
|
29
|
-
}, []),
|
|
29
|
+
}, []), s(() => {
|
|
30
30
|
let e = (e) => {
|
|
31
31
|
if (e.key === "Escape") {
|
|
32
32
|
if (G) {
|
|
33
33
|
K(!1);
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
M();
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
if (e.key !== "Tab" || !H) return;
|
|
@@ -44,13 +44,13 @@ var _ = ({ session: _, turns: b = [], onSaveTranscript: x, onContinueInChat: S,
|
|
|
44
44
|
};
|
|
45
45
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
46
46
|
}, [
|
|
47
|
-
|
|
47
|
+
M,
|
|
48
48
|
H,
|
|
49
49
|
G
|
|
50
50
|
]);
|
|
51
|
-
let Y =
|
|
52
|
-
snapshot:
|
|
53
|
-
capturing:
|
|
51
|
+
let Y = S !== null && L === null, X = n(g), Z = t({
|
|
52
|
+
snapshot: g,
|
|
53
|
+
capturing: ae,
|
|
54
54
|
interrupting: N,
|
|
55
55
|
awaitingEndpoint: P
|
|
56
56
|
}), Q = (() => {
|
|
@@ -66,7 +66,7 @@ var _ = ({ session: _, turns: b = [], onSaveTranscript: x, onContinueInChat: S,
|
|
|
66
66
|
default: return Z;
|
|
67
67
|
}
|
|
68
68
|
})(), $ = I && Z !== "listening" && Q !== "" ? `${Q} · ${F("voiceSession.muted", "Microphone off")}` : Q;
|
|
69
|
-
return /* @__PURE__ */
|
|
69
|
+
return /* @__PURE__ */ h("div", {
|
|
70
70
|
ref: z,
|
|
71
71
|
className: `flex flex-col items-center justify-between bg-bg-sunken ${B === "full" ? "fixed inset-x-0 bottom-0 top-14 z-[60] px-6 py-8" : B === "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"}`,
|
|
72
72
|
role: "dialog",
|
|
@@ -74,102 +74,103 @@ var _ = ({ session: _, turns: b = [], onSaveTranscript: x, onContinueInChat: S,
|
|
|
74
74
|
"aria-label": F("voiceSession.title", "Voice conversation"),
|
|
75
75
|
"data-testid": "assistant-voice-session",
|
|
76
76
|
children: [
|
|
77
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ h("button", {
|
|
78
78
|
ref: R,
|
|
79
79
|
type: "button",
|
|
80
|
-
onClick:
|
|
80
|
+
onClick: M,
|
|
81
81
|
className: `absolute ${H ? "right-6 top-6 h-14 gap-2 px-5 text-base" : U ? "right-2 top-2 size-8" : "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`,
|
|
82
82
|
"aria-label": U ? F("voiceSession.end", "End the voice conversation") : void 0,
|
|
83
83
|
"data-testid": "assistant-voice-end",
|
|
84
|
-
children: [/* @__PURE__ */
|
|
84
|
+
children: [/* @__PURE__ */ m(p, {
|
|
85
85
|
className: H ? "size-6" : U ? "size-4" : "size-5",
|
|
86
86
|
"aria-hidden": "true"
|
|
87
|
-
}), U ? null : /* @__PURE__ */
|
|
87
|
+
}), U ? null : /* @__PURE__ */ m("span", {
|
|
88
88
|
className: "max-w-[7rem] truncate whitespace-nowrap font-medium",
|
|
89
89
|
children: F("voiceSession.endShort", "End")
|
|
90
90
|
})]
|
|
91
91
|
}),
|
|
92
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ m("div", {
|
|
93
93
|
className: `flex flex-col items-center ${U ? "px-3" : `min-h-[1.5rem] ${Y ? H ? "pt-14" : "pt-10" : ""}`}`,
|
|
94
|
-
children: Y ? /* @__PURE__ */
|
|
94
|
+
children: Y ? /* @__PURE__ */ m("p", {
|
|
95
95
|
className: "max-w-xs text-center text-xs text-status-warning",
|
|
96
96
|
"data-testid": "assistant-voice-notice",
|
|
97
|
-
children:
|
|
97
|
+
children: _(S, F)
|
|
98
98
|
}) : null
|
|
99
99
|
}),
|
|
100
100
|
(() => {
|
|
101
|
-
let t = /* @__PURE__ */
|
|
102
|
-
session:
|
|
101
|
+
let t = /* @__PURE__ */ m(a, {
|
|
102
|
+
session: g,
|
|
103
103
|
compact: U,
|
|
104
104
|
connecting: Z === "connecting",
|
|
105
|
-
onPress: e(Z) ?
|
|
105
|
+
onPress: e(Z) ? w : T,
|
|
106
106
|
label: e(Z) ? F("voiceSession.interrupt", "Stop the assistant and speak") : I ? F("voiceSession.unmute", "Turn the microphone on") : F("voiceSession.mute", "Turn the microphone off")
|
|
107
|
-
}), n = e(Z) ?
|
|
108
|
-
return U ? /* @__PURE__ */
|
|
107
|
+
}), n = e(Z) ? C : X || null, r = L === null ? null : v(L, F);
|
|
108
|
+
return U ? /* @__PURE__ */ m(te, {
|
|
109
|
+
spokenChunks: j,
|
|
109
110
|
state: Z,
|
|
110
111
|
caption: n,
|
|
111
112
|
statusText: $,
|
|
112
113
|
errorText: r,
|
|
113
114
|
control: t
|
|
114
|
-
}) : /* @__PURE__ */
|
|
115
|
+
}) : /* @__PURE__ */ m(ne, {
|
|
115
116
|
state: Z,
|
|
116
117
|
userCaption: X || null,
|
|
117
|
-
spokenChunks:
|
|
118
|
-
assistantCaption:
|
|
118
|
+
spokenChunks: j,
|
|
119
|
+
assistantCaption: C,
|
|
119
120
|
expanded: H,
|
|
120
121
|
statusText: $,
|
|
121
122
|
errorText: r,
|
|
122
123
|
control: t
|
|
123
124
|
});
|
|
124
125
|
})(),
|
|
125
|
-
G ? /* @__PURE__ */
|
|
126
|
-
turns:
|
|
126
|
+
G ? /* @__PURE__ */ m(o, {
|
|
127
|
+
turns: y,
|
|
127
128
|
onClose: () => K(!1),
|
|
128
|
-
onSave:
|
|
129
|
-
onContinueInChat:
|
|
129
|
+
onSave: b,
|
|
130
|
+
onContinueInChat: x
|
|
130
131
|
}) : null,
|
|
131
|
-
|
|
132
|
+
D ? /* @__PURE__ */ m("div", {
|
|
132
133
|
className: `absolute ${H ? "left-6 top-6" : U ? "left-11 top-2" : "left-3 top-3"}`,
|
|
133
|
-
children: /* @__PURE__ */
|
|
134
|
+
children: /* @__PURE__ */ m(i, {
|
|
134
135
|
onFiles: (e) => {
|
|
135
|
-
|
|
136
|
+
D(e), V((e) => e === "mini" ? "panel" : e);
|
|
136
137
|
},
|
|
137
138
|
onPickerOpen: oe,
|
|
138
139
|
direction: "down",
|
|
139
140
|
canAddMore: ie
|
|
140
141
|
})
|
|
141
142
|
}) : null,
|
|
142
|
-
(
|
|
143
|
+
(E.length > 0 || A > 0) && !U ? /* @__PURE__ */ m("div", {
|
|
143
144
|
className: `absolute ${H ? "bottom-24 left-24 right-24" : "bottom-16 left-16 right-16"}`,
|
|
144
145
|
"data-testid": "assistant-voice-attachments",
|
|
145
|
-
children: /* @__PURE__ */
|
|
146
|
-
attachments:
|
|
147
|
-
onRemove:
|
|
146
|
+
children: /* @__PURE__ */ m(ee, {
|
|
147
|
+
attachments: E,
|
|
148
|
+
onRemove: O ?? (() => void 0),
|
|
148
149
|
onRetry: k ?? (() => void 0),
|
|
149
150
|
preparingCount: A
|
|
150
151
|
})
|
|
151
152
|
}) : null,
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ m("button", {
|
|
153
154
|
type: "button",
|
|
154
155
|
onClick: () => K((e) => !e),
|
|
155
156
|
className: `absolute ${H ? "bottom-6 right-6 size-14" : U ? "right-11 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`,
|
|
156
157
|
"aria-pressed": G,
|
|
157
158
|
"aria-label": F("voiceSession.transcript", "Voice transcript"),
|
|
158
159
|
"data-testid": "assistant-voice-transcript-toggle",
|
|
159
|
-
children: /* @__PURE__ */
|
|
160
|
+
children: /* @__PURE__ */ m(f, { className: H ? "size-6" : U ? "size-4" : "size-5" })
|
|
160
161
|
}),
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ m("button", {
|
|
162
163
|
type: "button",
|
|
163
164
|
onClick: () => V(W),
|
|
164
165
|
className: `absolute ${H ? "bottom-6 left-6 size-14" : U ? "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`,
|
|
165
166
|
"aria-label": W === "panel" ? F("voiceSession.expandPanel", "Show the conversation in the panel") : W === "full" ? F("voiceSession.expand", "Expand the conversation to full screen") : F("voiceSession.collapse", "Shrink to the compact controller"),
|
|
166
167
|
"data-testid": "assistant-voice-expand",
|
|
167
|
-
children: H ? /* @__PURE__ */
|
|
168
|
+
children: H ? /* @__PURE__ */ m(d, { className: "size-5" }) : /* @__PURE__ */ m(u, { className: U ? "size-4" : "size-5" })
|
|
168
169
|
})
|
|
169
170
|
]
|
|
170
171
|
});
|
|
171
172
|
};
|
|
172
|
-
function
|
|
173
|
+
function _(e, t) {
|
|
173
174
|
switch (e) {
|
|
174
175
|
case "network": return t("voiceSession.noticeNetwork", "Speech recognition lost its connection. Check your network — it will retry.");
|
|
175
176
|
case "not-capturing": return t("voiceSession.noticeNotCapturing", "The microphone did not start. Check that this site is allowed to use it, then try again.");
|
|
@@ -178,7 +179,7 @@ function v(e, t) {
|
|
|
178
179
|
default: return e;
|
|
179
180
|
}
|
|
180
181
|
}
|
|
181
|
-
function
|
|
182
|
+
function v(e, t) {
|
|
182
183
|
switch (e) {
|
|
183
184
|
case "mic-denied": return t("voiceSession.micDenied", "Microphone access is blocked. Allow it in your browser settings to talk.");
|
|
184
185
|
case "no-speech-support": return t("voiceSession.noSpeechSupport", "This browser cannot listen. Try a different browser, or type instead.");
|
|
@@ -187,4 +188,4 @@ function y(e, t) {
|
|
|
187
188
|
}
|
|
188
189
|
}
|
|
189
190
|
//#endregion
|
|
190
|
-
export {
|
|
191
|
+
export { g as AssistantVoiceSession };
|
|
@@ -22,6 +22,20 @@ interface Props {
|
|
|
22
22
|
state: VoiceStageState;
|
|
23
23
|
/** Live user transcript, or the assistant's caption while speaking. */
|
|
24
24
|
caption: string | null;
|
|
25
|
+
/**
|
|
26
|
+
* Per-sentence progress through the spoken reply, when the engine reports it.
|
|
27
|
+
*
|
|
28
|
+
* ★★ Without this the docked strip showed the whole reply as one static
|
|
29
|
+
* block: four acceptance criteria — caption/audio sync, current-sentence
|
|
30
|
+
* emphasis, previous-sentence dimming, and not showing text ahead of the
|
|
31
|
+
* audio — were implemented in `VoiceCaption` and simply unreachable here,
|
|
32
|
+
* because the stage that renders it is only mounted when NOT docked. Docked
|
|
33
|
+
* is the view every session opens in.
|
|
34
|
+
*/
|
|
35
|
+
spokenChunks?: {
|
|
36
|
+
chunks: string[];
|
|
37
|
+
index: number;
|
|
38
|
+
} | null;
|
|
25
39
|
statusText: string;
|
|
26
40
|
/** Mic / interrupt control — the same orb, in its compact size. */
|
|
27
41
|
control: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceMiniController.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/voice/VoiceMiniController.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,6BAA6B,CAAC;AAErC;;;;;;;;;;;;;;;;;GAiBG;AAEH,UAAU,KAAK;IACb,KAAK,EAAE,eAAe,CAAC;IACvB,uEAAuE;IACvE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,OAAO,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"VoiceMiniController.d.ts","sourceRoot":"","sources":["../../../../../src/shared/assistant/ui/voice/VoiceMiniController.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,6BAA6B,CAAC;AAErC;;;;;;;;;;;;;;;;;GAiBG;AAEH,UAAU,KAAK;IACb,KAAK,EAAE,eAAe,CAAC;IACvB,uEAAuE;IACvE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,OAAO,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,KAAK,CAgHzC,CAAC"}
|
|
@@ -1,47 +1,54 @@
|
|
|
1
1
|
import { showsAssistantCaption as e, waveformIsActive as t, waveformIsSettled as n } from "../../voice/voiceStageState.js";
|
|
2
2
|
import { VoiceWaveform as r } from "./VoiceWaveform.js";
|
|
3
|
-
import {
|
|
3
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
4
4
|
//#region src/shared/assistant/ui/voice/VoiceMiniController.tsx
|
|
5
|
-
var
|
|
6
|
-
let
|
|
7
|
-
return /* @__PURE__ */
|
|
5
|
+
var s = ({ state: s, caption: c, spokenChunks: l = null, statusText: u, control: d, errorText: f = null }) => {
|
|
6
|
+
let p = e(s), m = p && l && l.index >= 0 ? l : null;
|
|
7
|
+
return /* @__PURE__ */ o("div", {
|
|
8
8
|
className: "flex min-h-0 w-full flex-1 items-center gap-3 px-4",
|
|
9
9
|
"data-testid": "assistant-voice-mini",
|
|
10
|
-
"data-state":
|
|
11
|
-
children: [/* @__PURE__ */
|
|
10
|
+
"data-state": s,
|
|
11
|
+
children: [/* @__PURE__ */ o("div", {
|
|
12
12
|
className: "flex min-w-0 flex-1 flex-col gap-1.5",
|
|
13
|
-
children: [/* @__PURE__ */
|
|
13
|
+
children: [/* @__PURE__ */ o("div", {
|
|
14
14
|
className: "flex items-center gap-2",
|
|
15
|
-
children: [/* @__PURE__ */
|
|
16
|
-
active: t(
|
|
17
|
-
settled: n(
|
|
18
|
-
tone:
|
|
19
|
-
}), /* @__PURE__ */
|
|
15
|
+
children: [/* @__PURE__ */ a(r, {
|
|
16
|
+
active: t(s),
|
|
17
|
+
settled: n(s),
|
|
18
|
+
tone: s === "speaking" ? "speaking" : "listening"
|
|
19
|
+
}), /* @__PURE__ */ a("p", {
|
|
20
20
|
className: "truncate text-xs text-text-muted",
|
|
21
21
|
"aria-live": "polite",
|
|
22
22
|
"data-testid": "assistant-voice-status",
|
|
23
|
-
children:
|
|
23
|
+
children: u
|
|
24
24
|
})]
|
|
25
|
-
}),
|
|
25
|
+
}), s === "mic-error" ? /* @__PURE__ */ a("p", {
|
|
26
26
|
className: "line-clamp-2 text-xs text-status-warning",
|
|
27
27
|
role: "alert",
|
|
28
28
|
"data-testid": "assistant-voice-mini-error",
|
|
29
|
-
children:
|
|
30
|
-
}) :
|
|
31
|
-
className: ["line-clamp-3 break-words text-left text-sm leading-snug",
|
|
29
|
+
children: f
|
|
30
|
+
}) : c ? /* @__PURE__ */ a("p", {
|
|
31
|
+
className: ["line-clamp-3 break-words text-left text-sm leading-snug", p ? "font-semibold text-text-primary" : "font-medium text-text-secondary"].join(" "),
|
|
32
32
|
role: "status",
|
|
33
33
|
"aria-live": "polite",
|
|
34
34
|
"data-testid": "assistant-voice-caption",
|
|
35
|
-
children:
|
|
36
|
-
|
|
35
|
+
children: m ? /* @__PURE__ */ o(i, { children: [m.index > 0 ? /* @__PURE__ */ o("span", {
|
|
36
|
+
className: "text-text-muted transition-colors duration-300",
|
|
37
|
+
children: [m.chunks[m.index - 1], " "]
|
|
38
|
+
}) : null, /* @__PURE__ */ a("span", {
|
|
39
|
+
className: "text-text-primary",
|
|
40
|
+
"data-testid": "assistant-voice-caption-current",
|
|
41
|
+
children: m.chunks[m.index]
|
|
42
|
+
})] }) : c
|
|
43
|
+
}) : /* @__PURE__ */ a("div", {
|
|
37
44
|
className: "h-9",
|
|
38
45
|
"aria-hidden": "true"
|
|
39
46
|
})]
|
|
40
|
-
}), /* @__PURE__ */
|
|
47
|
+
}), /* @__PURE__ */ a("div", {
|
|
41
48
|
className: "shrink-0",
|
|
42
|
-
children:
|
|
49
|
+
children: d
|
|
43
50
|
})]
|
|
44
51
|
});
|
|
45
52
|
};
|
|
46
53
|
//#endregion
|
|
47
|
-
export {
|
|
54
|
+
export { s as VoiceMiniController };
|
package/dist/shared-assistant.js
CHANGED
|
@@ -49,43 +49,44 @@ import { AssistantMarkdownImage as Sr, imageHostLabel as Cr, isRemoteImageSrc as
|
|
|
49
49
|
import { AssistantMarkdownRenderer as Tr, assistantUrlTransform as Er } from "./shared/assistant/ui/AssistantMarkdownRenderer.js";
|
|
50
50
|
import { AssistantMessageAttachments as Dr } from "./shared/assistant/ui/AssistantMessageAttachments.js";
|
|
51
51
|
import { AssistantPendingWriteCard as Or } from "./shared/assistant/ui/AssistantPendingWriteCard.js";
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import {
|
|
81
|
-
import {
|
|
82
|
-
import {
|
|
83
|
-
import {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
import {
|
|
90
|
-
import {
|
|
91
|
-
|
|
52
|
+
import { AssistantLanguageMenu as kr } from "./shared/assistant/ui/AssistantLanguageMenu.js";
|
|
53
|
+
import { AssistantReplyLanguageSelector as Ar } from "./shared/assistant/ui/AssistantReplyLanguageSelector.js";
|
|
54
|
+
import { AssistantSpeakButton as jr } from "./shared/assistant/ui/AssistantSpeakButton.js";
|
|
55
|
+
import { AssistantSpokenTurnsNotice as Mr } from "./shared/assistant/ui/AssistantSpokenTurnsNotice.js";
|
|
56
|
+
import { AssistantAttachmentButton as Nr } from "./shared/assistant/ui/composer/AssistantAttachmentButton.js";
|
|
57
|
+
import { AssistantAttachmentChips as Pr } from "./shared/assistant/ui/composer/AssistantAttachmentChips.js";
|
|
58
|
+
import { AssistantLanguageSelector as Fr, FOLLOW_APP_LOCALE as Ir } from "./shared/assistant/ui/composer/AssistantLanguageSelector.js";
|
|
59
|
+
import { ASSISTANT_MODE_META as Lr, AssistantModeSelector as Rr, nextModeIndex as zr } from "./shared/assistant/ui/composer/AssistantModeSelector.js";
|
|
60
|
+
import { AssistantVoiceButton as Br } from "./shared/assistant/ui/composer/AssistantVoiceButton.js";
|
|
61
|
+
import { AUTO_VOICE as Vr, AssistantVoiceSelector as Hr } from "./shared/assistant/ui/composer/AssistantVoiceSelector.js";
|
|
62
|
+
import { AssistantVoiceOrb as Ur } from "./shared/assistant/ui/voice/AssistantVoiceOrb.js";
|
|
63
|
+
import { AssistantVoiceSessionButton as Wr } from "./shared/assistant/ui/voice/AssistantVoiceSessionButton.js";
|
|
64
|
+
import { VoiceCaption as Gr } from "./shared/assistant/ui/voice/VoiceCaption.js";
|
|
65
|
+
import { VoiceConversationView as Kr } from "./shared/assistant/ui/voice/VoiceConversationView.js";
|
|
66
|
+
import { VoiceWaveform as qr } from "./shared/assistant/ui/voice/VoiceWaveform.js";
|
|
67
|
+
import { VoiceMiniController as Jr } from "./shared/assistant/ui/voice/VoiceMiniController.js";
|
|
68
|
+
import { VoiceStage as Yr } from "./shared/assistant/ui/voice/VoiceStage.js";
|
|
69
|
+
import { VoiceTranscriptDrawer as Xr } from "./shared/assistant/ui/voice/VoiceTranscriptDrawer.js";
|
|
70
|
+
import { downloadFile as Zr, exportConversation as Qr } from "./shared/assistant/exportConversation.js";
|
|
71
|
+
import { AssistantMoreMenu as $r } from "./shared/assistant/ui/AssistantMoreMenu.js";
|
|
72
|
+
import { AssistantHeader as ei } from "./shared/assistant/ui/AssistantHeader.js";
|
|
73
|
+
import { AssistantConversationList as ti } from "./shared/assistant/ui/AssistantConversationList.js";
|
|
74
|
+
import { AssistantEmptyState as ni } from "./shared/assistant/ui/AssistantEmptyState.js";
|
|
75
|
+
import { AssistantMessageItem as ri } from "./shared/assistant/ui/AssistantMessageItem.js";
|
|
76
|
+
import { AssistantMessageList as ii } from "./shared/assistant/ui/AssistantMessageList.js";
|
|
77
|
+
import { AssistantVoiceSession as ai } from "./shared/assistant/ui/voice/AssistantVoiceSession.js";
|
|
78
|
+
import { useAssistantApiAccess as oi } from "./shared/assistant/useAssistantApiAccess.js";
|
|
79
|
+
import { useConversationTurns as si } from "./shared/assistant/useConversationTurns.js";
|
|
80
|
+
import { isMultimodalBodyRejection as ci, isRecoverableAssistantError as li } from "./shared/assistant/transportErrors.js";
|
|
81
|
+
import { aiCreditsUpdatedEventName as ui, dispatchAssistantQuotaExhausted as di, notifyAiCreditsUpdated as fi } from "./shared/assistant/aiCredits.js";
|
|
82
|
+
import { useWorkspaceWriteAccess as pi } from "./shared/assistant/useWorkspaceWriteAccess.js";
|
|
83
|
+
import { extractDocumentText as mi } from "./shared/assistant/documentExtract.js";
|
|
84
|
+
import { useAssistantAttachments as hi } from "./shared/assistant/useAssistantAttachments.js";
|
|
85
|
+
import { AssistantComposer as gi } from "./shared/assistant/ui/composer/AssistantComposer.js";
|
|
86
|
+
import { isProdRuntime as _i } from "./shared/assistant/env.js";
|
|
87
|
+
import { useAssistantHeartbeat as vi } from "./shared/assistant/useAssistantHeartbeat.js";
|
|
88
|
+
import { useAssistantKeyboardShortcuts as yi } from "./shared/assistant/useAssistantKeyboardShortcuts.js";
|
|
89
|
+
import { AssistantApiCallsConsentDialog as bi } from "./shared/assistant/ui/AssistantApiCallsConsentDialog.js";
|
|
90
|
+
import { AssistantChatArea as xi } from "./shared/assistant/ui/AssistantChatArea.js";
|
|
91
|
+
import { AIAssistantPanel as Si } from "./shared/assistant/ui/AIAssistantPanel.js";
|
|
92
|
+
export { Si as AIAssistantPanel, h as ASSISTANT_API_AUTH_STRATEGY, Mt as ASSISTANT_LANGUAGES, Lr as ASSISTANT_MODE_META, Dn as ATTACHMENT_ACCEPT, hr as ATTACHMENT_SOURCES, Vr as AUTO_VOICE, bi as AssistantApiCallsConsentDialog, Nr as AssistantAttachmentButton, Pr as AssistantAttachmentChips, xr as AssistantAutoSpeakToggle, xi as AssistantChatArea, gi as AssistantComposer, ti as AssistantConversationList, ni as AssistantEmptyState, ei as AssistantHeader, Kt as AssistantI18nProvider, kr as AssistantLanguageMenu, Fr as AssistantLanguageSelector, Sr as AssistantMarkdownImage, Tr as AssistantMarkdownRenderer, Dr as AssistantMessageAttachments, ri as AssistantMessageItem, ii as AssistantMessageList, Rr as AssistantModeSelector, $r as AssistantMoreMenu, Or as AssistantPendingWriteCard, Bt as AssistantProductProvider, Ar as AssistantReplyLanguageSelector, G as AssistantRuntimeManager, jr as AssistantSpeakButton, cr as AssistantSpeechProvider, Mr as AssistantSpokenTurnsNotice, or as AssistantToolActivity, Br as AssistantVoiceButton, Ur as AssistantVoiceOrb, Hr as AssistantVoiceSelector, ai as AssistantVoiceSession, Wr as AssistantVoiceSessionButton, On as AttachmentRejectedError, sn as BOILERPLATE_PAGE_SHARE, o as CHECK_AI_CREDITS, s as CREATE_SANDBOX, pt as DEFAULT_SPEAKABLE_LABELS, Nt as DEFAULT_SPEECH_RATE, Be as ENDPOINT_GRACE_MS, c as EXTEND_SANDBOX_TTL, Ir as FOLLOW_APP_LOCALE, l as GET_ACTIVE_SANDBOXES, u as GET_SANDBOX, ge as HOSTED_TTS_MAX_CHARS, fe as HOSTED_TTS_TIER, pe as HOSTED_VOICES, en as IDLE_PLAYBACK, Ve as INITIAL_SESSION, kn as INLINE_IMAGE_MAX_DIM, An as INLINE_IMAGE_QUALITY, He as INTERRUPT_MAX_MS, Ue as INTERRUPT_MIN_MS, jn as MAX_ATTACHMENTS, cn as MAX_BOILERPLATE_LINE_CHARS, ln as MAX_EXTRACTED_CHARS, Mn as MAX_FILE_BYTES, Nn as MAX_INLINE_CHARS_PER_FILE, Pn as MAX_INLINE_CHARS_TOTAL, an as MAX_INLINE_IMAGE_BASE64_BYTES, Fn as MAX_INLINE_IMAGE_BASE64_CHARS, In as MAX_INLINE_IMAGE_PARTS, Ln as MAX_INLINE_TURN_BODY_BYTES, un as MAX_PDF_PAGES_SCANNED, on as MAX_REQUEST_BODY_BYTES, mt as MAX_SPEAKABLE_CHARS, ht as MAX_SPOKEN_TABLE_ROWS, Rn as MAX_TURN_BODY_BYTES, dn as MIN_PAGE_TEXT_CHARS, fn as MIN_TEXT_PAGE_SHARE, Tt as POLL_FAST_MS, Et as POLL_FAST_UNTIL_MS, Dt as POLL_SLOW_MS, Ot as POLL_STEADY_MS, kt as POLL_STEADY_UNTIL_MS, Ct as PREVIEW_LANGUAGES, zn as PROMPT_ENVELOPE_RESERVE_BYTES, d as PROXY_SANDBOX_REQUEST, f as REPORT_AI_TOKEN_USAGE, vr as SANDBOX_READY_TTL_MS, We as SILENCE_SUBMIT_MS, _e as SPEAKING_RATE_MAX, ve as SPEAKING_RATE_MAX_STREAMING, ye as SPEAKING_RATE_MAX_SYNC, be as SPEAKING_RATE_MIN, gt as SPEECH_CHUNK_CHARS, _t as SPEECH_CHUNK_CJK_CHARS, Qe as SPEECH_LANG, Xt as SPOKEN_LABEL_LANGUAGES, p as STOP_ASSISTANT_SANDBOX, Bn as TURN_BODY_HEADROOM_BYTES, $e as VOICE_LIST_TIMEOUT_MS, Gr as VoiceCaption, Kr as VoiceConversationView, Jr as VoiceMiniController, Yr as VoiceStage, Xr as VoiceTranscriptDrawer, qr as VoiceWaveform, m as WAIT_FOR_SANDBOX_RUNNING, ui as aiCreditsUpdatedEventName, qt as assistantTranslationKey, Er as assistantUrlTransform, gr as availableAttachmentSources, xe as base64ToBytes, de as browserSpeechEngine, T as buildAssistantSandboxEnv, Vn as buildAttachmentPromptBlock, ut as buildContinuedFromVoiceNote, K as buildProgress, Hn as buildPromptParts, E as buildPromptRequestBody, Un as buildPromptWithAttachments, Se as buildRequest, i as buildSandboxContextInput, dt as buildVoiceTranscriptMarkdown, ie as chatTurns, D as checkAssistantAiCredits, vt as chunkForSpeech, Wn as classifyAttachment, Ce as classifyHttpFailure, t as classifyQuotaError, pn as columnLetterToIndex, ke as configureSpeechEngine, yt as containsCjk, dr as copyToClipboard, Gn as countInlineImageCandidates, Kn as countInlinedImageParts, O as createAssistantSandbox, k as createAssistantSession, De as createHostedTtsEngine, yr as createReadinessTracker, Oe as createRoutingSpeechEngine, ne as createSandboxAssistantTransport, Ae as createSpeechEngines, we as decodeAudioResponse, mn as decodeXmlEntities, qn as detectDocumentFormat, Qt as detectScriptLocale, _r as deviceHasCamera, di as dispatchAssistantQuotaExhausted, hn as docxXmlToText, A as downloadAssistantArtifact, Zr as downloadFile, Jn as estimateTurnBodyBytes, a as executeSandboxGraphQL, Qr as exportConversation, j as extendAssistantSandboxTTL, mi as extractDocumentText, Pt as findAssistantLanguage, M as findExistingSandbox, Rt as findPendingWrite, gn as fitPdfPages, Yn as formatBytes, _n as formatPageRanges, fr as getActorId, N as getAssistantArtifacts, q as getAssistantMedia, P as getAssistantMessages, F as getAssistantSession, I as getAssistantStreamAccess, J as getAssistantText, Xn as getAttachmentSendBlocker, x as getCapability, Zn as getExtension, g as getImageForMode, _ as getImageTagForMode, pr as getOrganizationId, Y as getRawMessageCreatedAt, v as getResourcesForMode, y as getSandboxImageRegistry, Qn as getSendableAttachments, je as getSpeechEngine, X as getToolProgress, mr as getWorkspaceId, ae as groupBySession, oe as groupConsecutiveBySession, $n as hasAttachmentWorkInFlight, me as hostedLocaleFor, he as hostedSupportsLanguage, Cr as imageHostLabel, Ge as isCapturing, Ke as isEcho, vn as isMostlyImagePages, ci as isMultimodalBodyRejection, _i as isProdRuntime, n as isQuotaExhaustedError, Z as isReapedSandboxConnectionError, br as isRecentlyVerified, Q as isRecoverable, li as isRecoverableAssistantError, wr as isRemoteImageSrc, tn as isSpeakingMessage, et as isSpeechBlocked, qe as isSubmittable, ar as isTurnInFlight, S as isUnknownFieldError, se as isVoiceTurn, yn as joinSheets, tt as languageDisplayName, $ as mapSessionToHistory, C as markSupported, w as markUnsupported, ee as mergeMessagesById, Pe as micIsInterrupt, L as modeRequiresConfirmWrites, zr as nextModeIndex, nt as normalizeLangTag, fi as notifyAiCreditsUpdated, Je as orbMode, bn as pageMarker, zt as parseConfirmationRefusal, er as parseDataUrl, xn as parseSharedStrings, sr as parseToolActivity, Sn as parseWorkbookSheets, Cn as pdfTextItemsToPage, Ye as planReplyConsumption, At as pollDelayMs, rt as primaryLanguageSubtag, r as quotaExhaustedEventName, Me as readSpeechEngineConfig, It as replyFollowsInput, R as reportAssistantAiTokenUsage, nn as requiresCancel, Ne as resetSpeechEngine, Ft as resolveAssistantLanguage, Lt as resolveLanguagePair, Vt as resolveModeConfig, b as resolveSandboxAssistantMode, $t as resolveSpeechLocale, te as sanitize, z as selectExistingAssistantSandbox, it as selectVoiceForLocale, B as sendAssistantPromptAsync, V as sendHeartbeat, wn as sheetXmlToRows, Te as shouldDisableEngine, Fe as showsAssistantCaption, Ie as showsUserCaption, bt as speakableEmail, at as speechGate, Zt as speechLabelsFor, ot as speechLangForLocale, rn as speechPlaybackReducer, Ee as splitForVendor, xt as splitTableRow, Xe as spokenSoFar, H as stopReapedAssistantSandbox, Tn as summarisePageText, jt as toCaptionText, tr as toMessageAttachment, St as toSpeakableText, nr as truncateForInline, En as truncatePagesForInline, oi as useAssistantApiAccess, hi as useAssistantAttachments, vi as useAssistantHeartbeat, Jt as useAssistantI18nNamespace, yi as useAssistantKeyboardShortcuts, Ht as useAssistantPageLabel, Ut as useAssistantProduct, Wt as useAssistantProductOrNull, lr as useAssistantSpeech, Gt as useAssistantStorageFolders, ir as useAssistantStore, Yt as useAssistantTr, si as useConversationTurns, re as useSandboxAssistantTransport, e as useVoiceInput, ur as useVoiceSession, pi as useWorkspaceWriteAccess, rr as validateFile, st as voiceAvailability, ce as voiceMarker, wt as voicePreviewText, ct as voiceQualityRank, le as voiceSessionIdOf, Ze as voiceSessionReducer, Le as voiceStageState, ft as voiceTranscriptFilename, ue as voiceTurnsOnly, lt as voicesForLocale, U as waitForAssistantServiceReady, W as waitForSandboxRunning, Re as waveformIsActive, ze as waveformIsSettled };
|