@absolutejs/voice 0.0.22-beta.377 → 0.0.22-beta.379
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 +6 -0
- package/dist/client/index.js +62 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +94 -0
- package/dist/productionReadiness.d.ts +17 -0
- package/dist/proofTrends.d.ts +14 -0
- package/dist/react/index.js +62 -0
- package/dist/vue/index.js +62 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1555,6 +1555,12 @@ additionalChecks: async () => [
|
|
|
1555
1555
|
];
|
|
1556
1556
|
```
|
|
1557
1557
|
|
|
1558
|
+
Use `buildVoiceReadinessRecoveryActions(...)` when a UI or API needs a compact plan of actions attached to failed or warning readiness checks:
|
|
1559
|
+
|
|
1560
|
+
```ts
|
|
1561
|
+
const recoveryPlan = buildVoiceReadinessRecoveryActions(readinessReport);
|
|
1562
|
+
```
|
|
1563
|
+
|
|
1558
1564
|
Use `createVoiceProfileTraceTagger(...)` when the app already has a trace store and needs every appended trace to carry a benchmark profile label. It wraps any `VoiceTraceEventStore`, preserves the underlying store behavior, and adds `profileId`/`benchmarkProfileId` metadata and payload fields that real-call profile history can ingest later.
|
|
1559
1565
|
|
|
1560
1566
|
```ts
|
package/dist/client/index.js
CHANGED
|
@@ -4237,6 +4237,68 @@ var buildVoiceRealCallProfileEvidenceFromTraceEvents = (events, options = {}) =>
|
|
|
4237
4237
|
}).filter((evidence) => evidence !== undefined);
|
|
4238
4238
|
};
|
|
4239
4239
|
var loadVoiceRealCallProfileEvidenceFromTraceStore = async (options) => buildVoiceRealCallProfileEvidenceFromTraceEvents(await options.store.list({ limit: options.limit ?? 5000 }), options);
|
|
4240
|
+
var realCallProfileTraceSignalTypes = new Set([
|
|
4241
|
+
"client.barge_in",
|
|
4242
|
+
"client.browser_media",
|
|
4243
|
+
"client.live_latency",
|
|
4244
|
+
"client.telephony_media",
|
|
4245
|
+
"provider.decision",
|
|
4246
|
+
"session.error",
|
|
4247
|
+
"turn_latency.stage"
|
|
4248
|
+
]);
|
|
4249
|
+
var hasTraceProfileMetadata = (event, options) => Boolean(readTraceProfileId([event], options));
|
|
4250
|
+
var mergeRealCallProfileCollectorOptions = (base, override = {}) => ({
|
|
4251
|
+
defaultProfileId: override.defaultProfileId ?? base.defaultProfileId,
|
|
4252
|
+
defaultProfileLabel: override.defaultProfileLabel ?? base.defaultProfileLabel,
|
|
4253
|
+
limit: override.limit ?? base.limit,
|
|
4254
|
+
maxProviderP95Ms: override.maxProviderP95Ms ?? base.maxProviderP95Ms,
|
|
4255
|
+
profileDescriptions: {
|
|
4256
|
+
...base.profileDescriptions ?? {},
|
|
4257
|
+
...override.profileDescriptions ?? {}
|
|
4258
|
+
},
|
|
4259
|
+
profileLabels: {
|
|
4260
|
+
...base.profileLabels ?? {},
|
|
4261
|
+
...override.profileLabels ?? {}
|
|
4262
|
+
},
|
|
4263
|
+
sessionIds: override.sessionIds ?? base.sessionIds
|
|
4264
|
+
});
|
|
4265
|
+
var createVoiceRealCallProfileTraceCollector = (options) => {
|
|
4266
|
+
const capturedSessionIds = new Set(options.sessionIds ?? []);
|
|
4267
|
+
const capture = (event) => {
|
|
4268
|
+
if (realCallProfileTraceSignalTypes.has(event.type) && hasTraceProfileMetadata(event, options)) {
|
|
4269
|
+
capturedSessionIds.add(event.sessionId);
|
|
4270
|
+
}
|
|
4271
|
+
};
|
|
4272
|
+
return {
|
|
4273
|
+
append: async (event) => {
|
|
4274
|
+
const stored = await options.store.append(event);
|
|
4275
|
+
capture(stored);
|
|
4276
|
+
return stored;
|
|
4277
|
+
},
|
|
4278
|
+
buildHistoryReport: async (historyOptions = {}) => {
|
|
4279
|
+
const evidence = await buildRealCallProfileCollectorEvidence(options, capturedSessionIds, historyOptions.evidenceOptions);
|
|
4280
|
+
return buildVoiceRealCallProfileHistoryReport({
|
|
4281
|
+
...historyOptions,
|
|
4282
|
+
evidence
|
|
4283
|
+
});
|
|
4284
|
+
},
|
|
4285
|
+
get: (id) => options.store.get(id),
|
|
4286
|
+
list: (filter) => options.store.list(filter),
|
|
4287
|
+
listCapturedSessionIds: () => [...capturedSessionIds],
|
|
4288
|
+
listEvidence: (evidenceOptions) => buildRealCallProfileCollectorEvidence(options, capturedSessionIds, evidenceOptions),
|
|
4289
|
+
remove: async (id) => {
|
|
4290
|
+
await options.store.remove(id);
|
|
4291
|
+
}
|
|
4292
|
+
};
|
|
4293
|
+
};
|
|
4294
|
+
var buildRealCallProfileCollectorEvidence = async (baseOptions, capturedSessionIds, evidenceOptions) => {
|
|
4295
|
+
const merged = mergeRealCallProfileCollectorOptions(baseOptions, evidenceOptions);
|
|
4296
|
+
const requestedSessionIds = merged.sessionIds ?? [...capturedSessionIds];
|
|
4297
|
+
return buildVoiceRealCallProfileEvidenceFromTraceEvents(await baseOptions.store.list({ limit: merged.limit ?? 5000 }), {
|
|
4298
|
+
...merged,
|
|
4299
|
+
sessionIds: requestedSessionIds
|
|
4300
|
+
});
|
|
4301
|
+
};
|
|
4240
4302
|
var readProofTrendProviders = (reports) => aggregateProofTrendProviders(reports.flatMap((report) => report.summary.providers && report.summary.providers.length > 0 ? report.summary.providers : report.cycles.flatMap((cycle) => cycle.providers ?? [])));
|
|
4241
4303
|
var exceedsProofTrendBudget = (value, budget) => value !== undefined && (!Number.isFinite(value) || value > budget);
|
|
4242
4304
|
var readProofTrendProfileStatus = (profile, budgets) => {
|
package/dist/index.d.ts
CHANGED
|
@@ -30,12 +30,12 @@ export { assertVoicePlatformCoverage, buildVoicePlatformCoverageSummary, createV
|
|
|
30
30
|
export { assertVoiceCompetitiveCoverage, buildVoiceCompetitiveCoverageReport, createVoiceCompetitiveCoverageRoutes, evaluateVoiceCompetitiveCoverage, renderVoiceCompetitiveCoverageHTML, renderVoiceCompetitiveCoverageMarkdown } from './competitiveCoverage';
|
|
31
31
|
export type { VoiceCompetitiveCoverageAssertionInput, VoiceCompetitiveCoverageAssertionReport, VoiceCompetitiveCoverageIssue, VoiceCompetitiveCoverageLevel, VoiceCompetitiveCoverageReport, VoiceCompetitiveCoverageReportInput, VoiceCompetitiveCoverageRoutesOptions, VoiceCompetitiveCoverageStatus, VoiceCompetitiveCoverageSummary, VoiceCompetitiveDepthLevel, VoiceCompetitiveEvidence, VoiceCompetitiveSurface } from './competitiveCoverage';
|
|
32
32
|
export type { VoicePlatformCoverageAssertionInput, VoicePlatformCoverageAssertionReport, VoicePlatformCoverageEvidence, VoicePlatformCoverageRoutesOptions, VoicePlatformCoverageStatus, VoicePlatformCoverageSummary, VoicePlatformCoverageSummaryInput, VoicePlatformCoverageSurface } from './platformCoverage';
|
|
33
|
-
export { assertVoiceProofTrendEvidence, buildEmptyVoiceProofTrendReport, buildVoiceProofTrendProfileSummaries, buildVoiceProofTrendRecommendationReport, buildVoiceProofTrendReportFromRealCallProfiles, buildVoiceProofTrendReport, buildVoiceRealCallProfileEvidenceFromTraceEvents, buildVoiceRealCallProfileDefaults, buildVoiceRealCallProfileHistoryReport, buildVoiceRealCallProfileReadinessCheck, buildVoiceRealCallProfileRecoveryJobHistoryCheck, buildVoiceRealCallProfileRecoveryActions, createVoiceInMemoryRealCallProfileRecoveryJobStore, createVoiceSQLiteRealCallProfileRecoveryJobStore, createVoiceProofTrendRecommendationRoutes, createVoiceProofTrendRoutes, createVoiceRealCallProfileHistoryRoutes, createVoiceRealCallProfileRecoveryActionRoutes, DEFAULT_VOICE_PROOF_TREND_PROFILE_DEFINITIONS, DEFAULT_VOICE_PROOF_TRENDS_MAX_AGE_MS, evaluateVoiceProofTrendEvidence, formatVoiceProofTrendAge, loadVoiceRealCallProfileEvidenceFromTraceStore, normalizeVoiceProofTrendReport, readVoiceProofTrendReportFile, renderVoiceProofTrendRecommendationHTML, renderVoiceProofTrendRecommendationMarkdown, renderVoiceRealCallProfileHistoryHTML, renderVoiceRealCallProfileHistoryMarkdown, resolveVoiceRealCallProfileProviderRoute } from './proofTrends';
|
|
33
|
+
export { assertVoiceProofTrendEvidence, buildEmptyVoiceProofTrendReport, buildVoiceProofTrendProfileSummaries, buildVoiceProofTrendRecommendationReport, buildVoiceProofTrendReportFromRealCallProfiles, buildVoiceProofTrendReport, buildVoiceRealCallProfileEvidenceFromTraceEvents, buildVoiceRealCallProfileDefaults, buildVoiceRealCallProfileHistoryReport, buildVoiceRealCallProfileReadinessCheck, buildVoiceRealCallProfileRecoveryJobHistoryCheck, buildVoiceRealCallProfileRecoveryActions, createVoiceInMemoryRealCallProfileRecoveryJobStore, createVoiceRealCallProfileTraceCollector, createVoiceSQLiteRealCallProfileRecoveryJobStore, createVoiceProofTrendRecommendationRoutes, createVoiceProofTrendRoutes, createVoiceRealCallProfileHistoryRoutes, createVoiceRealCallProfileRecoveryActionRoutes, DEFAULT_VOICE_PROOF_TREND_PROFILE_DEFINITIONS, DEFAULT_VOICE_PROOF_TRENDS_MAX_AGE_MS, evaluateVoiceProofTrendEvidence, formatVoiceProofTrendAge, loadVoiceRealCallProfileEvidenceFromTraceStore, normalizeVoiceProofTrendReport, readVoiceProofTrendReportFile, renderVoiceProofTrendRecommendationHTML, renderVoiceProofTrendRecommendationMarkdown, renderVoiceRealCallProfileHistoryHTML, renderVoiceRealCallProfileHistoryMarkdown, resolveVoiceRealCallProfileProviderRoute } from './proofTrends';
|
|
34
34
|
export { applyVoiceProfileSwitchGuard, buildVoiceProfileSwitchReadinessReport, buildVoiceProfileSwitchLiveDecisionReport, createVoiceProfileSwitchLiveDecisionRoutes, createVoiceProfileSwitchPolicyProofRoutes, createVoiceProfileSwitchReadinessRoutes, recommendVoiceProfileSwitch, renderVoiceProfileSwitchLiveDecisionHTML, renderVoiceProfileSwitchPolicyProofHTML, renderVoiceProfileSwitchReadinessHTML, runVoiceProfileSwitchPolicyProof } from './profileSwitchRecommendation';
|
|
35
35
|
export type { VoiceProfileSwitchGuardAction, VoiceProfileSwitchGuardDecision, VoiceProfileSwitchGuardMode, VoiceProfileSwitchGuardOptions, VoiceProfileSwitchObservedSignals, VoiceProfileSwitchLiveDecisionEvidence, VoiceProfileSwitchLiveDecisionReport, VoiceProfileSwitchLiveDecisionReportOptions, VoiceProfileSwitchLiveDecisionRoutesOptions, VoiceProfileSwitchLiveDecisionSession, VoiceProfileSwitchPolicyProofCase, VoiceProfileSwitchPolicyProofCaseResult, VoiceProfileSwitchPolicyProofOptions, VoiceProfileSwitchPolicyProofReport, VoiceProfileSwitchPolicyProofRoutesOptions, VoiceProfileSwitchReadinessIssue, VoiceProfileSwitchReadinessOptions, VoiceProfileSwitchReadinessReport, VoiceProfileSwitchReadinessRoutesOptions, VoiceProfileSwitchReadinessStatus, VoiceProfileSwitchRecommendation, VoiceProfileSwitchRecommendationOptions } from './profileSwitchRecommendation';
|
|
36
36
|
export { buildVoiceProviderDecisionTraceReport, createVoiceProviderDecisionTraceEvent, createVoiceProviderDecisionTraceRoutes, listVoiceProviderDecisionTraces, renderVoiceProviderDecisionTraceHTML, renderVoiceProviderDecisionTraceMarkdown } from './providerDecisionTraces';
|
|
37
37
|
export type { VoiceProviderDecisionStatus, VoiceProviderDecisionSurfaceReport, VoiceProviderDecisionTrace, VoiceProviderDecisionTraceInput, VoiceProviderDecisionTraceIssue, VoiceProviderDecisionTraceReport, VoiceProviderDecisionTraceReportOptions, VoiceProviderDecisionTraceRoutesOptions } from './providerDecisionTraces';
|
|
38
|
-
export type { VoiceProofTrendAssertionInput, VoiceProofTrendAssertionReport, VoiceProofTrendCycle, VoiceProofTrendProfileDefinition, VoiceProofTrendProfileRecommendation, VoiceProofTrendProfileSummaryOptions, VoiceProofTrendProfileSummary, VoiceProofTrendProviderRecommendation, VoiceProofTrendProviderSummary, VoiceProofTrendRecommendation, VoiceProofTrendRecommendationOptions, VoiceProofTrendRecommendationReport, VoiceProofTrendRecommendationRoutesOptions, VoiceProofTrendRecommendationStatus, VoiceProofTrendRecommendationSurface, VoiceProofTrendRealCallProfileEvidence, VoiceProofTrendRealCallProfileReportOptions, VoiceProofTrendReport, VoiceProofTrendReportInput, VoiceProofTrendRoutesOptions, VoiceProofTrendRuntimeChannelSummary, VoiceProofTrendStatus, VoiceProofTrendSummary, VoiceRealCallProfileDefault, VoiceRealCallProfileDefaultsOptions, VoiceRealCallProfileDefaultsReport, VoiceRealCallProfileHistoryOptions, VoiceRealCallProfileHistoryReport, VoiceRealCallProfileHistoryRoutesOptions, VoiceRealCallProfileProviderRouteOptions, VoiceRealCallProfileReadinessCheckOptions, VoiceRealCallProfileRecoveryActionOptions, VoiceRealCallProfileRecoveryAction, VoiceRealCallProfileRecoveryActionHandler, VoiceRealCallProfileRecoveryActionHandlerInput, VoiceRealCallProfileRecoveryActionId, VoiceRealCallProfileRecoveryJobHistoryCheckOptions, VoiceRealCallProfileRecoveryActionResult, VoiceRealCallProfileRecoveryActionRoutesOptions, VoiceRealCallProfileRecoveryJob, VoiceRealCallProfileRecoveryJobCreateInput, VoiceRealCallProfileRecoveryJobListOptions, VoiceRealCallProfileRecoveryJobStatus, VoiceRealCallProfileRecoveryJobStore, VoiceRealCallProfileRecoveryJobUpdate, VoiceSQLiteRealCallProfileRecoveryJobStoreOptions, VoiceRealCallProfileTraceEvidenceOptions, VoiceRealCallProfileTraceStoreEvidenceOptions } from './proofTrends';
|
|
38
|
+
export type { VoiceProofTrendAssertionInput, VoiceProofTrendAssertionReport, VoiceProofTrendCycle, VoiceProofTrendProfileDefinition, VoiceProofTrendProfileRecommendation, VoiceProofTrendProfileSummaryOptions, VoiceProofTrendProfileSummary, VoiceProofTrendProviderRecommendation, VoiceProofTrendProviderSummary, VoiceProofTrendRecommendation, VoiceProofTrendRecommendationOptions, VoiceProofTrendRecommendationReport, VoiceProofTrendRecommendationRoutesOptions, VoiceProofTrendRecommendationStatus, VoiceProofTrendRecommendationSurface, VoiceProofTrendRealCallProfileEvidence, VoiceProofTrendRealCallProfileReportOptions, VoiceProofTrendReport, VoiceProofTrendReportInput, VoiceProofTrendRoutesOptions, VoiceProofTrendRuntimeChannelSummary, VoiceProofTrendStatus, VoiceProofTrendSummary, VoiceRealCallProfileDefault, VoiceRealCallProfileDefaultsOptions, VoiceRealCallProfileDefaultsReport, VoiceRealCallProfileHistoryOptions, VoiceRealCallProfileHistoryReport, VoiceRealCallProfileHistoryRoutesOptions, VoiceRealCallProfileProviderRouteOptions, VoiceRealCallProfileReadinessCheckOptions, VoiceRealCallProfileRecoveryActionOptions, VoiceRealCallProfileRecoveryAction, VoiceRealCallProfileRecoveryActionHandler, VoiceRealCallProfileRecoveryActionHandlerInput, VoiceRealCallProfileRecoveryActionId, VoiceRealCallProfileRecoveryJobHistoryCheckOptions, VoiceRealCallProfileRecoveryActionResult, VoiceRealCallProfileRecoveryActionRoutesOptions, VoiceRealCallProfileRecoveryJob, VoiceRealCallProfileRecoveryJobCreateInput, VoiceRealCallProfileRecoveryJobListOptions, VoiceRealCallProfileRecoveryJobStatus, VoiceRealCallProfileRecoveryJobStore, VoiceRealCallProfileRecoveryJobUpdate, VoiceSQLiteRealCallProfileRecoveryJobStoreOptions, VoiceRealCallProfileTraceCollector, VoiceRealCallProfileTraceCollectorEvidenceOptions, VoiceRealCallProfileTraceCollectorOptions, VoiceRealCallProfileTraceEvidenceOptions, VoiceRealCallProfileTraceStoreEvidenceOptions } from './proofTrends';
|
|
39
39
|
export { assertVoiceSloCalibration, buildVoiceSloCalibrationReport, buildVoiceSloReadinessThresholdReport, createVoiceSloReadinessThresholdOptions, createVoiceSloReadinessThresholdRoutes, createVoiceSloThresholdProfile, createVoiceSloCalibrationRoutes, renderVoiceSloCalibrationMarkdown, renderVoiceSloReadinessThresholdHTML, renderVoiceSloReadinessThresholdMarkdown } from './sloCalibration';
|
|
40
40
|
export type { VoiceSloCalibrationMetricKey, VoiceSloCalibrationOptions, VoiceSloCalibrationReport, VoiceSloCalibrationRoutesOptions, VoiceSloCalibrationSample, VoiceSloCalibrationStatus, VoiceSloCalibrationThreshold, VoiceSloCalibrationThresholds, VoiceSloReadinessThresholdReport, VoiceSloReadinessThresholdReportOptions, VoiceSloReadinessThresholdOptions, VoiceSloReadinessThresholdRoutesOptions, VoiceSloThresholdProfile } from './sloCalibration';
|
|
41
41
|
export { assertVoiceLiveOpsControlEvidence, assertVoiceLiveOpsEvidence, buildVoiceLiveOpsControlState, createVoiceLiveOpsController, createVoiceLiveOpsRoutes, createVoiceMemoryLiveOpsControlStore, evaluateVoiceLiveOpsControlEvidence, evaluateVoiceLiveOpsEvidence, getVoiceLiveOpsControlStatus, VOICE_LIVE_OPS_ACTIONS } from './liveOps';
|
|
@@ -72,7 +72,7 @@ export { buildVoiceProviderOrchestrationReport, createVoiceProviderOrchestration
|
|
|
72
72
|
export { assertVoiceProviderRoutingContractEvidence, assertVoiceProviderRoutingContract, evaluateVoiceProviderRoutingContractEvidence, runVoiceProviderRoutingContract } from './providerRoutingContract';
|
|
73
73
|
export { assertVoiceProviderSloEvidence, buildVoiceProviderSloReport, createVoiceProviderSloRoutes, evaluateVoiceProviderSloEvidence, renderVoiceProviderSloHTML, renderVoiceProviderSloMarkdown } from './providerSlo';
|
|
74
74
|
export { createVoicePhoneAgentProductionSmokeHTMLHandler, createVoicePhoneAgentProductionSmokeJSONHandler, createVoicePhoneAgentProductionSmokeRoutes, renderVoicePhoneAgentProductionSmokeHTML, runVoicePhoneAgentProductionSmokeContract } from './phoneAgentProductionSmoke';
|
|
75
|
-
export { assertVoiceProductionReadinessEvidence, buildVoiceProductionReadinessGate, buildVoiceProductionReadinessReport, createVoiceProductionReadinessProofRuntime, createVoiceProductionReadinessRoutes, evaluateVoiceProductionReadinessEvidence, renderVoiceProductionReadinessHTML, summarizeVoiceProductionReadinessGate } from './productionReadiness';
|
|
75
|
+
export { assertVoiceProductionReadinessEvidence, buildVoiceProductionReadinessGate, buildVoiceProductionReadinessReport, buildVoiceReadinessRecoveryActions, createVoiceProductionReadinessProofRuntime, createVoiceProductionReadinessRoutes, evaluateVoiceProductionReadinessEvidence, renderVoiceProductionReadinessHTML, summarizeVoiceProductionReadinessGate } from './productionReadiness';
|
|
76
76
|
export { acknowledgeVoiceMonitorIssue, buildVoiceMonitorRunReport, createVoiceMemoryMonitorIssueStore, createVoiceMemoryMonitorNotifierDeliveryReceiptStore, createVoiceMonitorRoutes, createVoiceMonitorRunner, createVoiceMonitorRunnerRoutes, createVoiceMonitorWebhookNotifier, deliverVoiceMonitorIssueNotifications, muteVoiceMonitorIssue, renderVoiceMonitorHTML, renderVoiceMonitorMarkdown, resolveVoiceMonitorIssue } from './voiceMonitoring';
|
|
77
77
|
export { createVoiceReadinessProfile, recommendVoiceReadinessProfile } from './readinessProfiles';
|
|
78
78
|
export { assertVoiceProviderContractMatrixEvidence, assertVoiceProviderStackEvidence, buildVoiceProviderContractMatrix, createVoiceProviderContractMatrixHTMLHandler, createVoiceProviderContractMatrixJSONHandler, createVoiceProviderContractMatrixPreset, createVoiceProviderContractMatrixRoutes, evaluateVoiceProviderContractMatrixEvidence, evaluateVoiceProviderStackEvidence, evaluateVoiceProviderStackGaps, renderVoiceProviderContractMatrixHTML, recommendVoiceProviderStack } from './providerStackRecommendations';
|
|
@@ -142,7 +142,7 @@ export type { VoicePhoneAgentCarrier, VoicePhoneAgentCarrierSummary, VoicePhoneA
|
|
|
142
142
|
export type { VoicePhoneAgentProductionSmokeIssue, VoicePhoneAgentProductionSmokeHandlerOptions, VoicePhoneAgentProductionSmokeHTMLHandlerOptions, VoicePhoneAgentProductionSmokeOptions, VoicePhoneAgentProductionSmokeReport, VoicePhoneAgentProductionSmokeRoutesOptions, VoicePhoneAgentProductionSmokeRequirement } from './phoneAgentProductionSmoke';
|
|
143
143
|
export type { VoiceOpsConsoleLink, VoiceOpsConsoleReport, VoiceOpsConsoleRoutesOptions } from './opsConsoleRoutes';
|
|
144
144
|
export type { VoiceOpsStatus, VoiceOpsStatusLink, VoiceOpsStatusOptions, VoiceOpsStatusReport, VoiceOpsStatusRoutesOptions } from './opsStatus';
|
|
145
|
-
export type { VoiceProductionReadinessAction, VoiceProductionReadinessAuditOptions, VoiceProductionReadinessAuditRequirement, VoiceProductionReadinessAuditSummary, VoiceProductionReadinessAssertionInput, VoiceProductionReadinessAssertionReport, VoiceProductionReadinessCheck, VoiceProductionReadinessGateExplanation, VoiceProductionReadinessGateIssue, VoiceProductionReadinessGateOptions, VoiceProductionReadinessGateProfile, VoiceProductionReadinessGateProfileSurface, VoiceProductionReadinessGateReport, VoiceProductionReadinessOpsActionHistoryOptions, VoiceProductionReadinessOpsActionHistorySummary, VoiceProductionReadinessOperationsRecordLink, VoiceProductionReadinessOperationsRecordLinks, VoiceProductionReadinessProfileExplanation, VoiceProductionReadinessProfileSurface, VoiceProductionReadinessProofMetadata, VoiceProductionReadinessProofRuntime, VoiceProductionReadinessProofRuntimeOptions, VoiceProductionReadinessProofRuntimeSeedOptions, VoiceProductionReadinessProofSource, VoiceProductionReadinessReport, VoiceProductionReadinessRouteInput, VoiceProductionReadinessRoutesOptions, VoiceProductionReadinessTraceDeliverySummary, VoiceProductionReadinessAuditDeliveryOptions, VoiceProductionReadinessAuditDeliverySummary, VoiceProductionReadinessTraceDeliveryOptions, VoiceProductionReadinessStatus } from './productionReadiness';
|
|
145
|
+
export type { VoiceProductionReadinessAction, VoiceProductionReadinessAuditOptions, VoiceProductionReadinessAuditRequirement, VoiceProductionReadinessAuditSummary, VoiceProductionReadinessAssertionInput, VoiceProductionReadinessAssertionReport, VoiceProductionReadinessCheck, VoiceProductionReadinessGateExplanation, VoiceProductionReadinessGateIssue, VoiceProductionReadinessGateOptions, VoiceProductionReadinessGateProfile, VoiceProductionReadinessGateProfileSurface, VoiceProductionReadinessGateReport, VoiceProductionReadinessOpsActionHistoryOptions, VoiceProductionReadinessOpsActionHistorySummary, VoiceProductionReadinessOperationsRecordLink, VoiceProductionReadinessOperationsRecordLinks, VoiceProductionReadinessProfileExplanation, VoiceProductionReadinessProfileSurface, VoiceProductionReadinessProofMetadata, VoiceProductionReadinessProofRuntime, VoiceProductionReadinessProofRuntimeOptions, VoiceProductionReadinessProofRuntimeSeedOptions, VoiceProductionReadinessProofSource, VoiceProductionReadinessReport, VoiceProductionReadinessRouteInput, VoiceProductionReadinessRoutesOptions, VoiceProductionReadinessTraceDeliverySummary, VoiceReadinessRecoveryAction, VoiceReadinessRecoveryActionOptions, VoiceReadinessRecoveryActionPlan, VoiceProductionReadinessAuditDeliveryOptions, VoiceProductionReadinessAuditDeliverySummary, VoiceProductionReadinessTraceDeliveryOptions, VoiceProductionReadinessStatus } from './productionReadiness';
|
|
146
146
|
export type { VoiceMonitorDefinition, VoiceMonitorEvaluation, VoiceMonitorEvaluationInput, VoiceMonitorIssue, VoiceMonitorIssueStatus, VoiceMonitorIssueStore, VoiceMonitorNotifier, VoiceMonitorNotifierDeliveryInput, VoiceMonitorNotifierDeliveryOptions, VoiceMonitorNotifierDeliveryReceipt, VoiceMonitorNotifierDeliveryReceiptStore, VoiceMonitorNotifierDeliveryReport, VoiceMonitorNotifierDeliveryResult, VoiceMonitorRoutesOptions, VoiceMonitorRun, VoiceMonitorRunOptions, VoiceMonitorRunReport, VoiceMonitorRunner, VoiceMonitorRunnerOptions, VoiceMonitorRunnerRoutesOptions, VoiceMonitorRunnerTickResult, VoiceMonitorSeverity, VoiceMonitorStatus, VoiceMonitorWebhookNotifierOptions } from './voiceMonitoring';
|
|
147
147
|
export type { VoiceReadinessProfileName, VoiceReadinessProfileOptions, VoiceReadinessProfileRecommendation, VoiceReadinessProfileRecommendationScore, VoiceReadinessProfileRoutesOptions } from './readinessProfiles';
|
|
148
148
|
export type { VoiceProviderStackChoice, VoiceProviderStackCapabilities, VoiceProviderStackCapabilityGap, VoiceProviderStackCapabilityGapInput, VoiceProviderStackCapabilityGapReport, VoiceProviderContractCheck, VoiceProviderContractCheckStatus, VoiceProviderContractDefinition, VoiceProviderContractMatrixAssertionInput, VoiceProviderContractMatrixAssertionReport, VoiceProviderContractMatrixHandlerOptions, VoiceProviderContractMatrixHTMLHandlerOptions, VoiceProviderContractMatrixInput, VoiceProviderContractMatrixPresetOptions, VoiceProviderContractMatrixReport, VoiceProviderContractMatrixRoutesOptions, VoiceProviderContractMatrixRow, VoiceProviderStackAssertionInput, VoiceProviderStackAssertionReport, VoiceProviderStackInput, VoiceProviderStackKind, VoiceProviderStackRecommendation } from './providerStackRecommendations';
|
package/dist/index.js
CHANGED
|
@@ -15706,6 +15706,68 @@ var buildVoiceRealCallProfileEvidenceFromTraceEvents = (events, options = {}) =>
|
|
|
15706
15706
|
}).filter((evidence) => evidence !== undefined);
|
|
15707
15707
|
};
|
|
15708
15708
|
var loadVoiceRealCallProfileEvidenceFromTraceStore = async (options) => buildVoiceRealCallProfileEvidenceFromTraceEvents(await options.store.list({ limit: options.limit ?? 5000 }), options);
|
|
15709
|
+
var realCallProfileTraceSignalTypes = new Set([
|
|
15710
|
+
"client.barge_in",
|
|
15711
|
+
"client.browser_media",
|
|
15712
|
+
"client.live_latency",
|
|
15713
|
+
"client.telephony_media",
|
|
15714
|
+
"provider.decision",
|
|
15715
|
+
"session.error",
|
|
15716
|
+
"turn_latency.stage"
|
|
15717
|
+
]);
|
|
15718
|
+
var hasTraceProfileMetadata = (event, options) => Boolean(readTraceProfileId([event], options));
|
|
15719
|
+
var mergeRealCallProfileCollectorOptions = (base, override = {}) => ({
|
|
15720
|
+
defaultProfileId: override.defaultProfileId ?? base.defaultProfileId,
|
|
15721
|
+
defaultProfileLabel: override.defaultProfileLabel ?? base.defaultProfileLabel,
|
|
15722
|
+
limit: override.limit ?? base.limit,
|
|
15723
|
+
maxProviderP95Ms: override.maxProviderP95Ms ?? base.maxProviderP95Ms,
|
|
15724
|
+
profileDescriptions: {
|
|
15725
|
+
...base.profileDescriptions ?? {},
|
|
15726
|
+
...override.profileDescriptions ?? {}
|
|
15727
|
+
},
|
|
15728
|
+
profileLabels: {
|
|
15729
|
+
...base.profileLabels ?? {},
|
|
15730
|
+
...override.profileLabels ?? {}
|
|
15731
|
+
},
|
|
15732
|
+
sessionIds: override.sessionIds ?? base.sessionIds
|
|
15733
|
+
});
|
|
15734
|
+
var createVoiceRealCallProfileTraceCollector = (options) => {
|
|
15735
|
+
const capturedSessionIds = new Set(options.sessionIds ?? []);
|
|
15736
|
+
const capture = (event) => {
|
|
15737
|
+
if (realCallProfileTraceSignalTypes.has(event.type) && hasTraceProfileMetadata(event, options)) {
|
|
15738
|
+
capturedSessionIds.add(event.sessionId);
|
|
15739
|
+
}
|
|
15740
|
+
};
|
|
15741
|
+
return {
|
|
15742
|
+
append: async (event) => {
|
|
15743
|
+
const stored = await options.store.append(event);
|
|
15744
|
+
capture(stored);
|
|
15745
|
+
return stored;
|
|
15746
|
+
},
|
|
15747
|
+
buildHistoryReport: async (historyOptions = {}) => {
|
|
15748
|
+
const evidence = await buildRealCallProfileCollectorEvidence(options, capturedSessionIds, historyOptions.evidenceOptions);
|
|
15749
|
+
return buildVoiceRealCallProfileHistoryReport({
|
|
15750
|
+
...historyOptions,
|
|
15751
|
+
evidence
|
|
15752
|
+
});
|
|
15753
|
+
},
|
|
15754
|
+
get: (id) => options.store.get(id),
|
|
15755
|
+
list: (filter) => options.store.list(filter),
|
|
15756
|
+
listCapturedSessionIds: () => [...capturedSessionIds],
|
|
15757
|
+
listEvidence: (evidenceOptions) => buildRealCallProfileCollectorEvidence(options, capturedSessionIds, evidenceOptions),
|
|
15758
|
+
remove: async (id) => {
|
|
15759
|
+
await options.store.remove(id);
|
|
15760
|
+
}
|
|
15761
|
+
};
|
|
15762
|
+
};
|
|
15763
|
+
var buildRealCallProfileCollectorEvidence = async (baseOptions, capturedSessionIds, evidenceOptions) => {
|
|
15764
|
+
const merged = mergeRealCallProfileCollectorOptions(baseOptions, evidenceOptions);
|
|
15765
|
+
const requestedSessionIds = merged.sessionIds ?? [...capturedSessionIds];
|
|
15766
|
+
return buildVoiceRealCallProfileEvidenceFromTraceEvents(await baseOptions.store.list({ limit: merged.limit ?? 5000 }), {
|
|
15767
|
+
...merged,
|
|
15768
|
+
sessionIds: requestedSessionIds
|
|
15769
|
+
});
|
|
15770
|
+
};
|
|
15709
15771
|
var readProofTrendProviders = (reports) => aggregateProofTrendProviders(reports.flatMap((report) => report.summary.providers && report.summary.providers.length > 0 ? report.summary.providers : report.cycles.flatMap((cycle) => cycle.providers ?? [])));
|
|
15710
15772
|
var exceedsProofTrendBudget = (value, budget) => value !== undefined && (!Number.isFinite(value) || value > budget);
|
|
15711
15773
|
var readProofTrendProfileStatus = (profile, budgets) => {
|
|
@@ -32553,6 +32615,36 @@ var createVoiceObservabilityExportRoutes = (options = {}) => {
|
|
|
32553
32615
|
};
|
|
32554
32616
|
|
|
32555
32617
|
// src/productionReadiness.ts
|
|
32618
|
+
var buildVoiceReadinessRecoveryActions = (input, options = {}) => {
|
|
32619
|
+
const checks = "checks" in input ? input.checks : input;
|
|
32620
|
+
const includeWarnings = options.includeWarnings ?? true;
|
|
32621
|
+
const sourceChecks = checks.filter((check) => check.status === "fail" || includeWarnings && check.status === "warn");
|
|
32622
|
+
const seen = new Set;
|
|
32623
|
+
const actions = sourceChecks.flatMap((check) => (check.actions ?? []).flatMap((action) => {
|
|
32624
|
+
const method = action.method ?? "GET";
|
|
32625
|
+
const key = `${method}:${action.href}:${check.label}`;
|
|
32626
|
+
if (seen.has(key)) {
|
|
32627
|
+
return [];
|
|
32628
|
+
}
|
|
32629
|
+
seen.add(key);
|
|
32630
|
+
return [
|
|
32631
|
+
{
|
|
32632
|
+
...action,
|
|
32633
|
+
key,
|
|
32634
|
+
method,
|
|
32635
|
+
sourceCheckDetail: check.detail,
|
|
32636
|
+
sourceCheckHref: check.href,
|
|
32637
|
+
sourceCheckLabel: check.label,
|
|
32638
|
+
sourceStatus: check.status
|
|
32639
|
+
}
|
|
32640
|
+
];
|
|
32641
|
+
}));
|
|
32642
|
+
return {
|
|
32643
|
+
actions,
|
|
32644
|
+
generatedAt: (options.now ?? (() => new Date))().toISOString(),
|
|
32645
|
+
sourceChecks: sourceChecks.length
|
|
32646
|
+
};
|
|
32647
|
+
};
|
|
32556
32648
|
var escapeHtml52 = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
32557
32649
|
var formatVoiceProofFreshnessDuration = (valueMs) => {
|
|
32558
32650
|
if (valueMs < 1000) {
|
|
@@ -39144,6 +39236,7 @@ export {
|
|
|
39144
39236
|
createVoiceRealtimeProviderContractRoutes,
|
|
39145
39237
|
createVoiceRealtimeProviderContractMatrixPreset,
|
|
39146
39238
|
createVoiceRealtimeChannelRoutes,
|
|
39239
|
+
createVoiceRealCallProfileTraceCollector,
|
|
39147
39240
|
createVoiceRealCallProfileRecoveryActionRoutes,
|
|
39148
39241
|
createVoiceRealCallProfileHistoryRoutes,
|
|
39149
39242
|
createVoiceReadinessProfile,
|
|
@@ -39368,6 +39461,7 @@ export {
|
|
|
39368
39461
|
buildVoiceRealCallProfileHistoryReport,
|
|
39369
39462
|
buildVoiceRealCallProfileEvidenceFromTraceEvents,
|
|
39370
39463
|
buildVoiceRealCallProfileDefaults,
|
|
39464
|
+
buildVoiceReadinessRecoveryActions,
|
|
39371
39465
|
buildVoiceProviderSloReport,
|
|
39372
39466
|
buildVoiceProviderOrchestrationReport,
|
|
39373
39467
|
buildVoiceProviderDecisionTraceReport,
|
|
@@ -56,6 +56,22 @@ export type VoiceProductionReadinessCheck = {
|
|
|
56
56
|
status: VoiceProductionReadinessStatus;
|
|
57
57
|
value?: number | string;
|
|
58
58
|
};
|
|
59
|
+
export type VoiceReadinessRecoveryAction = VoiceProductionReadinessAction & {
|
|
60
|
+
key: string;
|
|
61
|
+
sourceCheckDetail?: string;
|
|
62
|
+
sourceCheckHref?: string;
|
|
63
|
+
sourceCheckLabel: string;
|
|
64
|
+
sourceStatus: Exclude<VoiceProductionReadinessStatus, 'pass'>;
|
|
65
|
+
};
|
|
66
|
+
export type VoiceReadinessRecoveryActionPlan = {
|
|
67
|
+
actions: VoiceReadinessRecoveryAction[];
|
|
68
|
+
generatedAt: string;
|
|
69
|
+
sourceChecks: number;
|
|
70
|
+
};
|
|
71
|
+
export type VoiceReadinessRecoveryActionOptions = {
|
|
72
|
+
includeWarnings?: boolean;
|
|
73
|
+
now?: () => Date;
|
|
74
|
+
};
|
|
59
75
|
export type VoiceProductionReadinessGateIssue = {
|
|
60
76
|
code: string;
|
|
61
77
|
detail?: string;
|
|
@@ -67,6 +83,7 @@ export type VoiceProductionReadinessGateIssue = {
|
|
|
67
83
|
export type VoiceProductionReadinessGateOptions = {
|
|
68
84
|
failOnWarnings?: boolean;
|
|
69
85
|
};
|
|
86
|
+
export declare const buildVoiceReadinessRecoveryActions: (input: VoiceProductionReadinessReport | readonly VoiceProductionReadinessCheck[], options?: VoiceReadinessRecoveryActionOptions) => VoiceReadinessRecoveryActionPlan;
|
|
70
87
|
export type VoiceProductionReadinessGateReport = {
|
|
71
88
|
checkedAt: number;
|
|
72
89
|
failures: VoiceProductionReadinessGateIssue[];
|
package/dist/proofTrends.d.ts
CHANGED
|
@@ -149,6 +149,19 @@ export type VoiceRealCallProfileTraceStoreEvidenceOptions = VoiceRealCallProfile
|
|
|
149
149
|
limit?: number;
|
|
150
150
|
store: VoiceTraceEventStore;
|
|
151
151
|
};
|
|
152
|
+
export type VoiceRealCallProfileTraceCollectorEvidenceOptions = VoiceRealCallProfileTraceEvidenceOptions & {
|
|
153
|
+
limit?: number;
|
|
154
|
+
};
|
|
155
|
+
export type VoiceRealCallProfileTraceCollectorOptions<TEvent extends StoredVoiceTraceEvent = StoredVoiceTraceEvent> = VoiceRealCallProfileTraceCollectorEvidenceOptions & {
|
|
156
|
+
store: VoiceTraceEventStore<TEvent>;
|
|
157
|
+
};
|
|
158
|
+
export type VoiceRealCallProfileTraceCollector<TEvent extends StoredVoiceTraceEvent = StoredVoiceTraceEvent> = VoiceTraceEventStore<TEvent> & {
|
|
159
|
+
buildHistoryReport: (options?: Omit<VoiceRealCallProfileHistoryOptions, 'evidence'> & {
|
|
160
|
+
evidenceOptions?: VoiceRealCallProfileTraceCollectorEvidenceOptions;
|
|
161
|
+
}) => Promise<VoiceRealCallProfileHistoryReport>;
|
|
162
|
+
listCapturedSessionIds: () => string[];
|
|
163
|
+
listEvidence: (options?: VoiceRealCallProfileTraceCollectorEvidenceOptions) => Promise<VoiceProofTrendRealCallProfileEvidence[]>;
|
|
164
|
+
};
|
|
152
165
|
export type VoiceProofTrendRealCallProfileReportOptions = VoiceProofTrendProfileSummaryOptions & {
|
|
153
166
|
baseUrl?: string;
|
|
154
167
|
evidence: readonly VoiceProofTrendRealCallProfileEvidence[];
|
|
@@ -477,6 +490,7 @@ export declare const readVoiceProofTrendReportFile: (path: string, options?: {
|
|
|
477
490
|
}) => Promise<VoiceProofTrendReport>;
|
|
478
491
|
export declare const buildVoiceRealCallProfileEvidenceFromTraceEvents: (events: readonly StoredVoiceTraceEvent[], options?: VoiceRealCallProfileTraceEvidenceOptions) => VoiceProofTrendRealCallProfileEvidence[];
|
|
479
492
|
export declare const loadVoiceRealCallProfileEvidenceFromTraceStore: (options: VoiceRealCallProfileTraceStoreEvidenceOptions) => Promise<VoiceProofTrendRealCallProfileEvidence[]>;
|
|
493
|
+
export declare const createVoiceRealCallProfileTraceCollector: <TEvent extends StoredVoiceTraceEvent = StoredVoiceTraceEvent>(options: VoiceRealCallProfileTraceCollectorOptions<TEvent>) => VoiceRealCallProfileTraceCollector<TEvent>;
|
|
480
494
|
export declare const buildVoiceProofTrendProfileSummaries: (input: VoiceProofTrendReport | readonly VoiceProofTrendReport[], options?: VoiceProofTrendProfileSummaryOptions) => VoiceProofTrendProfileSummary[];
|
|
481
495
|
export declare const buildVoiceProofTrendReportFromRealCallProfiles: (options: VoiceProofTrendRealCallProfileReportOptions) => VoiceProofTrendReport;
|
|
482
496
|
export declare const buildVoiceRealCallProfileDefaults: (input: VoiceRealCallProfileHistoryReport | VoiceProofTrendReport, options?: VoiceRealCallProfileDefaultsOptions) => VoiceRealCallProfileDefaultsReport;
|
package/dist/react/index.js
CHANGED
|
@@ -1824,6 +1824,68 @@ var buildVoiceRealCallProfileEvidenceFromTraceEvents = (events, options = {}) =>
|
|
|
1824
1824
|
}).filter((evidence) => evidence !== undefined);
|
|
1825
1825
|
};
|
|
1826
1826
|
var loadVoiceRealCallProfileEvidenceFromTraceStore = async (options) => buildVoiceRealCallProfileEvidenceFromTraceEvents(await options.store.list({ limit: options.limit ?? 5000 }), options);
|
|
1827
|
+
var realCallProfileTraceSignalTypes = new Set([
|
|
1828
|
+
"client.barge_in",
|
|
1829
|
+
"client.browser_media",
|
|
1830
|
+
"client.live_latency",
|
|
1831
|
+
"client.telephony_media",
|
|
1832
|
+
"provider.decision",
|
|
1833
|
+
"session.error",
|
|
1834
|
+
"turn_latency.stage"
|
|
1835
|
+
]);
|
|
1836
|
+
var hasTraceProfileMetadata = (event, options) => Boolean(readTraceProfileId([event], options));
|
|
1837
|
+
var mergeRealCallProfileCollectorOptions = (base, override = {}) => ({
|
|
1838
|
+
defaultProfileId: override.defaultProfileId ?? base.defaultProfileId,
|
|
1839
|
+
defaultProfileLabel: override.defaultProfileLabel ?? base.defaultProfileLabel,
|
|
1840
|
+
limit: override.limit ?? base.limit,
|
|
1841
|
+
maxProviderP95Ms: override.maxProviderP95Ms ?? base.maxProviderP95Ms,
|
|
1842
|
+
profileDescriptions: {
|
|
1843
|
+
...base.profileDescriptions ?? {},
|
|
1844
|
+
...override.profileDescriptions ?? {}
|
|
1845
|
+
},
|
|
1846
|
+
profileLabels: {
|
|
1847
|
+
...base.profileLabels ?? {},
|
|
1848
|
+
...override.profileLabels ?? {}
|
|
1849
|
+
},
|
|
1850
|
+
sessionIds: override.sessionIds ?? base.sessionIds
|
|
1851
|
+
});
|
|
1852
|
+
var createVoiceRealCallProfileTraceCollector = (options) => {
|
|
1853
|
+
const capturedSessionIds = new Set(options.sessionIds ?? []);
|
|
1854
|
+
const capture = (event) => {
|
|
1855
|
+
if (realCallProfileTraceSignalTypes.has(event.type) && hasTraceProfileMetadata(event, options)) {
|
|
1856
|
+
capturedSessionIds.add(event.sessionId);
|
|
1857
|
+
}
|
|
1858
|
+
};
|
|
1859
|
+
return {
|
|
1860
|
+
append: async (event) => {
|
|
1861
|
+
const stored = await options.store.append(event);
|
|
1862
|
+
capture(stored);
|
|
1863
|
+
return stored;
|
|
1864
|
+
},
|
|
1865
|
+
buildHistoryReport: async (historyOptions = {}) => {
|
|
1866
|
+
const evidence = await buildRealCallProfileCollectorEvidence(options, capturedSessionIds, historyOptions.evidenceOptions);
|
|
1867
|
+
return buildVoiceRealCallProfileHistoryReport({
|
|
1868
|
+
...historyOptions,
|
|
1869
|
+
evidence
|
|
1870
|
+
});
|
|
1871
|
+
},
|
|
1872
|
+
get: (id) => options.store.get(id),
|
|
1873
|
+
list: (filter) => options.store.list(filter),
|
|
1874
|
+
listCapturedSessionIds: () => [...capturedSessionIds],
|
|
1875
|
+
listEvidence: (evidenceOptions) => buildRealCallProfileCollectorEvidence(options, capturedSessionIds, evidenceOptions),
|
|
1876
|
+
remove: async (id) => {
|
|
1877
|
+
await options.store.remove(id);
|
|
1878
|
+
}
|
|
1879
|
+
};
|
|
1880
|
+
};
|
|
1881
|
+
var buildRealCallProfileCollectorEvidence = async (baseOptions, capturedSessionIds, evidenceOptions) => {
|
|
1882
|
+
const merged = mergeRealCallProfileCollectorOptions(baseOptions, evidenceOptions);
|
|
1883
|
+
const requestedSessionIds = merged.sessionIds ?? [...capturedSessionIds];
|
|
1884
|
+
return buildVoiceRealCallProfileEvidenceFromTraceEvents(await baseOptions.store.list({ limit: merged.limit ?? 5000 }), {
|
|
1885
|
+
...merged,
|
|
1886
|
+
sessionIds: requestedSessionIds
|
|
1887
|
+
});
|
|
1888
|
+
};
|
|
1827
1889
|
var readProofTrendProviders = (reports) => aggregateProofTrendProviders(reports.flatMap((report) => report.summary.providers && report.summary.providers.length > 0 ? report.summary.providers : report.cycles.flatMap((cycle) => cycle.providers ?? [])));
|
|
1828
1890
|
var exceedsProofTrendBudget = (value, budget) => value !== undefined && (!Number.isFinite(value) || value > budget);
|
|
1829
1891
|
var readProofTrendProfileStatus = (profile, budgets) => {
|
package/dist/vue/index.js
CHANGED
|
@@ -1745,6 +1745,68 @@ var buildVoiceRealCallProfileEvidenceFromTraceEvents = (events, options = {}) =>
|
|
|
1745
1745
|
}).filter((evidence) => evidence !== undefined);
|
|
1746
1746
|
};
|
|
1747
1747
|
var loadVoiceRealCallProfileEvidenceFromTraceStore = async (options) => buildVoiceRealCallProfileEvidenceFromTraceEvents(await options.store.list({ limit: options.limit ?? 5000 }), options);
|
|
1748
|
+
var realCallProfileTraceSignalTypes = new Set([
|
|
1749
|
+
"client.barge_in",
|
|
1750
|
+
"client.browser_media",
|
|
1751
|
+
"client.live_latency",
|
|
1752
|
+
"client.telephony_media",
|
|
1753
|
+
"provider.decision",
|
|
1754
|
+
"session.error",
|
|
1755
|
+
"turn_latency.stage"
|
|
1756
|
+
]);
|
|
1757
|
+
var hasTraceProfileMetadata = (event, options) => Boolean(readTraceProfileId([event], options));
|
|
1758
|
+
var mergeRealCallProfileCollectorOptions = (base, override = {}) => ({
|
|
1759
|
+
defaultProfileId: override.defaultProfileId ?? base.defaultProfileId,
|
|
1760
|
+
defaultProfileLabel: override.defaultProfileLabel ?? base.defaultProfileLabel,
|
|
1761
|
+
limit: override.limit ?? base.limit,
|
|
1762
|
+
maxProviderP95Ms: override.maxProviderP95Ms ?? base.maxProviderP95Ms,
|
|
1763
|
+
profileDescriptions: {
|
|
1764
|
+
...base.profileDescriptions ?? {},
|
|
1765
|
+
...override.profileDescriptions ?? {}
|
|
1766
|
+
},
|
|
1767
|
+
profileLabels: {
|
|
1768
|
+
...base.profileLabels ?? {},
|
|
1769
|
+
...override.profileLabels ?? {}
|
|
1770
|
+
},
|
|
1771
|
+
sessionIds: override.sessionIds ?? base.sessionIds
|
|
1772
|
+
});
|
|
1773
|
+
var createVoiceRealCallProfileTraceCollector = (options) => {
|
|
1774
|
+
const capturedSessionIds = new Set(options.sessionIds ?? []);
|
|
1775
|
+
const capture = (event) => {
|
|
1776
|
+
if (realCallProfileTraceSignalTypes.has(event.type) && hasTraceProfileMetadata(event, options)) {
|
|
1777
|
+
capturedSessionIds.add(event.sessionId);
|
|
1778
|
+
}
|
|
1779
|
+
};
|
|
1780
|
+
return {
|
|
1781
|
+
append: async (event) => {
|
|
1782
|
+
const stored = await options.store.append(event);
|
|
1783
|
+
capture(stored);
|
|
1784
|
+
return stored;
|
|
1785
|
+
},
|
|
1786
|
+
buildHistoryReport: async (historyOptions = {}) => {
|
|
1787
|
+
const evidence = await buildRealCallProfileCollectorEvidence(options, capturedSessionIds, historyOptions.evidenceOptions);
|
|
1788
|
+
return buildVoiceRealCallProfileHistoryReport({
|
|
1789
|
+
...historyOptions,
|
|
1790
|
+
evidence
|
|
1791
|
+
});
|
|
1792
|
+
},
|
|
1793
|
+
get: (id) => options.store.get(id),
|
|
1794
|
+
list: (filter) => options.store.list(filter),
|
|
1795
|
+
listCapturedSessionIds: () => [...capturedSessionIds],
|
|
1796
|
+
listEvidence: (evidenceOptions) => buildRealCallProfileCollectorEvidence(options, capturedSessionIds, evidenceOptions),
|
|
1797
|
+
remove: async (id) => {
|
|
1798
|
+
await options.store.remove(id);
|
|
1799
|
+
}
|
|
1800
|
+
};
|
|
1801
|
+
};
|
|
1802
|
+
var buildRealCallProfileCollectorEvidence = async (baseOptions, capturedSessionIds, evidenceOptions) => {
|
|
1803
|
+
const merged = mergeRealCallProfileCollectorOptions(baseOptions, evidenceOptions);
|
|
1804
|
+
const requestedSessionIds = merged.sessionIds ?? [...capturedSessionIds];
|
|
1805
|
+
return buildVoiceRealCallProfileEvidenceFromTraceEvents(await baseOptions.store.list({ limit: merged.limit ?? 5000 }), {
|
|
1806
|
+
...merged,
|
|
1807
|
+
sessionIds: requestedSessionIds
|
|
1808
|
+
});
|
|
1809
|
+
};
|
|
1748
1810
|
var readProofTrendProviders = (reports) => aggregateProofTrendProviders(reports.flatMap((report) => report.summary.providers && report.summary.providers.length > 0 ? report.summary.providers : report.cycles.flatMap((cycle) => cycle.providers ?? [])));
|
|
1749
1811
|
var exceedsProofTrendBudget = (value, budget) => value !== undefined && (!Number.isFinite(value) || value > budget);
|
|
1750
1812
|
var readProofTrendProfileStatus = (profile, budgets) => {
|