@vibe-validate/extractors 0.17.0-rc.8 → 0.17.0-rc.9
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/result-schema.d.ts
CHANGED
|
@@ -322,19 +322,42 @@ export type ErrorExtractorResult = z.infer<typeof ErrorExtractorResultSchema>;
|
|
|
322
322
|
/**
|
|
323
323
|
* Safe validation function for ErrorExtractorResult
|
|
324
324
|
*
|
|
325
|
-
* NOTE: This duplicates the pattern from @vibe-validate/core's createSafeValidator.
|
|
326
|
-
* We can't import from core here due to circular dependency (core → extractors).
|
|
327
|
-
* This is an acceptable trade-off for a foundational package.
|
|
328
|
-
*
|
|
329
325
|
* @param data - Data to validate
|
|
330
326
|
* @returns Validation result with success/error information
|
|
331
327
|
*/
|
|
332
|
-
export declare
|
|
333
|
-
success: true;
|
|
334
|
-
data: ErrorExtractorResult;
|
|
335
|
-
} | {
|
|
328
|
+
export declare const safeValidateExtractorResult: (data: unknown) => {
|
|
336
329
|
success: false;
|
|
337
330
|
errors: string[];
|
|
331
|
+
} | {
|
|
332
|
+
success: true;
|
|
333
|
+
data: {
|
|
334
|
+
summary: string;
|
|
335
|
+
totalErrors: number;
|
|
336
|
+
errors: {
|
|
337
|
+
message: string;
|
|
338
|
+
file?: string | undefined;
|
|
339
|
+
line?: number | undefined;
|
|
340
|
+
column?: number | undefined;
|
|
341
|
+
code?: string | undefined;
|
|
342
|
+
severity?: "error" | "warning" | undefined;
|
|
343
|
+
context?: string | undefined;
|
|
344
|
+
guidance?: string | undefined;
|
|
345
|
+
}[];
|
|
346
|
+
guidance?: string | undefined;
|
|
347
|
+
errorSummary?: string | undefined;
|
|
348
|
+
metadata?: {
|
|
349
|
+
issues: string[];
|
|
350
|
+
confidence: number;
|
|
351
|
+
completeness: number;
|
|
352
|
+
detection?: {
|
|
353
|
+
extractor: string;
|
|
354
|
+
confidence: number;
|
|
355
|
+
patterns: string[];
|
|
356
|
+
reason: string;
|
|
357
|
+
} | undefined;
|
|
358
|
+
suggestions?: string[] | undefined;
|
|
359
|
+
} | undefined;
|
|
360
|
+
};
|
|
338
361
|
};
|
|
339
362
|
/**
|
|
340
363
|
* Strict validation function for ErrorExtractorResult
|
|
@@ -345,5 +368,32 @@ export declare function safeValidateExtractorResult(data: unknown): {
|
|
|
345
368
|
* @returns Validated result
|
|
346
369
|
* @throws {Error} If validation fails
|
|
347
370
|
*/
|
|
348
|
-
export declare
|
|
371
|
+
export declare const validateExtractorResult: (data: unknown) => {
|
|
372
|
+
summary: string;
|
|
373
|
+
totalErrors: number;
|
|
374
|
+
errors: {
|
|
375
|
+
message: string;
|
|
376
|
+
file?: string | undefined;
|
|
377
|
+
line?: number | undefined;
|
|
378
|
+
column?: number | undefined;
|
|
379
|
+
code?: string | undefined;
|
|
380
|
+
severity?: "error" | "warning" | undefined;
|
|
381
|
+
context?: string | undefined;
|
|
382
|
+
guidance?: string | undefined;
|
|
383
|
+
}[];
|
|
384
|
+
guidance?: string | undefined;
|
|
385
|
+
errorSummary?: string | undefined;
|
|
386
|
+
metadata?: {
|
|
387
|
+
issues: string[];
|
|
388
|
+
confidence: number;
|
|
389
|
+
completeness: number;
|
|
390
|
+
detection?: {
|
|
391
|
+
extractor: string;
|
|
392
|
+
confidence: number;
|
|
393
|
+
patterns: string[];
|
|
394
|
+
reason: string;
|
|
395
|
+
} | undefined;
|
|
396
|
+
suggestions?: string[] | undefined;
|
|
397
|
+
} | undefined;
|
|
398
|
+
};
|
|
349
399
|
//# sourceMappingURL=result-schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result-schema.d.ts","sourceRoot":"","sources":["../src/result-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"result-schema.d.ts","sourceRoot":"","sources":["../src/result-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;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;;;;;;;;;;;;;;;;;;;;;;;EA0C/E,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAkD,CAAC;AAE3F;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAoD,CAAC"}
|
package/dist/result-schema.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
import { z } from 'zod';
|
|
10
|
+
import { createSafeValidator, createStrictValidator } from '@vibe-validate/config';
|
|
10
11
|
/**
|
|
11
12
|
* Maximum number of errors to include in errors array
|
|
12
13
|
*
|
|
@@ -105,25 +106,10 @@ export const ErrorExtractorResultSchema = z.object({
|
|
|
105
106
|
/**
|
|
106
107
|
* Safe validation function for ErrorExtractorResult
|
|
107
108
|
*
|
|
108
|
-
* NOTE: This duplicates the pattern from @vibe-validate/core's createSafeValidator.
|
|
109
|
-
* We can't import from core here due to circular dependency (core → extractors).
|
|
110
|
-
* This is an acceptable trade-off for a foundational package.
|
|
111
|
-
*
|
|
112
109
|
* @param data - Data to validate
|
|
113
110
|
* @returns Validation result with success/error information
|
|
114
111
|
*/
|
|
115
|
-
export
|
|
116
|
-
const result = ErrorExtractorResultSchema.safeParse(data);
|
|
117
|
-
if (result.success) {
|
|
118
|
-
return { success: true, data: result.data };
|
|
119
|
-
}
|
|
120
|
-
// Extract error messages with full path
|
|
121
|
-
const errors = result.error.errors.map(err => {
|
|
122
|
-
const path = err.path.join('.');
|
|
123
|
-
return path ? `${path}: ${err.message}` : err.message;
|
|
124
|
-
});
|
|
125
|
-
return { success: false, errors };
|
|
126
|
-
}
|
|
112
|
+
export const safeValidateExtractorResult = createSafeValidator(ErrorExtractorResultSchema);
|
|
127
113
|
/**
|
|
128
114
|
* Strict validation function for ErrorExtractorResult
|
|
129
115
|
*
|
|
@@ -133,7 +119,5 @@ export function safeValidateExtractorResult(data) {
|
|
|
133
119
|
* @returns Validated result
|
|
134
120
|
* @throws {Error} If validation fails
|
|
135
121
|
*/
|
|
136
|
-
export
|
|
137
|
-
return ErrorExtractorResultSchema.parse(data);
|
|
138
|
-
}
|
|
122
|
+
export const validateExtractorResult = createStrictValidator(ErrorExtractorResultSchema);
|
|
139
123
|
//# sourceMappingURL=result-schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result-schema.js","sourceRoot":"","sources":["../src/result-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"result-schema.js","sourceRoot":"","sources":["../src/result-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnF;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAEtC;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,yCAAyC;IACzC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAE3B,8BAA8B;IAC9B,IAAI,EAAE,CAAC,CAAC,MA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
|
3
|
+
"version": "0.17.0-rc.9",
|
|
4
4
|
"description": "LLM-optimized error extractors for validation output",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -42,7 +42,8 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"zod": "^3.24.1",
|
|
45
|
-
"zod-to-json-schema": "^3.24.6"
|
|
45
|
+
"zod-to-json-schema": "^3.24.6",
|
|
46
|
+
"@vibe-validate/config": "0.17.0-rc.9"
|
|
46
47
|
},
|
|
47
48
|
"engines": {
|
|
48
49
|
"node": ">=20.0.0"
|