@hanna84/mcp-writing 2.12.8 → 2.12.9

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,21 @@ 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.9](https://github.com/hannasdev/mcp-writing.git
8
+ /compare/v2.12.8...v2.12.9)
9
+
10
+ - refactor(tools): move tool modules under src/tools [`#124`](https://github.com/hannasdev/mcp-writing.git
11
+ /pull/124)
12
+
7
13
  #### [v2.12.8](https://github.com/hannasdev/mcp-writing.git
8
14
  /compare/v2.12.7...v2.12.8)
9
15
 
16
+ > 28 April 2026
17
+
10
18
  - refactor(domains): move review, styleguide, and workflow modules into src [`#123`](https://github.com/hannasdev/mcp-writing.git
11
19
  /pull/123)
20
+ - Release 2.12.8 [`6d0375f`](https://github.com/hannasdev/mcp-writing.git
21
+ /commit/6d0375f95d2341be0dd569856b9de3dd26fb9783)
12
22
 
13
23
  #### [v2.12.7](https://github.com/hannasdev/mcp-writing.git
14
24
  /compare/v2.12.6...v2.12.7)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanna84/mcp-writing",
3
- "version": "2.12.8",
3
+ "version": "2.12.9",
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",
@@ -29,7 +29,7 @@
29
29
  "./prose-styleguide.js": "./prose-styleguide.js",
30
30
  "./prose-styleguide-drift.js": "./prose-styleguide-drift.js",
31
31
  "./prose-styleguide-skill.js": "./prose-styleguide-skill.js",
32
- "./tools/*": "./tools/*",
32
+ "./tools/*": "./src/tools/*",
33
33
  "./scripts/*": "./scripts/*",
34
34
  "./src/*": "./src/*",
35
35
  "./package.json": "./package.json"
@@ -64,7 +64,6 @@
64
64
  "prose-styleguide-drift.js",
65
65
  "prose-styleguide-skill.js",
66
66
  "scripts/",
67
- "tools/",
68
67
  "README.md",
69
68
  "CHANGELOG.md"
70
69
  ],
@@ -82,7 +81,7 @@
82
81
  "normalize:scene-characters": "node --experimental-sqlite scripts/normalize-scene-characters.mjs",
83
82
  "setup:openclaw-env": "sh scripts/setup-openclaw-env.sh",
84
83
  "release": "release-it",
85
- "lint": "eslint *.js src/ scripts/ tools/",
84
+ "lint": "eslint *.js src/ scripts/",
86
85
  "docs": "node scripts/generate-tool-docs.mjs",
87
86
  "lint:metadata": "node scripts/lint-metadata.mjs",
88
87
  "sync:server-json-version": "node scripts/sync-server-json-version.mjs",
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
3
  * Generates docs/tools.md from tool definitions in the runtime entrypoint
4
- * (src/index.js when present, otherwise index.js) and tools/*.js.
4
+ * (src/index.js when present, otherwise index.js) and src/tools/*.js.
5
5
  *
6
6
  * Run: node scripts/generate-tool-docs.mjs
7
7
  * or: npm run docs
@@ -18,15 +18,19 @@ const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
18
18
  const OUT = path.join(ROOT, 'docs', 'tools.md');
19
19
 
20
20
  // Build a map from each registration function name to its module source.
21
- // e.g. "registerSyncTools" -> contents of tools/sync.js
21
+ // e.g. "registerSyncTools" -> contents of src/tools/sync.js
22
22
  const toolModuleMap = new Map();
23
- try {
24
- for (const f of readdirSync(path.join(ROOT, 'tools')).filter(f => f.endsWith('.js')).sort()) {
25
- const content = readFileSync(path.join(ROOT, 'tools', f), 'utf8');
26
- const fnName = (content.match(/export function (\w+)\s*\(/) ?? [])[1];
27
- if (fnName) toolModuleMap.set(fnName, content);
23
+ for (const dir of [path.join(ROOT, 'src', 'tools'), path.join(ROOT, 'tools')]) {
24
+ try {
25
+ for (const f of readdirSync(dir).filter(f => f.endsWith('.js')).sort()) {
26
+ const content = readFileSync(path.join(dir, f), 'utf8');
27
+ const fnName = (content.match(/export function (\w+)\s*\(/) ?? [])[1];
28
+ if (fnName && !toolModuleMap.has(fnName)) toolModuleMap.set(fnName, content);
29
+ }
30
+ } catch {
31
+ // Directory may not exist during early migration phases.
28
32
  }
29
- } catch { /* tools/ not yet created */ }
33
+ }
30
34
 
31
35
  // Inline each register*Tools(s, ...) call with the module source so that
32
36
  // s.tool() blocks appear in registration order (matching createMcpServer()).
package/src/index.js CHANGED
@@ -19,12 +19,12 @@ import {
19
19
  resolveBatchTargetScenes,
20
20
  } from "../helpers.js";
21
21
  import { STYLEGUIDE_CONFIG_BASENAME } from "./styleguide/prose-styleguide.js";
22
- import { registerSyncTools } from "../tools/sync.js";
23
- import { registerSearchTools } from "../tools/search.js";
24
- import { registerMetadataTools } from "../tools/metadata.js";
25
- import { registerReviewBundleTools } from "../tools/review-bundles.js";
26
- import { registerStyleguideTools } from "../tools/styleguide.js";
27
- import { registerEditingTools } from "../tools/editing.js";
22
+ import { registerSyncTools } from "./tools/sync.js";
23
+ import { registerSearchTools } from "./tools/search.js";
24
+ import { registerMetadataTools } from "./tools/metadata.js";
25
+ import { registerReviewBundleTools } from "./tools/review-bundles.js";
26
+ import { registerStyleguideTools } from "./tools/styleguide.js";
27
+ import { registerEditingTools } from "./tools/editing.js";
28
28
  import { WORKFLOW_CATALOGUE } from "./workflows/workflow-catalogue.js";
29
29
  import { getRuntimeDiagnostics } from "./runtime/runtime-diagnostics.js";
30
30
 
@@ -365,7 +365,7 @@ function createMcpServer() {
365
365
  }
366
366
  );
367
367
 
368
- // Passed to each tool registration module (tools/*.js) to thread state and
368
+ // Passed to each tool registration module (src/tools/*.js) to thread state and
369
369
  // shared helpers without circular imports. Grows as groups are extracted.
370
370
  const toolContext = {
371
371
  db,
@@ -2,8 +2,8 @@ import { z } from "zod";
2
2
  import fs from "node:fs";
3
3
  import matter from "gray-matter";
4
4
  import yaml from "js-yaml";
5
- import { createSnapshot, listSnapshots } from "../src/core/git.js";
6
- import { getFileWriteDiagnostics, readMeta, indexSceneFile } from "../src/sync/sync.js";
5
+ import { createSnapshot, listSnapshots } from "../core/git.js";
6
+ import { getFileWriteDiagnostics, readMeta, indexSceneFile } from "../sync/sync.js";
7
7
 
8
8
  function renderSceneContent(metadata, revisedProse) {
9
9
  const hasFrontmatter = metadata && Object.keys(metadata).length > 0;
@@ -1,8 +1,8 @@
1
1
  import { z } from "zod";
2
2
  import fs from "node:fs";
3
3
  import matter from "gray-matter";
4
- import { readMeta, writeMeta, indexSceneFile, normalizeSceneMetaForPath } from "../src/sync/sync.js";
5
- import { validateProjectId, validateUniverseId } from "../src/sync/importer.js";
4
+ import { readMeta, writeMeta, indexSceneFile, normalizeSceneMetaForPath } from "../sync/sync.js";
5
+ import { validateProjectId, validateUniverseId } from "../sync/importer.js";
6
6
 
7
7
  export function registerMetadataTools(s, {
8
8
  db,
@@ -6,9 +6,9 @@ import {
6
6
  ReviewBundlePlanError,
7
7
  buildReviewBundlePlan,
8
8
  createReviewBundleArtifacts,
9
- } from "../src/review-bundles/review-bundles.js";
10
- import { validateProjectId } from "../src/sync/importer.js";
11
- import { getHeadCommitHash } from "../src/core/git.js";
9
+ } from "../review-bundles/review-bundles.js";
10
+ import { validateProjectId } from "../sync/importer.js";
11
+ import { getHeadCommitHash } from "../core/git.js";
12
12
 
13
13
  export function registerReviewBundleTools(s, {
14
14
  db,
@@ -11,18 +11,18 @@ import {
11
11
  resolveStyleguideConfig,
12
12
  summarizeStyleguideConfig,
13
13
  updateStyleguideConfig,
14
- } from "../src/styleguide/prose-styleguide.js";
14
+ } from "../styleguide/prose-styleguide.js";
15
15
  import {
16
16
  detectStyleguideSignals,
17
17
  analyzeSceneStyleguideDrift,
18
18
  suggestStyleguideUpdatesFromScenes,
19
- } from "../src/styleguide/prose-styleguide-drift.js";
19
+ } from "../styleguide/prose-styleguide-drift.js";
20
20
  import {
21
21
  PROSE_STYLEGUIDE_SKILL_BASENAME,
22
22
  PROSE_STYLEGUIDE_SKILL_DIRNAME,
23
23
  buildProseStyleguideSkill,
24
- } from "../src/styleguide/prose-styleguide-skill.js";
25
- import { validateProjectId } from "../src/sync/importer.js";
24
+ } from "../styleguide/prose-styleguide-skill.js";
25
+ import { validateProjectId } from "../sync/importer.js";
26
26
 
27
27
  export function registerStyleguideTools(s, {
28
28
  db,
@@ -2,8 +2,8 @@ import { z } from "zod";
2
2
  import fs from "node:fs";
3
3
  import path from "node:path";
4
4
  import matter from "gray-matter";
5
- import { syncAll, writeMeta, readMeta, indexSceneFile, normalizeSceneMetaForPath } from "../src/sync/sync.js";
6
- import { importScrivenerSync, validateProjectId } from "../src/sync/importer.js";
5
+ import { syncAll, writeMeta, readMeta, indexSceneFile, normalizeSceneMetaForPath } from "../sync/sync.js";
6
+ import { importScrivenerSync, validateProjectId } from "../sync/importer.js";
7
7
 
8
8
  export function registerSyncTools(s, {
9
9
  db,
File without changes