@learnpack/learnpack 5.0.234 → 5.0.240
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 +7 -2
- package/lib/commands/publish.d.ts +1 -1
- package/lib/commands/publish.js +5 -4
- package/lib/commands/serve.d.ts +2 -4
- package/lib/commands/serve.js +79 -116
- package/lib/creatorDist/assets/{index-CFK5bQP2.js → index-DJn8b8wj.js} +8168 -8115
- package/lib/creatorDist/index.html +1 -1
- package/lib/utils/api.d.ts +1 -0
- package/lib/utils/api.js +1 -0
- package/lib/utils/rigoActions.d.ts +6 -1
- package/lib/utils/rigoActions.js +19 -2
- package/package.json +2 -2
- package/src/commands/init.ts +12 -2
- package/src/commands/publish.ts +12 -4
- package/src/commands/serve.ts +114 -181
- package/src/creator/src/App.tsx +67 -62
- package/src/creator/src/components/LessonItem.tsx +9 -3
- package/src/creator/src/components/NotificationListener.tsx +32 -0
- package/src/creator/src/components/syllabus/SyllabusEditor.tsx +42 -44
- package/src/creator/src/utils/creatorUtils.ts +2 -2
- package/src/creator/src/utils/rigo.ts +12 -3
- package/src/creator/src/utils/store.ts +13 -2
- package/src/creatorDist/assets/{index-CFK5bQP2.js → index-DJn8b8wj.js} +8168 -8115
- package/src/creatorDist/index.html +1 -1
- package/src/ui/_app/app.css +1 -1
- package/src/ui/_app/app.js +131 -131
- package/src/ui/app.tar.gz +0 -0
- package/src/utils/api.ts +2 -0
- package/src/utils/configBuilder.ts +1 -2
- package/src/utils/rigoActions.ts +32 -1
package/src/ui/app.tar.gz
CHANGED
Binary file
|
package/src/utils/api.ts
CHANGED
@@ -426,6 +426,7 @@ type TAssetMissing = {
|
|
426
426
|
owner: number
|
427
427
|
author: number
|
428
428
|
preview: string
|
429
|
+
readme_raw: string
|
429
430
|
}
|
430
431
|
|
431
432
|
export const createAsset = async (token: string, asset: TAssetMissing) => {
|
@@ -454,6 +455,7 @@ export const createAsset = async (token: string, asset: TAssetMissing) => {
|
|
454
455
|
translations: [asset.lang],
|
455
456
|
learnpack_deploy_url: asset.learnpack_deploy_url,
|
456
457
|
technologies: asset.technologies,
|
458
|
+
readme_raw: asset.readme_raw,
|
457
459
|
}
|
458
460
|
const url = `https://breathecode.herokuapp.com/v1/registry/asset/me`
|
459
461
|
const headers = {
|
@@ -43,8 +43,7 @@ export async function buildConfig(
|
|
43
43
|
const map: Record<string, Omit<Exercise, "position">> = {}
|
44
44
|
for (const file of files) {
|
45
45
|
const parts = file.name.split("/")
|
46
|
-
if (!parts.includes("exercises"))
|
47
|
-
continue
|
46
|
+
if (!parts.includes("exercises")) continue
|
48
47
|
|
49
48
|
const slug = parts[parts.indexOf("exercises") + 1]
|
50
49
|
if (!map[slug]) {
|
package/src/utils/rigoActions.ts
CHANGED
@@ -72,17 +72,21 @@ export const hasCreatorPermission = async (token: string) => {
|
|
72
72
|
|
73
73
|
type TGenerateImageParams = {
|
74
74
|
prompt: string
|
75
|
+
callbackUrl: string
|
75
76
|
}
|
76
77
|
|
77
78
|
export const generateImage = async (
|
78
79
|
token: string,
|
79
|
-
{ prompt }: TGenerateImageParams
|
80
|
+
{ prompt, callbackUrl }: TGenerateImageParams
|
80
81
|
) => {
|
81
82
|
try {
|
82
83
|
const response = await axios.post(
|
83
84
|
`${RIGOBOT_HOST}/v1/learnpack/tools/images`,
|
84
85
|
{
|
85
86
|
prompt,
|
87
|
+
webhook_callback_url: callbackUrl,
|
88
|
+
provider: "bfl",
|
89
|
+
model: "flux-pro-1.1",
|
86
90
|
},
|
87
91
|
{
|
88
92
|
headers: {
|
@@ -299,6 +303,33 @@ export const readmeCreator = async (
|
|
299
303
|
throw new Error("Invalid kind of lesson")
|
300
304
|
}
|
301
305
|
|
306
|
+
type TCreateStructuredPreviewReadmeInputs = {
|
307
|
+
tutorial_info: string
|
308
|
+
}
|
309
|
+
|
310
|
+
export const createStructuredPreviewReadme = async (
|
311
|
+
token: string,
|
312
|
+
inputs: TCreateStructuredPreviewReadmeInputs,
|
313
|
+
webhookUrl?: string
|
314
|
+
) => {
|
315
|
+
const response = await axios.post(
|
316
|
+
`${RIGOBOT_HOST}/v1/prompting/completion/write-course-introduction-readme/`,
|
317
|
+
{
|
318
|
+
inputs: inputs,
|
319
|
+
include_purpose_objective: false,
|
320
|
+
webhook_url: webhookUrl,
|
321
|
+
},
|
322
|
+
{
|
323
|
+
headers: {
|
324
|
+
"Content-Type": "application/json",
|
325
|
+
Authorization: "Token " + token,
|
326
|
+
},
|
327
|
+
}
|
328
|
+
)
|
329
|
+
|
330
|
+
return response.data
|
331
|
+
}
|
332
|
+
|
302
333
|
export async function createPreviewReadme(
|
303
334
|
tutorialDir: string,
|
304
335
|
packageInfo: PackageInfo,
|