@tostudy-ai/cli 0.16.6 → 0.16.7
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 +16 -14
- package/dist/cli.js.map +2 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3383,7 +3383,7 @@ var CLI_VERSION;
|
|
|
3383
3383
|
var init_version = __esm({
|
|
3384
3384
|
"src/version.ts"() {
|
|
3385
3385
|
"use strict";
|
|
3386
|
-
CLI_VERSION = true ? "0.16.
|
|
3386
|
+
CLI_VERSION = true ? "0.16.7" : "0.7.1";
|
|
3387
3387
|
}
|
|
3388
3388
|
});
|
|
3389
3389
|
|
|
@@ -3853,11 +3853,11 @@ import { stdin as processStdin, stdout as processStdout } from "node:process";
|
|
|
3853
3853
|
function composeBriefFromAnswers(answers) {
|
|
3854
3854
|
const levelLabel = {
|
|
3855
3855
|
beginner: "iniciante",
|
|
3856
|
-
intermediate: "
|
|
3857
|
-
advanced: "
|
|
3856
|
+
intermediate: "intermedi\xE1rio",
|
|
3857
|
+
advanced: "avan\xE7ado"
|
|
3858
3858
|
}[answers.yourLevel];
|
|
3859
3859
|
const paragraphOne = [answers.whoYouAre, answers.whereYouWork, answers.whatYouDo].map((s) => s.trim()).filter(Boolean).join(". ");
|
|
3860
|
-
const paragraphTwo = `Meu
|
|
3860
|
+
const paragraphTwo = `Meu n\xEDvel neste assunto \xE9 ${levelLabel}. ${answers.yourGoals.trim()}`;
|
|
3861
3861
|
const paragraphThree = `Contexto real do meu dia a dia: ${answers.realContext.trim()}`;
|
|
3862
3862
|
const text = [paragraphOne, paragraphTwo, paragraphThree].map((p) => p.replace(/\.\.+/g, ".")).join("\n\n");
|
|
3863
3863
|
return text.slice(0, 5e3);
|
|
@@ -3870,7 +3870,7 @@ async function askNonEmpty(question, deps) {
|
|
|
3870
3870
|
}
|
|
3871
3871
|
async function askLevel(deps) {
|
|
3872
3872
|
while (true) {
|
|
3873
|
-
const raw = (await deps.ask(" Seu
|
|
3873
|
+
const raw = (await deps.ask(" Seu n\xEDvel geral neste assunto (beginner/intermediate/advanced): ")).trim().toLowerCase();
|
|
3874
3874
|
if (raw === "beginner" || raw === "intermediate" || raw === "advanced") {
|
|
3875
3875
|
return raw;
|
|
3876
3876
|
}
|
|
@@ -3880,15 +3880,15 @@ async function collectBootstrapAnswersWithDeps(input2, deps) {
|
|
|
3880
3880
|
deps.write(
|
|
3881
3881
|
[
|
|
3882
3882
|
"",
|
|
3883
|
-
`
|
|
3884
|
-
"Ele ajuda o tutor a te conhecer para adaptar o ensino a
|
|
3885
|
-
"
|
|
3883
|
+
`Ol\xE1 ${input2.userName}, vamos criar seu brief base (1-2 minutos).`,
|
|
3884
|
+
"Ele ajuda o tutor a te conhecer para adaptar o ensino a voc\xEA.",
|
|
3885
|
+
"Voc\xEA pode editar depois em https://tostudy.ai/student/settings/learner-brief.",
|
|
3886
3886
|
""
|
|
3887
3887
|
].join("\n")
|
|
3888
3888
|
);
|
|
3889
|
-
const whoYouAre = await askNonEmpty(" Quem
|
|
3889
|
+
const whoYouAre = await askNonEmpty(" Quem voc\xEA \xE9 (profiss\xE3o/cargo/\xE1rea): ", deps);
|
|
3890
3890
|
const whereYouWork = await askNonEmpty(" Onde trabalha (empresa/setor): ", deps);
|
|
3891
|
-
const whatYouDo = await askNonEmpty(" O que
|
|
3891
|
+
const whatYouDo = await askNonEmpty(" O que voc\xEA faz (responsabilidades/projetos): ", deps);
|
|
3892
3892
|
const yourLevel = await askLevel(deps);
|
|
3893
3893
|
const yourGoals = await askNonEmpty(" Seu objetivo de aprendizado: ", deps);
|
|
3894
3894
|
const realContext = await askNonEmpty(
|
|
@@ -21586,7 +21586,7 @@ var init_brief = __esm({
|
|
|
21586
21586
|
}
|
|
21587
21587
|
if (!remote) {
|
|
21588
21588
|
const lines2 = [
|
|
21589
|
-
"
|
|
21589
|
+
"Voc\xEA ainda n\xE3o tem um brief base preenchido.",
|
|
21590
21590
|
"Para criar: `tostudy brief-create` (terminal) ou `tostudy brief-open` (portal web)."
|
|
21591
21591
|
];
|
|
21592
21592
|
output(lines2.join("\n"), { json: false });
|
|
@@ -21594,7 +21594,7 @@ var init_brief = __esm({
|
|
|
21594
21594
|
}
|
|
21595
21595
|
const lines = [`Brief base (atualizado em ${remote.updatedAt}):`, "", remote.text, ""];
|
|
21596
21596
|
if (cached2 && cached2.brief && cached2.brief.updatedAt !== remote.updatedAt) {
|
|
21597
|
-
lines.push("Aviso: cache local
|
|
21597
|
+
lines.push("Aviso: cache local est\xE1 desatualizado. Rode `tostudy sync` para atualizar.");
|
|
21598
21598
|
}
|
|
21599
21599
|
output(lines.join("\n"), { json: false });
|
|
21600
21600
|
} catch (err) {
|
|
@@ -23072,10 +23072,12 @@ if (!process.env.LOG_LEVEL) {
|
|
|
23072
23072
|
var MIN_NODE_MAJOR = 18;
|
|
23073
23073
|
var nodeMajor = Number.parseInt(process.versions.node.split(".")[0] ?? "0", 10);
|
|
23074
23074
|
if (Number.isFinite(nodeMajor) && nodeMajor < MIN_NODE_MAJOR) {
|
|
23075
|
-
const
|
|
23075
|
+
const localeFlagIdx = process.argv.indexOf("--locale");
|
|
23076
|
+
const localeFlag = localeFlagIdx !== -1 && localeFlagIdx + 1 < process.argv.length ? process.argv[localeFlagIdx + 1] : void 0;
|
|
23077
|
+
const pt = localeFlag === "pt-BR" || localeFlag === "en-US" ? localeFlag === "pt-BR" : !(process.env["LANG"] ?? "").toLowerCase().startsWith("en");
|
|
23076
23078
|
process.stderr.write(
|
|
23077
23079
|
pt ? `Erro: o ToStudy CLI precisa do Node.js ${MIN_NODE_MAJOR} ou superior.
|
|
23078
|
-
|
|
23080
|
+
Voc\xEA est\xE1 no Node.js ${process.versions.node}.
|
|
23079
23081
|
Atualize em https://nodejs.org e rode o comando de novo.
|
|
23080
23082
|
` : `Error: the ToStudy CLI requires Node.js ${MIN_NODE_MAJOR} or newer.
|
|
23081
23083
|
You are on Node.js ${process.versions.node}.
|