chofex-cli 0.1.202 → 0.1.206

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.
Files changed (3) hide show
  1. package/README.md +45 -40
  2. package/dist/index.js +499 -359
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -59516,7 +59516,7 @@ var jwtExpiry = (token) => {
59516
59516
  };
59517
59517
  var refresh = async (credentials) => {
59518
59518
  if (!credentials.refreshToken) {
59519
- throw new Error("Session expired. Run `chofex login` again.");
59519
+ throw new Error("Session expired. Run `andes login` again.");
59520
59520
  }
59521
59521
  const body = await tokenRequest({
59522
59522
  grant_type: "refresh_token",
@@ -59533,7 +59533,7 @@ var authentication = async (forceRefresh = false) => {
59533
59533
  }
59534
59534
  const credentials = await readCredentials();
59535
59535
  if (!credentials)
59536
- throw new Error("Not logged in. Run `chofex login`.");
59536
+ throw new Error("Not logged in. Run `andes login`.");
59537
59537
  if (forceRefresh || credentials.expiresAt !== undefined && credentials.expiresAt <= Date.now() + 30000) {
59538
59538
  return await refresh(credentials);
59539
59539
  }
@@ -59560,7 +59560,7 @@ var openBrowser = (url2) => {
59560
59560
  };
59561
59561
  var assertInteractiveLogin = (interactive = process.stdin.isTTY === true) => {
59562
59562
  if (!interactive) {
59563
- throw new Error("OAuth login requires an interactive terminal. Run `chofex login` yourself in a local terminal and leave it open until the browser confirms login.");
59563
+ throw new Error("OAuth login requires an interactive terminal. Run `andes login` yourself in a local terminal and leave it open until the browser confirms login.");
59564
59564
  }
59565
59565
  };
59566
59566
  var login = async () => {
@@ -59715,7 +59715,7 @@ var authenticationRecoveryMessage = (code, message) => {
59715
59715
  return message;
59716
59716
  if (message !== "Authentication failed")
59717
59717
  return message;
59718
- return `${message}. If login just succeeded, update the CLI with \`chofex update\` or \`npm install --global chofex-cli@latest\`, then run \`chofex logout\` and \`chofex login\`.`;
59718
+ return `${message}. If login just succeeded, update the CLI with \`andes update\` or \`npm install --global hacktheandes-cli@latest\`, then run \`andes logout\` and \`andes login\`.`;
59719
59719
  };
59720
59720
  var endpoint = (apiUrl, path4) => `${apiUrl.replace(/\/$/, "")}${path4}`;
59721
59721
  var resolveAuthentication = (suppliedToken, campaignAttribution, authenticate, forceRefresh = false) => {
@@ -59986,9 +59986,9 @@ var challengeListText = (catalog) => {
59986
59986
  }
59987
59987
  const hasOpenChallenge = catalog.challenges.some((challenge) => challenge.open && challenge.playable);
59988
59988
  if (hasOpenChallenge) {
59989
- lines2.push("Empieza el challenge abierto: chofex challenge");
59989
+ lines2.push("Empieza el challenge abierto: andes challenge");
59990
59990
  } else {
59991
- lines2.push("No hay un challenge abierto. Los rankings finales siguen visibles.");
59991
+ lines2.push("No hay un challenge abierto. Los rankings finales siguen visibles.", "Siguiente comando para consultar tu postulación: andes status");
59992
59992
  }
59993
59993
  return lines2.join(`
59994
59994
  `);
@@ -60023,7 +60023,11 @@ var challengeShowText = (attempt) => {
60023
60023
  if (progress.shareCode)
60024
60024
  lines3.push(`Código #${progress.shareCode}`);
60025
60025
  }
60026
- lines3.push("", "SIGUIENTE PASO", "Lee el contrato. Antes de editar, discute tres trazas de falla y elige cuál investigar primero.", " cd broken-agent && npm test", " chofex challenge test --challenge broken-agent --source ./scheduler.js");
60026
+ if (attempt.latestEvaluation || challenge.closed || evaluationsRemaining <= 0) {
60027
+ lines3.push("", "Consulta el estado de tu postulación y tu siguiente paso:", " andes status");
60028
+ } else {
60029
+ lines3.push("", "SIGUIENTE PASO", "Desde la carpeta broken-agent, lee el contrato, repara scheduler.js y ejecuta los tests públicos:", " andes challenge test --challenge broken-agent --source ./scheduler.js", "Después prepara review.json con tu revisión y envía una evaluación oficial:", " andes challenge evaluate --challenge broken-agent --source ./scheduler.js --review ./review.json", "Abre personalmente el enlace de aprobación y repite el mismo comando. Los tests públicos por sí solos no completan el challenge.");
60030
+ }
60027
60031
  return lines3.join(`
60028
60032
  `);
60029
60033
  }
@@ -60063,17 +60067,17 @@ var challengeShowText = (attempt) => {
60063
60067
  lines2.push(`Share code #${progress.shareCode}`);
60064
60068
  }
60065
60069
  if (challenge.closed) {
60066
- lines2.push("", "SIGUIENTE PASO", "Revisa tu historial y el ranking final.", " chofex challenge notebook", " chofex challenge ranking");
60070
+ lines2.push("", "SIGUIENTE PASO", "Revisa tu historial y el ranking final.", " andes challenge notebook", " andes challenge ranking");
60067
60071
  return lines2.join(`
60068
60072
  `);
60069
60073
  }
60070
60074
  lines2.push("", "YOUR NEXT MOVE");
60071
60075
  if (attempt.observations.length === 0) {
60072
- lines2.push("Ask the machine to price one ordinary shipment.", " chofex challenge query");
60076
+ lines2.push("Ask the machine to price one ordinary shipment.", " andes challenge query");
60073
60077
  } else if (attempt.latestEvaluation === undefined) {
60074
- lines2.push("Run controlled experiments, study the notebook, then test your model.", " chofex challenge query", " chofex challenge notebook", " chofex challenge init", " chofex challenge test --source ./shipping.js");
60078
+ lines2.push("Run controlled experiments, study the notebook, then test your model.", " andes challenge query", " andes challenge notebook", " andes challenge init", " andes challenge test --source ./shipping.js");
60075
60079
  } else {
60076
- lines2.push("Inspect your rank, then use remaining attempts only after improving your model.", " chofex challenge ranking", " chofex challenge test --source ./shipping.js");
60080
+ lines2.push("Inspect your rank, then use remaining attempts only after improving your model.", " andes challenge ranking", " andes challenge test --source ./shipping.js");
60077
60081
  }
60078
60082
  return lines2.join(`
60079
60083
  `);
@@ -60089,11 +60093,11 @@ var challengeQueryText = (result3) => {
60089
60093
  ""
60090
60094
  ];
60091
60095
  if (result3.queriesRemaining > 0) {
60092
- lines2.push("Next experiment", "Change one variable at a time. Keep the others fixed so the output difference means something.", " chofex challenge query", "");
60096
+ lines2.push("Next experiment", "Change one variable at a time. Keep the others fixed so the output difference means something.", " andes challenge query", "");
60093
60097
  } else {
60094
60098
  lines2.push("The oracle is now silent. Your notebook contains all the evidence you will get.", "");
60095
60099
  }
60096
- lines2.push("Review your evidence", " chofex challenge notebook", " chofex challenge notebook --format csv > observations.csv");
60100
+ lines2.push("Review your evidence", " andes challenge notebook", " andes challenge notebook --format csv > observations.csv");
60097
60101
  return lines2.join(`
60098
60102
  `);
60099
60103
  };
@@ -60124,7 +60128,7 @@ var notebookTableText = (observations, challengeClosed = false) => {
60124
60128
  "CASE FILE: no observations",
60125
60129
  "El challenge está cerrado. Revisa el ranking final.",
60126
60130
  "",
60127
- "Siguiente: chofex challenge ranking"
60131
+ "Siguiente: andes challenge ranking"
60128
60132
  ].join(`
60129
60133
  `);
60130
60134
  }
@@ -60132,7 +60136,7 @@ var notebookTableText = (observations, challengeClosed = false) => {
60132
60136
  "CASE FILE: no observations yet",
60133
60137
  "The machine has not revealed anything. Start with one ordinary shipment.",
60134
60138
  "",
60135
- "Next: chofex challenge query"
60139
+ "Next: andes challenge query"
60136
60140
  ].join(`
60137
60141
  `);
60138
60142
  }
@@ -60162,16 +60166,16 @@ var notebookTableText = (observations, challengeClosed = false) => {
60162
60166
  });
60163
60167
  const lines2 = [`CASE FILE: ${observationLabel}`, "", header, ...rows, ""];
60164
60168
  if (challengeClosed) {
60165
- lines2.push("El challenge está cerrado. Este cuaderno queda disponible como historial.", "Siguiente: chofex challenge ranking");
60169
+ lines2.push("El challenge está cerrado. Este cuaderno queda disponible como historial.", "Siguiente: andes challenge ranking");
60166
60170
  return lines2.join(`
60167
60171
  `);
60168
60172
  }
60169
60173
  if (observations.length === 1) {
60170
- lines2.push("One answer is a clue, not a rule.", "Next: run a controlled experiment. Change one field and keep the other four fixed.", " chofex challenge query", "");
60174
+ lines2.push("One answer is a clue, not a rule.", "Next: run a controlled experiment. Change one field and keep the other four fixed.", " andes challenge query", "");
60171
60175
  } else {
60172
- lines2.push("Look for thresholds, fixed surcharges, and interactions between fields.", "Next: test a hypothesis with a controlled query, or encode it in your solution.", " chofex challenge query", "");
60176
+ lines2.push("Look for thresholds, fixed surcharges, and interactions between fields.", "Next: test a hypothesis with a controlled query, or encode it in your solution.", " andes challenge query", "");
60173
60177
  }
60174
- lines2.push("Prepare your replacement", " chofex challenge init", " chofex challenge test --source ./shipping.js");
60178
+ lines2.push("Prepare your replacement", " andes challenge init", " andes challenge test --source ./shipping.js");
60175
60179
  return lines2.join(`
60176
60180
  `);
60177
60181
  };
@@ -60199,7 +60203,7 @@ var challengeTestText = (result3) => {
60199
60203
  `${result3.matchedObservations} / ${result3.observationCount} comportamientos visibles pasan`
60200
60204
  ];
60201
60205
  if (result3.accuracy === 1) {
60202
- lines3.push("", "Todo pasa.", "Eso todavía no significa que el scheduler sea correcto en producción.", "Antes de evaluar, el participante debe revisar la evidencia y tomar la decisión de release.", "", "Siguiente: discutan una traza de falla concreta y creen review.json con las palabras del participante.", "Luego usa una evaluación oficial solo si su decisión lo permite", " chofex challenge evaluate --challenge broken-agent --source ./scheduler.js --review ./review.json");
60206
+ lines3.push("", "Todo pasa.", "Eso todavía no significa que el scheduler sea correcto en producción.", "Antes de evaluar, el participante debe revisar la evidencia y tomar la decisión de release.", "", "Siguiente: discutan una traza de falla concreta y creen review.json con las palabras del participante.", "Luego usa una evaluación oficial solo si su decisión lo permite", " andes challenge evaluate --challenge broken-agent --source ./scheduler.js --review ./review.json");
60203
60207
  return lines3.join(`
60204
60208
  `);
60205
60209
  }
@@ -60209,7 +60213,7 @@ var challengeTestText = (result3) => {
60209
60213
  lines3.push(` ${String(mismatch.actual)}`);
60210
60214
  }
60211
60215
  }
60212
- lines3.push("", "Corrige las regresiones públicas antes de usar una evaluación oficial.");
60216
+ lines3.push("", "Corrige las regresiones públicas antes de usar una evaluación oficial.", "Siguiente comando: andes challenge test --challenge broken-agent --source ./scheduler.js");
60213
60217
  return lines3.join(`
60214
60218
  `);
60215
60219
  }
@@ -60231,9 +60235,9 @@ var challengeTestText = (result3) => {
60231
60235
  }
60232
60236
  }
60233
60237
  if (result3.accuracy === 1) {
60234
- lines2.push("", "Your model explains the notebook. That is necessary, but hidden cases may expose missing rules.", "Next: evaluate only when your experiments cover meaningful boundaries", " chofex challenge evaluate --source ./shipping.js");
60238
+ lines2.push("", "Your model explains the notebook. That is necessary, but hidden cases may expose missing rules.", "Next: evaluate only when your experiments cover meaningful boundaries", " andes challenge evaluate --source ./shipping.js");
60235
60239
  } else {
60236
- lines2.push("", "Next: edit shipping.js, explain the mismatches, and test again for free", " chofex challenge test --source ./shipping.js");
60240
+ lines2.push("", "Next: edit shipping.js, explain the mismatches, and test again for free", " andes challenge test --source ./shipping.js");
60237
60241
  }
60238
60242
  return lines2.join(`
60239
60243
  `);
@@ -60247,9 +60251,9 @@ var challengeEvaluateText = (result3) => {
60247
60251
  if (result3.rank !== undefined) {
60248
60252
  lines3.push(`Puesto #${result3.rank}`);
60249
60253
  }
60250
- lines3.push(`Evaluaciones oficiales restantes ${result3.evaluationsRemaining} / ${result3.evaluationsLimit}`, "", result3.shareText, "", "Siguiente: consulta el ranking", " chofex challenge ranking --challenge broken-agent");
60254
+ lines3.push(`Evaluaciones oficiales restantes ${result3.evaluationsRemaining} / ${result3.evaluationsLimit}`, "", result3.shareText, "", "Siguiente: consulta el ranking", " andes challenge ranking --challenge broken-agent");
60251
60255
  if (result3.evaluationsRemaining > 0) {
60252
- lines3.push("", "El veredicto es un solo puntaje. No dice qué caso falló. Razona antes de volver a enviar.", " chofex challenge test --challenge broken-agent --source ./scheduler.js");
60256
+ lines3.push("", "El veredicto es un solo puntaje. No dice qué caso falló. Razona antes de volver a enviar.", " andes challenge test --challenge broken-agent --source ./scheduler.js");
60253
60257
  }
60254
60258
  return lines3.join(`
60255
60259
  `);
@@ -60263,9 +60267,9 @@ var challengeEvaluateText = (result3) => {
60263
60267
  ];
60264
60268
  if (result3.rank !== undefined)
60265
60269
  lines2.push(`Rank #${result3.rank}`);
60266
- lines2.push(`Official evaluations remaining ${result3.evaluationsRemaining} / ${result3.evaluationsLimit}`, "", result3.shareText, "", "Next: inspect the leaderboard", " chofex challenge ranking");
60270
+ lines2.push(`Official evaluations remaining ${result3.evaluationsRemaining} / ${result3.evaluationsLimit}`, "", result3.shareText, "", "Next: inspect the leaderboard", " andes challenge ranking");
60267
60271
  if (result3.evaluationsRemaining > 0) {
60268
- lines2.push("", "Before spending another evaluation, improve and retest your model against the notebook.", " chofex challenge test --source ./shipping.js");
60272
+ lines2.push("", "Before spending another evaluation, improve and retest your model against the notebook.", " andes challenge test --source ./shipping.js");
60269
60273
  }
60270
60274
  return lines2.join(`
60271
60275
  `);
@@ -60274,13 +60278,13 @@ var challengeRankingText = (ranking, now3 = new Date) => {
60274
60278
  const lines2 = [`${ranking.challenge.theme} — ${ranking.challenge.title}`];
60275
60279
  const { rankingVisibleAt } = ranking.challenge;
60276
60280
  if (rankingVisibleAt && !isChallengeRankingVisibleAt(ranking.challenge, now3)) {
60277
- lines2.push("", `Ranking disponible ${formatChallengeOpeningInPeru(rankingVisibleAt)}.`);
60281
+ lines2.push("", `Ranking disponible ${formatChallengeOpeningInPeru(rankingVisibleAt)}.`, "Siguiente comando para consultar tu postulación: andes status");
60278
60282
  return lines2.join(`
60279
60283
  `);
60280
60284
  }
60281
60285
  lines2.push("");
60282
60286
  if (ranking.entries.length === 0) {
60283
- lines2.push("Todavía no hay evaluaciones oficiales.");
60287
+ lines2.push("Todavía no hay evaluaciones oficiales.", "Siguiente comando: andes");
60284
60288
  return lines2.join(`
60285
60289
  `);
60286
60290
  }
@@ -60294,6 +60298,7 @@ var challengeRankingText = (ranking, now3 = new Date) => {
60294
60298
  const participant = [entry.displayName, ...profileLinks].join(" ");
60295
60299
  lines2.push(`${rank} ${accuracy} ${points} ${participant}`);
60296
60300
  }
60301
+ lines2.push("", "El ranking no confirma tu aceptación. Consulta tu siguiente paso:", " andes status");
60297
60302
  return lines2.join(`
60298
60303
  `);
60299
60304
  }
@@ -60307,6 +60312,7 @@ var challengeRankingText = (ranking, now3 = new Date) => {
60307
60312
  const participant = [entry.displayName, ...profileLinks].join(" ");
60308
60313
  lines2.push(`${rank} ${accuracy} ${exact} ${queries} ${participant}`);
60309
60314
  }
60315
+ lines2.push("", "El ranking no confirma tu aceptación. Consulta tu siguiente paso:", " andes status");
60310
60316
  return lines2.join(`
60311
60317
  `);
60312
60318
  };
@@ -60324,9 +60330,9 @@ var registrationPartsText = (result3) => {
60324
60330
  lines2.push(` ${mark} ${part.title}${detail}`);
60325
60331
  }
60326
60332
  if (result3.requirements.canSubmitApplication) {
60327
- lines2.push("", "Ready to submit: chofex register");
60333
+ lines2.push("", "Ready to submit: andes register");
60328
60334
  } else if (result3.requirements.stage === "draft") {
60329
- lines2.push("", "Complete and submit with `chofex register`.");
60335
+ lines2.push("", "Complete and submit with `andes register`.");
60330
60336
  }
60331
60337
  return lines2.join(`
60332
60338
  `);
@@ -60509,8 +60515,8 @@ Repara \`scheduler.js\` sin cambiar la interfaz exportada
60509
60515
 
60510
60516
  \`\`\`sh
60511
60517
  npm test
60512
- chofex challenge test --challenge broken-agent --source ./scheduler.js
60513
- chofex challenge evaluate --challenge broken-agent --source ./scheduler.js --review ./review.json
60518
+ andes challenge test --challenge broken-agent --source ./scheduler.js
60519
+ andes challenge evaluate --challenge broken-agent --source ./scheduler.js --review ./review.json
60514
60520
  \`\`\`
60515
60521
 
60516
60522
  Los tests locales y públicos son ilimitados. Tienes **5 evaluaciones oficiales**
@@ -60833,6 +60839,7 @@ var createChallengeScaffold = exports_Effect.fn("createChallengeScaffold")(funct
60833
60839
  // src/metadata.ts
60834
60840
  import { readFileSync } from "node:fs";
60835
60841
  import { basename } from "node:path";
60842
+ var isStandaloneBuild = typeof CHOFEX_VERSION !== "undefined";
60836
60843
  var readMetadata = () => {
60837
60844
  if (typeof CHOFEX_VERSION !== "undefined") {
60838
60845
  return { name: "chofex-cli", version: CHOFEX_VERSION };
@@ -60845,7 +60852,11 @@ var readMetadata = () => {
60845
60852
  var metadata = readMetadata();
60846
60853
  var cliVersion = metadata.version;
60847
60854
  var cliPackageName = metadata.name;
60848
- var invokedAsAndes = /^andes(?:\.cmd|\.exe)?$/.test(basename(process.argv[1] ?? ""));
60855
+ var commandPath = process.argv[1] ?? "";
60856
+ if (isStandaloneBuild) {
60857
+ commandPath = process.argv0;
60858
+ }
60859
+ var invokedAsAndes = /^andes(?:\.cmd|\.exe)?$/.test(basename(commandPath));
60849
60860
  var cliCommandName = invokedAsAndes ? "andes" : "chofex";
60850
60861
 
60851
60862
  // src/cli-root.ts
@@ -60860,6 +60871,108 @@ var root = exports_Command.make(cliCommandName).pipe(exports_Command.withSharedF
60860
60871
  token: exports_Flag.string(rootValueFlagNames.token).pipe(exports_Flag.optional, exports_Flag.withDescription("Clerk OAuth token (prefer CHOFEX_TOKEN to avoid shell history)"))
60861
60872
  }), exports_Command.withDescription(`Apply to ${eventName} and compete for a seat through the mandatory technical challenges`));
60862
60873
 
60874
+ // src/participant-guidance.ts
60875
+ var nextStepFor = (result3) => {
60876
+ if (!result3) {
60877
+ return {
60878
+ kind: "register",
60879
+ message: "Completa y envía tu postulación. Después deberás completar un challenge con una evaluación oficial.",
60880
+ command: "andes register"
60881
+ };
60882
+ }
60883
+ const { registration, requirements } = result3;
60884
+ if (registration.status === "rejected" || registration.status === "withdrawn") {
60885
+ return {
60886
+ kind: "register",
60887
+ message: "Puedes enviar una nueva postulación.",
60888
+ command: "andes register"
60889
+ };
60890
+ }
60891
+ if (registration.status === "accepted") {
60892
+ if (requirements.stage === "complete") {
60893
+ return {
60894
+ kind: "badge",
60895
+ message: "Tu asistencia está confirmada. Generaremos tu carnet automáticamente. Consulta el resultado y comparte tu carnet.",
60896
+ command: "andes badge"
60897
+ };
60898
+ }
60899
+ return {
60900
+ kind: "confirm",
60901
+ message: "Tu postulación fue aceptada. Falta confirmar tu asistencia y completar tus datos de ingreso. Al terminar generaremos tu carnet automáticamente.",
60902
+ command: "andes confirm"
60903
+ };
60904
+ }
60905
+ if (requirements.stage === "draft") {
60906
+ return {
60907
+ kind: "register",
60908
+ message: "Tu postulación todavía es un borrador. Completa los datos y envíala.",
60909
+ command: "andes register"
60910
+ };
60911
+ }
60912
+ const evaluated = registration.challenges.find((challenge2) => challenge2.playable && challenge2.status === "evaluated");
60913
+ if (evaluated) {
60914
+ let message = "Tu evaluación oficial está registrada. Todavía falta la decisión sobre tu postulación. Te avisaremos por correo; también puedes consultar tu estado aquí.";
60915
+ if (registration.status === "waitlisted") {
60916
+ message = "Tu evaluación oficial está registrada y estás en lista de espera. Te avisaremos por correo si se libera un cupo.";
60917
+ }
60918
+ return { kind: "decision", message, command: "andes status" };
60919
+ }
60920
+ const available = registration.challenges.filter((challenge2) => challenge2.playable && challenge2.open && !challenge2.closed && challenge2.evaluationsUsed < challenge2.evaluationsLimit);
60921
+ const challenge = available.find((item) => item.status === "in_progress") ?? available[0];
60922
+ if (challenge) {
60923
+ if (challenge.status === "in_progress") {
60924
+ return {
60925
+ kind: "challenge_continue",
60926
+ challengeSlug: challenge.slug,
60927
+ message: `Tu postulación está enviada, pero falta completar ${challenge.theme} con una evaluación oficial. Revisa tu progreso y prepara el envío. Los tests públicos no completan este paso.`,
60928
+ command: `andes challenge show --challenge ${challenge.slug}`
60929
+ };
60930
+ }
60931
+ return {
60932
+ kind: "challenge_start",
60933
+ challengeSlug: challenge.slug,
60934
+ message: `Tu postulación está enviada, pero falta el challenge obligatorio. Empieza ${challenge.theme}, resuélvelo y envía una evaluación oficial para competir por un cupo.`,
60935
+ command: `andes challenge init --challenge ${challenge.slug}`
60936
+ };
60937
+ }
60938
+ return {
60939
+ kind: "challenge_unavailable",
60940
+ message: "Todavía necesitas una evaluación oficial para competir por un cupo, pero no hay un challenge abierto con evaluaciones disponibles. Consulta las fechas y los challenges disponibles.",
60941
+ command: "andes challenge list"
60942
+ };
60943
+ };
60944
+ var nextStepText = (step) => ["SIGUIENTE PASO", step.message, `Siguiente comando: ${step.command}`].join(`
60945
+ `);
60946
+ var withRegistrationNextStep = (operation) => operation.pipe(exports_Effect.map((response) => ({
60947
+ ...response,
60948
+ data: { ...response.data, nextStep: nextStepFor(response.data) }
60949
+ })));
60950
+ var loadParticipantGuidance = (client) => getRegistration(client).pipe(exports_Effect.map((response) => ({
60951
+ ...response,
60952
+ data: {
60953
+ registration: response.data,
60954
+ nextStep: nextStepFor(response.data)
60955
+ }
60956
+ })), exports_Effect.catch((error2) => {
60957
+ if (error2.code !== "REGISTRATION_NOT_FOUND" && error2.code !== "AUTHENTICATION_REQUIRED") {
60958
+ return exports_Effect.fail(error2);
60959
+ }
60960
+ let nextStep = nextStepFor();
60961
+ if (error2.code === "AUTHENTICATION_REQUIRED") {
60962
+ nextStep = {
60963
+ kind: "login",
60964
+ message: "Inicia sesión para consultar tu avance y continuar tu postulación.",
60965
+ command: "andes login"
60966
+ };
60967
+ }
60968
+ return exports_Effect.succeed({
60969
+ version: 1,
60970
+ ok: true,
60971
+ requestId: error2.requestId,
60972
+ data: { nextStep }
60973
+ });
60974
+ }));
60975
+
60863
60976
  // src/output.ts
60864
60977
  var printJson = (value3) => exports_Effect.sync(() => {
60865
60978
  process.stdout.write(`${JSON.stringify(value3)}
@@ -60924,74 +61037,69 @@ Request ID: ${error2.requestId}`);
60924
61037
  var registrationLookupErrorText = (error2) => {
60925
61038
  if (error2.code !== "REGISTRATION_NOT_FOUND")
60926
61039
  return;
60927
- return `No registration found.
60928
- Next command: chofex register`;
61040
+ return `Todavía no tienes una postulación.
61041
+ ${nextStepText(nextStepFor())}`;
60929
61042
  };
60930
61043
  var requirementsText = (result3) => {
60931
61044
  const { registration, requirements } = result3;
60932
- if (registration.status === "withdrawn") {
60933
- return "Application withdrawn. You may submit a new application.";
60934
- }
60935
- if (requirements.stage === "complete")
60936
- return "Attendance details: complete";
60937
- if (requirements.stage === "draft") {
60938
- return `Application draft in progress.${registrationPartsText(result3)}`;
60939
- }
60940
- if (requirements.stage === "review") {
60941
- return [
60942
- "Application received. A seat has not been assigned.",
60943
- result3.admission?.notice ?? challengeAdmissionNotice,
60944
- "Next command: chofex challenge"
60945
- ].join(`
60946
- `);
60947
- }
60948
- let feedback = "";
61045
+ const lines2 = [];
61046
+ if (requirements.stage === "draft")
61047
+ lines2.push(registrationPartsText(result3));
60949
61048
  const rejectionReason = requirements.rejectionReason ?? registration.rejectionReason;
60950
- if (rejectionReason) {
60951
- feedback = `
60952
- Review feedback: ${rejectionReason}`;
60953
- }
60954
- let nextCommand = "";
60955
- if (requirements.stage === "accepted") {
60956
- nextCommand = `
60957
- Next command: chofex confirm`;
60958
- }
60959
- let missing2 = "";
61049
+ if (rejectionReason)
61050
+ lines2.push(`Comentario del equipo: ${rejectionReason}`);
60960
61051
  if (requirements.missing.length > 0) {
60961
61052
  const items = requirements.missing.map((item) => ` - ${item.field}: ${item.reason}`).join(`
60962
61053
  `);
60963
- missing2 = `
60964
- Still required:
60965
- ${items}`;
61054
+ lines2.push(`Datos pendientes:
61055
+ ${items}`);
60966
61056
  }
60967
- return `Next stage: ${requirements.stage}${feedback}${missing2}${nextCommand}`;
61057
+ lines2.push(nextStepText(nextStepFor(result3)));
61058
+ return lines2.join(`
61059
+
61060
+ `);
61061
+ };
61062
+ var statusLabels = {
61063
+ draft: "Borrador",
61064
+ submitted: "Postulación enviada",
61065
+ under_review: "En revisión",
61066
+ waitlisted: "En lista de espera",
61067
+ accepted: "Aceptada",
61068
+ rejected: "No aceptada",
61069
+ withdrawn: "Retirada"
60968
61070
  };
60969
61071
  var registrationText = (result3) => [
60970
- `Registration: ${result3.registration.id}`,
60971
- `Participant: ${result3.registration.firstName} ${result3.registration.lastName}`,
60972
- `Status: ${result3.registration.status}`,
61072
+ `Postulación: ${result3.registration.id}`,
61073
+ `Participante: ${result3.registration.firstName} ${result3.registration.lastName}`,
61074
+ `Estado: ${statusLabels[result3.registration.status]}`,
60973
61075
  requirementsText(result3)
60974
61076
  ].join(`
60975
61077
  `);
60976
61078
  var createdText = (result3) => {
60977
- if (result3.registration.status !== "submitted") {
60978
- return ["Application draft saved.", registrationText(result3)].join(`
61079
+ if (result3.registration.status === "draft") {
61080
+ return ["Borrador guardado.", registrationText(result3)].join(`
60979
61081
  `);
60980
61082
  }
60981
- return ["Application submitted successfully.", registrationText(result3)].join(`
61083
+ return ["Postulación enviada.", registrationText(result3)].join(`
60982
61084
  `);
60983
61085
  };
60984
61086
  var requirementsOnlyText = (result3) => requirementsText(result3);
60985
61087
  var badgeText = (result3) => {
60986
- if (result3.url)
60987
- return result3.url;
61088
+ if (result3.status === "completed" && result3.url)
61089
+ return `Tu carnet está listo:
61090
+ ${result3.url}
61091
+
61092
+ Compártelo en LinkedIn o Instagram.
61093
+ Para personalizarlo: andes badge regenerate`;
60988
61094
  if (result3.status === "pending" || result3.status === "running") {
60989
- return "Tu carnet se está generando.";
61095
+ return `Tu carnet se está generando. Espera unos minutos y consulta de nuevo.
61096
+ Siguiente comando: andes badge`;
60990
61097
  }
60991
61098
  if (result3.status === "failed") {
60992
- return "No se pudo generar tu carnet. Ejecuta `chofex badge regenerate` para intentarlo de nuevo.";
61099
+ return "No se pudo generar tu carnet. Ejecuta `andes badge regenerate` para intentarlo de nuevo.";
60993
61100
  }
60994
- return "Todavía no tienes un carnet.";
61101
+ return `Todavía no tienes un carnet. Consulta qué paso te falta completar.
61102
+ Siguiente comando: andes status`;
60995
61103
  };
60996
61104
 
60997
61105
  // src/challenge-commands.ts
@@ -61014,13 +61122,13 @@ var challengeQuickstart = {
61014
61122
  {
61015
61123
  step: 1,
61016
61124
  action: "Inicia sesión",
61017
- command: "chofex login",
61125
+ command: "andes login",
61018
61126
  note: "Abre la autenticación de Clerk en tu navegador."
61019
61127
  },
61020
61128
  {
61021
61129
  step: 2,
61022
61130
  action: "Crea el repositorio del challenge",
61023
- command: "chofex challenge init --challenge broken-agent",
61131
+ command: "andes challenge init --challenge broken-agent",
61024
61132
  note: "Crea broken-agent/ con el contrato, el scheduler y siete tests públicos sin sobrescribir trabajo existente."
61025
61133
  },
61026
61134
  {
@@ -61032,7 +61140,7 @@ var challengeQuickstart = {
61032
61140
  {
61033
61141
  step: 4,
61034
61142
  action: "Revisa tu presupuesto",
61035
- command: "chofex challenge show --challenge broken-agent",
61143
+ command: "andes challenge show --challenge broken-agent",
61036
61144
  note: "Muestra las evaluaciones oficiales restantes y tu mejor puntaje."
61037
61145
  },
61038
61146
  {
@@ -61050,7 +61158,7 @@ var challengeQuickstart = {
61050
61158
  {
61051
61159
  step: 7,
61052
61160
  action: "Ejecuta los tests públicos",
61053
- command: "chofex challenge test --challenge broken-agent --source ./scheduler.js",
61161
+ command: "andes challenge test --challenge broken-agent --source ./scheduler.js",
61054
61162
  note: "Es seguro repetirlos y no consumen evaluaciones oficiales."
61055
61163
  },
61056
61164
  {
@@ -61062,7 +61170,7 @@ var challengeQuickstart = {
61062
61170
  {
61063
61171
  step: 9,
61064
61172
  action: "Crea el handoff de evaluación",
61065
- command: "chofex challenge evaluate --challenge broken-agent --source ./scheduler.js --review ./review.json",
61173
+ command: "andes challenge evaluate --challenge broken-agent --source ./scheduler.js --review ./review.json",
61066
61174
  note: "Devuelve un enlace de aprobación sin consumir una evaluación oficial."
61067
61175
  },
61068
61176
  {
@@ -61074,17 +61182,17 @@ var challengeQuickstart = {
61074
61182
  {
61075
61183
  step: 11,
61076
61184
  action: "Solicita el veredicto oculto",
61077
- command: "chofex challenge evaluate --challenge broken-agent --source ./scheduler.js --review ./review.json",
61185
+ command: "andes challenge evaluate --challenge broken-agent --source ./scheduler.js --review ./review.json",
61078
61186
  note: "Repite el mismo comando antes de que venza la aprobación; recién entonces consume una evaluación."
61079
61187
  },
61080
61188
  {
61081
61189
  step: 12,
61082
61190
  action: "Consulta el ranking",
61083
- command: "chofex challenge ranking --challenge broken-agent",
61191
+ command: "andes challenge ranking --challenge broken-agent",
61084
61192
  note: "Se revela el 1 de octubre a las 15:00, hora de Perú."
61085
61193
  }
61086
61194
  ],
61087
- helpCommand: "chofex challenge test --help"
61195
+ helpCommand: "andes challenge test --help"
61088
61196
  };
61089
61197
  var launchNoticeFor = (slug) => {
61090
61198
  const challenge = challengeBySlug(slug);
@@ -61108,12 +61216,12 @@ var challengeQuickstartText = (participationState, launchNotice) => {
61108
61216
  if (launchNotice)
61109
61217
  lines2.push("", "LAUNCH NOTICE", launchNotice);
61110
61218
  if (participationState === "closed") {
61111
- lines2.push("", "RANKING FINAL", " chofex challenge ranking");
61219
+ lines2.push("", "RANKING FINAL", " andes challenge ranking");
61112
61220
  return lines2.join(`
61113
61221
  `);
61114
61222
  }
61115
61223
  if (participationState === "scheduled") {
61116
- lines2.push("", "PRÓXIMAMENTE", " chofex challenge list");
61224
+ lines2.push("", "PRÓXIMAMENTE", " andes challenge list");
61117
61225
  return lines2.join(`
61118
61226
  `);
61119
61227
  }
@@ -61131,7 +61239,7 @@ var optionalString = (name, description) => exports_Flag.string(name).pipe(expor
61131
61239
  var challengeFlag = exports_Flag.string("challenge").pipe(exports_Flag.withDefault(defaultChallengeSlug), exports_Flag.withDescription("Challenge slug (default: broken-agent)"));
61132
61240
  var sourceFlag = optionalString("source", "JavaScript challenge solution file");
61133
61241
  var reviewFlag = optionalString("review", "Participant-authored Broken Agent engineering review JSON");
61134
- var officialEvaluateRetryCommand = "chofex challenge evaluate --challenge broken-agent --source ./scheduler.js --review ./review.json";
61242
+ var officialEvaluateRetryCommand = "andes challenge evaluate --challenge broken-agent --source ./scheduler.js --review ./review.json";
61135
61243
  var evaluationErrorText = (error2) => {
61136
61244
  if (error2.code === "CHALLENGE_ENGINE_UNAVAILABLE") {
61137
61245
  return [
@@ -61193,7 +61301,7 @@ var challengeInitText = (result3) => {
61193
61301
  "",
61194
61302
  "Siguiente: continúa endureciendo el scheduler y ejecuta los tests públicos",
61195
61303
  ` cd ${result3.path} && npm test`,
61196
- " chofex challenge test --challenge broken-agent --source ./scheduler.js"
61304
+ " andes challenge test --challenge broken-agent --source ./scheduler.js"
61197
61305
  ].join(`
61198
61306
  `);
61199
61307
  }
@@ -61206,7 +61314,7 @@ var challengeInitText = (result3) => {
61206
61314
  ` cd ${result3.path} && npm test`,
61207
61315
  "",
61208
61316
  "Luego repara scheduler.js y pruébalo sin consumir evaluaciones:",
61209
- " chofex challenge test --challenge broken-agent --source ./scheduler.js"
61317
+ " andes challenge test --challenge broken-agent --source ./scheduler.js"
61210
61318
  ].join(`
61211
61319
  `);
61212
61320
  }
@@ -61215,8 +61323,8 @@ var challengeInitText = (result3) => {
61215
61323
  `${result3.path} already exists. Left it unchanged.`,
61216
61324
  "",
61217
61325
  "Next: keep investigating, then test your current solution",
61218
- " chofex challenge query",
61219
- ` chofex challenge test --source ./${result3.path}`
61326
+ " andes challenge query",
61327
+ ` andes challenge test --source ./${result3.path}`
61220
61328
  ].join(`
61221
61329
  `);
61222
61330
  }
@@ -61225,10 +61333,10 @@ var challengeInitText = (result3) => {
61225
61333
  "A documented baseline is ready for the rules you discover.",
61226
61334
  "",
61227
61335
  "Next: probe the machine",
61228
- " chofex challenge query",
61336
+ " andes challenge query",
61229
61337
  "",
61230
61338
  `Then edit ${result3.path} and test it safely:`,
61231
- ` chofex challenge test --source ./${result3.path}`
61339
+ ` andes challenge test --source ./${result3.path}`
61232
61340
  ].join(`
61233
61341
  `);
61234
61342
  };
@@ -61237,7 +61345,7 @@ var listCommand = exports_Command.make("list", {}, exports_Effect.fn("challengeL
61237
61345
  yield* execute(options.output, listChallenges({ apiUrl: options.apiUrl }), challengeListText);
61238
61346
  })).pipe(exports_Command.withDescription("Discover available challenges, opening dates, and scoring formats. No login required."), exports_Command.withExamples([
61239
61347
  {
61240
- command: "chofex challenge list",
61348
+ command: "andes challenge list",
61241
61349
  description: "See which challenge is currently playable"
61242
61350
  }
61243
61351
  ]));
@@ -61261,11 +61369,11 @@ var initCommand = exports_Command.make("init", { challenge: challengeFlag }, exp
61261
61369
  yield* execute(options.output, operation, challengeInitText);
61262
61370
  })).pipe(exports_Command.withDescription("Crea el starter de un challenge sin sobrescribir trabajo existente."), exports_Command.withExamples([
61263
61371
  {
61264
- command: "chofex challenge init --challenge broken-agent",
61372
+ command: "andes challenge init --challenge broken-agent",
61265
61373
  description: "Prepara el repositorio de Broken Agent"
61266
61374
  },
61267
61375
  {
61268
- command: "chofex challenge init --challenge broken-agent",
61376
+ command: "andes challenge init --challenge broken-agent",
61269
61377
  description: "Usa explícitamente el slug del challenge"
61270
61378
  }
61271
61379
  ]));
@@ -61275,7 +61383,7 @@ var showCommand = exports_Command.make("show", { challenge: challengeFlag }, exp
61275
61383
  yield* execute(options.output, getChallengeAttempt({ apiUrl: options.apiUrl, token }, challenge), challengeShowText);
61276
61384
  })).pipe(exports_Command.withDescription("Consulta presupuesto, puntaje y progreso del challenge. Requiere iniciar sesión."), exports_Command.withExamples([
61277
61385
  {
61278
- command: "chofex challenge show",
61386
+ command: "andes challenge show",
61279
61387
  description: "Revisa tu progreso antes de consumir intentos limitados"
61280
61388
  }
61281
61389
  ]));
@@ -61311,11 +61419,11 @@ var queryCommand = exports_Command.make("query", {
61311
61419
  yield* execute(options.output, operation, challengeQueryText);
61312
61420
  })).pipe(exports_Command.withDescription("Send one shipment to the undocumented oracle. A successful query consumes one limited request. Requires sign-in."), exports_Command.withExamples([
61313
61421
  {
61314
- command: "chofex challenge query --challenge black-box --distance 10 --weight 3 --hour 14 --fragile false --express false",
61422
+ command: "andes challenge query --challenge black-box --distance 10 --weight 3 --hour 14 --fragile false --express false",
61315
61423
  description: "Spend one oracle query"
61316
61424
  },
61317
61425
  {
61318
- command: "chofex challenge query --challenge black-box --input shipment.json",
61426
+ command: "andes challenge query --challenge black-box --input shipment.json",
61319
61427
  description: "Read the shipment fields from a JSON file"
61320
61428
  }
61321
61429
  ]));
@@ -61333,11 +61441,11 @@ var notebookCommand = exports_Command.make("notebook", { challenge: challengeFla
61333
61441
  });
61334
61442
  })).pipe(exports_Command.withDescription("Review every input and price you observed. Export table, JSON, or CSV for analysis. Requires sign-in."), exports_Command.withExamples([
61335
61443
  {
61336
- command: "chofex challenge notebook --challenge black-box",
61444
+ command: "andes challenge notebook --challenge black-box",
61337
61445
  description: "Read observations in a terminal table"
61338
61446
  },
61339
61447
  {
61340
- command: "chofex challenge notebook --challenge black-box --format csv > observations.csv",
61448
+ command: "andes challenge notebook --challenge black-box --format csv > observations.csv",
61341
61449
  description: "Save observations for a spreadsheet"
61342
61450
  }
61343
61451
  ]));
@@ -61351,7 +61459,7 @@ var testCommand = exports_Command.make("test", { challenge: challengeFlag, sourc
61351
61459
  yield* execute(options.output, operation, challengeTestText);
61352
61460
  })).pipe(exports_Command.withDescription("Run the challenge's public tests. Safe to repeat; official evaluations are not consumed. Requires sign-in."), exports_Command.withExamples([
61353
61461
  {
61354
- command: "chofex challenge test --challenge broken-agent --source ./scheduler.js",
61462
+ command: "andes challenge test --challenge broken-agent --source ./scheduler.js",
61355
61463
  description: "Ejecuta los tests públicos de Broken Agent"
61356
61464
  }
61357
61465
  ]));
@@ -61364,12 +61472,21 @@ var evaluateCommand = exports_Command.make("evaluate", { challenge: challengeFla
61364
61472
  const token = exports_Option.getOrUndefined(options.token);
61365
61473
  const operation = exports_Effect.gen(function* () {
61366
61474
  const solution = yield* challengeEvaluationInput(exports_Option.getOrUndefined(source), exports_Option.getOrUndefined(review), challenge);
61367
- return yield* evaluateChallenge({ apiUrl: options.apiUrl, token }, challenge, solution);
61475
+ const client = { apiUrl: options.apiUrl, token };
61476
+ const evaluated = yield* evaluateChallenge(client, challenge, solution);
61477
+ const nextStep = yield* loadParticipantGuidance(client).pipe(exports_Effect.map((response) => response.data.nextStep), exports_Effect.catch(() => exports_Effect.succeed({
61478
+ kind: "decision",
61479
+ message: "Tu evaluación oficial se guardó. Consulta el estado de tu postulación para continuar.",
61480
+ command: "andes status"
61481
+ })));
61482
+ return { ...evaluated, data: { ...evaluated.data, nextStep } };
61368
61483
  });
61369
- yield* execute(options.output, operation, challengeEvaluateText, evaluationErrorText);
61484
+ yield* execute(options.output, operation, (result3) => `${challengeEvaluateText(result3)}
61485
+
61486
+ ${nextStepText(result3.nextStep)}`, evaluationErrorText);
61370
61487
  })).pipe(exports_Command.withDescription("Score a solution on hidden cases. Broken Agent requires participant browser approval before a limited evaluation is consumed."), exports_Command.withExamples([
61371
61488
  {
61372
- command: "chofex challenge evaluate --challenge broken-agent --source ./scheduler.js --review ./review.json",
61489
+ command: "andes challenge evaluate --challenge broken-agent --source ./scheduler.js --review ./review.json",
61373
61490
  description: "Consume una evaluación oficial cuando tu solución esté lista"
61374
61491
  }
61375
61492
  ]));
@@ -61378,67 +61495,42 @@ var rankingCommand = exports_Command.make("ranking", { challenge: challengeFlag
61378
61495
  yield* execute(options.output, getChallengeRanking({ apiUrl: options.apiUrl }, challenge), challengeRankingText);
61379
61496
  })).pipe(exports_Command.withDescription("View the public leaderboard. No login required and no challenge budget consumed."), exports_Command.withExamples([
61380
61497
  {
61381
- command: "chofex challenge ranking --challenge broken-agent",
61498
+ command: "andes challenge ranking --challenge broken-agent",
61382
61499
  description: "Compara puntajes oficiales"
61383
61500
  }
61384
61501
  ]));
61385
61502
  var challengeCommand = exports_Command.make("challenge", {}, exports_Effect.fn("challengeQuickstartCommand")(function* () {
61386
61503
  const options = yield* root;
61387
- const participationState = participationStateFor(defaultChallengeSlug);
61388
- const participationOpen = participationState === "open";
61389
- const launchNotice = launchNoticeFor(defaultChallengeSlug);
61390
- if (options.output === "json") {
61391
- let workflow = challengeQuickstart.workflow;
61392
- let helpCommand = challengeQuickstart.helpCommand;
61393
- let story = challengeQuickstart.story;
61394
- let mission = challengeQuickstart.mission;
61395
- let rules = challengeQuickstart.rules;
61396
- if (participationState === "closed") {
61397
- const rankingStep = challengeQuickstart.workflow.at(-1);
61398
- workflow = rankingStep ? [rankingStep] : [];
61399
- helpCommand = "chofex challenge ranking --help";
61400
- story = [];
61401
- mission = "El Challenge 2 terminó. El ranking final sigue disponible.";
61402
- rules = [];
61403
- } else if (participationState === "scheduled") {
61404
- workflow = [];
61405
- helpCommand = "chofex challenge list --help";
61406
- story = [];
61407
- mission = "El challenge todavía no está disponible.";
61408
- rules = [];
61409
- }
61410
- const data = {
61411
- ...challengeQuickstart,
61412
- story,
61413
- mission,
61414
- rules,
61415
- workflow,
61416
- helpCommand,
61417
- open: participationOpen,
61418
- state: participationState
61419
- };
61420
- if (launchNotice)
61421
- data.notice = launchNotice;
61422
- yield* printJson({
61423
- version: 1,
61424
- ok: true,
61425
- requestId: crypto.randomUUID(),
61426
- data
61427
- });
61428
- return;
61429
- }
61430
- yield* exports_Console.log(challengeQuickstartText(participationState, launchNotice));
61504
+ const client = {
61505
+ apiUrl: options.apiUrl,
61506
+ token: exports_Option.getOrUndefined(options.token)
61507
+ };
61508
+ const operation = loadParticipantGuidance(client).pipe(exports_Effect.map((response) => {
61509
+ const { nextStep } = response.data;
61510
+ let guide;
61511
+ if ((nextStep.kind === "challenge_start" || nextStep.kind === "challenge_continue") && nextStep.challengeSlug === "broken-agent") {
61512
+ guide = challengeQuickstart;
61513
+ }
61514
+ return { ...response, data: { ...response.data, guide } };
61515
+ }));
61516
+ yield* execute(options.output, operation, (result3) => {
61517
+ if (!result3.guide)
61518
+ return nextStepText(result3.nextStep);
61519
+ return `${challengeQuickstartText("open")}
61520
+
61521
+ ${nextStepText(result3.nextStep)}`;
61522
+ });
61431
61523
  })).pipe(exports_Command.withDescription("Compite en challenges técnicos obligatorios por un cupo. Ejecuta el comando sin subcomandos para abrir la guía del challenge actual."), exports_Command.withExamples([
61432
61524
  {
61433
- command: "chofex challenge",
61525
+ command: "andes challenge",
61434
61526
  description: "Abre la guía de Broken Agent"
61435
61527
  },
61436
61528
  {
61437
- command: "chofex challenge init --challenge broken-agent",
61529
+ command: "andes challenge init --challenge broken-agent",
61438
61530
  description: "Crea el repositorio de Broken Agent"
61439
61531
  },
61440
61532
  {
61441
- command: "chofex challenge test --help",
61533
+ command: "andes challenge test --help",
61442
61534
  description: "Revisa cómo ejecutar los tests públicos"
61443
61535
  }
61444
61536
  ]), exports_Command.withSubcommands([
@@ -63598,7 +63690,7 @@ var runInstaller = async (installDirectory, version) => {
63598
63690
  }
63599
63691
  return runProcess("bash", arguments_, script);
63600
63692
  };
63601
- var isStandaloneExecutable = () => typeof Bun !== "undefined" && Bun.isStandaloneExecutable;
63693
+ var isStandaloneExecutable = () => isStandaloneBuild;
63602
63694
  var assertSuccessful = (result3, program) => {
63603
63695
  if (result3.exitCode === 0)
63604
63696
  return;
@@ -63770,7 +63862,9 @@ var shouldAutoUpdateCli = async ({
63770
63862
  return pathIsInside(join3(npmRoot, cliPackageName), entryPath);
63771
63863
  };
63772
63864
  var runUpdatedCli = () => new Promise((resolve4, reject) => {
63773
- const child = spawn3(process.execPath, process.argv.slice(1), {
63865
+ const arguments_ = process.argv.slice(isStandaloneBuild ? 2 : 1);
63866
+ const child = spawn3(process.execPath, arguments_, {
63867
+ argv0: process.argv0,
63774
63868
  env: { ...process.env, CHOFEX_AUTO_UPDATE: "0" },
63775
63869
  stdio: "inherit"
63776
63870
  });
@@ -63778,6 +63872,149 @@ var runUpdatedCli = () => new Promise((resolve4, reject) => {
63778
63872
  child.on("close", (exitCode) => resolve4(exitCode ?? 1));
63779
63873
  });
63780
63874
 
63875
+ // src/welcome.ts
63876
+ var valley = [
63877
+ " 11 55 ",
63878
+ " 11 1111 5555 11 ",
63879
+ " 1111 111111 11 55 1111 ",
63880
+ " 11112222111111 111111 111111 ",
63881
+ "111222222211111111111111111122221111",
63882
+ "112223333222111111111111112223332222",
63883
+ "222333333322211114411111222333333333",
63884
+ "333333333332222144442222233333333333",
63885
+ "333333333333322244422223333333333333"
63886
+ ];
63887
+ var palette = {
63888
+ sky: "12;24;24",
63889
+ distant: "28;62;61",
63890
+ ridge: "44;101;85",
63891
+ terrace: "84;143;111",
63892
+ river: "141;200;190",
63893
+ sun: "234;183;108",
63894
+ border: "66;101;85",
63895
+ text: "243;241;217",
63896
+ muted: "183;201;181",
63897
+ accent: "214;255;0"
63898
+ };
63899
+ var pixels = {
63900
+ " ": { color: palette.sky, character: " " },
63901
+ "1": { color: palette.distant, character: "." },
63902
+ "2": { color: palette.ridge, character: ":" },
63903
+ "3": { color: palette.terrace, character: "#" },
63904
+ "4": { color: palette.river, character: "~" },
63905
+ "5": { color: palette.sun, character: "o" }
63906
+ };
63907
+ var wrap = (text2, width) => {
63908
+ const lines2 = [];
63909
+ let line = "";
63910
+ for (const word of text2.split(" ")) {
63911
+ if (line && line.length + word.length + 1 > width) {
63912
+ lines2.push(line);
63913
+ line = "";
63914
+ }
63915
+ line = line ? `${line} ${word}` : word;
63916
+ while (line.length > width) {
63917
+ lines2.push(line.slice(0, width));
63918
+ line = line.slice(width);
63919
+ }
63920
+ }
63921
+ if (line)
63922
+ lines2.push(line);
63923
+ return lines2;
63924
+ };
63925
+ var center = (text2, width) => (" ".repeat(Math.max(0, Math.floor((width - text2.length) / 2))) + text2).padEnd(width);
63926
+ var renderWelcome = ({
63927
+ columns = 80,
63928
+ colors: colors2 = false
63929
+ } = {}) => {
63930
+ const width = Math.max(1, Math.min(Math.floor(columns), 72));
63931
+ if (width < 24) {
63932
+ return [
63933
+ eventName,
63934
+ "by Chofex",
63935
+ "S/8,000 in prizes",
63936
+ "Only for the best engineers from Peru."
63937
+ ].flatMap((line) => wrap(line, width)).join(`
63938
+ `);
63939
+ }
63940
+ const innerWidth = width - 4;
63941
+ const paint = (text2, foreground = palette.text, background = palette.sky, bold2 = false) => {
63942
+ if (!colors2)
63943
+ return text2;
63944
+ const weight = bold2 ? "1;" : "";
63945
+ return `\x1B[${weight}38;2;${foreground};48;2;${background}m${text2}\x1B[0m`;
63946
+ };
63947
+ let horizontal = "-";
63948
+ let vertical = "|";
63949
+ let corners = ["+", "+", "+", "+"];
63950
+ if (colors2) {
63951
+ horizontal = "─";
63952
+ vertical = "│";
63953
+ corners = ["╭", "╮", "╰", "╯"];
63954
+ }
63955
+ const frame = (content) => ` ${paint(vertical, palette.border)}${content}${paint(vertical, palette.border)}`;
63956
+ const rule = (left, right) => ` ${paint(left + horizontal.repeat(innerWidth) + right, palette.border)}`;
63957
+ const label = (text2, foreground, bold2 = false) => frame(paint(center(text2, innerWidth), foreground, palette.sky, bold2));
63958
+ const sourceWidth = Math.max(...valley.map((row) => row.length));
63959
+ const scene = valley.map((row, y) => {
63960
+ const cells = Array.from({ length: innerWidth }, (_, x) => {
63961
+ const sourceX = Math.floor(x / innerWidth * sourceWidth);
63962
+ return row[sourceX] ?? " ";
63963
+ });
63964
+ let heading = "";
63965
+ let foreground = palette.text;
63966
+ if (y === 3)
63967
+ heading = eventName;
63968
+ if (y === 4) {
63969
+ heading = "by Chofex";
63970
+ foreground = palette.sun;
63971
+ }
63972
+ const headingStart = Math.floor((innerWidth - heading.length) / 2);
63973
+ let rendered = "";
63974
+ for (let x = 0;x < cells.length; x += 1) {
63975
+ if (heading && x >= headingStart - 1 && x <= headingStart + heading.length) {
63976
+ const character = heading[x - headingStart] ?? " ";
63977
+ rendered += paint(character, foreground, palette.sky, y === 3);
63978
+ continue;
63979
+ }
63980
+ const pixel = pixels[cells[x] ?? " "] ?? pixels[" "];
63981
+ if (!pixel)
63982
+ continue;
63983
+ if (colors2) {
63984
+ rendered += paint(" ", pixel.color, pixel.color);
63985
+ } else {
63986
+ rendered += pixel.character;
63987
+ }
63988
+ }
63989
+ return frame(rendered);
63990
+ });
63991
+ return [
63992
+ "",
63993
+ rule(corners[0] ?? "+", corners[1] ?? "+"),
63994
+ ...scene,
63995
+ label("", palette.text),
63996
+ label("S/8,000 in prizes", palette.accent, true),
63997
+ ...wrap("Only for the best engineers from Peru.", innerWidth - 2).map((line) => label(line, palette.muted)),
63998
+ rule(corners[2] ?? "+", corners[3] ?? "+"),
63999
+ ""
64000
+ ].join(`
64001
+ `);
64002
+ };
64003
+ var welcomeFormatter = (options) => {
64004
+ const formatter = exports_CliOutput.defaultFormatter({ colors: options.colors });
64005
+ return {
64006
+ ...formatter,
64007
+ formatHelpDoc: (doc) => {
64008
+ const help = formatter.formatHelpDoc(doc);
64009
+ if (!doc.subcommands?.length)
64010
+ return help;
64011
+ const welcome = renderWelcome(options);
64012
+ return `${welcome}
64013
+ ${help}`;
64014
+ }
64015
+ };
64016
+ };
64017
+
63781
64018
  // src/commands.ts
63782
64019
  var inputFlag2 = exports_Flag.string("input").pipe(exports_Flag.optional, exports_Flag.withDescription("Read JSON from a file, or use - for stdin"));
63783
64020
  var stageFlag = exports_Flag.choice("stage", ["application", "acceptance"]).pipe(exports_Flag.withDefault("application"));
@@ -63787,49 +64024,39 @@ var currentRegistration = (client) => getRegistration(client).pipe(exports_Effec
63787
64024
  }
63788
64025
  return exports_Effect.fail(error2);
63789
64026
  }));
63790
- var rejectIfApplicationLocked = exports_Effect.fn("rejectIfApplicationLocked")(function* (current) {
63791
- if (exports_Option.isNone(current))
63792
- return;
63793
- const { registration, requirements } = current.value.data;
63794
- const { status } = registration;
63795
- const registrationAlreadyExists = status === "submitted" || status === "under_review" || status === "waitlisted" || status === "accepted";
63796
- if (!registrationAlreadyExists)
63797
- return;
63798
- let message = "Already registered. Wait for approval.";
63799
- if (status === "accepted") {
63800
- message = "Already accepted. Your registration is complete.";
63801
- if (requirements.stage === "accepted") {
63802
- message = "Already accepted. Run `chofex confirm` to complete your registration.";
63803
- }
63804
- }
63805
- return yield* cliError("ACTIVE_APPLICATION_EXISTS", message, false, {
63806
- currentStatus: status
63807
- });
63808
- });
63809
64027
  var registerCommand = exports_Command.make("register", { input: inputFlag2 }, exports_Effect.fn("registerCommand")(function* ({ input }) {
63810
64028
  const options = yield* root;
64029
+ let existing = false;
63811
64030
  const operation = exports_Effect.gen(function* () {
63812
64031
  const token = exports_Option.getOrUndefined(options.token);
63813
64032
  const client = { apiUrl: options.apiUrl, token };
63814
64033
  const current = yield* currentRegistration(client);
63815
- yield* rejectIfApplicationLocked(current);
64034
+ if (exports_Option.isSome(current) && !current.value.data.requirements.canSubmitNewApplication && !current.value.data.requirements.canSaveDraft) {
64035
+ existing = true;
64036
+ return current.value;
64037
+ }
63816
64038
  if (exports_Option.isSome(input)) {
63817
64039
  const body = yield* applicationInput(input.value, config.publicSiteUrl);
63818
64040
  return yield* register(client, body);
63819
64041
  }
63820
- if (!process.stdin.isTTY || !process.stdout.isTTY) {
64042
+ if (options.output === "json" || !process.stdin.isTTY || !process.stdout.isTTY) {
63821
64043
  return yield* cliError("INPUT_REQUIRED", "Non-interactive use requires --input <file>, or --input - for stdin");
63822
64044
  }
63823
64045
  return yield* interactiveRegister(client, current);
63824
64046
  });
63825
- yield* execute(options.output, operation, createdText);
64047
+ yield* execute(options.output, withRegistrationNextStep(operation), (result3) => {
64048
+ if (existing)
64049
+ return `Tu postulación ya estaba enviada.
64050
+ ${registrationText(result3)}`;
64051
+ return createdText(result3);
64052
+ }, registrationLookupErrorText);
63826
64053
  })).pipe(exports_Command.withDescription("Complete and submit an application for review"), exports_Command.withExamples([
63827
64054
  {
63828
- command: "chofex register",
64055
+ command: "andes register",
63829
64056
  description: "Fill or resume the application interactively"
63830
64057
  },
63831
64058
  {
63832
- command: "chofex --output json register --input application.json",
64059
+ command: "andes --output json register --input application.json",
63833
64060
  description: "Submit an application from an agent or script"
63834
64061
  }
63835
64062
  ]));
@@ -63853,7 +64080,7 @@ var statusCommand = exports_Command.make("status", {}, exports_Effect.fn("status
63853
64080
  const token = exports_Option.getOrUndefined(options.token);
63854
64081
  return yield* getRegistration({ apiUrl: options.apiUrl, token });
63855
64082
  });
63856
- yield* execute(options.output, operation, registrationText, registrationLookupErrorText);
64083
+ yield* execute(options.output, withRegistrationNextStep(operation), registrationText, registrationLookupErrorText);
63857
64084
  })).pipe(exports_Command.withDescription("Show your latest application and next steps"));
63858
64085
  var requirementsCommand = exports_Command.make("requirements", {}, exports_Effect.fn("requirementsCommand")(function* () {
63859
64086
  const options = yield* root;
@@ -63861,7 +64088,7 @@ var requirementsCommand = exports_Command.make("requirements", {}, exports_Effec
63861
64088
  const token = exports_Option.getOrUndefined(options.token);
63862
64089
  return yield* getRegistration({ apiUrl: options.apiUrl, token });
63863
64090
  });
63864
- yield* execute(options.output, operation, requirementsOnlyText, registrationLookupErrorText);
64091
+ yield* execute(options.output, withRegistrationNextStep(operation), requirementsOnlyText, registrationLookupErrorText);
63865
64092
  })).pipe(exports_Command.withDescription("Show information you still need to provide"));
63866
64093
  var badgeRegenerateCommand = exports_Command.make("regenerate", {
63867
64094
  input: inputFlag2,
@@ -63875,14 +64102,15 @@ var badgeRegenerateCommand = exports_Command.make("regenerate", {
63875
64102
  }
63876
64103
  const token = exports_Option.getOrUndefined(options.token);
63877
64104
  const client = { apiUrl: options.apiUrl, token };
64105
+ const current = yield* getRegistration(client);
64106
+ if (current.data.requirements.stage !== "complete") {
64107
+ return yield* cliError("INVALID_APPLICATION_STATE", nextStepText(nextStepFor(current.data)));
64108
+ }
63878
64109
  const badge = yield* getBadge(client);
63879
64110
  if (!badge.data.profile) {
63880
64111
  return yield* exports_Effect.fail(cliError("INVALID_APPLICATION_STATE", "Confirma tu asistencia antes de regenerar tu carnet"));
63881
64112
  }
63882
- const [current, currentUser] = yield* exports_Effect.all([
63883
- getRegistration(client),
63884
- getCurrentUser(client)
63885
- ]);
64113
+ const currentUser = yield* getCurrentUser(client);
63886
64114
  const body = yield* badgeProfileInput(inputPath, badge.data.profile, {
63887
64115
  clerkPictureUrl: currentUser.data.clerkPictureUrl,
63888
64116
  githubUrl: current.data.registration.githubUrl
@@ -63904,8 +64132,26 @@ var badgeRegenerateCommand = exports_Command.make("regenerate", {
63904
64132
  var badgeCommand = exports_Command.make("badge", {}, exports_Effect.fn("badgeCommand")(function* () {
63905
64133
  const options = yield* root;
63906
64134
  const token = exports_Option.getOrUndefined(options.token);
63907
- const operation = getBadge({ apiUrl: options.apiUrl, token });
63908
- yield* execute(options.output, operation, badgeText);
64135
+ const client = { apiUrl: options.apiUrl, token };
64136
+ const operation = exports_Effect.gen(function* () {
64137
+ const current = yield* getRegistration(client);
64138
+ if (current.data.registration.status !== "accepted") {
64139
+ return yield* cliError("INVALID_APPLICATION_STATE", nextStepText(nextStepFor(current.data)));
64140
+ }
64141
+ const badge = yield* getBadge(client);
64142
+ return {
64143
+ ...badge,
64144
+ data: { ...badge.data, nextStep: nextStepFor(current.data) }
64145
+ };
64146
+ });
64147
+ yield* execute(options.output, operation, (result3) => {
64148
+ if (result3.nextStep.kind === "confirm")
64149
+ return `Tu carnet predeterminado no confirma tu asistencia.
64150
+ ${result3.url ?? "El carnet todavía se está preparando."}
64151
+
64152
+ ${nextStepText(result3.nextStep)}`;
64153
+ return badgeText(result3);
64154
+ }, registrationLookupErrorText);
63909
64155
  })).pipe(exports_Command.withDescription("Muestra o regenera tu carnet de participante"), exports_Command.withSubcommands([badgeRegenerateCommand]));
63910
64156
  var confirmCommand = exports_Command.make("confirm", {
63911
64157
  input: inputFlag2,
@@ -63916,8 +64162,13 @@ var confirmCommand = exports_Command.make("confirm", {
63916
64162
  const token = exports_Option.getOrUndefined(options.token);
63917
64163
  const client = { apiUrl: options.apiUrl, token };
63918
64164
  const current = yield* getRegistration(client);
64165
+ if (current.data.requirements.stage === "complete" && exports_Option.isNone(input) && exports_Option.isNone(picture))
64166
+ return current;
63919
64167
  if (!current.data.requirements.canSubmitAcceptedDetails) {
63920
- return yield* exports_Effect.fail(cliError("INVALID_APPLICATION_STATE", "Acceptance details can only be submitted after acceptance"));
64168
+ return yield* exports_Effect.fail(cliError("INVALID_APPLICATION_STATE", nextStepText(nextStepFor(current.data))));
64169
+ }
64170
+ if (options.output === "json" && exports_Option.isNone(input)) {
64171
+ return yield* cliError("INPUT_REQUIRED", "El modo JSON requiere --input <archivo> o --input -");
63921
64172
  }
63922
64173
  const currentUser = yield* getCurrentUser(client);
63923
64174
  const currentBadge = yield* getBadge(client);
@@ -63931,6 +64182,9 @@ var confirmCommand = exports_Command.make("confirm", {
63931
64182
  });
63932
64183
  const picturePath = exports_Option.getOrUndefined(picture);
63933
64184
  if (body.pictureSource === "upload") {
64185
+ if (options.output === "json" && picturePath === undefined) {
64186
+ return yield* cliError("PICTURE_PATH_REQUIRED", "Usa --picture <ruta> cuando pictureSource es upload");
64187
+ }
63934
64188
  const path4 = yield* picturePathInput(picturePath);
63935
64189
  yield* uploadPicture(client, path4);
63936
64190
  } else if (picturePath) {
@@ -63938,14 +64192,14 @@ var confirmCommand = exports_Command.make("confirm", {
63938
64192
  }
63939
64193
  return yield* confirmAttendance(client, body);
63940
64194
  });
63941
- yield* execute(options.output, operation, registrationText);
64195
+ yield* execute(options.output, withRegistrationNextStep(operation), registrationText, registrationLookupErrorText);
63942
64196
  })).pipe(exports_Command.withDescription("Provide private attendance details after acceptance"), exports_Command.withExamples([
63943
64197
  {
63944
- command: "chofex confirm",
64198
+ command: "andes confirm",
63945
64199
  description: "Complete accepted-participant details interactively"
63946
64200
  },
63947
64201
  {
63948
- command: "chofex --output json confirm --input attendance.json",
64202
+ command: "andes --output json confirm --input attendance.json",
63949
64203
  description: "Submit accepted-participant details from JSON"
63950
64204
  }
63951
64205
  ]));
@@ -63961,21 +64215,33 @@ var loginCommand = exports_Command.make("login", {}, exports_Effect.fn("loginCom
63961
64215
  token
63962
64216
  });
63963
64217
  const environmentTokenActive = Boolean(process.env.CHOFEX_TOKEN);
64218
+ const nextStep = yield* loadParticipantGuidance({
64219
+ apiUrl: options.apiUrl,
64220
+ token
64221
+ }).pipe(exports_Effect.map((response) => response.data.nextStep), exports_Effect.catch(() => exports_Effect.succeed({
64222
+ kind: "status",
64223
+ message: "Consulta tu avance para continuar con tu siguiente paso.",
64224
+ command: "andes"
64225
+ })));
63964
64226
  return {
63965
64227
  version: 1,
63966
64228
  ok: true,
63967
64229
  requestId: currentUser.requestId,
63968
64230
  data: {
63969
64231
  authenticated: true,
63970
- environmentTokenActive
64232
+ environmentTokenActive,
64233
+ nextStep
63971
64234
  }
63972
64235
  };
63973
64236
  });
63974
64237
  yield* execute(options.output, operation, (result3) => {
63975
64238
  if (result3.environmentTokenActive) {
63976
- return "Signed in successfully. CHOFEX_TOKEN is set and will override the stored session; unset it before running other commands.";
64239
+ return `Sesión iniciada. CHOFEX_TOKEN está configurado y tiene prioridad sobre la sesión guardada; elimínalo del entorno para usar esta sesión.
64240
+ Siguiente comando: andes`;
63977
64241
  }
63978
- return "Signed in successfully.";
64242
+ return `Sesión iniciada.
64243
+ ${result3.nextStep.message}
64244
+ Siguiente comando: ${result3.nextStep.command}`;
63979
64245
  });
63980
64246
  })).pipe(exports_Command.withDescription("Sign in through Clerk OAuth in your browser"));
63981
64247
  var logoutCommand = exports_Command.make("logout", {}, exports_Effect.fn("logoutCommand")(function* () {
@@ -64000,14 +64266,16 @@ var logoutCommand = exports_Command.make("logout", {}, exports_Effect.fn("logout
64000
64266
  if (result3.environmentTokenActive) {
64001
64267
  return "Stored credentials removed. CHOFEX_TOKEN remains active; unset it to stop using that token.";
64002
64268
  }
64003
- return "Signed out successfully.";
64269
+ return `Sesión cerrada. Para volver a continuar tu postulación:
64270
+ Siguiente comando: andes login`;
64004
64271
  });
64005
64272
  })).pipe(exports_Command.withDescription("Revoke and remove locally stored credentials"));
64006
64273
  var whoamiCommand = exports_Command.make("whoami", {}, exports_Effect.fn("whoamiCommand")(function* () {
64007
64274
  const options = yield* root;
64008
64275
  const token = exports_Option.getOrUndefined(options.token);
64009
64276
  const operation = getCurrentUser({ apiUrl: options.apiUrl, token });
64010
- yield* execute(options.output, operation, (result3) => `Authenticated as ${result3.email} (${result3.userId}, ${result3.tokenType}).`);
64277
+ yield* execute(options.output, operation, (result3) => `Sesión iniciada como ${result3.email} (${result3.userId}, ${result3.tokenType}).
64278
+ Consulta tu siguiente paso: andes`);
64011
64279
  })).pipe(exports_Command.withDescription("Verify the current Clerk authentication"));
64012
64280
  var makeUpgradeCommand = (name) => exports_Command.make(name, {}, exports_Effect.fn("upgradeCommand")(function* () {
64013
64281
  const options = yield* root;
@@ -64027,7 +64295,8 @@ var makeUpgradeCommand = (name) => exports_Command.make(name, {}, exports_Effect
64027
64295
  },
64028
64296
  catch: (error2) => cliError("UPGRADE_FAILED", `No se pudieron actualizar ${cliPackageName} y ${skillName}`, false, String(error2))
64029
64297
  });
64030
- yield* execute(options.output, operation, () => `Se actualizó ${cliPackageName} a la versión ${upgradeVersion} y se refrescó ${skillName}.`);
64298
+ yield* execute(options.output, operation, () => `Se actualizó ${cliPackageName} a la versión ${upgradeVersion} y se refrescó ${skillName}.
64299
+ Siguiente comando: andes`);
64031
64300
  })).pipe(exports_Command.withDescription(`Actualiza ${cliPackageName} y su skill de agente a la última versión`));
64032
64301
  var updateCommand = makeUpgradeCommand("update");
64033
64302
  var upgradeCommand = makeUpgradeCommand("upgrade");
@@ -64039,16 +64308,27 @@ var inputValidation = (stage, path4) => {
64039
64308
  };
64040
64309
  var validateCommand = exports_Command.make("validate", { input: inputFlag2, stage: stageFlag }, exports_Effect.fn("validateCommand")(function* ({ input, stage }) {
64041
64310
  const options = yield* root;
64311
+ if (options.output === "json" && exports_Option.isNone(input)) {
64312
+ yield* execute(options.output, exports_Effect.fail(cliError("INPUT_REQUIRED", "El modo JSON requiere --input <archivo> o --input -")), () => "");
64313
+ return;
64314
+ }
64042
64315
  const operation = inputValidation(stage, exports_Option.getOrUndefined(input)).pipe(exports_Effect.map(() => ({
64043
64316
  version: 1,
64044
64317
  ok: true,
64045
64318
  requestId: crypto.randomUUID(),
64046
64319
  data: { valid: true, stage }
64047
64320
  })));
64048
- yield* execute(options.output, operation, (result3) => `${result3.stage} input is valid.`);
64321
+ yield* execute(options.output, operation, (result3) => {
64322
+ const command = result3.stage === "application" ? "andes register" : "andes confirm";
64323
+ let nextCommand = command;
64324
+ if (exports_Option.isSome(input))
64325
+ nextCommand += ` --input ${JSON.stringify(input.value)}`;
64326
+ return `Datos válidos. Todavía no se enviaron.
64327
+ Siguiente comando: ${nextCommand}`;
64328
+ });
64049
64329
  })).pipe(exports_Command.withDescription("Validate input without submitting it"), exports_Command.withExamples([
64050
64330
  {
64051
- command: "chofex --output json validate --stage application --input application.json",
64331
+ command: "andes --output json validate --stage application --input application.json",
64052
64332
  description: "Validate an application file locally"
64053
64333
  }
64054
64334
  ]));
@@ -64087,11 +64367,27 @@ var schemaCommand = exports_Command.make("schema", { stage: stageFlag }, exports
64087
64367
  yield* printJson(templateFor(stage));
64088
64368
  })).pipe(exports_Command.withDescription("Print a complete machine-readable input template"), exports_Command.withExamples([
64089
64369
  {
64090
- command: "chofex schema --stage acceptance",
64370
+ command: "andes schema --stage acceptance",
64091
64371
  description: "Print the post-acceptance input template"
64092
64372
  }
64093
64373
  ]));
64094
- var command = root.pipe(exports_Command.withSubcommands([
64374
+ var command = root.pipe(exports_Command.withHandler((options) => exports_Effect.gen(function* () {
64375
+ const client = {
64376
+ apiUrl: options.apiUrl,
64377
+ token: exports_Option.getOrUndefined(options.token)
64378
+ };
64379
+ yield* execute(options.output, loadParticipantGuidance(client), (result3) => {
64380
+ const welcome = renderWelcome({
64381
+ columns: process.stdout.columns ?? 80,
64382
+ colors: process.stdout.isTTY === true && process.env.NO_COLOR === undefined
64383
+ });
64384
+ const guidance = result3.registration ? registrationText(result3.registration) : nextStepText(result3.nextStep);
64385
+ return `${welcome}
64386
+ ${guidance}
64387
+
64388
+ Todos los comandos: andes --help`;
64389
+ });
64390
+ })), exports_Command.withSubcommands([
64095
64391
  loginCommand,
64096
64392
  logoutCommand,
64097
64393
  whoamiCommand,
@@ -64107,161 +64403,6 @@ var command = root.pipe(exports_Command.withSubcommands([
64107
64403
  challengeCommand
64108
64404
  ]));
64109
64405
 
64110
- // src/welcome.ts
64111
- var valley = [
64112
- " 11 55 ",
64113
- " 11 1111 5555 11 ",
64114
- " 1111 111111 11 55 1111 ",
64115
- " 11112222111111 111111 111111 ",
64116
- "111222222211111111111111111122221111",
64117
- "112223333222111111111111112223332222",
64118
- "222333333322211114411111222333333333",
64119
- "333333333332222144442222233333333333",
64120
- "333333333333322244422223333333333333"
64121
- ];
64122
- var palette = {
64123
- sky: "12;24;24",
64124
- distant: "28;62;61",
64125
- ridge: "44;101;85",
64126
- terrace: "84;143;111",
64127
- river: "141;200;190",
64128
- sun: "234;183;108",
64129
- border: "66;101;85",
64130
- text: "243;241;217",
64131
- muted: "183;201;181",
64132
- accent: "214;255;0"
64133
- };
64134
- var pixels = {
64135
- " ": { color: palette.sky, character: " " },
64136
- "1": { color: palette.distant, character: "." },
64137
- "2": { color: palette.ridge, character: ":" },
64138
- "3": { color: palette.terrace, character: "#" },
64139
- "4": { color: palette.river, character: "~" },
64140
- "5": { color: palette.sun, character: "o" }
64141
- };
64142
- var wrap = (text2, width) => {
64143
- const lines2 = [];
64144
- let line = "";
64145
- for (const word of text2.split(" ")) {
64146
- if (line && line.length + word.length + 1 > width) {
64147
- lines2.push(line);
64148
- line = "";
64149
- }
64150
- line = line ? `${line} ${word}` : word;
64151
- while (line.length > width) {
64152
- lines2.push(line.slice(0, width));
64153
- line = line.slice(width);
64154
- }
64155
- }
64156
- if (line)
64157
- lines2.push(line);
64158
- return lines2;
64159
- };
64160
- var center = (text2, width) => (" ".repeat(Math.max(0, Math.floor((width - text2.length) / 2))) + text2).padEnd(width);
64161
- var renderWelcome = ({
64162
- columns = 80,
64163
- colors: colors2 = false
64164
- } = {}) => {
64165
- const width = Math.max(1, Math.min(Math.floor(columns), 72));
64166
- if (width < 24) {
64167
- return [
64168
- eventName,
64169
- "by Chofex",
64170
- "S/8,000 in prizes",
64171
- "Only for the best engineers from Peru."
64172
- ].flatMap((line) => wrap(line, width)).join(`
64173
- `);
64174
- }
64175
- const innerWidth = width - 4;
64176
- const paint = (text2, foreground = palette.text, background = palette.sky, bold2 = false) => {
64177
- if (!colors2)
64178
- return text2;
64179
- const weight = bold2 ? "1;" : "";
64180
- return `\x1B[${weight}38;2;${foreground};48;2;${background}m${text2}\x1B[0m`;
64181
- };
64182
- let horizontal = "-";
64183
- let vertical = "|";
64184
- let corners = ["+", "+", "+", "+"];
64185
- if (colors2) {
64186
- horizontal = "─";
64187
- vertical = "│";
64188
- corners = ["╭", "╮", "╰", "╯"];
64189
- }
64190
- const frame = (content) => ` ${paint(vertical, palette.border)}${content}${paint(vertical, palette.border)}`;
64191
- const rule = (left, right) => ` ${paint(left + horizontal.repeat(innerWidth) + right, palette.border)}`;
64192
- const label = (text2, foreground, bold2 = false) => frame(paint(center(text2, innerWidth), foreground, palette.sky, bold2));
64193
- const sourceWidth = Math.max(...valley.map((row) => row.length));
64194
- const scene = valley.map((row, y) => {
64195
- const cells = Array.from({ length: innerWidth }, (_, x) => {
64196
- const sourceX = Math.floor(x / innerWidth * sourceWidth);
64197
- return row[sourceX] ?? " ";
64198
- });
64199
- let heading = "";
64200
- let foreground = palette.text;
64201
- if (y === 3)
64202
- heading = eventName;
64203
- if (y === 4) {
64204
- heading = "by Chofex";
64205
- foreground = palette.sun;
64206
- }
64207
- const headingStart = Math.floor((innerWidth - heading.length) / 2);
64208
- let rendered = "";
64209
- for (let x = 0;x < cells.length; x += 1) {
64210
- if (heading && x >= headingStart - 1 && x <= headingStart + heading.length) {
64211
- const character = heading[x - headingStart] ?? " ";
64212
- rendered += paint(character, foreground, palette.sky, y === 3);
64213
- continue;
64214
- }
64215
- const pixel = pixels[cells[x] ?? " "] ?? pixels[" "];
64216
- if (!pixel)
64217
- continue;
64218
- if (colors2) {
64219
- rendered += paint(" ", pixel.color, pixel.color);
64220
- } else {
64221
- rendered += pixel.character;
64222
- }
64223
- }
64224
- return frame(rendered);
64225
- });
64226
- return [
64227
- "",
64228
- rule(corners[0] ?? "+", corners[1] ?? "+"),
64229
- ...scene,
64230
- label("", palette.text),
64231
- label("S/8,000 in prizes", palette.accent, true),
64232
- ...wrap("Only for the best engineers from Peru.", innerWidth - 2).map((line) => label(line, palette.muted)),
64233
- rule(corners[2] ?? "+", corners[3] ?? "+"),
64234
- ""
64235
- ].join(`
64236
- `);
64237
- };
64238
- var welcomeFormatter = (options) => {
64239
- const formatter = exports_CliOutput.defaultFormatter({ colors: options.colors });
64240
- return {
64241
- ...formatter,
64242
- formatHelpDoc: (doc) => {
64243
- const help = formatter.formatHelpDoc(doc);
64244
- if (!doc.subcommands?.length)
64245
- return help;
64246
- const welcome = renderWelcome(options);
64247
- if (!options.home)
64248
- return `${welcome}
64249
- ${help}`;
64250
- const width = Math.max(1, Math.min(options.columns ?? 80, 72));
64251
- const shortcuts = [
64252
- "chofex login Sign in",
64253
- "chofex register Apply",
64254
- "chofex status Check your application",
64255
- "chofex --help All commands"
64256
- ];
64257
- return `${welcome}
64258
- ${shortcuts.flatMap((line) => wrap(line, width)).join(`
64259
- `)}
64260
- `;
64261
- }
64262
- };
64263
- };
64264
-
64265
64406
  // src/index.ts
64266
64407
  var arguments_ = process.argv.slice(2);
64267
64408
  var jsonOutputRequested = (arguments_2) => {
@@ -64282,7 +64423,6 @@ var quietConsole = Object.assign(Object.create(console), {
64282
64423
  }
64283
64424
  });
64284
64425
  var commandProgram = command.pipe(exports_Command.run({ version: cliVersion, renderErrors: !jsonMode }), exports_Effect.provide(exports_CliOutput.layer(welcomeFormatter({
64285
- home: arguments_.length === 0,
64286
64426
  columns: process.stdout.columns ?? 80,
64287
64427
  colors: process.stdout.isTTY === true && process.env.NO_COLOR === undefined && process.env.TERM !== "dumb"
64288
64428
  }))), exports_Effect.catch((error2) => {