@olares/lares-mobile 0.15.19 → 0.15.21
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/package.json +2 -2
- package/src/App.vue +3 -2
- package/src/host.js +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olares/lares-mobile",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.21",
|
|
4
4
|
"description": "Lares chat component for LarePass",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"vue": "^3.2.0"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@olares/lares-core": "0.15.
|
|
31
|
+
"@olares/lares-core": "0.15.21",
|
|
32
32
|
"markdown-it": "^14.3.0"
|
|
33
33
|
}
|
|
34
34
|
}
|
package/src/App.vue
CHANGED
|
@@ -604,7 +604,7 @@ export default {
|
|
|
604
604
|
return this.player?.play(wavBlob(sentence.audio));
|
|
605
605
|
},
|
|
606
606
|
halt: () => this.player?.stop(),
|
|
607
|
-
silence: () => void this.runtime.interruptSpeech?.(),
|
|
607
|
+
silence: (source) => void this.runtime.interruptSpeech?.(source),
|
|
608
608
|
fail: (err) => this.showSpeakProblem(err),
|
|
609
609
|
});
|
|
610
610
|
|
|
@@ -728,6 +728,7 @@ export default {
|
|
|
728
728
|
this.items = snap.items;
|
|
729
729
|
this.running = snap.running;
|
|
730
730
|
this.runningSince = snap.runningSince || 0;
|
|
731
|
+
if (this.voiceCall) this.reader.stop();
|
|
731
732
|
const target = this.voiceSpeak && !this.voiceCall && !document.hidden ? speakable(utterance, true) : null;
|
|
732
733
|
if (target) this.reader.follow({ ...target, sessionId: snap.sessionId, source: { sessionId: snap.sessionId, turn: target.turn, step: target.step, attemptId: target.attemptId }, key: `${snap.sessionId}:${target.key}` });
|
|
733
734
|
this.failed = snap.failed;
|
|
@@ -1318,7 +1319,7 @@ export default {
|
|
|
1318
1319
|
this.reader.stop(); this.player?.stop(); this.player?.unlock();
|
|
1319
1320
|
let conversation;
|
|
1320
1321
|
const reader = createSentencePlayer({
|
|
1321
|
-
stream:
|
|
1322
|
+
stream: (value) => playAudioStream({ ...value, request: (path, options) => this.runtime.voiceRequest(path, options), headers: conversation.headers, socket: (ticket) => this.runtime.voiceSocket(ticket, "/api/lares/voice/stream") }),
|
|
1322
1323
|
send: (value) => conversation.speak(value),
|
|
1323
1324
|
play: (sentence) => sentence.bluetooth === "played" ? Promise.resolve() : this.player.play(wavBlob(sentence.audio)),
|
|
1324
1325
|
halt: () => this.player.stop(), silence: () => {},
|
package/src/host.js
CHANGED
|
@@ -319,8 +319,9 @@ export function createHostClient(ports = {}) {
|
|
|
319
319
|
const message = typeof error?.message === "string" && error.message ? error.message : code;
|
|
320
320
|
throw Object.assign(new Error(message), { code });
|
|
321
321
|
},
|
|
322
|
-
async interruptSpeech() {
|
|
323
|
-
const
|
|
322
|
+
async interruptSpeech(source) {
|
|
323
|
+
const body = source && typeof source === "object" ? { sessionId: source.sessionId, turn: source.turn, step: source.step, attemptId: source.attemptId } : {};
|
|
324
|
+
const res = await request(`${VOICE_API}/playback/stop`, { method: "POST", headers: voiceHeaders("device"), body });
|
|
324
325
|
return Boolean(res?.ok);
|
|
325
326
|
},
|
|
326
327
|
async openMux(signal) {
|