@retiform/paperless-mcp 2.3.5 → 2.3.6
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/build/manifest.test.d.ts +1 -0
- package/build/manifest.test.js +66 -0
- package/package.json +3 -2
- package/paperless-mcp.dxt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const strict_1 = __importDefault(require("node:assert/strict"));
|
|
7
|
+
const node_child_process_1 = require("node:child_process");
|
|
8
|
+
const node_fs_1 = require("node:fs");
|
|
9
|
+
const node_os_1 = require("node:os");
|
|
10
|
+
const node_path_1 = require("node:path");
|
|
11
|
+
const node_test_1 = require("node:test");
|
|
12
|
+
// The DXT manifest carries its own copy of the version and changesets only
|
|
13
|
+
// bumps package.json, so the two drifted on every bot-driven release: 2.3.3
|
|
14
|
+
// shipped a 2.3.2 manifest, 2.3.5 shipped a 2.3.4 one. scripts/sync-manifest-version.mjs
|
|
15
|
+
// derives it at pack time; this pins both halves of that guarantee.
|
|
16
|
+
const root = (0, node_path_1.join)(__dirname, "..");
|
|
17
|
+
function readManifest() {
|
|
18
|
+
return JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(root, "manifest.json"), "utf8"));
|
|
19
|
+
}
|
|
20
|
+
// NOTE: there is deliberately no assertion that the TRACKED manifest matches
|
|
21
|
+
// package.json. The changesets Version PR bumps package.json only, so that
|
|
22
|
+
// state is legitimately unequal between a version bump and the next pack; a
|
|
23
|
+
// test on it would fail for a correct reason. What is pinned below is the
|
|
24
|
+
// mechanism - prepack stamps the manifest from the package version - which is
|
|
25
|
+
// the property the published artifact actually depends on.
|
|
26
|
+
(0, node_test_1.test)("sync-manifest-version stamps package.json over a stale manifest version", () => {
|
|
27
|
+
const dir = (0, node_fs_1.mkdtempSync)((0, node_path_1.join)((0, node_os_1.tmpdir)(), "manifest-sync-"));
|
|
28
|
+
try {
|
|
29
|
+
(0, node_fs_1.cpSync)((0, node_path_1.join)(root, "package.json"), (0, node_path_1.join)(dir, "package.json"));
|
|
30
|
+
const manifest = readManifest();
|
|
31
|
+
manifest.version = "0.0.0-stale";
|
|
32
|
+
(0, node_fs_1.writeFileSync)((0, node_path_1.join)(dir, "manifest.json"), JSON.stringify(manifest, null, 2));
|
|
33
|
+
(0, node_fs_1.cpSync)((0, node_path_1.join)(root, "scripts"), (0, node_path_1.join)(dir, "scripts"), { recursive: true });
|
|
34
|
+
(0, node_fs_1.cpSync)((0, node_path_1.join)(root, "src"), (0, node_path_1.join)(dir, "src"), { recursive: true });
|
|
35
|
+
(0, node_child_process_1.execFileSync)(process.execPath, [(0, node_path_1.join)(dir, "scripts", "sync-manifest-version.mjs")], {
|
|
36
|
+
stdio: "pipe",
|
|
37
|
+
});
|
|
38
|
+
const pkg = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(dir, "package.json"), "utf8"));
|
|
39
|
+
const after = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(dir, "manifest.json"), "utf8"));
|
|
40
|
+
strict_1.default.equal(after.version, pkg.version, "sync did not stamp package.json version");
|
|
41
|
+
strict_1.default.notEqual(after.version, "0.0.0-stale", "stale literal survived the sync");
|
|
42
|
+
strict_1.default.equal(after.dxt_version, manifest.dxt_version, "sync clobbered dxt_version");
|
|
43
|
+
}
|
|
44
|
+
finally {
|
|
45
|
+
(0, node_fs_1.rmSync)(dir, { recursive: true, force: true });
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
(0, node_test_1.test)("sync-manifest-version is idempotent", () => {
|
|
49
|
+
const dir = (0, node_fs_1.mkdtempSync)((0, node_path_1.join)((0, node_os_1.tmpdir)(), "manifest-idem-"));
|
|
50
|
+
try {
|
|
51
|
+
(0, node_fs_1.cpSync)((0, node_path_1.join)(root, "package.json"), (0, node_path_1.join)(dir, "package.json"));
|
|
52
|
+
(0, node_fs_1.cpSync)((0, node_path_1.join)(root, "manifest.json"), (0, node_path_1.join)(dir, "manifest.json"));
|
|
53
|
+
(0, node_fs_1.cpSync)((0, node_path_1.join)(root, "scripts"), (0, node_path_1.join)(dir, "scripts"), { recursive: true });
|
|
54
|
+
const run = () => (0, node_child_process_1.execFileSync)(process.execPath, [(0, node_path_1.join)(dir, "scripts", "sync-manifest-version.mjs")], {
|
|
55
|
+
stdio: "pipe",
|
|
56
|
+
});
|
|
57
|
+
run();
|
|
58
|
+
const once = (0, node_fs_1.readFileSync)((0, node_path_1.join)(dir, "manifest.json"), "utf8");
|
|
59
|
+
run();
|
|
60
|
+
const twice = (0, node_fs_1.readFileSync)((0, node_path_1.join)(dir, "manifest.json"), "utf8");
|
|
61
|
+
strict_1.default.equal(twice, once, "second run changed the manifest");
|
|
62
|
+
}
|
|
63
|
+
finally {
|
|
64
|
+
(0, node_fs_1.rmSync)(dir, { recursive: true, force: true });
|
|
65
|
+
}
|
|
66
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@retiform/paperless-mcp",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.6",
|
|
4
4
|
"description": "MCP server for Paperless-NGX with bounded content reads - ranged document windows and passage search so agents never flood their context.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"build": "tsc",
|
|
14
14
|
"dxt-pack": "dxt pack",
|
|
15
15
|
"inspect": "npm run build && npx -y @modelcontextprotocol/inspector node build/index.js",
|
|
16
|
-
"prepack": "rm -rf build && npm run build && npm run dxt-pack"
|
|
16
|
+
"prepack": "rm -rf build && npm run build && npm run sync-manifest && npm run dxt-pack",
|
|
17
|
+
"sync-manifest": "node scripts/sync-manifest-version.mjs"
|
|
17
18
|
},
|
|
18
19
|
"keywords": [
|
|
19
20
|
"mcp",
|
package/paperless-mcp.dxt
CHANGED
|
Binary file
|