@plurnk/plurnk-plurnkdown 1.1.0 → 1.2.0

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.
@@ -0,0 +1,12 @@
1
+ import type { Diagnostic } from "./types.ts";
2
+ export interface PacketFinding extends Diagnostic {
3
+ file: string;
4
+ }
5
+ export interface PacketLintResult {
6
+ packets: string[];
7
+ findings: PacketFinding[];
8
+ }
9
+ export default class PacketLint {
10
+ static lintDir(dir: string): PacketLintResult;
11
+ }
12
+ //# sourceMappingURL=PacketLint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PacketLint.d.ts","sourceRoot":"","sources":["../src/PacketLint.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC7C,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC7B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC7B;AAKD,MAAM,CAAC,OAAO,OAAO,UAAU;IAC3B,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAQ5C;CACJ"}
@@ -0,0 +1,19 @@
1
+ import { readFileSync, readdirSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import Plurnkdown from "./Plurnkdown.js";
4
+ // The evaluation instrument: lint real emitted packets, not fixtures. A digest dir holds
5
+ // packetNNN.{system,user}.md — byte-exact what the model saw (Engine and digest both render
6
+ // through one PacketWire). Produce it with `plurnk-core/bin/digest.ts <run.db> <dir>`.
7
+ export default class PacketLint {
8
+ static lintDir(dir) {
9
+ const linter = new Plurnkdown();
10
+ const packets = readdirSync(dir).filter((f) => /^packet\d+\.(system|user)\.md$/.test(f)).sort();
11
+ const findings = [];
12
+ for (const file of packets) {
13
+ for (const d of linter.lint(readFileSync(join(dir, file), "utf8")))
14
+ findings.push({ file, ...d });
15
+ }
16
+ return { packets, findings };
17
+ }
18
+ }
19
+ //# sourceMappingURL=PacketLint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PacketLint.js","sourceRoot":"","sources":["../src/PacketLint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,UAAU,MAAM,iBAAiB,CAAC;AAYzC,yFAAyF;AACzF,4FAA4F;AAC5F,uFAAuF;AACvF,MAAM,CAAC,OAAO,OAAO,UAAU;IAC3B,MAAM,CAAC,OAAO,CAAC,GAAW;QACtB,MAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAChC,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,gCAAgC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAChG,MAAM,QAAQ,GAAoB,EAAE,CAAC;QACrC,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;YACzB,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;gBAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;QACtG,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;IACjC,CAAC;CACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plurnk/plurnk-plurnkdown",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Plurnkdown — the plurnk packet house style (GFM + Mermaid + fenced Plurnk ops) and its linter.",
5
5
  "keywords": [
6
6
  "plurnk",
@@ -14,7 +14,7 @@
14
14
  "node": ">=26"
15
15
  },
16
16
  "dependencies": {
17
- "@plurnk/plurnk-grammar": "1.1.0",
17
+ "@plurnk/plurnk-grammar": "1.2.0",
18
18
  "marked": "^18.0.5"
19
19
  },
20
20
  "license": "MIT",
@@ -44,6 +44,7 @@
44
44
  "test:lint": "tsc --noEmit",
45
45
  "test:unit": "node --conditions=plurnk-dev --test src/**/*.test.ts",
46
46
  "test": "npm run test:lint && npm run test:unit",
47
+ "dev:lint-packets": "node --conditions=plurnk-dev bin/lint-packets.ts",
47
48
  "build:dist": "tsc -p tsconfig.build.json",
48
49
  "build": "npm run build:dist",
49
50
  "prepack": "npm run build",