@bernierllc/content-workflow-ai-review-step 0.8.3 → 0.8.6
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/dist/ai-review-step.d.ts +45 -0
- package/dist/ai-review-step.d.ts.map +1 -0
- package/dist/ai-review-step.js +224 -0
- package/dist/ai-review-step.js.map +1 -0
- package/dist/errors.d.ts +12 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +21 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/prompt-builder.d.ts +25 -0
- package/dist/prompt-builder.d.ts.map +1 -0
- package/dist/prompt-builder.js +162 -0
- package/dist/prompt-builder.js.map +1 -0
- package/dist/response-parser.d.ts +13 -0
- package/dist/response-parser.d.ts.map +1 -0
- package/dist/response-parser.js +277 -0
- package/dist/response-parser.js.map +1 -0
- package/dist/scoring.d.ts +54 -0
- package/dist/scoring.d.ts.map +1 -0
- package/dist/scoring.js +174 -0
- package/dist/scoring.js.map +1 -0
- package/dist/types.d.ts +205 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +32 -0
- package/dist/types.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2025 Bernier LLC
|
|
3
|
+
|
|
4
|
+
This file is licensed to the client under a limited-use license.
|
|
5
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
6
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
7
|
+
*/
|
|
8
|
+
import { calculateOverallScore } from './scoring.js';
|
|
9
|
+
/**
|
|
10
|
+
* Parse AI response into structured review result
|
|
11
|
+
*/
|
|
12
|
+
export function parseReviewResponse(responseContent, provider, model, tokensUsed, costUsd) {
|
|
13
|
+
try {
|
|
14
|
+
// Clean the response - remove markdown code fences if present
|
|
15
|
+
const cleanedContent = cleanResponseContent(responseContent);
|
|
16
|
+
// Parse JSON
|
|
17
|
+
const parsed = JSON.parse(cleanedContent);
|
|
18
|
+
// Validate and extract data
|
|
19
|
+
const scores = parseScores(parsed.scores);
|
|
20
|
+
const suggestions = parseSuggestions(parsed.suggestions || []);
|
|
21
|
+
const summary = parseSummary(parsed.summary);
|
|
22
|
+
// Use provided overall score or calculate from category scores
|
|
23
|
+
const overallScore = typeof parsed.overallScore === 'number'
|
|
24
|
+
? clampScore(parsed.overallScore)
|
|
25
|
+
: calculateOverallScore(scores);
|
|
26
|
+
return {
|
|
27
|
+
overallScore,
|
|
28
|
+
scores,
|
|
29
|
+
suggestions,
|
|
30
|
+
summary,
|
|
31
|
+
provider,
|
|
32
|
+
model,
|
|
33
|
+
tokensUsed,
|
|
34
|
+
costUsd,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
// If parsing fails, return a fallback result
|
|
39
|
+
return createFallbackResult(error instanceof Error ? error.message : 'Unknown parsing error', provider, model, tokensUsed, costUsd);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Clean response content by removing markdown code fences and extra whitespace
|
|
44
|
+
*/
|
|
45
|
+
function cleanResponseContent(content) {
|
|
46
|
+
let cleaned = content.trim();
|
|
47
|
+
// Remove markdown code fences
|
|
48
|
+
cleaned = cleaned.replace(/^```json\s*/i, '');
|
|
49
|
+
cleaned = cleaned.replace(/^```\s*/i, '');
|
|
50
|
+
cleaned = cleaned.replace(/\s*```\s*$/i, '');
|
|
51
|
+
// Try to find JSON object if there's extra text
|
|
52
|
+
const jsonMatch = cleaned.match(/\{[\s\S]*\}/);
|
|
53
|
+
if (jsonMatch) {
|
|
54
|
+
cleaned = jsonMatch[0];
|
|
55
|
+
}
|
|
56
|
+
return cleaned.trim();
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Parse and validate scores object
|
|
60
|
+
*/
|
|
61
|
+
function parseScores(scoresData) {
|
|
62
|
+
const defaultScores = {
|
|
63
|
+
grammar: 50,
|
|
64
|
+
seo: 50,
|
|
65
|
+
tone: 50,
|
|
66
|
+
engagement: 50,
|
|
67
|
+
readability: 50,
|
|
68
|
+
};
|
|
69
|
+
if (!scoresData || typeof scoresData !== 'object') {
|
|
70
|
+
return defaultScores;
|
|
71
|
+
}
|
|
72
|
+
const scores = scoresData;
|
|
73
|
+
return {
|
|
74
|
+
grammar: parseScore(scores.grammar, defaultScores.grammar),
|
|
75
|
+
seo: parseScore(scores.seo, defaultScores.seo),
|
|
76
|
+
tone: parseScore(scores.tone, defaultScores.tone),
|
|
77
|
+
engagement: parseScore(scores.engagement, defaultScores.engagement),
|
|
78
|
+
readability: parseScore(scores.readability, defaultScores.readability),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Parse and validate a single score value
|
|
83
|
+
*/
|
|
84
|
+
function parseScore(value, defaultValue) {
|
|
85
|
+
if (typeof value === 'number') {
|
|
86
|
+
return clampScore(value);
|
|
87
|
+
}
|
|
88
|
+
if (typeof value === 'string') {
|
|
89
|
+
const parsed = parseFloat(value);
|
|
90
|
+
if (!isNaN(parsed)) {
|
|
91
|
+
return clampScore(parsed);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return defaultValue;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Clamp a score to valid range (0-100)
|
|
98
|
+
*/
|
|
99
|
+
function clampScore(score) {
|
|
100
|
+
return Math.max(0, Math.min(100, Math.round(score)));
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Parse suggestions array
|
|
104
|
+
*/
|
|
105
|
+
function parseSuggestions(suggestionsData) {
|
|
106
|
+
if (!Array.isArray(suggestionsData)) {
|
|
107
|
+
return [];
|
|
108
|
+
}
|
|
109
|
+
return suggestionsData
|
|
110
|
+
.map((item) => parseSingleSuggestion(item))
|
|
111
|
+
.filter((suggestion) => suggestion !== null);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Parse a single suggestion object
|
|
115
|
+
*/
|
|
116
|
+
function parseSingleSuggestion(data) {
|
|
117
|
+
if (!data || typeof data !== 'object') {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
const suggestion = data;
|
|
121
|
+
// Required fields
|
|
122
|
+
const type = parseSuggestionType(suggestion.type);
|
|
123
|
+
const severity = parseSeverityLevel(suggestion.severity);
|
|
124
|
+
const original = parseString(suggestion.original);
|
|
125
|
+
const suggestionText = parseString(suggestion.suggestion);
|
|
126
|
+
const reason = parseString(suggestion.reason);
|
|
127
|
+
if (!type || !severity || !original || !suggestionText || !reason) {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
// Optional location
|
|
131
|
+
const location = suggestion.location
|
|
132
|
+
? parseLocation(suggestion.location)
|
|
133
|
+
: undefined;
|
|
134
|
+
// Optional accepted flag
|
|
135
|
+
const accepted = typeof suggestion.accepted === 'boolean' ? suggestion.accepted : undefined;
|
|
136
|
+
return {
|
|
137
|
+
type,
|
|
138
|
+
severity,
|
|
139
|
+
original,
|
|
140
|
+
suggestion: suggestionText,
|
|
141
|
+
reason,
|
|
142
|
+
location,
|
|
143
|
+
accepted,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Parse suggestion type
|
|
148
|
+
*/
|
|
149
|
+
function parseSuggestionType(value) {
|
|
150
|
+
const validTypes = [
|
|
151
|
+
'grammar',
|
|
152
|
+
'seo',
|
|
153
|
+
'tone',
|
|
154
|
+
'engagement',
|
|
155
|
+
'readability',
|
|
156
|
+
'clarity',
|
|
157
|
+
];
|
|
158
|
+
if (typeof value === 'string' && validTypes.includes(value)) {
|
|
159
|
+
return value;
|
|
160
|
+
}
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Parse severity level
|
|
165
|
+
*/
|
|
166
|
+
function parseSeverityLevel(value) {
|
|
167
|
+
const validLevels = ['critical', 'warning', 'suggestion'];
|
|
168
|
+
if (typeof value === 'string' && validLevels.includes(value)) {
|
|
169
|
+
return value;
|
|
170
|
+
}
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Parse location object
|
|
175
|
+
*/
|
|
176
|
+
function parseLocation(data) {
|
|
177
|
+
if (!data || typeof data !== 'object') {
|
|
178
|
+
return undefined;
|
|
179
|
+
}
|
|
180
|
+
const loc = data;
|
|
181
|
+
return {
|
|
182
|
+
line: typeof loc.line === 'number' ? Math.max(1, loc.line) : undefined,
|
|
183
|
+
column: typeof loc.column === 'number' ? Math.max(1, loc.column) : undefined,
|
|
184
|
+
offset: typeof loc.offset === 'number' ? Math.max(0, loc.offset) : undefined,
|
|
185
|
+
length: typeof loc.length === 'number' ? Math.max(1, loc.length) : undefined,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Parse string value
|
|
190
|
+
*/
|
|
191
|
+
function parseString(value) {
|
|
192
|
+
if (typeof value === 'string') {
|
|
193
|
+
return value.trim();
|
|
194
|
+
}
|
|
195
|
+
return '';
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Parse summary text
|
|
199
|
+
*/
|
|
200
|
+
function parseSummary(value) {
|
|
201
|
+
if (typeof value === 'string' && value.trim().length > 0) {
|
|
202
|
+
return value.trim();
|
|
203
|
+
}
|
|
204
|
+
return 'AI review completed';
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Create a fallback result when parsing fails
|
|
208
|
+
*/
|
|
209
|
+
function createFallbackResult(errorMessage, provider, model, tokensUsed, costUsd) {
|
|
210
|
+
return {
|
|
211
|
+
overallScore: 0,
|
|
212
|
+
scores: {
|
|
213
|
+
grammar: 0,
|
|
214
|
+
seo: 0,
|
|
215
|
+
tone: 0,
|
|
216
|
+
engagement: 0,
|
|
217
|
+
readability: 0,
|
|
218
|
+
},
|
|
219
|
+
suggestions: [
|
|
220
|
+
{
|
|
221
|
+
type: 'clarity',
|
|
222
|
+
severity: 'critical',
|
|
223
|
+
original: 'AI response parsing',
|
|
224
|
+
suggestion: 'Failed to parse AI response',
|
|
225
|
+
reason: `Response parsing error: ${errorMessage}`,
|
|
226
|
+
},
|
|
227
|
+
],
|
|
228
|
+
summary: `Failed to parse AI response: ${errorMessage}`,
|
|
229
|
+
provider,
|
|
230
|
+
model,
|
|
231
|
+
tokensUsed,
|
|
232
|
+
costUsd,
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Validate that a parsed result is well-formed
|
|
237
|
+
*/
|
|
238
|
+
export function validateReviewResult(result) {
|
|
239
|
+
const errors = [];
|
|
240
|
+
// Check overall score
|
|
241
|
+
if (result.overallScore < 0 || result.overallScore > 100) {
|
|
242
|
+
errors.push('Overall score must be between 0 and 100');
|
|
243
|
+
}
|
|
244
|
+
// Check category scores
|
|
245
|
+
const scoreKeys = [
|
|
246
|
+
'grammar',
|
|
247
|
+
'seo',
|
|
248
|
+
'tone',
|
|
249
|
+
'engagement',
|
|
250
|
+
'readability',
|
|
251
|
+
];
|
|
252
|
+
for (const key of scoreKeys) {
|
|
253
|
+
const score = result.scores[key];
|
|
254
|
+
if (score < 0 || score > 100) {
|
|
255
|
+
errors.push(`${key} score must be between 0 and 100`);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
// Check suggestions
|
|
259
|
+
if (!Array.isArray(result.suggestions)) {
|
|
260
|
+
errors.push('Suggestions must be an array');
|
|
261
|
+
}
|
|
262
|
+
// Check required strings
|
|
263
|
+
if (!result.summary || result.summary.trim().length === 0) {
|
|
264
|
+
errors.push('Summary is required');
|
|
265
|
+
}
|
|
266
|
+
if (!result.provider || result.provider.trim().length === 0) {
|
|
267
|
+
errors.push('Provider is required');
|
|
268
|
+
}
|
|
269
|
+
if (!result.model || result.model.trim().length === 0) {
|
|
270
|
+
errors.push('Model is required');
|
|
271
|
+
}
|
|
272
|
+
return {
|
|
273
|
+
valid: errors.length === 0,
|
|
274
|
+
errors,
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
//# sourceMappingURL=response-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response-parser.js","sourceRoot":"","sources":["../src/response-parser.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AASF,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAErD;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,eAAuB,EACvB,QAAgB,EAChB,KAAa,EACb,UAAkB,EAClB,OAAe;IAEf,IAAI,CAAC;QACH,8DAA8D;QAC9D,MAAM,cAAc,GAAG,oBAAoB,CAAC,eAAe,CAAC,CAAC;QAE7D,aAAa;QACb,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QAE1C,4BAA4B;QAC5B,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC1C,MAAM,WAAW,GAAG,gBAAgB,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC;QAC/D,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAE7C,+DAA+D;QAC/D,MAAM,YAAY,GAChB,OAAO,MAAM,CAAC,YAAY,KAAK,QAAQ;YACrC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC;YACjC,CAAC,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;QAEpC,OAAO;YACL,YAAY;YACZ,MAAM;YACN,WAAW;YACX,OAAO;YACP,QAAQ;YACR,KAAK;YACL,UAAU;YACV,OAAO;SACR,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,6CAA6C;QAC7C,OAAO,oBAAoB,CACzB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAA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
|
|
2
|
+
/**
|
|
3
|
+
* Calculate overall score from category scores
|
|
4
|
+
* Uses weighted average based on importance
|
|
5
|
+
*/
|
|
6
|
+
export declare function calculateOverallScore(scores: ReviewScores): number;
|
|
7
|
+
/**
|
|
8
|
+
* Calculate a simple average of all category scores
|
|
9
|
+
*/
|
|
10
|
+
export declare function calculateSimpleAverage(scores: ReviewScores): number;
|
|
11
|
+
/**
|
|
12
|
+
* Determine quality level from overall score
|
|
13
|
+
*/
|
|
14
|
+
export declare function getQualityLevel(score: number): {
|
|
15
|
+
level: 'excellent' | 'good' | 'fair' | 'poor' | 'critical';
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Calculate score improvement potential
|
|
20
|
+
*/
|
|
21
|
+
export declare function calculateImprovementPotential(currentScore: number, targetScore?: number): {
|
|
22
|
+
potential: number;
|
|
23
|
+
effort: 'low' | 'medium' | 'high';
|
|
24
|
+
achievable: boolean;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Compare two score sets and calculate improvement
|
|
28
|
+
*/
|
|
29
|
+
export declare function compareScores(oldScores: ReviewScores, newScores: ReviewScores): {
|
|
30
|
+
overall: number;
|
|
31
|
+
byCategory: Record<keyof ReviewScores, number>;
|
|
32
|
+
improved: boolean;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Get the weakest category that needs most improvement
|
|
36
|
+
*/
|
|
37
|
+
export declare function getWeakestCategory(scores: ReviewScores): {
|
|
38
|
+
category: keyof ReviewScores;
|
|
39
|
+
score: number;
|
|
40
|
+
priority: 'high' | 'medium' | 'low';
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Get the strongest category
|
|
44
|
+
*/
|
|
45
|
+
export declare function getStrongestCategory(scores: ReviewScores): {
|
|
46
|
+
category: keyof ReviewScores;
|
|
47
|
+
score: number;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Calculate consistency score across categories
|
|
51
|
+
* Returns 100 if all scores are similar, lower if there's high variance
|
|
52
|
+
*/
|
|
53
|
+
export declare function calculateConsistencyScore(scores: ReviewScores): number;
|
|
54
|
+
//# sourceMappingURL=scoring.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoring.d.ts","sourceRoot":"","sources":["../src/scoring.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAiBlE;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CASnE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG;IAC9C,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;IAC3D,WAAW,EAAE,MAAM,CAAC;CACrB,CAiCA;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAC3C,YAAY,EAAE,MAAM,EACpB,WAAW,GAAE,MAAW,GACvB;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IAClC,UAAU,EAAE,OAAO,CAAC;CACrB,CAqBA;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,YAAY,EACvB,SAAS,EAAE,YAAY,GACtB;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC,MAAM,YAAY,EAAE,MAAM,CAAC,CAAC;IAC/C,QAAQ,EAAE,OAAO,CAAC;CACnB,CAeA;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG;IACxD,QAAQ,EAAE,MAAM,YAAY,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;CACrC,CAuBA;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG;IAC1D,QAAQ,EAAE,MAAM,YAAY,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;CACf,CAcA;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAoBtE"}
|
package/dist/scoring.js
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2025 Bernier LLC
|
|
3
|
+
|
|
4
|
+
This file is licensed to the client under a limited-use license.
|
|
5
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
6
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Calculate overall score from category scores
|
|
10
|
+
* Uses weighted average based on importance
|
|
11
|
+
*/
|
|
12
|
+
export function calculateOverallScore(scores) {
|
|
13
|
+
const weights = {
|
|
14
|
+
grammar: 0.25, // 25% - Critical for credibility
|
|
15
|
+
seo: 0.15, // 15% - Important for discoverability
|
|
16
|
+
tone: 0.20, // 20% - Important for brand alignment
|
|
17
|
+
engagement: 0.20, // 20% - Important for effectiveness
|
|
18
|
+
readability: 0.20, // 20% - Important for accessibility
|
|
19
|
+
};
|
|
20
|
+
const weightedSum = scores.grammar * weights.grammar +
|
|
21
|
+
scores.seo * weights.seo +
|
|
22
|
+
scores.tone * weights.tone +
|
|
23
|
+
scores.engagement * weights.engagement +
|
|
24
|
+
scores.readability * weights.readability;
|
|
25
|
+
return Math.round(weightedSum);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Calculate a simple average of all category scores
|
|
29
|
+
*/
|
|
30
|
+
export function calculateSimpleAverage(scores) {
|
|
31
|
+
const sum = scores.grammar +
|
|
32
|
+
scores.seo +
|
|
33
|
+
scores.tone +
|
|
34
|
+
scores.engagement +
|
|
35
|
+
scores.readability;
|
|
36
|
+
return Math.round(sum / 5);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Determine quality level from overall score
|
|
40
|
+
*/
|
|
41
|
+
export function getQualityLevel(score) {
|
|
42
|
+
if (score >= 90) {
|
|
43
|
+
return {
|
|
44
|
+
level: 'excellent',
|
|
45
|
+
description: 'Outstanding quality with minimal improvements needed',
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
if (score >= 75) {
|
|
49
|
+
return {
|
|
50
|
+
level: 'good',
|
|
51
|
+
description: 'Good quality with minor improvements suggested',
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
if (score >= 60) {
|
|
55
|
+
return {
|
|
56
|
+
level: 'fair',
|
|
57
|
+
description: 'Acceptable quality but significant improvements recommended',
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
if (score >= 40) {
|
|
61
|
+
return {
|
|
62
|
+
level: 'poor',
|
|
63
|
+
description: 'Below acceptable quality, major revisions needed',
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
level: 'critical',
|
|
68
|
+
description: 'Critical quality issues require immediate attention',
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Calculate score improvement potential
|
|
73
|
+
*/
|
|
74
|
+
export function calculateImprovementPotential(currentScore, targetScore = 90) {
|
|
75
|
+
const gap = targetScore - currentScore;
|
|
76
|
+
const potential = Math.max(0, gap);
|
|
77
|
+
let effort;
|
|
78
|
+
if (gap <= 10) {
|
|
79
|
+
effort = 'low';
|
|
80
|
+
}
|
|
81
|
+
else if (gap <= 25) {
|
|
82
|
+
effort = 'medium';
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
effort = 'high';
|
|
86
|
+
}
|
|
87
|
+
// Scores below 40 are very difficult to bring to 90
|
|
88
|
+
const achievable = currentScore >= 40 || targetScore <= 70;
|
|
89
|
+
return {
|
|
90
|
+
potential,
|
|
91
|
+
effort,
|
|
92
|
+
achievable,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Compare two score sets and calculate improvement
|
|
97
|
+
*/
|
|
98
|
+
export function compareScores(oldScores, newScores) {
|
|
99
|
+
const oldOverall = calculateOverallScore(oldScores);
|
|
100
|
+
const newOverall = calculateOverallScore(newScores);
|
|
101
|
+
return {
|
|
102
|
+
overall: newOverall - oldOverall,
|
|
103
|
+
byCategory: {
|
|
104
|
+
grammar: newScores.grammar - oldScores.grammar,
|
|
105
|
+
seo: newScores.seo - oldScores.seo,
|
|
106
|
+
tone: newScores.tone - oldScores.tone,
|
|
107
|
+
engagement: newScores.engagement - oldScores.engagement,
|
|
108
|
+
readability: newScores.readability - oldScores.readability,
|
|
109
|
+
},
|
|
110
|
+
improved: newOverall > oldOverall,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Get the weakest category that needs most improvement
|
|
115
|
+
*/
|
|
116
|
+
export function getWeakestCategory(scores) {
|
|
117
|
+
const entries = [
|
|
118
|
+
['grammar', scores.grammar],
|
|
119
|
+
['seo', scores.seo],
|
|
120
|
+
['tone', scores.tone],
|
|
121
|
+
['engagement', scores.engagement],
|
|
122
|
+
['readability', scores.readability],
|
|
123
|
+
];
|
|
124
|
+
entries.sort((a, b) => a[1] - b[1]);
|
|
125
|
+
const [category, score] = entries[0];
|
|
126
|
+
let priority;
|
|
127
|
+
if (score < 50) {
|
|
128
|
+
priority = 'high';
|
|
129
|
+
}
|
|
130
|
+
else if (score < 70) {
|
|
131
|
+
priority = 'medium';
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
priority = 'low';
|
|
135
|
+
}
|
|
136
|
+
return { category, score, priority };
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Get the strongest category
|
|
140
|
+
*/
|
|
141
|
+
export function getStrongestCategory(scores) {
|
|
142
|
+
const entries = [
|
|
143
|
+
['grammar', scores.grammar],
|
|
144
|
+
['seo', scores.seo],
|
|
145
|
+
['tone', scores.tone],
|
|
146
|
+
['engagement', scores.engagement],
|
|
147
|
+
['readability', scores.readability],
|
|
148
|
+
];
|
|
149
|
+
entries.sort((a, b) => b[1] - a[1]);
|
|
150
|
+
const [category, score] = entries[0];
|
|
151
|
+
return { category, score };
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Calculate consistency score across categories
|
|
155
|
+
* Returns 100 if all scores are similar, lower if there's high variance
|
|
156
|
+
*/
|
|
157
|
+
export function calculateConsistencyScore(scores) {
|
|
158
|
+
const values = [
|
|
159
|
+
scores.grammar,
|
|
160
|
+
scores.seo,
|
|
161
|
+
scores.tone,
|
|
162
|
+
scores.engagement,
|
|
163
|
+
scores.readability,
|
|
164
|
+
];
|
|
165
|
+
const mean = values.reduce((sum, val) => sum + val, 0) / values.length;
|
|
166
|
+
const variance = values.reduce((sum, val) => sum + Math.pow(val - mean, 2), 0) / values.length;
|
|
167
|
+
const stdDev = Math.sqrt(variance);
|
|
168
|
+
// Convert standard deviation to a 0-100 score
|
|
169
|
+
// Lower std dev = higher consistency
|
|
170
|
+
// Std dev of 0 = 100, std dev of 50 = 0
|
|
171
|
+
const consistencyScore = Math.max(0, 100 - (stdDev / 50) * 100);
|
|
172
|
+
return Math.round(consistencyScore);
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=scoring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoring.js","sourceRoot":"","sources":["../src/scoring.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAIF;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAoB;IACxD,MAAM,OAAO,GAAG;QACd,OAAO,EAAE,IAAI,EAAE,iCAAiC;QAChD,GAAG,EAAE,IAAI,EAAE,sCAAsC;QACjD,IAAI,EAAE,IAAI,EAAE,sCAAsC;QAClD,UAAU,EAAE,IAAI,EAAE,oCAAoC;Q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