chofex-cli 0.1.113 → 0.1.114
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/index.js +57 -20
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -58557,7 +58557,7 @@ var challengeCatalog = [
|
|
|
58557
58557
|
coreSkill: "Reverse engineering & experimentation",
|
|
58558
58558
|
format: "accuracy",
|
|
58559
58559
|
formatLabel: "Accuracy score",
|
|
58560
|
-
opensAt: "2026-09-
|
|
58560
|
+
opensAt: "2026-09-17T05:00:00.000Z",
|
|
58561
58561
|
queryLimit: 25,
|
|
58562
58562
|
evaluationLimit: 3,
|
|
58563
58563
|
hiddenSampleSize: 1000,
|
|
@@ -58634,6 +58634,35 @@ var challengeCatalog = [
|
|
|
58634
58634
|
}
|
|
58635
58635
|
];
|
|
58636
58636
|
var playableChallenges = challengeCatalog.filter((challenge) => challenge.playable);
|
|
58637
|
+
var challengeBySlug = (slug) => challengeCatalog.find((challenge) => challenge.slug === slug);
|
|
58638
|
+
var challengeTimeZoneOffsetMs = 5 * 60 * 60 * 1000;
|
|
58639
|
+
var monthNames = [
|
|
58640
|
+
"January",
|
|
58641
|
+
"February",
|
|
58642
|
+
"March",
|
|
58643
|
+
"April",
|
|
58644
|
+
"May",
|
|
58645
|
+
"June",
|
|
58646
|
+
"July",
|
|
58647
|
+
"August",
|
|
58648
|
+
"September",
|
|
58649
|
+
"October",
|
|
58650
|
+
"November",
|
|
58651
|
+
"December"
|
|
58652
|
+
];
|
|
58653
|
+
var formatChallengeOpeningInPeru = (opensAt) => {
|
|
58654
|
+
const localTime = new Date(Date.parse(opensAt) - challengeTimeZoneOffsetMs);
|
|
58655
|
+
const month = monthNames[localTime.getUTCMonth()];
|
|
58656
|
+
if (!month || Number.isNaN(localTime.getTime())) {
|
|
58657
|
+
throw new Error("Challenge opening time is invalid");
|
|
58658
|
+
}
|
|
58659
|
+
const day = localTime.getUTCDate();
|
|
58660
|
+
const year = localTime.getUTCFullYear();
|
|
58661
|
+
const hour = String(localTime.getUTCHours()).padStart(2, "0");
|
|
58662
|
+
const minute = String(localTime.getUTCMinutes()).padStart(2, "0");
|
|
58663
|
+
return `${month} ${day}, ${year} at ${hour}:${minute} (UTC-5)`;
|
|
58664
|
+
};
|
|
58665
|
+
var challengeOpeningNotice = (title, opensAt) => `${title} opens ${formatChallengeOpeningInPeru(opensAt)}. Queries and evaluations are disabled until then; no attempts will be consumed.`;
|
|
58637
58666
|
var ChallengeSlugSchema = exports_Schema.Literals([
|
|
58638
58667
|
"black-box",
|
|
58639
58668
|
"last-mile",
|
|
@@ -59649,12 +59678,18 @@ var remainingBar = (used, limit) => {
|
|
|
59649
59678
|
return `${"█".repeat(filled)}${"░".repeat(width - filled)}`;
|
|
59650
59679
|
};
|
|
59651
59680
|
var percent = (value3) => `${(value3 * 100).toFixed(2)}%`;
|
|
59681
|
+
var challengeLaunchNotice = (title, opensAt, now3 = new Date) => {
|
|
59682
|
+
if (now3.getTime() >= Date.parse(opensAt))
|
|
59683
|
+
return;
|
|
59684
|
+
return challengeOpeningNotice(title, opensAt);
|
|
59685
|
+
};
|
|
59652
59686
|
var challengeListText = (catalog) => {
|
|
59653
59687
|
const lines2 = ["Hack the Andes challenges", ""];
|
|
59654
59688
|
for (const challenge of catalog.challenges) {
|
|
59655
59689
|
let state = "open";
|
|
59656
|
-
if (!challenge.open)
|
|
59657
|
-
state = `opens ${challenge.opensAt
|
|
59690
|
+
if (!challenge.open) {
|
|
59691
|
+
state = `opens ${formatChallengeOpeningInPeru(challenge.opensAt)}`;
|
|
59692
|
+
}
|
|
59658
59693
|
const playable = challenge.playable ? "" : " (coming later)";
|
|
59659
59694
|
lines2.push(`${challenge.code} ${challenge.theme} — ${challenge.title}${playable}`);
|
|
59660
59695
|
lines2.push(` ${challenge.coreSkill} · ${challenge.formatLabel} · ${state}`);
|
|
@@ -60134,21 +60169,17 @@ var challengeQuickstart = {
|
|
|
60134
60169
|
],
|
|
60135
60170
|
helpCommand: "chofex challenge query --help"
|
|
60136
60171
|
};
|
|
60137
|
-
var
|
|
60138
|
-
const
|
|
60139
|
-
|
|
60140
|
-
|
|
60141
|
-
|
|
60142
|
-
|
|
60143
|
-
|
|
60144
|
-
|
|
60145
|
-
|
|
60146
|
-
"
|
|
60147
|
-
|
|
60148
|
-
"",
|
|
60149
|
-
"FIELD GUIDE",
|
|
60150
|
-
""
|
|
60151
|
-
];
|
|
60172
|
+
var launchNoticeFor = (slug) => {
|
|
60173
|
+
const challenge = challengeBySlug(slug);
|
|
60174
|
+
if (!challenge)
|
|
60175
|
+
return;
|
|
60176
|
+
return challengeLaunchNotice(challenge.theme, challenge.opensAt);
|
|
60177
|
+
};
|
|
60178
|
+
var challengeQuickstartText = (launchNotice) => {
|
|
60179
|
+
const lines2 = [challengeQuickstart.title];
|
|
60180
|
+
if (launchNotice)
|
|
60181
|
+
lines2.push("", "LAUNCH NOTICE", launchNotice);
|
|
60182
|
+
lines2.push("", ...challengeQuickstart.story, "", "YOUR MISSION", challengeQuickstart.mission, "", "RULES OF THE GAME", ...challengeQuickstart.rules.map((rule) => `• ${rule}`), "", "FIELD GUIDE", "");
|
|
60152
60183
|
for (const item of challengeQuickstart.workflow) {
|
|
60153
60184
|
lines2.push(`${item.step}. ${item.action}`);
|
|
60154
60185
|
lines2.push(` ${item.command}`);
|
|
@@ -60334,16 +60365,22 @@ var rankingCommand = exports_Command.make("ranking", { challenge: challengeFlag
|
|
|
60334
60365
|
]));
|
|
60335
60366
|
var challengeCommand = exports_Command.make("challenge", {}, exports_Effect.fn("challengeQuickstartCommand")(function* () {
|
|
60336
60367
|
const options = yield* root;
|
|
60368
|
+
const launchNotice = launchNoticeFor(defaultChallengeSlug);
|
|
60337
60369
|
if (options.output === "json") {
|
|
60370
|
+
const data = {
|
|
60371
|
+
...challengeQuickstart
|
|
60372
|
+
};
|
|
60373
|
+
if (launchNotice)
|
|
60374
|
+
data.notice = launchNotice;
|
|
60338
60375
|
yield* printJson({
|
|
60339
60376
|
version: 1,
|
|
60340
60377
|
ok: true,
|
|
60341
60378
|
requestId: crypto.randomUUID(),
|
|
60342
|
-
data
|
|
60379
|
+
data
|
|
60343
60380
|
});
|
|
60344
60381
|
return;
|
|
60345
60382
|
}
|
|
60346
|
-
yield* exports_Console.log(challengeQuickstartText());
|
|
60383
|
+
yield* exports_Console.log(challengeQuickstartText(launchNotice));
|
|
60347
60384
|
})).pipe(exports_Command.withDescription("Play mini technical challenges. Start here: learn the Black Box workflow from first query to leaderboard. Run without a subcommand for the guided quickstart."), exports_Command.withExamples([
|
|
60348
60385
|
{
|
|
60349
60386
|
command: "chofex challenge",
|