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,46 @@
1
+ /**
2
+ * Base adapter class for LLM providers
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ import type { LLMProvider, LLMConfig, LLMAdapter, CompletionRequest, CompletionResponse } from '../../types/llm.js';
7
+ /**
8
+ * LLM-related errors
9
+ */
10
+ export declare class LLMError extends Error {
11
+ readonly code: LLMErrorCode;
12
+ readonly provider: LLMProvider;
13
+ readonly cause?: Error | undefined;
14
+ constructor(message: string, code: LLMErrorCode, provider: LLMProvider, cause?: Error | undefined);
15
+ }
16
+ export type LLMErrorCode = 'NOT_CONFIGURED' | 'API_ERROR' | 'RATE_LIMIT' | 'INVALID_RESPONSE' | 'TIMEOUT' | 'NETWORK_ERROR' | 'PARSE_ERROR';
17
+ /**
18
+ * Default configuration values
19
+ */
20
+ export declare const DEFAULT_CONFIG: {
21
+ maxTokens: number;
22
+ temperature: number;
23
+ timeout: number;
24
+ retries: number;
25
+ };
26
+ /**
27
+ * Abstract base class for LLM adapters
28
+ */
29
+ export declare abstract class BaseLLMAdapter implements LLMAdapter {
30
+ protected config: LLMConfig;
31
+ constructor(config: LLMConfig);
32
+ abstract get provider(): LLMProvider;
33
+ get model(): string;
34
+ abstract complete(request: CompletionRequest): Promise<CompletionResponse>;
35
+ isConfigured(): boolean;
36
+ getConfig(): Omit<LLMConfig, 'apiKey'>;
37
+ /**
38
+ * Retry a function with exponential backoff
39
+ */
40
+ protected withRetry<T>(fn: () => Promise<T>, maxRetries?: number): Promise<T>;
41
+ /**
42
+ * Parse JSON from LLM response, handling common issues
43
+ */
44
+ protected parseJSON<T>(content: string): T;
45
+ }
46
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/llm/adapters/base.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,qBAAa,QAAS,SAAQ,KAAK;aAGf,IAAI,EAAE,YAAY;aAClB,QAAQ,EAAE,WAAW;aACrB,KAAK,CAAC,EAAE,KAAK;gBAH7B,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,YAAY,EAClB,QAAQ,EAAE,WAAW,EACrB,KAAK,CAAC,EAAE,KAAK,YAAA;CAKhC;AAED,MAAM,MAAM,YAAY,GACpB,gBAAgB,GAChB,WAAW,GACX,YAAY,GACZ,kBAAkB,GAClB,SAAS,GACT,eAAe,GACf,aAAa,CAAC;AAElB;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;CAK1B,CAAC;AAEF;;GAEG;AACH,8BAAsB,cAAe,YAAW,UAAU;IACxD,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC;gBAEhB,MAAM,EAAE,SAAS;IAO7B,QAAQ,KAAK,QAAQ,IAAI,WAAW,CAAC;IAErC,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAE1E,YAAY,IAAI,OAAO;IAOvB,SAAS,IAAI,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC;IAKtC;;OAEG;cACa,SAAS,CAAC,CAAC,EACzB,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,UAAU,SAAgD,GACzD,OAAO,CAAC,CAAC,CAAC;IA2Bb;;OAEG;IACH,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC;CAgB3C"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * LLM adapter exports
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ export { BaseLLMAdapter, LLMError, DEFAULT_CONFIG } from './base.js';
7
+ export type { LLMErrorCode } from './base.js';
8
+ export { OpenAIAdapter, createOpenAIAdapter } from './openai.js';
9
+ export { AnthropicAdapter, createAnthropicAdapter } from './anthropic.js';
10
+ export { OllamaAdapter, createOllamaAdapter } from './ollama.js';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/llm/adapters/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACrE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Ollama adapter for local LLM integration
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ import type { LLMProvider, OllamaConfig, CompletionRequest, CompletionResponse } from '../../types/llm.js';
7
+ import { BaseLLMAdapter } from './base.js';
8
+ /**
9
+ * Ollama adapter for local models
10
+ */
11
+ export declare class OllamaAdapter extends BaseLLMAdapter {
12
+ private readonly baseUrl;
13
+ constructor(config: OllamaConfig);
14
+ get provider(): LLMProvider;
15
+ isConfigured(): boolean;
16
+ complete(request: CompletionRequest): Promise<CompletionResponse>;
17
+ /**
18
+ * Check if Ollama is available
19
+ */
20
+ isAvailable(): Promise<boolean>;
21
+ /**
22
+ * List available models
23
+ */
24
+ listModels(): Promise<string[]>;
25
+ }
26
+ /**
27
+ * Create an Ollama adapter
28
+ */
29
+ export declare function createOllamaAdapter(model?: string, overrides?: Partial<OllamaConfig>): OllamaAdapter;
30
+ //# sourceMappingURL=ollama.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ollama.d.ts","sourceRoot":"","sources":["../../../../src/llm/adapters/ollama.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAA4B,MAAM,WAAW,CAAC;AAuBrE;;GAEG;AACH,qBAAa,aAAc,SAAQ,cAAc;IAC/C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,MAAM,EAAE,YAAY;IAKhC,IAAI,QAAQ,IAAI,WAAW,CAE1B;IAED,YAAY,IAAI,OAAO;IAIjB,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA+GvE;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAWrC;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAgBtC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,SAAa,EAClB,SAAS,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAChC,aAAa,CAOf"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * OpenAI adapter for LLM integration
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ import type { LLMProvider, OpenAIConfig, CompletionRequest, CompletionResponse } from '../../types/llm.js';
7
+ import { BaseLLMAdapter } from './base.js';
8
+ /**
9
+ * OpenAI adapter for chat completions
10
+ */
11
+ export declare class OpenAIAdapter extends BaseLLMAdapter {
12
+ private readonly baseUrl;
13
+ private readonly organization?;
14
+ constructor(config: OpenAIConfig);
15
+ get provider(): LLMProvider;
16
+ complete(request: CompletionRequest): Promise<CompletionResponse>;
17
+ }
18
+ /**
19
+ * Create an OpenAI adapter from environment variables
20
+ */
21
+ export declare function createOpenAIAdapter(model?: string, overrides?: Partial<OpenAIConfig>): OpenAIAdapter;
22
+ //# sourceMappingURL=openai.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../../../src/llm/adapters/openai.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAA4B,MAAM,WAAW,CAAC;AAuCrE;;GAEG;AACH,qBAAa,aAAc,SAAQ,cAAc;IAC/C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAS;gBAE3B,MAAM,EAAE,YAAY;IAQhC,IAAI,QAAQ,IAAI,WAAW,CAE1B;IAEK,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAuGxE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,SAAW,EAChB,SAAS,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAChC,aAAa,CAcf"}
@@ -3,4 +3,9 @@
3
3
  *
4
4
  * @packageDocumentation
5
5
  */
6
+ export type { LLMProvider, LLMConfig, OpenAIConfig, AnthropicConfig, OllamaConfig, MessageRole, ChatMessage, CompletionRequest, CompletionResponse, SkillExtractionRequest, ExtractedSkillLLM, SkillExtractionResponse, PrerequisiteInferenceRequest, InferredPrerequisite, PrerequisiteInferenceResponse, BloomAnalysisRequest, BloomAnalysisResponse, DecompositionRequest, DecompositionResponse, LLMAdapter, LLMOrchestrator as ILLMOrchestrator, } from '../types/llm.js';
7
+ export { BaseLLMAdapter, LLMError, DEFAULT_CONFIG, OpenAIAdapter, createOpenAIAdapter, AnthropicAdapter, createAnthropicAdapter, OllamaAdapter, createOllamaAdapter, } from './adapters/index.js';
8
+ export type { LLMErrorCode } from './adapters/index.js';
9
+ export { LLMOrchestrator, createOrchestrator } from './orchestrator.js';
10
+ export { SYSTEM_PROMPTS, EXTRACTION_SCHEMA, PREREQUISITE_SCHEMA, BLOOM_ANALYSIS_SCHEMA, DECOMPOSITION_SCHEMA, buildExtractionPrompt, buildPrerequisitePrompt, buildBloomPrompt, buildDecompositionPrompt, } from './prompts.js';
6
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/llm/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/llm/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,YAAY,EACV,WAAW,EACX,SAAS,EACT,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,uBAAuB,EACvB,4BAA4B,EAC5B,oBAAoB,EACpB,6BAA6B,EAC7B,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,UAAU,EACV,eAAe,IAAI,gBAAgB,GACpC,MAAM,iBAAiB,CAAC;AAKzB,OAAO,EACL,cAAc,EACd,QAAQ,EACR,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,aAAa,EACb,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAKxD,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAKxE,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,cAAc,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * LLM orchestrator for educational tasks
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ import type { LLMAdapter, LLMOrchestrator as ILLMOrchestrator, SkillExtractionRequest, SkillExtractionResponse, PrerequisiteInferenceRequest, PrerequisiteInferenceResponse, BloomAnalysisRequest, BloomAnalysisResponse, DecompositionRequest, DecompositionResponse } from '../types/llm.js';
7
+ /**
8
+ * High-level orchestrator for LLM-based educational tasks
9
+ */
10
+ export declare class LLMOrchestrator implements ILLMOrchestrator {
11
+ private readonly adapter;
12
+ constructor(adapter: LLMAdapter);
13
+ getAdapter(): LLMAdapter;
14
+ /**
15
+ * Extract skills from curriculum content
16
+ */
17
+ extractSkills(request: SkillExtractionRequest): Promise<SkillExtractionResponse>;
18
+ /**
19
+ * Infer prerequisites between skills
20
+ */
21
+ inferPrerequisites(request: PrerequisiteInferenceRequest): Promise<PrerequisiteInferenceResponse>;
22
+ /**
23
+ * Analyze Bloom's level of text
24
+ */
25
+ analyzeBloomLevel(request: BloomAnalysisRequest): Promise<BloomAnalysisResponse>;
26
+ /**
27
+ * Full curriculum decomposition into skill graph
28
+ */
29
+ decompose(request: DecompositionRequest): Promise<DecompositionResponse>;
30
+ }
31
+ /**
32
+ * Create an orchestrator with a specific adapter
33
+ */
34
+ export declare function createOrchestrator(adapter: LLMAdapter): LLMOrchestrator;
35
+ //# sourceMappingURL=orchestrator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../../src/llm/orchestrator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,eAAe,IAAI,gBAAgB,EACnC,sBAAsB,EACtB,uBAAuB,EACvB,4BAA4B,EAC5B,6BAA6B,EAC7B,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EAItB,MAAM,iBAAiB,CAAC;AA+BzB;;GAEG;AACH,qBAAa,eAAgB,YAAW,gBAAgB;IAC1C,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,UAAU;IAEhD,UAAU,IAAI,UAAU;IAIxB;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAqDtF;;OAEG;IACG,kBAAkB,CACtB,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,6BAA6B,CAAC;IAuCzC;;OAEG;IACG,iBAAiB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IA4BtF;;OAEG;IACG,SAAS,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAkF/E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,UAAU,GAAG,eAAe,CAEvE"}
@@ -0,0 +1,269 @@
1
+ /**
2
+ * Prompts for LLM-based educational tasks
3
+ *
4
+ * @packageDocumentation
5
+ */
6
+ import type { BloomLevel } from '../types/bloom.js';
7
+ export declare const SYSTEM_PROMPTS: {
8
+ skillExtraction: string;
9
+ prerequisiteInference: string;
10
+ bloomAnalysis: string;
11
+ curriculumDecomposition: string;
12
+ };
13
+ export declare const EXTRACTION_SCHEMA: {
14
+ type: string;
15
+ properties: {
16
+ skills: {
17
+ type: string;
18
+ items: {
19
+ type: string;
20
+ properties: {
21
+ name: {
22
+ type: string;
23
+ description: string;
24
+ };
25
+ description: {
26
+ type: string;
27
+ description: string;
28
+ };
29
+ bloomLevel: {
30
+ type: string;
31
+ enum: string[];
32
+ description: string;
33
+ };
34
+ difficulty: {
35
+ type: string;
36
+ minimum: number;
37
+ maximum: number;
38
+ description: string;
39
+ };
40
+ confidence: {
41
+ type: string;
42
+ minimum: number;
43
+ maximum: number;
44
+ description: string;
45
+ };
46
+ isThresholdConcept: {
47
+ type: string;
48
+ description: string;
49
+ };
50
+ estimatedMinutes: {
51
+ type: string;
52
+ description: string;
53
+ };
54
+ keywords: {
55
+ type: string;
56
+ items: {
57
+ type: string;
58
+ };
59
+ description: string;
60
+ };
61
+ reasoning: {
62
+ type: string;
63
+ description: string;
64
+ };
65
+ };
66
+ required: string[];
67
+ };
68
+ };
69
+ warnings: {
70
+ type: string;
71
+ items: {
72
+ type: string;
73
+ };
74
+ description: string;
75
+ };
76
+ };
77
+ required: string[];
78
+ };
79
+ export declare const PREREQUISITE_SCHEMA: {
80
+ type: string;
81
+ properties: {
82
+ prerequisites: {
83
+ type: string;
84
+ items: {
85
+ type: string;
86
+ properties: {
87
+ sourceId: {
88
+ type: string;
89
+ description: string;
90
+ };
91
+ targetId: {
92
+ type: string;
93
+ description: string;
94
+ };
95
+ strength: {
96
+ type: string;
97
+ minimum: number;
98
+ maximum: number;
99
+ description: string;
100
+ };
101
+ type: {
102
+ type: string;
103
+ enum: string[];
104
+ description: string;
105
+ };
106
+ confidence: {
107
+ type: string;
108
+ minimum: number;
109
+ maximum: number;
110
+ description: string;
111
+ };
112
+ reasoning: {
113
+ type: string;
114
+ description: string;
115
+ };
116
+ };
117
+ required: string[];
118
+ };
119
+ };
120
+ };
121
+ required: string[];
122
+ };
123
+ export declare const BLOOM_ANALYSIS_SCHEMA: {
124
+ type: string;
125
+ properties: {
126
+ level: {
127
+ type: string;
128
+ enum: string[];
129
+ description: string;
130
+ };
131
+ confidence: {
132
+ type: string;
133
+ minimum: number;
134
+ maximum: number;
135
+ description: string;
136
+ };
137
+ indicators: {
138
+ type: string;
139
+ items: {
140
+ type: string;
141
+ };
142
+ description: string;
143
+ };
144
+ reasoning: {
145
+ type: string;
146
+ description: string;
147
+ };
148
+ };
149
+ required: string[];
150
+ };
151
+ export declare const DECOMPOSITION_SCHEMA: {
152
+ type: string;
153
+ properties: {
154
+ title: {
155
+ type: string;
156
+ description: string;
157
+ };
158
+ skills: {
159
+ type: string;
160
+ items: {
161
+ type: string;
162
+ properties: {
163
+ id: {
164
+ type: string;
165
+ description: string;
166
+ };
167
+ name: {
168
+ type: string;
169
+ };
170
+ description: {
171
+ type: string;
172
+ };
173
+ bloomLevel: {
174
+ type: string;
175
+ enum: string[];
176
+ };
177
+ difficulty: {
178
+ type: string;
179
+ minimum: number;
180
+ maximum: number;
181
+ };
182
+ isThresholdConcept: {
183
+ type: string;
184
+ };
185
+ estimatedMinutes: {
186
+ type: string;
187
+ };
188
+ keywords: {
189
+ type: string;
190
+ items: {
191
+ type: string;
192
+ };
193
+ };
194
+ };
195
+ required: string[];
196
+ };
197
+ };
198
+ prerequisites: {
199
+ type: string;
200
+ items: {
201
+ type: string;
202
+ properties: {
203
+ sourceId: {
204
+ type: string;
205
+ };
206
+ targetId: {
207
+ type: string;
208
+ };
209
+ strength: {
210
+ type: string;
211
+ minimum: number;
212
+ maximum: number;
213
+ };
214
+ type: {
215
+ type: string;
216
+ enum: string[];
217
+ };
218
+ reasoning: {
219
+ type: string;
220
+ };
221
+ };
222
+ required: string[];
223
+ };
224
+ };
225
+ warnings: {
226
+ type: string;
227
+ items: {
228
+ type: string;
229
+ };
230
+ };
231
+ };
232
+ required: string[];
233
+ };
234
+ /**
235
+ * Build a skill extraction prompt
236
+ */
237
+ export declare function buildExtractionPrompt(content: string, options?: {
238
+ domain?: string;
239
+ gradeLevel?: string;
240
+ context?: string;
241
+ }): string;
242
+ /**
243
+ * Build a prerequisite inference prompt
244
+ */
245
+ export declare function buildPrerequisitePrompt(skills: Array<{
246
+ id: string;
247
+ name: string;
248
+ description: string;
249
+ bloomLevel: BloomLevel;
250
+ difficulty: number;
251
+ }>, options?: {
252
+ domain?: string;
253
+ inferTransitive?: boolean;
254
+ }): string;
255
+ /**
256
+ * Build a Bloom's analysis prompt
257
+ */
258
+ export declare function buildBloomPrompt(text: string, context?: string): string;
259
+ /**
260
+ * Build a curriculum decomposition prompt
261
+ */
262
+ export declare function buildDecompositionPrompt(content: string, options?: {
263
+ title?: string;
264
+ domain?: string;
265
+ gradeLevel?: string;
266
+ context?: string;
267
+ maxDepth?: number;
268
+ }): string;
269
+ //# sourceMappingURL=prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/llm/prompts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAMpD,eAAO,MAAM,cAAc;;;;;CAkG1B,CAAC;AAMF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuD7B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqC/B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBjC,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4ChC,CAAC;AAMF;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;IACR,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GACA,MAAM,CAiBR;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,KAAK,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,EACF,OAAO,CAAC,EAAE;IACR,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GACA,MAAM,CA2BR;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAWvE;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;IACR,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GACA,MAAM,CA2BR"}
@@ -16,4 +16,5 @@ export { GRAPH_VERSION } from './graph.js';
16
16
  export type { QueryOperator, QueryFilter, QuerySort, QueryPagination, SkillQuery, ZPDResult, LearningPath, LearningSession, ReviewSchedule, ReviewItem, ZPDOptions, PathOptions, ReviewOptions, } from './query.js';
17
17
  export type { StorageBackend, StorageConfigBase, Neo4jConfig, LevelGraphConfig, MemoryConfig, StorageConfig, ConnectionStatus, ImportResult, GraphStorage, StorageFactory, } from './storage.js';
18
18
  export type { ParseFormat, DocumentMetadata, LearningObjective, Topic, Module, ParseResult, ParseWarning, ParseStats, ExtractedSkill, SkillExtractionResult, ParseOptions, ExtractionOptions, Parser, SkillExtractor, } from './parser.js';
19
+ export type { LLMProvider, LLMConfig, OpenAIConfig, AnthropicConfig, OllamaConfig, MessageRole, ChatMessage, CompletionRequest, CompletionResponse, SkillExtractionRequest, ExtractedSkillLLM, SkillExtractionResponse, PrerequisiteInferenceRequest, InferredPrerequisite, PrerequisiteInferenceResponse, BloomAnalysisRequest, BloomAnalysisResponse, DecompositionRequest, DecompositionResponse, LLMAdapter, LLMOrchestrator, } from './llm.js';
19
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAKpB,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,EACL,aAAa,EACb,cAAc,EACd,yBAAyB,EACzB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,YAAY,CAAC;AAKpB,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAC3F,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,GAChB,MAAM,WAAW,CAAC;AAKnB,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1E,YAAY,EACV,QAAQ,EACR,WAAW,EACX,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAK3C,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,YAAY,CAAC;AAKpB,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,cAAc,GACf,MAAM,cAAc,CAAC;AAKtB,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,EACL,MAAM,EACN,WAAW,EACX,YAAY,EACZ,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,YAAY,EACZ,iBAAiB,EACjB,MAAM,EACN,cAAc,GACf,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAKpB,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,EACL,aAAa,EACb,cAAc,EACd,yBAAyB,EACzB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,YAAY,CAAC;AAKpB,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAC3F,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,GAChB,MAAM,WAAW,CAAC;AAKnB,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1E,YAAY,EACV,QAAQ,EACR,WAAW,EACX,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAK3C,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,YAAY,CAAC;AAKpB,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,cAAc,GACf,MAAM,cAAc,CAAC;AAKtB,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,EACL,MAAM,EACN,WAAW,EACX,YAAY,EACZ,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,YAAY,EACZ,iBAAiB,EACjB,MAAM,EACN,cAAc,GACf,MAAM,aAAa,CAAC;AAKrB,YAAY,EACV,WAAW,EACX,SAAS,EACT,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,uBAAuB,EACvB,4BAA4B,EAC5B,oBAAoB,EACpB,6BAA6B,EAC7B,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,UAAU,EACV,eAAe,GAChB,MAAM,UAAU,CAAC"}