@tostudy-ai/cli 0.16.6 → 0.16.8

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 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.6" : "0.7.1";
3386
+ CLI_VERSION = true ? "0.16.8" : "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: "intermediario",
3857
- advanced: "avancado"
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 nivel neste assunto e ${levelLabel}. ${answers.yourGoals.trim()}`;
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 nivel geral neste assunto (beginner/intermediate/advanced): ")).trim().toLowerCase();
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
- `Ola ${input2.userName}, vamos criar seu brief base (1-2 minutos).`,
3884
- "Ele ajuda o tutor a te conhecer para adaptar o ensino a voce.",
3885
- "Voce pode editar depois em https://tostudy.ai/student/settings/learner-brief.",
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 voce e (profissao/cargo/area): ", deps);
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 voce faz (responsabilidades/projetos): ", deps);
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(
@@ -20204,8 +20204,8 @@ async function collectLearnerContextProfileWithDeps(input2, deps) {
20204
20204
  `- Regiao: ${existingProfile.region}`,
20205
20205
  `- Equipe: ${existingProfile.team}`,
20206
20206
  `- Objetivo: ${existingProfile.goal}`,
20207
- `- Nivel: ${existingProfile.learnerLevel}`,
20208
- `- Contexto real: ${existingProfile.adaptToRealContext ? "sim" : "nao"}`,
20207
+ `- N\xEDvel: ${existingProfile.learnerLevel}`,
20208
+ `- Contexto real: ${existingProfile.adaptToRealContext ? "sim" : "n\xE3o"}`,
20209
20209
  ""
20210
20210
  ].join("\n")
20211
20211
  );
@@ -20248,7 +20248,7 @@ async function collectLearnerContextProfileWithDeps(input2, deps) {
20248
20248
  baseProfile?.goal
20249
20249
  );
20250
20250
  const learnerLevel = action === "keep" && baseProfile ? baseProfile.learnerLevel : await askChoice(
20251
- baseProfile ? `Nivel do aluno (beginner/intermediate/advanced) [${baseProfile.learnerLevel}]: ` : "Nivel do aluno (beginner/intermediate/advanced): ",
20251
+ baseProfile ? `N\xEDvel do aluno (beginner/intermediate/advanced) [${baseProfile.learnerLevel}]: ` : "N\xEDvel do aluno (beginner/intermediate/advanced): ",
20252
20252
  ["beginner", "intermediate", "advanced"],
20253
20253
  deps,
20254
20254
  baseProfile?.learnerLevel
@@ -20294,7 +20294,7 @@ function isCompleteProfile(flags) {
20294
20294
  async function runInit(deps = defaultDeps4, flags = {}) {
20295
20295
  const session = await deps.getSession();
20296
20296
  if (!session) {
20297
- deps.output("Nao autenticado. Rode `tostudy login` para comecar.", { json: false });
20297
+ deps.output("N\xE3o autenticado. Rode `tostudy login` para come\xE7ar.", { json: false });
20298
20298
  return;
20299
20299
  }
20300
20300
  const data = deps.createHttpProvider(session.apiUrl, session.token);
@@ -21586,7 +21586,7 @@ var init_brief = __esm({
21586
21586
  }
21587
21587
  if (!remote) {
21588
21588
  const lines2 = [
21589
- "Voce ainda nao tem um brief base preenchido.",
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 esta desatualizado. Rode `tostudy sync` para atualizar.");
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) {
@@ -21668,7 +21668,7 @@ function openUrl(url2) {
21668
21668
  }
21669
21669
  execFile4(cmd, args, (err) => {
21670
21670
  if (err) {
21671
- output(`Nao consegui abrir o navegador. Acesse manualmente: ${url2}`, { json: false });
21671
+ output(`N\xE3o consegui abrir o navegador. Acesse manualmente: ${url2}`, { json: false });
21672
21672
  }
21673
21673
  });
21674
21674
  }
@@ -21761,10 +21761,10 @@ var init_compact = __esm({
21761
21761
  const summary = fs19.readFileSync("/dev/stdin", "utf-8").trim();
21762
21762
  if (!summary) {
21763
21763
  if (opts.json) jsonError("empty_summary", { message: "Summary vazio" });
21764
- error("Summary vazio. Envie o conteudo via stdin.");
21764
+ error("Summary vazio. Envie o conte\xFAdo via stdin.");
21765
21765
  }
21766
21766
  const moduleId = opts.moduleId ?? activeCourse.currentModuleId ?? "unknown";
21767
- const moduleTitle = opts.moduleTitle ?? `Modulo ${moduleId}`;
21767
+ const moduleTitle = opts.moduleTitle ?? `M\xF3dulo ${moduleId}`;
21768
21768
  const filePath = await saveModuleSummary(ws.workspacePath, {
21769
21769
  moduleId,
21770
21770
  moduleTitle,
@@ -21834,7 +21834,7 @@ var init_context = __esm({
21834
21834
  } else {
21835
21835
  output(`Workspace: ${ws.workspacePath}`, { json: false });
21836
21836
  output(`Curso: ${ws.state.courseTitle}`, { json: false });
21837
- output(`Modulos resumidos: ${sessionCtx.moduleSummaries.length}`, { json: false });
21837
+ output(`M\xF3dulos resumidos: ${sessionCtx.moduleSummaries.length}`, { json: false });
21838
21838
  }
21839
21839
  } catch (err) {
21840
21840
  const msg = err instanceof Error ? err.message : String(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 pt = !(process.env["LANG"] ?? "").toLowerCase().startsWith("en");
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
- Voce esta no Node.js ${process.versions.node}.
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}.