@absolutejs/voice 0.0.22-beta.238 → 0.0.22-beta.239
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/angular/index.d.ts +1 -0
- package/dist/angular/index.js +306 -181
- package/dist/angular/voice-platform-coverage.service.d.ts +12 -0
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +80 -0
- package/dist/client/platformCoverage.d.ts +19 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.js +119 -20
- package/dist/react/useVoicePlatformCoverage.d.ts +8 -0
- package/dist/svelte/createVoicePlatformCoverage.d.ts +7 -0
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +90 -0
- package/dist/vue/index.d.ts +1 -0
- package/dist/vue/index.js +165 -51
- package/dist/vue/useVoicePlatformCoverage.d.ts +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type VoicePlatformCoverageClientOptions } from '../client/platformCoverage';
|
|
2
|
+
import type { VoicePlatformCoverageSummary } from '../platformCoverage';
|
|
3
|
+
export declare class VoicePlatformCoverageService {
|
|
4
|
+
connect(path?: string, options?: VoicePlatformCoverageClientOptions): {
|
|
5
|
+
close: () => void;
|
|
6
|
+
error: import("@angular/core").Signal<string | null>;
|
|
7
|
+
isLoading: import("@angular/core").Signal<boolean>;
|
|
8
|
+
refresh: () => Promise<VoicePlatformCoverageSummary | undefined>;
|
|
9
|
+
report: import("@angular/core").Signal<VoicePlatformCoverageSummary | undefined>;
|
|
10
|
+
updatedAt: import("@angular/core").Signal<number | undefined>;
|
|
11
|
+
};
|
|
12
|
+
}
|
package/dist/client/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export { createMicrophoneCapture } from './microphone';
|
|
|
8
8
|
export { createVoiceBargeInMonitor } from './bargeInMonitor';
|
|
9
9
|
export { createVoiceLiveTurnLatencyMonitor } from './liveTurnLatency';
|
|
10
10
|
export { createVoiceOpsStatusStore, fetchVoiceOpsStatus } from './opsStatus';
|
|
11
|
+
export { createVoicePlatformCoverageStore, fetchVoicePlatformCoverage } from './platformCoverage';
|
|
11
12
|
export { createVoiceOpsActionCenterActions, createVoiceOpsActionCenterStore, recordVoiceOpsActionResult, runVoiceOpsAction } from './opsActionCenter';
|
|
12
13
|
export { createVoiceLiveOpsStore, postVoiceLiveOpsAction } from './liveOps';
|
|
13
14
|
export { createVoiceOpsActionHistoryStore, fetchVoiceOpsActionHistory } from './opsActionHistory';
|
package/dist/client/index.js
CHANGED
|
@@ -2062,6 +2062,84 @@ var createVoiceOpsStatusStore = (path = "/api/voice/ops-status", options = {}) =
|
|
|
2062
2062
|
}
|
|
2063
2063
|
};
|
|
2064
2064
|
};
|
|
2065
|
+
// src/client/platformCoverage.ts
|
|
2066
|
+
var fetchVoicePlatformCoverage = async (path = "/api/voice/platform-coverage", options = {}) => {
|
|
2067
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
2068
|
+
const response = await fetchImpl(path);
|
|
2069
|
+
if (!response.ok) {
|
|
2070
|
+
throw new Error(`Voice platform coverage failed: HTTP ${response.status}`);
|
|
2071
|
+
}
|
|
2072
|
+
return await response.json();
|
|
2073
|
+
};
|
|
2074
|
+
var createVoicePlatformCoverageStore = (path = "/api/voice/platform-coverage", options = {}) => {
|
|
2075
|
+
const listeners = new Set;
|
|
2076
|
+
let closed = false;
|
|
2077
|
+
let timer;
|
|
2078
|
+
let snapshot = {
|
|
2079
|
+
error: null,
|
|
2080
|
+
isLoading: false
|
|
2081
|
+
};
|
|
2082
|
+
const emit = () => {
|
|
2083
|
+
for (const listener of listeners) {
|
|
2084
|
+
listener();
|
|
2085
|
+
}
|
|
2086
|
+
};
|
|
2087
|
+
const refresh = async () => {
|
|
2088
|
+
if (closed) {
|
|
2089
|
+
return snapshot.report;
|
|
2090
|
+
}
|
|
2091
|
+
snapshot = {
|
|
2092
|
+
...snapshot,
|
|
2093
|
+
error: null,
|
|
2094
|
+
isLoading: true
|
|
2095
|
+
};
|
|
2096
|
+
emit();
|
|
2097
|
+
try {
|
|
2098
|
+
const report = await fetchVoicePlatformCoverage(path, options);
|
|
2099
|
+
snapshot = {
|
|
2100
|
+
error: null,
|
|
2101
|
+
isLoading: false,
|
|
2102
|
+
report,
|
|
2103
|
+
updatedAt: Date.now()
|
|
2104
|
+
};
|
|
2105
|
+
emit();
|
|
2106
|
+
return report;
|
|
2107
|
+
} catch (error) {
|
|
2108
|
+
snapshot = {
|
|
2109
|
+
...snapshot,
|
|
2110
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2111
|
+
isLoading: false
|
|
2112
|
+
};
|
|
2113
|
+
emit();
|
|
2114
|
+
throw error;
|
|
2115
|
+
}
|
|
2116
|
+
};
|
|
2117
|
+
const close = () => {
|
|
2118
|
+
closed = true;
|
|
2119
|
+
if (timer) {
|
|
2120
|
+
clearInterval(timer);
|
|
2121
|
+
timer = undefined;
|
|
2122
|
+
}
|
|
2123
|
+
listeners.clear();
|
|
2124
|
+
};
|
|
2125
|
+
if (typeof window !== "undefined" && options.intervalMs && options.intervalMs > 0) {
|
|
2126
|
+
timer = setInterval(() => {
|
|
2127
|
+
refresh().catch(() => {});
|
|
2128
|
+
}, options.intervalMs);
|
|
2129
|
+
}
|
|
2130
|
+
return {
|
|
2131
|
+
close,
|
|
2132
|
+
getServerSnapshot: () => snapshot,
|
|
2133
|
+
getSnapshot: () => snapshot,
|
|
2134
|
+
refresh,
|
|
2135
|
+
subscribe: (listener) => {
|
|
2136
|
+
listeners.add(listener);
|
|
2137
|
+
return () => {
|
|
2138
|
+
listeners.delete(listener);
|
|
2139
|
+
};
|
|
2140
|
+
}
|
|
2141
|
+
};
|
|
2142
|
+
};
|
|
2065
2143
|
// src/client/opsActionCenter.ts
|
|
2066
2144
|
var recordVoiceOpsActionResult = async (result, options = {}) => {
|
|
2067
2145
|
if (options.auditPath === false) {
|
|
@@ -5999,6 +6077,7 @@ export {
|
|
|
5999
6077
|
fetchVoiceProviderStatus,
|
|
6000
6078
|
fetchVoiceProviderContracts,
|
|
6001
6079
|
fetchVoiceProviderCapabilities,
|
|
6080
|
+
fetchVoicePlatformCoverage,
|
|
6002
6081
|
fetchVoiceOpsStatus,
|
|
6003
6082
|
fetchVoiceOpsActionHistory,
|
|
6004
6083
|
fetchVoiceDeliveryRuntime,
|
|
@@ -6035,6 +6114,7 @@ export {
|
|
|
6035
6114
|
createVoiceProviderContractsStore,
|
|
6036
6115
|
createVoiceProviderCapabilitiesViewModel,
|
|
6037
6116
|
createVoiceProviderCapabilitiesStore,
|
|
6117
|
+
createVoicePlatformCoverageStore,
|
|
6038
6118
|
createVoiceOpsStatusViewModel,
|
|
6039
6119
|
createVoiceOpsStatusStore,
|
|
6040
6120
|
createVoiceOpsActionHistoryStore,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { VoicePlatformCoverageSummary } from '../platformCoverage';
|
|
2
|
+
export type VoicePlatformCoverageClientOptions = {
|
|
3
|
+
fetch?: typeof fetch;
|
|
4
|
+
intervalMs?: number;
|
|
5
|
+
};
|
|
6
|
+
export type VoicePlatformCoverageSnapshot = {
|
|
7
|
+
error: string | null;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
report?: VoicePlatformCoverageSummary;
|
|
10
|
+
updatedAt?: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const fetchVoicePlatformCoverage: (path?: string, options?: Pick<VoicePlatformCoverageClientOptions, "fetch">) => Promise<VoicePlatformCoverageSummary>;
|
|
13
|
+
export declare const createVoicePlatformCoverageStore: (path?: string, options?: VoicePlatformCoverageClientOptions) => {
|
|
14
|
+
close: () => void;
|
|
15
|
+
getServerSnapshot: () => VoicePlatformCoverageSnapshot;
|
|
16
|
+
getSnapshot: () => VoicePlatformCoverageSnapshot;
|
|
17
|
+
refresh: () => Promise<VoicePlatformCoverageSummary | undefined>;
|
|
18
|
+
subscribe: (listener: () => void) => () => void;
|
|
19
|
+
};
|
package/dist/react/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export { VoiceAgentSquadStatus } from './VoiceAgentSquadStatus';
|
|
|
11
11
|
export { VoiceTurnLatency } from './VoiceTurnLatency';
|
|
12
12
|
export { VoiceTurnQuality } from './VoiceTurnQuality';
|
|
13
13
|
export { useVoiceOpsStatus } from './useVoiceOpsStatus';
|
|
14
|
+
export { useVoicePlatformCoverage } from './useVoicePlatformCoverage';
|
|
14
15
|
export { useVoiceOpsActionCenter } from './useVoiceOpsActionCenter';
|
|
15
16
|
export { useVoiceLiveOps } from './useVoiceLiveOps';
|
|
16
17
|
export { useVoiceDeliveryRuntime } from './useVoiceDeliveryRuntime';
|
package/dist/react/index.js
CHANGED
|
@@ -3651,9 +3651,107 @@ var VoiceTurnQuality = ({
|
|
|
3651
3651
|
]
|
|
3652
3652
|
}, undefined, true, undefined, this);
|
|
3653
3653
|
};
|
|
3654
|
-
// src/react/
|
|
3654
|
+
// src/react/useVoicePlatformCoverage.tsx
|
|
3655
3655
|
import { useEffect as useEffect13, useRef as useRef13, useSyncExternalStore as useSyncExternalStore13 } from "react";
|
|
3656
3656
|
|
|
3657
|
+
// src/client/platformCoverage.ts
|
|
3658
|
+
var fetchVoicePlatformCoverage = async (path = "/api/voice/platform-coverage", options = {}) => {
|
|
3659
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
3660
|
+
const response = await fetchImpl(path);
|
|
3661
|
+
if (!response.ok) {
|
|
3662
|
+
throw new Error(`Voice platform coverage failed: HTTP ${response.status}`);
|
|
3663
|
+
}
|
|
3664
|
+
return await response.json();
|
|
3665
|
+
};
|
|
3666
|
+
var createVoicePlatformCoverageStore = (path = "/api/voice/platform-coverage", options = {}) => {
|
|
3667
|
+
const listeners = new Set;
|
|
3668
|
+
let closed = false;
|
|
3669
|
+
let timer;
|
|
3670
|
+
let snapshot = {
|
|
3671
|
+
error: null,
|
|
3672
|
+
isLoading: false
|
|
3673
|
+
};
|
|
3674
|
+
const emit = () => {
|
|
3675
|
+
for (const listener of listeners) {
|
|
3676
|
+
listener();
|
|
3677
|
+
}
|
|
3678
|
+
};
|
|
3679
|
+
const refresh = async () => {
|
|
3680
|
+
if (closed) {
|
|
3681
|
+
return snapshot.report;
|
|
3682
|
+
}
|
|
3683
|
+
snapshot = {
|
|
3684
|
+
...snapshot,
|
|
3685
|
+
error: null,
|
|
3686
|
+
isLoading: true
|
|
3687
|
+
};
|
|
3688
|
+
emit();
|
|
3689
|
+
try {
|
|
3690
|
+
const report = await fetchVoicePlatformCoverage(path, options);
|
|
3691
|
+
snapshot = {
|
|
3692
|
+
error: null,
|
|
3693
|
+
isLoading: false,
|
|
3694
|
+
report,
|
|
3695
|
+
updatedAt: Date.now()
|
|
3696
|
+
};
|
|
3697
|
+
emit();
|
|
3698
|
+
return report;
|
|
3699
|
+
} catch (error) {
|
|
3700
|
+
snapshot = {
|
|
3701
|
+
...snapshot,
|
|
3702
|
+
error: error instanceof Error ? error.message : String(error),
|
|
3703
|
+
isLoading: false
|
|
3704
|
+
};
|
|
3705
|
+
emit();
|
|
3706
|
+
throw error;
|
|
3707
|
+
}
|
|
3708
|
+
};
|
|
3709
|
+
const close = () => {
|
|
3710
|
+
closed = true;
|
|
3711
|
+
if (timer) {
|
|
3712
|
+
clearInterval(timer);
|
|
3713
|
+
timer = undefined;
|
|
3714
|
+
}
|
|
3715
|
+
listeners.clear();
|
|
3716
|
+
};
|
|
3717
|
+
if (typeof window !== "undefined" && options.intervalMs && options.intervalMs > 0) {
|
|
3718
|
+
timer = setInterval(() => {
|
|
3719
|
+
refresh().catch(() => {});
|
|
3720
|
+
}, options.intervalMs);
|
|
3721
|
+
}
|
|
3722
|
+
return {
|
|
3723
|
+
close,
|
|
3724
|
+
getServerSnapshot: () => snapshot,
|
|
3725
|
+
getSnapshot: () => snapshot,
|
|
3726
|
+
refresh,
|
|
3727
|
+
subscribe: (listener) => {
|
|
3728
|
+
listeners.add(listener);
|
|
3729
|
+
return () => {
|
|
3730
|
+
listeners.delete(listener);
|
|
3731
|
+
};
|
|
3732
|
+
}
|
|
3733
|
+
};
|
|
3734
|
+
};
|
|
3735
|
+
|
|
3736
|
+
// src/react/useVoicePlatformCoverage.tsx
|
|
3737
|
+
var useVoicePlatformCoverage = (path = "/api/voice/platform-coverage", options = {}) => {
|
|
3738
|
+
const storeRef = useRef13(null);
|
|
3739
|
+
if (!storeRef.current) {
|
|
3740
|
+
storeRef.current = createVoicePlatformCoverageStore(path, options);
|
|
3741
|
+
}
|
|
3742
|
+
const store = storeRef.current;
|
|
3743
|
+
useEffect13(() => {
|
|
3744
|
+
store.refresh().catch(() => {});
|
|
3745
|
+
return () => store.close();
|
|
3746
|
+
}, [store]);
|
|
3747
|
+
return {
|
|
3748
|
+
...useSyncExternalStore13(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
3749
|
+
refresh: store.refresh
|
|
3750
|
+
};
|
|
3751
|
+
};
|
|
3752
|
+
// src/react/useVoiceLiveOps.tsx
|
|
3753
|
+
import { useEffect as useEffect14, useRef as useRef14, useSyncExternalStore as useSyncExternalStore14 } from "react";
|
|
3754
|
+
|
|
3657
3755
|
// src/client/liveOps.ts
|
|
3658
3756
|
var postVoiceLiveOpsAction = async (input, options = {}) => {
|
|
3659
3757
|
if (!input.sessionId) {
|
|
@@ -3742,19 +3840,19 @@ var createVoiceLiveOpsStore = (options = {}) => {
|
|
|
3742
3840
|
|
|
3743
3841
|
// src/react/useVoiceLiveOps.tsx
|
|
3744
3842
|
var useVoiceLiveOps = (options = {}) => {
|
|
3745
|
-
const storeRef =
|
|
3843
|
+
const storeRef = useRef14(null);
|
|
3746
3844
|
if (!storeRef.current) {
|
|
3747
3845
|
storeRef.current = createVoiceLiveOpsStore(options);
|
|
3748
3846
|
}
|
|
3749
3847
|
const store = storeRef.current;
|
|
3750
|
-
|
|
3848
|
+
useEffect14(() => () => store.close(), [store]);
|
|
3751
3849
|
return {
|
|
3752
|
-
...
|
|
3850
|
+
...useSyncExternalStore14(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
3753
3851
|
run: store.run
|
|
3754
3852
|
};
|
|
3755
3853
|
};
|
|
3756
3854
|
// src/react/useVoiceCampaignDialerProof.tsx
|
|
3757
|
-
import { useEffect as
|
|
3855
|
+
import { useEffect as useEffect15, useRef as useRef15, useSyncExternalStore as useSyncExternalStore15 } from "react";
|
|
3758
3856
|
|
|
3759
3857
|
// src/client/campaignDialerProof.ts
|
|
3760
3858
|
var fetchVoiceCampaignDialerProofStatus = async (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
@@ -3876,23 +3974,23 @@ var createVoiceCampaignDialerProofStore = (path = "/api/voice/campaigns/dialer-p
|
|
|
3876
3974
|
|
|
3877
3975
|
// src/react/useVoiceCampaignDialerProof.tsx
|
|
3878
3976
|
var useVoiceCampaignDialerProof = (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
3879
|
-
const storeRef =
|
|
3977
|
+
const storeRef = useRef15(null);
|
|
3880
3978
|
if (!storeRef.current) {
|
|
3881
3979
|
storeRef.current = createVoiceCampaignDialerProofStore(path, options);
|
|
3882
3980
|
}
|
|
3883
3981
|
const store = storeRef.current;
|
|
3884
|
-
|
|
3982
|
+
useEffect15(() => {
|
|
3885
3983
|
store.refresh().catch(() => {});
|
|
3886
3984
|
return () => store.close();
|
|
3887
3985
|
}, [store]);
|
|
3888
3986
|
return {
|
|
3889
|
-
...
|
|
3987
|
+
...useSyncExternalStore15(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
3890
3988
|
refresh: store.refresh,
|
|
3891
3989
|
runProof: store.runProof
|
|
3892
3990
|
};
|
|
3893
3991
|
};
|
|
3894
3992
|
// src/react/useVoiceStream.tsx
|
|
3895
|
-
import { useEffect as
|
|
3993
|
+
import { useEffect as useEffect16, useRef as useRef16, useSyncExternalStore as useSyncExternalStore16 } from "react";
|
|
3896
3994
|
|
|
3897
3995
|
// src/client/actions.ts
|
|
3898
3996
|
var normalizeErrorMessage = (value) => {
|
|
@@ -4552,13 +4650,13 @@ var EMPTY_SNAPSHOT = {
|
|
|
4552
4650
|
turns: []
|
|
4553
4651
|
};
|
|
4554
4652
|
var useVoiceStream = (path, options = {}) => {
|
|
4555
|
-
const streamRef =
|
|
4653
|
+
const streamRef = useRef16(null);
|
|
4556
4654
|
if (!streamRef.current) {
|
|
4557
4655
|
streamRef.current = createVoiceStream(path, options);
|
|
4558
4656
|
}
|
|
4559
4657
|
const stream = streamRef.current;
|
|
4560
|
-
|
|
4561
|
-
const snapshot =
|
|
4658
|
+
useEffect16(() => () => stream.close(), [stream]);
|
|
4659
|
+
const snapshot = useSyncExternalStore16(stream.subscribe, stream.getSnapshot, stream.getServerSnapshot) ?? EMPTY_SNAPSHOT;
|
|
4562
4660
|
return {
|
|
4563
4661
|
...snapshot,
|
|
4564
4662
|
callControl: (message) => stream.callControl(message),
|
|
@@ -4568,7 +4666,7 @@ var useVoiceStream = (path, options = {}) => {
|
|
|
4568
4666
|
};
|
|
4569
4667
|
};
|
|
4570
4668
|
// src/react/useVoiceController.tsx
|
|
4571
|
-
import { useEffect as
|
|
4669
|
+
import { useEffect as useEffect17, useRef as useRef17, useSyncExternalStore as useSyncExternalStore17 } from "react";
|
|
4572
4670
|
|
|
4573
4671
|
// src/client/htmx.ts
|
|
4574
4672
|
var DEFAULT_EVENT_NAME = "voice-refresh";
|
|
@@ -5231,13 +5329,13 @@ var EMPTY_SNAPSHOT2 = {
|
|
|
5231
5329
|
turns: []
|
|
5232
5330
|
};
|
|
5233
5331
|
var useVoiceController = (path, options = {}) => {
|
|
5234
|
-
const controllerRef =
|
|
5332
|
+
const controllerRef = useRef17(null);
|
|
5235
5333
|
if (!controllerRef.current) {
|
|
5236
5334
|
controllerRef.current = createVoiceController(path, options);
|
|
5237
5335
|
}
|
|
5238
5336
|
const controller = controllerRef.current;
|
|
5239
|
-
|
|
5240
|
-
const snapshot =
|
|
5337
|
+
useEffect17(() => () => controller.close(), [controller]);
|
|
5338
|
+
const snapshot = useSyncExternalStore17(controller.subscribe, controller.getSnapshot, controller.getServerSnapshot) ?? EMPTY_SNAPSHOT2;
|
|
5241
5339
|
return {
|
|
5242
5340
|
...snapshot,
|
|
5243
5341
|
bindHTMX: controller.bindHTMX,
|
|
@@ -5251,7 +5349,7 @@ var useVoiceController = (path, options = {}) => {
|
|
|
5251
5349
|
};
|
|
5252
5350
|
};
|
|
5253
5351
|
// src/react/useVoiceWorkflowStatus.tsx
|
|
5254
|
-
import { useEffect as
|
|
5352
|
+
import { useEffect as useEffect18, useRef as useRef18, useSyncExternalStore as useSyncExternalStore18 } from "react";
|
|
5255
5353
|
|
|
5256
5354
|
// src/client/workflowStatus.ts
|
|
5257
5355
|
var fetchVoiceWorkflowStatus = async (path = "/evals/scenarios/json", options = {}) => {
|
|
@@ -5334,17 +5432,17 @@ var createVoiceWorkflowStatusStore = (path = "/evals/scenarios/json", options =
|
|
|
5334
5432
|
|
|
5335
5433
|
// src/react/useVoiceWorkflowStatus.tsx
|
|
5336
5434
|
var useVoiceWorkflowStatus = (path = "/evals/scenarios/json", options = {}) => {
|
|
5337
|
-
const storeRef =
|
|
5435
|
+
const storeRef = useRef18(null);
|
|
5338
5436
|
if (!storeRef.current) {
|
|
5339
5437
|
storeRef.current = createVoiceWorkflowStatusStore(path, options);
|
|
5340
5438
|
}
|
|
5341
5439
|
const store = storeRef.current;
|
|
5342
|
-
|
|
5440
|
+
useEffect18(() => {
|
|
5343
5441
|
store.refresh().catch(() => {});
|
|
5344
5442
|
return () => store.close();
|
|
5345
5443
|
}, [store]);
|
|
5346
5444
|
return {
|
|
5347
|
-
...
|
|
5445
|
+
...useSyncExternalStore18(store.subscribe, store.getSnapshot, store.getServerSnapshot),
|
|
5348
5446
|
refresh: store.refresh
|
|
5349
5447
|
};
|
|
5350
5448
|
};
|
|
@@ -5359,6 +5457,7 @@ export {
|
|
|
5359
5457
|
useVoiceProviderSimulationControls,
|
|
5360
5458
|
useVoiceProviderContracts,
|
|
5361
5459
|
useVoiceProviderCapabilities,
|
|
5460
|
+
useVoicePlatformCoverage,
|
|
5362
5461
|
useVoiceOpsStatus,
|
|
5363
5462
|
useVoiceOpsActionCenter,
|
|
5364
5463
|
useVoiceLiveOps,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type VoicePlatformCoverageClientOptions } from '../client/platformCoverage';
|
|
2
|
+
export declare const useVoicePlatformCoverage: (path?: string, options?: VoicePlatformCoverageClientOptions) => {
|
|
3
|
+
refresh: () => Promise<import("..").VoicePlatformCoverageSummary | undefined>;
|
|
4
|
+
error: string | null;
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
report?: import("..").VoicePlatformCoverageSummary;
|
|
7
|
+
updatedAt?: number;
|
|
8
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { VoicePlatformCoverageClientOptions } from '../client/platformCoverage';
|
|
2
|
+
export declare const createVoicePlatformCoverage: (path?: string, options?: VoicePlatformCoverageClientOptions) => {
|
|
3
|
+
close: () => void;
|
|
4
|
+
getSnapshot: () => import("../client/platformCoverage").VoicePlatformCoverageSnapshot;
|
|
5
|
+
refresh: () => Promise<import("..").VoicePlatformCoverageSummary | undefined>;
|
|
6
|
+
subscribe: (listener: () => void) => () => void;
|
|
7
|
+
};
|
package/dist/svelte/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { createVoiceDeliveryRuntime } from './createVoiceDeliveryRuntime';
|
|
|
3
3
|
export { createVoiceOpsActionCenter } from './createVoiceOpsActionCenter';
|
|
4
4
|
export { createVoiceLiveOps } from './createVoiceLiveOps';
|
|
5
5
|
export { createVoiceOpsStatus } from './createVoiceOpsStatus';
|
|
6
|
+
export { createVoicePlatformCoverage } from './createVoicePlatformCoverage';
|
|
6
7
|
export { createVoiceProviderSimulationControls } from './createVoiceProviderSimulationControls';
|
|
7
8
|
export { createVoiceProviderCapabilities } from './createVoiceProviderCapabilities';
|
|
8
9
|
export { createVoiceProviderContracts } from './createVoiceProviderContracts';
|
package/dist/svelte/index.js
CHANGED
|
@@ -2265,6 +2265,95 @@ var createVoiceOpsStatus = (path = "/api/voice/ops-status", options = {}) => {
|
|
|
2265
2265
|
subscribe: store.subscribe
|
|
2266
2266
|
};
|
|
2267
2267
|
};
|
|
2268
|
+
// src/client/platformCoverage.ts
|
|
2269
|
+
var fetchVoicePlatformCoverage = async (path = "/api/voice/platform-coverage", options = {}) => {
|
|
2270
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
2271
|
+
const response = await fetchImpl(path);
|
|
2272
|
+
if (!response.ok) {
|
|
2273
|
+
throw new Error(`Voice platform coverage failed: HTTP ${response.status}`);
|
|
2274
|
+
}
|
|
2275
|
+
return await response.json();
|
|
2276
|
+
};
|
|
2277
|
+
var createVoicePlatformCoverageStore = (path = "/api/voice/platform-coverage", options = {}) => {
|
|
2278
|
+
const listeners = new Set;
|
|
2279
|
+
let closed = false;
|
|
2280
|
+
let timer;
|
|
2281
|
+
let snapshot = {
|
|
2282
|
+
error: null,
|
|
2283
|
+
isLoading: false
|
|
2284
|
+
};
|
|
2285
|
+
const emit = () => {
|
|
2286
|
+
for (const listener of listeners) {
|
|
2287
|
+
listener();
|
|
2288
|
+
}
|
|
2289
|
+
};
|
|
2290
|
+
const refresh = async () => {
|
|
2291
|
+
if (closed) {
|
|
2292
|
+
return snapshot.report;
|
|
2293
|
+
}
|
|
2294
|
+
snapshot = {
|
|
2295
|
+
...snapshot,
|
|
2296
|
+
error: null,
|
|
2297
|
+
isLoading: true
|
|
2298
|
+
};
|
|
2299
|
+
emit();
|
|
2300
|
+
try {
|
|
2301
|
+
const report = await fetchVoicePlatformCoverage(path, options);
|
|
2302
|
+
snapshot = {
|
|
2303
|
+
error: null,
|
|
2304
|
+
isLoading: false,
|
|
2305
|
+
report,
|
|
2306
|
+
updatedAt: Date.now()
|
|
2307
|
+
};
|
|
2308
|
+
emit();
|
|
2309
|
+
return report;
|
|
2310
|
+
} catch (error) {
|
|
2311
|
+
snapshot = {
|
|
2312
|
+
...snapshot,
|
|
2313
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2314
|
+
isLoading: false
|
|
2315
|
+
};
|
|
2316
|
+
emit();
|
|
2317
|
+
throw error;
|
|
2318
|
+
}
|
|
2319
|
+
};
|
|
2320
|
+
const close = () => {
|
|
2321
|
+
closed = true;
|
|
2322
|
+
if (timer) {
|
|
2323
|
+
clearInterval(timer);
|
|
2324
|
+
timer = undefined;
|
|
2325
|
+
}
|
|
2326
|
+
listeners.clear();
|
|
2327
|
+
};
|
|
2328
|
+
if (typeof window !== "undefined" && options.intervalMs && options.intervalMs > 0) {
|
|
2329
|
+
timer = setInterval(() => {
|
|
2330
|
+
refresh().catch(() => {});
|
|
2331
|
+
}, options.intervalMs);
|
|
2332
|
+
}
|
|
2333
|
+
return {
|
|
2334
|
+
close,
|
|
2335
|
+
getServerSnapshot: () => snapshot,
|
|
2336
|
+
getSnapshot: () => snapshot,
|
|
2337
|
+
refresh,
|
|
2338
|
+
subscribe: (listener) => {
|
|
2339
|
+
listeners.add(listener);
|
|
2340
|
+
return () => {
|
|
2341
|
+
listeners.delete(listener);
|
|
2342
|
+
};
|
|
2343
|
+
}
|
|
2344
|
+
};
|
|
2345
|
+
};
|
|
2346
|
+
|
|
2347
|
+
// src/svelte/createVoicePlatformCoverage.ts
|
|
2348
|
+
var createVoicePlatformCoverage = (path = "/api/voice/platform-coverage", options = {}) => {
|
|
2349
|
+
const store = createVoicePlatformCoverageStore(path, options);
|
|
2350
|
+
return {
|
|
2351
|
+
close: store.close,
|
|
2352
|
+
getSnapshot: store.getSnapshot,
|
|
2353
|
+
refresh: store.refresh,
|
|
2354
|
+
subscribe: store.subscribe
|
|
2355
|
+
};
|
|
2356
|
+
};
|
|
2268
2357
|
// src/client/providerSimulationControls.ts
|
|
2269
2358
|
var postSimulation = async (pathPrefix, mode, provider, fetchImpl) => {
|
|
2270
2359
|
const response = await fetchImpl(`${pathPrefix}/${mode}?provider=${encodeURIComponent(provider)}`, { method: "POST" });
|
|
@@ -5385,6 +5474,7 @@ export {
|
|
|
5385
5474
|
createVoiceProviderSimulationControls,
|
|
5386
5475
|
createVoiceProviderContracts,
|
|
5387
5476
|
createVoiceProviderCapabilities,
|
|
5477
|
+
createVoicePlatformCoverage,
|
|
5388
5478
|
createVoiceOpsStatus,
|
|
5389
5479
|
createVoiceOpsActionCenter,
|
|
5390
5480
|
createVoiceLiveOps,
|
package/dist/vue/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { useVoiceAgentSquadStatus } from './useVoiceAgentSquadStatus';
|
|
|
10
10
|
export { VoiceTurnLatency } from './VoiceTurnLatency';
|
|
11
11
|
export { VoiceTurnQuality } from './VoiceTurnQuality';
|
|
12
12
|
export { useVoiceOpsStatus } from './useVoiceOpsStatus';
|
|
13
|
+
export { useVoicePlatformCoverage } from './useVoicePlatformCoverage';
|
|
13
14
|
export { useVoiceOpsActionCenter } from './useVoiceOpsActionCenter';
|
|
14
15
|
export { useVoiceLiveOps } from './useVoiceLiveOps';
|
|
15
16
|
export { useVoiceDeliveryRuntime } from './useVoiceDeliveryRuntime';
|