@learnpack/learnpack 5.0.291 → 5.0.293
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/lib/commands/init.js +42 -42
- package/lib/commands/serve.js +492 -33
- package/lib/creatorDist/assets/{index-C39zeF3W.css → index-CacFtcN8.css} +31 -0
- package/lib/creatorDist/assets/{index-wLKEQIG6.js → index-DOEfLGDQ.js} +1424 -1372
- package/lib/creatorDist/index.html +2 -2
- package/lib/models/creator.d.ts +4 -0
- package/lib/utils/api.d.ts +1 -1
- package/lib/utils/api.js +2 -1
- package/lib/utils/rigoActions.d.ts +14 -0
- package/lib/utils/rigoActions.js +43 -1
- package/package.json +1 -1
- package/src/commands/init.ts +655 -650
- package/src/commands/serve.ts +794 -48
- package/src/creator/src/App.tsx +12 -12
- package/src/creator/src/components/FileUploader.tsx +2 -68
- package/src/creator/src/components/LessonItem.tsx +47 -8
- package/src/creator/src/components/Login.tsx +0 -6
- package/src/creator/src/components/syllabus/ContentIndex.tsx +11 -0
- package/src/creator/src/components/syllabus/SyllabusEditor.tsx +6 -1
- package/src/creator/src/index.css +227 -217
- package/src/creator/src/locales/en.json +3 -3
- package/src/creator/src/locales/es.json +3 -3
- package/src/creator/src/utils/lib.ts +470 -468
- package/src/creator/src/utils/rigo.ts +85 -85
- package/src/creatorDist/assets/{index-C39zeF3W.css → index-CacFtcN8.css} +31 -0
- package/src/creatorDist/assets/{index-wLKEQIG6.js → index-DOEfLGDQ.js} +1424 -1372
- package/src/creatorDist/index.html +2 -2
- package/src/models/creator.ts +2 -0
- package/src/ui/_app/app.css +1 -1
- package/src/ui/_app/app.js +363 -361
- package/src/ui/app.tar.gz +0 -0
- package/src/utils/api.ts +2 -1
- package/src/utils/rigoActions.ts +73 -0
@@ -1,85 +1,85 @@
|
|
1
|
-
import toast from "react-hot-toast";
|
2
|
-
import { RIGOBOT_HOST, DEV_MODE } from "./constants";
|
3
|
-
import axios, { AxiosError } from "axios";
|
4
|
-
import { randomUUID } from "./creatorUtils";
|
5
|
-
|
6
|
-
type TInteractiveCreationInputs = {
|
7
|
-
courseInfo: string;
|
8
|
-
prevInteractions: string;
|
9
|
-
};
|
10
|
-
|
11
|
-
export const publicInteractiveCreation = async (
|
12
|
-
inputs: TInteractiveCreationInputs,
|
13
|
-
token: string,
|
14
|
-
purposeSlug: string,
|
15
|
-
publicRequest: boolean = true
|
16
|
-
): Promise<any | null> => {
|
17
|
-
try {
|
18
|
-
const randomUID = randomUUID(15);
|
19
|
-
const webhookUrl = `${
|
20
|
-
DEV_MODE
|
21
|
-
? "https://1gm40gnb-3000.use2.devtunnels.ms"
|
22
|
-
: window.location.
|
23
|
-
|
24
|
-
}/notifications/${randomUID}`;
|
25
|
-
|
26
|
-
console.log("WEBHOOK URL to send to Rigo", webhookUrl);
|
27
|
-
|
28
|
-
const response = await axios.post(
|
29
|
-
`${RIGOBOT_HOST}/v1/prompting${
|
30
|
-
publicRequest ? "/public" : ""
|
31
|
-
}/completion/${DEV_MODE ? "39" : "390"}/`,
|
32
|
-
{
|
33
|
-
inputs: inputs,
|
34
|
-
include_purpose_objective: true,
|
35
|
-
purpose_slug: purposeSlug,
|
36
|
-
webhook_url: webhookUrl,
|
37
|
-
},
|
38
|
-
{
|
39
|
-
headers: {
|
40
|
-
"Content-Type": "application/json",
|
41
|
-
Authorization: `Token ${token}`,
|
42
|
-
},
|
43
|
-
}
|
44
|
-
);
|
45
|
-
|
46
|
-
return { res: response.data, notificationId: randomUID };
|
47
|
-
} catch (error: unknown) {
|
48
|
-
const err = error as AxiosError;
|
49
|
-
console.log("error trying to create course", err);
|
50
|
-
|
51
|
-
if (err.response?.status === 403) {
|
52
|
-
toast.error("You've reached the limit. Please log in to continue.");
|
53
|
-
} else {
|
54
|
-
toast.error("Something went wrong while generating the course.");
|
55
|
-
}
|
56
|
-
|
57
|
-
return null;
|
58
|
-
}
|
59
|
-
};
|
60
|
-
|
61
|
-
export const isHuman = async (token: string) => {
|
62
|
-
try {
|
63
|
-
const body = {
|
64
|
-
access_token: token,
|
65
|
-
};
|
66
|
-
const response = await axios.post(
|
67
|
-
`${RIGOBOT_HOST}/v1/auth/verify/humanity`,
|
68
|
-
body,
|
69
|
-
{
|
70
|
-
headers: {
|
71
|
-
"Content-Type": "application/json",
|
72
|
-
},
|
73
|
-
}
|
74
|
-
);
|
75
|
-
|
76
|
-
return {
|
77
|
-
human: response.status === 200,
|
78
|
-
message: response.data.message,
|
79
|
-
token: response.data.public_access_token,
|
80
|
-
};
|
81
|
-
} catch (error) {
|
82
|
-
console.error(error);
|
83
|
-
return { human: false, message: error, token: null };
|
84
|
-
}
|
85
|
-
};
|
1
|
+
import toast from "react-hot-toast";
|
2
|
+
import { RIGOBOT_HOST, DEV_MODE } from "./constants";
|
3
|
+
import axios, { AxiosError } from "axios";
|
4
|
+
import { randomUUID } from "./creatorUtils";
|
5
|
+
|
6
|
+
type TInteractiveCreationInputs = {
|
7
|
+
courseInfo: string;
|
8
|
+
prevInteractions: string;
|
9
|
+
};
|
10
|
+
|
11
|
+
export const publicInteractiveCreation = async (
|
12
|
+
inputs: TInteractiveCreationInputs,
|
13
|
+
token: string,
|
14
|
+
purposeSlug: string,
|
15
|
+
publicRequest: boolean = true
|
16
|
+
): Promise<any | null> => {
|
17
|
+
try {
|
18
|
+
const randomUID = randomUUID(15);
|
19
|
+
const webhookUrl = `${
|
20
|
+
DEV_MODE
|
21
|
+
? "https://1gm40gnb-3000.use2.devtunnels.ms"
|
22
|
+
: // : window.location.orPigin
|
23
|
+
"https://1gm40gnb-3000.use2.devtunnels.ms"
|
24
|
+
}/notifications/${randomUID}`;
|
25
|
+
|
26
|
+
console.log("WEBHOOK URL to send to Rigo", webhookUrl);
|
27
|
+
|
28
|
+
const response = await axios.post(
|
29
|
+
`${RIGOBOT_HOST}/v1/prompting${
|
30
|
+
publicRequest ? "/public" : ""
|
31
|
+
}/completion/${DEV_MODE ? "39" : "390"}/`,
|
32
|
+
{
|
33
|
+
inputs: inputs,
|
34
|
+
include_purpose_objective: true,
|
35
|
+
purpose_slug: purposeSlug,
|
36
|
+
webhook_url: webhookUrl,
|
37
|
+
},
|
38
|
+
{
|
39
|
+
headers: {
|
40
|
+
"Content-Type": "application/json",
|
41
|
+
Authorization: `Token ${token}`,
|
42
|
+
},
|
43
|
+
}
|
44
|
+
);
|
45
|
+
|
46
|
+
return { res: response.data, notificationId: randomUID };
|
47
|
+
} catch (error: unknown) {
|
48
|
+
const err = error as AxiosError;
|
49
|
+
console.log("error trying to create course", err);
|
50
|
+
|
51
|
+
if (err.response?.status === 403) {
|
52
|
+
toast.error("You've reached the limit. Please log in to continue.");
|
53
|
+
} else {
|
54
|
+
toast.error("Something went wrong while generating the course.");
|
55
|
+
}
|
56
|
+
|
57
|
+
return null;
|
58
|
+
}
|
59
|
+
};
|
60
|
+
|
61
|
+
export const isHuman = async (token: string) => {
|
62
|
+
try {
|
63
|
+
const body = {
|
64
|
+
access_token: token,
|
65
|
+
};
|
66
|
+
const response = await axios.post(
|
67
|
+
`${RIGOBOT_HOST}/v1/auth/verify/humanity`,
|
68
|
+
body,
|
69
|
+
{
|
70
|
+
headers: {
|
71
|
+
"Content-Type": "application/json",
|
72
|
+
},
|
73
|
+
}
|
74
|
+
);
|
75
|
+
|
76
|
+
return {
|
77
|
+
human: response.status === 200,
|
78
|
+
message: response.data.message,
|
79
|
+
token: response.data.public_access_token,
|
80
|
+
};
|
81
|
+
} catch (error) {
|
82
|
+
console.error(error);
|
83
|
+
return { human: false, message: error, token: null };
|
84
|
+
}
|
85
|
+
};
|
@@ -59,6 +59,10 @@
|
|
59
59
|
--color-red-500: oklch(63.7% 0.237 25.331);
|
60
60
|
--color-red-600: oklch(57.7% 0.245 27.325);
|
61
61
|
--color-red-700: oklch(50.5% 0.213 27.518);
|
62
|
+
--color-yellow-50: oklch(98.7% 0.026 102.212);
|
63
|
+
--color-yellow-300: oklch(90.5% 0.182 98.111);
|
64
|
+
--color-yellow-600: oklch(68.1% 0.162 75.834);
|
65
|
+
--color-yellow-700: oklch(55.4% 0.135 66.442);
|
62
66
|
--color-blue-50: oklch(97% 0.014 254.604);
|
63
67
|
--color-blue-100: oklch(93.2% 0.032 255.585);
|
64
68
|
--color-blue-200: oklch(88.2% 0.059 254.128);
|
@@ -827,6 +831,9 @@
|
|
827
831
|
.border-transparent {
|
828
832
|
border-color: #0000;
|
829
833
|
}
|
834
|
+
.border-yellow-300 {
|
835
|
+
border-color: var(--color-yellow-300);
|
836
|
+
}
|
830
837
|
.border-t-transparent {
|
831
838
|
border-top-color: #0000;
|
832
839
|
}
|
@@ -893,6 +900,9 @@
|
|
893
900
|
.bg-white {
|
894
901
|
background-color: var(--color-white);
|
895
902
|
}
|
903
|
+
.bg-yellow-50 {
|
904
|
+
background-color: var(--color-yellow-50);
|
905
|
+
}
|
896
906
|
.bg-gradient-to-t {
|
897
907
|
--tw-gradient-position: to top in oklab;
|
898
908
|
background-image: linear-gradient(var(--tw-gradient-stops));
|
@@ -1046,6 +1056,9 @@
|
|
1046
1056
|
.text-blue-900 {
|
1047
1057
|
color: var(--color-blue-900);
|
1048
1058
|
}
|
1059
|
+
.text-gray-300 {
|
1060
|
+
color: var(--color-gray-300);
|
1061
|
+
}
|
1049
1062
|
.text-gray-400 {
|
1050
1063
|
color: var(--color-gray-400);
|
1051
1064
|
}
|
@@ -1070,6 +1083,9 @@
|
|
1070
1083
|
.text-white {
|
1071
1084
|
color: var(--color-white);
|
1072
1085
|
}
|
1086
|
+
.text-yellow-600 {
|
1087
|
+
color: var(--color-yellow-600);
|
1088
|
+
}
|
1073
1089
|
.uppercase {
|
1074
1090
|
text-transform: uppercase;
|
1075
1091
|
}
|
@@ -1191,6 +1207,12 @@
|
|
1191
1207
|
.hover\:text-red-700:hover {
|
1192
1208
|
color: var(--color-red-700);
|
1193
1209
|
}
|
1210
|
+
.hover\:text-yellow-600:hover {
|
1211
|
+
color: var(--color-yellow-600);
|
1212
|
+
}
|
1213
|
+
.hover\:text-yellow-700:hover {
|
1214
|
+
color: var(--color-yellow-700);
|
1215
|
+
}
|
1194
1216
|
.hover\:shadow-lg:hover {
|
1195
1217
|
--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, #0000001a),
|
1196
1218
|
0 4px 6px -4px var(--tw-shadow-color, #0000001a);
|
@@ -1458,6 +1480,15 @@ body {
|
|
1458
1480
|
transform: translateY(0);
|
1459
1481
|
}
|
1460
1482
|
}
|
1483
|
+
.yellow-ball {
|
1484
|
+
background-color: #08f700;
|
1485
|
+
border-radius: 50%;
|
1486
|
+
width: 16px;
|
1487
|
+
height: 16px;
|
1488
|
+
position: absolute;
|
1489
|
+
top: -10px;
|
1490
|
+
left: 10px;
|
1491
|
+
}
|
1461
1492
|
@property --tw-translate-x {
|
1462
1493
|
syntax: "*";
|
1463
1494
|
inherits: false;
|