@absolutejs/voice 0.0.22-beta.278 → 0.0.22-beta.279
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -2
- package/dist/index.js +122 -1
- package/dist/productionReadiness.d.ts +13 -1
- package/dist/voiceMonitoring.d.ts +73 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export { assertVoiceProviderRoutingContractEvidence, assertVoiceProviderRoutingC
|
|
|
53
53
|
export { assertVoiceProviderSloEvidence, buildVoiceProviderSloReport, createVoiceProviderSloRoutes, evaluateVoiceProviderSloEvidence, renderVoiceProviderSloHTML, renderVoiceProviderSloMarkdown } from './providerSlo';
|
|
54
54
|
export { createVoicePhoneAgentProductionSmokeHTMLHandler, createVoicePhoneAgentProductionSmokeJSONHandler, createVoicePhoneAgentProductionSmokeRoutes, renderVoicePhoneAgentProductionSmokeHTML, runVoicePhoneAgentProductionSmokeContract } from './phoneAgentProductionSmoke';
|
|
55
55
|
export { assertVoiceProductionReadinessEvidence, buildVoiceProductionReadinessGate, buildVoiceProductionReadinessReport, createVoiceProductionReadinessRoutes, evaluateVoiceProductionReadinessEvidence, renderVoiceProductionReadinessHTML, summarizeVoiceProductionReadinessGate } from './productionReadiness';
|
|
56
|
-
export { acknowledgeVoiceMonitorIssue, buildVoiceMonitorRunReport, createVoiceMemoryMonitorIssueStore, createVoiceMonitorRoutes, muteVoiceMonitorIssue, renderVoiceMonitorHTML, renderVoiceMonitorMarkdown, resolveVoiceMonitorIssue } from './voiceMonitoring';
|
|
56
|
+
export { acknowledgeVoiceMonitorIssue, buildVoiceMonitorRunReport, createVoiceMemoryMonitorIssueStore, createVoiceMemoryMonitorNotifierDeliveryReceiptStore, createVoiceMonitorRoutes, createVoiceMonitorWebhookNotifier, deliverVoiceMonitorIssueNotifications, muteVoiceMonitorIssue, renderVoiceMonitorHTML, renderVoiceMonitorMarkdown, resolveVoiceMonitorIssue } from './voiceMonitoring';
|
|
57
57
|
export { createVoiceReadinessProfile, recommendVoiceReadinessProfile } from './readinessProfiles';
|
|
58
58
|
export { assertVoiceProviderContractMatrixEvidence, assertVoiceProviderStackEvidence, buildVoiceProviderContractMatrix, createVoiceProviderContractMatrixHTMLHandler, createVoiceProviderContractMatrixJSONHandler, createVoiceProviderContractMatrixPreset, createVoiceProviderContractMatrixRoutes, evaluateVoiceProviderContractMatrixEvidence, evaluateVoiceProviderStackEvidence, evaluateVoiceProviderStackGaps, renderVoiceProviderContractMatrixHTML, recommendVoiceProviderStack } from './providerStackRecommendations';
|
|
59
59
|
export { buildVoiceOpsConsoleReport, createVoiceOpsConsoleRoutes, renderVoiceOpsConsoleHTML } from './opsConsoleRoutes';
|
|
@@ -122,7 +122,7 @@ export type { VoicePhoneAgentProductionSmokeIssue, VoicePhoneAgentProductionSmok
|
|
|
122
122
|
export type { VoiceOpsConsoleLink, VoiceOpsConsoleReport, VoiceOpsConsoleRoutesOptions } from './opsConsoleRoutes';
|
|
123
123
|
export type { VoiceOpsStatus, VoiceOpsStatusLink, VoiceOpsStatusOptions, VoiceOpsStatusReport, VoiceOpsStatusRoutesOptions } from './opsStatus';
|
|
124
124
|
export type { VoiceProductionReadinessAction, VoiceProductionReadinessAuditOptions, VoiceProductionReadinessAuditRequirement, VoiceProductionReadinessAuditSummary, VoiceProductionReadinessAssertionInput, VoiceProductionReadinessAssertionReport, VoiceProductionReadinessCheck, VoiceProductionReadinessGateIssue, VoiceProductionReadinessGateOptions, VoiceProductionReadinessGateProfile, VoiceProductionReadinessGateProfileSurface, VoiceProductionReadinessGateReport, VoiceProductionReadinessOpsActionHistoryOptions, VoiceProductionReadinessOpsActionHistorySummary, VoiceProductionReadinessOperationsRecordLink, VoiceProductionReadinessOperationsRecordLinks, VoiceProductionReadinessProfileExplanation, VoiceProductionReadinessProfileSurface, VoiceProductionReadinessProofSource, VoiceProductionReadinessReport, VoiceProductionReadinessRoutesOptions, VoiceProductionReadinessTraceDeliverySummary, VoiceProductionReadinessAuditDeliveryOptions, VoiceProductionReadinessAuditDeliverySummary, VoiceProductionReadinessTraceDeliveryOptions, VoiceProductionReadinessStatus } from './productionReadiness';
|
|
125
|
-
export type { VoiceMonitorDefinition, VoiceMonitorEvaluation, VoiceMonitorEvaluationInput, VoiceMonitorIssue, VoiceMonitorIssueStatus, VoiceMonitorIssueStore, VoiceMonitorRoutesOptions, VoiceMonitorRun, VoiceMonitorRunOptions, VoiceMonitorRunReport, VoiceMonitorSeverity, VoiceMonitorStatus } from './voiceMonitoring';
|
|
125
|
+
export type { VoiceMonitorDefinition, VoiceMonitorEvaluation, VoiceMonitorEvaluationInput, VoiceMonitorIssue, VoiceMonitorIssueStatus, VoiceMonitorIssueStore, VoiceMonitorNotifier, VoiceMonitorNotifierDeliveryInput, VoiceMonitorNotifierDeliveryOptions, VoiceMonitorNotifierDeliveryReceipt, VoiceMonitorNotifierDeliveryReceiptStore, VoiceMonitorNotifierDeliveryReport, VoiceMonitorNotifierDeliveryResult, VoiceMonitorRoutesOptions, VoiceMonitorRun, VoiceMonitorRunOptions, VoiceMonitorRunReport, VoiceMonitorSeverity, VoiceMonitorStatus, VoiceMonitorWebhookNotifierOptions } from './voiceMonitoring';
|
|
126
126
|
export type { VoiceReadinessProfileName, VoiceReadinessProfileOptions, VoiceReadinessProfileRecommendation, VoiceReadinessProfileRecommendationScore, VoiceReadinessProfileRoutesOptions } from './readinessProfiles';
|
|
127
127
|
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';
|
|
128
128
|
export type { VoiceOperationsRecord, VoiceOperationsRecordAgentHandoff, VoiceOperationsRecordAuditSummary, VoiceOperationsRecordGuardrailAssertionInput, VoiceOperationsRecordGuardrailAssertionReport, VoiceOperationsRecordGuardrailDecision, VoiceOperationsRecordGuardrailFinding, VoiceOperationsRecordGuardrailSummary, VoiceOperationsRecordIntegrationEventSummary, VoiceOperationsRecordOptions, VoiceOperationsRecordOutcome, VoiceOperationsRecordProviderDecision, VoiceOperationsRecordReviewSummary, VoiceOperationsRecordRoutesOptions, VoiceOperationsRecordStatus, VoiceOperationsRecordTaskSummary, VoiceOperationsRecordTranscriptTurn, VoiceOperationsRecordTool } from './operationsRecord';
|
package/dist/index.js
CHANGED
|
@@ -27334,6 +27334,12 @@ var resolveMonitoring = async (options, input) => {
|
|
|
27334
27334
|
}
|
|
27335
27335
|
return typeof options.monitoring === "function" ? await options.monitoring(input) : options.monitoring;
|
|
27336
27336
|
};
|
|
27337
|
+
var resolveMonitoringNotifierDelivery = async (options, input) => {
|
|
27338
|
+
if (options.monitoringNotifierDelivery === false || options.monitoringNotifierDelivery === undefined) {
|
|
27339
|
+
return;
|
|
27340
|
+
}
|
|
27341
|
+
return typeof options.monitoringNotifierDelivery === "function" ? await options.monitoringNotifierDelivery(input) : options.monitoringNotifierDelivery;
|
|
27342
|
+
};
|
|
27337
27343
|
var isVoiceTelephonyWebhookSecurityReport = (value) => typeof value.generatedAt === "number" && Array.isArray(value.providers) && typeof value.status === "string";
|
|
27338
27344
|
var resolveTelephonyWebhookSecurity = async (options, input) => {
|
|
27339
27345
|
if (options.telephonyWebhookSecurity === false || options.telephonyWebhookSecurity === undefined) {
|
|
@@ -27705,6 +27711,7 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
27705
27711
|
providerContractMatrix,
|
|
27706
27712
|
phoneAgentSmokes,
|
|
27707
27713
|
monitoring,
|
|
27714
|
+
monitoringNotifierDelivery,
|
|
27708
27715
|
telephonyWebhookSecurity,
|
|
27709
27716
|
reconnectContracts,
|
|
27710
27717
|
bargeInReports,
|
|
@@ -27745,6 +27752,7 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
27745
27752
|
resolveProviderContractMatrix(options, { query, request }),
|
|
27746
27753
|
resolvePhoneAgentSmokes(options, { query, request }),
|
|
27747
27754
|
resolveMonitoring(options, { query, request }),
|
|
27755
|
+
resolveMonitoringNotifierDelivery(options, { query, request }),
|
|
27748
27756
|
resolveTelephonyWebhookSecurity(options, { query, request }),
|
|
27749
27757
|
resolveReconnectContracts(options, { query, request }),
|
|
27750
27758
|
resolveBargeInReports(options, { query, request }),
|
|
@@ -27959,6 +27967,13 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
27959
27967
|
status: monitoring.status,
|
|
27960
27968
|
total: monitoring.summary.total
|
|
27961
27969
|
} : undefined;
|
|
27970
|
+
const monitoringNotifierDeliverySummary = monitoringNotifierDelivery ? {
|
|
27971
|
+
failed: monitoringNotifierDelivery.summary.failed,
|
|
27972
|
+
notifiers: monitoringNotifierDelivery.summary.notifiers,
|
|
27973
|
+
sent: monitoringNotifierDelivery.summary.sent,
|
|
27974
|
+
status: monitoringNotifierDelivery.status,
|
|
27975
|
+
total: monitoringNotifierDelivery.summary.total
|
|
27976
|
+
} : undefined;
|
|
27962
27977
|
const telephonyWebhookSecuritySummary = telephonyWebhookSecurity ? {
|
|
27963
27978
|
enabled: telephonyWebhookSecurity.summary.enabled,
|
|
27964
27979
|
failed: telephonyWebhookSecurity.summary.failed,
|
|
@@ -28371,6 +28386,22 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
28371
28386
|
]
|
|
28372
28387
|
});
|
|
28373
28388
|
}
|
|
28389
|
+
if (monitoringNotifierDelivery && monitoringNotifierDeliverySummary) {
|
|
28390
|
+
checks.push({
|
|
28391
|
+
detail: monitoringNotifierDeliverySummary.status === "pass" ? `${monitoringNotifierDeliverySummary.sent} monitor notification(s) delivered.` : `${monitoringNotifierDeliverySummary.failed} monitor notification delivery failure(s).`,
|
|
28392
|
+
href: options.links?.monitoringNotifierDelivery ?? "/api/voice/monitor-issues/notifications",
|
|
28393
|
+
label: "Monitor notifier delivery",
|
|
28394
|
+
status: monitoringNotifierDeliverySummary.status,
|
|
28395
|
+
value: `${monitoringNotifierDeliverySummary.sent}/${monitoringNotifierDeliverySummary.total}`,
|
|
28396
|
+
actions: monitoringNotifierDeliverySummary.status === "pass" ? [] : [
|
|
28397
|
+
{
|
|
28398
|
+
description: "Open monitor notification receipts and confirm webhook, Slack, email, or audit destinations are receiving issue alerts.",
|
|
28399
|
+
href: options.links?.monitoringNotifierDelivery ?? "/api/voice/monitor-issues/notifications",
|
|
28400
|
+
label: "Open monitor notification receipts"
|
|
28401
|
+
}
|
|
28402
|
+
]
|
|
28403
|
+
});
|
|
28404
|
+
}
|
|
28374
28405
|
return {
|
|
28375
28406
|
checkedAt: Date.now(),
|
|
28376
28407
|
checks,
|
|
@@ -28389,6 +28420,7 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
28389
28420
|
observabilityExport: "/voice/observability-export",
|
|
28390
28421
|
observabilityExportDeliveries: "/api/voice/observability-export/deliveries",
|
|
28391
28422
|
monitoring: "/voice/monitors",
|
|
28423
|
+
monitoringNotifierDelivery: "/api/voice/monitor-issues/notifications",
|
|
28392
28424
|
opsActions: "/voice/ops-actions",
|
|
28393
28425
|
opsRecovery: "/ops-recovery",
|
|
28394
28426
|
phoneAgentSmoke: "/sessions",
|
|
@@ -28421,6 +28453,7 @@ var buildVoiceProductionReadinessReport = async (options, input = {}) => {
|
|
|
28421
28453
|
},
|
|
28422
28454
|
liveLatency,
|
|
28423
28455
|
monitoring: monitoringSummary,
|
|
28456
|
+
monitoringNotifierDelivery: monitoringNotifierDeliverySummary,
|
|
28424
28457
|
opsActionHistory,
|
|
28425
28458
|
opsRecovery: opsRecovery ? {
|
|
28426
28459
|
issues: opsRecovery.issues.length,
|
|
@@ -28565,6 +28598,16 @@ var createVoiceMemoryMonitorIssueStore = (initial = []) => {
|
|
|
28565
28598
|
}
|
|
28566
28599
|
};
|
|
28567
28600
|
};
|
|
28601
|
+
var createVoiceMemoryMonitorNotifierDeliveryReceiptStore = (initial = []) => {
|
|
28602
|
+
const receipts = new Map(initial.map((receipt) => [receipt.id, { ...receipt }]));
|
|
28603
|
+
return {
|
|
28604
|
+
list: () => Array.from(receipts.values()).map((receipt) => ({ ...receipt })),
|
|
28605
|
+
set: (id, receipt) => {
|
|
28606
|
+
receipts.set(id, { ...receipt });
|
|
28607
|
+
return { ...receipt };
|
|
28608
|
+
}
|
|
28609
|
+
};
|
|
28610
|
+
};
|
|
28568
28611
|
var buildVoiceMonitorRunReport = async (options) => {
|
|
28569
28612
|
const checkedAt = options.now ?? Date.now();
|
|
28570
28613
|
const runs = await Promise.all(options.monitors.map(async (monitor) => {
|
|
@@ -28637,6 +28680,72 @@ var muteVoiceMonitorIssue = async (store, id, input = {}) => store.update(id, {
|
|
|
28637
28680
|
mutedBy: input.actorId,
|
|
28638
28681
|
status: "muted"
|
|
28639
28682
|
});
|
|
28683
|
+
var createVoiceMonitorWebhookNotifier = (options) => ({
|
|
28684
|
+
id: options.id,
|
|
28685
|
+
label: options.label ?? options.id,
|
|
28686
|
+
deliver: async ({ issue }) => {
|
|
28687
|
+
const response = await (options.fetch ?? fetch)(options.url, {
|
|
28688
|
+
body: JSON.stringify(options.mapIssue?.(issue) ?? {
|
|
28689
|
+
detail: issue.detail,
|
|
28690
|
+
impactedSessions: issue.impactedSessions,
|
|
28691
|
+
issueId: issue.id,
|
|
28692
|
+
label: issue.label,
|
|
28693
|
+
monitorId: issue.monitorId,
|
|
28694
|
+
operationsRecordHrefs: issue.operationsRecordHrefs,
|
|
28695
|
+
severity: issue.severity,
|
|
28696
|
+
status: issue.status,
|
|
28697
|
+
value: issue.value
|
|
28698
|
+
}),
|
|
28699
|
+
headers: {
|
|
28700
|
+
"content-type": "application/json",
|
|
28701
|
+
...options.headers
|
|
28702
|
+
},
|
|
28703
|
+
method: "POST"
|
|
28704
|
+
});
|
|
28705
|
+
return {
|
|
28706
|
+
detail: `HTTP ${response.status}`,
|
|
28707
|
+
status: response.ok ? "sent" : "failed"
|
|
28708
|
+
};
|
|
28709
|
+
}
|
|
28710
|
+
});
|
|
28711
|
+
var deliverVoiceMonitorIssueNotifications = async (options) => {
|
|
28712
|
+
const checkedAt = options.now ?? Date.now();
|
|
28713
|
+
const statuses = new Set(options.statuses ?? ["open"]);
|
|
28714
|
+
const issues = (await options.issueStore.list()).filter((issue) => statuses.has(issue.status));
|
|
28715
|
+
const receipts = [];
|
|
28716
|
+
for (const issue of issues) {
|
|
28717
|
+
for (const notifier of options.notifiers) {
|
|
28718
|
+
const result = await notifier.deliver({ issue, now: checkedAt });
|
|
28719
|
+
const receipt = {
|
|
28720
|
+
detail: result.detail,
|
|
28721
|
+
id: `voice-monitor-notifier:${notifier.id}:${issue.id}:${checkedAt}`,
|
|
28722
|
+
issueId: issue.id,
|
|
28723
|
+
notifierId: notifier.id,
|
|
28724
|
+
notifierLabel: notifier.label,
|
|
28725
|
+
sentAt: checkedAt,
|
|
28726
|
+
status: result.status
|
|
28727
|
+
};
|
|
28728
|
+
receipts.push(receipt);
|
|
28729
|
+
await options.receiptStore?.set(receipt.id, receipt);
|
|
28730
|
+
}
|
|
28731
|
+
}
|
|
28732
|
+
const allReceipts = options.receiptStore ? await options.receiptStore.list() : receipts;
|
|
28733
|
+
const failed = allReceipts.filter((receipt) => receipt.status === "failed").length;
|
|
28734
|
+
const sent = allReceipts.filter((receipt) => receipt.status === "sent").length;
|
|
28735
|
+
const skipped = allReceipts.filter((receipt) => receipt.status === "skipped").length;
|
|
28736
|
+
return {
|
|
28737
|
+
checkedAt,
|
|
28738
|
+
receipts: allReceipts,
|
|
28739
|
+
status: failed > 0 ? "fail" : allReceipts.length === 0 ? "warn" : "pass",
|
|
28740
|
+
summary: {
|
|
28741
|
+
failed,
|
|
28742
|
+
notifiers: options.notifiers.length,
|
|
28743
|
+
sent,
|
|
28744
|
+
skipped,
|
|
28745
|
+
total: allReceipts.length
|
|
28746
|
+
}
|
|
28747
|
+
};
|
|
28748
|
+
};
|
|
28640
28749
|
var renderVoiceMonitorMarkdown = (report) => {
|
|
28641
28750
|
const rows = report.runs.map((run) => `| ${run.id} | ${run.status} | ${run.severity} | ${run.value ?? ""} | ${run.threshold ?? ""} | ${run.detail ?? ""} |`).join(`
|
|
28642
28751
|
`);
|
|
@@ -28676,7 +28785,9 @@ var createVoiceMonitorRoutes = (options) => {
|
|
|
28676
28785
|
const path = options.path ?? "/api/voice/monitors";
|
|
28677
28786
|
const htmlPath = options.htmlPath === undefined ? "/voice/monitors" : options.htmlPath;
|
|
28678
28787
|
const issuePath = options.issuePath ?? "/api/voice/monitor-issues";
|
|
28788
|
+
const notifierPath = options.notifierPath === undefined ? "/api/voice/monitor-notifications" : options.notifierPath;
|
|
28679
28789
|
const issueStore = options.issueStore ?? createVoiceMemoryMonitorIssueStore();
|
|
28790
|
+
const receiptStore = options.receiptStore ?? createVoiceMemoryMonitorNotifierDeliveryReceiptStore();
|
|
28680
28791
|
const report = () => buildVoiceMonitorRunReport({
|
|
28681
28792
|
evidence: options.evidence,
|
|
28682
28793
|
issueStore,
|
|
@@ -28692,7 +28803,7 @@ var createVoiceMonitorRoutes = (options) => {
|
|
|
28692
28803
|
...options.headers
|
|
28693
28804
|
}
|
|
28694
28805
|
});
|
|
28695
|
-
}).get(issuePath, () => issueStore.list()).post(`${issuePath}/:id/acknowledge`, async ({ params, request }) => {
|
|
28806
|
+
}).get(issuePath, () => issueStore.list()).get(`${issuePath}/notifications`, () => receiptStore.list()).post(`${issuePath}/:id/acknowledge`, async ({ params, request }) => {
|
|
28696
28807
|
const issue = await acknowledgeVoiceMonitorIssue(issueStore, params.id, {
|
|
28697
28808
|
actorId: await actorFromRequest(request)
|
|
28698
28809
|
});
|
|
@@ -28708,6 +28819,13 @@ var createVoiceMonitorRoutes = (options) => {
|
|
|
28708
28819
|
});
|
|
28709
28820
|
return issue ?? new Response("Issue not found", { status: 404 });
|
|
28710
28821
|
});
|
|
28822
|
+
if (notifierPath !== false) {
|
|
28823
|
+
routes.post(notifierPath, () => deliverVoiceMonitorIssueNotifications({
|
|
28824
|
+
issueStore,
|
|
28825
|
+
notifiers: options.notifiers ?? [],
|
|
28826
|
+
receiptStore
|
|
28827
|
+
}));
|
|
28828
|
+
}
|
|
28711
28829
|
if (htmlPath !== false) {
|
|
28712
28830
|
routes.get(htmlPath, async () => {
|
|
28713
28831
|
const body = await (options.render ?? renderVoiceMonitorHTML)(await report(), { title: options.title });
|
|
@@ -32477,6 +32595,7 @@ export {
|
|
|
32477
32595
|
encodeTwilioMulawBase64,
|
|
32478
32596
|
deliverVoiceTraceEventsToSinks,
|
|
32479
32597
|
deliverVoiceObservabilityExport,
|
|
32598
|
+
deliverVoiceMonitorIssueNotifications,
|
|
32480
32599
|
deliverVoiceIntegrationEventToSinks,
|
|
32481
32600
|
deliverVoiceIntegrationEvent,
|
|
32482
32601
|
deliverVoiceHandoffDelivery,
|
|
@@ -32631,11 +32750,13 @@ export {
|
|
|
32631
32750
|
createVoiceObservabilityExportSchema,
|
|
32632
32751
|
createVoiceObservabilityExportRoutes,
|
|
32633
32752
|
createVoiceObservabilityExportReplayRoutes,
|
|
32753
|
+
createVoiceMonitorWebhookNotifier,
|
|
32634
32754
|
createVoiceMonitorRoutes,
|
|
32635
32755
|
createVoiceMemoryTraceSinkDeliveryStore,
|
|
32636
32756
|
createVoiceMemoryTraceEventStore,
|
|
32637
32757
|
createVoiceMemoryStore,
|
|
32638
32758
|
createVoiceMemoryObservabilityExportDeliveryReceiptStore,
|
|
32759
|
+
createVoiceMemoryMonitorNotifierDeliveryReceiptStore,
|
|
32639
32760
|
createVoiceMemoryMonitorIssueStore,
|
|
32640
32761
|
createVoiceMemoryLiveOpsControlStore,
|
|
32641
32762
|
createVoiceMemoryIncidentBundleStore,
|
|
@@ -2,7 +2,7 @@ import { Elysia } from 'elysia';
|
|
|
2
2
|
import { type VoiceProviderFallbackRecoverySummary } from './sessionReplay';
|
|
3
3
|
import { type VoiceTelephonyCarrierMatrixInput } from './telephony/matrix';
|
|
4
4
|
import { type VoiceTelephonyWebhookSecurityOptions, type VoiceTelephonyWebhookSecurityReport } from './telephony/security';
|
|
5
|
-
import type { VoiceMonitorRunReport } from './voiceMonitoring';
|
|
5
|
+
import type { VoiceMonitorNotifierDeliveryReport, VoiceMonitorRunReport } from './voiceMonitoring';
|
|
6
6
|
import type { VoiceTraceEventStore } from './trace';
|
|
7
7
|
import type { VoiceTraceSinkDeliveryStore } from './trace';
|
|
8
8
|
import type { VoiceAgentSquadContractReport } from './agentSquadContract';
|
|
@@ -120,6 +120,7 @@ export type VoiceProductionReadinessReport = {
|
|
|
120
120
|
observabilityExport?: string;
|
|
121
121
|
observabilityExportDeliveries?: string;
|
|
122
122
|
monitoring?: string;
|
|
123
|
+
monitoringNotifierDelivery?: string;
|
|
123
124
|
opsActions?: string;
|
|
124
125
|
opsRecovery?: string;
|
|
125
126
|
phoneAgentSmoke?: string;
|
|
@@ -184,6 +185,13 @@ export type VoiceProductionReadinessReport = {
|
|
|
184
185
|
status: VoiceProductionReadinessStatus;
|
|
185
186
|
total: number;
|
|
186
187
|
};
|
|
188
|
+
monitoringNotifierDelivery?: {
|
|
189
|
+
failed: number;
|
|
190
|
+
notifiers: number;
|
|
191
|
+
sent: number;
|
|
192
|
+
status: VoiceProductionReadinessStatus;
|
|
193
|
+
total: number;
|
|
194
|
+
};
|
|
187
195
|
opsActionHistory?: VoiceProductionReadinessOpsActionHistorySummary;
|
|
188
196
|
opsRecovery?: {
|
|
189
197
|
issues: number;
|
|
@@ -405,6 +413,10 @@ export type VoiceProductionReadinessRoutesOptions = {
|
|
|
405
413
|
query: Record<string, unknown>;
|
|
406
414
|
request: Request;
|
|
407
415
|
}) => Promise<VoiceMonitorRunReport> | VoiceMonitorRunReport);
|
|
416
|
+
monitoringNotifierDelivery?: false | VoiceMonitorNotifierDeliveryReport | ((input: {
|
|
417
|
+
query: Record<string, unknown>;
|
|
418
|
+
request: Request;
|
|
419
|
+
}) => Promise<VoiceMonitorNotifierDeliveryReport> | VoiceMonitorNotifierDeliveryReport);
|
|
408
420
|
opsActionHistory?: false | VoiceProductionReadinessOpsActionHistoryOptions;
|
|
409
421
|
opsRecovery?: false | VoiceOpsRecoveryReport | ((input: {
|
|
410
422
|
query: Record<string, unknown>;
|
|
@@ -55,6 +55,44 @@ export type VoiceMonitorIssueStore = {
|
|
|
55
55
|
upsert: (issue: VoiceMonitorIssue) => Promise<VoiceMonitorIssue> | VoiceMonitorIssue;
|
|
56
56
|
update: (id: string, patch: Partial<VoiceMonitorIssue>) => Promise<VoiceMonitorIssue | undefined> | VoiceMonitorIssue | undefined;
|
|
57
57
|
};
|
|
58
|
+
export type VoiceMonitorNotifier = {
|
|
59
|
+
deliver: (input: VoiceMonitorNotifierDeliveryInput) => Promise<VoiceMonitorNotifierDeliveryResult> | VoiceMonitorNotifierDeliveryResult;
|
|
60
|
+
id: string;
|
|
61
|
+
label: string;
|
|
62
|
+
};
|
|
63
|
+
export type VoiceMonitorNotifierDeliveryInput = {
|
|
64
|
+
issue: VoiceMonitorIssue;
|
|
65
|
+
now: number;
|
|
66
|
+
};
|
|
67
|
+
export type VoiceMonitorNotifierDeliveryResult = {
|
|
68
|
+
detail?: string;
|
|
69
|
+
status: 'failed' | 'sent' | 'skipped';
|
|
70
|
+
};
|
|
71
|
+
export type VoiceMonitorNotifierDeliveryReceipt = {
|
|
72
|
+
detail?: string;
|
|
73
|
+
id: string;
|
|
74
|
+
issueId: string;
|
|
75
|
+
notifierId: string;
|
|
76
|
+
notifierLabel: string;
|
|
77
|
+
sentAt: number;
|
|
78
|
+
status: 'failed' | 'sent' | 'skipped';
|
|
79
|
+
};
|
|
80
|
+
export type VoiceMonitorNotifierDeliveryReceiptStore = {
|
|
81
|
+
list: () => Promise<VoiceMonitorNotifierDeliveryReceipt[]> | VoiceMonitorNotifierDeliveryReceipt[];
|
|
82
|
+
set: (id: string, receipt: VoiceMonitorNotifierDeliveryReceipt) => Promise<VoiceMonitorNotifierDeliveryReceipt> | VoiceMonitorNotifierDeliveryReceipt;
|
|
83
|
+
};
|
|
84
|
+
export type VoiceMonitorNotifierDeliveryReport = {
|
|
85
|
+
checkedAt: number;
|
|
86
|
+
receipts: VoiceMonitorNotifierDeliveryReceipt[];
|
|
87
|
+
status: VoiceMonitorStatus;
|
|
88
|
+
summary: {
|
|
89
|
+
failed: number;
|
|
90
|
+
notifiers: number;
|
|
91
|
+
sent: number;
|
|
92
|
+
skipped: number;
|
|
93
|
+
total: number;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
58
96
|
export type VoiceMonitorRunReport = {
|
|
59
97
|
checkedAt: number;
|
|
60
98
|
issues: VoiceMonitorIssue[];
|
|
@@ -78,16 +116,35 @@ export type VoiceMonitorRunOptions<TEvidence = unknown> = {
|
|
|
78
116
|
monitors: readonly VoiceMonitorDefinition<TEvidence>[];
|
|
79
117
|
now?: number;
|
|
80
118
|
};
|
|
119
|
+
export type VoiceMonitorNotifierDeliveryOptions = {
|
|
120
|
+
issueStore: VoiceMonitorIssueStore;
|
|
121
|
+
notifiers: readonly VoiceMonitorNotifier[];
|
|
122
|
+
now?: number;
|
|
123
|
+
receiptStore?: VoiceMonitorNotifierDeliveryReceiptStore;
|
|
124
|
+
statuses?: readonly VoiceMonitorIssueStatus[];
|
|
125
|
+
};
|
|
126
|
+
export type VoiceMonitorWebhookNotifierOptions = {
|
|
127
|
+
fetch?: typeof fetch;
|
|
128
|
+
headers?: HeadersInit;
|
|
129
|
+
id: string;
|
|
130
|
+
label?: string;
|
|
131
|
+
mapIssue?: (issue: VoiceMonitorIssue) => unknown;
|
|
132
|
+
url: string;
|
|
133
|
+
};
|
|
81
134
|
export type VoiceMonitorRoutesOptions<TEvidence = unknown> = VoiceMonitorRunOptions<TEvidence> & {
|
|
82
135
|
headers?: HeadersInit;
|
|
83
136
|
htmlPath?: false | string;
|
|
84
137
|
issuePath?: string;
|
|
85
138
|
name?: string;
|
|
139
|
+
notifierPath?: false | string;
|
|
140
|
+
notifiers?: readonly VoiceMonitorNotifier[];
|
|
86
141
|
path?: string;
|
|
142
|
+
receiptStore?: VoiceMonitorNotifierDeliveryReceiptStore;
|
|
87
143
|
render?: (report: VoiceMonitorRunReport) => Promise<string> | string;
|
|
88
144
|
title?: string;
|
|
89
145
|
};
|
|
90
146
|
export declare const createVoiceMemoryMonitorIssueStore: (initial?: readonly VoiceMonitorIssue[]) => VoiceMonitorIssueStore;
|
|
147
|
+
export declare const createVoiceMemoryMonitorNotifierDeliveryReceiptStore: (initial?: readonly VoiceMonitorNotifierDeliveryReceipt[]) => VoiceMonitorNotifierDeliveryReceiptStore;
|
|
91
148
|
export declare const buildVoiceMonitorRunReport: <TEvidence = unknown>(options: VoiceMonitorRunOptions<TEvidence>) => Promise<VoiceMonitorRunReport>;
|
|
92
149
|
export declare const acknowledgeVoiceMonitorIssue: (store: VoiceMonitorIssueStore, id: string, input?: {
|
|
93
150
|
actorId?: string;
|
|
@@ -101,6 +158,8 @@ export declare const muteVoiceMonitorIssue: (store: VoiceMonitorIssueStore, id:
|
|
|
101
158
|
actorId?: string;
|
|
102
159
|
now?: number;
|
|
103
160
|
}) => Promise<VoiceMonitorIssue | undefined>;
|
|
161
|
+
export declare const createVoiceMonitorWebhookNotifier: (options: VoiceMonitorWebhookNotifierOptions) => VoiceMonitorNotifier;
|
|
162
|
+
export declare const deliverVoiceMonitorIssueNotifications: (options: VoiceMonitorNotifierDeliveryOptions) => Promise<VoiceMonitorNotifierDeliveryReport>;
|
|
104
163
|
export declare const renderVoiceMonitorMarkdown: (report: VoiceMonitorRunReport) => string;
|
|
105
164
|
export declare const renderVoiceMonitorHTML: (report: VoiceMonitorRunReport, options?: {
|
|
106
165
|
title?: string;
|
|
@@ -156,6 +215,20 @@ export declare const createVoiceMonitorRoutes: <TEvidence = unknown>(options: Vo
|
|
|
156
215
|
};
|
|
157
216
|
};
|
|
158
217
|
};
|
|
218
|
+
} & {
|
|
219
|
+
[x: string]: {
|
|
220
|
+
notifications: {
|
|
221
|
+
get: {
|
|
222
|
+
body: unknown;
|
|
223
|
+
params: {};
|
|
224
|
+
query: unknown;
|
|
225
|
+
headers: unknown;
|
|
226
|
+
response: {
|
|
227
|
+
200: VoiceMonitorNotifierDeliveryReceipt[];
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
};
|
|
159
232
|
} & {
|
|
160
233
|
[x: string]: {
|
|
161
234
|
":id": {
|