@orbytautomation/engine 0.2.3 → 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 +1 -1
- package/dist/core/EngineLogger.d.ts +34 -2
- package/dist/core/EngineLogger.d.ts.map +1 -1
- package/dist/core/EngineLogger.js +44 -3
- package/dist/core/EngineLogger.js.map +1 -1
- package/dist/errors/ErrorCodes.d.ts +205 -6
- package/dist/errors/ErrorCodes.d.ts.map +1 -1
- package/dist/errors/ErrorCodes.js +398 -5
- package/dist/errors/ErrorCodes.js.map +1 -1
- package/dist/errors/ErrorDebugger.d.ts +98 -0
- package/dist/errors/ErrorDebugger.d.ts.map +1 -0
- package/dist/errors/ErrorDebugger.js +283 -0
- package/dist/errors/ErrorDebugger.js.map +1 -0
- package/dist/errors/ErrorDetector.d.ts +148 -0
- package/dist/errors/ErrorDetector.d.ts.map +1 -0
- package/dist/errors/ErrorDetector.js +358 -0
- package/dist/errors/ErrorDetector.js.map +1 -0
- package/dist/errors/ErrorFormatter.d.ts +92 -3
- package/dist/errors/ErrorFormatter.d.ts.map +1 -1
- package/dist/errors/ErrorFormatter.js +220 -4
- package/dist/errors/ErrorFormatter.js.map +1 -1
- package/dist/errors/ErrorHandler.d.ts +259 -0
- package/dist/errors/ErrorHandler.d.ts.map +1 -0
- package/dist/errors/ErrorHandler.js +378 -0
- package/dist/errors/ErrorHandler.js.map +1 -0
- package/dist/errors/FieldRegistry.d.ts +39 -0
- package/dist/errors/FieldRegistry.d.ts.map +1 -1
- package/dist/errors/FieldRegistry.js +172 -74
- package/dist/errors/FieldRegistry.js.map +1 -1
- package/dist/errors/OrbytError.d.ts +85 -3
- package/dist/errors/OrbytError.d.ts.map +1 -1
- package/dist/errors/OrbytError.js +151 -4
- package/dist/errors/OrbytError.js.map +1 -1
- package/dist/errors/SchedulerError.d.ts +93 -1
- package/dist/errors/SchedulerError.d.ts.map +1 -1
- package/dist/errors/SchedulerError.js +145 -1
- package/dist/errors/SchedulerError.js.map +1 -1
- package/dist/errors/SecurityErrors.d.ts +94 -12
- package/dist/errors/SecurityErrors.d.ts.map +1 -1
- package/dist/errors/SecurityErrors.js +162 -18
- package/dist/errors/SecurityErrors.js.map +1 -1
- package/dist/errors/StepError.d.ts +111 -1
- package/dist/errors/StepError.d.ts.map +1 -1
- package/dist/errors/StepError.js +182 -1
- package/dist/errors/StepError.js.map +1 -1
- package/dist/errors/WorkflowError.d.ts +139 -2
- package/dist/errors/WorkflowError.d.ts.map +1 -1
- package/dist/errors/WorkflowError.js +264 -22
- package/dist/errors/WorkflowError.js.map +1 -1
- package/dist/errors/index.d.ts +5 -1
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +7 -4
- package/dist/errors/index.js.map +1 -1
- package/dist/loader/WorkflowLoader.d.ts +83 -21
- package/dist/loader/WorkflowLoader.d.ts.map +1 -1
- package/dist/loader/WorkflowLoader.js +169 -55
- package/dist/loader/WorkflowLoader.js.map +1 -1
- package/dist/parser/SchemaValidator.d.ts.map +1 -1
- package/dist/parser/SchemaValidator.js +2 -1
- package/dist/parser/SchemaValidator.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Detector (Smart Error Classification)
|
|
3
|
+
*
|
|
4
|
+
* Automatically detects error types and assigns correct error codes.
|
|
5
|
+
* Makes the engine smart enough to classify errors without manual coding.
|
|
6
|
+
* Also enriches errors with debug information for developers.
|
|
7
|
+
*
|
|
8
|
+
* PHILOSOPHY:
|
|
9
|
+
* ==========
|
|
10
|
+
* Instead of manually throwing specific error codes everywhere,
|
|
11
|
+
* the detector analyzes the error context and assigns the right code.
|
|
12
|
+
* Debug information is automatically attached at detection time.
|
|
13
|
+
*
|
|
14
|
+
* USAGE:
|
|
15
|
+
* ======
|
|
16
|
+
* ```typescript
|
|
17
|
+
* // Instead of manual classification:
|
|
18
|
+
* if (field === 'version') {
|
|
19
|
+
* throw SchemaError.missingField('version', 'workflow');
|
|
20
|
+
* }
|
|
21
|
+
*
|
|
22
|
+
* // Let detector classify automatically:
|
|
23
|
+
* const error = ErrorDetector.detect({
|
|
24
|
+
* type: 'missing_field',
|
|
25
|
+
* field: 'version',
|
|
26
|
+
* location: 'workflow'
|
|
27
|
+
* });
|
|
28
|
+
* throw error; // Already has debug info attached!
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @module errors/detector
|
|
32
|
+
*/
|
|
33
|
+
import { SchemaError, ValidationError } from './WorkflowError.js';
|
|
34
|
+
import { StepError } from './StepError.js';
|
|
35
|
+
import { SecurityError } from './SecurityErrors.js';
|
|
36
|
+
import { ErrorDebugger } from './ErrorDebugger.js';
|
|
37
|
+
import { RESERVED_WORKFLOW_FIELDS, RESERVED_CONTEXT_FIELDS, RESERVED_STEP_FIELDS, RESERVED_ANNOTATION_PREFIXES, ROOT_FIELDS, WORKFLOW_FIELDS, STEP_FIELDS, CONTEXT_FIELDS, METADATA_FIELDS } from './FieldRegistry.js';
|
|
38
|
+
import { findClosestMatch } from './TypoDetector.js';
|
|
39
|
+
/**
|
|
40
|
+
* Error Detector
|
|
41
|
+
*
|
|
42
|
+
* Smart system that analyzes error context and produces correct OrbytError.
|
|
43
|
+
*/
|
|
44
|
+
export class ErrorDetector {
|
|
45
|
+
/**
|
|
46
|
+
* Detect and create appropriate error from context
|
|
47
|
+
*
|
|
48
|
+
* @param context - Error context with information about what went wrong
|
|
49
|
+
* @returns Properly classified OrbytError
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* const error = ErrorDetector.detect({
|
|
54
|
+
* type: 'missing_field',
|
|
55
|
+
* field: 'version',
|
|
56
|
+
* location: 'workflow'
|
|
57
|
+
* });
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
/**
|
|
61
|
+
* Detect error from context and enrich with debug information
|
|
62
|
+
*
|
|
63
|
+
* This is the main entry point for error detection.
|
|
64
|
+
* All detected errors are automatically enriched with debug info.
|
|
65
|
+
*
|
|
66
|
+
* @param context - Error context
|
|
67
|
+
* @returns OrbytError with debug info attached
|
|
68
|
+
*/
|
|
69
|
+
static detect(context) {
|
|
70
|
+
let error;
|
|
71
|
+
// Auto-detect reserved fields
|
|
72
|
+
if (context.field && this.isReservedField(context.field)) {
|
|
73
|
+
error = this.handleReservedField(context);
|
|
74
|
+
return this.enrichWithDebugInfo(error);
|
|
75
|
+
}
|
|
76
|
+
// Auto-detect reserved annotations
|
|
77
|
+
if (context.field && this.isReservedAnnotation(context.field)) {
|
|
78
|
+
error = SecurityError.reservedAnnotation(context.field, context.location || 'unknown');
|
|
79
|
+
return this.enrichWithDebugInfo(error);
|
|
80
|
+
}
|
|
81
|
+
// Dispatch to specific handlers based on scenario
|
|
82
|
+
switch (context.type) {
|
|
83
|
+
// Schema errors
|
|
84
|
+
case 'unknown_field':
|
|
85
|
+
error = this.handleUnknownField(context);
|
|
86
|
+
break;
|
|
87
|
+
case 'reserved_field':
|
|
88
|
+
error = this.handleReservedField(context);
|
|
89
|
+
break;
|
|
90
|
+
case 'invalid_type':
|
|
91
|
+
error = this.handleInvalidType(context);
|
|
92
|
+
break;
|
|
93
|
+
case 'missing_field':
|
|
94
|
+
error = this.handleMissingField(context);
|
|
95
|
+
break;
|
|
96
|
+
case 'invalid_enum':
|
|
97
|
+
error = this.handleInvalidEnum(context);
|
|
98
|
+
break;
|
|
99
|
+
case 'parse_error':
|
|
100
|
+
error = this.handleParseError(context);
|
|
101
|
+
break;
|
|
102
|
+
case 'invalid_adapter':
|
|
103
|
+
error = this.handleInvalidAdapter(context);
|
|
104
|
+
break;
|
|
105
|
+
// Validation errors
|
|
106
|
+
case 'duplicate_id':
|
|
107
|
+
error = this.handleDuplicateId(context);
|
|
108
|
+
break;
|
|
109
|
+
case 'unknown_step':
|
|
110
|
+
error = this.handleUnknownStep(context);
|
|
111
|
+
break;
|
|
112
|
+
case 'circular_dependency':
|
|
113
|
+
error = this.handleCircularDependency(context);
|
|
114
|
+
break;
|
|
115
|
+
case 'forward_reference':
|
|
116
|
+
error = this.handleForwardReference(context);
|
|
117
|
+
break;
|
|
118
|
+
case 'empty_workflow':
|
|
119
|
+
error = ValidationError.emptyWorkflow(context.location || 'workflow');
|
|
120
|
+
break;
|
|
121
|
+
case 'missing_input':
|
|
122
|
+
error = this.handleMissingInput(context);
|
|
123
|
+
break;
|
|
124
|
+
case 'invalid_condition':
|
|
125
|
+
error = this.handleInvalidCondition(context);
|
|
126
|
+
break;
|
|
127
|
+
case 'invalid_variable':
|
|
128
|
+
error = this.handleInvalidVariable(context);
|
|
129
|
+
break;
|
|
130
|
+
// Step errors
|
|
131
|
+
case 'step_not_found':
|
|
132
|
+
error = StepError.notFound(context.field || 'unknown', context.location || 'unknown');
|
|
133
|
+
break;
|
|
134
|
+
case 'step_timeout':
|
|
135
|
+
error = this.handleStepTimeout(context);
|
|
136
|
+
break;
|
|
137
|
+
case 'step_failed':
|
|
138
|
+
error = this.handleStepFailed(context);
|
|
139
|
+
break;
|
|
140
|
+
case 'step_dependency_failed':
|
|
141
|
+
error = this.handleStepDependencyFailed(context);
|
|
142
|
+
break;
|
|
143
|
+
case 'step_invalid_config':
|
|
144
|
+
error = this.handleStepInvalidConfig(context);
|
|
145
|
+
break;
|
|
146
|
+
// Security errors
|
|
147
|
+
case 'permission_denied':
|
|
148
|
+
error = this.handlePermissionDenied(context);
|
|
149
|
+
break;
|
|
150
|
+
// Unknown/generic
|
|
151
|
+
default:
|
|
152
|
+
error = this.handleUnknown(context);
|
|
153
|
+
}
|
|
154
|
+
// Enrich with debug information before returning
|
|
155
|
+
return this.enrichWithDebugInfo(error);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Detect error from raw exception
|
|
159
|
+
* Analyzes exception and tries to classify it
|
|
160
|
+
*
|
|
161
|
+
* @param error - Raw error/exception
|
|
162
|
+
* @param location - Where the error occurred
|
|
163
|
+
* @returns Classified OrbytError with debug info
|
|
164
|
+
*/
|
|
165
|
+
static detectFromException(error, location) {
|
|
166
|
+
const message = error.message.toLowerCase();
|
|
167
|
+
const stack = error.stack;
|
|
168
|
+
// Try to detect error type from message
|
|
169
|
+
let scenario = 'unknown';
|
|
170
|
+
if (message.includes('yaml') || message.includes('parse') || message.includes('syntax')) {
|
|
171
|
+
scenario = 'parse_error';
|
|
172
|
+
}
|
|
173
|
+
else if (message.includes('unknown field') || message.includes('unexpected field')) {
|
|
174
|
+
scenario = 'unknown_field';
|
|
175
|
+
}
|
|
176
|
+
else if (message.includes('missing') || message.includes('required')) {
|
|
177
|
+
scenario = 'missing_field';
|
|
178
|
+
}
|
|
179
|
+
else if (message.includes('type') || message.includes('expected')) {
|
|
180
|
+
scenario = 'invalid_type';
|
|
181
|
+
}
|
|
182
|
+
else if (message.includes('circular') || message.includes('cycle')) {
|
|
183
|
+
scenario = 'circular_dependency';
|
|
184
|
+
}
|
|
185
|
+
else if (message.includes('duplicate')) {
|
|
186
|
+
scenario = 'duplicate_id';
|
|
187
|
+
}
|
|
188
|
+
else if (message.includes('timeout')) {
|
|
189
|
+
scenario = 'step_timeout';
|
|
190
|
+
}
|
|
191
|
+
else if (message.includes('permission') || message.includes('denied')) {
|
|
192
|
+
scenario = 'permission_denied';
|
|
193
|
+
}
|
|
194
|
+
// Use detect() which automatically enriches with debug info
|
|
195
|
+
return this.detect({
|
|
196
|
+
type: scenario,
|
|
197
|
+
location,
|
|
198
|
+
rawMessage: error.message,
|
|
199
|
+
stack,
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
// ==================== HELPER METHODS ====================
|
|
203
|
+
/**
|
|
204
|
+
* Check if field is reserved by engine
|
|
205
|
+
*/
|
|
206
|
+
static isReservedField(field) {
|
|
207
|
+
return (RESERVED_WORKFLOW_FIELDS.includes(field) ||
|
|
208
|
+
RESERVED_CONTEXT_FIELDS.includes(field) ||
|
|
209
|
+
RESERVED_STEP_FIELDS.includes(field) ||
|
|
210
|
+
field.startsWith('_') ||
|
|
211
|
+
field.startsWith('__'));
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Check if annotation uses reserved namespace
|
|
215
|
+
*/
|
|
216
|
+
static isReservedAnnotation(annotation) {
|
|
217
|
+
return RESERVED_ANNOTATION_PREFIXES.some(prefix => annotation.startsWith(prefix));
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Determine field type for security errors
|
|
221
|
+
*/
|
|
222
|
+
static getFieldType(field) {
|
|
223
|
+
if (field.includes('billing') || field.includes('price') || field.includes('cost')) {
|
|
224
|
+
return 'billing';
|
|
225
|
+
}
|
|
226
|
+
if (field.includes('execution') || field.includes('run') || field.includes('workflow')) {
|
|
227
|
+
return 'execution';
|
|
228
|
+
}
|
|
229
|
+
if (field.includes('user') || field.includes('org') || field.includes('owner')) {
|
|
230
|
+
return 'identity';
|
|
231
|
+
}
|
|
232
|
+
if (field.includes('usage') || field.includes('counter') || field.includes('consumed')) {
|
|
233
|
+
return 'usage';
|
|
234
|
+
}
|
|
235
|
+
return 'internal';
|
|
236
|
+
}
|
|
237
|
+
// ==================== ERROR HANDLERS ====================
|
|
238
|
+
static handleUnknownField(context) {
|
|
239
|
+
const field = context.field || 'unknown';
|
|
240
|
+
const location = context.location || 'unknown';
|
|
241
|
+
// Get valid fields based on location
|
|
242
|
+
const validFields = this.getValidFieldsForLocation(location);
|
|
243
|
+
// Use TypoDetector to find closest match
|
|
244
|
+
const suggestion = findClosestMatch(field, validFields, 0.6);
|
|
245
|
+
return SchemaError.unknownField(field, location, suggestion);
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Get valid field names based on location in workflow
|
|
249
|
+
*/
|
|
250
|
+
static getValidFieldsForLocation(location) {
|
|
251
|
+
const locationLower = location.toLowerCase();
|
|
252
|
+
// Root level fields
|
|
253
|
+
if (locationLower === 'workflow' || locationLower.startsWith('workflow.')) {
|
|
254
|
+
if (locationLower.includes('steps[') || locationLower.includes('.step')) {
|
|
255
|
+
return [...STEP_FIELDS];
|
|
256
|
+
}
|
|
257
|
+
if (locationLower.includes('context')) {
|
|
258
|
+
return [...CONTEXT_FIELDS];
|
|
259
|
+
}
|
|
260
|
+
if (locationLower.includes('metadata')) {
|
|
261
|
+
return [...METADATA_FIELDS];
|
|
262
|
+
}
|
|
263
|
+
return [...ROOT_FIELDS, ...WORKFLOW_FIELDS];
|
|
264
|
+
}
|
|
265
|
+
// Step fields
|
|
266
|
+
if (locationLower.includes('step')) {
|
|
267
|
+
return [...STEP_FIELDS];
|
|
268
|
+
}
|
|
269
|
+
// Default: return all common fields
|
|
270
|
+
return [
|
|
271
|
+
...ROOT_FIELDS,
|
|
272
|
+
...WORKFLOW_FIELDS,
|
|
273
|
+
...STEP_FIELDS,
|
|
274
|
+
...CONTEXT_FIELDS,
|
|
275
|
+
...METADATA_FIELDS
|
|
276
|
+
];
|
|
277
|
+
}
|
|
278
|
+
static handleReservedField(context) {
|
|
279
|
+
const field = context.field || 'unknown';
|
|
280
|
+
const fieldType = this.getFieldType(field);
|
|
281
|
+
return SecurityError.reservedFieldOverride(field, context.location || 'unknown', fieldType);
|
|
282
|
+
}
|
|
283
|
+
static handleInvalidType(context) {
|
|
284
|
+
return SchemaError.invalidType(context.field || 'unknown', context.expected || 'unknown', context.actual || 'unknown', context.location || 'unknown');
|
|
285
|
+
}
|
|
286
|
+
static handleMissingField(context) {
|
|
287
|
+
return SchemaError.missingField(context.field || 'unknown', context.location || 'unknown');
|
|
288
|
+
}
|
|
289
|
+
static handleInvalidEnum(context) {
|
|
290
|
+
const validValues = context.data?.validValues || [];
|
|
291
|
+
return SchemaError.invalidEnum(context.field || 'unknown', context.actual || 'unknown', validValues, context.location || 'unknown');
|
|
292
|
+
}
|
|
293
|
+
static handleParseError(context) {
|
|
294
|
+
return SchemaError.parseError(context.location || 'unknown', context.data?.line, context.data?.column, context.rawMessage);
|
|
295
|
+
}
|
|
296
|
+
static handleInvalidAdapter(context) {
|
|
297
|
+
return SchemaError.invalidAdapter(context.field || context.actual || 'unknown', context.location || 'unknown', context.data?.validAdapters);
|
|
298
|
+
}
|
|
299
|
+
static handleDuplicateId(context) {
|
|
300
|
+
return ValidationError.duplicateId(context.field || 'unknown', context.location || 'unknown', context.data?.firstOccurrence);
|
|
301
|
+
}
|
|
302
|
+
static handleUnknownStep(context) {
|
|
303
|
+
return ValidationError.unknownStep(context.field || 'unknown', context.location || 'unknown', context.data?.availableSteps);
|
|
304
|
+
}
|
|
305
|
+
static handleCircularDependency(context) {
|
|
306
|
+
const cycle = context.data?.cycle || [context.field || 'unknown'];
|
|
307
|
+
return ValidationError.circularDependency(cycle, context.location || 'unknown');
|
|
308
|
+
}
|
|
309
|
+
static handleForwardReference(context) {
|
|
310
|
+
return ValidationError.forwardReference(context.field || 'unknown', context.data?.referencedStep || 'unknown', context.location || 'unknown');
|
|
311
|
+
}
|
|
312
|
+
static handleMissingInput(context) {
|
|
313
|
+
return ValidationError.missingInput(context.field || 'unknown', context.location || 'unknown');
|
|
314
|
+
}
|
|
315
|
+
static handleInvalidCondition(context) {
|
|
316
|
+
return ValidationError.invalidCondition(context.actual || context.rawMessage || 'unknown', context.location || 'unknown', context.data?.reason);
|
|
317
|
+
}
|
|
318
|
+
static handleInvalidVariable(context) {
|
|
319
|
+
return ValidationError.invalidVariable(context.field || 'unknown', context.location || 'unknown', context.data?.availableVars);
|
|
320
|
+
}
|
|
321
|
+
static handleStepTimeout(context) {
|
|
322
|
+
return StepError.timeout(context.field || 'unknown', context.location || 'unknown', context.data?.timeout);
|
|
323
|
+
}
|
|
324
|
+
static handleStepFailed(context) {
|
|
325
|
+
const error = context.rawMessage ? new Error(context.rawMessage) : new Error('Step execution failed');
|
|
326
|
+
return StepError.executionFailed(context.field || 'unknown', context.location || 'unknown', error, context.data?.exitCode);
|
|
327
|
+
}
|
|
328
|
+
static handleStepDependencyFailed(context) {
|
|
329
|
+
return StepError.dependencyFailed(context.field || 'unknown', context.data?.dependency || 'unknown', context.location || 'unknown');
|
|
330
|
+
}
|
|
331
|
+
static handleStepInvalidConfig(context) {
|
|
332
|
+
return StepError.invalidConfig(context.field || 'unknown', context.location || 'unknown', context.rawMessage);
|
|
333
|
+
}
|
|
334
|
+
static handlePermissionDenied(context) {
|
|
335
|
+
return SecurityError.permissionDenied(context.field || context.data?.resource || 'unknown', context.location || 'unknown', context.data?.requiredPermission);
|
|
336
|
+
}
|
|
337
|
+
static handleUnknown(context) {
|
|
338
|
+
// Create generic schema error for unknown cases
|
|
339
|
+
return SchemaError.parseError(context.location || 'unknown', undefined, undefined, context.rawMessage || 'Unknown error occurred');
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Enrich error with debug information
|
|
343
|
+
*
|
|
344
|
+
* This is called automatically after error detection to attach
|
|
345
|
+
* detailed debug info including explanations, fix steps, examples, etc.
|
|
346
|
+
*
|
|
347
|
+
* @param error - Detected OrbytError
|
|
348
|
+
* @returns Same error with debug info attached (for console display)
|
|
349
|
+
* @private
|
|
350
|
+
*/
|
|
351
|
+
static enrichWithDebugInfo(error) {
|
|
352
|
+
// Generate and store formatted debug output for console display
|
|
353
|
+
// This is done here so it's available when needed in WorkflowLoader
|
|
354
|
+
error.__debugOutput = ErrorDebugger.format(error);
|
|
355
|
+
return error;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
//# sourceMappingURL=ErrorDetector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorDetector.js","sourceRoot":"","sources":["../../src/errors/ErrorDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD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CAAC,gBAAgB,CAC7B,OAAO,CAAC,KAAK,IAAI,SAAS,EAC1B,OAAO,CAAC,IAAI,EAAE,UAAU,IAAI,SAAS,EACrC,OAAO,CAAC,QAAQ,IAAI,SAAS,CAChC,CAAC;IACN,CAAC;IAEO,MAAM,CAAC,uBAAuB,CAAC,OAAqB;QACxD,OAAO,SAAS,CAAC,aAAa,CAC1B,OAAO,CAAC,KAAK,IAAI,SAAS,EAC1B,OAAO,CAAC,QAAQ,IAAI,SAAS,EAC7B,OAAO,CAAC,UAAU,CACrB,CAAC;IACN,CAAC;IAEO,MAAM,CAAC,sBAAsB,CAAC,OAAqB;QACvD,OAAO,aAAa,CAAC,gBAAgB,CACjC,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,IAAI,EAAE,QAAQ,IAAI,SAAS,EACpD,OAAO,CAAC,QAAQ,IAAI,SAAS,EAC7B,OAAO,CAAC,IAAI,EAAE,kBAAkB,CACnC,CAAC;IACN,CAAC;IAEO,MAAM,CAAC,aAAa,CAAC,OAAqB;QAC9C,gDAAgD;QAChD,OAAO,WAAW,CAAC,UAAU,CACzB,OAAO,CAAC,QAAQ,IAAI,SAAS,EAC7B,SAAS,EACT,SAAS,EACT,OAAO,CAAC,UAAU,IAAI,wBAAwB,CACjD,CAAC;IACN,CAAC;IAED;;;;;;;;;OASG;IACK,MAAM,CAAC,mBAAmB,CAAC,KAAiB;QAChD,gEAAgE;QAChE,oEAAoE;QACnE,KAAa,CAAC,aAAa,GAAG,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAE3D,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ"}
|
|
@@ -2,27 +2,74 @@
|
|
|
2
2
|
* Error Formatter
|
|
3
3
|
*
|
|
4
4
|
* Formats Orbyt errors for CLI display with colors and helpful formatting.
|
|
5
|
-
* Provides human-readable error output for developers
|
|
5
|
+
* Provides human-readable error output for developers with:
|
|
6
|
+
* - Colored output for severity levels
|
|
7
|
+
* - Exit code information
|
|
8
|
+
* - Error category and retryability
|
|
9
|
+
* - Contextual debugging information
|
|
10
|
+
* - Integration with EngineLogger for proper log management
|
|
11
|
+
*
|
|
12
|
+
* USAGE:
|
|
13
|
+
* =====
|
|
14
|
+
* ```typescript
|
|
15
|
+
* // Format single error
|
|
16
|
+
* const formatted = formatError(error);
|
|
17
|
+
* console.error(formatted);
|
|
18
|
+
*
|
|
19
|
+
* // Format multiple errors
|
|
20
|
+
* const formatted = formatErrors(errors);
|
|
21
|
+
* console.error(formatted);
|
|
22
|
+
*
|
|
23
|
+
* // Detailed format with all diagnostics
|
|
24
|
+
* const detailed = formatDetailedError(error);
|
|
25
|
+
* console.error(detailed);
|
|
26
|
+
*
|
|
27
|
+
* // Log error using EngineLogger
|
|
28
|
+
* logErrorToEngine(error, logger);
|
|
29
|
+
* ```
|
|
6
30
|
*
|
|
7
31
|
* @module errors
|
|
8
32
|
*/
|
|
9
33
|
import { OrbytError } from './OrbytError.js';
|
|
34
|
+
import { ErrorSeverity } from './ErrorCodes.js';
|
|
35
|
+
import type { EngineLogger } from '../core/EngineLogger.js';
|
|
36
|
+
import { LogLevel } from '@dev-ecosystem/core';
|
|
10
37
|
/**
|
|
11
38
|
* Format error for CLI display
|
|
12
39
|
*
|
|
13
40
|
* @param error - Orbyt error to format
|
|
14
41
|
* @param useColors - Whether to use ANSI colors (default: true)
|
|
42
|
+
* @param verbose - Show additional diagnostic info (default: false)
|
|
15
43
|
* @returns Formatted error string
|
|
16
44
|
*/
|
|
17
|
-
export declare function formatError(error: OrbytError, useColors?: boolean): string;
|
|
45
|
+
export declare function formatError(error: OrbytError, useColors?: boolean, verbose?: boolean): string;
|
|
18
46
|
/**
|
|
19
47
|
* Format multiple errors for CLI display
|
|
20
48
|
*
|
|
21
49
|
* @param errors - Array of Orbyt errors
|
|
22
50
|
* @param useColors - Whether to use ANSI colors
|
|
51
|
+
* @param verbose - Show additional diagnostic info
|
|
23
52
|
* @returns Formatted errors string
|
|
24
53
|
*/
|
|
25
|
-
export declare function formatErrors(errors: OrbytError[], useColors?: boolean): string;
|
|
54
|
+
export declare function formatErrors(errors: OrbytError[], useColors?: boolean, verbose?: boolean): string;
|
|
55
|
+
/**
|
|
56
|
+
* Format error with full diagnostic information
|
|
57
|
+
* Useful for debugging and detailed error analysis
|
|
58
|
+
*
|
|
59
|
+
* @param error - Orbyt error to format
|
|
60
|
+
* @param useColors - Whether to use ANSI colors
|
|
61
|
+
* @returns Detailed formatted error string
|
|
62
|
+
*/
|
|
63
|
+
export declare function formatDetailedError(error: OrbytError, useColors?: boolean): string;
|
|
64
|
+
/**
|
|
65
|
+
* Format error summary (one-line format)
|
|
66
|
+
* Useful for logging or compact display
|
|
67
|
+
*
|
|
68
|
+
* @param error - Orbyt error to format
|
|
69
|
+
* @param useColors - Whether to use ANSI colors
|
|
70
|
+
* @returns One-line error summary
|
|
71
|
+
*/
|
|
72
|
+
export declare function formatErrorSummary(error: OrbytError, useColors?: boolean): string;
|
|
26
73
|
/**
|
|
27
74
|
* Create a simple box around text (for emphasis)
|
|
28
75
|
*
|
|
@@ -31,4 +78,46 @@ export declare function formatErrors(errors: OrbytError[], useColors?: boolean):
|
|
|
31
78
|
* @returns Boxed text string
|
|
32
79
|
*/
|
|
33
80
|
export declare function createBox(text: string, useColors?: boolean): string;
|
|
81
|
+
/**
|
|
82
|
+
* Map ErrorSeverity to LogLevel
|
|
83
|
+
* Converts Orbyt's error severity to ecosystem-core's log level
|
|
84
|
+
*
|
|
85
|
+
* @param severity - Error severity
|
|
86
|
+
* @returns Corresponding log level
|
|
87
|
+
*/
|
|
88
|
+
export declare function errorSeverityToLogLevel(severity: ErrorSeverity): LogLevel;
|
|
89
|
+
/**
|
|
90
|
+
* Log an error to EngineLogger with proper formatting
|
|
91
|
+
*
|
|
92
|
+
* This is the primary way to log errors during workflow loading and execution.
|
|
93
|
+
* It maps Orbyt's ErrorSeverity to ecosystem-core's LogLevel and includes
|
|
94
|
+
* all relevant context.
|
|
95
|
+
*
|
|
96
|
+
* @param error - Orbyt error to log
|
|
97
|
+
* @param logger - EngineLogger instance
|
|
98
|
+
* @param includeDebugInfo - Whether to include full diagnostic info (default: true)
|
|
99
|
+
*/
|
|
100
|
+
export declare function logErrorToEngine(error: OrbytError, logger: EngineLogger, includeDebugInfo?: boolean): void;
|
|
101
|
+
/**
|
|
102
|
+
* Log multiple errors to EngineLogger
|
|
103
|
+
*
|
|
104
|
+
* @param errors - Array of Orbyt errors
|
|
105
|
+
* @param logger - EngineLogger instance
|
|
106
|
+
* @param includeDebugInfo - Whether to include full diagnostic info
|
|
107
|
+
*/
|
|
108
|
+
export declare function logErrorsToEngine(errors: OrbytError[], logger: EngineLogger, includeDebugInfo?: boolean): void;
|
|
109
|
+
/**
|
|
110
|
+
* Format and log error (combined operation)
|
|
111
|
+
* Returns formatted string AND logs to EngineLogger if provided
|
|
112
|
+
*
|
|
113
|
+
* @param error - Orbyt error
|
|
114
|
+
* @param logger - Optional EngineLogger instance
|
|
115
|
+
* @param options - Formatting options
|
|
116
|
+
* @returns Formatted error string
|
|
117
|
+
*/
|
|
118
|
+
export declare function formatAndLogError(error: OrbytError, logger?: EngineLogger, options?: {
|
|
119
|
+
useColors?: boolean;
|
|
120
|
+
verbose?: boolean;
|
|
121
|
+
includeDebugInfo?: boolean;
|
|
122
|
+
}): string;
|
|
34
123
|
//# sourceMappingURL=ErrorFormatter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorFormatter.d.ts","sourceRoot":"","sources":["../../src/errors/ErrorFormatter.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ErrorFormatter.d.ts","sourceRoot":"","sources":["../../src/errors/ErrorFormatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,O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