@gentorial/core 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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Gentorial contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # `@gentorial/core`
2
+
3
+ Gentorial 的框架无关协议层,包含课程定义、概念锚点、章节范围、学习者偏好、生成指令、受控课程块、诊断和插件接口。
4
+
5
+ 该包可同时在 Node.js 与浏览器中使用。它不会访问文件系统、发起网络请求,也不依赖 Vue、VitePress 或任何模型 SDK。
6
+
7
+ ```ts
8
+ import { defineCourse } from '@gentorial/core'
9
+
10
+ export default defineCourse({
11
+ schemaVersion: '1',
12
+ id: 'c-language',
13
+ title: 'C 语言教程',
14
+ lang: 'zh-CN',
15
+ contentDir: 'content',
16
+ generation: {
17
+ mode: 'hybrid',
18
+ defaultLocale: 'zh-CN'
19
+ },
20
+ accuracy: {
21
+ standards: ['ISO C17'],
22
+ policies: ['概念锚点的结论不可被反转']
23
+ }
24
+ })
25
+ ```
26
+
27
+ 一次生成会分别记录作者限定的 `scope`、标题触发器、`after-source` 输出目标和学习者表达偏好。生成结果必须在 `grounding.sourceIds` 中声明对应章节来源;概念锚点仍通过 `grounding.conceptIds` 独立校验。
28
+
29
+ `LessonConversationTurn` 用于记录结果上的深入问答。学习者消息是非空的 `content`,助手消息始终保存完整、可校验的 `GeneratedLesson`,因此后续回答与初始结果使用同一套安全输出协议。
@@ -0,0 +1,2 @@
1
+ import type { CourseDefinition } from './types.js';
2
+ export declare function defineCourse<const T extends CourseDefinition>(definition: T): T;
@@ -0,0 +1,4 @@
1
+ export { defineCourse } from './course.js';
2
+ export type { GentorialPlugin, PromptExtensionContext, PromptFragment, TransformContext, ValidationContext } from './plugin.js';
3
+ export { calloutBlockSchema, codeBlockSchema, comparisonBlockSchema, conceptSpecSchema, courseDefinitionSchema, courseManifestSchema, generatedLessonSchema, generateOutputSchema, generateSpecSchema, generateTriggerSchema, headingBlockSchema, learnerProfileSchema, lessonConversationTurnSchema, lessonBlockSchema, listBlockSchema, paragraphBlockSchema, sectionScopeSchema, sourceLocationSchema, validationDiagnosticSchema } from './schemas.js';
4
+ export type { CalloutBlock, CodeBlock, ComparisonBlock, ConceptSpec, CourseDefinition, CourseManifest, GeneratedLesson, GenerateOutput, GenerateSpec, GenerateTrigger, HeadingBlock, LearnerProfile, LessonConversationTurn, LessonBlock, ListBlock, ParagraphBlock, SectionScope, SourceLocation, ValidationDiagnostic } from './types.js';
package/dist/index.js ADDED
@@ -0,0 +1,186 @@
1
+ // src/schemas.ts
2
+ import { z } from "zod";
3
+ var nonBlankString = z.string().min(1).refine((value) => value.trim().length > 0, {
4
+ message: "Must not be blank"
5
+ });
6
+ var idSchema = z.string().min(1).regex(/^[a-z0-9]+(?:[._-][a-z0-9]+)*$/i, "Invalid stable identifier");
7
+ var sourceLocationSchema = z.object({
8
+ file: nonBlankString,
9
+ line: z.number().int().positive(),
10
+ column: z.number().int().positive().optional()
11
+ }).strict();
12
+ var validationDiagnosticSchema = z.object({
13
+ severity: z.enum(["error", "warning", "info"]),
14
+ code: nonBlankString,
15
+ message: nonBlankString,
16
+ source: sourceLocationSchema.optional(),
17
+ path: z.array(z.union([z.string(), z.number().int().nonnegative()])).optional()
18
+ }).strict();
19
+ var pluginSchema = z.custom(
20
+ (value) => typeof value === "object" && value !== null && typeof Reflect.get(value, "name") === "string" && typeof Reflect.get(value, "version") === "string",
21
+ "Invalid Gentorial plugin"
22
+ );
23
+ var courseDefinitionSchema = z.object({
24
+ schemaVersion: z.literal("1"),
25
+ id: idSchema,
26
+ title: nonBlankString,
27
+ description: nonBlankString.optional(),
28
+ lang: nonBlankString,
29
+ contentDir: nonBlankString,
30
+ generation: z.object({
31
+ mode: z.enum(["snapshot", "on-demand", "hybrid"]),
32
+ defaultLocale: nonBlankString
33
+ }).strict(),
34
+ accuracy: z.object({
35
+ policies: z.array(nonBlankString),
36
+ standards: z.array(nonBlankString).optional()
37
+ }).strict(),
38
+ plugins: z.array(pluginSchema).optional()
39
+ }).strict();
40
+ var conceptSpecSchema = z.object({
41
+ id: idSchema,
42
+ title: nonBlankString.optional(),
43
+ statement: nonBlankString,
44
+ source: sourceLocationSchema
45
+ }).strict();
46
+ var learnerProfileSchema = z.object({
47
+ locale: nonBlankString.optional(),
48
+ background: nonBlankString.optional(),
49
+ goal: nonBlankString.optional(),
50
+ detail: z.enum(["concise", "balanced", "deep"]).optional(),
51
+ tone: z.enum(["neutral", "conversational", "formal"]).optional(),
52
+ narrative: z.enum(["direct", "story", "timeline", "comparison"]).optional(),
53
+ examplePreferences: z.array(nonBlankString).min(1).optional()
54
+ }).strict();
55
+ var sectionScopeSchema = z.object({
56
+ type: z.literal("section"),
57
+ id: idSchema,
58
+ heading: nonBlankString,
59
+ level: z.number().int().min(1).max(6),
60
+ markdown: nonBlankString,
61
+ source: sourceLocationSchema
62
+ }).strict();
63
+ var generateTriggerSchema = z.object({
64
+ type: z.literal("heading"),
65
+ source: sourceLocationSchema
66
+ }).strict();
67
+ var generateOutputSchema = z.object({
68
+ placement: z.literal("after-source"),
69
+ mode: z.literal("replace")
70
+ }).strict();
71
+ var generateSpecSchema = z.object({
72
+ id: idSchema,
73
+ kind: z.enum(["explanation", "example", "comparison", "exercise", "feedback"]),
74
+ prompt: nonBlankString,
75
+ concepts: z.array(idSchema),
76
+ scope: sectionScopeSchema,
77
+ trigger: generateTriggerSchema,
78
+ output: generateOutputSchema,
79
+ source: sourceLocationSchema
80
+ }).strict();
81
+ var paragraphBlockSchema = z.object({
82
+ type: z.literal("paragraph"),
83
+ text: nonBlankString
84
+ }).strict();
85
+ var headingBlockSchema = z.object({
86
+ type: z.literal("heading"),
87
+ level: z.union([z.literal(2), z.literal(3), z.literal(4)]),
88
+ text: nonBlankString
89
+ }).strict();
90
+ var listBlockSchema = z.object({
91
+ type: z.literal("list"),
92
+ ordered: z.boolean(),
93
+ items: z.array(nonBlankString).min(1)
94
+ }).strict();
95
+ var codeBlockSchema = z.object({
96
+ type: z.literal("code"),
97
+ code: nonBlankString,
98
+ language: nonBlankString.optional(),
99
+ caption: nonBlankString.optional()
100
+ }).strict();
101
+ var calloutBlockSchema = z.object({
102
+ type: z.literal("callout"),
103
+ tone: z.enum(["info", "tip", "warning", "danger"]),
104
+ title: nonBlankString.optional(),
105
+ text: nonBlankString
106
+ }).strict();
107
+ var comparisonSideSchema = z.object({
108
+ title: nonBlankString,
109
+ items: z.array(nonBlankString).min(1)
110
+ }).strict();
111
+ var comparisonBlockSchema = z.object({
112
+ type: z.literal("comparison"),
113
+ left: comparisonSideSchema,
114
+ right: comparisonSideSchema
115
+ }).strict();
116
+ var lessonBlockSchema = z.discriminatedUnion("type", [
117
+ paragraphBlockSchema,
118
+ headingBlockSchema,
119
+ listBlockSchema,
120
+ codeBlockSchema,
121
+ calloutBlockSchema,
122
+ comparisonBlockSchema
123
+ ]);
124
+ var generatedLessonSchema = z.object({
125
+ schemaVersion: z.literal("1"),
126
+ title: nonBlankString.optional(),
127
+ blocks: z.array(lessonBlockSchema).min(1),
128
+ grounding: z.object({
129
+ conceptIds: z.array(idSchema),
130
+ sourceIds: z.array(idSchema),
131
+ notes: z.array(nonBlankString).optional()
132
+ }).strict()
133
+ }).strict();
134
+ var lessonConversationTurnSchema = z.discriminatedUnion("role", [
135
+ z.object({
136
+ role: z.literal("user"),
137
+ content: nonBlankString
138
+ }).strict(),
139
+ z.object({
140
+ role: z.literal("assistant"),
141
+ lesson: generatedLessonSchema
142
+ }).strict()
143
+ ]);
144
+ var manifestCourseSchema = courseDefinitionSchema.omit({ plugins: true }).extend({
145
+ plugins: z.array(
146
+ z.object({
147
+ name: nonBlankString,
148
+ version: nonBlankString
149
+ }).strict()
150
+ ).optional()
151
+ }).strict();
152
+ var courseManifestSchema = z.object({
153
+ schemaVersion: z.literal("1"),
154
+ course: manifestCourseSchema,
155
+ concepts: z.array(conceptSpecSchema),
156
+ generates: z.array(generateSpecSchema),
157
+ contentHash: z.string().regex(/^[a-f0-9]{64}$/)
158
+ }).strict();
159
+
160
+ // src/course.ts
161
+ function defineCourse(definition) {
162
+ return courseDefinitionSchema.parse(definition);
163
+ }
164
+ export {
165
+ calloutBlockSchema,
166
+ codeBlockSchema,
167
+ comparisonBlockSchema,
168
+ conceptSpecSchema,
169
+ courseDefinitionSchema,
170
+ courseManifestSchema,
171
+ defineCourse,
172
+ generateOutputSchema,
173
+ generateSpecSchema,
174
+ generateTriggerSchema,
175
+ generatedLessonSchema,
176
+ headingBlockSchema,
177
+ learnerProfileSchema,
178
+ lessonBlockSchema,
179
+ lessonConversationTurnSchema,
180
+ listBlockSchema,
181
+ paragraphBlockSchema,
182
+ sectionScopeSchema,
183
+ sourceLocationSchema,
184
+ validationDiagnosticSchema
185
+ };
186
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/schemas.ts","../src/course.ts"],"sourcesContent":["import { z } from 'zod'\nimport type { GentorialPlugin } from './plugin.js'\n\nconst nonBlankString = z.string().min(1).refine((value) => value.trim().length > 0, {\n message: 'Must not be blank'\n})\n\nconst idSchema = z\n .string()\n .min(1)\n .regex(/^[a-z0-9]+(?:[._-][a-z0-9]+)*$/i, 'Invalid stable identifier')\n\nexport const sourceLocationSchema = z\n .object({\n file: nonBlankString,\n line: z.number().int().positive(),\n column: z.number().int().positive().optional()\n })\n .strict()\n\nexport const validationDiagnosticSchema = z\n .object({\n severity: z.enum(['error', 'warning', 'info']),\n code: nonBlankString,\n message: nonBlankString,\n source: sourceLocationSchema.optional(),\n path: z.array(z.union([z.string(), z.number().int().nonnegative()])).optional()\n })\n .strict()\n\nconst pluginSchema = z.custom<GentorialPlugin>(\n (value) =>\n typeof value === 'object' &&\n value !== null &&\n typeof Reflect.get(value, 'name') === 'string' &&\n typeof Reflect.get(value, 'version') === 'string',\n 'Invalid Gentorial plugin'\n)\n\nexport const courseDefinitionSchema = z\n .object({\n schemaVersion: z.literal('1'),\n id: idSchema,\n title: nonBlankString,\n description: nonBlankString.optional(),\n lang: nonBlankString,\n contentDir: nonBlankString,\n generation: z\n .object({\n mode: z.enum(['snapshot', 'on-demand', 'hybrid']),\n defaultLocale: nonBlankString\n })\n .strict(),\n accuracy: z\n .object({\n policies: z.array(nonBlankString),\n standards: z.array(nonBlankString).optional()\n })\n .strict(),\n plugins: z.array(pluginSchema).optional()\n })\n .strict()\n\nexport const conceptSpecSchema = z\n .object({\n id: idSchema,\n title: nonBlankString.optional(),\n statement: nonBlankString,\n source: sourceLocationSchema\n })\n .strict()\n\nexport const learnerProfileSchema = z\n .object({\n locale: nonBlankString.optional(),\n background: nonBlankString.optional(),\n goal: nonBlankString.optional(),\n detail: z.enum(['concise', 'balanced', 'deep']).optional(),\n tone: z.enum(['neutral', 'conversational', 'formal']).optional(),\n narrative: z.enum(['direct', 'story', 'timeline', 'comparison']).optional(),\n examplePreferences: z.array(nonBlankString).min(1).optional()\n })\n .strict()\n\nexport const sectionScopeSchema = z\n .object({\n type: z.literal('section'),\n id: idSchema,\n heading: nonBlankString,\n level: z.number().int().min(1).max(6),\n markdown: nonBlankString,\n source: sourceLocationSchema\n })\n .strict()\n\nexport const generateTriggerSchema = z\n .object({\n type: z.literal('heading'),\n source: sourceLocationSchema\n })\n .strict()\n\nexport const generateOutputSchema = z\n .object({\n placement: z.literal('after-source'),\n mode: z.literal('replace')\n })\n .strict()\n\nexport const generateSpecSchema = z\n .object({\n id: idSchema,\n kind: z.enum(['explanation', 'example', 'comparison', 'exercise', 'feedback']),\n prompt: nonBlankString,\n concepts: z.array(idSchema),\n scope: sectionScopeSchema,\n trigger: generateTriggerSchema,\n output: generateOutputSchema,\n source: sourceLocationSchema\n })\n .strict()\n\nexport const paragraphBlockSchema = z\n .object({\n type: z.literal('paragraph'),\n text: nonBlankString\n })\n .strict()\n\nexport const headingBlockSchema = z\n .object({\n type: z.literal('heading'),\n level: z.union([z.literal(2), z.literal(3), z.literal(4)]),\n text: nonBlankString\n })\n .strict()\n\nexport const listBlockSchema = z\n .object({\n type: z.literal('list'),\n ordered: z.boolean(),\n items: z.array(nonBlankString).min(1)\n })\n .strict()\n\nexport const codeBlockSchema = z\n .object({\n type: z.literal('code'),\n code: nonBlankString,\n language: nonBlankString.optional(),\n caption: nonBlankString.optional()\n })\n .strict()\n\nexport const calloutBlockSchema = z\n .object({\n type: z.literal('callout'),\n tone: z.enum(['info', 'tip', 'warning', 'danger']),\n title: nonBlankString.optional(),\n text: nonBlankString\n })\n .strict()\n\nconst comparisonSideSchema = z\n .object({\n title: nonBlankString,\n items: z.array(nonBlankString).min(1)\n })\n .strict()\n\nexport const comparisonBlockSchema = z\n .object({\n type: z.literal('comparison'),\n left: comparisonSideSchema,\n right: comparisonSideSchema\n })\n .strict()\n\nexport const lessonBlockSchema = z.discriminatedUnion('type', [\n paragraphBlockSchema,\n headingBlockSchema,\n listBlockSchema,\n codeBlockSchema,\n calloutBlockSchema,\n comparisonBlockSchema\n])\n\nexport const generatedLessonSchema = z\n .object({\n schemaVersion: z.literal('1'),\n title: nonBlankString.optional(),\n blocks: z.array(lessonBlockSchema).min(1),\n grounding: z\n .object({\n conceptIds: z.array(idSchema),\n sourceIds: z.array(idSchema),\n notes: z.array(nonBlankString).optional()\n })\n .strict()\n })\n .strict()\n\nexport const lessonConversationTurnSchema = z.discriminatedUnion('role', [\n z\n .object({\n role: z.literal('user'),\n content: nonBlankString\n })\n .strict(),\n z\n .object({\n role: z.literal('assistant'),\n lesson: generatedLessonSchema\n })\n .strict()\n])\n\nconst manifestCourseSchema = courseDefinitionSchema\n .omit({ plugins: true })\n .extend({\n plugins: z\n .array(\n z\n .object({\n name: nonBlankString,\n version: nonBlankString\n })\n .strict()\n )\n .optional()\n })\n .strict()\n\nexport const courseManifestSchema = z\n .object({\n schemaVersion: z.literal('1'),\n course: manifestCourseSchema,\n concepts: z.array(conceptSpecSchema),\n generates: z.array(generateSpecSchema),\n contentHash: z.string().regex(/^[a-f0-9]{64}$/)\n })\n .strict()\n","import { courseDefinitionSchema } from './schemas.js'\nimport type { CourseDefinition } from './types.js'\n\nexport function defineCourse<const T extends CourseDefinition>(definition: T): T {\n return courseDefinitionSchema.parse(definition) as T\n}\n"],"mappings":";AAAA,SAAS,SAAS;AAGlB,IAAM,iBAAiB,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,UAAU,MAAM,KAAK,EAAE,SAAS,GAAG;AAAA,EAClF,SAAS;AACX,CAAC;AAED,IAAM,WAAW,EACd,OAAO,EACP,IAAI,CAAC,EACL,MAAM,mCAAmC,2BAA2B;AAEhE,IAAM,uBAAuB,EACjC,OAAO;AAAA,EACN,MAAM;AAAA,EACN,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EAChC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS;AAC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GAAG;AAAA,EAC5B,OAAO,eAAe,SAAS;AAAA,EAC/B,QAAQ,EAAE,MAAM,iBAAiB,EAAE,IAAI,CAAC;AAAA,EACxC,WAAW,EACR,OAAO;AAAA,IACN,YAAY,EAAE,MAAM,QAAQ;AAAA,IAC5B,WAAW,EAAE,MAAM,QAAQ;AAAA,IAC3B,OAAO,EAAE,MAAM,cAAc,EAAE,SAAS;AAAA,EAC1C,CAAC,EACA,OAAO;AACZ,CAAC,EACA,OAAO;AAEH,IAAM,+BAA+B,EAAE,mBAAmB,QAAQ;AAAA,EACvE,EACG,OAAO;AAAA,IACN,MAAM,EAAE,QAAQ,MAAM;AAAA,IACtB,SAAS;AAAA,EACX,CAAC,EACA,OAAO;AAAA,EACV,EACG,OAAO;AAAA,IACN,MAAM,EAAE,QAAQ,WAAW;AAAA,IAC3B,QAAQ;AAAA,EACV,CAAC,EACA,OAAO;AACZ,CAAC;AAED,IAAM,uBAAuB,uBAC1B,KAAK,EAAE,SAAS,KAAK,CAAC,EACtB,OAAO;AAAA,EACN,SAAS,EACN;AAAA,IACC,EACG,OAAO;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA,IACX,CAAC,EACA,OAAO;AAAA,EACZ,EACC,SAAS;AACd,CAAC,EACA,OAAO;AAEH,IAAM,uBAAuB,EACjC,OAAO;AAAA,EACN,eAAe,EAAE,QAAQ,GAAG;AAAA,EAC5B,QAAQ;AAAA,EACR,UAAU,EAAE,MAAM,iBAAiB;AAAA,EACnC,WAAW,EAAE,MAAM,kBAAkB;AAAA,EACrC,aAAa,EAAE,OAAO,EAAE,MAAM,gBAAgB;AAChD,CAAC,EACA,OAAO;;;AC9OH,SAAS,aAA+C,YAAkB;AAC/E,SAAO,uBAAuB,MAAM,UAAU;AAChD;","names":[]}
@@ -0,0 +1,21 @@
1
+ import type { ConceptSpec, CourseDefinition, GeneratedLesson, GenerateSpec, LessonBlock, ValidationDiagnostic } from './types.js';
2
+ export type PromptFragment = {
3
+ role: 'system' | 'user';
4
+ text: string;
5
+ };
6
+ export type PromptExtensionContext = {
7
+ course: CourseDefinition;
8
+ generate: GenerateSpec;
9
+ concepts: ConceptSpec[];
10
+ };
11
+ export type ValidationContext = PromptExtensionContext & {
12
+ lesson: GeneratedLesson;
13
+ };
14
+ export type TransformContext = ValidationContext;
15
+ export interface GentorialPlugin {
16
+ name: string;
17
+ version: string;
18
+ extendPrompt?(context: PromptExtensionContext): PromptFragment[] | Promise<PromptFragment[]>;
19
+ validate?(context: ValidationContext): ValidationDiagnostic[] | Promise<ValidationDiagnostic[]>;
20
+ transformBlocks?(context: TransformContext): LessonBlock[] | Promise<LessonBlock[]>;
21
+ }
@@ -0,0 +1,396 @@
1
+ import { z } from 'zod';
2
+ import type { GentorialPlugin } from './plugin.js';
3
+ export declare const sourceLocationSchema: z.ZodObject<{
4
+ file: z.ZodString;
5
+ line: z.ZodNumber;
6
+ column: z.ZodOptional<z.ZodNumber>;
7
+ }, z.core.$strict>;
8
+ export declare const validationDiagnosticSchema: z.ZodObject<{
9
+ severity: z.ZodEnum<{
10
+ error: "error";
11
+ info: "info";
12
+ warning: "warning";
13
+ }>;
14
+ code: z.ZodString;
15
+ message: z.ZodString;
16
+ source: z.ZodOptional<z.ZodObject<{
17
+ file: z.ZodString;
18
+ line: z.ZodNumber;
19
+ column: z.ZodOptional<z.ZodNumber>;
20
+ }, z.core.$strict>>;
21
+ path: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
22
+ }, z.core.$strict>;
23
+ export declare const courseDefinitionSchema: z.ZodObject<{
24
+ schemaVersion: z.ZodLiteral<"1">;
25
+ id: z.ZodString;
26
+ title: z.ZodString;
27
+ description: z.ZodOptional<z.ZodString>;
28
+ lang: z.ZodString;
29
+ contentDir: z.ZodString;
30
+ generation: z.ZodObject<{
31
+ mode: z.ZodEnum<{
32
+ hybrid: "hybrid";
33
+ "on-demand": "on-demand";
34
+ snapshot: "snapshot";
35
+ }>;
36
+ defaultLocale: z.ZodString;
37
+ }, z.core.$strict>;
38
+ accuracy: z.ZodObject<{
39
+ policies: z.ZodArray<z.ZodString>;
40
+ standards: z.ZodOptional<z.ZodArray<z.ZodString>>;
41
+ }, z.core.$strict>;
42
+ plugins: z.ZodOptional<z.ZodArray<z.ZodCustom<GentorialPlugin, GentorialPlugin>>>;
43
+ }, z.core.$strict>;
44
+ export declare const conceptSpecSchema: z.ZodObject<{
45
+ id: z.ZodString;
46
+ title: z.ZodOptional<z.ZodString>;
47
+ statement: z.ZodString;
48
+ source: z.ZodObject<{
49
+ file: z.ZodString;
50
+ line: z.ZodNumber;
51
+ column: z.ZodOptional<z.ZodNumber>;
52
+ }, z.core.$strict>;
53
+ }, z.core.$strict>;
54
+ export declare const learnerProfileSchema: z.ZodObject<{
55
+ locale: z.ZodOptional<z.ZodString>;
56
+ background: z.ZodOptional<z.ZodString>;
57
+ goal: z.ZodOptional<z.ZodString>;
58
+ detail: z.ZodOptional<z.ZodEnum<{
59
+ balanced: "balanced";
60
+ concise: "concise";
61
+ deep: "deep";
62
+ }>>;
63
+ tone: z.ZodOptional<z.ZodEnum<{
64
+ conversational: "conversational";
65
+ formal: "formal";
66
+ neutral: "neutral";
67
+ }>>;
68
+ narrative: z.ZodOptional<z.ZodEnum<{
69
+ comparison: "comparison";
70
+ direct: "direct";
71
+ story: "story";
72
+ timeline: "timeline";
73
+ }>>;
74
+ examplePreferences: z.ZodOptional<z.ZodArray<z.ZodString>>;
75
+ }, z.core.$strict>;
76
+ export declare const sectionScopeSchema: z.ZodObject<{
77
+ type: z.ZodLiteral<"section">;
78
+ id: z.ZodString;
79
+ heading: z.ZodString;
80
+ level: z.ZodNumber;
81
+ markdown: z.ZodString;
82
+ source: z.ZodObject<{
83
+ file: z.ZodString;
84
+ line: z.ZodNumber;
85
+ column: z.ZodOptional<z.ZodNumber>;
86
+ }, z.core.$strict>;
87
+ }, z.core.$strict>;
88
+ export declare const generateTriggerSchema: z.ZodObject<{
89
+ type: z.ZodLiteral<"heading">;
90
+ source: z.ZodObject<{
91
+ file: z.ZodString;
92
+ line: z.ZodNumber;
93
+ column: z.ZodOptional<z.ZodNumber>;
94
+ }, z.core.$strict>;
95
+ }, z.core.$strict>;
96
+ export declare const generateOutputSchema: z.ZodObject<{
97
+ placement: z.ZodLiteral<"after-source">;
98
+ mode: z.ZodLiteral<"replace">;
99
+ }, z.core.$strict>;
100
+ export declare const generateSpecSchema: z.ZodObject<{
101
+ id: z.ZodString;
102
+ kind: z.ZodEnum<{
103
+ comparison: "comparison";
104
+ example: "example";
105
+ exercise: "exercise";
106
+ explanation: "explanation";
107
+ feedback: "feedback";
108
+ }>;
109
+ prompt: z.ZodString;
110
+ concepts: z.ZodArray<z.ZodString>;
111
+ scope: z.ZodObject<{
112
+ type: z.ZodLiteral<"section">;
113
+ id: z.ZodString;
114
+ heading: z.ZodString;
115
+ level: z.ZodNumber;
116
+ markdown: z.ZodString;
117
+ source: z.ZodObject<{
118
+ file: z.ZodString;
119
+ line: z.ZodNumber;
120
+ column: z.ZodOptional<z.ZodNumber>;
121
+ }, z.core.$strict>;
122
+ }, z.core.$strict>;
123
+ trigger: z.ZodObject<{
124
+ type: z.ZodLiteral<"heading">;
125
+ source: z.ZodObject<{
126
+ file: z.ZodString;
127
+ line: z.ZodNumber;
128
+ column: z.ZodOptional<z.ZodNumber>;
129
+ }, z.core.$strict>;
130
+ }, z.core.$strict>;
131
+ output: z.ZodObject<{
132
+ placement: z.ZodLiteral<"after-source">;
133
+ mode: z.ZodLiteral<"replace">;
134
+ }, z.core.$strict>;
135
+ source: z.ZodObject<{
136
+ file: z.ZodString;
137
+ line: z.ZodNumber;
138
+ column: z.ZodOptional<z.ZodNumber>;
139
+ }, z.core.$strict>;
140
+ }, z.core.$strict>;
141
+ export declare const paragraphBlockSchema: z.ZodObject<{
142
+ type: z.ZodLiteral<"paragraph">;
143
+ text: z.ZodString;
144
+ }, z.core.$strict>;
145
+ export declare const headingBlockSchema: z.ZodObject<{
146
+ type: z.ZodLiteral<"heading">;
147
+ level: z.ZodUnion<readonly [z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>]>;
148
+ text: z.ZodString;
149
+ }, z.core.$strict>;
150
+ export declare const listBlockSchema: z.ZodObject<{
151
+ type: z.ZodLiteral<"list">;
152
+ ordered: z.ZodBoolean;
153
+ items: z.ZodArray<z.ZodString>;
154
+ }, z.core.$strict>;
155
+ export declare const codeBlockSchema: z.ZodObject<{
156
+ type: z.ZodLiteral<"code">;
157
+ code: z.ZodString;
158
+ language: z.ZodOptional<z.ZodString>;
159
+ caption: z.ZodOptional<z.ZodString>;
160
+ }, z.core.$strict>;
161
+ export declare const calloutBlockSchema: z.ZodObject<{
162
+ type: z.ZodLiteral<"callout">;
163
+ tone: z.ZodEnum<{
164
+ danger: "danger";
165
+ info: "info";
166
+ tip: "tip";
167
+ warning: "warning";
168
+ }>;
169
+ title: z.ZodOptional<z.ZodString>;
170
+ text: z.ZodString;
171
+ }, z.core.$strict>;
172
+ export declare const comparisonBlockSchema: z.ZodObject<{
173
+ type: z.ZodLiteral<"comparison">;
174
+ left: z.ZodObject<{
175
+ title: z.ZodString;
176
+ items: z.ZodArray<z.ZodString>;
177
+ }, z.core.$strict>;
178
+ right: z.ZodObject<{
179
+ title: z.ZodString;
180
+ items: z.ZodArray<z.ZodString>;
181
+ }, z.core.$strict>;
182
+ }, z.core.$strict>;
183
+ export declare const lessonBlockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
184
+ type: z.ZodLiteral<"paragraph">;
185
+ text: z.ZodString;
186
+ }, z.core.$strict>, z.ZodObject<{
187
+ type: z.ZodLiteral<"heading">;
188
+ level: z.ZodUnion<readonly [z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>]>;
189
+ text: z.ZodString;
190
+ }, z.core.$strict>, z.ZodObject<{
191
+ type: z.ZodLiteral<"list">;
192
+ ordered: z.ZodBoolean;
193
+ items: z.ZodArray<z.ZodString>;
194
+ }, z.core.$strict>, z.ZodObject<{
195
+ type: z.ZodLiteral<"code">;
196
+ code: z.ZodString;
197
+ language: z.ZodOptional<z.ZodString>;
198
+ caption: z.ZodOptional<z.ZodString>;
199
+ }, z.core.$strict>, z.ZodObject<{
200
+ type: z.ZodLiteral<"callout">;
201
+ tone: z.ZodEnum<{
202
+ danger: "danger";
203
+ info: "info";
204
+ tip: "tip";
205
+ warning: "warning";
206
+ }>;
207
+ title: z.ZodOptional<z.ZodString>;
208
+ text: z.ZodString;
209
+ }, z.core.$strict>, z.ZodObject<{
210
+ type: z.ZodLiteral<"comparison">;
211
+ left: z.ZodObject<{
212
+ title: z.ZodString;
213
+ items: z.ZodArray<z.ZodString>;
214
+ }, z.core.$strict>;
215
+ right: z.ZodObject<{
216
+ title: z.ZodString;
217
+ items: z.ZodArray<z.ZodString>;
218
+ }, z.core.$strict>;
219
+ }, z.core.$strict>], "type">;
220
+ export declare const generatedLessonSchema: z.ZodObject<{
221
+ schemaVersion: z.ZodLiteral<"1">;
222
+ title: z.ZodOptional<z.ZodString>;
223
+ blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
224
+ type: z.ZodLiteral<"paragraph">;
225
+ text: z.ZodString;
226
+ }, z.core.$strict>, z.ZodObject<{
227
+ type: z.ZodLiteral<"heading">;
228
+ level: z.ZodUnion<readonly [z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>]>;
229
+ text: z.ZodString;
230
+ }, z.core.$strict>, z.ZodObject<{
231
+ type: z.ZodLiteral<"list">;
232
+ ordered: z.ZodBoolean;
233
+ items: z.ZodArray<z.ZodString>;
234
+ }, z.core.$strict>, z.ZodObject<{
235
+ type: z.ZodLiteral<"code">;
236
+ code: z.ZodString;
237
+ language: z.ZodOptional<z.ZodString>;
238
+ caption: z.ZodOptional<z.ZodString>;
239
+ }, z.core.$strict>, z.ZodObject<{
240
+ type: z.ZodLiteral<"callout">;
241
+ tone: z.ZodEnum<{
242
+ danger: "danger";
243
+ info: "info";
244
+ tip: "tip";
245
+ warning: "warning";
246
+ }>;
247
+ title: z.ZodOptional<z.ZodString>;
248
+ text: z.ZodString;
249
+ }, z.core.$strict>, z.ZodObject<{
250
+ type: z.ZodLiteral<"comparison">;
251
+ left: z.ZodObject<{
252
+ title: z.ZodString;
253
+ items: z.ZodArray<z.ZodString>;
254
+ }, z.core.$strict>;
255
+ right: z.ZodObject<{
256
+ title: z.ZodString;
257
+ items: z.ZodArray<z.ZodString>;
258
+ }, z.core.$strict>;
259
+ }, z.core.$strict>], "type">>;
260
+ grounding: z.ZodObject<{
261
+ conceptIds: z.ZodArray<z.ZodString>;
262
+ sourceIds: z.ZodArray<z.ZodString>;
263
+ notes: z.ZodOptional<z.ZodArray<z.ZodString>>;
264
+ }, z.core.$strict>;
265
+ }, z.core.$strict>;
266
+ export declare const lessonConversationTurnSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
267
+ role: z.ZodLiteral<"user">;
268
+ content: z.ZodString;
269
+ }, z.core.$strict>, z.ZodObject<{
270
+ role: z.ZodLiteral<"assistant">;
271
+ lesson: z.ZodObject<{
272
+ schemaVersion: z.ZodLiteral<"1">;
273
+ title: z.ZodOptional<z.ZodString>;
274
+ blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
275
+ type: z.ZodLiteral<"paragraph">;
276
+ text: z.ZodString;
277
+ }, z.core.$strict>, z.ZodObject<{
278
+ type: z.ZodLiteral<"heading">;
279
+ level: z.ZodUnion<readonly [z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>]>;
280
+ text: z.ZodString;
281
+ }, z.core.$strict>, z.ZodObject<{
282
+ type: z.ZodLiteral<"list">;
283
+ ordered: z.ZodBoolean;
284
+ items: z.ZodArray<z.ZodString>;
285
+ }, z.core.$strict>, z.ZodObject<{
286
+ type: z.ZodLiteral<"code">;
287
+ code: z.ZodString;
288
+ language: z.ZodOptional<z.ZodString>;
289
+ caption: z.ZodOptional<z.ZodString>;
290
+ }, z.core.$strict>, z.ZodObject<{
291
+ type: z.ZodLiteral<"callout">;
292
+ tone: z.ZodEnum<{
293
+ danger: "danger";
294
+ info: "info";
295
+ tip: "tip";
296
+ warning: "warning";
297
+ }>;
298
+ title: z.ZodOptional<z.ZodString>;
299
+ text: z.ZodString;
300
+ }, z.core.$strict>, z.ZodObject<{
301
+ type: z.ZodLiteral<"comparison">;
302
+ left: z.ZodObject<{
303
+ title: z.ZodString;
304
+ items: z.ZodArray<z.ZodString>;
305
+ }, z.core.$strict>;
306
+ right: z.ZodObject<{
307
+ title: z.ZodString;
308
+ items: z.ZodArray<z.ZodString>;
309
+ }, z.core.$strict>;
310
+ }, z.core.$strict>], "type">>;
311
+ grounding: z.ZodObject<{
312
+ conceptIds: z.ZodArray<z.ZodString>;
313
+ sourceIds: z.ZodArray<z.ZodString>;
314
+ notes: z.ZodOptional<z.ZodArray<z.ZodString>>;
315
+ }, z.core.$strict>;
316
+ }, z.core.$strict>;
317
+ }, z.core.$strict>], "role">;
318
+ export declare const courseManifestSchema: z.ZodObject<{
319
+ schemaVersion: z.ZodLiteral<"1">;
320
+ course: z.ZodObject<{
321
+ schemaVersion: z.ZodLiteral<"1">;
322
+ id: z.ZodString;
323
+ title: z.ZodString;
324
+ description: z.ZodOptional<z.ZodString>;
325
+ lang: z.ZodString;
326
+ contentDir: z.ZodString;
327
+ generation: z.ZodObject<{
328
+ mode: z.ZodEnum<{
329
+ hybrid: "hybrid";
330
+ "on-demand": "on-demand";
331
+ snapshot: "snapshot";
332
+ }>;
333
+ defaultLocale: z.ZodString;
334
+ }, z.core.$strict>;
335
+ accuracy: z.ZodObject<{
336
+ policies: z.ZodArray<z.ZodString>;
337
+ standards: z.ZodOptional<z.ZodArray<z.ZodString>>;
338
+ }, z.core.$strict>;
339
+ plugins: z.ZodOptional<z.ZodArray<z.ZodObject<{
340
+ name: z.ZodString;
341
+ version: z.ZodString;
342
+ }, z.core.$strict>>>;
343
+ }, z.core.$strict>;
344
+ concepts: z.ZodArray<z.ZodObject<{
345
+ id: z.ZodString;
346
+ title: z.ZodOptional<z.ZodString>;
347
+ statement: z.ZodString;
348
+ source: z.ZodObject<{
349
+ file: z.ZodString;
350
+ line: z.ZodNumber;
351
+ column: z.ZodOptional<z.ZodNumber>;
352
+ }, z.core.$strict>;
353
+ }, z.core.$strict>>;
354
+ generates: z.ZodArray<z.ZodObject<{
355
+ id: z.ZodString;
356
+ kind: z.ZodEnum<{
357
+ comparison: "comparison";
358
+ example: "example";
359
+ exercise: "exercise";
360
+ explanation: "explanation";
361
+ feedback: "feedback";
362
+ }>;
363
+ prompt: z.ZodString;
364
+ concepts: z.ZodArray<z.ZodString>;
365
+ scope: z.ZodObject<{
366
+ type: z.ZodLiteral<"section">;
367
+ id: z.ZodString;
368
+ heading: z.ZodString;
369
+ level: z.ZodNumber;
370
+ markdown: z.ZodString;
371
+ source: z.ZodObject<{
372
+ file: z.ZodString;
373
+ line: z.ZodNumber;
374
+ column: z.ZodOptional<z.ZodNumber>;
375
+ }, z.core.$strict>;
376
+ }, z.core.$strict>;
377
+ trigger: z.ZodObject<{
378
+ type: z.ZodLiteral<"heading">;
379
+ source: z.ZodObject<{
380
+ file: z.ZodString;
381
+ line: z.ZodNumber;
382
+ column: z.ZodOptional<z.ZodNumber>;
383
+ }, z.core.$strict>;
384
+ }, z.core.$strict>;
385
+ output: z.ZodObject<{
386
+ placement: z.ZodLiteral<"after-source">;
387
+ mode: z.ZodLiteral<"replace">;
388
+ }, z.core.$strict>;
389
+ source: z.ZodObject<{
390
+ file: z.ZodString;
391
+ line: z.ZodNumber;
392
+ column: z.ZodOptional<z.ZodNumber>;
393
+ }, z.core.$strict>;
394
+ }, z.core.$strict>>;
395
+ contentHash: z.ZodString;
396
+ }, z.core.$strict>;
@@ -0,0 +1,21 @@
1
+ import type { z } from 'zod';
2
+ import type { calloutBlockSchema, codeBlockSchema, comparisonBlockSchema, conceptSpecSchema, courseDefinitionSchema, courseManifestSchema, generatedLessonSchema, generateOutputSchema, generateSpecSchema, generateTriggerSchema, headingBlockSchema, learnerProfileSchema, lessonConversationTurnSchema, lessonBlockSchema, listBlockSchema, paragraphBlockSchema, sectionScopeSchema, sourceLocationSchema, validationDiagnosticSchema } from './schemas.js';
3
+ export type SourceLocation = z.infer<typeof sourceLocationSchema>;
4
+ export type ValidationDiagnostic = z.infer<typeof validationDiagnosticSchema>;
5
+ export type CourseDefinition = z.infer<typeof courseDefinitionSchema>;
6
+ export type CourseManifest = z.infer<typeof courseManifestSchema>;
7
+ export type ConceptSpec = z.infer<typeof conceptSpecSchema>;
8
+ export type LearnerProfile = z.infer<typeof learnerProfileSchema>;
9
+ export type SectionScope = z.infer<typeof sectionScopeSchema>;
10
+ export type GenerateTrigger = z.infer<typeof generateTriggerSchema>;
11
+ export type GenerateOutput = z.infer<typeof generateOutputSchema>;
12
+ export type GenerateSpec = z.infer<typeof generateSpecSchema>;
13
+ export type ParagraphBlock = z.infer<typeof paragraphBlockSchema>;
14
+ export type HeadingBlock = z.infer<typeof headingBlockSchema>;
15
+ export type ListBlock = z.infer<typeof listBlockSchema>;
16
+ export type CodeBlock = z.infer<typeof codeBlockSchema>;
17
+ export type CalloutBlock = z.infer<typeof calloutBlockSchema>;
18
+ export type ComparisonBlock = z.infer<typeof comparisonBlockSchema>;
19
+ export type LessonBlock = z.infer<typeof lessonBlockSchema>;
20
+ export type GeneratedLesson = z.infer<typeof generatedLessonSchema>;
21
+ export type LessonConversationTurn = z.infer<typeof lessonConversationTurnSchema>;
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@gentorial/core",
3
+ "version": "0.1.0",
4
+ "description": "Framework-neutral course protocols and validation for Gentorial.",
5
+ "type": "module",
6
+ "sideEffects": false,
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "main": "./dist/index.js",
11
+ "types": "./dist/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.js"
16
+ }
17
+ },
18
+ "keywords": [
19
+ "gentorial",
20
+ "education",
21
+ "schema"
22
+ ],
23
+ "license": "MIT",
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "dependencies": {
28
+ "zod": "^4.4.3"
29
+ },
30
+ "scripts": {
31
+ "build": "tsup src/index.ts --format esm --sourcemap --clean && tsc --emitDeclarationOnly",
32
+ "typecheck": "tsc --noEmit",
33
+ "test": "vitest run --root ../.. --config vitest.config.ts packages/core/src",
34
+ "pack:check": "pnpm pack --dry-run"
35
+ }
36
+ }