nairon-bench 0.0.17 → 0.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +193 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -9921,7 +9921,7 @@ function detectEnvironment(projectDir, agents) {
9921
9921
  if (session.toolNames) {
9922
9922
  for (const toolName of session.toolNames) {
9923
9923
  const name = toolName.toLowerCase();
9924
- const mcpMatch = name.match(/^mcp__(\w+)__/);
9924
+ const mcpMatch = name.match(/^mcp[_]{1,2}([a-z0-9-]+)[_]{1,2}/);
9925
9925
  if (mcpMatch) {
9926
9926
  const serverName = mcpMatch[1];
9927
9927
  if (!detectedMcps.includes(serverName)) {
@@ -9938,24 +9938,50 @@ function detectEnvironment(projectDir, agents) {
9938
9938
  hasNia = true;
9939
9939
  }
9940
9940
  }
9941
- if (name.includes("context7")) {
9941
+ if (name.includes("context7") || name.includes("context-7")) {
9942
9942
  hasContext7 = true;
9943
9943
  if (!detectedMcps.includes("context7")) {
9944
9944
  detectedMcps.push("context7");
9945
9945
  mcpCount++;
9946
9946
  }
9947
9947
  }
9948
- if (name.includes("supermemory")) {
9948
+ if (name.includes("supermemory") || name === "supermemory") {
9949
9949
  hasSupermemory = true;
9950
9950
  if (!detectedMcps.includes("supermemory")) {
9951
9951
  detectedMcps.push("supermemory");
9952
9952
  mcpCount++;
9953
9953
  }
9954
9954
  }
9955
+ if (name.includes("nia") && name.startsWith("mcp")) {
9956
+ hasNia = true;
9957
+ if (!detectedMcps.includes("nia")) {
9958
+ detectedMcps.push("nia");
9959
+ mcpCount++;
9960
+ }
9961
+ }
9955
9962
  }
9956
9963
  }
9957
9964
  }
9958
9965
  }
9966
+ const transcriptsDir = join4(home, ".claude", "transcripts");
9967
+ if (!hasSupermemory && existsSync4(transcriptsDir)) {
9968
+ try {
9969
+ const transcriptFiles = readdirSync2(transcriptsDir).filter((f3) => f3.endsWith(".jsonl")).slice(-20);
9970
+ for (const file of transcriptFiles) {
9971
+ try {
9972
+ const content = readFileSync4(join4(transcriptsDir, file), "utf-8");
9973
+ if (content.includes('"tool_name":"supermemory"') || content.includes('"name":"supermemory"') || content.includes("supermemory")) {
9974
+ hasSupermemory = true;
9975
+ if (!detectedMcps.includes("supermemory")) {
9976
+ detectedMcps.push("supermemory");
9977
+ mcpCount++;
9978
+ }
9979
+ break;
9980
+ }
9981
+ } catch {}
9982
+ }
9983
+ } catch {}
9984
+ }
9959
9985
  const claudeSettingsLocal = join4(home, ".claude", "settings.local.json");
9960
9986
  const claudeProjectSettings = join4(projectDir, ".claude", "settings.local.json");
9961
9987
  const mcpConfigPaths = [
@@ -15267,7 +15293,8 @@ var toolsCommand = defineCommand2({
15267
15293
  discover: discoverCommand(),
15268
15294
  search: searchCommand(),
15269
15295
  info: infoCommand(),
15270
- compare: compareCommand()
15296
+ compare: compareCommand(),
15297
+ admin: adminCommand()
15271
15298
  }
15272
15299
  });
15273
15300
  function discoverCommand() {
@@ -15500,6 +15527,168 @@ function renderToolList(tools) {
15500
15527
  }
15501
15528
  consola.info(`Use \`nb tools info <slug>\` for setup instructions.`);
15502
15529
  }
15530
+ function adminCommand() {
15531
+ return defineCommand2({
15532
+ meta: {
15533
+ name: "admin",
15534
+ description: "Admin tools for reviewing discovered tools"
15535
+ },
15536
+ subCommands: {
15537
+ pending: pendingCommand(),
15538
+ approve: approveCommand(),
15539
+ reject: rejectCommand(),
15540
+ stats: statsCommand()
15541
+ }
15542
+ });
15543
+ }
15544
+ function pendingCommand() {
15545
+ return defineCommand2({
15546
+ meta: {
15547
+ name: "pending",
15548
+ description: "List tools pending review"
15549
+ },
15550
+ args: {
15551
+ limit: {
15552
+ type: "string",
15553
+ description: "Max results",
15554
+ default: "20"
15555
+ }
15556
+ },
15557
+ async run({ args }) {
15558
+ const client = getClient();
15559
+ if (!client) {
15560
+ console.log(` ${icons.error} Not connected. Run ${colors2.primary("nb init")} first.`);
15561
+ return;
15562
+ }
15563
+ const spinner = createSpinner("Fetching pending tools...");
15564
+ spinner.start();
15565
+ const tools = await client.query(api.tools.listPending, {
15566
+ limit: parseInt(args.limit, 10)
15567
+ });
15568
+ spinner.succeed(`Found ${tools.length} pending tools`);
15569
+ console.log();
15570
+ if (tools.length === 0) {
15571
+ console.log(` ${icons.success} No tools pending review!`);
15572
+ return;
15573
+ }
15574
+ for (const tool of tools) {
15575
+ const phases = tool.sdlcPhases.join(", ");
15576
+ const source = tool.mentions?.[0]?.source ?? "unknown";
15577
+ console.log(` ${colors2.bold(tool.name)}`);
15578
+ console.log(` ${colors2.dim("Slug:")} ${colors2.primary(tool.slug)}`);
15579
+ console.log(` ${colors2.dim("URL:")} ${tool.url}`);
15580
+ console.log(` ${colors2.dim("Source:")} ${source}`);
15581
+ console.log(` ${colors2.dim("Phases:")} ${phases}`);
15582
+ console.log(` ${colors2.dim(tool.description.slice(0, 100))}${tool.description.length > 100 ? "..." : ""}`);
15583
+ console.log();
15584
+ }
15585
+ console.log(colors2.dim(" Commands:"));
15586
+ console.log(` ${colors2.primary("nb tools admin approve <slug>")} - Approve a tool`);
15587
+ console.log(` ${colors2.primary("nb tools admin reject <slug>")} - Reject a tool`);
15588
+ }
15589
+ });
15590
+ }
15591
+ function approveCommand() {
15592
+ return defineCommand2({
15593
+ meta: {
15594
+ name: "approve",
15595
+ description: "Approve a pending tool"
15596
+ },
15597
+ args: {
15598
+ slug: {
15599
+ type: "positional",
15600
+ description: "Tool slug to approve",
15601
+ required: true
15602
+ },
15603
+ phases: {
15604
+ type: "string",
15605
+ description: "SDLC phases (comma-separated: requirements,planning,implementation,testing,review)"
15606
+ }
15607
+ },
15608
+ async run({ args }) {
15609
+ const client = getClient();
15610
+ if (!client) {
15611
+ console.log(` ${icons.error} Not connected. Run ${colors2.primary("nb init")} first.`);
15612
+ return;
15613
+ }
15614
+ const spinner = createSpinner(`Approving ${args.slug}...`);
15615
+ spinner.start();
15616
+ try {
15617
+ const result = args.phases ? await client.mutation(api.tools.approveTool, {
15618
+ slug: args.slug,
15619
+ sdlcPhases: args.phases.split(",").map((p) => p.trim())
15620
+ }) : await client.mutation(api.tools.approveTool, {
15621
+ slug: args.slug
15622
+ });
15623
+ spinner.succeed(`Approved: ${colors2.success(result.name)}`);
15624
+ } catch (error2) {
15625
+ spinner.fail(`Failed to approve: ${error2 instanceof Error ? error2.message : String(error2)}`);
15626
+ }
15627
+ }
15628
+ });
15629
+ }
15630
+ function rejectCommand() {
15631
+ return defineCommand2({
15632
+ meta: {
15633
+ name: "reject",
15634
+ description: "Reject a pending tool"
15635
+ },
15636
+ args: {
15637
+ slug: {
15638
+ type: "positional",
15639
+ description: "Tool slug to reject",
15640
+ required: true
15641
+ },
15642
+ reason: {
15643
+ type: "string",
15644
+ description: "Reason for rejection"
15645
+ }
15646
+ },
15647
+ async run({ args }) {
15648
+ const client = getClient();
15649
+ if (!client) {
15650
+ console.log(` ${icons.error} Not connected. Run ${colors2.primary("nb init")} first.`);
15651
+ return;
15652
+ }
15653
+ const spinner = createSpinner(`Rejecting ${args.slug}...`);
15654
+ spinner.start();
15655
+ try {
15656
+ const result = await client.mutation(api.tools.rejectTool, {
15657
+ slug: args.slug,
15658
+ reason: args.reason
15659
+ });
15660
+ spinner.succeed(`Rejected: ${colors2.warning(result.name)}`);
15661
+ } catch (error2) {
15662
+ spinner.fail(`Failed to reject: ${error2 instanceof Error ? error2.message : String(error2)}`);
15663
+ }
15664
+ }
15665
+ });
15666
+ }
15667
+ function statsCommand() {
15668
+ return defineCommand2({
15669
+ meta: {
15670
+ name: "stats",
15671
+ description: "Show tool database statistics"
15672
+ },
15673
+ async run() {
15674
+ const client = getClient();
15675
+ if (!client) {
15676
+ console.log(` ${icons.error} Not connected. Run ${colors2.primary("nb init")} first.`);
15677
+ return;
15678
+ }
15679
+ const spinner = createSpinner("Fetching stats...");
15680
+ spinner.start();
15681
+ const stats = await client.query(api.tools.getStats, {});
15682
+ spinner.succeed("Tool Database Stats");
15683
+ console.log();
15684
+ console.log(` ${icons.pending} Pending: ${colors2.warning(stats.pending.toString())}`);
15685
+ console.log(` ${icons.success} Approved: ${colors2.success(stats.approved.toString())}`);
15686
+ console.log(` ${icons.error} Rejected: ${colors2.error(stats.rejected.toString())}`);
15687
+ console.log(` ${colors2.dim("─".repeat(25))}`);
15688
+ console.log(` ${icons.info} Total: ${colors2.primary(stats.total.toString())}`);
15689
+ }
15690
+ });
15691
+ }
15503
15692
 
15504
15693
  // src/commands/dashboard.ts
15505
15694
  init_dist();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nairon-bench",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "description": "AI workflow benchmarking CLI",
5
5
  "type": "module",
6
6
  "bin": {