obi-sdk 0.12.0 → 0.12.2
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/modular/chunks/index-ff86c70a.js +6 -0
- package/dist/modular/chunks/index-ff86c70a.js.map +1 -0
- package/dist/modular/chunks/{obi-widget-6b2916f1.js → obi-widget-33113e44.js} +73 -15
- package/dist/modular/chunks/obi-widget-33113e44.js.map +1 -0
- package/dist/modular/index.js +1 -1
- package/dist/modular/ui.js +10 -10
- package/dist/obi-sdk.standalone.iife.js +63 -15
- package/dist/obi-sdk.standalone.iife.js.map +1 -1
- package/dist/react.es.js +998 -943
- package/dist/react.es.js.map +1 -1
- package/dist/react.umd.js +98 -50
- package/dist/react.umd.js.map +1 -1
- package/dist/ui/components/courses/courses.d.ts +2 -0
- package/package.json +5 -5
- package/dist/modular/chunks/index-21eeed74.js +0 -6
- package/dist/modular/chunks/index-21eeed74.js.map +0 -1
- package/dist/modular/chunks/obi-widget-6b2916f1.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-ff86c70a.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -629,19 +629,21 @@ class ObiClient {
|
|
|
629
629
|
}
|
|
630
630
|
const DEFAULT_API_BASE_URL = "https://app.coragents.ai/api";
|
|
631
631
|
class ObiSession {
|
|
632
|
-
constructor({ sessionId, apiBaseUrl }) {
|
|
632
|
+
constructor({ sessionId, apiBaseUrl, user }) {
|
|
633
633
|
this.currentState = SDKState.READY;
|
|
634
634
|
this.livekitState = "speaking";
|
|
635
635
|
this.assistantAudioContext = null;
|
|
636
636
|
this.userAudioContext = null;
|
|
637
637
|
this._assistantAudioTimer = null;
|
|
638
638
|
this._userAudioTimer = null;
|
|
639
|
+
this.user = void 0;
|
|
639
640
|
this.sessionId = sessionId;
|
|
640
641
|
this.apiBaseUrl = apiBaseUrl || DEFAULT_API_BASE_URL;
|
|
641
642
|
this.client = new ObiClient({
|
|
642
643
|
baseUrl: this.apiBaseUrl
|
|
643
644
|
});
|
|
644
645
|
this.emitter = new EventEmitter();
|
|
646
|
+
this.user = user;
|
|
645
647
|
}
|
|
646
648
|
emit(event, data) {
|
|
647
649
|
this.emitter.emit(event, data);
|
|
@@ -768,7 +770,10 @@ class ObiSession {
|
|
|
768
770
|
dynacast: true
|
|
769
771
|
});
|
|
770
772
|
this.setupRoomEventListeners();
|
|
771
|
-
const joinToken = await this.client.getJoinToken(this.sessionId, {
|
|
773
|
+
const joinToken = await this.client.getJoinToken(this.sessionId, {
|
|
774
|
+
skipIntro: true,
|
|
775
|
+
...this.user && { user: JSON.stringify(this.user) }
|
|
776
|
+
});
|
|
772
777
|
await this.room.connect(joinToken.data.url, joinToken.data.token);
|
|
773
778
|
if (this.microphoneStream) {
|
|
774
779
|
const micTrack = this.microphoneStream.getAudioTracks()[0];
|
|
@@ -16424,6 +16429,7 @@ class Course extends i$1 {
|
|
|
16424
16429
|
this.name = "";
|
|
16425
16430
|
this.description = "";
|
|
16426
16431
|
this.duration = 10;
|
|
16432
|
+
this.order = 0;
|
|
16427
16433
|
this.selected = false;
|
|
16428
16434
|
this.handleClick = withSentryHandler(
|
|
16429
16435
|
() => {
|
|
@@ -16582,6 +16588,9 @@ __decorateClass$5([
|
|
|
16582
16588
|
__decorateClass$5([
|
|
16583
16589
|
n$2({ type: Number })
|
|
16584
16590
|
], Course.prototype, "duration", 2);
|
|
16591
|
+
__decorateClass$5([
|
|
16592
|
+
n$2({ type: Number })
|
|
16593
|
+
], Course.prototype, "order", 2);
|
|
16585
16594
|
__decorateClass$5([
|
|
16586
16595
|
n$2({ type: Boolean })
|
|
16587
16596
|
], Course.prototype, "selected", 2);
|
|
@@ -16605,17 +16614,18 @@ class CourseList extends i$1 {
|
|
|
16605
16614
|
}
|
|
16606
16615
|
return x`
|
|
16607
16616
|
<div class="course-grid">
|
|
16608
|
-
${this.courses.map((course) => {
|
|
16617
|
+
${this.courses.sort((a2, b2) => (a2.order || 0) - (b2.order || 0)).map((course) => {
|
|
16609
16618
|
const isSelected = course.id === this.selectedCourseId;
|
|
16610
16619
|
return x`
|
|
16611
|
-
|
|
16612
|
-
|
|
16613
|
-
|
|
16614
|
-
|
|
16615
|
-
|
|
16616
|
-
|
|
16617
|
-
|
|
16618
|
-
|
|
16620
|
+
<obi-course
|
|
16621
|
+
id=${course.id}
|
|
16622
|
+
name=${course.name}
|
|
16623
|
+
description=${course.description || ""}
|
|
16624
|
+
duration=${course.duration}
|
|
16625
|
+
order=${course.order || 0}
|
|
16626
|
+
?selected=${isSelected}
|
|
16627
|
+
></obi-course>
|
|
16628
|
+
`;
|
|
16619
16629
|
})}
|
|
16620
16630
|
</div>
|
|
16621
16631
|
`;
|
|
@@ -16734,7 +16744,8 @@ class CourseModal extends i$1 {
|
|
|
16734
16744
|
id: session.uuid,
|
|
16735
16745
|
name: session.onboarding_plan.name,
|
|
16736
16746
|
description: session.onboarding_plan.description,
|
|
16737
|
-
duration: session.onboarding_plan.duration
|
|
16747
|
+
duration: session.onboarding_plan.duration,
|
|
16748
|
+
order: session.onboarding_plan.order
|
|
16738
16749
|
};
|
|
16739
16750
|
});
|
|
16740
16751
|
const filteredCourses = mappedCourses.filter((course) => !!course.name);
|
|
@@ -16844,6 +16855,25 @@ class CourseModal extends i$1 {
|
|
|
16844
16855
|
Sessions are securely recorded for quality improvement purposes.
|
|
16845
16856
|
</p>
|
|
16846
16857
|
</div>
|
|
16858
|
+
<div class="powered-by-container">
|
|
16859
|
+
<a href="https://getcor.ai/" target="_blank" class="powered-by-link">
|
|
16860
|
+
<div style="display: flex; align-items: end; gap: 4px;">
|
|
16861
|
+
<p class="powered-by">Powered by</p>
|
|
16862
|
+
<svg
|
|
16863
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
16864
|
+
width="59"
|
|
16865
|
+
height="16"
|
|
16866
|
+
viewBox="0 0 59 16"
|
|
16867
|
+
fill="none"
|
|
16868
|
+
>
|
|
16869
|
+
<path
|
|
16870
|
+
d="M43.1777 3.86914C46.7404 3.86914 48.9042 6.57952 48.9043 9.77051C48.9043 13.4206 46.7624 16 43.1777 16C39.5498 15.9998 37.4299 13.268 37.4297 9.90234C37.4297 6.40537 39.5714 3.86928 43.1777 3.86914ZM28.8398 0C30.7196 0 32.1619 0.852712 33.1455 1.98926L33.2988 1.07129C33.4518 0.481159 33.8017 0.28418 34.2607 0.28418C35.0036 0.284203 35.1345 0.459008 35.2656 1.11426L35.9658 4.93945C36.097 5.5733 35.9869 5.83598 35.4404 6.12012C34.8287 6.42584 34.4137 6.40382 34.0859 5.90137C32.4466 3.08185 30.9818 2.22949 29.0146 2.22949C25.9547 2.22959 24.2285 4.93988 24.2285 7.95605C24.2286 11.9994 26.6979 13.748 29.4082 13.748C31.5502 13.748 33.517 12.6986 34.5225 10.4912C34.8284 9.90123 35.2877 9.79169 35.834 10.0537C36.4241 10.316 36.4898 10.8626 36.2275 11.4746C35.2002 14.0974 32.7523 15.999 28.8398 15.999C24.0969 15.999 21.3428 12.4584 21.3428 8.30566C21.3428 3.49723 24.4684 5.99482e-05 28.8398 0ZM9.93945 0.0927734C10.9259 0.142615 11.7099 0.956225 11.71 1.95215C11.7098 2.97999 10.8746 3.81329 9.84375 3.81348H6.13086C4.88502 3.9007 3.88179 4.86388 3.73535 6.08887L3.73438 6.10059V9.94141L3.73535 9.9541C3.88896 11.2389 4.98549 12.2353 6.31543 12.2354H9.53613C10.971 12.2352 12.1338 11.0752 12.1338 9.64453V6.09766L12.1367 6.00195C12.1867 5.01847 13.0022 4.23648 14.001 4.23633C15.032 4.23637 15.8681 5.06962 15.8682 6.09766V9.95117L15.8662 10.043C15.8203 10.984 15.073 11.7415 14.1348 11.8076V11.8184C12.8383 11.9038 11.8024 12.9378 11.7168 14.2305H11.7051C11.6364 15.1959 10.8295 15.9578 9.84375 15.958H5.97852C4.94743 15.958 4.11137 15.1247 4.11133 14.0967C4.11133 14.0783 4.11177 14.0595 4.1123 14.041H4.10938C3.92516 12.8594 2.94081 11.9037 1.72559 11.8193V11.8076C0.76079 11.7355 3.38938e-05 10.9317 0 9.95117V6.09766L0.00195312 6.00488C0.0487124 5.05403 0.811457 4.29096 1.76367 4.23926C2.96095 4.13852 3.92677 3.20977 4.10938 2.04102L4.1123 2.02148V2.00293C4.11188 1.9871 4.11133 1.97019 4.11133 1.95215C4.11137 0.924114 4.94744 0.0908305 5.97852 0.0908203H9.84375L9.93945 0.0927734ZM57.3926 4.00684C58.0264 4.00684 58.4639 4.42303 58.4639 5.10059C58.4636 6.17112 57.6773 6.54308 56.541 7.00195C55.2296 7.54837 54.4202 8.26929 54.0049 9.14355V12.8809C54.0049 13.5803 54.2454 13.887 55.6006 14.2148C56.2126 14.4116 56.3438 14.5862 56.3438 15.0889C56.3437 15.5696 56.1687 15.7881 55.666 15.7881H50.5518C50.071 15.7881 49.8956 15.5914 49.8955 15.0889C49.8955 14.6299 50.0055 14.433 50.4863 14.2363C51.2949 13.9085 51.5566 13.5805 51.5566 12.8594V7.72266C51.5566 6.82676 51.4256 6.62971 50.3984 6.23633C49.9834 6.06155 49.8955 5.95228 49.8955 5.53711C49.8955 5.16578 50.0051 5.01258 50.3545 4.90332L52.5625 4.13867C53.4805 3.85454 53.9395 4.02928 53.9395 4.94727V7.02344C54.901 5.23148 56.4308 4.00723 57.3926 4.00684ZM42.8506 5.94629C40.9053 5.94629 39.8994 7.38883 39.8994 9.44336C39.8996 11.6725 41.1016 13.9236 43.5273 13.9238C45.1011 13.9238 46.457 12.7867 46.457 10.4043C46.4569 8.17514 45.189 5.94655 42.8506 5.94629Z"
|
|
16871
|
+
fill="#18181B"
|
|
16872
|
+
/>
|
|
16873
|
+
</svg>
|
|
16874
|
+
</div>
|
|
16875
|
+
</a>
|
|
16876
|
+
</div>
|
|
16847
16877
|
</div>
|
|
16848
16878
|
`;
|
|
16849
16879
|
}
|
|
@@ -17067,6 +17097,34 @@ CourseModal.styles = i$4`
|
|
|
17067
17097
|
height: 20px;
|
|
17068
17098
|
width: 80%;
|
|
17069
17099
|
}
|
|
17100
|
+
|
|
17101
|
+
.powered-by-container {
|
|
17102
|
+
position: absolute;
|
|
17103
|
+
bottom: 32px;
|
|
17104
|
+
right: 32px;
|
|
17105
|
+
display: flex;
|
|
17106
|
+
flex-direction: row;
|
|
17107
|
+
align-items: end;
|
|
17108
|
+
justify-content: center;
|
|
17109
|
+
gap: 4px;
|
|
17110
|
+
z-index: 10;
|
|
17111
|
+
}
|
|
17112
|
+
|
|
17113
|
+
.powered-by-link {
|
|
17114
|
+
text-decoration: none;
|
|
17115
|
+
}
|
|
17116
|
+
|
|
17117
|
+
.powered-by {
|
|
17118
|
+
color: #18181b;
|
|
17119
|
+
text-align: center;
|
|
17120
|
+
font-family: "Satoshi", sans-serif;
|
|
17121
|
+
font-size: 12px;
|
|
17122
|
+
font-style: normal;
|
|
17123
|
+
font-weight: 400;
|
|
17124
|
+
line-height: 100%;
|
|
17125
|
+
letter-spacing: -0.12px;
|
|
17126
|
+
margin: 0;
|
|
17127
|
+
}
|
|
17070
17128
|
`;
|
|
17071
17129
|
__decorateClass$4([
|
|
17072
17130
|
n$2({ type: Array })
|
|
@@ -18534,7 +18592,7 @@ class ObiWidget extends i$1 {
|
|
|
18534
18592
|
const updatedConfig = customEvent.detail;
|
|
18535
18593
|
const needsInit = updatedConfig.isActive && !this.isActive;
|
|
18536
18594
|
this.updateFromConfig();
|
|
18537
|
-
if (needsInit && !isCurrentUrlBlacklisted(this.urlBlacklist)) {
|
|
18595
|
+
if (needsInit && !isCurrentUrlBlacklisted(this.urlBlacklist) && !this.activeSession) {
|
|
18538
18596
|
this.sessionConnectionCheck();
|
|
18539
18597
|
}
|
|
18540
18598
|
this.requestUpdate();
|
|
@@ -18666,7 +18724,7 @@ class ObiWidget extends i$1 {
|
|
|
18666
18724
|
const primaryColor = windowConfig?.primaryColor || dbConfig?.primaryColor || OBI_PRIMARY_COLOR;
|
|
18667
18725
|
this.style.setProperty("--obi-primary", primaryColor);
|
|
18668
18726
|
this.generateColorVariables(primaryColor);
|
|
18669
|
-
if (this.isActive && !isCurrentUrlBlacklisted(this.urlBlacklist)) {
|
|
18727
|
+
if (this.isActive && !isCurrentUrlBlacklisted(this.urlBlacklist) && !this.activeSession) {
|
|
18670
18728
|
this.sessionConnectionCheck();
|
|
18671
18729
|
}
|
|
18672
18730
|
}
|
|
@@ -18967,4 +19025,4 @@ export {
|
|
|
18967
19025
|
withSentryAsyncHandler as w,
|
|
18968
19026
|
x
|
|
18969
19027
|
};
|
|
18970
|
-
//# sourceMappingURL=obi-widget-
|
|
19028
|
+
//# sourceMappingURL=obi-widget-33113e44.js.map
|