learngraph 0.2.0 → 0.3.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 (58) hide show
  1. package/README.md +82 -1
  2. package/dist/cjs/llm/adapters/anthropic.js +124 -0
  3. package/dist/cjs/llm/adapters/anthropic.js.map +1 -0
  4. package/dist/cjs/llm/adapters/base.js +100 -0
  5. package/dist/cjs/llm/adapters/base.js.map +1 -0
  6. package/dist/cjs/llm/adapters/index.js +22 -0
  7. package/dist/cjs/llm/adapters/index.js.map +1 -0
  8. package/dist/cjs/llm/adapters/ollama.js +149 -0
  9. package/dist/cjs/llm/adapters/ollama.js.map +1 -0
  10. package/dist/cjs/llm/adapters/openai.js +126 -0
  11. package/dist/cjs/llm/adapters/openai.js.map +1 -0
  12. package/dist/cjs/llm/index.js +34 -5
  13. package/dist/cjs/llm/index.js.map +1 -1
  14. package/dist/cjs/llm/orchestrator.js +219 -0
  15. package/dist/cjs/llm/orchestrator.js.map +1 -0
  16. package/dist/cjs/llm/prompts.js +367 -0
  17. package/dist/cjs/llm/prompts.js.map +1 -0
  18. package/dist/cjs/types/llm.js +8 -0
  19. package/dist/cjs/types/llm.js.map +1 -0
  20. package/dist/esm/llm/adapters/anthropic.js +119 -0
  21. package/dist/esm/llm/adapters/anthropic.js.map +1 -0
  22. package/dist/esm/llm/adapters/base.js +95 -0
  23. package/dist/esm/llm/adapters/base.js.map +1 -0
  24. package/dist/esm/llm/adapters/index.js +10 -0
  25. package/dist/esm/llm/adapters/index.js.map +1 -0
  26. package/dist/esm/llm/adapters/ollama.js +144 -0
  27. package/dist/esm/llm/adapters/ollama.js.map +1 -0
  28. package/dist/esm/llm/adapters/openai.js +121 -0
  29. package/dist/esm/llm/adapters/openai.js.map +1 -0
  30. package/dist/esm/llm/index.js +12 -6
  31. package/dist/esm/llm/index.js.map +1 -1
  32. package/dist/esm/llm/orchestrator.js +214 -0
  33. package/dist/esm/llm/orchestrator.js.map +1 -0
  34. package/dist/esm/llm/prompts.js +360 -0
  35. package/dist/esm/llm/prompts.js.map +1 -0
  36. package/dist/esm/types/llm.js +7 -0
  37. package/dist/esm/types/llm.js.map +1 -0
  38. package/dist/types/llm/adapters/anthropic.d.ts +21 -0
  39. package/dist/types/llm/adapters/anthropic.d.ts.map +1 -0
  40. package/dist/types/llm/adapters/base.d.ts +46 -0
  41. package/dist/types/llm/adapters/base.d.ts.map +1 -0
  42. package/dist/types/llm/adapters/index.d.ts +11 -0
  43. package/dist/types/llm/adapters/index.d.ts.map +1 -0
  44. package/dist/types/llm/adapters/ollama.d.ts +30 -0
  45. package/dist/types/llm/adapters/ollama.d.ts.map +1 -0
  46. package/dist/types/llm/adapters/openai.d.ts +22 -0
  47. package/dist/types/llm/adapters/openai.d.ts.map +1 -0
  48. package/dist/types/llm/index.d.ts +5 -0
  49. package/dist/types/llm/index.d.ts.map +1 -1
  50. package/dist/types/llm/orchestrator.d.ts +35 -0
  51. package/dist/types/llm/orchestrator.d.ts.map +1 -0
  52. package/dist/types/llm/prompts.d.ts +269 -0
  53. package/dist/types/llm/prompts.d.ts.map +1 -0
  54. package/dist/types/types/index.d.ts +1 -0
  55. package/dist/types/types/index.d.ts.map +1 -1
  56. package/dist/types/types/llm.d.ts +298 -0
  57. package/dist/types/types/llm.d.ts.map +1 -0
  58. package/package.json +1 -1
@@ -0,0 +1,214 @@
1
+ /**
2
+ * LLM orchestrator for educational tasks
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ import { SKILL_DEFAULTS, THRESHOLD_CONCEPT_MASTERY } from '../types/skill.js';
7
+ import { SYSTEM_PROMPTS, EXTRACTION_SCHEMA, PREREQUISITE_SCHEMA, BLOOM_ANALYSIS_SCHEMA, DECOMPOSITION_SCHEMA, buildExtractionPrompt, buildPrerequisitePrompt, buildBloomPrompt, buildDecompositionPrompt, } from './prompts.js';
8
+ /** Default estimated minutes for skill mastery */
9
+ const DEFAULT_ESTIMATED_MINUTES = 30;
10
+ /**
11
+ * Difficulty mapping for Bloom's levels
12
+ */
13
+ const BLOOM_DIFFICULTY = {
14
+ remember: 0.2,
15
+ understand: 0.35,
16
+ apply: 0.5,
17
+ analyze: 0.65,
18
+ evaluate: 0.8,
19
+ create: 0.9,
20
+ };
21
+ /**
22
+ * High-level orchestrator for LLM-based educational tasks
23
+ */
24
+ export class LLMOrchestrator {
25
+ adapter;
26
+ constructor(adapter) {
27
+ this.adapter = adapter;
28
+ }
29
+ getAdapter() {
30
+ return this.adapter;
31
+ }
32
+ /**
33
+ * Extract skills from curriculum content
34
+ */
35
+ async extractSkills(request) {
36
+ const startTime = Date.now();
37
+ // Build options object conditionally to avoid undefined values
38
+ const extractionOptions = {};
39
+ if (request.domain)
40
+ extractionOptions.domain = request.domain;
41
+ if (request.gradeLevel)
42
+ extractionOptions.gradeLevel = request.gradeLevel;
43
+ if (request.context)
44
+ extractionOptions.context = request.context;
45
+ const messages = [
46
+ { role: 'system', content: SYSTEM_PROMPTS.skillExtraction },
47
+ {
48
+ role: 'user',
49
+ content: buildExtractionPrompt(request.content, extractionOptions),
50
+ },
51
+ ];
52
+ const response = await this.adapter.complete({
53
+ messages,
54
+ responseFormat: 'json',
55
+ jsonSchema: EXTRACTION_SCHEMA,
56
+ });
57
+ const parsed = response.json;
58
+ // Apply filters and defaults
59
+ let skills = parsed.skills.map((skill) => ({
60
+ ...skill,
61
+ isThresholdConcept: skill.isThresholdConcept ?? false,
62
+ confidence: skill.confidence ?? 0.8,
63
+ }));
64
+ // Filter by minimum confidence
65
+ if (request.minConfidence) {
66
+ skills = skills.filter((s) => s.confidence >= request.minConfidence);
67
+ }
68
+ // Calculate overall confidence
69
+ const confidence = skills.length > 0 ? skills.reduce((acc, s) => acc + s.confidence, 0) / skills.length : 0;
70
+ return {
71
+ skills,
72
+ confidence,
73
+ usage: response.usage,
74
+ warnings: parsed.warnings ?? [],
75
+ durationMs: Date.now() - startTime,
76
+ };
77
+ }
78
+ /**
79
+ * Infer prerequisites between skills
80
+ */
81
+ async inferPrerequisites(request) {
82
+ const startTime = Date.now();
83
+ // Build options object conditionally to avoid undefined values
84
+ const prerequisiteOptions = {};
85
+ if (request.domain)
86
+ prerequisiteOptions.domain = request.domain;
87
+ if (request.inferTransitive !== undefined)
88
+ prerequisiteOptions.inferTransitive = request.inferTransitive;
89
+ const messages = [
90
+ { role: 'system', content: SYSTEM_PROMPTS.prerequisiteInference },
91
+ {
92
+ role: 'user',
93
+ content: buildPrerequisitePrompt(request.skills, prerequisiteOptions),
94
+ },
95
+ ];
96
+ const response = await this.adapter.complete({
97
+ messages,
98
+ responseFormat: 'json',
99
+ jsonSchema: PREREQUISITE_SCHEMA,
100
+ });
101
+ const parsed = response.json;
102
+ // Filter by minimum confidence
103
+ let prerequisites = parsed.prerequisites;
104
+ if (request.minConfidence) {
105
+ prerequisites = prerequisites.filter((p) => p.confidence >= request.minConfidence);
106
+ }
107
+ return {
108
+ prerequisites,
109
+ usage: response.usage,
110
+ durationMs: Date.now() - startTime,
111
+ };
112
+ }
113
+ /**
114
+ * Analyze Bloom's level of text
115
+ */
116
+ async analyzeBloomLevel(request) {
117
+ const messages = [
118
+ { role: 'system', content: SYSTEM_PROMPTS.bloomAnalysis },
119
+ { role: 'user', content: buildBloomPrompt(request.text, request.context) },
120
+ ];
121
+ const response = await this.adapter.complete({
122
+ messages,
123
+ responseFormat: 'json',
124
+ jsonSchema: BLOOM_ANALYSIS_SCHEMA,
125
+ });
126
+ const parsed = response.json;
127
+ return {
128
+ level: parsed.level,
129
+ confidence: parsed.confidence,
130
+ indicators: parsed.indicators,
131
+ reasoning: parsed.reasoning,
132
+ usage: response.usage,
133
+ };
134
+ }
135
+ /**
136
+ * Full curriculum decomposition into skill graph
137
+ */
138
+ async decompose(request) {
139
+ const startTime = Date.now();
140
+ // Build options object conditionally to avoid undefined values
141
+ const decompositionOptions = {};
142
+ if (request.title)
143
+ decompositionOptions.title = request.title;
144
+ if (request.domain)
145
+ decompositionOptions.domain = request.domain;
146
+ if (request.gradeLevel)
147
+ decompositionOptions.gradeLevel = request.gradeLevel;
148
+ if (request.context)
149
+ decompositionOptions.context = request.context;
150
+ if (request.maxDepth !== undefined)
151
+ decompositionOptions.maxDepth = request.maxDepth;
152
+ const messages = [
153
+ { role: 'system', content: SYSTEM_PROMPTS.curriculumDecomposition },
154
+ {
155
+ role: 'user',
156
+ content: buildDecompositionPrompt(request.content, decompositionOptions),
157
+ },
158
+ ];
159
+ const response = await this.adapter.complete({
160
+ messages,
161
+ responseFormat: 'json',
162
+ jsonSchema: DECOMPOSITION_SCHEMA,
163
+ maxTokens: 8192, // Decomposition can be verbose
164
+ });
165
+ const parsed = response.json;
166
+ // Convert extracted skills to SkillNodeInput format
167
+ const skillInputs = parsed.skills.map((skill) => ({
168
+ name: skill.name,
169
+ description: skill.description,
170
+ bloomLevel: skill.bloomLevel,
171
+ difficulty: skill.difficulty ?? BLOOM_DIFFICULTY[skill.bloomLevel] ?? 0.5,
172
+ isThresholdConcept: skill.isThresholdConcept ?? false,
173
+ masteryThreshold: skill.isThresholdConcept
174
+ ? THRESHOLD_CONCEPT_MASTERY
175
+ : SKILL_DEFAULTS.masteryThreshold,
176
+ estimatedMinutes: skill.estimatedMinutes ?? DEFAULT_ESTIMATED_MINUTES,
177
+ tags: skill.keywords ?? [],
178
+ metadata: {
179
+ llmExtracted: true,
180
+ llmId: skill.id,
181
+ confidence: skill.confidence ?? 0.8,
182
+ },
183
+ }));
184
+ // Convert prerequisites with confidence
185
+ const prerequisites = parsed.prerequisites.map((p) => ({
186
+ sourceId: p.sourceId,
187
+ targetId: p.targetId,
188
+ strength: p.strength,
189
+ type: p.type,
190
+ confidence: 0.8, // Default confidence for decomposition
191
+ reasoning: p.reasoning ?? 'Inferred from curriculum structure',
192
+ }));
193
+ return {
194
+ title: parsed.title || request.title || 'Untitled Curriculum',
195
+ skills: parsed.skills.map((s) => ({
196
+ ...s,
197
+ isThresholdConcept: s.isThresholdConcept ?? false,
198
+ confidence: s.confidence ?? 0.8,
199
+ })),
200
+ prerequisites,
201
+ skillInputs,
202
+ usage: response.usage,
203
+ durationMs: Date.now() - startTime,
204
+ warnings: parsed.warnings ?? [],
205
+ };
206
+ }
207
+ }
208
+ /**
209
+ * Create an orchestrator with a specific adapter
210
+ */
211
+ export function createOrchestrator(adapter) {
212
+ return new LLMOrchestrator(adapter);
213
+ }
214
+ //# sourceMappingURL=orchestrator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestrator.js","sourceRoot":"","sources":["../../../src/llm/orchestrator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAmBH,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,cAAc,CAAC;AAEtB,kDAAkD;AAClD,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAErC;;GAEG;AACH,MAAM,gBAAgB,GAA+B;IACnD,QAAQ,EAAE,GAAG;IACb,UAAU,EAAE,IAAI;IAChB,KAAK,EAAE,GAAG;IACV,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,GAAG;CACZ,CAAC;AAEF;;GAEG;AACH,MAAM,OAAO,eAAe;IACG;IAA7B,YAA6B,OAAmB;QAAnB,YAAO,GAAP,OAAO,CAAY;IAAG,CAAC;IAEpD,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,aAAa,CAAC,OAA+B;QACjD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE7B,+DAA+D;QAC/D,MAAM,iBAAiB,GAAgD,EAAE,CAAC;QAC1E,IAAI,OAAO,CAAC,MAAM;YAAE,iBAAiB,CAAC,MAAM,GAAG,OAAO,CAAC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C,OAAO,CAAC,CAAC;AACtC,CAAC"}
@@ -0,0 +1,360 @@
1
+ /**
2
+ * Prompts for LLM-based educational tasks
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ // ─────────────────────────────────────────────────────────────────────────────
7
+ // System Prompts
8
+ // ─────────────────────────────────────────────────────────────────────────────
9
+ export const SYSTEM_PROMPTS = {
10
+ skillExtraction: `You are an expert educational curriculum analyst specializing in competency-based education and learning science.
11
+
12
+ Your task is to analyze curriculum content and extract discrete, measurable skills that learners should master.
13
+
14
+ For each skill you identify:
15
+ 1. Name: A concise, action-oriented name (e.g., "Calculate derivative of polynomial")
16
+ 2. Description: A clear explanation of what mastery of this skill looks like
17
+ 3. Bloom's Level: Classify using Bloom's Taxonomy (remember, understand, apply, analyze, evaluate, create)
18
+ 4. Difficulty: Estimate difficulty on a 0-1 scale based on cognitive complexity
19
+ 5. Threshold Concept: Identify if this is a transformative "gateway" skill that changes understanding
20
+ 6. Estimated Time: How long a typical learner needs to achieve mastery
21
+
22
+ Focus on:
23
+ - Observable, measurable outcomes
24
+ - Skills that can be assessed
25
+ - Appropriate granularity (not too broad, not too narrow)
26
+ - Clear prerequisite relationships
27
+
28
+ Bloom's Level Guidelines:
29
+ - remember (0.20): Recall facts, terms, basic concepts
30
+ - understand (0.35): Explain ideas, interpret, summarize
31
+ - apply (0.50): Use information in new situations, solve problems
32
+ - analyze (0.65): Draw connections, organize, compare, contrast
33
+ - evaluate (0.80): Justify decisions, make judgments, critique
34
+ - create (0.90): Produce new work, design, construct`,
35
+ prerequisiteInference: `You are an expert in learning science and curriculum design, specializing in prerequisite mapping and learning path optimization.
36
+
37
+ Your task is to analyze skills and infer prerequisite relationships between them.
38
+
39
+ For each prerequisite relationship:
40
+ 1. Identify which skill must be learned first (source/prerequisite)
41
+ 2. Identify which skill depends on it (target/dependent)
42
+ 3. Classify the relationship type:
43
+ - hard: Absolutely required - cannot learn target without source
44
+ - soft: Strongly beneficial but not strictly required
45
+ - recommended: Helpful for optimal learning path
46
+ 4. Estimate strength (0-1): How critical is this prerequisite?
47
+ 5. Provide clear reasoning for the relationship
48
+
49
+ Consider:
50
+ - Bloom's level progression (lower levels typically prerequisite to higher)
51
+ - Conceptual dependencies (foundational concepts before advanced)
52
+ - Skill hierarchies within domains
53
+ - Transfer of learning between related skills
54
+ - Avoid circular dependencies`,
55
+ bloomAnalysis: `You are an expert in Bloom's Taxonomy and educational assessment design.
56
+
57
+ Analyze the given text and determine its cognitive level according to Bloom's Taxonomy:
58
+
59
+ 1. remember - Recall facts and basic concepts
60
+ Verbs: define, identify, list, name, recall, recognize, state
61
+
62
+ 2. understand - Explain ideas or concepts
63
+ Verbs: describe, explain, interpret, summarize, classify, compare
64
+
65
+ 3. apply - Use information in new situations
66
+ Verbs: apply, calculate, solve, demonstrate, implement, use
67
+
68
+ 4. analyze - Draw connections among ideas
69
+ Verbs: analyze, compare, contrast, differentiate, examine, organize
70
+
71
+ 5. evaluate - Justify a decision or course of action
72
+ Verbs: evaluate, assess, critique, judge, justify, recommend
73
+
74
+ 6. create - Produce new or original work
75
+ Verbs: create, design, develop, construct, formulate, produce
76
+
77
+ Provide:
78
+ - The Bloom's level
79
+ - Confidence score (0-1)
80
+ - Key indicators (verbs/phrases) that led to this classification
81
+ - Brief reasoning`,
82
+ curriculumDecomposition: `You are an expert curriculum designer and learning scientist.
83
+
84
+ Your task is to decompose curriculum content into a structured skill graph suitable for adaptive learning systems.
85
+
86
+ Process:
87
+ 1. Identify the overall learning goals and outcomes
88
+ 2. Break down content into discrete, measurable skills
89
+ 3. Classify each skill by Bloom's level and difficulty
90
+ 4. Identify threshold concepts (transformative gateway skills)
91
+ 5. Map prerequisite relationships between skills
92
+ 6. Ensure appropriate granularity for personalized learning
93
+
94
+ Output a complete skill graph with:
95
+ - Skills: Name, description, Bloom's level, difficulty, estimated time
96
+ - Prerequisites: Source skill, target skill, type, strength, reasoning
97
+
98
+ Principles:
99
+ - Every skill should be assessable
100
+ - Skills should be at appropriate granularity (15-45 min to master)
101
+ - Clear progression from foundational to advanced
102
+ - Identify threshold concepts that unlock new understanding
103
+ - Consider both hard prerequisites (required) and soft (beneficial)`,
104
+ };
105
+ // ─────────────────────────────────────────────────────────────────────────────
106
+ // JSON Schemas for Structured Output
107
+ // ─────────────────────────────────────────────────────────────────────────────
108
+ export const EXTRACTION_SCHEMA = {
109
+ type: 'object',
110
+ properties: {
111
+ skills: {
112
+ type: 'array',
113
+ items: {
114
+ type: 'object',
115
+ properties: {
116
+ name: { type: 'string', description: 'Concise, action-oriented skill name' },
117
+ description: { type: 'string', description: 'What mastery of this skill looks like' },
118
+ bloomLevel: {
119
+ type: 'string',
120
+ enum: ['remember', 'understand', 'apply', 'analyze', 'evaluate', 'create'],
121
+ description: "Bloom's Taxonomy level",
122
+ },
123
+ difficulty: {
124
+ type: 'number',
125
+ minimum: 0,
126
+ maximum: 1,
127
+ description: 'Difficulty on 0-1 scale',
128
+ },
129
+ confidence: {
130
+ type: 'number',
131
+ minimum: 0,
132
+ maximum: 1,
133
+ description: 'Confidence in this extraction',
134
+ },
135
+ isThresholdConcept: {
136
+ type: 'boolean',
137
+ description: 'Is this a transformative gateway skill?',
138
+ },
139
+ estimatedMinutes: {
140
+ type: 'number',
141
+ description: 'Estimated time to master in minutes',
142
+ },
143
+ keywords: {
144
+ type: 'array',
145
+ items: { type: 'string' },
146
+ description: 'Associated keywords/concepts',
147
+ },
148
+ reasoning: {
149
+ type: 'string',
150
+ description: 'Why this skill was extracted',
151
+ },
152
+ },
153
+ required: ['name', 'description', 'bloomLevel', 'difficulty', 'confidence'],
154
+ },
155
+ },
156
+ warnings: {
157
+ type: 'array',
158
+ items: { type: 'string' },
159
+ description: 'Any warnings or notes about the extraction',
160
+ },
161
+ },
162
+ required: ['skills'],
163
+ };
164
+ export const PREREQUISITE_SCHEMA = {
165
+ type: 'object',
166
+ properties: {
167
+ prerequisites: {
168
+ type: 'array',
169
+ items: {
170
+ type: 'object',
171
+ properties: {
172
+ sourceId: { type: 'string', description: 'ID of the prerequisite skill' },
173
+ targetId: { type: 'string', description: 'ID of the dependent skill' },
174
+ strength: {
175
+ type: 'number',
176
+ minimum: 0,
177
+ maximum: 1,
178
+ description: 'How critical is this prerequisite (0-1)',
179
+ },
180
+ type: {
181
+ type: 'string',
182
+ enum: ['hard', 'soft', 'recommended'],
183
+ description: 'Type of prerequisite relationship',
184
+ },
185
+ confidence: {
186
+ type: 'number',
187
+ minimum: 0,
188
+ maximum: 1,
189
+ description: 'Confidence in this inference',
190
+ },
191
+ reasoning: {
192
+ type: 'string',
193
+ description: 'Why this prerequisite relationship exists',
194
+ },
195
+ },
196
+ required: ['sourceId', 'targetId', 'strength', 'type', 'confidence', 'reasoning'],
197
+ },
198
+ },
199
+ },
200
+ required: ['prerequisites'],
201
+ };
202
+ export const BLOOM_ANALYSIS_SCHEMA = {
203
+ type: 'object',
204
+ properties: {
205
+ level: {
206
+ type: 'string',
207
+ enum: ['remember', 'understand', 'apply', 'analyze', 'evaluate', 'create'],
208
+ description: "Detected Bloom's level",
209
+ },
210
+ confidence: {
211
+ type: 'number',
212
+ minimum: 0,
213
+ maximum: 1,
214
+ description: 'Confidence in detection',
215
+ },
216
+ indicators: {
217
+ type: 'array',
218
+ items: { type: 'string' },
219
+ description: 'Key verbs/phrases indicating this level',
220
+ },
221
+ reasoning: {
222
+ type: 'string',
223
+ description: 'Explanation for the classification',
224
+ },
225
+ },
226
+ required: ['level', 'confidence', 'indicators', 'reasoning'],
227
+ };
228
+ export const DECOMPOSITION_SCHEMA = {
229
+ type: 'object',
230
+ properties: {
231
+ title: { type: 'string', description: 'Course/curriculum title' },
232
+ skills: {
233
+ type: 'array',
234
+ items: {
235
+ type: 'object',
236
+ properties: {
237
+ id: { type: 'string', description: 'Unique skill identifier' },
238
+ name: { type: 'string' },
239
+ description: { type: 'string' },
240
+ bloomLevel: {
241
+ type: 'string',
242
+ enum: ['remember', 'understand', 'apply', 'analyze', 'evaluate', 'create'],
243
+ },
244
+ difficulty: { type: 'number', minimum: 0, maximum: 1 },
245
+ isThresholdConcept: { type: 'boolean' },
246
+ estimatedMinutes: { type: 'number' },
247
+ keywords: { type: 'array', items: { type: 'string' } },
248
+ },
249
+ required: ['id', 'name', 'description', 'bloomLevel', 'difficulty'],
250
+ },
251
+ },
252
+ prerequisites: {
253
+ type: 'array',
254
+ items: {
255
+ type: 'object',
256
+ properties: {
257
+ sourceId: { type: 'string' },
258
+ targetId: { type: 'string' },
259
+ strength: { type: 'number', minimum: 0, maximum: 1 },
260
+ type: { type: 'string', enum: ['hard', 'soft', 'recommended'] },
261
+ reasoning: { type: 'string' },
262
+ },
263
+ required: ['sourceId', 'targetId', 'strength', 'type'],
264
+ },
265
+ },
266
+ warnings: {
267
+ type: 'array',
268
+ items: { type: 'string' },
269
+ },
270
+ },
271
+ required: ['title', 'skills', 'prerequisites'],
272
+ };
273
+ // ─────────────────────────────────────────────────────────────────────────────
274
+ // Prompt Builders
275
+ // ─────────────────────────────────────────────────────────────────────────────
276
+ /**
277
+ * Build a skill extraction prompt
278
+ */
279
+ export function buildExtractionPrompt(content, options) {
280
+ let prompt = `Analyze the following curriculum content and extract all discrete, measurable skills.\n\n`;
281
+ if (options?.domain) {
282
+ prompt += `Domain: ${options.domain}\n`;
283
+ }
284
+ if (options?.gradeLevel) {
285
+ prompt += `Target Audience: ${options.gradeLevel}\n`;
286
+ }
287
+ if (options?.context) {
288
+ prompt += `Additional Context: ${options.context}\n`;
289
+ }
290
+ prompt += `\n--- CURRICULUM CONTENT ---\n${content}\n--- END CONTENT ---\n\n`;
291
+ prompt += `Extract all skills from this content. For each skill, provide name, description, Bloom's level, difficulty (0-1), and identify if it's a threshold concept.`;
292
+ return prompt;
293
+ }
294
+ /**
295
+ * Build a prerequisite inference prompt
296
+ */
297
+ export function buildPrerequisitePrompt(skills, options) {
298
+ let prompt = `Analyze the following skills and infer prerequisite relationships between them.\n\n`;
299
+ if (options?.domain) {
300
+ prompt += `Domain: ${options.domain}\n`;
301
+ }
302
+ prompt += `\n--- SKILLS ---\n`;
303
+ for (const skill of skills) {
304
+ prompt += `ID: ${skill.id}\n`;
305
+ prompt += `Name: ${skill.name}\n`;
306
+ prompt += `Description: ${skill.description}\n`;
307
+ prompt += `Bloom's Level: ${skill.bloomLevel}\n`;
308
+ prompt += `Difficulty: ${skill.difficulty}\n\n`;
309
+ }
310
+ prompt += `--- END SKILLS ---\n\n`;
311
+ prompt += `For each prerequisite relationship you identify:\n`;
312
+ prompt += `1. Specify sourceId (prerequisite) and targetId (dependent)\n`;
313
+ prompt += `2. Classify as hard, soft, or recommended\n`;
314
+ prompt += `3. Provide strength (0-1) and reasoning\n`;
315
+ if (options?.inferTransitive === false) {
316
+ prompt += `\nNote: Only infer direct prerequisites, not transitive ones.`;
317
+ }
318
+ return prompt;
319
+ }
320
+ /**
321
+ * Build a Bloom's analysis prompt
322
+ */
323
+ export function buildBloomPrompt(text, context) {
324
+ let prompt = `Analyze the following text and determine its Bloom's Taxonomy level.\n\n`;
325
+ if (context) {
326
+ prompt += `Context: ${context}\n\n`;
327
+ }
328
+ prompt += `--- TEXT ---\n${text}\n--- END TEXT ---\n\n`;
329
+ prompt += `Classify this text according to Bloom's Taxonomy (remember, understand, apply, analyze, evaluate, create).`;
330
+ return prompt;
331
+ }
332
+ /**
333
+ * Build a curriculum decomposition prompt
334
+ */
335
+ export function buildDecompositionPrompt(content, options) {
336
+ let prompt = `Decompose the following curriculum into a complete skill graph.\n\n`;
337
+ if (options?.title) {
338
+ prompt += `Course Title: ${options.title}\n`;
339
+ }
340
+ if (options?.domain) {
341
+ prompt += `Domain: ${options.domain}\n`;
342
+ }
343
+ if (options?.gradeLevel) {
344
+ prompt += `Target Audience: ${options.gradeLevel}\n`;
345
+ }
346
+ if (options?.context) {
347
+ prompt += `Additional Context: ${options.context}\n`;
348
+ }
349
+ if (options?.maxDepth) {
350
+ prompt += `Maximum Skill Hierarchy Depth: ${options.maxDepth}\n`;
351
+ }
352
+ prompt += `\n--- CURRICULUM CONTENT ---\n${content}\n--- END CONTENT ---\n\n`;
353
+ prompt += `Create a complete skill graph with:\n`;
354
+ prompt += `1. All discrete, measurable skills with unique IDs\n`;
355
+ prompt += `2. Bloom's level and difficulty for each skill\n`;
356
+ prompt += `3. Prerequisite relationships between skills\n`;
357
+ prompt += `4. Identify threshold concepts that unlock understanding\n`;
358
+ return prompt;
359
+ }
360
+ //# sourceMappingURL=prompts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/llm/prompts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,gFAAgF;AAChF,iBAAiB;AACjB,gFAAgF;AAEhF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,eAAe,EAAE;;;;;;;;;;;;;;;;;;;;;;;;qDAwBkC;IAEnD,qBAAqB,EAAE;;;;;;;;;;;;;;;;;;;8BAmBK;IAE5B,aAAa,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;kBA0BC;IAEhB,uBAAuB,EAAE;;;;;;;;;;;;;;;;;;;;;oEAqByC;CACnE,CAAC;AAEF,gFAAgF;AAChF,qCAAqC;AACrC,gFAAgF;AAEhF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,MAAM,EAAE;YACN,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qCAAqC,EAAE;oBAC5E,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uCAAuC,EAAE;oBACrF,UAAU,EAAE;wBACV,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,CAAC;wBAC1E,WAAW,EAAE,wBAAwB;qBACt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AC;QACnB,MAAM,IAAI,iBAAiB,OAAO,CAAC,KAAK,IAAI,CAAC;IAC/C,CAAC;IACD,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC;QACpB,MAAM,IAAI,WAAW,OAAO,CAAC,MAAM,IAAI,CAAC;IAC1C,CAAC;IACD,IAAI,OAAO,EAAE,UAAU,EAAE,CAAC;QACxB,MAAM,IAAI,oBAAoB,OAAO,CAAC,UAAU,IAAI,CAAC;IACvD,CAAC;IACD,IAAI,OAAO,EAAE,OAAO,EAAE,CAAC;QACrB,MAAM,IAAI,uBAAuB,OAAO,CAAC,OAAO,IAAI,CAAC;IACvD,CAAC;IACD,IAAI,OAAO,EAAE,QAAQ,EAAE,CAAC;QACtB,MAAM,IAAI,kCAAkC,OAAO,CAAC,QAAQ,IAAI,CAAC;IACnE,CAAC;IAED,MAAM,IAAI,iCAAiC,OAAO,2BAA2B,CAAC;IAC9E,MAAM,IAAI,uCAAuC,CAAC;IAClD,MAAM,IAAI,sDAAsD,CAAC;IACjE,MAAM,IAAI,kDAAkD,CAAC;IAC7D,MAAM,IAAI,gDAAgD,CAAC;IAC3D,MAAM,IAAI,4DAA4D,CAAC;IAEvE,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * LLM provider types for skill extraction and prerequisite inference
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=llm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm.js","sourceRoot":"","sources":["../../../src/types/llm.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Anthropic adapter for LLM integration
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ import type { LLMProvider, AnthropicConfig, CompletionRequest, CompletionResponse } from '../../types/llm.js';
7
+ import { BaseLLMAdapter } from './base.js';
8
+ /**
9
+ * Anthropic adapter for Claude models
10
+ */
11
+ export declare class AnthropicAdapter extends BaseLLMAdapter {
12
+ private readonly baseUrl;
13
+ constructor(config: AnthropicConfig);
14
+ get provider(): LLMProvider;
15
+ complete(request: CompletionRequest): Promise<CompletionResponse>;
16
+ }
17
+ /**
18
+ * Create an Anthropic adapter from environment variables
19
+ */
20
+ export declare function createAnthropicAdapter(model?: string, overrides?: Partial<AnthropicConfig>): AnthropicAdapter;
21
+ //# sourceMappingURL=anthropic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../../../src/llm/adapters/anthropic.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAA4B,MAAM,WAAW,CAAC;AAiCrE;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,cAAc;IAClD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,MAAM,EAAE,eAAe;IAKnC,IAAI,QAAQ,IAAI,WAAW,CAE1B;IAEK,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAyGxE;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,SAA+B,EACpC,SAAS,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GACnC,gBAAgB,CAclB"}