@thanh01.pmt/curriculum-kit 1.0.2 → 1.0.3
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-PDw11tpD.d.cts → index-BIhxrUEa.d.cts} +6 -1
- package/dist/{index-BAUtASfr.d.ts → index-BvWC_xXe.d.ts} +6 -1
- package/dist/index.cjs +294 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +294 -18
- package/dist/index.mjs.map +1 -1
- package/dist/workflow/index.cjs +320 -44
- package/dist/workflow/index.cjs.map +1 -1
- package/dist/workflow/index.d.cts +1 -1
- package/dist/workflow/index.d.ts +1 -1
- package/dist/workflow/index.mjs +319 -43
- package/dist/workflow/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -11,8 +11,8 @@ export { b as ArtifactLifecycleInfo, A as ArtifactLifecycleState, L as LessonArt
|
|
|
11
11
|
export { FileSystemCurriculumAdapter, FileSystemStorageOptions, STANDARD_SOT_FILES, StorageFactoryOptions, SupabaseCurriculumAdapter, SupabaseStorageConfig, computeContentHash, createCurriculumStorage } from './storage/index.cjs';
|
|
12
12
|
import { F as FrameworkPack } from './standardsCoverageGate-BWAkXY76.cjs';
|
|
13
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.cjs';
|
|
14
|
-
import { R as ResolvedGateSettings } from './index-
|
|
15
|
-
export { I as ApprovalPayload, A as ArtifactType, y as CurriculumArtifactType, C as CurriculumGateMode, D as DEFAULT_GATE_SETTINGS, L as ExecuteWithRateLimitOptions, z as GateSettings, G as GenerateMasterLessonStepInput, Q as GenerateRoadmapWorkflowInput, J as JudgeMasterLessonStepInput, q as JudgeSatelliteStepInput, N as MilestoneWorkflowInput, O as MilestoneWorkflowResult, e as RepairMasterLessonStepInput, T as RoadmapWorkflowSummary, t as SaveMilestoneArtifactsInput, u as SavedMilestoneResult, S as ScaffoldingLevel, a as SingleArtifactRequest, b as SingleArtifactResult, H as approvalPayloadSchema, V as executeSingleArtifactStep, F as gateModeFor, f as generateActivityStep, h as generateCodeLabStep, k as generateDiagnosticQuizStep, p as generateExtensionStep, m as generateHandoutStep, d as generateMasterLessonStep, P as generateMilestoneWorkflow, U as generateRoadmapWorkflow, i as generateSelfLabStep, c as generateSingleArtifact, W as generateSingleArtifactWorkflow, l as generateSlidesStep, o as generateTeacherGuideStep, n as generateWorksheetStep, g as getArtifactMetadata, j as judgeMasterLessonStep, s as judgeSatelliteStep, K as lessonApprovalHook, B as parseGateSettings, w as publishToGitStep, x as publishToSupabaseStep, r as repairMasterLessonStep, E as resolveGateSettings, v as saveMilestoneToWorkspaceStep, M as withRateLimitBackoff } from './index-
|
|
14
|
+
import { R as ResolvedGateSettings } from './index-BIhxrUEa.cjs';
|
|
15
|
+
export { I as ApprovalPayload, A as ArtifactType, y as CurriculumArtifactType, C as CurriculumGateMode, D as DEFAULT_GATE_SETTINGS, L as ExecuteWithRateLimitOptions, z as GateSettings, G as GenerateMasterLessonStepInput, Q as GenerateRoadmapWorkflowInput, J as JudgeMasterLessonStepInput, q as JudgeSatelliteStepInput, N as MilestoneWorkflowInput, O as MilestoneWorkflowResult, e as RepairMasterLessonStepInput, T as RoadmapWorkflowSummary, t as SaveMilestoneArtifactsInput, u as SavedMilestoneResult, S as ScaffoldingLevel, a as SingleArtifactRequest, b as SingleArtifactResult, H as approvalPayloadSchema, V as executeSingleArtifactStep, F as gateModeFor, f as generateActivityStep, h as generateCodeLabStep, k as generateDiagnosticQuizStep, p as generateExtensionStep, m as generateHandoutStep, d as generateMasterLessonStep, P as generateMilestoneWorkflow, U as generateRoadmapWorkflow, i as generateSelfLabStep, c as generateSingleArtifact, W as generateSingleArtifactWorkflow, l as generateSlidesStep, o as generateTeacherGuideStep, n as generateWorksheetStep, g as getArtifactMetadata, j as judgeMasterLessonStep, s as judgeSatelliteStep, K as lessonApprovalHook, B as parseGateSettings, w as publishToGitStep, x as publishToSupabaseStep, r as repairMasterLessonStep, E as resolveGateSettings, v as saveMilestoneToWorkspaceStep, M as withRateLimitBackoff } from './index-BIhxrUEa.cjs';
|
|
16
16
|
export { DeliveryPackResult, JobManifest, LocalWorkspaceManager, ParsedQuizQuestion, buildDeliveryPackages, exportAllProjectQuizzes, formatQuizzesToCsv, parseQuizMarkdown } from './publishers/index.cjs';
|
|
17
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.cjs';
|
|
18
18
|
export { BUNDLED_STANDARDS_PACK_IDS, HydratedPack, ImportPackResult, SelectedStatement, StandardStackOptions, StandardsRegistryAdapter, StandardsRegistryConfig, StandardsSelectionInput, buildStandardStackMarkdown, buildStandardsContext, buildStandardsContextBlock, resolveStandardsPacks, selectStatementsForLesson } from './standards/index.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -11,8 +11,8 @@ export { b as ArtifactLifecycleInfo, A as ArtifactLifecycleState, L as LessonArt
|
|
|
11
11
|
export { FileSystemCurriculumAdapter, FileSystemStorageOptions, STANDARD_SOT_FILES, StorageFactoryOptions, SupabaseCurriculumAdapter, SupabaseStorageConfig, computeContentHash, createCurriculumStorage } from './storage/index.js';
|
|
12
12
|
import { F as FrameworkPack } from './standardsCoverageGate-BWAkXY76.js';
|
|
13
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 { R as ResolvedGateSettings } from './index-
|
|
15
|
-
export { I as ApprovalPayload, A as ArtifactType, y as CurriculumArtifactType, C as CurriculumGateMode, D as DEFAULT_GATE_SETTINGS, L as ExecuteWithRateLimitOptions, z as GateSettings, G as GenerateMasterLessonStepInput, Q as GenerateRoadmapWorkflowInput, J as JudgeMasterLessonStepInput, q as JudgeSatelliteStepInput, N as MilestoneWorkflowInput, O as MilestoneWorkflowResult, e as RepairMasterLessonStepInput, T as RoadmapWorkflowSummary, t as SaveMilestoneArtifactsInput, u as SavedMilestoneResult, S as ScaffoldingLevel, a as SingleArtifactRequest, b as SingleArtifactResult, H as approvalPayloadSchema, V as executeSingleArtifactStep, F as gateModeFor, f as generateActivityStep, h as generateCodeLabStep, k as generateDiagnosticQuizStep, p as generateExtensionStep, m as generateHandoutStep, d as generateMasterLessonStep, P as generateMilestoneWorkflow, U as generateRoadmapWorkflow, i as generateSelfLabStep, c as generateSingleArtifact, W as generateSingleArtifactWorkflow, l as generateSlidesStep, o as generateTeacherGuideStep, n as generateWorksheetStep, g as getArtifactMetadata, j as judgeMasterLessonStep, s as judgeSatelliteStep, K as lessonApprovalHook, B as parseGateSettings, w as publishToGitStep, x as publishToSupabaseStep, r as repairMasterLessonStep, E as resolveGateSettings, v as saveMilestoneToWorkspaceStep, M as withRateLimitBackoff } from './index-
|
|
14
|
+
import { R as ResolvedGateSettings } from './index-BvWC_xXe.js';
|
|
15
|
+
export { I as ApprovalPayload, A as ArtifactType, y as CurriculumArtifactType, C as CurriculumGateMode, D as DEFAULT_GATE_SETTINGS, L as ExecuteWithRateLimitOptions, z as GateSettings, G as GenerateMasterLessonStepInput, Q as GenerateRoadmapWorkflowInput, J as JudgeMasterLessonStepInput, q as JudgeSatelliteStepInput, N as MilestoneWorkflowInput, O as MilestoneWorkflowResult, e as RepairMasterLessonStepInput, T as RoadmapWorkflowSummary, t as SaveMilestoneArtifactsInput, u as SavedMilestoneResult, S as ScaffoldingLevel, a as SingleArtifactRequest, b as SingleArtifactResult, H as approvalPayloadSchema, V as executeSingleArtifactStep, F as gateModeFor, f as generateActivityStep, h as generateCodeLabStep, k as generateDiagnosticQuizStep, p as generateExtensionStep, m as generateHandoutStep, d as generateMasterLessonStep, P as generateMilestoneWorkflow, U as generateRoadmapWorkflow, i as generateSelfLabStep, c as generateSingleArtifact, W as generateSingleArtifactWorkflow, l as generateSlidesStep, o as generateTeacherGuideStep, n as generateWorksheetStep, g as getArtifactMetadata, j as judgeMasterLessonStep, s as judgeSatelliteStep, K as lessonApprovalHook, B as parseGateSettings, w as publishToGitStep, x as publishToSupabaseStep, r as repairMasterLessonStep, E as resolveGateSettings, v as saveMilestoneToWorkspaceStep, M as withRateLimitBackoff } from './index-BvWC_xXe.js';
|
|
16
16
|
export { DeliveryPackResult, JobManifest, LocalWorkspaceManager, ParsedQuizQuestion, buildDeliveryPackages, exportAllProjectQuizzes, formatQuizzesToCsv, parseQuizMarkdown } from './publishers/index.js';
|
|
17
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
18
|
export { BUNDLED_STANDARDS_PACK_IDS, HydratedPack, ImportPackResult, SelectedStatement, StandardStackOptions, StandardsRegistryAdapter, StandardsRegistryConfig, StandardsSelectionInput, buildStandardStackMarkdown, buildStandardsContext, buildStandardsContextBlock, resolveStandardsPacks, selectStatementsForLesson } from './standards/index.js';
|
package/dist/index.mjs
CHANGED
|
@@ -9311,12 +9311,14 @@ var __filename2 = typeof import.meta?.url === "string" ? fileURLToPath(import.me
|
|
|
9311
9311
|
var _resolvedDir = __filename2 ? path3.dirname(__filename2) : typeof __dirname !== "undefined" ? __dirname : process.cwd();
|
|
9312
9312
|
function loadCurriculumTemplate(templateName) {
|
|
9313
9313
|
const candidatePaths = [
|
|
9314
|
-
path3.resolve(
|
|
9314
|
+
path3.resolve("/Users/tonypham/MEGA/WebApp/WIP/learnwell-platform/packages/curriculum-kit/docs/refs/templates", templateName),
|
|
9315
9315
|
path3.resolve(process.cwd(), "packages/curriculum-kit/docs/refs/templates", templateName),
|
|
9316
|
+
path3.resolve(process.cwd(), "_templates", templateName),
|
|
9316
9317
|
path3.resolve(process.cwd(), "docs/refs/templates", templateName),
|
|
9317
9318
|
path3.resolve(_resolvedDir, "../docs/refs/templates", templateName),
|
|
9318
9319
|
path3.resolve(_resolvedDir, "../../docs/refs/templates", templateName),
|
|
9319
9320
|
path3.resolve(_resolvedDir, "../../../docs/refs/templates", templateName),
|
|
9321
|
+
path3.resolve("/Users/tonypham/MEGA/WebApp/content-gen/the-ultimate-curriculum-agent-os/_templates", templateName),
|
|
9320
9322
|
path3.resolve(_resolvedDir, "../../../../the-ultimate-curriculum-agent-os/_templates", templateName)
|
|
9321
9323
|
];
|
|
9322
9324
|
for (const p of candidatePaths) {
|
|
@@ -10741,11 +10743,14 @@ async function produceBatchLessons(storage, projectId, lessonIds, options = {})
|
|
|
10741
10743
|
// src/services/singleArtifactService.ts
|
|
10742
10744
|
init_streamRunner();
|
|
10743
10745
|
init_errors();
|
|
10744
|
-
function getArtifactMetadata(type, lessonId) {
|
|
10746
|
+
function getArtifactMetadata(type, lessonId, pedagogy) {
|
|
10745
10747
|
const id = lessonId || "ON_DEMAND";
|
|
10746
10748
|
switch (type) {
|
|
10747
|
-
case "lesson":
|
|
10748
|
-
|
|
10749
|
+
case "lesson": {
|
|
10750
|
+
const p = (pedagogy || "").toLowerCase();
|
|
10751
|
+
const templateFile = p === "edp" ? "LESSON_EDP_template.md" : p === "general" ? "LESSON_GENERAL_template.md" : "LESSON_5E_template.md";
|
|
10752
|
+
return { filename: `LESSON_${id}.md`, persona: "@content", templateFile };
|
|
10753
|
+
}
|
|
10749
10754
|
case "slide":
|
|
10750
10755
|
return { filename: `SLIDE_${id}.md`, persona: "@illustrator", templateFile: "SLIDE_template.md" };
|
|
10751
10756
|
case "act":
|
|
@@ -10786,6 +10791,8 @@ function getArtifactMetadata(type, lessonId) {
|
|
|
10786
10791
|
return { filename: `REVIEW_GAME_${id}.md`, persona: "@assessor", templateFile: "REVIEW_GAME_template.md" };
|
|
10787
10792
|
case "graphic_organizer":
|
|
10788
10793
|
return { filename: `GRAPHIC_ORGANIZER_${id}.md`, persona: "@illustrator", templateFile: "GRAPHIC_ORGANIZER_template.md" };
|
|
10794
|
+
default:
|
|
10795
|
+
return { filename: `ARTIFACT_${id}.md`, persona: "@content", templateFile: "LESSON_5E_template.md" };
|
|
10789
10796
|
}
|
|
10790
10797
|
}
|
|
10791
10798
|
async function generateSingleArtifact(req) {
|
|
@@ -10798,24 +10805,50 @@ async function generateSingleArtifact(req) {
|
|
|
10798
10805
|
targetAge = "14-18 years old (High School / Early College)",
|
|
10799
10806
|
scaffoldingLevel = "balanced",
|
|
10800
10807
|
hardwarePlatform = ["MacBook Lab (macOS 14+ / Swift 6)"],
|
|
10808
|
+
gradeLevel,
|
|
10809
|
+
studentCount,
|
|
10810
|
+
language = "Vietnamese",
|
|
10811
|
+
extraContext,
|
|
10812
|
+
config,
|
|
10801
10813
|
contextSot = {},
|
|
10802
10814
|
options = {},
|
|
10803
10815
|
onChunk
|
|
10804
10816
|
} = req;
|
|
10805
|
-
const meta = getArtifactMetadata(artifactType, lessonId);
|
|
10806
|
-
const templateContent = loadCurriculumTemplate(meta.templateFile);
|
|
10817
|
+
const meta = getArtifactMetadata(artifactType, lessonId, pedagogy || config?.pedagogicalModel);
|
|
10807
10818
|
const displayTitle = lessonTitle || topic;
|
|
10819
|
+
const loadedTemplate = loadCurriculumTemplate(meta.templateFile);
|
|
10820
|
+
const templateContent = loadedTemplate || getDefaultFallbackTemplate(artifactType, displayTitle, lessonId || "ON_DEMAND");
|
|
10808
10821
|
const hwStr = hardwarePlatform.join(", ");
|
|
10822
|
+
const selectedDevices = (config?.devices || (hardwarePlatform[0]?.toLowerCase().includes("paper") ? "paper-only" : "laptop")).toLowerCase();
|
|
10823
|
+
const isBilingual = language.toLowerCase().includes("bilingual") || language.toLowerCase().includes("song");
|
|
10824
|
+
const isVietnamese = !isBilingual && language.toLowerCase().includes("viet");
|
|
10825
|
+
const langRule = isBilingual ? `1. AUTHORING LANGUAGE: Bilingual (Vietnamese - English). Headings and core conceptual definitions should be presented in Vietnamese with English technical terms in parentheses. Explanations and instructional text are in Vietnamese. Key code terms, comments, and challenge summaries are presented bilingually.` : isVietnamese ? `1. AUTHORING LANGUAGE: Vietnamese for all instructional text, explanations, questions, rubrics, and presenter notes. Programming code, syntax keywords, and standard API identifiers remain in standard English (with Vietnamese explanation comments/notes).` : `1. AUTHORING LANGUAGE: 100% English (Plan C Canonical Specification).`;
|
|
10826
|
+
const isPaperOnly = selectedDevices === "paper-only" || hwStr.toLowerCase().includes("paper") || hwStr.toLowerCase().includes("print-ready");
|
|
10827
|
+
const deviceRule = isPaperOnly ? `
|
|
10828
|
+
- \u{1F4C4} PAPER-ONLY / NO-DEVICE ENVIRONMENT: The learning space has NO computers or screens. All exercises, worksheets, task cards, exit tickets, and code analyses MUST be 100% printable. Provide write-in blank boxes, printed code snippets with line numbers, tracing tables, and physical manipulative instructions.` : selectedDevices === "tablet" || selectedDevices === "smartphone" ? `
|
|
10829
|
+
- \u{1F4F1} MOBILE/TABLET ENVIRONMENT: Activities should be optimized for touch interfaces and mobile/tablet sandboxes (e.g. Swift Playgrounds, Web IDEs, tap/touch interactions).` : `
|
|
10830
|
+
- \u{1F4BB} LAPTOP/DESKTOP ENVIRONMENT: Full keyboard, terminal, multi-file code editing, and browser developer tooling are available.`;
|
|
10831
|
+
const classDynamicsRule = studentCount ? `
|
|
10832
|
+
- \u{1F465} CLASS SIZE LOGISTICS: Class has exactly ${studentCount} students. Structure group sizes, pair-programming pairs, station rotations, and material distribution to realistically accommodate ${studentCount} students without bottlenecks.` : "";
|
|
10833
|
+
const scaffoldingRule = scaffoldingLevel === "foundation" ? `
|
|
10834
|
+
- \u{1FA9C} FOUNDATION SCAFFOLDING: High instructional support. Provide step-by-step numbered breakdowns, concrete real-world analogies, hints for every problem, scaffolded starter code/fill-in-the-blanks, and frequent check-for-understanding prompts.` : scaffoldingLevel === "advanced" ? `
|
|
10835
|
+
- \u{1F680} ADVANCED CHALLENGE: Minimal scaffolding. Focus on deeper system architecture, edge case handling, computational complexity, performance optimization, and open-ended extension challenges.` : `
|
|
10836
|
+
- \u2696\uFE0F BALANCED SCAFFOLDING: Balanced approach combining structured teacher guidance with independent inquiry and problem solving.`;
|
|
10837
|
+
const extraContextRule = extraContext ? `
|
|
10838
|
+
- \u{1F3AF} CRITICAL USER INSTRUCTIONS (MANDATORY): "${extraContext}". You MUST directly reflect and satisfy every point of this user guidance in the generated artifact!` : "";
|
|
10839
|
+
const artifactSpecializedPrompt = getArtifactSpecializedInvariants(artifactType, {
|
|
10840
|
+
...req,
|
|
10841
|
+
studentCount});
|
|
10809
10842
|
const systemPrompt = `You are ${meta.persona}, an expert Curriculum & Pedagogical Specialist in the Curriculum OS Multi-Agent Team.
|
|
10810
10843
|
Your task is to author a canonical, publication-grade learning artifact of type "${artifactType.toUpperCase()}".
|
|
10811
10844
|
|
|
10812
10845
|
### CORE OPERATIONAL INVARIANTS:
|
|
10813
|
-
|
|
10846
|
+
${langRule}
|
|
10814
10847
|
2. NON-MOCK CODE INVARIANT: Any code snippet provided MUST be 100% syntactically valid, idiomatic, and executable without placeholders or fake functions.
|
|
10815
10848
|
3. PEDAGOGICAL GROUNDING: Strictly align with the ${pedagogy.toUpperCase()} model, Bloom's Revised Taxonomy, and IEEE/ACM CS2023 guidelines.
|
|
10816
|
-
4. SCAFFOLDING LEVEL: "${scaffoldingLevel.toUpperCase()}"
|
|
10817
|
-
5. TARGET AUDIENCE: ${targetAge} on ${hwStr}
|
|
10818
|
-
6. OUTPUT INTEGRITY: Output clean Markdown starting directly with YAML frontmatter. Do not wrap entire response in triple backticks
|
|
10849
|
+
4. SCAFFOLDING LEVEL: "${scaffoldingLevel.toUpperCase()}".${scaffoldingRule}
|
|
10850
|
+
5. TARGET AUDIENCE: ${gradeLevel ? `Grade ${gradeLevel}, ` : ""}${targetAge} on ${hwStr}.${deviceRule}${classDynamicsRule}${extraContextRule}
|
|
10851
|
+
6. OUTPUT INTEGRITY: Output clean Markdown starting directly with YAML frontmatter. Do not wrap entire response in triple backticks.${artifactSpecializedPrompt}`;
|
|
10819
10852
|
const userPrompt = `### CONTEXT GROUND TRUTH:
|
|
10820
10853
|
- Topic / Concept Domain: "${topic}"
|
|
10821
10854
|
- Lesson ID: "${lessonId || "ON_DEMAND"}"
|
|
@@ -10823,7 +10856,13 @@ Your task is to author a canonical, publication-grade learning artifact of type
|
|
|
10823
10856
|
- Pedagogy: "${pedagogy.toUpperCase()}"
|
|
10824
10857
|
- Scaffolding Level: "${scaffoldingLevel}"
|
|
10825
10858
|
- Hardware Environment: "${hwStr}"
|
|
10826
|
-
|
|
10859
|
+
${gradeLevel ? `- Target Grade Level: "${gradeLevel}"
|
|
10860
|
+
` : ""}${studentCount ? `- Class Size: "${studentCount} students"
|
|
10861
|
+
` : ""}- Target Language: "${language}"
|
|
10862
|
+
${selectedDevices ? `- Device Mode: "${selectedDevices}"
|
|
10863
|
+
` : ""}${extraContext ? `- User Specific Guidance & Requirements: "${extraContext}"
|
|
10864
|
+
` : ""}${config ? `- Full Task Config: ${JSON.stringify(config)}
|
|
10865
|
+
` : ""}
|
|
10827
10866
|
${contextSot.framework ? `### SOT CURRICULUM FRAMEWORK:
|
|
10828
10867
|
${contextSot.framework.slice(0, 1500)}
|
|
10829
10868
|
` : ""}
|
|
@@ -10837,15 +10876,10 @@ ${contextSot.handout.slice(0, 1e3)}
|
|
|
10837
10876
|
### MANDATORY CANONICAL TEMPLATE CONTRACT:
|
|
10838
10877
|
Use the following reference template structure as the exact specification:
|
|
10839
10878
|
|
|
10840
|
-
${templateContent
|
|
10841
|
-
id: "${lessonId || "ON_DEMAND"}"
|
|
10842
|
-
title: "${displayTitle}"
|
|
10843
|
-
type: "${artifactType.toUpperCase()}"
|
|
10844
|
-
---
|
|
10845
|
-
# ${displayTitle}`}
|
|
10879
|
+
${templateContent}
|
|
10846
10880
|
|
|
10847
10881
|
### TASK INSTRUCTION:
|
|
10848
|
-
Generate the complete, thorough,
|
|
10882
|
+
Generate the complete, thorough, publication-grade "${artifactType.toUpperCase()}" artifact for "${displayTitle}". Ensure all [REQUIRED] sections are fully developed with realistic, detailed pedagogical and technical content. Strictly follow the specialized invariants for "${artifactType.toUpperCase()}".`;
|
|
10849
10883
|
let accumulatedContent = "";
|
|
10850
10884
|
let accumulatedThought = "";
|
|
10851
10885
|
try {
|
|
@@ -10884,6 +10918,248 @@ Generate the complete, thorough, production-grade "${artifactType.toUpperCase()}
|
|
|
10884
10918
|
});
|
|
10885
10919
|
}
|
|
10886
10920
|
}
|
|
10921
|
+
function getArtifactSpecializedInvariants(type, req) {
|
|
10922
|
+
const cfg = req.config || {};
|
|
10923
|
+
const isPaperOnly = cfg.devices === "paper-only" || req.hardwarePlatform?.some((h) => h.toLowerCase().includes("paper"));
|
|
10924
|
+
const studentCount = req.studentCount || "25";
|
|
10925
|
+
switch (type) {
|
|
10926
|
+
case "slide": {
|
|
10927
|
+
const slideCount = cfg.slideCount || 10;
|
|
10928
|
+
const presentationStyle = cfg.presentationStyle || "modern";
|
|
10929
|
+
const presentationDuration = cfg.presentationDuration || 45;
|
|
10930
|
+
const includeSpeakerNotes = cfg.includeSpeakerNotes !== false;
|
|
10931
|
+
return `
|
|
10932
|
+
### \u{1F3AC} SLIDE PRESENTATION & MARP ARCHITECTURE INVARIANTS:
|
|
10933
|
+
1. **SLIDE COUNT & TIMING TARGET**:
|
|
10934
|
+
- Generate EXACTLY ${slideCount} slides separated by \`---\` horizontal rules.
|
|
10935
|
+
- Pacing: Target total duration is ${presentationDuration} minutes (~${Math.round(Number(presentationDuration) / Number(slideCount))} mins per slide).
|
|
10936
|
+
- Visual Style: "${presentationStyle.toUpperCase()}". Maintain high visual clarity, contrasting accents, and executive polish.
|
|
10937
|
+
2. **STRICT CONCISENESS & 6x6 RULE (ABSOLUTELY NO TEXT WALLS)**:
|
|
10938
|
+
- A slide is a VISUAL PROJECTION CANVAS, NOT a textbook or lesson plan!
|
|
10939
|
+
- Maximum 4\u20136 bullet points per slide.
|
|
10940
|
+
- Maximum 8\u201312 words per bullet point. Forbid dense multi-sentence paragraphs on the slide surface.
|
|
10941
|
+
3. **SPEAKER NOTES FOR ALL SPOKEN WORDS (<!-- Presenter Notes: ... -->)**:
|
|
10942
|
+
${includeSpeakerNotes ? "- MANDATORY: Every single slide MUST contain comprehensive presenter notes in `<!-- Presenter Notes: ... -->` at the bottom, giving the teacher the exact verbal talking points, analogies, and pacing tips." : "- Optional brief presenter notes."}
|
|
10943
|
+
4. **CLICK-TO-REVEAL SYSTEM**:
|
|
10944
|
+
- Use \`<!-- clicks -->\` before bulleted lists (\`<ul>\` or \`<ol>\`) for incremental click-to-reveal.
|
|
10945
|
+
- Use \`<!-- click -->\` before answers, code reveals, or key callouts.
|
|
10946
|
+
5. **2-COLUMN / SPLIT LAYOUT**:
|
|
10947
|
+
- Use <div class="columns"><div>...</div><div>...</div></div> for side-by-side concept vs. code or problem vs. solution comparisons.
|
|
10948
|
+
6. **CONCISE CODE SNIPPETS**:
|
|
10949
|
+
- Maximum 6\u201310 lines of clean code per snippet with inline comments. Never paste whole files.
|
|
10950
|
+
7. **MERMAID VISUALS**:
|
|
10951
|
+
- Use Mermaid flowcharts or sequence diagrams for workflows and control loops.`;
|
|
10952
|
+
}
|
|
10953
|
+
case "tiered_practice": {
|
|
10954
|
+
const techStack = cfg.techStack || (req.hardwarePlatform?.[0] || "Modern Programming Language");
|
|
10955
|
+
const includeUnitTests = cfg.includeUnitTests !== false;
|
|
10956
|
+
return `
|
|
10957
|
+
### \u{1FA9C} TIERED PRACTICE ARCHITECTURE INVARIANTS (3-TIER ADAPTIVE):
|
|
10958
|
+
- Target Technology Stack: "${techStack}"
|
|
10959
|
+
${includeUnitTests ? "- Automated Testing: Include explicit executable Unit Tests / Assertions for verifying Bronze, Silver, and Gold tiers." : ""}
|
|
10960
|
+
1. **3 EXPLICIT RIGOR TIERS**:
|
|
10961
|
+
- **\u{1F949} Tier 1 (Bronze / C\u01A1 b\u1EA3n)**: 70% starter boilerplate / 30% fill-in. Direct recall, scaffolded fill-in-the-blanks, single-concept recognition with starter hints.
|
|
10962
|
+
- **\u{1F948} Tier 2 (Silver / Ti\xEAu chu\u1EA9n)**: 30% starter boilerplate / 70% implementation. Independent multi-step problem solving, bug identification, synthesis of 2+ concepts.
|
|
10963
|
+
- **\u{1F947} Tier 3 (Gold / Th\u1EED th\xE1ch)**: 0% code / open architecture. Edge case handling, algorithmic optimization, open-ended architectural design or extension.
|
|
10964
|
+
2. **COMPLETE WORKED SOLUTIONS & ANSWER KEYS**:
|
|
10965
|
+
- Provide step-by-step worked solutions for every problem across all 3 tiers.
|
|
10966
|
+
3. **SELF-DIAGNOSTIC RUBRIC**:
|
|
10967
|
+
- Include a clear student rubric with criteria for when a student is ready to level up from Bronze \u2794 Silver \u2794 Gold.`;
|
|
10968
|
+
}
|
|
10969
|
+
case "exit_ticket": {
|
|
10970
|
+
const questionCount = cfg.questionCount || 3;
|
|
10971
|
+
const diagnosticFocus = cfg.diagnosticFocus || "misconceptions";
|
|
10972
|
+
return `
|
|
10973
|
+
### \u{1F39F}\uFE0F EXIT TICKET ARCHITECTURE INVARIANTS:
|
|
10974
|
+
1. **EXACTLY ${questionCount} TARGETED ITEMS (3\u20135 MINUTE DURATION)**:
|
|
10975
|
+
- Item 1: Quick diagnostic checking mastery of the core objective.
|
|
10976
|
+
- Item 2: Application with diagnostic trap focusing on: "${diagnosticFocus}".
|
|
10977
|
+
- Item 3: Metacognitive self-check (Confidence rating 1\u20135 + "Explain what is still fuzzy").
|
|
10978
|
+
2. **TEACHER DIAGNOSTIC INTERVENTION GUIDE**:
|
|
10979
|
+
- Provide a quick lookup table: "If student chooses/writes X \u2794 Misconception is Y \u2794 Quick remedy is Z".${isPaperOnly ? "\n3. **PRINTABLE CUT-OUT FORMAT**: Include student name/date line and cut-border dashed line." : ""}`;
|
|
10980
|
+
}
|
|
10981
|
+
case "quiz": {
|
|
10982
|
+
const questionCount = cfg.questionCount || 5;
|
|
10983
|
+
const questionTypes = Array.isArray(cfg.questionTypes) ? cfg.questionTypes.join(", ") : cfg.questionTypes || "multiple_choice";
|
|
10984
|
+
const diagnosticFocus = cfg.diagnosticFocus || "balanced";
|
|
10985
|
+
return `
|
|
10986
|
+
### \u{1F4DD} BLOOM-ALIGNED QUIZ ARCHITECTURE INVARIANTS:
|
|
10987
|
+
1. **EXACTLY ${questionCount} QUESTIONS (${questionTypes.toUpperCase()})**:
|
|
10988
|
+
- Diagnostic emphasis: "${diagnosticFocus}".
|
|
10989
|
+
- 40% Remember/Understand (Conceptual foundations).
|
|
10990
|
+
- 40% Apply/Analyze (Bug finding, code tracing, scenario application).
|
|
10991
|
+
- 20% Evaluate/Create (Algorithmic reasoning, trade-off evaluation).
|
|
10992
|
+
2. **HIGH-QUALITY DISTRACTORS WITH RATIONALE**:
|
|
10993
|
+
- For every multiple choice item, explain WHY each incorrect option is a plausible misconception and WHY the key is correct.
|
|
10994
|
+
3. **COMPLETE ANSWER KEY & SCORING RUBRIC**:
|
|
10995
|
+
- Explicit point distribution, partial credit guidelines, and sample ideal answers for open-ended questions.`;
|
|
10996
|
+
}
|
|
10997
|
+
case "task_cards": {
|
|
10998
|
+
const cardCount = cfg.cardCount || 12;
|
|
10999
|
+
const cardUsage = cfg.cardUsage || "stations";
|
|
11000
|
+
return `
|
|
11001
|
+
### \u{1F4CB} TASK CARDS ARCHITECTURE INVARIANTS:
|
|
11002
|
+
1. **SET OF EXACTLY ${cardCount} NUMBERED CARDS (Optimized for ${cardUsage.toUpperCase()})**:
|
|
11003
|
+
- Clearly mark each card: Card # (1 to ${cardCount}), Difficulty (Foundation / Standard / Challenge), and Target Skill.
|
|
11004
|
+
2. **STUDENT RECORDING SHEET (B\u1EA2NG GHI \u0110\xC1P \xC1N)**:
|
|
11005
|
+
- Include a structured printable grid where students record answers for Cards 1\u2013${cardCount}.
|
|
11006
|
+
3. **TEACHER MASTER KEY**:
|
|
11007
|
+
- Quick reference key with verified answers and explanations.${isPaperOnly ? "\n4. **PRINT-READY CARD BORDERS**: Layout with clean visual borders ready for physical printing and cutting." : ""}`;
|
|
11008
|
+
}
|
|
11009
|
+
case "graphic_organizer": {
|
|
11010
|
+
const diagramType = cfg.diagramType || "concept_map";
|
|
11011
|
+
const includeFillIn = cfg.includeFillInExercise !== false;
|
|
11012
|
+
return `
|
|
11013
|
+
### \u{1F4CA} GRAPHIC ORGANIZER ARCHITECTURE INVARIANTS:
|
|
11014
|
+
1. **VISUAL MODEL TYPE: "${diagramType.toUpperCase()}"**:
|
|
11015
|
+
- Structure a clear cognitive thinking tool: Concept Map, Flowchart, Venn Diagram, Hierarchy Tree, or Cause-Effect Matrix.
|
|
11016
|
+
2. **VALID MERMAID SYNTAX**:
|
|
11017
|
+
- Embed complete, 100% syntactically correct Mermaid diagrams showing the knowledge structure.
|
|
11018
|
+
3. **ACTIVE STUDENT INTERACTION PROMPTS**:
|
|
11019
|
+
${includeFillIn ? "- Include interactive fill-in-the-blank nodes and connection articulation challenges." : "- Include synthesis and reflection prompts based on the visual model."}`;
|
|
11020
|
+
}
|
|
11021
|
+
case "choice_board": {
|
|
11022
|
+
const gridSize = cfg.gridSize || "3x3";
|
|
11023
|
+
const completionRule = cfg.completionRule || "row_column_diagonal";
|
|
11024
|
+
return `
|
|
11025
|
+
### \u{1F3AF} CHOICE BOARD ARCHITECTURE INVARIANTS (UDL ${gridSize.toUpperCase()} MATRIX):
|
|
11026
|
+
1. **${gridSize.toUpperCase()} MENU (UDL MULTIPLE MEANS OF EXPRESSION)**:
|
|
11027
|
+
- Option tasks spanning practical coding, architectural diagrams, analytical writing, and real-world scenarios.
|
|
11028
|
+
2. **COMPLETION CONTRACT: "${completionRule.toUpperCase()}"**:
|
|
11029
|
+
- Explicit rule (e.g. Tic-Tac-Toe 3-in-a-row/column/diagonal, or Point Bounty system).
|
|
11030
|
+
3. **UNIFIED EVALUATION RUBRIC**:
|
|
11031
|
+
- Consistent grading criteria applicable across all task choices on the board.`;
|
|
11032
|
+
}
|
|
11033
|
+
case "station_rotation": {
|
|
11034
|
+
const stationCount = cfg.stationCount || 3;
|
|
11035
|
+
const stationDuration = cfg.stationDuration || 15;
|
|
11036
|
+
return `
|
|
11037
|
+
### \u{1F504} STATION ROTATION ARCHITECTURE INVARIANTS:
|
|
11038
|
+
1. **EXACTLY ${stationCount} STATIONS SCALED FOR ${studentCount} STUDENTS**:
|
|
11039
|
+
- Group size: ~${Math.ceil(Number(studentCount) / Number(stationCount)) || 7} students per group.
|
|
11040
|
+
- Distinct station roles: Teacher-Led Small Group, Independent Practical Lab, Collaborative / Unplugged Peer Challenge.
|
|
11041
|
+
2. **TIMING & TRANSITIONS (${stationDuration} MINS/STATION)**:
|
|
11042
|
+
- ${stationDuration} minutes per station + 3-minute structured rotation protocol.
|
|
11043
|
+
3. **STATION DELIVERABLES & ACCOUNTABILITY**:
|
|
11044
|
+
- Clear check-in deliverable required at each station to ensure on-task accountability.`;
|
|
11045
|
+
}
|
|
11046
|
+
case "act":
|
|
11047
|
+
case "codelab":
|
|
11048
|
+
case "science_lab": {
|
|
11049
|
+
const techStack = cfg.techStack || (req.hardwarePlatform?.[0] || "Modern Programming Language");
|
|
11050
|
+
const includeUnitTests = cfg.includeUnitTests !== false;
|
|
11051
|
+
return `
|
|
11052
|
+
### \u{1F4BB} HANDS-ON LAB & CODE ACTIVITY ARCHITECTURE INVARIANTS:
|
|
11053
|
+
- Technology Stack: "${techStack}"
|
|
11054
|
+
${includeUnitTests ? "- Unit Testing: Provide automated assertions or test runner checks." : ""}
|
|
11055
|
+
1. **100% RUNNABLE CODE / RIGOROUS PROCEDURE**:
|
|
11056
|
+
- Absolutely no fake APIs, mock functions, or non-executable pseudocode.
|
|
11057
|
+
2. **STRUCTURED LAB PHASES**:
|
|
11058
|
+
- Objective & Environmental Prerequisites.
|
|
11059
|
+
- Starter Skeleton Code with clear \`// TODO [Student Task]\` comments.
|
|
11060
|
+
- Step-by-step Guided Challenges (Level 1 \u2794 Level 2 \u2794 Level 3).
|
|
11061
|
+
- Automated Verification / Test Cases.
|
|
11062
|
+
- Complete Reference Solution with design explanation.`;
|
|
11063
|
+
}
|
|
11064
|
+
case "bell_ringer":
|
|
11065
|
+
return `
|
|
11066
|
+
### \u{1F514} BELL RINGER ARCHITECTURE INVARIANTS (3\u20135 MIN WARM-UP):
|
|
11067
|
+
1. **3 QUICK HOOK QUESTIONS**:
|
|
11068
|
+
- 2 rapid-fire recall questions activating previous knowledge.
|
|
11069
|
+
- 1 curiosity hook question bridging into today's core topic.
|
|
11070
|
+
2. **60-SECOND TEACHER REVIEW KEY**:
|
|
11071
|
+
- Quick-glance answer key for instant whole-class review.`;
|
|
11072
|
+
case "review_game":
|
|
11073
|
+
return `
|
|
11074
|
+
### \u{1F3AE} REVIEW GAME ARCHITECTURE INVARIANTS:
|
|
11075
|
+
1. **GAMIFIED STRUCTURE**:
|
|
11076
|
+
- Jeopardy-style board (3\u20134 Categories x 3 Point Values: 100 / 200 / 300) OR 3-Round Interactive Trivia.
|
|
11077
|
+
2. **CLEAR RULES & TEAM DYNAMICS**:
|
|
11078
|
+
- Team scoring rules, buzz-in protocol, and tie-breaker challenge.
|
|
11079
|
+
3. **COMPLETE QUESTION & ANSWER DECK**:
|
|
11080
|
+
- Verified answers and point values for the host/teacher.`;
|
|
11081
|
+
case "guide": {
|
|
11082
|
+
const lessonDuration = cfg.lessonDuration || 90;
|
|
11083
|
+
return `
|
|
11084
|
+
### \u{1F4D6} TEACHER GUIDE ARCHITECTURE INVARIANTS (${lessonDuration} MINS LESSON):
|
|
11085
|
+
1. **MINUTE-BY-MINUTE PACING TIMELINE**:
|
|
11086
|
+
- Pacing broken down for ${lessonDuration} minutes (Hook, Modeling, Guided Practice, Independent Practice, Debrief).
|
|
11087
|
+
2. **SOCRATIC QUESTIONS & PROMPTS**:
|
|
11088
|
+
- Cold-call questions with anticipated student misconceptions and remediation scripts.
|
|
11089
|
+
3. **DIFFERENTIATION STRATEGIES**:
|
|
11090
|
+
- Specific adaptations for students needing support vs. high-flyers needing extension.`;
|
|
11091
|
+
}
|
|
11092
|
+
case "worksheet":
|
|
11093
|
+
case "handout":
|
|
11094
|
+
return `
|
|
11095
|
+
### \u{1F4D1} WORKSHEET / HANDOUT ARCHITECTURE INVARIANTS:
|
|
11096
|
+
1. **I DO \u2794 WE DO \u2794 YOU DO SCAFFOLDING**:
|
|
11097
|
+
- Part 1 (I Do): Fully worked and annotated example.
|
|
11098
|
+
- Part 2 (We Do): Guided problem with fill-in hints and scaffolding scaffolds.
|
|
11099
|
+
- Part 3 (You Do): Independent mastery challenge.
|
|
11100
|
+
2. **SELF-CHECK RUBRIC**:
|
|
11101
|
+
- End-of-worksheet self-evaluation checklist.${isPaperOnly ? "\n3. **PRINTABLE WORKSPACES**: Include spacious, clean write-in boxes and workspace for calculations/code." : ""}`;
|
|
11102
|
+
case "rubric": {
|
|
11103
|
+
const rubricScale = cfg.rubricScale || "4_levels";
|
|
11104
|
+
return `
|
|
11105
|
+
### \u{1F4CA} ANALYTIC RUBRIC ARCHITECTURE INVARIANTS (${rubricScale.toUpperCase()} SCALE):
|
|
11106
|
+
1. **RIGOROUS PROFICIENCY LEVELS**:
|
|
11107
|
+
- 4 Proficiency Levels: Level 4 (Exemplary) | Level 3 (Proficient) | Level 2 (Developing) | Level 1 (Beginning).
|
|
11108
|
+
2. **CONCRETE OBSERVABLE CRITERIA**:
|
|
11109
|
+
- Each cell MUST describe concrete, observable behavioral evidence, not vague words like "good" or "average".`;
|
|
11110
|
+
}
|
|
11111
|
+
case "glossary":
|
|
11112
|
+
return `
|
|
11113
|
+
### \u{1F4DA} TECHNICAL GLOSSARY ARCHITECTURE INVARIANTS:
|
|
11114
|
+
1. **COMPREHENSIVE TERM PROFILES**:
|
|
11115
|
+
- For every key term: Technical Definition, Real-world Analogy, Code Syntax Example, and Common Misconception.`;
|
|
11116
|
+
case "bom":
|
|
11117
|
+
return `
|
|
11118
|
+
### \u{1F4E6} BILL OF MATERIALS (BOM) ARCHITECTURE INVARIANTS:
|
|
11119
|
+
1. **CLASS-SCALED INVENTORY FOR ${studentCount} STUDENTS**:
|
|
11120
|
+
- Exact quantities calculated for ${studentCount} students.
|
|
11121
|
+
- Component specifications, estimated unit cost, and affordable alternatives.`;
|
|
11122
|
+
case "lesson": {
|
|
11123
|
+
const lessonDuration = cfg.lessonDuration || 90;
|
|
11124
|
+
const pedagogicalModel = cfg.pedagogicalModel || req.pedagogy || "5e";
|
|
11125
|
+
return `
|
|
11126
|
+
### \u{1F393} CANONICAL LESSON PLAN INVARIANTS (${pedagogicalModel.toUpperCase()} MODEL, ${lessonDuration} MINS):
|
|
11127
|
+
1. **A. LESSON DESIGN PLAN**:
|
|
11128
|
+
- Learning Objectives (Bloom-aligned) & Observable Student Evidence.
|
|
11129
|
+
- Activity Sequence mapping every phase with timing totaling ${lessonDuration} minutes.
|
|
11130
|
+
- Resource Map & Assessment Map with explicit Artifact Contracts.
|
|
11131
|
+
2. **B. LESSON FLOW**:
|
|
11132
|
+
- Detailed teacher moves, student actions, scripted key questions, and check-for-understanding points for every activity phase.`;
|
|
11133
|
+
}
|
|
11134
|
+
default:
|
|
11135
|
+
return "";
|
|
11136
|
+
}
|
|
11137
|
+
}
|
|
11138
|
+
function getDefaultFallbackTemplate(type, title, id) {
|
|
11139
|
+
const upperType = type.toUpperCase();
|
|
11140
|
+
return `---
|
|
11141
|
+
id: "${id}"
|
|
11142
|
+
title: "${title}"
|
|
11143
|
+
type: "${upperType}"
|
|
11144
|
+
version: "1.0.0"
|
|
11145
|
+
date: "${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}"
|
|
11146
|
+
---
|
|
11147
|
+
|
|
11148
|
+
# ${title}
|
|
11149
|
+
|
|
11150
|
+
## 1. Overview & Learning Objectives
|
|
11151
|
+
<!-- [REQUIRED] State 2-3 measurable, Bloom-aligned learning objectives -->
|
|
11152
|
+
|
|
11153
|
+
## 2. Core Pedagogical Content
|
|
11154
|
+
<!-- [REQUIRED] Provide the core educational substance, questions, problems, and diagrams -->
|
|
11155
|
+
|
|
11156
|
+
## 3. Practice & Differentiation
|
|
11157
|
+
<!-- [REQUIRED] Tiered support, worked examples, and challenges -->
|
|
11158
|
+
|
|
11159
|
+
## 4. Assessment & Answer Key
|
|
11160
|
+
<!-- [REQUIRED] Complete solutions, rubrics, and diagnostic teacher feedback -->
|
|
11161
|
+
`;
|
|
11162
|
+
}
|
|
10887
11163
|
|
|
10888
11164
|
// src/services/projectCreationService.ts
|
|
10889
11165
|
init_streamRunner();
|