obi-sdk 0.11.1 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.es.js CHANGED
@@ -16499,6 +16499,34 @@ class _g {
16499
16499
  body: t
16500
16500
  });
16501
16501
  }
16502
+ async listRevisionKnowledgeBlocks(e) {
16503
+ return await this.client.GET("/revisions/{id}/knowledge-blocks", {
16504
+ params: { path: { id: e } }
16505
+ });
16506
+ }
16507
+ async replaceRevisionKnowledgeBlocks(e, t) {
16508
+ return await this.client.PUT("/revisions/{id}/knowledge-blocks", {
16509
+ params: { path: { id: e } },
16510
+ body: t
16511
+ });
16512
+ }
16513
+ async createRevisionKnowledgeBlock(e, t) {
16514
+ return await this.client.POST("/revisions/{id}/knowledge-blocks", {
16515
+ params: { path: { id: e } },
16516
+ body: t
16517
+ });
16518
+ }
16519
+ async updateRevisionKnowledgeBlock(e, t, n) {
16520
+ return await this.client.PUT("/revisions/{id}/knowledge-blocks/{blockId}", {
16521
+ params: { path: { id: e, blockId: t } },
16522
+ body: n
16523
+ });
16524
+ }
16525
+ async deleteRevisionKnowledgeBlock(e, t) {
16526
+ return await this.client.DELETE("/revisions/{id}/knowledge-blocks/{blockId}", {
16527
+ params: { path: { id: e, blockId: t } }
16528
+ });
16529
+ }
16502
16530
  // Sessions
16503
16531
  async listSessions(e) {
16504
16532
  return await this.client.GET("/sessions", {
@@ -16530,12 +16558,13 @@ class _g {
16530
16558
  params: { path: { id: e } }
16531
16559
  });
16532
16560
  }
16533
- async getJoinToken(e, { skipIntro: t } = {}) {
16561
+ async getJoinToken(e, { skipIntro: t, user: n } = {}) {
16534
16562
  return await this.client.GET("/join-token", {
16535
16563
  params: {
16536
16564
  query: {
16537
16565
  token: e,
16538
- ...t && { skip_intro: "true" }
16566
+ ...t && { skip_intro: "true" },
16567
+ ...n && { user: encodeURIComponent(n) }
16539
16568
  }
16540
16569
  }
16541
16570
  });
@@ -16553,10 +16582,10 @@ var O;
16553
16582
  A.READY = "ready", A.ERROR = "error", A.PAUSED = "paused", A.LOADING = "loading", A.THINKING = "thinking", A.RESEARCHING = "researching", A.AGENT_SPEAKING = "agent_speaking", A.USER_SPEAKING = "user_speaking", A.AWAITING_USER_INPUT = "awaiting_user_input";
16554
16583
  })(O || (O = {}));
16555
16584
  class KC {
16556
- constructor({ sessionId: e, apiBaseUrl: t }) {
16557
- this.currentState = O.READY, this.livekitState = "speaking", this.assistantAudioContext = null, this.userAudioContext = null, this._assistantAudioTimer = null, this._userAudioTimer = null, this.sessionId = e, this.apiBaseUrl = t || NC, this.client = new _g({
16585
+ constructor({ sessionId: e, apiBaseUrl: t, user: n }) {
16586
+ this.currentState = O.READY, this.livekitState = "speaking", this.assistantAudioContext = null, this.userAudioContext = null, this._assistantAudioTimer = null, this._userAudioTimer = null, this.user = void 0, this.sessionId = e, this.apiBaseUrl = t || NC, this.client = new _g({
16558
16587
  baseUrl: this.apiBaseUrl
16559
- }), this.emitter = new Om();
16588
+ }), this.emitter = new Om(), this.user = n;
16560
16589
  }
16561
16590
  emit(e, t) {
16562
16591
  this.emitter.emit(e, t);
@@ -16651,7 +16680,10 @@ class KC {
16651
16680
  adaptiveStream: !0,
16652
16681
  dynacast: !0
16653
16682
  }), this.setupRoomEventListeners();
16654
- const e = await this.client.getJoinToken(this.sessionId, { skipIntro: !0 });
16683
+ const e = await this.client.getJoinToken(this.sessionId, {
16684
+ skipIntro: !0,
16685
+ ...this.user && { user: JSON.stringify(this.user) }
16686
+ });
16655
16687
  if (await this.room.connect(e.data.url, e.data.token), this.microphoneStream) {
16656
16688
  const t = this.microphoneStream.getAudioTracks()[0];
16657
16689
  await this.room.localParticipant.publishTrack(t, {
@@ -28559,13 +28591,6 @@ LA.styles = Qt`
28559
28591
  aspect-ratio: 1/1;
28560
28592
  border-radius: 8px;
28561
28593
  background: var(--obi-primary, #a10fff);
28562
- box-shadow:
28563
- 0px 0px 8px 0px rgba(168, 85, 247, 0.12),
28564
- 0px 0px 8px 0px rgba(192, 132, 252, 0.24),
28565
- 0px 0px 4px 0px rgba(192, 132, 252, 0.24),
28566
- 0px 0px 4px 0px rgba(192, 132, 252, 0.24),
28567
- 0px 0px 2px 0px rgba(192, 132, 252, 0.12),
28568
- 0px 0px 1px 0px rgba(168, 85, 247, 0.24);
28569
28594
  }
28570
28595
 
28571
28596
  .logo img {
@@ -28978,7 +29003,8 @@ let Ce = class extends Ft {
28978
29003
  try {
28979
29004
  const t = new KC({
28980
29005
  sessionId: e,
28981
- apiBaseUrl: nc
29006
+ apiBaseUrl: nc,
29007
+ ...this.user && { user: this.user }
28982
29008
  });
28983
29009
  return t || (console.error("Failed to create session"), null);
28984
29010
  } catch (t) {