@absolutejs/voice 0.0.22-beta.551 → 0.0.22-beta.552

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.
@@ -516,6 +516,18 @@ export type VoiceSessionHandle<TContext = unknown, TSession extends VoiceSession
516
516
  }) => Promise<void>;
517
517
  close: (reason?: string) => Promise<void>;
518
518
  snapshot: () => Promise<TSession>;
519
+ /**
520
+ * Mutate the live turn-detection config for this session — useful when a
521
+ * tool call wants to dial silenceMs up ("the caller asked for more time")
522
+ * or down. The change takes effect on the NEXT silence-timer schedule, so
523
+ * an in-flight commit isn't cancelled. Returns the merged config so the
524
+ * caller can confirm.
525
+ */
526
+ setTurnDetection: (patch: Partial<VoiceTurnDetectionConfig>) => Promise<{
527
+ silenceMs: number;
528
+ speechThreshold: number;
529
+ transcriptStabilityMs: number;
530
+ }>;
519
531
  };
520
532
  export type VoiceRouteResult<TResult = unknown> = {
521
533
  complete?: boolean;
package/dist/index.js CHANGED
@@ -5904,6 +5904,22 @@ var createVoiceSession = (options) => {
5904
5904
  snapshot: async () => runSerial("api.snapshot", async () => readSession()),
5905
5905
  transfer: async (input) => runSerial("api.transfer", async () => {
5906
5906
  await transferInternal(input);
5907
+ }),
5908
+ setTurnDetection: async (patch) => runSerial("api.setTurnDetection", async () => {
5909
+ if (patch.silenceMs !== undefined && Number.isFinite(patch.silenceMs)) {
5910
+ turnDetection.silenceMs = Math.max(300, Math.min(15000, Math.round(patch.silenceMs)));
5911
+ }
5912
+ if (patch.speechThreshold !== undefined && Number.isFinite(patch.speechThreshold)) {
5913
+ turnDetection.speechThreshold = Math.max(0, Math.min(1, patch.speechThreshold));
5914
+ }
5915
+ if (patch.transcriptStabilityMs !== undefined && Number.isFinite(patch.transcriptStabilityMs)) {
5916
+ turnDetection.transcriptStabilityMs = Math.max(0, Math.min(5000, Math.round(patch.transcriptStabilityMs)));
5917
+ }
5918
+ return {
5919
+ silenceMs: turnDetection.silenceMs,
5920
+ speechThreshold: turnDetection.speechThreshold,
5921
+ transcriptStabilityMs: turnDetection.transcriptStabilityMs
5922
+ };
5907
5923
  })
5908
5924
  };
5909
5925
  return api;
@@ -43024,6 +43040,11 @@ var createContractApi = (session) => ({
43024
43040
  markNoAnswer: async () => {},
43025
43041
  markVoicemail: async () => {},
43026
43042
  receiveAudio: async () => {},
43043
+ setTurnDetection: async () => ({
43044
+ silenceMs: 0,
43045
+ speechThreshold: 0,
43046
+ transcriptStabilityMs: 0
43047
+ }),
43027
43048
  snapshot: async () => session,
43028
43049
  transfer: async () => {}
43029
43050
  });
@@ -7721,6 +7721,22 @@ var createVoiceSession = (options) => {
7721
7721
  snapshot: async () => runSerial("api.snapshot", async () => readSession()),
7722
7722
  transfer: async (input) => runSerial("api.transfer", async () => {
7723
7723
  await transferInternal(input);
7724
+ }),
7725
+ setTurnDetection: async (patch) => runSerial("api.setTurnDetection", async () => {
7726
+ if (patch.silenceMs !== undefined && Number.isFinite(patch.silenceMs)) {
7727
+ turnDetection.silenceMs = Math.max(300, Math.min(15000, Math.round(patch.silenceMs)));
7728
+ }
7729
+ if (patch.speechThreshold !== undefined && Number.isFinite(patch.speechThreshold)) {
7730
+ turnDetection.speechThreshold = Math.max(0, Math.min(1, patch.speechThreshold));
7731
+ }
7732
+ if (patch.transcriptStabilityMs !== undefined && Number.isFinite(patch.transcriptStabilityMs)) {
7733
+ turnDetection.transcriptStabilityMs = Math.max(0, Math.min(5000, Math.round(patch.transcriptStabilityMs)));
7734
+ }
7735
+ return {
7736
+ silenceMs: turnDetection.silenceMs,
7737
+ speechThreshold: turnDetection.speechThreshold,
7738
+ transcriptStabilityMs: turnDetection.transcriptStabilityMs
7739
+ };
7724
7740
  })
7725
7741
  };
7726
7742
  return api;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.551",
3
+ "version": "0.0.22-beta.552",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",