rankmycode 0.1.4
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/LICENSE +19 -0
- package/README.md +32 -0
- package/checksums.json +20 -0
- package/package.json +32 -0
- package/rankme.mjs +133 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) 2026 Jatin Jain. All rights reserved.
|
|
2
|
+
|
|
3
|
+
This package is a launcher: it downloads, verifies and runs the Builder
|
|
4
|
+
collector. It contains no collector source code.
|
|
5
|
+
|
|
6
|
+
Permission is granted to install and run this package for its intended purpose,
|
|
7
|
+
which is to install and run the Builder collector on your own machine.
|
|
8
|
+
|
|
9
|
+
That is the whole of the permission granted. No licence is granted, expressly or
|
|
10
|
+
by implication, to:
|
|
11
|
+
|
|
12
|
+
- copy, redistribute, sell or sublicense this package;
|
|
13
|
+
- create derivative works from it;
|
|
14
|
+
- use it, or anything described in it, to design, build, train on, or
|
|
15
|
+
reproduce the behaviour of the Builder collector or any part of the service
|
|
16
|
+
it communicates with.
|
|
17
|
+
|
|
18
|
+
No licence to any underlying source code is granted or implied. The collector is
|
|
19
|
+
proprietary and its source is not public.
|
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# rankmycode
|
|
2
|
+
|
|
3
|
+
**Rank yourself as a coder. Measured.**
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npx rankmycode
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Reads the Claude Code, Cursor, Codex and opencode sessions already on your machine, measures
|
|
10
|
+
them **on your own machine**, shows you exactly what would be sent, and asks before anything is
|
|
11
|
+
published.
|
|
12
|
+
|
|
13
|
+
This package is a launcher. It downloads the signed collector binary for your platform from the
|
|
14
|
+
release it is pinned to, verifies its SHA-256 before making it executable, caches it under
|
|
15
|
+
`~/.cache/rankme/`, and runs it. It contains no collector source.
|
|
16
|
+
|
|
17
|
+
| | |
|
|
18
|
+
|---|---|
|
|
19
|
+
| `npx rankmycode` | scan, show, ask, publish |
|
|
20
|
+
| `npx rankmycode discover` | show what would be read, and read nothing |
|
|
21
|
+
| `npx rankmycode analyze` | measure locally, upload nothing |
|
|
22
|
+
| `npx rankmycode forget` | delete this machine's evidence and score |
|
|
23
|
+
|
|
24
|
+
The publish confirmation is read from a real terminal and cannot be answered by a flag, a pipe,
|
|
25
|
+
or an agent. In CI, or anywhere without a terminal, it refuses rather than assuming yes.
|
|
26
|
+
|
|
27
|
+
Other ways in: `brew install jatinjain25/tap/rankme`, or the
|
|
28
|
+
[Claude Code plugin](https://github.com/jatinjain25/rankme).
|
|
29
|
+
|
|
30
|
+
## Licence
|
|
31
|
+
|
|
32
|
+
Copyright (c) 2026 Jatin Jain. All rights reserved. See LICENSE.
|
package/checksums.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.1.4",
|
|
3
|
+
"tag": "v0.1.4",
|
|
4
|
+
"base": "https://github.com/jatinjain25/paxel-dist/releases/download/v0.1.4",
|
|
5
|
+
"origin": "https://builder-production-5049.up.railway.app",
|
|
6
|
+
"assets": {
|
|
7
|
+
"builder-darwin-arm64": {
|
|
8
|
+
"sha256": "c05143908bda97e0d3defbded6ba4b1cd3602cfcd3b382b78f04ad9422eb6df1"
|
|
9
|
+
},
|
|
10
|
+
"builder-darwin-x64": {
|
|
11
|
+
"sha256": "2821be85e4545ebdb76e2d3b5a3362d58a95b7a56cd7c7dac346b7bdf4512e33"
|
|
12
|
+
},
|
|
13
|
+
"builder-linux-arm64": {
|
|
14
|
+
"sha256": "b91e5c52c4ae6e9da5d51356b8b4ff98bbeb690979db9880fd349e940d1b4651"
|
|
15
|
+
},
|
|
16
|
+
"builder-linux-x64": {
|
|
17
|
+
"sha256": "538ed36ad740adf704006a7c1073ba90e0eba2aaabcbde825bfa74436080c232"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rankmycode",
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Rank yourself as a coder. Downloads the signed Builder collector for your platform, verifies it, and runs it.",
|
|
6
|
+
"bin": {
|
|
7
|
+
"rankmycode": "rankme.mjs"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"rankme.mjs",
|
|
11
|
+
"checksums.json",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=18.17"
|
|
17
|
+
},
|
|
18
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
19
|
+
"homepage": "https://github.com/jatinjain25/rankme",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/jatinjain25/rankme.git"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"leaderboard",
|
|
26
|
+
"ranking",
|
|
27
|
+
"claude-code",
|
|
28
|
+
"cursor",
|
|
29
|
+
"codex",
|
|
30
|
+
"ai-coding"
|
|
31
|
+
]
|
|
32
|
+
}
|
package/rankme.mjs
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// packages/launcher/src/main.ts
|
|
4
|
+
import { spawnSync } from "node:child_process";
|
|
5
|
+
import { homedir } from "node:os";
|
|
6
|
+
import { createRequire } from "node:module";
|
|
7
|
+
|
|
8
|
+
// packages/launcher/src/resolve.ts
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
|
|
11
|
+
class UnsupportedPlatformError extends Error {
|
|
12
|
+
name = "UnsupportedPlatformError";
|
|
13
|
+
}
|
|
14
|
+
function assetName(platform, arch) {
|
|
15
|
+
const os = platform === "darwin" ? "darwin" : platform === "linux" ? "linux" : undefined;
|
|
16
|
+
const cpu = arch === "arm64" ? "arm64" : arch === "x64" ? "x64" : undefined;
|
|
17
|
+
if (os === undefined || cpu === undefined) {
|
|
18
|
+
throw new UnsupportedPlatformError(`There is no build for ${platform}/${arch}. macOS and Linux, on arm64 and x64.`);
|
|
19
|
+
}
|
|
20
|
+
return `builder-${os}-${cpu}`;
|
|
21
|
+
}
|
|
22
|
+
function cacheBin(env, home, version, asset) {
|
|
23
|
+
const root = env["RANKME_CACHE"] ?? env["XDG_CACHE_HOME"] ?? join(home, ".cache");
|
|
24
|
+
return join(root, "rankme", version, asset);
|
|
25
|
+
}
|
|
26
|
+
function childArgs(userArgs, origin) {
|
|
27
|
+
const first = userArgs[0];
|
|
28
|
+
const command = first === undefined || first.startsWith("-") ? ["publish"] : [];
|
|
29
|
+
return ["--api", origin, ...command, ...userArgs];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// packages/launcher/src/ensure.ts
|
|
33
|
+
import { createHash } from "node:crypto";
|
|
34
|
+
import { createReadStream, createWriteStream } from "node:fs";
|
|
35
|
+
import { chmod, mkdir, rename, rm, stat } from "node:fs/promises";
|
|
36
|
+
import { Readable } from "node:stream";
|
|
37
|
+
import { pipeline } from "node:stream/promises";
|
|
38
|
+
import { createGunzip } from "node:zlib";
|
|
39
|
+
import { dirname } from "node:path";
|
|
40
|
+
|
|
41
|
+
class ChecksumError extends Error {
|
|
42
|
+
name = "ChecksumError";
|
|
43
|
+
}
|
|
44
|
+
async function isExecutable(path) {
|
|
45
|
+
try {
|
|
46
|
+
return (await stat(path)).isFile();
|
|
47
|
+
} catch {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
async function sha256Of(path) {
|
|
52
|
+
const hash = createHash("sha256");
|
|
53
|
+
await pipeline(createReadStream(path), hash);
|
|
54
|
+
return hash.digest("hex");
|
|
55
|
+
}
|
|
56
|
+
async function download(url, to) {
|
|
57
|
+
const res = await fetch(url);
|
|
58
|
+
if (!res.ok || res.body === null)
|
|
59
|
+
return false;
|
|
60
|
+
await pipeline(Readable.fromWeb(res.body), createWriteStream(to));
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
async function ensureBinary(opts) {
|
|
64
|
+
if (await isExecutable(opts.target))
|
|
65
|
+
return opts.target;
|
|
66
|
+
const note = opts.note ?? (() => {});
|
|
67
|
+
await mkdir(dirname(opts.target), { recursive: true });
|
|
68
|
+
const packed = `${opts.target}.gz.tmp-${process.pid}`;
|
|
69
|
+
const plain = `${opts.target}.tmp-${process.pid}`;
|
|
70
|
+
const clean = async () => {
|
|
71
|
+
await rm(packed, { force: true });
|
|
72
|
+
await rm(plain, { force: true });
|
|
73
|
+
};
|
|
74
|
+
try {
|
|
75
|
+
note(`downloading ${opts.asset}`);
|
|
76
|
+
if (await download(`${opts.base}/${opts.asset}.gz`, packed)) {
|
|
77
|
+
await pipeline(createReadStream(packed), createGunzip(), createWriteStream(plain));
|
|
78
|
+
} else if (!await download(`${opts.base}/${opts.asset}`, plain)) {
|
|
79
|
+
throw new Error(`Download failed: ${opts.base}/${opts.asset}`);
|
|
80
|
+
}
|
|
81
|
+
const actual = await sha256Of(plain);
|
|
82
|
+
if (actual !== opts.sha256) {
|
|
83
|
+
throw new ChecksumError(`Checksum mismatch for ${opts.asset}. Refusing to run it.
|
|
84
|
+
` + ` expected ${opts.sha256}
|
|
85
|
+
actual ${actual}`);
|
|
86
|
+
}
|
|
87
|
+
await chmod(plain, 493);
|
|
88
|
+
await rename(plain, opts.target);
|
|
89
|
+
return opts.target;
|
|
90
|
+
} catch (err) {
|
|
91
|
+
await clean();
|
|
92
|
+
throw err;
|
|
93
|
+
} finally {
|
|
94
|
+
await rm(packed, { force: true });
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// packages/launcher/src/main.ts
|
|
99
|
+
async function main() {
|
|
100
|
+
const require2 = createRequire(import.meta.url);
|
|
101
|
+
const sums = require2("./checksums.json");
|
|
102
|
+
const asset = assetName(process.platform, process.arch);
|
|
103
|
+
const digest = sums.assets[asset]?.sha256;
|
|
104
|
+
if (digest === undefined) {
|
|
105
|
+
throw new Error(`No checksum published for ${asset}.`);
|
|
106
|
+
}
|
|
107
|
+
const bin = await ensureBinary({
|
|
108
|
+
base: sums.base,
|
|
109
|
+
asset,
|
|
110
|
+
sha256: digest,
|
|
111
|
+
target: cacheBin(process.env, homedir(), sums.version, asset),
|
|
112
|
+
note: (m) => process.stderr.write(` ${m}
|
|
113
|
+
`)
|
|
114
|
+
});
|
|
115
|
+
const res = spawnSync(bin, childArgs(process.argv.slice(2), sums.origin), {
|
|
116
|
+
stdio: "inherit",
|
|
117
|
+
env: { ...process.env, BUILDER_INVOKED_AS: "npx rankmycode" }
|
|
118
|
+
});
|
|
119
|
+
if (res.error !== undefined)
|
|
120
|
+
throw res.error;
|
|
121
|
+
if (res.signal !== null) {
|
|
122
|
+
process.kill(process.pid, res.signal);
|
|
123
|
+
}
|
|
124
|
+
return res.status ?? 1;
|
|
125
|
+
}
|
|
126
|
+
main().then((code) => process.exit(code)).catch((err) => {
|
|
127
|
+
const detail = err instanceof Error ? err.message : String(err);
|
|
128
|
+
process.stderr.write(`
|
|
129
|
+
${detail}
|
|
130
|
+
|
|
131
|
+
`);
|
|
132
|
+
process.exit(err instanceof UnsupportedPlatformError || err instanceof ChecksumError ? 2 : 1);
|
|
133
|
+
});
|