chofex-cli 0.1.197 → 0.1.203
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/README.md +69 -40
- package/dist/index.js +172 -156
- package/package.json +2 -22
package/README.md
CHANGED
|
@@ -1,55 +1,69 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Hack the Andes CLI
|
|
2
2
|
|
|
3
3
|
Command-line client for Hack the Andes.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
npm install --global
|
|
8
|
+
npm install --global hacktheandes-cli@latest
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
También puedes instalar `chofex-cli`. Ambos paquetes instalan los comandos
|
|
12
|
+
`andes` y `chofex`, con los mismos subcomandos, configuración y sesión guardada.
|
|
13
|
+
Instala uno de los dos paquetes.
|
|
12
14
|
|
|
13
15
|
```sh
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
chofex
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
andes register
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Para instalarlo dentro de un proyecto, usa `npm install hacktheandes-cli` y
|
|
20
|
+
ejecuta `npx andes register`.
|
|
21
|
+
|
|
22
|
+
El comando recomendado es `andes`. `chofex` sigue disponible por compatibilidad.
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
andes
|
|
26
|
+
andes whoami
|
|
27
|
+
andes update
|
|
28
|
+
andes upgrade
|
|
29
|
+
andes register
|
|
30
|
+
andes status
|
|
31
|
+
andes requirements
|
|
32
|
+
andes challenge list
|
|
33
|
+
andes challenge query --challenge black-box
|
|
34
|
+
andes challenge notebook --challenge black-box
|
|
35
|
+
andes challenge test --challenge black-box --source ./shipping.js
|
|
36
|
+
andes challenge evaluate --challenge black-box --source ./shipping.js
|
|
37
|
+
andes challenge ranking --challenge black-box
|
|
38
|
+
andes challenge init --challenge broken-agent
|
|
28
39
|
cd broken-agent && npm test
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
40
|
+
andes challenge test --challenge broken-agent --source ./scheduler.js
|
|
41
|
+
andes challenge evaluate --challenge broken-agent --source ./scheduler.js --review ./review.json
|
|
42
|
+
andes challenge ranking --challenge broken-agent
|
|
43
|
+
andes confirm
|
|
44
|
+
andes badge
|
|
45
|
+
andes badge regenerate
|
|
35
46
|
```
|
|
36
47
|
|
|
37
|
-
`
|
|
48
|
+
`andes update` and `andes upgrade` are interchangeable; both update the CLI
|
|
38
49
|
to the latest published version.
|
|
39
50
|
|
|
40
|
-
Las
|
|
51
|
+
Las actualizaciones conservan el paquete instalado: `hacktheandes-cli` o
|
|
52
|
+
`chofex-cli`, independientemente del comando que uses.
|
|
53
|
+
|
|
54
|
+
Las copias instaladas también consultan npm cada vez que se inicia `andes` e
|
|
41
55
|
instalan una versión publicada más reciente antes de ejecutar el comando. Si
|
|
42
56
|
npm o la red no están disponibles temporalmente, se continúa con la versión
|
|
43
57
|
actual. Usa `CHOFEX_AUTO_UPDATE=0` para desactivar esta comprobación.
|
|
44
58
|
|
|
45
|
-
`
|
|
59
|
+
`andes register` collects and submits an application with full name, role,
|
|
46
60
|
optional phone number, bio, portfolio URL, shipped project, LinkedIn and GitHub
|
|
47
61
|
URLs, and Terms and Conditions. Use `--input` to submit a completed JSON
|
|
48
62
|
application.
|
|
49
63
|
Acceptance creates a default badge from the Clerk profile visible to reviewers.
|
|
50
|
-
`
|
|
64
|
+
`andes confirm` updates the public name, one-line description, and picture
|
|
51
65
|
while separately collecting the legal full name and venue details required for attendance. After confirmation,
|
|
52
|
-
`
|
|
66
|
+
`andes badge regenerate` can also update those public fields and the QR
|
|
53
67
|
destination without changing the submitted application.
|
|
54
68
|
The technical challenges do not block application submission, but they are
|
|
55
69
|
mandatory for admission. An application does not reserve a seat; organizers
|
|
@@ -60,19 +74,19 @@ version; legacy attempts do not count toward admission.
|
|
|
60
74
|
|
|
61
75
|
The public ranking is read-only at `https://hacktheandes.com/challenges`.
|
|
62
76
|
|
|
63
|
-
Run `
|
|
64
|
-
the main commands. Run `
|
|
77
|
+
Run `andes` for a compact retro welcome screen with a pixel Sacred Valley and
|
|
78
|
+
the main commands. Run `andes --help` for the full command reference. The
|
|
65
79
|
landscape uses colored terminal cells, with readable text that works with your
|
|
66
80
|
terminal's line spacing. It adapts to the terminal width and has a plain ASCII
|
|
67
81
|
fallback when color is disabled with `NO_COLOR`. JSON output and individual
|
|
68
82
|
command results omit the welcome screen.
|
|
69
83
|
|
|
70
|
-
For agent or script input, `
|
|
71
|
-
`
|
|
84
|
+
For agent or script input, `andes schema --stage application` and
|
|
85
|
+
`andes schema --stage acceptance` print complete templates containing every
|
|
72
86
|
accepted JSON key. Validate a completed input file locally before submitting it:
|
|
73
87
|
|
|
74
88
|
```sh
|
|
75
|
-
|
|
89
|
+
andes --output json validate --stage application --input application.json
|
|
76
90
|
```
|
|
77
91
|
|
|
78
92
|
Validation does not contact the API, and a successful result does not echo input
|
|
@@ -80,12 +94,12 @@ values. Local validation errors include `acceptedFields` in JSON mode. The
|
|
|
80
94
|
`status` response already includes both the registration and its requirements;
|
|
81
95
|
use `requirements` only when requirements-only human output is preferred.
|
|
82
96
|
|
|
83
|
-
Run `
|
|
97
|
+
Run `andes login` to authenticate. For automation, provide an OAuth access
|
|
84
98
|
token with `CHOFEX_TOKEN`.
|
|
85
99
|
|
|
86
100
|
### Authentication troubleshooting
|
|
87
101
|
|
|
88
|
-
If `
|
|
102
|
+
If `andes login` succeeds but `whoami` or an authenticated challenge command
|
|
89
103
|
returns `AUTHENTICATION_REQUIRED`, first remove any token or API URL overrides
|
|
90
104
|
from the shell. In Bash or Zsh:
|
|
91
105
|
|
|
@@ -102,7 +116,7 @@ Remove-Item Env:CHOFEX_TOKEN, Env:CHOFEX_API_URL -ErrorAction SilentlyContinue
|
|
|
102
116
|
Update by repeating the installation method you originally used. For npm:
|
|
103
117
|
|
|
104
118
|
```sh
|
|
105
|
-
npm install --global
|
|
119
|
+
npm install --global hacktheandes-cli@latest
|
|
106
120
|
```
|
|
107
121
|
|
|
108
122
|
For the standalone installer:
|
|
@@ -114,10 +128,10 @@ curl -fsSL https://hacktheandes.com/install | bash
|
|
|
114
128
|
Then renew the stored session and verify it:
|
|
115
129
|
|
|
116
130
|
```sh
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
131
|
+
andes --version
|
|
132
|
+
andes logout
|
|
133
|
+
andes login
|
|
134
|
+
andes --output json whoami
|
|
121
135
|
```
|
|
122
136
|
|
|
123
137
|
Versions before `0.1.140` used a retired API origin whose cross-origin redirect
|
|
@@ -145,3 +159,18 @@ override the API URL when running against a local or preview Chofex instance.
|
|
|
145
159
|
|
|
146
160
|
Registration links use `https://hacktheandes.com` by default. Local or preview
|
|
147
161
|
environments can override that origin with `CHOFEX_PUBLIC_SITE_URL`.
|
|
162
|
+
|
|
163
|
+
## Verificar los paquetes npm
|
|
164
|
+
|
|
165
|
+
Desde la raíz del repositorio:
|
|
166
|
+
|
|
167
|
+
```sh
|
|
168
|
+
bun --filter chofex-cli build
|
|
169
|
+
bun --filter chofex-cli prepare-packages
|
|
170
|
+
bun --filter chofex-cli verify-packages
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
La verificación empaqueta e instala ambos paquetes en directorios temporales.
|
|
174
|
+
Comprueba los dos comandos, la ayuda de registro, la salida JSON y el paquete
|
|
175
|
+
que solicita cada actualización. El workflow de publicación ejecuta estos
|
|
176
|
+
mismos pasos antes de publicar ambos paquetes con la misma versión.
|
package/dist/index.js
CHANGED
|
@@ -2319,9 +2319,9 @@ var require_envpath = __commonJS((exports, module) => {
|
|
|
2319
2319
|
splitPath: () => splitPath
|
|
2320
2320
|
});
|
|
2321
2321
|
module.exports = __toCommonJS(envpath_exports);
|
|
2322
|
-
var
|
|
2322
|
+
var import_node_path2 = __toESM2(__require("node:path"));
|
|
2323
2323
|
function prependPathEntries(pathValue, directories) {
|
|
2324
|
-
const pathParts = pathValue.split(
|
|
2324
|
+
const pathParts = pathValue.split(import_node_path2.default.delimiter).filter(Boolean);
|
|
2325
2325
|
const prepended = [];
|
|
2326
2326
|
for (const directory3 of directories) {
|
|
2327
2327
|
if (!pathParts.includes(directory3) && !prepended.includes(directory3)) {
|
|
@@ -2331,10 +2331,10 @@ var require_envpath = __commonJS((exports, module) => {
|
|
|
2331
2331
|
if (prepended.length === 0) {
|
|
2332
2332
|
return pathValue;
|
|
2333
2333
|
}
|
|
2334
|
-
return pathValue === "" || pathValue ===
|
|
2334
|
+
return pathValue === "" || pathValue === import_node_path2.default.delimiter ? `${prepended.join(import_node_path2.default.delimiter)}${pathValue}` : [...prepended, pathValue].join(import_node_path2.default.delimiter);
|
|
2335
2335
|
}
|
|
2336
2336
|
function splitPath(pathValue) {
|
|
2337
|
-
return pathValue.split(
|
|
2337
|
+
return pathValue.split(import_node_path2.default.delimiter).filter(Boolean);
|
|
2338
2338
|
}
|
|
2339
2339
|
function getEnvPath(env = process.env) {
|
|
2340
2340
|
if (process.platform !== "win32") {
|
|
@@ -2436,7 +2436,7 @@ var require_fsutils = __commonJS((exports, module) => {
|
|
|
2436
2436
|
});
|
|
2437
2437
|
module.exports = __toCommonJS(fsutils_exports);
|
|
2438
2438
|
var import_promises4 = __require("node:fs/promises");
|
|
2439
|
-
var
|
|
2439
|
+
var import_node_path2 = __toESM2(__require("node:path"));
|
|
2440
2440
|
var import_errutils = require_errutils();
|
|
2441
2441
|
async function getCanonicalPath(filePath) {
|
|
2442
2442
|
try {
|
|
@@ -2447,14 +2447,14 @@ var require_fsutils = __commonJS((exports, module) => {
|
|
|
2447
2447
|
}
|
|
2448
2448
|
function getDirectoriesBetween(parent, child) {
|
|
2449
2449
|
const directories = [];
|
|
2450
|
-
let current =
|
|
2451
|
-
const resolvedParent =
|
|
2450
|
+
let current = import_node_path2.default.resolve(child);
|
|
2451
|
+
const resolvedParent = import_node_path2.default.resolve(parent);
|
|
2452
2452
|
while (true) {
|
|
2453
2453
|
directories.push(current);
|
|
2454
2454
|
if (current === resolvedParent) {
|
|
2455
2455
|
return directories.reverse();
|
|
2456
2456
|
}
|
|
2457
|
-
const next =
|
|
2457
|
+
const next = import_node_path2.default.dirname(current);
|
|
2458
2458
|
if (next === current) {
|
|
2459
2459
|
return [];
|
|
2460
2460
|
}
|
|
@@ -2472,18 +2472,18 @@ var require_fsutils = __commonJS((exports, module) => {
|
|
|
2472
2472
|
}
|
|
2473
2473
|
}
|
|
2474
2474
|
function isNodeScript(filePath) {
|
|
2475
|
-
return [".js", ".cjs", ".mjs"].includes(
|
|
2475
|
+
return [".js", ".cjs", ".mjs"].includes(import_node_path2.default.extname(filePath));
|
|
2476
2476
|
}
|
|
2477
2477
|
function isSubpath(parent, child) {
|
|
2478
|
-
const relativePath =
|
|
2479
|
-
return relativePath === "" || relativePath !== "" && !relativePath.startsWith("..") && !
|
|
2478
|
+
const relativePath = import_node_path2.default.relative(parent, child);
|
|
2479
|
+
return relativePath === "" || relativePath !== "" && !relativePath.startsWith("..") && !import_node_path2.default.isAbsolute(relativePath);
|
|
2480
2480
|
}
|
|
2481
2481
|
function getCommandBase(command) {
|
|
2482
|
-
const extension =
|
|
2482
|
+
const extension = import_node_path2.default.extname(command).toLowerCase();
|
|
2483
2483
|
if (process.platform === "win32" && [".cmd", ".exe"].includes(extension)) {
|
|
2484
|
-
return
|
|
2484
|
+
return import_node_path2.default.basename(command, extension);
|
|
2485
2485
|
}
|
|
2486
|
-
return
|
|
2486
|
+
return import_node_path2.default.basename(command);
|
|
2487
2487
|
}
|
|
2488
2488
|
});
|
|
2489
2489
|
|
|
@@ -2520,11 +2520,11 @@ var require_safety = __commonJS((exports, module) => {
|
|
|
2520
2520
|
});
|
|
2521
2521
|
module.exports = __toCommonJS(safety_exports);
|
|
2522
2522
|
var import_promises4 = __require("node:fs/promises");
|
|
2523
|
-
var
|
|
2523
|
+
var import_node_path2 = __toESM2(__require("node:path"));
|
|
2524
2524
|
var import_errutils = require_errutils();
|
|
2525
2525
|
var import_fsutils = require_fsutils();
|
|
2526
2526
|
async function getSkippedNodeModulesReason(nodeModulesDirectory, parentDirectories) {
|
|
2527
|
-
const parentDirectory =
|
|
2527
|
+
const parentDirectory = import_node_path2.default.dirname(nodeModulesDirectory);
|
|
2528
2528
|
parentDirectories ??= [parentDirectory];
|
|
2529
2529
|
for (const directory3 of parentDirectories) {
|
|
2530
2530
|
let unsafeParentReason;
|
|
@@ -2551,7 +2551,7 @@ var require_safety = __commonJS((exports, module) => {
|
|
|
2551
2551
|
if (unsafeNodeModulesReason) {
|
|
2552
2552
|
return unsafeNodeModulesReason;
|
|
2553
2553
|
}
|
|
2554
|
-
return await getSkippedLocalBinDirectoryReason(
|
|
2554
|
+
return await getSkippedLocalBinDirectoryReason(import_node_path2.default.join(nodeModulesDirectory, ".bin"));
|
|
2555
2555
|
}
|
|
2556
2556
|
async function getSkippedLocalBinDirectoryReason(localBinDirectory) {
|
|
2557
2557
|
const result3 = await (0, import_fsutils.statIfExists)(localBinDirectory);
|
|
@@ -2588,7 +2588,7 @@ var require_safety = __commonJS((exports, module) => {
|
|
|
2588
2588
|
return null;
|
|
2589
2589
|
}
|
|
2590
2590
|
async function getUnsafePackageFileReason(packageDirectory, filePath) {
|
|
2591
|
-
const directoriesToCheck = (0, import_fsutils.getDirectoriesBetween)(packageDirectory,
|
|
2591
|
+
const directoriesToCheck = (0, import_fsutils.getDirectoriesBetween)(packageDirectory, import_node_path2.default.dirname(filePath));
|
|
2592
2592
|
if (directoriesToCheck.length === 0) {
|
|
2593
2593
|
return `${filePath} resolves outside package`;
|
|
2594
2594
|
}
|
|
@@ -2667,14 +2667,14 @@ var require_lookup = __commonJS((exports, module) => {
|
|
|
2667
2667
|
});
|
|
2668
2668
|
module.exports = __toCommonJS(lookup_exports);
|
|
2669
2669
|
var import_promises4 = __require("node:fs/promises");
|
|
2670
|
-
var
|
|
2670
|
+
var import_node_path2 = __toESM2(__require("node:path"));
|
|
2671
2671
|
var import_envpath = require_envpath();
|
|
2672
2672
|
var import_errutils = require_errutils();
|
|
2673
2673
|
var import_fsutils = require_fsutils();
|
|
2674
2674
|
var import_safety = require_safety();
|
|
2675
2675
|
var cliInvocationCache = /* @__PURE__ */ new Map;
|
|
2676
2676
|
async function findVercelCli2(options = {}) {
|
|
2677
|
-
const cwd =
|
|
2677
|
+
const cwd = import_node_path2.default.resolve(options.cwd ?? process.cwd());
|
|
2678
2678
|
const pathValue = options.path ?? (0, import_envpath.getEnvPath)(process.env);
|
|
2679
2679
|
const resolution = await resolveCachedCliInvocation(cwd, pathValue);
|
|
2680
2680
|
return resolution.found ? toVercelCliInvocation(resolution) : null;
|
|
@@ -2751,8 +2751,8 @@ var require_lookup = __commonJS((exports, module) => {
|
|
|
2751
2751
|
return null;
|
|
2752
2752
|
}
|
|
2753
2753
|
function getPathCommandCandidate(directory3, command, cwd) {
|
|
2754
|
-
const candidateDirectory =
|
|
2755
|
-
return
|
|
2754
|
+
const candidateDirectory = import_node_path2.default.isAbsolute(directory3) ? directory3 : import_node_path2.default.resolve(cwd, directory3);
|
|
2755
|
+
return import_node_path2.default.join(candidateDirectory, command);
|
|
2756
2756
|
}
|
|
2757
2757
|
async function canAccessCommandCandidate(candidate, localBinSearch, diagnostics) {
|
|
2758
2758
|
try {
|
|
@@ -2804,12 +2804,12 @@ var require_lookup = __commonJS((exports, module) => {
|
|
|
2804
2804
|
return commandBases.flatMap((command) => extensions.map((extension) => `${command}${extension}`));
|
|
2805
2805
|
}
|
|
2806
2806
|
async function getLocalBinSearch(cwd) {
|
|
2807
|
-
const searchRoot = await (0, import_fsutils.getCanonicalPath)(
|
|
2807
|
+
const searchRoot = await (0, import_fsutils.getCanonicalPath)(import_node_path2.default.resolve(cwd));
|
|
2808
2808
|
const ancestorSearch = await getAncestorDirectorySearch(searchRoot);
|
|
2809
2809
|
const skippedNodeModules = [];
|
|
2810
2810
|
const directories = [];
|
|
2811
2811
|
for (const directory3 of ancestorSearch.directories) {
|
|
2812
|
-
const nodeModulesDirectory =
|
|
2812
|
+
const nodeModulesDirectory = import_node_path2.default.join(directory3, "node_modules");
|
|
2813
2813
|
const parentDirectories = ancestorSearch.stopReason === "project-root-marker" ? (0, import_fsutils.getDirectoriesBetween)(ancestorSearch.stoppedAt, directory3) : (0, import_fsutils.getDirectoriesBetween)(directory3, searchRoot);
|
|
2814
2814
|
const skippedReason = await (0, import_safety.getSkippedNodeModulesReason)(nodeModulesDirectory, parentDirectories);
|
|
2815
2815
|
if (skippedReason) {
|
|
@@ -2819,7 +2819,7 @@ var require_lookup = __commonJS((exports, module) => {
|
|
|
2819
2819
|
});
|
|
2820
2820
|
continue;
|
|
2821
2821
|
}
|
|
2822
|
-
directories.push(
|
|
2822
|
+
directories.push(import_node_path2.default.join(nodeModulesDirectory, ".bin"));
|
|
2823
2823
|
}
|
|
2824
2824
|
return {
|
|
2825
2825
|
directories,
|
|
@@ -2834,7 +2834,7 @@ var require_lookup = __commonJS((exports, module) => {
|
|
|
2834
2834
|
}
|
|
2835
2835
|
async function getAncestorDirectorySearch(cwd) {
|
|
2836
2836
|
const directories = [];
|
|
2837
|
-
let current =
|
|
2837
|
+
let current = import_node_path2.default.resolve(cwd);
|
|
2838
2838
|
while (true) {
|
|
2839
2839
|
directories.push(current);
|
|
2840
2840
|
const marker = await getProjectRootMarker(current);
|
|
@@ -2846,7 +2846,7 @@ var require_lookup = __commonJS((exports, module) => {
|
|
|
2846
2846
|
markerPath: marker.path
|
|
2847
2847
|
};
|
|
2848
2848
|
}
|
|
2849
|
-
const parent =
|
|
2849
|
+
const parent = import_node_path2.default.dirname(current);
|
|
2850
2850
|
if (parent === current) {
|
|
2851
2851
|
return {
|
|
2852
2852
|
directories,
|
|
@@ -2858,7 +2858,7 @@ var require_lookup = __commonJS((exports, module) => {
|
|
|
2858
2858
|
}
|
|
2859
2859
|
}
|
|
2860
2860
|
async function getProjectRootMarker(directory3) {
|
|
2861
|
-
const gitPath =
|
|
2861
|
+
const gitPath = import_node_path2.default.join(directory3, ".git");
|
|
2862
2862
|
try {
|
|
2863
2863
|
await (0, import_promises4.stat)(gitPath);
|
|
2864
2864
|
return { path: gitPath };
|
|
@@ -2866,23 +2866,23 @@ var require_lookup = __commonJS((exports, module) => {
|
|
|
2866
2866
|
return null;
|
|
2867
2867
|
}
|
|
2868
2868
|
async function getLocalBinDirectory(filePath, localBinDirectories) {
|
|
2869
|
-
const resolvedFilePath =
|
|
2869
|
+
const resolvedFilePath = import_node_path2.default.resolve(filePath);
|
|
2870
2870
|
let canonicalFilePath = resolvedFilePath;
|
|
2871
2871
|
try {
|
|
2872
|
-
canonicalFilePath =
|
|
2872
|
+
canonicalFilePath = import_node_path2.default.join(await (0, import_promises4.realpath)(import_node_path2.default.dirname(resolvedFilePath)), import_node_path2.default.basename(resolvedFilePath));
|
|
2873
2873
|
} catch {}
|
|
2874
2874
|
for (let localBinDirectory of localBinDirectories) {
|
|
2875
2875
|
try {
|
|
2876
2876
|
localBinDirectory = await (0, import_promises4.realpath)(localBinDirectory);
|
|
2877
2877
|
} catch {}
|
|
2878
|
-
if (canonicalFilePath.startsWith(`${localBinDirectory}${
|
|
2878
|
+
if (canonicalFilePath.startsWith(`${localBinDirectory}${import_node_path2.default.sep}`)) {
|
|
2879
2879
|
return localBinDirectory;
|
|
2880
2880
|
}
|
|
2881
2881
|
}
|
|
2882
2882
|
return null;
|
|
2883
2883
|
}
|
|
2884
2884
|
async function getNodeModulesBinDirectory(filePath) {
|
|
2885
|
-
const candidateDirectory =
|
|
2885
|
+
const candidateDirectory = import_node_path2.default.resolve(import_node_path2.default.dirname(filePath));
|
|
2886
2886
|
const directories = [candidateDirectory];
|
|
2887
2887
|
try {
|
|
2888
2888
|
const canonicalDirectory = await (0, import_promises4.realpath)(candidateDirectory);
|
|
@@ -2891,7 +2891,7 @@ var require_lookup = __commonJS((exports, module) => {
|
|
|
2891
2891
|
}
|
|
2892
2892
|
} catch {}
|
|
2893
2893
|
for (const directory3 of directories) {
|
|
2894
|
-
if (
|
|
2894
|
+
if (import_node_path2.default.basename(directory3) === ".bin" && import_node_path2.default.basename(import_node_path2.default.dirname(directory3)) === "node_modules") {
|
|
2895
2895
|
return directory3;
|
|
2896
2896
|
}
|
|
2897
2897
|
}
|
|
@@ -2906,7 +2906,7 @@ var require_lookup = __commonJS((exports, module) => {
|
|
|
2906
2906
|
if (!nodeModulesBinDirectory) {
|
|
2907
2907
|
return null;
|
|
2908
2908
|
}
|
|
2909
|
-
const nodeModulesDirectory =
|
|
2909
|
+
const nodeModulesDirectory = import_node_path2.default.dirname(nodeModulesBinDirectory);
|
|
2910
2910
|
const skippedReason = await (0, import_safety.getSkippedNodeModulesReason)(nodeModulesDirectory);
|
|
2911
2911
|
if (skippedReason) {
|
|
2912
2912
|
return { reason: `local node_modules is ${skippedReason}` };
|
|
@@ -2915,8 +2915,8 @@ var require_lookup = __commonJS((exports, module) => {
|
|
|
2915
2915
|
}
|
|
2916
2916
|
async function getLocalVercelPackageBin(command, localBinDirectory) {
|
|
2917
2917
|
const commandBase = (0, import_fsutils.getCommandBase)(command);
|
|
2918
|
-
const nodeModulesDirectory =
|
|
2919
|
-
if (commandBase !== "vercel" ||
|
|
2918
|
+
const nodeModulesDirectory = import_node_path2.default.dirname(localBinDirectory);
|
|
2919
|
+
if (commandBase !== "vercel" || import_node_path2.default.basename(nodeModulesDirectory) !== "node_modules") {
|
|
2920
2920
|
return { reason: "not a local vercel bin" };
|
|
2921
2921
|
}
|
|
2922
2922
|
try {
|
|
@@ -2937,7 +2937,7 @@ var require_lookup = __commonJS((exports, module) => {
|
|
|
2937
2937
|
}
|
|
2938
2938
|
}
|
|
2939
2939
|
async function getLocalVercelPackage(nodeModulesDirectory) {
|
|
2940
|
-
const packageDirectory =
|
|
2940
|
+
const packageDirectory = import_node_path2.default.join(nodeModulesDirectory, "vercel");
|
|
2941
2941
|
const realNodeModulesDirectory = await (0, import_promises4.realpath)(nodeModulesDirectory);
|
|
2942
2942
|
const realPackageDirectory = await (0, import_promises4.realpath)(packageDirectory);
|
|
2943
2943
|
if (!(0, import_fsutils.isSubpath)(realNodeModulesDirectory, realPackageDirectory)) {
|
|
@@ -2958,7 +2958,7 @@ var require_lookup = __commonJS((exports, module) => {
|
|
|
2958
2958
|
};
|
|
2959
2959
|
}
|
|
2960
2960
|
async function readLocalVercelPackageJson(realPackageDirectory) {
|
|
2961
|
-
const packageJsonPath =
|
|
2961
|
+
const packageJsonPath = import_node_path2.default.join(realPackageDirectory, "package.json");
|
|
2962
2962
|
const realPackageJsonPath = await (0, import_promises4.realpath)(packageJsonPath);
|
|
2963
2963
|
if (!(0, import_fsutils.isSubpath)(realPackageDirectory, realPackageJsonPath)) {
|
|
2964
2964
|
return { reason: "local vercel package.json resolves outside package" };
|
|
@@ -2983,7 +2983,7 @@ var require_lookup = __commonJS((exports, module) => {
|
|
|
2983
2983
|
if (!binTarget) {
|
|
2984
2984
|
return { reason: "local vercel package does not declare bin.vercel" };
|
|
2985
2985
|
}
|
|
2986
|
-
const declaredBinPath =
|
|
2986
|
+
const declaredBinPath = import_node_path2.default.resolve(realPackageDirectory, binTarget);
|
|
2987
2987
|
const realDeclaredBinPath = await (0, import_promises4.realpath)(declaredBinPath);
|
|
2988
2988
|
if (!(0, import_fsutils.isSubpath)(realPackageDirectory, realDeclaredBinPath)) {
|
|
2989
2989
|
return { reason: "local vercel package bin resolves outside package" };
|
|
@@ -3050,13 +3050,13 @@ var require_exec = __commonJS((exports, module) => {
|
|
|
3050
3050
|
execVercelCli: () => execVercelCli2
|
|
3051
3051
|
});
|
|
3052
3052
|
module.exports = __toCommonJS(exec_exports);
|
|
3053
|
-
var
|
|
3053
|
+
var import_node_path2 = __toESM2(__require("node:path"));
|
|
3054
3054
|
var import_execa = __toESM2(require_execa());
|
|
3055
3055
|
var import_envpath = require_envpath();
|
|
3056
3056
|
var import_errors9 = require_errors();
|
|
3057
3057
|
var import_lookup = require_lookup();
|
|
3058
3058
|
async function execVercelCli2(args2, options = {}) {
|
|
3059
|
-
const cwd =
|
|
3059
|
+
const cwd = import_node_path2.default.resolve(options.cwd ?? process.cwd());
|
|
3060
3060
|
await (0, import_errors9.assertValidCwd)(cwd);
|
|
3061
3061
|
const env = mergeExecEnv(options.env);
|
|
3062
3062
|
const pathValue = (0, import_envpath.getEnvPath)(env);
|
|
@@ -3111,7 +3111,7 @@ var require_exec = __commonJS((exports, module) => {
|
|
|
3111
3111
|
}
|
|
3112
3112
|
async function prependLocalBinsToEnvPath(cwd, env = process.env) {
|
|
3113
3113
|
const localPath = await prependLocalBinsToPath(cwd, (0, import_envpath.getEnvPath)(env));
|
|
3114
|
-
return (0, import_envpath.setEnvPath)(env, (0, import_envpath.prependPathEntries)(localPath, [
|
|
3114
|
+
return (0, import_envpath.setEnvPath)(env, (0, import_envpath.prependPathEntries)(localPath, [import_node_path2.default.dirname(process.execPath)]));
|
|
3115
3115
|
}
|
|
3116
3116
|
async function prependLocalBinsToPath(cwd, pathValue = "") {
|
|
3117
3117
|
return (0, import_envpath.prependPathEntries)(pathValue, (await (0, import_lookup.getLocalBinSearch)(cwd)).directories);
|
|
@@ -5120,12 +5120,12 @@ var require_dist2 = __commonJS((exports, module) => {
|
|
|
5120
5120
|
var authConfigSchema2 = authConfigSchema.passthrough();
|
|
5121
5121
|
var import_node_fs2 = __toESM2(__require("fs"));
|
|
5122
5122
|
var import_node_path2 = __toESM2(__require("path"));
|
|
5123
|
-
var
|
|
5124
|
-
var
|
|
5123
|
+
var import_node_fs3 = __toESM2(__require("fs"));
|
|
5124
|
+
var import_node_path3 = __toESM2(__require("path"));
|
|
5125
5125
|
var import_node_os = __require("os");
|
|
5126
5126
|
function isReadableDirectory(targetPath) {
|
|
5127
5127
|
try {
|
|
5128
|
-
return
|
|
5128
|
+
return import_node_fs3.default.lstatSync(targetPath).isDirectory();
|
|
5129
5129
|
} catch {
|
|
5130
5130
|
return false;
|
|
5131
5131
|
}
|
|
@@ -5144,13 +5144,13 @@ var require_dist2 = __commonJS((exports, module) => {
|
|
|
5144
5144
|
}
|
|
5145
5145
|
function getGlobalPathConfig() {
|
|
5146
5146
|
let vercelDirectories = getDataDirectories("com.vercel.cli");
|
|
5147
|
-
return [...vercelDirectories,
|
|
5147
|
+
return [...vercelDirectories, import_node_path3.default.join((0, import_node_os.homedir)(), ".now"), ...getDataDirectories("now")].find((configPath) => isReadableDirectory(configPath)) || vercelDirectories[0];
|
|
5148
5148
|
}
|
|
5149
5149
|
function getConfigFilePath(configDir) {
|
|
5150
|
-
return
|
|
5150
|
+
return import_node_path3.default.join(configDir, "config.json");
|
|
5151
5151
|
}
|
|
5152
5152
|
function getAuthConfigFilePath(configDir) {
|
|
5153
|
-
return
|
|
5153
|
+
return import_node_path3.default.join(configDir, "auth.json");
|
|
5154
5154
|
}
|
|
5155
5155
|
var DOCS_URL = "https://vercel.com/docs/projects/project-configuration/global-configuration";
|
|
5156
5156
|
var defaultGlobalConfig = { "// Note": "This is your Vercel config file. For more information see the global configuration documentation.", "// Docs": `${DOCS_URL}#config.json` };
|
|
@@ -5398,11 +5398,11 @@ var require_oauth = __commonJS((exports, module) => {
|
|
|
5398
5398
|
if (!response.ok) {
|
|
5399
5399
|
throw new Error("Failed to discover OAuth endpoints");
|
|
5400
5400
|
}
|
|
5401
|
-
const
|
|
5402
|
-
if (!
|
|
5401
|
+
const metadata2 = await response.json();
|
|
5402
|
+
if (!metadata2 || typeof metadata2.token_endpoint !== "string") {
|
|
5403
5403
|
throw new Error("Invalid OAuth discovery response");
|
|
5404
5404
|
}
|
|
5405
|
-
const endpoint2 =
|
|
5405
|
+
const endpoint2 = metadata2.token_endpoint;
|
|
5406
5406
|
_tokenEndpoint = endpoint2;
|
|
5407
5407
|
return endpoint2;
|
|
5408
5408
|
}
|
|
@@ -14113,8 +14113,8 @@ var require_util2 = __commonJS((exports, module) => {
|
|
|
14113
14113
|
return true;
|
|
14114
14114
|
}
|
|
14115
14115
|
const strongest = getStrongestMetadata(parsedMetadata);
|
|
14116
|
-
const
|
|
14117
|
-
for (const item of
|
|
14116
|
+
const metadata2 = filterMetadataListByAlgorithm(parsedMetadata, strongest);
|
|
14117
|
+
for (const item of metadata2) {
|
|
14118
14118
|
const algorithm = item.algo;
|
|
14119
14119
|
const expectedValue = item.hash;
|
|
14120
14120
|
let actualValue = crypto2.createHash(algorithm).update(bytes).digest("base64");
|
|
@@ -14132,10 +14132,10 @@ var require_util2 = __commonJS((exports, module) => {
|
|
|
14132
14132
|
return false;
|
|
14133
14133
|
}
|
|
14134
14134
|
var parseHashWithOptions = /(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;
|
|
14135
|
-
function parseMetadata(
|
|
14135
|
+
function parseMetadata(metadata2) {
|
|
14136
14136
|
const result3 = [];
|
|
14137
14137
|
let empty9 = true;
|
|
14138
|
-
for (const token of
|
|
14138
|
+
for (const token of metadata2.split(" ")) {
|
|
14139
14139
|
empty9 = false;
|
|
14140
14140
|
const parsedToken = parseHashWithOptions.exec(token);
|
|
14141
14141
|
if (parsedToken === null || parsedToken.groups === undefined || parsedToken.groups.algo === undefined) {
|
|
@@ -14157,13 +14157,13 @@ var require_util2 = __commonJS((exports, module) => {
|
|
|
14157
14157
|
return algorithm;
|
|
14158
14158
|
}
|
|
14159
14159
|
for (let i = 1;i < metadataList.length; ++i) {
|
|
14160
|
-
const
|
|
14161
|
-
if (
|
|
14160
|
+
const metadata2 = metadataList[i];
|
|
14161
|
+
if (metadata2.algo[3] === "5") {
|
|
14162
14162
|
algorithm = "sha512";
|
|
14163
14163
|
break;
|
|
14164
14164
|
} else if (algorithm[3] === "3") {
|
|
14165
14165
|
continue;
|
|
14166
|
-
} else if (
|
|
14166
|
+
} else if (metadata2.algo[3] === "3") {
|
|
14167
14167
|
algorithm = "sha384";
|
|
14168
14168
|
}
|
|
14169
14169
|
}
|
|
@@ -27644,7 +27644,6 @@ var require_throttleit = __commonJS((exports, module) => {
|
|
|
27644
27644
|
});
|
|
27645
27645
|
|
|
27646
27646
|
// src/index.ts
|
|
27647
|
-
import { readFileSync } from "node:fs";
|
|
27648
27647
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
27649
27648
|
// ../../node_modules/@effect/platform-node/dist/NodeRuntime.js
|
|
27650
27649
|
var exports_NodeRuntime = {};
|
|
@@ -59517,7 +59516,7 @@ var jwtExpiry = (token) => {
|
|
|
59517
59516
|
};
|
|
59518
59517
|
var refresh = async (credentials) => {
|
|
59519
59518
|
if (!credentials.refreshToken) {
|
|
59520
|
-
throw new Error("Session expired. Run `
|
|
59519
|
+
throw new Error("Session expired. Run `andes login` again.");
|
|
59521
59520
|
}
|
|
59522
59521
|
const body = await tokenRequest({
|
|
59523
59522
|
grant_type: "refresh_token",
|
|
@@ -59534,7 +59533,7 @@ var authentication = async (forceRefresh = false) => {
|
|
|
59534
59533
|
}
|
|
59535
59534
|
const credentials = await readCredentials();
|
|
59536
59535
|
if (!credentials)
|
|
59537
|
-
throw new Error("Not logged in. Run `
|
|
59536
|
+
throw new Error("Not logged in. Run `andes login`.");
|
|
59538
59537
|
if (forceRefresh || credentials.expiresAt !== undefined && credentials.expiresAt <= Date.now() + 30000) {
|
|
59539
59538
|
return await refresh(credentials);
|
|
59540
59539
|
}
|
|
@@ -59561,7 +59560,7 @@ var openBrowser = (url2) => {
|
|
|
59561
59560
|
};
|
|
59562
59561
|
var assertInteractiveLogin = (interactive = process.stdin.isTTY === true) => {
|
|
59563
59562
|
if (!interactive) {
|
|
59564
|
-
throw new Error("OAuth login requires an interactive terminal. Run `
|
|
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.");
|
|
59565
59564
|
}
|
|
59566
59565
|
};
|
|
59567
59566
|
var login = async () => {
|
|
@@ -59716,7 +59715,7 @@ var authenticationRecoveryMessage = (code, message) => {
|
|
|
59716
59715
|
return message;
|
|
59717
59716
|
if (message !== "Authentication failed")
|
|
59718
59717
|
return message;
|
|
59719
|
-
return `${message}. If login just succeeded, update the CLI with \`
|
|
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\`.`;
|
|
59720
59719
|
};
|
|
59721
59720
|
var endpoint = (apiUrl, path4) => `${apiUrl.replace(/\/$/, "")}${path4}`;
|
|
59722
59721
|
var resolveAuthentication = (suppliedToken, campaignAttribution, authenticate, forceRefresh = false) => {
|
|
@@ -59987,7 +59986,7 @@ var challengeListText = (catalog) => {
|
|
|
59987
59986
|
}
|
|
59988
59987
|
const hasOpenChallenge = catalog.challenges.some((challenge) => challenge.open && challenge.playable);
|
|
59989
59988
|
if (hasOpenChallenge) {
|
|
59990
|
-
lines2.push("Empieza el challenge abierto:
|
|
59989
|
+
lines2.push("Empieza el challenge abierto: andes challenge");
|
|
59991
59990
|
} else {
|
|
59992
59991
|
lines2.push("No hay un challenge abierto. Los rankings finales siguen visibles.");
|
|
59993
59992
|
}
|
|
@@ -60024,7 +60023,7 @@ var challengeShowText = (attempt) => {
|
|
|
60024
60023
|
if (progress.shareCode)
|
|
60025
60024
|
lines3.push(`Código #${progress.shareCode}`);
|
|
60026
60025
|
}
|
|
60027
|
-
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", "
|
|
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", " andes challenge test --challenge broken-agent --source ./scheduler.js");
|
|
60028
60027
|
return lines3.join(`
|
|
60029
60028
|
`);
|
|
60030
60029
|
}
|
|
@@ -60064,17 +60063,17 @@ var challengeShowText = (attempt) => {
|
|
|
60064
60063
|
lines2.push(`Share code #${progress.shareCode}`);
|
|
60065
60064
|
}
|
|
60066
60065
|
if (challenge.closed) {
|
|
60067
|
-
lines2.push("", "SIGUIENTE PASO", "Revisa tu historial y el ranking final.", "
|
|
60066
|
+
lines2.push("", "SIGUIENTE PASO", "Revisa tu historial y el ranking final.", " andes challenge notebook", " andes challenge ranking");
|
|
60068
60067
|
return lines2.join(`
|
|
60069
60068
|
`);
|
|
60070
60069
|
}
|
|
60071
60070
|
lines2.push("", "YOUR NEXT MOVE");
|
|
60072
60071
|
if (attempt.observations.length === 0) {
|
|
60073
|
-
lines2.push("Ask the machine to price one ordinary shipment.", "
|
|
60072
|
+
lines2.push("Ask the machine to price one ordinary shipment.", " andes challenge query");
|
|
60074
60073
|
} else if (attempt.latestEvaluation === undefined) {
|
|
60075
|
-
lines2.push("Run controlled experiments, study the notebook, then test your model.", "
|
|
60074
|
+
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");
|
|
60076
60075
|
} else {
|
|
60077
|
-
lines2.push("Inspect your rank, then use remaining attempts only after improving your model.", "
|
|
60076
|
+
lines2.push("Inspect your rank, then use remaining attempts only after improving your model.", " andes challenge ranking", " andes challenge test --source ./shipping.js");
|
|
60078
60077
|
}
|
|
60079
60078
|
return lines2.join(`
|
|
60080
60079
|
`);
|
|
@@ -60090,11 +60089,11 @@ var challengeQueryText = (result3) => {
|
|
|
60090
60089
|
""
|
|
60091
60090
|
];
|
|
60092
60091
|
if (result3.queriesRemaining > 0) {
|
|
60093
|
-
lines2.push("Next experiment", "Change one variable at a time. Keep the others fixed so the output difference means something.", "
|
|
60092
|
+
lines2.push("Next experiment", "Change one variable at a time. Keep the others fixed so the output difference means something.", " andes challenge query", "");
|
|
60094
60093
|
} else {
|
|
60095
60094
|
lines2.push("The oracle is now silent. Your notebook contains all the evidence you will get.", "");
|
|
60096
60095
|
}
|
|
60097
|
-
lines2.push("Review your evidence", "
|
|
60096
|
+
lines2.push("Review your evidence", " andes challenge notebook", " andes challenge notebook --format csv > observations.csv");
|
|
60098
60097
|
return lines2.join(`
|
|
60099
60098
|
`);
|
|
60100
60099
|
};
|
|
@@ -60125,7 +60124,7 @@ var notebookTableText = (observations, challengeClosed = false) => {
|
|
|
60125
60124
|
"CASE FILE: no observations",
|
|
60126
60125
|
"El challenge está cerrado. Revisa el ranking final.",
|
|
60127
60126
|
"",
|
|
60128
|
-
"Siguiente:
|
|
60127
|
+
"Siguiente: andes challenge ranking"
|
|
60129
60128
|
].join(`
|
|
60130
60129
|
`);
|
|
60131
60130
|
}
|
|
@@ -60133,7 +60132,7 @@ var notebookTableText = (observations, challengeClosed = false) => {
|
|
|
60133
60132
|
"CASE FILE: no observations yet",
|
|
60134
60133
|
"The machine has not revealed anything. Start with one ordinary shipment.",
|
|
60135
60134
|
"",
|
|
60136
|
-
"Next:
|
|
60135
|
+
"Next: andes challenge query"
|
|
60137
60136
|
].join(`
|
|
60138
60137
|
`);
|
|
60139
60138
|
}
|
|
@@ -60163,16 +60162,16 @@ var notebookTableText = (observations, challengeClosed = false) => {
|
|
|
60163
60162
|
});
|
|
60164
60163
|
const lines2 = [`CASE FILE: ${observationLabel}`, "", header, ...rows, ""];
|
|
60165
60164
|
if (challengeClosed) {
|
|
60166
|
-
lines2.push("El challenge está cerrado. Este cuaderno queda disponible como historial.", "Siguiente:
|
|
60165
|
+
lines2.push("El challenge está cerrado. Este cuaderno queda disponible como historial.", "Siguiente: andes challenge ranking");
|
|
60167
60166
|
return lines2.join(`
|
|
60168
60167
|
`);
|
|
60169
60168
|
}
|
|
60170
60169
|
if (observations.length === 1) {
|
|
60171
|
-
lines2.push("One answer is a clue, not a rule.", "Next: run a controlled experiment. Change one field and keep the other four fixed.", "
|
|
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.", " andes challenge query", "");
|
|
60172
60171
|
} else {
|
|
60173
|
-
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.", "
|
|
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.", " andes challenge query", "");
|
|
60174
60173
|
}
|
|
60175
|
-
lines2.push("Prepare your replacement", "
|
|
60174
|
+
lines2.push("Prepare your replacement", " andes challenge init", " andes challenge test --source ./shipping.js");
|
|
60176
60175
|
return lines2.join(`
|
|
60177
60176
|
`);
|
|
60178
60177
|
};
|
|
@@ -60200,7 +60199,7 @@ var challengeTestText = (result3) => {
|
|
|
60200
60199
|
`${result3.matchedObservations} / ${result3.observationCount} comportamientos visibles pasan`
|
|
60201
60200
|
];
|
|
60202
60201
|
if (result3.accuracy === 1) {
|
|
60203
|
-
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", "
|
|
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", " andes challenge evaluate --challenge broken-agent --source ./scheduler.js --review ./review.json");
|
|
60204
60203
|
return lines3.join(`
|
|
60205
60204
|
`);
|
|
60206
60205
|
}
|
|
@@ -60232,9 +60231,9 @@ var challengeTestText = (result3) => {
|
|
|
60232
60231
|
}
|
|
60233
60232
|
}
|
|
60234
60233
|
if (result3.accuracy === 1) {
|
|
60235
|
-
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", "
|
|
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", " andes challenge evaluate --source ./shipping.js");
|
|
60236
60235
|
} else {
|
|
60237
|
-
lines2.push("", "Next: edit shipping.js, explain the mismatches, and test again for free", "
|
|
60236
|
+
lines2.push("", "Next: edit shipping.js, explain the mismatches, and test again for free", " andes challenge test --source ./shipping.js");
|
|
60238
60237
|
}
|
|
60239
60238
|
return lines2.join(`
|
|
60240
60239
|
`);
|
|
@@ -60248,9 +60247,9 @@ var challengeEvaluateText = (result3) => {
|
|
|
60248
60247
|
if (result3.rank !== undefined) {
|
|
60249
60248
|
lines3.push(`Puesto #${result3.rank}`);
|
|
60250
60249
|
}
|
|
60251
|
-
lines3.push(`Evaluaciones oficiales restantes ${result3.evaluationsRemaining} / ${result3.evaluationsLimit}`, "", result3.shareText, "", "Siguiente: consulta el ranking", "
|
|
60250
|
+
lines3.push(`Evaluaciones oficiales restantes ${result3.evaluationsRemaining} / ${result3.evaluationsLimit}`, "", result3.shareText, "", "Siguiente: consulta el ranking", " andes challenge ranking --challenge broken-agent");
|
|
60252
60251
|
if (result3.evaluationsRemaining > 0) {
|
|
60253
|
-
lines3.push("", "El veredicto es un solo puntaje. No dice qué caso falló. Razona antes de volver a enviar.", "
|
|
60252
|
+
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");
|
|
60254
60253
|
}
|
|
60255
60254
|
return lines3.join(`
|
|
60256
60255
|
`);
|
|
@@ -60264,9 +60263,9 @@ var challengeEvaluateText = (result3) => {
|
|
|
60264
60263
|
];
|
|
60265
60264
|
if (result3.rank !== undefined)
|
|
60266
60265
|
lines2.push(`Rank #${result3.rank}`);
|
|
60267
|
-
lines2.push(`Official evaluations remaining ${result3.evaluationsRemaining} / ${result3.evaluationsLimit}`, "", result3.shareText, "", "Next: inspect the leaderboard", "
|
|
60266
|
+
lines2.push(`Official evaluations remaining ${result3.evaluationsRemaining} / ${result3.evaluationsLimit}`, "", result3.shareText, "", "Next: inspect the leaderboard", " andes challenge ranking");
|
|
60268
60267
|
if (result3.evaluationsRemaining > 0) {
|
|
60269
|
-
lines2.push("", "Before spending another evaluation, improve and retest your model against the notebook.", "
|
|
60268
|
+
lines2.push("", "Before spending another evaluation, improve and retest your model against the notebook.", " andes challenge test --source ./shipping.js");
|
|
60270
60269
|
}
|
|
60271
60270
|
return lines2.join(`
|
|
60272
60271
|
`);
|
|
@@ -60325,9 +60324,9 @@ var registrationPartsText = (result3) => {
|
|
|
60325
60324
|
lines2.push(` ${mark} ${part.title}${detail}`);
|
|
60326
60325
|
}
|
|
60327
60326
|
if (result3.requirements.canSubmitApplication) {
|
|
60328
|
-
lines2.push("", "Ready to submit:
|
|
60327
|
+
lines2.push("", "Ready to submit: andes register");
|
|
60329
60328
|
} else if (result3.requirements.stage === "draft") {
|
|
60330
|
-
lines2.push("", "Complete and submit with `
|
|
60329
|
+
lines2.push("", "Complete and submit with `andes register`.");
|
|
60331
60330
|
}
|
|
60332
60331
|
return lines2.join(`
|
|
60333
60332
|
`);
|
|
@@ -60510,8 +60509,8 @@ Repara \`scheduler.js\` sin cambiar la interfaz exportada
|
|
|
60510
60509
|
|
|
60511
60510
|
\`\`\`sh
|
|
60512
60511
|
npm test
|
|
60513
|
-
|
|
60514
|
-
|
|
60512
|
+
andes challenge test --challenge broken-agent --source ./scheduler.js
|
|
60513
|
+
andes challenge evaluate --challenge broken-agent --source ./scheduler.js --review ./review.json
|
|
60515
60514
|
\`\`\`
|
|
60516
60515
|
|
|
60517
60516
|
Los tests locales y públicos son ilimitados. Tienes **5 evaluaciones oficiales**
|
|
@@ -60831,13 +60830,36 @@ var createChallengeScaffold = exports_Effect.fn("createChallengeScaffold")(funct
|
|
|
60831
60830
|
return { challenge: challengeSlug, path: solutionPath, status };
|
|
60832
60831
|
});
|
|
60833
60832
|
|
|
60833
|
+
// src/metadata.ts
|
|
60834
|
+
import { readFileSync } from "node:fs";
|
|
60835
|
+
import { basename } from "node:path";
|
|
60836
|
+
var isStandaloneBuild = typeof CHOFEX_VERSION !== "undefined";
|
|
60837
|
+
var readMetadata = () => {
|
|
60838
|
+
if (typeof CHOFEX_VERSION !== "undefined") {
|
|
60839
|
+
return { name: "chofex-cli", version: CHOFEX_VERSION };
|
|
60840
|
+
}
|
|
60841
|
+
return exports_Schema.decodeUnknownSync(exports_Schema.Struct({
|
|
60842
|
+
name: exports_Schema.Literals(["chofex-cli", "hacktheandes-cli"]),
|
|
60843
|
+
version: exports_Schema.String
|
|
60844
|
+
}))(JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")));
|
|
60845
|
+
};
|
|
60846
|
+
var metadata = readMetadata();
|
|
60847
|
+
var cliVersion = metadata.version;
|
|
60848
|
+
var cliPackageName = metadata.name;
|
|
60849
|
+
var commandPath = process.argv[1] ?? "";
|
|
60850
|
+
if (isStandaloneBuild) {
|
|
60851
|
+
commandPath = process.argv0;
|
|
60852
|
+
}
|
|
60853
|
+
var invokedAsAndes = /^andes(?:\.cmd|\.exe)?$/.test(basename(commandPath));
|
|
60854
|
+
var cliCommandName = invokedAsAndes ? "andes" : "chofex";
|
|
60855
|
+
|
|
60834
60856
|
// src/cli-root.ts
|
|
60835
60857
|
var rootValueFlagNames = {
|
|
60836
60858
|
apiUrl: "api-url",
|
|
60837
60859
|
output: "output",
|
|
60838
60860
|
token: "token"
|
|
60839
60861
|
};
|
|
60840
|
-
var root = exports_Command.make(
|
|
60862
|
+
var root = exports_Command.make(cliCommandName).pipe(exports_Command.withSharedFlags({
|
|
60841
60863
|
apiUrl: exports_Flag.string(rootValueFlagNames.apiUrl).pipe(exports_Flag.withDefault(config.apiUrl), exports_Flag.withDescription("Chofex API base URL")),
|
|
60842
60864
|
output: exports_Flag.choice(rootValueFlagNames.output, ["human", "json"]).pipe(exports_Flag.withDefault("human"), exports_Flag.withDescription("Output format")),
|
|
60843
60865
|
token: exports_Flag.string(rootValueFlagNames.token).pipe(exports_Flag.optional, exports_Flag.withDescription("Clerk OAuth token (prefer CHOFEX_TOKEN to avoid shell history)"))
|
|
@@ -60908,7 +60930,7 @@ var registrationLookupErrorText = (error2) => {
|
|
|
60908
60930
|
if (error2.code !== "REGISTRATION_NOT_FOUND")
|
|
60909
60931
|
return;
|
|
60910
60932
|
return `No registration found.
|
|
60911
|
-
Next command:
|
|
60933
|
+
Next command: andes register`;
|
|
60912
60934
|
};
|
|
60913
60935
|
var requirementsText = (result3) => {
|
|
60914
60936
|
const { registration, requirements } = result3;
|
|
@@ -60924,7 +60946,7 @@ var requirementsText = (result3) => {
|
|
|
60924
60946
|
return [
|
|
60925
60947
|
"Application received. A seat has not been assigned.",
|
|
60926
60948
|
result3.admission?.notice ?? challengeAdmissionNotice,
|
|
60927
|
-
"Next command:
|
|
60949
|
+
"Next command: andes challenge"
|
|
60928
60950
|
].join(`
|
|
60929
60951
|
`);
|
|
60930
60952
|
}
|
|
@@ -60937,7 +60959,7 @@ Review feedback: ${rejectionReason}`;
|
|
|
60937
60959
|
let nextCommand = "";
|
|
60938
60960
|
if (requirements.stage === "accepted") {
|
|
60939
60961
|
nextCommand = `
|
|
60940
|
-
Next command:
|
|
60962
|
+
Next command: andes confirm`;
|
|
60941
60963
|
}
|
|
60942
60964
|
let missing2 = "";
|
|
60943
60965
|
if (requirements.missing.length > 0) {
|
|
@@ -60972,7 +60994,7 @@ var badgeText = (result3) => {
|
|
|
60972
60994
|
return "Tu carnet se está generando.";
|
|
60973
60995
|
}
|
|
60974
60996
|
if (result3.status === "failed") {
|
|
60975
|
-
return "No se pudo generar tu carnet. Ejecuta `
|
|
60997
|
+
return "No se pudo generar tu carnet. Ejecuta `andes badge regenerate` para intentarlo de nuevo.";
|
|
60976
60998
|
}
|
|
60977
60999
|
return "Todavía no tienes un carnet.";
|
|
60978
61000
|
};
|
|
@@ -60997,13 +61019,13 @@ var challengeQuickstart = {
|
|
|
60997
61019
|
{
|
|
60998
61020
|
step: 1,
|
|
60999
61021
|
action: "Inicia sesión",
|
|
61000
|
-
command: "
|
|
61022
|
+
command: "andes login",
|
|
61001
61023
|
note: "Abre la autenticación de Clerk en tu navegador."
|
|
61002
61024
|
},
|
|
61003
61025
|
{
|
|
61004
61026
|
step: 2,
|
|
61005
61027
|
action: "Crea el repositorio del challenge",
|
|
61006
|
-
command: "
|
|
61028
|
+
command: "andes challenge init --challenge broken-agent",
|
|
61007
61029
|
note: "Crea broken-agent/ con el contrato, el scheduler y siete tests públicos sin sobrescribir trabajo existente."
|
|
61008
61030
|
},
|
|
61009
61031
|
{
|
|
@@ -61015,7 +61037,7 @@ var challengeQuickstart = {
|
|
|
61015
61037
|
{
|
|
61016
61038
|
step: 4,
|
|
61017
61039
|
action: "Revisa tu presupuesto",
|
|
61018
|
-
command: "
|
|
61040
|
+
command: "andes challenge show --challenge broken-agent",
|
|
61019
61041
|
note: "Muestra las evaluaciones oficiales restantes y tu mejor puntaje."
|
|
61020
61042
|
},
|
|
61021
61043
|
{
|
|
@@ -61033,7 +61055,7 @@ var challengeQuickstart = {
|
|
|
61033
61055
|
{
|
|
61034
61056
|
step: 7,
|
|
61035
61057
|
action: "Ejecuta los tests públicos",
|
|
61036
|
-
command: "
|
|
61058
|
+
command: "andes challenge test --challenge broken-agent --source ./scheduler.js",
|
|
61037
61059
|
note: "Es seguro repetirlos y no consumen evaluaciones oficiales."
|
|
61038
61060
|
},
|
|
61039
61061
|
{
|
|
@@ -61045,7 +61067,7 @@ var challengeQuickstart = {
|
|
|
61045
61067
|
{
|
|
61046
61068
|
step: 9,
|
|
61047
61069
|
action: "Crea el handoff de evaluación",
|
|
61048
|
-
command: "
|
|
61070
|
+
command: "andes challenge evaluate --challenge broken-agent --source ./scheduler.js --review ./review.json",
|
|
61049
61071
|
note: "Devuelve un enlace de aprobación sin consumir una evaluación oficial."
|
|
61050
61072
|
},
|
|
61051
61073
|
{
|
|
@@ -61057,17 +61079,17 @@ var challengeQuickstart = {
|
|
|
61057
61079
|
{
|
|
61058
61080
|
step: 11,
|
|
61059
61081
|
action: "Solicita el veredicto oculto",
|
|
61060
|
-
command: "
|
|
61082
|
+
command: "andes challenge evaluate --challenge broken-agent --source ./scheduler.js --review ./review.json",
|
|
61061
61083
|
note: "Repite el mismo comando antes de que venza la aprobación; recién entonces consume una evaluación."
|
|
61062
61084
|
},
|
|
61063
61085
|
{
|
|
61064
61086
|
step: 12,
|
|
61065
61087
|
action: "Consulta el ranking",
|
|
61066
|
-
command: "
|
|
61088
|
+
command: "andes challenge ranking --challenge broken-agent",
|
|
61067
61089
|
note: "Se revela el 1 de octubre a las 15:00, hora de Perú."
|
|
61068
61090
|
}
|
|
61069
61091
|
],
|
|
61070
|
-
helpCommand: "
|
|
61092
|
+
helpCommand: "andes challenge test --help"
|
|
61071
61093
|
};
|
|
61072
61094
|
var launchNoticeFor = (slug) => {
|
|
61073
61095
|
const challenge = challengeBySlug(slug);
|
|
@@ -61091,12 +61113,12 @@ var challengeQuickstartText = (participationState, launchNotice) => {
|
|
|
61091
61113
|
if (launchNotice)
|
|
61092
61114
|
lines2.push("", "LAUNCH NOTICE", launchNotice);
|
|
61093
61115
|
if (participationState === "closed") {
|
|
61094
|
-
lines2.push("", "RANKING FINAL", "
|
|
61116
|
+
lines2.push("", "RANKING FINAL", " andes challenge ranking");
|
|
61095
61117
|
return lines2.join(`
|
|
61096
61118
|
`);
|
|
61097
61119
|
}
|
|
61098
61120
|
if (participationState === "scheduled") {
|
|
61099
|
-
lines2.push("", "PRÓXIMAMENTE", "
|
|
61121
|
+
lines2.push("", "PRÓXIMAMENTE", " andes challenge list");
|
|
61100
61122
|
return lines2.join(`
|
|
61101
61123
|
`);
|
|
61102
61124
|
}
|
|
@@ -61114,7 +61136,7 @@ var optionalString = (name, description) => exports_Flag.string(name).pipe(expor
|
|
|
61114
61136
|
var challengeFlag = exports_Flag.string("challenge").pipe(exports_Flag.withDefault(defaultChallengeSlug), exports_Flag.withDescription("Challenge slug (default: broken-agent)"));
|
|
61115
61137
|
var sourceFlag = optionalString("source", "JavaScript challenge solution file");
|
|
61116
61138
|
var reviewFlag = optionalString("review", "Participant-authored Broken Agent engineering review JSON");
|
|
61117
|
-
var officialEvaluateRetryCommand = "
|
|
61139
|
+
var officialEvaluateRetryCommand = "andes challenge evaluate --challenge broken-agent --source ./scheduler.js --review ./review.json";
|
|
61118
61140
|
var evaluationErrorText = (error2) => {
|
|
61119
61141
|
if (error2.code === "CHALLENGE_ENGINE_UNAVAILABLE") {
|
|
61120
61142
|
return [
|
|
@@ -61176,7 +61198,7 @@ var challengeInitText = (result3) => {
|
|
|
61176
61198
|
"",
|
|
61177
61199
|
"Siguiente: continúa endureciendo el scheduler y ejecuta los tests públicos",
|
|
61178
61200
|
` cd ${result3.path} && npm test`,
|
|
61179
|
-
"
|
|
61201
|
+
" andes challenge test --challenge broken-agent --source ./scheduler.js"
|
|
61180
61202
|
].join(`
|
|
61181
61203
|
`);
|
|
61182
61204
|
}
|
|
@@ -61189,7 +61211,7 @@ var challengeInitText = (result3) => {
|
|
|
61189
61211
|
` cd ${result3.path} && npm test`,
|
|
61190
61212
|
"",
|
|
61191
61213
|
"Luego repara scheduler.js y pruébalo sin consumir evaluaciones:",
|
|
61192
|
-
"
|
|
61214
|
+
" andes challenge test --challenge broken-agent --source ./scheduler.js"
|
|
61193
61215
|
].join(`
|
|
61194
61216
|
`);
|
|
61195
61217
|
}
|
|
@@ -61198,8 +61220,8 @@ var challengeInitText = (result3) => {
|
|
|
61198
61220
|
`${result3.path} already exists. Left it unchanged.`,
|
|
61199
61221
|
"",
|
|
61200
61222
|
"Next: keep investigating, then test your current solution",
|
|
61201
|
-
"
|
|
61202
|
-
`
|
|
61223
|
+
" andes challenge query",
|
|
61224
|
+
` andes challenge test --source ./${result3.path}`
|
|
61203
61225
|
].join(`
|
|
61204
61226
|
`);
|
|
61205
61227
|
}
|
|
@@ -61208,10 +61230,10 @@ var challengeInitText = (result3) => {
|
|
|
61208
61230
|
"A documented baseline is ready for the rules you discover.",
|
|
61209
61231
|
"",
|
|
61210
61232
|
"Next: probe the machine",
|
|
61211
|
-
"
|
|
61233
|
+
" andes challenge query",
|
|
61212
61234
|
"",
|
|
61213
61235
|
`Then edit ${result3.path} and test it safely:`,
|
|
61214
|
-
`
|
|
61236
|
+
` andes challenge test --source ./${result3.path}`
|
|
61215
61237
|
].join(`
|
|
61216
61238
|
`);
|
|
61217
61239
|
};
|
|
@@ -61220,7 +61242,7 @@ var listCommand = exports_Command.make("list", {}, exports_Effect.fn("challengeL
|
|
|
61220
61242
|
yield* execute(options.output, listChallenges({ apiUrl: options.apiUrl }), challengeListText);
|
|
61221
61243
|
})).pipe(exports_Command.withDescription("Discover available challenges, opening dates, and scoring formats. No login required."), exports_Command.withExamples([
|
|
61222
61244
|
{
|
|
61223
|
-
command: "
|
|
61245
|
+
command: "andes challenge list",
|
|
61224
61246
|
description: "See which challenge is currently playable"
|
|
61225
61247
|
}
|
|
61226
61248
|
]));
|
|
@@ -61244,11 +61266,11 @@ var initCommand = exports_Command.make("init", { challenge: challengeFlag }, exp
|
|
|
61244
61266
|
yield* execute(options.output, operation, challengeInitText);
|
|
61245
61267
|
})).pipe(exports_Command.withDescription("Crea el starter de un challenge sin sobrescribir trabajo existente."), exports_Command.withExamples([
|
|
61246
61268
|
{
|
|
61247
|
-
command: "
|
|
61269
|
+
command: "andes challenge init --challenge broken-agent",
|
|
61248
61270
|
description: "Prepara el repositorio de Broken Agent"
|
|
61249
61271
|
},
|
|
61250
61272
|
{
|
|
61251
|
-
command: "
|
|
61273
|
+
command: "andes challenge init --challenge broken-agent",
|
|
61252
61274
|
description: "Usa explícitamente el slug del challenge"
|
|
61253
61275
|
}
|
|
61254
61276
|
]));
|
|
@@ -61258,7 +61280,7 @@ var showCommand = exports_Command.make("show", { challenge: challengeFlag }, exp
|
|
|
61258
61280
|
yield* execute(options.output, getChallengeAttempt({ apiUrl: options.apiUrl, token }, challenge), challengeShowText);
|
|
61259
61281
|
})).pipe(exports_Command.withDescription("Consulta presupuesto, puntaje y progreso del challenge. Requiere iniciar sesión."), exports_Command.withExamples([
|
|
61260
61282
|
{
|
|
61261
|
-
command: "
|
|
61283
|
+
command: "andes challenge show",
|
|
61262
61284
|
description: "Revisa tu progreso antes de consumir intentos limitados"
|
|
61263
61285
|
}
|
|
61264
61286
|
]));
|
|
@@ -61294,11 +61316,11 @@ var queryCommand = exports_Command.make("query", {
|
|
|
61294
61316
|
yield* execute(options.output, operation, challengeQueryText);
|
|
61295
61317
|
})).pipe(exports_Command.withDescription("Send one shipment to the undocumented oracle. A successful query consumes one limited request. Requires sign-in."), exports_Command.withExamples([
|
|
61296
61318
|
{
|
|
61297
|
-
command: "
|
|
61319
|
+
command: "andes challenge query --challenge black-box --distance 10 --weight 3 --hour 14 --fragile false --express false",
|
|
61298
61320
|
description: "Spend one oracle query"
|
|
61299
61321
|
},
|
|
61300
61322
|
{
|
|
61301
|
-
command: "
|
|
61323
|
+
command: "andes challenge query --challenge black-box --input shipment.json",
|
|
61302
61324
|
description: "Read the shipment fields from a JSON file"
|
|
61303
61325
|
}
|
|
61304
61326
|
]));
|
|
@@ -61316,11 +61338,11 @@ var notebookCommand = exports_Command.make("notebook", { challenge: challengeFla
|
|
|
61316
61338
|
});
|
|
61317
61339
|
})).pipe(exports_Command.withDescription("Review every input and price you observed. Export table, JSON, or CSV for analysis. Requires sign-in."), exports_Command.withExamples([
|
|
61318
61340
|
{
|
|
61319
|
-
command: "
|
|
61341
|
+
command: "andes challenge notebook --challenge black-box",
|
|
61320
61342
|
description: "Read observations in a terminal table"
|
|
61321
61343
|
},
|
|
61322
61344
|
{
|
|
61323
|
-
command: "
|
|
61345
|
+
command: "andes challenge notebook --challenge black-box --format csv > observations.csv",
|
|
61324
61346
|
description: "Save observations for a spreadsheet"
|
|
61325
61347
|
}
|
|
61326
61348
|
]));
|
|
@@ -61334,7 +61356,7 @@ var testCommand = exports_Command.make("test", { challenge: challengeFlag, sourc
|
|
|
61334
61356
|
yield* execute(options.output, operation, challengeTestText);
|
|
61335
61357
|
})).pipe(exports_Command.withDescription("Run the challenge's public tests. Safe to repeat; official evaluations are not consumed. Requires sign-in."), exports_Command.withExamples([
|
|
61336
61358
|
{
|
|
61337
|
-
command: "
|
|
61359
|
+
command: "andes challenge test --challenge broken-agent --source ./scheduler.js",
|
|
61338
61360
|
description: "Ejecuta los tests públicos de Broken Agent"
|
|
61339
61361
|
}
|
|
61340
61362
|
]));
|
|
@@ -61352,7 +61374,7 @@ var evaluateCommand = exports_Command.make("evaluate", { challenge: challengeFla
|
|
|
61352
61374
|
yield* execute(options.output, operation, challengeEvaluateText, evaluationErrorText);
|
|
61353
61375
|
})).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([
|
|
61354
61376
|
{
|
|
61355
|
-
command: "
|
|
61377
|
+
command: "andes challenge evaluate --challenge broken-agent --source ./scheduler.js --review ./review.json",
|
|
61356
61378
|
description: "Consume una evaluación oficial cuando tu solución esté lista"
|
|
61357
61379
|
}
|
|
61358
61380
|
]));
|
|
@@ -61361,7 +61383,7 @@ var rankingCommand = exports_Command.make("ranking", { challenge: challengeFlag
|
|
|
61361
61383
|
yield* execute(options.output, getChallengeRanking({ apiUrl: options.apiUrl }, challenge), challengeRankingText);
|
|
61362
61384
|
})).pipe(exports_Command.withDescription("View the public leaderboard. No login required and no challenge budget consumed."), exports_Command.withExamples([
|
|
61363
61385
|
{
|
|
61364
|
-
command: "
|
|
61386
|
+
command: "andes challenge ranking --challenge broken-agent",
|
|
61365
61387
|
description: "Compara puntajes oficiales"
|
|
61366
61388
|
}
|
|
61367
61389
|
]));
|
|
@@ -61379,13 +61401,13 @@ var challengeCommand = exports_Command.make("challenge", {}, exports_Effect.fn("
|
|
|
61379
61401
|
if (participationState === "closed") {
|
|
61380
61402
|
const rankingStep = challengeQuickstart.workflow.at(-1);
|
|
61381
61403
|
workflow = rankingStep ? [rankingStep] : [];
|
|
61382
|
-
helpCommand = "
|
|
61404
|
+
helpCommand = "andes challenge ranking --help";
|
|
61383
61405
|
story = [];
|
|
61384
61406
|
mission = "El Challenge 2 terminó. El ranking final sigue disponible.";
|
|
61385
61407
|
rules = [];
|
|
61386
61408
|
} else if (participationState === "scheduled") {
|
|
61387
61409
|
workflow = [];
|
|
61388
|
-
helpCommand = "
|
|
61410
|
+
helpCommand = "andes challenge list --help";
|
|
61389
61411
|
story = [];
|
|
61390
61412
|
mission = "El challenge todavía no está disponible.";
|
|
61391
61413
|
rules = [];
|
|
@@ -61413,15 +61435,15 @@ var challengeCommand = exports_Command.make("challenge", {}, exports_Effect.fn("
|
|
|
61413
61435
|
yield* exports_Console.log(challengeQuickstartText(participationState, launchNotice));
|
|
61414
61436
|
})).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([
|
|
61415
61437
|
{
|
|
61416
|
-
command: "
|
|
61438
|
+
command: "andes challenge",
|
|
61417
61439
|
description: "Abre la guía de Broken Agent"
|
|
61418
61440
|
},
|
|
61419
61441
|
{
|
|
61420
|
-
command: "
|
|
61442
|
+
command: "andes challenge init --challenge broken-agent",
|
|
61421
61443
|
description: "Crea el repositorio de Broken Agent"
|
|
61422
61444
|
},
|
|
61423
61445
|
{
|
|
61424
|
-
command: "
|
|
61446
|
+
command: "andes challenge test --help",
|
|
61425
61447
|
description: "Revisa cómo ejecutar los tests públicos"
|
|
61426
61448
|
}
|
|
61427
61449
|
]), exports_Command.withSubcommands([
|
|
@@ -63451,17 +63473,17 @@ var normalizePicturePath = (input) => {
|
|
|
63451
63473
|
var readPicture = (inputPath) => exports_Effect.tryPromise({
|
|
63452
63474
|
try: async () => {
|
|
63453
63475
|
const path4 = normalizePicturePath(inputPath);
|
|
63454
|
-
const
|
|
63455
|
-
if (!
|
|
63476
|
+
const metadata2 = await stat3(path4);
|
|
63477
|
+
if (!metadata2.isFile())
|
|
63456
63478
|
throw new Error("Path is not a regular file");
|
|
63457
|
-
if (
|
|
63479
|
+
if (metadata2.size < 1 || metadata2.size > maximumPictureBytes) {
|
|
63458
63480
|
throw new Error("Picture must be between 1 byte and 5 MB");
|
|
63459
63481
|
}
|
|
63460
63482
|
const contents = await readFile5(path4);
|
|
63461
63483
|
const contentType = detectPictureContentType(contents);
|
|
63462
63484
|
if (!contentType)
|
|
63463
63485
|
throw new Error("Picture must be JPEG, PNG, or WebP");
|
|
63464
|
-
return { contents, contentType, size:
|
|
63486
|
+
return { contents, contentType, size: metadata2.size };
|
|
63465
63487
|
},
|
|
63466
63488
|
catch: (error2) => cliError("INVALID_PICTURE_FILE", `Could not use ${normalizePicturePath(inputPath)}: ${String(error2)}`)
|
|
63467
63489
|
});
|
|
@@ -63500,7 +63522,6 @@ import { spawn as spawn3 } from "node:child_process";
|
|
|
63500
63522
|
import { mkdtemp as mkdtemp2, rm as rm2 } from "node:fs/promises";
|
|
63501
63523
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
63502
63524
|
import { dirname as dirname2, isAbsolute, join as join3, relative, sep } from "node:path";
|
|
63503
|
-
var cliPackageName = "chofex-cli";
|
|
63504
63525
|
var upgradeVersion = "latest";
|
|
63505
63526
|
var skillName = "chofex-hackathon";
|
|
63506
63527
|
var skillRepository = "https://github.com/crafter-station/hack-the-andes";
|
|
@@ -63582,7 +63603,7 @@ var runInstaller = async (installDirectory, version) => {
|
|
|
63582
63603
|
}
|
|
63583
63604
|
return runProcess("bash", arguments_, script);
|
|
63584
63605
|
};
|
|
63585
|
-
var isStandaloneExecutable = () =>
|
|
63606
|
+
var isStandaloneExecutable = () => isStandaloneBuild;
|
|
63586
63607
|
var assertSuccessful = (result3, program) => {
|
|
63587
63608
|
if (result3.exitCode === 0)
|
|
63588
63609
|
return;
|
|
@@ -63685,12 +63706,12 @@ var fetchLatestVersion = async () => {
|
|
|
63685
63706
|
if (!response.ok) {
|
|
63686
63707
|
throw new Error(`npm registry returned HTTP ${response.status}`);
|
|
63687
63708
|
}
|
|
63688
|
-
const
|
|
63689
|
-
if (typeof
|
|
63709
|
+
const metadata2 = await response.json();
|
|
63710
|
+
if (typeof metadata2 !== "object" || metadata2 === null || !("version" in metadata2) || typeof metadata2.version !== "string") {
|
|
63690
63711
|
throw new Error("npm registry returned an invalid package version");
|
|
63691
63712
|
}
|
|
63692
|
-
parseVersion(
|
|
63693
|
-
return
|
|
63713
|
+
parseVersion(metadata2.version);
|
|
63714
|
+
return metadata2.version;
|
|
63694
63715
|
};
|
|
63695
63716
|
var autoUpdateCli = async (currentVersion, options = {}) => {
|
|
63696
63717
|
const latestVersion = await (options.fetchLatestVersion ?? fetchLatestVersion)();
|
|
@@ -63754,7 +63775,9 @@ var shouldAutoUpdateCli = async ({
|
|
|
63754
63775
|
return pathIsInside(join3(npmRoot, cliPackageName), entryPath);
|
|
63755
63776
|
};
|
|
63756
63777
|
var runUpdatedCli = () => new Promise((resolve4, reject) => {
|
|
63757
|
-
const
|
|
63778
|
+
const arguments_ = process.argv.slice(isStandaloneBuild ? 2 : 1);
|
|
63779
|
+
const child = spawn3(process.execPath, arguments_, {
|
|
63780
|
+
argv0: process.argv0,
|
|
63758
63781
|
env: { ...process.env, CHOFEX_AUTO_UPDATE: "0" },
|
|
63759
63782
|
stdio: "inherit"
|
|
63760
63783
|
});
|
|
@@ -63783,7 +63806,7 @@ var rejectIfApplicationLocked = exports_Effect.fn("rejectIfApplicationLocked")(f
|
|
|
63783
63806
|
if (status === "accepted") {
|
|
63784
63807
|
message = "Already accepted. Your registration is complete.";
|
|
63785
63808
|
if (requirements.stage === "accepted") {
|
|
63786
|
-
message = "Already accepted. Run `
|
|
63809
|
+
message = "Already accepted. Run `andes confirm` to complete your registration.";
|
|
63787
63810
|
}
|
|
63788
63811
|
}
|
|
63789
63812
|
return yield* cliError("ACTIVE_APPLICATION_EXISTS", message, false, {
|
|
@@ -63809,11 +63832,11 @@ var registerCommand = exports_Command.make("register", { input: inputFlag2 }, ex
|
|
|
63809
63832
|
yield* execute(options.output, operation, createdText);
|
|
63810
63833
|
})).pipe(exports_Command.withDescription("Complete and submit an application for review"), exports_Command.withExamples([
|
|
63811
63834
|
{
|
|
63812
|
-
command: "
|
|
63835
|
+
command: "andes register",
|
|
63813
63836
|
description: "Fill or resume the application interactively"
|
|
63814
63837
|
},
|
|
63815
63838
|
{
|
|
63816
|
-
command: "
|
|
63839
|
+
command: "andes --output json register --input application.json",
|
|
63817
63840
|
description: "Submit an application from an agent or script"
|
|
63818
63841
|
}
|
|
63819
63842
|
]));
|
|
@@ -63925,11 +63948,11 @@ var confirmCommand = exports_Command.make("confirm", {
|
|
|
63925
63948
|
yield* execute(options.output, operation, registrationText);
|
|
63926
63949
|
})).pipe(exports_Command.withDescription("Provide private attendance details after acceptance"), exports_Command.withExamples([
|
|
63927
63950
|
{
|
|
63928
|
-
command: "
|
|
63951
|
+
command: "andes confirm",
|
|
63929
63952
|
description: "Complete accepted-participant details interactively"
|
|
63930
63953
|
},
|
|
63931
63954
|
{
|
|
63932
|
-
command: "
|
|
63955
|
+
command: "andes --output json confirm --input attendance.json",
|
|
63933
63956
|
description: "Submit accepted-participant details from JSON"
|
|
63934
63957
|
}
|
|
63935
63958
|
]));
|
|
@@ -64012,7 +64035,7 @@ var makeUpgradeCommand = (name) => exports_Command.make(name, {}, exports_Effect
|
|
|
64012
64035
|
catch: (error2) => cliError("UPGRADE_FAILED", `No se pudieron actualizar ${cliPackageName} y ${skillName}`, false, String(error2))
|
|
64013
64036
|
});
|
|
64014
64037
|
yield* execute(options.output, operation, () => `Se actualizó ${cliPackageName} a la versión ${upgradeVersion} y se refrescó ${skillName}.`);
|
|
64015
|
-
})).pipe(exports_Command.withDescription(
|
|
64038
|
+
})).pipe(exports_Command.withDescription(`Actualiza ${cliPackageName} y su skill de agente a la última versión`));
|
|
64016
64039
|
var updateCommand = makeUpgradeCommand("update");
|
|
64017
64040
|
var upgradeCommand = makeUpgradeCommand("upgrade");
|
|
64018
64041
|
var inputValidation = (stage, path4) => {
|
|
@@ -64032,7 +64055,7 @@ var validateCommand = exports_Command.make("validate", { input: inputFlag2, stag
|
|
|
64032
64055
|
yield* execute(options.output, operation, (result3) => `${result3.stage} input is valid.`);
|
|
64033
64056
|
})).pipe(exports_Command.withDescription("Validate input without submitting it"), exports_Command.withExamples([
|
|
64034
64057
|
{
|
|
64035
|
-
command: "
|
|
64058
|
+
command: "andes --output json validate --stage application --input application.json",
|
|
64036
64059
|
description: "Validate an application file locally"
|
|
64037
64060
|
}
|
|
64038
64061
|
]));
|
|
@@ -64071,7 +64094,7 @@ var schemaCommand = exports_Command.make("schema", { stage: stageFlag }, exports
|
|
|
64071
64094
|
yield* printJson(templateFor(stage));
|
|
64072
64095
|
})).pipe(exports_Command.withDescription("Print a complete machine-readable input template"), exports_Command.withExamples([
|
|
64073
64096
|
{
|
|
64074
|
-
command: "
|
|
64097
|
+
command: "andes schema --stage acceptance",
|
|
64075
64098
|
description: "Print the post-acceptance input template"
|
|
64076
64099
|
}
|
|
64077
64100
|
]));
|
|
@@ -64233,10 +64256,10 @@ var welcomeFormatter = (options) => {
|
|
|
64233
64256
|
${help}`;
|
|
64234
64257
|
const width = Math.max(1, Math.min(options.columns ?? 80, 72));
|
|
64235
64258
|
const shortcuts = [
|
|
64236
|
-
"
|
|
64237
|
-
"
|
|
64238
|
-
"
|
|
64239
|
-
"
|
|
64259
|
+
"andes login Sign in",
|
|
64260
|
+
"andes register Apply",
|
|
64261
|
+
"andes status Check your application",
|
|
64262
|
+
"andes --help All commands"
|
|
64240
64263
|
];
|
|
64241
64264
|
return `${welcome}
|
|
64242
64265
|
${shortcuts.flatMap((line) => wrap(line, width)).join(`
|
|
@@ -64247,13 +64270,6 @@ ${shortcuts.flatMap((line) => wrap(line, width)).join(`
|
|
|
64247
64270
|
};
|
|
64248
64271
|
|
|
64249
64272
|
// src/index.ts
|
|
64250
|
-
var readCliVersion = () => {
|
|
64251
|
-
if (typeof CHOFEX_VERSION !== "undefined")
|
|
64252
|
-
return CHOFEX_VERSION;
|
|
64253
|
-
const packageMetadata = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
64254
|
-
return packageMetadata.version;
|
|
64255
|
-
};
|
|
64256
|
-
var cliVersion = readCliVersion();
|
|
64257
64273
|
var arguments_ = process.argv.slice(2);
|
|
64258
64274
|
var jsonOutputRequested = (arguments_2) => {
|
|
64259
64275
|
if (arguments_2.includes("--output=json"))
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chofex-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.203",
|
|
4
4
|
"description": "Command-line client for Hack the Andes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
+
"andes": "./dist/index.js",
|
|
7
8
|
"chofex": "./dist/index.js"
|
|
8
9
|
},
|
|
9
10
|
"files": [
|
|
@@ -30,26 +31,5 @@
|
|
|
30
31
|
"publishConfig": {
|
|
31
32
|
"access": "public",
|
|
32
33
|
"registry": "https://registry.npmjs.org/"
|
|
33
|
-
},
|
|
34
|
-
"scripts": {
|
|
35
|
-
"build": "rm -rf dist && bun build src/index.ts --target=node --outfile=dist/index.js",
|
|
36
|
-
"dev": "bun src/index.ts",
|
|
37
|
-
"lint": "biome lint --error-on-warnings .",
|
|
38
|
-
"format": "biome format --write .",
|
|
39
|
-
"check-types": "tsc --noEmit",
|
|
40
|
-
"test": "bun test",
|
|
41
|
-
"prepack": "bun run build"
|
|
42
|
-
},
|
|
43
|
-
"devDependencies": {
|
|
44
|
-
"@biomejs/biome": "2.5.12",
|
|
45
|
-
"@effect/platform-node": "4.0.0-rc.112",
|
|
46
|
-
"@chofex/challenges-contract": "*",
|
|
47
|
-
"@chofex/registration-contract": "*",
|
|
48
|
-
"@chofex/typescript-config": "*",
|
|
49
|
-
"@types/bun": "^1.3.14",
|
|
50
|
-
"@types/node": "26.4.1",
|
|
51
|
-
"@vercel/blob": "^2.8.0",
|
|
52
|
-
"effect": "4.0.0-rc.112",
|
|
53
|
-
"typescript": "7.0.2"
|
|
54
34
|
}
|
|
55
35
|
}
|