@absolutejs/voice 0.0.22-beta.352 → 0.0.22-beta.353

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.
@@ -0,0 +1,8 @@
1
+ import { type VoiceProfileComparisonClientOptions } from '../client/profileComparison';
2
+ export declare const useVoiceProfileComparison: (path?: string, options?: VoiceProfileComparisonClientOptions) => {
3
+ refresh: () => Promise<import("..").VoiceRealCallProfileHistoryReport | undefined>;
4
+ error: string | null;
5
+ isLoading: boolean;
6
+ report?: import("..").VoiceRealCallProfileHistoryReport;
7
+ updatedAt?: number;
8
+ };
@@ -0,0 +1,7 @@
1
+ import type { VoiceProfileComparisonClientOptions } from '../client/profileComparison';
2
+ export declare const createVoiceProfileComparison: (path?: string, options?: VoiceProfileComparisonClientOptions) => {
3
+ close: () => void;
4
+ getSnapshot: () => import("../client").VoiceProfileComparisonSnapshot;
5
+ refresh: () => Promise<import("..").VoiceRealCallProfileHistoryReport | undefined>;
6
+ subscribe: (listener: () => void) => () => void;
7
+ };
@@ -5,6 +5,7 @@ export { createVoiceLiveOps } from './createVoiceLiveOps';
5
5
  export { createVoiceOpsStatus } from './createVoiceOpsStatus';
6
6
  export { createVoicePlatformCoverage } from './createVoicePlatformCoverage';
7
7
  export { createVoiceProofTrends } from './createVoiceProofTrends';
8
+ export { createVoiceProfileComparison } from './createVoiceProfileComparison';
8
9
  export { createVoiceReadinessFailures } from './createVoiceReadinessFailures';
9
10
  export { createVoiceProviderSimulationControls } from './createVoiceProviderSimulationControls';
10
11
  export { createVoiceProviderCapabilities } from './createVoiceProviderCapabilities';
@@ -2588,6 +2588,91 @@ var createVoiceProofTrends = (path = "/api/voice/proof-trends", options = {}) =>
2588
2588
  subscribe: store.subscribe
2589
2589
  };
2590
2590
  };
2591
+ // src/client/profileComparison.ts
2592
+ var fetchVoiceProfileComparison = async (path = "/api/voice/real-call-profile-history", options = {}) => {
2593
+ const fetchImpl = options.fetch ?? globalThis.fetch;
2594
+ const response = await fetchImpl(path);
2595
+ if (!response.ok) {
2596
+ throw new Error(`Voice profile comparison failed: HTTP ${response.status}`);
2597
+ }
2598
+ return await response.json();
2599
+ };
2600
+ var createVoiceProfileComparisonStore = (path = "/api/voice/real-call-profile-history", options = {}) => {
2601
+ const listeners = new Set;
2602
+ let closed = false;
2603
+ let timer;
2604
+ let snapshot = {
2605
+ error: null,
2606
+ isLoading: false
2607
+ };
2608
+ const emit = () => {
2609
+ for (const listener of listeners) {
2610
+ listener();
2611
+ }
2612
+ };
2613
+ const refresh = async () => {
2614
+ if (closed) {
2615
+ return snapshot.report;
2616
+ }
2617
+ snapshot = { ...snapshot, error: null, isLoading: true };
2618
+ emit();
2619
+ try {
2620
+ const report = await fetchVoiceProfileComparison(path, options);
2621
+ snapshot = {
2622
+ error: null,
2623
+ isLoading: false,
2624
+ report,
2625
+ updatedAt: Date.now()
2626
+ };
2627
+ emit();
2628
+ return report;
2629
+ } catch (error) {
2630
+ snapshot = {
2631
+ ...snapshot,
2632
+ error: error instanceof Error ? error.message : String(error),
2633
+ isLoading: false
2634
+ };
2635
+ emit();
2636
+ throw error;
2637
+ }
2638
+ };
2639
+ const close = () => {
2640
+ closed = true;
2641
+ if (timer) {
2642
+ clearInterval(timer);
2643
+ timer = undefined;
2644
+ }
2645
+ listeners.clear();
2646
+ };
2647
+ if (typeof window !== "undefined" && options.intervalMs && options.intervalMs > 0) {
2648
+ timer = setInterval(() => {
2649
+ refresh().catch(() => {});
2650
+ }, options.intervalMs);
2651
+ }
2652
+ return {
2653
+ close,
2654
+ getServerSnapshot: () => snapshot,
2655
+ getSnapshot: () => snapshot,
2656
+ refresh,
2657
+ subscribe: (listener) => {
2658
+ listeners.add(listener);
2659
+ return () => {
2660
+ listeners.delete(listener);
2661
+ };
2662
+ }
2663
+ };
2664
+ };
2665
+
2666
+ // src/svelte/createVoiceProfileComparison.ts
2667
+ var createVoiceProfileComparison = (path = "/api/voice/real-call-profile-history", options = {}) => {
2668
+ const store = createVoiceProfileComparisonStore(path, options);
2669
+ return {
2670
+ close: store.close,
2671
+ getSnapshot: store.getSnapshot,
2672
+ refresh: store.refresh,
2673
+ subscribe: store.subscribe
2674
+ };
2675
+ };
2591
2676
  // src/client/readinessFailures.ts
2592
2677
  var fetchVoiceReadinessFailures = async (path = "/api/production-readiness", options = {}) => {
2593
2678
  const fetchImpl = options.fetch ?? globalThis.fetch;
@@ -6587,6 +6672,7 @@ export {
6587
6672
  createVoiceProviderContracts,
6588
6673
  createVoiceProviderCapabilities,
6589
6674
  createVoiceProofTrends,
6675
+ createVoiceProfileComparison,
6590
6676
  createVoicePlatformCoverage,
6591
6677
  createVoiceOpsStatus,
6592
6678
  createVoiceOpsActionCenter,
@@ -15,6 +15,7 @@ export { VoiceTurnQuality } from './VoiceTurnQuality';
15
15
  export { useVoiceOpsStatus } from './useVoiceOpsStatus';
16
16
  export { useVoicePlatformCoverage } from './useVoicePlatformCoverage';
17
17
  export { useVoiceProofTrends } from './useVoiceProofTrends';
18
+ export { useVoiceProfileComparison } from './useVoiceProfileComparison';
18
19
  export { useVoiceReadinessFailures } from './useVoiceReadinessFailures';
19
20
  export { useVoiceOpsActionCenter } from './useVoiceOpsActionCenter';
20
21
  export { useVoiceLiveOps } from './useVoiceLiveOps';
package/dist/vue/index.js CHANGED
@@ -5274,9 +5274,118 @@ var VoiceTurnQuality = defineComponent13({
5274
5274
  ]);
5275
5275
  }
5276
5276
  });
5277
- // src/vue/useVoiceLiveOps.ts
5277
+ // src/vue/useVoiceProfileComparison.ts
5278
5278
  import { onUnmounted as onUnmounted14, ref as ref11, shallowRef as shallowRef13 } from "vue";
5279
5279
 
5280
+ // src/client/profileComparison.ts
5281
+ var fetchVoiceProfileComparison = async (path = "/api/voice/real-call-profile-history", options = {}) => {
5282
+ const fetchImpl = options.fetch ?? globalThis.fetch;
5283
+ const response = await fetchImpl(path);
5284
+ if (!response.ok) {
5285
+ throw new Error(`Voice profile comparison failed: HTTP ${response.status}`);
5286
+ }
5287
+ return await response.json();
5288
+ };
5289
+ var createVoiceProfileComparisonStore = (path = "/api/voice/real-call-profile-history", options = {}) => {
5290
+ const listeners = new Set;
5291
+ let closed = false;
5292
+ let timer;
5293
+ let snapshot = {
5294
+ error: null,
5295
+ isLoading: false
5296
+ };
5297
+ const emit = () => {
5298
+ for (const listener of listeners) {
5299
+ listener();
5300
+ }
5301
+ };
5302
+ const refresh = async () => {
5303
+ if (closed) {
5304
+ return snapshot.report;
5305
+ }
5306
+ snapshot = { ...snapshot, error: null, isLoading: true };
5307
+ emit();
5308
+ try {
5309
+ const report = await fetchVoiceProfileComparison(path, options);
5310
+ snapshot = {
5311
+ error: null,
5312
+ isLoading: false,
5313
+ report,
5314
+ updatedAt: Date.now()
5315
+ };
5316
+ emit();
5317
+ return report;
5318
+ } catch (error) {
5319
+ snapshot = {
5320
+ ...snapshot,
5321
+ error: error instanceof Error ? error.message : String(error),
5322
+ isLoading: false
5323
+ };
5324
+ emit();
5325
+ throw error;
5326
+ }
5327
+ };
5328
+ const close = () => {
5329
+ closed = true;
5330
+ if (timer) {
5331
+ clearInterval(timer);
5332
+ timer = undefined;
5333
+ }
5334
+ listeners.clear();
5335
+ };
5336
+ if (typeof window !== "undefined" && options.intervalMs && options.intervalMs > 0) {
5337
+ timer = setInterval(() => {
5338
+ refresh().catch(() => {});
5339
+ }, options.intervalMs);
5340
+ }
5341
+ return {
5342
+ close,
5343
+ getServerSnapshot: () => snapshot,
5344
+ getSnapshot: () => snapshot,
5345
+ refresh,
5346
+ subscribe: (listener) => {
5347
+ listeners.add(listener);
5348
+ return () => {
5349
+ listeners.delete(listener);
5350
+ };
5351
+ }
5352
+ };
5353
+ };
5354
+
5355
+ // src/vue/useVoiceProfileComparison.ts
5356
+ function useVoiceProfileComparison(path = "/api/voice/real-call-profile-history", options = {}) {
5357
+ const store = createVoiceProfileComparisonStore(path, options);
5358
+ const error = ref11(null);
5359
+ const isLoading = ref11(false);
5360
+ const report = shallowRef13(undefined);
5361
+ const updatedAt = ref11(undefined);
5362
+ const sync = () => {
5363
+ const snapshot = store.getSnapshot();
5364
+ error.value = snapshot.error;
5365
+ isLoading.value = snapshot.isLoading;
5366
+ report.value = snapshot.report;
5367
+ updatedAt.value = snapshot.updatedAt;
5368
+ };
5369
+ const unsubscribe = store.subscribe(sync);
5370
+ sync();
5371
+ if (typeof window !== "undefined") {
5372
+ store.refresh().catch(() => {});
5373
+ }
5374
+ onUnmounted14(() => {
5375
+ unsubscribe();
5376
+ store.close();
5377
+ });
5378
+ return {
5379
+ error,
5380
+ isLoading,
5381
+ refresh: store.refresh,
5382
+ report,
5383
+ updatedAt
5384
+ };
5385
+ }
5386
+ // src/vue/useVoiceLiveOps.ts
5387
+ import { onUnmounted as onUnmounted15, ref as ref12, shallowRef as shallowRef14 } from "vue";
5388
+
5280
5389
  // src/client/liveOps.ts
5281
5390
  var postVoiceLiveOpsAction = async (input, options = {}) => {
5282
5391
  if (!input.sessionId) {
@@ -5366,11 +5475,11 @@ var createVoiceLiveOpsStore = (options = {}) => {
5366
5475
  // src/vue/useVoiceLiveOps.ts
5367
5476
  function useVoiceLiveOps(options = {}) {
5368
5477
  const store = createVoiceLiveOpsStore(options);
5369
- const error = ref11(null);
5370
- const isRunning = ref11(false);
5371
- const lastResult = shallowRef13(undefined);
5372
- const runningAction = ref11(undefined);
5373
- const updatedAt = ref11(undefined);
5478
+ const error = ref12(null);
5479
+ const isRunning = ref12(false);
5480
+ const lastResult = shallowRef14(undefined);
5481
+ const runningAction = ref12(undefined);
5482
+ const updatedAt = ref12(undefined);
5374
5483
  const sync = () => {
5375
5484
  const snapshot = store.getSnapshot();
5376
5485
  error.value = snapshot.error;
@@ -5381,7 +5490,7 @@ function useVoiceLiveOps(options = {}) {
5381
5490
  };
5382
5491
  const unsubscribe = store.subscribe(sync);
5383
5492
  sync();
5384
- onUnmounted14(() => {
5493
+ onUnmounted15(() => {
5385
5494
  unsubscribe();
5386
5495
  store.close();
5387
5496
  });
@@ -5395,7 +5504,7 @@ function useVoiceLiveOps(options = {}) {
5395
5504
  };
5396
5505
  }
5397
5506
  // src/vue/useVoiceCampaignDialerProof.ts
5398
- import { onUnmounted as onUnmounted15, shallowRef as shallowRef14 } from "vue";
5507
+ import { onUnmounted as onUnmounted16, shallowRef as shallowRef15 } from "vue";
5399
5508
 
5400
5509
  // src/client/campaignDialerProof.ts
5401
5510
  var fetchVoiceCampaignDialerProofStatus = async (path = "/api/voice/campaigns/dialer-proof", options = {}) => {
@@ -5518,11 +5627,11 @@ var createVoiceCampaignDialerProofStore = (path = "/api/voice/campaigns/dialer-p
5518
5627
  // src/vue/useVoiceCampaignDialerProof.ts
5519
5628
  function useVoiceCampaignDialerProof(path = "/api/voice/campaigns/dialer-proof", options = {}) {
5520
5629
  const store = createVoiceCampaignDialerProofStore(path, options);
5521
- const error = shallowRef14(null);
5522
- const isLoading = shallowRef14(false);
5523
- const report = shallowRef14();
5524
- const status = shallowRef14();
5525
- const updatedAt = shallowRef14(undefined);
5630
+ const error = shallowRef15(null);
5631
+ const isLoading = shallowRef15(false);
5632
+ const report = shallowRef15();
5633
+ const status = shallowRef15();
5634
+ const updatedAt = shallowRef15(undefined);
5526
5635
  const sync = () => {
5527
5636
  const snapshot = store.getSnapshot();
5528
5637
  error.value = snapshot.error;
@@ -5536,7 +5645,7 @@ function useVoiceCampaignDialerProof(path = "/api/voice/campaigns/dialer-proof",
5536
5645
  if (typeof window !== "undefined") {
5537
5646
  store.refresh().catch(() => {});
5538
5647
  }
5539
- onUnmounted15(() => {
5648
+ onUnmounted16(() => {
5540
5649
  unsubscribe();
5541
5650
  store.close();
5542
5651
  });
@@ -5551,7 +5660,7 @@ function useVoiceCampaignDialerProof(path = "/api/voice/campaigns/dialer-proof",
5551
5660
  };
5552
5661
  }
5553
5662
  // src/vue/useVoiceStream.ts
5554
- import { onUnmounted as onUnmounted16, ref as ref12, shallowRef as shallowRef15 } from "vue";
5663
+ import { onUnmounted as onUnmounted17, ref as ref13, shallowRef as shallowRef16 } from "vue";
5555
5664
 
5556
5665
  // src/client/actions.ts
5557
5666
  var normalizeErrorMessage = (value) => {
@@ -6938,16 +7047,16 @@ var createVoiceStream = (path, options = {}) => {
6938
7047
  // src/vue/useVoiceStream.ts
6939
7048
  function useVoiceStream(path, options = {}) {
6940
7049
  const stream = createVoiceStream(path, options);
6941
- const assistantAudio = shallowRef15([]);
6942
- const assistantTexts = shallowRef15([]);
6943
- const call = shallowRef15(null);
6944
- const error = ref12(null);
6945
- const isConnected = ref12(false);
6946
- const partial = ref12("");
6947
- const reconnect = shallowRef15(stream.reconnect);
6948
- const sessionId = ref12(stream.sessionId);
6949
- const status = ref12(stream.status);
6950
- const turns = shallowRef15([]);
7050
+ const assistantAudio = shallowRef16([]);
7051
+ const assistantTexts = shallowRef16([]);
7052
+ const call = shallowRef16(null);
7053
+ const error = ref13(null);
7054
+ const isConnected = ref13(false);
7055
+ const partial = ref13("");
7056
+ const reconnect = shallowRef16(stream.reconnect);
7057
+ const sessionId = ref13(stream.sessionId);
7058
+ const status = ref13(stream.status);
7059
+ const turns = shallowRef16([]);
6951
7060
  const sync = () => {
6952
7061
  assistantAudio.value = [...stream.assistantAudio];
6953
7062
  assistantTexts.value = [...stream.assistantTexts];
@@ -6966,7 +7075,7 @@ function useVoiceStream(path, options = {}) {
6966
7075
  unsubscribe();
6967
7076
  stream.close();
6968
7077
  };
6969
- onUnmounted16(destroy);
7078
+ onUnmounted17(destroy);
6970
7079
  return {
6971
7080
  assistantAudio,
6972
7081
  assistantTexts,
@@ -6985,7 +7094,7 @@ function useVoiceStream(path, options = {}) {
6985
7094
  };
6986
7095
  }
6987
7096
  // src/vue/useVoiceController.ts
6988
- import { onUnmounted as onUnmounted17, ref as ref13, shallowRef as shallowRef16 } from "vue";
7097
+ import { onUnmounted as onUnmounted18, ref as ref14, shallowRef as shallowRef17 } from "vue";
6989
7098
 
6990
7099
  // src/client/htmx.ts
6991
7100
  var DEFAULT_EVENT_NAME = "voice-refresh";
@@ -7631,17 +7740,17 @@ var createVoiceController = (path, options = {}) => {
7631
7740
  // src/vue/useVoiceController.ts
7632
7741
  function useVoiceController(path, options = {}) {
7633
7742
  const controller = createVoiceController(path, options);
7634
- const assistantAudio = shallowRef16([]);
7635
- const assistantTexts = shallowRef16([]);
7636
- const error = ref13(null);
7637
- const isConnected = ref13(false);
7638
- const isRecording = ref13(false);
7639
- const partial = ref13("");
7640
- const reconnect = shallowRef16(controller.reconnect);
7641
- const recordingError = ref13(null);
7642
- const sessionId = ref13(controller.sessionId);
7643
- const status = ref13(controller.status);
7644
- const turns = shallowRef16([]);
7743
+ const assistantAudio = shallowRef17([]);
7744
+ const assistantTexts = shallowRef17([]);
7745
+ const error = ref14(null);
7746
+ const isConnected = ref14(false);
7747
+ const isRecording = ref14(false);
7748
+ const partial = ref14("");
7749
+ const reconnect = shallowRef17(controller.reconnect);
7750
+ const recordingError = ref14(null);
7751
+ const sessionId = ref14(controller.sessionId);
7752
+ const status = ref14(controller.status);
7753
+ const turns = shallowRef17([]);
7645
7754
  const sync = () => {
7646
7755
  assistantAudio.value = [...controller.assistantAudio];
7647
7756
  assistantTexts.value = [...controller.assistantTexts];
@@ -7661,7 +7770,7 @@ function useVoiceController(path, options = {}) {
7661
7770
  unsubscribe();
7662
7771
  controller.close();
7663
7772
  };
7664
- onUnmounted17(destroy);
7773
+ onUnmounted18(destroy);
7665
7774
  return {
7666
7775
  assistantAudio,
7667
7776
  assistantTexts,
@@ -7684,13 +7793,13 @@ function useVoiceController(path, options = {}) {
7684
7793
  };
7685
7794
  }
7686
7795
  // src/vue/useVoiceTraceTimeline.ts
7687
- import { onUnmounted as onUnmounted18, ref as ref14, shallowRef as shallowRef17 } from "vue";
7796
+ import { onUnmounted as onUnmounted19, ref as ref15, shallowRef as shallowRef18 } from "vue";
7688
7797
  function useVoiceTraceTimeline(path = "/api/voice-traces", options = {}) {
7689
7798
  const store = createVoiceTraceTimelineStore(path, options);
7690
- const error = ref14(null);
7691
- const isLoading = ref14(false);
7692
- const report = shallowRef17(null);
7693
- const updatedAt = ref14(undefined);
7799
+ const error = ref15(null);
7800
+ const isLoading = ref15(false);
7801
+ const report = shallowRef18(null);
7802
+ const updatedAt = ref15(undefined);
7694
7803
  const sync = () => {
7695
7804
  const snapshot = store.getSnapshot();
7696
7805
  error.value = snapshot.error;
@@ -7701,7 +7810,7 @@ function useVoiceTraceTimeline(path = "/api/voice-traces", options = {}) {
7701
7810
  const unsubscribe = store.subscribe(sync);
7702
7811
  sync();
7703
7812
  store.refresh().catch(() => {});
7704
- onUnmounted18(() => {
7813
+ onUnmounted19(() => {
7705
7814
  unsubscribe();
7706
7815
  store.close();
7707
7816
  });
@@ -7714,7 +7823,7 @@ function useVoiceTraceTimeline(path = "/api/voice-traces", options = {}) {
7714
7823
  };
7715
7824
  }
7716
7825
  // src/vue/useVoiceWorkflowStatus.ts
7717
- import { onUnmounted as onUnmounted19, ref as ref15, shallowRef as shallowRef18 } from "vue";
7826
+ import { onUnmounted as onUnmounted20, ref as ref16, shallowRef as shallowRef19 } from "vue";
7718
7827
 
7719
7828
  // src/client/workflowStatus.ts
7720
7829
  var fetchVoiceWorkflowStatus = async (path = "/evals/scenarios/json", options = {}) => {
@@ -7798,10 +7907,10 @@ var createVoiceWorkflowStatusStore = (path = "/evals/scenarios/json", options =
7798
7907
  // src/vue/useVoiceWorkflowStatus.ts
7799
7908
  function useVoiceWorkflowStatus(path = "/evals/scenarios/json", options = {}) {
7800
7909
  const store = createVoiceWorkflowStatusStore(path, options);
7801
- const error = ref15(null);
7802
- const isLoading = ref15(false);
7803
- const report = shallowRef18(undefined);
7804
- const updatedAt = ref15(undefined);
7910
+ const error = ref16(null);
7911
+ const isLoading = ref16(false);
7912
+ const report = shallowRef19(undefined);
7913
+ const updatedAt = ref16(undefined);
7805
7914
  const sync = () => {
7806
7915
  const snapshot = store.getSnapshot();
7807
7916
  error.value = snapshot.error;
@@ -7814,7 +7923,7 @@ function useVoiceWorkflowStatus(path = "/evals/scenarios/json", options = {}) {
7814
7923
  if (typeof window !== "undefined") {
7815
7924
  store.refresh().catch(() => {});
7816
7925
  }
7817
- onUnmounted19(() => {
7926
+ onUnmounted20(() => {
7818
7927
  unsubscribe();
7819
7928
  store.close();
7820
7929
  });
@@ -7839,6 +7948,7 @@ export {
7839
7948
  useVoiceProviderContracts,
7840
7949
  useVoiceProviderCapabilities,
7841
7950
  useVoiceProofTrends,
7951
+ useVoiceProfileComparison,
7842
7952
  useVoicePlatformCoverage,
7843
7953
  useVoiceOpsStatus,
7844
7954
  useVoiceOpsActionCenter,
@@ -0,0 +1,9 @@
1
+ import { type VoiceProfileComparisonClientOptions } from '../client/profileComparison';
2
+ import type { VoiceRealCallProfileHistoryReport } from '../proofTrends';
3
+ export declare function useVoiceProfileComparison(path?: string, options?: VoiceProfileComparisonClientOptions): {
4
+ error: import("vue").Ref<string | null, string | null>;
5
+ isLoading: import("vue").Ref<boolean, boolean>;
6
+ refresh: () => Promise<VoiceRealCallProfileHistoryReport | undefined>;
7
+ report: import("vue").ShallowRef<VoiceRealCallProfileHistoryReport | undefined, VoiceRealCallProfileHistoryReport | undefined>;
8
+ updatedAt: import("vue").Ref<number | undefined, number | undefined>;
9
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.352",
3
+ "version": "0.0.22-beta.353",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",