@absolutejs/voice 0.0.22-beta.104 → 0.0.22-beta.106

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.
@@ -0,0 +1,41 @@
1
+ import { Elysia } from 'elysia';
2
+ import { type PlivoVoiceRoutesOptions } from './telephony/plivo';
3
+ import { type TelnyxVoiceRoutesOptions } from './telephony/telnyx';
4
+ import { type TwilioVoiceRoutesOptions } from './telephony/twilio';
5
+ import { type VoiceTelephonyCarrierMatrixRoutesOptions } from './telephony/matrix';
6
+ import type { VoiceSessionRecord } from './types';
7
+ type VoicePhoneAgentCarrierBase = {
8
+ name?: string;
9
+ smokePath?: false | string;
10
+ setupPath?: false | string;
11
+ };
12
+ export type VoicePhoneAgentTwilioCarrier<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = VoicePhoneAgentCarrierBase & {
13
+ options: TwilioVoiceRoutesOptions<TContext, TSession, TResult>;
14
+ provider: 'twilio';
15
+ };
16
+ export type VoicePhoneAgentTelnyxCarrier<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = VoicePhoneAgentCarrierBase & {
17
+ options?: TelnyxVoiceRoutesOptions<TContext, TSession, TResult>;
18
+ provider: 'telnyx';
19
+ };
20
+ export type VoicePhoneAgentPlivoCarrier<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = VoicePhoneAgentCarrierBase & {
21
+ options?: PlivoVoiceRoutesOptions<TContext, TSession, TResult>;
22
+ provider: 'plivo';
23
+ };
24
+ export type VoicePhoneAgentCarrier<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = VoicePhoneAgentTwilioCarrier<TContext, TSession, TResult> | VoicePhoneAgentTelnyxCarrier<TContext, TSession, TResult> | VoicePhoneAgentPlivoCarrier<TContext, TSession, TResult>;
25
+ export type VoicePhoneAgentRoutesOptions<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
26
+ carriers: readonly VoicePhoneAgentCarrier<TContext, TSession, TResult>[];
27
+ matrix?: false | Omit<VoiceTelephonyCarrierMatrixRoutesOptions, 'load'>;
28
+ name?: string;
29
+ };
30
+ export type VoicePhoneAgentRoutes = {
31
+ carriers: {
32
+ name?: string;
33
+ provider: 'plivo' | 'telnyx' | 'twilio';
34
+ setupPath?: false | string;
35
+ smokePath?: false | string;
36
+ }[];
37
+ matrixPath?: string;
38
+ routes: Elysia;
39
+ };
40
+ export declare const createVoicePhoneAgent: <TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown>(options: VoicePhoneAgentRoutesOptions<TContext, TSession, TResult>) => VoicePhoneAgentRoutes;
41
+ export {};
@@ -0,0 +1,105 @@
1
+ import { Elysia } from 'elysia';
2
+ import { type VoiceEvalReport, type VoiceEvalRoutesOptions, type VoiceScenarioEvalDefinition, type VoiceScenarioEvalReport, type VoiceScenarioFixture, type VoiceScenarioFixtureEvalReport, type VoiceScenarioFixtureStore } from './evalRoutes';
3
+ import { type VoiceOutcomeContractDefinition, type VoiceOutcomeContractOptions, type VoiceOutcomeContractSuiteReport } from './outcomeContract';
4
+ import { type VoiceToolContractDefinition, type VoiceToolContractSuiteReport } from './toolContract';
5
+ import type { VoiceQualityThresholds } from './qualityRoutes';
6
+ import type { VoiceTraceEventStore } from './trace';
7
+ import type { VoiceSessionRecord } from './types';
8
+ export type VoiceSimulationSuiteStatus = 'pass' | 'fail';
9
+ export type VoiceSimulationSuiteReport = {
10
+ checkedAt: number;
11
+ failed: number;
12
+ fixtures?: VoiceScenarioFixtureEvalReport;
13
+ outcomes?: VoiceOutcomeContractSuiteReport;
14
+ passed: number;
15
+ scenarios?: VoiceScenarioEvalReport;
16
+ sessions?: VoiceEvalReport;
17
+ status: VoiceSimulationSuiteStatus;
18
+ summary: {
19
+ fixtures?: VoiceSimulationSuiteSectionSummary;
20
+ outcomes?: VoiceSimulationSuiteSectionSummary;
21
+ scenarios?: VoiceSimulationSuiteSectionSummary;
22
+ sessions?: VoiceSimulationSuiteSectionSummary;
23
+ tools?: VoiceSimulationSuiteSectionSummary;
24
+ };
25
+ tools?: VoiceToolContractSuiteReport;
26
+ total: number;
27
+ };
28
+ export type VoiceSimulationSuiteSectionSummary = {
29
+ failed: number;
30
+ passed: number;
31
+ status: VoiceSimulationSuiteStatus;
32
+ total: number;
33
+ };
34
+ export type VoiceSimulationSuiteOptions<TSession extends VoiceSessionRecord = VoiceSessionRecord> = {
35
+ fixtures?: VoiceScenarioFixture[];
36
+ fixtureStore?: VoiceScenarioFixtureStore;
37
+ include?: {
38
+ fixtures?: boolean;
39
+ outcomes?: boolean;
40
+ scenarios?: boolean;
41
+ sessions?: boolean;
42
+ tools?: boolean;
43
+ };
44
+ limit?: number;
45
+ outcomes?: Omit<VoiceOutcomeContractOptions<TSession>, 'contracts'> & {
46
+ contracts: VoiceOutcomeContractDefinition[];
47
+ };
48
+ scenarios?: VoiceScenarioEvalDefinition[];
49
+ store?: VoiceTraceEventStore;
50
+ thresholds?: VoiceQualityThresholds;
51
+ tools?: VoiceToolContractDefinition[];
52
+ };
53
+ export type VoiceSimulationSuiteRoutesOptions<TSession extends VoiceSessionRecord = VoiceSessionRecord> = VoiceSimulationSuiteOptions<TSession> & {
54
+ headers?: HeadersInit;
55
+ htmlPath?: false | string;
56
+ name?: string;
57
+ path?: string;
58
+ render?: (report: VoiceSimulationSuiteReport) => string | Promise<string>;
59
+ title?: string;
60
+ };
61
+ export declare const runVoiceSimulationSuite: <TSession extends VoiceSessionRecord = VoiceSessionRecord>(options: VoiceSimulationSuiteOptions<TSession>) => Promise<VoiceSimulationSuiteReport>;
62
+ export declare const renderVoiceSimulationSuiteHTML: (report: VoiceSimulationSuiteReport, options?: {
63
+ title?: string;
64
+ }) => string;
65
+ export declare const createVoiceSimulationSuiteRoutes: <TSession extends VoiceSessionRecord = VoiceSessionRecord>(options: VoiceSimulationSuiteRoutesOptions<TSession>) => Elysia<"", {
66
+ decorator: {};
67
+ store: {};
68
+ derive: {};
69
+ resolve: {};
70
+ }, {
71
+ typebox: {};
72
+ error: {};
73
+ }, {
74
+ schema: {};
75
+ standaloneSchema: {};
76
+ macro: {};
77
+ macroFn: {};
78
+ parser: {};
79
+ response: {};
80
+ }, {
81
+ [x: string]: {
82
+ get: {
83
+ body: unknown;
84
+ params: {};
85
+ query: unknown;
86
+ headers: unknown;
87
+ response: {
88
+ 200: VoiceSimulationSuiteReport;
89
+ };
90
+ };
91
+ };
92
+ }, {
93
+ derive: {};
94
+ resolve: {};
95
+ schema: {};
96
+ standaloneSchema: {};
97
+ response: {};
98
+ }, {
99
+ derive: {};
100
+ resolve: {};
101
+ schema: {};
102
+ standaloneSchema: {};
103
+ response: {};
104
+ }>;
105
+ export type VoiceSimulationSuiteEvalRoutesOptions = VoiceEvalRoutesOptions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.104",
3
+ "version": "0.0.22-beta.106",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",