@bendyline/gezel-sdk 1.1.16 → 1.1.18
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.d.ts +2 -0
- package/dist/checks.js +16 -5
- package/package.json +2 -2
package/dist/checks.d.ts
CHANGED
|
@@ -444,6 +444,8 @@ interface CitationsResult extends CheckResult {
|
|
|
444
444
|
urls: string[];
|
|
445
445
|
/** Unresolvable cited paths forgiven as task metadata (see `knownPaths`). */
|
|
446
446
|
forgiven?: string[];
|
|
447
|
+
/** Citations of the checked document itself; never a source. */
|
|
448
|
+
selfCited?: string[];
|
|
447
449
|
}
|
|
448
450
|
/**
|
|
449
451
|
* Every source `file` cites must exist. File-path citations are resolved
|
package/dist/checks.js
CHANGED
|
@@ -2070,7 +2070,13 @@ async function citationsResolve(ws, file, opts = {}) {
|
|
|
2070
2070
|
const unresolved = [];
|
|
2071
2071
|
const urls = [];
|
|
2072
2072
|
const forgiven = [];
|
|
2073
|
+
const selfCited = [];
|
|
2074
|
+
const self = cleanCitedPath(file).toLowerCase();
|
|
2073
2075
|
for (const c of cites) {
|
|
2076
|
+
if (cleanCitedPath(c).toLowerCase() === self) {
|
|
2077
|
+
selfCited.push(c);
|
|
2078
|
+
continue;
|
|
2079
|
+
}
|
|
2074
2080
|
if (opts.resolveKnowledge && /^knowledge:\/\//i.test(c)) {
|
|
2075
2081
|
if (await opts.resolveKnowledge(c)) resolved.push(c);
|
|
2076
2082
|
else unresolved.push(c);
|
|
@@ -2099,7 +2105,9 @@ async function citationsResolve(ws, file, opts = {}) {
|
|
|
2099
2105
|
}
|
|
2100
2106
|
}
|
|
2101
2107
|
}
|
|
2102
|
-
|
|
2108
|
+
const counted = cites.length - forgiven.length - selfCited.length;
|
|
2109
|
+
const selfNote = selfCited.length > 0 ? ` A citation of ${file} itself is not a source; cite what it draws on.` : "";
|
|
2110
|
+
if (counted < min) {
|
|
2103
2111
|
return {
|
|
2104
2112
|
ok: false,
|
|
2105
2113
|
// Name the accepted FORMS, not just the rule: a model that wrote the
|
|
@@ -2107,11 +2115,12 @@ async function citationsResolve(ws, file, opts = {}) {
|
|
|
2107
2115
|
// "cite the source" as already satisfied and rewrites content instead
|
|
2108
2116
|
// of adding markup, looping to gate exhaustion (wild-caught:
|
|
2109
2117
|
// deepseek-v4 with a flawless diagnosis, three identical rejections).
|
|
2110
|
-
detail: `${file} has ${
|
|
2118
|
+
detail: `${file} has ${counted} recognizable citation(s), need \u2265 ${min}. Only these forms count as citations: a backticked path like \`src/file.js\`, a markdown link like [name](src/file.js), or (source: src/file.js). Plain prose paths are not counted \u2014 wrap each cited file path in backticks.${selfNote}`,
|
|
2111
2119
|
resolved,
|
|
2112
2120
|
unresolved,
|
|
2113
2121
|
urls,
|
|
2114
|
-
...forgiven.length > 0 ? { forgiven } : {}
|
|
2122
|
+
...forgiven.length > 0 ? { forgiven } : {},
|
|
2123
|
+
...selfCited.length > 0 ? { selfCited } : {}
|
|
2115
2124
|
};
|
|
2116
2125
|
}
|
|
2117
2126
|
if (unresolved.length > 0) {
|
|
@@ -2122,7 +2131,8 @@ async function citationsResolve(ws, file, opts = {}) {
|
|
|
2122
2131
|
resolved,
|
|
2123
2132
|
unresolved,
|
|
2124
2133
|
urls,
|
|
2125
|
-
...forgiven.length > 0 ? { forgiven } : {}
|
|
2134
|
+
...forgiven.length > 0 ? { forgiven } : {},
|
|
2135
|
+
...selfCited.length > 0 ? { selfCited } : {}
|
|
2126
2136
|
};
|
|
2127
2137
|
}
|
|
2128
2138
|
return {
|
|
@@ -2131,7 +2141,8 @@ async function citationsResolve(ws, file, opts = {}) {
|
|
|
2131
2141
|
resolved,
|
|
2132
2142
|
unresolved,
|
|
2133
2143
|
urls,
|
|
2134
|
-
...forgiven.length > 0 ? { forgiven } : {}
|
|
2144
|
+
...forgiven.length > 0 ? { forgiven } : {},
|
|
2145
|
+
...selfCited.length > 0 ? { selfCited } : {}
|
|
2135
2146
|
};
|
|
2136
2147
|
}
|
|
2137
2148
|
function valuesSubsetOf(outputText, sourceTexts, spec) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bendyline/gezel-sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.18",
|
|
4
4
|
"description": "SDK for scripts that run in the Gezel sandbox: the gezel object and the 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.3.
|
|
66
|
+
"@bendyline/gezel": "1.3.3",
|
|
67
67
|
"tsup": "^8.5.1",
|
|
68
68
|
"typescript": "^6.0.3",
|
|
69
69
|
"vitest": "^4.1.10"
|