@absolutejs/voice 0.0.22-beta.569 → 0.0.22-beta.570

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.
@@ -2,7 +2,7 @@ import { Elysia } from "elysia";
2
2
  import type { VoiceTelephonySetupStatus, VoiceTelephonySmokeCheck, VoiceTelephonySmokeReport } from "./contract";
3
3
  import { type VoiceTelephonyOutcomePolicy, type VoiceTelephonyWebhookRoutesOptions } from "../core/telephonyOutcome";
4
4
  import { type VoiceCallReviewArtifact, type VoiceCallReviewConfig } from "../testing/review";
5
- import type { AudioFormat, STTAdapter, VoiceLogger, VoicePluginConfig, VoiceSessionRecord, VoiceServerMessage } from "../core/types";
5
+ import type { AudioFormat, STTAdapter, VoiceLogger, VoiceOnTurnObjectHandler, VoicePluginConfig, VoiceSessionRecord, VoiceServerMessage } from "../core/types";
6
6
  type TwilioMediaPayload = {
7
7
  chunk?: string;
8
8
  payload: string;
@@ -78,7 +78,17 @@ export type TwilioMediaStreamSocket = {
78
78
  close: (code?: number, reason?: string) => void | Promise<void>;
79
79
  send: (data: string) => void | Promise<void>;
80
80
  };
81
- export type TwilioMediaStreamBridgeOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = Omit<VoicePluginConfig<TContext, TSession, TResult>, "htmx" | "path" | "stt"> & {
81
+ export type TwilioMediaStreamBridgeOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = Omit<VoicePluginConfig<TContext, TSession, TResult>, "htmx" | "onTurn" | "path" | "stt"> & {
82
+ /**
83
+ * Per-turn handler. Receives the committed turn, session, context, and
84
+ * session `api` as a single object. The legacy positional form
85
+ * `(session, turn, api, context)` is still accepted at runtime via
86
+ * `normalizeOnTurn`, but only the object form is part of the typed
87
+ * surface — pinning it to a single (non-union) signature is what lets
88
+ * the `input` parameter infer at the call site instead of falling back
89
+ * to `any` (a union of function types defeats contextual typing).
90
+ */
91
+ onTurn: VoiceOnTurnObjectHandler<TContext, TSession, TResult>;
82
92
  /**
83
93
  * Legacy barge-in: send the carrier a "clear" on every inbound media frame
84
94
  * once the assistant has spoken. Defaults to `false` — a phone line streams
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.569",
3
+ "version": "0.0.22-beta.570",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",