nairon-bench 0.0.24 → 0.0.26
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 +108 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16066,8 +16066,9 @@ function renderBar2(value, width) {
|
|
|
16066
16066
|
init_dist();
|
|
16067
16067
|
init_client();
|
|
16068
16068
|
import { existsSync as existsSync9, readdirSync as readdirSync3, readFileSync as readFileSync6 } from "node:fs";
|
|
16069
|
-
import { join as join9 } from "node:path";
|
|
16069
|
+
import { join as join9, basename as basename2 } from "node:path";
|
|
16070
16070
|
import { homedir as homedir7 } from "node:os";
|
|
16071
|
+
import { execSync as execSync2 } from "node:child_process";
|
|
16071
16072
|
var publishCommand = defineCommand2({
|
|
16072
16073
|
meta: {
|
|
16073
16074
|
name: "publish",
|
|
@@ -16136,7 +16137,16 @@ var publishCommand = defineCommand2({
|
|
|
16136
16137
|
consola.error("Not connected. Run `nb init` first.");
|
|
16137
16138
|
process.exit(1);
|
|
16138
16139
|
}
|
|
16139
|
-
|
|
16140
|
+
const repoInfo = detectRepository(projectDir);
|
|
16141
|
+
const mcpServers = detectMCPServers(projectDir);
|
|
16142
|
+
const skills = detectSkills(projectDir);
|
|
16143
|
+
if (mcpServers.length > 0) {
|
|
16144
|
+
consola.success(`Found ${mcpServers.length} MCP servers`);
|
|
16145
|
+
}
|
|
16146
|
+
if (skills.length > 0) {
|
|
16147
|
+
consola.success(`Found ${skills.length} skills`);
|
|
16148
|
+
}
|
|
16149
|
+
consola.info(`Publishing report for ${repoInfo.name}...`);
|
|
16140
16150
|
try {
|
|
16141
16151
|
const result = await client.mutation(api.publicReports.publish, {
|
|
16142
16152
|
clerkId,
|
|
@@ -16155,7 +16165,11 @@ var publishCommand = defineCommand2({
|
|
|
16155
16165
|
patternCorrectionRate: aggregated.patternCorrectionRate,
|
|
16156
16166
|
scansAnalyzed: reports.length,
|
|
16157
16167
|
periodStart: reports[0]?.date ?? new Date().toISOString(),
|
|
16158
|
-
periodEnd: reports[reports.length - 1]?.date ?? new Date().toISOString()
|
|
16168
|
+
periodEnd: reports[reports.length - 1]?.date ?? new Date().toISOString(),
|
|
16169
|
+
repositoryName: repoInfo.name,
|
|
16170
|
+
...repoInfo.url ? { repositoryUrl: repoInfo.url } : {},
|
|
16171
|
+
mcpServers: mcpServers.map((s2) => s2.name),
|
|
16172
|
+
skills: skills.map((s2) => s2.name)
|
|
16159
16173
|
});
|
|
16160
16174
|
consola.success(`Published! Your report is live.`);
|
|
16161
16175
|
consola.log("");
|
|
@@ -16241,9 +16255,9 @@ function detectTools(projectDir) {
|
|
|
16241
16255
|
{ name: "Windsurf", check: () => existsSync9(join9(home, ".windsurf")) },
|
|
16242
16256
|
{ name: "Aider", check: () => existsSync9(join9(projectDir, ".aider.conf.yml")) },
|
|
16243
16257
|
{ name: "Codeium", check: () => existsSync9(join9(home, ".codeium")) },
|
|
16244
|
-
{ name: "
|
|
16245
|
-
{ name: "
|
|
16246
|
-
{ name: "
|
|
16258
|
+
{ name: "Tabnine", check: () => existsSync9(join9(home, ".tabnine")) },
|
|
16259
|
+
{ name: "Amazon Q", check: () => existsSync9(join9(home, ".aws", "amazonq")) },
|
|
16260
|
+
{ name: "Beads", check: () => existsSync9(join9(projectDir, ".beads")) }
|
|
16247
16261
|
];
|
|
16248
16262
|
for (const { name, check } of toolChecks) {
|
|
16249
16263
|
try {
|
|
@@ -16254,6 +16268,65 @@ function detectTools(projectDir) {
|
|
|
16254
16268
|
}
|
|
16255
16269
|
return tools;
|
|
16256
16270
|
}
|
|
16271
|
+
function detectMCPServers(projectDir) {
|
|
16272
|
+
const servers = [];
|
|
16273
|
+
const home = homedir7();
|
|
16274
|
+
const mcpLocations = [
|
|
16275
|
+
{ path: join9(home, ".mcp.json"), source: "global" },
|
|
16276
|
+
{ path: join9(home, ".cursor", "mcp.json"), source: "Cursor" },
|
|
16277
|
+
{ path: join9(home, ".windsurf", "mcp_config.json"), source: "Windsurf" },
|
|
16278
|
+
{ path: join9(projectDir, ".mcp.json"), source: "project" },
|
|
16279
|
+
{ path: join9(projectDir, ".cursor", "mcp.json"), source: "Cursor (project)" },
|
|
16280
|
+
{ path: join9(projectDir, ".windsurf", "mcp_config.json"), source: "Windsurf (project)" }
|
|
16281
|
+
];
|
|
16282
|
+
for (const { path, source } of mcpLocations) {
|
|
16283
|
+
try {
|
|
16284
|
+
if (existsSync9(path)) {
|
|
16285
|
+
const content = readFileSync6(path, "utf-8");
|
|
16286
|
+
const config = JSON.parse(content);
|
|
16287
|
+
const mcpServers = config.mcpServers || config;
|
|
16288
|
+
if (typeof mcpServers === "object") {
|
|
16289
|
+
for (const name of Object.keys(mcpServers)) {
|
|
16290
|
+
if (!servers.some((s2) => s2.name === name)) {
|
|
16291
|
+
servers.push({ name, source });
|
|
16292
|
+
}
|
|
16293
|
+
}
|
|
16294
|
+
}
|
|
16295
|
+
}
|
|
16296
|
+
} catch {}
|
|
16297
|
+
}
|
|
16298
|
+
return servers;
|
|
16299
|
+
}
|
|
16300
|
+
function detectSkills(projectDir) {
|
|
16301
|
+
const skills = [];
|
|
16302
|
+
const home = homedir7();
|
|
16303
|
+
const skillsLocations = [
|
|
16304
|
+
{ path: join9(home, ".claude", "skills"), source: "Claude Code" },
|
|
16305
|
+
{ path: join9(home, ".cursor", "skills"), source: "Cursor" },
|
|
16306
|
+
{ path: join9(home, ".config", "opencode", "skills"), source: "OpenCode" },
|
|
16307
|
+
{ path: join9(home, ".windsurf", "skills"), source: "Windsurf" },
|
|
16308
|
+
{ path: join9(home, ".agents", "skills"), source: "Agents" },
|
|
16309
|
+
{ path: join9(home, ".config", "agents", "skills"), source: "Agents" },
|
|
16310
|
+
{ path: join9(projectDir, ".claude", "skills"), source: "Claude Code (project)" },
|
|
16311
|
+
{ path: join9(projectDir, ".cursor", "skills"), source: "Cursor (project)" }
|
|
16312
|
+
];
|
|
16313
|
+
for (const { path, source } of skillsLocations) {
|
|
16314
|
+
try {
|
|
16315
|
+
if (existsSync9(path)) {
|
|
16316
|
+
const entries = readdirSync3(path, { withFileTypes: true });
|
|
16317
|
+
for (const entry of entries) {
|
|
16318
|
+
if (entry.isDirectory() || entry.isSymbolicLink()) {
|
|
16319
|
+
const skillName = entry.name;
|
|
16320
|
+
if (!skills.some((s2) => s2.name === skillName)) {
|
|
16321
|
+
skills.push({ name: skillName, source });
|
|
16322
|
+
}
|
|
16323
|
+
}
|
|
16324
|
+
}
|
|
16325
|
+
}
|
|
16326
|
+
} catch {}
|
|
16327
|
+
}
|
|
16328
|
+
return skills;
|
|
16329
|
+
}
|
|
16257
16330
|
function aggregateReports(reports) {
|
|
16258
16331
|
if (reports.length === 0) {
|
|
16259
16332
|
return {
|
|
@@ -16351,6 +16424,27 @@ function formatPreview(data) {
|
|
|
16351
16424
|
return lines.join(`
|
|
16352
16425
|
`);
|
|
16353
16426
|
}
|
|
16427
|
+
function detectRepository(projectDir) {
|
|
16428
|
+
const name = basename2(projectDir);
|
|
16429
|
+
let url;
|
|
16430
|
+
try {
|
|
16431
|
+
const remoteUrl = execSync2("git remote get-url origin", {
|
|
16432
|
+
cwd: projectDir,
|
|
16433
|
+
encoding: "utf-8",
|
|
16434
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
16435
|
+
}).trim();
|
|
16436
|
+
if (remoteUrl.startsWith("git@github.com:")) {
|
|
16437
|
+
url = remoteUrl.replace("git@github.com:", "https://github.com/").replace(/\.git$/, "");
|
|
16438
|
+
} else if (remoteUrl.startsWith("https://")) {
|
|
16439
|
+
url = remoteUrl.replace(/\.git$/, "");
|
|
16440
|
+
} else {
|
|
16441
|
+
url = remoteUrl;
|
|
16442
|
+
}
|
|
16443
|
+
} catch {
|
|
16444
|
+
url = undefined;
|
|
16445
|
+
}
|
|
16446
|
+
return { name, url };
|
|
16447
|
+
}
|
|
16354
16448
|
|
|
16355
16449
|
// src/commands/history.ts
|
|
16356
16450
|
init_client();
|
|
@@ -16658,7 +16752,7 @@ function formatTokens3(tokens) {
|
|
|
16658
16752
|
// src/commands/session.ts
|
|
16659
16753
|
import { existsSync as existsSync10, readdirSync as readdirSync4, readFileSync as readFileSync7, statSync as statSync2 } from "node:fs";
|
|
16660
16754
|
import { homedir as homedir8 } from "node:os";
|
|
16661
|
-
import { join as join10, basename as
|
|
16755
|
+
import { join as join10, basename as basename3 } from "node:path";
|
|
16662
16756
|
var sessionCommand = defineCommand2({
|
|
16663
16757
|
meta: {
|
|
16664
16758
|
name: "session",
|
|
@@ -16831,7 +16925,7 @@ async function collectSessionList() {
|
|
|
16831
16925
|
const files = readdirSync4(projectPath).filter((f3) => f3.endsWith(".jsonl"));
|
|
16832
16926
|
for (const file of files) {
|
|
16833
16927
|
const filePath = join10(projectPath, file);
|
|
16834
|
-
const sessionId =
|
|
16928
|
+
const sessionId = basename3(file, ".jsonl").slice(0, 8);
|
|
16835
16929
|
try {
|
|
16836
16930
|
const content = readFileSync7(filePath, "utf-8");
|
|
16837
16931
|
const lines = content.trim().split(`
|
|
@@ -17172,7 +17266,7 @@ function generateCSV(data) {
|
|
|
17172
17266
|
}
|
|
17173
17267
|
|
|
17174
17268
|
// src/commands/pr.ts
|
|
17175
|
-
import { execSync as
|
|
17269
|
+
import { execSync as execSync3 } from "node:child_process";
|
|
17176
17270
|
var prCommand = defineCommand2({
|
|
17177
17271
|
meta: {
|
|
17178
17272
|
name: "pr",
|
|
@@ -17317,14 +17411,14 @@ async function getPRInfo(prArg) {
|
|
|
17317
17411
|
const match = prArg.match(/\/pull\/(\d+)/);
|
|
17318
17412
|
prNumber = match ? match[1] : prArg;
|
|
17319
17413
|
} else {
|
|
17320
|
-
const branch =
|
|
17321
|
-
const result2 =
|
|
17414
|
+
const branch = execSync3("git branch --show-current", { encoding: "utf-8" }).trim();
|
|
17415
|
+
const result2 = execSync3(`gh pr list --head "${branch}" --json number --limit 1`, { encoding: "utf-8" });
|
|
17322
17416
|
const prs = JSON.parse(result2);
|
|
17323
17417
|
if (prs.length === 0)
|
|
17324
17418
|
return null;
|
|
17325
17419
|
prNumber = prs[0].number.toString();
|
|
17326
17420
|
}
|
|
17327
|
-
const result =
|
|
17421
|
+
const result = execSync3(`gh pr view ${prNumber} --json number,title,author,createdAt,mergedAt,additions,deletions`, { encoding: "utf-8" });
|
|
17328
17422
|
const pr = JSON.parse(result);
|
|
17329
17423
|
return {
|
|
17330
17424
|
number: pr.number,
|
|
@@ -17341,7 +17435,7 @@ async function getPRInfo(prArg) {
|
|
|
17341
17435
|
}
|
|
17342
17436
|
async function getPRCommits(prNumber) {
|
|
17343
17437
|
try {
|
|
17344
|
-
const result =
|
|
17438
|
+
const result = execSync3(`gh pr view ${prNumber} --json commits --jq '.commits[].oid'`, { encoding: "utf-8" });
|
|
17345
17439
|
return result.trim().split(`
|
|
17346
17440
|
`).filter(Boolean);
|
|
17347
17441
|
} catch {
|
|
@@ -17702,7 +17796,7 @@ function formatBytes(bytes) {
|
|
|
17702
17796
|
// package.json
|
|
17703
17797
|
var package_default = {
|
|
17704
17798
|
name: "nairon-bench",
|
|
17705
|
-
version: "0.0.
|
|
17799
|
+
version: "0.0.26",
|
|
17706
17800
|
description: "AI workflow benchmarking CLI",
|
|
17707
17801
|
type: "module",
|
|
17708
17802
|
bin: {
|