@bernierllc/content-workflow-ai-review-step 0.1.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.
@@ -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;QACtD,WAAW,EAAE,IAAI,EAAE,oCAAoC;KACxD,CAAC;IAEF,MAAM,WAAW,GACf,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO;QAChC,MAAM,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG;QACxB,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI;Q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AC,CAAC,CAAC;IAErC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAC7B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,MAAoB;IAC5D,MAAM,MAAM,GAAG;QACb,MAAM,CAAC,OAAO;QACd,MAAM,CAAC,GAAG;QACV,MAAM,CAAC,IAAI;QACX,MAAM,CAAC,UAAU;QACjB,MAAM,CAAC,WAAW;KACnB,CAAC;IAEF,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;IACvE,MAAM,QAAQ,GACZ,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;IAChF,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAEnC,8CAA8C;IAC9C,qCAAqC;IACrC,wCAAwC;IACxC,MAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC;IAEhE,OAAO,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;AACtC,CAAC"}
@@ -0,0 +1,205 @@
1
+ /**
2
+ * Type of suggestion
3
+ */
4
+ export type SuggestionType = 'grammar' | 'seo' | 'tone' | 'engagement' | 'readability' | 'clarity';
5
+ /**
6
+ * Severity level of a suggestion
7
+ */
8
+ export type SeverityLevel = 'critical' | 'warning' | 'suggestion';
9
+ /**
10
+ * Location information for a suggestion in the content
11
+ */
12
+ export interface SuggestionLocation {
13
+ /** Line number (1-based) */
14
+ line?: number;
15
+ /** Column number (1-based) */
16
+ column?: number;
17
+ /** Character offset from start of content (0-based) */
18
+ offset?: number;
19
+ /** Length of the problematic text */
20
+ length?: number;
21
+ }
22
+ /**
23
+ * A single AI review suggestion
24
+ */
25
+ export interface AIReviewSuggestion {
26
+ /** Type of suggestion */
27
+ type: SuggestionType;
28
+ /** Severity level */
29
+ severity: SeverityLevel;
30
+ /** Location in the content */
31
+ location?: SuggestionLocation;
32
+ /** Original text that needs improvement */
33
+ original: string;
34
+ /** Suggested replacement text */
35
+ suggestion: string;
36
+ /** Reason for the suggestion */
37
+ reason: string;
38
+ /** Whether the user has accepted this suggestion */
39
+ accepted?: boolean;
40
+ }
41
+ /**
42
+ * Category scores for the review
43
+ */
44
+ export interface ReviewScores {
45
+ /** Grammar score (0-100) */
46
+ grammar: number;
47
+ /** SEO optimization score (0-100) */
48
+ seo: number;
49
+ /** Tone consistency score (0-100) */
50
+ tone: number;
51
+ /** Engagement potential score (0-100) */
52
+ engagement: number;
53
+ /** Readability score (0-100) */
54
+ readability: number;
55
+ }
56
+ /**
57
+ * Complete AI review result
58
+ */
59
+ export interface AIReviewResult {
60
+ /** Overall quality score (0-100) */
61
+ overallScore: number;
62
+ /** Scores by category */
63
+ scores: ReviewScores;
64
+ /** List of suggestions for improvement */
65
+ suggestions: AIReviewSuggestion[];
66
+ /** Summary of the review */
67
+ summary: string;
68
+ /** AI provider used (e.g., 'openai', 'anthropic') */
69
+ provider: string;
70
+ /** Model used (e.g., 'gpt-4', 'claude-3-opus') */
71
+ model: string;
72
+ /** Total tokens used in the request */
73
+ tokensUsed: number;
74
+ /** Estimated cost in USD */
75
+ costUsd: number;
76
+ }
77
+ /**
78
+ * Workflow step configuration (minimal interface for this step)
79
+ */
80
+ export interface WorkflowStepConfig {
81
+ /** Unique step identifier */
82
+ id: string;
83
+ /** Step name */
84
+ name: string;
85
+ /** Step type (must be 'ai_review' for this step) */
86
+ type: string;
87
+ /** Whether the step is enabled */
88
+ enabled: boolean;
89
+ /** Execution order */
90
+ order: number;
91
+ /** AI configuration */
92
+ aiConfig?: {
93
+ /** AI provider to use (e.g., 'openai', 'anthropic', 'auto') */
94
+ provider?: string;
95
+ /** Model to use */
96
+ model?: string;
97
+ /** Custom prompt for the review */
98
+ prompt?: string;
99
+ /** Temperature for AI generation (0-1) */
100
+ temperature?: number;
101
+ /** Maximum tokens for the response */
102
+ maxTokens?: number;
103
+ };
104
+ }
105
+ /**
106
+ * Content being reviewed
107
+ */
108
+ export interface WorkflowContent {
109
+ /** Content ID */
110
+ id: string;
111
+ /** Content title */
112
+ title?: string;
113
+ /** Content body */
114
+ body: string;
115
+ /** Additional metadata */
116
+ metadata?: Record<string, unknown>;
117
+ }
118
+ /**
119
+ * Workflow execution context
120
+ */
121
+ export interface WorkflowContext {
122
+ /** The content being processed */
123
+ content: WorkflowContent;
124
+ /** User who initiated the workflow */
125
+ userId?: string;
126
+ /** Additional context data */
127
+ metadata?: Record<string, unknown>;
128
+ }
129
+ /**
130
+ * Result of a workflow step execution
131
+ */
132
+ export interface WorkflowStepExecutionResult {
133
+ /** Whether the step succeeded */
134
+ success: boolean;
135
+ /** Step output data */
136
+ data?: AIReviewResult;
137
+ /** Error message if failed */
138
+ error?: string;
139
+ /** Additional metadata about execution */
140
+ metadata?: {
141
+ /** Provider used */
142
+ provider?: string;
143
+ /** Model used */
144
+ model?: string;
145
+ /** Tokens used */
146
+ tokensUsed?: number;
147
+ /** Cost in USD */
148
+ costUsd?: number;
149
+ /** Execution time in milliseconds */
150
+ durationMs?: number;
151
+ };
152
+ }
153
+ /**
154
+ * Validation result
155
+ */
156
+ export interface ValidationResult {
157
+ /** Whether validation passed */
158
+ valid: boolean;
159
+ /** Validation errors if any */
160
+ errors?: string[];
161
+ }
162
+ /**
163
+ * Step requirements (permissions and dependencies)
164
+ */
165
+ export interface StepRequirements {
166
+ /** Required permissions */
167
+ permissions: string[];
168
+ /** Required dependencies */
169
+ dependencies: string[];
170
+ }
171
+ /**
172
+ * Base workflow step interface
173
+ */
174
+ export interface WorkflowStep {
175
+ /** Unique step identifier */
176
+ readonly id: string;
177
+ /** Step type */
178
+ readonly type: string;
179
+ /**
180
+ * Execute the workflow step
181
+ */
182
+ execute(config: WorkflowStepConfig, context: WorkflowContext): Promise<WorkflowStepExecutionResult>;
183
+ /**
184
+ * Validate step configuration
185
+ */
186
+ validate(config: WorkflowStepConfig): ValidationResult;
187
+ /**
188
+ * Get step requirements
189
+ */
190
+ getRequirements(): StepRequirements;
191
+ }
192
+ /**
193
+ * Base workflow step implementation (stub until content-workflow-step-manager exists)
194
+ */
195
+ export declare abstract class BaseWorkflowStep implements WorkflowStep {
196
+ abstract readonly id: string;
197
+ abstract readonly type: string;
198
+ abstract execute(config: WorkflowStepConfig, context: WorkflowContext): Promise<WorkflowStepExecutionResult>;
199
+ /**
200
+ * Basic validation - checks for required fields
201
+ */
202
+ validate(config: WorkflowStepConfig): ValidationResult;
203
+ abstract getRequirements(): StepRequirements;
204
+ }
205
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,YAAY,GAAG,aAAa,GAAG,SAAS,CAAC;AAEnG;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,SAAS,GAAG,YAAY,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,4BAA4B;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,yBAAyB;IACzB,IAAI,E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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
+ * Base workflow step implementation (stub until content-workflow-step-manager exists)
10
+ */
11
+ export class BaseWorkflowStep {
12
+ /**
13
+ * Basic validation - checks for required fields
14
+ */
15
+ validate(config) {
16
+ const errors = [];
17
+ if (!config.id) {
18
+ errors.push('Step config must have an id');
19
+ }
20
+ if (!config.name) {
21
+ errors.push('Step config must have a name');
22
+ }
23
+ if (!config.type) {
24
+ errors.push('Step config must have a type');
25
+ }
26
+ return {
27
+ valid: errors.length === 0,
28
+ errors: errors.length > 0 ? errors : undefined,
29
+ };
30
+ }
31
+ }
32
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAoNF;;GAEG;AACH,MAAM,OAAgB,gBAAgB;IASpC;;OAEG;IACH,QAAQ,CAAC,MAA0B;QACjC,MAAM,MAAM,GAAa,EAAE,CAAC;QAE5B,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACf,MAAM,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;QAC7C,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACjB,MAAM,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;QAC9C,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACjB,MAAM,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;QAC9C,CAAC;QAED,OAAO;YACL,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;YAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;SAC/C,CAAC;IACJ,CAAC;CAGF"}
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@bernierllc/content-workflow-ai-review-step",
3
+ "version": "0.1.0",
4
+ "description": "AI-powered content review workflow step with grammar, SEO, tone, and engagement analysis",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "type": "module",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "keywords": [
18
+ "workflow",
19
+ "ai",
20
+ "content",
21
+ "review",
22
+ "grammar",
23
+ "seo",
24
+ "tone",
25
+ "engagement",
26
+ "analysis",
27
+ "workflow-step"
28
+ ],
29
+ "author": "Bernier LLC",
30
+ "license": "SEE LICENSE IN LICENSE",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "https://github.com/bernierllc/tools.git",
34
+ "directory": "packages/service/content-workflow-ai-review-step"
35
+ },
36
+ "homepage": "https://github.com/bernierllc/tools/tree/main/packages/service/content-workflow-ai-review-step",
37
+ "publishConfig": {
38
+ "access": "public",
39
+ "registry": "https://registry.npmjs.org/"
40
+ },
41
+ "dependencies": {
42
+ "@bernierllc/ai-provider-router": "1.0.1",
43
+ "@bernierllc/ai-content-reviewer": "1.0.3",
44
+ "@bernierllc/logger": "1.0.3",
45
+ "@bernierllc/neverhub-adapter": "0.1.2"
46
+ },
47
+ "devDependencies": {
48
+ "@types/jest": "^29.5.12",
49
+ "@types/node": "^20.11.0",
50
+ "@typescript-eslint/eslint-plugin": "^6.19.0",
51
+ "@typescript-eslint/parser": "^6.19.0",
52
+ "eslint": "^8.56.0",
53
+ "jest": "^29.7.0",
54
+ "rimraf": "^5.0.5",
55
+ "ts-jest": "^29.1.1",
56
+ "typescript": "^5.3.3"
57
+ },
58
+ "scripts": {
59
+ "build": "tsc",
60
+ "clean": "rimraf dist",
61
+ "prebuild": "npm run clean",
62
+ "test": "jest",
63
+ "test:run": "jest --passWithNoTests",
64
+ "test:coverage": "jest --coverage",
65
+ "lint": "eslint src --ext .ts"
66
+ }
67
+ }