@absolutejs/voice 0.0.22-beta.340 → 0.0.22-beta.341
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/client/index.js +37 -6
- package/dist/index.js +37 -6
- package/dist/react/index.js +37 -6
- package/dist/vue/index.js +37 -6
- package/package.json +1 -1
package/dist/client/index.js
CHANGED
|
@@ -3915,6 +3915,22 @@ var aggregateProofTrendRuntimeChannel = (channels) => {
|
|
|
3915
3915
|
};
|
|
3916
3916
|
};
|
|
3917
3917
|
var readProofTrendProviders = (reports) => aggregateProofTrendProviders(reports.flatMap((report) => report.summary.providers && report.summary.providers.length > 0 ? report.summary.providers : report.cycles.flatMap((cycle) => cycle.providers ?? [])));
|
|
3918
|
+
var exceedsProofTrendBudget = (value, budget) => value !== undefined && (!Number.isFinite(value) || value > budget);
|
|
3919
|
+
var readProofTrendProfileStatus = (profile, budgets) => {
|
|
3920
|
+
const runtimeChannel = profile.runtimeChannel;
|
|
3921
|
+
const hasBudgetEvidence = profile.maxLiveP95Ms !== undefined || profile.maxProviderP95Ms !== undefined || profile.maxTurnP95Ms !== undefined || profile.providers?.some((provider) => provider.p95Ms !== undefined) === true || runtimeChannel?.maxFirstAudioLatencyMs !== undefined || runtimeChannel?.maxInterruptionP95Ms !== undefined || runtimeChannel?.maxJitterMs !== undefined || runtimeChannel?.maxTimestampDriftMs !== undefined || runtimeChannel?.maxBackpressureEvents !== undefined;
|
|
3922
|
+
const budgetFailed = exceedsProofTrendBudget(profile.maxLiveP95Ms, budgets.maxLiveP95Ms) || exceedsProofTrendBudget(profile.maxProviderP95Ms, budgets.maxProviderP95Ms) || exceedsProofTrendBudget(profile.maxTurnP95Ms, budgets.maxTurnP95Ms) || exceedsProofTrendBudget(runtimeChannel?.maxFirstAudioLatencyMs, budgets.maxRuntimeFirstAudioLatencyMs) || exceedsProofTrendBudget(runtimeChannel?.maxInterruptionP95Ms, budgets.maxRuntimeInterruptionP95Ms) || exceedsProofTrendBudget(runtimeChannel?.maxJitterMs, budgets.maxRuntimeJitterMs) || exceedsProofTrendBudget(runtimeChannel?.maxTimestampDriftMs, budgets.maxRuntimeTimestampDriftMs) || exceedsProofTrendBudget(runtimeChannel?.maxBackpressureEvents, 0);
|
|
3923
|
+
if (budgetFailed || !hasBudgetEvidence && profile.status === "fail") {
|
|
3924
|
+
return "fail";
|
|
3925
|
+
}
|
|
3926
|
+
if (profile.status === "warn" || runtimeChannel?.status === "warn" || profile.providers?.some((provider) => provider.status === "warn") === true) {
|
|
3927
|
+
return "warn";
|
|
3928
|
+
}
|
|
3929
|
+
if (hasBudgetEvidence || profile.status === "pass" || runtimeChannel?.status === "pass" || profile.providers?.some((provider) => provider.status === "pass") === true) {
|
|
3930
|
+
return "pass";
|
|
3931
|
+
}
|
|
3932
|
+
return;
|
|
3933
|
+
};
|
|
3918
3934
|
var buildVoiceProofTrendProfileSummaries = (input, options = {}) => {
|
|
3919
3935
|
const reports = Array.isArray(input) ? input : [input];
|
|
3920
3936
|
const definitions = options.profiles ?? DEFAULT_VOICE_PROOF_TREND_PROFILE_DEFINITIONS;
|
|
@@ -3925,6 +3941,15 @@ var buildVoiceProofTrendProfileSummaries = (input, options = {}) => {
|
|
|
3925
3941
|
const runtimeInterruptionCap = options.maxRuntimeInterruptionP95Ms ?? 300;
|
|
3926
3942
|
const runtimeJitterCap = options.maxRuntimeJitterMs ?? 30;
|
|
3927
3943
|
const runtimeTimestampDriftCap = options.maxRuntimeTimestampDriftMs ?? 800;
|
|
3944
|
+
const budgets = {
|
|
3945
|
+
maxLiveP95Ms: liveCap,
|
|
3946
|
+
maxProviderP95Ms: providerCap,
|
|
3947
|
+
maxRuntimeFirstAudioLatencyMs: runtimeFirstAudioCap,
|
|
3948
|
+
maxRuntimeInterruptionP95Ms: runtimeInterruptionCap,
|
|
3949
|
+
maxRuntimeJitterMs: runtimeJitterCap,
|
|
3950
|
+
maxRuntimeTimestampDriftMs: runtimeTimestampDriftCap,
|
|
3951
|
+
maxTurnP95Ms: turnCap
|
|
3952
|
+
};
|
|
3928
3953
|
return definitions.map((definition) => {
|
|
3929
3954
|
const historicalProfiles = reports.flatMap((report) => report.summary.profiles?.filter((profile) => profile.id === definition.id) ?? []);
|
|
3930
3955
|
if (historicalProfiles.length > 0) {
|
|
@@ -3934,7 +3959,7 @@ var buildVoiceProofTrendProfileSummaries = (input, options = {}) => {
|
|
|
3934
3959
|
profiles: [definition]
|
|
3935
3960
|
}) : [];
|
|
3936
3961
|
const profiles = [...historicalProfiles, ...derivedProfiles];
|
|
3937
|
-
|
|
3962
|
+
const aggregatedProfile = {
|
|
3938
3963
|
description: definition.description ?? profiles.find(Boolean)?.description,
|
|
3939
3964
|
id: definition.id,
|
|
3940
3965
|
label: definition.label ?? profiles.find(Boolean)?.label,
|
|
@@ -3942,12 +3967,15 @@ var buildVoiceProofTrendProfileSummaries = (input, options = {}) => {
|
|
|
3942
3967
|
maxProviderP95Ms: maxNumber(profiles.map((profile) => profile.maxProviderP95Ms)),
|
|
3943
3968
|
maxTurnP95Ms: maxNumber(profiles.map((profile) => profile.maxTurnP95Ms)),
|
|
3944
3969
|
providers: aggregateProofTrendProviders(profiles.flatMap((profile) => profile.providers ?? [])),
|
|
3945
|
-
runtimeChannel: aggregateProofTrendRuntimeChannel(profiles.map((profile) => profile.runtimeChannel).filter((channel) => channel !== undefined))
|
|
3946
|
-
|
|
3970
|
+
runtimeChannel: aggregateProofTrendRuntimeChannel(profiles.map((profile) => profile.runtimeChannel).filter((channel) => channel !== undefined))
|
|
3971
|
+
};
|
|
3972
|
+
return {
|
|
3973
|
+
...aggregatedProfile,
|
|
3974
|
+
status: readProofTrendProfileStatus(aggregatedProfile, budgets)
|
|
3947
3975
|
};
|
|
3948
3976
|
}
|
|
3949
3977
|
const runtimeChannel = aggregateProofTrendRuntimeChannel(reports.map((report) => readProofTrendRuntimeChannel(report)).filter((channel) => Object.values(channel).some((value) => value !== undefined)));
|
|
3950
|
-
|
|
3978
|
+
const derivedProfile = {
|
|
3951
3979
|
description: definition.description,
|
|
3952
3980
|
id: definition.id,
|
|
3953
3981
|
label: definition.label,
|
|
@@ -3963,8 +3991,11 @@ var buildVoiceProofTrendProfileSummaries = (input, options = {}) => {
|
|
|
3963
3991
|
maxTimestampDriftMs: addProofTrendProfileOffset(runtimeChannel.maxTimestampDriftMs, definition.runtimeOffsetMs, definition.maxRuntimeTimestampDriftMs ?? runtimeTimestampDriftCap),
|
|
3964
3992
|
samples: runtimeChannel.samples,
|
|
3965
3993
|
status: runtimeChannel.status
|
|
3966
|
-
}
|
|
3967
|
-
|
|
3994
|
+
}
|
|
3995
|
+
};
|
|
3996
|
+
return {
|
|
3997
|
+
...derivedProfile,
|
|
3998
|
+
status: readProofTrendProfileStatus(derivedProfile, budgets)
|
|
3968
3999
|
};
|
|
3969
4000
|
});
|
|
3970
4001
|
};
|
package/dist/index.js
CHANGED
|
@@ -14632,6 +14632,22 @@ var aggregateProofTrendRuntimeChannel = (channels) => {
|
|
|
14632
14632
|
};
|
|
14633
14633
|
};
|
|
14634
14634
|
var readProofTrendProviders = (reports) => aggregateProofTrendProviders(reports.flatMap((report) => report.summary.providers && report.summary.providers.length > 0 ? report.summary.providers : report.cycles.flatMap((cycle) => cycle.providers ?? [])));
|
|
14635
|
+
var exceedsProofTrendBudget = (value, budget) => value !== undefined && (!Number.isFinite(value) || value > budget);
|
|
14636
|
+
var readProofTrendProfileStatus = (profile, budgets) => {
|
|
14637
|
+
const runtimeChannel = profile.runtimeChannel;
|
|
14638
|
+
const hasBudgetEvidence = profile.maxLiveP95Ms !== undefined || profile.maxProviderP95Ms !== undefined || profile.maxTurnP95Ms !== undefined || profile.providers?.some((provider) => provider.p95Ms !== undefined) === true || runtimeChannel?.maxFirstAudioLatencyMs !== undefined || runtimeChannel?.maxInterruptionP95Ms !== undefined || runtimeChannel?.maxJitterMs !== undefined || runtimeChannel?.maxTimestampDriftMs !== undefined || runtimeChannel?.maxBackpressureEvents !== undefined;
|
|
14639
|
+
const budgetFailed = exceedsProofTrendBudget(profile.maxLiveP95Ms, budgets.maxLiveP95Ms) || exceedsProofTrendBudget(profile.maxProviderP95Ms, budgets.maxProviderP95Ms) || exceedsProofTrendBudget(profile.maxTurnP95Ms, budgets.maxTurnP95Ms) || exceedsProofTrendBudget(runtimeChannel?.maxFirstAudioLatencyMs, budgets.maxRuntimeFirstAudioLatencyMs) || exceedsProofTrendBudget(runtimeChannel?.maxInterruptionP95Ms, budgets.maxRuntimeInterruptionP95Ms) || exceedsProofTrendBudget(runtimeChannel?.maxJitterMs, budgets.maxRuntimeJitterMs) || exceedsProofTrendBudget(runtimeChannel?.maxTimestampDriftMs, budgets.maxRuntimeTimestampDriftMs) || exceedsProofTrendBudget(runtimeChannel?.maxBackpressureEvents, 0);
|
|
14640
|
+
if (budgetFailed || !hasBudgetEvidence && profile.status === "fail") {
|
|
14641
|
+
return "fail";
|
|
14642
|
+
}
|
|
14643
|
+
if (profile.status === "warn" || runtimeChannel?.status === "warn" || profile.providers?.some((provider) => provider.status === "warn") === true) {
|
|
14644
|
+
return "warn";
|
|
14645
|
+
}
|
|
14646
|
+
if (hasBudgetEvidence || profile.status === "pass" || runtimeChannel?.status === "pass" || profile.providers?.some((provider) => provider.status === "pass") === true) {
|
|
14647
|
+
return "pass";
|
|
14648
|
+
}
|
|
14649
|
+
return;
|
|
14650
|
+
};
|
|
14635
14651
|
var buildVoiceProofTrendProfileSummaries = (input, options = {}) => {
|
|
14636
14652
|
const reports = Array.isArray(input) ? input : [input];
|
|
14637
14653
|
const definitions = options.profiles ?? DEFAULT_VOICE_PROOF_TREND_PROFILE_DEFINITIONS;
|
|
@@ -14642,6 +14658,15 @@ var buildVoiceProofTrendProfileSummaries = (input, options = {}) => {
|
|
|
14642
14658
|
const runtimeInterruptionCap = options.maxRuntimeInterruptionP95Ms ?? 300;
|
|
14643
14659
|
const runtimeJitterCap = options.maxRuntimeJitterMs ?? 30;
|
|
14644
14660
|
const runtimeTimestampDriftCap = options.maxRuntimeTimestampDriftMs ?? 800;
|
|
14661
|
+
const budgets = {
|
|
14662
|
+
maxLiveP95Ms: liveCap,
|
|
14663
|
+
maxProviderP95Ms: providerCap,
|
|
14664
|
+
maxRuntimeFirstAudioLatencyMs: runtimeFirstAudioCap,
|
|
14665
|
+
maxRuntimeInterruptionP95Ms: runtimeInterruptionCap,
|
|
14666
|
+
maxRuntimeJitterMs: runtimeJitterCap,
|
|
14667
|
+
maxRuntimeTimestampDriftMs: runtimeTimestampDriftCap,
|
|
14668
|
+
maxTurnP95Ms: turnCap
|
|
14669
|
+
};
|
|
14645
14670
|
return definitions.map((definition) => {
|
|
14646
14671
|
const historicalProfiles = reports.flatMap((report) => report.summary.profiles?.filter((profile) => profile.id === definition.id) ?? []);
|
|
14647
14672
|
if (historicalProfiles.length > 0) {
|
|
@@ -14651,7 +14676,7 @@ var buildVoiceProofTrendProfileSummaries = (input, options = {}) => {
|
|
|
14651
14676
|
profiles: [definition]
|
|
14652
14677
|
}) : [];
|
|
14653
14678
|
const profiles = [...historicalProfiles, ...derivedProfiles];
|
|
14654
|
-
|
|
14679
|
+
const aggregatedProfile = {
|
|
14655
14680
|
description: definition.description ?? profiles.find(Boolean)?.description,
|
|
14656
14681
|
id: definition.id,
|
|
14657
14682
|
label: definition.label ?? profiles.find(Boolean)?.label,
|
|
@@ -14659,12 +14684,15 @@ var buildVoiceProofTrendProfileSummaries = (input, options = {}) => {
|
|
|
14659
14684
|
maxProviderP95Ms: maxNumber(profiles.map((profile) => profile.maxProviderP95Ms)),
|
|
14660
14685
|
maxTurnP95Ms: maxNumber(profiles.map((profile) => profile.maxTurnP95Ms)),
|
|
14661
14686
|
providers: aggregateProofTrendProviders(profiles.flatMap((profile) => profile.providers ?? [])),
|
|
14662
|
-
runtimeChannel: aggregateProofTrendRuntimeChannel(profiles.map((profile) => profile.runtimeChannel).filter((channel) => channel !== undefined))
|
|
14663
|
-
|
|
14687
|
+
runtimeChannel: aggregateProofTrendRuntimeChannel(profiles.map((profile) => profile.runtimeChannel).filter((channel) => channel !== undefined))
|
|
14688
|
+
};
|
|
14689
|
+
return {
|
|
14690
|
+
...aggregatedProfile,
|
|
14691
|
+
status: readProofTrendProfileStatus(aggregatedProfile, budgets)
|
|
14664
14692
|
};
|
|
14665
14693
|
}
|
|
14666
14694
|
const runtimeChannel = aggregateProofTrendRuntimeChannel(reports.map((report) => readProofTrendRuntimeChannel(report)).filter((channel) => Object.values(channel).some((value) => value !== undefined)));
|
|
14667
|
-
|
|
14695
|
+
const derivedProfile = {
|
|
14668
14696
|
description: definition.description,
|
|
14669
14697
|
id: definition.id,
|
|
14670
14698
|
label: definition.label,
|
|
@@ -14680,8 +14708,11 @@ var buildVoiceProofTrendProfileSummaries = (input, options = {}) => {
|
|
|
14680
14708
|
maxTimestampDriftMs: addProofTrendProfileOffset(runtimeChannel.maxTimestampDriftMs, definition.runtimeOffsetMs, definition.maxRuntimeTimestampDriftMs ?? runtimeTimestampDriftCap),
|
|
14681
14709
|
samples: runtimeChannel.samples,
|
|
14682
14710
|
status: runtimeChannel.status
|
|
14683
|
-
}
|
|
14684
|
-
|
|
14711
|
+
}
|
|
14712
|
+
};
|
|
14713
|
+
return {
|
|
14714
|
+
...derivedProfile,
|
|
14715
|
+
status: readProofTrendProfileStatus(derivedProfile, budgets)
|
|
14685
14716
|
};
|
|
14686
14717
|
});
|
|
14687
14718
|
};
|
package/dist/react/index.js
CHANGED
|
@@ -1663,6 +1663,22 @@ var aggregateProofTrendRuntimeChannel = (channels) => {
|
|
|
1663
1663
|
};
|
|
1664
1664
|
};
|
|
1665
1665
|
var readProofTrendProviders = (reports) => aggregateProofTrendProviders(reports.flatMap((report) => report.summary.providers && report.summary.providers.length > 0 ? report.summary.providers : report.cycles.flatMap((cycle) => cycle.providers ?? [])));
|
|
1666
|
+
var exceedsProofTrendBudget = (value, budget) => value !== undefined && (!Number.isFinite(value) || value > budget);
|
|
1667
|
+
var readProofTrendProfileStatus = (profile, budgets) => {
|
|
1668
|
+
const runtimeChannel = profile.runtimeChannel;
|
|
1669
|
+
const hasBudgetEvidence = profile.maxLiveP95Ms !== undefined || profile.maxProviderP95Ms !== undefined || profile.maxTurnP95Ms !== undefined || profile.providers?.some((provider) => provider.p95Ms !== undefined) === true || runtimeChannel?.maxFirstAudioLatencyMs !== undefined || runtimeChannel?.maxInterruptionP95Ms !== undefined || runtimeChannel?.maxJitterMs !== undefined || runtimeChannel?.maxTimestampDriftMs !== undefined || runtimeChannel?.maxBackpressureEvents !== undefined;
|
|
1670
|
+
const budgetFailed = exceedsProofTrendBudget(profile.maxLiveP95Ms, budgets.maxLiveP95Ms) || exceedsProofTrendBudget(profile.maxProviderP95Ms, budgets.maxProviderP95Ms) || exceedsProofTrendBudget(profile.maxTurnP95Ms, budgets.maxTurnP95Ms) || exceedsProofTrendBudget(runtimeChannel?.maxFirstAudioLatencyMs, budgets.maxRuntimeFirstAudioLatencyMs) || exceedsProofTrendBudget(runtimeChannel?.maxInterruptionP95Ms, budgets.maxRuntimeInterruptionP95Ms) || exceedsProofTrendBudget(runtimeChannel?.maxJitterMs, budgets.maxRuntimeJitterMs) || exceedsProofTrendBudget(runtimeChannel?.maxTimestampDriftMs, budgets.maxRuntimeTimestampDriftMs) || exceedsProofTrendBudget(runtimeChannel?.maxBackpressureEvents, 0);
|
|
1671
|
+
if (budgetFailed || !hasBudgetEvidence && profile.status === "fail") {
|
|
1672
|
+
return "fail";
|
|
1673
|
+
}
|
|
1674
|
+
if (profile.status === "warn" || runtimeChannel?.status === "warn" || profile.providers?.some((provider) => provider.status === "warn") === true) {
|
|
1675
|
+
return "warn";
|
|
1676
|
+
}
|
|
1677
|
+
if (hasBudgetEvidence || profile.status === "pass" || runtimeChannel?.status === "pass" || profile.providers?.some((provider) => provider.status === "pass") === true) {
|
|
1678
|
+
return "pass";
|
|
1679
|
+
}
|
|
1680
|
+
return;
|
|
1681
|
+
};
|
|
1666
1682
|
var buildVoiceProofTrendProfileSummaries = (input, options = {}) => {
|
|
1667
1683
|
const reports = Array.isArray(input) ? input : [input];
|
|
1668
1684
|
const definitions = options.profiles ?? DEFAULT_VOICE_PROOF_TREND_PROFILE_DEFINITIONS;
|
|
@@ -1673,6 +1689,15 @@ var buildVoiceProofTrendProfileSummaries = (input, options = {}) => {
|
|
|
1673
1689
|
const runtimeInterruptionCap = options.maxRuntimeInterruptionP95Ms ?? 300;
|
|
1674
1690
|
const runtimeJitterCap = options.maxRuntimeJitterMs ?? 30;
|
|
1675
1691
|
const runtimeTimestampDriftCap = options.maxRuntimeTimestampDriftMs ?? 800;
|
|
1692
|
+
const budgets = {
|
|
1693
|
+
maxLiveP95Ms: liveCap,
|
|
1694
|
+
maxProviderP95Ms: providerCap,
|
|
1695
|
+
maxRuntimeFirstAudioLatencyMs: runtimeFirstAudioCap,
|
|
1696
|
+
maxRuntimeInterruptionP95Ms: runtimeInterruptionCap,
|
|
1697
|
+
maxRuntimeJitterMs: runtimeJitterCap,
|
|
1698
|
+
maxRuntimeTimestampDriftMs: runtimeTimestampDriftCap,
|
|
1699
|
+
maxTurnP95Ms: turnCap
|
|
1700
|
+
};
|
|
1676
1701
|
return definitions.map((definition) => {
|
|
1677
1702
|
const historicalProfiles = reports.flatMap((report) => report.summary.profiles?.filter((profile) => profile.id === definition.id) ?? []);
|
|
1678
1703
|
if (historicalProfiles.length > 0) {
|
|
@@ -1682,7 +1707,7 @@ var buildVoiceProofTrendProfileSummaries = (input, options = {}) => {
|
|
|
1682
1707
|
profiles: [definition]
|
|
1683
1708
|
}) : [];
|
|
1684
1709
|
const profiles = [...historicalProfiles, ...derivedProfiles];
|
|
1685
|
-
|
|
1710
|
+
const aggregatedProfile = {
|
|
1686
1711
|
description: definition.description ?? profiles.find(Boolean)?.description,
|
|
1687
1712
|
id: definition.id,
|
|
1688
1713
|
label: definition.label ?? profiles.find(Boolean)?.label,
|
|
@@ -1690,12 +1715,15 @@ var buildVoiceProofTrendProfileSummaries = (input, options = {}) => {
|
|
|
1690
1715
|
maxProviderP95Ms: maxNumber(profiles.map((profile) => profile.maxProviderP95Ms)),
|
|
1691
1716
|
maxTurnP95Ms: maxNumber(profiles.map((profile) => profile.maxTurnP95Ms)),
|
|
1692
1717
|
providers: aggregateProofTrendProviders(profiles.flatMap((profile) => profile.providers ?? [])),
|
|
1693
|
-
runtimeChannel: aggregateProofTrendRuntimeChannel(profiles.map((profile) => profile.runtimeChannel).filter((channel) => channel !== undefined))
|
|
1694
|
-
|
|
1718
|
+
runtimeChannel: aggregateProofTrendRuntimeChannel(profiles.map((profile) => profile.runtimeChannel).filter((channel) => channel !== undefined))
|
|
1719
|
+
};
|
|
1720
|
+
return {
|
|
1721
|
+
...aggregatedProfile,
|
|
1722
|
+
status: readProofTrendProfileStatus(aggregatedProfile, budgets)
|
|
1695
1723
|
};
|
|
1696
1724
|
}
|
|
1697
1725
|
const runtimeChannel = aggregateProofTrendRuntimeChannel(reports.map((report) => readProofTrendRuntimeChannel(report)).filter((channel) => Object.values(channel).some((value) => value !== undefined)));
|
|
1698
|
-
|
|
1726
|
+
const derivedProfile = {
|
|
1699
1727
|
description: definition.description,
|
|
1700
1728
|
id: definition.id,
|
|
1701
1729
|
label: definition.label,
|
|
@@ -1711,8 +1739,11 @@ var buildVoiceProofTrendProfileSummaries = (input, options = {}) => {
|
|
|
1711
1739
|
maxTimestampDriftMs: addProofTrendProfileOffset(runtimeChannel.maxTimestampDriftMs, definition.runtimeOffsetMs, definition.maxRuntimeTimestampDriftMs ?? runtimeTimestampDriftCap),
|
|
1712
1740
|
samples: runtimeChannel.samples,
|
|
1713
1741
|
status: runtimeChannel.status
|
|
1714
|
-
}
|
|
1715
|
-
|
|
1742
|
+
}
|
|
1743
|
+
};
|
|
1744
|
+
return {
|
|
1745
|
+
...derivedProfile,
|
|
1746
|
+
status: readProofTrendProfileStatus(derivedProfile, budgets)
|
|
1716
1747
|
};
|
|
1717
1748
|
});
|
|
1718
1749
|
};
|
package/dist/vue/index.js
CHANGED
|
@@ -1584,6 +1584,22 @@ var aggregateProofTrendRuntimeChannel = (channels) => {
|
|
|
1584
1584
|
};
|
|
1585
1585
|
};
|
|
1586
1586
|
var readProofTrendProviders = (reports) => aggregateProofTrendProviders(reports.flatMap((report) => report.summary.providers && report.summary.providers.length > 0 ? report.summary.providers : report.cycles.flatMap((cycle) => cycle.providers ?? [])));
|
|
1587
|
+
var exceedsProofTrendBudget = (value, budget) => value !== undefined && (!Number.isFinite(value) || value > budget);
|
|
1588
|
+
var readProofTrendProfileStatus = (profile, budgets) => {
|
|
1589
|
+
const runtimeChannel = profile.runtimeChannel;
|
|
1590
|
+
const hasBudgetEvidence = profile.maxLiveP95Ms !== undefined || profile.maxProviderP95Ms !== undefined || profile.maxTurnP95Ms !== undefined || profile.providers?.some((provider) => provider.p95Ms !== undefined) === true || runtimeChannel?.maxFirstAudioLatencyMs !== undefined || runtimeChannel?.maxInterruptionP95Ms !== undefined || runtimeChannel?.maxJitterMs !== undefined || runtimeChannel?.maxTimestampDriftMs !== undefined || runtimeChannel?.maxBackpressureEvents !== undefined;
|
|
1591
|
+
const budgetFailed = exceedsProofTrendBudget(profile.maxLiveP95Ms, budgets.maxLiveP95Ms) || exceedsProofTrendBudget(profile.maxProviderP95Ms, budgets.maxProviderP95Ms) || exceedsProofTrendBudget(profile.maxTurnP95Ms, budgets.maxTurnP95Ms) || exceedsProofTrendBudget(runtimeChannel?.maxFirstAudioLatencyMs, budgets.maxRuntimeFirstAudioLatencyMs) || exceedsProofTrendBudget(runtimeChannel?.maxInterruptionP95Ms, budgets.maxRuntimeInterruptionP95Ms) || exceedsProofTrendBudget(runtimeChannel?.maxJitterMs, budgets.maxRuntimeJitterMs) || exceedsProofTrendBudget(runtimeChannel?.maxTimestampDriftMs, budgets.maxRuntimeTimestampDriftMs) || exceedsProofTrendBudget(runtimeChannel?.maxBackpressureEvents, 0);
|
|
1592
|
+
if (budgetFailed || !hasBudgetEvidence && profile.status === "fail") {
|
|
1593
|
+
return "fail";
|
|
1594
|
+
}
|
|
1595
|
+
if (profile.status === "warn" || runtimeChannel?.status === "warn" || profile.providers?.some((provider) => provider.status === "warn") === true) {
|
|
1596
|
+
return "warn";
|
|
1597
|
+
}
|
|
1598
|
+
if (hasBudgetEvidence || profile.status === "pass" || runtimeChannel?.status === "pass" || profile.providers?.some((provider) => provider.status === "pass") === true) {
|
|
1599
|
+
return "pass";
|
|
1600
|
+
}
|
|
1601
|
+
return;
|
|
1602
|
+
};
|
|
1587
1603
|
var buildVoiceProofTrendProfileSummaries = (input, options = {}) => {
|
|
1588
1604
|
const reports = Array.isArray(input) ? input : [input];
|
|
1589
1605
|
const definitions = options.profiles ?? DEFAULT_VOICE_PROOF_TREND_PROFILE_DEFINITIONS;
|
|
@@ -1594,6 +1610,15 @@ var buildVoiceProofTrendProfileSummaries = (input, options = {}) => {
|
|
|
1594
1610
|
const runtimeInterruptionCap = options.maxRuntimeInterruptionP95Ms ?? 300;
|
|
1595
1611
|
const runtimeJitterCap = options.maxRuntimeJitterMs ?? 30;
|
|
1596
1612
|
const runtimeTimestampDriftCap = options.maxRuntimeTimestampDriftMs ?? 800;
|
|
1613
|
+
const budgets = {
|
|
1614
|
+
maxLiveP95Ms: liveCap,
|
|
1615
|
+
maxProviderP95Ms: providerCap,
|
|
1616
|
+
maxRuntimeFirstAudioLatencyMs: runtimeFirstAudioCap,
|
|
1617
|
+
maxRuntimeInterruptionP95Ms: runtimeInterruptionCap,
|
|
1618
|
+
maxRuntimeJitterMs: runtimeJitterCap,
|
|
1619
|
+
maxRuntimeTimestampDriftMs: runtimeTimestampDriftCap,
|
|
1620
|
+
maxTurnP95Ms: turnCap
|
|
1621
|
+
};
|
|
1597
1622
|
return definitions.map((definition) => {
|
|
1598
1623
|
const historicalProfiles = reports.flatMap((report) => report.summary.profiles?.filter((profile) => profile.id === definition.id) ?? []);
|
|
1599
1624
|
if (historicalProfiles.length > 0) {
|
|
@@ -1603,7 +1628,7 @@ var buildVoiceProofTrendProfileSummaries = (input, options = {}) => {
|
|
|
1603
1628
|
profiles: [definition]
|
|
1604
1629
|
}) : [];
|
|
1605
1630
|
const profiles = [...historicalProfiles, ...derivedProfiles];
|
|
1606
|
-
|
|
1631
|
+
const aggregatedProfile = {
|
|
1607
1632
|
description: definition.description ?? profiles.find(Boolean)?.description,
|
|
1608
1633
|
id: definition.id,
|
|
1609
1634
|
label: definition.label ?? profiles.find(Boolean)?.label,
|
|
@@ -1611,12 +1636,15 @@ var buildVoiceProofTrendProfileSummaries = (input, options = {}) => {
|
|
|
1611
1636
|
maxProviderP95Ms: maxNumber(profiles.map((profile) => profile.maxProviderP95Ms)),
|
|
1612
1637
|
maxTurnP95Ms: maxNumber(profiles.map((profile) => profile.maxTurnP95Ms)),
|
|
1613
1638
|
providers: aggregateProofTrendProviders(profiles.flatMap((profile) => profile.providers ?? [])),
|
|
1614
|
-
runtimeChannel: aggregateProofTrendRuntimeChannel(profiles.map((profile) => profile.runtimeChannel).filter((channel) => channel !== undefined))
|
|
1615
|
-
|
|
1639
|
+
runtimeChannel: aggregateProofTrendRuntimeChannel(profiles.map((profile) => profile.runtimeChannel).filter((channel) => channel !== undefined))
|
|
1640
|
+
};
|
|
1641
|
+
return {
|
|
1642
|
+
...aggregatedProfile,
|
|
1643
|
+
status: readProofTrendProfileStatus(aggregatedProfile, budgets)
|
|
1616
1644
|
};
|
|
1617
1645
|
}
|
|
1618
1646
|
const runtimeChannel = aggregateProofTrendRuntimeChannel(reports.map((report) => readProofTrendRuntimeChannel(report)).filter((channel) => Object.values(channel).some((value) => value !== undefined)));
|
|
1619
|
-
|
|
1647
|
+
const derivedProfile = {
|
|
1620
1648
|
description: definition.description,
|
|
1621
1649
|
id: definition.id,
|
|
1622
1650
|
label: definition.label,
|
|
@@ -1632,8 +1660,11 @@ var buildVoiceProofTrendProfileSummaries = (input, options = {}) => {
|
|
|
1632
1660
|
maxTimestampDriftMs: addProofTrendProfileOffset(runtimeChannel.maxTimestampDriftMs, definition.runtimeOffsetMs, definition.maxRuntimeTimestampDriftMs ?? runtimeTimestampDriftCap),
|
|
1633
1661
|
samples: runtimeChannel.samples,
|
|
1634
1662
|
status: runtimeChannel.status
|
|
1635
|
-
}
|
|
1636
|
-
|
|
1663
|
+
}
|
|
1664
|
+
};
|
|
1665
|
+
return {
|
|
1666
|
+
...derivedProfile,
|
|
1667
|
+
status: readProofTrendProfileStatus(derivedProfile, budgets)
|
|
1637
1668
|
};
|
|
1638
1669
|
});
|
|
1639
1670
|
};
|