@hanna84/mcp-writing 2.10.3 → 2.10.4

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.10.4](https://github.com/hannasdev/mcp-writing.git
8
+ /compare/v2.10.3...v2.10.4)
9
+
10
+ - fix(review-bundles): guard oversized scene_ids in planner [`#108`](https://github.com/hannasdev/mcp-writing.git
11
+ /pull/108)
12
+
7
13
  #### [v2.10.3](https://github.com/hannasdev/mcp-writing.git
8
14
  /compare/v2.10.2...v2.10.3)
9
15
 
16
+ > 26 April 2026
17
+
10
18
  - refactor(helpers): extract domain helpers and path safety utilities from index.js [`#107`](https://github.com/hannasdev/mcp-writing.git
11
19
  /pull/107)
20
+ - Release 2.10.3 [`f3b296a`](https://github.com/hannasdev/mcp-writing.git
21
+ /commit/f3b296a9dbbedafcedab12ca8492d479aaa68180)
12
22
 
13
23
  #### [v2.10.2](https://github.com/hannasdev/mcp-writing.git
14
24
  /compare/v2.10.1...v2.10.2)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanna84/mcp-writing",
3
- "version": "2.10.3",
3
+ "version": "2.10.4",
4
4
  "description": "MCP service for AI-assisted reasoning and editing on long-form fiction projects",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,4 +1,5 @@
1
1
  const MAX_SORT_VALUE = Number.MAX_SAFE_INTEGER;
2
+ const MAX_SCENE_ID_FILTER_PARAMS = 900;
2
3
 
3
4
  export const REVIEW_BUNDLE_PROFILES = ["outline_discussion", "editor_detailed", "beta_reader_personalized"];
4
5
  export const REVIEW_BUNDLE_STRICTNESS = ["warn", "fail"];
@@ -99,14 +100,22 @@ function resolveRequestedSceneIds(dbHandle, projectId, sceneIds) {
99
100
  return { requested: [], existing: new Set() };
100
101
  }
101
102
 
102
- const placeholders = sceneIds.map(() => "?").join(",");
103
- const rows = dbHandle.prepare(
104
- `SELECT scene_id FROM scenes WHERE project_id = ? AND scene_id IN (${placeholders})`
105
- ).all(projectId, ...sceneIds);
103
+ const existing = new Set();
104
+
105
+ for (let i = 0; i < sceneIds.length; i += MAX_SCENE_ID_FILTER_PARAMS) {
106
+ const chunk = sceneIds.slice(i, i + MAX_SCENE_ID_FILTER_PARAMS);
107
+ const placeholders = chunk.map(() => "?").join(",");
108
+ const rows = dbHandle.prepare(
109
+ `SELECT scene_id FROM scenes WHERE project_id = ? AND scene_id IN (${placeholders})`
110
+ ).all(projectId, ...chunk);
111
+ for (const row of rows) {
112
+ existing.add(row.scene_id);
113
+ }
114
+ }
106
115
 
107
116
  return {
108
117
  requested: sceneIds,
109
- existing: new Set(rows.map(row => row.scene_id)),
118
+ existing,
110
119
  };
111
120
  }
112
121
 
@@ -129,6 +138,17 @@ export function buildReviewBundlePlan(dbHandle, {
129
138
  throw new ReviewBundlePlanError("INVALID_PROJECT_ID", "project_id is required.");
130
139
  }
131
140
 
141
+ if (Array.isArray(scene_ids) && scene_ids.length > MAX_SCENE_ID_FILTER_PARAMS) {
142
+ throw new ReviewBundlePlanError(
143
+ "SCENE_IDS_TOO_LARGE",
144
+ `scene_ids supports at most ${MAX_SCENE_ID_FILTER_PARAMS} entries per request.`,
145
+ {
146
+ max_scene_ids: MAX_SCENE_ID_FILTER_PARAMS,
147
+ received_scene_ids: scene_ids.length,
148
+ }
149
+ );
150
+ }
151
+
132
152
  assertProfile(profile);
133
153
  assertStrictness(strictness);
134
154
  assertFormat(format);