@first-tree-ai/context-tree 0.1.6-alpha.202608310559 → 0.1.7

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.
Files changed (45) hide show
  1. package/README.md +158 -128
  2. package/dist/cli/index.mjs +1404 -746
  3. package/package.json +7 -28
  4. package/scripts/postinstall.mjs +53 -0
  5. package/skills/context-tree-connect/SKILL.md +36 -0
  6. package/skills/context-tree-connect/agents/openai.yaml +4 -0
  7. package/skills/context-tree-create/SKILL.md +32 -0
  8. package/skills/context-tree-create/agents/openai.yaml +4 -0
  9. package/skills/context-tree-publish/SKILL.md +22 -0
  10. package/skills/context-tree-publish/agents/openai.yaml +4 -0
  11. package/skills/context-tree-read/SKILL.md +34 -37
  12. package/skills/context-tree-read/agents/openai.yaml +2 -2
  13. package/skills/context-tree-setup/SKILL.md +28 -0
  14. package/skills/context-tree-setup/agents/openai.yaml +4 -0
  15. package/skills/context-tree-write/SKILL.md +208 -125
  16. package/skills/context-tree-write/agents/openai.yaml +2 -2
  17. package/.agents/plugins/marketplace.json +0 -19
  18. package/.claude-plugin/marketplace.json +0 -21
  19. package/.claude-plugin/plugin.json +0 -16
  20. package/.codex-plugin/plugin.json +0 -36
  21. package/dist/cli/index.d.mts +0 -1
  22. package/dist/index.d.mts +0 -28
  23. package/dist/index.mjs +0 -1087
  24. package/dist/schemas-BWM6Q6iz.mjs +0 -278
  25. package/dist/schemas-C4bs-FkC.d.mts +0 -394
  26. package/dist/schemas.d.mts +0 -2
  27. package/dist/schemas.mjs +0 -2
  28. package/docs/specification.md +0 -146
  29. package/examples/basic/NODE.md +0 -15
  30. package/examples/basic/members/NODE.md +0 -8
  31. package/examples/basic/members/example-agent/NODE.md +0 -7
  32. package/examples/basic/members/example-agent/memory.md +0 -9
  33. package/examples/basic/systems/NODE.md +0 -10
  34. package/examples/basic/systems/runtime.md +0 -15
  35. package/hooks/hooks.json +0 -26
  36. package/hooks/session-start.mjs +0 -64
  37. package/policy/context-tree-policy.md +0 -158
  38. package/skills/context-tree-init/SKILL.md +0 -51
  39. package/skills/context-tree-init/agents/openai.yaml +0 -4
  40. package/skills/context-tree-init/scripts/context-tree.mjs +0 -41
  41. package/skills/context-tree-link/SKILL.md +0 -45
  42. package/skills/context-tree-link/agents/openai.yaml +0 -4
  43. package/skills/context-tree-link/scripts/context-tree.mjs +0 -41
  44. package/skills/context-tree-read/scripts/context-tree.mjs +0 -41
  45. package/skills/context-tree-write/scripts/context-tree.mjs +0 -41
@@ -1,278 +0,0 @@
1
- import { isAbsolute } from "node:path";
2
- import { z } from "zod";
3
- import { parse as parse$1 } 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
- function parseYamlMapping(source) {
11
- const value = parse$1(source);
12
- if (!isRecord(value)) throw new Error("frontmatter must be a YAML mapping");
13
- return value;
14
- }
15
- function readLine(source, start) {
16
- const newline = source.indexOf("\n", start);
17
- const end = newline === -1 ? source.length : newline + 1;
18
- const contentEnd = newline === -1 ? source.length : source.charCodeAt(newline - 1) === 13 ? newline - 1 : newline;
19
- return {
20
- end,
21
- start,
22
- value: source.slice(start, contentEnd)
23
- };
24
- }
25
- function parseMarkdownFrontmatter(source) {
26
- const opening = readLine(source, 0);
27
- if (opening.value !== "---") return {
28
- body: source,
29
- data: null,
30
- frontmatter: "missing"
31
- };
32
- let closing;
33
- let lineStart = opening.end;
34
- while (lineStart < source.length) {
35
- const line = readLine(source, lineStart);
36
- if (line.value === "---") {
37
- closing = line;
38
- break;
39
- }
40
- lineStart = line.end;
41
- }
42
- if (closing === void 0) return {
43
- body: "",
44
- data: null,
45
- error: "frontmatter closing delimiter is missing",
46
- frontmatter: "invalid"
47
- };
48
- const body = source.slice(closing.end);
49
- try {
50
- return {
51
- body,
52
- data: parseYamlMapping(source.slice(opening.end, closing.start)),
53
- frontmatter: "valid"
54
- };
55
- } catch (error) {
56
- return {
57
- body,
58
- data: null,
59
- error: error instanceof Error ? error.message : String(error),
60
- frontmatter: "invalid"
61
- };
62
- }
63
- }
64
- //#endregion
65
- //#region src/schemas.ts
66
- const SCHEMA_VERSION = 1;
67
- const CONTEXT_TREE_ROOT_NODE_MAX_BYTES = 16 * 1024;
68
- const VALIDATION_CODES = {
69
- rootMissing: "TREE_ROOT_MISSING",
70
- rootNodeInvalid: "TREE_ROOT_NODE_INVALID",
71
- rootOnlyFields: "TREE_ROOT_ONLY_FIELDS",
72
- directoryNodeMissing: "TREE_DIRECTORY_NODE_MISSING",
73
- frontmatterMissing: "TREE_FRONTMATTER_MISSING",
74
- frontmatterParse: "TREE_FRONTMATTER_PARSE",
75
- titleMissing: "TREE_TITLE_MISSING",
76
- titleInvalid: "TREE_TITLE_INVALID",
77
- descriptionInvalid: "TREE_DESCRIPTION_INVALID",
78
- softLinksInvalid: "TREE_SOFT_LINKS_INVALID",
79
- softLinkBroken: "TREE_SOFT_LINK_BROKEN",
80
- softLinkPathEscape: "TREE_SOFT_LINK_PATH_ESCAPE",
81
- markdownPathEscape: "TREE_MARKDOWN_LINK_PATH_ESCAPE",
82
- markdownFileSymlinkBroken: "TREE_MARKDOWN_FILE_SYMLINK_BROKEN",
83
- markdownFileSymlinkUnsupported: "TREE_MARKDOWN_FILE_SYMLINK_UNSUPPORTED",
84
- markdownFilePathEscape: "TREE_MARKDOWN_FILE_PATH_ESCAPE",
85
- markdownFileContentClassMismatch: "TREE_MARKDOWN_FILE_CONTENT_CLASS_MISMATCH",
86
- directorySymlinkUnsupported: "TREE_DIRECTORY_SYMLINK_UNSUPPORTED",
87
- directorySymlinkPathEscape: "TREE_DIRECTORY_SYMLINK_PATH_ESCAPE"
88
- };
89
- const CLI_ERROR_CODES = {
90
- ambiguousLink: "AMBIGUOUS_LINK",
91
- corruptLink: "CORRUPT_LINK",
92
- failed: "CONTEXT_TREE_FAILED",
93
- noLink: "NO_LINK",
94
- staleLink: "STALE_LINK"
95
- };
96
- function hasUnsafeCharacter(value) {
97
- return [...value].some((character) => {
98
- const code = character.codePointAt(0);
99
- return code !== void 0 && (code <= 31 || code === 127 || code === 8232 || code === 8233);
100
- });
101
- }
102
- const absoluteSingleLinePathSchema = z.string().superRefine((value, context) => {
103
- if (!isAbsolute(value) || value.trim() !== value || hasUnsafeCharacter(value)) context.addIssue({
104
- code: "custom",
105
- message: "Paths must be absolute single-line values."
106
- });
107
- });
108
- const credentialFreeRepositoryUrlSchema = z.string().superRefine((value, context) => {
109
- if (value.trim() !== value || hasUnsafeCharacter(value) || value.includes("\\")) {
110
- context.addIssue({
111
- code: "custom",
112
- message: "Repository URLs must be canonical single-line values."
113
- });
114
- return;
115
- }
116
- if (value.includes("?") || value.includes("#")) {
117
- context.addIssue({
118
- code: "custom",
119
- message: "Repository URLs must not contain a query or fragment."
120
- });
121
- return;
122
- }
123
- if (/^(?:[a-z\d._-]+@)?[a-z\d.-]+:[^\s/][^\s]*$/iu.test(value)) return;
124
- try {
125
- const parsed = new URL(value);
126
- 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");
127
- } catch {
128
- context.addIssue({
129
- code: "custom",
130
- message: "Repository URLs must use credential-free HTTP(S), ssh://, or scp-like SSH syntax."
131
- });
132
- }
133
- });
134
- const githubRepositoryIdentitySchema = z.string().superRefine((value, context) => {
135
- const parts = value.split("/");
136
- const [owner, name] = parts;
137
- if (parts.length !== 2 || owner === void 0 || name === void 0 || !/^[A-Za-z\d](?:[A-Za-z\d-]{0,37}[A-Za-z\d])?$/u.test(owner) || !/^[A-Za-z\d._-]{1,100}$/u.test(name) || name === "." || name === ".." || /\.git$/iu.test(name)) context.addIssue({
138
- code: "custom",
139
- message: "Repository must be an explicit GitHub OWNER/REPO identity."
140
- });
141
- });
142
- const contextTreeRootNodeFrontmatterSchema = z.object({
143
- schemaVersion: z.literal(1),
144
- title: z.string().trim().min(1),
145
- description: z.string().trim().min(1).optional(),
146
- soft_links: z.array(z.string().trim().min(1)).min(1).optional()
147
- }).loose();
148
- const contextTreeRootNodeSchema = z.object({
149
- frontmatter: contextTreeRootNodeFrontmatterSchema,
150
- body: z.string().trim().min(1, "Root NODE.md must contain repository-wide context.")
151
- });
152
- function parseContextTreeRootNode(markdown) {
153
- if (Buffer.byteLength(markdown, "utf8") > 16384) throw new Error(`Root NODE.md exceeds the ${CONTEXT_TREE_ROOT_NODE_MAX_BYTES}-byte limit.`);
154
- const document = parseMarkdownFrontmatter(markdown);
155
- if (document.frontmatter === "missing") throw new Error("Root NODE.md must contain YAML frontmatter.");
156
- if (document.frontmatter === "invalid") throw new Error(`Root NODE.md frontmatter is invalid: ${document.error}`);
157
- return contextTreeRootNodeSchema.parse({
158
- frontmatter: document.data,
159
- body: document.body
160
- });
161
- }
162
- const contextContentClassSchema = z.enum([
163
- "normal",
164
- "member",
165
- "repo-infra"
166
- ]);
167
- const validationCodeSchema = z.enum(VALIDATION_CODES);
168
- const treeValidationFindingSchema = z.object({
169
- code: validationCodeSchema,
170
- message: z.string(),
171
- path: z.string(),
172
- target: z.string().optional()
173
- }).strict();
174
- const contextContentClassCountsSchema = z.object({
175
- normal: z.number().int().nonnegative(),
176
- member: z.number().int().nonnegative(),
177
- "repo-infra": z.number().int().nonnegative()
178
- }).strict();
179
- const contextTreePolicySchema = z.object({
180
- content: z.string(),
181
- schemaVersion: z.literal(1)
182
- }).strict();
183
- const contextTreeReadCommonFields = {
184
- contentClass: contextContentClassSchema,
185
- kind: z.enum(["directory", "file"]),
186
- path: z.string()
187
- };
188
- const contextTreeReadNodeSchema = z.object({
189
- body: z.string(),
190
- frontmatter: z.record(z.string(), z.unknown()),
191
- ...contextTreeReadCommonFields
192
- }).strict();
193
- const contextTreeReadChildSchema = z.object({
194
- description: z.string().optional(),
195
- title: z.string(),
196
- ...contextTreeReadCommonFields
197
- }).strict();
198
- const contextTreeReadResultSchema = z.object({
199
- children: z.array(contextTreeReadChildSchema),
200
- node: contextTreeReadNodeSchema,
201
- root: z.string(),
202
- schemaVersion: z.literal(1),
203
- target: z.string()
204
- }).strict();
205
- const verifyTreeReportSchema = z.object({
206
- findings: z.array(treeValidationFindingSchema),
207
- ok: z.boolean(),
208
- root: z.string(),
209
- scannedByContentClass: contextContentClassCountsSchema,
210
- schemaVersion: z.literal(1)
211
- }).strict();
212
- const scaffoldTreeResultSchema = z.object({
213
- files: z.array(z.string()),
214
- root: z.string(),
215
- schemaVersion: z.literal(1),
216
- verification: verifyTreeReportSchema
217
- }).strict();
218
- const contextTreeProjectIdentitySchema = z.discriminatedUnion("kind", [z.object({
219
- kind: z.literal("git"),
220
- origin: credentialFreeRepositoryUrlSchema
221
- }).strict(), z.object({
222
- kind: z.literal("directory"),
223
- path: absoluteSingleLinePathSchema
224
- }).strict()]);
225
- const contextTreeLinkSchema = z.object({
226
- project: contextTreeProjectIdentitySchema,
227
- tree: z.object({
228
- path: absoluteSingleLinePathSchema,
229
- repository: githubRepositoryIdentitySchema
230
- }).strict()
231
- }).strict();
232
- const contextTreeLinkResultSchema = z.object({
233
- link: contextTreeLinkSchema,
234
- schemaVersion: z.literal(1)
235
- }).strict();
236
- const contextTreeRefreshResultSchema = z.object({
237
- link: contextTreeLinkSchema,
238
- defaultBranch: z.string().trim().min(1),
239
- refreshed: z.boolean(),
240
- schemaVersion: z.literal(1),
241
- sha: z.string()
242
- }).strict();
243
- const contextTreeStageResultSchema = z.object({
244
- link: contextTreeLinkSchema,
245
- defaultBranch: z.string().trim().min(1),
246
- baseSha: z.string(),
247
- schemaVersion: z.literal(1),
248
- taskBranch: z.string().trim().min(1),
249
- worktreePath: z.string()
250
- }).strict();
251
- const contextTreeDiffResultSchema = z.object({
252
- base: z.string(),
253
- files: z.array(z.object({
254
- path: z.string(),
255
- status: z.enum([
256
- "added",
257
- "deleted",
258
- "modified",
259
- "renamed",
260
- "untracked"
261
- ])
262
- }).strict()).max(4096),
263
- patch: z.string(),
264
- schemaVersion: z.literal(1),
265
- treePath: z.string()
266
- }).strict();
267
- const contextTreeCliErrorCodeSchema = z.enum(CLI_ERROR_CODES);
268
- const contextTreeCliErrorSchema = z.object({
269
- code: contextTreeCliErrorCodeSchema,
270
- message: z.string()
271
- }).strict();
272
- const contextTreeCliErrorEnvelopeSchema = z.object({
273
- error: contextTreeCliErrorSchema,
274
- ok: z.literal(false),
275
- schemaVersion: z.literal(1)
276
- }).strict();
277
- //#endregion
278
- export { isRecord as A, githubRepositoryIdentitySchema as C, validationCodeSchema as D, treeValidationFindingSchema as E, verifyTreeReportSchema as O, credentialFreeRepositoryUrlSchema as S, scaffoldTreeResultSchema as T, contextTreeReadResultSchema as _, contextContentClassCountsSchema as a, contextTreeRootNodeSchema as b, contextTreeCliErrorEnvelopeSchema as c, contextTreeLinkResultSchema as d, contextTreeLinkSchema as f, contextTreeReadNodeSchema as g, contextTreeReadChildSchema as h, VALIDATION_CODES as i, parseMarkdownFrontmatter as k, contextTreeCliErrorSchema as l, contextTreeProjectIdentitySchema as m, CONTEXT_TREE_ROOT_NODE_MAX_BYTES as n, contextContentClassSchema as o, contextTreePolicySchema as p, SCHEMA_VERSION as r, contextTreeCliErrorCodeSchema as s, CLI_ERROR_CODES as t, contextTreeDiffResultSchema as u, contextTreeRefreshResultSchema as v, parseContextTreeRootNode as w, contextTreeStageResultSchema as x, contextTreeRootNodeFrontmatterSchema as y };
@@ -1,394 +0,0 @@
1
- import { z } from "zod";
2
-
3
- //#region src/schemas.d.ts
4
- declare const SCHEMA_VERSION: 1;
5
- declare const CONTEXT_TREE_ROOT_NODE_MAX_BYTES: number;
6
- declare const VALIDATION_CODES: {
7
- readonly rootMissing: "TREE_ROOT_MISSING";
8
- readonly rootNodeInvalid: "TREE_ROOT_NODE_INVALID";
9
- readonly rootOnlyFields: "TREE_ROOT_ONLY_FIELDS";
10
- readonly directoryNodeMissing: "TREE_DIRECTORY_NODE_MISSING";
11
- readonly frontmatterMissing: "TREE_FRONTMATTER_MISSING";
12
- readonly frontmatterParse: "TREE_FRONTMATTER_PARSE";
13
- readonly titleMissing: "TREE_TITLE_MISSING";
14
- readonly titleInvalid: "TREE_TITLE_INVALID";
15
- readonly descriptionInvalid: "TREE_DESCRIPTION_INVALID";
16
- readonly softLinksInvalid: "TREE_SOFT_LINKS_INVALID";
17
- readonly softLinkBroken: "TREE_SOFT_LINK_BROKEN";
18
- readonly softLinkPathEscape: "TREE_SOFT_LINK_PATH_ESCAPE";
19
- readonly markdownPathEscape: "TREE_MARKDOWN_LINK_PATH_ESCAPE";
20
- readonly markdownFileSymlinkBroken: "TREE_MARKDOWN_FILE_SYMLINK_BROKEN";
21
- readonly markdownFileSymlinkUnsupported: "TREE_MARKDOWN_FILE_SYMLINK_UNSUPPORTED";
22
- readonly markdownFilePathEscape: "TREE_MARKDOWN_FILE_PATH_ESCAPE";
23
- readonly markdownFileContentClassMismatch: "TREE_MARKDOWN_FILE_CONTENT_CLASS_MISMATCH";
24
- readonly directorySymlinkUnsupported: "TREE_DIRECTORY_SYMLINK_UNSUPPORTED";
25
- readonly directorySymlinkPathEscape: "TREE_DIRECTORY_SYMLINK_PATH_ESCAPE";
26
- };
27
- declare const CLI_ERROR_CODES: {
28
- readonly ambiguousLink: "AMBIGUOUS_LINK";
29
- readonly corruptLink: "CORRUPT_LINK";
30
- readonly failed: "CONTEXT_TREE_FAILED";
31
- readonly noLink: "NO_LINK";
32
- readonly staleLink: "STALE_LINK";
33
- };
34
- declare const credentialFreeRepositoryUrlSchema: z.ZodString;
35
- declare const githubRepositoryIdentitySchema: z.ZodString;
36
- declare const contextTreeRootNodeFrontmatterSchema: z.ZodObject<{
37
- schemaVersion: z.ZodLiteral<1>;
38
- title: z.ZodString;
39
- description: z.ZodOptional<z.ZodString>;
40
- soft_links: z.ZodOptional<z.ZodArray<z.ZodString>>;
41
- }, z.core.$loose>;
42
- declare const contextTreeRootNodeSchema: z.ZodObject<{
43
- frontmatter: z.ZodObject<{
44
- schemaVersion: z.ZodLiteral<1>;
45
- title: z.ZodString;
46
- description: z.ZodOptional<z.ZodString>;
47
- soft_links: z.ZodOptional<z.ZodArray<z.ZodString>>;
48
- }, z.core.$loose>;
49
- body: z.ZodString;
50
- }, z.core.$strip>;
51
- type ContextTreeRootNode = z.infer<typeof contextTreeRootNodeSchema>;
52
- declare function parseContextTreeRootNode(markdown: string): ContextTreeRootNode;
53
- declare const contextContentClassSchema: z.ZodEnum<{
54
- normal: "normal";
55
- member: "member";
56
- "repo-infra": "repo-infra";
57
- }>;
58
- type ContextContentClass = z.infer<typeof contextContentClassSchema>;
59
- declare const validationCodeSchema: z.ZodEnum<{
60
- readonly rootMissing: "TREE_ROOT_MISSING";
61
- readonly rootNodeInvalid: "TREE_ROOT_NODE_INVALID";
62
- readonly rootOnlyFields: "TREE_ROOT_ONLY_FIELDS";
63
- readonly directoryNodeMissing: "TREE_DIRECTORY_NODE_MISSING";
64
- readonly frontmatterMissing: "TREE_FRONTMATTER_MISSING";
65
- readonly frontmatterParse: "TREE_FRONTMATTER_PARSE";
66
- readonly titleMissing: "TREE_TITLE_MISSING";
67
- readonly titleInvalid: "TREE_TITLE_INVALID";
68
- readonly descriptionInvalid: "TREE_DESCRIPTION_INVALID";
69
- readonly softLinksInvalid: "TREE_SOFT_LINKS_INVALID";
70
- readonly softLinkBroken: "TREE_SOFT_LINK_BROKEN";
71
- readonly softLinkPathEscape: "TREE_SOFT_LINK_PATH_ESCAPE";
72
- readonly markdownPathEscape: "TREE_MARKDOWN_LINK_PATH_ESCAPE";
73
- readonly markdownFileSymlinkBroken: "TREE_MARKDOWN_FILE_SYMLINK_BROKEN";
74
- readonly markdownFileSymlinkUnsupported: "TREE_MARKDOWN_FILE_SYMLINK_UNSUPPORTED";
75
- readonly markdownFilePathEscape: "TREE_MARKDOWN_FILE_PATH_ESCAPE";
76
- readonly markdownFileContentClassMismatch: "TREE_MARKDOWN_FILE_CONTENT_CLASS_MISMATCH";
77
- readonly directorySymlinkUnsupported: "TREE_DIRECTORY_SYMLINK_UNSUPPORTED";
78
- readonly directorySymlinkPathEscape: "TREE_DIRECTORY_SYMLINK_PATH_ESCAPE";
79
- }>;
80
- type ValidationCode = z.infer<typeof validationCodeSchema>;
81
- declare const treeValidationFindingSchema: z.ZodObject<{
82
- code: z.ZodEnum<{
83
- readonly rootMissing: "TREE_ROOT_MISSING";
84
- readonly rootNodeInvalid: "TREE_ROOT_NODE_INVALID";
85
- readonly rootOnlyFields: "TREE_ROOT_ONLY_FIELDS";
86
- readonly directoryNodeMissing: "TREE_DIRECTORY_NODE_MISSING";
87
- readonly frontmatterMissing: "TREE_FRONTMATTER_MISSING";
88
- readonly frontmatterParse: "TREE_FRONTMATTER_PARSE";
89
- readonly titleMissing: "TREE_TITLE_MISSING";
90
- readonly titleInvalid: "TREE_TITLE_INVALID";
91
- readonly descriptionInvalid: "TREE_DESCRIPTION_INVALID";
92
- readonly softLinksInvalid: "TREE_SOFT_LINKS_INVALID";
93
- readonly softLinkBroken: "TREE_SOFT_LINK_BROKEN";
94
- readonly softLinkPathEscape: "TREE_SOFT_LINK_PATH_ESCAPE";
95
- readonly markdownPathEscape: "TREE_MARKDOWN_LINK_PATH_ESCAPE";
96
- readonly markdownFileSymlinkBroken: "TREE_MARKDOWN_FILE_SYMLINK_BROKEN";
97
- readonly markdownFileSymlinkUnsupported: "TREE_MARKDOWN_FILE_SYMLINK_UNSUPPORTED";
98
- readonly markdownFilePathEscape: "TREE_MARKDOWN_FILE_PATH_ESCAPE";
99
- readonly markdownFileContentClassMismatch: "TREE_MARKDOWN_FILE_CONTENT_CLASS_MISMATCH";
100
- readonly directorySymlinkUnsupported: "TREE_DIRECTORY_SYMLINK_UNSUPPORTED";
101
- readonly directorySymlinkPathEscape: "TREE_DIRECTORY_SYMLINK_PATH_ESCAPE";
102
- }>;
103
- message: z.ZodString;
104
- path: z.ZodString;
105
- target: z.ZodOptional<z.ZodString>;
106
- }, z.core.$strict>;
107
- type TreeValidationFinding = z.infer<typeof treeValidationFindingSchema>;
108
- declare const contextContentClassCountsSchema: z.ZodObject<{
109
- normal: z.ZodNumber;
110
- member: z.ZodNumber;
111
- "repo-infra": z.ZodNumber;
112
- }, z.core.$strict>;
113
- type ContextContentClassCounts = z.infer<typeof contextContentClassCountsSchema>;
114
- declare const contextTreePolicySchema: z.ZodObject<{
115
- content: z.ZodString;
116
- schemaVersion: z.ZodLiteral<1>;
117
- }, z.core.$strict>;
118
- type ContextTreePolicy = z.infer<typeof contextTreePolicySchema>;
119
- declare const contextTreeReadNodeSchema: z.ZodObject<{
120
- contentClass: z.ZodEnum<{
121
- normal: "normal";
122
- member: "member";
123
- "repo-infra": "repo-infra";
124
- }>;
125
- kind: z.ZodEnum<{
126
- file: "file";
127
- directory: "directory";
128
- }>;
129
- path: z.ZodString;
130
- body: z.ZodString;
131
- frontmatter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
132
- }, z.core.$strict>;
133
- type ContextTreeReadNode = z.infer<typeof contextTreeReadNodeSchema>;
134
- declare const contextTreeReadChildSchema: z.ZodObject<{
135
- contentClass: z.ZodEnum<{
136
- normal: "normal";
137
- member: "member";
138
- "repo-infra": "repo-infra";
139
- }>;
140
- kind: z.ZodEnum<{
141
- file: "file";
142
- directory: "directory";
143
- }>;
144
- path: z.ZodString;
145
- description: z.ZodOptional<z.ZodString>;
146
- title: z.ZodString;
147
- }, z.core.$strict>;
148
- type ContextTreeReadChild = z.infer<typeof contextTreeReadChildSchema>;
149
- declare const contextTreeReadResultSchema: z.ZodObject<{
150
- children: z.ZodArray<z.ZodObject<{
151
- contentClass: z.ZodEnum<{
152
- normal: "normal";
153
- member: "member";
154
- "repo-infra": "repo-infra";
155
- }>;
156
- kind: z.ZodEnum<{
157
- file: "file";
158
- directory: "directory";
159
- }>;
160
- path: z.ZodString;
161
- description: z.ZodOptional<z.ZodString>;
162
- title: z.ZodString;
163
- }, z.core.$strict>>;
164
- node: z.ZodObject<{
165
- contentClass: z.ZodEnum<{
166
- normal: "normal";
167
- member: "member";
168
- "repo-infra": "repo-infra";
169
- }>;
170
- kind: z.ZodEnum<{
171
- file: "file";
172
- directory: "directory";
173
- }>;
174
- path: z.ZodString;
175
- body: z.ZodString;
176
- frontmatter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
177
- }, z.core.$strict>;
178
- root: z.ZodString;
179
- schemaVersion: z.ZodLiteral<1>;
180
- target: z.ZodString;
181
- }, z.core.$strict>;
182
- type ContextTreeReadResult = z.infer<typeof contextTreeReadResultSchema>;
183
- declare const verifyTreeReportSchema: z.ZodObject<{
184
- findings: z.ZodArray<z.ZodObject<{
185
- code: z.ZodEnum<{
186
- readonly rootMissing: "TREE_ROOT_MISSING";
187
- readonly rootNodeInvalid: "TREE_ROOT_NODE_INVALID";
188
- readonly rootOnlyFields: "TREE_ROOT_ONLY_FIELDS";
189
- readonly directoryNodeMissing: "TREE_DIRECTORY_NODE_MISSING";
190
- readonly frontmatterMissing: "TREE_FRONTMATTER_MISSING";
191
- readonly frontmatterParse: "TREE_FRONTMATTER_PARSE";
192
- readonly titleMissing: "TREE_TITLE_MISSING";
193
- readonly titleInvalid: "TREE_TITLE_INVALID";
194
- readonly descriptionInvalid: "TREE_DESCRIPTION_INVALID";
195
- readonly softLinksInvalid: "TREE_SOFT_LINKS_INVALID";
196
- readonly softLinkBroken: "TREE_SOFT_LINK_BROKEN";
197
- readonly softLinkPathEscape: "TREE_SOFT_LINK_PATH_ESCAPE";
198
- readonly markdownPathEscape: "TREE_MARKDOWN_LINK_PATH_ESCAPE";
199
- readonly markdownFileSymlinkBroken: "TREE_MARKDOWN_FILE_SYMLINK_BROKEN";
200
- readonly markdownFileSymlinkUnsupported: "TREE_MARKDOWN_FILE_SYMLINK_UNSUPPORTED";
201
- readonly markdownFilePathEscape: "TREE_MARKDOWN_FILE_PATH_ESCAPE";
202
- readonly markdownFileContentClassMismatch: "TREE_MARKDOWN_FILE_CONTENT_CLASS_MISMATCH";
203
- readonly directorySymlinkUnsupported: "TREE_DIRECTORY_SYMLINK_UNSUPPORTED";
204
- readonly directorySymlinkPathEscape: "TREE_DIRECTORY_SYMLINK_PATH_ESCAPE";
205
- }>;
206
- message: z.ZodString;
207
- path: z.ZodString;
208
- target: z.ZodOptional<z.ZodString>;
209
- }, z.core.$strict>>;
210
- ok: z.ZodBoolean;
211
- root: z.ZodString;
212
- scannedByContentClass: z.ZodObject<{
213
- normal: z.ZodNumber;
214
- member: z.ZodNumber;
215
- "repo-infra": z.ZodNumber;
216
- }, z.core.$strict>;
217
- schemaVersion: z.ZodLiteral<1>;
218
- }, z.core.$strict>;
219
- type VerifyTreeReport = z.infer<typeof verifyTreeReportSchema>;
220
- declare const scaffoldTreeResultSchema: z.ZodObject<{
221
- files: z.ZodArray<z.ZodString>;
222
- root: z.ZodString;
223
- schemaVersion: z.ZodLiteral<1>;
224
- verification: z.ZodObject<{
225
- findings: z.ZodArray<z.ZodObject<{
226
- code: z.ZodEnum<{
227
- readonly rootMissing: "TREE_ROOT_MISSING";
228
- readonly rootNodeInvalid: "TREE_ROOT_NODE_INVALID";
229
- readonly rootOnlyFields: "TREE_ROOT_ONLY_FIELDS";
230
- readonly directoryNodeMissing: "TREE_DIRECTORY_NODE_MISSING";
231
- readonly frontmatterMissing: "TREE_FRONTMATTER_MISSING";
232
- readonly frontmatterParse: "TREE_FRONTMATTER_PARSE";
233
- readonly titleMissing: "TREE_TITLE_MISSING";
234
- readonly titleInvalid: "TREE_TITLE_INVALID";
235
- readonly descriptionInvalid: "TREE_DESCRIPTION_INVALID";
236
- readonly softLinksInvalid: "TREE_SOFT_LINKS_INVALID";
237
- readonly softLinkBroken: "TREE_SOFT_LINK_BROKEN";
238
- readonly softLinkPathEscape: "TREE_SOFT_LINK_PATH_ESCAPE";
239
- readonly markdownPathEscape: "TREE_MARKDOWN_LINK_PATH_ESCAPE";
240
- readonly markdownFileSymlinkBroken: "TREE_MARKDOWN_FILE_SYMLINK_BROKEN";
241
- readonly markdownFileSymlinkUnsupported: "TREE_MARKDOWN_FILE_SYMLINK_UNSUPPORTED";
242
- readonly markdownFilePathEscape: "TREE_MARKDOWN_FILE_PATH_ESCAPE";
243
- readonly markdownFileContentClassMismatch: "TREE_MARKDOWN_FILE_CONTENT_CLASS_MISMATCH";
244
- readonly directorySymlinkUnsupported: "TREE_DIRECTORY_SYMLINK_UNSUPPORTED";
245
- readonly directorySymlinkPathEscape: "TREE_DIRECTORY_SYMLINK_PATH_ESCAPE";
246
- }>;
247
- message: z.ZodString;
248
- path: z.ZodString;
249
- target: z.ZodOptional<z.ZodString>;
250
- }, z.core.$strict>>;
251
- ok: z.ZodBoolean;
252
- root: z.ZodString;
253
- scannedByContentClass: z.ZodObject<{
254
- normal: z.ZodNumber;
255
- member: z.ZodNumber;
256
- "repo-infra": z.ZodNumber;
257
- }, z.core.$strict>;
258
- schemaVersion: z.ZodLiteral<1>;
259
- }, z.core.$strict>;
260
- }, z.core.$strict>;
261
- type ScaffoldTreeResult = z.infer<typeof scaffoldTreeResultSchema>;
262
- declare const contextTreeProjectIdentitySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
263
- kind: z.ZodLiteral<"git">;
264
- origin: z.ZodString;
265
- }, z.core.$strict>, z.ZodObject<{
266
- kind: z.ZodLiteral<"directory">;
267
- path: z.ZodString;
268
- }, z.core.$strict>], "kind">;
269
- type ContextTreeProjectIdentity = z.infer<typeof contextTreeProjectIdentitySchema>;
270
- declare const contextTreeLinkSchema: z.ZodObject<{
271
- project: z.ZodDiscriminatedUnion<[z.ZodObject<{
272
- kind: z.ZodLiteral<"git">;
273
- origin: z.ZodString;
274
- }, z.core.$strict>, z.ZodObject<{
275
- kind: z.ZodLiteral<"directory">;
276
- path: z.ZodString;
277
- }, z.core.$strict>], "kind">;
278
- tree: z.ZodObject<{
279
- path: z.ZodString;
280
- repository: z.ZodString;
281
- }, z.core.$strict>;
282
- }, z.core.$strict>;
283
- type ContextTreeLink = z.infer<typeof contextTreeLinkSchema>;
284
- declare const contextTreeLinkResultSchema: z.ZodObject<{
285
- link: z.ZodObject<{
286
- project: z.ZodDiscriminatedUnion<[z.ZodObject<{
287
- kind: z.ZodLiteral<"git">;
288
- origin: z.ZodString;
289
- }, z.core.$strict>, z.ZodObject<{
290
- kind: z.ZodLiteral<"directory">;
291
- path: z.ZodString;
292
- }, z.core.$strict>], "kind">;
293
- tree: z.ZodObject<{
294
- path: z.ZodString;
295
- repository: z.ZodString;
296
- }, z.core.$strict>;
297
- }, z.core.$strict>;
298
- schemaVersion: z.ZodLiteral<1>;
299
- }, z.core.$strict>;
300
- type ContextTreeLinkResult = z.infer<typeof contextTreeLinkResultSchema>;
301
- declare const contextTreeRefreshResultSchema: z.ZodObject<{
302
- link: z.ZodObject<{
303
- project: z.ZodDiscriminatedUnion<[z.ZodObject<{
304
- kind: z.ZodLiteral<"git">;
305
- origin: z.ZodString;
306
- }, z.core.$strict>, z.ZodObject<{
307
- kind: z.ZodLiteral<"directory">;
308
- path: z.ZodString;
309
- }, z.core.$strict>], "kind">;
310
- tree: z.ZodObject<{
311
- path: z.ZodString;
312
- repository: z.ZodString;
313
- }, z.core.$strict>;
314
- }, z.core.$strict>;
315
- defaultBranch: z.ZodString;
316
- refreshed: z.ZodBoolean;
317
- schemaVersion: z.ZodLiteral<1>;
318
- sha: z.ZodString;
319
- }, z.core.$strict>;
320
- type ContextTreeRefreshResult = z.infer<typeof contextTreeRefreshResultSchema>;
321
- declare const contextTreeStageResultSchema: z.ZodObject<{
322
- link: z.ZodObject<{
323
- project: z.ZodDiscriminatedUnion<[z.ZodObject<{
324
- kind: z.ZodLiteral<"git">;
325
- origin: z.ZodString;
326
- }, z.core.$strict>, z.ZodObject<{
327
- kind: z.ZodLiteral<"directory">;
328
- path: z.ZodString;
329
- }, z.core.$strict>], "kind">;
330
- tree: z.ZodObject<{
331
- path: z.ZodString;
332
- repository: z.ZodString;
333
- }, z.core.$strict>;
334
- }, z.core.$strict>;
335
- defaultBranch: z.ZodString;
336
- baseSha: z.ZodString;
337
- schemaVersion: z.ZodLiteral<1>;
338
- taskBranch: z.ZodString;
339
- worktreePath: z.ZodString;
340
- }, z.core.$strict>;
341
- type ContextTreeStageResult = z.infer<typeof contextTreeStageResultSchema>;
342
- declare const contextTreeDiffResultSchema: z.ZodObject<{
343
- base: z.ZodString;
344
- files: z.ZodArray<z.ZodObject<{
345
- path: z.ZodString;
346
- status: z.ZodEnum<{
347
- added: "added";
348
- deleted: "deleted";
349
- modified: "modified";
350
- renamed: "renamed";
351
- untracked: "untracked";
352
- }>;
353
- }, z.core.$strict>>;
354
- patch: z.ZodString;
355
- schemaVersion: z.ZodLiteral<1>;
356
- treePath: z.ZodString;
357
- }, z.core.$strict>;
358
- type ContextTreeDiffResult = z.infer<typeof contextTreeDiffResultSchema>;
359
- declare const contextTreeCliErrorCodeSchema: z.ZodEnum<{
360
- readonly ambiguousLink: "AMBIGUOUS_LINK";
361
- readonly corruptLink: "CORRUPT_LINK";
362
- readonly failed: "CONTEXT_TREE_FAILED";
363
- readonly noLink: "NO_LINK";
364
- readonly staleLink: "STALE_LINK";
365
- }>;
366
- type ContextTreeCliErrorCode = z.infer<typeof contextTreeCliErrorCodeSchema>;
367
- declare const contextTreeCliErrorSchema: z.ZodObject<{
368
- code: z.ZodEnum<{
369
- readonly ambiguousLink: "AMBIGUOUS_LINK";
370
- readonly corruptLink: "CORRUPT_LINK";
371
- readonly failed: "CONTEXT_TREE_FAILED";
372
- readonly noLink: "NO_LINK";
373
- readonly staleLink: "STALE_LINK";
374
- }>;
375
- message: z.ZodString;
376
- }, z.core.$strict>;
377
- type ContextTreeCliError = z.infer<typeof contextTreeCliErrorSchema>;
378
- declare const contextTreeCliErrorEnvelopeSchema: z.ZodObject<{
379
- error: z.ZodObject<{
380
- code: z.ZodEnum<{
381
- readonly ambiguousLink: "AMBIGUOUS_LINK";
382
- readonly corruptLink: "CORRUPT_LINK";
383
- readonly failed: "CONTEXT_TREE_FAILED";
384
- readonly noLink: "NO_LINK";
385
- readonly staleLink: "STALE_LINK";
386
- }>;
387
- message: z.ZodString;
388
- }, z.core.$strict>;
389
- ok: z.ZodLiteral<false>;
390
- schemaVersion: z.ZodLiteral<1>;
391
- }, z.core.$strict>;
392
- type ContextTreeCliErrorEnvelope = z.infer<typeof contextTreeCliErrorEnvelopeSchema>;
393
- //#endregion
394
- export { contextTreeDiffResultSchema as A, contextTreeRootNodeSchema as B, ValidationCode as C, contextTreeCliErrorCodeSchema as D, contextContentClassSchema as E, contextTreeReadChildSchema as F, scaffoldTreeResultSchema as G, credentialFreeRepositoryUrlSchema as H, contextTreeReadNodeSchema as I, verifyTreeReportSchema as J, treeValidationFindingSchema as K, contextTreeReadResultSchema as L, contextTreeLinkSchema as M, contextTreePolicySchema as N, contextTreeCliErrorEnvelopeSchema as O, contextTreeProjectIdentitySchema as P, contextTreeRefreshResultSchema as R, VALIDATION_CODES as S, contextContentClassCountsSchema as T, githubRepositoryIdentitySchema as U, contextTreeStageResultSchema as V, parseContextTreeRootNode as W, ContextTreeRootNode as _, ContextTreeCliError as a, ScaffoldTreeResult as b, ContextTreeDiffResult as c, ContextTreePolicy as d, ContextTreeProjectIdentity as f, ContextTreeRefreshResult as g, ContextTreeReadResult as h, ContextContentClassCounts as i, contextTreeLinkResultSchema as j, contextTreeCliErrorSchema as k, ContextTreeLink as l, ContextTreeReadNode as m, CONTEXT_TREE_ROOT_NODE_MAX_BYTES as n, ContextTreeCliErrorCode as o, ContextTreeReadChild as p, validationCodeSchema as q, ContextContentClass as r, ContextTreeCliErrorEnvelope as s, CLI_ERROR_CODES as t, ContextTreeLinkResult as u, ContextTreeStageResult as v, VerifyTreeReport as w, TreeValidationFinding as x, SCHEMA_VERSION as y, contextTreeRootNodeFrontmatterSchema as z };
@@ -1,2 +0,0 @@
1
- import { A as contextTreeDiffResultSchema, B as contextTreeRootNodeSchema, C as ValidationCode, D as contextTreeCliErrorCodeSchema, E as contextContentClassSchema, F as contextTreeReadChildSchema, G as scaffoldTreeResultSchema, H as credentialFreeRepositoryUrlSchema, I as contextTreeReadNodeSchema, J as verifyTreeReportSchema, K as treeValidationFindingSchema, L as contextTreeReadResultSchema, M as contextTreeLinkSchema, N as contextTreePolicySchema, O as contextTreeCliErrorEnvelopeSchema, P as contextTreeProjectIdentitySchema, R as contextTreeRefreshResultSchema, S as VALIDATION_CODES, T as contextContentClassCountsSchema, U as githubRepositoryIdentitySchema, V as contextTreeStageResultSchema, W as parseContextTreeRootNode, _ as ContextTreeRootNode, a as ContextTreeCliError, b as ScaffoldTreeResult, c as ContextTreeDiffResult, d as ContextTreePolicy, f as ContextTreeProjectIdentity, g as ContextTreeRefreshResult, h as ContextTreeReadResult, i as ContextContentClassCounts, j as contextTreeLinkResultSchema, k as contextTreeCliErrorSchema, l as ContextTreeLink, m as ContextTreeReadNode, n as CONTEXT_TREE_ROOT_NODE_MAX_BYTES, o as ContextTreeCliErrorCode, p as ContextTreeReadChild, q as validationCodeSchema, r as ContextContentClass, s as ContextTreeCliErrorEnvelope, t as CLI_ERROR_CODES, u as ContextTreeLinkResult, v as ContextTreeStageResult, w as VerifyTreeReport, x as TreeValidationFinding, y as SCHEMA_VERSION, z as contextTreeRootNodeFrontmatterSchema } from "./schemas-C4bs-FkC.mjs";
2
- export { CLI_ERROR_CODES, CONTEXT_TREE_ROOT_NODE_MAX_BYTES, ContextContentClass, ContextContentClassCounts, ContextTreeCliError, ContextTreeCliErrorCode, ContextTreeCliErrorEnvelope, ContextTreeDiffResult, ContextTreeLink, ContextTreeLinkResult, ContextTreePolicy, ContextTreeProjectIdentity, ContextTreeReadChild, ContextTreeReadNode, ContextTreeReadResult, ContextTreeRefreshResult, ContextTreeRootNode, ContextTreeStageResult, SCHEMA_VERSION, ScaffoldTreeResult, TreeValidationFinding, VALIDATION_CODES, ValidationCode, VerifyTreeReport, contextContentClassCountsSchema, contextContentClassSchema, contextTreeCliErrorCodeSchema, contextTreeCliErrorEnvelopeSchema, contextTreeCliErrorSchema, contextTreeDiffResultSchema, contextTreeLinkResultSchema, contextTreeLinkSchema, contextTreePolicySchema, contextTreeProjectIdentitySchema, contextTreeReadChildSchema, contextTreeReadNodeSchema, contextTreeReadResultSchema, contextTreeRefreshResultSchema, contextTreeRootNodeFrontmatterSchema, contextTreeRootNodeSchema, contextTreeStageResultSchema, credentialFreeRepositoryUrlSchema, githubRepositoryIdentitySchema, parseContextTreeRootNode, scaffoldTreeResultSchema, treeValidationFindingSchema, validationCodeSchema, verifyTreeReportSchema };
package/dist/schemas.mjs DELETED
@@ -1,2 +0,0 @@
1
- import { C as githubRepositoryIdentitySchema, D as validationCodeSchema, E as treeValidationFindingSchema, O as verifyTreeReportSchema, S as credentialFreeRepositoryUrlSchema, T as scaffoldTreeResultSchema, _ as contextTreeReadResultSchema, a as contextContentClassCountsSchema, b as contextTreeRootNodeSchema, c as contextTreeCliErrorEnvelopeSchema, d as contextTreeLinkResultSchema, f as contextTreeLinkSchema, g as contextTreeReadNodeSchema, h as contextTreeReadChildSchema, i as VALIDATION_CODES, l as contextTreeCliErrorSchema, m as contextTreeProjectIdentitySchema, n as CONTEXT_TREE_ROOT_NODE_MAX_BYTES, o as contextContentClassSchema, p as contextTreePolicySchema, r as SCHEMA_VERSION, s as contextTreeCliErrorCodeSchema, t as CLI_ERROR_CODES, u as contextTreeDiffResultSchema, v as contextTreeRefreshResultSchema, w as parseContextTreeRootNode, x as contextTreeStageResultSchema, y as contextTreeRootNodeFrontmatterSchema } from "./schemas-BWM6Q6iz.mjs";
2
- export { CLI_ERROR_CODES, CONTEXT_TREE_ROOT_NODE_MAX_BYTES, SCHEMA_VERSION, VALIDATION_CODES, contextContentClassCountsSchema, contextContentClassSchema, contextTreeCliErrorCodeSchema, contextTreeCliErrorEnvelopeSchema, contextTreeCliErrorSchema, contextTreeDiffResultSchema, contextTreeLinkResultSchema, contextTreeLinkSchema, contextTreePolicySchema, contextTreeProjectIdentitySchema, contextTreeReadChildSchema, contextTreeReadNodeSchema, contextTreeReadResultSchema, contextTreeRefreshResultSchema, contextTreeRootNodeFrontmatterSchema, contextTreeRootNodeSchema, contextTreeStageResultSchema, credentialFreeRepositoryUrlSchema, githubRepositoryIdentitySchema, parseContextTreeRootNode, scaffoldTreeResultSchema, treeValidationFindingSchema, validationCodeSchema, verifyTreeReportSchema };