@first-tree-ai/context-tree 0.0.1 → 0.1.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/LICENSE +201 -0
- package/README.md +91 -0
- package/dist/cli/index.d.mts +1 -0
- package/dist/cli/index.mjs +95 -0
- package/dist/index.d.mts +29 -0
- package/dist/index.mjs +3 -0
- package/dist/schemas-BJXFTfxw.d.mts +359 -0
- package/dist/schemas-D0Qt1bWc.mjs +207 -0
- package/dist/schemas.d.mts +2 -0
- package/dist/schemas.mjs +2 -0
- package/dist/src-Ce9BtETD.mjs +794 -0
- package/docs/specification.md +74 -0
- package/examples/basic/NODE.md +11 -0
- package/examples/basic/SCOPE.md +7 -0
- package/examples/basic/members/NODE.md +6 -0
- package/examples/basic/members/example-owner/NODE.md +10 -0
- package/examples/basic/systems/NODE.md +7 -0
- package/examples/basic/systems/runtime.md +16 -0
- package/package.json +75 -8
- package/policy/context-tree-policy.md +129 -0
- package/skills/context-tree-init/SKILL.md +43 -0
- package/skills/context-tree-init/agents/openai.yaml +4 -0
- package/skills/context-tree-read/SKILL.md +43 -0
- package/skills/context-tree-read/agents/openai.yaml +4 -0
- package/skills/context-tree-write/SKILL.md +59 -0
- package/skills/context-tree-write/agents/openai.yaml +4 -0
- package/templates/member-node.md +13 -0
- package/templates/members-index.md +9 -0
- package/templates/root-node.md +15 -0
- package/templates/scope.md +5 -0
- package/templates/validate-context-tree.yml +16 -0
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/schemas.d.ts
|
|
4
|
+
declare const SCHEMA_VERSION: 1;
|
|
5
|
+
declare const CONTEXT_TREE_SCOPE_MAX_BYTES: number;
|
|
6
|
+
declare const VALIDATION_CODES: {
|
|
7
|
+
readonly rootMissing: "TREE_ROOT_MISSING";
|
|
8
|
+
readonly directoryNodeMissing: "TREE_DIRECTORY_NODE_MISSING";
|
|
9
|
+
readonly scopeInvalid: "TREE_SCOPE_INVALID";
|
|
10
|
+
readonly frontmatterMissing: "TREE_FRONTMATTER_MISSING";
|
|
11
|
+
readonly frontmatterParse: "TREE_FRONTMATTER_PARSE";
|
|
12
|
+
readonly titleMissing: "TREE_TITLE_MISSING";
|
|
13
|
+
readonly titleInvalid: "TREE_TITLE_INVALID";
|
|
14
|
+
readonly ownersMissing: "TREE_OWNERS_MISSING";
|
|
15
|
+
readonly ownersInvalid: "TREE_OWNERS_INVALID";
|
|
16
|
+
readonly descriptionInvalid: "TREE_DESCRIPTION_INVALID";
|
|
17
|
+
readonly softLinksInvalid: "TREE_SOFT_LINKS_INVALID";
|
|
18
|
+
readonly softLinkBroken: "TREE_SOFT_LINK_BROKEN";
|
|
19
|
+
readonly softLinkPathEscape: "TREE_SOFT_LINK_PATH_ESCAPE";
|
|
20
|
+
readonly softLinkArchiveDependency: "TREE_SOFT_LINK_ARCHIVE_DEPENDENCY";
|
|
21
|
+
readonly markdownPathEscape: "TREE_MARKDOWN_LINK_PATH_ESCAPE";
|
|
22
|
+
readonly markdownArchiveDependency: "TREE_MARKDOWN_LINK_ARCHIVE_DEPENDENCY";
|
|
23
|
+
readonly markdownFileSymlinkBroken: "TREE_MARKDOWN_FILE_SYMLINK_BROKEN";
|
|
24
|
+
readonly markdownFileSymlinkUnsupported: "TREE_MARKDOWN_FILE_SYMLINK_UNSUPPORTED";
|
|
25
|
+
readonly markdownFilePathEscape: "TREE_MARKDOWN_FILE_PATH_ESCAPE";
|
|
26
|
+
readonly markdownFileContentClassMismatch: "TREE_MARKDOWN_FILE_CONTENT_CLASS_MISMATCH";
|
|
27
|
+
readonly directorySymlinkUnsupported: "TREE_DIRECTORY_SYMLINK_UNSUPPORTED";
|
|
28
|
+
readonly directorySymlinkPathEscape: "TREE_DIRECTORY_SYMLINK_PATH_ESCAPE";
|
|
29
|
+
readonly memberFrontmatterMissing: "TREE_MEMBER_FRONTMATTER_MISSING";
|
|
30
|
+
readonly memberFrontmatterParse: "TREE_MEMBER_FRONTMATTER_PARSE";
|
|
31
|
+
readonly memberTitleInvalid: "TREE_MEMBER_TITLE_INVALID";
|
|
32
|
+
readonly memberOwnersMissing: "TREE_MEMBER_OWNERS_MISSING";
|
|
33
|
+
readonly memberOwnersInvalid: "TREE_MEMBER_OWNERS_INVALID";
|
|
34
|
+
readonly memberTypeMissing: "TREE_MEMBER_TYPE_MISSING";
|
|
35
|
+
readonly memberTypeInvalid: "TREE_MEMBER_TYPE_INVALID";
|
|
36
|
+
readonly memberTypeShape: "TREE_MEMBER_TYPE_SHAPE";
|
|
37
|
+
readonly memberStatusInvalid: "TREE_MEMBER_STATUS_INVALID";
|
|
38
|
+
readonly memberStatusShape: "TREE_MEMBER_STATUS_SHAPE";
|
|
39
|
+
readonly memberRoleInvalid: "TREE_MEMBER_ROLE_INVALID";
|
|
40
|
+
readonly memberRoleShape: "TREE_MEMBER_ROLE_SHAPE";
|
|
41
|
+
readonly memberDomainsInvalid: "TREE_MEMBER_DOMAINS_INVALID";
|
|
42
|
+
readonly memberDomainsShape: "TREE_MEMBER_DOMAINS_SHAPE";
|
|
43
|
+
readonly membersDirectoryMissing: "TREE_MEMBERS_DIRECTORY_MISSING";
|
|
44
|
+
readonly memberNodeMissing: "TREE_MEMBER_NODE_MISSING";
|
|
45
|
+
readonly memberNodesEmpty: "TREE_MEMBER_NODES_EMPTY";
|
|
46
|
+
};
|
|
47
|
+
declare const CLI_ERROR_CODES: {
|
|
48
|
+
readonly failed: "CONTEXT_TREE_FAILED";
|
|
49
|
+
};
|
|
50
|
+
declare const credentialFreeRepositoryUrlSchema: z.ZodString;
|
|
51
|
+
declare const contextTreeScopeFrontmatterSchema: z.ZodObject<{
|
|
52
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
53
|
+
relatedRepositories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
54
|
+
}, z.core.$strict>;
|
|
55
|
+
declare const contextTreeScopeSchema: z.ZodObject<{
|
|
56
|
+
frontmatter: z.ZodObject<{
|
|
57
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
58
|
+
relatedRepositories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
59
|
+
}, z.core.$strict>;
|
|
60
|
+
body: z.ZodString;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
type ContextTreeScope = z.infer<typeof contextTreeScopeSchema>;
|
|
63
|
+
declare function parseContextTreeScope(markdown: string): ContextTreeScope;
|
|
64
|
+
declare const contextContentClassSchema: z.ZodEnum<{
|
|
65
|
+
normal: "normal";
|
|
66
|
+
"archive-supporting": "archive-supporting";
|
|
67
|
+
member: "member";
|
|
68
|
+
"repo-infra": "repo-infra";
|
|
69
|
+
}>;
|
|
70
|
+
type ContextContentClass = z.infer<typeof contextContentClassSchema>;
|
|
71
|
+
declare const validationCodeSchema: z.ZodEnum<{
|
|
72
|
+
readonly rootMissing: "TREE_ROOT_MISSING";
|
|
73
|
+
readonly directoryNodeMissing: "TREE_DIRECTORY_NODE_MISSING";
|
|
74
|
+
readonly scopeInvalid: "TREE_SCOPE_INVALID";
|
|
75
|
+
readonly frontmatterMissing: "TREE_FRONTMATTER_MISSING";
|
|
76
|
+
readonly frontmatterParse: "TREE_FRONTMATTER_PARSE";
|
|
77
|
+
readonly titleMissing: "TREE_TITLE_MISSING";
|
|
78
|
+
readonly titleInvalid: "TREE_TITLE_INVALID";
|
|
79
|
+
readonly ownersMissing: "TREE_OWNERS_MISSING";
|
|
80
|
+
readonly ownersInvalid: "TREE_OWNERS_INVALID";
|
|
81
|
+
readonly descriptionInvalid: "TREE_DESCRIPTION_INVALID";
|
|
82
|
+
readonly softLinksInvalid: "TREE_SOFT_LINKS_INVALID";
|
|
83
|
+
readonly softLinkBroken: "TREE_SOFT_LINK_BROKEN";
|
|
84
|
+
readonly softLinkPathEscape: "TREE_SOFT_LINK_PATH_ESCAPE";
|
|
85
|
+
readonly softLinkArchiveDependency: "TREE_SOFT_LINK_ARCHIVE_DEPENDENCY";
|
|
86
|
+
readonly markdownPathEscape: "TREE_MARKDOWN_LINK_PATH_ESCAPE";
|
|
87
|
+
readonly markdownArchiveDependency: "TREE_MARKDOWN_LINK_ARCHIVE_DEPENDENCY";
|
|
88
|
+
readonly markdownFileSymlinkBroken: "TREE_MARKDOWN_FILE_SYMLINK_BROKEN";
|
|
89
|
+
readonly markdownFileSymlinkUnsupported: "TREE_MARKDOWN_FILE_SYMLINK_UNSUPPORTED";
|
|
90
|
+
readonly markdownFilePathEscape: "TREE_MARKDOWN_FILE_PATH_ESCAPE";
|
|
91
|
+
readonly markdownFileContentClassMismatch: "TREE_MARKDOWN_FILE_CONTENT_CLASS_MISMATCH";
|
|
92
|
+
readonly directorySymlinkUnsupported: "TREE_DIRECTORY_SYMLINK_UNSUPPORTED";
|
|
93
|
+
readonly directorySymlinkPathEscape: "TREE_DIRECTORY_SYMLINK_PATH_ESCAPE";
|
|
94
|
+
readonly memberFrontmatterMissing: "TREE_MEMBER_FRONTMATTER_MISSING";
|
|
95
|
+
readonly memberFrontmatterParse: "TREE_MEMBER_FRONTMATTER_PARSE";
|
|
96
|
+
readonly memberTitleInvalid: "TREE_MEMBER_TITLE_INVALID";
|
|
97
|
+
readonly memberOwnersMissing: "TREE_MEMBER_OWNERS_MISSING";
|
|
98
|
+
readonly memberOwnersInvalid: "TREE_MEMBER_OWNERS_INVALID";
|
|
99
|
+
readonly memberTypeMissing: "TREE_MEMBER_TYPE_MISSING";
|
|
100
|
+
readonly memberTypeInvalid: "TREE_MEMBER_TYPE_INVALID";
|
|
101
|
+
readonly memberTypeShape: "TREE_MEMBER_TYPE_SHAPE";
|
|
102
|
+
readonly memberStatusInvalid: "TREE_MEMBER_STATUS_INVALID";
|
|
103
|
+
readonly memberStatusShape: "TREE_MEMBER_STATUS_SHAPE";
|
|
104
|
+
readonly memberRoleInvalid: "TREE_MEMBER_ROLE_INVALID";
|
|
105
|
+
readonly memberRoleShape: "TREE_MEMBER_ROLE_SHAPE";
|
|
106
|
+
readonly memberDomainsInvalid: "TREE_MEMBER_DOMAINS_INVALID";
|
|
107
|
+
readonly memberDomainsShape: "TREE_MEMBER_DOMAINS_SHAPE";
|
|
108
|
+
readonly membersDirectoryMissing: "TREE_MEMBERS_DIRECTORY_MISSING";
|
|
109
|
+
readonly memberNodeMissing: "TREE_MEMBER_NODE_MISSING";
|
|
110
|
+
readonly memberNodesEmpty: "TREE_MEMBER_NODES_EMPTY";
|
|
111
|
+
}>;
|
|
112
|
+
type ValidationCode = z.infer<typeof validationCodeSchema>;
|
|
113
|
+
declare const treeValidationFindingSchema: z.ZodObject<{
|
|
114
|
+
code: z.ZodEnum<{
|
|
115
|
+
readonly rootMissing: "TREE_ROOT_MISSING";
|
|
116
|
+
readonly directoryNodeMissing: "TREE_DIRECTORY_NODE_MISSING";
|
|
117
|
+
readonly scopeInvalid: "TREE_SCOPE_INVALID";
|
|
118
|
+
readonly frontmatterMissing: "TREE_FRONTMATTER_MISSING";
|
|
119
|
+
readonly frontmatterParse: "TREE_FRONTMATTER_PARSE";
|
|
120
|
+
readonly titleMissing: "TREE_TITLE_MISSING";
|
|
121
|
+
readonly titleInvalid: "TREE_TITLE_INVALID";
|
|
122
|
+
readonly ownersMissing: "TREE_OWNERS_MISSING";
|
|
123
|
+
readonly ownersInvalid: "TREE_OWNERS_INVALID";
|
|
124
|
+
readonly descriptionInvalid: "TREE_DESCRIPTION_INVALID";
|
|
125
|
+
readonly softLinksInvalid: "TREE_SOFT_LINKS_INVALID";
|
|
126
|
+
readonly softLinkBroken: "TREE_SOFT_LINK_BROKEN";
|
|
127
|
+
readonly softLinkPathEscape: "TREE_SOFT_LINK_PATH_ESCAPE";
|
|
128
|
+
readonly softLinkArchiveDependency: "TREE_SOFT_LINK_ARCHIVE_DEPENDENCY";
|
|
129
|
+
readonly markdownPathEscape: "TREE_MARKDOWN_LINK_PATH_ESCAPE";
|
|
130
|
+
readonly markdownArchiveDependency: "TREE_MARKDOWN_LINK_ARCHIVE_DEPENDENCY";
|
|
131
|
+
readonly markdownFileSymlinkBroken: "TREE_MARKDOWN_FILE_SYMLINK_BROKEN";
|
|
132
|
+
readonly markdownFileSymlinkUnsupported: "TREE_MARKDOWN_FILE_SYMLINK_UNSUPPORTED";
|
|
133
|
+
readonly markdownFilePathEscape: "TREE_MARKDOWN_FILE_PATH_ESCAPE";
|
|
134
|
+
readonly markdownFileContentClassMismatch: "TREE_MARKDOWN_FILE_CONTENT_CLASS_MISMATCH";
|
|
135
|
+
readonly directorySymlinkUnsupported: "TREE_DIRECTORY_SYMLINK_UNSUPPORTED";
|
|
136
|
+
readonly directorySymlinkPathEscape: "TREE_DIRECTORY_SYMLINK_PATH_ESCAPE";
|
|
137
|
+
readonly memberFrontmatterMissing: "TREE_MEMBER_FRONTMATTER_MISSING";
|
|
138
|
+
readonly memberFrontmatterParse: "TREE_MEMBER_FRONTMATTER_PARSE";
|
|
139
|
+
readonly memberTitleInvalid: "TREE_MEMBER_TITLE_INVALID";
|
|
140
|
+
readonly memberOwnersMissing: "TREE_MEMBER_OWNERS_MISSING";
|
|
141
|
+
readonly memberOwnersInvalid: "TREE_MEMBER_OWNERS_INVALID";
|
|
142
|
+
readonly memberTypeMissing: "TREE_MEMBER_TYPE_MISSING";
|
|
143
|
+
readonly memberTypeInvalid: "TREE_MEMBER_TYPE_INVALID";
|
|
144
|
+
readonly memberTypeShape: "TREE_MEMBER_TYPE_SHAPE";
|
|
145
|
+
readonly memberStatusInvalid: "TREE_MEMBER_STATUS_INVALID";
|
|
146
|
+
readonly memberStatusShape: "TREE_MEMBER_STATUS_SHAPE";
|
|
147
|
+
readonly memberRoleInvalid: "TREE_MEMBER_ROLE_INVALID";
|
|
148
|
+
readonly memberRoleShape: "TREE_MEMBER_ROLE_SHAPE";
|
|
149
|
+
readonly memberDomainsInvalid: "TREE_MEMBER_DOMAINS_INVALID";
|
|
150
|
+
readonly memberDomainsShape: "TREE_MEMBER_DOMAINS_SHAPE";
|
|
151
|
+
readonly membersDirectoryMissing: "TREE_MEMBERS_DIRECTORY_MISSING";
|
|
152
|
+
readonly memberNodeMissing: "TREE_MEMBER_NODE_MISSING";
|
|
153
|
+
readonly memberNodesEmpty: "TREE_MEMBER_NODES_EMPTY";
|
|
154
|
+
}>;
|
|
155
|
+
message: z.ZodString;
|
|
156
|
+
path: z.ZodString;
|
|
157
|
+
target: z.ZodOptional<z.ZodString>;
|
|
158
|
+
}, z.core.$strict>;
|
|
159
|
+
type TreeValidationFinding = z.infer<typeof treeValidationFindingSchema>;
|
|
160
|
+
declare const contextContentClassCountsSchema: z.ZodObject<{
|
|
161
|
+
normal: z.ZodNumber;
|
|
162
|
+
"archive-supporting": z.ZodNumber;
|
|
163
|
+
member: z.ZodNumber;
|
|
164
|
+
"repo-infra": z.ZodNumber;
|
|
165
|
+
}, z.core.$strict>;
|
|
166
|
+
type ContextContentClassCounts = z.infer<typeof contextContentClassCountsSchema>;
|
|
167
|
+
declare const contextTreePolicySchema: z.ZodObject<{
|
|
168
|
+
content: z.ZodString;
|
|
169
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
170
|
+
}, z.core.$strict>;
|
|
171
|
+
type ContextTreePolicy = z.infer<typeof contextTreePolicySchema>;
|
|
172
|
+
declare const contextTreeReadEntrySchema: z.ZodObject<{
|
|
173
|
+
content: z.ZodOptional<z.ZodString>;
|
|
174
|
+
contentClass: z.ZodEnum<{
|
|
175
|
+
normal: "normal";
|
|
176
|
+
"archive-supporting": "archive-supporting";
|
|
177
|
+
member: "member";
|
|
178
|
+
"repo-infra": "repo-infra";
|
|
179
|
+
}>;
|
|
180
|
+
depth: z.ZodNumber;
|
|
181
|
+
description: z.ZodOptional<z.ZodString>;
|
|
182
|
+
kind: z.ZodEnum<{
|
|
183
|
+
file: "file";
|
|
184
|
+
directory: "directory";
|
|
185
|
+
}>;
|
|
186
|
+
owners: z.ZodArray<z.ZodString>;
|
|
187
|
+
path: z.ZodString;
|
|
188
|
+
title: z.ZodString;
|
|
189
|
+
}, z.core.$strict>;
|
|
190
|
+
type ContextTreeReadEntry = z.infer<typeof contextTreeReadEntrySchema>;
|
|
191
|
+
declare const contextTreeReadResultSchema: z.ZodObject<{
|
|
192
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
193
|
+
content: z.ZodOptional<z.ZodString>;
|
|
194
|
+
contentClass: z.ZodEnum<{
|
|
195
|
+
normal: "normal";
|
|
196
|
+
"archive-supporting": "archive-supporting";
|
|
197
|
+
member: "member";
|
|
198
|
+
"repo-infra": "repo-infra";
|
|
199
|
+
}>;
|
|
200
|
+
depth: z.ZodNumber;
|
|
201
|
+
description: z.ZodOptional<z.ZodString>;
|
|
202
|
+
kind: z.ZodEnum<{
|
|
203
|
+
file: "file";
|
|
204
|
+
directory: "directory";
|
|
205
|
+
}>;
|
|
206
|
+
owners: z.ZodArray<z.ZodString>;
|
|
207
|
+
path: z.ZodString;
|
|
208
|
+
title: z.ZodString;
|
|
209
|
+
}, z.core.$strict>>;
|
|
210
|
+
root: z.ZodString;
|
|
211
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
212
|
+
target: z.ZodString;
|
|
213
|
+
}, z.core.$strict>;
|
|
214
|
+
type ContextTreeReadResult = z.infer<typeof contextTreeReadResultSchema>;
|
|
215
|
+
declare const verifyTreeReportSchema: z.ZodObject<{
|
|
216
|
+
findings: z.ZodArray<z.ZodObject<{
|
|
217
|
+
code: z.ZodEnum<{
|
|
218
|
+
readonly rootMissing: "TREE_ROOT_MISSING";
|
|
219
|
+
readonly directoryNodeMissing: "TREE_DIRECTORY_NODE_MISSING";
|
|
220
|
+
readonly scopeInvalid: "TREE_SCOPE_INVALID";
|
|
221
|
+
readonly frontmatterMissing: "TREE_FRONTMATTER_MISSING";
|
|
222
|
+
readonly frontmatterParse: "TREE_FRONTMATTER_PARSE";
|
|
223
|
+
readonly titleMissing: "TREE_TITLE_MISSING";
|
|
224
|
+
readonly titleInvalid: "TREE_TITLE_INVALID";
|
|
225
|
+
readonly ownersMissing: "TREE_OWNERS_MISSING";
|
|
226
|
+
readonly ownersInvalid: "TREE_OWNERS_INVALID";
|
|
227
|
+
readonly descriptionInvalid: "TREE_DESCRIPTION_INVALID";
|
|
228
|
+
readonly softLinksInvalid: "TREE_SOFT_LINKS_INVALID";
|
|
229
|
+
readonly softLinkBroken: "TREE_SOFT_LINK_BROKEN";
|
|
230
|
+
readonly softLinkPathEscape: "TREE_SOFT_LINK_PATH_ESCAPE";
|
|
231
|
+
readonly softLinkArchiveDependency: "TREE_SOFT_LINK_ARCHIVE_DEPENDENCY";
|
|
232
|
+
readonly markdownPathEscape: "TREE_MARKDOWN_LINK_PATH_ESCAPE";
|
|
233
|
+
readonly markdownArchiveDependency: "TREE_MARKDOWN_LINK_ARCHIVE_DEPENDENCY";
|
|
234
|
+
readonly markdownFileSymlinkBroken: "TREE_MARKDOWN_FILE_SYMLINK_BROKEN";
|
|
235
|
+
readonly markdownFileSymlinkUnsupported: "TREE_MARKDOWN_FILE_SYMLINK_UNSUPPORTED";
|
|
236
|
+
readonly markdownFilePathEscape: "TREE_MARKDOWN_FILE_PATH_ESCAPE";
|
|
237
|
+
readonly markdownFileContentClassMismatch: "TREE_MARKDOWN_FILE_CONTENT_CLASS_MISMATCH";
|
|
238
|
+
readonly directorySymlinkUnsupported: "TREE_DIRECTORY_SYMLINK_UNSUPPORTED";
|
|
239
|
+
readonly directorySymlinkPathEscape: "TREE_DIRECTORY_SYMLINK_PATH_ESCAPE";
|
|
240
|
+
readonly memberFrontmatterMissing: "TREE_MEMBER_FRONTMATTER_MISSING";
|
|
241
|
+
readonly memberFrontmatterParse: "TREE_MEMBER_FRONTMATTER_PARSE";
|
|
242
|
+
readonly memberTitleInvalid: "TREE_MEMBER_TITLE_INVALID";
|
|
243
|
+
readonly memberOwnersMissing: "TREE_MEMBER_OWNERS_MISSING";
|
|
244
|
+
readonly memberOwnersInvalid: "TREE_MEMBER_OWNERS_INVALID";
|
|
245
|
+
readonly memberTypeMissing: "TREE_MEMBER_TYPE_MISSING";
|
|
246
|
+
readonly memberTypeInvalid: "TREE_MEMBER_TYPE_INVALID";
|
|
247
|
+
readonly memberTypeShape: "TREE_MEMBER_TYPE_SHAPE";
|
|
248
|
+
readonly memberStatusInvalid: "TREE_MEMBER_STATUS_INVALID";
|
|
249
|
+
readonly memberStatusShape: "TREE_MEMBER_STATUS_SHAPE";
|
|
250
|
+
readonly memberRoleInvalid: "TREE_MEMBER_ROLE_INVALID";
|
|
251
|
+
readonly memberRoleShape: "TREE_MEMBER_ROLE_SHAPE";
|
|
252
|
+
readonly memberDomainsInvalid: "TREE_MEMBER_DOMAINS_INVALID";
|
|
253
|
+
readonly memberDomainsShape: "TREE_MEMBER_DOMAINS_SHAPE";
|
|
254
|
+
readonly membersDirectoryMissing: "TREE_MEMBERS_DIRECTORY_MISSING";
|
|
255
|
+
readonly memberNodeMissing: "TREE_MEMBER_NODE_MISSING";
|
|
256
|
+
readonly memberNodesEmpty: "TREE_MEMBER_NODES_EMPTY";
|
|
257
|
+
}>;
|
|
258
|
+
message: z.ZodString;
|
|
259
|
+
path: z.ZodString;
|
|
260
|
+
target: z.ZodOptional<z.ZodString>;
|
|
261
|
+
}, z.core.$strict>>;
|
|
262
|
+
ok: z.ZodBoolean;
|
|
263
|
+
root: z.ZodString;
|
|
264
|
+
scannedByContentClass: z.ZodObject<{
|
|
265
|
+
normal: z.ZodNumber;
|
|
266
|
+
"archive-supporting": z.ZodNumber;
|
|
267
|
+
member: z.ZodNumber;
|
|
268
|
+
"repo-infra": z.ZodNumber;
|
|
269
|
+
}, z.core.$strict>;
|
|
270
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
271
|
+
}, z.core.$strict>;
|
|
272
|
+
type VerifyTreeReport = z.infer<typeof verifyTreeReportSchema>;
|
|
273
|
+
declare const scaffoldTreeResultSchema: z.ZodObject<{
|
|
274
|
+
files: z.ZodArray<z.ZodString>;
|
|
275
|
+
root: z.ZodString;
|
|
276
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
277
|
+
verification: z.ZodObject<{
|
|
278
|
+
findings: z.ZodArray<z.ZodObject<{
|
|
279
|
+
code: z.ZodEnum<{
|
|
280
|
+
readonly rootMissing: "TREE_ROOT_MISSING";
|
|
281
|
+
readonly directoryNodeMissing: "TREE_DIRECTORY_NODE_MISSING";
|
|
282
|
+
readonly scopeInvalid: "TREE_SCOPE_INVALID";
|
|
283
|
+
readonly frontmatterMissing: "TREE_FRONTMATTER_MISSING";
|
|
284
|
+
readonly frontmatterParse: "TREE_FRONTMATTER_PARSE";
|
|
285
|
+
readonly titleMissing: "TREE_TITLE_MISSING";
|
|
286
|
+
readonly titleInvalid: "TREE_TITLE_INVALID";
|
|
287
|
+
readonly ownersMissing: "TREE_OWNERS_MISSING";
|
|
288
|
+
readonly ownersInvalid: "TREE_OWNERS_INVALID";
|
|
289
|
+
readonly descriptionInvalid: "TREE_DESCRIPTION_INVALID";
|
|
290
|
+
readonly softLinksInvalid: "TREE_SOFT_LINKS_INVALID";
|
|
291
|
+
readonly softLinkBroken: "TREE_SOFT_LINK_BROKEN";
|
|
292
|
+
readonly softLinkPathEscape: "TREE_SOFT_LINK_PATH_ESCAPE";
|
|
293
|
+
readonly softLinkArchiveDependency: "TREE_SOFT_LINK_ARCHIVE_DEPENDENCY";
|
|
294
|
+
readonly markdownPathEscape: "TREE_MARKDOWN_LINK_PATH_ESCAPE";
|
|
295
|
+
readonly markdownArchiveDependency: "TREE_MARKDOWN_LINK_ARCHIVE_DEPENDENCY";
|
|
296
|
+
readonly markdownFileSymlinkBroken: "TREE_MARKDOWN_FILE_SYMLINK_BROKEN";
|
|
297
|
+
readonly markdownFileSymlinkUnsupported: "TREE_MARKDOWN_FILE_SYMLINK_UNSUPPORTED";
|
|
298
|
+
readonly markdownFilePathEscape: "TREE_MARKDOWN_FILE_PATH_ESCAPE";
|
|
299
|
+
readonly markdownFileContentClassMismatch: "TREE_MARKDOWN_FILE_CONTENT_CLASS_MISMATCH";
|
|
300
|
+
readonly directorySymlinkUnsupported: "TREE_DIRECTORY_SYMLINK_UNSUPPORTED";
|
|
301
|
+
readonly directorySymlinkPathEscape: "TREE_DIRECTORY_SYMLINK_PATH_ESCAPE";
|
|
302
|
+
readonly memberFrontmatterMissing: "TREE_MEMBER_FRONTMATTER_MISSING";
|
|
303
|
+
readonly memberFrontmatterParse: "TREE_MEMBER_FRONTMATTER_PARSE";
|
|
304
|
+
readonly memberTitleInvalid: "TREE_MEMBER_TITLE_INVALID";
|
|
305
|
+
readonly memberOwnersMissing: "TREE_MEMBER_OWNERS_MISSING";
|
|
306
|
+
readonly memberOwnersInvalid: "TREE_MEMBER_OWNERS_INVALID";
|
|
307
|
+
readonly memberTypeMissing: "TREE_MEMBER_TYPE_MISSING";
|
|
308
|
+
readonly memberTypeInvalid: "TREE_MEMBER_TYPE_INVALID";
|
|
309
|
+
readonly memberTypeShape: "TREE_MEMBER_TYPE_SHAPE";
|
|
310
|
+
readonly memberStatusInvalid: "TREE_MEMBER_STATUS_INVALID";
|
|
311
|
+
readonly memberStatusShape: "TREE_MEMBER_STATUS_SHAPE";
|
|
312
|
+
readonly memberRoleInvalid: "TREE_MEMBER_ROLE_INVALID";
|
|
313
|
+
readonly memberRoleShape: "TREE_MEMBER_ROLE_SHAPE";
|
|
314
|
+
readonly memberDomainsInvalid: "TREE_MEMBER_DOMAINS_INVALID";
|
|
315
|
+
readonly memberDomainsShape: "TREE_MEMBER_DOMAINS_SHAPE";
|
|
316
|
+
readonly membersDirectoryMissing: "TREE_MEMBERS_DIRECTORY_MISSING";
|
|
317
|
+
readonly memberNodeMissing: "TREE_MEMBER_NODE_MISSING";
|
|
318
|
+
readonly memberNodesEmpty: "TREE_MEMBER_NODES_EMPTY";
|
|
319
|
+
}>;
|
|
320
|
+
message: z.ZodString;
|
|
321
|
+
path: z.ZodString;
|
|
322
|
+
target: z.ZodOptional<z.ZodString>;
|
|
323
|
+
}, z.core.$strict>>;
|
|
324
|
+
ok: z.ZodBoolean;
|
|
325
|
+
root: z.ZodString;
|
|
326
|
+
scannedByContentClass: z.ZodObject<{
|
|
327
|
+
normal: z.ZodNumber;
|
|
328
|
+
"archive-supporting": z.ZodNumber;
|
|
329
|
+
member: z.ZodNumber;
|
|
330
|
+
"repo-infra": z.ZodNumber;
|
|
331
|
+
}, z.core.$strict>;
|
|
332
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
333
|
+
}, z.core.$strict>;
|
|
334
|
+
}, z.core.$strict>;
|
|
335
|
+
type ScaffoldTreeResult = z.infer<typeof scaffoldTreeResultSchema>;
|
|
336
|
+
declare const contextTreeCliErrorCodeSchema: z.ZodEnum<{
|
|
337
|
+
readonly failed: "CONTEXT_TREE_FAILED";
|
|
338
|
+
}>;
|
|
339
|
+
type ContextTreeCliErrorCode = z.infer<typeof contextTreeCliErrorCodeSchema>;
|
|
340
|
+
declare const contextTreeCliErrorSchema: z.ZodObject<{
|
|
341
|
+
code: z.ZodEnum<{
|
|
342
|
+
readonly failed: "CONTEXT_TREE_FAILED";
|
|
343
|
+
}>;
|
|
344
|
+
message: z.ZodString;
|
|
345
|
+
}, z.core.$strict>;
|
|
346
|
+
type ContextTreeCliError = z.infer<typeof contextTreeCliErrorSchema>;
|
|
347
|
+
declare const contextTreeCliErrorEnvelopeSchema: z.ZodObject<{
|
|
348
|
+
error: z.ZodObject<{
|
|
349
|
+
code: z.ZodEnum<{
|
|
350
|
+
readonly failed: "CONTEXT_TREE_FAILED";
|
|
351
|
+
}>;
|
|
352
|
+
message: z.ZodString;
|
|
353
|
+
}, z.core.$strict>;
|
|
354
|
+
ok: z.ZodLiteral<false>;
|
|
355
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
356
|
+
}, z.core.$strict>;
|
|
357
|
+
type ContextTreeCliErrorEnvelope = z.infer<typeof contextTreeCliErrorEnvelopeSchema>;
|
|
358
|
+
//#endregion
|
|
359
|
+
export { scaffoldTreeResultSchema as A, contextTreePolicySchema as C, contextTreeScopeSchema as D, contextTreeScopeFrontmatterSchema as E, validationCodeSchema as M, verifyTreeReportSchema as N, credentialFreeRepositoryUrlSchema as O, contextTreeCliErrorSchema as S, contextTreeReadResultSchema as T, VerifyTreeReport as _, ContextTreeCliError as a, contextTreeCliErrorCodeSchema as b, ContextTreePolicy as c, ContextTreeScope as d, SCHEMA_VERSION as f, ValidationCode as g, VALIDATION_CODES as h, ContextContentClassCounts as i, treeValidationFindingSchema as j, parseContextTreeScope as k, ContextTreeReadEntry as l, TreeValidationFinding as m, CONTEXT_TREE_SCOPE_MAX_BYTES as n, ContextTreeCliErrorCode as o, ScaffoldTreeResult as p, ContextContentClass as r, ContextTreeCliErrorEnvelope as s, CLI_ERROR_CODES as t, ContextTreeReadResult as u, contextContentClassCountsSchema as v, contextTreeReadEntrySchema as w, contextTreeCliErrorEnvelopeSchema as x, contextContentClassSchema as y };
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import matter from "gray-matter";
|
|
3
|
+
import { parse } from "yaml";
|
|
4
|
+
//#region src/internal/value.ts
|
|
5
|
+
function isRecord(value) {
|
|
6
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/internal/frontmatter.ts
|
|
10
|
+
const STRICT_FRONTMATTER_RE = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)([\s\S]*)$/u;
|
|
11
|
+
const PERMISSIVE_FRONTMATTER_RE = /^---\s*\r?\n([\s\S]*?)\r?\n---(?:\s*\r?\n|\s*$)([\s\S]*)$/u;
|
|
12
|
+
function parseYamlMapping(source) {
|
|
13
|
+
const value = parse(source);
|
|
14
|
+
if (!isRecord(value)) throw new Error("frontmatter must be a YAML mapping");
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
const MATTER_OPTIONS = { engines: { yaml: parseYamlMapping } };
|
|
18
|
+
function parseMarkdownFrontmatter(source, options = {}) {
|
|
19
|
+
const match = (options.strictDelimiters === true ? STRICT_FRONTMATTER_RE : PERMISSIVE_FRONTMATTER_RE).exec(source);
|
|
20
|
+
if (!matter.test(source) || match === null) return {
|
|
21
|
+
body: source,
|
|
22
|
+
data: null,
|
|
23
|
+
frontmatter: "missing"
|
|
24
|
+
};
|
|
25
|
+
try {
|
|
26
|
+
const parsed = matter(source, MATTER_OPTIONS);
|
|
27
|
+
const data = parsed.data;
|
|
28
|
+
if (!isRecord(data)) return {
|
|
29
|
+
body: parsed.content,
|
|
30
|
+
data: null,
|
|
31
|
+
error: "frontmatter must be a YAML mapping",
|
|
32
|
+
frontmatter: "invalid"
|
|
33
|
+
};
|
|
34
|
+
return {
|
|
35
|
+
body: parsed.content,
|
|
36
|
+
data,
|
|
37
|
+
frontmatter: "valid"
|
|
38
|
+
};
|
|
39
|
+
} catch (error) {
|
|
40
|
+
return {
|
|
41
|
+
body: match[2] ?? "",
|
|
42
|
+
data: null,
|
|
43
|
+
error: error instanceof Error ? error.message : String(error),
|
|
44
|
+
frontmatter: "invalid"
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/schemas.ts
|
|
50
|
+
const SCHEMA_VERSION = 1;
|
|
51
|
+
const CONTEXT_TREE_SCOPE_MAX_BYTES = 16 * 1024;
|
|
52
|
+
const VALIDATION_CODES = {
|
|
53
|
+
rootMissing: "TREE_ROOT_MISSING",
|
|
54
|
+
directoryNodeMissing: "TREE_DIRECTORY_NODE_MISSING",
|
|
55
|
+
scopeInvalid: "TREE_SCOPE_INVALID",
|
|
56
|
+
frontmatterMissing: "TREE_FRONTMATTER_MISSING",
|
|
57
|
+
frontmatterParse: "TREE_FRONTMATTER_PARSE",
|
|
58
|
+
titleMissing: "TREE_TITLE_MISSING",
|
|
59
|
+
titleInvalid: "TREE_TITLE_INVALID",
|
|
60
|
+
ownersMissing: "TREE_OWNERS_MISSING",
|
|
61
|
+
ownersInvalid: "TREE_OWNERS_INVALID",
|
|
62
|
+
descriptionInvalid: "TREE_DESCRIPTION_INVALID",
|
|
63
|
+
softLinksInvalid: "TREE_SOFT_LINKS_INVALID",
|
|
64
|
+
softLinkBroken: "TREE_SOFT_LINK_BROKEN",
|
|
65
|
+
softLinkPathEscape: "TREE_SOFT_LINK_PATH_ESCAPE",
|
|
66
|
+
softLinkArchiveDependency: "TREE_SOFT_LINK_ARCHIVE_DEPENDENCY",
|
|
67
|
+
markdownPathEscape: "TREE_MARKDOWN_LINK_PATH_ESCAPE",
|
|
68
|
+
markdownArchiveDependency: "TREE_MARKDOWN_LINK_ARCHIVE_DEPENDENCY",
|
|
69
|
+
markdownFileSymlinkBroken: "TREE_MARKDOWN_FILE_SYMLINK_BROKEN",
|
|
70
|
+
markdownFileSymlinkUnsupported: "TREE_MARKDOWN_FILE_SYMLINK_UNSUPPORTED",
|
|
71
|
+
markdownFilePathEscape: "TREE_MARKDOWN_FILE_PATH_ESCAPE",
|
|
72
|
+
markdownFileContentClassMismatch: "TREE_MARKDOWN_FILE_CONTENT_CLASS_MISMATCH",
|
|
73
|
+
directorySymlinkUnsupported: "TREE_DIRECTORY_SYMLINK_UNSUPPORTED",
|
|
74
|
+
directorySymlinkPathEscape: "TREE_DIRECTORY_SYMLINK_PATH_ESCAPE",
|
|
75
|
+
memberFrontmatterMissing: "TREE_MEMBER_FRONTMATTER_MISSING",
|
|
76
|
+
memberFrontmatterParse: "TREE_MEMBER_FRONTMATTER_PARSE",
|
|
77
|
+
memberTitleInvalid: "TREE_MEMBER_TITLE_INVALID",
|
|
78
|
+
memberOwnersMissing: "TREE_MEMBER_OWNERS_MISSING",
|
|
79
|
+
memberOwnersInvalid: "TREE_MEMBER_OWNERS_INVALID",
|
|
80
|
+
memberTypeMissing: "TREE_MEMBER_TYPE_MISSING",
|
|
81
|
+
memberTypeInvalid: "TREE_MEMBER_TYPE_INVALID",
|
|
82
|
+
memberTypeShape: "TREE_MEMBER_TYPE_SHAPE",
|
|
83
|
+
memberStatusInvalid: "TREE_MEMBER_STATUS_INVALID",
|
|
84
|
+
memberStatusShape: "TREE_MEMBER_STATUS_SHAPE",
|
|
85
|
+
memberRoleInvalid: "TREE_MEMBER_ROLE_INVALID",
|
|
86
|
+
memberRoleShape: "TREE_MEMBER_ROLE_SHAPE",
|
|
87
|
+
memberDomainsInvalid: "TREE_MEMBER_DOMAINS_INVALID",
|
|
88
|
+
memberDomainsShape: "TREE_MEMBER_DOMAINS_SHAPE",
|
|
89
|
+
membersDirectoryMissing: "TREE_MEMBERS_DIRECTORY_MISSING",
|
|
90
|
+
memberNodeMissing: "TREE_MEMBER_NODE_MISSING",
|
|
91
|
+
memberNodesEmpty: "TREE_MEMBER_NODES_EMPTY"
|
|
92
|
+
};
|
|
93
|
+
const CLI_ERROR_CODES = { failed: "CONTEXT_TREE_FAILED" };
|
|
94
|
+
function hasUnsafeCharacter(value) {
|
|
95
|
+
return [...value].some((character) => {
|
|
96
|
+
const code = character.codePointAt(0);
|
|
97
|
+
return code !== void 0 && (code <= 31 || code === 127 || code === 8232 || code === 8233);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
const credentialFreeRepositoryUrlSchema = z.string().superRefine((value, context) => {
|
|
101
|
+
if (value.trim() !== value || hasUnsafeCharacter(value) || value.includes("\\")) {
|
|
102
|
+
context.addIssue({
|
|
103
|
+
code: "custom",
|
|
104
|
+
message: "Repository URLs must be canonical single-line values."
|
|
105
|
+
});
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (value.includes("?") || value.includes("#")) {
|
|
109
|
+
context.addIssue({
|
|
110
|
+
code: "custom",
|
|
111
|
+
message: "Repository URLs must not contain a query or fragment."
|
|
112
|
+
});
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (/^(?:[a-z\d._-]+@)?[a-z\d.-]+:[^\s/][^\s]*$/iu.test(value)) return;
|
|
116
|
+
try {
|
|
117
|
+
const parsed = new URL(value);
|
|
118
|
+
if (parsed.protocol !== "http:" && parsed.protocol !== "https:" && parsed.protocol !== "ssh:" || !parsed.hostname || parsed.pathname.split("/").every((part) => part.length === 0) || parsed.password || (parsed.protocol === "http:" || parsed.protocol === "https:") && parsed.username) throw new Error("invalid transport");
|
|
119
|
+
} catch {
|
|
120
|
+
context.addIssue({
|
|
121
|
+
code: "custom",
|
|
122
|
+
message: "Repository URLs must use credential-free HTTP(S), ssh://, or scp-like SSH syntax."
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
const contextTreeScopeFrontmatterSchema = z.object({
|
|
127
|
+
schemaVersion: z.literal(1),
|
|
128
|
+
relatedRepositories: z.array(credentialFreeRepositoryUrlSchema).max(64).optional()
|
|
129
|
+
}).strict();
|
|
130
|
+
const contextTreeScopeSchema = z.object({
|
|
131
|
+
frontmatter: contextTreeScopeFrontmatterSchema,
|
|
132
|
+
body: z.string().trim().min(1, "SCOPE.md must describe what the Context Tree covers.")
|
|
133
|
+
});
|
|
134
|
+
function parseContextTreeScope(markdown) {
|
|
135
|
+
if (Buffer.byteLength(markdown, "utf8") > 16384) throw new Error(`SCOPE.md exceeds the ${CONTEXT_TREE_SCOPE_MAX_BYTES}-byte limit.`);
|
|
136
|
+
const document = parseMarkdownFrontmatter(markdown, { strictDelimiters: true });
|
|
137
|
+
if (document.frontmatter === "missing") throw new Error("SCOPE.md must contain YAML frontmatter.");
|
|
138
|
+
if (document.frontmatter === "invalid" || document.data === null) throw new Error(`SCOPE.md frontmatter is invalid${document.error === void 0 ? "." : `: ${document.error}`}`);
|
|
139
|
+
return contextTreeScopeSchema.parse({
|
|
140
|
+
frontmatter: document.data,
|
|
141
|
+
body: document.body
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
const contextContentClassSchema = z.enum([
|
|
145
|
+
"normal",
|
|
146
|
+
"archive-supporting",
|
|
147
|
+
"member",
|
|
148
|
+
"repo-infra"
|
|
149
|
+
]);
|
|
150
|
+
const validationCodeSchema = z.enum(VALIDATION_CODES);
|
|
151
|
+
const treeValidationFindingSchema = z.object({
|
|
152
|
+
code: validationCodeSchema,
|
|
153
|
+
message: z.string(),
|
|
154
|
+
path: z.string(),
|
|
155
|
+
target: z.string().optional()
|
|
156
|
+
}).strict();
|
|
157
|
+
const contextContentClassCountsSchema = z.object({
|
|
158
|
+
normal: z.number().int().nonnegative(),
|
|
159
|
+
"archive-supporting": z.number().int().nonnegative(),
|
|
160
|
+
member: z.number().int().nonnegative(),
|
|
161
|
+
"repo-infra": z.number().int().nonnegative()
|
|
162
|
+
}).strict();
|
|
163
|
+
const contextTreePolicySchema = z.object({
|
|
164
|
+
content: z.string(),
|
|
165
|
+
schemaVersion: z.literal(1)
|
|
166
|
+
}).strict();
|
|
167
|
+
const contextTreeReadEntrySchema = z.object({
|
|
168
|
+
content: z.string().optional(),
|
|
169
|
+
contentClass: contextContentClassSchema,
|
|
170
|
+
depth: z.number().int().nonnegative(),
|
|
171
|
+
description: z.string().optional(),
|
|
172
|
+
kind: z.enum(["directory", "file"]),
|
|
173
|
+
owners: z.array(z.string()),
|
|
174
|
+
path: z.string(),
|
|
175
|
+
title: z.string()
|
|
176
|
+
}).strict();
|
|
177
|
+
const contextTreeReadResultSchema = z.object({
|
|
178
|
+
entries: z.array(contextTreeReadEntrySchema),
|
|
179
|
+
root: z.string(),
|
|
180
|
+
schemaVersion: z.literal(1),
|
|
181
|
+
target: z.string()
|
|
182
|
+
}).strict();
|
|
183
|
+
const verifyTreeReportSchema = z.object({
|
|
184
|
+
findings: z.array(treeValidationFindingSchema),
|
|
185
|
+
ok: z.boolean(),
|
|
186
|
+
root: z.string(),
|
|
187
|
+
scannedByContentClass: contextContentClassCountsSchema,
|
|
188
|
+
schemaVersion: z.literal(1)
|
|
189
|
+
}).strict();
|
|
190
|
+
const scaffoldTreeResultSchema = z.object({
|
|
191
|
+
files: z.array(z.string()),
|
|
192
|
+
root: z.string(),
|
|
193
|
+
schemaVersion: z.literal(1),
|
|
194
|
+
verification: verifyTreeReportSchema
|
|
195
|
+
}).strict();
|
|
196
|
+
const contextTreeCliErrorCodeSchema = z.enum(CLI_ERROR_CODES);
|
|
197
|
+
const contextTreeCliErrorSchema = z.object({
|
|
198
|
+
code: contextTreeCliErrorCodeSchema,
|
|
199
|
+
message: z.string()
|
|
200
|
+
}).strict();
|
|
201
|
+
const contextTreeCliErrorEnvelopeSchema = z.object({
|
|
202
|
+
error: contextTreeCliErrorSchema,
|
|
203
|
+
ok: z.literal(false),
|
|
204
|
+
schemaVersion: z.literal(1)
|
|
205
|
+
}).strict();
|
|
206
|
+
//#endregion
|
|
207
|
+
export { isRecord as S, scaffoldTreeResultSchema as _, contextContentClassCountsSchema as a, verifyTreeReportSchema as b, contextTreeCliErrorEnvelopeSchema as c, contextTreeReadEntrySchema as d, contextTreeReadResultSchema as f, parseContextTreeScope as g, credentialFreeRepositoryUrlSchema as h, VALIDATION_CODES as i, contextTreeCliErrorSchema as l, contextTreeScopeSchema as m, CONTEXT_TREE_SCOPE_MAX_BYTES as n, contextContentClassSchema as o, contextTreeScopeFrontmatterSchema as p, SCHEMA_VERSION as r, contextTreeCliErrorCodeSchema as s, CLI_ERROR_CODES as t, contextTreePolicySchema as u, treeValidationFindingSchema as v, parseMarkdownFrontmatter as x, validationCodeSchema as y };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { A as scaffoldTreeResultSchema, C as contextTreePolicySchema, D as contextTreeScopeSchema, E as contextTreeScopeFrontmatterSchema, M as validationCodeSchema, N as verifyTreeReportSchema, O as credentialFreeRepositoryUrlSchema, S as contextTreeCliErrorSchema, T as contextTreeReadResultSchema, _ as VerifyTreeReport, a as ContextTreeCliError, b as contextTreeCliErrorCodeSchema, c as ContextTreePolicy, d as ContextTreeScope, f as SCHEMA_VERSION, g as ValidationCode, h as VALIDATION_CODES, i as ContextContentClassCounts, j as treeValidationFindingSchema, k as parseContextTreeScope, l as ContextTreeReadEntry, m as TreeValidationFinding, n as CONTEXT_TREE_SCOPE_MAX_BYTES, o as ContextTreeCliErrorCode, p as ScaffoldTreeResult, r as ContextContentClass, s as ContextTreeCliErrorEnvelope, t as CLI_ERROR_CODES, u as ContextTreeReadResult, v as contextContentClassCountsSchema, w as contextTreeReadEntrySchema, x as contextTreeCliErrorEnvelopeSchema, y as contextContentClassSchema } from "./schemas-BJXFTfxw.mjs";
|
|
2
|
+
export { CLI_ERROR_CODES, CONTEXT_TREE_SCOPE_MAX_BYTES, ContextContentClass, ContextContentClassCounts, ContextTreeCliError, ContextTreeCliErrorCode, ContextTreeCliErrorEnvelope, ContextTreePolicy, ContextTreeReadEntry, ContextTreeReadResult, ContextTreeScope, SCHEMA_VERSION, ScaffoldTreeResult, TreeValidationFinding, VALIDATION_CODES, ValidationCode, VerifyTreeReport, contextContentClassCountsSchema, contextContentClassSchema, contextTreeCliErrorCodeSchema, contextTreeCliErrorEnvelopeSchema, contextTreeCliErrorSchema, contextTreePolicySchema, contextTreeReadEntrySchema, contextTreeReadResultSchema, contextTreeScopeFrontmatterSchema, contextTreeScopeSchema, credentialFreeRepositoryUrlSchema, parseContextTreeScope, scaffoldTreeResultSchema, treeValidationFindingSchema, validationCodeSchema, verifyTreeReportSchema };
|
package/dist/schemas.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { _ as scaffoldTreeResultSchema, a as contextContentClassCountsSchema, b as verifyTreeReportSchema, c as contextTreeCliErrorEnvelopeSchema, d as contextTreeReadEntrySchema, f as contextTreeReadResultSchema, g as parseContextTreeScope, h as credentialFreeRepositoryUrlSchema, i as VALIDATION_CODES, l as contextTreeCliErrorSchema, m as contextTreeScopeSchema, n as CONTEXT_TREE_SCOPE_MAX_BYTES, o as contextContentClassSchema, p as contextTreeScopeFrontmatterSchema, r as SCHEMA_VERSION, s as contextTreeCliErrorCodeSchema, t as CLI_ERROR_CODES, u as contextTreePolicySchema, v as treeValidationFindingSchema, y as validationCodeSchema } from "./schemas-D0Qt1bWc.mjs";
|
|
2
|
+
export { CLI_ERROR_CODES, CONTEXT_TREE_SCOPE_MAX_BYTES, SCHEMA_VERSION, VALIDATION_CODES, contextContentClassCountsSchema, contextContentClassSchema, contextTreeCliErrorCodeSchema, contextTreeCliErrorEnvelopeSchema, contextTreeCliErrorSchema, contextTreePolicySchema, contextTreeReadEntrySchema, contextTreeReadResultSchema, contextTreeScopeFrontmatterSchema, contextTreeScopeSchema, credentialFreeRepositoryUrlSchema, parseContextTreeScope, scaffoldTreeResultSchema, treeValidationFindingSchema, validationCodeSchema, verifyTreeReportSchema };
|