@hanna84/mcp-writing 2.12.11 → 2.12.13

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/CHANGELOG.md CHANGED
@@ -4,11 +4,31 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [v2.12.13](https://github.com/hannasdev/mcp-writing.git
8
+ /compare/v2.12.12...v2.12.13)
9
+
10
+ - refactor(ci): add legacy root import guardrail [`#128`](https://github.com/hannasdev/mcp-writing.git
11
+ /pull/128)
12
+
13
+ #### [v2.12.12](https://github.com/hannasdev/mcp-writing.git
14
+ /compare/v2.12.11...v2.12.12)
15
+
16
+ > 29 April 2026
17
+
18
+ - refactor(root): remove compatibility shims after src migration [`#127`](https://github.com/hannasdev/mcp-writing.git
19
+ /pull/127)
20
+ - Release 2.12.12 [`ec309e6`](https://github.com/hannasdev/mcp-writing.git
21
+ /commit/ec309e654549ed0120e079618811952831249338)
22
+
7
23
  #### [v2.12.11](https://github.com/hannasdev/mcp-writing.git
8
24
  /compare/v2.12.10...v2.12.11)
9
25
 
26
+ > 29 April 2026
27
+
10
28
  - refactor(core): move helpers under src/core [`#126`](https://github.com/hannasdev/mcp-writing.git
11
29
  /pull/126)
30
+ - Release 2.12.11 [`dff03db`](https://github.com/hannasdev/mcp-writing.git
31
+ /commit/dff03db488274a1753e1b6bc49fb48173ab61115)
12
32
 
13
33
  #### [v2.12.10](https://github.com/hannasdev/mcp-writing.git
14
34
  /compare/v2.12.9...v2.12.10)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanna84/mcp-writing",
3
- "version": "2.12.11",
3
+ "version": "2.12.13",
4
4
  "description": "MCP service for AI-assisted reasoning and editing on long-form fiction projects",
5
5
  "homepage": "https://hannasdev.github.io/mcp-writing/",
6
6
  "type": "module",
@@ -8,27 +8,27 @@
8
8
  "exports": {
9
9
  ".": "./index.js",
10
10
  "./index.js": "./index.js",
11
- "./async-jobs.js": "./async-jobs.js",
12
- "./async-progress.js": "./async-progress.js",
13
- "./helpers.js": "./helpers.js",
14
- "./scene-character-batch.js": "./scene-character-batch.js",
15
- "./scrivener-direct.js": "./scrivener-direct.js",
16
- "./importer.js": "./importer.js",
17
- "./db.js": "./db.js",
18
- "./sync.js": "./sync.js",
19
- "./git.js": "./git.js",
20
- "./world-entity-templates.js": "./world-entity-templates.js",
21
- "./workflow-catalogue.js": "./workflow-catalogue.js",
22
- "./runtime-diagnostics.js": "./runtime-diagnostics.js",
23
- "./metadata-lint.js": "./metadata-lint.js",
24
- "./scene-character-normalization.js": "./scene-character-normalization.js",
25
- "./review-bundles.js": "./review-bundles.js",
26
- "./review-bundles-planner.js": "./review-bundles-planner.js",
27
- "./review-bundles-renderer.js": "./review-bundles-renderer.js",
28
- "./review-bundles-writer.js": "./review-bundles-writer.js",
29
- "./prose-styleguide.js": "./prose-styleguide.js",
30
- "./prose-styleguide-drift.js": "./prose-styleguide-drift.js",
31
- "./prose-styleguide-skill.js": "./prose-styleguide-skill.js",
11
+ "./async-jobs.js": "./src/runtime/async-jobs.js",
12
+ "./async-progress.js": "./src/runtime/async-progress.js",
13
+ "./helpers.js": "./src/core/helpers.js",
14
+ "./scene-character-batch.js": "./src/sync/scene-character-batch.js",
15
+ "./scrivener-direct.js": "./src/sync/scrivener-direct.js",
16
+ "./importer.js": "./src/sync/importer.js",
17
+ "./db.js": "./src/core/db.js",
18
+ "./sync.js": "./src/sync/sync.js",
19
+ "./git.js": "./src/core/git.js",
20
+ "./world-entity-templates.js": "./src/world/world-entity-templates.js",
21
+ "./workflow-catalogue.js": "./src/workflows/workflow-catalogue.js",
22
+ "./runtime-diagnostics.js": "./src/runtime/runtime-diagnostics.js",
23
+ "./metadata-lint.js": "./src/sync/metadata-lint.js",
24
+ "./scene-character-normalization.js": "./src/sync/scene-character-normalization.js",
25
+ "./review-bundles.js": "./src/review-bundles/review-bundles.js",
26
+ "./review-bundles-planner.js": "./src/review-bundles/review-bundles-planner.js",
27
+ "./review-bundles-renderer.js": "./src/review-bundles/review-bundles-renderer.js",
28
+ "./review-bundles-writer.js": "./src/review-bundles/review-bundles-writer.js",
29
+ "./prose-styleguide.js": "./src/styleguide/prose-styleguide.js",
30
+ "./prose-styleguide-drift.js": "./src/styleguide/prose-styleguide-drift.js",
31
+ "./prose-styleguide-skill.js": "./src/styleguide/prose-styleguide-skill.js",
32
32
  "./tools/*": "./src/tools/*",
33
33
  "./scripts/*": "./scripts/*",
34
34
  "./src/*": "./src/*",
@@ -42,27 +42,6 @@
42
42
  "bin/",
43
43
  "index.js",
44
44
  "src/",
45
- "async-jobs.js",
46
- "async-progress.js",
47
- "helpers.js",
48
- "scene-character-batch.js",
49
- "scrivener-direct.js",
50
- "importer.js",
51
- "db.js",
52
- "sync.js",
53
- "git.js",
54
- "world-entity-templates.js",
55
- "workflow-catalogue.js",
56
- "runtime-diagnostics.js",
57
- "metadata-lint.js",
58
- "scene-character-normalization.js",
59
- "review-bundles.js",
60
- "review-bundles-planner.js",
61
- "review-bundles-renderer.js",
62
- "review-bundles-writer.js",
63
- "prose-styleguide.js",
64
- "prose-styleguide-drift.js",
65
- "prose-styleguide-skill.js",
66
45
  "scripts/",
67
46
  "README.md",
68
47
  "CHANGELOG.md"
@@ -82,6 +61,7 @@
82
61
  "setup:openclaw-env": "sh scripts/setup-openclaw-env.sh",
83
62
  "release": "release-it",
84
63
  "lint": "eslint *.js src/ scripts/",
64
+ "guard:legacy-root-imports": "node scripts/check-legacy-root-imports.mjs",
85
65
  "docs": "node scripts/generate-tool-docs.mjs",
86
66
  "lint:metadata": "node scripts/lint-metadata.mjs",
87
67
  "sync:server-json-version": "node scripts/sync-server-json-version.mjs",
@@ -0,0 +1,103 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = path.dirname(__filename);
7
+ const ROOT = path.resolve(__dirname, "..");
8
+
9
+ const SCAN_PATHS = ["src", "scripts", "test", "index.js"];
10
+ const SOURCE_EXTENSIONS = new Set([".js", ".mjs"]);
11
+ const LEGACY_ROOT_MODULES = new Set([
12
+ "async-jobs.js",
13
+ "async-progress.js",
14
+ "db.js",
15
+ "git.js",
16
+ "helpers.js",
17
+ "importer.js",
18
+ "metadata-lint.js",
19
+ "prose-styleguide.js",
20
+ "prose-styleguide-drift.js",
21
+ "prose-styleguide-skill.js",
22
+ "review-bundles.js",
23
+ "review-bundles-planner.js",
24
+ "review-bundles-renderer.js",
25
+ "review-bundles-writer.js",
26
+ "runtime-diagnostics.js",
27
+ "scene-character-batch.js",
28
+ "scene-character-normalization.js",
29
+ "scrivener-direct.js",
30
+ "sync.js",
31
+ "workflow-catalogue.js",
32
+ "world-entity-templates.js",
33
+ ]);
34
+
35
+ const findings = [];
36
+
37
+ function isSourceFile(filePath) {
38
+ return SOURCE_EXTENSIONS.has(path.extname(filePath));
39
+ }
40
+
41
+ function toPosix(filePath) {
42
+ return filePath.replace(/\\/g, "/");
43
+ }
44
+
45
+ function lineNumberForIndex(content, index) {
46
+ let line = 1;
47
+ for (let i = 0; i < index; i += 1) {
48
+ if (content[i] === "\n") line += 1;
49
+ }
50
+ return line;
51
+ }
52
+
53
+ function hasLegacyRootImport(specifier, importerPath) {
54
+ if (!specifier || !specifier.startsWith(".")) return false;
55
+ const resolved = path.resolve(path.dirname(importerPath), specifier);
56
+ const relativeToRoot = toPosix(path.relative(ROOT, resolved));
57
+ if (relativeToRoot.includes("/")) return false;
58
+ return LEGACY_ROOT_MODULES.has(relativeToRoot);
59
+ }
60
+
61
+ function scanFile(absolutePath) {
62
+ const source = fs.readFileSync(absolutePath, "utf8");
63
+ const importRegex =
64
+ /(?:\bfrom\s*["']([^"']+)["'])|(?:^\s*import\s*["']([^"']+)["'])|(?:\bimport\s*\(\s*["']([^"']+)["']\s*\))/gm;
65
+
66
+ for (const match of source.matchAll(importRegex)) {
67
+ const specifier = match[1] ?? match[2] ?? match[3] ?? null;
68
+ if (!hasLegacyRootImport(specifier, absolutePath)) continue;
69
+ findings.push({
70
+ file: path.relative(ROOT, absolutePath),
71
+ line: lineNumberForIndex(source, match.index ?? 0),
72
+ specifier,
73
+ });
74
+ }
75
+ }
76
+
77
+ function walk(absolutePath) {
78
+ const stat = fs.statSync(absolutePath);
79
+ if (stat.isDirectory()) {
80
+ for (const entry of fs.readdirSync(absolutePath, { withFileTypes: true })) {
81
+ walk(path.join(absolutePath, entry.name));
82
+ }
83
+ return;
84
+ }
85
+ if (isSourceFile(absolutePath)) scanFile(absolutePath);
86
+ }
87
+
88
+ for (const relativePath of SCAN_PATHS) {
89
+ const absolutePath = path.join(ROOT, relativePath);
90
+ if (fs.existsSync(absolutePath)) {
91
+ walk(absolutePath);
92
+ }
93
+ }
94
+
95
+ if (findings.length > 0) {
96
+ console.error("Found legacy root-module imports that should use src/** paths:");
97
+ for (const finding of findings) {
98
+ console.error(`- ${toPosix(finding.file)}:${finding.line} -> ${finding.specifier}`);
99
+ }
100
+ process.exit(1);
101
+ }
102
+
103
+ console.log("No legacy root-module imports found.");
package/async-jobs.js DELETED
@@ -1 +0,0 @@
1
- export * from "./src/runtime/async-jobs.js";
package/async-progress.js DELETED
@@ -1 +0,0 @@
1
- export * from "./src/runtime/async-progress.js";
package/db.js DELETED
@@ -1 +0,0 @@
1
- export * from "./src/core/db.js";
package/git.js DELETED
@@ -1 +0,0 @@
1
- export * from "./src/core/git.js";
package/helpers.js DELETED
@@ -1 +0,0 @@
1
- export * from "./src/core/helpers.js";
package/importer.js DELETED
@@ -1 +0,0 @@
1
- export * from "./src/sync/importer.js";
package/metadata-lint.js DELETED
@@ -1 +0,0 @@
1
- export * from "./src/sync/metadata-lint.js";
@@ -1 +0,0 @@
1
- export * from "./src/styleguide/prose-styleguide-drift.js";
@@ -1 +0,0 @@
1
- export * from "./src/styleguide/prose-styleguide-skill.js";
@@ -1 +0,0 @@
1
- export * from "./src/styleguide/prose-styleguide.js";
@@ -1 +0,0 @@
1
- export * from "./src/review-bundles/review-bundles-planner.js";
@@ -1 +0,0 @@
1
- export * from "./src/review-bundles/review-bundles-renderer.js";
@@ -1 +0,0 @@
1
- export * from "./src/review-bundles/review-bundles-writer.js";
package/review-bundles.js DELETED
@@ -1 +0,0 @@
1
- export * from "./src/review-bundles/review-bundles.js";
@@ -1 +0,0 @@
1
- export * from "./src/runtime/runtime-diagnostics.js";
@@ -1 +0,0 @@
1
- export * from "./src/sync/scene-character-batch.js";
@@ -1 +0,0 @@
1
- export * from "./src/sync/scene-character-normalization.js";
@@ -1 +0,0 @@
1
- export * from "./src/sync/scrivener-direct.js";
package/sync.js DELETED
@@ -1 +0,0 @@
1
- export * from "./src/sync/sync.js";
@@ -1 +0,0 @@
1
- export * from "./src/workflows/workflow-catalogue.js";
@@ -1 +0,0 @@
1
- export * from "./src/world/world-entity-templates.js";