@333eco/corpus 1.1.0 → 1.1.1
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/package.json +1 -1
- package/src/server.mjs +23 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@333eco/corpus",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "An MCP server for an open-licensed corpus, served with verifiable provenance \u2014 every document carries its sha256, DOI and OpenTimestamps proof so a consuming agent can check its own citation.",
|
|
5
5
|
"license": "CC0-1.0",
|
|
6
6
|
"author": "Thon Ly",
|
package/src/server.mjs
CHANGED
|
@@ -79,7 +79,12 @@ const envelope = (d) => ({
|
|
|
79
79
|
provenance: {
|
|
80
80
|
...d.provenance,
|
|
81
81
|
verify: {
|
|
82
|
-
|
|
82
|
+
// Concrete, because an instruction that says "the source file"
|
|
83
|
+
// without saying which one is not an instruction. All three source
|
|
84
|
+
// repositories are public, so this is genuinely runnable.
|
|
85
|
+
sha256: d.provenance.source_url
|
|
86
|
+
? `curl -sL ${d.provenance.source_url} | shasum -a 256 # compare to provenance.sha256`
|
|
87
|
+
: "shasum -a 256 <the source file> # compare to provenance.sha256",
|
|
83
88
|
...(d.provenance.doi ? { doi: `https://doi.org/${d.provenance.doi}` } : {}),
|
|
84
89
|
...(d.provenance.opentimestamps
|
|
85
90
|
? { opentimestamps: `ots verify ${d.path}.ots # in the source repository; the proof is anchored in the Bitcoin blockchain` }
|
|
@@ -167,7 +172,23 @@ const callTool = (name, args) => {
|
|
|
167
172
|
if (name === "get_document") {
|
|
168
173
|
const d = bySlug.get(String(args?.slug ?? ""));
|
|
169
174
|
if (!d) throw new Error(`no document with slug "${args?.slug}". Call list_documents to see what is available.`);
|
|
170
|
-
return text({
|
|
175
|
+
return text({
|
|
176
|
+
...envelope(d),
|
|
177
|
+
genre: d.genre,
|
|
178
|
+
repo: d.repo,
|
|
179
|
+
path: d.path,
|
|
180
|
+
metadata_convention: d.metadata_convention,
|
|
181
|
+
// ⚠️ PRESENT ONLY WHERE THEY MEAN SOMETHING, and dropping them was a
|
|
182
|
+
// real bug: `editorial` is what tells a consumer that the inline
|
|
183
|
+
// [VERBATIM]/[SCAFFOLD] markers in `text` are a convention rather
|
|
184
|
+
// than noise, and `segments` is the same split structurally. The
|
|
185
|
+
// markers alone are the load-bearing half — they survive quotation —
|
|
186
|
+
// but shipping them with nothing that explains them made the
|
|
187
|
+
// convention look like an artefact of bad extraction.
|
|
188
|
+
...(d.editorial ? { editorial: d.editorial } : {}),
|
|
189
|
+
...(d.segments ? { segments: d.segments } : {}),
|
|
190
|
+
text: d.text
|
|
191
|
+
});
|
|
171
192
|
}
|
|
172
193
|
|
|
173
194
|
if (name === "list_documents") {
|