@absolutejs/voice 0.0.22-beta.593 → 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,6 +4639,11 @@ var createVoiceSession = (options) => {
4639
4639
  if (!didComplete) {
4640
4640
  return;
4641
4641
  }
4642
+ const onCompletePromise = shouldInvokeOnComplete ? Promise.resolve(options.route.onComplete({
4643
+ api,
4644
+ context: options.context,
4645
+ session
4646
+ })) : Promise.resolve();
4642
4647
  if (disposition === "completed") {
4643
4648
  await drainAssistantSpeech(lastTtsSendAt);
4644
4649
  await assistantAudioQueue;
@@ -4701,13 +4706,7 @@ var createVoiceSession = (options) => {
4701
4706
  session
4702
4707
  });
4703
4708
  }
4704
- if (shouldInvokeOnComplete) {
4705
- await options.route.onComplete({
4706
- api,
4707
- context: options.context,
4708
- session
4709
- });
4710
- }
4709
+ await onCompletePromise;
4711
4710
  await options.route.onCallEnd?.({
4712
4711
  api,
4713
4712
  context: options.context,
@@ -6866,6 +6866,11 @@ var createVoiceSession = (options) => {
6866
6866
  if (!didComplete) {
6867
6867
  return;
6868
6868
  }
6869
+ const onCompletePromise = shouldInvokeOnComplete ? Promise.resolve(options.route.onComplete({
6870
+ api,
6871
+ context: options.context,
6872
+ session
6873
+ })) : Promise.resolve();
6869
6874
  if (disposition === "completed") {
6870
6875
  await drainAssistantSpeech(lastTtsSendAt);
6871
6876
  await assistantAudioQueue;
@@ -6928,13 +6933,7 @@ var createVoiceSession = (options) => {
6928
6933
  session
6929
6934
  });
6930
6935
  }
6931
- if (shouldInvokeOnComplete) {
6932
- await options.route.onComplete({
6933
- api,
6934
- context: options.context,
6935
- session
6936
- });
6937
- }
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.593",
3
+ "version": "0.0.22-beta.595",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",