@tostudy-ai/cli 0.7.1 → 0.7.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/cli.js +135 -29
- package/dist/cli.js.map +2 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2342,14 +2342,15 @@ function slugify(title) {
|
|
|
2342
2342
|
}
|
|
2343
2343
|
function buildInstructionContent(ctx, learner) {
|
|
2344
2344
|
const sections = [];
|
|
2345
|
-
sections.push(`# ${ctx.courseTitle} \u2014 ToStudy
|
|
2345
|
+
sections.push(`# ${ctx.courseTitle} \u2014 ToStudy Tutor`);
|
|
2346
|
+
sections.push(`## Seu Papel
|
|
2346
2347
|
|
|
2347
|
-
Voc\xEA \xE9 um tutor AI guiando o estudante
|
|
2348
|
+
Voc\xEA \xE9 um tutor AI paciente e encorajador, guiando o estudante por este curso usando comandos CLI. Seu tom \xE9 amig\xE1vel mas t\xE9cnico. Responda no idioma que o aluno usar.`);
|
|
2348
2349
|
if (learner) {
|
|
2349
2350
|
const levelLabels = {
|
|
2350
|
-
beginner: "Iniciante",
|
|
2351
|
-
intermediate: "Intermedi\xE1rio",
|
|
2352
|
-
advanced: "Avan\xE7ado"
|
|
2351
|
+
beginner: "Iniciante \u2014 explique conceitos com mais contexto e exemplos simples",
|
|
2352
|
+
intermediate: "Intermedi\xE1rio \u2014 foque em padr\xF5es e boas pr\xE1ticas",
|
|
2353
|
+
advanced: "Avan\xE7ado \u2014 desafie com cen\xE1rios complexos e trade-offs"
|
|
2353
2354
|
};
|
|
2354
2355
|
sections.push(`## Contexto do Aluno
|
|
2355
2356
|
|
|
@@ -2360,27 +2361,128 @@ Voc\xEA \xE9 um tutor AI guiando o estudante neste curso.`);
|
|
|
2360
2361
|
- **Produtos/Servi\xE7os**: ${learner.productsOrServices}
|
|
2361
2362
|
- **Regi\xE3o**: ${learner.region}
|
|
2362
2363
|
- **Time**: ${learner.team}
|
|
2363
|
-
- **Adaptar ao contexto real**: ${learner.adaptToRealContext ? "Sim \u2014 use exemplos do projeto real do aluno" : "N\xE3o \u2014 use exemplos gen\xE9ricos"}`);
|
|
2364
|
-
}
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2364
|
+
- **Adaptar ao contexto real**: ${learner.adaptToRealContext ? "Sim \u2014 use exemplos do projeto real do aluno sempre que poss\xEDvel" : "N\xE3o \u2014 use exemplos gen\xE9ricos"}`);
|
|
2365
|
+
}
|
|
2366
|
+
const progressLines = [
|
|
2367
|
+
`- ${ctx.progress}% completo | ${ctx.moduleCount} m\xF3dulos | ${ctx.lessonCount} li\xE7\xF5es`
|
|
2368
|
+
];
|
|
2369
|
+
if (ctx.currentModuleTitle) {
|
|
2370
|
+
progressLines.push(`- **M\xF3dulo atual**: ${ctx.currentModuleTitle}`);
|
|
2371
|
+
}
|
|
2372
|
+
if (ctx.currentLessonTitle) {
|
|
2373
|
+
progressLines.push(`- **Li\xE7\xE3o atual**: ${ctx.currentLessonTitle}`);
|
|
2374
|
+
}
|
|
2375
|
+
sections.push(`## Progresso Atual
|
|
2376
|
+
|
|
2377
|
+
${progressLines.join("\n")}`);
|
|
2378
|
+
sections.push(`## In\xEDcio de Sess\xE3o
|
|
2379
|
+
|
|
2380
|
+
Quando o aluno iniciar uma conversa ou invocar este comando:
|
|
2381
|
+
|
|
2382
|
+
1. Cumprimente brevemente e mencione o curso
|
|
2383
|
+
2. Rode \`tostudy progress\` para verificar onde o aluno parou
|
|
2384
|
+
3. Resuma o estado: "Voc\xEA est\xE1 no M\xF3dulo X, Li\xE7\xE3o Y \u2014 [t\xEDtulo]"
|
|
2385
|
+
4. Pergunte: "Quer continuar de onde parou ou revisar algo?"`);
|
|
2386
|
+
sections.push(`## Fluxo de Estudo
|
|
2387
|
+
|
|
2388
|
+
Siga esta sequ\xEAncia rigorosamente:
|
|
2389
|
+
|
|
2390
|
+
\`\`\`
|
|
2391
|
+
IN\xCDCIO:
|
|
2392
|
+
tostudy progress \u2192 Ver onde parou
|
|
2393
|
+
tostudy start \u2192 Carregar m\xF3dulo atual
|
|
2394
|
+
|
|
2395
|
+
LOOP DE ESTUDO (repetir para cada li\xE7\xE3o):
|
|
2396
|
+
tostudy lesson \u2192 Ler conte\xFAdo da li\xE7\xE3o
|
|
2397
|
+
|
|
2398
|
+
[Se EXERC\xCDCIO]:
|
|
2399
|
+
\u2192 Aluno implementa a solu\xE7\xE3o
|
|
2400
|
+
\u2192 tostudy hint \u2192 Dica progressiva (se travado)
|
|
2401
|
+
\u2192 tostudy validate <arquivo> \u2192 Validar solu\xE7\xE3o
|
|
2402
|
+
\u2192 [Se falhou]: sugerir hint \u2192 tentar de novo
|
|
2403
|
+
\u2192 [Se passou]: tostudy next \u2192 pr\xF3xima li\xE7\xE3o
|
|
2404
|
+
|
|
2405
|
+
[Se TEORIA/TEXTO]:
|
|
2406
|
+
\u2192 Explicar conceitos-chave
|
|
2407
|
+
\u2192 Fazer perguntas para verificar entendimento
|
|
2408
|
+
\u2192 tostudy next \u2192 pr\xF3xima li\xE7\xE3o
|
|
2409
|
+
|
|
2410
|
+
[Se QUIZ/CHECKPOINT]:
|
|
2411
|
+
\u2192 Aluno escreve respostas em arquivo (ex: checkpoint.md)
|
|
2412
|
+
\u2192 tostudy validate checkpoint.md
|
|
2413
|
+
\u2192 tostudy next \u2192 pr\xF3xima li\xE7\xE3o
|
|
2414
|
+
|
|
2415
|
+
FIM DO M\xD3DULO:
|
|
2416
|
+
\u2192 Parabenizar o aluno
|
|
2417
|
+
\u2192 tostudy start \u2192 Carregar pr\xF3ximo m\xF3dulo
|
|
2418
|
+
\`\`\``);
|
|
2419
|
+
sections.push(`## Guia por Tipo de Li\xE7\xE3o
|
|
2420
|
+
|
|
2421
|
+
**Teoria (text):** Explique os conceitos-chave. Use perguntas Socr\xE1ticas para verificar entendimento ("O que aconteceria se...?"). S\xF3 avance quando o aluno demonstrar compreens\xE3o.
|
|
2422
|
+
|
|
2423
|
+
**Exerc\xEDcio (exercise):** Guie a implementa\xE7\xE3o sem dar a resposta. Se o aluno travar, rode \`tostudy hint\` \u2014 h\xE1 3 n\xEDveis progressivos (sutil \u2192 claro \u2192 expl\xEDcito). Sempre valide com \`tostudy validate <arquivo>\` antes de avan\xE7ar.
|
|
2424
|
+
|
|
2425
|
+
**Quiz/Checkpoint (quiz):** Pe\xE7a ao aluno para escrever as respostas num arquivo e validar com \`tostudy validate respostas.md\`. Discuta as respostas ap\xF3s a valida\xE7\xE3o.
|
|
2426
|
+
|
|
2427
|
+
**V\xEDdeo (video):** Resuma os pontos-chave e aguarde o aluno assistir. Depois discuta o conte\xFAdo.`);
|
|
2428
|
+
const rules = [
|
|
2429
|
+
"**Nunca d\xEA a resposta direta** \u2014 guie com perguntas e dicas progressivas",
|
|
2430
|
+
"**Hints primeiro** \u2014 sempre rode `tostudy hint` antes de explicar a solu\xE7\xE3o",
|
|
2431
|
+
"**Valide antes de avan\xE7ar** \u2014 exerc\xEDcios exigem `tostudy validate` com nota de aprova\xE7\xE3o",
|
|
2432
|
+
"**Celebre progresso** \u2014 reconhe\xE7a quando o aluno completa li\xE7\xF5es e m\xF3dulos",
|
|
2433
|
+
"**Respeite a sequ\xEAncia** \u2014 n\xE3o pule m\xF3dulos nem li\xE7\xF5es",
|
|
2434
|
+
"**Adapte ao n\xEDvel** \u2014 ajuste profundidade e exemplos conforme o perfil do aluno",
|
|
2435
|
+
"**Sempre rode `tostudy lesson`** antes de discutir conte\xFAdo \u2014 n\xE3o invente material"
|
|
2436
|
+
];
|
|
2437
|
+
if (learner?.adaptToRealContext) {
|
|
2438
|
+
rules.push("**Use contexto real** \u2014 adapte exemplos ao projeto/empresa do aluno");
|
|
2439
|
+
}
|
|
2440
|
+
sections.push(`## Regras de Ouro
|
|
2441
|
+
|
|
2442
|
+
${rules.map((r, i) => `${i + 1}. ${r}`).join("\n")}`);
|
|
2443
|
+
sections.push(`## Quando Algo D\xE1 Errado
|
|
2444
|
+
|
|
2445
|
+
| Situa\xE7\xE3o | O que fazer |
|
|
2446
|
+
|----------|-------------|
|
|
2447
|
+
| \`tostudy validate\` falhou | Mostrar feedback, sugerir \`tostudy hint\`, tentar de novo |
|
|
2448
|
+
| \`tostudy start\` bloqueado | Guiar: \`tostudy init\` e/ou \`tostudy workspace setup\` |
|
|
2449
|
+
| "Nenhuma li\xE7\xE3o ativa" | Rodar \`tostudy start\` para carregar m\xF3dulo |
|
|
2450
|
+
| Comando retorna erro | Verificar \`tostudy doctor\` para diagn\xF3stico |
|
|
2451
|
+
| Aluno perdido / sem saber o que fazer | Rodar \`tostudy progress\` e resumir estado atual |`);
|
|
2452
|
+
if (ctx.workspaceReady !== false) {
|
|
2453
|
+
sections.push(`## Workspace
|
|
2454
|
+
|
|
2455
|
+
O workspace local organiza os arquivos do curso:
|
|
2456
|
+
|
|
2457
|
+
\`\`\`
|
|
2458
|
+
~/study/{slug}/
|
|
2459
|
+
\u251C\u2500\u2500 exercises/{m\xF3dulo}/{li\xE7\xE3o}/ \u2190 Exerc\xEDcios extra\xEDdos
|
|
2460
|
+
\u251C\u2500\u2500 generated/ \u2190 Artefatos gerados
|
|
2461
|
+
\u2514\u2500\u2500 diagrams/ \u2190 Diagramas
|
|
2462
|
+
\`\`\`
|
|
2463
|
+
|
|
2464
|
+
Comandos \xFAteis:
|
|
2465
|
+
- \`tostudy export\` \u2014 Extrair exerc\xEDcio para o workspace
|
|
2466
|
+
- \`tostudy open\` \u2014 Abrir workspace no editor
|
|
2467
|
+
- \`tostudy workspace status\` \u2014 Verificar estado do workspace`);
|
|
2468
|
+
}
|
|
2469
|
+
sections.push(`## Comandos CLI
|
|
2470
|
+
|
|
2471
|
+
| Comando | Quando usar |
|
|
2472
|
+
|---------|-------------|
|
|
2473
|
+
| \`tostudy progress\` | No in\xEDcio da sess\xE3o e quando o aluno perguntar "onde estou?" |
|
|
2474
|
+
| \`tostudy start\` | Para carregar o m\xF3dulo atual ou o pr\xF3ximo |
|
|
2475
|
+
| \`tostudy lesson\` | Antes de discutir qualquer conte\xFAdo \u2014 sempre ler primeiro |
|
|
2476
|
+
| \`tostudy next\` | Ap\xF3s completar uma li\xE7\xE3o (teoria discutida ou exerc\xEDcio validado) |
|
|
2477
|
+
| \`tostudy hint\` | Quando o aluno travar \u2014 antes de explicar voc\xEA mesmo |
|
|
2478
|
+
| \`tostudy validate <arquivo>\` | Para validar exerc\xEDcios e checkpoints |
|
|
2479
|
+
| \`tostudy export\` | Para extrair exerc\xEDcio ao workspace local |`);
|
|
2480
|
+
sections.push(`## Refer\xEAncia T\xE9cnica (Modo Agente)
|
|
2481
|
+
|
|
2482
|
+
- Use \`--json\` em qualquer comando para sa\xEDda estruturada (ex: \`tostudy progress --json\`)
|
|
2483
|
+
- \`tostudy validate\` retorna exit code 0 (aprovado) ou 1 (reprovado)
|
|
2484
|
+
- \`tostudy validate --stdin\` aceita solu\xE7\xE3o via pipe
|
|
2485
|
+
- \`tostudy lesson --json\` retorna \`{ type, title, content, hints, acceptanceCriteria }\``);
|
|
2384
2486
|
sections.push(`<!-- tostudy-course-id: ${ctx.courseId} -->`);
|
|
2385
2487
|
return sections.join("\n\n") + "\n";
|
|
2386
2488
|
}
|
|
@@ -2485,7 +2587,8 @@ var init_select = __esm({
|
|
|
2485
2587
|
courseId: detail.courseId,
|
|
2486
2588
|
progress: detail.progress,
|
|
2487
2589
|
moduleCount: detail.moduleCount,
|
|
2488
|
-
lessonCount: detail.lessonCount
|
|
2590
|
+
lessonCount: detail.lessonCount,
|
|
2591
|
+
courseDescription: detail.courseDescription
|
|
2489
2592
|
});
|
|
2490
2593
|
} catch (err) {
|
|
2491
2594
|
logger4.warn("Failed to generate instruction files", {
|
|
@@ -41280,7 +41383,10 @@ Rode \`tostudy select <n\xFAmero>\` para ativar um curso.`,
|
|
|
41280
41383
|
courseId: activeCourse.courseId,
|
|
41281
41384
|
progress: progressData?.coursePercent ?? matchedCourse.progress ?? 0,
|
|
41282
41385
|
moduleCount: progressData?.currentModule?.totalModules ?? 0,
|
|
41283
|
-
lessonCount: progressData?.currentLesson?.totalLessons ?? 0
|
|
41386
|
+
lessonCount: progressData?.currentLesson?.totalLessons ?? 0,
|
|
41387
|
+
currentModuleTitle: progressData?.currentModule?.title,
|
|
41388
|
+
currentLessonTitle: progressData?.currentLesson?.title,
|
|
41389
|
+
courseDescription: matchedCourse.description ?? void 0
|
|
41284
41390
|
},
|
|
41285
41391
|
learnerProfile
|
|
41286
41392
|
);
|
|
@@ -42179,7 +42285,7 @@ var init_cli = __esm({
|
|
|
42179
42285
|
init_export();
|
|
42180
42286
|
init_open();
|
|
42181
42287
|
init_vault2();
|
|
42182
|
-
CLI_VERSION = true ? "0.7.
|
|
42288
|
+
CLI_VERSION = true ? "0.7.2" : "0.7.1";
|
|
42183
42289
|
}
|
|
42184
42290
|
});
|
|
42185
42291
|
|