@absolutejs/voice 0.0.22-beta.417 → 0.0.22-beta.419

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 CHANGED
@@ -206,6 +206,6 @@ export type { PlivoInboundMessage, PlivoMediaStreamBridge, PlivoMediaStreamBridg
206
206
  export type { VoiceTelephonyCarrierMatrix, VoiceTelephonyCarrierMatrixEntry, VoiceTelephonyCarrierMatrixInput, VoiceTelephonyCarrierMatrixOptions, VoiceTelephonyCarrierMatrixRoutesOptions, VoiceTelephonyCarrierMatrixStatus } from './telephony/matrix';
207
207
  export { shapeTelephonyAssistantText } from './telephony/response';
208
208
  export type { TelephonyResponseShapeMode, TelephonyResponseShapeOptions } from './telephony/response';
209
- export { buildVoiceProofPack, buildVoiceProofPackFromObservabilityExport, createVoiceProofPackBuildContext, createVoiceProofPackStaleWhileRefreshSource, createVoiceProofPackArtifacts, createVoiceProofPackOperationsRecordSection, createVoiceProofPackProductionReadinessSection, createVoiceProofPackProviderSloSection, createVoiceProofPackRoutes, createVoiceProofPackSupportBundleSection, renderVoiceProofPackMarkdown, writeVoiceProofPack } from './proofPack';
210
- export type { VoiceProofPack, VoiceProofPackBuildContext, VoiceProofPackBuildContextOptions, VoiceProofPackBuildTiming, VoiceProofPackEvidence, VoiceProofPackInput, VoiceProofPackRefreshState, VoiceProofPackRefreshStatus, VoiceProofPackRoutesOptions, VoiceProofPackSection, VoiceProofPackSourceValue, VoiceProofPackStatus, VoiceProofPackStaleWhileRefreshSource, VoiceProofPackStaleWhileRefreshSourceOptions, VoiceProofPackWriteResult } from './proofPack';
209
+ export { buildVoiceProofPackInput, buildVoiceProofPack, buildVoiceProofPackFromObservabilityExport, createVoiceProofPackBuildContext, createVoiceProofRefreshSnapshot, createVoiceProofPackStaleWhileRefreshSource, createVoiceProofPackArtifacts, createVoiceProofPackOperationsRecordSection, createVoiceProofPackProductionReadinessSection, createVoiceProofPackProviderSloSection, createVoiceProofPackRoutes, createVoiceProofPackSupportBundleSection, renderVoiceProofPackMarkdown, writeVoiceProofPack } from './proofPack';
210
+ export type { VoiceProofPack, VoiceProofPackBuildContext, VoiceProofPackBuildContextOptions, VoiceProofPackBuildTiming, VoiceProofPackEvidence, VoiceProofPackInput, VoiceProofPackInputBuilderLoaderInput, VoiceProofPackInputBuilderOperationsLoaderInput, VoiceProofPackInputBuilderOptions, VoiceProofPackInputBuilderSupportBundle, VoiceProofPackRefreshState, VoiceProofPackRefreshStatus, VoiceProofPackRoutesOptions, VoiceProofPackSection, VoiceProofPackSourceValue, VoiceProofPackStatus, VoiceProofPackStaleWhileRefreshSource, VoiceProofPackStaleWhileRefreshSourceOptions, VoiceProofPackWriteResult, VoiceProofRefreshSnapshot, VoiceProofRefreshSnapshotOptions } from './proofPack';
211
211
  export * from './types';
package/dist/index.js CHANGED
@@ -40023,6 +40023,78 @@ var createVoiceProofPackBuildContext = (options = {}) => {
40023
40023
  time
40024
40024
  };
40025
40025
  };
40026
+ var createSnapshotTraceStore = (events) => ({
40027
+ append: async () => {
40028
+ throw new Error("Voice proof refresh snapshot trace store is read-only.");
40029
+ },
40030
+ get: async (id) => events.find((event) => event.id === id),
40031
+ list: async (filter) => filterVoiceTraceEvents([...events], filter),
40032
+ remove: async () => {
40033
+ throw new Error("Voice proof refresh snapshot trace store is read-only.");
40034
+ }
40035
+ });
40036
+ var createSnapshotAuditStore = (events) => ({
40037
+ append: async () => {
40038
+ throw new Error("Voice proof refresh snapshot audit store is read-only.");
40039
+ },
40040
+ get: async (id) => events.find((event) => event.id === id),
40041
+ list: async (filter) => filterVoiceAuditEvents([...events], filter)
40042
+ });
40043
+ var createSnapshotTraceDeliveryStore = (deliveries) => ({
40044
+ get: async (id) => deliveries.find((delivery) => delivery.id === id),
40045
+ list: async () => [...deliveries],
40046
+ remove: async () => {
40047
+ throw new Error("Voice proof refresh snapshot delivery store is read-only.");
40048
+ },
40049
+ set: async () => {
40050
+ throw new Error("Voice proof refresh snapshot delivery store is read-only.");
40051
+ }
40052
+ });
40053
+ var createVoiceProofRefreshSnapshot = async (options = {}) => {
40054
+ const [traceEvents, auditEvents, traceDeliveries, auditSinkDeliveries] = await Promise.all([
40055
+ options.events ?? await options.traceStore?.list(options.traceFilter) ?? [],
40056
+ options.audit ? await options.audit.list(options.auditFilter) : [],
40057
+ options.traceDeliveries ? await options.traceDeliveries.list() : [],
40058
+ options.auditSinkDeliveries ? await options.auditSinkDeliveries.list() : []
40059
+ ]);
40060
+ return {
40061
+ auditEvents,
40062
+ auditSinkDeliveries,
40063
+ auditStore: createSnapshotAuditStore(auditEvents),
40064
+ capturedAt: Date.now(),
40065
+ traceDeliveries,
40066
+ traceDeliveryStore: createSnapshotTraceDeliveryStore(traceDeliveries),
40067
+ traceEvents,
40068
+ traceStore: createSnapshotTraceStore(traceEvents)
40069
+ };
40070
+ };
40071
+ var buildVoiceProofPackInput = async (options) => {
40072
+ const context = options.context ?? createVoiceProofPackBuildContext();
40073
+ const loaderInput = { context };
40074
+ const [productionReadiness, providerSlo, supportBundle, observabilityExport] = await Promise.all([
40075
+ options.loadProductionReadiness ? context.time("productionReadiness", () => options.loadProductionReadiness?.(loaderInput)) : undefined,
40076
+ options.loadProviderSlo ? context.time("providerSlo", () => options.loadProviderSlo?.(loaderInput)) : undefined,
40077
+ options.loadSupportBundle ? context.time("supportBundle", () => options.loadSupportBundle?.(loaderInput)) : undefined,
40078
+ options.loadObservabilityExport ? context.time("observabilityExport", () => options.loadObservabilityExport?.(loaderInput)) : undefined
40079
+ ]);
40080
+ const operationsRecords = options.loadOperationsRecords ? await context.time("operationsRecords", () => options.loadOperationsRecords?.({
40081
+ context,
40082
+ supportBundle
40083
+ })) : options.operationsRecords;
40084
+ return {
40085
+ artifacts: options.artifacts,
40086
+ callDebuggerReports: supportBundle?.callDebuggerReports ?? options.callDebuggerReports,
40087
+ generatedAt: options.generatedAt,
40088
+ observabilityExport,
40089
+ operationsRecords,
40090
+ outputDir: options.outputDir,
40091
+ productionReadiness,
40092
+ providerSlo,
40093
+ runId: options.runId,
40094
+ sections: options.sections,
40095
+ sessionSnapshots: supportBundle?.sessionSnapshots ?? options.sessionSnapshots
40096
+ };
40097
+ };
40026
40098
  var toProofPackStatus = (status) => {
40027
40099
  if (status === "fail" || status === "failed") {
40028
40100
  return "fail";
@@ -40868,6 +40940,7 @@ export {
40868
40940
  createVoiceProofTrendRoutes,
40869
40941
  createVoiceProofTrendRecommendationRoutes,
40870
40942
  createVoiceProofTraceStore,
40943
+ createVoiceProofRefreshSnapshot,
40871
40944
  createVoiceProofPackSupportBundleSection,
40872
40945
  createVoiceProofPackStaleWhileRefreshSource,
40873
40946
  createVoiceProofPackRoutes,
@@ -41094,6 +41167,7 @@ export {
41094
41167
  buildVoiceProofTrendReport,
41095
41168
  buildVoiceProofTrendRecommendationReport,
41096
41169
  buildVoiceProofTrendProfileSummaries,
41170
+ buildVoiceProofPackInput,
41097
41171
  buildVoiceProofPackFromObservabilityExport,
41098
41172
  buildVoiceProofPack,
41099
41173
  buildVoiceProfileSwitchReadinessReport,
@@ -1,10 +1,12 @@
1
1
  import { Elysia } from 'elysia';
2
+ import { type StoredVoiceAuditEvent, type VoiceAuditEventFilter, type VoiceAuditEventStore } from './audit';
2
3
  import type { VoiceObservabilityExportArtifact, VoiceObservabilityExportReport } from './observabilityExport';
3
4
  import type { VoiceCallDebuggerReport } from './callDebugger';
4
5
  import type { VoiceOperationsRecord } from './operationsRecord';
5
6
  import type { VoiceProductionReadinessReport } from './productionReadiness';
6
7
  import type { VoiceProviderSloReport } from './providerSlo';
7
8
  import type { VoiceSessionSnapshot } from './sessionSnapshot';
9
+ import { type StoredVoiceTraceEvent, type VoiceTraceEventFilter, type VoiceTraceEventStore, type VoiceTraceSinkDeliveryRecord, type VoiceTraceSinkDeliveryStore } from './trace';
8
10
  export type VoiceProofPackStatus = 'fail' | 'pass' | 'warn';
9
11
  export type VoiceProofPackEvidence = {
10
12
  detail?: string;
@@ -69,6 +71,48 @@ export type VoiceProofPackBuildContextOptions = {
69
71
  now?: () => number;
70
72
  onTiming?: (timing: VoiceProofPackBuildTiming) => void;
71
73
  };
74
+ export type VoiceProofRefreshSnapshotOptions = {
75
+ audit?: VoiceAuditEventStore;
76
+ auditFilter?: VoiceAuditEventFilter;
77
+ auditSinkDeliveries?: {
78
+ list: () => Promise<unknown[]> | unknown[];
79
+ };
80
+ events?: StoredVoiceTraceEvent[];
81
+ traceDeliveries?: VoiceTraceSinkDeliveryStore;
82
+ traceFilter?: VoiceTraceEventFilter;
83
+ traceStore?: VoiceTraceEventStore;
84
+ };
85
+ export type VoiceProofRefreshSnapshot = {
86
+ auditEvents: StoredVoiceAuditEvent[];
87
+ auditStore: VoiceAuditEventStore;
88
+ auditSinkDeliveries: unknown[];
89
+ capturedAt: number;
90
+ traceDeliveries: VoiceTraceSinkDeliveryRecord[];
91
+ traceDeliveryStore: VoiceTraceSinkDeliveryStore;
92
+ traceEvents: StoredVoiceTraceEvent[];
93
+ traceStore: VoiceTraceEventStore;
94
+ };
95
+ export type VoiceProofPackInputBuilderSupportBundle = {
96
+ callDebuggerReports?: VoiceCallDebuggerReport[];
97
+ sessionSnapshots?: VoiceSessionSnapshot[];
98
+ };
99
+ export type VoiceProofPackInputBuilderLoaderInput = {
100
+ context: VoiceProofPackBuildContext;
101
+ };
102
+ export type VoiceProofPackInputBuilderOperationsLoaderInput = VoiceProofPackInputBuilderLoaderInput & {
103
+ supportBundle?: VoiceProofPackInputBuilderSupportBundle;
104
+ };
105
+ export type VoiceProofPackInputBuilderOptions = Omit<VoiceProofPackInput, 'callDebuggerReports' | 'observabilityExport' | 'operationsRecords' | 'productionReadiness' | 'providerSlo' | 'sessionSnapshots'> & {
106
+ callDebuggerReports?: VoiceCallDebuggerReport[];
107
+ context?: VoiceProofPackBuildContext;
108
+ loadObservabilityExport?: (input: VoiceProofPackInputBuilderLoaderInput) => Promise<VoiceObservabilityExportReport> | VoiceObservabilityExportReport;
109
+ loadOperationsRecords?: (input: VoiceProofPackInputBuilderOperationsLoaderInput) => Promise<VoiceOperationsRecord[]> | VoiceOperationsRecord[];
110
+ loadProductionReadiness?: (input: VoiceProofPackInputBuilderLoaderInput) => Promise<VoiceProductionReadinessReport> | VoiceProductionReadinessReport;
111
+ loadProviderSlo?: (input: VoiceProofPackInputBuilderLoaderInput) => Promise<VoiceProviderSloReport> | VoiceProviderSloReport;
112
+ loadSupportBundle?: (input: VoiceProofPackInputBuilderLoaderInput) => Promise<VoiceProofPackInputBuilderSupportBundle> | VoiceProofPackInputBuilderSupportBundle;
113
+ operationsRecords?: VoiceOperationsRecord[];
114
+ sessionSnapshots?: VoiceSessionSnapshot[];
115
+ };
72
116
  export type VoiceProofPackSourceValue = VoiceProofPack | VoiceProofPackInput;
73
117
  export type VoiceProofPackStaleWhileRefreshSourceOptions = {
74
118
  maxAgeMs?: number;
@@ -100,6 +144,8 @@ export type VoiceProofPackRoutesOptions = {
100
144
  source: VoiceProofPackSourceValue | (() => VoiceProofPackSourceValue | Promise<VoiceProofPackSourceValue>);
101
145
  };
102
146
  export declare const createVoiceProofPackBuildContext: (options?: VoiceProofPackBuildContextOptions) => VoiceProofPackBuildContext;
147
+ export declare const createVoiceProofRefreshSnapshot: (options?: VoiceProofRefreshSnapshotOptions) => Promise<VoiceProofRefreshSnapshot>;
148
+ export declare const buildVoiceProofPackInput: (options: VoiceProofPackInputBuilderOptions) => Promise<VoiceProofPackInput>;
103
149
  export declare const createVoiceProofPackProviderSloSection: (report: VoiceProviderSloReport, options?: {
104
150
  href?: string;
105
151
  title?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.417",
3
+ "version": "0.0.22-beta.419",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",