@thanh01.pmt/curriculum-kit 1.0.0 → 1.0.2
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/dist/index-BAUtASfr.d.ts +354 -0
- package/dist/index-PDw11tpD.d.cts +354 -0
- package/dist/index.cjs +24 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -53
- package/dist/index.d.ts +5 -53
- package/dist/index.mjs +23 -3
- package/dist/index.mjs.map +1 -1
- package/dist/workflow/index.cjs +873 -3
- package/dist/workflow/index.cjs.map +1 -1
- package/dist/workflow/index.d.cts +6 -294
- package/dist/workflow/index.d.ts +6 -294
- package/dist/workflow/index.mjs +871 -4
- package/dist/workflow/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
import { MilestoneInput, LessonPlan, CurriculumQualityReport, ActivityLab, CodeLab, SelfLab, DiagnosticQuiz, SlideDeck, Handout, Worksheet, TeacherGuide, Extension, ProjectRoadmap } from './schemas/index.cjs';
|
|
2
|
+
import { M as ModelResolutionOptions } from './provider-factory-DH3udYlN.cjs';
|
|
3
|
+
import { G as GitPublishOptions, a as GitPublishResult, S as SupabasePublishOptions, b as SupabasePublishResult } from './supabasePublisher-C627qXFT.cjs';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { F as FrameworkPack, m as CoverageGateReport } from './standardsCoverageGate-BWAkXY76.cjs';
|
|
6
|
+
|
|
7
|
+
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';
|
|
8
|
+
type ScaffoldingLevel = 'foundation' | 'balanced' | 'advanced';
|
|
9
|
+
interface SingleArtifactRequest {
|
|
10
|
+
artifactType: ArtifactType;
|
|
11
|
+
topic: string;
|
|
12
|
+
lessonId?: string;
|
|
13
|
+
lessonTitle?: string;
|
|
14
|
+
pedagogy?: '5e' | 'edp' | 'pbl' | 'general';
|
|
15
|
+
targetAge?: string;
|
|
16
|
+
scaffoldingLevel?: ScaffoldingLevel;
|
|
17
|
+
hardwarePlatform?: string[];
|
|
18
|
+
contextSot?: {
|
|
19
|
+
framework?: string;
|
|
20
|
+
learnerProfile?: string;
|
|
21
|
+
lessonPlan?: string;
|
|
22
|
+
handout?: string;
|
|
23
|
+
};
|
|
24
|
+
options?: {
|
|
25
|
+
model?: string;
|
|
26
|
+
temperature?: number;
|
|
27
|
+
openrouterKey?: string;
|
|
28
|
+
alibabaKey?: string;
|
|
29
|
+
deepseekKey?: string;
|
|
30
|
+
geminiKey?: string;
|
|
31
|
+
nvidiaKey?: string;
|
|
32
|
+
openaiKey?: string;
|
|
33
|
+
anthropicKey?: string;
|
|
34
|
+
};
|
|
35
|
+
onChunk?: (chunk: string, type: 'content' | 'thought') => void;
|
|
36
|
+
}
|
|
37
|
+
interface SingleArtifactResult {
|
|
38
|
+
artifactType: ArtifactType;
|
|
39
|
+
filename: string;
|
|
40
|
+
content: string;
|
|
41
|
+
persona: string;
|
|
42
|
+
thought?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Maps artifact type to default canonical filename and responsible agent persona
|
|
46
|
+
*/
|
|
47
|
+
declare function getArtifactMetadata(type: ArtifactType, lessonId?: string): {
|
|
48
|
+
filename: string;
|
|
49
|
+
persona: string;
|
|
50
|
+
templateFile: string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Universal Single Artifact Generator Service for all 21 Pedagogical JTBD Artifacts
|
|
54
|
+
*/
|
|
55
|
+
declare function generateSingleArtifact(req: SingleArtifactRequest): Promise<SingleArtifactResult>;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Gate Settings — toàn bộ logic "ai kiểm artifact nào" nằm ở đây, trong kit.
|
|
59
|
+
* Composer chỉ gọi: resolveGateSettings(projectConfig.gateModes) rồi dùng kết quả.
|
|
60
|
+
*
|
|
61
|
+
* Vocabulary chuẩn (duy nhất, không có biến thể thứ hai):
|
|
62
|
+
* 'OFF' — không kiểm
|
|
63
|
+
* 'LLM_JUDGE' — Agent kiểm (LLM-as-Judge)
|
|
64
|
+
* 'HITL' — Human kiểm (human-in-the-loop)
|
|
65
|
+
*
|
|
66
|
+
* Phạm vi phủ: SOT foundation (Learner Profile, Framework, Style Guide — duyệt trước khi
|
|
67
|
+
* sinh content) + toàn bộ content artifacts.
|
|
68
|
+
*/
|
|
69
|
+
type CurriculumGateMode = 'OFF' | 'LLM_JUDGE' | 'HITL';
|
|
70
|
+
type CurriculumArtifactType = 'LEARNER_PROFILE' | 'PROJECT_BRIEF' | 'REFERENCE_PACK' | 'CURRICULUM_FRAMEWORK' | 'KNOWLEDGE_EXPOSITION' | 'STYLE_GUIDE' | 'ART_DIRECTION' | 'LESSON' | 'ACT' | 'QUIZ' | 'SLIDE' | 'GUIDE' | 'WKS' | 'HANDOUT' | 'EXT' | 'CODE' | 'MEDIA_SCRIPT' | 'EXIT_TICKET';
|
|
71
|
+
type GateSettings = Partial<Record<CurriculumArtifactType, CurriculumGateMode>>;
|
|
72
|
+
type ResolvedGateSettings = Readonly<Record<CurriculumArtifactType, CurriculumGateMode>>;
|
|
73
|
+
/** Mặc định trùng hành vi production hiện tại: SOT nền = HITL, LESSON/CODE = Agent kiểm, còn lại OFF. */
|
|
74
|
+
declare const DEFAULT_GATE_SETTINGS: ResolvedGateSettings;
|
|
75
|
+
/**
|
|
76
|
+
* Chuẩn hoá config thô (vd: gateModes đọc từ project.config.json của Composer) thành GateSettings.
|
|
77
|
+
* Key/value không nhận diện được bị bỏ qua — config sai không bao giờ làm workflow chết.
|
|
78
|
+
*/
|
|
79
|
+
declare function parseGateSettings(raw: unknown): GateSettings;
|
|
80
|
+
/**
|
|
81
|
+
* Điểm vào DUY NHẤT: raw config (hoặc đã chuẩn hoá) → settings đầy đủ cho mọi artifact type.
|
|
82
|
+
* Key không có trong config nhận DEFAULT_GATE_SETTINGS.
|
|
83
|
+
*/
|
|
84
|
+
declare function resolveGateSettings(raw?: unknown): ResolvedGateSettings;
|
|
85
|
+
/** Mode đã resolve cho 1 artifact type. */
|
|
86
|
+
declare function gateModeFor(resolved: ResolvedGateSettings, type: CurriculumArtifactType): CurriculumGateMode;
|
|
87
|
+
|
|
88
|
+
interface GenerateMasterLessonStepInput {
|
|
89
|
+
milestone: MilestoneInput;
|
|
90
|
+
language: string;
|
|
91
|
+
topic?: string;
|
|
92
|
+
targetAudience?: string;
|
|
93
|
+
contextContinuity?: string;
|
|
94
|
+
/** Pre-rendered STANDARDS CONTEXT block (verbatim standard statements). */
|
|
95
|
+
standardsContext?: string;
|
|
96
|
+
modelOptions?: ModelResolutionOptions;
|
|
97
|
+
}
|
|
98
|
+
declare function generateMasterLessonStep(input: GenerateMasterLessonStepInput): Promise<LessonPlan>;
|
|
99
|
+
interface JudgeMasterLessonStepInput {
|
|
100
|
+
lessonId: string;
|
|
101
|
+
lesson: LessonPlan;
|
|
102
|
+
language: string;
|
|
103
|
+
targetObjectives: Array<{
|
|
104
|
+
code: string;
|
|
105
|
+
description: string;
|
|
106
|
+
bloomLevel: string;
|
|
107
|
+
}>;
|
|
108
|
+
/** Verbatim standard statements (canonical ID -> text) for the Standards Alignment judge dimension. */
|
|
109
|
+
standardStatements?: Record<string, string>;
|
|
110
|
+
modelOptions?: ModelResolutionOptions;
|
|
111
|
+
}
|
|
112
|
+
declare function judgeMasterLessonStep(input: JudgeMasterLessonStepInput): Promise<CurriculumQualityReport>;
|
|
113
|
+
interface RepairMasterLessonStepInput {
|
|
114
|
+
milestone: MilestoneInput;
|
|
115
|
+
language: string;
|
|
116
|
+
topic?: string;
|
|
117
|
+
targetAudience?: string;
|
|
118
|
+
auditReport: CurriculumQualityReport;
|
|
119
|
+
/** Pre-rendered STANDARDS CONTEXT block — kept across repair so grounding is never lost. */
|
|
120
|
+
standardsContext?: string;
|
|
121
|
+
modelOptions?: ModelResolutionOptions;
|
|
122
|
+
}
|
|
123
|
+
declare function repairMasterLessonStep(input: RepairMasterLessonStepInput): Promise<LessonPlan>;
|
|
124
|
+
|
|
125
|
+
declare function generateActivityStep(options: {
|
|
126
|
+
lesson: LessonPlan;
|
|
127
|
+
language: string;
|
|
128
|
+
modelOptions?: ModelResolutionOptions;
|
|
129
|
+
}): Promise<ActivityLab>;
|
|
130
|
+
declare function generateCodeLabStep(options: {
|
|
131
|
+
lesson: LessonPlan;
|
|
132
|
+
activity: ActivityLab;
|
|
133
|
+
language: string;
|
|
134
|
+
targetTechStack?: string[];
|
|
135
|
+
modelOptions?: ModelResolutionOptions;
|
|
136
|
+
}): Promise<CodeLab>;
|
|
137
|
+
declare function generateSelfLabStep(options: {
|
|
138
|
+
milestone: MilestoneInput;
|
|
139
|
+
language: string;
|
|
140
|
+
targetTechStack?: string[];
|
|
141
|
+
modelOptions?: ModelResolutionOptions;
|
|
142
|
+
}): Promise<SelfLab>;
|
|
143
|
+
declare function generateDiagnosticQuizStep(options: {
|
|
144
|
+
milestone: MilestoneInput;
|
|
145
|
+
language: string;
|
|
146
|
+
modelOptions?: ModelResolutionOptions;
|
|
147
|
+
}): Promise<DiagnosticQuiz>;
|
|
148
|
+
declare function generateSlidesStep(options: {
|
|
149
|
+
lesson: LessonPlan;
|
|
150
|
+
language: string;
|
|
151
|
+
modelOptions?: ModelResolutionOptions;
|
|
152
|
+
}): Promise<SlideDeck>;
|
|
153
|
+
declare function generateHandoutStep(options: {
|
|
154
|
+
lesson: LessonPlan;
|
|
155
|
+
language: string;
|
|
156
|
+
modelOptions?: ModelResolutionOptions;
|
|
157
|
+
}): Promise<Handout>;
|
|
158
|
+
declare function generateWorksheetStep(options: {
|
|
159
|
+
lesson: LessonPlan;
|
|
160
|
+
language: string;
|
|
161
|
+
modelOptions?: ModelResolutionOptions;
|
|
162
|
+
}): Promise<Worksheet>;
|
|
163
|
+
declare function generateTeacherGuideStep(options: {
|
|
164
|
+
lesson: LessonPlan;
|
|
165
|
+
activity: ActivityLab;
|
|
166
|
+
language: string;
|
|
167
|
+
modelOptions?: ModelResolutionOptions;
|
|
168
|
+
}): Promise<TeacherGuide>;
|
|
169
|
+
declare function generateExtensionStep(options: {
|
|
170
|
+
lesson: LessonPlan;
|
|
171
|
+
activity: ActivityLab;
|
|
172
|
+
language: string;
|
|
173
|
+
modelOptions?: ModelResolutionOptions;
|
|
174
|
+
}): Promise<Extension>;
|
|
175
|
+
|
|
176
|
+
interface JudgeSatelliteStepInput {
|
|
177
|
+
artifactType: string;
|
|
178
|
+
artifactId: string;
|
|
179
|
+
artifact: unknown;
|
|
180
|
+
language: string;
|
|
181
|
+
targetObjectives: Array<{
|
|
182
|
+
code: string;
|
|
183
|
+
description: string;
|
|
184
|
+
bloomLevel: string;
|
|
185
|
+
}>;
|
|
186
|
+
standardStatements?: Record<string, string>;
|
|
187
|
+
modelOptions?: ModelResolutionOptions;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Gate step for satellite artifacts (LLM_JUDGE mode).
|
|
191
|
+
* Judges any artifact JSON against the same 6-dimension rubric; returns the report.
|
|
192
|
+
* The workflow decides what to do with the verdict (log / block / store) — gate config stays the single source of truth.
|
|
193
|
+
*/
|
|
194
|
+
declare function judgeSatelliteStep(input: JudgeSatelliteStepInput): Promise<CurriculumQualityReport>;
|
|
195
|
+
|
|
196
|
+
interface SaveMilestoneArtifactsInput {
|
|
197
|
+
jobId: string;
|
|
198
|
+
milestoneSlug: string;
|
|
199
|
+
lesson: LessonPlan;
|
|
200
|
+
activity?: ActivityLab;
|
|
201
|
+
codeLab?: CodeLab;
|
|
202
|
+
selfLab?: SelfLab;
|
|
203
|
+
quiz?: DiagnosticQuiz;
|
|
204
|
+
slides?: SlideDeck;
|
|
205
|
+
handout?: Handout;
|
|
206
|
+
worksheet?: Worksheet;
|
|
207
|
+
teacherGuide?: TeacherGuide;
|
|
208
|
+
extension?: Extension;
|
|
209
|
+
cheatSheetMarkdown?: string;
|
|
210
|
+
baseWorkspaceDir?: string;
|
|
211
|
+
}
|
|
212
|
+
interface SavedMilestoneResult {
|
|
213
|
+
milestoneSlug: string;
|
|
214
|
+
savedFiles: string[];
|
|
215
|
+
}
|
|
216
|
+
declare function saveMilestoneToWorkspaceStep(input: SaveMilestoneArtifactsInput): Promise<SavedMilestoneResult>;
|
|
217
|
+
declare function publishToGitStep(options: GitPublishOptions): Promise<GitPublishResult>;
|
|
218
|
+
declare function publishToSupabaseStep(options: SupabasePublishOptions): Promise<SupabasePublishResult>;
|
|
219
|
+
|
|
220
|
+
declare const approvalPayloadSchema: z.ZodObject<{
|
|
221
|
+
approved: z.ZodBoolean;
|
|
222
|
+
reviewerName: z.ZodOptional<z.ZodString>;
|
|
223
|
+
feedback: z.ZodOptional<z.ZodString>;
|
|
224
|
+
timestamp: z.ZodOptional<z.ZodString>;
|
|
225
|
+
}, "strip", z.ZodTypeAny, {
|
|
226
|
+
approved: boolean;
|
|
227
|
+
feedback?: string | undefined;
|
|
228
|
+
timestamp?: string | undefined;
|
|
229
|
+
reviewerName?: string | undefined;
|
|
230
|
+
}, {
|
|
231
|
+
approved: boolean;
|
|
232
|
+
feedback?: string | undefined;
|
|
233
|
+
timestamp?: string | undefined;
|
|
234
|
+
reviewerName?: string | undefined;
|
|
235
|
+
}>;
|
|
236
|
+
type ApprovalPayload = z.infer<typeof approvalPayloadSchema>;
|
|
237
|
+
/**
|
|
238
|
+
* Durable Hook for Human-in-the-Loop curriculum approval gates.
|
|
239
|
+
* Pauses workflow with zero compute cost until an authorized user approves via UI/API.
|
|
240
|
+
*/
|
|
241
|
+
declare const lessonApprovalHook: any;
|
|
242
|
+
|
|
243
|
+
interface ExecuteWithRateLimitOptions<T> {
|
|
244
|
+
stepName: string;
|
|
245
|
+
fn: () => Promise<T>;
|
|
246
|
+
maxAttempts?: number;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Wraps async LLM functions to automatically catch 429/503/transient network errors
|
|
250
|
+
* and throw a durable RetryableError with exponential backoff for Vercel Workflow runtime.
|
|
251
|
+
*/
|
|
252
|
+
declare function withRateLimitBackoff<T>(options: ExecuteWithRateLimitOptions<T>): Promise<T>;
|
|
253
|
+
|
|
254
|
+
interface MilestoneWorkflowInput {
|
|
255
|
+
jobId: string;
|
|
256
|
+
milestone: MilestoneInput;
|
|
257
|
+
language?: string;
|
|
258
|
+
topic?: string;
|
|
259
|
+
targetAudience?: string;
|
|
260
|
+
techStack?: string[];
|
|
261
|
+
bundleTier?: 'minimum' | 'full';
|
|
262
|
+
baseWorkspaceDir?: string;
|
|
263
|
+
modelOptions?: ModelResolutionOptions;
|
|
264
|
+
/** Adopted Framework Packs (hydrated from the Standards Registry) for standards-grounded generation. */
|
|
265
|
+
standardsPacks?: FrameworkPack[];
|
|
266
|
+
/** Hard-block the milestone when standards coverage FAILs (default: true when packs provided). */
|
|
267
|
+
enforceStandardsCoverage?: boolean;
|
|
268
|
+
/** Gate Settings thô (vd: gateModes từ project.config.json) — kit tự chuẩn hoá. */
|
|
269
|
+
gateSettings?: unknown;
|
|
270
|
+
}
|
|
271
|
+
interface MilestoneWorkflowResult {
|
|
272
|
+
milestoneId: string;
|
|
273
|
+
milestoneSlug: string;
|
|
274
|
+
status: 'SUCCESS' | 'FAILED';
|
|
275
|
+
savedResult: SavedMilestoneResult;
|
|
276
|
+
judgeReport?: CurriculumQualityReport;
|
|
277
|
+
/** Per-artifact-type judge reports for satellites (Gate mode LLM_JUDGE only). */
|
|
278
|
+
satelliteJudgeReports?: Record<string, CurriculumQualityReport>;
|
|
279
|
+
/** The resolved gate settings actually applied in this run (for traceability). */
|
|
280
|
+
gatesResolved?: Record<string, string>;
|
|
281
|
+
/** Set when a Gate (e.g. HITL rejection) BLOCKED downstream production. */
|
|
282
|
+
gateBlocked?: {
|
|
283
|
+
artifactType: string;
|
|
284
|
+
reason: 'HITL_REJECTED' | 'HITL_REJECTED_V2';
|
|
285
|
+
feedback?: string;
|
|
286
|
+
};
|
|
287
|
+
standardsCoverage?: CoverageGateReport;
|
|
288
|
+
artifacts: {
|
|
289
|
+
lesson: LessonPlan;
|
|
290
|
+
activity?: ActivityLab;
|
|
291
|
+
codeLab?: CodeLab;
|
|
292
|
+
selfLab?: SelfLab;
|
|
293
|
+
quiz?: DiagnosticQuiz;
|
|
294
|
+
slides?: SlideDeck;
|
|
295
|
+
handout?: Handout;
|
|
296
|
+
worksheet?: Worksheet;
|
|
297
|
+
teacherGuide?: TeacherGuide;
|
|
298
|
+
extension?: Extension;
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Child Workflow: Executes fine-grained durable generation for a single Milestone.
|
|
303
|
+
* Uses Step-level memoization, automatic LLM retries, and parallel satellite generation.
|
|
304
|
+
*/
|
|
305
|
+
declare function generateMilestoneWorkflow(input: MilestoneWorkflowInput): Promise<MilestoneWorkflowResult>;
|
|
306
|
+
|
|
307
|
+
interface GenerateRoadmapWorkflowInput {
|
|
308
|
+
jobId?: string;
|
|
309
|
+
roadmap: ProjectRoadmap;
|
|
310
|
+
language?: string;
|
|
311
|
+
bundleTier?: 'minimum' | 'full';
|
|
312
|
+
batchSize?: number;
|
|
313
|
+
/** Gate Settings thô (vd: gateModes từ project.config.json) — kit tự chuẩn hoá. */
|
|
314
|
+
gateSettings?: unknown;
|
|
315
|
+
baseWorkspaceDir?: string;
|
|
316
|
+
gitPublishOptions?: Omit<GitPublishOptions, 'jobId' | 'localJobDir'>;
|
|
317
|
+
supabasePublishOptions?: Omit<SupabasePublishOptions, 'jobId' | 'courseTitle' | 'topic' | 'language' | 'milestones'>;
|
|
318
|
+
modelOptions?: ModelResolutionOptions;
|
|
319
|
+
}
|
|
320
|
+
interface RoadmapWorkflowSummary {
|
|
321
|
+
jobId: string;
|
|
322
|
+
courseTitle: string;
|
|
323
|
+
topic: string;
|
|
324
|
+
language: string;
|
|
325
|
+
totalMilestones: number;
|
|
326
|
+
successfulMilestones: number;
|
|
327
|
+
failedMilestones: number;
|
|
328
|
+
results: Array<{
|
|
329
|
+
milestoneId: string;
|
|
330
|
+
status: 'FULFILLED' | 'REJECTED';
|
|
331
|
+
result?: MilestoneWorkflowResult;
|
|
332
|
+
error?: string;
|
|
333
|
+
}>;
|
|
334
|
+
gitPublishResult?: GitPublishResult;
|
|
335
|
+
supabasePublishResult?: SupabasePublishResult;
|
|
336
|
+
workspaceDir: string;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Parent Workflow: Orchestrates durable generation of an entire Curriculum Roadmap.
|
|
340
|
+
* Implements Batching (Pattern 1), Failure Isolation, and Dual-Target Publishing (Git + Supabase).
|
|
341
|
+
*/
|
|
342
|
+
declare function generateRoadmapWorkflow(input: GenerateRoadmapWorkflowInput): Promise<RoadmapWorkflowSummary>;
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Step-level durable execution for generating a single standalone artifact.
|
|
346
|
+
*/
|
|
347
|
+
declare function executeSingleArtifactStep(request: SingleArtifactRequest): Promise<SingleArtifactResult>;
|
|
348
|
+
/**
|
|
349
|
+
* Workflow for on-demand single artifact generation.
|
|
350
|
+
* Supports Vercel Workflow durable execution, step memoization, and automatic retry.
|
|
351
|
+
*/
|
|
352
|
+
declare function generateSingleArtifactWorkflow(request: SingleArtifactRequest): Promise<SingleArtifactResult>;
|
|
353
|
+
|
|
354
|
+
export { type ArtifactType as A, parseGateSettings as B, type CurriculumGateMode as C, DEFAULT_GATE_SETTINGS as D, resolveGateSettings as E, gateModeFor as F, type GenerateMasterLessonStepInput as G, approvalPayloadSchema as H, type ApprovalPayload as I, type JudgeMasterLessonStepInput as J, lessonApprovalHook as K, type ExecuteWithRateLimitOptions as L, withRateLimitBackoff as M, type MilestoneWorkflowInput as N, type MilestoneWorkflowResult as O, generateMilestoneWorkflow as P, type GenerateRoadmapWorkflowInput as Q, type ResolvedGateSettings as R, type ScaffoldingLevel as S, type RoadmapWorkflowSummary as T, generateRoadmapWorkflow as U, executeSingleArtifactStep as V, generateSingleArtifactWorkflow as W, type SingleArtifactRequest as a, type SingleArtifactResult as b, generateSingleArtifact as c, generateMasterLessonStep as d, type RepairMasterLessonStepInput as e, generateActivityStep as f, getArtifactMetadata as g, generateCodeLabStep as h, generateSelfLabStep as i, judgeMasterLessonStep as j, generateDiagnosticQuizStep as k, generateSlidesStep as l, generateHandoutStep as m, generateWorksheetStep as n, generateTeacherGuideStep as o, generateExtensionStep as p, type JudgeSatelliteStepInput as q, repairMasterLessonStep as r, judgeSatelliteStep as s, type SaveMilestoneArtifactsInput as t, type SavedMilestoneResult as u, saveMilestoneToWorkspaceStep as v, publishToGitStep as w, publishToSupabaseStep as x, type CurriculumArtifactType as y, type GateSettings as z };
|
package/dist/index.cjs
CHANGED
|
@@ -11712,6 +11712,9 @@ async function streamLayerPrefillWithFallback(options, onChunk) {
|
|
|
11712
11712
|
budgetOrExistingSpecs = "",
|
|
11713
11713
|
cognitiveScaffolding = ""
|
|
11714
11714
|
} = accumulatedData;
|
|
11715
|
+
const language = typeof options.language === "string" && options.language ? options.language : typeof accumulatedData.language === "string" && accumulatedData.language ? accumulatedData.language : "vi";
|
|
11716
|
+
const textLangMandate = language === "vi" ? "natural, fluent Vietnamese (Ti\u1EBFng Vi\u1EC7t)" : language === "en" ? "natural, fluent English" : `natural, fluent ${language}`;
|
|
11717
|
+
const choiceLangMandate = language === "vi" ? "in Vietnamese" : language === "en" ? "in English" : `in ${language}`;
|
|
11715
11718
|
const systemPrompt = `You are @analyst, a Senior Curriculum Architect operating under International Curriculum Standards (UbD, Cognitive Load Theory, Bruner Spiral, BSCS 5E).
|
|
11716
11719
|
STANDARDS POLICY: Any academicBenchmark value you propose MUST be a framework ID from the org's Standards Registry (e.g. 'csta-k12-2017', 'gdpt-2018-tin-hoc'). NEVER name-drop a framework that is not in the registry \u2014 the generation pipeline grounds lessons with VERBATIM statements loaded from the registry by this ID.
|
|
11717
11720
|
Your task is to generate PROACTIVE HIGH-FIDELITY PRE-FILLED values for Layer ${targetLayer} in a 4-Layer Concentric Curriculum Creation Wizard.
|
|
@@ -11747,8 +11750,8 @@ ${targetLayer === 1 ? `
|
|
|
11747
11750
|
- Field 7 (id: 'assessmentStrategy', type: 'single_choice'): Grading weights (e.g. 40% Formative Process + 60% Capstone Rubric).
|
|
11748
11751
|
`}
|
|
11749
11752
|
|
|
11750
|
-
- EVERY text/textarea field MUST have a complete, professional, ready-to-use pre-filled text in
|
|
11751
|
-
- EVERY choice field MUST have realistic concrete options
|
|
11753
|
+
- EVERY text/textarea field MUST have a complete, professional, ready-to-use pre-filled text in ${textLangMandate} adhering strictly to standard pedagogical terminology. NO placeholders, NO empty strings.
|
|
11754
|
+
- EVERY choice field MUST have realistic concrete options ${choiceLangMandate} with EXACTLY ONE recommended option (selected: true).
|
|
11752
11755
|
|
|
11753
11756
|
RETURN STRICT VALID JSON ONLY adhering exactly to this format:
|
|
11754
11757
|
{
|
|
@@ -13397,6 +13400,23 @@ async function generateRoadmapWorkflow(input) {
|
|
|
13397
13400
|
};
|
|
13398
13401
|
}
|
|
13399
13402
|
|
|
13403
|
+
// src/workflow/workflows/singleArtifactWorkflow.ts
|
|
13404
|
+
async function executeSingleArtifactStep(request) {
|
|
13405
|
+
"use step";
|
|
13406
|
+
const t0 = Date.now();
|
|
13407
|
+
console.log(` \u23F3 [Step: Single Artifact] Generating ${request.artifactType.toUpperCase()} for "${request.topic.slice(0, 35)}"...`);
|
|
13408
|
+
const res = await withRateLimitBackoff({
|
|
13409
|
+
stepName: `generate-single-artifact-${request.artifactType}-${(request.topic || "topic").slice(0, 20)}`,
|
|
13410
|
+
fn: async () => generateSingleArtifact(request)
|
|
13411
|
+
});
|
|
13412
|
+
console.log(` \u2705 [Step: Single Artifact] Done in ${((Date.now() - t0) / 1e3).toFixed(1)}s (File: "${res.filename}")`);
|
|
13413
|
+
return res;
|
|
13414
|
+
}
|
|
13415
|
+
async function generateSingleArtifactWorkflow(request) {
|
|
13416
|
+
"use workflow";
|
|
13417
|
+
return executeSingleArtifactStep(request);
|
|
13418
|
+
}
|
|
13419
|
+
|
|
13400
13420
|
// src/index.ts
|
|
13401
13421
|
init_errors();
|
|
13402
13422
|
|
|
@@ -15189,6 +15209,7 @@ exports.ensureExpositionForLesson = ensureExpositionForLesson;
|
|
|
15189
15209
|
exports.ensureKnowledgeExposition = ensureKnowledgeExposition;
|
|
15190
15210
|
exports.evaluateStandardsCoverage = evaluateStandardsCoverage;
|
|
15191
15211
|
exports.executeCurriculumCommand = executeCurriculumCommand;
|
|
15212
|
+
exports.executeSingleArtifactStep = executeSingleArtifactStep;
|
|
15192
15213
|
exports.exportAllProjectQuizzes = exportAllProjectQuizzes;
|
|
15193
15214
|
exports.expositionCacheKey = expositionCacheKey;
|
|
15194
15215
|
exports.extractScopeSequenceRows = extractScopeSequenceRows;
|
|
@@ -15222,6 +15243,7 @@ exports.generateSelfLabFlow = generateSelfLabFlow;
|
|
|
15222
15243
|
exports.generateSelfLabStep = generateSelfLabStep;
|
|
15223
15244
|
exports.generateSelfPacedBundle = generateSelfPacedBundle;
|
|
15224
15245
|
exports.generateSingleArtifact = generateSingleArtifact;
|
|
15246
|
+
exports.generateSingleArtifactWorkflow = generateSingleArtifactWorkflow;
|
|
15225
15247
|
exports.generateSlidesFlow = generateSlidesFlow;
|
|
15226
15248
|
exports.generateSlidesStep = generateSlidesStep;
|
|
15227
15249
|
exports.generateTeacherGuideFlow = generateTeacherGuideFlow;
|