@hanna84/mcp-writing 2.12.10 → 2.12.12

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.12](https://github.com/hannasdev/mcp-writing.git
8
+ /compare/v2.12.11...v2.12.12)
9
+
10
+ - refactor(root): remove compatibility shims after src migration [`#127`](https://github.com/hannasdev/mcp-writing.git
11
+ /pull/127)
12
+
13
+ #### [v2.12.11](https://github.com/hannasdev/mcp-writing.git
14
+ /compare/v2.12.10...v2.12.11)
15
+
16
+ > 29 April 2026
17
+
18
+ - refactor(core): move helpers under src/core [`#126`](https://github.com/hannasdev/mcp-writing.git
19
+ /pull/126)
20
+ - Release 2.12.11 [`dff03db`](https://github.com/hannasdev/mcp-writing.git
21
+ /commit/dff03db488274a1753e1b6bc49fb48173ab61115)
22
+
7
23
  #### [v2.12.10](https://github.com/hannasdev/mcp-writing.git
8
24
  /compare/v2.12.9...v2.12.10)
9
25
 
26
+ > 29 April 2026
27
+
10
28
  - refactor(scripts): move async job runner under src/scripts [`#125`](https://github.com/hannasdev/mcp-writing.git
11
29
  /pull/125)
30
+ - Release 2.12.10 [`fa20160`](https://github.com/hannasdev/mcp-writing.git
31
+ /commit/fa20160423211dd6ab7416a82fdf3365b69ae6d1)
12
32
 
13
33
  #### [v2.12.9](https://github.com/hannasdev/mcp-writing.git
14
34
  /compare/v2.12.8...v2.12.9)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanna84/mcp-writing",
3
- "version": "2.12.10",
3
+ "version": "2.12.12",
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"
@@ -2,14 +2,21 @@ import fs from "node:fs";
2
2
  import path from "node:path";
3
3
  import matter from "gray-matter";
4
4
  import yaml from "js-yaml";
5
- import { sidecarPath, syncAll } from "./src/sync/sync.js";
5
+ import { sidecarPath, syncAll } from "../sync/sync.js";
6
6
  import {
7
7
  slugifyEntityName,
8
8
  renderCharacterSheetTemplate,
9
9
  renderPlaceSheetTemplate,
10
10
  renderCharacterArcTemplate,
11
- } from "./src/world/world-entity-templates.js";
12
- import { ReviewBundlePlanError } from "./src/review-bundles/review-bundles.js";
11
+ } from "../world/world-entity-templates.js";
12
+
13
+ function createCoreValidationError(code, message, details) {
14
+ const error = new Error(message);
15
+ error.name = "CoreValidationError";
16
+ error.code = code;
17
+ error.details = details;
18
+ return error;
19
+ }
13
20
 
14
21
  export function deriveLoglineFromProse(prose) {
15
22
  const compact = prose.replace(/\s+/g, " ").trim();
@@ -197,7 +204,7 @@ export function createHelpers({ syncDir, syncDirReal, syncDirAbs, db, syncDirWri
197
204
  while (!fs.existsSync(existingAncestor)) {
198
205
  const parentDir = path.dirname(existingAncestor);
199
206
  if (parentDir === existingAncestor) {
200
- throw new ReviewBundlePlanError(
207
+ throw createCoreValidationError(
201
208
  "INVALID_OUTPUT_DIR",
202
209
  "output_dir must be inside WRITING_SYNC_DIR.",
203
210
  { output_dir: resolvedOutputDir, sync_dir: syncDirAbs }
@@ -210,10 +217,14 @@ export function createHelpers({ syncDir, syncDirReal, syncDirAbs, db, syncDirWri
210
217
  try {
211
218
  realExistingAncestor = fs.realpathSync.native(existingAncestor);
212
219
  } catch (err) {
213
- throw new ReviewBundlePlanError(
220
+ throw createCoreValidationError(
214
221
  "INVALID_OUTPUT_DIR",
215
222
  "output_dir ancestor could not be resolved: path may be inaccessible.",
216
- { output_dir: outputDir, existing_ancestor: existingAncestor, cause: err.message }
223
+ {
224
+ output_dir: outputDir,
225
+ existing_ancestor: existingAncestor,
226
+ cause: err instanceof Error ? err.message : String(err),
227
+ }
217
228
  );
218
229
  }
219
230
  const relativeFromAncestor = path.relative(existingAncestor, resolvedOutputDir);
@@ -221,7 +232,7 @@ export function createHelpers({ syncDir, syncDirReal, syncDirAbs, db, syncDirWri
221
232
 
222
233
  const relativeToSyncDir = path.relative(syncDirReal, resolvedOutputDir);
223
234
  if (relativeToSyncDir.startsWith("..") || path.isAbsolute(relativeToSyncDir)) {
224
- throw new ReviewBundlePlanError(
235
+ throw createCoreValidationError(
225
236
  "INVALID_OUTPUT_DIR",
226
237
  "output_dir must be inside WRITING_SYNC_DIR.",
227
238
  { output_dir: resolvedOutputDir, sync_dir: syncDirAbs }
package/src/index.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  readSupportingNotesForEntity,
18
18
  readEntityMetadata,
19
19
  resolveBatchTargetScenes,
20
- } from "../helpers.js";
20
+ } from "./core/helpers.js";
21
21
  import { STYLEGUIDE_CONFIG_BASENAME } from "./styleguide/prose-styleguide.js";
22
22
  import { registerSyncTools } from "./tools/sync.js";
23
23
  import { registerSearchTools } from "./tools/search.js";
@@ -79,6 +79,14 @@ export function registerReviewBundleTools(s, {
79
79
  if (error instanceof ReviewBundlePlanError) {
80
80
  return errorResponse(error.code, error.message, error.details);
81
81
  }
82
+ if (
83
+ error &&
84
+ typeof error === "object" &&
85
+ error.name === "CoreValidationError" &&
86
+ typeof error.code === "string"
87
+ ) {
88
+ return errorResponse(error.code, error.message ?? "Request failed.", error.details);
89
+ }
82
90
  return errorResponse(
83
91
  "PREVIEW_FAILED",
84
92
  error instanceof Error ? error.message : "Failed to generate review bundle preview."
@@ -197,6 +205,14 @@ export function registerReviewBundleTools(s, {
197
205
  if (error instanceof ReviewBundlePlanError) {
198
206
  return errorResponse(error.code, error.message, error.details);
199
207
  }
208
+ if (
209
+ error &&
210
+ typeof error === "object" &&
211
+ error.name === "CoreValidationError" &&
212
+ typeof error.code === "string"
213
+ ) {
214
+ return errorResponse(error.code, error.message ?? "Request failed.", error.details);
215
+ }
200
216
  return errorResponse(
201
217
  "CREATE_BUNDLE_FAILED",
202
218
  error instanceof Error ? error.message : "Failed to create review bundle artifacts."
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/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";