@vibe-agent-toolkit/resources 0.1.39-rc.1 → 0.1.39-rc.10
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/frontmatter-link-validator.d.ts +4 -4
- package/dist/frontmatter-link-validator.d.ts.map +1 -1
- package/dist/frontmatter-link-validator.js +3 -3
- package/dist/frontmatter-link-validator.js.map +1 -1
- package/dist/html-link-parser.d.ts +47 -0
- package/dist/html-link-parser.d.ts.map +1 -0
- package/dist/html-link-parser.js +111 -0
- package/dist/html-link-parser.js.map +1 -0
- package/dist/html-transform.d.ts +45 -0
- package/dist/html-transform.d.ts.map +1 -0
- package/dist/html-transform.js +116 -0
- package/dist/html-transform.js.map +1 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/link-parser.d.ts +26 -2
- package/dist/link-parser.d.ts.map +1 -1
- package/dist/link-parser.js +28 -1
- package/dist/link-parser.js.map +1 -1
- package/dist/link-validator.d.ts +50 -3
- package/dist/link-validator.d.ts.map +1 -1
- package/dist/link-validator.js +72 -55
- package/dist/link-validator.js.map +1 -1
- package/dist/resource-registry.d.ts +46 -11
- package/dist/resource-registry.d.ts.map +1 -1
- package/dist/resource-registry.js +140 -34
- package/dist/resource-registry.js.map +1 -1
- package/dist/schemas/link-auth.d.ts +382 -0
- package/dist/schemas/link-auth.d.ts.map +1 -0
- package/dist/schemas/link-auth.js +124 -0
- package/dist/schemas/link-auth.js.map +1 -0
- package/dist/schemas/project-config.d.ts +3156 -98
- package/dist/schemas/project-config.d.ts.map +1 -1
- package/dist/schemas/project-config.js +66 -0
- package/dist/schemas/project-config.js.map +1 -1
- package/dist/schemas/resource-metadata.d.ts +46 -10
- package/dist/schemas/resource-metadata.d.ts.map +1 -1
- package/dist/schemas/resource-metadata.js +14 -1
- package/dist/schemas/resource-metadata.js.map +1 -1
- package/package.json +4 -3
- package/src/frontmatter-link-validator.ts +5 -5
- package/src/html-link-parser.ts +140 -0
- package/src/html-transform.ts +157 -0
- package/src/index.ts +10 -1
- package/src/link-parser.ts +35 -2
- package/src/link-validator.ts +102 -82
- package/src/resource-registry.ts +157 -39
- package/src/schemas/link-auth.ts +146 -0
- package/src/schemas/project-config.ts +74 -0
- package/src/schemas/resource-metadata.ts +17 -1
|
@@ -6,6 +6,7 @@ import { SHA256Schema } from './checksum.js';
|
|
|
6
6
|
* Type of link found in markdown resources.
|
|
7
7
|
*
|
|
8
8
|
* - `local_file`: Link to a local file (relative or absolute path)
|
|
9
|
+
* - `local_directory`: Link to a local directory, e.g. a ref ending in `/`
|
|
9
10
|
* - `anchor`: Link to a heading anchor (e.g., #heading-slug)
|
|
10
11
|
* - `external`: HTTP/HTTPS URL to external resource
|
|
11
12
|
* - `email`: Mailto link
|
|
@@ -13,6 +14,7 @@ import { SHA256Schema } from './checksum.js';
|
|
|
13
14
|
*/
|
|
14
15
|
export const LinkTypeSchema = z.enum([
|
|
15
16
|
'local_file',
|
|
17
|
+
'local_directory',
|
|
16
18
|
'anchor',
|
|
17
19
|
'external',
|
|
18
20
|
'email',
|
|
@@ -36,6 +38,16 @@ export const LinkNodeTypeSchema = z.enum([
|
|
|
36
38
|
|
|
37
39
|
export type LinkNodeType = z.infer<typeof LinkNodeTypeSchema>;
|
|
38
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Zod schema for an HTML well-formedness diagnostic.
|
|
43
|
+
*/
|
|
44
|
+
export const HtmlParseErrorSchema = z.object({
|
|
45
|
+
message: z.string().describe('parse5 error code (e.g. "missing-end-tag")'),
|
|
46
|
+
line: z.number().int().positive().optional().describe('1-based source line, when known'),
|
|
47
|
+
}).describe('HTML well-formedness diagnostic');
|
|
48
|
+
|
|
49
|
+
export type HtmlParseError = z.infer<typeof HtmlParseErrorSchema>;
|
|
50
|
+
|
|
39
51
|
/**
|
|
40
52
|
* Represents a heading node in the document's table of contents.
|
|
41
53
|
*
|
|
@@ -96,6 +108,10 @@ export const ResourceMetadataSchema = z.object({
|
|
|
96
108
|
filePath: z.string().describe('Absolute path to the resource file'),
|
|
97
109
|
links: z.array(ResourceLinkSchema).describe('All links found in the resource'),
|
|
98
110
|
headings: z.array(HeadingNodeSchema).describe('Document table of contents (top-level headings only; children are nested)'),
|
|
111
|
+
anchors: z.array(z.string()).optional()
|
|
112
|
+
.describe('Fragment targets for anchor validation (HTML id/name attributes)'),
|
|
113
|
+
parseErrors: z.array(HtmlParseErrorSchema).optional()
|
|
114
|
+
.describe('HTML well-formedness diagnostics (populated for HTML resources only)'),
|
|
99
115
|
frontmatter: z.record(z.string(), z.unknown()).optional()
|
|
100
116
|
.describe('Parsed YAML frontmatter (if present in markdown file)'),
|
|
101
117
|
frontmatterError: z.string().optional()
|
|
@@ -106,6 +122,6 @@ export const ResourceMetadataSchema = z.object({
|
|
|
106
122
|
checksum: SHA256Schema.describe('SHA-256 checksum of file content'),
|
|
107
123
|
collections: z.array(z.string()).optional()
|
|
108
124
|
.describe('Collection names this resource belongs to (populated when using config-based discovery)'),
|
|
109
|
-
}).describe('Complete metadata for a markdown resource');
|
|
125
|
+
}).strict().describe('Complete metadata for a markdown resource');
|
|
110
126
|
|
|
111
127
|
export type ResourceMetadata = z.infer<typeof ResourceMetadataSchema>;
|