@absolutejs/voice 0.0.22-beta.57 → 0.0.22-beta.58
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/dist/index.d.ts +2 -2
- package/dist/index.js +24 -0
- package/dist/resilienceRoutes.d.ts +11 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export { createAnthropicVoiceAssistantModel, createGeminiVoiceAssistantModel, cr
|
|
|
13
13
|
export { createVoiceProviderHealthHTMLHandler, createVoiceProviderHealthJSONHandler, createVoiceProviderHealthRoutes, renderVoiceProviderHealthHTML, summarizeVoiceProviderHealth } from './providerHealth';
|
|
14
14
|
export { buildVoiceOpsConsoleReport, createVoiceOpsConsoleRoutes, renderVoiceOpsConsoleHTML } from './opsConsoleRoutes';
|
|
15
15
|
export { createVoiceQualityRoutes, evaluateVoiceQuality, renderVoiceQualityHTML } from './qualityRoutes';
|
|
16
|
-
export { createVoiceResilienceRoutes, listVoiceRoutingEvents, renderVoiceResilienceHTML } from './resilienceRoutes';
|
|
16
|
+
export { createVoiceResilienceRoutes, createVoiceRoutingDecisionSummary, listVoiceRoutingEvents, renderVoiceResilienceHTML, summarizeVoiceRoutingDecision } from './resilienceRoutes';
|
|
17
17
|
export { createVoiceSTTProviderRouter, createVoiceTTSProviderRouter } from './providerAdapters';
|
|
18
18
|
export { buildVoiceTraceReplay, createVoiceMemoryTraceSinkDeliveryStore, createVoiceTraceHTTPSink, createVoiceMemoryTraceEventStore, createVoiceTraceSinkDeliveryId, createVoiceTraceSinkDeliveryRecord, createVoiceTraceSinkStore, createVoiceTraceEvent, createVoiceTraceEventId, deliverVoiceTraceEventsToSinks, evaluateVoiceTrace, exportVoiceTrace, filterVoiceTraceEvents, pruneVoiceTraceEvents, redactVoiceTraceEvent, redactVoiceTraceEvents, redactVoiceTraceText, renderVoiceTraceHTML, renderVoiceTraceMarkdown, resolveVoiceTraceRedactionOptions, selectVoiceTraceEventsForPrune, summarizeVoiceTrace } from './trace';
|
|
19
19
|
export { createVoiceSQLiteExternalObjectMapStore, createVoiceSQLiteIntegrationEventStore, createVoiceSQLiteReviewStore, createVoiceSQLiteRuntimeStorage, createVoiceSQLiteSessionStore, createVoiceSQLiteTaskStore, createVoiceSQLiteTraceSinkDeliveryStore, createVoiceSQLiteTraceEventStore } from './sqliteStore';
|
|
@@ -50,7 +50,7 @@ export type { AnthropicVoiceAssistantModelOptions, GeminiVoiceAssistantModelOpti
|
|
|
50
50
|
export type { VoiceProviderHealthStatus, VoiceProviderHealthSummary, VoiceProviderHealthSummaryOptions } from './providerHealth';
|
|
51
51
|
export type { VoiceOpsConsoleLink, VoiceOpsConsoleReport, VoiceOpsConsoleRoutesOptions } from './opsConsoleRoutes';
|
|
52
52
|
export type { VoiceQualityLink, VoiceQualityMetric, VoiceQualityReport, VoiceQualityRoutesOptions, VoiceQualityStatus, VoiceQualityThresholds } from './qualityRoutes';
|
|
53
|
-
export type { VoiceResilienceIOSimulator, VoiceResilienceLink, VoiceResiliencePageData, VoiceResilienceRoutesOptions, VoiceResilienceSimulationProvider, VoiceRoutingEvent, VoiceRoutingEventKind } from './resilienceRoutes';
|
|
53
|
+
export type { VoiceResilienceIOSimulator, VoiceResilienceLink, VoiceResiliencePageData, VoiceResilienceRoutesOptions, VoiceResilienceSimulationProvider, VoiceRoutingDecisionSummary, VoiceRoutingDecisionSummaryOptions, VoiceRoutingEvent, VoiceRoutingEventKind } from './resilienceRoutes';
|
|
54
54
|
export type { VoiceIOProviderRouterEvent, VoiceIOProviderRouterOptions, VoiceIOProviderRouterPolicy, VoiceIOProviderRouterPolicyConfig, VoiceSTTProviderRouterOptions, VoiceTTSProviderRouterOptions } from './providerAdapters';
|
|
55
55
|
export type { VoiceAgent, VoiceAgentMessage, VoiceAgentMessageRole, VoiceAgentModel, VoiceAgentModelInput, VoiceAgentModelOutput, VoiceAgentOptions, VoiceAgentRunResult, VoiceAgentSquadOptions, VoiceAgentTool, VoiceAgentToolCall, VoiceAgentToolResult } from './agent';
|
|
56
56
|
export type { VoiceOpsRuntime, VoiceOpsRuntimeConfig, VoiceOpsRuntimeSummary, VoiceOpsRuntimeSinkWorkerConfig, VoiceOpsRuntimeTaskWorkerConfig, VoiceOpsRuntimeTickResult, VoiceOpsRuntimeWebhookWorkerConfig } from './opsRuntime';
|
package/dist/index.js
CHANGED
|
@@ -8493,15 +8493,37 @@ var listVoiceRoutingEvents = (events) => {
|
|
|
8493
8493
|
latencyBudgetMs: getNumber4(event.payload.latencyBudgetMs),
|
|
8494
8494
|
operation: getString7(event.payload.operation),
|
|
8495
8495
|
provider,
|
|
8496
|
+
routing: getString7(event.payload.routing),
|
|
8496
8497
|
selectedProvider: getString7(event.payload.selectedProvider),
|
|
8497
8498
|
sessionId: event.sessionId,
|
|
8498
8499
|
status: providerStatus,
|
|
8500
|
+
suppressionRemainingMs: getNumber4(event.payload.suppressionRemainingMs),
|
|
8499
8501
|
timedOut: getBoolean2(event.payload.timedOut),
|
|
8500
8502
|
turnId: event.turnId
|
|
8501
8503
|
});
|
|
8502
8504
|
}
|
|
8503
8505
|
return routingEvents.sort((left, right) => right.at - left.at);
|
|
8504
8506
|
};
|
|
8507
|
+
var summarizeVoiceRoutingDecision = (events, options = {}) => {
|
|
8508
|
+
const routingEvents = listVoiceRoutingEvents(events).filter((event) => {
|
|
8509
|
+
if (options.kind && event.kind !== options.kind) {
|
|
8510
|
+
return false;
|
|
8511
|
+
}
|
|
8512
|
+
if (options.sessionId && event.sessionId !== options.sessionId) {
|
|
8513
|
+
return false;
|
|
8514
|
+
}
|
|
8515
|
+
return true;
|
|
8516
|
+
});
|
|
8517
|
+
const limited = typeof options.limit === "number" && options.limit >= 0 ? routingEvents.slice(0, options.limit) : routingEvents;
|
|
8518
|
+
return limited[0] ?? null;
|
|
8519
|
+
};
|
|
8520
|
+
var createVoiceRoutingDecisionSummary = async (options) => {
|
|
8521
|
+
const events = await options.store.list({
|
|
8522
|
+
sessionId: options.sessionId,
|
|
8523
|
+
type: "session.error"
|
|
8524
|
+
});
|
|
8525
|
+
return summarizeVoiceRoutingDecision(events, options);
|
|
8526
|
+
};
|
|
8505
8527
|
var summarizeRoutingEvents = (events) => {
|
|
8506
8528
|
const byKind = new Map;
|
|
8507
8529
|
let errors = 0;
|
|
@@ -14080,6 +14102,7 @@ export {
|
|
|
14080
14102
|
summarizeVoiceTrace,
|
|
14081
14103
|
summarizeVoiceSessions,
|
|
14082
14104
|
summarizeVoiceSessionReplay,
|
|
14105
|
+
summarizeVoiceRoutingDecision,
|
|
14083
14106
|
summarizeVoiceProviderHealth,
|
|
14084
14107
|
summarizeVoiceOpsTasks,
|
|
14085
14108
|
summarizeVoiceOpsTaskQueue,
|
|
@@ -14194,6 +14217,7 @@ export {
|
|
|
14194
14217
|
createVoiceSQLiteIntegrationEventStore,
|
|
14195
14218
|
createVoiceSQLiteExternalObjectMapStore,
|
|
14196
14219
|
createVoiceS3ReviewStore,
|
|
14220
|
+
createVoiceRoutingDecisionSummary,
|
|
14197
14221
|
createVoiceReviewSavedEvent,
|
|
14198
14222
|
createVoiceResilienceRoutes,
|
|
14199
14223
|
createVoiceRedisTaskLeaseCoordinator,
|
|
@@ -13,12 +13,21 @@ export type VoiceRoutingEvent = {
|
|
|
13
13
|
latencyBudgetMs?: number;
|
|
14
14
|
operation?: string;
|
|
15
15
|
provider?: string;
|
|
16
|
+
routing?: string;
|
|
16
17
|
selectedProvider?: string;
|
|
17
18
|
sessionId: string;
|
|
18
19
|
status?: string;
|
|
20
|
+
suppressionRemainingMs?: number;
|
|
19
21
|
timedOut: boolean;
|
|
20
22
|
turnId?: string;
|
|
21
23
|
};
|
|
24
|
+
export type VoiceRoutingDecisionSummary = VoiceRoutingEvent;
|
|
25
|
+
export type VoiceRoutingDecisionSummaryOptions = {
|
|
26
|
+
kind?: VoiceRoutingEventKind;
|
|
27
|
+
limit?: number;
|
|
28
|
+
sessionId?: string;
|
|
29
|
+
store: VoiceTraceEventStore;
|
|
30
|
+
};
|
|
22
31
|
export type VoiceResilienceLink = {
|
|
23
32
|
href: string;
|
|
24
33
|
label: string;
|
|
@@ -63,6 +72,8 @@ export type VoiceResilienceRoutesOptions = {
|
|
|
63
72
|
ttsSimulation?: VoiceResilienceIOSimulator<string>;
|
|
64
73
|
};
|
|
65
74
|
export declare const listVoiceRoutingEvents: (events: StoredVoiceTraceEvent[]) => VoiceRoutingEvent[];
|
|
75
|
+
export declare const summarizeVoiceRoutingDecision: (events: StoredVoiceTraceEvent[], options?: Omit<VoiceRoutingDecisionSummaryOptions, "store">) => VoiceRoutingDecisionSummary | null;
|
|
76
|
+
export declare const createVoiceRoutingDecisionSummary: (options: VoiceRoutingDecisionSummaryOptions) => Promise<VoiceRoutingDecisionSummary | null>;
|
|
66
77
|
export declare const renderVoiceResilienceHTML: (input: VoiceResiliencePageData) => string;
|
|
67
78
|
export declare const createVoiceResilienceRoutes: (options: VoiceResilienceRoutesOptions) => Elysia<"", {
|
|
68
79
|
decorator: {};
|