@bendyline/gezel-sdk 1.1.0 → 1.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/checks.js +9 -2
- package/package.json +2 -2
package/dist/checks.js
CHANGED
|
@@ -1048,13 +1048,19 @@ function stripFencedBlocks(text) {
|
|
|
1048
1048
|
return text.replace(/^[ \t]*(`{3,}|~{3,})[^\n]*\n[\s\S]*?^[ \t]*\1[ \t]*$/gm, "").replace(/^[ \t]*(`{3,}|~{3,})[^\n]*\n[\s\S]*$/m, "");
|
|
1049
1049
|
}
|
|
1050
1050
|
var TASK_REF_RE = /^[A-Za-z0-9][A-Za-z0-9._-]*\/\d+$/;
|
|
1051
|
+
var ANGLE_SLOT_RE = /^<[^<>.:]*>$/;
|
|
1052
|
+
var NO_NAME_RE = /^[^\p{L}\p{N}]+$/u;
|
|
1053
|
+
var SLOT_WORDS = /* @__PURE__ */ new Set(["path", "url", "path/url", "file", "none", "n/a", "tbd"]);
|
|
1054
|
+
function isTemplateSlot(cap) {
|
|
1055
|
+
return ANGLE_SLOT_RE.test(cap) || NO_NAME_RE.test(cap) || SLOT_WORDS.has(cleanCitation(cap).toLowerCase());
|
|
1056
|
+
}
|
|
1051
1057
|
function extractCitations(text, re) {
|
|
1052
1058
|
const flags = re.flags.includes("g") ? re.flags : `${re.flags}g`;
|
|
1053
1059
|
const global = new RegExp(re.source, flags);
|
|
1054
1060
|
const out = [];
|
|
1055
1061
|
for (const m of stripFencedBlocks(text).matchAll(global)) {
|
|
1056
1062
|
const cap = m.slice(1).find((x) => x !== void 0) ?? m[0];
|
|
1057
|
-
if (cap && !TASK_REF_RE.test(cap)) out.push(cap);
|
|
1063
|
+
if (cap && !TASK_REF_RE.test(cap) && !isTemplateSlot(cap)) out.push(cap);
|
|
1058
1064
|
}
|
|
1059
1065
|
return out;
|
|
1060
1066
|
}
|
|
@@ -1133,9 +1139,10 @@ async function citationsResolve(ws, file, opts = {}) {
|
|
|
1133
1139
|
};
|
|
1134
1140
|
}
|
|
1135
1141
|
if (unresolved.length > 0) {
|
|
1142
|
+
const listed = unresolved.slice(0, 5).map((u) => `\`${u}\``).join(", ");
|
|
1136
1143
|
return {
|
|
1137
1144
|
ok: false,
|
|
1138
|
-
detail: `${file} cites ${unresolved.length} source(s) that do not exist: ${
|
|
1145
|
+
detail: `${file} cites ${unresolved.length} source(s) that do not exist: ${listed}${unresolved.length > 5 ? ", \u2026" : ""} \u2014 every cited path must resolve to a real file in the workspace${corpus ? "/corpus" : ""} (no fabricated citations).`,
|
|
1139
1146
|
resolved,
|
|
1140
1147
|
unresolved,
|
|
1141
1148
|
urls,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bendyline/gezel-sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "SDK imported by scripts running in the Gezel sandbox. Exposes the `gezel` object and `defineScript` helper.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"!dist/**/*.map"
|
|
64
64
|
],
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@bendyline/gezel": "1.2.
|
|
66
|
+
"@bendyline/gezel": "1.2.2",
|
|
67
67
|
"tsup": "^8.5.1",
|
|
68
68
|
"typescript": "^6.0.3",
|
|
69
69
|
"vitest": "^4.1.10"
|