evalify-cli 0.1.1 → 0.1.2

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 CHANGED
@@ -1,17 +1,12 @@
1
1
  #!/usr/bin/env node
2
+ "use strict";
2
3
  var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
7
  var __getProtoOf = Object.getPrototypeOf;
7
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
9
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
10
- }) : x)(function(x) {
11
- if (typeof require !== "undefined") return require.apply(this, arguments);
12
- throw Error('Dynamic require of "' + x + '" is not supported');
13
- });
14
- var __commonJS = (cb, mod) => function __require2() {
9
+ var __commonJS = (cb, mod) => function __require() {
15
10
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
16
11
  };
17
12
  var __copyProps = (to, from, except, desc) => {
@@ -33,7 +28,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
28
 
34
29
  // ../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/error.js
35
30
  var require_error = __commonJS({
36
- "../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/error.js"(exports) {
31
+ "../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/error.js"(exports2) {
37
32
  "use strict";
38
33
  var CommanderError2 = class extends Error {
39
34
  /**
@@ -62,14 +57,14 @@ var require_error = __commonJS({
62
57
  this.name = this.constructor.name;
63
58
  }
64
59
  };
65
- exports.CommanderError = CommanderError2;
66
- exports.InvalidArgumentError = InvalidArgumentError2;
60
+ exports2.CommanderError = CommanderError2;
61
+ exports2.InvalidArgumentError = InvalidArgumentError2;
67
62
  }
68
63
  });
69
64
 
70
65
  // ../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/argument.js
71
66
  var require_argument = __commonJS({
72
- "../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/argument.js"(exports) {
67
+ "../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/argument.js"(exports2) {
73
68
  "use strict";
74
69
  var { InvalidArgumentError: InvalidArgumentError2 } = require_error();
75
70
  var Argument2 = class {
@@ -190,14 +185,14 @@ var require_argument = __commonJS({
190
185
  const nameOutput = arg.name() + (arg.variadic === true ? "..." : "");
191
186
  return arg.required ? "<" + nameOutput + ">" : "[" + nameOutput + "]";
192
187
  }
193
- exports.Argument = Argument2;
194
- exports.humanReadableArgName = humanReadableArgName;
188
+ exports2.Argument = Argument2;
189
+ exports2.humanReadableArgName = humanReadableArgName;
195
190
  }
196
191
  });
197
192
 
198
193
  // ../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/help.js
199
194
  var require_help = __commonJS({
200
- "../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/help.js"(exports) {
195
+ "../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/help.js"(exports2) {
201
196
  "use strict";
202
197
  var { humanReadableArgName } = require_argument();
203
198
  var Help2 = class {
@@ -606,13 +601,13 @@ var require_help = __commonJS({
606
601
  }).join("\n");
607
602
  }
608
603
  };
609
- exports.Help = Help2;
604
+ exports2.Help = Help2;
610
605
  }
611
606
  });
612
607
 
613
608
  // ../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/option.js
614
609
  var require_option = __commonJS({
615
- "../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/option.js"(exports) {
610
+ "../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/option.js"(exports2) {
616
611
  "use strict";
617
612
  var { InvalidArgumentError: InvalidArgumentError2 } = require_error();
618
613
  var Option2 = class {
@@ -878,14 +873,14 @@ var require_option = __commonJS({
878
873
  }
879
874
  return { shortFlag, longFlag };
880
875
  }
881
- exports.Option = Option2;
882
- exports.DualOptions = DualOptions;
876
+ exports2.Option = Option2;
877
+ exports2.DualOptions = DualOptions;
883
878
  }
884
879
  });
885
880
 
886
881
  // ../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/suggestSimilar.js
887
882
  var require_suggestSimilar = __commonJS({
888
- "../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/suggestSimilar.js"(exports) {
883
+ "../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/suggestSimilar.js"(exports2) {
889
884
  "use strict";
890
885
  var maxDistance = 3;
891
886
  function editDistance(a, b) {
@@ -960,19 +955,19 @@ var require_suggestSimilar = __commonJS({
960
955
  }
961
956
  return "";
962
957
  }
963
- exports.suggestSimilar = suggestSimilar;
958
+ exports2.suggestSimilar = suggestSimilar;
964
959
  }
965
960
  });
966
961
 
967
962
  // ../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/command.js
968
963
  var require_command = __commonJS({
969
- "../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/command.js"(exports) {
964
+ "../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/command.js"(exports2) {
970
965
  "use strict";
971
- var EventEmitter = __require("events").EventEmitter;
972
- var childProcess = __require("child_process");
973
- var path4 = __require("path");
974
- var fs4 = __require("fs");
975
- var process3 = __require("process");
966
+ var EventEmitter = require("events").EventEmitter;
967
+ var childProcess = require("child_process");
968
+ var path4 = require("path");
969
+ var fs4 = require("fs");
970
+ var process3 = require("process");
976
971
  var { Argument: Argument2, humanReadableArgName } = require_argument();
977
972
  var { CommanderError: CommanderError2 } = require_error();
978
973
  var { Help: Help2 } = require_help();
@@ -3004,30 +2999,30 @@ Expecting one of '${allowedValues.join("', '")}'`);
3004
2999
  return arg;
3005
3000
  });
3006
3001
  }
3007
- exports.Command = Command2;
3002
+ exports2.Command = Command2;
3008
3003
  }
3009
3004
  });
3010
3005
 
3011
3006
  // ../node_modules/.pnpm/commander@12.1.0/node_modules/commander/index.js
3012
3007
  var require_commander = __commonJS({
3013
- "../node_modules/.pnpm/commander@12.1.0/node_modules/commander/index.js"(exports) {
3008
+ "../node_modules/.pnpm/commander@12.1.0/node_modules/commander/index.js"(exports2) {
3014
3009
  "use strict";
3015
3010
  var { Argument: Argument2 } = require_argument();
3016
3011
  var { Command: Command2 } = require_command();
3017
3012
  var { CommanderError: CommanderError2, InvalidArgumentError: InvalidArgumentError2 } = require_error();
3018
3013
  var { Help: Help2 } = require_help();
3019
3014
  var { Option: Option2 } = require_option();
3020
- exports.program = new Command2();
3021
- exports.createCommand = (name) => new Command2(name);
3022
- exports.createOption = (flags, description) => new Option2(flags, description);
3023
- exports.createArgument = (name, description) => new Argument2(name, description);
3024
- exports.Command = Command2;
3025
- exports.Option = Option2;
3026
- exports.Argument = Argument2;
3027
- exports.Help = Help2;
3028
- exports.CommanderError = CommanderError2;
3029
- exports.InvalidArgumentError = InvalidArgumentError2;
3030
- exports.InvalidOptionArgumentError = InvalidArgumentError2;
3015
+ exports2.program = new Command2();
3016
+ exports2.createCommand = (name) => new Command2(name);
3017
+ exports2.createOption = (flags, description) => new Option2(flags, description);
3018
+ exports2.createArgument = (name, description) => new Argument2(name, description);
3019
+ exports2.Command = Command2;
3020
+ exports2.Option = Option2;
3021
+ exports2.Argument = Argument2;
3022
+ exports2.Help = Help2;
3023
+ exports2.CommanderError = CommanderError2;
3024
+ exports2.InvalidArgumentError = InvalidArgumentError2;
3025
+ exports2.InvalidOptionArgumentError = InvalidArgumentError2;
3031
3026
  }
3032
3027
  });
3033
3028
 
@@ -3235,16 +3230,16 @@ var ansiStyles = assembleStyles();
3235
3230
  var ansi_styles_default = ansiStyles;
3236
3231
 
3237
3232
  // ../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.js
3238
- import process2 from "process";
3239
- import os from "os";
3240
- import tty from "tty";
3241
- function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
3233
+ var import_node_process = __toESM(require("process"), 1);
3234
+ var import_node_os = __toESM(require("os"), 1);
3235
+ var import_node_tty = __toESM(require("tty"), 1);
3236
+ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process.default.argv) {
3242
3237
  const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
3243
3238
  const position = argv.indexOf(prefix + flag);
3244
3239
  const terminatorPosition = argv.indexOf("--");
3245
3240
  return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
3246
3241
  }
3247
- var { env } = process2;
3242
+ var { env } = import_node_process.default;
3248
3243
  var flagForceColor;
3249
3244
  if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
3250
3245
  flagForceColor = 0;
@@ -3300,8 +3295,8 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
3300
3295
  if (env.TERM === "dumb") {
3301
3296
  return min;
3302
3297
  }
3303
- if (process2.platform === "win32") {
3304
- const osRelease = os.release().split(".");
3298
+ if (import_node_process.default.platform === "win32") {
3299
+ const osRelease = import_node_os.default.release().split(".");
3305
3300
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
3306
3301
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
3307
3302
  }
@@ -3361,8 +3356,8 @@ function createSupportsColor(stream, options = {}) {
3361
3356
  return translateLevel(level);
3362
3357
  }
3363
3358
  var supportsColor = {
3364
- stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
3365
- stderr: createSupportsColor({ isTTY: tty.isatty(2) })
3359
+ stdout: createSupportsColor({ isTTY: import_node_tty.default.isatty(1) }),
3360
+ stderr: createSupportsColor({ isTTY: import_node_tty.default.isatty(2) })
3366
3361
  };
3367
3362
  var supports_color_default = supportsColor;
3368
3363
 
@@ -3577,8 +3572,8 @@ function table(rows) {
3577
3572
  }
3578
3573
 
3579
3574
  // src/commands/pull.ts
3580
- import path from "path";
3581
- import fs from "fs/promises";
3575
+ var import_node_path = __toESM(require("path"));
3576
+ var import_promises = __toESM(require("fs/promises"));
3582
3577
  var REGISTRY_URL = "https://evalify.sh/api/registry";
3583
3578
  async function pull(slug) {
3584
3579
  header();
@@ -3609,10 +3604,10 @@ async function pull(slug) {
3609
3604
  console.log();
3610
3605
  return;
3611
3606
  }
3612
- const targetDir = path.resolve(process.cwd(), "evals", slug);
3613
- const targetFile = path.join(targetDir, "evals.json");
3607
+ const targetDir = import_node_path.default.resolve(process.cwd(), "evals", slug);
3608
+ const targetFile = import_node_path.default.join(targetDir, "evals.json");
3614
3609
  try {
3615
- await fs.mkdir(targetDir, { recursive: true });
3610
+ await import_promises.default.mkdir(targetDir, { recursive: true });
3616
3611
  const output = {
3617
3612
  slug: pack.slug,
3618
3613
  displayName: pack.displayName,
@@ -3623,7 +3618,7 @@ async function pull(slug) {
3623
3618
  tags: pack.tags,
3624
3619
  evals: pack.evals
3625
3620
  };
3626
- await fs.writeFile(targetFile, JSON.stringify(output, null, 2) + "\n");
3621
+ await import_promises.default.writeFile(targetFile, JSON.stringify(output, null, 2) + "\n");
3627
3622
  success(`Pulled ${pack.displayName} v${pack.version}`);
3628
3623
  success(`Wrote ${pack.evals.length} eval${pack.evals.length !== 1 ? "s" : ""} to evals/${slug}/evals.json`);
3629
3624
  console.log();
@@ -3638,8 +3633,8 @@ async function pull(slug) {
3638
3633
  }
3639
3634
 
3640
3635
  // src/commands/publish.ts
3641
- import path2 from "path";
3642
- import fs2 from "fs/promises";
3636
+ var import_node_path2 = __toESM(require("path"));
3637
+ var import_promises2 = __toESM(require("fs/promises"));
3643
3638
 
3644
3639
  // ../packages/frameworks/dist/anthropic-skillcreator-v2.js
3645
3640
  function extractItems(parsed) {
@@ -3832,15 +3827,15 @@ function validateEvalsJson(content) {
3832
3827
 
3833
3828
  // src/commands/publish.ts
3834
3829
  async function findEvalsFile(targetPath) {
3835
- const stat = await fs2.stat(targetPath);
3830
+ const stat = await import_promises2.default.stat(targetPath);
3836
3831
  if (stat.isFile()) return targetPath;
3837
3832
  const candidates = [
3838
- path2.join(targetPath, "evals", "evals.json"),
3839
- path2.join(targetPath, "evals.json")
3833
+ import_node_path2.default.join(targetPath, "evals", "evals.json"),
3834
+ import_node_path2.default.join(targetPath, "evals.json")
3840
3835
  ];
3841
3836
  for (const candidate of candidates) {
3842
3837
  try {
3843
- await fs2.access(candidate);
3838
+ await import_promises2.default.access(candidate);
3844
3839
  return candidate;
3845
3840
  } catch {
3846
3841
  }
@@ -3849,9 +3844,9 @@ async function findEvalsFile(targetPath) {
3849
3844
  }
3850
3845
  async function publish(targetPath) {
3851
3846
  header();
3852
- const resolvedPath = path2.resolve(process.cwd(), targetPath || ".");
3847
+ const resolvedPath = import_node_path2.default.resolve(process.cwd(), targetPath || ".");
3853
3848
  try {
3854
- await fs2.access(resolvedPath);
3849
+ await import_promises2.default.access(resolvedPath);
3855
3850
  } catch {
3856
3851
  error(`Path not found: ${targetPath || "."}`);
3857
3852
  console.log();
@@ -3868,8 +3863,8 @@ async function publish(targetPath) {
3868
3863
  console.log();
3869
3864
  return;
3870
3865
  }
3871
- success(`Found ${path2.relative(process.cwd(), filePath)}`);
3872
- const content = await fs2.readFile(filePath, "utf-8");
3866
+ success(`Found ${import_node_path2.default.relative(process.cwd(), filePath)}`);
3867
+ const content = await import_promises2.default.readFile(filePath, "utf-8");
3873
3868
  const result = validateEvalsJson(content);
3874
3869
  if (!result.valid) {
3875
3870
  console.log();
@@ -3900,7 +3895,7 @@ async function publish(targetPath) {
3900
3895
  }
3901
3896
  dim(`Format: ${getFramework(result.format)?.meta.name ?? result.format}`);
3902
3897
  dim(`Eval count: ${result.evalCount}`);
3903
- dim(`File: ${path2.relative(process.cwd(), filePath)}`);
3898
+ dim(`File: ${import_node_path2.default.relative(process.cwd(), filePath)}`);
3904
3899
  console.log();
3905
3900
  warn("Dry run \u2014 publishing is not yet connected to the registry");
3906
3901
  success("File is valid and ready to publish");
@@ -3927,8 +3922,8 @@ async function search(query) {
3927
3922
  }
3928
3923
 
3929
3924
  // src/commands/validate.ts
3930
- import path3 from "path";
3931
- import fs3 from "fs/promises";
3925
+ var import_node_path3 = __toESM(require("path"));
3926
+ var import_promises3 = __toESM(require("fs/promises"));
3932
3927
  var ALLOWED_EXTENSIONS = /* @__PURE__ */ new Set([
3933
3928
  ".json",
3934
3929
  ".md",
@@ -3948,17 +3943,17 @@ var ALLOWED_EXTENSIONS = /* @__PURE__ */ new Set([
3948
3943
  ".toml"
3949
3944
  ]);
3950
3945
  async function findEvalsJson(targetPath) {
3951
- const stat = await fs3.stat(targetPath);
3946
+ const stat = await import_promises3.default.stat(targetPath);
3952
3947
  if (stat.isFile()) {
3953
- return { evalsPath: targetPath, rootDir: path3.dirname(targetPath) };
3948
+ return { evalsPath: targetPath, rootDir: import_node_path3.default.dirname(targetPath) };
3954
3949
  }
3955
3950
  const candidates = [
3956
- path3.join(targetPath, "evals", "evals.json"),
3957
- path3.join(targetPath, "evals.json")
3951
+ import_node_path3.default.join(targetPath, "evals", "evals.json"),
3952
+ import_node_path3.default.join(targetPath, "evals.json")
3958
3953
  ];
3959
3954
  for (const candidate of candidates) {
3960
3955
  try {
3961
- await fs3.access(candidate);
3956
+ await import_promises3.default.access(candidate);
3962
3957
  return { evalsPath: candidate, rootDir: targetPath };
3963
3958
  } catch {
3964
3959
  }
@@ -3967,19 +3962,19 @@ async function findEvalsJson(targetPath) {
3967
3962
  }
3968
3963
  async function scanCompanionFiles(rootDir, evalsPath, maxDepth = 2) {
3969
3964
  const companions = [];
3970
- const evalsRelative = path3.relative(rootDir, evalsPath);
3965
+ const evalsRelative = import_node_path3.default.relative(rootDir, evalsPath);
3971
3966
  async function walk(dir, depth) {
3972
3967
  if (depth > maxDepth) return;
3973
- const entries = await fs3.readdir(dir, { withFileTypes: true });
3968
+ const entries = await import_promises3.default.readdir(dir, { withFileTypes: true });
3974
3969
  for (const entry of entries) {
3975
3970
  if (entry.name.startsWith(".")) continue;
3976
- const fullPath = path3.join(dir, entry.name);
3977
- const relativePath = path3.relative(rootDir, fullPath);
3971
+ const fullPath = import_node_path3.default.join(dir, entry.name);
3972
+ const relativePath = import_node_path3.default.relative(rootDir, fullPath);
3978
3973
  if (entry.isDirectory()) {
3979
3974
  await walk(fullPath, depth + 1);
3980
3975
  } else if (entry.isFile()) {
3981
3976
  if (relativePath === evalsRelative) continue;
3982
- const ext = path3.extname(entry.name).toLowerCase();
3977
+ const ext = import_node_path3.default.extname(entry.name).toLowerCase();
3983
3978
  if (ALLOWED_EXTENSIONS.has(ext)) {
3984
3979
  companions.push(relativePath);
3985
3980
  }
@@ -4004,20 +3999,20 @@ function extractFileRefs(content) {
4004
3999
  }
4005
4000
  async function validate(targetPath) {
4006
4001
  header();
4007
- const resolvedPath = path3.resolve(process.cwd(), targetPath || ".");
4002
+ const resolvedPath = import_node_path3.default.resolve(process.cwd(), targetPath || ".");
4008
4003
  try {
4009
- await fs3.access(resolvedPath);
4004
+ await import_promises3.default.access(resolvedPath);
4010
4005
  } catch {
4011
4006
  error(`Path not found: ${targetPath || "."}`);
4012
4007
  console.log();
4013
4008
  return;
4014
4009
  }
4015
- const stat = await fs3.stat(resolvedPath);
4010
+ const stat = await import_promises3.default.stat(resolvedPath);
4016
4011
  const isFolder = stat.isDirectory();
4017
4012
  if (isFolder) {
4018
- info(`Scanning folder: ${path3.basename(resolvedPath)}/`);
4013
+ info(`Scanning folder: ${import_node_path3.default.basename(resolvedPath)}/`);
4019
4014
  } else {
4020
- info(`Validating: ${path3.basename(resolvedPath)}`);
4015
+ info(`Validating: ${import_node_path3.default.basename(resolvedPath)}`);
4021
4016
  }
4022
4017
  const found = await findEvalsJson(resolvedPath);
4023
4018
  if (!found) {
@@ -4030,7 +4025,7 @@ async function validate(targetPath) {
4030
4025
  return;
4031
4026
  }
4032
4027
  const { evalsPath, rootDir } = found;
4033
- const relEvalsPath = path3.relative(process.cwd(), evalsPath);
4028
+ const relEvalsPath = import_node_path3.default.relative(process.cwd(), evalsPath);
4034
4029
  success(`Found ${relEvalsPath}`);
4035
4030
  const companions = isFolder ? await scanCompanionFiles(rootDir, evalsPath) : [];
4036
4031
  if (companions.length > 0) {
@@ -4039,7 +4034,7 @@ async function validate(targetPath) {
4039
4034
  dim(c);
4040
4035
  }
4041
4036
  }
4042
- const content = await fs3.readFile(evalsPath, "utf-8");
4037
+ const content = await import_promises3.default.readFile(evalsPath, "utf-8");
4043
4038
  const result = validateEvalsJson(content);
4044
4039
  const fileRefs = extractFileRefs(content);
4045
4040
  if (fileRefs.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evalify-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "CLI tool for the Evalify eval criteria registry",
5
5
  "homepage": "https://evalify.sh",
6
6
  "repository": "https://github.com/AppVerse-cc/evalify",
@@ -21,6 +21,5 @@
21
21
  "@types/node": "^22.0.0",
22
22
  "tsup": "^8.5.1",
23
23
  "typescript": "^5.7.0"
24
- },
25
- "type": "module"
24
+ }
26
25
  }
package/tsup.config.ts CHANGED
@@ -2,7 +2,8 @@ import { defineConfig } from "tsup";
2
2
 
3
3
  export default defineConfig({
4
4
  entry: ["src/index.ts"],
5
- format: ["esm"],
5
+ format: ["cjs"],
6
+ platform: "node",
6
7
  bundle: true,
7
8
  minify: false,
8
9
  splitting: false,