@bernierllc/content-workflow-ai-review-step 0.8.2 → 0.8.3

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/types.d.ts DELETED
@@ -1,205 +0,0 @@
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
@@ -1 +0,0 @@
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,uDA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B,GAAG,gBAAgB;IAqBtD,QAAQ,CAAC,eAAe,IAAI,gBAAgB;CAC7C"}
package/dist/types.js DELETED
@@ -1,32 +0,0 @@
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
- * 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
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
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"}