@absolutejs/voice 0.0.22-beta.126 → 0.0.22-beta.127

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.
Files changed (43) hide show
  1. package/README.md +202 -26
  2. package/dist/agent.d.ts +5 -0
  3. package/dist/angular/index.d.ts +1 -1
  4. package/dist/angular/index.js +16 -16
  5. package/dist/angular/voice-ops-status.service.d.ts +12 -0
  6. package/dist/audit.d.ts +128 -0
  7. package/dist/auditDeliveryRoutes.d.ts +85 -0
  8. package/dist/auditExport.d.ts +34 -0
  9. package/dist/auditRoutes.d.ts +66 -0
  10. package/dist/auditSinks.d.ts +133 -0
  11. package/dist/client/index.d.ts +2 -2
  12. package/dist/client/index.js +11 -11
  13. package/dist/client/opsStatus.d.ts +19 -0
  14. package/dist/client/opsStatusWidget.d.ts +7 -7
  15. package/dist/dataControl.d.ts +47 -0
  16. package/dist/demoReadyRoutes.d.ts +98 -0
  17. package/dist/fileStore.d.ts +8 -2
  18. package/dist/index.d.ts +25 -6
  19. package/dist/index.js +10602 -8598
  20. package/dist/opsStatus.d.ts +65 -0
  21. package/dist/opsStatusRoutes.d.ts +33 -0
  22. package/dist/phoneAgent.d.ts +4 -0
  23. package/dist/phoneAgentProductionSmoke.d.ts +115 -0
  24. package/dist/postgresStore.d.ts +8 -2
  25. package/dist/productionReadiness.d.ts +82 -0
  26. package/dist/react/index.d.ts +1 -1
  27. package/dist/react/index.js +16 -16
  28. package/dist/react/useVoiceOpsStatus.d.ts +8 -0
  29. package/dist/sqliteStore.d.ts +8 -2
  30. package/dist/svelte/createVoiceOpsStatus.d.ts +2 -2
  31. package/dist/svelte/index.d.ts +0 -1
  32. package/dist/svelte/index.js +72 -75
  33. package/dist/traceDeliveryRoutes.d.ts +86 -0
  34. package/dist/vue/index.d.ts +1 -1
  35. package/dist/vue/index.js +15 -15
  36. package/dist/vue/useVoiceOpsStatus.d.ts +9 -0
  37. package/package.json +1 -1
  38. package/dist/angular/voice-app-kit-status.service.d.ts +0 -12
  39. package/dist/appKit.d.ts +0 -100
  40. package/dist/client/appKitStatus.d.ts +0 -19
  41. package/dist/react/useVoiceAppKitStatus.d.ts +0 -8
  42. package/dist/svelte/createVoiceAppKitStatus.d.ts +0 -8
  43. package/dist/vue/useVoiceAppKitStatus.d.ts +0 -9
@@ -0,0 +1,85 @@
1
+ import { Elysia } from 'elysia';
2
+ import { type VoiceAuditSinkDeliveryQueueStatus, type VoiceAuditSinkDeliveryQueueSummary, type VoiceAuditSinkDeliveryRecord, type VoiceAuditSinkDeliveryStore, type VoiceAuditSinkDeliveryWorkerResult } from './auditSinks';
3
+ export type VoiceAuditDeliveryReport = {
4
+ checkedAt: number;
5
+ deliveries: VoiceAuditSinkDeliveryRecord[];
6
+ filter: VoiceAuditDeliveryFilter;
7
+ summary: VoiceAuditSinkDeliveryQueueSummary;
8
+ };
9
+ export type VoiceAuditDeliveryDrainWorker = {
10
+ drain: () => Promise<VoiceAuditSinkDeliveryWorkerResult> | VoiceAuditSinkDeliveryWorkerResult;
11
+ };
12
+ export type VoiceAuditDeliveryDrainReport = VoiceAuditSinkDeliveryWorkerResult & {
13
+ drainedAt: number;
14
+ };
15
+ export type VoiceAuditDeliveryFilter = {
16
+ limit?: number;
17
+ q?: string;
18
+ status?: VoiceAuditSinkDeliveryQueueStatus | 'all';
19
+ };
20
+ export type VoiceAuditDeliveryRoutesOptions = {
21
+ deadLetters?: VoiceAuditSinkDeliveryStore;
22
+ filter?: VoiceAuditDeliveryFilter;
23
+ headers?: HeadersInit;
24
+ htmlPath?: false | string;
25
+ limit?: number;
26
+ name?: string;
27
+ path?: string;
28
+ render?: (report: VoiceAuditDeliveryReport) => string | Promise<string>;
29
+ store: VoiceAuditSinkDeliveryStore;
30
+ title?: string;
31
+ worker?: VoiceAuditDeliveryDrainWorker;
32
+ workerPath?: false | string;
33
+ };
34
+ export declare const resolveVoiceAuditDeliveryFilter: (query?: Record<string, unknown>, base?: VoiceAuditDeliveryFilter) => VoiceAuditDeliveryFilter;
35
+ export declare const buildVoiceAuditDeliveryReport: (options: VoiceAuditDeliveryRoutesOptions, filter?: VoiceAuditDeliveryFilter) => Promise<VoiceAuditDeliveryReport>;
36
+ export declare const renderVoiceAuditDeliveryHTML: (report: VoiceAuditDeliveryReport, options?: {
37
+ title?: string;
38
+ workerPath?: false | string;
39
+ }) => string;
40
+ export declare const createVoiceAuditDeliveryJSONHandler: (options: VoiceAuditDeliveryRoutesOptions) => ({ query }: {
41
+ query?: Record<string, string | undefined>;
42
+ }) => Promise<VoiceAuditDeliveryReport>;
43
+ export declare const createVoiceAuditDeliveryHTMLHandler: (options: VoiceAuditDeliveryRoutesOptions) => ({ query }: {
44
+ query?: Record<string, string | undefined>;
45
+ }) => Promise<Response>;
46
+ export declare const createVoiceAuditDeliveryRoutes: (options: VoiceAuditDeliveryRoutesOptions) => Elysia<"", {
47
+ decorator: {};
48
+ store: {};
49
+ derive: {};
50
+ resolve: {};
51
+ }, {
52
+ typebox: {};
53
+ error: {};
54
+ }, {
55
+ schema: {};
56
+ standaloneSchema: {};
57
+ macro: {};
58
+ macroFn: {};
59
+ parser: {};
60
+ response: {};
61
+ }, {
62
+ [x: string]: {
63
+ get: {
64
+ body: unknown;
65
+ params: {};
66
+ query: unknown;
67
+ headers: unknown;
68
+ response: {
69
+ 200: VoiceAuditDeliveryReport;
70
+ };
71
+ };
72
+ };
73
+ }, {
74
+ derive: {};
75
+ resolve: {};
76
+ schema: {};
77
+ standaloneSchema: {};
78
+ response: {};
79
+ }, {
80
+ derive: {};
81
+ resolve: {};
82
+ schema: {};
83
+ standaloneSchema: {};
84
+ response: {};
85
+ }>;
@@ -0,0 +1,34 @@
1
+ import type { StoredVoiceAuditEvent, VoiceAuditEventFilter, VoiceAuditEventStore } from './audit';
2
+ import { type VoiceTraceRedactionConfig } from './trace';
3
+ import { type VoiceAuditTrailSummary } from './auditRoutes';
4
+ export type VoiceAuditExport = {
5
+ events: StoredVoiceAuditEvent[];
6
+ exportedAt: number;
7
+ filter?: VoiceAuditEventFilter;
8
+ redacted: boolean;
9
+ summary: VoiceAuditTrailSummary;
10
+ };
11
+ export declare const redactVoiceAuditEvent: <TEvent extends StoredVoiceAuditEvent = StoredVoiceAuditEvent>(event: TEvent, options?: VoiceTraceRedactionConfig) => TEvent;
12
+ export declare const redactVoiceAuditEvents: <TEvent extends StoredVoiceAuditEvent = StoredVoiceAuditEvent>(events: TEvent[], options?: VoiceTraceRedactionConfig) => TEvent[];
13
+ export declare const exportVoiceAuditTrail: (input: {
14
+ filter?: VoiceAuditEventFilter;
15
+ redact?: VoiceTraceRedactionConfig;
16
+ store: VoiceAuditEventStore;
17
+ }) => Promise<VoiceAuditExport>;
18
+ export declare const renderVoiceAuditMarkdown: (events: StoredVoiceAuditEvent[], options?: {
19
+ redact?: VoiceTraceRedactionConfig;
20
+ title?: string;
21
+ }) => string;
22
+ export declare const renderVoiceAuditHTML: (events: StoredVoiceAuditEvent[], options?: {
23
+ redact?: VoiceTraceRedactionConfig;
24
+ title?: string;
25
+ }) => string;
26
+ export declare const buildVoiceAuditExport: (events: StoredVoiceAuditEvent[], options?: {
27
+ redact?: VoiceTraceRedactionConfig;
28
+ title?: string;
29
+ }) => {
30
+ events: StoredVoiceAuditEvent[];
31
+ html: string;
32
+ markdown: string;
33
+ summary: VoiceAuditTrailSummary;
34
+ };
@@ -0,0 +1,66 @@
1
+ import { Elysia } from 'elysia';
2
+ import type { StoredVoiceAuditEvent, VoiceAuditEventFilter, VoiceAuditEventStore, VoiceAuditEventType } from './audit';
3
+ export type VoiceAuditTrailSummary = {
4
+ byActor: Array<[string, number]>;
5
+ byOutcome: Array<[string, number]>;
6
+ byResourceType: Array<[string, number]>;
7
+ byType: Array<[VoiceAuditEventType, number]>;
8
+ errors: number;
9
+ latestAt?: number;
10
+ total: number;
11
+ };
12
+ export type VoiceAuditTrailReport = {
13
+ checkedAt: number;
14
+ events: StoredVoiceAuditEvent[];
15
+ filter: VoiceAuditEventFilter;
16
+ summary: VoiceAuditTrailSummary;
17
+ };
18
+ export type VoiceAuditTrailOptions = {
19
+ filter?: VoiceAuditEventFilter;
20
+ limit?: number;
21
+ store: VoiceAuditEventStore;
22
+ };
23
+ export type VoiceAuditTrailRoutesOptions = VoiceAuditTrailOptions & {
24
+ exportHtmlPath?: false | string;
25
+ exportPath?: false | string;
26
+ headers?: HeadersInit;
27
+ htmlPath?: false | string;
28
+ name?: string;
29
+ path?: string;
30
+ render?: (report: VoiceAuditTrailReport) => string | Promise<string>;
31
+ title?: string;
32
+ };
33
+ export declare const resolveVoiceAuditTrailFilter: (query?: Record<string, unknown>, base?: VoiceAuditEventFilter) => VoiceAuditEventFilter;
34
+ export declare const summarizeVoiceAuditTrail: (events: StoredVoiceAuditEvent[]) => VoiceAuditTrailSummary;
35
+ export declare const buildVoiceAuditTrailReport: (options: VoiceAuditTrailOptions) => Promise<VoiceAuditTrailReport>;
36
+ export declare const renderVoiceAuditTrailHTML: (report: VoiceAuditTrailReport, options?: {
37
+ title?: string;
38
+ }) => string;
39
+ export declare const createVoiceAuditTrailRoutes: (options: VoiceAuditTrailRoutesOptions) => Elysia<"", {
40
+ decorator: {};
41
+ store: {};
42
+ derive: {};
43
+ resolve: {};
44
+ }, {
45
+ typebox: {};
46
+ error: {};
47
+ }, {
48
+ schema: {};
49
+ standaloneSchema: {};
50
+ macro: {};
51
+ macroFn: {};
52
+ parser: {};
53
+ response: {};
54
+ }, {}, {
55
+ derive: {};
56
+ resolve: {};
57
+ schema: {};
58
+ standaloneSchema: {};
59
+ response: {};
60
+ }, {
61
+ derive: {};
62
+ resolve: {};
63
+ schema: {};
64
+ standaloneSchema: {};
65
+ response: {};
66
+ }>;
@@ -0,0 +1,133 @@
1
+ import type { StoredVoiceAuditEvent, VoiceAuditEventStore, VoiceAuditEventType } from './audit';
2
+ import type { VoiceIdempotencyStore, VoiceRedisTaskLeaseCoordinator } from './queue';
3
+ import type { VoiceTraceRedactionConfig } from './trace';
4
+ export type VoiceAuditSinkDeliveryStatus = 'delivered' | 'failed' | 'skipped';
5
+ export type VoiceAuditSinkDeliveryQueueStatus = VoiceAuditSinkDeliveryStatus | 'pending';
6
+ export type VoiceAuditSinkDeliveryResult = {
7
+ attempts: number;
8
+ deliveredAt?: number;
9
+ deliveredTo?: string;
10
+ error?: string;
11
+ eventCount: number;
12
+ responseBody?: unknown;
13
+ status: VoiceAuditSinkDeliveryStatus;
14
+ };
15
+ export type VoiceAuditSink = {
16
+ deliver: (input: {
17
+ events: StoredVoiceAuditEvent[];
18
+ }) => Promise<VoiceAuditSinkDeliveryResult> | VoiceAuditSinkDeliveryResult;
19
+ eventTypes?: VoiceAuditEventType[];
20
+ id: string;
21
+ kind?: string;
22
+ };
23
+ export type VoiceAuditSinkFanoutResult = {
24
+ deliveredAt: number;
25
+ eventCount: number;
26
+ sinkDeliveries: Record<string, VoiceAuditSinkDeliveryResult>;
27
+ status: VoiceAuditSinkDeliveryStatus;
28
+ };
29
+ export type VoiceAuditSinkDeliveryRecord = {
30
+ createdAt: number;
31
+ deliveredAt?: number;
32
+ deliveryAttempts?: number;
33
+ deliveryError?: string;
34
+ deliveryStatus: VoiceAuditSinkDeliveryQueueStatus;
35
+ events: StoredVoiceAuditEvent[];
36
+ id: string;
37
+ sinkDeliveries?: Record<string, VoiceAuditSinkDeliveryResult>;
38
+ updatedAt: number;
39
+ };
40
+ export type VoiceAuditSinkDeliveryStore<TDelivery extends VoiceAuditSinkDeliveryRecord = VoiceAuditSinkDeliveryRecord> = {
41
+ get: (id: string) => Promise<TDelivery | undefined> | TDelivery | undefined;
42
+ list: () => Promise<TDelivery[]> | TDelivery[];
43
+ remove: (id: string) => Promise<void> | void;
44
+ set: (id: string, delivery: TDelivery) => Promise<void> | void;
45
+ };
46
+ export type VoiceAuditHTTPSinkOptions<TBody extends Record<string, unknown> = Record<string, unknown>> = {
47
+ backoffMs?: number;
48
+ body?: (input: {
49
+ events: StoredVoiceAuditEvent[];
50
+ }) => Promise<TBody> | TBody;
51
+ eventTypes?: VoiceAuditEventType[];
52
+ fetch?: typeof fetch;
53
+ headers?: Record<string, string>;
54
+ id: string;
55
+ kind?: string;
56
+ method?: 'POST' | 'PUT' | 'PATCH';
57
+ retries?: number;
58
+ signingSecret?: string;
59
+ timeoutMs?: number;
60
+ url: string;
61
+ };
62
+ export type VoiceAuditSinkStoreOptions<TEvent extends StoredVoiceAuditEvent = StoredVoiceAuditEvent> = {
63
+ awaitDelivery?: boolean;
64
+ deliveryQueue?: VoiceAuditSinkDeliveryStore;
65
+ onDelivery?: (result: VoiceAuditSinkFanoutResult) => Promise<void> | void;
66
+ onError?: (error: unknown) => Promise<void> | void;
67
+ redact?: VoiceTraceRedactionConfig;
68
+ sinks: VoiceAuditSink[];
69
+ store: VoiceAuditEventStore<TEvent>;
70
+ };
71
+ export type VoiceAuditSinkDeliveryWorkerOptions<TDelivery extends VoiceAuditSinkDeliveryRecord = VoiceAuditSinkDeliveryRecord> = {
72
+ deadLetters?: VoiceAuditSinkDeliveryStore<TDelivery>;
73
+ deliveries: VoiceAuditSinkDeliveryStore<TDelivery>;
74
+ idempotency?: VoiceIdempotencyStore;
75
+ idempotencyTtlSeconds?: number;
76
+ leaseMs?: number;
77
+ leases: VoiceRedisTaskLeaseCoordinator;
78
+ maxFailures?: number;
79
+ onDeadLetter?: (delivery: TDelivery) => Promise<void> | void;
80
+ redact?: VoiceTraceRedactionConfig;
81
+ sinks: VoiceAuditSink[];
82
+ statuses?: VoiceAuditSinkDeliveryQueueStatus[];
83
+ workerId: string;
84
+ };
85
+ export type VoiceAuditSinkDeliveryWorkerResult = {
86
+ alreadyProcessed: number;
87
+ attempted: number;
88
+ deadLettered: number;
89
+ delivered: number;
90
+ failed: number;
91
+ skipped: number;
92
+ };
93
+ export type VoiceAuditSinkDeliveryWorkerLoopOptions<TDelivery extends VoiceAuditSinkDeliveryRecord = VoiceAuditSinkDeliveryRecord> = {
94
+ onError?: (error: unknown) => Promise<void> | void;
95
+ pollIntervalMs?: number;
96
+ worker: ReturnType<typeof createVoiceAuditSinkDeliveryWorker<TDelivery>>;
97
+ };
98
+ export type VoiceAuditSinkDeliveryWorkerLoop = {
99
+ isRunning: () => boolean;
100
+ start: () => void;
101
+ stop: () => void;
102
+ tick: () => Promise<VoiceAuditSinkDeliveryWorkerResult>;
103
+ };
104
+ export type VoiceAuditSinkDeliveryQueueSummary = {
105
+ deadLettered: number;
106
+ delivered: number;
107
+ failed: number;
108
+ pending: number;
109
+ retryEligible: number;
110
+ skipped: number;
111
+ total: number;
112
+ };
113
+ export declare const createVoiceAuditSinkDeliveryId: (events: StoredVoiceAuditEvent[]) => string;
114
+ export declare const createVoiceAuditSinkDeliveryRecord: (input: {
115
+ createdAt?: number;
116
+ events: StoredVoiceAuditEvent[];
117
+ id?: string;
118
+ } & Partial<Omit<VoiceAuditSinkDeliveryRecord, "createdAt" | "events" | "id">>) => VoiceAuditSinkDeliveryRecord;
119
+ export declare const createVoiceAuditHTTPSink: <TBody extends Record<string, unknown> = Record<string, unknown>>(options: VoiceAuditHTTPSinkOptions<TBody>) => VoiceAuditSink;
120
+ export declare const deliverVoiceAuditEventsToSinks: (input: {
121
+ events: StoredVoiceAuditEvent[];
122
+ redact?: VoiceTraceRedactionConfig;
123
+ sinks: VoiceAuditSink[];
124
+ }) => Promise<VoiceAuditSinkFanoutResult>;
125
+ export declare const createVoiceAuditSinkStore: <TEvent extends StoredVoiceAuditEvent = StoredVoiceAuditEvent>(options: VoiceAuditSinkStoreOptions<TEvent>) => VoiceAuditEventStore<TEvent>;
126
+ export declare const createVoiceMemoryAuditSinkDeliveryStore: <TDelivery extends VoiceAuditSinkDeliveryRecord = VoiceAuditSinkDeliveryRecord>() => VoiceAuditSinkDeliveryStore<TDelivery>;
127
+ export declare const summarizeVoiceAuditSinkDeliveries: <TDelivery extends VoiceAuditSinkDeliveryRecord = VoiceAuditSinkDeliveryRecord>(deliveries: TDelivery[], input?: {
128
+ deadLetters?: VoiceAuditSinkDeliveryStore<TDelivery>;
129
+ }) => Promise<VoiceAuditSinkDeliveryQueueSummary> | VoiceAuditSinkDeliveryQueueSummary;
130
+ export declare const createVoiceAuditSinkDeliveryWorker: <TDelivery extends VoiceAuditSinkDeliveryRecord = VoiceAuditSinkDeliveryRecord>(options: VoiceAuditSinkDeliveryWorkerOptions<TDelivery>) => {
131
+ drain: () => Promise<VoiceAuditSinkDeliveryWorkerResult>;
132
+ };
133
+ export declare const createVoiceAuditSinkDeliveryWorkerLoop: <TDelivery extends VoiceAuditSinkDeliveryRecord = VoiceAuditSinkDeliveryRecord>(options: VoiceAuditSinkDeliveryWorkerLoopOptions<TDelivery>) => VoiceAuditSinkDeliveryWorkerLoop;
@@ -7,7 +7,7 @@ export { bindVoiceHTMX } from './htmx';
7
7
  export { createMicrophoneCapture } from './microphone';
8
8
  export { createVoiceBargeInMonitor } from './bargeInMonitor';
9
9
  export { createVoiceLiveTurnLatencyMonitor } from './liveTurnLatency';
10
- export { createVoiceAppKitStatusStore, fetchVoiceAppKitStatus } from './appKitStatus';
10
+ export { createVoiceOpsStatusStore, fetchVoiceOpsStatus } from './opsStatus';
11
11
  export { createVoiceOpsStatusViewModel, defineVoiceOpsStatusElement, getVoiceOpsStatusCSS, getVoiceOpsStatusLabel, mountVoiceOpsStatus, renderVoiceOpsStatusHTML } from './opsStatusWidget';
12
12
  export { createVoiceRoutingStatusStore, fetchVoiceRoutingStatus } from './routingStatus';
13
13
  export { createVoiceRoutingStatusViewModel, defineVoiceRoutingStatusElement, getVoiceRoutingStatusCSS, mountVoiceRoutingStatus, renderVoiceRoutingStatusHTML } from './routingStatusWidget';
@@ -25,7 +25,7 @@ export { createVoiceTurnQualityViewModel, defineVoiceTurnQualityElement, getVoic
25
25
  export { createVoiceTurnLatencyViewModel, defineVoiceTurnLatencyElement, mountVoiceTurnLatency, renderVoiceTurnLatencyHTML } from './turnLatencyWidget';
26
26
  export { createVoiceTraceTimelineViewModel, defineVoiceTraceTimelineElement, getVoiceTraceTimelineCSS, mountVoiceTraceTimeline, renderVoiceTraceTimelineWidgetHTML } from './traceTimelineWidget';
27
27
  export { createVoiceWorkflowStatusStore, fetchVoiceWorkflowStatus } from './workflowStatus';
28
- export type { VoiceAppKitStatusClientOptions, VoiceAppKitStatusSnapshot } from './appKitStatus';
28
+ export type { VoiceOpsStatusClientOptions, VoiceOpsStatusSnapshot } from './opsStatus';
29
29
  export type { VoiceBargeInMonitorOptions } from './bargeInMonitor';
30
30
  export type { VoiceLiveTurnLatencyEvent, VoiceLiveTurnLatencyMonitorOptions, VoiceLiveTurnLatencySnapshot, VoiceLiveTurnLatencyStatus } from './liveTurnLatency';
31
31
  export type { VoiceOpsStatusSurfaceView, VoiceOpsStatusViewModel, VoiceOpsStatusWidgetOptions } from './opsStatusWidget';
@@ -1852,16 +1852,16 @@ var createVoiceLiveTurnLatencyMonitor = (options = {}) => {
1852
1852
  }
1853
1853
  };
1854
1854
  };
1855
- // src/client/appKitStatus.ts
1856
- var fetchVoiceAppKitStatus = async (path = "/app-kit/status", options = {}) => {
1855
+ // src/client/opsStatus.ts
1856
+ var fetchVoiceOpsStatus = async (path = "/api/voice/ops-status", options = {}) => {
1857
1857
  const fetchImpl = options.fetch ?? globalThis.fetch;
1858
1858
  const response = await fetchImpl(path);
1859
1859
  if (!response.ok) {
1860
- throw new Error(`Voice app kit status failed: HTTP ${response.status}`);
1860
+ throw new Error(`Voice ops status failed: HTTP ${response.status}`);
1861
1861
  }
1862
1862
  return await response.json();
1863
1863
  };
1864
- var createVoiceAppKitStatusStore = (path = "/app-kit/status", options = {}) => {
1864
+ var createVoiceOpsStatusStore = (path = "/api/voice/ops-status", options = {}) => {
1865
1865
  const listeners = new Set;
1866
1866
  let closed = false;
1867
1867
  let timer;
@@ -1885,7 +1885,7 @@ var createVoiceAppKitStatusStore = (path = "/app-kit/status", options = {}) => {
1885
1885
  };
1886
1886
  emit();
1887
1887
  try {
1888
- const report = await fetchVoiceAppKitStatus(path, options);
1888
+ const report = await fetchVoiceOpsStatus(path, options);
1889
1889
  snapshot = {
1890
1890
  error: null,
1891
1891
  isLoading: false,
@@ -1932,7 +1932,7 @@ var createVoiceAppKitStatusStore = (path = "/app-kit/status", options = {}) => {
1932
1932
  };
1933
1933
  // src/client/opsStatusWidget.ts
1934
1934
  var DEFAULT_TITLE = "Voice Ops Status";
1935
- var DEFAULT_DESCRIPTION = "Certified workflow, provider, and handoff readiness from the AbsoluteJS voice app kit.";
1935
+ var DEFAULT_DESCRIPTION = "Certified workflow, provider, and handoff readiness from your AbsoluteJS voice app.";
1936
1936
  var SURFACE_LABELS = {
1937
1937
  handoffs: "Handoffs",
1938
1938
  providers: "Providers",
@@ -2017,8 +2017,8 @@ var renderVoiceOpsStatusHTML = (snapshot, options = {}) => {
2017
2017
  </section>`;
2018
2018
  };
2019
2019
  var getVoiceOpsStatusCSS = () => `.absolute-voice-ops-status{border:1px solid #d8d2c4;border-radius:20px;background:#fffaf0;color:#16130d;padding:18px;box-shadow:0 18px 40px rgba(47,37,18,.12);font-family:inherit}.absolute-voice-ops-status--fail,.absolute-voice-ops-status--error{border-color:#f2a7a7;background:#fff5f3}.absolute-voice-ops-status__header{align-items:start;display:flex;gap:12px;justify-content:space-between}.absolute-voice-ops-status__eyebrow{color:#73664f;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.absolute-voice-ops-status__label{font-size:28px;line-height:1}.absolute-voice-ops-status__description{color:#514733;margin:12px 0 0}.absolute-voice-ops-status__summary,.absolute-voice-ops-status__links{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.absolute-voice-ops-status__summary span,.absolute-voice-ops-status__links a{border:1px solid #e6ddca;border-radius:999px;color:inherit;padding:6px 10px;text-decoration:none}.absolute-voice-ops-status__surfaces{display:grid;gap:8px;list-style:none;margin:16px 0 0;padding:0}.absolute-voice-ops-status__surface{align-items:center;background:#fff;border:1px solid #eee4d2;border-radius:14px;display:flex;gap:12px;justify-content:space-between;padding:10px 12px}.absolute-voice-ops-status__surface--fail{border-color:#f2a7a7}.absolute-voice-ops-status__surface span{color:#655944}.absolute-voice-ops-status__error{color:#9f1239;font-weight:700}`;
2020
- var mountVoiceOpsStatus = (element, path = "/app-kit/status", options = {}) => {
2021
- const store = createVoiceAppKitStatusStore(path, options);
2020
+ var mountVoiceOpsStatus = (element, path = "/api/voice/ops-status", options = {}) => {
2021
+ const store = createVoiceOpsStatusStore(path, options);
2022
2022
  const render = () => {
2023
2023
  element.innerHTML = renderVoiceOpsStatusHTML(store.getSnapshot(), options);
2024
2024
  };
@@ -2041,7 +2041,7 @@ var defineVoiceOpsStatusElement = (tagName = "absolute-voice-ops-status") => {
2041
2041
  mounted;
2042
2042
  connectedCallback() {
2043
2043
  const intervalMs = Number(this.getAttribute("interval-ms") ?? 5000);
2044
- this.mounted = mountVoiceOpsStatus(this, this.getAttribute("path") ?? "/app-kit/status", {
2044
+ this.mounted = mountVoiceOpsStatus(this, this.getAttribute("path") ?? "/api/voice/ops-status", {
2045
2045
  description: this.getAttribute("description") ?? undefined,
2046
2046
  includeLinks: this.getAttribute("include-links") !== "false",
2047
2047
  intervalMs: Number.isFinite(intervalMs) ? intervalMs : 5000,
@@ -3571,8 +3571,8 @@ export {
3571
3571
  fetchVoiceRoutingStatus,
3572
3572
  fetchVoiceProviderStatus,
3573
3573
  fetchVoiceProviderCapabilities,
3574
+ fetchVoiceOpsStatus,
3574
3575
  fetchVoiceCampaignDialerProofStatus,
3575
- fetchVoiceAppKitStatus,
3576
3576
  defineVoiceTurnQualityElement,
3577
3577
  defineVoiceTurnLatencyElement,
3578
3578
  defineVoiceTraceTimelineElement,
@@ -3599,6 +3599,7 @@ export {
3599
3599
  createVoiceProviderCapabilitiesViewModel,
3600
3600
  createVoiceProviderCapabilitiesStore,
3601
3601
  createVoiceOpsStatusViewModel,
3602
+ createVoiceOpsStatusStore,
3602
3603
  createVoiceLiveTurnLatencyMonitor,
3603
3604
  createVoiceDuplexController,
3604
3605
  createVoiceController,
@@ -3606,7 +3607,6 @@ export {
3606
3607
  createVoiceCampaignDialerProofStore,
3607
3608
  createVoiceBargeInMonitor,
3608
3609
  createVoiceAudioPlayer,
3609
- createVoiceAppKitStatusStore,
3610
3610
  createMicrophoneCapture,
3611
3611
  bindVoiceProviderSimulationControls,
3612
3612
  bindVoiceHTMX,
@@ -0,0 +1,19 @@
1
+ import type { VoiceOpsStatusReport } from '../opsStatus';
2
+ export type VoiceOpsStatusClientOptions = {
3
+ fetch?: typeof fetch;
4
+ intervalMs?: number;
5
+ };
6
+ export type VoiceOpsStatusSnapshot = {
7
+ error: string | null;
8
+ isLoading: boolean;
9
+ report?: VoiceOpsStatusReport;
10
+ updatedAt?: number;
11
+ };
12
+ export declare const fetchVoiceOpsStatus: (path?: string, options?: Pick<VoiceOpsStatusClientOptions, "fetch">) => Promise<VoiceOpsStatusReport>;
13
+ export declare const createVoiceOpsStatusStore: (path?: string, options?: VoiceOpsStatusClientOptions) => {
14
+ close: () => void;
15
+ getServerSnapshot: () => VoiceOpsStatusSnapshot;
16
+ getSnapshot: () => VoiceOpsStatusSnapshot;
17
+ refresh: () => Promise<VoiceOpsStatusReport | undefined>;
18
+ subscribe: (listener: () => void) => () => void;
19
+ };
@@ -1,5 +1,5 @@
1
- import type { VoiceAppKitStatusReport } from '../appKit';
2
- import { type VoiceAppKitStatusClientOptions, type VoiceAppKitStatusSnapshot } from './appKitStatus';
1
+ import type { VoiceOpsStatusReport } from '../opsStatus';
2
+ import { type VoiceOpsStatusClientOptions, type VoiceOpsStatusSnapshot } from './opsStatus';
3
3
  export type VoiceOpsStatusSurfaceView = {
4
4
  detail: string;
5
5
  failed: number;
@@ -24,17 +24,17 @@ export type VoiceOpsStatusViewModel = {
24
24
  total: number;
25
25
  updatedAt?: number;
26
26
  };
27
- export type VoiceOpsStatusWidgetOptions = VoiceAppKitStatusClientOptions & {
27
+ export type VoiceOpsStatusWidgetOptions = VoiceOpsStatusClientOptions & {
28
28
  description?: string;
29
29
  includeLinks?: boolean;
30
30
  title?: string;
31
31
  };
32
- export declare const getVoiceOpsStatusLabel: (report?: VoiceAppKitStatusReport | null, error?: string | null) => "Needs attention" | "Passing" | "Unavailable" | "Checking";
33
- export declare const createVoiceOpsStatusViewModel: (snapshot: VoiceAppKitStatusSnapshot, options?: VoiceOpsStatusWidgetOptions) => VoiceOpsStatusViewModel;
34
- export declare const renderVoiceOpsStatusHTML: (snapshot: VoiceAppKitStatusSnapshot, options?: VoiceOpsStatusWidgetOptions) => string;
32
+ export declare const getVoiceOpsStatusLabel: (report?: VoiceOpsStatusReport | null, error?: string | null) => "Needs attention" | "Passing" | "Unavailable" | "Checking";
33
+ export declare const createVoiceOpsStatusViewModel: (snapshot: VoiceOpsStatusSnapshot, options?: VoiceOpsStatusWidgetOptions) => VoiceOpsStatusViewModel;
34
+ export declare const renderVoiceOpsStatusHTML: (snapshot: VoiceOpsStatusSnapshot, options?: VoiceOpsStatusWidgetOptions) => string;
35
35
  export declare const getVoiceOpsStatusCSS: () => string;
36
36
  export declare const mountVoiceOpsStatus: (element: Element, path?: string, options?: VoiceOpsStatusWidgetOptions) => {
37
37
  close: () => void;
38
- refresh: () => Promise<VoiceAppKitStatusReport | undefined>;
38
+ refresh: () => Promise<VoiceOpsStatusReport | undefined>;
39
39
  };
40
40
  export declare const defineVoiceOpsStatusElement: (tagName?: string) => void;
@@ -0,0 +1,47 @@
1
+ import type { VoiceCampaignStore } from './campaign';
2
+ import { type VoiceAuditActor, type VoiceAuditEventStore } from './audit';
3
+ import type { VoiceAuditSinkDeliveryStore } from './auditSinks';
4
+ import type { VoiceIntegrationEventStore, VoiceOpsTaskStore } from './ops';
5
+ import type { VoiceCallReviewStore } from './testing/review';
6
+ import type { VoiceTraceEventStore, VoiceTracePruneFilter, VoiceTraceSinkDeliveryStore } from './trace';
7
+ import type { VoiceSessionStore } from './types';
8
+ export type VoiceDataRetentionScope = 'auditDeliveries' | 'campaigns' | 'events' | 'reviews' | 'sessions' | 'tasks' | 'traceDeliveries' | 'traces';
9
+ export type VoiceDataRetentionStores = {
10
+ campaigns?: VoiceCampaignStore;
11
+ events?: VoiceIntegrationEventStore;
12
+ reviews?: VoiceCallReviewStore;
13
+ session?: VoiceSessionStore;
14
+ sessions?: VoiceSessionStore;
15
+ tasks?: VoiceOpsTaskStore;
16
+ traceDeliveries?: VoiceTraceSinkDeliveryStore;
17
+ traces?: VoiceTraceEventStore;
18
+ };
19
+ export type VoiceDataRetentionPolicy = VoiceDataRetentionStores & {
20
+ audit?: VoiceAuditEventStore;
21
+ auditDeliveries?: VoiceAuditSinkDeliveryStore;
22
+ auditActor?: VoiceAuditActor;
23
+ before?: number;
24
+ beforeOrAt?: number;
25
+ dryRun?: boolean;
26
+ keepNewest?: Partial<Record<VoiceDataRetentionScope, number>>;
27
+ limit?: number;
28
+ scopes?: VoiceDataRetentionScope[];
29
+ traceFilter?: VoiceTracePruneFilter;
30
+ };
31
+ export type VoiceDataRetentionScopeReport = {
32
+ deletedIds: string[];
33
+ deletedCount: number;
34
+ dryRun: boolean;
35
+ keepNewest?: number;
36
+ scannedCount: number;
37
+ scope: VoiceDataRetentionScope;
38
+ skippedReason?: 'missing-store' | 'missing-selector';
39
+ };
40
+ export type VoiceDataRetentionReport = {
41
+ checkedAt: number;
42
+ deletedCount: number;
43
+ dryRun: boolean;
44
+ scopes: VoiceDataRetentionScopeReport[];
45
+ };
46
+ export declare const applyVoiceDataRetentionPolicy: (options: VoiceDataRetentionPolicy) => Promise<VoiceDataRetentionReport>;
47
+ export declare const buildVoiceDataRetentionPlan: (options: Omit<VoiceDataRetentionPolicy, "dryRun">) => Promise<VoiceDataRetentionReport>;
@@ -0,0 +1,98 @@
1
+ import { Elysia } from 'elysia';
2
+ import type { VoiceOpsStatusReport } from './opsStatus';
3
+ import type { VoicePhoneAgentProductionSmokeReport } from './phoneAgentProductionSmoke';
4
+ import type { VoicePhoneAgentSetupReport } from './phoneAgent';
5
+ import type { VoiceProductionReadinessReport } from './productionReadiness';
6
+ export type VoiceDemoReadyStatus = 'fail' | 'pass' | 'warn';
7
+ export type VoiceDemoReadySection = {
8
+ description?: string;
9
+ href?: string;
10
+ label: string;
11
+ status: VoiceDemoReadyStatus;
12
+ value?: number | string;
13
+ };
14
+ export type VoiceDemoReadyReport = {
15
+ checkedAt: number;
16
+ sections: VoiceDemoReadySection[];
17
+ status: VoiceDemoReadyStatus;
18
+ summary: {
19
+ opsStatus?: Pick<VoiceOpsStatusReport, 'failed' | 'passed' | 'status' | 'total'>;
20
+ phoneSetup?: {
21
+ carriers: number;
22
+ ready: boolean;
23
+ };
24
+ phoneSmoke?: {
25
+ issues: number;
26
+ pass: boolean;
27
+ provider?: string;
28
+ sessionId?: string;
29
+ };
30
+ productionReadiness?: {
31
+ checks: number;
32
+ status: VoiceProductionReadinessReport['status'];
33
+ };
34
+ };
35
+ title: string;
36
+ };
37
+ type VoiceDemoReadyLoader<TValue> = TValue | ((input: {
38
+ query: Record<string, unknown>;
39
+ request: Request;
40
+ }) => Promise<TValue | undefined> | TValue | undefined);
41
+ export type VoiceDemoReadyRoutesOptions = {
42
+ opsStatus?: false | {
43
+ href?: string;
44
+ load: VoiceDemoReadyLoader<VoiceOpsStatusReport>;
45
+ };
46
+ headers?: HeadersInit;
47
+ htmlPath?: false | string;
48
+ name?: string;
49
+ path?: string;
50
+ phoneSetup?: false | {
51
+ href?: string;
52
+ load: VoiceDemoReadyLoader<VoicePhoneAgentSetupReport>;
53
+ };
54
+ phoneSmoke?: false | {
55
+ href?: string;
56
+ load: VoiceDemoReadyLoader<VoicePhoneAgentProductionSmokeReport>;
57
+ };
58
+ productionReadiness?: false | {
59
+ href?: string;
60
+ load: VoiceDemoReadyLoader<VoiceProductionReadinessReport>;
61
+ };
62
+ render?: (report: VoiceDemoReadyReport) => Promise<string> | string;
63
+ title?: string;
64
+ };
65
+ export declare const buildVoiceDemoReadyReport: (options: VoiceDemoReadyRoutesOptions, input?: {
66
+ query?: Record<string, unknown>;
67
+ request?: Request;
68
+ }) => Promise<VoiceDemoReadyReport>;
69
+ export declare const renderVoiceDemoReadyHTML: (report: VoiceDemoReadyReport) => string;
70
+ export declare const createVoiceDemoReadyRoutes: (options: VoiceDemoReadyRoutesOptions) => Elysia<"", {
71
+ decorator: {};
72
+ store: {};
73
+ derive: {};
74
+ resolve: {};
75
+ }, {
76
+ typebox: {};
77
+ error: {};
78
+ }, {
79
+ schema: {};
80
+ standaloneSchema: {};
81
+ macro: {};
82
+ macroFn: {};
83
+ parser: {};
84
+ response: {};
85
+ }, {}, {
86
+ derive: {};
87
+ resolve: {};
88
+ schema: {};
89
+ standaloneSchema: {};
90
+ response: {};
91
+ }, {
92
+ derive: {};
93
+ resolve: {};
94
+ schema: {};
95
+ standaloneSchema: {};
96
+ response: {};
97
+ }>;
98
+ export {};
@@ -1,3 +1,5 @@
1
+ import { type StoredVoiceAuditEvent, type VoiceAuditEventStore } from './audit';
2
+ import type { VoiceAuditSinkDeliveryRecord, VoiceAuditSinkDeliveryStore } from './auditSinks';
1
3
  import type { VoiceCampaignStore } from './campaign';
2
4
  import { type VoiceAssistantMemoryRecord, type VoiceAssistantMemoryStore } from './assistantMemory';
3
5
  import { type StoredVoiceTraceEvent, type VoiceTraceSinkDeliveryRecord, type VoiceTraceSinkDeliveryStore, type VoiceTraceEventStore } from './trace';
@@ -8,7 +10,9 @@ export type VoiceFileStoreOptions = {
8
10
  directory: string;
9
11
  pretty?: boolean;
10
12
  };
11
- export type VoiceFileRuntimeStorage<TSession extends VoiceSessionRecord = VoiceSessionRecord, TReview extends StoredVoiceCallReviewArtifact = StoredVoiceCallReviewArtifact, TTask extends StoredVoiceOpsTask = StoredVoiceOpsTask, TEvent extends StoredVoiceIntegrationEvent = StoredVoiceIntegrationEvent, TMapping extends StoredVoiceExternalObjectMap = StoredVoiceExternalObjectMap, TTrace extends StoredVoiceTraceEvent = StoredVoiceTraceEvent, TTraceDelivery extends VoiceTraceSinkDeliveryRecord = VoiceTraceSinkDeliveryRecord, TMemory extends VoiceAssistantMemoryRecord = VoiceAssistantMemoryRecord> = {
13
+ export type VoiceFileRuntimeStorage<TSession extends VoiceSessionRecord = VoiceSessionRecord, TReview extends StoredVoiceCallReviewArtifact = StoredVoiceCallReviewArtifact, TTask extends StoredVoiceOpsTask = StoredVoiceOpsTask, TEvent extends StoredVoiceIntegrationEvent = StoredVoiceIntegrationEvent, TMapping extends StoredVoiceExternalObjectMap = StoredVoiceExternalObjectMap, TTrace extends StoredVoiceTraceEvent = StoredVoiceTraceEvent, TTraceDelivery extends VoiceTraceSinkDeliveryRecord = VoiceTraceSinkDeliveryRecord, TAudit extends StoredVoiceAuditEvent = StoredVoiceAuditEvent, TAuditDelivery extends VoiceAuditSinkDeliveryRecord = VoiceAuditSinkDeliveryRecord, TMemory extends VoiceAssistantMemoryRecord = VoiceAssistantMemoryRecord> = {
14
+ audit: VoiceAuditEventStore<TAudit>;
15
+ auditDeliveries: VoiceAuditSinkDeliveryStore<TAuditDelivery>;
12
16
  campaigns: VoiceCampaignStore;
13
17
  events: VoiceIntegrationEventStore<TEvent>;
14
18
  externalObjects: VoiceExternalObjectMapStore<TMapping>;
@@ -27,8 +31,10 @@ export declare const createVoiceFileIntegrationEventStore: <TEvent extends Store
27
31
  export declare const createVoiceFileExternalObjectMapStore: <TMapping extends StoredVoiceExternalObjectMap = StoredVoiceExternalObjectMap>(options: VoiceFileStoreOptions) => VoiceExternalObjectMapStore<TMapping>;
28
32
  export declare const createVoiceFileTraceEventStore: <TEvent extends StoredVoiceTraceEvent = StoredVoiceTraceEvent>(options: VoiceFileStoreOptions) => VoiceTraceEventStore<TEvent>;
29
33
  export declare const createVoiceFileTraceSinkDeliveryStore: <TDelivery extends VoiceTraceSinkDeliveryRecord = VoiceTraceSinkDeliveryRecord>(options: VoiceFileStoreOptions) => VoiceTraceSinkDeliveryStore<TDelivery>;
34
+ export declare const createVoiceFileAuditEventStore: <TEvent extends StoredVoiceAuditEvent = StoredVoiceAuditEvent>(options: VoiceFileStoreOptions) => VoiceAuditEventStore<TEvent>;
35
+ export declare const createVoiceFileAuditSinkDeliveryStore: <TDelivery extends VoiceAuditSinkDeliveryRecord = VoiceAuditSinkDeliveryRecord>(options: VoiceFileStoreOptions) => VoiceAuditSinkDeliveryStore<TDelivery>;
30
36
  export declare const createVoiceFileAssistantMemoryStore: <TRecord extends VoiceAssistantMemoryRecord = VoiceAssistantMemoryRecord>(options: VoiceFileStoreOptions) => VoiceAssistantMemoryStore<TRecord>;
31
- export declare const createVoiceFileRuntimeStorage: <TSession extends VoiceSessionRecord = VoiceSessionRecord, TReview extends StoredVoiceCallReviewArtifact = StoredVoiceCallReviewArtifact, TTask extends StoredVoiceOpsTask = StoredVoiceOpsTask, TEvent extends StoredVoiceIntegrationEvent = StoredVoiceIntegrationEvent, TMapping extends StoredVoiceExternalObjectMap = StoredVoiceExternalObjectMap, TTrace extends StoredVoiceTraceEvent = StoredVoiceTraceEvent, TTraceDelivery extends VoiceTraceSinkDeliveryRecord = VoiceTraceSinkDeliveryRecord, TMemory extends VoiceAssistantMemoryRecord = VoiceAssistantMemoryRecord>(options: VoiceFileStoreOptions) => VoiceFileRuntimeStorage<TSession, TReview, TTask, TEvent, TMapping, TTrace, TTraceDelivery, TMemory>;
37
+ export declare const createVoiceFileRuntimeStorage: <TSession extends VoiceSessionRecord = VoiceSessionRecord, TReview extends StoredVoiceCallReviewArtifact = StoredVoiceCallReviewArtifact, TTask extends StoredVoiceOpsTask = StoredVoiceOpsTask, TEvent extends StoredVoiceIntegrationEvent = StoredVoiceIntegrationEvent, TMapping extends StoredVoiceExternalObjectMap = StoredVoiceExternalObjectMap, TTrace extends StoredVoiceTraceEvent = StoredVoiceTraceEvent, TTraceDelivery extends VoiceTraceSinkDeliveryRecord = VoiceTraceSinkDeliveryRecord, TAudit extends StoredVoiceAuditEvent = StoredVoiceAuditEvent, TAuditDelivery extends VoiceAuditSinkDeliveryRecord = VoiceAuditSinkDeliveryRecord, TMemory extends VoiceAssistantMemoryRecord = VoiceAssistantMemoryRecord>(options: VoiceFileStoreOptions) => VoiceFileRuntimeStorage<TSession, TReview, TTask, TEvent, TMapping, TTrace, TTraceDelivery, TAudit, TAuditDelivery, TMemory>;
32
38
  export declare const createStoredVoiceCallReviewArtifact: <TArtifact extends VoiceCallReviewArtifact = VoiceCallReviewArtifact>(id: string, artifact: TArtifact) => TArtifact & {
33
39
  id: string;
34
40
  };