@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.esm.js
CHANGED
|
@@ -4130,6 +4130,12 @@ const ParticipantInfo = /* @__PURE__ */proto3.makeMessageType("livekit.Participa
|
|
|
4130
4130
|
kind: "enum",
|
|
4131
4131
|
T: proto3.getEnumType(ParticipantInfo_KindDetail),
|
|
4132
4132
|
repeated: true
|
|
4133
|
+
}, {
|
|
4134
|
+
no: 19,
|
|
4135
|
+
name: "data_tracks",
|
|
4136
|
+
kind: "message",
|
|
4137
|
+
T: DataTrackInfo,
|
|
4138
|
+
repeated: true
|
|
4133
4139
|
}]);
|
|
4134
4140
|
const ParticipantInfo_State = /* @__PURE__ */proto3.makeEnum("livekit.ParticipantInfo.State", [{
|
|
4135
4141
|
no: 0,
|
|
@@ -4162,6 +4168,9 @@ const ParticipantInfo_Kind = /* @__PURE__ */proto3.makeEnum("livekit.Participant
|
|
|
4162
4168
|
}, {
|
|
4163
4169
|
no: 7,
|
|
4164
4170
|
name: "CONNECTOR"
|
|
4171
|
+
}, {
|
|
4172
|
+
no: 8,
|
|
4173
|
+
name: "BRIDGE"
|
|
4165
4174
|
}]);
|
|
4166
4175
|
const ParticipantInfo_KindDetail = /* @__PURE__ */proto3.makeEnum("livekit.ParticipantInfo.KindDetail", [{
|
|
4167
4176
|
no: 0,
|
|
@@ -4169,6 +4178,15 @@ const ParticipantInfo_KindDetail = /* @__PURE__ */proto3.makeEnum("livekit.Parti
|
|
|
4169
4178
|
}, {
|
|
4170
4179
|
no: 1,
|
|
4171
4180
|
name: "FORWARDED"
|
|
4181
|
+
}, {
|
|
4182
|
+
no: 2,
|
|
4183
|
+
name: "CONNECTOR_WHATSAPP"
|
|
4184
|
+
}, {
|
|
4185
|
+
no: 3,
|
|
4186
|
+
name: "CONNECTOR_TWILIO"
|
|
4187
|
+
}, {
|
|
4188
|
+
no: 4,
|
|
4189
|
+
name: "BRIDGE_RTSP"
|
|
4172
4190
|
}]);
|
|
4173
4191
|
const Encryption_Type = /* @__PURE__ */proto3.makeEnum("livekit.Encryption.Type", [{
|
|
4174
4192
|
no: 0,
|
|
@@ -4332,6 +4350,37 @@ const TrackInfo = /* @__PURE__ */proto3.makeMessageType("livekit.TrackInfo", ()
|
|
|
4332
4350
|
kind: "enum",
|
|
4333
4351
|
T: proto3.getEnumType(BackupCodecPolicy$1)
|
|
4334
4352
|
}]);
|
|
4353
|
+
const DataTrackInfo = /* @__PURE__ */proto3.makeMessageType("livekit.DataTrackInfo", () => [{
|
|
4354
|
+
no: 1,
|
|
4355
|
+
name: "pub_handle",
|
|
4356
|
+
kind: "scalar",
|
|
4357
|
+
T: 13
|
|
4358
|
+
/* ScalarType.UINT32 */
|
|
4359
|
+
}, {
|
|
4360
|
+
no: 2,
|
|
4361
|
+
name: "sid",
|
|
4362
|
+
kind: "scalar",
|
|
4363
|
+
T: 9
|
|
4364
|
+
/* ScalarType.STRING */
|
|
4365
|
+
}, {
|
|
4366
|
+
no: 3,
|
|
4367
|
+
name: "name",
|
|
4368
|
+
kind: "scalar",
|
|
4369
|
+
T: 9
|
|
4370
|
+
/* ScalarType.STRING */
|
|
4371
|
+
}, {
|
|
4372
|
+
no: 4,
|
|
4373
|
+
name: "encryption",
|
|
4374
|
+
kind: "enum",
|
|
4375
|
+
T: proto3.getEnumType(Encryption_Type)
|
|
4376
|
+
}]);
|
|
4377
|
+
const DataTrackSubscriptionOptions = /* @__PURE__ */proto3.makeMessageType("livekit.DataTrackSubscriptionOptions", () => [{
|
|
4378
|
+
no: 1,
|
|
4379
|
+
name: "target_fps",
|
|
4380
|
+
kind: "scalar",
|
|
4381
|
+
T: 13,
|
|
4382
|
+
opt: true
|
|
4383
|
+
}]);
|
|
4335
4384
|
const VideoLayer = /* @__PURE__ */proto3.makeMessageType("livekit.VideoLayer", () => [{
|
|
4336
4385
|
no: 1,
|
|
4337
4386
|
name: "quality",
|
|
@@ -4373,6 +4422,12 @@ const VideoLayer = /* @__PURE__ */proto3.makeMessageType("livekit.VideoLayer", (
|
|
|
4373
4422
|
kind: "scalar",
|
|
4374
4423
|
T: 9
|
|
4375
4424
|
/* ScalarType.STRING */
|
|
4425
|
+
}, {
|
|
4426
|
+
no: 8,
|
|
4427
|
+
name: "repair_ssrc",
|
|
4428
|
+
kind: "scalar",
|
|
4429
|
+
T: 13
|
|
4430
|
+
/* ScalarType.UINT32 */
|
|
4376
4431
|
}]);
|
|
4377
4432
|
const VideoLayer_Mode = /* @__PURE__ */proto3.makeEnum("livekit.VideoLayer.Mode", [{
|
|
4378
4433
|
no: 0,
|
|
@@ -5387,6 +5442,24 @@ const SignalRequest = /* @__PURE__ */proto3.makeMessageType("livekit.SignalReque
|
|
|
5387
5442
|
kind: "message",
|
|
5388
5443
|
T: UpdateLocalVideoTrack,
|
|
5389
5444
|
oneof: "message"
|
|
5445
|
+
}, {
|
|
5446
|
+
no: 19,
|
|
5447
|
+
name: "publish_data_track_request",
|
|
5448
|
+
kind: "message",
|
|
5449
|
+
T: PublishDataTrackRequest,
|
|
5450
|
+
oneof: "message"
|
|
5451
|
+
}, {
|
|
5452
|
+
no: 20,
|
|
5453
|
+
name: "unpublish_data_track_request",
|
|
5454
|
+
kind: "message",
|
|
5455
|
+
T: UnpublishDataTrackRequest,
|
|
5456
|
+
oneof: "message"
|
|
5457
|
+
}, {
|
|
5458
|
+
no: 21,
|
|
5459
|
+
name: "update_data_subscription",
|
|
5460
|
+
kind: "message",
|
|
5461
|
+
T: UpdateDataSubscription,
|
|
5462
|
+
oneof: "message"
|
|
5390
5463
|
}]);
|
|
5391
5464
|
const SignalResponse = /* @__PURE__ */proto3.makeMessageType("livekit.SignalResponse", () => [{
|
|
5392
5465
|
no: 1,
|
|
@@ -5538,6 +5611,24 @@ const SignalResponse = /* @__PURE__ */proto3.makeMessageType("livekit.SignalResp
|
|
|
5538
5611
|
kind: "message",
|
|
5539
5612
|
T: SubscribedAudioCodecUpdate,
|
|
5540
5613
|
oneof: "message"
|
|
5614
|
+
}, {
|
|
5615
|
+
no: 27,
|
|
5616
|
+
name: "publish_data_track_response",
|
|
5617
|
+
kind: "message",
|
|
5618
|
+
T: PublishDataTrackResponse,
|
|
5619
|
+
oneof: "message"
|
|
5620
|
+
}, {
|
|
5621
|
+
no: 28,
|
|
5622
|
+
name: "unpublish_data_track_response",
|
|
5623
|
+
kind: "message",
|
|
5624
|
+
T: UnpublishDataTrackResponse,
|
|
5625
|
+
oneof: "message"
|
|
5626
|
+
}, {
|
|
5627
|
+
no: 29,
|
|
5628
|
+
name: "data_track_subscriber_handles",
|
|
5629
|
+
kind: "message",
|
|
5630
|
+
T: DataTrackSubscriberHandles,
|
|
5631
|
+
oneof: "message"
|
|
5541
5632
|
}]);
|
|
5542
5633
|
const SimulcastCodec = /* @__PURE__ */proto3.makeMessageType("livekit.SimulcastCodec", () => [{
|
|
5543
5634
|
no: 1,
|
|
@@ -5662,6 +5753,74 @@ const AddTrackRequest = /* @__PURE__ */proto3.makeMessageType("livekit.AddTrackR
|
|
|
5662
5753
|
T: proto3.getEnumType(AudioTrackFeature),
|
|
5663
5754
|
repeated: true
|
|
5664
5755
|
}]);
|
|
5756
|
+
const PublishDataTrackRequest = /* @__PURE__ */proto3.makeMessageType("livekit.PublishDataTrackRequest", () => [{
|
|
5757
|
+
no: 1,
|
|
5758
|
+
name: "pub_handle",
|
|
5759
|
+
kind: "scalar",
|
|
5760
|
+
T: 13
|
|
5761
|
+
/* ScalarType.UINT32 */
|
|
5762
|
+
}, {
|
|
5763
|
+
no: 2,
|
|
5764
|
+
name: "name",
|
|
5765
|
+
kind: "scalar",
|
|
5766
|
+
T: 9
|
|
5767
|
+
/* ScalarType.STRING */
|
|
5768
|
+
}, {
|
|
5769
|
+
no: 3,
|
|
5770
|
+
name: "encryption",
|
|
5771
|
+
kind: "enum",
|
|
5772
|
+
T: proto3.getEnumType(Encryption_Type)
|
|
5773
|
+
}]);
|
|
5774
|
+
const PublishDataTrackResponse = /* @__PURE__ */proto3.makeMessageType("livekit.PublishDataTrackResponse", () => [{
|
|
5775
|
+
no: 1,
|
|
5776
|
+
name: "info",
|
|
5777
|
+
kind: "message",
|
|
5778
|
+
T: DataTrackInfo
|
|
5779
|
+
}]);
|
|
5780
|
+
const UnpublishDataTrackRequest = /* @__PURE__ */proto3.makeMessageType("livekit.UnpublishDataTrackRequest", () => [{
|
|
5781
|
+
no: 1,
|
|
5782
|
+
name: "pub_handle",
|
|
5783
|
+
kind: "scalar",
|
|
5784
|
+
T: 13
|
|
5785
|
+
/* ScalarType.UINT32 */
|
|
5786
|
+
}]);
|
|
5787
|
+
const UnpublishDataTrackResponse = /* @__PURE__ */proto3.makeMessageType("livekit.UnpublishDataTrackResponse", () => [{
|
|
5788
|
+
no: 1,
|
|
5789
|
+
name: "info",
|
|
5790
|
+
kind: "message",
|
|
5791
|
+
T: DataTrackInfo
|
|
5792
|
+
}]);
|
|
5793
|
+
const DataTrackSubscriberHandles = /* @__PURE__ */proto3.makeMessageType("livekit.DataTrackSubscriberHandles", () => [{
|
|
5794
|
+
no: 1,
|
|
5795
|
+
name: "sub_handles",
|
|
5796
|
+
kind: "map",
|
|
5797
|
+
K: 13,
|
|
5798
|
+
V: {
|
|
5799
|
+
kind: "message",
|
|
5800
|
+
T: DataTrackSubscriberHandles_PublishedDataTrack
|
|
5801
|
+
}
|
|
5802
|
+
}]);
|
|
5803
|
+
const DataTrackSubscriberHandles_PublishedDataTrack = /* @__PURE__ */proto3.makeMessageType("livekit.DataTrackSubscriberHandles.PublishedDataTrack", () => [{
|
|
5804
|
+
no: 1,
|
|
5805
|
+
name: "publisher_identity",
|
|
5806
|
+
kind: "scalar",
|
|
5807
|
+
T: 9
|
|
5808
|
+
/* ScalarType.STRING */
|
|
5809
|
+
}, {
|
|
5810
|
+
no: 2,
|
|
5811
|
+
name: "publisher_sid",
|
|
5812
|
+
kind: "scalar",
|
|
5813
|
+
T: 9
|
|
5814
|
+
/* ScalarType.STRING */
|
|
5815
|
+
}, {
|
|
5816
|
+
no: 3,
|
|
5817
|
+
name: "track_sid",
|
|
5818
|
+
kind: "scalar",
|
|
5819
|
+
T: 9
|
|
5820
|
+
/* ScalarType.STRING */
|
|
5821
|
+
}], {
|
|
5822
|
+
localName: "DataTrackSubscriberHandles_PublishedDataTrack"
|
|
5823
|
+
});
|
|
5665
5824
|
const TrickleRequest = /* @__PURE__ */proto3.makeMessageType("livekit.TrickleRequest", () => [{
|
|
5666
5825
|
no: 1,
|
|
5667
5826
|
name: "candidateInit",
|
|
@@ -5877,6 +6036,33 @@ const UpdateSubscription = /* @__PURE__ */proto3.makeMessageType("livekit.Update
|
|
|
5877
6036
|
T: ParticipantTracks,
|
|
5878
6037
|
repeated: true
|
|
5879
6038
|
}]);
|
|
6039
|
+
const UpdateDataSubscription = /* @__PURE__ */proto3.makeMessageType("livekit.UpdateDataSubscription", () => [{
|
|
6040
|
+
no: 1,
|
|
6041
|
+
name: "updates",
|
|
6042
|
+
kind: "message",
|
|
6043
|
+
T: UpdateDataSubscription_Update,
|
|
6044
|
+
repeated: true
|
|
6045
|
+
}]);
|
|
6046
|
+
const UpdateDataSubscription_Update = /* @__PURE__ */proto3.makeMessageType("livekit.UpdateDataSubscription.Update", () => [{
|
|
6047
|
+
no: 1,
|
|
6048
|
+
name: "track_sid",
|
|
6049
|
+
kind: "scalar",
|
|
6050
|
+
T: 9
|
|
6051
|
+
/* ScalarType.STRING */
|
|
6052
|
+
}, {
|
|
6053
|
+
no: 2,
|
|
6054
|
+
name: "subscribe",
|
|
6055
|
+
kind: "scalar",
|
|
6056
|
+
T: 8
|
|
6057
|
+
/* ScalarType.BOOL */
|
|
6058
|
+
}, {
|
|
6059
|
+
no: 3,
|
|
6060
|
+
name: "options",
|
|
6061
|
+
kind: "message",
|
|
6062
|
+
T: DataTrackSubscriptionOptions
|
|
6063
|
+
}], {
|
|
6064
|
+
localName: "UpdateDataSubscription_Update"
|
|
6065
|
+
});
|
|
5880
6066
|
const UpdateTrackSettings = /* @__PURE__ */proto3.makeMessageType("livekit.UpdateTrackSettings", () => [{
|
|
5881
6067
|
no: 1,
|
|
5882
6068
|
name: "track_sids",
|
|
@@ -6283,6 +6469,12 @@ const SyncState = /* @__PURE__ */proto3.makeMessageType("livekit.SyncState", ()
|
|
|
6283
6469
|
kind: "message",
|
|
6284
6470
|
T: DataChannelReceiveState,
|
|
6285
6471
|
repeated: true
|
|
6472
|
+
}, {
|
|
6473
|
+
no: 8,
|
|
6474
|
+
name: "publish_data_tracks",
|
|
6475
|
+
kind: "message",
|
|
6476
|
+
T: PublishDataTrackResponse,
|
|
6477
|
+
repeated: true
|
|
6286
6478
|
}]);
|
|
6287
6479
|
const DataChannelReceiveState = /* @__PURE__ */proto3.makeMessageType("livekit.DataChannelReceiveState", () => [{
|
|
6288
6480
|
no: 1,
|
|
@@ -6487,6 +6679,18 @@ const RequestResponse = /* @__PURE__ */proto3.makeMessageType("livekit.RequestRe
|
|
|
6487
6679
|
kind: "message",
|
|
6488
6680
|
T: UpdateLocalVideoTrack,
|
|
6489
6681
|
oneof: "request"
|
|
6682
|
+
}, {
|
|
6683
|
+
no: 10,
|
|
6684
|
+
name: "publish_data_track",
|
|
6685
|
+
kind: "message",
|
|
6686
|
+
T: PublishDataTrackRequest,
|
|
6687
|
+
oneof: "request"
|
|
6688
|
+
}, {
|
|
6689
|
+
no: 11,
|
|
6690
|
+
name: "unpublish_data_track",
|
|
6691
|
+
kind: "message",
|
|
6692
|
+
T: UnpublishDataTrackRequest,
|
|
6693
|
+
oneof: "request"
|
|
6490
6694
|
}]);
|
|
6491
6695
|
const RequestResponse_Reason = /* @__PURE__ */proto3.makeEnum("livekit.RequestResponse.Reason", [{
|
|
6492
6696
|
no: 0,
|
|
@@ -6509,6 +6713,18 @@ const RequestResponse_Reason = /* @__PURE__ */proto3.makeEnum("livekit.RequestRe
|
|
|
6509
6713
|
}, {
|
|
6510
6714
|
no: 6,
|
|
6511
6715
|
name: "UNCLASSIFIED_ERROR"
|
|
6716
|
+
}, {
|
|
6717
|
+
no: 7,
|
|
6718
|
+
name: "INVALID_HANDLE"
|
|
6719
|
+
}, {
|
|
6720
|
+
no: 8,
|
|
6721
|
+
name: "INVALID_NAME"
|
|
6722
|
+
}, {
|
|
6723
|
+
no: 9,
|
|
6724
|
+
name: "DUPLICATE_HANDLE"
|
|
6725
|
+
}, {
|
|
6726
|
+
no: 10,
|
|
6727
|
+
name: "DUPLICATE_NAME"
|
|
6512
6728
|
}]);
|
|
6513
6729
|
const TrackSubscribed = /* @__PURE__ */proto3.makeMessageType("livekit.TrackSubscribed", () => [{
|
|
6514
6730
|
no: 1,
|
|
@@ -6541,6 +6757,12 @@ const ConnectionSettings = /* @__PURE__ */proto3.makeMessageType("livekit.Connec
|
|
|
6541
6757
|
kind: "scalar",
|
|
6542
6758
|
T: 8
|
|
6543
6759
|
/* ScalarType.BOOL */
|
|
6760
|
+
}, {
|
|
6761
|
+
no: 5,
|
|
6762
|
+
name: "auto_subscribe_data_track",
|
|
6763
|
+
kind: "scalar",
|
|
6764
|
+
T: 8,
|
|
6765
|
+
opt: true
|
|
6544
6766
|
}]);
|
|
6545
6767
|
const JoinRequest = /* @__PURE__ */proto3.makeMessageType("livekit.JoinRequest", () => [{
|
|
6546
6768
|
no: 1,
|
|
@@ -10391,7 +10613,8 @@ function adapterFactory() {
|
|
|
10391
10613
|
|
|
10392
10614
|
adapterFactory({
|
|
10393
10615
|
window: typeof window === 'undefined' ? undefined : window
|
|
10394
|
-
});
|
|
10616
|
+
});var _a, _b;
|
|
10617
|
+
class TypedPromise extends (_b = Promise) {
|
|
10395
10618
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
10396
10619
|
constructor(executor) {
|
|
10397
10620
|
super(executor);
|
|
@@ -10408,7 +10631,11 @@ adapterFactory({
|
|
|
10408
10631
|
static race(values) {
|
|
10409
10632
|
return super.race(values);
|
|
10410
10633
|
}
|
|
10411
|
-
}
|
|
10634
|
+
}
|
|
10635
|
+
_a = TypedPromise;
|
|
10636
|
+
TypedPromise.resolve = value => {
|
|
10637
|
+
return Reflect.get(_b, "resolve", _a).call(_a, value);
|
|
10638
|
+
};// tiny, simplified version of https://github.com/lancedikson/bowser/blob/master/src/parser-browsers.js
|
|
10412
10639
|
// reduced to only differentiate Chrome(ium) based browsers / Firefox / Safari
|
|
10413
10640
|
const commonVersionIdentifier = /version\/(\d+(\.?_?\d+)+)/i;
|
|
10414
10641
|
let browserDetails;
|
|
@@ -10474,14 +10701,23 @@ function getMatch(exp, ua) {
|
|
|
10474
10701
|
}
|
|
10475
10702
|
function getOSVersion(ua) {
|
|
10476
10703
|
return ua.includes('mac os') ? getMatch(/\(.+?(\d+_\d+(:?_\d+)?)/, ua, 1).replace(/_/g, '.') : undefined;
|
|
10477
|
-
}var version$1 = "2.17.
|
|
10478
|
-
const protocolVersion = 16
|
|
10479
|
-
|
|
10480
|
-
|
|
10704
|
+
}var version$1 = "2.17.1";const version = version$1;
|
|
10705
|
+
const protocolVersion = 16;/** Base error that all LiveKit specific custom errors inherit from. */
|
|
10706
|
+
class LivekitError extends Error {
|
|
10707
|
+
constructor(code, message, options) {
|
|
10708
|
+
super(message || 'an error has occurred');
|
|
10481
10709
|
this.name = 'LiveKitError';
|
|
10482
10710
|
this.code = code;
|
|
10711
|
+
if (typeof (options === null || options === void 0 ? void 0 : options.cause) !== 'undefined') {
|
|
10712
|
+
this.cause = options === null || options === void 0 ? void 0 : options.cause;
|
|
10713
|
+
}
|
|
10483
10714
|
}
|
|
10484
10715
|
}
|
|
10716
|
+
/**
|
|
10717
|
+
* LiveKit specific error type representing an error with an associated set of reasons.
|
|
10718
|
+
* Use this to represent an error with multiple different but contextually related variants.
|
|
10719
|
+
* */
|
|
10720
|
+
class LivekitReasonedError extends LivekitError {}
|
|
10485
10721
|
var ConnectionErrorReason;
|
|
10486
10722
|
(function (ConnectionErrorReason) {
|
|
10487
10723
|
ConnectionErrorReason[ConnectionErrorReason["NotAllowed"] = 0] = "NotAllowed";
|
|
@@ -10493,7 +10729,7 @@ var ConnectionErrorReason;
|
|
|
10493
10729
|
ConnectionErrorReason[ConnectionErrorReason["WebSocket"] = 6] = "WebSocket";
|
|
10494
10730
|
ConnectionErrorReason[ConnectionErrorReason["ServiceNotFound"] = 7] = "ServiceNotFound";
|
|
10495
10731
|
})(ConnectionErrorReason || (ConnectionErrorReason = {}));
|
|
10496
|
-
class ConnectionError extends
|
|
10732
|
+
class ConnectionError extends LivekitReasonedError {
|
|
10497
10733
|
constructor(message, reason, status, context) {
|
|
10498
10734
|
super(1, message);
|
|
10499
10735
|
this.name = 'ConnectionError';
|
|
@@ -10564,7 +10800,7 @@ class PublishTrackError extends LivekitError {
|
|
|
10564
10800
|
this.status = status;
|
|
10565
10801
|
}
|
|
10566
10802
|
}
|
|
10567
|
-
class SignalRequestError extends
|
|
10803
|
+
class SignalRequestError extends LivekitReasonedError {
|
|
10568
10804
|
constructor(message, reason) {
|
|
10569
10805
|
super(15, message);
|
|
10570
10806
|
this.name = 'SignalRequestError';
|
|
@@ -10590,7 +10826,7 @@ var DataStreamErrorReason;
|
|
|
10590
10826
|
// Encryption type mismatch.
|
|
10591
10827
|
DataStreamErrorReason[DataStreamErrorReason["EncryptionTypeMismatch"] = 8] = "EncryptionTypeMismatch";
|
|
10592
10828
|
})(DataStreamErrorReason || (DataStreamErrorReason = {}));
|
|
10593
|
-
class DataStreamError extends
|
|
10829
|
+
class DataStreamError extends LivekitReasonedError {
|
|
10594
10830
|
constructor(message, reason) {
|
|
10595
10831
|
super(16, message);
|
|
10596
10832
|
this.name = 'DataStreamError';
|
|
@@ -20117,7 +20353,8 @@ class TextStreamReader extends BaseStreamReader {
|
|
|
20117
20353
|
topic: streamHeader.topic,
|
|
20118
20354
|
timestamp: Number(streamHeader.timestamp),
|
|
20119
20355
|
attributes: streamHeader.attributes,
|
|
20120
|
-
encryptionType
|
|
20356
|
+
encryptionType,
|
|
20357
|
+
attachedStreamIds: streamHeader.contentHeader.value.attachedStreamIds
|
|
20121
20358
|
};
|
|
20122
20359
|
const stream = new ReadableStream({
|
|
20123
20360
|
start: controller => {
|
|
@@ -20270,7 +20507,8 @@ class OutgoingDataStreamManager {
|
|
|
20270
20507
|
topic: (_b = options === null || options === void 0 ? void 0 : options.topic) !== null && _b !== void 0 ? _b : '',
|
|
20271
20508
|
size: options === null || options === void 0 ? void 0 : options.totalSize,
|
|
20272
20509
|
attributes: options === null || options === void 0 ? void 0 : options.attributes,
|
|
20273
|
-
encryptionType: ((_c = this.engine.e2eeManager) === null || _c === void 0 ? void 0 : _c.isDataChannelEncryptionEnabled) ? Encryption_Type.GCM : Encryption_Type.NONE
|
|
20510
|
+
encryptionType: ((_c = this.engine.e2eeManager) === null || _c === void 0 ? void 0 : _c.isDataChannelEncryptionEnabled) ? Encryption_Type.GCM : Encryption_Type.NONE,
|
|
20511
|
+
attachedStreamIds: options === null || options === void 0 ? void 0 : options.attachedStreamIds
|
|
20274
20512
|
};
|
|
20275
20513
|
const header = new DataStream_Header({
|
|
20276
20514
|
streamId,
|
|
@@ -20283,7 +20521,7 @@ class OutgoingDataStreamManager {
|
|
|
20283
20521
|
case: 'textHeader',
|
|
20284
20522
|
value: new DataStream_TextHeader({
|
|
20285
20523
|
version: options === null || options === void 0 ? void 0 : options.version,
|
|
20286
|
-
attachedStreamIds:
|
|
20524
|
+
attachedStreamIds: info.attachedStreamIds,
|
|
20287
20525
|
replyToStreamId: options === null || options === void 0 ? void 0 : options.replyToStreamId,
|
|
20288
20526
|
operationType: (options === null || options === void 0 ? void 0 : options.type) === 'update' ? DataStream_OperationType.UPDATE : DataStream_OperationType.CREATE
|
|
20289
20527
|
})
|
|
@@ -26893,17 +27131,54 @@ class JWSSignatureVerificationFailed extends JOSEError {
|
|
|
26893
27131
|
_defineProperty(this, "code", 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED');
|
|
26894
27132
|
}
|
|
26895
27133
|
}
|
|
26896
|
-
_defineProperty(JWSSignatureVerificationFailed, "code", 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED');
|
|
27134
|
+
_defineProperty(JWSSignatureVerificationFailed, "code", 'ERR_JWS_SIGNATURE_VERIFICATION_FAILED');var DataTrackHandleErrorReason;
|
|
27135
|
+
(function (DataTrackHandleErrorReason) {
|
|
27136
|
+
DataTrackHandleErrorReason[DataTrackHandleErrorReason["Reserved"] = 0] = "Reserved";
|
|
27137
|
+
DataTrackHandleErrorReason[DataTrackHandleErrorReason["TooLarge"] = 1] = "TooLarge";
|
|
27138
|
+
})(DataTrackHandleErrorReason || (DataTrackHandleErrorReason = {}));
|
|
27139
|
+
var DataTrackDeserializeErrorReason;
|
|
27140
|
+
(function (DataTrackDeserializeErrorReason) {
|
|
27141
|
+
DataTrackDeserializeErrorReason[DataTrackDeserializeErrorReason["TooShort"] = 0] = "TooShort";
|
|
27142
|
+
DataTrackDeserializeErrorReason[DataTrackDeserializeErrorReason["HeaderOverrun"] = 1] = "HeaderOverrun";
|
|
27143
|
+
DataTrackDeserializeErrorReason[DataTrackDeserializeErrorReason["MissingExtWords"] = 2] = "MissingExtWords";
|
|
27144
|
+
DataTrackDeserializeErrorReason[DataTrackDeserializeErrorReason["UnsupportedVersion"] = 3] = "UnsupportedVersion";
|
|
27145
|
+
DataTrackDeserializeErrorReason[DataTrackDeserializeErrorReason["InvalidHandle"] = 4] = "InvalidHandle";
|
|
27146
|
+
DataTrackDeserializeErrorReason[DataTrackDeserializeErrorReason["MalformedExt"] = 5] = "MalformedExt";
|
|
27147
|
+
})(DataTrackDeserializeErrorReason || (DataTrackDeserializeErrorReason = {}));
|
|
27148
|
+
var DataTrackSerializeErrorReason;
|
|
27149
|
+
(function (DataTrackSerializeErrorReason) {
|
|
27150
|
+
DataTrackSerializeErrorReason[DataTrackSerializeErrorReason["TooSmallForHeader"] = 0] = "TooSmallForHeader";
|
|
27151
|
+
DataTrackSerializeErrorReason[DataTrackSerializeErrorReason["TooSmallForPayload"] = 1] = "TooSmallForPayload";
|
|
27152
|
+
})(DataTrackSerializeErrorReason || (DataTrackSerializeErrorReason = {}));
|
|
27153
|
+
var DataTrackExtensionTag;
|
|
27154
|
+
(function (DataTrackExtensionTag) {
|
|
27155
|
+
DataTrackExtensionTag[DataTrackExtensionTag["UserTimestamp"] = 2] = "UserTimestamp";
|
|
27156
|
+
DataTrackExtensionTag[DataTrackExtensionTag["E2ee"] = 1] = "E2ee";
|
|
27157
|
+
})(DataTrackExtensionTag || (DataTrackExtensionTag = {}));
|
|
27158
|
+
DataTrackExtensionTag.UserTimestamp;
|
|
27159
|
+
DataTrackExtensionTag.E2ee;
|
|
27160
|
+
/** Marker indicating a packet's position in relation to a frame. */
|
|
27161
|
+
var FrameMarker;
|
|
27162
|
+
(function (FrameMarker) {
|
|
27163
|
+
/** Packet is the first in a frame. */
|
|
27164
|
+
FrameMarker[FrameMarker["Start"] = 0] = "Start";
|
|
27165
|
+
/** Packet is within a frame. */
|
|
27166
|
+
FrameMarker[FrameMarker["Inter"] = 1] = "Inter";
|
|
27167
|
+
/** Packet is the last in a frame. */
|
|
27168
|
+
FrameMarker[FrameMarker["Final"] = 2] = "Final";
|
|
27169
|
+
/** Packet is the only one in a frame. */
|
|
27170
|
+
FrameMarker[FrameMarker["Single"] = 3] = "Single";
|
|
27171
|
+
})(FrameMarker || (FrameMarker = {}));
|
|
26897
27172
|
|
|
26898
27173
|
/**
|
|
26899
|
-
* Base HTTP Client for Voice.
|
|
27174
|
+
* Base HTTP Client for Voice.ai API
|
|
26900
27175
|
*
|
|
26901
27176
|
* Provides common functionality for all API clients including:
|
|
26902
27177
|
* - Authentication via Bearer token
|
|
26903
27178
|
* - Error handling and response parsing
|
|
26904
27179
|
* - Common HTTP methods (GET, POST, PUT, PATCH, DELETE)
|
|
26905
27180
|
*/
|
|
26906
|
-
/** Error thrown by Voice.
|
|
27181
|
+
/** Error thrown by Voice.ai API client */
|
|
26907
27182
|
class VoiceAIError extends Error {
|
|
26908
27183
|
constructor(message, status, code, detail) {
|
|
26909
27184
|
super(message);
|
|
@@ -27699,7 +27974,7 @@ class PhoneNumberClient extends BaseClient {
|
|
|
27699
27974
|
}
|
|
27700
27975
|
|
|
27701
27976
|
/**
|
|
27702
|
-
* VoiceAgentWidget - UI widget for Voice.
|
|
27977
|
+
* VoiceAgentWidget - UI widget for Voice.ai
|
|
27703
27978
|
*
|
|
27704
27979
|
* Features:
|
|
27705
27980
|
* - Click to connect/disconnect
|
|
@@ -28106,9 +28381,9 @@ VoiceAgentWidget.DEFAULT_THEME = {
|
|
|
28106
28381
|
};
|
|
28107
28382
|
|
|
28108
28383
|
/**
|
|
28109
|
-
* Voice.
|
|
28384
|
+
* Voice.ai Web SDK
|
|
28110
28385
|
*
|
|
28111
|
-
* A single, unified SDK for Voice.
|
|
28386
|
+
* A single, unified SDK for Voice.ai services.
|
|
28112
28387
|
*
|
|
28113
28388
|
* @example
|
|
28114
28389
|
* ```typescript
|
|
@@ -28130,7 +28405,7 @@ VoiceAgentWidget.DEFAULT_THEME = {
|
|
|
28130
28405
|
/** Default API URL */
|
|
28131
28406
|
const DEFAULT_API_URL = 'https://dev.voice.ai/api/v1';
|
|
28132
28407
|
/**
|
|
28133
|
-
* VoiceAI - The unified Voice.
|
|
28408
|
+
* VoiceAI - The unified Voice.ai SDK
|
|
28134
28409
|
*
|
|
28135
28410
|
* Provides both real-time voice agent connections and REST API access
|
|
28136
28411
|
* through a single, easy-to-use interface.
|
|
@@ -28158,7 +28433,7 @@ class VoiceAI {
|
|
|
28158
28433
|
* Create a new VoiceAI client
|
|
28159
28434
|
*
|
|
28160
28435
|
* @param config - Configuration options
|
|
28161
|
-
* @param config.apiKey - Your Voice.
|
|
28436
|
+
* @param config.apiKey - Your Voice.ai API key (required)
|
|
28162
28437
|
* @param config.apiUrl - Custom API URL (optional, defaults to production)
|
|
28163
28438
|
*/
|
|
28164
28439
|
constructor(config) {
|
|
@@ -28198,10 +28473,15 @@ class VoiceAI {
|
|
|
28198
28473
|
* @param options - Connection options
|
|
28199
28474
|
* @param options.agentId - ID of the agent to connect to
|
|
28200
28475
|
* @param options.autoPublishMic - Auto-enable microphone (default: true)
|
|
28476
|
+
* @param options.testMode - Test mode to preview paused/undeployed agents (default: false)
|
|
28201
28477
|
*
|
|
28202
28478
|
* @example
|
|
28203
28479
|
* ```typescript
|
|
28480
|
+
* // Connect to a deployed agent
|
|
28204
28481
|
* await voiceai.connect({ agentId: 'agent-123' });
|
|
28482
|
+
*
|
|
28483
|
+
* // Test a paused agent before deploying
|
|
28484
|
+
* await voiceai.connect({ agentId: 'agent-123', testMode: true });
|
|
28205
28485
|
* ```
|
|
28206
28486
|
*/
|
|
28207
28487
|
async connect(options) {
|
|
@@ -28427,7 +28707,11 @@ class VoiceAI {
|
|
|
28427
28707
|
}
|
|
28428
28708
|
async getConnectionDetails(options) {
|
|
28429
28709
|
const url = options.apiUrl || this.apiUrl;
|
|
28430
|
-
|
|
28710
|
+
// Use test-connection-details for testMode (allows testing paused/undeployed agents)
|
|
28711
|
+
const endpointPath = options.testMode
|
|
28712
|
+
? '/connection/test-connection-details'
|
|
28713
|
+
: '/connection/connection-details';
|
|
28714
|
+
const endpoint = `${url}${endpointPath}`;
|
|
28431
28715
|
const requestData = {};
|
|
28432
28716
|
if (options.agentId)
|
|
28433
28717
|
requestData.agent_id = options.agentId;
|