@absolutejs/voice 0.0.22-beta.594 → 0.0.22-beta.595

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.js CHANGED
@@ -4639,13 +4639,11 @@ var createVoiceSession = (options) => {
4639
4639
  if (!didComplete) {
4640
4640
  return;
4641
4641
  }
4642
- if (shouldInvokeOnComplete) {
4643
- await options.route.onComplete({
4644
- api,
4645
- context: options.context,
4646
- session
4647
- });
4648
- }
4642
+ const onCompletePromise = shouldInvokeOnComplete ? Promise.resolve(options.route.onComplete({
4643
+ api,
4644
+ context: options.context,
4645
+ session
4646
+ })) : Promise.resolve();
4649
4647
  if (disposition === "completed") {
4650
4648
  await drainAssistantSpeech(lastTtsSendAt);
4651
4649
  await assistantAudioQueue;
@@ -4708,6 +4706,7 @@ var createVoiceSession = (options) => {
4708
4706
  session
4709
4707
  });
4710
4708
  }
4709
+ await onCompletePromise;
4711
4710
  await options.route.onCallEnd?.({
4712
4711
  api,
4713
4712
  context: options.context,
@@ -6866,13 +6866,11 @@ var createVoiceSession = (options) => {
6866
6866
  if (!didComplete) {
6867
6867
  return;
6868
6868
  }
6869
- if (shouldInvokeOnComplete) {
6870
- await options.route.onComplete({
6871
- api,
6872
- context: options.context,
6873
- session
6874
- });
6875
- }
6869
+ const onCompletePromise = shouldInvokeOnComplete ? Promise.resolve(options.route.onComplete({
6870
+ api,
6871
+ context: options.context,
6872
+ session
6873
+ })) : Promise.resolve();
6876
6874
  if (disposition === "completed") {
6877
6875
  await drainAssistantSpeech(lastTtsSendAt);
6878
6876
  await assistantAudioQueue;
@@ -6935,6 +6933,7 @@ var createVoiceSession = (options) => {
6935
6933
  session
6936
6934
  });
6937
6935
  }
6936
+ await onCompletePromise;
6938
6937
  await options.route.onCallEnd?.({
6939
6938
  api,
6940
6939
  context: options.context,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.594",
3
+ "version": "0.0.22-beta.595",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",