learngraph 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 +21 -0
- package/README.md +25 -0
- package/dist/cjs/education/index.js +18 -0
- package/dist/cjs/education/index.js.map +1 -0
- package/dist/cjs/graph/index.js +14 -0
- package/dist/cjs/graph/index.js.map +1 -0
- package/dist/cjs/index.js +61 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/llm/index.js +12 -0
- package/dist/cjs/llm/index.js.map +1 -0
- package/dist/cjs/parsers/index.js +11 -0
- package/dist/cjs/parsers/index.js.map +1 -0
- package/dist/cjs/query/index.js +12 -0
- package/dist/cjs/query/index.js.map +1 -0
- package/dist/cjs/storage/index.js +12 -0
- package/dist/cjs/storage/index.js.map +1 -0
- package/dist/cjs/types/bloom.js +174 -0
- package/dist/cjs/types/bloom.js.map +1 -0
- package/dist/cjs/types/edge.js +42 -0
- package/dist/cjs/types/edge.js.map +1 -0
- package/dist/cjs/types/graph.js +8 -0
- package/dist/cjs/types/graph.js.map +1 -0
- package/dist/cjs/types/index.js +32 -0
- package/dist/cjs/types/index.js.map +1 -0
- package/dist/cjs/types/mastery.js +31 -0
- package/dist/cjs/types/mastery.js.map +1 -0
- package/dist/cjs/types/query.js +3 -0
- package/dist/cjs/types/query.js.map +1 -0
- package/dist/cjs/types/skill.js +38 -0
- package/dist/cjs/types/skill.js.map +1 -0
- package/dist/cjs/types/storage.js +3 -0
- package/dist/cjs/types/storage.js.map +1 -0
- package/dist/esm/education/index.js +12 -0
- package/dist/esm/education/index.js.map +1 -0
- package/dist/esm/graph/index.js +10 -0
- package/dist/esm/graph/index.js.map +1 -0
- package/dist/esm/index.js +44 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/llm/index.js +12 -0
- package/dist/esm/llm/index.js.map +1 -0
- package/dist/esm/parsers/index.js +11 -0
- package/dist/esm/parsers/index.js.map +1 -0
- package/dist/esm/query/index.js +11 -0
- package/dist/esm/query/index.js.map +1 -0
- package/dist/esm/storage/index.js +11 -0
- package/dist/esm/storage/index.js.map +1 -0
- package/dist/esm/types/bloom.js +168 -0
- package/dist/esm/types/bloom.js.map +1 -0
- package/dist/esm/types/edge.js +36 -0
- package/dist/esm/types/edge.js.map +1 -0
- package/dist/esm/types/graph.js +5 -0
- package/dist/esm/types/graph.js.map +1 -0
- package/dist/esm/types/index.js +11 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/esm/types/mastery.js +26 -0
- package/dist/esm/types/mastery.js.map +1 -0
- package/dist/esm/types/query.js +2 -0
- package/dist/esm/types/query.js.map +1 -0
- package/dist/esm/types/skill.js +32 -0
- package/dist/esm/types/skill.js.map +1 -0
- package/dist/esm/types/storage.js +2 -0
- package/dist/esm/types/storage.js.map +1 -0
- package/dist/types/education/index.d.ts +8 -0
- package/dist/types/education/index.d.ts.map +1 -0
- package/dist/types/graph/index.d.ts +8 -0
- package/dist/types/graph/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +38 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/llm/index.d.ts +6 -0
- package/dist/types/llm/index.d.ts.map +1 -0
- package/dist/types/parsers/index.d.ts +6 -0
- package/dist/types/parsers/index.d.ts.map +1 -0
- package/dist/types/query/index.d.ts +7 -0
- package/dist/types/query/index.d.ts.map +1 -0
- package/dist/types/storage/index.d.ts +7 -0
- package/dist/types/storage/index.d.ts.map +1 -0
- package/dist/types/types/bloom.d.ts +33 -0
- package/dist/types/types/bloom.d.ts.map +1 -0
- package/dist/types/types/edge.d.ts +80 -0
- package/dist/types/types/edge.d.ts.map +1 -0
- package/dist/types/types/graph.d.ts +99 -0
- package/dist/types/types/graph.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +18 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/mastery.d.ts +89 -0
- package/dist/types/types/mastery.d.ts.map +1 -0
- package/dist/types/types/query.d.ts +155 -0
- package/dist/types/types/query.d.ts.map +1 -0
- package/dist/types/types/skill.d.ts +107 -0
- package/dist/types/types/skill.d.ts.map +1 -0
- package/dist/types/types/storage.d.ts +214 -0
- package/dist/types/types/storage.d.ts.map +1 -0
- package/package.json +149 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LearnGraph (jali) - AI-powered educational knowledge graph infrastructure
|
|
3
|
+
*
|
|
4
|
+
* Decompose curricula into skill graphs with learning science built in.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { createSkillId, type SkillNode, type GraphStorage } from 'learngraph';
|
|
9
|
+
*
|
|
10
|
+
* // Define a skill
|
|
11
|
+
* const skill: SkillNode = {
|
|
12
|
+
* id: createSkillId('add-fractions'),
|
|
13
|
+
* name: 'Add Fractions',
|
|
14
|
+
* description: 'Add fractions with like and unlike denominators',
|
|
15
|
+
* bloomLevel: 'apply',
|
|
16
|
+
* difficulty: 0.4,
|
|
17
|
+
* isThresholdConcept: false,
|
|
18
|
+
* masteryThreshold: 0.8,
|
|
19
|
+
* estimatedMinutes: 30,
|
|
20
|
+
* tags: ['mathematics', 'fractions'],
|
|
21
|
+
* metadata: {},
|
|
22
|
+
* createdAt: new Date().toISOString(),
|
|
23
|
+
* updatedAt: new Date().toISOString(),
|
|
24
|
+
* };
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @packageDocumentation
|
|
28
|
+
*/
|
|
29
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
30
|
+
// Core Types
|
|
31
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
32
|
+
export * from './types/index.js';
|
|
33
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
34
|
+
// Package Metadata
|
|
35
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
36
|
+
/**
|
|
37
|
+
* Package version
|
|
38
|
+
*/
|
|
39
|
+
export const VERSION = '0.1.0';
|
|
40
|
+
/**
|
|
41
|
+
* Package name
|
|
42
|
+
*/
|
|
43
|
+
export const PACKAGE_NAME = 'learngraph';
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,gFAAgF;AAChF,aAAa;AACb,gFAAgF;AAChF,cAAc,kBAAkB,CAAC;AAEjC,gFAAgF;AAChF,mBAAmB;AACnB,gFAAgF;AAEhF;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAE/B;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* LLM integration for skill extraction and prerequisite inference
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
// LLM integration will be implemented in Phase 4
|
|
8
|
+
// export { LLMOrchestrator } from './orchestrator.js';
|
|
9
|
+
// export { OpenAIAdapter } from './adapters/openai.js';
|
|
10
|
+
// export { AnthropicAdapter } from './adapters/anthropic.js';
|
|
11
|
+
// export { OllamaAdapter } from './adapters/ollama.js';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/llm/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,iDAAiD;AACjD,uDAAuD;AACvD,wDAAwD;AACxD,8DAA8D;AAC9D,wDAAwD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Content parsers for educational materials
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
// Parsers will be implemented in Phase 3
|
|
8
|
+
// export { SyllabusParser } from './syllabus.js';
|
|
9
|
+
// export { ChapterParser } from './chapter.js';
|
|
10
|
+
// export { ObjectiveParser } from './objective.js';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/parsers/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,yCAAyC;AACzC,kDAAkD;AAClD,gDAAgD;AAChD,oDAAoD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Query and traversal engines
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
export {};
|
|
7
|
+
// Query engines will be implemented in Phase 6
|
|
8
|
+
// export { ZPDCalculator } from './zpd.js';
|
|
9
|
+
// export { PathGenerator } from './path.js';
|
|
10
|
+
// export { SkillQueryBuilder } from './builder.js';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/query/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAmBH,+CAA+C;AAC/C,4CAA4C;AAC5C,6CAA6C;AAC7C,oDAAoD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graph storage adapters
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
export {};
|
|
7
|
+
// Storage adapters will be implemented in Phase 2
|
|
8
|
+
// export { Neo4jStorage } from './neo4j.js';
|
|
9
|
+
// export { LevelGraphStorage } from './levelgraph.js';
|
|
10
|
+
// export { MemoryStorage } from './memory.js';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/storage/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAeH,kDAAkD;AAClD,6CAA6C;AAC7C,uDAAuD;AACvD,+CAA+C"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Numeric mapping for Bloom's levels (1-6 scale)
|
|
3
|
+
*/
|
|
4
|
+
export const BLOOM_LEVEL_ORDER = {
|
|
5
|
+
remember: 1,
|
|
6
|
+
understand: 2,
|
|
7
|
+
apply: 3,
|
|
8
|
+
analyze: 4,
|
|
9
|
+
evaluate: 5,
|
|
10
|
+
create: 6,
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Bloom's taxonomy action verbs for each level
|
|
14
|
+
* Used for automatic classification from learning objectives
|
|
15
|
+
*/
|
|
16
|
+
export const BLOOM_VERBS = {
|
|
17
|
+
remember: [
|
|
18
|
+
'define',
|
|
19
|
+
'describe',
|
|
20
|
+
'identify',
|
|
21
|
+
'label',
|
|
22
|
+
'list',
|
|
23
|
+
'match',
|
|
24
|
+
'name',
|
|
25
|
+
'outline',
|
|
26
|
+
'recall',
|
|
27
|
+
'recognize',
|
|
28
|
+
'reproduce',
|
|
29
|
+
'select',
|
|
30
|
+
'state',
|
|
31
|
+
'memorize',
|
|
32
|
+
'repeat',
|
|
33
|
+
],
|
|
34
|
+
understand: [
|
|
35
|
+
'classify',
|
|
36
|
+
'compare',
|
|
37
|
+
'contrast',
|
|
38
|
+
'demonstrate',
|
|
39
|
+
'explain',
|
|
40
|
+
'extend',
|
|
41
|
+
'illustrate',
|
|
42
|
+
'infer',
|
|
43
|
+
'interpret',
|
|
44
|
+
'paraphrase',
|
|
45
|
+
'predict',
|
|
46
|
+
'summarize',
|
|
47
|
+
'translate',
|
|
48
|
+
'discuss',
|
|
49
|
+
'distinguish',
|
|
50
|
+
],
|
|
51
|
+
apply: [
|
|
52
|
+
'apply',
|
|
53
|
+
'calculate',
|
|
54
|
+
'change',
|
|
55
|
+
'complete',
|
|
56
|
+
'compute',
|
|
57
|
+
'construct',
|
|
58
|
+
'demonstrate',
|
|
59
|
+
'discover',
|
|
60
|
+
'manipulate',
|
|
61
|
+
'modify',
|
|
62
|
+
'operate',
|
|
63
|
+
'predict',
|
|
64
|
+
'prepare',
|
|
65
|
+
'produce',
|
|
66
|
+
'solve',
|
|
67
|
+
'use',
|
|
68
|
+
'implement',
|
|
69
|
+
'execute',
|
|
70
|
+
],
|
|
71
|
+
analyze: [
|
|
72
|
+
'analyze',
|
|
73
|
+
'break down',
|
|
74
|
+
'categorize',
|
|
75
|
+
'compare',
|
|
76
|
+
'contrast',
|
|
77
|
+
'deconstruct',
|
|
78
|
+
'differentiate',
|
|
79
|
+
'discriminate',
|
|
80
|
+
'distinguish',
|
|
81
|
+
'examine',
|
|
82
|
+
'experiment',
|
|
83
|
+
'identify',
|
|
84
|
+
'infer',
|
|
85
|
+
'organize',
|
|
86
|
+
'test',
|
|
87
|
+
'investigate',
|
|
88
|
+
],
|
|
89
|
+
evaluate: [
|
|
90
|
+
'appraise',
|
|
91
|
+
'argue',
|
|
92
|
+
'assess',
|
|
93
|
+
'choose',
|
|
94
|
+
'conclude',
|
|
95
|
+
'critique',
|
|
96
|
+
'decide',
|
|
97
|
+
'defend',
|
|
98
|
+
'evaluate',
|
|
99
|
+
'judge',
|
|
100
|
+
'justify',
|
|
101
|
+
'prioritize',
|
|
102
|
+
'rank',
|
|
103
|
+
'rate',
|
|
104
|
+
'recommend',
|
|
105
|
+
'support',
|
|
106
|
+
'value',
|
|
107
|
+
],
|
|
108
|
+
create: [
|
|
109
|
+
'assemble',
|
|
110
|
+
'compose',
|
|
111
|
+
'construct',
|
|
112
|
+
'create',
|
|
113
|
+
'design',
|
|
114
|
+
'develop',
|
|
115
|
+
'devise',
|
|
116
|
+
'formulate',
|
|
117
|
+
'generate',
|
|
118
|
+
'hypothesize',
|
|
119
|
+
'invent',
|
|
120
|
+
'plan',
|
|
121
|
+
'produce',
|
|
122
|
+
'write',
|
|
123
|
+
'synthesize',
|
|
124
|
+
'integrate',
|
|
125
|
+
],
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* Detect Bloom's level from text (typically a learning objective)
|
|
129
|
+
* Returns the first matching level based on verb detection
|
|
130
|
+
*/
|
|
131
|
+
export function detectBloomLevel(text) {
|
|
132
|
+
const lowerText = text.toLowerCase().trim();
|
|
133
|
+
// Check each level from highest to lowest (prefer higher classification)
|
|
134
|
+
const levels = [
|
|
135
|
+
'create',
|
|
136
|
+
'evaluate',
|
|
137
|
+
'analyze',
|
|
138
|
+
'apply',
|
|
139
|
+
'understand',
|
|
140
|
+
'remember',
|
|
141
|
+
];
|
|
142
|
+
for (const level of levels) {
|
|
143
|
+
const verbs = BLOOM_VERBS[level];
|
|
144
|
+
for (const verb of verbs) {
|
|
145
|
+
// Check if text starts with verb or contains "to {verb}"
|
|
146
|
+
if (lowerText.startsWith(verb) ||
|
|
147
|
+
lowerText.startsWith(`to ${verb}`) ||
|
|
148
|
+
lowerText.includes(` ${verb} `)) {
|
|
149
|
+
return level;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Compare two Bloom's levels
|
|
157
|
+
* Returns negative if a < b, positive if a > b, 0 if equal
|
|
158
|
+
*/
|
|
159
|
+
export function compareBloomLevels(a, b) {
|
|
160
|
+
return BLOOM_LEVEL_ORDER[a] - BLOOM_LEVEL_ORDER[b];
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Check if a Bloom's level meets a minimum threshold
|
|
164
|
+
*/
|
|
165
|
+
export function meetsBloomThreshold(level, minimum) {
|
|
166
|
+
return BLOOM_LEVEL_ORDER[level] >= BLOOM_LEVEL_ORDER[minimum];
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=bloom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bloom.js","sourceRoot":"","sources":["../../../src/types/bloom.ts"],"names":[],"mappings":"AAgBA;;GAEG;AACH,MAAM,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
|
|
1
|
+
/**
|
|
2
|
+
* Create a typed EdgeId from a string
|
|
3
|
+
*/
|
|
4
|
+
export function createEdgeId(id) {
|
|
5
|
+
return id;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Default edge strength thresholds
|
|
9
|
+
*/
|
|
10
|
+
export const EDGE_STRENGTH_THRESHOLDS = {
|
|
11
|
+
/** Minimum strength to be considered a meaningful dependency */
|
|
12
|
+
minimum: 0.3,
|
|
13
|
+
/** Strength threshold for "hard" prerequisites */
|
|
14
|
+
hard: 0.8,
|
|
15
|
+
/** Strength threshold for "soft" prerequisites */
|
|
16
|
+
soft: 0.5,
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Validate an edge strength is in valid range
|
|
20
|
+
*/
|
|
21
|
+
export function isValidEdgeStrength(strength) {
|
|
22
|
+
return strength >= 0 && strength <= 1;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Suggest edge type based on strength
|
|
26
|
+
*/
|
|
27
|
+
export function suggestEdgeType(strength) {
|
|
28
|
+
if (strength >= EDGE_STRENGTH_THRESHOLDS.hard) {
|
|
29
|
+
return 'hard';
|
|
30
|
+
}
|
|
31
|
+
if (strength >= EDGE_STRENGTH_THRESHOLDS.soft) {
|
|
32
|
+
return 'soft';
|
|
33
|
+
}
|
|
34
|
+
return 'recommended';
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=edge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edge.js","sourceRoot":"","sources":["../../../src/types/edge.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,EAAU;IACrC,OAAO,EAAY,CAAC;AACtB,CAAC;AA6DD;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,gEAAgE;IAChE,OAAO,EAAE,GAAG;IACZ,kDAAkD;IAClD,IAAI,EAAE,GAAG;IACT,kDAAkD;IAClD,IAAI,EAAE,GAAG;CACD,CAAC;AAEX;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAAgB;IAClD,OAAO,QAAQ,IAAI,CAAC,IAAI,QAAQ,IAAI,CAAC,CAAC;AACxC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,IAAI,QAAQ,IAAI,wBAAwB,CAAC,IAAI,EAAE,CAAC;QAC9C,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,IAAI,QAAQ,IAAI,wBAAwB,CAAC,IAAI,EAAE,CAAC;QAC9C,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph.js","sourceRoot":"","sources":["../../../src/types/graph.ts"],"names":[],"mappings":"AAmIA;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core type definitions for LearnGraph (jali)
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
export { BLOOM_LEVEL_ORDER, BLOOM_VERBS, detectBloomLevel, compareBloomLevels, meetsBloomThreshold, } from './bloom.js';
|
|
7
|
+
export { createSkillId, SKILL_DEFAULTS, THRESHOLD_CONCEPT_MASTERY, isValidDifficulty, isValidMasteryThreshold, } from './skill.js';
|
|
8
|
+
export { createEdgeId, EDGE_STRENGTH_THRESHOLDS, isValidEdgeStrength, suggestEdgeType, } from './edge.js';
|
|
9
|
+
export { MASTERY_THRESHOLDS, hasMastery, masteryGap } from './mastery.js';
|
|
10
|
+
export { GRAPH_VERSION } from './graph.js';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAMpB,OAAO,EACL,aAAa,EACb,cAAc,EACd,yBAAyB,EACzB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,YAAY,CAAC;AAMpB,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,GAChB,MAAM,WAAW,CAAC;AAMnB,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAa1E,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mastery threshold values
|
|
3
|
+
*/
|
|
4
|
+
export const MASTERY_THRESHOLDS = {
|
|
5
|
+
/** Default mastery threshold for standard skills */
|
|
6
|
+
default: 0.8,
|
|
7
|
+
/** Mastery threshold for threshold concepts */
|
|
8
|
+
thresholdConcept: 0.9,
|
|
9
|
+
/** Minimum mastery to be considered "learned" */
|
|
10
|
+
minimum: 0.5,
|
|
11
|
+
/** High mastery for expert-level */
|
|
12
|
+
expert: 0.95,
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Check if mastery level meets threshold
|
|
16
|
+
*/
|
|
17
|
+
export function hasMastery(mastery, threshold = MASTERY_THRESHOLDS.default) {
|
|
18
|
+
return mastery >= threshold;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Calculate mastery gap (how much more is needed)
|
|
22
|
+
*/
|
|
23
|
+
export function masteryGap(current, threshold = MASTERY_THRESHOLDS.default) {
|
|
24
|
+
return Math.max(0, threshold - current);
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=mastery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mastery.js","sourceRoot":"","sources":["../../../src/types/mastery.ts"],"names":[],"mappings":"AAuFA;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,oDAAoD;IACpD,OAAO,EAAE,GAAG;IACZ,+CAA+C;IAC/C,gBAAgB,EAAE,GAAG;IACrB,iDAAiD;IACjD,OAAO,EAAE,GAAG;IACZ,oCAAoC;IACpC,MAAM,EAAE,IAAI;CACJ,CAAC;AAEX;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,OAAe,EAAE,YAAoB,kBAAkB,CAAC,OAAO;IACxF,OAAO,OAAO,IAAI,SAAS,CAAC;AAC9B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,OAAe,EAAE,YAAoB,kBAAkB,CAAC,OAAO;IACxF,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/types/query.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create a typed SkillId from a string
|
|
3
|
+
*/
|
|
4
|
+
export function createSkillId(id) {
|
|
5
|
+
return id;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Default values for optional skill fields
|
|
9
|
+
*/
|
|
10
|
+
export const SKILL_DEFAULTS = {
|
|
11
|
+
masteryThreshold: 0.8,
|
|
12
|
+
isThresholdConcept: false,
|
|
13
|
+
tags: [],
|
|
14
|
+
metadata: {},
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Mastery threshold for threshold concepts
|
|
18
|
+
*/
|
|
19
|
+
export const THRESHOLD_CONCEPT_MASTERY = 0.9;
|
|
20
|
+
/**
|
|
21
|
+
* Validate a difficulty value is in valid range
|
|
22
|
+
*/
|
|
23
|
+
export function isValidDifficulty(difficulty) {
|
|
24
|
+
return difficulty >= 0 && difficulty <= 1;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Validate a mastery threshold is in valid range
|
|
28
|
+
*/
|
|
29
|
+
export function isValidMasteryThreshold(threshold) {
|
|
30
|
+
return threshold >= 0 && threshold <= 1;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=skill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill.js","sourceRoot":"","sources":["../../../src/types/skill.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,EAAU;IACtC,OAAO,EAAa,CAAC;AACvB,CAAC;AAkGD;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAGvB;IACF,gBAAgB,EAAE,GAAG;IACrB,kBAAkB,EAAE,KAAK;IACzB,IAAI,EAAE,EAAE;IACR,QAAQ,EAAE,EAAE;CACJ,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAE7C;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,UAAkB;IAClD,OAAO,UAAU,IAAI,CAAC,IAAI,UAAU,IAAI,CAAC,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,SAAiB;IACvD,OAAO,SAAS,IAAI,CAAC,IAAI,SAAS,IAAI,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../../src/types/storage.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Educational psychology algorithms
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
export type { MasteryState, ResponseRecord, MasteryTrajectory } from '../types/mastery.js';
|
|
7
|
+
export { MASTERY_THRESHOLDS, hasMastery, masteryGap } from '../types/mastery.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/education/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE3F,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graph construction and validation
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
export type { Subgraph, GraphExport, GraphStats, GraphValidation, GraphValidationError, GraphValidationWarning, } from '../types/graph.js';
|
|
7
|
+
export { GRAPH_VERSION } from '../types/graph.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/graph/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EACV,QAAQ,EACR,WAAW,EACX,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LearnGraph (jali) - AI-powered educational knowledge graph infrastructure
|
|
3
|
+
*
|
|
4
|
+
* Decompose curricula into skill graphs with learning science built in.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { createSkillId, type SkillNode, type GraphStorage } from 'learngraph';
|
|
9
|
+
*
|
|
10
|
+
* // Define a skill
|
|
11
|
+
* const skill: SkillNode = {
|
|
12
|
+
* id: createSkillId('add-fractions'),
|
|
13
|
+
* name: 'Add Fractions',
|
|
14
|
+
* description: 'Add fractions with like and unlike denominators',
|
|
15
|
+
* bloomLevel: 'apply',
|
|
16
|
+
* difficulty: 0.4,
|
|
17
|
+
* isThresholdConcept: false,
|
|
18
|
+
* masteryThreshold: 0.8,
|
|
19
|
+
* estimatedMinutes: 30,
|
|
20
|
+
* tags: ['mathematics', 'fractions'],
|
|
21
|
+
* metadata: {},
|
|
22
|
+
* createdAt: new Date().toISOString(),
|
|
23
|
+
* updatedAt: new Date().toISOString(),
|
|
24
|
+
* };
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @packageDocumentation
|
|
28
|
+
*/
|
|
29
|
+
export * from './types/index.js';
|
|
30
|
+
/**
|
|
31
|
+
* Package version
|
|
32
|
+
*/
|
|
33
|
+
export declare const VERSION = "0.1.0";
|
|
34
|
+
/**
|
|
35
|
+
* Package name
|
|
36
|
+
*/
|
|
37
|
+
export declare const PACKAGE_NAME = "learngraph";
|
|
38
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAKH,cAAc,kBAAkB,CAAC;AAMjC;;GAEG;AACH,eAAO,MAAM,OAAO,UAAU,CAAC;AAE/B;;GAEG;AACH,eAAO,MAAM,YAAY,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/llm/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/parsers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Query and traversal engines
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
export type { QueryOperator, QueryFilter, QuerySort, QueryPagination, SkillQuery, ZPDResult, LearningPath, LearningSession, ReviewSchedule, ReviewItem, ZPDOptions, PathOptions, ReviewOptions, } from '../types/query.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/query/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EACV,aAAa,EACb,WAAW,EACX,SAAS,EACT,eAAe,EACf,UAAU,EACV,SAAS,EACT,YAAY,EACZ,eAAe,EACf,cAAc,EACd,UAAU,EACV,UAAU,EACV,WAAW,EACX,aAAa,GACd,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graph storage adapters
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
export type { StorageBackend, StorageConfig, Neo4jConfig, LevelGraphConfig, MemoryConfig, ConnectionStatus, ImportResult, GraphStorage, StorageFactory, } from '../types/storage.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EACV,cAAc,EACd,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,cAAc,GACf,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bloom's Taxonomy Cognitive Levels
|
|
3
|
+
*
|
|
4
|
+
* Based on Anderson & Krathwohl's revised taxonomy (2001).
|
|
5
|
+
* Ordered from lowest to highest cognitive complexity.
|
|
6
|
+
*
|
|
7
|
+
* @see https://cft.vanderbilt.edu/guides-sub-pages/blooms-taxonomy/
|
|
8
|
+
*/
|
|
9
|
+
export type BloomLevel = 'remember' | 'understand' | 'apply' | 'analyze' | 'evaluate' | 'create';
|
|
10
|
+
/**
|
|
11
|
+
* Numeric mapping for Bloom's levels (1-6 scale)
|
|
12
|
+
*/
|
|
13
|
+
export declare const BLOOM_LEVEL_ORDER: Record<BloomLevel, number>;
|
|
14
|
+
/**
|
|
15
|
+
* Bloom's taxonomy action verbs for each level
|
|
16
|
+
* Used for automatic classification from learning objectives
|
|
17
|
+
*/
|
|
18
|
+
export declare const BLOOM_VERBS: Record<BloomLevel, readonly string[]>;
|
|
19
|
+
/**
|
|
20
|
+
* Detect Bloom's level from text (typically a learning objective)
|
|
21
|
+
* Returns the first matching level based on verb detection
|
|
22
|
+
*/
|
|
23
|
+
export declare function detectBloomLevel(text: string): BloomLevel | null;
|
|
24
|
+
/**
|
|
25
|
+
* Compare two Bloom's levels
|
|
26
|
+
* Returns negative if a < b, positive if a > b, 0 if equal
|
|
27
|
+
*/
|
|
28
|
+
export declare function compareBloomLevels(a: BloomLevel, b: BloomLevel): number;
|
|
29
|
+
/**
|
|
30
|
+
* Check if a Bloom's level meets a minimum threshold
|
|
31
|
+
*/
|
|
32
|
+
export declare function meetsBloomThreshold(level: BloomLevel, minimum: BloomLevel): boolean;
|
|
33
|
+
//# sourceMappingURL=bloom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bloom.d.ts","sourceRoot":"","sources":["../../../src/types/bloom.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GAClB,UAAU,GACV,YAAY,GACZ,OAAO,GACP,SAAS,GACT,UAAU,GACV,QAAQ,CAAC;AAEb;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAO/C,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CA8GpD,CAAC;AAEX;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CA4BhE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,MAAM,CAEvE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAEnF"}
|