@absolutejs/voice 0.0.22-beta.27 → 0.0.22-beta.28
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/angular/index.js +4 -0
- package/dist/angular/voice-stream.service.d.ts +2 -0
- package/dist/react/index.js +4 -0
- package/dist/react/useVoiceController.d.ts +1 -0
- package/dist/react/useVoiceStream.d.ts +1 -0
- package/dist/vue/index.js +4 -0
- package/dist/vue/useVoiceStream.d.ts +2 -0
- package/package.json +1 -1
package/dist/angular/index.js
CHANGED
|
@@ -596,6 +596,7 @@ class VoiceStreamService {
|
|
|
596
596
|
const stream = createVoiceStream(path, options);
|
|
597
597
|
const assistantAudioSignal = signal([]);
|
|
598
598
|
const assistantTextsSignal = signal([]);
|
|
599
|
+
const callSignal = signal(null);
|
|
599
600
|
const errorSignal = signal(null);
|
|
600
601
|
const isConnectedSignal = signal(false);
|
|
601
602
|
const partialSignal = signal("");
|
|
@@ -605,6 +606,7 @@ class VoiceStreamService {
|
|
|
605
606
|
const sync = () => {
|
|
606
607
|
assistantAudioSignal.set([...stream.assistantAudio]);
|
|
607
608
|
assistantTextsSignal.set([...stream.assistantTexts]);
|
|
609
|
+
callSignal.set(stream.call);
|
|
608
610
|
errorSignal.set(stream.error);
|
|
609
611
|
isConnectedSignal.set(stream.isConnected);
|
|
610
612
|
partialSignal.set(stream.partial);
|
|
@@ -617,6 +619,8 @@ class VoiceStreamService {
|
|
|
617
619
|
return {
|
|
618
620
|
assistantAudio: computed(() => assistantAudioSignal()),
|
|
619
621
|
assistantTexts: computed(() => assistantTextsSignal()),
|
|
622
|
+
call: computed(() => callSignal()),
|
|
623
|
+
callControl: (message) => stream.callControl(message),
|
|
620
624
|
close: () => {
|
|
621
625
|
unsubscribe();
|
|
622
626
|
stream.close();
|
|
@@ -8,6 +8,8 @@ export declare class VoiceStreamService {
|
|
|
8
8
|
turnId?: string;
|
|
9
9
|
}[]>;
|
|
10
10
|
assistantTexts: import("@angular/core").Signal<string[]>;
|
|
11
|
+
call: import("@angular/core").Signal<import("..").VoiceCallLifecycleState | null>;
|
|
12
|
+
callControl: (message: Parameters<(message: Omit<import("..").VoiceClientCallControlMessage, "type">) => void>[0]) => void;
|
|
11
13
|
close: () => void;
|
|
12
14
|
endTurn: () => void;
|
|
13
15
|
error: import("@angular/core").Signal<string | null>;
|
package/dist/react/index.js
CHANGED
|
@@ -589,6 +589,7 @@ var createVoiceStream = (path, options = {}) => {
|
|
|
589
589
|
var EMPTY_SNAPSHOT = {
|
|
590
590
|
assistantAudio: [],
|
|
591
591
|
assistantTexts: [],
|
|
592
|
+
call: null,
|
|
592
593
|
error: null,
|
|
593
594
|
isConnected: false,
|
|
594
595
|
partial: "",
|
|
@@ -606,6 +607,7 @@ var useVoiceStream = (path, options = {}) => {
|
|
|
606
607
|
const snapshot = useSyncExternalStore(stream.subscribe, stream.getSnapshot, stream.getServerSnapshot) ?? EMPTY_SNAPSHOT;
|
|
607
608
|
return {
|
|
608
609
|
...snapshot,
|
|
610
|
+
callControl: (message) => stream.callControl(message),
|
|
609
611
|
close: () => stream.close(),
|
|
610
612
|
endTurn: () => stream.endTurn(),
|
|
611
613
|
sendAudio: (audio) => stream.sendAudio(audio)
|
|
@@ -1248,6 +1250,7 @@ var createVoiceController = (path, options = {}) => {
|
|
|
1248
1250
|
var EMPTY_SNAPSHOT2 = {
|
|
1249
1251
|
assistantAudio: [],
|
|
1250
1252
|
assistantTexts: [],
|
|
1253
|
+
call: null,
|
|
1251
1254
|
error: null,
|
|
1252
1255
|
isConnected: false,
|
|
1253
1256
|
isRecording: false,
|
|
@@ -1268,6 +1271,7 @@ var useVoiceController = (path, options = {}) => {
|
|
|
1268
1271
|
return {
|
|
1269
1272
|
...snapshot,
|
|
1270
1273
|
bindHTMX: controller.bindHTMX,
|
|
1274
|
+
callControl: (message) => controller.callControl(message),
|
|
1271
1275
|
close: () => controller.close(),
|
|
1272
1276
|
endTurn: () => controller.endTurn(),
|
|
1273
1277
|
sendAudio: (audio) => controller.sendAudio(audio),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { VoiceControllerOptions } from '../types';
|
|
2
2
|
export declare const useVoiceController: <TResult = unknown>(path: string, options?: VoiceControllerOptions) => {
|
|
3
3
|
bindHTMX: (options: import("..").VoiceHTMXBindingOptions) => () => void;
|
|
4
|
+
callControl: (message: Parameters<(message: Omit<import("..").VoiceClientCallControlMessage, "type">) => void>[0]) => void;
|
|
4
5
|
close: () => void;
|
|
5
6
|
endTurn: () => void;
|
|
6
7
|
sendAudio: (audio: Uint8Array | ArrayBuffer) => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { VoiceConnectionOptions } from '../types';
|
|
2
2
|
export declare const useVoiceStream: <TResult = unknown>(path: string, options?: VoiceConnectionOptions) => {
|
|
3
|
+
callControl: (message: Parameters<(message: Omit<import("..").VoiceClientCallControlMessage, "type">) => void>[0]) => void;
|
|
3
4
|
close: () => void;
|
|
4
5
|
endTurn: () => void;
|
|
5
6
|
sendAudio: (audio: Uint8Array | ArrayBuffer) => void;
|
package/dist/vue/index.js
CHANGED
|
@@ -590,6 +590,7 @@ var useVoiceStream = (path, options = {}) => {
|
|
|
590
590
|
const stream = createVoiceStream(path, options);
|
|
591
591
|
const assistantAudio = shallowRef([]);
|
|
592
592
|
const assistantTexts = shallowRef([]);
|
|
593
|
+
const call = shallowRef(null);
|
|
593
594
|
const error = ref(null);
|
|
594
595
|
const isConnected = ref(false);
|
|
595
596
|
const partial = ref("");
|
|
@@ -599,6 +600,7 @@ var useVoiceStream = (path, options = {}) => {
|
|
|
599
600
|
const sync = () => {
|
|
600
601
|
assistantAudio.value = [...stream.assistantAudio];
|
|
601
602
|
assistantTexts.value = [...stream.assistantTexts];
|
|
603
|
+
call.value = stream.call;
|
|
602
604
|
error.value = stream.error;
|
|
603
605
|
isConnected.value = stream.isConnected;
|
|
604
606
|
partial.value = stream.partial;
|
|
@@ -616,6 +618,8 @@ var useVoiceStream = (path, options = {}) => {
|
|
|
616
618
|
return {
|
|
617
619
|
assistantAudio,
|
|
618
620
|
assistantTexts,
|
|
621
|
+
call,
|
|
622
|
+
callControl: (message) => stream.callControl(message),
|
|
619
623
|
close: () => destroy(),
|
|
620
624
|
endTurn: () => stream.endTurn(),
|
|
621
625
|
error,
|
|
@@ -12,6 +12,8 @@ export declare const useVoiceStream: <TResult = unknown>(path: string, options?:
|
|
|
12
12
|
turnId?: string;
|
|
13
13
|
}[]>;
|
|
14
14
|
assistantTexts: import("vue").ShallowRef<string[], string[]>;
|
|
15
|
+
call: import("vue").ShallowRef<import("..").VoiceCallLifecycleState | null, import("..").VoiceCallLifecycleState | null>;
|
|
16
|
+
callControl: (message: Parameters<(message: Omit<import("..").VoiceClientCallControlMessage, "type">) => void>[0]) => void;
|
|
15
17
|
close: () => void;
|
|
16
18
|
endTurn: () => void;
|
|
17
19
|
error: import("vue").Ref<string | null, string | null>;
|