@absolutejs/voice 0.0.22-beta.204 → 0.0.22-beta.206
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/README.md +398 -1
- package/dist/angular/index.d.ts +1 -0
- package/dist/angular/index.js +150 -31
- package/dist/angular/voice-agent-squad-status.service.d.ts +12 -0
- package/dist/client/agentSquadStatus.d.ts +37 -0
- package/dist/client/agentSquadStatusWidget.d.ts +24 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.js +170 -0
- package/dist/index.js +46 -7
- package/dist/phoneAgent.d.ts +14 -0
- package/dist/react/VoiceAgentSquadStatus.d.ts +5 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +349 -97
- package/dist/react/useVoiceAgentSquadStatus.d.ts +8 -0
- package/dist/svelte/createVoiceAgentSquadStatus.d.ts +9 -0
- package/dist/svelte/index.d.ts +1 -0
- package/dist/svelte/index.js +211 -33
- package/dist/traceTimeline.d.ts +1 -0
- package/dist/vue/index.d.ts +1 -0
- package/dist/vue/index.js +255 -145
- package/dist/vue/useVoiceAgentSquadStatus.d.ts +9 -0
- package/package.json +1 -1
package/dist/vue/index.js
CHANGED
|
@@ -2573,6 +2573,197 @@ var VoiceRoutingStatus = defineComponent8({
|
|
|
2573
2573
|
]);
|
|
2574
2574
|
}
|
|
2575
2575
|
});
|
|
2576
|
+
// src/vue/useVoiceAgentSquadStatus.ts
|
|
2577
|
+
import { onUnmounted as onUnmounted9, ref as ref7, shallowRef as shallowRef8 } from "vue";
|
|
2578
|
+
|
|
2579
|
+
// src/client/traceTimeline.ts
|
|
2580
|
+
var fetchVoiceTraceTimeline = async (path = "/api/voice-traces", options = {}) => {
|
|
2581
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
2582
|
+
const response = await fetchImpl(path);
|
|
2583
|
+
if (!response.ok) {
|
|
2584
|
+
throw new Error(`Voice trace timeline failed: HTTP ${response.status}`);
|
|
2585
|
+
}
|
|
2586
|
+
return await response.json();
|
|
2587
|
+
};
|
|
2588
|
+
var createVoiceTraceTimelineStore = (path = "/api/voice-traces", options = {}) => {
|
|
2589
|
+
const listeners = new Set;
|
|
2590
|
+
let closed = false;
|
|
2591
|
+
let timer;
|
|
2592
|
+
let snapshot = {
|
|
2593
|
+
error: null,
|
|
2594
|
+
isLoading: false,
|
|
2595
|
+
report: null
|
|
2596
|
+
};
|
|
2597
|
+
const emit = () => {
|
|
2598
|
+
for (const listener of listeners) {
|
|
2599
|
+
listener();
|
|
2600
|
+
}
|
|
2601
|
+
};
|
|
2602
|
+
const refresh = async () => {
|
|
2603
|
+
if (closed) {
|
|
2604
|
+
return snapshot.report;
|
|
2605
|
+
}
|
|
2606
|
+
snapshot = {
|
|
2607
|
+
...snapshot,
|
|
2608
|
+
error: null,
|
|
2609
|
+
isLoading: true
|
|
2610
|
+
};
|
|
2611
|
+
emit();
|
|
2612
|
+
try {
|
|
2613
|
+
const report = await fetchVoiceTraceTimeline(path, options);
|
|
2614
|
+
snapshot = {
|
|
2615
|
+
error: null,
|
|
2616
|
+
isLoading: false,
|
|
2617
|
+
report,
|
|
2618
|
+
updatedAt: Date.now()
|
|
2619
|
+
};
|
|
2620
|
+
emit();
|
|
2621
|
+
return report;
|
|
2622
|
+
} catch (error) {
|
|
2623
|
+
snapshot = {
|
|
2624
|
+
...snapshot,
|
|
2625
|
+
error: error instanceof Error ? error.message : String(error),
|
|
2626
|
+
isLoading: false
|
|
2627
|
+
};
|
|
2628
|
+
emit();
|
|
2629
|
+
throw error;
|
|
2630
|
+
}
|
|
2631
|
+
};
|
|
2632
|
+
const close = () => {
|
|
2633
|
+
closed = true;
|
|
2634
|
+
if (timer) {
|
|
2635
|
+
clearInterval(timer);
|
|
2636
|
+
timer = undefined;
|
|
2637
|
+
}
|
|
2638
|
+
listeners.clear();
|
|
2639
|
+
};
|
|
2640
|
+
if (options.intervalMs && options.intervalMs > 0) {
|
|
2641
|
+
timer = setInterval(() => {
|
|
2642
|
+
refresh().catch(() => {});
|
|
2643
|
+
}, options.intervalMs);
|
|
2644
|
+
}
|
|
2645
|
+
return {
|
|
2646
|
+
close,
|
|
2647
|
+
getServerSnapshot: () => snapshot,
|
|
2648
|
+
getSnapshot: () => snapshot,
|
|
2649
|
+
refresh,
|
|
2650
|
+
subscribe: (listener) => {
|
|
2651
|
+
listeners.add(listener);
|
|
2652
|
+
return () => {
|
|
2653
|
+
listeners.delete(listener);
|
|
2654
|
+
};
|
|
2655
|
+
}
|
|
2656
|
+
};
|
|
2657
|
+
};
|
|
2658
|
+
|
|
2659
|
+
// src/client/agentSquadStatus.ts
|
|
2660
|
+
var getString = (value) => typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
2661
|
+
var getPayloadString = (event, key) => getString(event.payload?.[key]);
|
|
2662
|
+
var eventStatus = (event) => {
|
|
2663
|
+
const status = getPayloadString(event, "status");
|
|
2664
|
+
if (status === "blocked")
|
|
2665
|
+
return "blocked";
|
|
2666
|
+
if (status === "unknown-target")
|
|
2667
|
+
return "unknown-target";
|
|
2668
|
+
if (status === "allowed")
|
|
2669
|
+
return "handoff";
|
|
2670
|
+
return event.type === "agent.result" ? "active" : "handoff";
|
|
2671
|
+
};
|
|
2672
|
+
var deriveSessionSpecialist = (session) => {
|
|
2673
|
+
const events = [...session.events].sort((left, right) => left.at - right.at);
|
|
2674
|
+
const agentEvents = events.filter((event) => event.type === "agent.handoff" || event.type === "agent.context" || event.type === "agent.result" || event.type === "agent.model");
|
|
2675
|
+
const latest = agentEvents.at(-1);
|
|
2676
|
+
if (!latest) {
|
|
2677
|
+
return {
|
|
2678
|
+
lastEventAt: session.lastEventAt,
|
|
2679
|
+
sessionId: session.sessionId,
|
|
2680
|
+
status: "idle"
|
|
2681
|
+
};
|
|
2682
|
+
}
|
|
2683
|
+
const handoffEvents = events.filter((event) => event.type === "agent.handoff");
|
|
2684
|
+
const lastHandoff = handoffEvents.at(-1);
|
|
2685
|
+
const latestAgentId = getPayloadString(latest, "agentId");
|
|
2686
|
+
const handoffStatus = lastHandoff ? eventStatus(lastHandoff) : undefined;
|
|
2687
|
+
const currentTarget = handoffStatus === "blocked" || handoffStatus === "unknown-target" ? getPayloadString(lastHandoff, "fromAgentId") ?? latestAgentId : getPayloadString(lastHandoff ?? latest, "targetAgentId") ?? latestAgentId;
|
|
2688
|
+
return {
|
|
2689
|
+
fromAgentId: getPayloadString(lastHandoff ?? latest, "fromAgentId"),
|
|
2690
|
+
lastEventAt: latest.at,
|
|
2691
|
+
reason: getPayloadString(lastHandoff ?? latest, "reason") ?? getPayloadString(latest, "handoffTarget"),
|
|
2692
|
+
sessionId: session.sessionId,
|
|
2693
|
+
status: lastHandoff ? eventStatus(lastHandoff) : "active",
|
|
2694
|
+
summary: getPayloadString(lastHandoff ?? latest, "summary"),
|
|
2695
|
+
targetAgentId: currentTarget,
|
|
2696
|
+
turnId: latest.turnId
|
|
2697
|
+
};
|
|
2698
|
+
};
|
|
2699
|
+
var buildVoiceAgentSquadStatusReport = (timeline, options = {}) => {
|
|
2700
|
+
const sessions = (timeline?.sessions ?? []).filter((session) => !options.sessionId || session.sessionId === options.sessionId).map(deriveSessionSpecialist).sort((left, right) => (right.lastEventAt ?? 0) - (left.lastEventAt ?? 0));
|
|
2701
|
+
const active = sessions.filter((session) => session.status !== "idle");
|
|
2702
|
+
return {
|
|
2703
|
+
active,
|
|
2704
|
+
checkedAt: timeline?.checkedAt,
|
|
2705
|
+
current: active[0] ?? sessions[0],
|
|
2706
|
+
sessionCount: sessions.length,
|
|
2707
|
+
sessions
|
|
2708
|
+
};
|
|
2709
|
+
};
|
|
2710
|
+
var createVoiceAgentSquadStatusStore = (path = "/api/voice-traces", options = {}) => {
|
|
2711
|
+
const timelineStore = createVoiceTraceTimelineStore(path, options);
|
|
2712
|
+
const getReport = () => buildVoiceAgentSquadStatusReport(timelineStore.getSnapshot().report, {
|
|
2713
|
+
sessionId: options.sessionId
|
|
2714
|
+
});
|
|
2715
|
+
const getSnapshot = () => {
|
|
2716
|
+
const snapshot = timelineStore.getSnapshot();
|
|
2717
|
+
return {
|
|
2718
|
+
error: snapshot.error,
|
|
2719
|
+
isLoading: snapshot.isLoading,
|
|
2720
|
+
report: getReport(),
|
|
2721
|
+
updatedAt: snapshot.updatedAt
|
|
2722
|
+
};
|
|
2723
|
+
};
|
|
2724
|
+
return {
|
|
2725
|
+
close: timelineStore.close,
|
|
2726
|
+
getServerSnapshot: getSnapshot,
|
|
2727
|
+
getSnapshot,
|
|
2728
|
+
refresh: timelineStore.refresh,
|
|
2729
|
+
subscribe: timelineStore.subscribe
|
|
2730
|
+
};
|
|
2731
|
+
};
|
|
2732
|
+
|
|
2733
|
+
// src/vue/useVoiceAgentSquadStatus.ts
|
|
2734
|
+
function useVoiceAgentSquadStatus(path = "/api/voice-traces", options = {}) {
|
|
2735
|
+
const store = createVoiceAgentSquadStatusStore(path, options);
|
|
2736
|
+
const current = shallowRef8(undefined);
|
|
2737
|
+
const error = ref7(null);
|
|
2738
|
+
const isLoading = ref7(false);
|
|
2739
|
+
const report = shallowRef8(undefined);
|
|
2740
|
+
const updatedAt = ref7(undefined);
|
|
2741
|
+
const sync = () => {
|
|
2742
|
+
const snapshot = store.getSnapshot();
|
|
2743
|
+
current.value = snapshot.report.current;
|
|
2744
|
+
error.value = snapshot.error;
|
|
2745
|
+
isLoading.value = snapshot.isLoading;
|
|
2746
|
+
report.value = snapshot.report;
|
|
2747
|
+
updatedAt.value = snapshot.updatedAt;
|
|
2748
|
+
};
|
|
2749
|
+
const unsubscribe = store.subscribe(sync);
|
|
2750
|
+
sync();
|
|
2751
|
+
if (typeof window !== "undefined") {
|
|
2752
|
+
store.refresh().catch(() => {});
|
|
2753
|
+
}
|
|
2754
|
+
onUnmounted9(() => {
|
|
2755
|
+
unsubscribe();
|
|
2756
|
+
store.close();
|
|
2757
|
+
});
|
|
2758
|
+
return {
|
|
2759
|
+
current,
|
|
2760
|
+
error,
|
|
2761
|
+
isLoading,
|
|
2762
|
+
refresh: store.refresh,
|
|
2763
|
+
report,
|
|
2764
|
+
updatedAt
|
|
2765
|
+
};
|
|
2766
|
+
}
|
|
2576
2767
|
// src/vue/VoiceTurnLatency.ts
|
|
2577
2768
|
import { computed as computed5, defineComponent as defineComponent9, h as h9 } from "vue";
|
|
2578
2769
|
|
|
@@ -2780,13 +2971,13 @@ var defineVoiceTurnLatencyElement = (tagName = "absolute-voice-turn-latency") =>
|
|
|
2780
2971
|
};
|
|
2781
2972
|
|
|
2782
2973
|
// src/vue/useVoiceTurnLatency.ts
|
|
2783
|
-
import { onUnmounted as
|
|
2974
|
+
import { onUnmounted as onUnmounted10, shallowRef as shallowRef9 } from "vue";
|
|
2784
2975
|
function useVoiceTurnLatency(path = "/api/turn-latency", options = {}) {
|
|
2785
2976
|
const store = createVoiceTurnLatencyStore(path, options);
|
|
2786
|
-
const error =
|
|
2787
|
-
const isLoading =
|
|
2788
|
-
const report =
|
|
2789
|
-
const updatedAt =
|
|
2977
|
+
const error = shallowRef9(null);
|
|
2978
|
+
const isLoading = shallowRef9(false);
|
|
2979
|
+
const report = shallowRef9();
|
|
2980
|
+
const updatedAt = shallowRef9(undefined);
|
|
2790
2981
|
const sync = () => {
|
|
2791
2982
|
const snapshot = store.getSnapshot();
|
|
2792
2983
|
error.value = snapshot.error;
|
|
@@ -2797,7 +2988,7 @@ function useVoiceTurnLatency(path = "/api/turn-latency", options = {}) {
|
|
|
2797
2988
|
const unsubscribe = store.subscribe(sync);
|
|
2798
2989
|
sync();
|
|
2799
2990
|
store.refresh().catch(() => {});
|
|
2800
|
-
|
|
2991
|
+
onUnmounted10(() => {
|
|
2801
2992
|
unsubscribe();
|
|
2802
2993
|
store.close();
|
|
2803
2994
|
});
|
|
@@ -3072,13 +3263,13 @@ var defineVoiceTurnQualityElement = (tagName = "absolute-voice-turn-quality") =>
|
|
|
3072
3263
|
};
|
|
3073
3264
|
|
|
3074
3265
|
// src/vue/useVoiceTurnQuality.ts
|
|
3075
|
-
import { onUnmounted as
|
|
3266
|
+
import { onUnmounted as onUnmounted11, shallowRef as shallowRef10 } from "vue";
|
|
3076
3267
|
function useVoiceTurnQuality(path = "/api/turn-quality", options = {}) {
|
|
3077
3268
|
const store = createVoiceTurnQualityStore(path, options);
|
|
3078
|
-
const error =
|
|
3079
|
-
const isLoading =
|
|
3080
|
-
const report =
|
|
3081
|
-
const updatedAt =
|
|
3269
|
+
const error = shallowRef10(null);
|
|
3270
|
+
const isLoading = shallowRef10(false);
|
|
3271
|
+
const report = shallowRef10();
|
|
3272
|
+
const updatedAt = shallowRef10(undefined);
|
|
3082
3273
|
const sync = () => {
|
|
3083
3274
|
const snapshot = store.getSnapshot();
|
|
3084
3275
|
error.value = snapshot.error;
|
|
@@ -3089,7 +3280,7 @@ function useVoiceTurnQuality(path = "/api/turn-quality", options = {}) {
|
|
|
3089
3280
|
const unsubscribe = store.subscribe(sync);
|
|
3090
3281
|
sync();
|
|
3091
3282
|
store.refresh().catch(() => {});
|
|
3092
|
-
|
|
3283
|
+
onUnmounted11(() => {
|
|
3093
3284
|
unsubscribe();
|
|
3094
3285
|
store.close();
|
|
3095
3286
|
});
|
|
@@ -3153,7 +3344,7 @@ var VoiceTurnQuality = defineComponent10({
|
|
|
3153
3344
|
}
|
|
3154
3345
|
});
|
|
3155
3346
|
// src/vue/useVoiceLiveOps.ts
|
|
3156
|
-
import { onUnmounted as
|
|
3347
|
+
import { onUnmounted as onUnmounted12, ref as ref8, shallowRef as shallowRef11 } from "vue";
|
|
3157
3348
|
|
|
3158
3349
|
// src/client/liveOps.ts
|
|
3159
3350
|
var postVoiceLiveOpsAction = async (input, options = {}) => {
|
|
@@ -3244,11 +3435,11 @@ var createVoiceLiveOpsStore = (options = {}) => {
|
|
|
3244
3435
|
// src/vue/useVoiceLiveOps.ts
|
|
3245
3436
|
function useVoiceLiveOps(options = {}) {
|
|
3246
3437
|
const store = createVoiceLiveOpsStore(options);
|
|
3247
|
-
const error =
|
|
3248
|
-
const isRunning =
|
|
3249
|
-
const lastResult =
|
|
3250
|
-
const runningAction =
|
|
3251
|
-
const updatedAt =
|
|
3438
|
+
const error = ref8(null);
|
|
3439
|
+
const isRunning = ref8(false);
|
|
3440
|
+
const lastResult = shallowRef11(undefined);
|
|
3441
|
+
const runningAction = ref8(undefined);
|
|
3442
|
+
const updatedAt = ref8(undefined);
|
|
3252
3443
|
const sync = () => {
|
|
3253
3444
|
const snapshot = store.getSnapshot();
|
|
3254
3445
|
error.value = snapshot.error;
|
|
@@ -3259,7 +3450,7 @@ function useVoiceLiveOps(options = {}) {
|
|
|
3259
3450
|
};
|
|
3260
3451
|
const unsubscribe = store.subscribe(sync);
|
|
3261
3452
|
sync();
|
|
3262
|
-
|
|
3453
|
+
onUnmounted12(() => {
|
|
3263
3454
|
unsubscribe();
|
|
3264
3455
|
store.close();
|
|
3265
3456
|
});
|
|
@@ -3273,7 +3464,7 @@ function useVoiceLiveOps(options = {}) {
|
|
|
3273
3464
|
};
|
|
3274
3465
|
}
|
|
3275
3466
|
// src/vue/useVoiceCampaignDialerProof.ts
|
|
3276
|
-
import { onUnmounted as
|
|
3467
|
+
import { onUnmounted as onUnmounted13, shallowRef as shallowRef12 } from "vue";
|
|
3277
3468
|
|
|
3278
3469
|
// src/client/campaignDialerProof.ts
|
|
3279
3470
|
var fetchVoiceCampaignDialerProofStatus = async (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
|
|
@@ -3396,11 +3587,11 @@ var createVoiceCampaignDialerProofStore = (path = "/api/voice/campaigns/dialer-p
|
|
|
3396
3587
|
// src/vue/useVoiceCampaignDialerProof.ts
|
|
3397
3588
|
function useVoiceCampaignDialerProof(path = "/api/voice/campaigns/dialer-proof", options = {}) {
|
|
3398
3589
|
const store = createVoiceCampaignDialerProofStore(path, options);
|
|
3399
|
-
const error =
|
|
3400
|
-
const isLoading =
|
|
3401
|
-
const report =
|
|
3402
|
-
const status =
|
|
3403
|
-
const updatedAt =
|
|
3590
|
+
const error = shallowRef12(null);
|
|
3591
|
+
const isLoading = shallowRef12(false);
|
|
3592
|
+
const report = shallowRef12();
|
|
3593
|
+
const status = shallowRef12();
|
|
3594
|
+
const updatedAt = shallowRef12(undefined);
|
|
3404
3595
|
const sync = () => {
|
|
3405
3596
|
const snapshot = store.getSnapshot();
|
|
3406
3597
|
error.value = snapshot.error;
|
|
@@ -3414,7 +3605,7 @@ function useVoiceCampaignDialerProof(path = "/api/voice/campaigns/dialer-proof",
|
|
|
3414
3605
|
if (typeof window !== "undefined") {
|
|
3415
3606
|
store.refresh().catch(() => {});
|
|
3416
3607
|
}
|
|
3417
|
-
|
|
3608
|
+
onUnmounted13(() => {
|
|
3418
3609
|
unsubscribe();
|
|
3419
3610
|
store.close();
|
|
3420
3611
|
});
|
|
@@ -3429,7 +3620,7 @@ function useVoiceCampaignDialerProof(path = "/api/voice/campaigns/dialer-proof",
|
|
|
3429
3620
|
};
|
|
3430
3621
|
}
|
|
3431
3622
|
// src/vue/useVoiceStream.ts
|
|
3432
|
-
import { onUnmounted as
|
|
3623
|
+
import { onUnmounted as onUnmounted14, ref as ref9, shallowRef as shallowRef13 } from "vue";
|
|
3433
3624
|
|
|
3434
3625
|
// src/client/actions.ts
|
|
3435
3626
|
var normalizeErrorMessage = (value) => {
|
|
@@ -4074,16 +4265,16 @@ var createVoiceStream = (path, options = {}) => {
|
|
|
4074
4265
|
// src/vue/useVoiceStream.ts
|
|
4075
4266
|
function useVoiceStream(path, options = {}) {
|
|
4076
4267
|
const stream = createVoiceStream(path, options);
|
|
4077
|
-
const assistantAudio =
|
|
4078
|
-
const assistantTexts =
|
|
4079
|
-
const call =
|
|
4080
|
-
const error =
|
|
4081
|
-
const isConnected =
|
|
4082
|
-
const partial =
|
|
4083
|
-
const reconnect =
|
|
4084
|
-
const sessionId =
|
|
4085
|
-
const status =
|
|
4086
|
-
const turns =
|
|
4268
|
+
const assistantAudio = shallowRef13([]);
|
|
4269
|
+
const assistantTexts = shallowRef13([]);
|
|
4270
|
+
const call = shallowRef13(null);
|
|
4271
|
+
const error = ref9(null);
|
|
4272
|
+
const isConnected = ref9(false);
|
|
4273
|
+
const partial = ref9("");
|
|
4274
|
+
const reconnect = shallowRef13(stream.reconnect);
|
|
4275
|
+
const sessionId = ref9(stream.sessionId);
|
|
4276
|
+
const status = ref9(stream.status);
|
|
4277
|
+
const turns = shallowRef13([]);
|
|
4087
4278
|
const sync = () => {
|
|
4088
4279
|
assistantAudio.value = [...stream.assistantAudio];
|
|
4089
4280
|
assistantTexts.value = [...stream.assistantTexts];
|
|
@@ -4102,7 +4293,7 @@ function useVoiceStream(path, options = {}) {
|
|
|
4102
4293
|
unsubscribe();
|
|
4103
4294
|
stream.close();
|
|
4104
4295
|
};
|
|
4105
|
-
|
|
4296
|
+
onUnmounted14(destroy);
|
|
4106
4297
|
return {
|
|
4107
4298
|
assistantAudio,
|
|
4108
4299
|
assistantTexts,
|
|
@@ -4121,7 +4312,7 @@ function useVoiceStream(path, options = {}) {
|
|
|
4121
4312
|
};
|
|
4122
4313
|
}
|
|
4123
4314
|
// src/vue/useVoiceController.ts
|
|
4124
|
-
import { onUnmounted as
|
|
4315
|
+
import { onUnmounted as onUnmounted15, ref as ref10, shallowRef as shallowRef14 } from "vue";
|
|
4125
4316
|
|
|
4126
4317
|
// src/client/htmx.ts
|
|
4127
4318
|
var DEFAULT_EVENT_NAME = "voice-refresh";
|
|
@@ -4767,17 +4958,17 @@ var createVoiceController = (path, options = {}) => {
|
|
|
4767
4958
|
// src/vue/useVoiceController.ts
|
|
4768
4959
|
function useVoiceController(path, options = {}) {
|
|
4769
4960
|
const controller = createVoiceController(path, options);
|
|
4770
|
-
const assistantAudio =
|
|
4771
|
-
const assistantTexts =
|
|
4772
|
-
const error =
|
|
4773
|
-
const isConnected =
|
|
4774
|
-
const isRecording =
|
|
4775
|
-
const partial =
|
|
4776
|
-
const reconnect =
|
|
4777
|
-
const recordingError =
|
|
4778
|
-
const sessionId =
|
|
4779
|
-
const status =
|
|
4780
|
-
const turns =
|
|
4961
|
+
const assistantAudio = shallowRef14([]);
|
|
4962
|
+
const assistantTexts = shallowRef14([]);
|
|
4963
|
+
const error = ref10(null);
|
|
4964
|
+
const isConnected = ref10(false);
|
|
4965
|
+
const isRecording = ref10(false);
|
|
4966
|
+
const partial = ref10("");
|
|
4967
|
+
const reconnect = shallowRef14(controller.reconnect);
|
|
4968
|
+
const recordingError = ref10(null);
|
|
4969
|
+
const sessionId = ref10(controller.sessionId);
|
|
4970
|
+
const status = ref10(controller.status);
|
|
4971
|
+
const turns = shallowRef14([]);
|
|
4781
4972
|
const sync = () => {
|
|
4782
4973
|
assistantAudio.value = [...controller.assistantAudio];
|
|
4783
4974
|
assistantTexts.value = [...controller.assistantTexts];
|
|
@@ -4797,7 +4988,7 @@ function useVoiceController(path, options = {}) {
|
|
|
4797
4988
|
unsubscribe();
|
|
4798
4989
|
controller.close();
|
|
4799
4990
|
};
|
|
4800
|
-
|
|
4991
|
+
onUnmounted15(destroy);
|
|
4801
4992
|
return {
|
|
4802
4993
|
assistantAudio,
|
|
4803
4994
|
assistantTexts,
|
|
@@ -4820,95 +5011,13 @@ function useVoiceController(path, options = {}) {
|
|
|
4820
5011
|
};
|
|
4821
5012
|
}
|
|
4822
5013
|
// src/vue/useVoiceTraceTimeline.ts
|
|
4823
|
-
import { onUnmounted as
|
|
4824
|
-
|
|
4825
|
-
// src/client/traceTimeline.ts
|
|
4826
|
-
var fetchVoiceTraceTimeline = async (path = "/api/voice-traces", options = {}) => {
|
|
4827
|
-
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
4828
|
-
const response = await fetchImpl(path);
|
|
4829
|
-
if (!response.ok) {
|
|
4830
|
-
throw new Error(`Voice trace timeline failed: HTTP ${response.status}`);
|
|
4831
|
-
}
|
|
4832
|
-
return await response.json();
|
|
4833
|
-
};
|
|
4834
|
-
var createVoiceTraceTimelineStore = (path = "/api/voice-traces", options = {}) => {
|
|
4835
|
-
const listeners = new Set;
|
|
4836
|
-
let closed = false;
|
|
4837
|
-
let timer;
|
|
4838
|
-
let snapshot = {
|
|
4839
|
-
error: null,
|
|
4840
|
-
isLoading: false,
|
|
4841
|
-
report: null
|
|
4842
|
-
};
|
|
4843
|
-
const emit = () => {
|
|
4844
|
-
for (const listener of listeners) {
|
|
4845
|
-
listener();
|
|
4846
|
-
}
|
|
4847
|
-
};
|
|
4848
|
-
const refresh = async () => {
|
|
4849
|
-
if (closed) {
|
|
4850
|
-
return snapshot.report;
|
|
4851
|
-
}
|
|
4852
|
-
snapshot = {
|
|
4853
|
-
...snapshot,
|
|
4854
|
-
error: null,
|
|
4855
|
-
isLoading: true
|
|
4856
|
-
};
|
|
4857
|
-
emit();
|
|
4858
|
-
try {
|
|
4859
|
-
const report = await fetchVoiceTraceTimeline(path, options);
|
|
4860
|
-
snapshot = {
|
|
4861
|
-
error: null,
|
|
4862
|
-
isLoading: false,
|
|
4863
|
-
report,
|
|
4864
|
-
updatedAt: Date.now()
|
|
4865
|
-
};
|
|
4866
|
-
emit();
|
|
4867
|
-
return report;
|
|
4868
|
-
} catch (error) {
|
|
4869
|
-
snapshot = {
|
|
4870
|
-
...snapshot,
|
|
4871
|
-
error: error instanceof Error ? error.message : String(error),
|
|
4872
|
-
isLoading: false
|
|
4873
|
-
};
|
|
4874
|
-
emit();
|
|
4875
|
-
throw error;
|
|
4876
|
-
}
|
|
4877
|
-
};
|
|
4878
|
-
const close = () => {
|
|
4879
|
-
closed = true;
|
|
4880
|
-
if (timer) {
|
|
4881
|
-
clearInterval(timer);
|
|
4882
|
-
timer = undefined;
|
|
4883
|
-
}
|
|
4884
|
-
listeners.clear();
|
|
4885
|
-
};
|
|
4886
|
-
if (options.intervalMs && options.intervalMs > 0) {
|
|
4887
|
-
timer = setInterval(() => {
|
|
4888
|
-
refresh().catch(() => {});
|
|
4889
|
-
}, options.intervalMs);
|
|
4890
|
-
}
|
|
4891
|
-
return {
|
|
4892
|
-
close,
|
|
4893
|
-
getServerSnapshot: () => snapshot,
|
|
4894
|
-
getSnapshot: () => snapshot,
|
|
4895
|
-
refresh,
|
|
4896
|
-
subscribe: (listener) => {
|
|
4897
|
-
listeners.add(listener);
|
|
4898
|
-
return () => {
|
|
4899
|
-
listeners.delete(listener);
|
|
4900
|
-
};
|
|
4901
|
-
}
|
|
4902
|
-
};
|
|
4903
|
-
};
|
|
4904
|
-
|
|
4905
|
-
// src/vue/useVoiceTraceTimeline.ts
|
|
5014
|
+
import { onUnmounted as onUnmounted16, ref as ref11, shallowRef as shallowRef15 } from "vue";
|
|
4906
5015
|
function useVoiceTraceTimeline(path = "/api/voice-traces", options = {}) {
|
|
4907
5016
|
const store = createVoiceTraceTimelineStore(path, options);
|
|
4908
|
-
const error =
|
|
4909
|
-
const isLoading =
|
|
4910
|
-
const report =
|
|
4911
|
-
const updatedAt =
|
|
5017
|
+
const error = ref11(null);
|
|
5018
|
+
const isLoading = ref11(false);
|
|
5019
|
+
const report = shallowRef15(null);
|
|
5020
|
+
const updatedAt = ref11(undefined);
|
|
4912
5021
|
const sync = () => {
|
|
4913
5022
|
const snapshot = store.getSnapshot();
|
|
4914
5023
|
error.value = snapshot.error;
|
|
@@ -4919,7 +5028,7 @@ function useVoiceTraceTimeline(path = "/api/voice-traces", options = {}) {
|
|
|
4919
5028
|
const unsubscribe = store.subscribe(sync);
|
|
4920
5029
|
sync();
|
|
4921
5030
|
store.refresh().catch(() => {});
|
|
4922
|
-
|
|
5031
|
+
onUnmounted16(() => {
|
|
4923
5032
|
unsubscribe();
|
|
4924
5033
|
store.close();
|
|
4925
5034
|
});
|
|
@@ -4932,7 +5041,7 @@ function useVoiceTraceTimeline(path = "/api/voice-traces", options = {}) {
|
|
|
4932
5041
|
};
|
|
4933
5042
|
}
|
|
4934
5043
|
// src/vue/useVoiceWorkflowStatus.ts
|
|
4935
|
-
import { onUnmounted as
|
|
5044
|
+
import { onUnmounted as onUnmounted17, ref as ref12, shallowRef as shallowRef16 } from "vue";
|
|
4936
5045
|
|
|
4937
5046
|
// src/client/workflowStatus.ts
|
|
4938
5047
|
var fetchVoiceWorkflowStatus = async (path = "/evals/scenarios/json", options = {}) => {
|
|
@@ -5016,10 +5125,10 @@ var createVoiceWorkflowStatusStore = (path = "/evals/scenarios/json", options =
|
|
|
5016
5125
|
// src/vue/useVoiceWorkflowStatus.ts
|
|
5017
5126
|
function useVoiceWorkflowStatus(path = "/evals/scenarios/json", options = {}) {
|
|
5018
5127
|
const store = createVoiceWorkflowStatusStore(path, options);
|
|
5019
|
-
const error =
|
|
5020
|
-
const isLoading =
|
|
5021
|
-
const report =
|
|
5022
|
-
const updatedAt =
|
|
5128
|
+
const error = ref12(null);
|
|
5129
|
+
const isLoading = ref12(false);
|
|
5130
|
+
const report = shallowRef16(undefined);
|
|
5131
|
+
const updatedAt = ref12(undefined);
|
|
5023
5132
|
const sync = () => {
|
|
5024
5133
|
const snapshot = store.getSnapshot();
|
|
5025
5134
|
error.value = snapshot.error;
|
|
@@ -5032,7 +5141,7 @@ function useVoiceWorkflowStatus(path = "/evals/scenarios/json", options = {}) {
|
|
|
5032
5141
|
if (typeof window !== "undefined") {
|
|
5033
5142
|
store.refresh().catch(() => {});
|
|
5034
5143
|
}
|
|
5035
|
-
|
|
5144
|
+
onUnmounted17(() => {
|
|
5036
5145
|
unsubscribe();
|
|
5037
5146
|
store.close();
|
|
5038
5147
|
});
|
|
@@ -5061,6 +5170,7 @@ export {
|
|
|
5061
5170
|
useVoiceDeliveryRuntime,
|
|
5062
5171
|
useVoiceController,
|
|
5063
5172
|
useVoiceCampaignDialerProof,
|
|
5173
|
+
useVoiceAgentSquadStatus,
|
|
5064
5174
|
VoiceTurnQuality,
|
|
5065
5175
|
VoiceTurnLatency,
|
|
5066
5176
|
VoiceRoutingStatus,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VoiceAgentSquadSpecialist, type VoiceAgentSquadStatusClientOptions, type VoiceAgentSquadStatusReport } from '../client/agentSquadStatus';
|
|
2
|
+
export declare function useVoiceAgentSquadStatus(path?: string, options?: VoiceAgentSquadStatusClientOptions): {
|
|
3
|
+
current: import("vue").ShallowRef<VoiceAgentSquadSpecialist | undefined, VoiceAgentSquadSpecialist | undefined>;
|
|
4
|
+
error: import("vue").Ref<string | null, string | null>;
|
|
5
|
+
isLoading: import("vue").Ref<boolean, boolean>;
|
|
6
|
+
refresh: () => Promise<import("..").VoiceTraceTimelineReport | null>;
|
|
7
|
+
report: import("vue").ShallowRef<VoiceAgentSquadStatusReport | undefined, VoiceAgentSquadStatusReport | undefined>;
|
|
8
|
+
updatedAt: import("vue").Ref<number | undefined, number | undefined>;
|
|
9
|
+
};
|