@absolutejs/voice 0.0.22-beta.192 → 0.0.22-beta.194

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,56 @@
1
+ import type { StoredVoiceTraceEvent, VoiceTraceEventStore } from './trace';
2
+ export type VoiceLatencySLOStatus = 'empty' | 'fail' | 'pass' | 'warn';
3
+ export type VoiceLatencySLOStage = 'assistant_text_to_tts_send' | 'barge_in_stop' | 'commit_to_assistant_text' | 'final_to_commit' | 'live_latency' | 'provider_llm' | 'provider_stt' | 'provider_tts' | 'speech_to_commit' | 'tts_send_duration' | 'tts_to_first_audio';
4
+ export type VoiceLatencySLOBudget = {
5
+ failAfterMs: number;
6
+ warnAfterMs?: number;
7
+ };
8
+ export type VoiceLatencySLOMeasurement = {
9
+ at: number;
10
+ latencyMs: number;
11
+ label: string;
12
+ provider?: string;
13
+ sessionId: string;
14
+ stage: VoiceLatencySLOStage;
15
+ status: Exclude<VoiceLatencySLOStatus, 'empty'>;
16
+ turnId?: string;
17
+ };
18
+ export type VoiceLatencySLOStageSummary = {
19
+ averageMs?: number;
20
+ budget: VoiceLatencySLOBudget;
21
+ failed: number;
22
+ label: string;
23
+ maxMs?: number;
24
+ measurements: VoiceLatencySLOMeasurement[];
25
+ p50Ms?: number;
26
+ p95Ms?: number;
27
+ stage: VoiceLatencySLOStage;
28
+ status: VoiceLatencySLOStatus;
29
+ total: number;
30
+ warnings: number;
31
+ };
32
+ export type VoiceLatencySLOGateReport = {
33
+ checkedAt: number;
34
+ failed: number;
35
+ measurements: VoiceLatencySLOMeasurement[];
36
+ stages: VoiceLatencySLOStageSummary[];
37
+ status: VoiceLatencySLOStatus;
38
+ total: number;
39
+ warnings: number;
40
+ };
41
+ export type VoiceLatencySLOGateOptions = {
42
+ budgets?: Partial<Record<VoiceLatencySLOStage, VoiceLatencySLOBudget>>;
43
+ events?: StoredVoiceTraceEvent[];
44
+ failAfterMs?: number;
45
+ limit?: number;
46
+ store?: VoiceTraceEventStore;
47
+ warnAfterMs?: number;
48
+ };
49
+ export type VoiceLatencySLOGateError = Error & {
50
+ report: VoiceLatencySLOGateReport;
51
+ };
52
+ export declare const buildVoiceLatencySLOGate: (options: VoiceLatencySLOGateOptions) => Promise<VoiceLatencySLOGateReport>;
53
+ export declare const assertVoiceLatencySLOGate: (options: VoiceLatencySLOGateOptions) => Promise<VoiceLatencySLOGateReport>;
54
+ export declare const renderVoiceLatencySLOMarkdown: (report: VoiceLatencySLOGateReport, options?: {
55
+ title?: string;
56
+ }) => string;
@@ -1,6 +1,8 @@
1
1
  import { Elysia } from 'elysia';
2
2
  import { type StoredVoiceAuditEvent, type VoiceAuditEventStore } from './audit';
3
+ import type { StoredVoiceIntegrationEvent, StoredVoiceOpsTask, VoiceIntegrationEventStore, VoiceOpsTaskStore } from './ops';
3
4
  import { type VoiceSessionReplay } from './sessionReplay';
5
+ import type { StoredVoiceCallReviewArtifact, VoiceCallReviewStore } from './testing/review';
4
6
  import { type VoiceTraceTimelineEvent, type VoiceTraceTimelineProviderSummary } from './traceTimeline';
5
7
  import { type StoredVoiceTraceEvent, type VoiceTraceEvaluationOptions, type VoiceTraceEventStore, type VoiceTraceRedactionConfig, type VoiceTraceSummary } from './trace';
6
8
  export type VoiceOperationsRecordStatus = 'failed' | 'healthy' | 'warning';
@@ -38,16 +40,41 @@ export type VoiceOperationsRecordAuditSummary = {
38
40
  success: number;
39
41
  total: number;
40
42
  };
43
+ export type VoiceOperationsRecordReviewSummary = {
44
+ failed: number;
45
+ reviews: StoredVoiceCallReviewArtifact[];
46
+ total: number;
47
+ };
48
+ export type VoiceOperationsRecordTaskSummary = {
49
+ done: number;
50
+ inProgress: number;
51
+ open: number;
52
+ overdue: number;
53
+ tasks: StoredVoiceOpsTask[];
54
+ total: number;
55
+ };
56
+ export type VoiceOperationsRecordIntegrationEventSummary = {
57
+ delivered: number;
58
+ events: StoredVoiceIntegrationEvent[];
59
+ failed: number;
60
+ pending: number;
61
+ sinkDeliveries: number;
62
+ skipped: number;
63
+ total: number;
64
+ };
41
65
  export type VoiceOperationsRecord = {
42
66
  audit?: VoiceOperationsRecordAuditSummary;
43
67
  checkedAt: number;
44
68
  handoffs: VoiceOperationsRecordAgentHandoff[];
69
+ integrationEvents?: VoiceOperationsRecordIntegrationEventSummary;
45
70
  outcome: VoiceOperationsRecordOutcome;
46
71
  providers: VoiceTraceTimelineProviderSummary[];
47
72
  replay: VoiceSessionReplay;
73
+ reviews?: VoiceOperationsRecordReviewSummary;
48
74
  sessionId: string;
49
75
  status: VoiceOperationsRecordStatus;
50
76
  summary: VoiceTraceSummary;
77
+ tasks?: VoiceOperationsRecordTaskSummary;
51
78
  timeline: VoiceTraceTimelineEvent[];
52
79
  tools: VoiceOperationsRecordTool[];
53
80
  traceEvents: StoredVoiceTraceEvent[];
@@ -56,9 +83,12 @@ export type VoiceOperationsRecordOptions = {
56
83
  audit?: VoiceAuditEventStore;
57
84
  evaluation?: VoiceTraceEvaluationOptions;
58
85
  events?: StoredVoiceTraceEvent[];
86
+ integrationEvents?: VoiceIntegrationEventStore;
59
87
  redact?: VoiceTraceRedactionConfig;
88
+ reviews?: VoiceCallReviewStore;
60
89
  sessionId: string;
61
90
  store?: VoiceTraceEventStore;
91
+ tasks?: VoiceOpsTaskStore;
62
92
  };
63
93
  export type VoiceOperationsRecordRoutesOptions = Omit<VoiceOperationsRecordOptions, 'sessionId'> & {
64
94
  headers?: HeadersInit;
@@ -12,6 +12,7 @@ import type { VoiceReconnectContractReport } from './reconnectContract';
12
12
  import type { VoiceAuditEventStore, VoiceAuditEventType, VoiceAuditOutcome } from './audit';
13
13
  import { type VoiceAuditSinkDeliveryStore } from './auditSinks';
14
14
  import type { VoiceProviderContractMatrixReport, VoiceProviderStackCapabilityGapReport } from './providerStackRecommendations';
15
+ import type { VoiceCampaignReadinessProofReport } from './campaign';
15
16
  export type VoiceProductionReadinessStatus = 'fail' | 'pass' | 'warn';
16
17
  export type VoiceProductionReadinessAction = {
17
18
  description?: string;
@@ -81,6 +82,7 @@ export type VoiceProductionReadinessReport = {
81
82
  audit?: string;
82
83
  auditDeliveries?: string;
83
84
  bargeIn?: string;
85
+ campaignReadiness?: string;
84
86
  carriers?: string;
85
87
  deliveryRuntime?: string;
86
88
  handoffs?: string;
@@ -117,6 +119,12 @@ export type VoiceProductionReadinessReport = {
117
119
  total: number;
118
120
  warnings: number;
119
121
  };
122
+ campaignReadiness?: {
123
+ failed: number;
124
+ passed: number;
125
+ status: VoiceProductionReadinessStatus;
126
+ total: number;
127
+ };
120
128
  carriers?: {
121
129
  failing: number;
122
130
  providers: number;
@@ -294,6 +302,10 @@ export type VoiceProductionReadinessRoutesOptions = {
294
302
  query: Record<string, unknown>;
295
303
  request: Request;
296
304
  }) => Promise<readonly VoiceTelephonyCarrierMatrixInput[]> | readonly VoiceTelephonyCarrierMatrixInput[]);
305
+ campaignReadiness?: false | VoiceCampaignReadinessProofReport | ((input: {
306
+ query: Record<string, unknown>;
307
+ request: Request;
308
+ }) => Promise<VoiceCampaignReadinessProofReport> | VoiceCampaignReadinessProofReport);
297
309
  deliveryRuntime?: false | VoiceDeliveryRuntime | VoiceDeliveryRuntimeSummary | ((input: {
298
310
  query: Record<string, unknown>;
299
311
  request: Request;
@@ -4,6 +4,7 @@ export type VoiceReadinessProfileOptions = {
4
4
  audit?: VoiceProductionReadinessAuditOptions;
5
5
  auditDeliveries?: VoiceProductionReadinessAuditDeliveryOptions;
6
6
  bargeInReports?: VoiceProductionReadinessRoutesOptions['bargeInReports'];
7
+ campaignReadiness?: VoiceProductionReadinessRoutesOptions['campaignReadiness'];
7
8
  carriers?: VoiceProductionReadinessRoutesOptions['carriers'];
8
9
  deliveryRuntime?: VoiceProductionReadinessRoutesOptions['deliveryRuntime'];
9
10
  explain?: boolean;
@@ -1621,6 +1621,8 @@ var renderTraceEventMarkdown = (event, startedAt) => {
1621
1621
  return event.payload.text ? `${label} assistant "${formatTraceValue(event.payload.text)}"` : `${label} ${formatTraceValue(event.payload.status)}`;
1622
1622
  case "agent.tool":
1623
1623
  return `${label} ${formatTraceValue(event.payload.toolName)} ${formatTraceValue(event.payload.status)}`;
1624
+ case "agent.context":
1625
+ return `${label} ${formatTraceValue(event.payload.fromAgentId)} -> ${formatTraceValue(event.payload.targetAgentId)} ${formatTraceValue(event.payload.status)}`;
1624
1626
  case "agent.handoff":
1625
1627
  return `${label} ${formatTraceValue(event.payload.fromAgentId)} -> ${formatTraceValue(event.payload.targetAgentId)}`;
1626
1628
  case "session.error":
package/dist/trace.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { S3Client, S3Options } from 'bun';
2
- export type VoiceTraceEventType = 'assistant.guardrail' | 'assistant.memory' | 'assistant.run' | 'agent.handoff' | 'agent.model' | 'agent.result' | 'agent.tool' | 'call.handoff' | 'call.lifecycle' | 'client.barge_in' | 'client.live_latency' | 'client.reconnect' | 'operator.action' | 'session.error' | 'turn.assistant' | 'turn.committed' | 'turn.cost' | 'turn_latency.stage' | 'turn.transcript' | 'workflow.contract';
2
+ export type VoiceTraceEventType = 'assistant.guardrail' | 'assistant.memory' | 'assistant.run' | 'agent.context' | 'agent.handoff' | 'agent.model' | 'agent.result' | 'agent.tool' | 'call.handoff' | 'call.lifecycle' | 'client.barge_in' | 'client.live_latency' | 'client.reconnect' | 'operator.action' | 'session.error' | 'turn.assistant' | 'turn.committed' | 'turn.cost' | 'turn_latency.stage' | 'turn.transcript' | 'workflow.contract';
3
3
  export type VoiceTraceEvent<TPayload extends Record<string, unknown> = Record<string, unknown>> = {
4
4
  at: number;
5
5
  id?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.192",
3
+ "version": "0.0.22-beta.194",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",