scrivener-mcp 0.1.4 → 0.3.0
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/README.md +37 -0
- package/dist/content-analyzer.d.ts +105 -0
- package/dist/content-analyzer.d.ts.map +1 -0
- package/dist/content-analyzer.js +443 -0
- package/dist/content-analyzer.js.map +1 -0
- package/dist/content-enhancer.d.ts +119 -0
- package/dist/content-enhancer.d.ts.map +1 -0
- package/dist/content-enhancer.js +745 -0
- package/dist/content-enhancer.js.map +1 -0
- package/dist/index.js +525 -49
- package/dist/index.js.map +1 -1
- package/dist/memory-manager.d.ts +114 -0
- package/dist/memory-manager.d.ts.map +1 -0
- package/dist/memory-manager.js +222 -0
- package/dist/memory-manager.js.map +1 -0
- package/package.json +7 -3
- package/scripts/setup.js +102 -0
- package/scripts/uninstall.js +50 -0
package/README.md
CHANGED
|
@@ -2,6 +2,43 @@
|
|
|
2
2
|
|
|
3
3
|
A Model Context Protocol (MCP) server for Scrivener integration that allows Claude to manipulate Scrivener projects, including file and folder operations, metadata management, and content analysis.
|
|
4
4
|
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g scrivener-mcp
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The installation will **automatically configure Claude Desktop** for you! Just restart Claude Desktop after installation.
|
|
12
|
+
|
|
13
|
+
### Manual Configuration (if needed)
|
|
14
|
+
|
|
15
|
+
If automatic setup didn't work, you can manually configure:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Run the setup script
|
|
19
|
+
npx scrivener-mcp setup
|
|
20
|
+
|
|
21
|
+
# Or manually add to claude_desktop_config.json:
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"mcpServers": {
|
|
27
|
+
"scrivener": {
|
|
28
|
+
"command": "npx",
|
|
29
|
+
"args": ["scrivener-mcp"]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Uninstalling
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# Remove the package and configuration
|
|
39
|
+
npm uninstall -g scrivener-mcp
|
|
40
|
+
```
|
|
41
|
+
|
|
5
42
|
## Features
|
|
6
43
|
|
|
7
44
|
### Core Scrivener Operations
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
export interface ContentAnalysis {
|
|
2
|
+
documentId: string;
|
|
3
|
+
timestamp: string;
|
|
4
|
+
metrics: WritingMetrics;
|
|
5
|
+
style: StyleAnalysis;
|
|
6
|
+
structure: StructureAnalysis;
|
|
7
|
+
quality: QualityIndicators;
|
|
8
|
+
suggestions: Suggestion[];
|
|
9
|
+
emotions: EmotionalAnalysis;
|
|
10
|
+
pacing: PacingAnalysis;
|
|
11
|
+
}
|
|
12
|
+
export interface WritingMetrics {
|
|
13
|
+
wordCount: number;
|
|
14
|
+
sentenceCount: number;
|
|
15
|
+
paragraphCount: number;
|
|
16
|
+
averageSentenceLength: number;
|
|
17
|
+
averageParagraphLength: number;
|
|
18
|
+
readingTime: number;
|
|
19
|
+
fleschReadingEase: number;
|
|
20
|
+
fleschKincaidGrade: number;
|
|
21
|
+
}
|
|
22
|
+
export interface StyleAnalysis {
|
|
23
|
+
sentenceVariety: 'low' | 'medium' | 'high';
|
|
24
|
+
vocabularyComplexity: 'simple' | 'moderate' | 'complex' | 'advanced';
|
|
25
|
+
adverbUsage: 'minimal' | 'moderate' | 'heavy';
|
|
26
|
+
passiveVoicePercentage: number;
|
|
27
|
+
dialoguePercentage: number;
|
|
28
|
+
descriptionPercentage: number;
|
|
29
|
+
mostFrequentWords: {
|
|
30
|
+
word: string;
|
|
31
|
+
count: number;
|
|
32
|
+
}[];
|
|
33
|
+
styleConsistency: number;
|
|
34
|
+
}
|
|
35
|
+
export interface StructureAnalysis {
|
|
36
|
+
sceneBreaks: number;
|
|
37
|
+
chapters: number;
|
|
38
|
+
averageSceneLength: number;
|
|
39
|
+
openingStrength: 'weak' | 'moderate' | 'strong';
|
|
40
|
+
endingStrength: 'weak' | 'moderate' | 'strong';
|
|
41
|
+
hookPresence: boolean;
|
|
42
|
+
cliffhangers: number;
|
|
43
|
+
}
|
|
44
|
+
export interface QualityIndicators {
|
|
45
|
+
repetitiveness: number;
|
|
46
|
+
cliches: string[];
|
|
47
|
+
filterWords: string[];
|
|
48
|
+
tellingVsShowing: number;
|
|
49
|
+
sensoryDetails: 'lacking' | 'adequate' | 'rich';
|
|
50
|
+
whiteSpace: 'cramped' | 'balanced' | 'excessive';
|
|
51
|
+
}
|
|
52
|
+
export interface Suggestion {
|
|
53
|
+
type: 'style' | 'structure' | 'grammar' | 'clarity' | 'impact';
|
|
54
|
+
severity: 'minor' | 'moderate' | 'major';
|
|
55
|
+
location?: {
|
|
56
|
+
paragraph: number;
|
|
57
|
+
sentence?: number;
|
|
58
|
+
};
|
|
59
|
+
issue: string;
|
|
60
|
+
suggestion: string;
|
|
61
|
+
example?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface EmotionalAnalysis {
|
|
64
|
+
dominantEmotion: string;
|
|
65
|
+
emotionalArc: {
|
|
66
|
+
position: number;
|
|
67
|
+
emotion: string;
|
|
68
|
+
intensity: number;
|
|
69
|
+
}[];
|
|
70
|
+
tensionLevel: number;
|
|
71
|
+
moodConsistency: number;
|
|
72
|
+
}
|
|
73
|
+
export interface PacingAnalysis {
|
|
74
|
+
overall: 'slow' | 'moderate' | 'fast' | 'variable';
|
|
75
|
+
sections: {
|
|
76
|
+
start: number;
|
|
77
|
+
end: number;
|
|
78
|
+
pace: 'slow' | 'moderate' | 'fast';
|
|
79
|
+
}[];
|
|
80
|
+
actionVsReflection: number;
|
|
81
|
+
recommendedAdjustments: string[];
|
|
82
|
+
}
|
|
83
|
+
export declare class ContentAnalyzer {
|
|
84
|
+
private commonWords;
|
|
85
|
+
private filterWords;
|
|
86
|
+
private clichePhrases;
|
|
87
|
+
analyzeContent(content: string, documentId: string): Promise<ContentAnalysis>;
|
|
88
|
+
private calculateMetrics;
|
|
89
|
+
private analyzeStyle;
|
|
90
|
+
private analyzeStructure;
|
|
91
|
+
private assessQuality;
|
|
92
|
+
private generateSuggestions;
|
|
93
|
+
private analyzeEmotions;
|
|
94
|
+
private analyzePacing;
|
|
95
|
+
private countSyllables;
|
|
96
|
+
private calculateReadability;
|
|
97
|
+
private calculateVariance;
|
|
98
|
+
private assessOpeningStrength;
|
|
99
|
+
private assessEndingStrength;
|
|
100
|
+
private detectHook;
|
|
101
|
+
private countCliffhangers;
|
|
102
|
+
private splitIntoSegments;
|
|
103
|
+
private detectSegmentEmotion;
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=content-analyzer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-analyzer.d.ts","sourceRoot":"","sources":["../src/content-analyzer.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,cAAc,CAAC;IACxB,KAAK,EAAE,aAAa,CAAC;IACrB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,MAAM,EAAE,cAAc,CAAC;CAC1B;AAED,MAAM,WAAW,cAAc;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,aAAa;IAC1B,e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Y5B,OAAO,CAAC,UAAU;IAWlB,OAAO,CAAC,iBAAiB;IAUzB,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,oBAAoB;CAkB/B"}
|
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
// import type { ScrivenerDocument } from './scrivener-project.js';
|
|
2
|
+
export class ContentAnalyzer {
|
|
3
|
+
commonWords = new Set(['the', 'a', 'an', 'and', 'or', 'but', 'in', 'on', 'at', 'to', 'for',
|
|
4
|
+
'of', 'with', 'as', 'by', 'that', 'this', 'it', 'is', 'was', 'are', 'were', 'be', 'been',
|
|
5
|
+
'being', 'have', 'has', 'had', 'do', 'does', 'did', 'will', 'would', 'could', 'should']);
|
|
6
|
+
filterWords = new Set(['just', 'really', 'very', 'quite', 'rather', 'somewhat',
|
|
7
|
+
'somehow', 'definitely', 'certainly', 'probably', 'possibly', 'perhaps', 'maybe',
|
|
8
|
+
'simply', 'actually', 'basically', 'virtually', 'literally', 'essentially']);
|
|
9
|
+
clichePhrases = [
|
|
10
|
+
'dark and stormy night', 'in the nick of time', 'avoid like the plague',
|
|
11
|
+
'dead as a doornail', 'fit as a fiddle', 'time will tell', 'only time will tell',
|
|
12
|
+
'lost track of time', 'all walks of life', 'calm before the storm',
|
|
13
|
+
'cry over spilled milk', 'every cloud has a silver lining'
|
|
14
|
+
];
|
|
15
|
+
async analyzeContent(content, documentId) {
|
|
16
|
+
const metrics = this.calculateMetrics(content);
|
|
17
|
+
const style = this.analyzeStyle(content);
|
|
18
|
+
const structure = this.analyzeStructure(content);
|
|
19
|
+
const quality = this.assessQuality(content);
|
|
20
|
+
const suggestions = this.generateSuggestions(content, metrics, style, quality);
|
|
21
|
+
const emotions = this.analyzeEmotions(content);
|
|
22
|
+
const pacing = this.analyzePacing(content);
|
|
23
|
+
return {
|
|
24
|
+
documentId,
|
|
25
|
+
timestamp: new Date().toISOString(),
|
|
26
|
+
metrics,
|
|
27
|
+
style,
|
|
28
|
+
structure,
|
|
29
|
+
quality,
|
|
30
|
+
suggestions,
|
|
31
|
+
emotions,
|
|
32
|
+
pacing
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
calculateMetrics(content) {
|
|
36
|
+
const words = content.split(/\s+/).filter(w => w.length > 0);
|
|
37
|
+
const sentences = content.split(/[.!?]+/).filter(s => s.trim().length > 0);
|
|
38
|
+
const paragraphs = content.split(/\n\n+/).filter(p => p.trim().length > 0);
|
|
39
|
+
const wordCount = words.length;
|
|
40
|
+
const sentenceCount = sentences.length;
|
|
41
|
+
const paragraphCount = paragraphs.length;
|
|
42
|
+
const averageSentenceLength = sentenceCount > 0 ? wordCount / sentenceCount : 0;
|
|
43
|
+
const averageParagraphLength = paragraphCount > 0 ? wordCount / paragraphCount : 0;
|
|
44
|
+
const readingTime = Math.ceil(wordCount / 250); // Average reading speed
|
|
45
|
+
// Calculate readability scores
|
|
46
|
+
const { fleschReadingEase, fleschKincaidGrade } = this.calculateReadability(wordCount, sentenceCount, this.countSyllables(words));
|
|
47
|
+
return {
|
|
48
|
+
wordCount,
|
|
49
|
+
sentenceCount,
|
|
50
|
+
paragraphCount,
|
|
51
|
+
averageSentenceLength,
|
|
52
|
+
averageParagraphLength,
|
|
53
|
+
readingTime,
|
|
54
|
+
fleschReadingEase,
|
|
55
|
+
fleschKincaidGrade
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
analyzeStyle(content) {
|
|
59
|
+
const sentences = content.split(/[.!?]+/).filter(s => s.trim().length > 0);
|
|
60
|
+
const words = content.toLowerCase().split(/\s+/).filter(w => w.length > 0);
|
|
61
|
+
// Sentence variety
|
|
62
|
+
const sentenceLengths = sentences.map(s => s.split(/\s+/).length);
|
|
63
|
+
const lengthVariance = this.calculateVariance(sentenceLengths);
|
|
64
|
+
const sentenceVariety = lengthVariance > 50 ? 'high' : lengthVariance > 20 ? 'medium' : 'low';
|
|
65
|
+
// Vocabulary complexity
|
|
66
|
+
// const uniqueWords = new Set(words);
|
|
67
|
+
const complexWords = words.filter(w => this.countSyllables([w]) > 2).length;
|
|
68
|
+
const vocabularyComplexity = complexWords / words.length > 0.3 ? 'advanced' :
|
|
69
|
+
complexWords / words.length > 0.2 ? 'complex' :
|
|
70
|
+
complexWords / words.length > 0.1 ? 'moderate' : 'simple';
|
|
71
|
+
// Adverb usage
|
|
72
|
+
const adverbs = words.filter(w => w.endsWith('ly')).length;
|
|
73
|
+
const adverbUsage = adverbs / words.length > 0.05 ? 'heavy' :
|
|
74
|
+
adverbs / words.length > 0.02 ? 'moderate' : 'minimal';
|
|
75
|
+
// Passive voice
|
|
76
|
+
const passiveIndicators = ['was', 'were', 'been', 'being', 'be', 'is', 'are'];
|
|
77
|
+
const passiveCount = words.filter(w => passiveIndicators.includes(w)).length;
|
|
78
|
+
const passiveVoicePercentage = (passiveCount / sentences.length) * 100;
|
|
79
|
+
// Dialogue vs description
|
|
80
|
+
const dialogueLines = content.split('\n').filter(line => line.includes('"') || line.includes("'"));
|
|
81
|
+
const dialoguePercentage = (dialogueLines.length / content.split('\n').length) * 100;
|
|
82
|
+
const descriptionPercentage = 100 - dialoguePercentage;
|
|
83
|
+
// Most frequent words (excluding common words)
|
|
84
|
+
const wordFrequency = new Map();
|
|
85
|
+
words.forEach(word => {
|
|
86
|
+
if (!this.commonWords.has(word) && word.length > 3) {
|
|
87
|
+
wordFrequency.set(word, (wordFrequency.get(word) || 0) + 1);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
const mostFrequentWords = Array.from(wordFrequency.entries())
|
|
91
|
+
.sort((a, b) => b[1] - a[1])
|
|
92
|
+
.slice(0, 10)
|
|
93
|
+
.map(([word, count]) => ({ word, count }));
|
|
94
|
+
return {
|
|
95
|
+
sentenceVariety,
|
|
96
|
+
vocabularyComplexity,
|
|
97
|
+
adverbUsage,
|
|
98
|
+
passiveVoicePercentage,
|
|
99
|
+
dialoguePercentage,
|
|
100
|
+
descriptionPercentage,
|
|
101
|
+
mostFrequentWords,
|
|
102
|
+
styleConsistency: 85 // Simplified for now
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
analyzeStructure(content) {
|
|
106
|
+
const lines = content.split('\n');
|
|
107
|
+
const paragraphs = content.split(/\n\n+/);
|
|
108
|
+
// Scene breaks (looking for common indicators)
|
|
109
|
+
const sceneBreaks = lines.filter(line => line.trim() === '***' ||
|
|
110
|
+
line.trim() === '* * *' ||
|
|
111
|
+
line.trim() === '#').length;
|
|
112
|
+
// Chapters (looking for chapter headings)
|
|
113
|
+
const chapters = lines.filter(line => /^(Chapter|CHAPTER|Ch\.|Part|PART)\s+\d+/i.test(line.trim())).length;
|
|
114
|
+
const averageSceneLength = sceneBreaks > 0 ?
|
|
115
|
+
content.length / (sceneBreaks + 1) : content.length;
|
|
116
|
+
// Opening and ending analysis
|
|
117
|
+
const firstParagraph = paragraphs[0] || '';
|
|
118
|
+
const lastParagraph = paragraphs[paragraphs.length - 1] || '';
|
|
119
|
+
const openingStrength = this.assessOpeningStrength(firstParagraph);
|
|
120
|
+
const endingStrength = this.assessEndingStrength(lastParagraph);
|
|
121
|
+
const hookPresence = this.detectHook(firstParagraph);
|
|
122
|
+
const cliffhangers = this.countCliffhangers(paragraphs);
|
|
123
|
+
return {
|
|
124
|
+
sceneBreaks,
|
|
125
|
+
chapters,
|
|
126
|
+
averageSceneLength,
|
|
127
|
+
openingStrength,
|
|
128
|
+
endingStrength,
|
|
129
|
+
hookPresence,
|
|
130
|
+
cliffhangers
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
assessQuality(content) {
|
|
134
|
+
const words = content.toLowerCase().split(/\s+/);
|
|
135
|
+
const sentences = content.split(/[.!?]+/).filter(s => s.trim().length > 0);
|
|
136
|
+
// Repetitiveness
|
|
137
|
+
const wordPairs = new Map();
|
|
138
|
+
for (let i = 0; i < words.length - 1; i++) {
|
|
139
|
+
const pair = `${words[i]} ${words[i + 1]}`;
|
|
140
|
+
wordPairs.set(pair, (wordPairs.get(pair) || 0) + 1);
|
|
141
|
+
}
|
|
142
|
+
const repetitivePairs = Array.from(wordPairs.values()).filter(count => count > 2).length;
|
|
143
|
+
const repetitiveness = Math.min((repetitivePairs / wordPairs.size) * 100, 100);
|
|
144
|
+
// Cliches
|
|
145
|
+
const foundClichés = this.clichePhrases.filter(cliché => content.toLowerCase().includes(cliché));
|
|
146
|
+
// Filter words
|
|
147
|
+
const foundFilterWords = Array.from(new Set(words.filter(w => this.filterWords.has(w))));
|
|
148
|
+
// Telling vs showing (simplified heuristic)
|
|
149
|
+
const tellingWords = ['felt', 'thought', 'knew', 'realized', 'understood', 'believed'];
|
|
150
|
+
const tellingCount = words.filter(w => tellingWords.includes(w)).length;
|
|
151
|
+
const actionWords = words.filter(w => w.endsWith('ed') || w.endsWith('ing')).length;
|
|
152
|
+
const tellingVsShowing = tellingCount / Math.max(actionWords, 1);
|
|
153
|
+
// Sensory details
|
|
154
|
+
const sensoryWords = ['saw', 'heard', 'smelled', 'tasted', 'touched', 'felt',
|
|
155
|
+
'bright', 'dark', 'loud', 'quiet', 'soft', 'hard', 'sweet', 'bitter'];
|
|
156
|
+
const sensoryCount = words.filter(w => sensoryWords.some(s => w.includes(s))).length;
|
|
157
|
+
const sensoryDetails = sensoryCount / sentences.length > 1 ? 'rich' :
|
|
158
|
+
sensoryCount / sentences.length > 0.5 ? 'adequate' : 'lacking';
|
|
159
|
+
// White space
|
|
160
|
+
const paragraphs = content.split(/\n\n+/);
|
|
161
|
+
const avgParagraphLength = content.length / paragraphs.length;
|
|
162
|
+
const whiteSpace = avgParagraphLength < 200 ? 'balanced' :
|
|
163
|
+
avgParagraphLength < 500 ? 'balanced' :
|
|
164
|
+
avgParagraphLength < 1000 ? 'cramped' : 'cramped';
|
|
165
|
+
return {
|
|
166
|
+
repetitiveness,
|
|
167
|
+
cliches: foundClichés,
|
|
168
|
+
filterWords: foundFilterWords,
|
|
169
|
+
tellingVsShowing,
|
|
170
|
+
sensoryDetails,
|
|
171
|
+
whiteSpace
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
generateSuggestions(_content, metrics, style, quality) {
|
|
175
|
+
const suggestions = [];
|
|
176
|
+
// Sentence length suggestions
|
|
177
|
+
if (metrics.averageSentenceLength > 25) {
|
|
178
|
+
suggestions.push({
|
|
179
|
+
type: 'style',
|
|
180
|
+
severity: 'moderate',
|
|
181
|
+
issue: 'Long average sentence length',
|
|
182
|
+
suggestion: 'Consider breaking up longer sentences for better readability.',
|
|
183
|
+
example: 'Split compound sentences at conjunctions like "and" or "but".'
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
// Adverb usage
|
|
187
|
+
if (style.adverbUsage === 'heavy') {
|
|
188
|
+
suggestions.push({
|
|
189
|
+
type: 'style',
|
|
190
|
+
severity: 'minor',
|
|
191
|
+
issue: 'Heavy adverb usage',
|
|
192
|
+
suggestion: 'Replace adverbs with stronger verbs for more impactful writing.',
|
|
193
|
+
example: 'Instead of "walked quickly", use "hurried" or "rushed".'
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
// Passive voice
|
|
197
|
+
if (style.passiveVoicePercentage > 20) {
|
|
198
|
+
suggestions.push({
|
|
199
|
+
type: 'clarity',
|
|
200
|
+
severity: 'moderate',
|
|
201
|
+
issue: 'High passive voice usage',
|
|
202
|
+
suggestion: 'Convert passive constructions to active voice for more engaging prose.',
|
|
203
|
+
example: 'Change "The ball was thrown by John" to "John threw the ball".'
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
// Repetitiveness
|
|
207
|
+
if (quality.repetitiveness > 30) {
|
|
208
|
+
suggestions.push({
|
|
209
|
+
type: 'style',
|
|
210
|
+
severity: 'major',
|
|
211
|
+
issue: 'Repetitive word patterns detected',
|
|
212
|
+
suggestion: 'Vary your word choice and sentence structure to improve flow.',
|
|
213
|
+
example: 'Use synonyms and restructure similar sentences.'
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
// Filter words
|
|
217
|
+
if (quality.filterWords.length > 5) {
|
|
218
|
+
suggestions.push({
|
|
219
|
+
type: 'impact',
|
|
220
|
+
severity: 'minor',
|
|
221
|
+
issue: `Filter words weakening prose: ${quality.filterWords.slice(0, 5).join(', ')}`,
|
|
222
|
+
suggestion: 'Remove or replace filter words for more direct, impactful writing.',
|
|
223
|
+
example: 'Instead of "He thought it was strange", write "It was strange".'
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
// Clichés
|
|
227
|
+
if (quality.cliches.length > 0) {
|
|
228
|
+
suggestions.push({
|
|
229
|
+
type: 'style',
|
|
230
|
+
severity: 'moderate',
|
|
231
|
+
issue: `Clichés detected: ${quality.cliches.join(', ')}`,
|
|
232
|
+
suggestion: 'Replace clichés with fresh, original descriptions.',
|
|
233
|
+
example: 'Create unique metaphors that fit your story\'s voice.'
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
// Telling vs showing
|
|
237
|
+
if (quality.tellingVsShowing > 0.3) {
|
|
238
|
+
suggestions.push({
|
|
239
|
+
type: 'impact',
|
|
240
|
+
severity: 'major',
|
|
241
|
+
issue: 'High ratio of telling vs showing',
|
|
242
|
+
suggestion: 'Show character emotions and reactions through actions and dialogue.',
|
|
243
|
+
example: 'Instead of "She was angry", write "She slammed the door, her hands trembling".'
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
// Sensory details
|
|
247
|
+
if (quality.sensoryDetails === 'lacking') {
|
|
248
|
+
suggestions.push({
|
|
249
|
+
type: 'impact',
|
|
250
|
+
severity: 'moderate',
|
|
251
|
+
issue: 'Lacking sensory details',
|
|
252
|
+
suggestion: 'Add sight, sound, smell, taste, and touch descriptions to immerse readers.',
|
|
253
|
+
example: 'Describe the environment using multiple senses.'
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
return suggestions;
|
|
257
|
+
}
|
|
258
|
+
analyzeEmotions(content) {
|
|
259
|
+
// Simplified emotion detection
|
|
260
|
+
const emotionWords = {
|
|
261
|
+
joy: ['happy', 'joy', 'excited', 'delighted', 'cheerful', 'pleased'],
|
|
262
|
+
sadness: ['sad', 'depressed', 'miserable', 'sorrowful', 'grief', 'melancholy'],
|
|
263
|
+
anger: ['angry', 'furious', 'rage', 'irritated', 'annoyed', 'mad'],
|
|
264
|
+
fear: ['afraid', 'scared', 'terrified', 'anxious', 'worried', 'nervous'],
|
|
265
|
+
surprise: ['surprised', 'shocked', 'amazed', 'astonished', 'stunned'],
|
|
266
|
+
disgust: ['disgusted', 'revolted', 'repulsed', 'sickened']
|
|
267
|
+
};
|
|
268
|
+
const words = content.toLowerCase().split(/\s+/);
|
|
269
|
+
const emotionCounts = new Map();
|
|
270
|
+
for (const [emotion, keywords] of Object.entries(emotionWords)) {
|
|
271
|
+
const count = words.filter(w => keywords.some(k => w.includes(k))).length;
|
|
272
|
+
if (count > 0)
|
|
273
|
+
emotionCounts.set(emotion, count);
|
|
274
|
+
}
|
|
275
|
+
const dominantEmotion = Array.from(emotionCounts.entries())
|
|
276
|
+
.sort((a, b) => b[1] - a[1])[0]?.[0] || 'neutral';
|
|
277
|
+
// Simplified emotional arc
|
|
278
|
+
const segments = this.splitIntoSegments(content, 5);
|
|
279
|
+
const emotionalArc = segments.map((segment, index) => {
|
|
280
|
+
const segmentEmotions = this.detectSegmentEmotion(segment, emotionWords);
|
|
281
|
+
return {
|
|
282
|
+
position: (index + 1) / segments.length,
|
|
283
|
+
emotion: segmentEmotions.emotion,
|
|
284
|
+
intensity: segmentEmotions.intensity
|
|
285
|
+
};
|
|
286
|
+
});
|
|
287
|
+
// Tension level (based on conflict words)
|
|
288
|
+
const tensionWords = ['conflict', 'struggle', 'fight', 'battle', 'tension', 'pressure'];
|
|
289
|
+
const tensionCount = words.filter(w => tensionWords.some(t => w.includes(t))).length;
|
|
290
|
+
const sentenceCount = content.split(/[.!?]+/).filter(s => s.trim().length > 0).length;
|
|
291
|
+
const tensionLevel = Math.min((tensionCount / sentenceCount) * 100, 100);
|
|
292
|
+
return {
|
|
293
|
+
dominantEmotion,
|
|
294
|
+
emotionalArc,
|
|
295
|
+
tensionLevel,
|
|
296
|
+
moodConsistency: 75 // Simplified
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
analyzePacing(content) {
|
|
300
|
+
// const paragraphs = content.split(/\n\n+/);
|
|
301
|
+
const sentences = content.split(/[.!?]+/);
|
|
302
|
+
// Analyze sentence lengths for pacing
|
|
303
|
+
const sentenceLengths = sentences.map(s => s.split(/\s+/).length);
|
|
304
|
+
const avgLength = sentenceLengths.reduce((a, b) => a + b, 0) / sentenceLengths.length;
|
|
305
|
+
// Determine overall pacing
|
|
306
|
+
const overall = avgLength < 10 ? 'fast' :
|
|
307
|
+
avgLength < 15 ? 'moderate' :
|
|
308
|
+
avgLength < 20 ? 'moderate' : 'slow';
|
|
309
|
+
// Analyze sections
|
|
310
|
+
const sections = this.splitIntoSegments(content, 3).map((segment, index) => {
|
|
311
|
+
const segmentSentences = segment.split(/[.!?]+/);
|
|
312
|
+
const segmentAvg = segmentSentences.map(s => s.split(/\s+/).length)
|
|
313
|
+
.reduce((a, b) => a + b, 0) / segmentSentences.length;
|
|
314
|
+
return {
|
|
315
|
+
start: index * (100 / 3),
|
|
316
|
+
end: (index + 1) * (100 / 3),
|
|
317
|
+
pace: segmentAvg < 10 ? 'fast' :
|
|
318
|
+
segmentAvg < 20 ? 'moderate' : 'slow'
|
|
319
|
+
};
|
|
320
|
+
});
|
|
321
|
+
// Action vs reflection ratio
|
|
322
|
+
const actionWords = ['ran', 'jumped', 'grabbed', 'pushed', 'pulled', 'struck'];
|
|
323
|
+
const reflectionWords = ['thought', 'considered', 'pondered', 'reflected', 'remembered'];
|
|
324
|
+
const words = content.toLowerCase().split(/\s+/);
|
|
325
|
+
const actionCount = words.filter(w => actionWords.some(a => w.includes(a))).length;
|
|
326
|
+
const reflectionCount = words.filter(w => reflectionWords.some(r => w.includes(r))).length;
|
|
327
|
+
const actionVsReflection = actionCount / Math.max(reflectionCount, 1);
|
|
328
|
+
// Recommendations
|
|
329
|
+
const recommendedAdjustments = [];
|
|
330
|
+
if (overall === 'slow') {
|
|
331
|
+
recommendedAdjustments.push('Consider shortening sentences and paragraphs to increase pace');
|
|
332
|
+
}
|
|
333
|
+
if (actionVsReflection < 0.5) {
|
|
334
|
+
recommendedAdjustments.push('Add more action sequences to balance reflection');
|
|
335
|
+
}
|
|
336
|
+
if (sections.every(s => s.pace === sections[0].pace)) {
|
|
337
|
+
recommendedAdjustments.push('Vary pacing between sections for better rhythm');
|
|
338
|
+
}
|
|
339
|
+
return {
|
|
340
|
+
overall: overall,
|
|
341
|
+
sections,
|
|
342
|
+
actionVsReflection,
|
|
343
|
+
recommendedAdjustments
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
// Helper methods
|
|
347
|
+
countSyllables(words) {
|
|
348
|
+
return words.reduce((count, word) => {
|
|
349
|
+
word = word.toLowerCase().replace(/[^a-z]/g, '');
|
|
350
|
+
let syllables = 0;
|
|
351
|
+
let previousWasVowel = false;
|
|
352
|
+
for (let i = 0; i < word.length; i++) {
|
|
353
|
+
const isVowel = /[aeiou]/.test(word[i]);
|
|
354
|
+
if (isVowel && !previousWasVowel)
|
|
355
|
+
syllables++;
|
|
356
|
+
previousWasVowel = isVowel;
|
|
357
|
+
}
|
|
358
|
+
// Adjustments
|
|
359
|
+
if (word.endsWith('e'))
|
|
360
|
+
syllables--;
|
|
361
|
+
if (word.endsWith('le') && word.length > 2)
|
|
362
|
+
syllables++;
|
|
363
|
+
if (syllables === 0)
|
|
364
|
+
syllables = 1;
|
|
365
|
+
return count + syllables;
|
|
366
|
+
}, 0);
|
|
367
|
+
}
|
|
368
|
+
calculateReadability(words, sentences, syllables) {
|
|
369
|
+
const avgSyllablesPerWord = syllables / words;
|
|
370
|
+
const avgWordsPerSentence = words / sentences;
|
|
371
|
+
const fleschReadingEase = 206.835 - 1.015 * avgWordsPerSentence - 84.6 * avgSyllablesPerWord;
|
|
372
|
+
const fleschKincaidGrade = 0.39 * avgWordsPerSentence + 11.8 * avgSyllablesPerWord - 15.59;
|
|
373
|
+
return {
|
|
374
|
+
fleschReadingEase: Math.max(0, Math.min(100, fleschReadingEase)),
|
|
375
|
+
fleschKincaidGrade: Math.max(0, fleschKincaidGrade)
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
calculateVariance(numbers) {
|
|
379
|
+
const mean = numbers.reduce((a, b) => a + b, 0) / numbers.length;
|
|
380
|
+
const squaredDifferences = numbers.map(n => Math.pow(n - mean, 2));
|
|
381
|
+
return squaredDifferences.reduce((a, b) => a + b, 0) / numbers.length;
|
|
382
|
+
}
|
|
383
|
+
assessOpeningStrength(paragraph) {
|
|
384
|
+
if (!paragraph)
|
|
385
|
+
return 'weak';
|
|
386
|
+
const hasHook = this.detectHook(paragraph);
|
|
387
|
+
const hasAction = /\b(ran|jumped|crashed|exploded|screamed)\b/i.test(paragraph);
|
|
388
|
+
const hasDialogue = paragraph.includes('"') || paragraph.includes("'");
|
|
389
|
+
const isShort = paragraph.length < 200;
|
|
390
|
+
const strength = [hasHook, hasAction, hasDialogue, isShort].filter(Boolean).length;
|
|
391
|
+
return strength >= 3 ? 'strong' : strength >= 2 ? 'moderate' : 'weak';
|
|
392
|
+
}
|
|
393
|
+
assessEndingStrength(paragraph) {
|
|
394
|
+
if (!paragraph)
|
|
395
|
+
return 'weak';
|
|
396
|
+
const hasResolution = /\b(finally|resolved|ended|complete|finished)\b/i.test(paragraph);
|
|
397
|
+
const hasCliffhanger = paragraph.endsWith('?') || /\b(but|however|suddenly)\b/i.test(paragraph.slice(-50));
|
|
398
|
+
const hasImpact = paragraph.length < 150;
|
|
399
|
+
const strength = [hasResolution || hasCliffhanger, hasImpact].filter(Boolean).length;
|
|
400
|
+
return strength === 2 ? 'strong' : strength === 1 ? 'moderate' : 'weak';
|
|
401
|
+
}
|
|
402
|
+
detectHook(text) {
|
|
403
|
+
const hookPatterns = [
|
|
404
|
+
/^"[^"]+"/, // Opens with dialogue
|
|
405
|
+
/^\w+\s+(ran|jumped|crashed|fell|screamed)/i, // Opens with action
|
|
406
|
+
/^(The|A)\s+\w+\s+was\s+dead/i, // Opens with shocking statement
|
|
407
|
+
/\?$/ // Opens with question
|
|
408
|
+
];
|
|
409
|
+
return hookPatterns.some(pattern => pattern.test(text.slice(0, 100)));
|
|
410
|
+
}
|
|
411
|
+
countCliffhangers(paragraphs) {
|
|
412
|
+
return paragraphs.filter(p => {
|
|
413
|
+
const lastSentence = p.split(/[.!?]/).slice(-1)[0];
|
|
414
|
+
return lastSentence && (lastSentence.includes('?') ||
|
|
415
|
+
/\b(but|however|suddenly|then)\b/i.test(lastSentence));
|
|
416
|
+
}).length;
|
|
417
|
+
}
|
|
418
|
+
splitIntoSegments(content, count) {
|
|
419
|
+
const segmentLength = Math.ceil(content.length / count);
|
|
420
|
+
const segments = [];
|
|
421
|
+
for (let i = 0; i < count; i++) {
|
|
422
|
+
segments.push(content.slice(i * segmentLength, (i + 1) * segmentLength));
|
|
423
|
+
}
|
|
424
|
+
return segments;
|
|
425
|
+
}
|
|
426
|
+
detectSegmentEmotion(segment, emotionWords) {
|
|
427
|
+
const words = segment.toLowerCase().split(/\s+/);
|
|
428
|
+
let maxEmotion = 'neutral';
|
|
429
|
+
let maxCount = 0;
|
|
430
|
+
for (const [emotion, keywords] of Object.entries(emotionWords)) {
|
|
431
|
+
const count = words.filter(w => keywords.some(k => w.includes(k))).length;
|
|
432
|
+
if (count > maxCount) {
|
|
433
|
+
maxCount = count;
|
|
434
|
+
maxEmotion = emotion;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
return {
|
|
438
|
+
emotion: maxEmotion,
|
|
439
|
+
intensity: Math.min((maxCount / words.length) * 100, 100)
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
//# sourceMappingURL=content-analyzer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-analyzer.js","sourceRoot":"","sources":["../src/content-analyzer.ts"],"names":[],"mappings":"AAAA,mEAAmE;AA8EnE,MAAM,O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