@absolutejs/voice 0.0.22-beta.8 → 0.0.22-beta.80
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/README.md +205 -0
- package/dist/agent.d.ts +2 -0
- package/dist/angular/index.d.ts +6 -0
- package/dist/angular/index.js +833 -43
- package/dist/angular/voice-app-kit-status.service.d.ts +12 -0
- package/dist/angular/voice-ops-status.component.d.ts +15 -0
- package/dist/angular/voice-provider-capabilities.service.d.ts +12 -0
- package/dist/angular/voice-provider-status.service.d.ts +12 -0
- package/dist/angular/voice-routing-status.service.d.ts +11 -0
- package/dist/angular/voice-stream.service.d.ts +2 -0
- package/dist/angular/voice-turn-quality.service.d.ts +12 -0
- package/dist/angular/voice-workflow-status.service.d.ts +12 -0
- package/dist/appKit.d.ts +94 -0
- package/dist/assistantHealth.d.ts +81 -0
- package/dist/client/actions.d.ts +22 -0
- package/dist/client/appKitStatus.d.ts +19 -0
- package/dist/client/connection.d.ts +3 -0
- package/dist/client/htmxBootstrap.js +44 -2
- package/dist/client/index.d.ts +26 -0
- package/dist/client/index.js +1290 -2
- package/dist/client/opsStatusWidget.d.ts +40 -0
- package/dist/client/providerCapabilities.d.ts +19 -0
- package/dist/client/providerCapabilitiesWidget.d.ts +32 -0
- package/dist/client/providerSimulationControls.d.ts +33 -0
- package/dist/client/providerSimulationControlsWidget.d.ts +20 -0
- package/dist/client/providerStatus.d.ts +19 -0
- package/dist/client/providerStatusWidget.d.ts +32 -0
- package/dist/client/routingStatus.d.ts +19 -0
- package/dist/client/routingStatusWidget.d.ts +28 -0
- package/dist/client/turnQuality.d.ts +19 -0
- package/dist/client/turnQualityWidget.d.ts +32 -0
- package/dist/client/workflowStatus.d.ts +19 -0
- package/dist/diagnosticsRoutes.d.ts +44 -0
- package/dist/evalRoutes.d.ts +213 -0
- package/dist/handoff.d.ts +54 -0
- package/dist/handoffHealth.d.ts +94 -0
- package/dist/index.d.ts +56 -7
- package/dist/index.js +6919 -128
- package/dist/modelAdapters.d.ts +75 -0
- package/dist/opsConsoleRoutes.d.ts +77 -0
- package/dist/opsWebhook.d.ts +126 -0
- package/dist/outcomeContract.d.ts +112 -0
- package/dist/postgresStore.d.ts +2 -0
- package/dist/providerAdapters.d.ts +48 -0
- package/dist/providerCapabilities.d.ts +92 -0
- package/dist/providerHealth.d.ts +79 -0
- package/dist/qualityRoutes.d.ts +76 -0
- package/dist/queue.d.ts +61 -0
- package/dist/react/VoiceOpsStatus.d.ts +6 -0
- package/dist/react/VoiceProviderCapabilities.d.ts +6 -0
- package/dist/react/VoiceProviderSimulationControls.d.ts +5 -0
- package/dist/react/VoiceProviderStatus.d.ts +6 -0
- package/dist/react/VoiceRoutingStatus.d.ts +6 -0
- package/dist/react/VoiceTurnQuality.d.ts +6 -0
- package/dist/react/index.d.ts +13 -0
- package/dist/react/index.js +1884 -11
- package/dist/react/useVoiceAppKitStatus.d.ts +8 -0
- package/dist/react/useVoiceController.d.ts +2 -0
- package/dist/react/useVoiceProviderCapabilities.d.ts +8 -0
- package/dist/react/useVoiceProviderSimulationControls.d.ts +10 -0
- package/dist/react/useVoiceProviderStatus.d.ts +8 -0
- package/dist/react/useVoiceRoutingStatus.d.ts +8 -0
- package/dist/react/useVoiceStream.d.ts +2 -0
- package/dist/react/useVoiceTurnQuality.d.ts +8 -0
- package/dist/react/useVoiceWorkflowStatus.d.ts +8 -0
- package/dist/resilienceRoutes.d.ts +117 -0
- package/dist/sessionReplay.d.ts +175 -0
- package/dist/sqliteStore.d.ts +2 -0
- package/dist/svelte/createVoiceAppKitStatus.d.ts +8 -0
- package/dist/svelte/createVoiceOpsStatus.d.ts +9 -0
- package/dist/svelte/createVoiceProviderCapabilities.d.ts +10 -0
- package/dist/svelte/createVoiceProviderSimulationControls.d.ts +11 -0
- package/dist/svelte/createVoiceProviderStatus.d.ts +10 -0
- package/dist/svelte/createVoiceRoutingStatus.d.ts +10 -0
- package/dist/svelte/createVoiceTurnQuality.d.ts +10 -0
- package/dist/svelte/createVoiceWorkflowStatus.d.ts +8 -0
- package/dist/svelte/index.d.ts +8 -0
- package/dist/svelte/index.js +1330 -3
- package/dist/telephony/contract.d.ts +61 -0
- package/dist/telephony/matrix.d.ts +97 -0
- package/dist/telephony/plivo.d.ts +154 -0
- package/dist/telephony/telnyx.d.ts +139 -0
- package/dist/telephony/twilio.d.ts +132 -0
- package/dist/telephonyOutcome.d.ts +201 -0
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.js +2541 -14
- package/dist/testing/ioProviderSimulator.d.ts +41 -0
- package/dist/testing/providerSimulator.d.ts +44 -0
- package/dist/toolContract.d.ts +130 -0
- package/dist/toolRuntime.d.ts +50 -0
- package/dist/trace.d.ts +1 -1
- package/dist/turnQuality.d.ts +94 -0
- package/dist/types.d.ts +84 -2
- package/dist/vue/VoiceOpsStatus.d.ts +30 -0
- package/dist/vue/VoiceProviderCapabilities.d.ts +51 -0
- package/dist/vue/VoiceProviderSimulationControls.d.ts +88 -0
- package/dist/vue/VoiceProviderStatus.d.ts +51 -0
- package/dist/vue/VoiceRoutingStatus.d.ts +51 -0
- package/dist/vue/VoiceTurnQuality.d.ts +51 -0
- package/dist/vue/index.d.ts +13 -0
- package/dist/vue/index.js +1934 -25
- package/dist/vue/useVoiceAppKitStatus.d.ts +9 -0
- package/dist/vue/useVoiceProviderCapabilities.d.ts +9 -0
- package/dist/vue/useVoiceProviderSimulationControls.d.ts +24 -0
- package/dist/vue/useVoiceProviderStatus.d.ts +9 -0
- package/dist/vue/useVoiceRoutingStatus.d.ts +8 -0
- package/dist/vue/useVoiceStream.d.ts +2 -0
- package/dist/vue/useVoiceTurnQuality.d.ts +9 -0
- package/dist/vue/useVoiceWorkflowStatus.d.ts +9 -0
- package/dist/workflowContract.d.ts +91 -0
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type VoiceAppKitStatusClientOptions } from '../client/appKitStatus';
|
|
2
|
+
import type { VoiceAppKitStatusReport } from '../appKit';
|
|
3
|
+
export declare class VoiceAppKitStatusService {
|
|
4
|
+
connect(path?: string, options?: VoiceAppKitStatusClientOptions): {
|
|
5
|
+
close: () => void;
|
|
6
|
+
error: import("@angular/core").Signal<string | null>;
|
|
7
|
+
isLoading: import("@angular/core").Signal<boolean>;
|
|
8
|
+
refresh: () => Promise<VoiceAppKitStatusReport | undefined>;
|
|
9
|
+
report: import("@angular/core").Signal<VoiceAppKitStatusReport | undefined>;
|
|
10
|
+
updatedAt: import("@angular/core").Signal<number | undefined>;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { type VoiceOpsStatusViewModel } from '../client/opsStatusWidget';
|
|
3
|
+
export declare class VoiceOpsStatusComponent implements OnDestroy, OnInit {
|
|
4
|
+
description?: string;
|
|
5
|
+
includeLinks: boolean;
|
|
6
|
+
intervalMs?: number;
|
|
7
|
+
path: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
private cleanup;
|
|
10
|
+
private store?;
|
|
11
|
+
model: import("@angular/core").WritableSignal<VoiceOpsStatusViewModel>;
|
|
12
|
+
ngOnInit(): void;
|
|
13
|
+
ngOnDestroy(): void;
|
|
14
|
+
private options;
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type VoiceProviderCapabilitiesClientOptions } from '../client/providerCapabilities';
|
|
2
|
+
import type { VoiceProviderCapabilityReport } from '../providerCapabilities';
|
|
3
|
+
export declare class VoiceProviderCapabilitiesService {
|
|
4
|
+
connect<TProvider extends string = string>(path?: string, options?: VoiceProviderCapabilitiesClientOptions): {
|
|
5
|
+
close: () => void;
|
|
6
|
+
error: import("@angular/core").Signal<string | null>;
|
|
7
|
+
isLoading: import("@angular/core").Signal<boolean>;
|
|
8
|
+
refresh: () => Promise<VoiceProviderCapabilityReport<TProvider> | undefined>;
|
|
9
|
+
report: import("@angular/core").Signal<VoiceProviderCapabilityReport<TProvider> | undefined>;
|
|
10
|
+
updatedAt: import("@angular/core").Signal<number | undefined>;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type VoiceProviderStatusClientOptions } from '../client/providerStatus';
|
|
2
|
+
import type { VoiceProviderHealthSummary } from '../providerHealth';
|
|
3
|
+
export declare class VoiceProviderStatusService {
|
|
4
|
+
connect<TProvider extends string = string>(path?: string, options?: VoiceProviderStatusClientOptions): {
|
|
5
|
+
close: () => void;
|
|
6
|
+
error: import("@angular/core").Signal<string | null>;
|
|
7
|
+
isLoading: import("@angular/core").Signal<boolean>;
|
|
8
|
+
providers: import("@angular/core").Signal<VoiceProviderHealthSummary<TProvider>[]>;
|
|
9
|
+
refresh: () => Promise<VoiceProviderHealthSummary<TProvider>[]>;
|
|
10
|
+
updatedAt: import("@angular/core").Signal<number | undefined>;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type VoiceRoutingStatusClientOptions } from '../client/routingStatus';
|
|
2
|
+
export declare class VoiceRoutingStatusService {
|
|
3
|
+
connect(path?: string, options?: VoiceRoutingStatusClientOptions): {
|
|
4
|
+
close: () => void;
|
|
5
|
+
decision: import("@angular/core").Signal<import("..").VoiceRoutingEvent | null>;
|
|
6
|
+
error: import("@angular/core").Signal<string | null>;
|
|
7
|
+
isLoading: import("@angular/core").Signal<boolean>;
|
|
8
|
+
refresh: () => Promise<import("..").VoiceRoutingEvent | null>;
|
|
9
|
+
updatedAt: import("@angular/core").Signal<number | undefined>;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -8,6 +8,8 @@ export declare class VoiceStreamService {
|
|
|
8
8
|
turnId?: string;
|
|
9
9
|
}[]>;
|
|
10
10
|
assistantTexts: import("@angular/core").Signal<string[]>;
|
|
11
|
+
call: import("@angular/core").Signal<import("..").VoiceCallLifecycleState | null>;
|
|
12
|
+
callControl: (message: Parameters<(message: Omit<import("..").VoiceClientCallControlMessage, "type">) => void>[0]) => void;
|
|
11
13
|
close: () => void;
|
|
12
14
|
endTurn: () => void;
|
|
13
15
|
error: import("@angular/core").Signal<string | null>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type VoiceTurnQualityClientOptions } from '../client/turnQuality';
|
|
2
|
+
import type { VoiceTurnQualityReport } from '../turnQuality';
|
|
3
|
+
export declare class VoiceTurnQualityService {
|
|
4
|
+
connect(path?: string, options?: VoiceTurnQualityClientOptions): {
|
|
5
|
+
close: () => void;
|
|
6
|
+
error: import("@angular/core").Signal<string | null>;
|
|
7
|
+
isLoading: import("@angular/core").Signal<boolean>;
|
|
8
|
+
refresh: () => Promise<VoiceTurnQualityReport | undefined>;
|
|
9
|
+
report: import("@angular/core").Signal<VoiceTurnQualityReport | undefined>;
|
|
10
|
+
updatedAt: import("@angular/core").Signal<number | undefined>;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type VoiceWorkflowStatusClientOptions } from '../client/workflowStatus';
|
|
2
|
+
import type { VoiceScenarioEvalReport } from '../evalRoutes';
|
|
3
|
+
export declare class VoiceWorkflowStatusService {
|
|
4
|
+
connect(path?: string, options?: VoiceWorkflowStatusClientOptions): {
|
|
5
|
+
close: () => void;
|
|
6
|
+
error: import("@angular/core").Signal<string | null>;
|
|
7
|
+
isLoading: import("@angular/core").Signal<boolean>;
|
|
8
|
+
refresh: () => Promise<VoiceScenarioEvalReport | undefined>;
|
|
9
|
+
report: import("@angular/core").Signal<VoiceScenarioEvalReport | undefined>;
|
|
10
|
+
updatedAt: import("@angular/core").Signal<number | undefined>;
|
|
11
|
+
};
|
|
12
|
+
}
|
package/dist/appKit.d.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import { type VoiceAssistantHealthRoutesOptions } from './assistantHealth';
|
|
3
|
+
import { type VoiceDiagnosticsRoutesOptions } from './diagnosticsRoutes';
|
|
4
|
+
import { type VoiceEvalRoutesOptions, type VoiceEvalLink } from './evalRoutes';
|
|
5
|
+
import { type VoiceHandoffHealthRoutesOptions } from './handoffHealth';
|
|
6
|
+
import { type VoiceOpsConsoleRoutesOptions } from './opsConsoleRoutes';
|
|
7
|
+
import { type VoiceProviderHealthRoutesOptions } from './providerHealth';
|
|
8
|
+
import { type VoiceProviderCapabilityRoutesOptions } from './providerCapabilities';
|
|
9
|
+
import { type VoiceQualityRoutesOptions } from './qualityRoutes';
|
|
10
|
+
import { type VoiceResilienceRoutesOptions } from './resilienceRoutes';
|
|
11
|
+
import { type VoiceSessionListRoutesOptions, type VoiceSessionReplayRoutesOptions } from './sessionReplay';
|
|
12
|
+
import { type VoiceTraceEventStore } from './trace';
|
|
13
|
+
export type VoiceAppKitSurface = 'assistantHealth' | 'diagnostics' | 'evals' | 'handoffs' | 'opsConsole' | 'providerCapabilities' | 'providerHealth' | 'quality' | 'resilience' | 'sessionReplay' | 'sessions';
|
|
14
|
+
export type VoiceAppKitLink = VoiceEvalLink & {
|
|
15
|
+
description?: string;
|
|
16
|
+
statusHref?: string;
|
|
17
|
+
};
|
|
18
|
+
export type VoiceAppKitRoutesOptions<TProvider extends string = string> = {
|
|
19
|
+
appStatus?: false | VoiceAppKitStatusOptions;
|
|
20
|
+
assistantHealth?: false | Partial<VoiceAssistantHealthRoutesOptions<TProvider>>;
|
|
21
|
+
diagnostics?: false | Partial<Omit<VoiceDiagnosticsRoutesOptions, 'store'>>;
|
|
22
|
+
evals?: false | Partial<VoiceEvalRoutesOptions>;
|
|
23
|
+
handoffs?: false | Partial<VoiceHandoffHealthRoutesOptions>;
|
|
24
|
+
headers?: HeadersInit;
|
|
25
|
+
links?: VoiceAppKitLink[];
|
|
26
|
+
llmProviders?: readonly TProvider[];
|
|
27
|
+
name?: string;
|
|
28
|
+
opsConsole?: false | Partial<VoiceOpsConsoleRoutesOptions>;
|
|
29
|
+
providerCapabilities?: false | Partial<VoiceProviderCapabilityRoutesOptions<TProvider>>;
|
|
30
|
+
providerHealth?: false | Partial<VoiceProviderHealthRoutesOptions<TProvider>>;
|
|
31
|
+
quality?: false | Partial<VoiceQualityRoutesOptions>;
|
|
32
|
+
resilience?: false | Partial<VoiceResilienceRoutesOptions>;
|
|
33
|
+
sessionReplay?: false | Partial<VoiceSessionReplayRoutesOptions>;
|
|
34
|
+
sessions?: false | Partial<VoiceSessionListRoutesOptions>;
|
|
35
|
+
store: VoiceTraceEventStore;
|
|
36
|
+
sttProviders?: readonly string[];
|
|
37
|
+
title?: string;
|
|
38
|
+
ttsProviders?: readonly string[];
|
|
39
|
+
};
|
|
40
|
+
export type VoiceAppKitStatus = 'pass' | 'fail';
|
|
41
|
+
export type VoiceAppKitStatusOptions = {
|
|
42
|
+
include?: {
|
|
43
|
+
handoffs?: boolean;
|
|
44
|
+
providers?: boolean;
|
|
45
|
+
quality?: boolean;
|
|
46
|
+
sessions?: boolean;
|
|
47
|
+
workflows?: boolean;
|
|
48
|
+
};
|
|
49
|
+
path?: string;
|
|
50
|
+
preferFixtureWorkflows?: boolean;
|
|
51
|
+
};
|
|
52
|
+
export type VoiceAppKitStatusReport = {
|
|
53
|
+
checkedAt: number;
|
|
54
|
+
failed: number;
|
|
55
|
+
links: VoiceAppKitLink[];
|
|
56
|
+
passed: number;
|
|
57
|
+
status: VoiceAppKitStatus;
|
|
58
|
+
surfaces: {
|
|
59
|
+
handoffs?: {
|
|
60
|
+
failed: number;
|
|
61
|
+
status: VoiceAppKitStatus;
|
|
62
|
+
total: number;
|
|
63
|
+
};
|
|
64
|
+
providers?: {
|
|
65
|
+
degraded: number;
|
|
66
|
+
status: VoiceAppKitStatus;
|
|
67
|
+
total: number;
|
|
68
|
+
};
|
|
69
|
+
quality?: {
|
|
70
|
+
status: VoiceAppKitStatus;
|
|
71
|
+
};
|
|
72
|
+
sessions?: {
|
|
73
|
+
failed: number;
|
|
74
|
+
status: VoiceAppKitStatus;
|
|
75
|
+
total: number;
|
|
76
|
+
};
|
|
77
|
+
workflows?: {
|
|
78
|
+
failed: number;
|
|
79
|
+
source: 'fixtures' | 'live';
|
|
80
|
+
status: VoiceAppKitStatus;
|
|
81
|
+
total: number;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
total: number;
|
|
85
|
+
};
|
|
86
|
+
export type VoiceAppKitRoutes<TProvider extends string = string> = {
|
|
87
|
+
links: VoiceAppKitLink[];
|
|
88
|
+
routes: Elysia;
|
|
89
|
+
surfaces: VoiceAppKitSurface[];
|
|
90
|
+
use: Elysia['use'];
|
|
91
|
+
};
|
|
92
|
+
export declare const summarizeVoiceAppKitStatus: <TProvider extends string = string>(options: VoiceAppKitRoutesOptions<TProvider>) => Promise<VoiceAppKitStatusReport>;
|
|
93
|
+
export declare const createVoiceAppKitRoutes: <TProvider extends string = string>(options: VoiceAppKitRoutesOptions<TProvider>) => VoiceAppKitRoutes<TProvider>;
|
|
94
|
+
export declare const createVoiceAppKit: <TProvider extends string = string>(options: VoiceAppKitRoutesOptions<TProvider>) => VoiceAppKitRoutes<TProvider>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
import { type VoiceAssistantRunsSummary } from './assistant';
|
|
3
|
+
import { type VoiceProviderHealthSummary } from './providerHealth';
|
|
4
|
+
import type { StoredVoiceTraceEvent, VoiceTraceEventStore } from './trace';
|
|
5
|
+
export type VoiceAssistantHealthFailure = {
|
|
6
|
+
at: number;
|
|
7
|
+
assistantId?: string;
|
|
8
|
+
error?: string;
|
|
9
|
+
provider?: string;
|
|
10
|
+
rateLimited?: boolean;
|
|
11
|
+
replayHref?: string;
|
|
12
|
+
sessionId: string;
|
|
13
|
+
status?: string;
|
|
14
|
+
turnId?: string;
|
|
15
|
+
type: StoredVoiceTraceEvent['type'];
|
|
16
|
+
};
|
|
17
|
+
export type VoiceAssistantHealthSummary<TProvider extends string = string> = {
|
|
18
|
+
assistantRuns: VoiceAssistantRunsSummary;
|
|
19
|
+
providerHealth: VoiceProviderHealthSummary<TProvider>[];
|
|
20
|
+
recentFailures: VoiceAssistantHealthFailure[];
|
|
21
|
+
};
|
|
22
|
+
export type VoiceAssistantHealthSummaryOptions<TProvider extends string = string> = {
|
|
23
|
+
events?: StoredVoiceTraceEvent[];
|
|
24
|
+
maxFailures?: number;
|
|
25
|
+
providers?: readonly TProvider[];
|
|
26
|
+
replayHref?: false | string | ((failure: Omit<VoiceAssistantHealthFailure, 'replayHref'>) => string);
|
|
27
|
+
store?: VoiceTraceEventStore;
|
|
28
|
+
};
|
|
29
|
+
export type VoiceAssistantHealthHTMLHandlerOptions<TProvider extends string = string> = VoiceAssistantHealthSummaryOptions<TProvider> & {
|
|
30
|
+
headers?: HeadersInit;
|
|
31
|
+
render?: (summary: VoiceAssistantHealthSummary<TProvider>) => string | Promise<string>;
|
|
32
|
+
};
|
|
33
|
+
export type VoiceAssistantHealthRoutesOptions<TProvider extends string = string> = VoiceAssistantHealthHTMLHandlerOptions<TProvider> & {
|
|
34
|
+
htmlPath?: false | string;
|
|
35
|
+
name?: string;
|
|
36
|
+
path?: string;
|
|
37
|
+
};
|
|
38
|
+
export declare const summarizeVoiceAssistantHealth: <TProvider extends string = string>(options: VoiceAssistantHealthSummaryOptions<TProvider>) => Promise<VoiceAssistantHealthSummary<TProvider>>;
|
|
39
|
+
export declare const renderVoiceAssistantHealthHTML: <TProvider extends string = string>(summary: VoiceAssistantHealthSummary<TProvider>) => string;
|
|
40
|
+
export declare const createVoiceAssistantHealthJSONHandler: <TProvider extends string = string>(options: VoiceAssistantHealthSummaryOptions<TProvider>) => () => Promise<VoiceAssistantHealthSummary<TProvider>>;
|
|
41
|
+
export declare const createVoiceAssistantHealthHTMLHandler: <TProvider extends string = string>(options: VoiceAssistantHealthHTMLHandlerOptions<TProvider>) => () => Promise<Response>;
|
|
42
|
+
export declare const createVoiceAssistantHealthRoutes: <TProvider extends string = string>(options: VoiceAssistantHealthRoutesOptions<TProvider>) => Elysia<"", {
|
|
43
|
+
decorator: {};
|
|
44
|
+
store: {};
|
|
45
|
+
derive: {};
|
|
46
|
+
resolve: {};
|
|
47
|
+
}, {
|
|
48
|
+
typebox: {};
|
|
49
|
+
error: {};
|
|
50
|
+
}, {
|
|
51
|
+
schema: {};
|
|
52
|
+
standaloneSchema: {};
|
|
53
|
+
macro: {};
|
|
54
|
+
macroFn: {};
|
|
55
|
+
parser: {};
|
|
56
|
+
response: {};
|
|
57
|
+
}, {
|
|
58
|
+
[x: string]: {
|
|
59
|
+
get: {
|
|
60
|
+
body: unknown;
|
|
61
|
+
params: {};
|
|
62
|
+
query: unknown;
|
|
63
|
+
headers: unknown;
|
|
64
|
+
response: {
|
|
65
|
+
200: VoiceAssistantHealthSummary<TProvider>;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
}, {
|
|
70
|
+
derive: {};
|
|
71
|
+
resolve: {};
|
|
72
|
+
schema: {};
|
|
73
|
+
standaloneSchema: {};
|
|
74
|
+
response: {};
|
|
75
|
+
}, {
|
|
76
|
+
derive: {};
|
|
77
|
+
resolve: {};
|
|
78
|
+
schema: {};
|
|
79
|
+
standaloneSchema: {};
|
|
80
|
+
response: {};
|
|
81
|
+
}>;
|
package/dist/client/actions.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare const serverMessageToAction: <TResult = unknown>(message: VoiceSe
|
|
|
7
7
|
type: "audio";
|
|
8
8
|
text?: undefined;
|
|
9
9
|
sessionId?: undefined;
|
|
10
|
+
event?: undefined;
|
|
10
11
|
message?: undefined;
|
|
11
12
|
transcript?: undefined;
|
|
12
13
|
scenarioId?: undefined;
|
|
@@ -20,6 +21,7 @@ export declare const serverMessageToAction: <TResult = unknown>(message: VoiceSe
|
|
|
20
21
|
receivedAt?: undefined;
|
|
21
22
|
turnId?: undefined;
|
|
22
23
|
sessionId?: undefined;
|
|
24
|
+
event?: undefined;
|
|
23
25
|
message?: undefined;
|
|
24
26
|
transcript?: undefined;
|
|
25
27
|
scenarioId?: undefined;
|
|
@@ -33,6 +35,21 @@ export declare const serverMessageToAction: <TResult = unknown>(message: VoiceSe
|
|
|
33
35
|
receivedAt?: undefined;
|
|
34
36
|
turnId?: undefined;
|
|
35
37
|
text?: undefined;
|
|
38
|
+
event?: undefined;
|
|
39
|
+
message?: undefined;
|
|
40
|
+
transcript?: undefined;
|
|
41
|
+
scenarioId?: undefined;
|
|
42
|
+
status?: undefined;
|
|
43
|
+
turn?: undefined;
|
|
44
|
+
} | {
|
|
45
|
+
event: import("..").VoiceCallLifecycleEvent;
|
|
46
|
+
sessionId: string;
|
|
47
|
+
type: "call_lifecycle";
|
|
48
|
+
chunk?: undefined;
|
|
49
|
+
format?: undefined;
|
|
50
|
+
receivedAt?: undefined;
|
|
51
|
+
turnId?: undefined;
|
|
52
|
+
text?: undefined;
|
|
36
53
|
message?: undefined;
|
|
37
54
|
transcript?: undefined;
|
|
38
55
|
scenarioId?: undefined;
|
|
@@ -47,6 +64,7 @@ export declare const serverMessageToAction: <TResult = unknown>(message: VoiceSe
|
|
|
47
64
|
turnId?: undefined;
|
|
48
65
|
text?: undefined;
|
|
49
66
|
sessionId?: undefined;
|
|
67
|
+
event?: undefined;
|
|
50
68
|
transcript?: undefined;
|
|
51
69
|
scenarioId?: undefined;
|
|
52
70
|
status?: undefined;
|
|
@@ -60,6 +78,7 @@ export declare const serverMessageToAction: <TResult = unknown>(message: VoiceSe
|
|
|
60
78
|
turnId?: undefined;
|
|
61
79
|
text?: undefined;
|
|
62
80
|
sessionId?: undefined;
|
|
81
|
+
event?: undefined;
|
|
63
82
|
message?: undefined;
|
|
64
83
|
scenarioId?: undefined;
|
|
65
84
|
status?: undefined;
|
|
@@ -73,6 +92,7 @@ export declare const serverMessageToAction: <TResult = unknown>(message: VoiceSe
|
|
|
73
92
|
turnId?: undefined;
|
|
74
93
|
text?: undefined;
|
|
75
94
|
sessionId?: undefined;
|
|
95
|
+
event?: undefined;
|
|
76
96
|
message?: undefined;
|
|
77
97
|
scenarioId?: undefined;
|
|
78
98
|
status?: undefined;
|
|
@@ -87,6 +107,7 @@ export declare const serverMessageToAction: <TResult = unknown>(message: VoiceSe
|
|
|
87
107
|
receivedAt?: undefined;
|
|
88
108
|
turnId?: undefined;
|
|
89
109
|
text?: undefined;
|
|
110
|
+
event?: undefined;
|
|
90
111
|
message?: undefined;
|
|
91
112
|
transcript?: undefined;
|
|
92
113
|
turn?: undefined;
|
|
@@ -99,6 +120,7 @@ export declare const serverMessageToAction: <TResult = unknown>(message: VoiceSe
|
|
|
99
120
|
turnId?: undefined;
|
|
100
121
|
text?: undefined;
|
|
101
122
|
sessionId?: undefined;
|
|
123
|
+
event?: undefined;
|
|
102
124
|
message?: undefined;
|
|
103
125
|
transcript?: undefined;
|
|
104
126
|
scenarioId?: undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { VoiceAppKitStatusReport } from '../appKit';
|
|
2
|
+
export type VoiceAppKitStatusClientOptions = {
|
|
3
|
+
fetch?: typeof fetch;
|
|
4
|
+
intervalMs?: number;
|
|
5
|
+
};
|
|
6
|
+
export type VoiceAppKitStatusSnapshot = {
|
|
7
|
+
error: string | null;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
report?: VoiceAppKitStatusReport;
|
|
10
|
+
updatedAt?: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const fetchVoiceAppKitStatus: (path?: string, options?: Pick<VoiceAppKitStatusClientOptions, "fetch">) => Promise<VoiceAppKitStatusReport>;
|
|
13
|
+
export declare const createVoiceAppKitStatusStore: (path?: string, options?: VoiceAppKitStatusClientOptions) => {
|
|
14
|
+
close: () => void;
|
|
15
|
+
getServerSnapshot: () => VoiceAppKitStatusSnapshot;
|
|
16
|
+
getSnapshot: () => VoiceAppKitStatusSnapshot;
|
|
17
|
+
refresh: () => Promise<VoiceAppKitStatusReport | undefined>;
|
|
18
|
+
subscribe: (listener: () => void) => () => void;
|
|
19
|
+
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { VoiceClientMessage, VoiceConnectionOptions, VoiceServerMessage } from '../types';
|
|
2
2
|
type VoiceConnectionHandle = {
|
|
3
|
+
callControl: (message: Omit<VoiceClientMessage & {
|
|
4
|
+
type: 'call_control';
|
|
5
|
+
}, 'type'>) => void;
|
|
3
6
|
start: (input?: {
|
|
4
7
|
sessionId?: string;
|
|
5
8
|
scenarioId?: string;
|
|
@@ -188,6 +188,12 @@ var serverMessageToAction = (message) => {
|
|
|
188
188
|
sessionId: message.sessionId,
|
|
189
189
|
type: "complete"
|
|
190
190
|
};
|
|
191
|
+
case "call_lifecycle":
|
|
192
|
+
return {
|
|
193
|
+
event: message.event,
|
|
194
|
+
sessionId: message.sessionId,
|
|
195
|
+
type: "call_lifecycle"
|
|
196
|
+
};
|
|
191
197
|
case "error":
|
|
192
198
|
return {
|
|
193
199
|
message: normalizeErrorMessage(message.message),
|
|
@@ -231,7 +237,7 @@ var DEFAULT_SCENARIO_QUERY_PARAM = "scenarioId";
|
|
|
231
237
|
var noop = () => {};
|
|
232
238
|
var noopUnsubscribe = () => noop;
|
|
233
239
|
var NOOP_CONNECTION = {
|
|
234
|
-
|
|
240
|
+
callControl: noop,
|
|
235
241
|
close: noop,
|
|
236
242
|
endTurn: noop,
|
|
237
243
|
getReadyState: () => WS_CLOSED,
|
|
@@ -239,6 +245,7 @@ var NOOP_CONNECTION = {
|
|
|
239
245
|
getSessionId: () => "",
|
|
240
246
|
send: noop,
|
|
241
247
|
sendAudio: noop,
|
|
248
|
+
start: () => {},
|
|
242
249
|
subscribe: noopUnsubscribe
|
|
243
250
|
};
|
|
244
251
|
var createSessionId = () => crypto.randomUUID();
|
|
@@ -260,6 +267,7 @@ var isVoiceServerMessage = (value) => {
|
|
|
260
267
|
switch (value.type) {
|
|
261
268
|
case "audio":
|
|
262
269
|
case "assistant":
|
|
270
|
+
case "call_lifecycle":
|
|
263
271
|
case "complete":
|
|
264
272
|
case "error":
|
|
265
273
|
case "final":
|
|
@@ -400,6 +408,12 @@ var createVoiceConnection = (path, options = {}) => {
|
|
|
400
408
|
const endTurn = () => {
|
|
401
409
|
send({ type: "end_turn" });
|
|
402
410
|
};
|
|
411
|
+
const callControl = (message) => {
|
|
412
|
+
send({
|
|
413
|
+
...message,
|
|
414
|
+
type: "call_control"
|
|
415
|
+
});
|
|
416
|
+
};
|
|
403
417
|
const close = () => {
|
|
404
418
|
clearTimers();
|
|
405
419
|
if (state.ws) {
|
|
@@ -417,7 +431,7 @@ var createVoiceConnection = (path, options = {}) => {
|
|
|
417
431
|
};
|
|
418
432
|
connect();
|
|
419
433
|
return {
|
|
420
|
-
|
|
434
|
+
callControl,
|
|
421
435
|
close,
|
|
422
436
|
endTurn,
|
|
423
437
|
getReadyState: () => state.ws?.readyState ?? WS_CLOSED,
|
|
@@ -425,6 +439,7 @@ var createVoiceConnection = (path, options = {}) => {
|
|
|
425
439
|
getSessionId: () => state.sessionId,
|
|
426
440
|
send,
|
|
427
441
|
sendAudio,
|
|
442
|
+
start,
|
|
428
443
|
subscribe
|
|
429
444
|
};
|
|
430
445
|
};
|
|
@@ -433,6 +448,7 @@ var createVoiceConnection = (path, options = {}) => {
|
|
|
433
448
|
var createInitialState = () => ({
|
|
434
449
|
assistantAudio: [],
|
|
435
450
|
assistantTexts: [],
|
|
451
|
+
call: null,
|
|
436
452
|
error: null,
|
|
437
453
|
isConnected: false,
|
|
438
454
|
scenarioId: null,
|
|
@@ -476,6 +492,20 @@ var createVoiceStreamStore = () => {
|
|
|
476
492
|
status: "completed"
|
|
477
493
|
};
|
|
478
494
|
break;
|
|
495
|
+
case "call_lifecycle":
|
|
496
|
+
state = {
|
|
497
|
+
...state,
|
|
498
|
+
call: {
|
|
499
|
+
...state.call,
|
|
500
|
+
disposition: action.event.type === "end" ? action.event.disposition : state.call?.disposition,
|
|
501
|
+
endedAt: action.event.type === "end" ? action.event.at : state.call?.endedAt,
|
|
502
|
+
events: [...state.call?.events ?? [], action.event],
|
|
503
|
+
lastEventAt: action.event.at,
|
|
504
|
+
startedAt: state.call?.startedAt ?? action.event.at
|
|
505
|
+
},
|
|
506
|
+
sessionId: action.sessionId
|
|
507
|
+
};
|
|
508
|
+
break;
|
|
479
509
|
case "connected":
|
|
480
510
|
state = {
|
|
481
511
|
...state,
|
|
@@ -562,6 +592,9 @@ var createVoiceStream = (path, options = {}) => {
|
|
|
562
592
|
}
|
|
563
593
|
});
|
|
564
594
|
return {
|
|
595
|
+
callControl(message) {
|
|
596
|
+
connection.callControl(message);
|
|
597
|
+
},
|
|
565
598
|
close() {
|
|
566
599
|
unsubscribeConnection();
|
|
567
600
|
connection.close();
|
|
@@ -605,6 +638,9 @@ var createVoiceStream = (path, options = {}) => {
|
|
|
605
638
|
get assistantAudio() {
|
|
606
639
|
return store.getSnapshot().assistantAudio;
|
|
607
640
|
},
|
|
641
|
+
get call() {
|
|
642
|
+
return store.getSnapshot().call;
|
|
643
|
+
},
|
|
608
644
|
sendAudio(audio) {
|
|
609
645
|
connection.sendAudio(audio);
|
|
610
646
|
},
|
|
@@ -900,6 +936,7 @@ var resolveVoiceRuntimePreset = (name = "default") => {
|
|
|
900
936
|
var createInitialState2 = (stream) => ({
|
|
901
937
|
assistantAudio: [...stream.assistantAudio],
|
|
902
938
|
assistantTexts: [...stream.assistantTexts],
|
|
939
|
+
call: stream.call,
|
|
903
940
|
error: stream.error,
|
|
904
941
|
isConnected: stream.isConnected,
|
|
905
942
|
isRecording: false,
|
|
@@ -929,6 +966,7 @@ var createVoiceController = (path, options = {}) => {
|
|
|
929
966
|
...state,
|
|
930
967
|
assistantAudio: [...stream.assistantAudio],
|
|
931
968
|
assistantTexts: [...stream.assistantTexts],
|
|
969
|
+
call: stream.call,
|
|
932
970
|
error: stream.error,
|
|
933
971
|
isConnected: stream.isConnected,
|
|
934
972
|
partial: stream.partial,
|
|
@@ -1006,6 +1044,7 @@ var createVoiceController = (path, options = {}) => {
|
|
|
1006
1044
|
bindHTMX(bindingOptions) {
|
|
1007
1045
|
return bindVoiceHTMX(stream, bindingOptions);
|
|
1008
1046
|
},
|
|
1047
|
+
callControl: (message) => stream.callControl(message),
|
|
1009
1048
|
close,
|
|
1010
1049
|
endTurn: () => stream.endTurn(),
|
|
1011
1050
|
get error() {
|
|
@@ -1058,6 +1097,9 @@ var createVoiceController = (path, options = {}) => {
|
|
|
1058
1097
|
},
|
|
1059
1098
|
get assistantAudio() {
|
|
1060
1099
|
return state.assistantAudio;
|
|
1100
|
+
},
|
|
1101
|
+
get call() {
|
|
1102
|
+
return state.call;
|
|
1061
1103
|
}
|
|
1062
1104
|
};
|
|
1063
1105
|
};
|
package/dist/client/index.d.ts
CHANGED
|
@@ -5,3 +5,29 @@ export { createVoiceController } from './controller';
|
|
|
5
5
|
export { bindVoiceBargeIn, createVoiceDuplexController } from './duplex';
|
|
6
6
|
export { bindVoiceHTMX } from './htmx';
|
|
7
7
|
export { createMicrophoneCapture } from './microphone';
|
|
8
|
+
export { createVoiceAppKitStatusStore, fetchVoiceAppKitStatus } from './appKitStatus';
|
|
9
|
+
export { createVoiceOpsStatusViewModel, defineVoiceOpsStatusElement, getVoiceOpsStatusCSS, getVoiceOpsStatusLabel, mountVoiceOpsStatus, renderVoiceOpsStatusHTML } from './opsStatusWidget';
|
|
10
|
+
export { createVoiceRoutingStatusStore, fetchVoiceRoutingStatus } from './routingStatus';
|
|
11
|
+
export { createVoiceRoutingStatusViewModel, defineVoiceRoutingStatusElement, getVoiceRoutingStatusCSS, mountVoiceRoutingStatus, renderVoiceRoutingStatusHTML } from './routingStatusWidget';
|
|
12
|
+
export { createVoiceProviderStatusStore, fetchVoiceProviderStatus } from './providerStatus';
|
|
13
|
+
export { createVoiceProviderCapabilitiesStore, fetchVoiceProviderCapabilities } from './providerCapabilities';
|
|
14
|
+
export { createVoiceTurnQualityStore, fetchVoiceTurnQuality } from './turnQuality';
|
|
15
|
+
export { createVoiceProviderSimulationControlsStore } from './providerSimulationControls';
|
|
16
|
+
export { bindVoiceProviderSimulationControls, createVoiceProviderSimulationControlsViewModel, defineVoiceProviderSimulationControlsElement, mountVoiceProviderSimulationControls, renderVoiceProviderSimulationControlsHTML } from './providerSimulationControlsWidget';
|
|
17
|
+
export { createVoiceProviderStatusViewModel, defineVoiceProviderStatusElement, getVoiceProviderStatusCSS, mountVoiceProviderStatus, renderVoiceProviderStatusHTML } from './providerStatusWidget';
|
|
18
|
+
export { createVoiceProviderCapabilitiesViewModel, defineVoiceProviderCapabilitiesElement, getVoiceProviderCapabilitiesCSS, mountVoiceProviderCapabilities, renderVoiceProviderCapabilitiesHTML } from './providerCapabilitiesWidget';
|
|
19
|
+
export { createVoiceTurnQualityViewModel, defineVoiceTurnQualityElement, getVoiceTurnQualityCSS, mountVoiceTurnQuality, renderVoiceTurnQualityHTML } from './turnQualityWidget';
|
|
20
|
+
export { createVoiceWorkflowStatusStore, fetchVoiceWorkflowStatus } from './workflowStatus';
|
|
21
|
+
export type { VoiceAppKitStatusClientOptions, VoiceAppKitStatusSnapshot } from './appKitStatus';
|
|
22
|
+
export type { VoiceOpsStatusSurfaceView, VoiceOpsStatusViewModel, VoiceOpsStatusWidgetOptions } from './opsStatusWidget';
|
|
23
|
+
export type { VoiceRoutingStatusClientOptions, VoiceRoutingStatusSnapshot } from './routingStatus';
|
|
24
|
+
export type { VoiceRoutingStatusViewModel, VoiceRoutingStatusWidgetOptions } from './routingStatusWidget';
|
|
25
|
+
export type { VoiceProviderStatusClientOptions, VoiceProviderStatusSnapshot } from './providerStatus';
|
|
26
|
+
export type { VoiceProviderCapabilitiesClientOptions, VoiceProviderCapabilitiesSnapshot } from './providerCapabilities';
|
|
27
|
+
export type { VoiceTurnQualityClientOptions, VoiceTurnQualitySnapshot } from './turnQuality';
|
|
28
|
+
export type { VoiceProviderSimulationControlsOptions, VoiceProviderSimulationControlsSnapshot, VoiceProviderSimulationProvider } from './providerSimulationControls';
|
|
29
|
+
export type { VoiceProviderSimulationControlsViewModel } from './providerSimulationControlsWidget';
|
|
30
|
+
export type { VoiceProviderStatusCardView, VoiceProviderStatusViewModel, VoiceProviderStatusWidgetOptions } from './providerStatusWidget';
|
|
31
|
+
export type { VoiceProviderCapabilitiesViewModel, VoiceProviderCapabilitiesWidgetOptions, VoiceProviderCapabilityCardView } from './providerCapabilitiesWidget';
|
|
32
|
+
export type { VoiceTurnQualityCardView, VoiceTurnQualityViewModel, VoiceTurnQualityWidgetOptions } from './turnQualityWidget';
|
|
33
|
+
export type { VoiceWorkflowStatusClientOptions, VoiceWorkflowStatusSnapshot } from './workflowStatus';
|