@cejel/cejel 0.1.4 → 0.1.6

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
@@ -7,7 +7,7 @@ import {
7
7
  renderWitanHtmlReport,
8
8
  runCejelScan,
9
9
  serializeWitanReport
10
- } from "./chunk-SQNTNX5U.js";
10
+ } from "./chunk-A7NZKJ5H.js";
11
11
 
12
12
  // src/index.ts
13
13
  import { mkdirSync, readFileSync, realpathSync, writeFileSync } from "fs";
@@ -16,11 +16,15 @@ import { pathToFileURL } from "url";
16
16
 
17
17
  // src/terminal.ts
18
18
  function renderTerminalCertificate(summary) {
19
- const lines = summary.insufficientSourceReason ? [
19
+ const abstained = summary.verdict === "Insufficient source";
20
+ if (!abstained && (summary.overallScore === null || summary.codeTrustScore === null || summary.processTrustScore === null)) {
21
+ throw new Error("A scored Cejel summary must carry numeric headline scores.");
22
+ }
23
+ const lines = abstained ? [
20
24
  `Cejel Trust Certificate \u2014 ${summary.productDisplayName}`,
21
25
  "",
22
26
  "Insufficient source to certify.",
23
- ` ${summary.insufficientSourceReason}`,
27
+ ` ${summary.insufficientSourceReason ?? "No ratable source was found."}`,
24
28
  ""
25
29
  ] : [
26
30
  `Cejel Trust Certificate \u2014 ${summary.productDisplayName}`,
@@ -37,7 +41,7 @@ function renderTerminalCertificate(summary) {
37
41
  }
38
42
  lines.push("");
39
43
  }
40
- if (summary.insufficientSourceReason) {
44
+ if (abstained) {
41
45
  lines.push("See report.json / certificate.html for the full per-criterion detail.");
42
46
  } else if (summary.topFindings.length === 0) {
43
47
  lines.push("No evidence-backed findings.");
@@ -51,7 +55,7 @@ function renderTerminalCertificate(summary) {
51
55
  lines.push(` ...and ${remaining} more \u2014 see the written report for the full list.`);
52
56
  }
53
57
  }
54
- if (!summary.insufficientSourceReason && summary.externalFindingCount > 0) {
58
+ if (!abstained && summary.externalFindingCount > 0) {
55
59
  lines.push(
56
60
  "",
57
61
  `External findings (${summary.externalFindingCount} total, attributed to tool + criterion):`
@@ -70,6 +74,7 @@ function renderTerminalCertificate(summary) {
70
74
  `;
71
75
  }
72
76
  function formatScore(score) {
77
+ if (score === null) throw new Error("A scored Cejel summary must carry numeric scores.");
73
78
  return score.toFixed(1);
74
79
  }
75
80
 
@@ -117,6 +122,9 @@ var CLI_FLAG_KIND_BY_TOKEN = new Map(
117
122
  CLI_FLAG_SPECS.flatMap((spec) => spec.tokens.map((token) => [token, spec.kind]))
118
123
  );
119
124
  function cliVersion() {
125
+ if (typeof __CEJEL_SEA_VERSION__ === "string" && __CEJEL_SEA_VERSION__.length > 0) {
126
+ return __CEJEL_SEA_VERSION__;
127
+ }
120
128
  const manifest = JSON.parse(
121
129
  readFileSync(new URL("../package.json", import.meta.url), "utf8")
122
130
  );
@@ -191,12 +199,21 @@ Wrote:
191
199
  `
192
200
  );
193
201
  }
194
- if (options.minScore != null && report.overallScore < options.minScore) {
195
- process.stderr.write(
196
- `Cejel: overall score ${report.overallScore.toFixed(1)}/4.0 is below the required minimum ${options.minScore.toFixed(1)}/4.0
202
+ if (options.minScore != null) {
203
+ if (report.verdict === "insufficient_source") {
204
+ process.stderr.write(
205
+ `Cejel: cannot evaluate the required minimum ${options.minScore.toFixed(1)}/4.0 because this repository has insufficient source.
197
206
  `
198
- );
199
- return 1;
207
+ );
208
+ return 1;
209
+ }
210
+ if (report.overallScore < options.minScore) {
211
+ process.stderr.write(
212
+ `Cejel: overall score ${report.overallScore.toFixed(1)}/4.0 is below the required minimum ${options.minScore.toFixed(1)}/4.0
213
+ `
214
+ );
215
+ return 1;
216
+ }
200
217
  }
201
218
  return 0;
202
219
  }
package/dist/mcp/index.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  renderWitanBadgeSvg,
11
11
  renderWitanHtmlReport,
12
12
  runCejelScan
13
- } from "../chunk-SQNTNX5U.js";
13
+ } from "../chunk-A7NZKJ5H.js";
14
14
 
15
15
  // node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js
16
16
  var require_code = __commonJS({
@@ -17061,7 +17061,7 @@ function createCejelMcpServer(identity) {
17061
17061
  });
17062
17062
  server.tool(
17063
17063
  "scan",
17064
- `Score a repository's engineering-trust signals (tests, secrets, isolation, claim-vs-reality, CI discipline) with the ${identity.packageName} trust-certificate scan \u2014 the exact same offline, deterministic scoring as running the ${identity.packageName} CLI on the path. Returns the trust cert as JSON: overall + code/process sub-scores (0-4), verdict band, and top findings. No network, no telemetry, no signup. After a scan, the full HTML certificate and SVG badge are readable as the resources ${certificateUri} and ${badgeUri}.`,
17064
+ `Score a repository's engineering-trust signals (tests, secrets, isolation, claim-vs-reality, CI discipline) with the ${identity.packageName} trust-certificate scan \u2014 the exact same offline, deterministic scoring as running the ${identity.packageName} CLI on the path. Returns the trust cert as JSON: overall + code/process sub-scores (0-4) for a scored repository, or null scores with an insufficient-source verdict when Cejel cannot read it; plus the verdict and top findings. No network, no telemetry, no signup. After a scan, the full HTML certificate and SVG badge are readable as the resources ${certificateUri} and ${badgeUri}.`,
17065
17065
  {
17066
17066
  path: external_exports.string().min(1).describe("Path to the repository to score (absolute, or relative to the server CWD)"),
17067
17067
  format: external_exports.enum(["summary", "json"]).optional().describe(
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@cejel/cejel",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
+ "mcpName": "io.github.BargLabs/cejel",
4
5
  "private": false,
5
6
  "publishConfig": {
6
7
  "access": "public"
@@ -22,7 +23,7 @@
22
23
  ],
23
24
  "license": "AGPL-3.0-only",
24
25
  "author": "Barg Labs",
25
- "homepage": "https://github.com/BargLabs/cejel",
26
+ "homepage": "https://cejel.dev",
26
27
  "bugs": {
27
28
  "url": "https://github.com/BargLabs/cejel/issues"
28
29
  },
@@ -45,6 +46,8 @@
45
46
  },
46
47
  "scripts": {
47
48
  "build": "tsup",
49
+ "build:sea-js": "tsup --config tsup.public-sea.config.ts",
50
+ "validate:distribution": "node scripts/validate-distribution-metadata.mjs",
48
51
  "prepublishOnly": "pnpm run build",
49
52
  "prepack": "pnpm run build",
50
53
  "dev": "tsx src/index.ts",
@@ -54,6 +57,7 @@
54
57
  "devDependencies": {
55
58
  "@modelcontextprotocol/sdk": "^1.0.0",
56
59
  "@types/node": "^25.9.1",
60
+ "postject": "^1.0.0-alpha.6",
57
61
  "tsup": "^8.0.0",
58
62
  "tsx": "^4.0.0",
59
63
  "typescript": "^5.5.0",