flex-md 3.5.0 → 4.1.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.
- package/README.md +423 -39
- package/dist/index.cjs +62 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/md/parse.d.ts +1 -0
- package/dist/md/parse.js +12 -0
- package/dist/ofs/parser.js +31 -10
- package/dist/tokens/auto-fix.d.ts +10 -0
- package/dist/tokens/auto-fix.js +56 -0
- package/dist/tokens/cognitive-cost.d.ts +10 -0
- package/dist/tokens/cognitive-cost.js +205 -0
- package/dist/tokens/compliance.d.ts +10 -0
- package/dist/tokens/compliance.js +70 -0
- package/dist/tokens/confidence.d.ts +6 -0
- package/dist/tokens/confidence.js +332 -0
- package/dist/tokens/estimator.d.ts +12 -0
- package/dist/tokens/estimator.js +138 -0
- package/dist/tokens/improvements.d.ts +10 -0
- package/dist/tokens/improvements.js +697 -0
- package/dist/tokens/index.d.ts +24 -0
- package/dist/tokens/index.js +31 -0
- package/dist/tokens/parser.d.ts +3 -0
- package/dist/tokens/parser.js +97 -0
- package/dist/tokens/patterns.d.ts +9 -0
- package/dist/tokens/patterns.js +20 -0
- package/dist/tokens/smart-report.d.ts +10 -0
- package/dist/tokens/smart-report.js +187 -0
- package/dist/tokens/spec-estimator.d.ts +7 -0
- package/dist/tokens/spec-estimator.js +68 -0
- package/dist/tokens/types.d.ts +185 -0
- package/dist/tokens/validator.d.ts +16 -0
- package/dist/tokens/validator.js +59 -0
- package/docs/Recommended New Strategies for AI Request Builder.md +691 -0
- package/package.json +7 -3
- package/dist/detection/detector.d.ts +0 -6
- package/dist/detection/detector.js +0 -104
- package/dist/detection/extractor.d.ts +0 -10
- package/dist/detection/extractor.js +0 -54
- package/dist/issues/build.d.ts +0 -26
- package/dist/issues/build.js +0 -62
- package/dist/md/lists.d.ts +0 -14
- package/dist/md/lists.js +0 -33
- package/dist/md/tables.d.ts +0 -25
- package/dist/md/tables.js +0 -72
- package/dist/ofs/extractor.d.ts +0 -9
- package/dist/ofs/extractor.js +0 -75
- package/dist/ofs/issues.d.ts +0 -14
- package/dist/ofs/issues.js +0 -92
- package/dist/ofs/validator.d.ts +0 -10
- package/dist/ofs/validator.js +0 -91
- package/dist/outline/builder.d.ts +0 -10
- package/dist/outline/builder.js +0 -85
- package/dist/outline/renderer.d.ts +0 -6
- package/dist/outline/renderer.js +0 -23
- package/dist/parser.d.ts +0 -2
- package/dist/parser.js +0 -199
- package/dist/parsers/lists.d.ts +0 -6
- package/dist/parsers/lists.js +0 -36
- package/dist/parsers/tables.d.ts +0 -10
- package/dist/parsers/tables.js +0 -58
- package/dist/stringify.d.ts +0 -2
- package/dist/stringify.js +0 -110
- package/dist/test-pipeline.js +0 -53
- package/dist/test-runner.d.ts +0 -1
- package/dist/test-runner.js +0 -331
- package/dist/test-strictness.d.ts +0 -1
- package/dist/test-strictness.js +0 -213
- package/dist/util.d.ts +0 -5
- package/dist/util.js +0 -64
- package/dist/validate/policy.d.ts +0 -10
- package/dist/validate/policy.js +0 -17
- package/dist/validator.d.ts +0 -2
- package/dist/validator.js +0 -80
- /package/dist/{test-pipeline.d.ts → tokens/types.js} +0 -0
package/dist/validate/policy.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export function enforcementToSeverity(e) {
|
|
2
|
-
return e === "error" ? "error" : "warning";
|
|
3
|
-
}
|
|
4
|
-
/**
|
|
5
|
-
* Decide whether to emit an issue:
|
|
6
|
-
* - "ignore" => return null
|
|
7
|
-
* - "warn"/"error" => return ValidationIssue with chosen severity
|
|
8
|
-
*/
|
|
9
|
-
export function makeIssue(policy, key, fallback, issue) {
|
|
10
|
-
const enforcement = (policy?.[key] ?? fallback);
|
|
11
|
-
if (enforcement === "ignore")
|
|
12
|
-
return null;
|
|
13
|
-
return { severity: enforcementToSeverity(enforcement), ...issue };
|
|
14
|
-
}
|
|
15
|
-
export function hasErrors(issues) {
|
|
16
|
-
return issues.some(i => i.severity === "error");
|
|
17
|
-
}
|
package/dist/validator.d.ts
DELETED
package/dist/validator.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
const HEADER_START = "[[";
|
|
2
|
-
const HEADER_END = "]]";
|
|
3
|
-
const PAYLOAD_DECL_RE = /^@payload:name:\s*(.+)\s*$/;
|
|
4
|
-
const FENCE_RE = /^(```|~~~)/;
|
|
5
|
-
export function validateFlexMd(input) {
|
|
6
|
-
const lines = input.split("\n");
|
|
7
|
-
const errors = [];
|
|
8
|
-
let inFence = null;
|
|
9
|
-
let pendingPayloadLine = null;
|
|
10
|
-
for (let i = 0; i < lines.length; i++) {
|
|
11
|
-
const line = lines[i];
|
|
12
|
-
const lineNum = i + 1;
|
|
13
|
-
// Check for unterminated headers
|
|
14
|
-
if (line.includes(HEADER_START) && !line.includes(HEADER_END)) {
|
|
15
|
-
// Small check: if it really looks like a header start at beginning of line
|
|
16
|
-
if (line.trim().startsWith(HEADER_START)) {
|
|
17
|
-
errors.push({
|
|
18
|
-
line: lineNum,
|
|
19
|
-
message: "Possible unterminated frame header (missing ']]')",
|
|
20
|
-
severity: "error",
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
// Handle code fences
|
|
25
|
-
const fenceMatch = line.match(FENCE_RE);
|
|
26
|
-
if (fenceMatch) {
|
|
27
|
-
const fence = fenceMatch[1];
|
|
28
|
-
if (inFence) {
|
|
29
|
-
if (line.trimEnd() === inFence) {
|
|
30
|
-
inFence = null;
|
|
31
|
-
pendingPayloadLine = null; // Payload satisfied
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
inFence = fence;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
else if (pendingPayloadLine !== null && !inFence && line.trim().length > 0) {
|
|
39
|
-
// We had a @payload:name: but the next non-empty line wasn't a fence
|
|
40
|
-
errors.push({
|
|
41
|
-
line: pendingPayloadLine,
|
|
42
|
-
message: "Payload declaration not followed by a code fence",
|
|
43
|
-
severity: "warning",
|
|
44
|
-
});
|
|
45
|
-
pendingPayloadLine = null;
|
|
46
|
-
}
|
|
47
|
-
// Check for payload declarations
|
|
48
|
-
const payloadMatch = line.match(PAYLOAD_DECL_RE);
|
|
49
|
-
if (payloadMatch) {
|
|
50
|
-
if (inFence) {
|
|
51
|
-
errors.push({
|
|
52
|
-
line: lineNum,
|
|
53
|
-
message: "Payload declaration inside a code fence",
|
|
54
|
-
severity: "warning",
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
pendingPayloadLine = lineNum;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
if (inFence) {
|
|
63
|
-
errors.push({
|
|
64
|
-
line: lines.length,
|
|
65
|
-
message: "Unterminated code fence at end of document",
|
|
66
|
-
severity: "error",
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
if (pendingPayloadLine !== null) {
|
|
70
|
-
errors.push({
|
|
71
|
-
line: pendingPayloadLine,
|
|
72
|
-
message: "Dangling payload declaration at end of document",
|
|
73
|
-
severity: "warning",
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
return {
|
|
77
|
-
valid: !errors.some((e) => e.severity === "error"),
|
|
78
|
-
errors,
|
|
79
|
-
};
|
|
80
|
-
}
|
|
File without changes
|