@thanh01.pmt/domain-kit 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.
Files changed (108) hide show
  1. package/README.md +1101 -0
  2. package/dist/assembly/index.cjs +213 -0
  3. package/dist/assembly/index.cjs.map +1 -0
  4. package/dist/assembly/index.d.cts +66 -0
  5. package/dist/assembly/index.d.ts +66 -0
  6. package/dist/assembly/index.mjs +4 -0
  7. package/dist/assembly/index.mjs.map +1 -0
  8. package/dist/chunk-3H2HX7PR.mjs +324 -0
  9. package/dist/chunk-3H2HX7PR.mjs.map +1 -0
  10. package/dist/chunk-3VVPSRAM.mjs +1297 -0
  11. package/dist/chunk-3VVPSRAM.mjs.map +1 -0
  12. package/dist/chunk-DRVOV5ZD.mjs +314 -0
  13. package/dist/chunk-DRVOV5ZD.mjs.map +1 -0
  14. package/dist/chunk-F4RZNBOE.mjs +3 -0
  15. package/dist/chunk-F4RZNBOE.mjs.map +1 -0
  16. package/dist/chunk-GEUDHZE7.mjs +446 -0
  17. package/dist/chunk-GEUDHZE7.mjs.map +1 -0
  18. package/dist/chunk-HH4UX65C.mjs +100 -0
  19. package/dist/chunk-HH4UX65C.mjs.map +1 -0
  20. package/dist/chunk-KMYENICQ.mjs +3 -0
  21. package/dist/chunk-KMYENICQ.mjs.map +1 -0
  22. package/dist/chunk-KNDBODUQ.mjs +153 -0
  23. package/dist/chunk-KNDBODUQ.mjs.map +1 -0
  24. package/dist/chunk-MM2RWYNW.mjs +3 -0
  25. package/dist/chunk-MM2RWYNW.mjs.map +1 -0
  26. package/dist/chunk-MOKNFLUD.mjs +851 -0
  27. package/dist/chunk-MOKNFLUD.mjs.map +1 -0
  28. package/dist/chunk-ONQHJ4OH.mjs +211 -0
  29. package/dist/chunk-ONQHJ4OH.mjs.map +1 -0
  30. package/dist/chunk-PM42MMDJ.mjs +516 -0
  31. package/dist/chunk-PM42MMDJ.mjs.map +1 -0
  32. package/dist/chunk-RKRNOVKO.mjs +166 -0
  33. package/dist/chunk-RKRNOVKO.mjs.map +1 -0
  34. package/dist/chunk-VFART56O.mjs +884 -0
  35. package/dist/chunk-VFART56O.mjs.map +1 -0
  36. package/dist/chunk-XMHKWHVK.mjs +218 -0
  37. package/dist/chunk-XMHKWHVK.mjs.map +1 -0
  38. package/dist/conceptEscalator-YfMKIKCZ.d.ts +40 -0
  39. package/dist/conceptEscalator-ltRLtPhf.d.cts +40 -0
  40. package/dist/concepts/index.cjs +155 -0
  41. package/dist/concepts/index.cjs.map +1 -0
  42. package/dist/concepts/index.d.cts +79 -0
  43. package/dist/concepts/index.d.ts +79 -0
  44. package/dist/concepts/index.mjs +4 -0
  45. package/dist/concepts/index.mjs.map +1 -0
  46. package/dist/curriculumFeedSchema-TEeQg2bY.d.cts +549 -0
  47. package/dist/curriculumFeedSchema-TEeQg2bY.d.ts +549 -0
  48. package/dist/detector/index.cjs +889 -0
  49. package/dist/detector/index.cjs.map +1 -0
  50. package/dist/detector/index.d.cts +112 -0
  51. package/dist/detector/index.d.ts +112 -0
  52. package/dist/detector/index.mjs +3 -0
  53. package/dist/detector/index.mjs.map +1 -0
  54. package/dist/domainProfileSchema-CwT3Ffsw.d.cts +105 -0
  55. package/dist/domainProfileSchema-CwT3Ffsw.d.ts +105 -0
  56. package/dist/extractors/index.cjs +387 -0
  57. package/dist/extractors/index.cjs.map +1 -0
  58. package/dist/extractors/index.d.cts +46 -0
  59. package/dist/extractors/index.d.ts +46 -0
  60. package/dist/extractors/index.mjs +4 -0
  61. package/dist/extractors/index.mjs.map +1 -0
  62. package/dist/feed/index.cjs +421 -0
  63. package/dist/feed/index.cjs.map +1 -0
  64. package/dist/feed/index.d.cts +23 -0
  65. package/dist/feed/index.d.ts +23 -0
  66. package/dist/feed/index.mjs +4 -0
  67. package/dist/feed/index.mjs.map +1 -0
  68. package/dist/graph/index.cjs +2167 -0
  69. package/dist/graph/index.cjs.map +1 -0
  70. package/dist/graph/index.d.cts +226 -0
  71. package/dist/graph/index.d.ts +226 -0
  72. package/dist/graph/index.mjs +4 -0
  73. package/dist/graph/index.mjs.map +1 -0
  74. package/dist/graphVerifier-DsTP9uAN.d.ts +37 -0
  75. package/dist/graphVerifier-QjgDAJce.d.cts +37 -0
  76. package/dist/hybridGraphSchema-BCgXicgA.d.cts +2840 -0
  77. package/dist/hybridGraphSchema-BCgXicgA.d.ts +2840 -0
  78. package/dist/index.cjs +5539 -0
  79. package/dist/index.cjs.map +1 -0
  80. package/dist/index.d.cts +18 -0
  81. package/dist/index.d.ts +18 -0
  82. package/dist/index.mjs +17 -0
  83. package/dist/index.mjs.map +1 -0
  84. package/dist/keywordExtractor-CKaXqSku.d.ts +34 -0
  85. package/dist/keywordExtractor-zPAz2isq.d.cts +34 -0
  86. package/dist/llmClient-ysPhLjcH.d.cts +16 -0
  87. package/dist/llmClient-ysPhLjcH.d.ts +16 -0
  88. package/dist/parsers/index.cjs +323 -0
  89. package/dist/parsers/index.cjs.map +1 -0
  90. package/dist/parsers/index.d.cts +98 -0
  91. package/dist/parsers/index.d.ts +98 -0
  92. package/dist/parsers/index.mjs +4 -0
  93. package/dist/parsers/index.mjs.map +1 -0
  94. package/dist/pipeline/index.cjs +2166 -0
  95. package/dist/pipeline/index.cjs.map +1 -0
  96. package/dist/pipeline/index.d.cts +45 -0
  97. package/dist/pipeline/index.d.ts +45 -0
  98. package/dist/pipeline/index.mjs +8 -0
  99. package/dist/pipeline/index.mjs.map +1 -0
  100. package/dist/projectGraphSchema-DnD7orZV.d.cts +2581 -0
  101. package/dist/projectGraphSchema-DnD7orZV.d.ts +2581 -0
  102. package/dist/schemas/index.cjs +675 -0
  103. package/dist/schemas/index.cjs.map +1 -0
  104. package/dist/schemas/index.d.cts +253 -0
  105. package/dist/schemas/index.d.ts +253 -0
  106. package/dist/schemas/index.mjs +4 -0
  107. package/dist/schemas/index.mjs.map +1 -0
  108. package/package.json +71 -0
@@ -0,0 +1,675 @@
1
+ 'use strict';
2
+
3
+ var zod = require('zod');
4
+
5
+ // src/schemas/projectGraphSchema.ts
6
+ var StepEffortSchema = zod.z.object({
7
+ estimated_minutes: zod.z.number().optional(),
8
+ complexity: zod.z.enum(["low", "medium", "high"]).optional(),
9
+ concepts_count: zod.z.number().optional(),
10
+ files_touched: zod.z.number().optional()
11
+ });
12
+ var StepOutcomeSchema = zod.z.object({
13
+ user_visible: zod.z.string().optional(),
14
+ technical: zod.z.union([zod.z.string(), zod.z.array(zod.z.string())]).optional()
15
+ });
16
+ var StepSchema = zod.z.object({
17
+ id: zod.z.string(),
18
+ sequence: zod.z.number(),
19
+ name: zod.z.string(),
20
+ description: zod.z.string().optional().default(""),
21
+ files: zod.z.array(zod.z.string()).optional().default([]),
22
+ api_usage: zod.z.array(zod.z.string()).optional().default([]),
23
+ keywords: zod.z.array(zod.z.string()).optional().default([]),
24
+ completion_level: zod.z.enum(["base", "mvp", "extend", "polish"]).optional().default("mvp"),
25
+ platform: zod.z.string().optional().default("app"),
26
+ intent: zod.z.string().optional().default(""),
27
+ outcome: StepOutcomeSchema.optional(),
28
+ acceptance: zod.z.array(zod.z.string()).optional().default([]),
29
+ effort: StepEffortSchema.optional(),
30
+ requirement_ids: zod.z.array(zod.z.string()).optional().default([]),
31
+ concept_codes: zod.z.array(zod.z.string()).optional().default([])
32
+ });
33
+ var FeatureSchema = zod.z.object({
34
+ id: zod.z.string(),
35
+ name: zod.z.string(),
36
+ description: zod.z.string().optional().default(""),
37
+ purpose: zod.z.string().optional().default(""),
38
+ priority: zod.z.enum(["core", "supporting", "polish"]).optional().default("core"),
39
+ status: zod.z.enum(["PLANNED", "IMPLEMENTED", "IN_PROGRESS"]).optional().default("PLANNED"),
40
+ platform: zod.z.string().optional().default("app"),
41
+ requirement_ids: zod.z.array(zod.z.string()).optional().default([]),
42
+ journey_ids: zod.z.array(zod.z.string()).optional().default([]),
43
+ depends_on: zod.z.array(zod.z.string()).optional().default([]),
44
+ api_usage: zod.z.array(zod.z.string()).optional().default([]),
45
+ steps: zod.z.array(StepSchema).optional().default([])
46
+ });
47
+ var JourneyStepSchema = zod.z.object({
48
+ id: zod.z.string(),
49
+ name: zod.z.string(),
50
+ steps: zod.z.array(zod.z.string()).optional().default([]),
51
+ requirement_ids: zod.z.array(zod.z.string()).optional().default([])
52
+ });
53
+ var JourneySchema = zod.z.object({
54
+ id: zod.z.string(),
55
+ name: zod.z.string(),
56
+ steps: zod.z.array(zod.z.string()).optional().default([]),
57
+ feature_ids: zod.z.array(zod.z.string()).optional().default([]),
58
+ requirement_ids: zod.z.array(zod.z.string()).optional().default([])
59
+ });
60
+ var RequirementSchema = zod.z.object({
61
+ id: zod.z.string(),
62
+ statement: zod.z.string(),
63
+ priority: zod.z.enum(["core", "supporting", "polish"]).optional().default("core"),
64
+ acceptance: zod.z.array(zod.z.string()).optional().default([]),
65
+ completion_level: zod.z.string().optional().default("base")
66
+ });
67
+ var DevelopmentStageSchema = zod.z.object({
68
+ stage: zod.z.string(),
69
+ product_state: zod.z.string().optional().default(""),
70
+ need: zod.z.array(zod.z.string()).optional().default([]),
71
+ learn: zod.z.array(zod.z.string()).optional().default([]),
72
+ validation: zod.z.string().optional().default(""),
73
+ cross_feature_value: zod.z.string().optional().default(""),
74
+ temporary_approach: zod.z.string().optional().default("")
75
+ });
76
+ var ProductGoalSchema = zod.z.object({
77
+ id: zod.z.string(),
78
+ description: zod.z.string()
79
+ });
80
+ var ProductUserSchema = zod.z.object({
81
+ id: zod.z.string(),
82
+ goals: zod.z.array(zod.z.string())
83
+ });
84
+ var ProductSchema = zod.z.object({
85
+ goals: zod.z.array(ProductGoalSchema).optional().default([]),
86
+ users: zod.z.array(ProductUserSchema).optional().default([]),
87
+ journeys: zod.z.array(JourneySchema).optional().default([]),
88
+ requirements: zod.z.array(RequirementSchema).optional().default([]),
89
+ development_stages: zod.z.array(DevelopmentStageSchema).optional().default([]),
90
+ purpose: zod.z.string().optional().default(""),
91
+ problem_statement: zod.z.string().optional().default(""),
92
+ primary_users: zod.z.array(zod.z.string()).optional().default([])
93
+ });
94
+ var TechStackSchema = zod.z.record(zod.z.string(), zod.z.array(zod.z.string()));
95
+ var ProjectInfoSchema = zod.z.object({
96
+ id: zod.z.string(),
97
+ name: zod.z.string(),
98
+ version: zod.z.string().optional().default("0.1.0"),
99
+ purpose: zod.z.string().optional().default(""),
100
+ project_type: zod.z.string().optional().default("app"),
101
+ platform: zod.z.array(zod.z.string()).optional().default([]),
102
+ tech_stack: TechStackSchema.optional(),
103
+ architecture: zod.z.array(zod.z.string()).optional().default([]),
104
+ source: zod.z.object({
105
+ repository: zod.z.string().optional().default(""),
106
+ commit: zod.z.string().optional().default(""),
107
+ scan_dir: zod.z.string().optional().default("")
108
+ }).optional()
109
+ });
110
+ var CapabilitySchema = zod.z.object({
111
+ id: zod.z.string(),
112
+ feature_id: zod.z.string(),
113
+ purpose: zod.z.string().optional().default(""),
114
+ depends_on: zod.z.array(zod.z.string()).optional().default([]),
115
+ produces: zod.z.array(zod.z.string()).optional().default([])
116
+ });
117
+ var ArchNodeSchema = zod.z.object({
118
+ id: zod.z.string(),
119
+ type: zod.z.string().optional().default("component"),
120
+ custom_type: zod.z.string().optional(),
121
+ layer: zod.z.string().optional().default("presentation"),
122
+ responsibility: zod.z.string().optional().default(""),
123
+ depends_on: zod.z.array(zod.z.string()).optional().default([]),
124
+ used_by: zod.z.array(zod.z.string()).optional().default([]),
125
+ evidence_type: zod.z.string().optional().default("INFERRED"),
126
+ confidence: zod.z.number().optional().default(0.5)
127
+ });
128
+ var ArchEdgeSchema = zod.z.object({
129
+ from: zod.z.string(),
130
+ to: zod.z.string(),
131
+ type: zod.z.string().optional().default("USES")
132
+ });
133
+ var ArchitectureDetailSchema = zod.z.object({
134
+ pattern: zod.z.array(zod.z.string()).optional().default([]),
135
+ confidence: zod.z.number().optional().default(0.5),
136
+ evidence: zod.z.array(zod.z.string()).optional().default([]),
137
+ nodes: zod.z.array(ArchNodeSchema).optional().default([]),
138
+ edges: zod.z.array(ArchEdgeSchema).optional().default([])
139
+ });
140
+ var ScreenSchema = zod.z.object({
141
+ id: zod.z.string(),
142
+ name: zod.z.string().optional().default(""),
143
+ purpose: zod.z.string().optional().default(""),
144
+ entry_point: zod.z.boolean().optional().default(false),
145
+ components: zod.z.array(zod.z.string()).optional().default([]),
146
+ states: zod.z.array(zod.z.string()).optional().default([]),
147
+ navigates_to: zod.z.array(zod.z.string()).optional().default([]),
148
+ keywords: zod.z.array(zod.z.string()).optional().default([])
149
+ });
150
+ var ExperienceComponentSchema = zod.z.object({
151
+ id: zod.z.string(),
152
+ type: zod.z.string().optional().default("component"),
153
+ purpose: zod.z.string().optional().default(""),
154
+ inputs: zod.z.array(zod.z.string()).optional().default([]),
155
+ outputs: zod.z.array(zod.z.string()).optional().default([]),
156
+ state: zod.z.array(zod.z.string()).optional().default([])
157
+ });
158
+ var UiStateSchema = zod.z.object({
159
+ id: zod.z.string(),
160
+ owner: zod.z.string().optional().default(""),
161
+ triggered_by: zod.z.array(zod.z.string()).optional().default([]),
162
+ transitions_to: zod.z.array(zod.z.string()).optional().default([])
163
+ });
164
+ var NavigationSchema = zod.z.object({
165
+ from: zod.z.string(),
166
+ to: zod.z.string(),
167
+ trigger: zod.z.string().optional().default(""),
168
+ presentation: zod.z.string().optional().default("push")
169
+ });
170
+ var ExperienceSchema = zod.z.object({
171
+ screens: zod.z.array(ScreenSchema).optional().default([]),
172
+ components: zod.z.array(ExperienceComponentSchema).optional().default([]),
173
+ ui_states: zod.z.array(UiStateSchema).optional().default([]),
174
+ navigation: zod.z.array(NavigationSchema).optional().default([])
175
+ });
176
+ var DataIntegrationSchema = zod.z.object({
177
+ data_flows: zod.z.array(zod.z.any()).optional().default([]),
178
+ models: zod.z.array(zod.z.any()).optional().default([]),
179
+ integrations: zod.z.array(zod.z.any()).optional().default([]),
180
+ persistence: zod.z.array(zod.z.any()).optional().default([])
181
+ });
182
+ var TaskEffortSchema = zod.z.object({
183
+ concepts_count: zod.z.number().optional().default(0),
184
+ files_touched: zod.z.number().optional().default(0),
185
+ estimated_minutes: zod.z.number().optional().default(0)
186
+ });
187
+ var TaskOutcomeSchema = zod.z.object({
188
+ user_visible: zod.z.string().optional().default(""),
189
+ technical: zod.z.array(zod.z.string()).optional().default([])
190
+ });
191
+ var TaskSchema = zod.z.object({
192
+ id: zod.z.string(),
193
+ capability_id: zod.z.string().optional().default(""),
194
+ action: zod.z.string(),
195
+ modifies: zod.z.array(zod.z.string()).optional().default([]),
196
+ creates: zod.z.array(zod.z.string()).optional().default([]),
197
+ depends_on: zod.z.array(zod.z.string()).optional().default([]),
198
+ acceptance: zod.z.array(zod.z.string()).optional().default([]),
199
+ intent: zod.z.string().optional().default(""),
200
+ outcome: TaskOutcomeSchema.optional(),
201
+ source_evidence: zod.z.array(zod.z.string()).optional().default([]),
202
+ keywords: zod.z.array(zod.z.string()).optional().default([]),
203
+ concurrency: zod.z.array(zod.z.string()).optional().default([]),
204
+ effort: TaskEffortSchema.optional(),
205
+ requirement_ids: zod.z.array(zod.z.string()).optional().default([])
206
+ });
207
+ var ImplementationSchema = zod.z.object({
208
+ tasks: zod.z.array(TaskSchema).optional().default([])
209
+ });
210
+ var MissingGapSchema = zod.z.object({
211
+ gap: zod.z.string(),
212
+ location: zod.z.string().optional().default(""),
213
+ suggested_lo: zod.z.string().optional().default("")
214
+ });
215
+ var TechDebtSchema = zod.z.object({
216
+ issue: zod.z.string(),
217
+ location: zod.z.string().optional().default(""),
218
+ severity: zod.z.enum(["low", "medium", "high"]).optional().default("medium")
219
+ });
220
+ var MilestoneDecompositionSchema = zod.z.object({
221
+ id: zod.z.string(),
222
+ phase: zod.z.string().optional().default(""),
223
+ name: zod.z.string().optional().default(""),
224
+ goal: zod.z.string().optional().default(""),
225
+ feature_ids: zod.z.array(zod.z.string()).optional().default([])
226
+ });
227
+ var DecompositionSchema = zod.z.object({
228
+ milestones: zod.z.array(MilestoneDecompositionSchema).optional().default([])
229
+ });
230
+ var ProjectGraphSchema = zod.z.object({
231
+ schema_version: zod.z.literal(3).optional().default(3),
232
+ project: ProjectInfoSchema,
233
+ product: ProductSchema,
234
+ features: zod.z.array(FeatureSchema).optional().default([]),
235
+ capabilities: zod.z.array(CapabilitySchema).optional().default([]),
236
+ architecture_detail: ArchitectureDetailSchema.optional(),
237
+ experience: ExperienceSchema.optional(),
238
+ data_integration: DataIntegrationSchema.optional(),
239
+ implementation: ImplementationSchema,
240
+ decomposition: DecompositionSchema.optional(),
241
+ missing_gaps: zod.z.array(MissingGapSchema).optional().default([]),
242
+ tech_debt: zod.z.array(TechDebtSchema).optional().default([])
243
+ });
244
+ var ProblemTypeSchema = zod.z.object({
245
+ id: zod.z.string(),
246
+ name: zod.z.string(),
247
+ description: zod.z.string().optional().default(""),
248
+ bloom_level: zod.z.enum(["Remember", "Understand", "Apply", "Analyze", "Evaluate", "Create"]).optional().default("Understand"),
249
+ difficulty: zod.z.enum(["easy", "medium", "hard"]).optional().default("medium"),
250
+ estimated_minutes: zod.z.number().optional().default(10),
251
+ examples: zod.z.array(zod.z.string()).optional().default([]),
252
+ common_mistakes: zod.z.array(zod.z.string()).optional().default([])
253
+ });
254
+ var ConceptSchema = zod.z.object({
255
+ id: zod.z.string(),
256
+ // Production-standard neutral code (UPPER_SNAKE_CASE, Naming Conventions v2.2).
257
+ // After STEP_2_5 standardization this is either a knowledge-tree code
258
+ // (standardized) or a provisional proposed code (tracked in the proposals
259
+ // artifact for later merge).
260
+ code: zod.z.string().regex(/^[A-Z][A-Z0-9_]*$/).optional(),
261
+ // Knowledge-tree provenance (STEP_2_5): standardized | proposed_new | unset
262
+ standardization: zod.z.enum(["standardized", "proposed_new"]).optional(),
263
+ tree_code: zod.z.string().optional().describe("Exact knowledge-tree CONCEPT code when standardization=standardized"),
264
+ tree_prerequisites: zod.z.array(zod.z.string()).optional().default([]).describe("Knowledge-tree prerequisite concept codes (seed for prereq edges)"),
265
+ name: zod.z.string(),
266
+ description: zod.z.string().optional().default(""),
267
+ category: zod.z.string().optional().default(""),
268
+ // ULO/CIO/SIO — technology-independent knowledge levels.
269
+ // Text fields use the production clause "The learner will be able to ...".
270
+ ulo: zod.z.string().optional().default("").describe("WHAT + WHY: What is this concept? Why does it exist? What problem does it solve?"),
271
+ ulo_code: zod.z.string().optional().describe("ULO-[CONCEPT]-NN per Naming Conventions v2.2"),
272
+ cio: zod.z.string().optional().default("").describe("HOW: How does it solve the problem? What is the mechanism?"),
273
+ cio_code: zod.z.string().optional().describe("CIO-[CONCEPT]-NN-ACTION per Naming Conventions v2.2"),
274
+ sio: zod.z.array(zod.z.string()).optional().default([]).describe("IMPLEMENTATION: Specific implementations in concrete technologies"),
275
+ sio_codes: zod.z.array(zod.z.string()).optional().describe("SIO-[TECH]-[CONCEPT]-NN, one per sio item"),
276
+ // Prerequisites and timing
277
+ prerequisites: zod.z.array(zod.z.string()).optional().default([]).describe("Concept IDs that must be learned first"),
278
+ estimated_minutes: zod.z.number().optional().default(30),
279
+ // Problem types associated with this concept
280
+ problem_types: zod.z.array(ProblemTypeSchema).optional().default([]),
281
+ // Supporting materials
282
+ techniques: zod.z.array(zod.z.string()).optional().default([]).describe("Methods, formulas, tools, procedures"),
283
+ materials: zod.z.array(zod.z.string()).optional().default([]).describe("Physical materials needed (lab equipment, instruments)"),
284
+ visual_aids: zod.z.array(zod.z.string()).optional().default([]).describe("Diagrams, images, animations needed"),
285
+ common_mistakes: zod.z.array(zod.z.string()).optional().default([]).describe("Frequently confused ideas or errors"),
286
+ // Metadata
287
+ keywords: zod.z.array(zod.z.string()).optional().default([]).describe("Technology-specific keywords (SIO level)"),
288
+ tech_stack: zod.z.array(zod.z.string()).optional().default([]).describe("Specific technologies if applicable")
289
+ });
290
+ var ConceptCategorySchema = zod.z.object({
291
+ id: zod.z.string(),
292
+ name: zod.z.string(),
293
+ description: zod.z.string().optional().default(""),
294
+ concept_ids: zod.z.array(zod.z.string()).optional().default([]),
295
+ order: zod.z.number().optional().default(0).describe("Teaching order within the subject")
296
+ });
297
+ var SubjectInfoSchema = zod.z.object({
298
+ id: zod.z.string(),
299
+ name: zod.z.string(),
300
+ description: zod.z.string().optional().default(""),
301
+ domain: zod.z.enum(["math", "science", "language", "arts", "research", "business", "other"]).optional().default("other"),
302
+ grade_band: zod.z.tuple([zod.z.number().int(), zod.z.number().int()]).optional(),
303
+ estimated_hours: zod.z.number().optional().default(0),
304
+ estimated_weeks: zod.z.number().optional().default(0),
305
+ syllabus_ref: zod.z.string().optional().default("").describe("Reference to original syllabus/curriculum")
306
+ });
307
+ var LearningPathStepSchema = zod.z.object({
308
+ concept_id: zod.z.string(),
309
+ order: zod.z.number(),
310
+ depends_on: zod.z.array(zod.z.string()).optional().default([]),
311
+ milestone_name: zod.z.string().optional().default("")
312
+ });
313
+ var KnowledgeGraphSchema = zod.z.object({
314
+ schema_version: zod.z.literal(1).optional().default(1),
315
+ type: zod.z.literal("knowledge_graph").optional().default("knowledge_graph"),
316
+ subject: SubjectInfoSchema,
317
+ concepts: zod.z.array(ConceptSchema).optional().default([]),
318
+ categories: zod.z.array(ConceptCategorySchema).optional().default([]),
319
+ learning_path: zod.z.array(LearningPathStepSchema).optional().default([]).describe("Recommended teaching order")
320
+ });
321
+ var WiringSchema = zod.z.object({
322
+ component: zod.z.string(),
323
+ pin: zod.z.string(),
324
+ connection: zod.z.string(),
325
+ wire_color: zod.z.string().optional(),
326
+ notes: zod.z.string().optional()
327
+ });
328
+ var HardwareStepSchema = zod.z.object({
329
+ action: zod.z.string(),
330
+ tool: zod.z.string().optional(),
331
+ safety_note: zod.z.string().optional(),
332
+ estimated_minutes: zod.z.number().optional()
333
+ });
334
+ var HardwareFeatureExtensionSchema = zod.z.object({
335
+ wiring: zod.z.array(WiringSchema).optional().default([]),
336
+ components_used: zod.z.array(zod.z.string()).optional().default([]),
337
+ circuit_diagram_ref: zod.z.string().optional()
338
+ });
339
+ var HardwareTaskExtensionSchema = zod.z.object({
340
+ techniques: zod.z.array(zod.z.string()).optional().default([]).describe("soldering, breadboarding, debugging"),
341
+ hardware_steps: zod.z.array(HardwareStepSchema).optional().default([]),
342
+ safety_notes: zod.z.array(zod.z.string()).optional().default([]),
343
+ multimeter_readings: zod.z.boolean().optional().default(false)
344
+ });
345
+ var HardwareTechStackExtensionSchema = zod.z.object({
346
+ materials: zod.z.array(zod.z.string()).optional().default([]).describe("Physical components: Arduino Uno, LED, Servo"),
347
+ tools: zod.z.array(zod.z.string()).optional().default([]).describe("Arduino IDE, USB cable, Multimeter"),
348
+ protocols: zod.z.array(zod.z.string()).optional().default([]).describe("I2C, PWM, SPI, UART"),
349
+ pin_config: zod.z.record(zod.z.string(), zod.z.string()).optional().default({}).describe("Pin assignments"),
350
+ power_requirements: zod.z.string().optional()
351
+ });
352
+ var ShapeSchema = zod.z.object({
353
+ id: zod.z.string(),
354
+ type: zod.z.string().describe("Box, Cylinder, Sphere, Roof, Torus, Hole, etc."),
355
+ dimensions: zod.z.string().describe('e.g. "200x150x5mm"'),
356
+ position: zod.z.string().describe('e.g. "0,0,0"'),
357
+ color: zod.z.string().optional(),
358
+ rotation: zod.z.string().optional()
359
+ });
360
+ var ThreeDesignFeatureExtensionSchema = zod.z.object({
361
+ shapes: zod.z.array(ShapeSchema).optional().default([]),
362
+ assembly_order: zod.z.array(zod.z.string()).optional().default([]).describe("Shape IDs in assembly order"),
363
+ group_operations: zod.z.array(zod.z.string()).optional().default([]).describe("Group/hole operations")
364
+ });
365
+ var ThreeDesignTaskExtensionSchema = zod.z.object({
366
+ operations: zod.z.array(zod.z.string()).optional().default([]).describe("create, resize, position, group, align, hole"),
367
+ dimensions: zod.z.record(zod.z.string(), zod.z.string()).optional().default({}),
368
+ shape_type: zod.z.string().optional(),
369
+ constraints: zod.z.array(zod.z.string()).optional().default([])
370
+ });
371
+ var ThreeDesignTechStackExtensionSchema = zod.z.object({
372
+ design_software: zod.z.string().optional().describe("Tinkercad, Fusion360, Blender"),
373
+ units: zod.z.string().optional().default("mm"),
374
+ canvas_size: zod.z.string().optional(),
375
+ export_formats: zod.z.array(zod.z.string()).optional().default([]).describe("STL, OBJ, STEP")
376
+ });
377
+ var ProjectConceptLinkSchema = zod.z.object({
378
+ feature_id: zod.z.string().describe("Feature ID from project_graph"),
379
+ concept_id: zod.z.string().describe("Concept ID from knowledge_graph"),
380
+ relationship: zod.z.enum([
381
+ "requires",
382
+ // Feature requires understanding this concept
383
+ "demonstrates",
384
+ // Feature demonstrates this concept in practice
385
+ "applies",
386
+ // Feature applies this concept
387
+ "extends"
388
+ // Feature extends this concept to new context
389
+ ]).optional().default("requires"),
390
+ depth: zod.z.enum([
391
+ "ulo",
392
+ // Feature only needs WHAT+WHY understanding
393
+ "cio",
394
+ // Feature needs HOW understanding
395
+ "sio"
396
+ // Feature needs specific implementation knowledge
397
+ ]).optional().default("cio"),
398
+ description: zod.z.string().optional().default(""),
399
+ estimated_prereq_minutes: zod.z.number().optional().default(0).describe("How many minutes of concept learning before this feature"),
400
+ phase_id: zod.z.string().optional().default("").describe("Development phase this link belongs to")
401
+ });
402
+ var ConceptIntroductionSchema = zod.z.object({
403
+ concept_id: zod.z.string().describe("Concept ID from knowledge_graph"),
404
+ aspect: zod.z.enum(["new", "advanced"]).default("new").describe(
405
+ "new = concept introduced for the first time; advanced = previously introduced concept revisited at higher depth"
406
+ ),
407
+ note: zod.z.string().optional().default("").describe("Which advanced aspect of the concept this phase develops")
408
+ });
409
+ var DevelopmentPhaseSchema = zod.z.object({
410
+ id: zod.z.string().describe("Phase id, e.g. PH1"),
411
+ order: zod.z.number().int().positive().describe("1-based phase execution order"),
412
+ name: zod.z.string().min(1).describe("Short phase name"),
413
+ product_completion: zod.z.string().min(1).describe(
414
+ "What the product can demonstrably DO once this phase is complete (completion level description)"
415
+ ),
416
+ feature_ids: zod.z.array(zod.z.string()).default([]).describe("Every feature built during this phase (each feature in EXACTLY one phase)"),
417
+ introduces: zod.z.array(ConceptIntroductionSchema).default([]).describe(
418
+ "Concepts introduced (new) or revisited at advanced depth (advanced) at the start of this phase"
419
+ )
420
+ });
421
+ var HybridGraphSchema = zod.z.object({
422
+ schema_version: zod.z.literal(1).optional().default(1),
423
+ type: zod.z.literal("hybrid_graph").optional().default("hybrid_graph"),
424
+ // Product decomposition (what to build)
425
+ project_graph: ProjectGraphSchema,
426
+ // Concept decomposition (what to understand)
427
+ knowledge_graph: KnowledgeGraphSchema,
428
+ // Links between features and concepts
429
+ links: zod.z.array(ProjectConceptLinkSchema).optional().default([]),
430
+ // Progressive completion phases (cross-feature decomposition). Empty for
431
+ // pre-phase legacy graphs — emitters fall back to feature ordering.
432
+ phases: zod.z.array(DevelopmentPhaseSchema).optional().default([]),
433
+ // Metadata
434
+ description: zod.z.string().optional().default(""),
435
+ total_project_minutes: zod.z.number().optional().default(0),
436
+ total_concept_minutes: zod.z.number().optional().default(0),
437
+ estimated_total_minutes: zod.z.number().optional().default(0)
438
+ });
439
+ var InputTypeSchema = zod.z.enum([
440
+ "repository",
441
+ // Source code repo (git URL or local dir)
442
+ "description",
443
+ // Text description of subject/project
444
+ "syllabus",
445
+ // Syllabus, curriculum framework, textbook outline
446
+ "files",
447
+ // Non-code files (3D models, images, documents)
448
+ "mixed"
449
+ // Combination of the above
450
+ ]);
451
+ var DomainCategorySchema = zod.z.enum([
452
+ "software",
453
+ // App, web, API, CLI, library
454
+ "hardware_iot",
455
+ // Arduino, robotics, ESP32, Raspberry Pi
456
+ "3d_design",
457
+ // Tinkercad, Fusion360, Blender, CAD
458
+ "math",
459
+ // Hình học, đại số, giải tích, xác suất
460
+ "science",
461
+ // Lý, hóa, sinh, địa lý
462
+ "language",
463
+ // Tiếng Việt, English, writing, grammar
464
+ "arts",
465
+ // Âm nhạc, hội họa, thiết kế, nhiếp ảnh
466
+ "research",
467
+ // Nghiên cứu, thống kê, phân tích dữ liệu
468
+ "business",
469
+ // Kinh doanh, tài chính, quản lý
470
+ "other"
471
+ ]);
472
+ var LearningModeSchema = zod.z.enum([
473
+ "product",
474
+ // Build a product (project-driven)
475
+ "concept",
476
+ // Understand concepts (knowledge-driven)
477
+ "hybrid"
478
+ // Both: build product while understanding concepts
479
+ ]);
480
+ var GraphTypeSchema = zod.z.enum([
481
+ "project_graph",
482
+ // Product decomposition (software, hardware, 3d_design)
483
+ "knowledge_graph",
484
+ // Concept decomposition (math, science, language, etc.)
485
+ "hybrid_graph"
486
+ // Both linked together
487
+ ]);
488
+ var DetectionConfidenceSchema = zod.z.object({
489
+ inputType: zod.z.number().min(0).max(1).optional().default(0.5),
490
+ domainCategory: zod.z.number().min(0).max(1).optional().default(0.5),
491
+ learningMode: zod.z.number().min(0).max(1).optional().default(0.5)
492
+ });
493
+ var DomainProfileSchema = zod.z.object({
494
+ // Detection results
495
+ inputType: InputTypeSchema,
496
+ domainCategory: DomainCategorySchema,
497
+ learningMode: LearningModeSchema,
498
+ graphType: GraphTypeSchema,
499
+ // Confidence scores
500
+ confidence: DetectionConfidenceSchema.optional(),
501
+ // Evidence for detection decisions
502
+ evidence: zod.z.array(zod.z.string()).optional().default([]),
503
+ // Detected metadata (optional, populated during detection)
504
+ detectedTechStack: zod.z.array(zod.z.string()).optional().default([]),
505
+ detectedSubject: zod.z.string().optional().default(""),
506
+ detectedGradeBand: zod.z.tuple([zod.z.number().int(), zod.z.number().int()]).optional(),
507
+ detectedDomain: zod.z.string().optional().default(""),
508
+ // User-provided context (pass-through)
509
+ goal: zod.z.string().optional().default(""),
510
+ description: zod.z.string().optional().default(""),
511
+ repoUrl: zod.z.string().optional().default(""),
512
+ repoDir: zod.z.string().optional().default(""),
513
+ syllabusText: zod.z.string().optional().default("")
514
+ });
515
+ var FeedKeywordsSchema = zod.z.object({
516
+ all: zod.z.array(zod.z.string()).default([]),
517
+ new: zod.z.array(zod.z.string()).default([]),
518
+ prerequisite: zod.z.array(zod.z.string()).default([])
519
+ });
520
+ var FeedScaffoldCandidateSchema = zod.z.object({
521
+ item: zod.z.string(),
522
+ reason: zod.z.string().default(""),
523
+ minutes_saved: zod.z.number().int().nonnegative().default(0),
524
+ suggest: zod.z.enum(["provide_full", "provide_partial", "provide_reference"]).default("provide_full")
525
+ });
526
+ var FeedNodeSchema = zod.z.object({
527
+ id: zod.z.string().min(1),
528
+ kind: zod.z.enum(["skill", "concept", "product_step"]),
529
+ name: zod.z.string().min(1),
530
+ concept_codes: zod.z.array(zod.z.string()).default([]),
531
+ keywords: FeedKeywordsSchema,
532
+ estimated_minutes: zod.z.number().int().nonnegative(),
533
+ bloom_hint: zod.z.enum(["Remember", "Understand", "Apply", "Analyze", "Evaluate", "Create"]).nullable().default(null),
534
+ depth_hint: zod.z.enum(["ulo", "cio", "sio"]).nullable().default(null),
535
+ completion_level: zod.z.enum(["mvp", "standard", "stretch"]).default("standard"),
536
+ scaffolding: zod.z.object({
537
+ scaffold_candidates: zod.z.array(FeedScaffoldCandidateSchema).default([]),
538
+ core_value_minutes: zod.z.number().int().nonnegative().default(0)
539
+ }).default({ scaffold_candidates: [], core_value_minutes: 0 }),
540
+ references: zod.z.array(zod.z.object({ file: zod.z.string().min(1), evidence: zod.z.string().default("") })).default([]),
541
+ feature_id: zod.z.string().nullable().default(null),
542
+ concept_ref: zod.z.string().nullable().default(null),
543
+ // Progressive-completion bookkeeping (feed v2, additive):
544
+ // phase_id = development phase that introduces/uses this node;
545
+ // introduce_aspect = how the phase teaches a concept node (first intro vs advanced revisit).
546
+ phase_id: zod.z.string().default(""),
547
+ introduce_aspect: zod.z.enum(["new", "advanced"]).nullable().default(null)
548
+ });
549
+ var FeedEdgeSchema = zod.z.object({
550
+ from: zod.z.string().min(1),
551
+ to: zod.z.string().min(1),
552
+ kind: zod.z.enum(["knowledge", "task"]),
553
+ reason: zod.z.string().default("")
554
+ });
555
+ var FeedGroupingSchema = zod.z.object({
556
+ id: zod.z.string().min(1),
557
+ name: zod.z.string().min(1),
558
+ node_ids: zod.z.array(zod.z.string()).min(1),
559
+ rationale: zod.z.string().default("")
560
+ });
561
+ var FeedPhaseSchema = zod.z.object({
562
+ id: zod.z.string().min(1),
563
+ order: zod.z.number().int().positive(),
564
+ name: zod.z.string().min(1),
565
+ product_completion: zod.z.string().min(1),
566
+ node_ids: zod.z.array(zod.z.string()).min(1)
567
+ });
568
+ var CurriculumFeedSchema = zod.z.object({
569
+ schema_version: zod.z.literal(2),
570
+ source: zod.z.object({
571
+ graph_type: zod.z.enum(["project_graph", "knowledge_graph", "hybrid_graph"]),
572
+ warnings: zod.z.array(zod.z.string()).default([]),
573
+ hallucination_count: zod.z.number().int().nonnegative().default(0)
574
+ }),
575
+ learning_nodes: zod.z.array(FeedNodeSchema).min(1, "curriculum feed must contain at least one learning node"),
576
+ dependency_edges: zod.z.array(FeedEdgeSchema).default([]),
577
+ suggested_groupings: zod.z.array(FeedGroupingSchema).default([]),
578
+ // Progressive completion phases (cross-feature). When non-empty, these — not
579
+ // suggested_groupings — define the teaching sequence and unit structure.
580
+ phases: zod.z.array(FeedPhaseSchema).default([])
581
+ });
582
+ function validateCurriculumFeed(feed) {
583
+ const parsed = CurriculumFeedSchema.parse(feed);
584
+ const ids = new Set(parsed.learning_nodes.map((n) => n.id));
585
+ if (ids.size !== parsed.learning_nodes.length) {
586
+ throw new Error("curriculum feed contains duplicate node ids");
587
+ }
588
+ for (const e of parsed.dependency_edges) {
589
+ if (!ids.has(e.from) || !ids.has(e.to)) {
590
+ throw new Error("curriculum feed edge " + e.from + " -> " + e.to + " references unknown node");
591
+ }
592
+ if (e.from === e.to) throw new Error("curriculum feed self-loop edge on " + e.from);
593
+ }
594
+ for (const g of parsed.suggested_groupings) {
595
+ for (const id of g.node_ids) {
596
+ if (!ids.has(id)) throw new Error("grouping " + g.id + " references unknown node " + id);
597
+ }
598
+ }
599
+ for (const ph of parsed.phases) {
600
+ for (const id of ph.node_ids) {
601
+ if (!ids.has(id)) throw new Error("phase " + ph.id + " references unknown node " + id);
602
+ }
603
+ }
604
+ const phaseIds = parsed.phases.map((p) => p.id);
605
+ if (new Set(phaseIds).size !== phaseIds.length) throw new Error("curriculum feed contains duplicate phase ids");
606
+ return parsed;
607
+ }
608
+
609
+ exports.ArchEdgeSchema = ArchEdgeSchema;
610
+ exports.ArchNodeSchema = ArchNodeSchema;
611
+ exports.ArchitectureDetailSchema = ArchitectureDetailSchema;
612
+ exports.CapabilitySchema = CapabilitySchema;
613
+ exports.ConceptCategorySchema = ConceptCategorySchema;
614
+ exports.ConceptIntroductionSchema = ConceptIntroductionSchema;
615
+ exports.ConceptSchema = ConceptSchema;
616
+ exports.CurriculumFeedSchema = CurriculumFeedSchema;
617
+ exports.DataIntegrationSchema = DataIntegrationSchema;
618
+ exports.DecompositionSchema = DecompositionSchema;
619
+ exports.DetectionConfidenceSchema = DetectionConfidenceSchema;
620
+ exports.DevelopmentPhaseSchema = DevelopmentPhaseSchema;
621
+ exports.DevelopmentStageSchema = DevelopmentStageSchema;
622
+ exports.DomainCategorySchema = DomainCategorySchema;
623
+ exports.DomainProfileSchema = DomainProfileSchema;
624
+ exports.ExperienceComponentSchema = ExperienceComponentSchema;
625
+ exports.ExperienceSchema = ExperienceSchema;
626
+ exports.FeatureSchema = FeatureSchema;
627
+ exports.FeedEdgeSchema = FeedEdgeSchema;
628
+ exports.FeedGroupingSchema = FeedGroupingSchema;
629
+ exports.FeedKeywordsSchema = FeedKeywordsSchema;
630
+ exports.FeedNodeSchema = FeedNodeSchema;
631
+ exports.FeedPhaseSchema = FeedPhaseSchema;
632
+ exports.FeedScaffoldCandidateSchema = FeedScaffoldCandidateSchema;
633
+ exports.GraphTypeSchema = GraphTypeSchema;
634
+ exports.HardwareFeatureExtensionSchema = HardwareFeatureExtensionSchema;
635
+ exports.HardwareStepSchema = HardwareStepSchema;
636
+ exports.HardwareTaskExtensionSchema = HardwareTaskExtensionSchema;
637
+ exports.HardwareTechStackExtensionSchema = HardwareTechStackExtensionSchema;
638
+ exports.HybridGraphSchema = HybridGraphSchema;
639
+ exports.ImplementationSchema = ImplementationSchema;
640
+ exports.InputTypeSchema = InputTypeSchema;
641
+ exports.JourneySchema = JourneySchema;
642
+ exports.JourneyStepSchema = JourneyStepSchema;
643
+ exports.KnowledgeGraphSchema = KnowledgeGraphSchema;
644
+ exports.LearningModeSchema = LearningModeSchema;
645
+ exports.LearningPathStepSchema = LearningPathStepSchema;
646
+ exports.MilestoneDecompositionSchema = MilestoneDecompositionSchema;
647
+ exports.MissingGapSchema = MissingGapSchema;
648
+ exports.NavigationSchema = NavigationSchema;
649
+ exports.ProblemTypeSchema = ProblemTypeSchema;
650
+ exports.ProductGoalSchema = ProductGoalSchema;
651
+ exports.ProductSchema = ProductSchema;
652
+ exports.ProductUserSchema = ProductUserSchema;
653
+ exports.ProjectConceptLinkSchema = ProjectConceptLinkSchema;
654
+ exports.ProjectGraphSchema = ProjectGraphSchema;
655
+ exports.ProjectInfoSchema = ProjectInfoSchema;
656
+ exports.RequirementSchema = RequirementSchema;
657
+ exports.ScreenSchema = ScreenSchema;
658
+ exports.ShapeSchema = ShapeSchema;
659
+ exports.StepEffortSchema = StepEffortSchema;
660
+ exports.StepOutcomeSchema = StepOutcomeSchema;
661
+ exports.StepSchema = StepSchema;
662
+ exports.SubjectInfoSchema = SubjectInfoSchema;
663
+ exports.TaskEffortSchema = TaskEffortSchema;
664
+ exports.TaskOutcomeSchema = TaskOutcomeSchema;
665
+ exports.TaskSchema = TaskSchema;
666
+ exports.TechDebtSchema = TechDebtSchema;
667
+ exports.TechStackSchema = TechStackSchema;
668
+ exports.ThreeDesignFeatureExtensionSchema = ThreeDesignFeatureExtensionSchema;
669
+ exports.ThreeDesignTaskExtensionSchema = ThreeDesignTaskExtensionSchema;
670
+ exports.ThreeDesignTechStackExtensionSchema = ThreeDesignTechStackExtensionSchema;
671
+ exports.UiStateSchema = UiStateSchema;
672
+ exports.WiringSchema = WiringSchema;
673
+ exports.validateCurriculumFeed = validateCurriculumFeed;
674
+ //# sourceMappingURL=index.cjs.map
675
+ //# sourceMappingURL=index.cjs.map