@ateam-ai-mobile/ui 0.1.10 → 0.1.11
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/index.d.mts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +2 -0
- package/src/providers.ts +22 -0
- package/src/voice/voiceSession.ts +22 -0
package/dist/index.mjs
CHANGED
|
@@ -215,6 +215,13 @@ function setOAuthProvider(oauth) {
|
|
|
215
215
|
function getOAuthProvider() {
|
|
216
216
|
return _oauth;
|
|
217
217
|
}
|
|
218
|
+
var _callAudio = null;
|
|
219
|
+
function setCallAudioProvider(callAudio) {
|
|
220
|
+
_callAudio = callAudio;
|
|
221
|
+
}
|
|
222
|
+
function getCallAudioProvider() {
|
|
223
|
+
return _callAudio;
|
|
224
|
+
}
|
|
218
225
|
var _clipboard = null;
|
|
219
226
|
function setClipboardProvider(clipboard) {
|
|
220
227
|
_clipboard = clipboard;
|
|
@@ -2864,6 +2871,9 @@ function originOf(url) {
|
|
|
2864
2871
|
const m = /^([a-z][a-z0-9+.-]*:\/\/[^/?#]+)/i.exec(url);
|
|
2865
2872
|
return m ? m[1].toLowerCase() : null;
|
|
2866
2873
|
}
|
|
2874
|
+
function isLiveCall(state) {
|
|
2875
|
+
return state === "connecting" || state === "connected";
|
|
2876
|
+
}
|
|
2867
2877
|
var IDLE = {
|
|
2868
2878
|
callState: "idle",
|
|
2869
2879
|
sessionId: null,
|
|
@@ -3318,9 +3328,22 @@ var VoiceSessionManager = class {
|
|
|
3318
3328
|
}
|
|
3319
3329
|
// ── internals ────────────────────────────────────────────────
|
|
3320
3330
|
setState(partial) {
|
|
3331
|
+
const wasLive = isLiveCall(this.state.callState);
|
|
3321
3332
|
this.state = { ...this.state, ...partial };
|
|
3333
|
+
const isLive = isLiveCall(this.state.callState);
|
|
3334
|
+
if (wasLive !== isLive) this.setCallAudio(isLive);
|
|
3322
3335
|
this.emit({ type: "state" });
|
|
3323
3336
|
}
|
|
3337
|
+
setCallAudio(on) {
|
|
3338
|
+
const audio = getCallAudioProvider();
|
|
3339
|
+
if (!audio) return;
|
|
3340
|
+
try {
|
|
3341
|
+
if (on) audio.beginCall();
|
|
3342
|
+
else audio.endCall();
|
|
3343
|
+
} catch (e) {
|
|
3344
|
+
console.warn("[voiceSession] call audio mode failed:", e?.message || String(e));
|
|
3345
|
+
}
|
|
3346
|
+
}
|
|
3324
3347
|
appendTranscript(entry) {
|
|
3325
3348
|
this.state = { ...this.state, transcript: [...this.state.transcript, entry] };
|
|
3326
3349
|
this.emit({ type: "transcript" });
|
|
@@ -3820,6 +3843,7 @@ export {
|
|
|
3820
3843
|
openJoinErrorMessage,
|
|
3821
3844
|
openWidget,
|
|
3822
3845
|
runHandoffExchange,
|
|
3846
|
+
setCallAudioProvider,
|
|
3823
3847
|
setClipboardProvider,
|
|
3824
3848
|
setOAuthProvider,
|
|
3825
3849
|
setPluginWebViewExtraHosts,
|