@absolutejs/voice 0.0.22-beta.21 → 0.0.22-beta.22

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.
@@ -4377,8 +4377,15 @@ var createVoiceProviderFailureSimulator = (options) => {
4377
4377
  return {
4378
4378
  mode,
4379
4379
  provider,
4380
+ replayHref: options.replayHref === false ? undefined : typeof options.replayHref === "function" ? options.replayHref({
4381
+ provider,
4382
+ sessionId: session.id,
4383
+ turnId: turn.id
4384
+ }) : `${options.replayHref ?? "/api/voice-sessions"}/${encodeURIComponent(session.id)}/replay/htmx`,
4380
4385
  result,
4381
- status: "simulated"
4386
+ sessionId: session.id,
4387
+ status: "simulated",
4388
+ turnId: turn.id
4382
4389
  };
4383
4390
  };
4384
4391
  return {
@@ -12,8 +12,11 @@ export type VoiceProviderFailureSimulationContext<TProvider extends string = str
12
12
  export type VoiceProviderFailureSimulationResult<TProvider extends string = string, TResult = unknown> = {
13
13
  mode: VoiceProviderFailureSimulationMode;
14
14
  provider: TProvider;
15
+ replayHref?: string;
15
16
  result: VoiceAgentModelOutput<TResult>;
17
+ sessionId: string;
16
18
  status: 'simulated';
19
+ turnId: string;
17
20
  };
18
21
  type ProviderListResolver<TContext, TSession extends VoiceSessionRecord, TProvider extends string> = readonly TProvider[] | ((input: VoiceAgentModelInput<TContext, TSession>) => readonly TProvider[] | Promise<readonly TProvider[]>);
19
22
  export type VoiceProviderFailureSimulatorOptions<TContext extends VoiceProviderFailureSimulationContext<TProvider>, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown, TProvider extends string = string> = {
@@ -25,6 +28,11 @@ export type VoiceProviderFailureSimulatorOptions<TContext extends VoiceProviderF
25
28
  providerHealth?: boolean | VoiceProviderRouterHealthOptions;
26
29
  providerLabel?: (provider: TProvider) => string;
27
30
  providers: readonly TProvider[];
31
+ replayHref?: false | string | ((input: {
32
+ provider: TProvider;
33
+ sessionId: string;
34
+ turnId: string;
35
+ }) => string);
28
36
  response?: (input: {
29
37
  mode: VoiceProviderFailureSimulationMode;
30
38
  provider: TProvider;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.21",
3
+ "version": "0.0.22-beta.22",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",