@absolutejs/voice 0.0.22-beta.115 → 0.0.22-beta.117
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 +274 -108
- package/dist/angular/voice-campaign-dialer-proof.service.d.ts +14 -0
- package/dist/campaignDialers.d.ts +39 -1
- package/dist/client/campaignDialerProof.d.ts +23 -0
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +120 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +168 -9
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.js +151 -12
- package/dist/react/useVoiceCampaignDialerProof.d.ts +10 -0
- package/dist/svelte/createVoiceCampaignDialerProof.d.ts +9 -0
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +121 -0
- package/dist/vue/index.d.ts +1 -0
- package/dist/vue/index.js +172 -17
- package/dist/vue/useVoiceCampaignDialerProof.d.ts +11 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { applyVoiceCampaignTelephonyOutcome, VoiceCampaignDialer, VoiceCampaignDialerInput, type VoiceCampaignRecord, type VoiceCampaignStore, type VoiceCampaignTickResult } from './campaign';
|
|
2
2
|
type VoiceCampaignDialerFetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
3
3
|
type VoiceCampaignDialerMetadataInput = VoiceCampaignDialerInput & {
|
|
4
4
|
provider: 'plivo' | 'telnyx' | 'twilio';
|
|
@@ -46,7 +46,45 @@ export type VoicePlivoCampaignDialerOptions = {
|
|
|
46
46
|
from: string;
|
|
47
47
|
metadata?: VoiceCampaignDialerMetadata;
|
|
48
48
|
};
|
|
49
|
+
export type VoiceCampaignDialerProofProvider = 'plivo' | 'telnyx' | 'twilio';
|
|
50
|
+
export type VoiceCampaignDialerProofCarrierRequest = {
|
|
51
|
+
body: unknown;
|
|
52
|
+
method: string;
|
|
53
|
+
provider: VoiceCampaignDialerProofProvider;
|
|
54
|
+
url: string;
|
|
55
|
+
};
|
|
56
|
+
export type VoiceCampaignDialerProofProviderResult = {
|
|
57
|
+
campaignId: string;
|
|
58
|
+
carrierRequests: VoiceCampaignDialerProofCarrierRequest[];
|
|
59
|
+
final?: VoiceCampaignRecord;
|
|
60
|
+
outcomes: Awaited<ReturnType<typeof applyVoiceCampaignTelephonyOutcome>>[];
|
|
61
|
+
provider: VoiceCampaignDialerProofProvider;
|
|
62
|
+
tick: VoiceCampaignTickResult;
|
|
63
|
+
};
|
|
64
|
+
export type VoiceCampaignDialerProofReport = {
|
|
65
|
+
generatedAt: number;
|
|
66
|
+
mode: 'dry-run';
|
|
67
|
+
ok: boolean;
|
|
68
|
+
providers: VoiceCampaignDialerProofProviderResult[];
|
|
69
|
+
};
|
|
70
|
+
export type VoiceCampaignDialerProofStatus = {
|
|
71
|
+
generatedAt: number;
|
|
72
|
+
mode: 'dry-run';
|
|
73
|
+
ok: boolean;
|
|
74
|
+
providers: VoiceCampaignDialerProofProvider[];
|
|
75
|
+
runPath?: string;
|
|
76
|
+
safe: true;
|
|
77
|
+
};
|
|
78
|
+
export type VoiceCampaignDialerProofOptions = {
|
|
79
|
+
baseUrl?: string;
|
|
80
|
+
from?: string;
|
|
81
|
+
providers?: VoiceCampaignDialerProofProvider[];
|
|
82
|
+
runPath?: string;
|
|
83
|
+
store?: VoiceCampaignStore;
|
|
84
|
+
};
|
|
49
85
|
export declare const createVoiceTwilioCampaignDialer: (options: VoiceTwilioCampaignDialerOptions) => VoiceCampaignDialer;
|
|
50
86
|
export declare const createVoiceTelnyxCampaignDialer: (options: VoiceTelnyxCampaignDialerOptions) => VoiceCampaignDialer;
|
|
51
87
|
export declare const createVoicePlivoCampaignDialer: (options: VoicePlivoCampaignDialerOptions) => VoiceCampaignDialer;
|
|
88
|
+
export declare const getVoiceCampaignDialerProofStatus: (options?: Pick<VoiceCampaignDialerProofOptions, "providers" | "runPath">) => VoiceCampaignDialerProofStatus;
|
|
89
|
+
export declare const runVoiceCampaignDialerProof: (options?: VoiceCampaignDialerProofOptions) => Promise<VoiceCampaignDialerProofReport>;
|
|
52
90
|
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { VoiceCampaignDialerProofReport, VoiceCampaignDialerProofStatus } from '../campaignDialers';
|
|
2
|
+
export type VoiceCampaignDialerProofClientOptions = {
|
|
3
|
+
fetch?: typeof fetch;
|
|
4
|
+
intervalMs?: number;
|
|
5
|
+
runPath?: string;
|
|
6
|
+
};
|
|
7
|
+
export type VoiceCampaignDialerProofSnapshot = {
|
|
8
|
+
error: string | null;
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
report?: VoiceCampaignDialerProofReport;
|
|
11
|
+
status?: VoiceCampaignDialerProofStatus;
|
|
12
|
+
updatedAt?: number;
|
|
13
|
+
};
|
|
14
|
+
export declare const fetchVoiceCampaignDialerProofStatus: (path?: string, options?: Pick<VoiceCampaignDialerProofClientOptions, "fetch">) => Promise<VoiceCampaignDialerProofStatus>;
|
|
15
|
+
export declare const runVoiceCampaignDialerProofAction: (path?: string, options?: Pick<VoiceCampaignDialerProofClientOptions, "fetch">) => Promise<VoiceCampaignDialerProofReport>;
|
|
16
|
+
export declare const createVoiceCampaignDialerProofStore: (path?: string, options?: VoiceCampaignDialerProofClientOptions) => {
|
|
17
|
+
close: () => void;
|
|
18
|
+
getServerSnapshot: () => VoiceCampaignDialerProofSnapshot;
|
|
19
|
+
getSnapshot: () => VoiceCampaignDialerProofSnapshot;
|
|
20
|
+
refresh: () => Promise<VoiceCampaignDialerProofStatus | undefined>;
|
|
21
|
+
runProof: () => Promise<VoiceCampaignDialerProofReport>;
|
|
22
|
+
subscribe: (listener: () => void) => () => void;
|
|
23
|
+
};
|
package/dist/client/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export { createVoiceProviderStatusStore, fetchVoiceProviderStatus } from './prov
|
|
|
15
15
|
export { createVoiceProviderCapabilitiesStore, fetchVoiceProviderCapabilities } from './providerCapabilities';
|
|
16
16
|
export { createVoiceTurnQualityStore, fetchVoiceTurnQuality } from './turnQuality';
|
|
17
17
|
export { createVoiceTurnLatencyStore, fetchVoiceTurnLatency, runVoiceTurnLatencyProof } from './turnLatency';
|
|
18
|
+
export { createVoiceCampaignDialerProofStore, fetchVoiceCampaignDialerProofStatus, runVoiceCampaignDialerProofAction } from './campaignDialerProof';
|
|
18
19
|
export { createVoiceTraceTimelineStore, fetchVoiceTraceTimeline } from './traceTimeline';
|
|
19
20
|
export { createVoiceProviderSimulationControlsStore } from './providerSimulationControls';
|
|
20
21
|
export { bindVoiceProviderSimulationControls, createVoiceProviderSimulationControlsViewModel, defineVoiceProviderSimulationControlsElement, mountVoiceProviderSimulationControls, renderVoiceProviderSimulationControlsHTML } from './providerSimulationControlsWidget';
|
|
@@ -34,6 +35,7 @@ export type { VoiceProviderStatusClientOptions, VoiceProviderStatusSnapshot } fr
|
|
|
34
35
|
export type { VoiceProviderCapabilitiesClientOptions, VoiceProviderCapabilitiesSnapshot } from './providerCapabilities';
|
|
35
36
|
export type { VoiceTurnQualityClientOptions, VoiceTurnQualitySnapshot } from './turnQuality';
|
|
36
37
|
export type { VoiceTurnLatencyClientOptions, VoiceTurnLatencySnapshot } from './turnLatency';
|
|
38
|
+
export type { VoiceCampaignDialerProofClientOptions, VoiceCampaignDialerProofSnapshot } from './campaignDialerProof';
|
|
37
39
|
export type { VoiceTraceTimelineClientOptions, VoiceTraceTimelineSnapshot } from './traceTimeline';
|
|
38
40
|
export type { VoiceProviderSimulationControlsOptions, VoiceProviderSimulationControlsSnapshot, VoiceProviderSimulationProvider } from './providerSimulationControls';
|
|
39
41
|
export type { VoiceProviderSimulationControlsViewModel } from './providerSimulationControlsWidget';
|
package/dist/client/index.js
CHANGED
|
@@ -2560,6 +2560,123 @@ var createVoiceTurnLatencyStore = (path = "/api/turn-latency", options = {}) =>
|
|
|
2560
2560
|
}
|
|
2561
2561
|
};
|
|
2562
2562
|
};
|
|
2563
|
+
// src/client/campaignDialerProof.ts
|
|
2564
|
+
var fetchVoiceCampaignDialerProofStatus = async (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
2565
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
2566
|
+
const response = await fetchImpl(path);
|
|
2567
|
+
if (!response.ok) {
|
|
2568
|
+
throw new Error(`Voice campaign dialer proof status failed: HTTP ${response.status}`);
|
|
2569
|
+
}
|
|
2570
|
+
return await response.json();
|
|
2571
|
+
};
|
|
2572
|
+
var runVoiceCampaignDialerProofAction = async (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
2573
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
2574
|
+
const response = await fetchImpl(path, { method: "POST" });
|
|
2575
|
+
if (!response.ok) {
|
|
2576
|
+
throw new Error(`Voice campaign dialer proof failed: HTTP ${response.status}`);
|
|
2577
|
+
}
|
|
2578
|
+
return await response.json();
|
|
2579
|
+
};
|
|
2580
|
+
var createVoiceCampaignDialerProofStore = (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
2581
|
+
const listeners = new Set;
|
|
2582
|
+
let closed = false;
|
|
2583
|
+
let timer;
|
|
2584
|
+
let snapshot = {
|
|
2585
|
+
error: null,
|
|
2586
|
+
isLoading: false
|
|
2587
|
+
};
|
|
2588
|
+
const emit = () => {
|
|
2589
|
+
for (const listener of listeners) {
|
|
2590
|
+
listener();
|
|
2591
|
+
}
|
|
2592
|
+
};
|
|
2593
|
+
const refresh = async () => {
|
|
2594
|
+
if (closed) {
|
|
2595
|
+
return snapshot.status;
|
|
2596
|
+
}
|
|
2597
|
+
snapshot = { ...snapshot, error: null, isLoading: true };
|
|
2598
|
+
emit();
|
|
2599
|
+
try {
|
|
2600
|
+
const status = await fetchVoiceCampaignDialerProofStatus(path, options);
|
|
2601
|
+
snapshot = {
|
|
2602
|
+
...snapshot,
|
|
2603
|
+
error: null,
|
|
2604
|
+
isLoading: false,
|
|
2605
|
+
status,
|
|
2606
|
+
updatedAt: Date.now()
|
|
2607
|
+
};
|
|
2608
|
+
emit();
|
|
2609
|
+
return status;
|
|
2610
|
+
} catch (error) {
|
|
2611
|
+
snapshot = {
|
|
2612
|
+
...snapshot,
|
|
2613
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2614
|
+
isLoading: false
|
|
2615
|
+
};
|
|
2616
|
+
emit();
|
|
2617
|
+
throw error;
|
|
2618
|
+
}
|
|
2619
|
+
};
|
|
2620
|
+
const runProof = async () => {
|
|
2621
|
+
const runPath = options.runPath ?? snapshot.status?.runPath ?? path;
|
|
2622
|
+
snapshot = { ...snapshot, error: null, isLoading: true };
|
|
2623
|
+
emit();
|
|
2624
|
+
try {
|
|
2625
|
+
const report = await runVoiceCampaignDialerProofAction(runPath, options);
|
|
2626
|
+
snapshot = {
|
|
2627
|
+
...snapshot,
|
|
2628
|
+
error: null,
|
|
2629
|
+
isLoading: false,
|
|
2630
|
+
report,
|
|
2631
|
+
status: {
|
|
2632
|
+
generatedAt: Date.now(),
|
|
2633
|
+
mode: report.mode,
|
|
2634
|
+
ok: report.ok,
|
|
2635
|
+
providers: report.providers.map((provider) => provider.provider),
|
|
2636
|
+
runPath,
|
|
2637
|
+
safe: true
|
|
2638
|
+
},
|
|
2639
|
+
updatedAt: Date.now()
|
|
2640
|
+
};
|
|
2641
|
+
emit();
|
|
2642
|
+
return report;
|
|
2643
|
+
} catch (error) {
|
|
2644
|
+
snapshot = {
|
|
2645
|
+
...snapshot,
|
|
2646
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2647
|
+
isLoading: false
|
|
2648
|
+
};
|
|
2649
|
+
emit();
|
|
2650
|
+
throw error;
|
|
2651
|
+
}
|
|
2652
|
+
};
|
|
2653
|
+
const close = () => {
|
|
2654
|
+
closed = true;
|
|
2655
|
+
if (timer) {
|
|
2656
|
+
clearInterval(timer);
|
|
2657
|
+
timer = undefined;
|
|
2658
|
+
}
|
|
2659
|
+
listeners.clear();
|
|
2660
|
+
};
|
|
2661
|
+
if (options.intervalMs && options.intervalMs > 0) {
|
|
2662
|
+
timer = setInterval(() => {
|
|
2663
|
+
refresh().catch(() => {});
|
|
2664
|
+
}, options.intervalMs);
|
|
2665
|
+
}
|
|
2666
|
+
return {
|
|
2667
|
+
close,
|
|
2668
|
+
getServerSnapshot: () => snapshot,
|
|
2669
|
+
getSnapshot: () => snapshot,
|
|
2670
|
+
refresh,
|
|
2671
|
+
runProof,
|
|
2672
|
+
subscribe: (listener) => {
|
|
2673
|
+
listeners.add(listener);
|
|
2674
|
+
return () => {
|
|
2675
|
+
listeners.delete(listener);
|
|
2676
|
+
};
|
|
2677
|
+
}
|
|
2678
|
+
};
|
|
2679
|
+
};
|
|
2563
2680
|
// src/client/traceTimeline.ts
|
|
2564
2681
|
var fetchVoiceTraceTimeline = async (path = "/api/voice-traces", options = {}) => {
|
|
2565
2682
|
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
@@ -3423,6 +3540,7 @@ var createVoiceWorkflowStatusStore = (path = "/evals/scenarios/json", options =
|
|
|
3423
3540
|
};
|
|
3424
3541
|
export {
|
|
3425
3542
|
runVoiceTurnLatencyProof,
|
|
3543
|
+
runVoiceCampaignDialerProofAction,
|
|
3426
3544
|
renderVoiceTurnQualityHTML,
|
|
3427
3545
|
renderVoiceTurnLatencyHTML,
|
|
3428
3546
|
renderVoiceTraceTimelineWidgetHTML,
|
|
@@ -3453,6 +3571,7 @@ export {
|
|
|
3453
3571
|
fetchVoiceRoutingStatus,
|
|
3454
3572
|
fetchVoiceProviderStatus,
|
|
3455
3573
|
fetchVoiceProviderCapabilities,
|
|
3574
|
+
fetchVoiceCampaignDialerProofStatus,
|
|
3456
3575
|
fetchVoiceAppKitStatus,
|
|
3457
3576
|
defineVoiceTurnQualityElement,
|
|
3458
3577
|
defineVoiceTurnLatencyElement,
|
|
@@ -3484,6 +3603,7 @@ export {
|
|
|
3484
3603
|
createVoiceDuplexController,
|
|
3485
3604
|
createVoiceController,
|
|
3486
3605
|
createVoiceConnection,
|
|
3606
|
+
createVoiceCampaignDialerProofStore,
|
|
3487
3607
|
createVoiceBargeInMonitor,
|
|
3488
3608
|
createVoiceAudioPlayer,
|
|
3489
3609
|
createVoiceAppKitStatusStore,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { voice } from './plugin';
|
|
2
2
|
export { createVoiceAppKit, createVoiceAppKitRoutes, summarizeVoiceAppKitStatus } from './appKit';
|
|
3
3
|
export { applyVoiceCampaignTelephonyOutcome, buildVoiceCampaignObservabilityReport, createVoiceCampaignTelephonyOutcomeHandler, createVoiceCampaign, createVoiceCampaignRoutes, createVoiceCampaignWorker, createVoiceCampaignWorkerLoop, createVoiceMemoryCampaignStore, renderVoiceCampaignObservabilityHTML, renderVoiceCampaignsHTML, runVoiceCampaignProof, summarizeVoiceCampaigns } from './campaign';
|
|
4
|
-
export { createVoicePlivoCampaignDialer, createVoiceTelnyxCampaignDialer, createVoiceTwilioCampaignDialer } from './campaignDialers';
|
|
4
|
+
export { createVoicePlivoCampaignDialer, createVoiceTelnyxCampaignDialer, createVoiceTwilioCampaignDialer, getVoiceCampaignDialerProofStatus, runVoiceCampaignDialerProof } from './campaignDialers';
|
|
5
5
|
export { createVoiceAssistant, createVoiceExperiment, summarizeVoiceAssistantRuns } from './assistant';
|
|
6
6
|
export { createVoiceAssistantHealthHTMLHandler, createVoiceAssistantHealthJSONHandler, createVoiceAssistantHealthRoutes, renderVoiceAssistantHealthHTML, summarizeVoiceAssistantHealth } from './assistantHealth';
|
|
7
7
|
export { createVoiceBargeInRoutes, renderVoiceBargeInHTML, summarizeVoiceBargeIn } from './bargeInRoutes';
|
|
@@ -56,6 +56,7 @@ export { resolveTurnDetectionConfig, TURN_PROFILE_DEFAULTS } from './turnProfile
|
|
|
56
56
|
export { createVoiceCallReviewFromLiveTelephonyReport, createVoiceCallReviewRecorder, renderVoiceCallReviewHTML, renderVoiceCallReviewMarkdown } from './testing/review';
|
|
57
57
|
export type { VoiceAppKitLink, VoiceAppKitRoutes, VoiceAppKitRoutesOptions, VoiceAppKitStatus, VoiceAppKitStatusOptions, VoiceAppKitStatusReport, VoiceAppKitSurface } from './appKit';
|
|
58
58
|
export type { VoiceCampaign, VoiceCampaignAttempt, VoiceCampaignAttemptResultInput, VoiceCampaignAttemptStatus, VoiceCampaignCreateInput, VoiceCampaignDialer, VoiceCampaignDialerInput, VoiceCampaignDialerResult, VoiceCampaignProofOptions, VoiceCampaignProofReport, VoiceCampaignRecipient, VoiceCampaignRecipientInput, VoiceCampaignRecipientStatus, VoiceCampaignRecord, VoiceCampaignRoutesOptions, VoiceCampaignRuntime, VoiceCampaignRuntimeOptions, VoiceCampaignStatus, VoiceCampaignStore, VoiceCampaignSummary, VoiceCampaignTickResult } from './campaign';
|
|
59
|
+
export type { VoiceCampaignDialerProofCarrierRequest, VoiceCampaignDialerProofOptions, VoiceCampaignDialerProofProvider, VoiceCampaignDialerProofProviderResult, VoiceCampaignDialerProofReport, VoiceCampaignDialerProofStatus, VoicePlivoCampaignDialerOptions, VoiceTelnyxCampaignDialerOptions, VoiceTwilioCampaignDialerOptions } from './campaignDialers';
|
|
59
60
|
export type { VoiceBargeInReport, VoiceBargeInRoutesOptions } from './bargeInRoutes';
|
|
60
61
|
export type { VoiceAssistant, VoiceAssistantArtifactPlan, VoiceAssistantExperiment, VoiceAssistantExperimentOptions, VoiceAssistantGuardrailInput, VoiceAssistantGuardrails, VoiceAssistantMemoryLifecycle, VoiceAssistantMemoryLifecycleInput, VoiceAssistantOptions, VoiceAssistantOutputGuardrailInput, VoiceAssistantPreset, VoiceAssistantRunsSummary, VoiceAssistantRunSummary, VoiceAssistantVariant } from './assistant';
|
|
61
62
|
export type { VoiceAssistantHealthFailure, VoiceAssistantHealthHTMLHandlerOptions, VoiceAssistantHealthRoutesOptions, VoiceAssistantHealthSummary, VoiceAssistantHealthSummaryOptions } from './assistantHealth';
|
package/dist/index.js
CHANGED
|
@@ -11451,6 +11451,163 @@ var createVoicePlivoCampaignDialer = (options) => async (input) => {
|
|
|
11451
11451
|
status: "running"
|
|
11452
11452
|
};
|
|
11453
11453
|
};
|
|
11454
|
+
var campaignDialerProofProviders = [
|
|
11455
|
+
"twilio",
|
|
11456
|
+
"telnyx",
|
|
11457
|
+
"plivo"
|
|
11458
|
+
];
|
|
11459
|
+
var joinUrlPath = (origin, path) => `${origin.replace(/\/$/, "")}${path.startsWith("/") ? path : `/${path}`}`;
|
|
11460
|
+
var serializeProofRequestBody = (body) => {
|
|
11461
|
+
if (body instanceof URLSearchParams) {
|
|
11462
|
+
return Object.fromEntries(body.entries());
|
|
11463
|
+
}
|
|
11464
|
+
if (typeof body === "string") {
|
|
11465
|
+
try {
|
|
11466
|
+
return JSON.parse(body);
|
|
11467
|
+
} catch {
|
|
11468
|
+
return body;
|
|
11469
|
+
}
|
|
11470
|
+
}
|
|
11471
|
+
return body ? String(body) : undefined;
|
|
11472
|
+
};
|
|
11473
|
+
var createProofFetch = (provider, requests) => {
|
|
11474
|
+
let sequence = 0;
|
|
11475
|
+
return async (url, init) => {
|
|
11476
|
+
sequence += 1;
|
|
11477
|
+
requests.push({
|
|
11478
|
+
body: serializeProofRequestBody(init?.body),
|
|
11479
|
+
method: init?.method ?? "GET",
|
|
11480
|
+
provider,
|
|
11481
|
+
url: String(url)
|
|
11482
|
+
});
|
|
11483
|
+
const externalCallId = `dry-run-${provider}-${sequence}`;
|
|
11484
|
+
const payload = provider === "twilio" ? { sid: externalCallId } : provider === "telnyx" ? { data: { call_control_id: externalCallId } } : { request_uuid: externalCallId };
|
|
11485
|
+
return Response.json(payload);
|
|
11486
|
+
};
|
|
11487
|
+
};
|
|
11488
|
+
var createProofDialer = (input) => {
|
|
11489
|
+
const fetch2 = createProofFetch(input.provider, input.requests);
|
|
11490
|
+
if (input.provider === "twilio") {
|
|
11491
|
+
return createVoiceTwilioCampaignDialer({
|
|
11492
|
+
accountSid: "AC_dry_run",
|
|
11493
|
+
answerUrl: joinUrlPath(input.baseUrl, "/api/twilio/voice"),
|
|
11494
|
+
apiBaseUrl: "https://twilio.dry-run.absolutejs.local",
|
|
11495
|
+
authToken: "dry-run-token",
|
|
11496
|
+
fetch: fetch2,
|
|
11497
|
+
from: input.from,
|
|
11498
|
+
statusCallbackEvents: ["answered", "completed"],
|
|
11499
|
+
statusCallbackUrl: joinUrlPath(input.baseUrl, "/api/telephony-webhook")
|
|
11500
|
+
});
|
|
11501
|
+
}
|
|
11502
|
+
if (input.provider === "telnyx") {
|
|
11503
|
+
return createVoiceTelnyxCampaignDialer({
|
|
11504
|
+
apiBaseUrl: "https://telnyx.dry-run.absolutejs.local",
|
|
11505
|
+
apiKey: "dry-run-token",
|
|
11506
|
+
connectionId: "dry-run-connection",
|
|
11507
|
+
fetch: fetch2,
|
|
11508
|
+
from: input.from,
|
|
11509
|
+
webhookUrl: joinUrlPath(input.baseUrl, "/api/telnyx/webhook")
|
|
11510
|
+
});
|
|
11511
|
+
}
|
|
11512
|
+
return createVoicePlivoCampaignDialer({
|
|
11513
|
+
answerUrl: joinUrlPath(input.baseUrl, "/api/plivo/voice"),
|
|
11514
|
+
apiBaseUrl: "https://plivo.dry-run.absolutejs.local",
|
|
11515
|
+
authId: "dry-run-auth-id",
|
|
11516
|
+
authToken: "dry-run-token",
|
|
11517
|
+
callbackUrl: joinUrlPath(input.baseUrl, "/api/plivo/webhook"),
|
|
11518
|
+
fetch: fetch2,
|
|
11519
|
+
from: input.from
|
|
11520
|
+
});
|
|
11521
|
+
};
|
|
11522
|
+
var runCampaignDialerProofForProvider = async (input) => {
|
|
11523
|
+
const carrierRequests = [];
|
|
11524
|
+
const runtime = createVoiceCampaign({
|
|
11525
|
+
dialer: createProofDialer({
|
|
11526
|
+
baseUrl: input.baseUrl,
|
|
11527
|
+
from: input.from,
|
|
11528
|
+
provider: input.provider,
|
|
11529
|
+
requests: carrierRequests
|
|
11530
|
+
}),
|
|
11531
|
+
store: input.store
|
|
11532
|
+
});
|
|
11533
|
+
const proof = await runVoiceCampaignProof({
|
|
11534
|
+
campaign: {
|
|
11535
|
+
description: "Dry-run carrier dialer proof with campaign metadata and webhook outcome resolution.",
|
|
11536
|
+
id: `campaign-dialer-proof-${input.provider}-${crypto.randomUUID()}`,
|
|
11537
|
+
metadata: {
|
|
11538
|
+
mode: "dry-run",
|
|
11539
|
+
provider: input.provider
|
|
11540
|
+
},
|
|
11541
|
+
name: `AbsoluteJS Voice ${input.provider} Campaign Dialer Proof`
|
|
11542
|
+
},
|
|
11543
|
+
completeAttempts: false,
|
|
11544
|
+
recipients: [
|
|
11545
|
+
{
|
|
11546
|
+
id: `dialer-proof-${input.provider}-recipient`,
|
|
11547
|
+
metadata: {
|
|
11548
|
+
provider: input.provider,
|
|
11549
|
+
source: "campaign-dialer-proof"
|
|
11550
|
+
},
|
|
11551
|
+
name: `${input.provider} dry-run recipient`,
|
|
11552
|
+
phone: "+15550001001"
|
|
11553
|
+
}
|
|
11554
|
+
],
|
|
11555
|
+
runtime
|
|
11556
|
+
});
|
|
11557
|
+
const outcomes = await Promise.all(proof.tick.started.map((attempt) => applyVoiceCampaignTelephonyOutcome({
|
|
11558
|
+
decision: {
|
|
11559
|
+
action: "complete",
|
|
11560
|
+
confidence: "high",
|
|
11561
|
+
disposition: "completed",
|
|
11562
|
+
source: "status"
|
|
11563
|
+
},
|
|
11564
|
+
event: {
|
|
11565
|
+
metadata: {
|
|
11566
|
+
attemptId: attempt.id,
|
|
11567
|
+
campaignId: attempt.campaignId,
|
|
11568
|
+
externalCallId: attempt.externalCallId,
|
|
11569
|
+
voiceCampaignAttemptId: attempt.id,
|
|
11570
|
+
voiceCampaignId: attempt.campaignId
|
|
11571
|
+
},
|
|
11572
|
+
provider: input.provider,
|
|
11573
|
+
status: "completed"
|
|
11574
|
+
}
|
|
11575
|
+
}, {
|
|
11576
|
+
runtime
|
|
11577
|
+
})));
|
|
11578
|
+
return {
|
|
11579
|
+
campaignId: proof.campaign.campaign.id,
|
|
11580
|
+
carrierRequests,
|
|
11581
|
+
final: await runtime.get(proof.campaign.campaign.id),
|
|
11582
|
+
outcomes,
|
|
11583
|
+
provider: input.provider,
|
|
11584
|
+
tick: proof.tick
|
|
11585
|
+
};
|
|
11586
|
+
};
|
|
11587
|
+
var getVoiceCampaignDialerProofStatus = (options = {}) => ({
|
|
11588
|
+
generatedAt: Date.now(),
|
|
11589
|
+
mode: "dry-run",
|
|
11590
|
+
ok: true,
|
|
11591
|
+
providers: options.providers ?? campaignDialerProofProviders,
|
|
11592
|
+
runPath: options.runPath,
|
|
11593
|
+
safe: true
|
|
11594
|
+
});
|
|
11595
|
+
var runVoiceCampaignDialerProof = async (options = {}) => {
|
|
11596
|
+
const providers = options.providers ?? campaignDialerProofProviders;
|
|
11597
|
+
const store = options.store ?? createVoiceMemoryCampaignStore();
|
|
11598
|
+
const results = await Promise.all(providers.map((provider) => runCampaignDialerProofForProvider({
|
|
11599
|
+
baseUrl: options.baseUrl ?? "http://localhost",
|
|
11600
|
+
from: options.from ?? "+15550009999",
|
|
11601
|
+
provider,
|
|
11602
|
+
store
|
|
11603
|
+
})));
|
|
11604
|
+
return {
|
|
11605
|
+
generatedAt: Date.now(),
|
|
11606
|
+
mode: "dry-run",
|
|
11607
|
+
ok: results.every((result) => result.carrierRequests.length > 0 && result.outcomes.every((outcome) => outcome.applied)),
|
|
11608
|
+
providers: results
|
|
11609
|
+
};
|
|
11610
|
+
};
|
|
11454
11611
|
// src/simulationSuite.ts
|
|
11455
11612
|
import { Elysia as Elysia20 } from "elysia";
|
|
11456
11613
|
|
|
@@ -13533,7 +13690,7 @@ var resolveTwilioStreamParameters = async (parameters, input) => {
|
|
|
13533
13690
|
}
|
|
13534
13691
|
return parameters;
|
|
13535
13692
|
};
|
|
13536
|
-
var
|
|
13693
|
+
var joinUrlPath2 = (origin, path) => `${origin.replace(/\/$/, "")}${path.startsWith("/") ? path : `/${path}`}`;
|
|
13537
13694
|
var escapeHtml25 = (value) => value.replaceAll("&", "&").replaceAll('"', """).replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">");
|
|
13538
13695
|
var getWebhookVerificationUrl = (webhook, input) => {
|
|
13539
13696
|
if (!webhook?.verificationUrl) {
|
|
@@ -13547,8 +13704,8 @@ var getWebhookVerificationUrl = (webhook, input) => {
|
|
|
13547
13704
|
var buildTwilioVoiceSetupStatus = async (options, input) => {
|
|
13548
13705
|
const origin = resolveRequestOrigin(input.request);
|
|
13549
13706
|
const stream = await resolveTwilioStreamUrl(options, input);
|
|
13550
|
-
const twiml =
|
|
13551
|
-
const webhook =
|
|
13707
|
+
const twiml = joinUrlPath2(origin, input.twimlPath);
|
|
13708
|
+
const webhook = joinUrlPath2(origin, input.webhookPath);
|
|
13552
13709
|
const verificationUrl = getWebhookVerificationUrl(options.webhook, input);
|
|
13553
13710
|
const missing = Object.entries(options.setup?.requiredEnv ?? {}).filter((entry) => !entry[1]).map(([name]) => name);
|
|
13554
13711
|
const signingConfigured = Boolean(options.webhook?.signingSecret || options.webhook?.verify);
|
|
@@ -14215,7 +14372,7 @@ var createTwilioVoiceRoutes = (options) => {
|
|
|
14215
14372
|
// src/telephony/plivo.ts
|
|
14216
14373
|
var escapeXml3 = (value) => value.replaceAll("&", "&").replaceAll('"', """).replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">");
|
|
14217
14374
|
var escapeHtml26 = (value) => value.replaceAll("&", "&").replaceAll('"', """).replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">");
|
|
14218
|
-
var
|
|
14375
|
+
var joinUrlPath3 = (origin, path) => `${origin.replace(/\/$/, "")}${path.startsWith("/") ? path : `/${path}`}`;
|
|
14219
14376
|
var resolveRequestOrigin2 = (request) => {
|
|
14220
14377
|
const url = new URL(request.url);
|
|
14221
14378
|
const forwardedHost = request.headers.get("x-forwarded-host");
|
|
@@ -14436,8 +14593,8 @@ var verifyVoicePlivoWebhookSignature = async (input) => {
|
|
|
14436
14593
|
var buildPlivoVoiceSetupStatus = async (options, input) => {
|
|
14437
14594
|
const origin = resolveRequestOrigin2(input.request);
|
|
14438
14595
|
const stream = await resolvePlivoStreamUrl(options, input);
|
|
14439
|
-
const answer =
|
|
14440
|
-
const webhook =
|
|
14596
|
+
const answer = joinUrlPath3(origin, input.answerPath);
|
|
14597
|
+
const webhook = joinUrlPath3(origin, input.webhookPath);
|
|
14441
14598
|
const missing = Object.entries(options.setup?.requiredEnv ?? {}).filter((entry) => !entry[1]).map(([name]) => name);
|
|
14442
14599
|
const signingConfigured = Boolean(options.webhook?.authToken || options.webhook?.verify);
|
|
14443
14600
|
const warnings = [
|
|
@@ -14688,7 +14845,7 @@ import { Buffer as Buffer6 } from "buffer";
|
|
|
14688
14845
|
import { Elysia as Elysia27 } from "elysia";
|
|
14689
14846
|
var escapeXml4 = (value) => value.replaceAll("&", "&").replaceAll('"', """).replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">");
|
|
14690
14847
|
var escapeHtml27 = (value) => value.replaceAll("&", "&").replaceAll('"', """).replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">");
|
|
14691
|
-
var
|
|
14848
|
+
var joinUrlPath4 = (origin, path) => `${origin.replace(/\/$/, "")}${path.startsWith("/") ? path : `/${path}`}`;
|
|
14692
14849
|
var resolveRequestOrigin3 = (request) => {
|
|
14693
14850
|
const url = new URL(request.url);
|
|
14694
14851
|
const forwardedHost = request.headers.get("x-forwarded-host");
|
|
@@ -14860,8 +15017,8 @@ var verifyVoiceTelnyxWebhookSignature = async (input) => {
|
|
|
14860
15017
|
var buildTelnyxVoiceSetupStatus = async (options, input) => {
|
|
14861
15018
|
const origin = resolveRequestOrigin3(input.request);
|
|
14862
15019
|
const stream = await resolveTelnyxStreamUrl(options, input);
|
|
14863
|
-
const texml =
|
|
14864
|
-
const webhook =
|
|
15020
|
+
const texml = joinUrlPath4(origin, input.texmlPath);
|
|
15021
|
+
const webhook = joinUrlPath4(origin, input.webhookPath);
|
|
14865
15022
|
const missing = Object.entries(options.setup?.requiredEnv ?? {}).filter((entry) => !entry[1]).map(([name]) => name);
|
|
14866
15023
|
const signingConfigured = Boolean(options.webhook?.publicKey || options.webhook?.verify);
|
|
14867
15024
|
const warnings = [
|
|
@@ -19460,6 +19617,7 @@ export {
|
|
|
19460
19617
|
runVoiceScenarioEvals,
|
|
19461
19618
|
runVoiceOutcomeContractSuite,
|
|
19462
19619
|
runVoiceCampaignProof,
|
|
19620
|
+
runVoiceCampaignDialerProof,
|
|
19463
19621
|
resolveVoiceTraceRedactionOptions,
|
|
19464
19622
|
resolveVoiceTelephonyOutcome,
|
|
19465
19623
|
resolveVoiceSTTRoutingStrategy,
|
|
@@ -19519,6 +19677,7 @@ export {
|
|
|
19519
19677
|
isVoiceOpsTaskOverdue,
|
|
19520
19678
|
heartbeatVoiceOpsTask,
|
|
19521
19679
|
hasVoiceOpsTaskSLABreach,
|
|
19680
|
+
getVoiceCampaignDialerProofStatus,
|
|
19522
19681
|
filterVoiceTraceEvents,
|
|
19523
19682
|
failVoiceOpsTask,
|
|
19524
19683
|
exportVoiceTrace,
|
package/dist/react/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { VoiceTraceTimeline } from './VoiceTraceTimeline';
|
|
|
7
7
|
export { VoiceTurnLatency } from './VoiceTurnLatency';
|
|
8
8
|
export { VoiceTurnQuality } from './VoiceTurnQuality';
|
|
9
9
|
export { useVoiceAppKitStatus } from './useVoiceAppKitStatus';
|
|
10
|
+
export { useVoiceCampaignDialerProof } from './useVoiceCampaignDialerProof';
|
|
10
11
|
export { useVoiceStream } from './useVoiceStream';
|
|
11
12
|
export { useVoiceController } from './useVoiceController';
|
|
12
13
|
export { useVoiceProviderStatus } from './useVoiceProviderStatus';
|