@vibe-agent-toolkit/resources 0.1.2 → 0.1.4
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 +255 -17
- package/dist/collection-matcher.d.ts +63 -0
- package/dist/collection-matcher.d.ts.map +1 -0
- package/dist/collection-matcher.js +127 -0
- package/dist/collection-matcher.js.map +1 -0
- package/dist/config-parser.d.ts +63 -0
- package/dist/config-parser.d.ts.map +1 -0
- package/dist/config-parser.js +113 -0
- package/dist/config-parser.js.map +1 -0
- package/dist/frontmatter-validator.d.ts +50 -0
- package/dist/frontmatter-validator.d.ts.map +1 -0
- package/dist/frontmatter-validator.js +238 -0
- package/dist/frontmatter-validator.js.map +1 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/link-parser.d.ts +2 -0
- package/dist/link-parser.d.ts.map +1 -1
- package/dist/link-parser.js +41 -0
- package/dist/link-parser.js.map +1 -1
- package/dist/link-validator.d.ts +25 -3
- package/dist/link-validator.d.ts.map +1 -1
- package/dist/link-validator.js +52 -40
- package/dist/link-validator.js.map +1 -1
- package/dist/multi-schema-validator.d.ts +42 -0
- package/dist/multi-schema-validator.d.ts.map +1 -0
- package/dist/multi-schema-validator.js +107 -0
- package/dist/multi-schema-validator.js.map +1 -0
- package/dist/pattern-expander.d.ts +63 -0
- package/dist/pattern-expander.d.ts.map +1 -0
- package/dist/pattern-expander.js +93 -0
- package/dist/pattern-expander.js.map +1 -0
- package/dist/resource-registry.d.ts +104 -8
- package/dist/resource-registry.d.ts.map +1 -1
- package/dist/resource-registry.js +230 -30
- package/dist/resource-registry.js.map +1 -1
- package/dist/schema-assignment.d.ts +49 -0
- package/dist/schema-assignment.d.ts.map +1 -0
- package/dist/schema-assignment.js +95 -0
- package/dist/schema-assignment.js.map +1 -0
- package/dist/schemas/project-config.d.ts +254 -0
- package/dist/schemas/project-config.d.ts.map +1 -0
- package/dist/schemas/project-config.js +57 -0
- package/dist/schemas/project-config.js.map +1 -0
- package/dist/schemas/resource-metadata.d.ts +10 -1
- package/dist/schemas/resource-metadata.d.ts.map +1 -1
- package/dist/schemas/resource-metadata.js +7 -1
- package/dist/schemas/resource-metadata.js.map +1 -1
- package/dist/schemas/validation-result.d.ts +9 -24
- package/dist/schemas/validation-result.d.ts.map +1 -1
- package/dist/schemas/validation-result.js +11 -18
- package/dist/schemas/validation-result.js.map +1 -1
- package/dist/types/resource-parser.d.ts +53 -0
- package/dist/types/resource-parser.d.ts.map +1 -0
- package/dist/types/resource-parser.js +233 -0
- package/dist/types/resource-parser.js.map +1 -0
- package/dist/types/resource-path-utils.d.ts +43 -0
- package/dist/types/resource-path-utils.d.ts.map +1 -0
- package/dist/types/resource-path-utils.js +89 -0
- package/dist/types/resource-path-utils.js.map +1 -0
- package/dist/types/resources.d.ts +140 -0
- package/dist/types/resources.d.ts.map +1 -0
- package/dist/types/resources.js +58 -0
- package/dist/types/resources.js.map +1 -0
- package/dist/types.d.ts +14 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +17 -0
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +18 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +39 -0
- package/dist/utils.js.map +1 -1
- package/package.json +5 -2
- package/src/collection-matcher.ts +148 -0
- package/src/config-parser.ts +125 -0
- package/src/frontmatter-validator.ts +279 -0
- package/src/index.ts +10 -2
- package/src/link-parser.ts +50 -0
- package/src/link-validator.ts +70 -43
- package/src/multi-schema-validator.ts +128 -0
- package/src/pattern-expander.ts +100 -0
- package/src/resource-registry.ts +347 -34
- package/src/schema-assignment.ts +119 -0
- package/src/schemas/project-config.ts +71 -0
- package/src/schemas/resource-metadata.ts +7 -1
- package/src/schemas/validation-result.ts +11 -21
- package/src/types/resource-parser.ts +302 -0
- package/src/types/resource-path-utils.ts +102 -0
- package/src/types/resources.ts +211 -0
- package/src/types.ts +89 -1
- package/src/utils.ts +43 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-assignment.d.ts","sourceRoot":"","sources":["../src/schema-assignment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,eAAe,EAAE,eAAe,EAAE,EAClC,cAAc,EAAE,MAAM,EACtB,gBAAgB,EAAE,gBAAgB,GACjC,eAAe,EAAE,CAsBnB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,eAAe,EAAE,eAAe,EAAE,EAClC,UAAU,EAAE,MAAM,GACjB,eAAe,EAAE,CAgBnB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAC3B,eAAe,EAAE,eAAe,EAAE,EAClC,WAAW,EAAE,MAAM,EAAE,EACrB,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,EACnD,SAAS,CAAC,EAAE,MAAM,GACjB,eAAe,EAAE,CAiBnB"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema assignment pipeline for resources
|
|
3
|
+
*
|
|
4
|
+
* Handles the multi-source schema assignment:
|
|
5
|
+
* 1. Self-asserted schemas (from $schema field in frontmatter)
|
|
6
|
+
* 2. Collection-imposed schemas (from collection config)
|
|
7
|
+
* 3. CLI-imposed schemas (from --frontmatter-schema flag)
|
|
8
|
+
*
|
|
9
|
+
* Each resource can have multiple schemas from different sources,
|
|
10
|
+
* and each is validated independently.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Add collection-imposed schema to a resource's schema list
|
|
14
|
+
*
|
|
15
|
+
* @param existingSchemas - Current schemas (including self-asserted)
|
|
16
|
+
* @param collectionName - Name of the collection
|
|
17
|
+
* @param collectionConfig - Collection configuration
|
|
18
|
+
* @returns Updated schema list with collection schema added (if defined)
|
|
19
|
+
*/
|
|
20
|
+
export function addCollectionSchema(existingSchemas, collectionName, collectionConfig) {
|
|
21
|
+
const schemaPath = collectionConfig.validation?.frontmatterSchema;
|
|
22
|
+
if (!schemaPath) {
|
|
23
|
+
return existingSchemas;
|
|
24
|
+
}
|
|
25
|
+
// Check if this schema is already present from any source
|
|
26
|
+
const alreadyExists = existingSchemas.some((ref) => ref.schema === schemaPath);
|
|
27
|
+
if (alreadyExists) {
|
|
28
|
+
return existingSchemas;
|
|
29
|
+
}
|
|
30
|
+
// Add collection-imposed schema
|
|
31
|
+
return [
|
|
32
|
+
...existingSchemas,
|
|
33
|
+
{
|
|
34
|
+
schema: schemaPath,
|
|
35
|
+
source: collectionName,
|
|
36
|
+
applied: false,
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Add CLI-imposed schema to a resource's schema list
|
|
42
|
+
*
|
|
43
|
+
* @param existingSchemas - Current schemas (including self-asserted and collection)
|
|
44
|
+
* @param schemaPath - Path to schema from CLI flag
|
|
45
|
+
* @returns Updated schema list with CLI schema added
|
|
46
|
+
*/
|
|
47
|
+
export function addCLISchema(existingSchemas, schemaPath) {
|
|
48
|
+
// Check if this schema is already present from any source
|
|
49
|
+
const alreadyExists = existingSchemas.some((ref) => ref.schema === schemaPath);
|
|
50
|
+
if (alreadyExists) {
|
|
51
|
+
return existingSchemas;
|
|
52
|
+
}
|
|
53
|
+
// Add CLI-imposed schema
|
|
54
|
+
return [
|
|
55
|
+
...existingSchemas,
|
|
56
|
+
{
|
|
57
|
+
schema: schemaPath,
|
|
58
|
+
source: 'cli',
|
|
59
|
+
applied: false,
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Apply schema assignments to a resource
|
|
65
|
+
*
|
|
66
|
+
* Pipeline order:
|
|
67
|
+
* 1. Self-asserted (already in resource.schemas from parser)
|
|
68
|
+
* 2. Collection-imposed (from each collection the resource belongs to)
|
|
69
|
+
* 3. CLI-imposed (from --frontmatter-schema flag)
|
|
70
|
+
*
|
|
71
|
+
* Deduplicates schemas by path - same schema from multiple sources
|
|
72
|
+
* only appears once (first source wins).
|
|
73
|
+
*
|
|
74
|
+
* @param resourceSchemas - Current schemas (from parser)
|
|
75
|
+
* @param collections - Collections this resource belongs to
|
|
76
|
+
* @param collectionsConfig - Collection configurations
|
|
77
|
+
* @param cliSchema - Optional CLI-imposed schema
|
|
78
|
+
* @returns Complete list of schemas to validate
|
|
79
|
+
*/
|
|
80
|
+
export function assignSchemas(resourceSchemas, collections, collectionsConfig, cliSchema) {
|
|
81
|
+
let schemas = resourceSchemas;
|
|
82
|
+
// Add collection-imposed schemas
|
|
83
|
+
for (const collectionName of collections) {
|
|
84
|
+
const collectionConfig = collectionsConfig[collectionName];
|
|
85
|
+
if (collectionConfig) {
|
|
86
|
+
schemas = addCollectionSchema(schemas, collectionName, collectionConfig);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// Add CLI-imposed schema
|
|
90
|
+
if (cliSchema) {
|
|
91
|
+
schemas = addCLISchema(schemas, cliSchema);
|
|
92
|
+
}
|
|
93
|
+
return schemas;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=schema-assignment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-assignment.js","sourceRoot":"","sources":["../src/schema-assignment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CACjC,eAAkC,EAClC,cAAsB,EACtB,gBAAkC;IAElC,MAAM,UAAU,GAAG,gBAAgB,CAAC,UAAU,EAAE,iBAAiB,CAAC;IAElE,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,eAAe,CAAC;IACzB,CAAC;IAED,0DAA0D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,EAAE,SAAS,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Validation mode for frontmatter schema validation.
|
|
4
|
+
*
|
|
5
|
+
* - `strict`: Enforce schema exactly (respect additionalProperties: false)
|
|
6
|
+
* - `permissive`: Allow extra fields (ignore additionalProperties: false)
|
|
7
|
+
*/
|
|
8
|
+
export declare const ValidationModeSchema: z.ZodEnum<["strict", "permissive"]>;
|
|
9
|
+
export type ValidationMode = z.infer<typeof ValidationModeSchema>;
|
|
10
|
+
/**
|
|
11
|
+
* Validation configuration for a collection.
|
|
12
|
+
*/
|
|
13
|
+
export declare const CollectionValidationSchema: z.ZodObject<{
|
|
14
|
+
frontmatterSchema: z.ZodOptional<z.ZodString>;
|
|
15
|
+
mode: z.ZodOptional<z.ZodEnum<["strict", "permissive"]>>;
|
|
16
|
+
checkUrlLinks: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
checkGitIgnored: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
frontmatterSchema?: string | undefined;
|
|
20
|
+
mode?: "strict" | "permissive" | undefined;
|
|
21
|
+
checkUrlLinks?: boolean | undefined;
|
|
22
|
+
checkGitIgnored?: boolean | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
frontmatterSchema?: string | undefined;
|
|
25
|
+
mode?: "strict" | "permissive" | undefined;
|
|
26
|
+
checkUrlLinks?: boolean | undefined;
|
|
27
|
+
checkGitIgnored?: boolean | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
export type CollectionValidation = z.infer<typeof CollectionValidationSchema>;
|
|
30
|
+
/**
|
|
31
|
+
* Configuration for a named collection of resources.
|
|
32
|
+
*
|
|
33
|
+
* Collections define include/exclude patterns and validation rules.
|
|
34
|
+
* A file can belong to multiple collections.
|
|
35
|
+
*/
|
|
36
|
+
export declare const CollectionConfigSchema: z.ZodObject<{
|
|
37
|
+
include: z.ZodArray<z.ZodString, "many">;
|
|
38
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
39
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
40
|
+
frontmatterSchema: z.ZodOptional<z.ZodString>;
|
|
41
|
+
mode: z.ZodOptional<z.ZodEnum<["strict", "permissive"]>>;
|
|
42
|
+
checkUrlLinks: z.ZodOptional<z.ZodBoolean>;
|
|
43
|
+
checkGitIgnored: z.ZodOptional<z.ZodBoolean>;
|
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
|
45
|
+
frontmatterSchema?: string | undefined;
|
|
46
|
+
mode?: "strict" | "permissive" | undefined;
|
|
47
|
+
checkUrlLinks?: boolean | undefined;
|
|
48
|
+
checkGitIgnored?: boolean | undefined;
|
|
49
|
+
}, {
|
|
50
|
+
frontmatterSchema?: string | undefined;
|
|
51
|
+
mode?: "strict" | "permissive" | undefined;
|
|
52
|
+
checkUrlLinks?: boolean | undefined;
|
|
53
|
+
checkGitIgnored?: boolean | undefined;
|
|
54
|
+
}>>;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
include: string[];
|
|
57
|
+
validation?: {
|
|
58
|
+
frontmatterSchema?: string | undefined;
|
|
59
|
+
mode?: "strict" | "permissive" | undefined;
|
|
60
|
+
checkUrlLinks?: boolean | undefined;
|
|
61
|
+
checkGitIgnored?: boolean | undefined;
|
|
62
|
+
} | undefined;
|
|
63
|
+
exclude?: string[] | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
include: string[];
|
|
66
|
+
validation?: {
|
|
67
|
+
frontmatterSchema?: string | undefined;
|
|
68
|
+
mode?: "strict" | "permissive" | undefined;
|
|
69
|
+
checkUrlLinks?: boolean | undefined;
|
|
70
|
+
checkGitIgnored?: boolean | undefined;
|
|
71
|
+
} | undefined;
|
|
72
|
+
exclude?: string[] | undefined;
|
|
73
|
+
}>;
|
|
74
|
+
export type CollectionConfig = z.infer<typeof CollectionConfigSchema>;
|
|
75
|
+
/**
|
|
76
|
+
* Resources section of project configuration.
|
|
77
|
+
*/
|
|
78
|
+
export declare const ResourcesConfigSchema: z.ZodObject<{
|
|
79
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
80
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
81
|
+
collections: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
82
|
+
include: z.ZodArray<z.ZodString, "many">;
|
|
83
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
84
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
85
|
+
frontmatterSchema: z.ZodOptional<z.ZodString>;
|
|
86
|
+
mode: z.ZodOptional<z.ZodEnum<["strict", "permissive"]>>;
|
|
87
|
+
checkUrlLinks: z.ZodOptional<z.ZodBoolean>;
|
|
88
|
+
checkGitIgnored: z.ZodOptional<z.ZodBoolean>;
|
|
89
|
+
}, "strip", z.ZodTypeAny, {
|
|
90
|
+
frontmatterSchema?: string | undefined;
|
|
91
|
+
mode?: "strict" | "permissive" | undefined;
|
|
92
|
+
checkUrlLinks?: boolean | undefined;
|
|
93
|
+
checkGitIgnored?: boolean | undefined;
|
|
94
|
+
}, {
|
|
95
|
+
frontmatterSchema?: string | undefined;
|
|
96
|
+
mode?: "strict" | "permissive" | undefined;
|
|
97
|
+
checkUrlLinks?: boolean | undefined;
|
|
98
|
+
checkGitIgnored?: boolean | undefined;
|
|
99
|
+
}>>;
|
|
100
|
+
}, "strip", z.ZodTypeAny, {
|
|
101
|
+
include: string[];
|
|
102
|
+
validation?: {
|
|
103
|
+
frontmatterSchema?: string | undefined;
|
|
104
|
+
mode?: "strict" | "permissive" | undefined;
|
|
105
|
+
checkUrlLinks?: boolean | undefined;
|
|
106
|
+
checkGitIgnored?: boolean | undefined;
|
|
107
|
+
} | undefined;
|
|
108
|
+
exclude?: string[] | undefined;
|
|
109
|
+
}, {
|
|
110
|
+
include: string[];
|
|
111
|
+
validation?: {
|
|
112
|
+
frontmatterSchema?: string | undefined;
|
|
113
|
+
mode?: "strict" | "permissive" | undefined;
|
|
114
|
+
checkUrlLinks?: boolean | undefined;
|
|
115
|
+
checkGitIgnored?: boolean | undefined;
|
|
116
|
+
} | undefined;
|
|
117
|
+
exclude?: string[] | undefined;
|
|
118
|
+
}>>;
|
|
119
|
+
}, "strip", z.ZodTypeAny, {
|
|
120
|
+
collections: Record<string, {
|
|
121
|
+
include: string[];
|
|
122
|
+
validation?: {
|
|
123
|
+
frontmatterSchema?: string | undefined;
|
|
124
|
+
mode?: "strict" | "permissive" | undefined;
|
|
125
|
+
checkUrlLinks?: boolean | undefined;
|
|
126
|
+
checkGitIgnored?: boolean | undefined;
|
|
127
|
+
} | undefined;
|
|
128
|
+
exclude?: string[] | undefined;
|
|
129
|
+
}>;
|
|
130
|
+
include?: string[] | undefined;
|
|
131
|
+
exclude?: string[] | undefined;
|
|
132
|
+
}, {
|
|
133
|
+
collections: Record<string, {
|
|
134
|
+
include: string[];
|
|
135
|
+
validation?: {
|
|
136
|
+
frontmatterSchema?: string | undefined;
|
|
137
|
+
mode?: "strict" | "permissive" | undefined;
|
|
138
|
+
checkUrlLinks?: boolean | undefined;
|
|
139
|
+
checkGitIgnored?: boolean | undefined;
|
|
140
|
+
} | undefined;
|
|
141
|
+
exclude?: string[] | undefined;
|
|
142
|
+
}>;
|
|
143
|
+
include?: string[] | undefined;
|
|
144
|
+
exclude?: string[] | undefined;
|
|
145
|
+
}>;
|
|
146
|
+
export type ResourcesConfig = z.infer<typeof ResourcesConfigSchema>;
|
|
147
|
+
/**
|
|
148
|
+
* Complete project configuration schema.
|
|
149
|
+
*/
|
|
150
|
+
export declare const ProjectConfigSchema: z.ZodObject<{
|
|
151
|
+
version: z.ZodLiteral<1>;
|
|
152
|
+
resources: z.ZodOptional<z.ZodObject<{
|
|
153
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
154
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
155
|
+
collections: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
156
|
+
include: z.ZodArray<z.ZodString, "many">;
|
|
157
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
158
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
159
|
+
frontmatterSchema: z.ZodOptional<z.ZodString>;
|
|
160
|
+
mode: z.ZodOptional<z.ZodEnum<["strict", "permissive"]>>;
|
|
161
|
+
checkUrlLinks: z.ZodOptional<z.ZodBoolean>;
|
|
162
|
+
checkGitIgnored: z.ZodOptional<z.ZodBoolean>;
|
|
163
|
+
}, "strip", z.ZodTypeAny, {
|
|
164
|
+
frontmatterSchema?: string | undefined;
|
|
165
|
+
mode?: "strict" | "permissive" | undefined;
|
|
166
|
+
checkUrlLinks?: boolean | undefined;
|
|
167
|
+
checkGitIgnored?: boolean | undefined;
|
|
168
|
+
}, {
|
|
169
|
+
frontmatterSchema?: string | undefined;
|
|
170
|
+
mode?: "strict" | "permissive" | undefined;
|
|
171
|
+
checkUrlLinks?: boolean | undefined;
|
|
172
|
+
checkGitIgnored?: boolean | undefined;
|
|
173
|
+
}>>;
|
|
174
|
+
}, "strip", z.ZodTypeAny, {
|
|
175
|
+
include: string[];
|
|
176
|
+
validation?: {
|
|
177
|
+
frontmatterSchema?: string | undefined;
|
|
178
|
+
mode?: "strict" | "permissive" | undefined;
|
|
179
|
+
checkUrlLinks?: boolean | undefined;
|
|
180
|
+
checkGitIgnored?: boolean | undefined;
|
|
181
|
+
} | undefined;
|
|
182
|
+
exclude?: string[] | undefined;
|
|
183
|
+
}, {
|
|
184
|
+
include: string[];
|
|
185
|
+
validation?: {
|
|
186
|
+
frontmatterSchema?: string | undefined;
|
|
187
|
+
mode?: "strict" | "permissive" | undefined;
|
|
188
|
+
checkUrlLinks?: boolean | undefined;
|
|
189
|
+
checkGitIgnored?: boolean | undefined;
|
|
190
|
+
} | undefined;
|
|
191
|
+
exclude?: string[] | undefined;
|
|
192
|
+
}>>;
|
|
193
|
+
}, "strip", z.ZodTypeAny, {
|
|
194
|
+
collections: Record<string, {
|
|
195
|
+
include: string[];
|
|
196
|
+
validation?: {
|
|
197
|
+
frontmatterSchema?: string | undefined;
|
|
198
|
+
mode?: "strict" | "permissive" | undefined;
|
|
199
|
+
checkUrlLinks?: boolean | undefined;
|
|
200
|
+
checkGitIgnored?: boolean | undefined;
|
|
201
|
+
} | undefined;
|
|
202
|
+
exclude?: string[] | undefined;
|
|
203
|
+
}>;
|
|
204
|
+
include?: string[] | undefined;
|
|
205
|
+
exclude?: string[] | undefined;
|
|
206
|
+
}, {
|
|
207
|
+
collections: Record<string, {
|
|
208
|
+
include: string[];
|
|
209
|
+
validation?: {
|
|
210
|
+
frontmatterSchema?: string | undefined;
|
|
211
|
+
mode?: "strict" | "permissive" | undefined;
|
|
212
|
+
checkUrlLinks?: boolean | undefined;
|
|
213
|
+
checkGitIgnored?: boolean | undefined;
|
|
214
|
+
} | undefined;
|
|
215
|
+
exclude?: string[] | undefined;
|
|
216
|
+
}>;
|
|
217
|
+
include?: string[] | undefined;
|
|
218
|
+
exclude?: string[] | undefined;
|
|
219
|
+
}>>;
|
|
220
|
+
}, "strip", z.ZodTypeAny, {
|
|
221
|
+
version: 1;
|
|
222
|
+
resources?: {
|
|
223
|
+
collections: Record<string, {
|
|
224
|
+
include: string[];
|
|
225
|
+
validation?: {
|
|
226
|
+
frontmatterSchema?: string | undefined;
|
|
227
|
+
mode?: "strict" | "permissive" | undefined;
|
|
228
|
+
checkUrlLinks?: boolean | undefined;
|
|
229
|
+
checkGitIgnored?: boolean | undefined;
|
|
230
|
+
} | undefined;
|
|
231
|
+
exclude?: string[] | undefined;
|
|
232
|
+
}>;
|
|
233
|
+
include?: string[] | undefined;
|
|
234
|
+
exclude?: string[] | undefined;
|
|
235
|
+
} | undefined;
|
|
236
|
+
}, {
|
|
237
|
+
version: 1;
|
|
238
|
+
resources?: {
|
|
239
|
+
collections: Record<string, {
|
|
240
|
+
include: string[];
|
|
241
|
+
validation?: {
|
|
242
|
+
frontmatterSchema?: string | undefined;
|
|
243
|
+
mode?: "strict" | "permissive" | undefined;
|
|
244
|
+
checkUrlLinks?: boolean | undefined;
|
|
245
|
+
checkGitIgnored?: boolean | undefined;
|
|
246
|
+
} | undefined;
|
|
247
|
+
exclude?: string[] | undefined;
|
|
248
|
+
}>;
|
|
249
|
+
include?: string[] | undefined;
|
|
250
|
+
exclude?: string[] | undefined;
|
|
251
|
+
} | undefined;
|
|
252
|
+
}>;
|
|
253
|
+
export type ProjectConfig = z.infer<typeof ProjectConfigSchema>;
|
|
254
|
+
//# sourceMappingURL=project-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-config.d.ts","sourceRoot":"","sources":["../../src/schemas/project-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,qCAC+B,CAAC;AAEjE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;EASiB,CAAC;AAEzD,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO6B,CAAC;AAEjE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOuB,CAAC;AAE1D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKuB,CAAC;AAExD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Validation mode for frontmatter schema validation.
|
|
4
|
+
*
|
|
5
|
+
* - `strict`: Enforce schema exactly (respect additionalProperties: false)
|
|
6
|
+
* - `permissive`: Allow extra fields (ignore additionalProperties: false)
|
|
7
|
+
*/
|
|
8
|
+
export const ValidationModeSchema = z.enum(['strict', 'permissive'])
|
|
9
|
+
.describe('Validation mode for frontmatter schema validation');
|
|
10
|
+
/**
|
|
11
|
+
* Validation configuration for a collection.
|
|
12
|
+
*/
|
|
13
|
+
export const CollectionValidationSchema = z.object({
|
|
14
|
+
frontmatterSchema: z.string().optional()
|
|
15
|
+
.describe('Path to JSON Schema file for frontmatter validation (relative to config file or package reference like @vibe-agent-toolkit/schemas/skill.v1.json)'),
|
|
16
|
+
mode: ValidationModeSchema.optional()
|
|
17
|
+
.describe('Validation mode (default: strict)'),
|
|
18
|
+
checkUrlLinks: z.boolean().optional()
|
|
19
|
+
.describe('Whether to validate external URL links (default: false)'),
|
|
20
|
+
checkGitIgnored: z.boolean().optional()
|
|
21
|
+
.describe('Whether to check if non-ignored files link to git-ignored files (default: true)'),
|
|
22
|
+
}).describe('Validation configuration for a collection');
|
|
23
|
+
/**
|
|
24
|
+
* Configuration for a named collection of resources.
|
|
25
|
+
*
|
|
26
|
+
* Collections define include/exclude patterns and validation rules.
|
|
27
|
+
* A file can belong to multiple collections.
|
|
28
|
+
*/
|
|
29
|
+
export const CollectionConfigSchema = z.object({
|
|
30
|
+
include: z.array(z.string()).min(1)
|
|
31
|
+
.describe('Include patterns (paths or globs like docs/**/*.md)'),
|
|
32
|
+
exclude: z.array(z.string()).optional()
|
|
33
|
+
.describe('Exclude patterns (globs)'),
|
|
34
|
+
validation: CollectionValidationSchema.optional()
|
|
35
|
+
.describe('Validation configuration for this collection'),
|
|
36
|
+
}).describe('Configuration for a named collection of resources');
|
|
37
|
+
/**
|
|
38
|
+
* Resources section of project configuration.
|
|
39
|
+
*/
|
|
40
|
+
export const ResourcesConfigSchema = z.object({
|
|
41
|
+
include: z.array(z.string()).optional()
|
|
42
|
+
.describe('Global default include patterns (not used by collections in Phase 2)'),
|
|
43
|
+
exclude: z.array(z.string()).optional()
|
|
44
|
+
.describe('Global default exclude patterns (not used by collections in Phase 2)'),
|
|
45
|
+
collections: z.record(z.string(), CollectionConfigSchema)
|
|
46
|
+
.describe('Named collections of resources'),
|
|
47
|
+
}).describe('Resources section of project configuration');
|
|
48
|
+
/**
|
|
49
|
+
* Complete project configuration schema.
|
|
50
|
+
*/
|
|
51
|
+
export const ProjectConfigSchema = z.object({
|
|
52
|
+
version: z.literal(1)
|
|
53
|
+
.describe('Config file version (must be 1)'),
|
|
54
|
+
resources: ResourcesConfigSchema.optional()
|
|
55
|
+
.describe('Resources configuration'),
|
|
56
|
+
}).describe('vibe-agent-toolkit project configuration');
|
|
57
|
+
//# sourceMappingURL=project-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-config.js","sourceRoot":"","sources":["../../src/schemas/project-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;KACjE,QAAQ,CAA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,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;SACpC,QAAQ,CAAC,sEAAsE,CAAC;IACnF,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,sBAAsB,CAAC;SACtD,QAAQ,CAAC,gCAAgC,CAAC;CAC9C,CAAC,CAAC,QAAQ,CAAC,4CAA4C,CAAC,CAAC;AAI1D;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;SAClB,QAAQ,CAAC,iCAAiC,CAAC;IAC9C,SAAS,EAAE,qBAAqB,CAAC,QAAQ,EAAE;SACxC,QAAQ,CAAC,yBAAyB,CAAC;CACvC,CAAC,CAAC,QAAQ,CAAC,0CAA0C,CAAC,CAAC"}
|
|
@@ -66,7 +66,7 @@ export type ResourceLink = z.infer<typeof ResourceLinkSchema>;
|
|
|
66
66
|
* Complete metadata for a markdown resource.
|
|
67
67
|
*
|
|
68
68
|
* Includes all parsed information about the resource: its links, headings structure,
|
|
69
|
-
* file stats, and identifiers.
|
|
69
|
+
* file stats, and identifiers. Supports YAML frontmatter parsing.
|
|
70
70
|
*/
|
|
71
71
|
export declare const ResourceMetadataSchema: z.ZodObject<{
|
|
72
72
|
id: z.ZodString;
|
|
@@ -97,10 +97,13 @@ export declare const ResourceMetadataSchema: z.ZodObject<{
|
|
|
97
97
|
resolvedId?: string | undefined;
|
|
98
98
|
}>, "many">;
|
|
99
99
|
headings: z.ZodArray<z.ZodType<HeadingNode, z.ZodTypeDef, HeadingNode>, "many">;
|
|
100
|
+
frontmatter: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
101
|
+
frontmatterError: z.ZodOptional<z.ZodString>;
|
|
100
102
|
sizeBytes: z.ZodNumber;
|
|
101
103
|
estimatedTokenCount: z.ZodNumber;
|
|
102
104
|
modifiedAt: z.ZodDate;
|
|
103
105
|
checksum: z.ZodBranded<z.ZodString, "SHA256">;
|
|
106
|
+
collections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
104
107
|
}, "strip", z.ZodTypeAny, {
|
|
105
108
|
id: string;
|
|
106
109
|
filePath: string;
|
|
@@ -118,6 +121,9 @@ export declare const ResourceMetadataSchema: z.ZodObject<{
|
|
|
118
121
|
estimatedTokenCount: number;
|
|
119
122
|
modifiedAt: Date;
|
|
120
123
|
checksum: string & z.BRAND<"SHA256">;
|
|
124
|
+
collections?: string[] | undefined;
|
|
125
|
+
frontmatter?: Record<string, unknown> | undefined;
|
|
126
|
+
frontmatterError?: string | undefined;
|
|
121
127
|
}, {
|
|
122
128
|
id: string;
|
|
123
129
|
filePath: string;
|
|
@@ -135,6 +141,9 @@ export declare const ResourceMetadataSchema: z.ZodObject<{
|
|
|
135
141
|
estimatedTokenCount: number;
|
|
136
142
|
modifiedAt: Date;
|
|
137
143
|
checksum: string;
|
|
144
|
+
collections?: string[] | undefined;
|
|
145
|
+
frontmatter?: Record<string, unknown> | undefined;
|
|
146
|
+
frontmatterError?: string | undefined;
|
|
138
147
|
}>;
|
|
139
148
|
export type ResourceMetadata = z.infer<typeof ResourceMetadataSchema>;
|
|
140
149
|
//# sourceMappingURL=resource-metadata.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-metadata.d.ts","sourceRoot":"","sources":["../../src/schemas/resource-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,qEAM4B,CAAC;AAExD,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;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D;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAeqB,CAAC;AAEzD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -48,16 +48,22 @@ export const ResourceLinkSchema = z.object({
|
|
|
48
48
|
* Complete metadata for a markdown resource.
|
|
49
49
|
*
|
|
50
50
|
* Includes all parsed information about the resource: its links, headings structure,
|
|
51
|
-
* file stats, and identifiers.
|
|
51
|
+
* file stats, and identifiers. Supports YAML frontmatter parsing.
|
|
52
52
|
*/
|
|
53
53
|
export const ResourceMetadataSchema = z.object({
|
|
54
54
|
id: z.string().describe('Unique identifier (inferred from filePath or overridden by frontmatter)'),
|
|
55
55
|
filePath: z.string().describe('Absolute path to the resource file'),
|
|
56
56
|
links: z.array(ResourceLinkSchema).describe('All links found in the resource'),
|
|
57
57
|
headings: z.array(HeadingNodeSchema).describe('Document table of contents (top-level headings only; children are nested)'),
|
|
58
|
+
frontmatter: z.record(z.string(), z.unknown()).optional()
|
|
59
|
+
.describe('Parsed YAML frontmatter (if present in markdown file)'),
|
|
60
|
+
frontmatterError: z.string().optional()
|
|
61
|
+
.describe('YAML parsing error message (if frontmatter contains invalid YAML syntax)'),
|
|
58
62
|
sizeBytes: z.number().int().nonnegative().describe('File size in bytes'),
|
|
59
63
|
estimatedTokenCount: z.number().int().nonnegative().describe('Estimated token count for LLM context (roughly 1 token per 4 chars)'),
|
|
60
64
|
modifiedAt: z.date().describe('Last modified timestamp'),
|
|
61
65
|
checksum: SHA256Schema.describe('SHA-256 checksum of file content'),
|
|
66
|
+
collections: z.array(z.string()).optional()
|
|
67
|
+
.describe('Collection names this resource belongs to (populated when using config-based discovery)'),
|
|
62
68
|
}).describe('Complete metadata for a markdown resource');
|
|
63
69
|
//# sourceMappingURL=resource-metadata.js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,2EAA2E,CAAC;IAC1H,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;SACtD,QAAQ,CAAC,uDAAuD,CAAC;IACpE,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;SACpC,QAAQ,CAAC,0EAA0E,CAAC;IACvF,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;IACxE,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,qEAAqE,CAAC;IACnI,UAAU,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;IACxD,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IACnE,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;SACxC,QAAQ,CAAC,yFAAyF,CAAC;CACvG,CAAC,CAAC,QAAQ,CAAC,2CAA2C,CAAC,CAAC"}
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Severity level for validation issues.
|
|
4
|
-
*
|
|
5
|
-
* - `error`: Critical issue that should block usage (e.g., broken file link)
|
|
6
|
-
* - `warning`: Non-critical issue that should be addressed (e.g., questionable link format)
|
|
7
|
-
* - `info`: Informational message (e.g., external URL not validated)
|
|
8
|
-
*/
|
|
9
|
-
export declare const ValidationSeveritySchema: z.ZodEnum<["error", "warning", "info"]>;
|
|
10
|
-
export type ValidationSeverity = z.infer<typeof ValidationSeveritySchema>;
|
|
11
2
|
/**
|
|
12
3
|
* A single validation issue found during link validation.
|
|
13
4
|
*
|
|
5
|
+
* Issue types:
|
|
6
|
+
* - broken_file: Local file link points to non-existent file
|
|
7
|
+
* - broken_anchor: Anchor link points to non-existent heading
|
|
8
|
+
* - frontmatter_missing: Schema requires frontmatter, file has none
|
|
9
|
+
* - frontmatter_invalid_yaml: YAML syntax error in frontmatter
|
|
10
|
+
* - frontmatter_schema_error: Frontmatter fails JSON Schema validation
|
|
11
|
+
* - unknown_link: Unknown link type
|
|
12
|
+
*
|
|
14
13
|
* Includes details about what went wrong, where it occurred, and optionally
|
|
15
14
|
* how to fix it.
|
|
16
15
|
*/
|
|
17
16
|
export declare const ValidationIssueSchema: z.ZodObject<{
|
|
18
|
-
severity: z.ZodEnum<["error", "warning", "info"]>;
|
|
19
17
|
resourcePath: z.ZodString;
|
|
20
18
|
line: z.ZodOptional<z.ZodNumber>;
|
|
21
19
|
type: z.ZodString;
|
|
@@ -26,7 +24,6 @@ export declare const ValidationIssueSchema: z.ZodObject<{
|
|
|
26
24
|
message: string;
|
|
27
25
|
type: string;
|
|
28
26
|
link: string;
|
|
29
|
-
severity: "error" | "warning" | "info";
|
|
30
27
|
resourcePath: string;
|
|
31
28
|
line?: number | undefined;
|
|
32
29
|
suggestion?: string | undefined;
|
|
@@ -34,7 +31,6 @@ export declare const ValidationIssueSchema: z.ZodObject<{
|
|
|
34
31
|
message: string;
|
|
35
32
|
type: string;
|
|
36
33
|
link: string;
|
|
37
|
-
severity: "error" | "warning" | "info";
|
|
38
34
|
resourcePath: string;
|
|
39
35
|
line?: number | undefined;
|
|
40
36
|
suggestion?: string | undefined;
|
|
@@ -44,14 +40,13 @@ export type ValidationIssue = z.infer<typeof ValidationIssueSchema>;
|
|
|
44
40
|
* Complete results from validating a collection of resources.
|
|
45
41
|
*
|
|
46
42
|
* Provides summary statistics, detailed issues, and validation metadata.
|
|
47
|
-
* The `passed` field indicates whether validation succeeded (no
|
|
43
|
+
* The `passed` field indicates whether validation succeeded (no issues found).
|
|
48
44
|
*/
|
|
49
45
|
export declare const ValidationResultSchema: z.ZodObject<{
|
|
50
46
|
totalResources: z.ZodNumber;
|
|
51
47
|
totalLinks: z.ZodNumber;
|
|
52
48
|
linksByType: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
53
49
|
issues: z.ZodArray<z.ZodObject<{
|
|
54
|
-
severity: z.ZodEnum<["error", "warning", "info"]>;
|
|
55
50
|
resourcePath: z.ZodString;
|
|
56
51
|
line: z.ZodOptional<z.ZodNumber>;
|
|
57
52
|
type: z.ZodString;
|
|
@@ -62,7 +57,6 @@ export declare const ValidationResultSchema: z.ZodObject<{
|
|
|
62
57
|
message: string;
|
|
63
58
|
type: string;
|
|
64
59
|
link: string;
|
|
65
|
-
severity: "error" | "warning" | "info";
|
|
66
60
|
resourcePath: string;
|
|
67
61
|
line?: number | undefined;
|
|
68
62
|
suggestion?: string | undefined;
|
|
@@ -70,14 +64,11 @@ export declare const ValidationResultSchema: z.ZodObject<{
|
|
|
70
64
|
message: string;
|
|
71
65
|
type: string;
|
|
72
66
|
link: string;
|
|
73
|
-
severity: "error" | "warning" | "info";
|
|
74
67
|
resourcePath: string;
|
|
75
68
|
line?: number | undefined;
|
|
76
69
|
suggestion?: string | undefined;
|
|
77
70
|
}>, "many">;
|
|
78
71
|
errorCount: z.ZodNumber;
|
|
79
|
-
warningCount: z.ZodNumber;
|
|
80
|
-
infoCount: z.ZodNumber;
|
|
81
72
|
passed: z.ZodBoolean;
|
|
82
73
|
durationMs: z.ZodNumber;
|
|
83
74
|
timestamp: z.ZodDate;
|
|
@@ -86,7 +77,6 @@ export declare const ValidationResultSchema: z.ZodObject<{
|
|
|
86
77
|
message: string;
|
|
87
78
|
type: string;
|
|
88
79
|
link: string;
|
|
89
|
-
severity: "error" | "warning" | "info";
|
|
90
80
|
resourcePath: string;
|
|
91
81
|
line?: number | undefined;
|
|
92
82
|
suggestion?: string | undefined;
|
|
@@ -95,8 +85,6 @@ export declare const ValidationResultSchema: z.ZodObject<{
|
|
|
95
85
|
totalLinks: number;
|
|
96
86
|
linksByType: Record<string, number>;
|
|
97
87
|
errorCount: number;
|
|
98
|
-
warningCount: number;
|
|
99
|
-
infoCount: number;
|
|
100
88
|
passed: boolean;
|
|
101
89
|
durationMs: number;
|
|
102
90
|
timestamp: Date;
|
|
@@ -105,7 +93,6 @@ export declare const ValidationResultSchema: z.ZodObject<{
|
|
|
105
93
|
message: string;
|
|
106
94
|
type: string;
|
|
107
95
|
link: string;
|
|
108
|
-
severity: "error" | "warning" | "info";
|
|
109
96
|
resourcePath: string;
|
|
110
97
|
line?: number | undefined;
|
|
111
98
|
suggestion?: string | undefined;
|
|
@@ -114,8 +101,6 @@ export declare const ValidationResultSchema: z.ZodObject<{
|
|
|
114
101
|
totalLinks: number;
|
|
115
102
|
linksByType: Record<string, number>;
|
|
116
103
|
errorCount: number;
|
|
117
|
-
warningCount: number;
|
|
118
|
-
infoCount: number;
|
|
119
104
|
passed: boolean;
|
|
120
105
|
durationMs: number;
|
|
121
106
|
timestamp: Date;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation-result.d.ts","sourceRoot":"","sources":["../../src/schemas/validation-result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB
|
|
1
|
+
{"version":3,"file":"validation-result.d.ts","sourceRoot":"","sources":["../../src/schemas/validation-result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;EAOmC,CAAC;AAEtE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASsC,CAAC;AAE1E,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|