@voice-ai-labs/web-sdk 0.2.0 → 0.4.0
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 +138 -2
- package/dist/client/base.d.ts +2 -2
- package/dist/client/base.js +2 -2
- package/dist/client/index.d.ts +5 -5
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +3 -3
- package/dist/client/index.js.map +1 -1
- package/dist/components/VoiceAgentWidget.d.ts +1 -1
- package/dist/components/VoiceAgentWidget.js +1 -1
- package/dist/index.d.ts +10 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +305 -21
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +305 -21
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +82 -13
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4134,6 +4134,12 @@ const ParticipantInfo = /* @__PURE__ */proto3.makeMessageType("livekit.Participa
|
|
|
4134
4134
|
kind: "enum",
|
|
4135
4135
|
T: proto3.getEnumType(ParticipantInfo_KindDetail),
|
|
4136
4136
|
repeated: true
|
|
4137
|
+
}, {
|
|
4138
|
+
no: 19,
|
|
4139
|
+
name: "data_tracks",
|
|
4140
|
+
kind: "message",
|
|
4141
|
+
T: DataTrackInfo,
|
|
4142
|
+
repeated: true
|
|
4137
4143
|
}]);
|
|
4138
4144
|
const ParticipantInfo_State = /* @__PURE__ */proto3.makeEnum("livekit.ParticipantInfo.State", [{
|
|
4139
4145
|
no: 0,
|
|
@@ -4166,6 +4172,9 @@ const ParticipantInfo_Kind = /* @__PURE__ */proto3.makeEnum("livekit.Participant
|
|
|
4166
4172
|
}, {
|
|
4167
4173
|
no: 7,
|
|
4168
4174
|
name: "CONNECTOR"
|
|
4175
|
+
}, {
|
|
4176
|
+
no: 8,
|
|
4177
|
+
name: "BRIDGE"
|
|
4169
4178
|
}]);
|
|
4170
4179
|
const ParticipantInfo_KindDetail = /* @__PURE__ */proto3.makeEnum("livekit.ParticipantInfo.KindDetail", [{
|
|
4171
4180
|
no: 0,
|
|
@@ -4173,6 +4182,15 @@ const ParticipantInfo_KindDetail = /* @__PURE__ */proto3.makeEnum("livekit.Parti
|
|
|
4173
4182
|
}, {
|
|
4174
4183
|
no: 1,
|
|
4175
4184
|
name: "FORWARDED"
|
|
4185
|
+
}, {
|
|
4186
|
+
no: 2,
|
|
4187
|
+
name: "CONNECTOR_WHATSAPP"
|
|
4188
|
+
}, {
|
|
4189
|
+
no: 3,
|
|
4190
|
+
name: "CONNECTOR_TWILIO"
|
|
4191
|
+
}, {
|
|
4192
|
+
no: 4,
|
|
4193
|
+
name: "BRIDGE_RTSP"
|
|
4176
4194
|
}]);
|
|
4177
4195
|
const Encryption_Type = /* @__PURE__ */proto3.makeEnum("livekit.Encryption.Type", [{
|
|
4178
4196
|
no: 0,
|
|
@@ -4336,6 +4354,37 @@ const TrackInfo = /* @__PURE__ */proto3.makeMessageType("livekit.TrackInfo", ()
|
|
|
4336
4354
|
kind: "enum",
|
|
4337
4355
|
T: proto3.getEnumType(BackupCodecPolicy$1)
|
|
4338
4356
|
}]);
|
|
4357
|
+
const DataTrackInfo = /* @__PURE__ */proto3.makeMessageType("livekit.DataTrackInfo", () => [{
|
|
4358
|
+
no: 1,
|
|
4359
|
+
name: "pub_handle",
|
|
4360
|
+
kind: "scalar",
|
|
4361
|
+
T: 13
|
|
4362
|
+
/* ScalarType.UINT32 */
|
|
4363
|
+
}, {
|
|
4364
|
+
no: 2,
|
|
4365
|
+
name: "sid",
|
|
4366
|
+
kind: "scalar",
|
|
4367
|
+
T: 9
|
|
4368
|
+
/* ScalarType.STRING */
|
|
4369
|
+
}, {
|
|
4370
|
+
no: 3,
|
|
4371
|
+
name: "name",
|
|
4372
|
+
kind: "scalar",
|
|
4373
|
+
T: 9
|
|
4374
|
+
/* ScalarType.STRING */
|
|
4375
|
+
}, {
|
|
4376
|
+
no: 4,
|
|
4377
|
+
name: "encryption",
|
|
4378
|
+
kind: "enum",
|
|
4379
|
+
T: proto3.getEnumType(Encryption_Type)
|
|
4380
|
+
}]);
|
|
4381
|
+
const DataTrackSubscriptionOptions = /* @__PURE__ */proto3.makeMessageType("livekit.DataTrackSubscriptionOptions", () => [{
|
|
4382
|
+
no: 1,
|
|
4383
|
+
name: "target_fps",
|
|
4384
|
+
kind: "scalar",
|
|
4385
|
+
T: 13,
|
|
4386
|
+
opt: true
|
|
4387
|
+
}]);
|
|
4339
4388
|
const VideoLayer = /* @__PURE__ */proto3.makeMessageType("livekit.VideoLayer", () => [{
|
|
4340
4389
|
no: 1,
|
|
4341
4390
|
name: "quality",
|
|
@@ -4377,6 +4426,12 @@ const VideoLayer = /* @__PURE__ */proto3.makeMessageType("livekit.VideoLayer", (
|
|
|
4377
4426
|
kind: "scalar",
|
|
4378
4427
|
T: 9
|
|
4379
4428
|
/* ScalarType.STRING */
|
|
4429
|
+
}, {
|
|
4430
|
+
no: 8,
|
|
4431
|
+
name: "repair_ssrc",
|
|
4432
|
+
kind: "scalar",
|
|
4433
|
+
T: 13
|
|
4434
|
+
/* ScalarType.UINT32 */
|
|
4380
4435
|
}]);
|
|
4381
4436
|
const VideoLayer_Mode = /* @__PURE__ */proto3.makeEnum("livekit.VideoLayer.Mode", [{
|
|
4382
4437
|
no: 0,
|
|
@@ -5391,6 +5446,24 @@ const SignalRequest = /* @__PURE__ */proto3.makeMessageType("livekit.SignalReque
|
|
|
5391
5446
|
kind: "message",
|
|
5392
5447
|
T: UpdateLocalVideoTrack,
|
|
5393
5448
|
oneof: "message"
|
|
5449
|
+
}, {
|
|
5450
|
+
no: 19,
|
|
5451
|
+
name: "publish_data_track_request",
|
|
5452
|
+
kind: "message",
|
|
5453
|
+
T: PublishDataTrackRequest,
|
|
5454
|
+
oneof: "message"
|
|
5455
|
+
}, {
|
|
5456
|
+
no: 20,
|
|
5457
|
+
name: "unpublish_data_track_request",
|
|
5458
|
+
kind: "message",
|
|
5459
|
+
T: UnpublishDataTrackRequest,
|
|
5460
|
+
oneof: "message"
|
|
5461
|
+
}, {
|
|
5462
|
+
no: 21,
|
|
5463
|
+
name: "update_data_subscription",
|
|
5464
|
+
kind: "message",
|
|
5465
|
+
T: UpdateDataSubscription,
|
|
5466
|
+
oneof: "message"
|
|
5394
5467
|
}]);
|
|
5395
5468
|
const SignalResponse = /* @__PURE__ */proto3.makeMessageType("livekit.SignalResponse", () => [{
|
|
5396
5469
|
no: 1,
|
|
@@ -5542,6 +5615,24 @@ const SignalResponse = /* @__PURE__ */proto3.makeMessageType("livekit.SignalResp
|
|
|
5542
5615
|
kind: "message",
|
|
5543
5616
|
T: SubscribedAudioCodecUpdate,
|
|
5544
5617
|
oneof: "message"
|
|
5618
|
+
}, {
|
|
5619
|
+
no: 27,
|
|
5620
|
+
name: "publish_data_track_response",
|
|
5621
|
+
kind: "message",
|
|
5622
|
+
T: PublishDataTrackResponse,
|
|
5623
|
+
oneof: "message"
|
|
5624
|
+
}, {
|
|
5625
|
+
no: 28,
|
|
5626
|
+
name: "unpublish_data_track_response",
|
|
5627
|
+
kind: "message",
|
|
5628
|
+
T: UnpublishDataTrackResponse,
|
|
5629
|
+
oneof: "message"
|
|
5630
|
+
}, {
|
|
5631
|
+
no: 29,
|
|
5632
|
+
name: "data_track_subscriber_handles",
|
|
5633
|
+
kind: "message",
|
|
5634
|
+
T: DataTrackSubscriberHandles,
|
|
5635
|
+
oneof: "message"
|
|
5545
5636
|
}]);
|
|
5546
5637
|
const SimulcastCodec = /* @__PURE__ */proto3.makeMessageType("livekit.SimulcastCodec", () => [{
|
|
5547
5638
|
no: 1,
|
|
@@ -5666,6 +5757,74 @@ const AddTrackRequest = /* @__PURE__ */proto3.makeMessageType("livekit.AddTrackR
|
|
|
5666
5757
|
T: proto3.getEnumType(AudioTrackFeature),
|
|
5667
5758
|
repeated: true
|
|
5668
5759
|
}]);
|
|
5760
|
+
const PublishDataTrackRequest = /* @__PURE__ */proto3.makeMessageType("livekit.PublishDataTrackRequest", () => [{
|
|
5761
|
+
no: 1,
|
|
5762
|
+
name: "pub_handle",
|
|
5763
|
+
kind: "scalar",
|
|
5764
|
+
T: 13
|
|
5765
|
+
/* ScalarType.UINT32 */
|
|
5766
|
+
}, {
|
|
5767
|
+
no: 2,
|
|
5768
|
+
name: "name",
|
|
5769
|
+
kind: "scalar",
|
|
5770
|
+
T: 9
|
|
5771
|
+
/* ScalarType.STRING */
|
|
5772
|
+
}, {
|
|
5773
|
+
no: 3,
|
|
5774
|
+
name: "encryption",
|
|
5775
|
+
kind: "enum",
|
|
5776
|
+
T: proto3.getEnumType(Encryption_Type)
|
|
5777
|
+
}]);
|
|
5778
|
+
const PublishDataTrackResponse = /* @__PURE__ */proto3.makeMessageType("livekit.PublishDataTrackResponse", () => [{
|
|
5779
|
+
no: 1,
|
|
5780
|
+
name: "info",
|
|
5781
|
+
kind: "message",
|
|
5782
|
+
T: DataTrackInfo
|
|
5783
|
+
}]);
|
|
5784
|
+
const UnpublishDataTrackRequest = /* @__PURE__ */proto3.makeMessageType("livekit.UnpublishDataTrackRequest", () => [{
|
|
5785
|
+
no: 1,
|
|
5786
|
+
name: "pub_handle",
|
|
5787
|
+
kind: "scalar",
|
|
5788
|
+
T: 13
|
|
5789
|
+
/* ScalarType.UINT32 */
|
|
5790
|
+
}]);
|
|
5791
|
+
const UnpublishDataTrackResponse = /* @__PURE__ */proto3.makeMessageType("livekit.UnpublishDataTrackResponse", () => [{
|
|
5792
|
+
no: 1,
|
|
5793
|
+
name: "info",
|
|
5794
|
+
kind: "message",
|
|
5795
|
+
T: DataTrackInfo
|
|
5796
|
+
}]);
|
|
5797
|
+
const DataTrackSubscriberHandles = /* @__PURE__ */proto3.makeMessageType("livekit.DataTrackSubscriberHandles", () => [{
|
|
5798
|
+
no: 1,
|
|
5799
|
+
name: "sub_handles",
|
|
5800
|
+
kind: "map",
|
|
5801
|
+
K: 13,
|
|
5802
|
+
V: {
|
|
5803
|
+
kind: "message",
|
|
5804
|
+
T: DataTrackSubscriberHandles_PublishedDataTrack
|
|
5805
|
+
}
|
|
5806
|
+
}]);
|
|
5807
|
+
const DataTrackSubscriberHandles_PublishedDataTrack = /* @__PURE__ */proto3.makeMessageType("livekit.DataTrackSubscriberHandles.PublishedDataTrack", () => [{
|
|
5808
|
+
no: 1,
|
|
5809
|
+
name: "publisher_identity",
|
|
5810
|
+
kind: "scalar",
|
|
5811
|
+
T: 9
|
|
5812
|
+
/* ScalarType.STRING */
|
|
5813
|
+
}, {
|
|
5814
|
+
no: 2,
|
|
5815
|
+
name: "publisher_sid",
|
|
5816
|
+
kind: "scalar",
|
|
5817
|
+
T: 9
|
|
5818
|
+
/* ScalarType.STRING */
|
|
5819
|
+
}, {
|
|
5820
|
+
no: 3,
|
|
5821
|
+
name: "track_sid",
|
|
5822
|
+
kind: "scalar",
|
|
5823
|
+
T: 9
|
|
5824
|
+
/* ScalarType.STRING */
|
|
5825
|
+
}], {
|
|
5826
|
+
localName: "DataTrackSubscriberHandles_PublishedDataTrack"
|
|
5827
|
+
});
|
|
5669
5828
|
const TrickleRequest = /* @__PURE__ */proto3.makeMessageType("livekit.TrickleRequest", () => [{
|
|
5670
5829
|
no: 1,
|
|
5671
5830
|
name: "candidateInit",
|
|
@@ -5881,6 +6040,33 @@ const UpdateSubscription = /* @__PURE__ */proto3.makeMessageType("livekit.Update
|
|
|
5881
6040
|
T: ParticipantTracks,
|
|
5882
6041
|
repeated: true
|
|
5883
6042
|
}]);
|
|
6043
|
+
const UpdateDataSubscription = /* @__PURE__ */proto3.makeMessageType("livekit.UpdateDataSubscription", () => [{
|
|
6044
|
+
no: 1,
|
|
6045
|
+
name: "updates",
|
|
6046
|
+
kind: "message",
|
|
6047
|
+
T: UpdateDataSubscription_Update,
|
|
6048
|
+
repeated: true
|
|
6049
|
+
}]);
|
|
6050
|
+
const UpdateDataSubscription_Update = /* @__PURE__ */proto3.makeMessageType("livekit.UpdateDataSubscription.Update", () => [{
|
|
6051
|
+
no: 1,
|
|
6052
|
+
name: "track_sid",
|
|
6053
|
+
kind: "scalar",
|
|
6054
|
+
T: 9
|
|
6055
|
+
/* ScalarType.STRING */
|
|
6056
|
+
}, {
|
|
6057
|
+
no: 2,
|
|
6058
|
+
name: "subscribe",
|
|
6059
|
+
kind: "scalar",
|
|
6060
|
+
T: 8
|
|
6061
|
+
/* ScalarType.BOOL */
|
|
6062
|
+
}, {
|
|
6063
|
+
no: 3,
|
|
6064
|
+
name: "options",
|
|
6065
|
+
kind: "message",
|
|
6066
|
+
T: DataTrackSubscriptionOptions
|
|
6067
|
+
}], {
|
|
6068
|
+
localName: "UpdateDataSubscription_Update"
|
|
6069
|
+
});
|
|
5884
6070
|
const UpdateTrackSettings = /* @__PURE__ */proto3.makeMessageType("livekit.UpdateTrackSettings", () => [{
|
|
5885
6071
|
no: 1,
|
|
5886
6072
|
name: "track_sids",
|
|
@@ -6287,6 +6473,12 @@ const SyncState = /* @__PURE__ */proto3.makeMessageType("livekit.SyncState", ()
|
|
|
6287
6473
|
kind: "message",
|
|
6288
6474
|
T: DataChannelReceiveState,
|
|
6289
6475
|
repeated: true
|
|
6476
|
+
}, {
|
|
6477
|
+
no: 8,
|
|
6478
|
+
name: "publish_data_tracks",
|
|
6479
|
+
kind: "message",
|
|
6480
|
+
T: PublishDataTrackResponse,
|
|
6481
|
+
repeated: true
|
|
6290
6482
|
}]);
|
|
6291
6483
|
const DataChannelReceiveState = /* @__PURE__ */proto3.makeMessageType("livekit.DataChannelReceiveState", () => [{
|
|
6292
6484
|
no: 1,
|
|
@@ -6491,6 +6683,18 @@ const RequestResponse = /* @__PURE__ */proto3.makeMessageType("livekit.RequestRe
|
|
|
6491
6683
|
kind: "message",
|
|
6492
6684
|
T: UpdateLocalVideoTrack,
|
|
6493
6685
|
oneof: "request"
|
|
6686
|
+
}, {
|
|
6687
|
+
no: 10,
|
|
6688
|
+
name: "publish_data_track",
|
|
6689
|
+
kind: "message",
|
|
6690
|
+
T: PublishDataTrackRequest,
|
|
6691
|
+
oneof: "request"
|
|
6692
|
+
}, {
|
|
6693
|
+
no: 11,
|
|
6694
|
+
name: "unpublish_data_track",
|
|
6695
|
+
kind: "message",
|
|
6696
|
+
T: UnpublishDataTrackRequest,
|
|
6697
|
+
oneof: "request"
|
|
6494
6698
|
}]);
|
|
6495
6699
|
const RequestResponse_Reason = /* @__PURE__ */proto3.makeEnum("livekit.RequestResponse.Reason", [{
|
|
6496
6700
|
no: 0,
|
|
@@ -6513,6 +6717,18 @@ const RequestResponse_Reason = /* @__PURE__ */proto3.makeEnum("livekit.RequestRe
|
|
|
6513
6717
|
}, {
|
|
6514
6718
|
no: 6,
|
|
6515
6719
|
name: "UNCLASSIFIED_ERROR"
|
|
6720
|
+
}, {
|
|
6721
|
+
no: 7,
|
|
6722
|
+
name: "INVALID_HANDLE"
|
|
6723
|
+
}, {
|
|
6724
|
+
no: 8,
|
|
6725
|
+
name: "INVALID_NAME"
|
|
6726
|
+
}, {
|
|
6727
|
+
no: 9,
|
|
6728
|
+
name: "DUPLICATE_HANDLE"
|
|
6729
|
+
}, {
|
|
6730
|
+
no: 10,
|
|
6731
|
+
name: "DUPLICATE_NAME"
|
|
6516
6732
|
}]);
|
|
6517
6733
|
const TrackSubscribed = /* @__PURE__ */proto3.makeMessageType("livekit.TrackSubscribed", () => [{
|
|
6518
6734
|
no: 1,
|
|
@@ -6545,6 +6761,12 @@ const ConnectionSettings = /* @__PURE__ */proto3.makeMessageType("livekit.Connec
|
|
|
6545
6761
|
kind: "scalar",
|
|
6546
6762
|
T: 8
|
|
6547
6763
|
/* ScalarType.BOOL */
|
|
6764
|
+
}, {
|
|
6765
|
+
no: 5,
|
|
6766
|
+
name: "auto_subscribe_data_track",
|
|
6767
|
+
kind: "scalar",
|
|
6768
|
+
T: 8,
|
|
6769
|
+
opt: true
|
|
6548
6770
|
}]);
|
|
6549
6771
|
const JoinRequest = /* @__PURE__ */proto3.makeMessageType("livekit.JoinRequest", () => [{
|
|
6550
6772
|
no: 1,
|
|
@@ -10395,7 +10617,8 @@ function adapterFactory() {
|
|
|
10395
10617
|
|
|
10396
10618
|
adapterFactory({
|
|
10397
10619
|
window: typeof window === 'undefined' ? undefined : window
|
|
10398
|
-
});
|
|
10620
|
+
});var _a, _b;
|
|
10621
|
+
class TypedPromise extends (_b = Promise) {
|
|
10399
10622
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
10400
10623
|
constructor(executor) {
|
|
10401
10624
|
super(executor);
|
|
@@ -10412,7 +10635,11 @@ adapterFactory({
|
|
|
10412
10635
|
static race(values) {
|
|
10413
10636
|
return super.race(values);
|
|
10414
10637
|
}
|
|
10415
|
-
}
|
|
10638
|
+
}
|
|
10639
|
+
_a = TypedPromise;
|
|
10640
|
+
TypedPromise.resolve = value => {
|
|
10641
|
+
return Reflect.get(_b, "resolve", _a).call(_a, value);
|
|
10642
|
+
};// tiny, simplified version of https://github.com/lancedikson/bowser/blob/master/src/parser-browsers.js
|
|
10416
10643
|
// reduced to only differentiate Chrome(ium) based browsers / Firefox / Safari
|
|
10417
10644
|
const commonVersionIdentifier = /version\/(\d+(\.?_?\d+)+)/i;
|
|
10418
10645
|
let browserDetails;
|
|
@@ -10478,14 +10705,23 @@ function getMatch(exp, ua) {
|
|
|
10478
10705
|
}
|
|
10479
10706
|
function getOSVersion(ua) {
|
|
10480
10707
|
return ua.includes('mac os') ? getMatch(/\(.+?(\d+_\d+(:?_\d+)?)/, ua, 1).replace(/_/g, '.') : undefined;
|
|
10481
|
-
}var version$1 = "2.17.
|
|
10482
|
-
const protocolVersion = 16
|
|
10483
|
-
|
|
10484
|
-
|
|
10708
|
+
}var version$1 = "2.17.1";const version = version$1;
|
|
10709
|
+
const protocolVersion = 16;/** Base error that all LiveKit specific custom errors inherit from. */
|
|
10710
|
+
class LivekitError extends Error {
|
|
10711
|
+
constructor(code, message, options) {
|
|
10712
|
+
super(message || 'an error has occurred');
|
|
10485
10713
|
this.name = 'LiveKitError';
|
|
10486
10714
|
this.code = code;
|
|
10715
|
+
if (typeof (options === null || options === void 0 ? void 0 : options.cause) !== 'undefined') {
|
|
10716
|
+
this.cause = options === null || options === void 0 ? void 0 : options.cause;
|
|
10717
|
+
}
|
|
10487
10718
|
}
|
|
10488
10719
|
}
|
|
10720
|
+
/**
|
|
10721
|
+
* LiveKit specific error type representing an error with an associated set of reasons.
|
|
10722
|
+
* Use this to represent an error with multiple different but contextually related variants.
|
|
10723
|
+
* */
|
|
10724
|
+
class LivekitReasonedError extends LivekitError {}
|
|
10489
10725
|
var ConnectionErrorReason;
|
|
10490
10726
|
(function (ConnectionErrorReason) {
|
|
10491
10727
|
ConnectionErrorReason[ConnectionErrorReason["NotAllowed"] = 0] = "NotAllowed";
|
|
@@ -10497,7 +10733,7 @@ var ConnectionErrorReason;
|
|
|
10497
10733
|
ConnectionErrorReason[ConnectionErrorReason["WebSocket"] = 6] = "WebSocket";
|
|
10498
10734
|
ConnectionErrorReason[ConnectionErrorReason["ServiceNotFound"] = 7] = "ServiceNotFound";
|
|
10499
10735
|
})(ConnectionErrorReason || (ConnectionErrorReason = {}));
|
|
10500
|
-
class ConnectionError extends
|
|
10736
|
+
class ConnectionError extends LivekitReasonedError {
|
|
10501
10737
|
constructor(message, reason, status, context) {
|
|
10502
10738
|
super(1, message);
|
|
10503
10739
|
this.name = 'ConnectionError';
|
|
@@ -10568,7 +10804,7 @@ class PublishTrackError extends LivekitError {
|
|
|
10568
10804
|
this.status = status;
|
|
10569
10805
|
}
|
|
10570
10806
|
}
|
|
10571
|
-
class SignalRequestError extends
|
|
10807
|
+
class SignalRequestError extends LivekitReasonedError {
|
|
10572
10808
|
constructor(message, reason) {
|
|
10573
10809
|
super(15, message);
|
|
10574
10810
|
this.name = 'SignalRequestError';
|
|
@@ -10594,7 +10830,7 @@ var DataStreamErrorReason;
|
|
|
10594
10830
|
// Encryption type mismatch.
|
|
10595
10831
|
DataStreamErrorReason[DataStreamErrorReason["EncryptionTypeMismatch"] = 8] = "EncryptionTypeMismatch";
|
|
10596
10832
|
})(DataStreamErrorReason || (DataStreamErrorReason = {}));
|
|
10597
|
-
class DataStreamError extends
|
|
10833
|
+
class DataStreamError extends LivekitReasonedError {
|
|
10598
10834
|
constructor(message, reason) {
|
|
10599
10835
|
super(16, message);
|
|
10600
10836
|
this.name = 'DataStreamError';
|
|
@@ -20121,7 +20357,8 @@ class TextStreamReader extends BaseStreamReader {
|
|
|
20121
20357
|
topic: streamHeader.topic,
|
|
20122
20358
|
timestamp: Number(streamHeader.timestamp),
|
|
20123
20359
|
attributes: streamHeader.attributes,
|
|
20124
|
-
encryptionType
|
|
20360
|
+
encryptionType,
|
|
20361
|
+
attachedStreamIds: streamHeader.contentHeader.value.attachedStreamIds
|
|
20125
20362
|
};
|
|
20126
20363
|
const stream = new ReadableStream({
|
|
20127
20364
|
start: controller => {
|
|
@@ -20274,7 +20511,8 @@ class OutgoingDataStreamManager {
|
|
|
20274
20511
|
topic: (_b = options === null || options === void 0 ? void 0 : options.topic) !== null && _b !== void 0 ? _b : '',
|
|
20275
20512
|
size: options === null || options === void 0 ? void 0 : options.totalSize,
|
|
20276
20513
|
attributes: options === null || options === void 0 ? void 0 : options.attributes,
|
|
20277
|
-
encryptionType: ((_c = this.engine.e2eeManager) === null || _c === void 0 ? void 0 : _c.isDataChannelEncryptionEnabled) ? Encryption_Type.GCM : Encryption_Type.NONE
|
|
20514
|
+
encryptionType: ((_c = this.engine.e2eeManager) === null || _c === void 0 ? void 0 : _c.isDataChannelEncryptionEnabled) ? Encryption_Type.GCM : Encryption_Type.NONE,
|
|
20515
|
+
attachedStreamIds: options === null || options === void 0 ? void 0 : options.attachedStreamIds
|
|
20278
20516
|
};
|
|
20279
20517
|
const header = new DataStream_Header({
|
|
20280
20518
|
streamId,
|
|
@@ -20287,7 +20525,7 @@ class OutgoingDataStreamManager {
|
|
|
20287
20525
|
case: 'textHeader',
|
|
20288
20526
|
value: new DataStream_TextHeader({
|
|
20289
20527
|
version: options === null || options === void 0 ? void 0 : options.version,
|
|
20290
|
-
attachedStreamIds:
|
|
20528
|
+
attachedStreamIds: info.attachedStreamIds,
|
|
20291
20529
|
replyToStreamId: options === null || options === void 0 ? void 0 : options.replyToStreamId,
|
|
20292
20530
|
operationType: (options === null || options === void 0 ? void 0 : options.type) === 'update' ? DataStream_OperationType.UPDATE : DataStream_OperationType.CREATE
|
|
20293
20531
|
})
|
|
@@ -26897,17 +27135,54 @@ class JWSSignatureVerificationFailed extends JOSEError {
|
|
|
26897
27135
|
_defineProperty(this, "code", 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED');
|
|
26898
27136
|
}
|
|
26899
27137
|
}
|
|
26900
|
-
_defineProperty(JWSSignatureVerificationFailed, "code", 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED');
|
|
27138
|
+
_defineProperty(JWSSignatureVerificationFailed, "code", 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED');var DataTrackHandleErrorReason;
|
|
27139
|
+
(function (DataTrackHandleErrorReason) {
|
|
27140
|
+
DataTrackHandleErrorReason[DataTrackHandleErrorReason["Reserved"] = 0] = "Reserved";
|
|
27141
|
+
DataTrackHandleErrorReason[DataTrackHandleErrorReason["TooLarge"] = 1] = "TooLarge";
|
|
27142
|
+
})(DataTrackHandleErrorReason || (DataTrackHandleErrorReason = {}));
|
|
27143
|
+
var DataTrackDeserializeErrorReason;
|
|
27144
|
+
(function (DataTrackDeserializeErrorReason) {
|
|
27145
|
+
DataTrackDeserializeErrorReason[DataTrackDeserializeErrorReason["TooShort"] = 0] = "TooShort";
|
|
27146
|
+
DataTrackDeserializeErrorReason[DataTrackDeserializeErrorReason["HeaderOverrun"] = 1] = "HeaderOverrun";
|
|
27147
|
+
DataTrackDeserializeErrorReason[DataTrackDeserializeErrorReason["MissingExtWords"] = 2] = "MissingExtWords";
|
|
27148
|
+
DataTrackDeserializeErrorReason[DataTrackDeserializeErrorReason["UnsupportedVersion"] = 3] = "UnsupportedVersion";
|
|
27149
|
+
DataTrackDeserializeErrorReason[DataTrackDeserializeErrorReason["InvalidHandle"] = 4] = "InvalidHandle";
|
|
27150
|
+
DataTrackDeserializeErrorReason[DataTrackDeserializeErrorReason["MalformedExt"] = 5] = "MalformedExt";
|
|
27151
|
+
})(DataTrackDeserializeErrorReason || (DataTrackDeserializeErrorReason = {}));
|
|
27152
|
+
var DataTrackSerializeErrorReason;
|
|
27153
|
+
(function (DataTrackSerializeErrorReason) {
|
|
27154
|
+
DataTrackSerializeErrorReason[DataTrackSerializeErrorReason["TooSmallForHeader"] = 0] = "TooSmallForHeader";
|
|
27155
|
+
DataTrackSerializeErrorReason[DataTrackSerializeErrorReason["TooSmallForPayload"] = 1] = "TooSmallForPayload";
|
|
27156
|
+
})(DataTrackSerializeErrorReason || (DataTrackSerializeErrorReason = {}));
|
|
27157
|
+
var DataTrackExtensionTag;
|
|
27158
|
+
(function (DataTrackExtensionTag) {
|
|
27159
|
+
DataTrackExtensionTag[DataTrackExtensionTag["UserTimestamp"] = 2] = "UserTimestamp";
|
|
27160
|
+
DataTrackExtensionTag[DataTrackExtensionTag["E2ee"] = 1] = "E2ee";
|
|
27161
|
+
})(DataTrackExtensionTag || (DataTrackExtensionTag = {}));
|
|
27162
|
+
DataTrackExtensionTag.UserTimestamp;
|
|
27163
|
+
DataTrackExtensionTag.E2ee;
|
|
27164
|
+
/** Marker indicating a packet's position in relation to a frame. */
|
|
27165
|
+
var FrameMarker;
|
|
27166
|
+
(function (FrameMarker) {
|
|
27167
|
+
/** Packet is the first in a frame. */
|
|
27168
|
+
FrameMarker[FrameMarker["Start"] = 0] = "Start";
|
|
27169
|
+
/** Packet is within a frame. */
|
|
27170
|
+
FrameMarker[FrameMarker["Inter"] = 1] = "Inter";
|
|
27171
|
+
/** Packet is the last in a frame. */
|
|
27172
|
+
FrameMarker[FrameMarker["Final"] = 2] = "Final";
|
|
27173
|
+
/** Packet is the only one in a frame. */
|
|
27174
|
+
FrameMarker[FrameMarker["Single"] = 3] = "Single";
|
|
27175
|
+
})(FrameMarker || (FrameMarker = {}));
|
|
26901
27176
|
|
|
26902
27177
|
/**
|
|
26903
|
-
* Base HTTP Client for Voice.
|
|
27178
|
+
* Base HTTP Client for Voice.ai API
|
|
26904
27179
|
*
|
|
26905
27180
|
* Provides common functionality for all API clients including:
|
|
26906
27181
|
* - Authentication via Bearer token
|
|
26907
27182
|
* - Error handling and response parsing
|
|
26908
27183
|
* - Common HTTP methods (GET, POST, PUT, PATCH, DELETE)
|
|
26909
27184
|
*/
|
|
26910
|
-
/** Error thrown by Voice.
|
|
27185
|
+
/** Error thrown by Voice.ai API client */
|
|
26911
27186
|
class VoiceAIError extends Error {
|
|
26912
27187
|
constructor(message, status, code, detail) {
|
|
26913
27188
|
super(message);
|
|
@@ -27703,7 +27978,7 @@ class PhoneNumberClient extends BaseClient {
|
|
|
27703
27978
|
}
|
|
27704
27979
|
|
|
27705
27980
|
/**
|
|
27706
|
-
* VoiceAgentWidget - UI widget for Voice.
|
|
27981
|
+
* VoiceAgentWidget - UI widget for Voice.ai
|
|
27707
27982
|
*
|
|
27708
27983
|
* Features:
|
|
27709
27984
|
* - Click to connect/disconnect
|
|
@@ -28110,9 +28385,9 @@ VoiceAgentWidget.DEFAULT_THEME = {
|
|
|
28110
28385
|
};
|
|
28111
28386
|
|
|
28112
28387
|
/**
|
|
28113
|
-
* Voice.
|
|
28388
|
+
* Voice.ai Web SDK
|
|
28114
28389
|
*
|
|
28115
|
-
* A single, unified SDK for Voice.
|
|
28390
|
+
* A single, unified SDK for Voice.ai services.
|
|
28116
28391
|
*
|
|
28117
28392
|
* @example
|
|
28118
28393
|
* ```typescript
|
|
@@ -28134,7 +28409,7 @@ VoiceAgentWidget.DEFAULT_THEME = {
|
|
|
28134
28409
|
/** Default API URL */
|
|
28135
28410
|
const DEFAULT_API_URL = 'https://dev.voice.ai/api/v1';
|
|
28136
28411
|
/**
|
|
28137
|
-
* VoiceAI - The unified Voice.
|
|
28412
|
+
* VoiceAI - The unified Voice.ai SDK
|
|
28138
28413
|
*
|
|
28139
28414
|
* Provides both real-time voice agent connections and REST API access
|
|
28140
28415
|
* through a single, easy-to-use interface.
|
|
@@ -28162,7 +28437,7 @@ class VoiceAI {
|
|
|
28162
28437
|
* Create a new VoiceAI client
|
|
28163
28438
|
*
|
|
28164
28439
|
* @param config - Configuration options
|
|
28165
|
-
* @param config.apiKey - Your Voice.
|
|
28440
|
+
* @param config.apiKey - Your Voice.ai API key (required)
|
|
28166
28441
|
* @param config.apiUrl - Custom API URL (optional, defaults to production)
|
|
28167
28442
|
*/
|
|
28168
28443
|
constructor(config) {
|
|
@@ -28202,10 +28477,15 @@ class VoiceAI {
|
|
|
28202
28477
|
* @param options - Connection options
|
|
28203
28478
|
* @param options.agentId - ID of the agent to connect to
|
|
28204
28479
|
* @param options.autoPublishMic - Auto-enable microphone (default: true)
|
|
28480
|
+
* @param options.testMode - Test mode to preview paused/undeployed agents (default: false)
|
|
28205
28481
|
*
|
|
28206
28482
|
* @example
|
|
28207
28483
|
* ```typescript
|
|
28484
|
+
* // Connect to a deployed agent
|
|
28208
28485
|
* await voiceai.connect({ agentId: 'agent-123' });
|
|
28486
|
+
*
|
|
28487
|
+
* // Test a paused agent before deploying
|
|
28488
|
+
* await voiceai.connect({ agentId: 'agent-123', testMode: true });
|
|
28209
28489
|
* ```
|
|
28210
28490
|
*/
|
|
28211
28491
|
async connect(options) {
|
|
@@ -28431,7 +28711,11 @@ class VoiceAI {
|
|
|
28431
28711
|
}
|
|
28432
28712
|
async getConnectionDetails(options) {
|
|
28433
28713
|
const url = options.apiUrl || this.apiUrl;
|
|
28434
|
-
|
|
28714
|
+
// Use test-connection-details for testMode (allows testing paused/undeployed agents)
|
|
28715
|
+
const endpointPath = options.testMode
|
|
28716
|
+
? '/connection/test-connection-details'
|
|
28717
|
+
: '/connection/connection-details';
|
|
28718
|
+
const endpoint = `${url}${endpointPath}`;
|
|
28435
28719
|
const requestData = {};
|
|
28436
28720
|
if (options.agentId)
|
|
28437
28721
|
requestData.agent_id = options.agentId;
|