@thanh01.pmt/curriculum-kit 1.0.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/README.md +22 -0
- package/dist/ai/index.cjs +4980 -0
- package/dist/ai/index.cjs.map +1 -0
- package/dist/ai/index.d.cts +1287 -0
- package/dist/ai/index.d.ts +1287 -0
- package/dist/ai/index.mjs +4924 -0
- package/dist/ai/index.mjs.map +1 -0
- package/dist/index.cjs +15308 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +747 -0
- package/dist/index.d.ts +747 -0
- package/dist/index.mjs +14965 -0
- package/dist/index.mjs.map +1 -0
- package/dist/media/index.cjs +1238 -0
- package/dist/media/index.cjs.map +1 -0
- package/dist/media/index.d.cts +254 -0
- package/dist/media/index.d.ts +254 -0
- package/dist/media/index.mjs +1221 -0
- package/dist/media/index.mjs.map +1 -0
- package/dist/milestoneBundleGenerator-CbXhs1CP.d.ts +62 -0
- package/dist/milestoneBundleGenerator-DrBtHzBO.d.cts +62 -0
- package/dist/pipeline/index.cjs +4894 -0
- package/dist/pipeline/index.cjs.map +1 -0
- package/dist/pipeline/index.d.cts +161 -0
- package/dist/pipeline/index.d.ts +161 -0
- package/dist/pipeline/index.mjs +4869 -0
- package/dist/pipeline/index.mjs.map +1 -0
- package/dist/provider-factory-DH3udYlN.d.cts +25 -0
- package/dist/provider-factory-DH3udYlN.d.ts +25 -0
- package/dist/publishers/index.cjs +575 -0
- package/dist/publishers/index.cjs.map +1 -0
- package/dist/publishers/index.d.cts +85 -0
- package/dist/publishers/index.d.ts +85 -0
- package/dist/publishers/index.mjs +561 -0
- package/dist/publishers/index.mjs.map +1 -0
- package/dist/schemas/index.cjs +1640 -0
- package/dist/schemas/index.cjs.map +1 -0
- package/dist/schemas/index.d.cts +14194 -0
- package/dist/schemas/index.d.ts +14194 -0
- package/dist/schemas/index.mjs +1517 -0
- package/dist/schemas/index.mjs.map +1 -0
- package/dist/standards/index.cjs +910 -0
- package/dist/standards/index.cjs.map +1 -0
- package/dist/standards/index.d.cts +130 -0
- package/dist/standards/index.d.ts +130 -0
- package/dist/standards/index.mjs +890 -0
- package/dist/standards/index.mjs.map +1 -0
- package/dist/standardsCoverageGate-BWAkXY76.d.cts +767 -0
- package/dist/standardsCoverageGate-BWAkXY76.d.ts +767 -0
- package/dist/storage/index.cjs +595 -0
- package/dist/storage/index.cjs.map +1 -0
- package/dist/storage/index.d.cts +77 -0
- package/dist/storage/index.d.ts +77 -0
- package/dist/storage/index.mjs +583 -0
- package/dist/storage/index.mjs.map +1 -0
- package/dist/streamRunner-C7j5LKon.d.cts +60 -0
- package/dist/streamRunner-C7j5LKon.d.ts +60 -0
- package/dist/supabasePublisher-C627qXFT.d.cts +63 -0
- package/dist/supabasePublisher-C627qXFT.d.ts +63 -0
- package/dist/types-BUJGYiep.d.cts +89 -0
- package/dist/types-BUJGYiep.d.ts +89 -0
- package/dist/workflow/index.cjs +5266 -0
- package/dist/workflow/index.cjs.map +1 -0
- package/dist/workflow/index.d.cts +295 -0
- package/dist/workflow/index.d.ts +295 -0
- package/dist/workflow/index.mjs +5216 -0
- package/dist/workflow/index.mjs.map +1 -0
- package/package.json +105 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,747 @@
|
|
|
1
|
+
import { PlanConstraints, TranslationPolicy, CurriculumPlan, PlanningGraph, PlanningNode, DependencyEdge, LessonPlan, DiagnosticQuizInput, ActivityLab, SlideDeck, CodeLab, DiagnosticQuiz } from './schemas/index.js';
|
|
2
|
+
export { ActiveLearningWorkflow, ActiveLearningWorkflowSchema, ActivityLabSchema, ActivitySeqRow, ActivitySeqRowSchema, ActivityStepSchema, ArtifactContractRowSchema, AssessmentMapRowSchema, AssessmentObjective, AssessmentObjectiveSchema, BellRinger, BellRingerDay, BellRingerDaySchema, BellRingerInput, BellRingerSchema, BloomLevel, BloomLevelSchema, BronzeTier, BronzeTierSchema, CERConclusion, CERConclusionSchema, CardTierEnum, ChoiceBoard, ChoiceBoardInput, ChoiceBoardRubricRowSchema, ChoiceBoardSchema, ChoiceRuleSchema, ChoiceSquare, ChoiceSquareSchema, CodeLabSchema, CodeSnippet, CodeSnippetSchema, CompetencyRubricRow, CompetencyRubricRowSchema, ComputationalThinking, ComputationalThinkingSchema, CoreConcept, CoreConceptSchema, CourseObjective, CourseObjectiveSchema, CoverageReport, CoverageReportSchema, CurriculumArtifact, CurriculumArtifactSchema, CurriculumPlanSchema, CurriculumQualityReport, CurriculumQualityReportSchema, DependencyEdgeSchema, DepthAssignment, DepthAssignmentSchema, DepthLevel, DepthLevelSchema, DiagnosticQuestion, DiagnosticQuestionInput, DiagnosticQuestionSchema, DiagnosticQuizSchema, EDPPhaseEnum, EntryLevelSchema, ExitTicket, ExitTicketBugHunt, ExitTicketBugHuntSchema, ExitTicketMetacognitionSchema, ExitTicketQuickItemSchema, ExitTicketRecallPromptSchema, ExitTicketSchema, ExperimentalDesignSchema, Extension, ExtensionChallengeSchema, ExtensionSchema, FiveEFlowPhaseSchema, FiveEPhaseEnum, Glossary, GlossaryInput, GlossaryQuickRefRowSchema, GlossarySchema, GlossaryTerm, GlossaryTermSchema, GoldTier, GoldTierSchema, GraphicOrganizer, GraphicOrganizerInput, GraphicOrganizerItem, GraphicOrganizerItemSchema, GraphicOrganizerSchema, Handout, HandoutSchema, HandoutSection, HandoutSectionSchema, InstructionSection, InstructionSectionSchema, InstructionStep, InstructionStepSchema, JudgeCriterionSchema, LabTierTask, LabTierTaskSchema, LearningObjectiveInput, LearningObjectiveInputSchema, LearningObjectiveRow, LearningObjectiveRowSchema, LessonFlowPhase, LessonFlowPhaseSchema, LessonPlan5E, LessonPlan5ESchema, LessonPlanEDP, LessonPlanEDPSchema, LessonPlanSchema, LessonSectionSchema, MarpSlide, MarpSlideSchema, MentorCheatsheetSchema, MilestoneInput, MilestoneInputSchema, Misconception, MisconceptionSchema, NodeKindSchema, OrganizerTypeEnum, PhaseInput, PhaseInputSchema, PlanConstraintsSchema, PlannerInput, PlannerInputSchema, PlanningGraphSchema, PlanningNodeSchema, PlanningPhase, PrerequisiteDecision, PrerequisiteDecisionEntry, PrerequisiteDecisionEntrySchema, PrerequisiteDecisionSchema, ProductGoalSchema, ProgressiveHints, ProgressiveHintsSchema, ProjectGraph, ProjectGraphSchema, ProjectInstruction, ProjectInstructionSchema, ProjectProfile, ProjectProfileSchema, ProjectRoadmap, QualityAuditVerdictSchema, QuizOption, QuizOptionSchema, ResourceMapRowSchema, ReviewGame, ReviewGameExportRowSchema, ReviewGameInput, ReviewGameQuestion, ReviewGameQuestionSchema, ReviewGameSchema, RoadmapInput, RoadmapInputSchema, RotationStation, RotationStationSchema, Rubric, RubricCriteria, RubricCriteriaSchema, RubricSchema, ScaffoldDecision, ScaffoldDecisionEntry, ScaffoldDecisionEntrySchema, ScaffoldDecisionSchema, ScienceLab, ScienceLabInput, ScienceLabSchema, ScoringRubricRowSchema, SelfLab, SelfLabSchema, SelfPacedBundle, SelfPacedBundleSchema, SelfPacedChallenge, SelfPacedChallengeSchema, SessionPlan, SessionPlanSchema, SilverTier, SilverTierSchema, SlideDeckSchema, StandardizedTermRowSchema, StationRecordRowSchema, StationRotation, StationRotationInput, StationRotationSchema, StationTypeEnum, TaskCard, TaskCardSchema, TaskCards, TaskCardsInput, TaskCardsSchema, TeacherGuide, TeacherGuideSchema, TeachingScriptPhase, TeachingScriptPhaseSchema, TierLevelEnum, TierObjectiveSchema, TieredPractice, TieredPracticeSchema, TranslationPolicySchema, TroubleshootingEntry, TroubleshootingEntrySchema, TroubleshootingRow, TroubleshootingRowSchema, UnitPlan, UnitPlanSchema, UserJourneySchema, Worksheet, WorksheetItem, WorksheetItemSchema, WorksheetItemTypeEnum, WorksheetPart, WorksheetPartSchema, WorksheetSchema, validateCurriculumPlan } from './schemas/index.js';
|
|
3
|
+
import { M as ModelResolutionOptions } from './provider-factory-DH3udYlN.js';
|
|
4
|
+
export { A as AIProviderName, N as NVIDIA_MODELS, g as getAIModel } from './provider-factory-DH3udYlN.js';
|
|
5
|
+
export { ActivityPromptInput, AggregatedToolCall, AsyncLLMJudgeInput, AuditCurriculumQualityInput, CodeLabPromptInput, DEFAULT_ENABLED_PROVIDERS, DiagnosticQuizPromptInput, ExtensionPromptInput, GenerateActivityInput, GenerateCodeLabInput, GenerateDiagnosticQuizInput, GenerateExtensionInput, GenerateHandoutInput, GenerateLessonMasterInput, GenerateProjectInstructionInput, GenerateSelfLabInput, GenerateSlidesInput, GenerateTeacherGuideInput, GenerateWorksheetInput, HandoutPromptInput, JudgeEvaluationResult, JudgePromptInput, LLMJudgeEngine, LessonPromptInput, ModelPolicyResolution, ModelPolicyResolver, ModelProviderKey, MultiProviderPolicyResolution, ProjectInstructionPromptInput, SelfLabPromptInput, SlidesPromptInput, StreamDiagnosticQuizInput, StreamLessonMasterInput, StreamSelfLabInput, TeacherGuidePromptInput, ToolDefinition, ToolExecutionResult, ToolExecutor, ToolLoopConfig, WorksheetPromptInput, activityTools, analystTools, assessorTools, auditCurriculumQualityFlow, buildActivityPrompt, buildCodeLabPrompt, buildDiagnosticQuizPrompt, buildExtensionPrompt, buildHandoutPrompt, buildJudgePrompt, buildLessonMasterPrompt, buildProjectInstructionPrompt, buildSelfLabPrompt, buildSlidesPrompt, buildTeacherGuidePrompt, buildWorksheetPrompt, contentTools, designerTools, generateActivityFlow, generateCodeLabFlow, generateDiagnosticQuizFlow, generateExtensionFlow, generateHandoutFlow, generateLessonMasterFlow, generateProjectInstructionFlow, generateSelfLabFlow, generateSlidesFlow, generateTeacherGuideFlow, generateWorksheetFlow, illustratorTools, packagerTools, researcherTools, reviewerTools, streamCurriculumAIInferenceWithTools, streamDiagnosticQuizFlow, streamLessonMasterFlow, streamSelfLabFlow, techSmeTools } from './ai/index.js';
|
|
6
|
+
export { C as ChatMessage, c as ChunkType, F as FallbackTarget, S as StreamRunnerOptions, e as extractThoughtAndContent, g as getDesignatedFallbackChain, b as getDesignatedFallbackConfig, a as isModelAllowed, i as isProviderEnabled, r as runCurriculumAIInference, s as streamCurriculumAIInference } from './streamRunner-C7j5LKon.js';
|
|
7
|
+
export { ArtifactLintReport, ConvertedSotBundle, GenerateProjectInstructionOptions, GenerateRoadmapCurriculumOptions, GenerateSelfPacedBundleInput, LintIssue, ProjectInstructionResult, RoadmapCurriculumOutput, SelfPacedBundleOutput, convertRoadmapToFoundationSot, generateProjectInstruction, generateRoadmapCurriculum, generateSelfPacedBundle, importRoadmapToProject, lintAndSanitizeArtifact, serializeActivityToMarkdown, serializeCodeLabToMarkdown, serializeDiagnosticQuizToMarkdown, serializeHandoutToMarkdown, serializeLessonToMarkdown, serializeProjectInstructionToMarkdown, serializeSelfLabToMarkdown, validateMarkdownTables, validateMermaidSyntax } from './pipeline/index.js';
|
|
8
|
+
export { A as AutoRepairOptions, a as AutoRepairResult, B as BundleTier, G as GenerateMilestoneBundleOptions, M as MilestoneCurriculumBundle, g as generateMilestoneCurriculumBundle, w as withAutoRepair } from './milestoneBundleGenerator-CbXhs1CP.js';
|
|
9
|
+
import { I as ICurriculumStorage, P as ProjectStatusReport, S as SmartResumeContext, Q as QualityAuditReport } from './types-BUJGYiep.js';
|
|
10
|
+
export { b as ArtifactLifecycleInfo, A as ArtifactLifecycleState, L as LessonArtifactSummary, c as PipelineState, R as ReviewRecord, a as SotDocument, T as TaskLifecycleState } from './types-BUJGYiep.js';
|
|
11
|
+
export { FileSystemCurriculumAdapter, FileSystemStorageOptions, STANDARD_SOT_FILES, StorageFactoryOptions, SupabaseCurriculumAdapter, SupabaseStorageConfig, computeContentHash, createCurriculumStorage } from './storage/index.js';
|
|
12
|
+
import { F as FrameworkPack } from './standardsCoverageGate-BWAkXY76.js';
|
|
13
|
+
export { B as BloomHintSchema, C as ClassificationSchema, k as CoverageGateInput, m as CoverageGateReport, g as FrameworkMapping, c as FrameworkMappingSchema, e as FrameworkPackManifest, a as FrameworkPackManifestSchema, d as FrameworkPackSchema, f as FrameworkStatement, b as FrameworkStatementSchema, G as GradeBandSchema, h as MappingKind, M as MappingKindSchema, P as PackLintIssue, j as PackValidationResult, i as RecordProvenance, R as RecordProvenanceSchema, S as StatementCoverageRow, n as evaluateStandardsCoverage, l as lintFrameworkPack, v as validateFrameworkPack } from './standardsCoverageGate-BWAkXY76.js';
|
|
14
|
+
import { ResolvedGateSettings } from './workflow/index.js';
|
|
15
|
+
export { ApprovalPayload, CurriculumArtifactType, CurriculumGateMode, DEFAULT_GATE_SETTINGS, ExecuteWithRateLimitOptions, GateSettings, GenerateMasterLessonStepInput, GenerateRoadmapWorkflowInput, JudgeMasterLessonStepInput, JudgeSatelliteStepInput, MilestoneWorkflowInput, MilestoneWorkflowResult, RepairMasterLessonStepInput, RoadmapWorkflowSummary, SaveMilestoneArtifactsInput, SavedMilestoneResult, approvalPayloadSchema, gateModeFor, generateActivityStep, generateCodeLabStep, generateDiagnosticQuizStep, generateExtensionStep, generateHandoutStep, generateMasterLessonStep, generateMilestoneWorkflow, generateRoadmapWorkflow, generateSelfLabStep, generateSlidesStep, generateTeacherGuideStep, generateWorksheetStep, judgeMasterLessonStep, judgeSatelliteStep, lessonApprovalHook, parseGateSettings, publishToGitStep, publishToSupabaseStep, repairMasterLessonStep, resolveGateSettings, saveMilestoneToWorkspaceStep, withRateLimitBackoff } from './workflow/index.js';
|
|
16
|
+
export { DeliveryPackResult, JobManifest, LocalWorkspaceManager, ParsedQuizQuestion, buildDeliveryPackages, exportAllProjectQuizzes, formatQuizzesToCsv, parseQuizMarkdown } from './publishers/index.js';
|
|
17
|
+
export { G as GitPublishOptions, a as GitPublishResult, S as SupabasePublishOptions, b as SupabasePublishResult, p as publishToGitHub, c as publishToSupabase, u as uploadAssetToBucket } from './supabasePublisher-C627qXFT.js';
|
|
18
|
+
export { BUNDLED_STANDARDS_PACK_IDS, HydratedPack, ImportPackResult, SelectedStatement, StandardStackOptions, StandardsRegistryAdapter, StandardsRegistryConfig, StandardsSelectionInput, buildStandardStackMarkdown, buildStandardsContext, buildStandardsContextBlock, resolveStandardsPacks, selectStatementsForLesson } from './standards/index.js';
|
|
19
|
+
export { CurateOptions, CurationDecision, FulfillOptions, FulfillResult, GenCandidate, GenRanking, GenerateImageOptions, GeneratedImage, MediaError, MediaLedger, MediaLedgerEntry, MediaLedgerMode, MediaLedgerStatus, MediaPolicy, MediaPolicyMode, MediaProvider, SearchImageOptions, SearchVideoOptions, StockImage, StockVideo, buildImagePrompt, curateMediaLedger, fulfillMediaLedger, generateEducationalImage, injectMediaIntoMarkdown, rankGenCandidates, renderMediaPlaceholder, searchEducationalImages, searchEducationalVideos } from './media/index.js';
|
|
20
|
+
import 'zod';
|
|
21
|
+
import 'ai';
|
|
22
|
+
import '@supabase/supabase-js';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Service to generate high-level status, readiness reports, and resume guidance.
|
|
26
|
+
*/
|
|
27
|
+
declare function getProjectStatusReport(storage: ICurriculumStorage, projectId: string): Promise<ProjectStatusReport>;
|
|
28
|
+
declare function getSmartResumeContext(storage: ICurriculumStorage, projectId: string): Promise<SmartResumeContext>;
|
|
29
|
+
/**
|
|
30
|
+
* Dynamically resolves the required artifact scope from SOT (PROJECT_BRIEF.md or CURRICULUM_FRAMEWORK.md)
|
|
31
|
+
*/
|
|
32
|
+
declare function getProjectArtifactScope(storage: ICurriculumStorage, projectId: string): Promise<string[]>;
|
|
33
|
+
declare function auditQualityReport(storage: ICurriculumStorage, projectId: string): Promise<QualityAuditReport>;
|
|
34
|
+
|
|
35
|
+
interface BuildContextOptions {
|
|
36
|
+
activeArtifactRelPath?: string;
|
|
37
|
+
maxContentChars?: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Builds the complete Ground Truth curriculum context for LLM prompt ingestion.
|
|
41
|
+
*/
|
|
42
|
+
declare function buildCurriculumContext(storage: ICurriculumStorage, projectId: string, options?: BuildContextOptions): Promise<string>;
|
|
43
|
+
|
|
44
|
+
interface ProjectBriefingData {
|
|
45
|
+
projectName?: string;
|
|
46
|
+
topic?: string;
|
|
47
|
+
context?: string;
|
|
48
|
+
language?: string;
|
|
49
|
+
targetAge?: string;
|
|
50
|
+
targetAgeTier?: string;
|
|
51
|
+
courseDuration?: string;
|
|
52
|
+
courseDurationTier?: string;
|
|
53
|
+
hardwarePlatform?: string | string[];
|
|
54
|
+
hardwareReadiness?: string;
|
|
55
|
+
pedagogy?: string;
|
|
56
|
+
depth?: string;
|
|
57
|
+
capstoneTheme?: string;
|
|
58
|
+
exitVision?: string;
|
|
59
|
+
primaryGoal?: string;
|
|
60
|
+
valueAndCertification?: string;
|
|
61
|
+
budgetAndHardwareBOM?: string;
|
|
62
|
+
cognitiveScaffolding?: string;
|
|
63
|
+
differentiationStrategy?: string;
|
|
64
|
+
assessmentStrategy?: string;
|
|
65
|
+
academicBenchmark?: string;
|
|
66
|
+
/** Adopted Framework Packs (Standards Registry) — STANDARD_STACK.md is rendered deterministically from these. */
|
|
67
|
+
standardsPacks?: FrameworkPack[];
|
|
68
|
+
brandingAndTone?: string;
|
|
69
|
+
recommendedToolchain?: string;
|
|
70
|
+
artifactScope?: string[];
|
|
71
|
+
specialRequirements?: string;
|
|
72
|
+
[key: string]: any;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Helper to load Markdown Template from docs/refs/templates
|
|
76
|
+
*/
|
|
77
|
+
declare function loadSotTemplate(templateFileName: string): string;
|
|
78
|
+
/**
|
|
79
|
+
* Service to generate Phase 1 Foundation SOT artifacts (@analyst & @researcher) from Brief input.
|
|
80
|
+
*/
|
|
81
|
+
declare function generatePhase1SotArtifacts(storage: ICurriculumStorage, projectId: string, briefing: ProjectBriefingData, onProgress?: (agent: string, step: string) => void): Promise<{
|
|
82
|
+
learnerProfile: string;
|
|
83
|
+
projectBrief: string;
|
|
84
|
+
referencePack: string;
|
|
85
|
+
standardStack?: string;
|
|
86
|
+
}>;
|
|
87
|
+
/**
|
|
88
|
+
* Service to generate Phase 2 Architecture SOT artifacts (@designer) from approved Foundation.
|
|
89
|
+
*/
|
|
90
|
+
declare function generatePhase2SotArtifacts(storage: ICurriculumStorage, projectId: string, briefing: ProjectBriefingData, onProgress?: (agent: string, step: string) => void): Promise<{
|
|
91
|
+
framework: string;
|
|
92
|
+
styleGuide: string;
|
|
93
|
+
artDirection: string;
|
|
94
|
+
projectStatus: string;
|
|
95
|
+
}>;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* 🛠️ Framework Linter — hợp đồng "1 buổi = 1 dòng đầy đủ" cho CURRICULUM_FRAMEWORK.md
|
|
99
|
+
*
|
|
100
|
+
* Framework là SOT của toàn bộ pipeline production: nếu framework thiếu objective/deliverable/prerequisite
|
|
101
|
+
* cho từng buổi, MỌI LESSON phía sau sinh sai. Linter này chạy NGAY SAU khi sinh framework
|
|
102
|
+
* (0 token, deterministic) và trả findings để caller retry có mục tiêu hoặc cảnh báo rõ ràng.
|
|
103
|
+
*/
|
|
104
|
+
interface FrameworkLintFinding {
|
|
105
|
+
code: string;
|
|
106
|
+
severity: 'CRITICAL' | 'MAJOR' | 'MINOR';
|
|
107
|
+
message: string;
|
|
108
|
+
}
|
|
109
|
+
interface FrameworkLintReport {
|
|
110
|
+
passed: boolean;
|
|
111
|
+
score: number;
|
|
112
|
+
totalLessons: number;
|
|
113
|
+
findings: FrameworkLintFinding[];
|
|
114
|
+
summary: string;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Trích các dòng dữ liệu từ bảng Scope & Sequence (bỏ header + separator).
|
|
118
|
+
* Nhận diện bảng theo header chứa cả "Lesson Code" và "Learning Objective".
|
|
119
|
+
*/
|
|
120
|
+
declare function extractScopeSequenceRows(framework: string): {
|
|
121
|
+
headerFound: boolean;
|
|
122
|
+
rows: string[][];
|
|
123
|
+
};
|
|
124
|
+
declare function lintCurriculumFramework(framework: string, expectedSessions?: number): FrameworkLintReport;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Resolves and loads official canonical templates from docs/refs/templates or _templates/
|
|
128
|
+
*/
|
|
129
|
+
declare function loadCurriculumTemplate(templateName: string): string;
|
|
130
|
+
type PedagogicalModel = '5e' | 'edp' | 'pbl' | 'general';
|
|
131
|
+
interface ProduceLessonOptions {
|
|
132
|
+
artifactScope?: string[];
|
|
133
|
+
force?: boolean;
|
|
134
|
+
pedagogy?: PedagogicalModel;
|
|
135
|
+
/** Chiến lược batch (chỉ produceBatchLessons dùng). */
|
|
136
|
+
batchStrategy?: 'depth_first_lesson' | 'breadth_first_artifact';
|
|
137
|
+
/**
|
|
138
|
+
* Gate Settings — NGUỒN DUY NHẤT quyết định "ai kiểm artifact nào".
|
|
139
|
+
* Chấp nhận config thô (vd: gateModes từ project.config.json của Composer):
|
|
140
|
+
* { LESSON: 'llm_judge', ACT: 'none', gate1: 'hitl', ... } — kit tự chuẩn hoá.
|
|
141
|
+
* Riêng approvedArtifacts là INPUT của HITL (bản đã được người duyệt), không phải config.
|
|
142
|
+
*/
|
|
143
|
+
gateSettings?: unknown;
|
|
144
|
+
/**
|
|
145
|
+
* Standards Registry packs (đã validate + activate) để GROUNDING prompt và Judge.
|
|
146
|
+
* Không truyền → pipeline chạy như cũ, không inject block chuẩn nào.
|
|
147
|
+
*/
|
|
148
|
+
standardsPacks?: FrameworkPack[];
|
|
149
|
+
/** Id pack đóng gói sẵn trong kit (vd: 'csta-k12-2017') — cách Composer truyền chuẩn gọn nhất. */
|
|
150
|
+
standardsPackIds?: string[];
|
|
151
|
+
/** Grade band của lesson (để chọn statement theo lớp). Fallback [6,12]. */
|
|
152
|
+
gradeBand?: [number, number] | number;
|
|
153
|
+
/**
|
|
154
|
+
* Media Ledger policy (nếu có): agent chèn placeholder [IMAGE: slug], Curator duyệt, Fulfiller thực thi.
|
|
155
|
+
* maxGenImagesPerArtifact = quota ảnh AI/gen — search kho ảnh (Pexels) KHÔNG tốn quota này.
|
|
156
|
+
*/
|
|
157
|
+
mediaPolicy?: {
|
|
158
|
+
maxGenImagesPerArtifact: number;
|
|
159
|
+
autoFulfill?: boolean;
|
|
160
|
+
preferredProvider?: 'openai' | 'gemini';
|
|
161
|
+
mode?: 'search_only' | 'gen_only' | 'auto';
|
|
162
|
+
};
|
|
163
|
+
approvedArtifacts?: string[];
|
|
164
|
+
onProgress?: (agent: string, message: string, meta?: any) => void;
|
|
165
|
+
}
|
|
166
|
+
interface ProduceLessonResult {
|
|
167
|
+
lessonId: string;
|
|
168
|
+
pedagogy: PedagogicalModel;
|
|
169
|
+
producedArtifacts: string[];
|
|
170
|
+
pausedForReview: boolean;
|
|
171
|
+
gateStatus?: string;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Detects pedagogical model from SOT (Framework, Style Guide, or Brief)
|
|
175
|
+
*/
|
|
176
|
+
declare function detectProjectPedagogy(frameworkText: string, styleGuideText: string, explicitPedagogy?: PedagogicalModel): PedagogicalModel;
|
|
177
|
+
/**
|
|
178
|
+
* Extracts lesson information (Title, Concept, Bloom, Unit, Module) from CURRICULUM_FRAMEWORK.md.
|
|
179
|
+
*/
|
|
180
|
+
declare function getLessonMetadata(storage: ICurriculumStorage, projectId: string, lessonId: string): Promise<{
|
|
181
|
+
unitCode: string;
|
|
182
|
+
moduleCode: string;
|
|
183
|
+
lessonCode: string;
|
|
184
|
+
lessonTitle: string;
|
|
185
|
+
concept: string;
|
|
186
|
+
prerequisites: string;
|
|
187
|
+
bloomLevel: string;
|
|
188
|
+
}>;
|
|
189
|
+
/**
|
|
190
|
+
* Produces artifacts for a single lesson with support for dynamic pedagogy, HITL gating, and artifact scope.
|
|
191
|
+
*/
|
|
192
|
+
declare function produceSingleLesson(storage: ICurriculumStorage, projectId: string, lessonId: string, options?: ProduceLessonOptions): Promise<ProduceLessonResult>;
|
|
193
|
+
/**
|
|
194
|
+
* Batch production orchestrator supporting Lesson-by-Lesson (Strategy A) or Artifact-by-Artifact (Strategy B) execution.
|
|
195
|
+
*/
|
|
196
|
+
declare function produceBatchLessons(storage: ICurriculumStorage, projectId: string, lessonIds: string[], options?: ProduceLessonOptions): Promise<{
|
|
197
|
+
totalLessons: number;
|
|
198
|
+
completedLessons: string[];
|
|
199
|
+
pausedLessonId?: string;
|
|
200
|
+
report: ProjectStatusReport;
|
|
201
|
+
}>;
|
|
202
|
+
|
|
203
|
+
type ArtifactType = 'lesson' | 'slide' | 'act' | 'quiz' | 'guide' | 'handout' | 'worksheet' | 'rubric' | 'ext' | 'glossary' | 'codelab' | 'bom' | 'exit_ticket' | 'tiered_practice' | 'choice_board' | 'science_lab' | 'task_cards' | 'station_rotation' | 'bell_ringer' | 'review_game' | 'graphic_organizer';
|
|
204
|
+
type ScaffoldingLevel = 'foundation' | 'balanced' | 'advanced';
|
|
205
|
+
interface SingleArtifactRequest {
|
|
206
|
+
artifactType: ArtifactType;
|
|
207
|
+
topic: string;
|
|
208
|
+
lessonId?: string;
|
|
209
|
+
lessonTitle?: string;
|
|
210
|
+
pedagogy?: '5e' | 'edp' | 'pbl' | 'general';
|
|
211
|
+
targetAge?: string;
|
|
212
|
+
scaffoldingLevel?: ScaffoldingLevel;
|
|
213
|
+
hardwarePlatform?: string[];
|
|
214
|
+
contextSot?: {
|
|
215
|
+
framework?: string;
|
|
216
|
+
learnerProfile?: string;
|
|
217
|
+
lessonPlan?: string;
|
|
218
|
+
handout?: string;
|
|
219
|
+
};
|
|
220
|
+
options?: {
|
|
221
|
+
model?: string;
|
|
222
|
+
temperature?: number;
|
|
223
|
+
openrouterKey?: string;
|
|
224
|
+
alibabaKey?: string;
|
|
225
|
+
deepseekKey?: string;
|
|
226
|
+
geminiKey?: string;
|
|
227
|
+
nvidiaKey?: string;
|
|
228
|
+
openaiKey?: string;
|
|
229
|
+
anthropicKey?: string;
|
|
230
|
+
};
|
|
231
|
+
onChunk?: (chunk: string, type: 'content' | 'thought') => void;
|
|
232
|
+
}
|
|
233
|
+
interface SingleArtifactResult {
|
|
234
|
+
artifactType: ArtifactType;
|
|
235
|
+
filename: string;
|
|
236
|
+
content: string;
|
|
237
|
+
persona: string;
|
|
238
|
+
thought?: string;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Maps artifact type to default canonical filename and responsible agent persona
|
|
242
|
+
*/
|
|
243
|
+
declare function getArtifactMetadata(type: ArtifactType, lessonId?: string): {
|
|
244
|
+
filename: string;
|
|
245
|
+
persona: string;
|
|
246
|
+
templateFile: string;
|
|
247
|
+
};
|
|
248
|
+
/**
|
|
249
|
+
* Universal Single Artifact Generator Service for all 21 Pedagogical JTBD Artifacts
|
|
250
|
+
*/
|
|
251
|
+
declare function generateSingleArtifact(req: SingleArtifactRequest): Promise<SingleArtifactResult>;
|
|
252
|
+
|
|
253
|
+
interface ProjectCreationPayload {
|
|
254
|
+
projectName: string;
|
|
255
|
+
projectCode: string;
|
|
256
|
+
coreObjective: string;
|
|
257
|
+
topic: string;
|
|
258
|
+
targetAge: string;
|
|
259
|
+
pedagogy: '5e' | 'edp' | 'pbli' | string;
|
|
260
|
+
hardwarePlatform: string[];
|
|
261
|
+
artifactScope: string[];
|
|
262
|
+
context?: 'school' | 'corporate' | 'community' | 'competition' | string;
|
|
263
|
+
depth?: 'remember' | 'understand' | 'apply' | 'evaluate' | 'create' | string;
|
|
264
|
+
tone?: 'friendly' | 'academic' | 'inspiring' | string;
|
|
265
|
+
language?: 'vi' | 'en' | string;
|
|
266
|
+
specialRequirements?: string;
|
|
267
|
+
}
|
|
268
|
+
interface ProjectClarification {
|
|
269
|
+
question: string;
|
|
270
|
+
missingField: keyof ProjectCreationPayload | string;
|
|
271
|
+
options: string[];
|
|
272
|
+
}
|
|
273
|
+
interface ProjectIntentAnalysisResult {
|
|
274
|
+
status: 'READY' | 'NEEDS_CLARIFICATION';
|
|
275
|
+
message: string;
|
|
276
|
+
payload?: ProjectCreationPayload;
|
|
277
|
+
clarification?: ProjectClarification;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Slugifies a project name into standard kebab-case project code.
|
|
281
|
+
* Ensures uniqueness against any existing project codes.
|
|
282
|
+
*/
|
|
283
|
+
declare function slugifyProjectName(name: string, existingCodes?: string[]): string;
|
|
284
|
+
/**
|
|
285
|
+
* Analyzes natural language project creation request and extracts structured parameters or clarification questions.
|
|
286
|
+
*/
|
|
287
|
+
declare function analyzeProjectCreationIntent(userPrompt: string, currentContext?: Record<string, any>): Promise<ProjectIntentAnalysisResult>;
|
|
288
|
+
/**
|
|
289
|
+
* Initializes a new course project and writes initial SOT files into storage.
|
|
290
|
+
*/
|
|
291
|
+
declare function initializeProjectInStorage(storage: ICurriculumStorage, payload: ProjectCreationPayload): Promise<{
|
|
292
|
+
projectId: string;
|
|
293
|
+
filesCreated: string[];
|
|
294
|
+
}>;
|
|
295
|
+
/**
|
|
296
|
+
* Converts a Project Roadmap JSON into a standardized ProjectCreationPayload.
|
|
297
|
+
*/
|
|
298
|
+
declare function parseRoadmapJsonToProjectPayload(roadmapJson: any): ProjectCreationPayload;
|
|
299
|
+
/**
|
|
300
|
+
* Ingests a Project Graph JSON (Architecture, Features, Implementation symbols) as a Reference Resource in the project SOT.
|
|
301
|
+
*/
|
|
302
|
+
declare function ingestProjectGraphIntoProject(storage: ICurriculumStorage, projectId: string, graphJson: any): Promise<{
|
|
303
|
+
success: boolean;
|
|
304
|
+
filesCreated: string[];
|
|
305
|
+
summary: string;
|
|
306
|
+
}>;
|
|
307
|
+
|
|
308
|
+
interface SlashCommandDefinition {
|
|
309
|
+
id: string;
|
|
310
|
+
command: string;
|
|
311
|
+
label: string;
|
|
312
|
+
description: string;
|
|
313
|
+
category: 'workflow' | 'audit' | 'knowledge' | 'specs';
|
|
314
|
+
}
|
|
315
|
+
declare const CURRICULUM_SLASH_COMMANDS: SlashCommandDefinition[];
|
|
316
|
+
interface ExecuteCommandResult {
|
|
317
|
+
success: boolean;
|
|
318
|
+
command: string;
|
|
319
|
+
actionTaken: string;
|
|
320
|
+
artifactPath?: string;
|
|
321
|
+
content?: string;
|
|
322
|
+
message: string;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Executes a curriculum-kit slash command against the given project storage.
|
|
326
|
+
*/
|
|
327
|
+
declare function executeCurriculumCommand(storage: ICurriculumStorage, projectId: string, command: string, payload?: {
|
|
328
|
+
messages?: Array<{
|
|
329
|
+
role: string;
|
|
330
|
+
content: string;
|
|
331
|
+
}>;
|
|
332
|
+
projectName?: string;
|
|
333
|
+
pedagogy?: string;
|
|
334
|
+
}): Promise<ExecuteCommandResult>;
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Deterministic Pipeline Runner (Parity with LangGraph unit_loop_node & ARTIFACT_EXECUTION_ORDER)
|
|
338
|
+
*
|
|
339
|
+
* Enforces the strict sequential waterfall for lesson production:
|
|
340
|
+
* 1. Step 1: LESSON (5E Master Plan — The Artifact Contract)
|
|
341
|
+
* 2. Step 2: ACT (STEM Lab Operations bound to LESSON contract)
|
|
342
|
+
* 3. Step 3: QUIZ (Diagnostic & Summative Quizzes bound to LESSON evidence)
|
|
343
|
+
* 4. Step 4: SLIDE (Marp Visual Slides bound to 5E Phases)
|
|
344
|
+
* 5. Step 5: SATELLITES (GUIDE, WKS, HANDOUT, EXT)
|
|
345
|
+
*/
|
|
346
|
+
interface ArtifactProductionSpec {
|
|
347
|
+
artifactType: 'LESSON' | 'ACT' | 'QUIZ' | 'SLIDE' | 'GUIDE' | 'WKS' | 'HANDOUT' | 'EXT' | 'MEDIA_SCRIPT';
|
|
348
|
+
assignedPersona: string;
|
|
349
|
+
isContractRoot: boolean;
|
|
350
|
+
requiresPriorLesson: boolean;
|
|
351
|
+
}
|
|
352
|
+
declare const ARTIFACT_EXECUTION_ORDER: ArtifactProductionSpec[];
|
|
353
|
+
interface PipelineExecutionProgress {
|
|
354
|
+
lessonId: string;
|
|
355
|
+
currentStepIndex: number;
|
|
356
|
+
totalSteps: number;
|
|
357
|
+
activeArtifact: string;
|
|
358
|
+
assignedPersona: string;
|
|
359
|
+
completedArtifacts: string[];
|
|
360
|
+
pendingArtifacts: string[];
|
|
361
|
+
status: 'IDLE' | 'IN_PROGRESS' | 'AWAITING_APPROVAL' | 'COMPLETED' | 'ERROR';
|
|
362
|
+
error?: string;
|
|
363
|
+
}
|
|
364
|
+
declare class DeterministicPipelineRunner {
|
|
365
|
+
/**
|
|
366
|
+
* Determine what artifacts need to be produced next for a lesson, honoring the strict dependency order.
|
|
367
|
+
*/
|
|
368
|
+
static getNextProductionTarget(lessonId: string, existingArtifacts: string[], scopedArtifactTypes?: string[]): {
|
|
369
|
+
nextArtifact: ArtifactProductionSpec | null;
|
|
370
|
+
isLessonComplete: boolean;
|
|
371
|
+
parallelQueue: string[];
|
|
372
|
+
progress: PipelineExecutionProgress;
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
interface LayerPrefillOptions {
|
|
377
|
+
action?: 'prefill' | 'research';
|
|
378
|
+
targetLayer?: number;
|
|
379
|
+
accumulatedData?: Record<string, any>;
|
|
380
|
+
apiKeys?: Record<string, string>;
|
|
381
|
+
liveSearchConfig?: Record<string, boolean>;
|
|
382
|
+
stream?: boolean;
|
|
383
|
+
}
|
|
384
|
+
interface PreliminaryResearchResult {
|
|
385
|
+
groundTruthSummary: string;
|
|
386
|
+
hardwareVersion: string;
|
|
387
|
+
ideVersion: string;
|
|
388
|
+
activeLibraries: string[];
|
|
389
|
+
technicalGotchas: string[];
|
|
390
|
+
}
|
|
391
|
+
interface LayerPrefillResult {
|
|
392
|
+
success: boolean;
|
|
393
|
+
targetLayer?: number;
|
|
394
|
+
parsedResponse?: any;
|
|
395
|
+
research?: PreliminaryResearchResult;
|
|
396
|
+
rawText?: string;
|
|
397
|
+
}
|
|
398
|
+
type LayerChunkCallback = (chunk: string, type: 'thought' | 'content') => void;
|
|
399
|
+
/**
|
|
400
|
+
* Robust JSON extraction and repair helper
|
|
401
|
+
*/
|
|
402
|
+
declare function safeParseJson<T = any>(rawText: string | null): T | null;
|
|
403
|
+
/**
|
|
404
|
+
* Multi-tiered resilient streaming inference helper for wizard layers.
|
|
405
|
+
*/
|
|
406
|
+
declare function streamLLMWithFallback(systemPrompt: string, userPrompt: string, apiKeys?: Record<string, string>, onChunk?: LayerChunkCallback): Promise<string | null>;
|
|
407
|
+
/**
|
|
408
|
+
* Conducts preliminary ecosystem research for a course project.
|
|
409
|
+
*/
|
|
410
|
+
declare function conductPreliminaryResearch(options: LayerPrefillOptions, onChunk?: LayerChunkCallback): Promise<PreliminaryResearchResult>;
|
|
411
|
+
/**
|
|
412
|
+
* Executes concentric 3-layer drill-down prefill inference with live reasoning stream.
|
|
413
|
+
*/
|
|
414
|
+
declare function streamLayerPrefillWithFallback(options: LayerPrefillOptions, onChunk?: LayerChunkCallback): Promise<LayerPrefillResult>;
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Curriculum Planner — turns a domain planning graph + constraints into a
|
|
418
|
+
* validated CurriculumPlan (planner outputs [1]-[7] from the design doc).
|
|
419
|
+
*
|
|
420
|
+
* Deterministic-first: LLM is optional and only used for prose objectives via
|
|
421
|
+
* the `llmFn` hook. Packing, depth and prereq/scaffold decisions are pure
|
|
422
|
+
* functions — testable, replayable, no silent fallbacks.
|
|
423
|
+
*/
|
|
424
|
+
interface PlannerLlmFn {
|
|
425
|
+
(systemPrompt: string, userPrompt: string): Promise<string>;
|
|
426
|
+
}
|
|
427
|
+
interface PlanOptions {
|
|
428
|
+
constraints: PlanConstraints;
|
|
429
|
+
translation?: TranslationPolicy;
|
|
430
|
+
/** Optional LLM for prose objectives; absent => deterministic templates. */
|
|
431
|
+
llmFn?: PlannerLlmFn;
|
|
432
|
+
}
|
|
433
|
+
interface PlanResult {
|
|
434
|
+
plan: CurriculumPlan;
|
|
435
|
+
warnings: string[];
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Normalize any accepted input shape into a PlanningGraph.
|
|
439
|
+
* Accepted: CurriculumFeed v2 (learning_nodes), knowledge_graph (concepts),
|
|
440
|
+
* AssembledRoadmap (phases/milestones), raw project_graph (features/steps),
|
|
441
|
+
* hybrid (concepts + features/roadmap + links). Throws on unusable input.
|
|
442
|
+
*/
|
|
443
|
+
declare function normalizePlanningGraph(raw: unknown): PlanningGraph;
|
|
444
|
+
declare function assertAcyclic(nodes: PlanningNode[], edges: DependencyEdge[]): void;
|
|
445
|
+
declare function topoSort(nodes: PlanningNode[], edges: DependencyEdge[]): string[];
|
|
446
|
+
interface PackingSpec {
|
|
447
|
+
contentBudget: number;
|
|
448
|
+
overheadMinutes: number;
|
|
449
|
+
sessionDurationMinutes: number;
|
|
450
|
+
}
|
|
451
|
+
declare function computePackingSpec(constraints: PlanConstraints): PackingSpec;
|
|
452
|
+
declare function buildCurriculumPlan(rawGraph: unknown, options: PlanOptions): Promise<PlanResult>;
|
|
453
|
+
/** Extract the machine-readable slice the LESSON agent consumes for one session. */
|
|
454
|
+
declare function extractSessionSlice(plan: CurriculumPlan, lessonCode: string): CurriculumPlan['sessions'][number];
|
|
455
|
+
/** Compact plan-slice context block for LESSON/satellite prompts (activity design inputs). */
|
|
456
|
+
declare function buildSessionSliceContext(plan: CurriculumPlan, lessonCode: string): string;
|
|
457
|
+
|
|
458
|
+
interface ProjectionMeta {
|
|
459
|
+
courseName: string;
|
|
460
|
+
shortDescription?: string;
|
|
461
|
+
}
|
|
462
|
+
declare function renderFrameworkFromPlan(plan: CurriculumPlan, meta: ProjectionMeta): string;
|
|
463
|
+
/** Extract the glossary scope (terms per session) the EXPOSITION service consumes. */
|
|
464
|
+
declare function glossaryTermsForSession(plan: CurriculumPlan, lessonCode: string): string[];
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* KNOWLEDGE_EXPOSITION service — canonical knowledge reference per session,
|
|
468
|
+
* generated ON DEMAND after framework approval (design doc: option b).
|
|
469
|
+
*
|
|
470
|
+
* Guarantees:
|
|
471
|
+
* - fail-closed: refuses without approval.status === 'approved'
|
|
472
|
+
* - hash invalidation: regenerates when plan_hash changed after approval
|
|
473
|
+
* - scope-locked: covers exactly the session's nodes/keywords/depths
|
|
474
|
+
* - student-facing: no teacher-only content (LESSON owns activities)
|
|
475
|
+
*/
|
|
476
|
+
interface ExpositionLlmFn {
|
|
477
|
+
(systemPrompt: string, userPrompt: string): Promise<string>;
|
|
478
|
+
}
|
|
479
|
+
interface ExpositionStorage {
|
|
480
|
+
readArtifact(projectId: string, relPath: string): Promise<string | null>;
|
|
481
|
+
saveArtifact(projectId: string, relPath: string, content: string): Promise<void>;
|
|
482
|
+
}
|
|
483
|
+
declare const EXPOSITION_REL: (lessonCode: string) => string;
|
|
484
|
+
declare class ExpositionApprovalError extends Error {
|
|
485
|
+
constructor(message: string);
|
|
486
|
+
}
|
|
487
|
+
/** Determine whether an existing EXPOSITION can be reused for this lesson. */
|
|
488
|
+
declare function isExpositionFresh(existing: string | null, plan: CurriculumPlan, lessonCode: string): boolean;
|
|
489
|
+
interface GenerateExpositionOptions {
|
|
490
|
+
projectId: string;
|
|
491
|
+
lessonCode: string;
|
|
492
|
+
plan: CurriculumPlan;
|
|
493
|
+
glossary: Array<{
|
|
494
|
+
term: string;
|
|
495
|
+
definition?: string;
|
|
496
|
+
example?: string;
|
|
497
|
+
}>;
|
|
498
|
+
llmFn: ExpositionLlmFn;
|
|
499
|
+
storage: ExpositionStorage;
|
|
500
|
+
gates?: ResolvedGateSettings;
|
|
501
|
+
}
|
|
502
|
+
interface ExpositionResult {
|
|
503
|
+
relPath: string;
|
|
504
|
+
content: string;
|
|
505
|
+
reused: boolean;
|
|
506
|
+
gateMode: 'OFF' | 'LLM_JUDGE' | 'HITL';
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* Generate (or reuse) the KNOWLEDGE_EXPOSITION for one lesson.
|
|
510
|
+
* Throws ExpositionApprovalError when the plan is not approved or approval
|
|
511
|
+
* hash mismatches the current plan — callers must NOT proceed to LESSON.
|
|
512
|
+
*/
|
|
513
|
+
declare function ensureKnowledgeExposition(options: GenerateExpositionOptions): Promise<ExpositionResult>;
|
|
514
|
+
/** Build a compact exposition context block for LESSON / satellite prompts. */
|
|
515
|
+
declare function buildExpositionContext(expositionContent: string, maxChars?: number): string;
|
|
516
|
+
/** Integrity hash helper for cache bookkeeping. */
|
|
517
|
+
declare function expositionCacheKey(planHash: string, lessonCode: string): string;
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* End-to-end helper for the produce flow: read plan + glossary from SOT
|
|
521
|
+
* storage, ensure approval, generate/reuse the EXPOSITION, return a compact
|
|
522
|
+
* context block. Returns null when no plan exists (legacy flow) — callers
|
|
523
|
+
* render that state explicitly in telemetry, never silently.
|
|
524
|
+
*/
|
|
525
|
+
declare function ensureExpositionForLesson(storage: ICurriculumStorage, projectId: string, lessonCode: string, options?: {
|
|
526
|
+
gates?: ResolvedGateSettings;
|
|
527
|
+
force?: boolean;
|
|
528
|
+
}): Promise<{
|
|
529
|
+
relPath: string;
|
|
530
|
+
context: string;
|
|
531
|
+
reused: boolean;
|
|
532
|
+
} | null>;
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Translation policy resolver — decides which artifacts need a translated copy
|
|
536
|
+
* at which point, per the plan's translation policy. Composer executes the
|
|
537
|
+
* actual translation jobs; the kit owns the policy decision (pure function).
|
|
538
|
+
*
|
|
539
|
+
* Policy semantics (approved design D5):
|
|
540
|
+
* - after_artifact: every artifact gets translated as soon as it passes its gate
|
|
541
|
+
* - end_of_unit: artifacts of a unit are translated when the unit's last lesson is done
|
|
542
|
+
* - at_publish: nothing translates until explicit publish — recommended default
|
|
543
|
+
*/
|
|
544
|
+
type TranslationTrigger = 'after_artifact' | 'end_of_unit' | 'at_publish';
|
|
545
|
+
interface TranslationTarget {
|
|
546
|
+
/** Artifact-relative path of the SOURCE (always English). */
|
|
547
|
+
sourceRelPath: string;
|
|
548
|
+
/** Where the translated copy belongs (e.g. _i18n/vi/...). */
|
|
549
|
+
targetRelPath: string;
|
|
550
|
+
targetLanguage: string;
|
|
551
|
+
trigger: TranslationTrigger;
|
|
552
|
+
/** Unit code for end_of_unit grouping; null for course-wide artifacts. */
|
|
553
|
+
unitId: string | null;
|
|
554
|
+
}
|
|
555
|
+
declare function resolveTranslationTargets(plan: CurriculumPlan, knownArtifactPaths: string[]): TranslationTarget[];
|
|
556
|
+
/** Should this target be translated NOW given the trigger and current state? */
|
|
557
|
+
declare function isTranslationDue(target: TranslationTarget, context: {
|
|
558
|
+
completedLessonsByUnit: Record<string, number>;
|
|
559
|
+
totalLessonsByUnit: Record<string, number>;
|
|
560
|
+
publishRequested: boolean;
|
|
561
|
+
}): boolean;
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Curriculum OS - Standardized Error Taxonomy & Traceability System
|
|
565
|
+
*
|
|
566
|
+
* Provides typed, structured, and traceable error codes for all pipeline failures,
|
|
567
|
+
* API exceptions, safeguard blocks, and contract violations.
|
|
568
|
+
*/
|
|
569
|
+
type CurriculumErrorCode = 'ERR_AI_NO_API_KEY' | 'ERR_AI_RATE_LIMIT' | 'ERR_AI_AUTH_FAILED' | 'ERR_AI_NETWORK_TIMEOUT' | 'ERR_AI_RESPONSE_MALFORMED' | 'ERR_AI_ALL_PROVIDERS_FAILED' | 'ERR_SOT_MISSING' | 'ERR_SOT_INVALID_SCHEMA' | 'ERR_TASK_GATE_BLOCKED' | 'ERR_METERED_LIMIT_EXCEEDED' | 'ERR_SCHEMA_CONTRACT_VIOLATION' | 'ERR_STORAGE_IO_FAILED';
|
|
570
|
+
interface CurriculumErrorDetail {
|
|
571
|
+
errorCode: CurriculumErrorCode;
|
|
572
|
+
agent?: string;
|
|
573
|
+
artifactType?: string;
|
|
574
|
+
lessonId?: string;
|
|
575
|
+
provider?: string;
|
|
576
|
+
statusCode?: number;
|
|
577
|
+
message: string;
|
|
578
|
+
suggestedAction: string;
|
|
579
|
+
retryable: boolean;
|
|
580
|
+
timestamp: string;
|
|
581
|
+
rawError?: string;
|
|
582
|
+
}
|
|
583
|
+
declare class CurriculumError extends Error {
|
|
584
|
+
readonly detail: CurriculumErrorDetail;
|
|
585
|
+
constructor(detail: Omit<CurriculumErrorDetail, 'timestamp'>);
|
|
586
|
+
get errorCode(): CurriculumErrorCode;
|
|
587
|
+
get retryable(): boolean;
|
|
588
|
+
get suggestedAction(): string;
|
|
589
|
+
toJSON(): CurriculumErrorDetail;
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* Helper to build standardized AI inference errors
|
|
593
|
+
*/
|
|
594
|
+
declare function createAiInferenceError(params: {
|
|
595
|
+
errorCode: CurriculumErrorCode;
|
|
596
|
+
message: string;
|
|
597
|
+
provider?: string;
|
|
598
|
+
statusCode?: number;
|
|
599
|
+
agent?: string;
|
|
600
|
+
artifactType?: string;
|
|
601
|
+
lessonId?: string;
|
|
602
|
+
rawError?: any;
|
|
603
|
+
suggestedAction?: string;
|
|
604
|
+
retryable?: boolean;
|
|
605
|
+
}): CurriculumError;
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* Academic Quality & Pedagogical Verification Types
|
|
609
|
+
*/
|
|
610
|
+
type AcademicDimension = 'CONSTRUCTIVE_ALIGNMENT' | 'BLOOM_PROGRESSION' | '5E_INSTRUCTIONAL_FIDELITY' | 'MISCONCEPTION_RIGOR' | 'TECHNICAL_AUTHENTICITY' | 'CROSS_ARTIFACT_ZERO_DRIFT';
|
|
611
|
+
type FindingSeverity = 'CRITICAL' | 'MAJOR' | 'MINOR';
|
|
612
|
+
interface AcademicAuditFinding {
|
|
613
|
+
id: string;
|
|
614
|
+
dimension: AcademicDimension;
|
|
615
|
+
severity: FindingSeverity;
|
|
616
|
+
title: string;
|
|
617
|
+
description: string;
|
|
618
|
+
remediationAdvice: string;
|
|
619
|
+
affectedElement?: string;
|
|
620
|
+
}
|
|
621
|
+
interface DimensionScore {
|
|
622
|
+
score: number;
|
|
623
|
+
weight: number;
|
|
624
|
+
passed: boolean;
|
|
625
|
+
strengths: string[];
|
|
626
|
+
findings: AcademicAuditFinding[];
|
|
627
|
+
}
|
|
628
|
+
interface ComprehensiveAcademicReport {
|
|
629
|
+
timestamp: string;
|
|
630
|
+
targetId: string;
|
|
631
|
+
targetType: 'LESSON' | 'QUIZ' | 'ACT' | 'SLIDE' | 'BUNDLE' | 'SOT_CLUSTER';
|
|
632
|
+
overallScore: number;
|
|
633
|
+
passed: boolean;
|
|
634
|
+
verdict: 'EXEMPLARY' | 'ACADEMICALLY_SOUND' | 'NEEDS_PEDAGOGICAL_REFINEMENT' | 'REJECTED';
|
|
635
|
+
summary: string;
|
|
636
|
+
dimensionScores: {
|
|
637
|
+
constructiveAlignment: DimensionScore;
|
|
638
|
+
bloomProgression: DimensionScore;
|
|
639
|
+
fiveEFidelity: DimensionScore;
|
|
640
|
+
misconceptionRigor: DimensionScore;
|
|
641
|
+
technicalAuthenticity: DimensionScore;
|
|
642
|
+
crossArtifactZeroDrift: DimensionScore;
|
|
643
|
+
};
|
|
644
|
+
criticalFindingsCount: number;
|
|
645
|
+
allFindings: AcademicAuditFinding[];
|
|
646
|
+
actionablePromptGuidance: string[];
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* 🛠️ Deterministic Structural & Contract Linter
|
|
651
|
+
* Strict rule-based checks: Schema completeness, Zero-drift ID alignment,
|
|
652
|
+
* format sanity, and structural safety rules.
|
|
653
|
+
*
|
|
654
|
+
* ⛔ DOES NOT do regex-based semantic parsing or fake semantic understanding.
|
|
655
|
+
* All semantic, cognitive, and pedagogical evaluations are delegated to LLM-as-a-Judge.
|
|
656
|
+
*/
|
|
657
|
+
declare class DeterministicStructuralLinter {
|
|
658
|
+
/**
|
|
659
|
+
* Validates structural invariants across a complete lesson bundle.
|
|
660
|
+
*/
|
|
661
|
+
static lintBundle(input: {
|
|
662
|
+
lesson: LessonPlan;
|
|
663
|
+
quiz?: DiagnosticQuizInput;
|
|
664
|
+
activity?: ActivityLab;
|
|
665
|
+
slides?: SlideDeck;
|
|
666
|
+
codeLab?: CodeLab;
|
|
667
|
+
}): {
|
|
668
|
+
passed: boolean;
|
|
669
|
+
structuralScore: number;
|
|
670
|
+
findings: AcademicAuditFinding[];
|
|
671
|
+
strengths: string[];
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
interface AuditBundleInput {
|
|
676
|
+
lesson: LessonPlan;
|
|
677
|
+
quiz?: DiagnosticQuizInput;
|
|
678
|
+
activity?: ActivityLab;
|
|
679
|
+
slides?: SlideDeck;
|
|
680
|
+
codeLab?: CodeLab;
|
|
681
|
+
modelOptions?: ModelResolutionOptions;
|
|
682
|
+
executeLLMJudge?: boolean;
|
|
683
|
+
}
|
|
684
|
+
declare class AcademicAuditor {
|
|
685
|
+
/**
|
|
686
|
+
* Evaluates a complete lesson bundle.
|
|
687
|
+
* Step 1 (Deterministic): Fast structural, contract, schema, and safety linting.
|
|
688
|
+
* Step 2 (Semantic LLM-as-a-Judge): Deep pedagogical, cognitive (Bloom), and misconception analysis with live frontier LLM.
|
|
689
|
+
*/
|
|
690
|
+
static auditLessonBundle(input: AuditBundleInput): Promise<ComprehensiveAcademicReport>;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
declare const BLOOM_ACTION_VERBS: {
|
|
694
|
+
remember: string[];
|
|
695
|
+
understand: string[];
|
|
696
|
+
apply: string[];
|
|
697
|
+
analyze: string[];
|
|
698
|
+
evaluate: string[];
|
|
699
|
+
create: string[];
|
|
700
|
+
};
|
|
701
|
+
declare class BloomTaxonomyEvaluator {
|
|
702
|
+
/**
|
|
703
|
+
* Audits a LessonPlan for Bloom taxonomy fidelity and cognitive scaffolding.
|
|
704
|
+
*/
|
|
705
|
+
static evaluateLesson(lesson: LessonPlan): DimensionScore;
|
|
706
|
+
/**
|
|
707
|
+
* Audits a Diagnostic Quiz for true cognitive depth matching declared Bloom levels.
|
|
708
|
+
*/
|
|
709
|
+
static evaluateQuiz(quiz: DiagnosticQuiz): DimensionScore;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
declare class CrossArtifactDriftEvaluator {
|
|
713
|
+
/**
|
|
714
|
+
* Audits consistency, metadata synchronization, and zero-drift across all artifacts in a lesson bundle.
|
|
715
|
+
*/
|
|
716
|
+
static evaluateBundle(lesson: LessonPlan, quiz?: DiagnosticQuiz, activity?: ActivityLab, slides?: SlideDeck): DimensionScore;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
declare class ConstructiveAlignmentEvaluator {
|
|
720
|
+
/**
|
|
721
|
+
* Evaluates constructive alignment within a LessonPlan and across its satellite artifacts.
|
|
722
|
+
*/
|
|
723
|
+
static evaluateLesson(lesson: LessonPlan, quiz?: DiagnosticQuiz, activity?: ActivityLab): DimensionScore;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
declare class FiveEInstructionalEvaluator {
|
|
727
|
+
/**
|
|
728
|
+
* Evaluates the pedagogical structure of a Lesson Plan against the 5E Inquiry Model.
|
|
729
|
+
*/
|
|
730
|
+
static evaluateLesson(lesson: LessonPlan): DimensionScore;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
declare class CodeHardwareFeasibilityEvaluator {
|
|
734
|
+
/**
|
|
735
|
+
* Audits technical accuracy, code syntax sanity, and hardware circuit safety.
|
|
736
|
+
*/
|
|
737
|
+
static evaluateTechnicalFeasibility(lesson?: LessonPlan, codeLab?: CodeLab, activity?: ActivityLab): DimensionScore;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
declare class MisconceptionEvaluator {
|
|
741
|
+
/**
|
|
742
|
+
* Audits the psychometric and pedagogical rigor of diagnostic questions and their distractors.
|
|
743
|
+
*/
|
|
744
|
+
static evaluateQuiz(quiz: DiagnosticQuiz): DimensionScore;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
export { ARTIFACT_EXECUTION_ORDER, type AcademicAuditFinding, AcademicAuditor, type AcademicDimension, ActivityLab, type ArtifactProductionSpec, type ArtifactType, type AuditBundleInput, BLOOM_ACTION_VERBS, BloomTaxonomyEvaluator, type BuildContextOptions, CURRICULUM_SLASH_COMMANDS, CodeHardwareFeasibilityEvaluator, CodeLab, type ComprehensiveAcademicReport, ConstructiveAlignmentEvaluator, CrossArtifactDriftEvaluator, CurriculumError, type CurriculumErrorCode, type CurriculumErrorDetail, CurriculumPlan, DependencyEdge, DeterministicPipelineRunner, DeterministicStructuralLinter, DiagnosticQuiz, DiagnosticQuizInput, type DimensionScore, EXPOSITION_REL, type ExecuteCommandResult, ExpositionApprovalError, type ExpositionLlmFn, type ExpositionResult, type ExpositionStorage, type FindingSeverity, FiveEInstructionalEvaluator, type FrameworkLintFinding, type FrameworkLintReport, FrameworkPack, type GenerateExpositionOptions, ICurriculumStorage, type LayerChunkCallback, type LayerPrefillOptions, type LayerPrefillResult, LessonPlan, MisconceptionEvaluator, ModelResolutionOptions, type PackingSpec, type PedagogicalModel, type PipelineExecutionProgress, PlanConstraints, type PlanOptions, type PlanResult, type PlannerLlmFn, PlanningGraph, PlanningNode, type PreliminaryResearchResult, type ProduceLessonOptions, type ProduceLessonResult, type ProjectBriefingData, type ProjectClarification, type ProjectCreationPayload, type ProjectIntentAnalysisResult, ProjectStatusReport, type ProjectionMeta, QualityAuditReport, ResolvedGateSettings, type ScaffoldingLevel, type SingleArtifactRequest, type SingleArtifactResult, type SlashCommandDefinition, SlideDeck, SmartResumeContext, TranslationPolicy, type TranslationTarget, type TranslationTrigger, analyzeProjectCreationIntent, assertAcyclic, auditQualityReport, buildCurriculumContext, buildCurriculumPlan, buildExpositionContext, buildSessionSliceContext, computePackingSpec, conductPreliminaryResearch, createAiInferenceError, detectProjectPedagogy, ensureExpositionForLesson, ensureKnowledgeExposition, executeCurriculumCommand, expositionCacheKey, extractScopeSequenceRows, extractSessionSlice, generatePhase1SotArtifacts, generatePhase2SotArtifacts, generateSingleArtifact, getArtifactMetadata, getLessonMetadata, getProjectArtifactScope, getProjectStatusReport, getSmartResumeContext, glossaryTermsForSession, ingestProjectGraphIntoProject, initializeProjectInStorage, isExpositionFresh, isTranslationDue, lintCurriculumFramework, loadCurriculumTemplate, loadSotTemplate, normalizePlanningGraph, parseRoadmapJsonToProjectPayload, produceBatchLessons, produceSingleLesson, renderFrameworkFromPlan, resolveTranslationTargets, safeParseJson, slugifyProjectName, streamLLMWithFallback, streamLayerPrefillWithFallback, topoSort };
|