@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
package/dist/vue/index.js
CHANGED
|
@@ -3343,9 +3343,122 @@ var VoiceTurnQuality = defineComponent10({
|
|
|
3343
3343
|
]);
|
|
3344
3344
|
}
|
|
3345
3345
|
});
|
|
3346
|
-
// src/vue/
|
|
3346
|
+
// src/vue/useVoicePlatformCoverage.ts
|
|
3347
3347
|
import { onUnmounted as onUnmounted12, ref as ref8, shallowRef as shallowRef11 } from "vue";
|
|
3348
3348
|
|
|
3349
|
+
// src/client/platformCoverage.ts
|
|
3350
|
+
var fetchVoicePlatformCoverage = async (path = "/api/voice/platform-coverage", options = {}) => {
|
|
3351
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
3352
|
+
const response = await fetchImpl(path);
|
|
3353
|
+
if (!response.ok) {
|
|
3354
|
+
throw new Error(`Voice platform coverage failed: HTTP ${response.status}`);
|
|
3355
|
+
}
|
|
3356
|
+
return await response.json();
|
|
3357
|
+
};
|
|
3358
|
+
var createVoicePlatformCoverageStore = (path = "/api/voice/platform-coverage", options = {}) => {
|
|
3359
|
+
const listeners = new Set;
|
|
3360
|
+
let closed = false;
|
|
3361
|
+
let timer;
|
|
3362
|
+
let snapshot = {
|
|
3363
|
+
error: null,
|
|
3364
|
+
isLoading: false
|
|
3365
|
+
};
|
|
3366
|
+
const emit = () => {
|
|
3367
|
+
for (const listener of listeners) {
|
|
3368
|
+
listener();
|
|
3369
|
+
}
|
|
3370
|
+
};
|
|
3371
|
+
const refresh = async () => {
|
|
3372
|
+
if (closed) {
|
|
3373
|
+
return snapshot.report;
|
|
3374
|
+
}
|
|
3375
|
+
snapshot = {
|
|
3376
|
+
...snapshot,
|
|
3377
|
+
error: null,
|
|
3378
|
+
isLoading: true
|
|
3379
|
+
};
|
|
3380
|
+
emit();
|
|
3381
|
+
try {
|
|
3382
|
+
const report = await fetchVoicePlatformCoverage(path, options);
|
|
3383
|
+
snapshot = {
|
|
3384
|
+
error: null,
|
|
3385
|
+
isLoading: false,
|
|
3386
|
+
report,
|
|
3387
|
+
updatedAt: Date.now()
|
|
3388
|
+
};
|
|
3389
|
+
emit();
|
|
3390
|
+
return report;
|
|
3391
|
+
} catch (error) {
|
|
3392
|
+
snapshot = {
|
|
3393
|
+
...snapshot,
|
|
3394
|
+
error: error instanceof Error ? error.message : String(error),
|
|
3395
|
+
isLoading: false
|
|
3396
|
+
};
|
|
3397
|
+
emit();
|
|
3398
|
+
throw error;
|
|
3399
|
+
}
|
|
3400
|
+
};
|
|
3401
|
+
const close = () => {
|
|
3402
|
+
closed = true;
|
|
3403
|
+
if (timer) {
|
|
3404
|
+
clearInterval(timer);
|
|
3405
|
+
timer = undefined;
|
|
3406
|
+
}
|
|
3407
|
+
listeners.clear();
|
|
3408
|
+
};
|
|
3409
|
+
if (typeof window !== "undefined" && options.intervalMs && options.intervalMs > 0) {
|
|
3410
|
+
timer = setInterval(() => {
|
|
3411
|
+
refresh().catch(() => {});
|
|
3412
|
+
}, options.intervalMs);
|
|
3413
|
+
}
|
|
3414
|
+
return {
|
|
3415
|
+
close,
|
|
3416
|
+
getServerSnapshot: () => snapshot,
|
|
3417
|
+
getSnapshot: () => snapshot,
|
|
3418
|
+
refresh,
|
|
3419
|
+
subscribe: (listener) => {
|
|
3420
|
+
listeners.add(listener);
|
|
3421
|
+
return () => {
|
|
3422
|
+
listeners.delete(listener);
|
|
3423
|
+
};
|
|
3424
|
+
}
|
|
3425
|
+
};
|
|
3426
|
+
};
|
|
3427
|
+
|
|
3428
|
+
// src/vue/useVoicePlatformCoverage.ts
|
|
3429
|
+
function useVoicePlatformCoverage(path = "/api/voice/platform-coverage", options = {}) {
|
|
3430
|
+
const store = createVoicePlatformCoverageStore(path, options);
|
|
3431
|
+
const error = ref8(null);
|
|
3432
|
+
const isLoading = ref8(false);
|
|
3433
|
+
const report = shallowRef11(undefined);
|
|
3434
|
+
const updatedAt = ref8(undefined);
|
|
3435
|
+
const sync = () => {
|
|
3436
|
+
const snapshot = store.getSnapshot();
|
|
3437
|
+
error.value = snapshot.error;
|
|
3438
|
+
isLoading.value = snapshot.isLoading;
|
|
3439
|
+
report.value = snapshot.report;
|
|
3440
|
+
updatedAt.value = snapshot.updatedAt;
|
|
3441
|
+
};
|
|
3442
|
+
const unsubscribe = store.subscribe(sync);
|
|
3443
|
+
sync();
|
|
3444
|
+
if (typeof window !== "undefined") {
|
|
3445
|
+
store.refresh().catch(() => {});
|
|
3446
|
+
}
|
|
3447
|
+
onUnmounted12(() => {
|
|
3448
|
+
unsubscribe();
|
|
3449
|
+
store.close();
|
|
3450
|
+
});
|
|
3451
|
+
return {
|
|
3452
|
+
error,
|
|
3453
|
+
isLoading,
|
|
3454
|
+
refresh: store.refresh,
|
|
3455
|
+
report,
|
|
3456
|
+
updatedAt
|
|
3457
|
+
};
|
|
3458
|
+
}
|
|
3459
|
+
// src/vue/useVoiceLiveOps.ts
|
|
3460
|
+
import { onUnmounted as onUnmounted13, ref as ref9, shallowRef as shallowRef12 } from "vue";
|
|
3461
|
+
|
|
3349
3462
|
// src/client/liveOps.ts
|
|
3350
3463
|
var postVoiceLiveOpsAction = async (input, options = {}) => {
|
|
3351
3464
|
if (!input.sessionId) {
|
|
@@ -3435,11 +3548,11 @@ var createVoiceLiveOpsStore = (options = {}) => {
|
|
|
3435
3548
|
// src/vue/useVoiceLiveOps.ts
|
|
3436
3549
|
function useVoiceLiveOps(options = {}) {
|
|
3437
3550
|
const store = createVoiceLiveOpsStore(options);
|
|
3438
|
-
const error =
|
|
3439
|
-
const isRunning =
|
|
3440
|
-
const lastResult =
|
|
3441
|
-
const runningAction =
|
|
3442
|
-
const updatedAt =
|
|
3551
|
+
const error = ref9(null);
|
|
3552
|
+
const isRunning = ref9(false);
|
|
3553
|
+
const lastResult = shallowRef12(undefined);
|
|
3554
|
+
const runningAction = ref9(undefined);
|
|
3555
|
+
const updatedAt = ref9(undefined);
|
|
3443
3556
|
const sync = () => {
|
|
3444
3557
|
const snapshot = store.getSnapshot();
|
|
3445
3558
|
error.value = snapshot.error;
|
|
@@ -3450,7 +3563,7 @@ function useVoiceLiveOps(options = {}) {
|
|
|
3450
3563
|
};
|
|
3451
3564
|
const unsubscribe = store.subscribe(sync);
|
|
3452
3565
|
sync();
|
|
3453
|
-
|
|
3566
|
+
onUnmounted13(() => {
|
|
3454
3567
|
unsubscribe();
|
|
3455
3568
|
store.close();
|
|
3456
3569
|
});
|
|
@@ -3464,7 +3577,7 @@ function useVoiceLiveOps(options = {}) {
|
|
|
3464
3577
|
};
|
|
3465
3578
|
}
|
|
3466
3579
|
// src/vue/useVoiceCampaignDialerProof.ts
|
|
3467
|
-
import { onUnmounted as
|
|
3580
|
+
import { onUnmounted as onUnmounted14, shallowRef as shallowRef13 } from "vue";
|
|
3468
3581
|
|
|
3469
3582
|
// src/client/campaignDialerProof.ts
|
|
3470
3583
|
var fetchVoiceCampaignDialerProofStatus = async (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
@@ -3587,11 +3700,11 @@ var createVoiceCampaignDialerProofStore = (path = "/api/voice/campaigns/dialer-p
|
|
|
3587
3700
|
// src/vue/useVoiceCampaignDialerProof.ts
|
|
3588
3701
|
function useVoiceCampaignDialerProof(path = "/api/voice/campaigns/dialer-proof", options = {}) {
|
|
3589
3702
|
const store = createVoiceCampaignDialerProofStore(path, options);
|
|
3590
|
-
const error =
|
|
3591
|
-
const isLoading =
|
|
3592
|
-
const report =
|
|
3593
|
-
const status =
|
|
3594
|
-
const updatedAt =
|
|
3703
|
+
const error = shallowRef13(null);
|
|
3704
|
+
const isLoading = shallowRef13(false);
|
|
3705
|
+
const report = shallowRef13();
|
|
3706
|
+
const status = shallowRef13();
|
|
3707
|
+
const updatedAt = shallowRef13(undefined);
|
|
3595
3708
|
const sync = () => {
|
|
3596
3709
|
const snapshot = store.getSnapshot();
|
|
3597
3710
|
error.value = snapshot.error;
|
|
@@ -3605,7 +3718,7 @@ function useVoiceCampaignDialerProof(path = "/api/voice/campaigns/dialer-proof",
|
|
|
3605
3718
|
if (typeof window !== "undefined") {
|
|
3606
3719
|
store.refresh().catch(() => {});
|
|
3607
3720
|
}
|
|
3608
|
-
|
|
3721
|
+
onUnmounted14(() => {
|
|
3609
3722
|
unsubscribe();
|
|
3610
3723
|
store.close();
|
|
3611
3724
|
});
|
|
@@ -3620,7 +3733,7 @@ function useVoiceCampaignDialerProof(path = "/api/voice/campaigns/dialer-proof",
|
|
|
3620
3733
|
};
|
|
3621
3734
|
}
|
|
3622
3735
|
// src/vue/useVoiceStream.ts
|
|
3623
|
-
import { onUnmounted as
|
|
3736
|
+
import { onUnmounted as onUnmounted15, ref as ref10, shallowRef as shallowRef14 } from "vue";
|
|
3624
3737
|
|
|
3625
3738
|
// src/client/actions.ts
|
|
3626
3739
|
var normalizeErrorMessage = (value) => {
|
|
@@ -4265,16 +4378,16 @@ var createVoiceStream = (path, options = {}) => {
|
|
|
4265
4378
|
// src/vue/useVoiceStream.ts
|
|
4266
4379
|
function useVoiceStream(path, options = {}) {
|
|
4267
4380
|
const stream = createVoiceStream(path, options);
|
|
4268
|
-
const assistantAudio =
|
|
4269
|
-
const assistantTexts =
|
|
4270
|
-
const call =
|
|
4271
|
-
const error =
|
|
4272
|
-
const isConnected =
|
|
4273
|
-
const partial =
|
|
4274
|
-
const reconnect =
|
|
4275
|
-
const sessionId =
|
|
4276
|
-
const status =
|
|
4277
|
-
const turns =
|
|
4381
|
+
const assistantAudio = shallowRef14([]);
|
|
4382
|
+
const assistantTexts = shallowRef14([]);
|
|
4383
|
+
const call = shallowRef14(null);
|
|
4384
|
+
const error = ref10(null);
|
|
4385
|
+
const isConnected = ref10(false);
|
|
4386
|
+
const partial = ref10("");
|
|
4387
|
+
const reconnect = shallowRef14(stream.reconnect);
|
|
4388
|
+
const sessionId = ref10(stream.sessionId);
|
|
4389
|
+
const status = ref10(stream.status);
|
|
4390
|
+
const turns = shallowRef14([]);
|
|
4278
4391
|
const sync = () => {
|
|
4279
4392
|
assistantAudio.value = [...stream.assistantAudio];
|
|
4280
4393
|
assistantTexts.value = [...stream.assistantTexts];
|
|
@@ -4293,7 +4406,7 @@ function useVoiceStream(path, options = {}) {
|
|
|
4293
4406
|
unsubscribe();
|
|
4294
4407
|
stream.close();
|
|
4295
4408
|
};
|
|
4296
|
-
|
|
4409
|
+
onUnmounted15(destroy);
|
|
4297
4410
|
return {
|
|
4298
4411
|
assistantAudio,
|
|
4299
4412
|
assistantTexts,
|
|
@@ -4312,7 +4425,7 @@ function useVoiceStream(path, options = {}) {
|
|
|
4312
4425
|
};
|
|
4313
4426
|
}
|
|
4314
4427
|
// src/vue/useVoiceController.ts
|
|
4315
|
-
import { onUnmounted as
|
|
4428
|
+
import { onUnmounted as onUnmounted16, ref as ref11, shallowRef as shallowRef15 } from "vue";
|
|
4316
4429
|
|
|
4317
4430
|
// src/client/htmx.ts
|
|
4318
4431
|
var DEFAULT_EVENT_NAME = "voice-refresh";
|
|
@@ -4958,17 +5071,17 @@ var createVoiceController = (path, options = {}) => {
|
|
|
4958
5071
|
// src/vue/useVoiceController.ts
|
|
4959
5072
|
function useVoiceController(path, options = {}) {
|
|
4960
5073
|
const controller = createVoiceController(path, options);
|
|
4961
|
-
const assistantAudio =
|
|
4962
|
-
const assistantTexts =
|
|
4963
|
-
const error =
|
|
4964
|
-
const isConnected =
|
|
4965
|
-
const isRecording =
|
|
4966
|
-
const partial =
|
|
4967
|
-
const reconnect =
|
|
4968
|
-
const recordingError =
|
|
4969
|
-
const sessionId =
|
|
4970
|
-
const status =
|
|
4971
|
-
const turns =
|
|
5074
|
+
const assistantAudio = shallowRef15([]);
|
|
5075
|
+
const assistantTexts = shallowRef15([]);
|
|
5076
|
+
const error = ref11(null);
|
|
5077
|
+
const isConnected = ref11(false);
|
|
5078
|
+
const isRecording = ref11(false);
|
|
5079
|
+
const partial = ref11("");
|
|
5080
|
+
const reconnect = shallowRef15(controller.reconnect);
|
|
5081
|
+
const recordingError = ref11(null);
|
|
5082
|
+
const sessionId = ref11(controller.sessionId);
|
|
5083
|
+
const status = ref11(controller.status);
|
|
5084
|
+
const turns = shallowRef15([]);
|
|
4972
5085
|
const sync = () => {
|
|
4973
5086
|
assistantAudio.value = [...controller.assistantAudio];
|
|
4974
5087
|
assistantTexts.value = [...controller.assistantTexts];
|
|
@@ -4988,7 +5101,7 @@ function useVoiceController(path, options = {}) {
|
|
|
4988
5101
|
unsubscribe();
|
|
4989
5102
|
controller.close();
|
|
4990
5103
|
};
|
|
4991
|
-
|
|
5104
|
+
onUnmounted16(destroy);
|
|
4992
5105
|
return {
|
|
4993
5106
|
assistantAudio,
|
|
4994
5107
|
assistantTexts,
|
|
@@ -5011,13 +5124,13 @@ function useVoiceController(path, options = {}) {
|
|
|
5011
5124
|
};
|
|
5012
5125
|
}
|
|
5013
5126
|
// src/vue/useVoiceTraceTimeline.ts
|
|
5014
|
-
import { onUnmounted as
|
|
5127
|
+
import { onUnmounted as onUnmounted17, ref as ref12, shallowRef as shallowRef16 } from "vue";
|
|
5015
5128
|
function useVoiceTraceTimeline(path = "/api/voice-traces", options = {}) {
|
|
5016
5129
|
const store = createVoiceTraceTimelineStore(path, options);
|
|
5017
|
-
const error =
|
|
5018
|
-
const isLoading =
|
|
5019
|
-
const report =
|
|
5020
|
-
const updatedAt =
|
|
5130
|
+
const error = ref12(null);
|
|
5131
|
+
const isLoading = ref12(false);
|
|
5132
|
+
const report = shallowRef16(null);
|
|
5133
|
+
const updatedAt = ref12(undefined);
|
|
5021
5134
|
const sync = () => {
|
|
5022
5135
|
const snapshot = store.getSnapshot();
|
|
5023
5136
|
error.value = snapshot.error;
|
|
@@ -5028,7 +5141,7 @@ function useVoiceTraceTimeline(path = "/api/voice-traces", options = {}) {
|
|
|
5028
5141
|
const unsubscribe = store.subscribe(sync);
|
|
5029
5142
|
sync();
|
|
5030
5143
|
store.refresh().catch(() => {});
|
|
5031
|
-
|
|
5144
|
+
onUnmounted17(() => {
|
|
5032
5145
|
unsubscribe();
|
|
5033
5146
|
store.close();
|
|
5034
5147
|
});
|
|
@@ -5041,7 +5154,7 @@ function useVoiceTraceTimeline(path = "/api/voice-traces", options = {}) {
|
|
|
5041
5154
|
};
|
|
5042
5155
|
}
|
|
5043
5156
|
// src/vue/useVoiceWorkflowStatus.ts
|
|
5044
|
-
import { onUnmounted as
|
|
5157
|
+
import { onUnmounted as onUnmounted18, ref as ref13, shallowRef as shallowRef17 } from "vue";
|
|
5045
5158
|
|
|
5046
5159
|
// src/client/workflowStatus.ts
|
|
5047
5160
|
var fetchVoiceWorkflowStatus = async (path = "/evals/scenarios/json", options = {}) => {
|
|
@@ -5125,10 +5238,10 @@ var createVoiceWorkflowStatusStore = (path = "/evals/scenarios/json", options =
|
|
|
5125
5238
|
// src/vue/useVoiceWorkflowStatus.ts
|
|
5126
5239
|
function useVoiceWorkflowStatus(path = "/evals/scenarios/json", options = {}) {
|
|
5127
5240
|
const store = createVoiceWorkflowStatusStore(path, options);
|
|
5128
|
-
const error =
|
|
5129
|
-
const isLoading =
|
|
5130
|
-
const report =
|
|
5131
|
-
const updatedAt =
|
|
5241
|
+
const error = ref13(null);
|
|
5242
|
+
const isLoading = ref13(false);
|
|
5243
|
+
const report = shallowRef17(undefined);
|
|
5244
|
+
const updatedAt = ref13(undefined);
|
|
5132
5245
|
const sync = () => {
|
|
5133
5246
|
const snapshot = store.getSnapshot();
|
|
5134
5247
|
error.value = snapshot.error;
|
|
@@ -5141,7 +5254,7 @@ function useVoiceWorkflowStatus(path = "/evals/scenarios/json", options = {}) {
|
|
|
5141
5254
|
if (typeof window !== "undefined") {
|
|
5142
5255
|
store.refresh().catch(() => {});
|
|
5143
5256
|
}
|
|
5144
|
-
|
|
5257
|
+
onUnmounted18(() => {
|
|
5145
5258
|
unsubscribe();
|
|
5146
5259
|
store.close();
|
|
5147
5260
|
});
|
|
@@ -5164,6 +5277,7 @@ export {
|
|
|
5164
5277
|
useVoiceProviderSimulationControls,
|
|
5165
5278
|
useVoiceProviderContracts,
|
|
5166
5279
|
useVoiceProviderCapabilities,
|
|
5280
|
+
useVoicePlatformCoverage,
|
|
5167
5281
|
useVoiceOpsStatus,
|
|
5168
5282
|
useVoiceOpsActionCenter,
|
|
5169
5283
|
useVoiceLiveOps,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VoicePlatformCoverageClientOptions } from '../client/platformCoverage';
|
|
2
|
+
import type { VoicePlatformCoverageSummary } from '../platformCoverage';
|
|
3
|
+
export declare function useVoicePlatformCoverage(path?: string, options?: VoicePlatformCoverageClientOptions): {
|
|
4
|
+
error: import("vue").Ref<string | null, string | null>;
|
|
5
|
+
isLoading: import("vue").Ref<boolean, boolean>;
|
|
6
|
+
refresh: () => Promise<VoicePlatformCoverageSummary | undefined>;
|
|
7
|
+
report: import("vue").ShallowRef<VoicePlatformCoverageSummary | undefined, VoicePlatformCoverageSummary | undefined>;
|
|
8
|
+
updatedAt: import("vue").Ref<number | undefined, number | undefined>;
|
|
9
|
+
};
|