@thanh01.pmt/curriculum-kit 1.4.18 → 1.4.21

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.d.ts CHANGED
@@ -9,11 +9,11 @@ export { ArtifactLintReport, ConvertedSotBundle, GenerateProjectInstructionOptio
9
9
  export { A as AutoRepairOptions, a as AutoRepairResult, B as BundleTier, G as GenerateMilestoneBundleOptions, M as MilestoneCurriculumBundle, g as generateMilestoneCurriculumBundle, w as withAutoRepair } from './milestoneBundleGenerator-Bkba8OPG.js';
10
10
  import { I as ICurriculumStorage, P as ProjectStatusReport, S as SmartResumeContext, Q as QualityAuditReport } from './types-BUJGYiep.js';
11
11
  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';
12
- export { FileSystemCurriculumAdapter, FileSystemStorageOptions, STANDARD_SOT_FILES, StorageFactoryOptions, SupabaseCurriculumAdapter, SupabaseStorageConfig, computeContentHash, createCurriculumStorage } from './storage/index.js';
12
+ export { FileSystemCurriculumAdapter, FileSystemStorageOptions, STANDARD_SOT_FILES, StorageFactoryOptions, SupabaseCurriculumAdapter, SupabaseStorageConfig, atomicWriteFileSync, computeContentHash, createCurriculumStorage } from './storage/index.js';
13
13
  import { F as FrameworkPack, C as CoverageGateReport } from './standardsCoverageGate-DR5YTtlt.js';
14
14
  export { B as BloomHintSchema, a as ClassificationSchema, m as CoverageGateInput, h as FrameworkMapping, d as FrameworkMappingSchema, f as FrameworkPackManifest, b as FrameworkPackManifestSchema, e as FrameworkPackSchema, g as FrameworkStatement, c as FrameworkStatementSchema, G as GradeBandSchema, i as MappingKind, M as MappingKindSchema, P as PackLintIssue, k as PackValidationResult, j as RecordProvenance, R as RecordProvenanceSchema, S as StatementCoverageRow, n as evaluateStandardsCoverage, l as lintFrameworkPack, v as validateFrameworkPack } from './standardsCoverageGate-DR5YTtlt.js';
15
- import { R as ResolvedGateSettings } from './gateSettings-L3FR2-MO.js';
16
- export { A as ArtifactType, b as CurriculumArtifactType, C as CurriculumGateMode, D as DEFAULT_GATE_SETTINGS, G as GateSettings, c as ScaffoldingLevel, S as SingleArtifactRequest, a as SingleArtifactResult, g as gateModeFor, e as generateSingleArtifact, d as getArtifactMetadata, p as parseGateSettings, r as resolveGateSettings } from './gateSettings-L3FR2-MO.js';
15
+ import { R as ResolvedGateSettings } from './gateSettings-DabOqP6_.js';
16
+ export { A as ArtifactType, B as BoundaryPeek, b as CurriculumArtifactType, C as CurriculumGateMode, h as CurriculumHorizon, D as DEFAULT_GATE_SETTINGS, f as DetailedLessonBridge, E as ExtractCurriculumHorizonOptions, G as GateSettings, H as HorizonSessionSnapshot, i as HorizonValidationResult, c as ScaffoldingLevel, S as SingleArtifactRequest, a as SingleArtifactResult, k as extractCurriculumHorizon, g as gateModeFor, e as generateSingleArtifact, d as getArtifactMetadata, j as parseAllSessions, p as parseGateSettings, l as renderHorizonPromptBlock, r as resolveGateSettings, v as validateHorizonCompliance } from './gateSettings-DabOqP6_.js';
17
17
  import { z } from 'zod';
18
18
  export { DeliveryPackResult, JobManifest, LocalWorkspaceManager, ParsedQuizQuestion, buildDeliveryPackages, exportAllProjectQuizzes, formatQuizzesToCsv, parseQuizMarkdown } from './publishers/index.js';
19
19
  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';
@@ -227,6 +227,73 @@ declare function produceBatchLessons(storage: ICurriculumStorage, projectId: str
227
227
  report: ProjectStatusReport;
228
228
  }>;
229
229
 
230
+ interface ExcerptOptions {
231
+ /**
232
+ * Canonical (English) section keys to prioritize, in order.
233
+ * Each key's body is included before moving to the next priority.
234
+ */
235
+ priorities?: string[];
236
+ /** Character budget for the excerpt (default 12_000, ~3k tokens). */
237
+ budget?: number;
238
+ /**
239
+ * Section Language Contract mapping (Record or raw contract markdown).
240
+ * Used to resolve localized headings (e.g. Vietnamese) to canonical keys.
241
+ */
242
+ sectionLanguageContract?: Record<string, Record<string, string>> | string;
243
+ /** File name or artifact type hint (e.g. 'LESSON', 'KNOWLEDGE_EXPOSITION'). */
244
+ artifactType?: string;
245
+ /**
246
+ * Source file name (e.g. `LESSON_U03_M01_L06.md`) — artifact type derived
247
+ * from it when `artifactType` is not given. Matches the web app's builder
248
+ * option so both call-sites share one contract.
249
+ */
250
+ fileName?: string;
251
+ /** Min chars below which the excerpt is flagged as insufficient (default 400). */
252
+ minContentChars?: number;
253
+ }
254
+ interface ExcerptResult {
255
+ /** Excerpt markdown safe to inject into prompt context blocks. */
256
+ excerpt: string;
257
+ /** True when the source parsed cleanly, passed sufficiency checks, and resolved priorities. */
258
+ verified: boolean;
259
+ /** True when canonical section resolution matched at least one priority section. */
260
+ sectionAware: boolean;
261
+ /** Canonical section keys included in the excerpt, in order. */
262
+ includedSections: string[];
263
+ /** Warning or error flags explaining why verified === false. */
264
+ issues: string[];
265
+ /** Approximate token count (chars / 4). */
266
+ tokenEstimate: number;
267
+ }
268
+ declare const DEFAULT_LESSON_PRIORITIES: string[];
269
+ /**
270
+ * Priorities for the canonical-lesson excerpt injected into SATELLITE artifact
271
+ * contexts (ACT, QUIZ, SLIDE, ...). Excludes 'Symbol & Identifier Ledger' —
272
+ * the symbol registry is injected as its own dedicated block
273
+ * ([MANDATORY CODE SYMBOL REGISTRY]) to avoid duplicated ground truth.
274
+ */
275
+ declare const SATELLITE_LESSON_PRIORITIES: string[];
276
+ declare const DEFAULT_KX_PRIORITIES: string[];
277
+ declare function buildSectionAwareExcerpt(markdown: string, opts?: ExcerptOptions): ExcerptResult;
278
+ declare function buildExpositionExcerpt(markdown: string, opts?: Omit<ExcerptOptions, 'priorities'>): ExcerptResult;
279
+ declare function buildLessonExcerpt(markdown: string, opts?: Omit<ExcerptOptions, 'priorities'>): ExcerptResult;
280
+ /**
281
+ * Normalizes SLC input into a two-level map: Record<ArtifactType, Record<CanonicalKey, LocalizedLabel>>
282
+ */
283
+ declare function normalizeSlcContract(slc: Record<string, Record<string, string>> | string | undefined): Record<string, Record<string, string>> | undefined;
284
+ /**
285
+ * Extracts code symbol & identifier contracts from LESSON markdown.
286
+ * Provides deterministic symbol names (Primary Struct/Class, Entry File, Key Functions)
287
+ * so all satellite agents (@activity, @illustrator, @assessor) inherit them verbatim.
288
+ */
289
+ interface SymbolLedgerResult {
290
+ primarySymbol?: string;
291
+ entryFileName?: string;
292
+ keySymbols: string[];
293
+ rawBlock: string;
294
+ }
295
+ declare function extractSymbolLedger(lessonMarkdown: string): SymbolLedgerResult;
296
+
230
297
  interface ProjectCreationPayload {
231
298
  projectName: string;
232
299
  projectCode: string;
@@ -669,66 +736,6 @@ declare function extractSectionHeadingsFromSLC(slcInput: Record<string, Record<s
669
736
  */
670
737
  declare function buildHeadingDirective(artifactType: string, slcMarkdown?: Record<string, Record<string, string>> | string | null, targetLanguage?: string): string;
671
738
 
672
- interface ExcerptOptions {
673
- /**
674
- * Canonical (English) section keys to prioritize, in order.
675
- * Each key's body is included before moving to the next priority.
676
- */
677
- priorities?: string[];
678
- /** Character budget for the excerpt (default 12_000, ~3k tokens). */
679
- budget?: number;
680
- /**
681
- * Section Language Contract mapping (Record or raw contract markdown).
682
- * Used to resolve localized headings (e.g. Vietnamese) to canonical keys.
683
- */
684
- sectionLanguageContract?: Record<string, Record<string, string>> | string;
685
- /** File name or artifact type hint (e.g. 'LESSON', 'KNOWLEDGE_EXPOSITION'). */
686
- artifactType?: string;
687
- /**
688
- * Source file name (e.g. `LESSON_U03_M01_L06.md`) — artifact type derived
689
- * from it when `artifactType` is not given. Matches the web app's builder
690
- * option so both call-sites share one contract.
691
- */
692
- fileName?: string;
693
- /** Min chars below which the excerpt is flagged as insufficient (default 400). */
694
- minContentChars?: number;
695
- }
696
- interface ExcerptResult {
697
- /** Excerpt markdown safe to inject into prompt context blocks. */
698
- excerpt: string;
699
- /** True when the source parsed cleanly, passed sufficiency checks, and resolved priorities. */
700
- verified: boolean;
701
- /** True when canonical section resolution matched at least one priority section. */
702
- sectionAware: boolean;
703
- /** Canonical section keys included in the excerpt, in order. */
704
- includedSections: string[];
705
- /** Warning or error flags explaining why verified === false. */
706
- issues: string[];
707
- /** Approximate token count (chars / 4). */
708
- tokenEstimate: number;
709
- }
710
- declare const DEFAULT_LESSON_PRIORITIES: string[];
711
- declare const DEFAULT_KX_PRIORITIES: string[];
712
- declare function buildSectionAwareExcerpt(markdown: string, opts?: ExcerptOptions): ExcerptResult;
713
- declare function buildExpositionExcerpt(markdown: string, opts?: Omit<ExcerptOptions, 'priorities'>): ExcerptResult;
714
- declare function buildLessonExcerpt(markdown: string, opts?: Omit<ExcerptOptions, 'priorities'>): ExcerptResult;
715
- /**
716
- * Normalizes SLC input into a two-level map: Record<ArtifactType, Record<CanonicalKey, LocalizedLabel>>
717
- */
718
- declare function normalizeSlcContract(slc: Record<string, Record<string, string>> | string | undefined): Record<string, Record<string, string>> | undefined;
719
- /**
720
- * Extracts code symbol & identifier contracts from LESSON markdown.
721
- * Provides deterministic symbol names (Primary Struct/Class, Entry File, Key Functions)
722
- * so all satellite agents (@activity, @illustrator, @assessor) inherit them verbatim.
723
- */
724
- interface SymbolLedgerResult {
725
- primarySymbol?: string;
726
- entryFileName?: string;
727
- keySymbols: string[];
728
- rawBlock: string;
729
- }
730
- declare function extractSymbolLedger(lessonMarkdown: string): SymbolLedgerResult;
731
-
732
739
  /**
733
740
  * Curriculum OS - Standardized Error Taxonomy & Traceability System
734
741
  *
@@ -817,110 +824,217 @@ interface SlideBlueprintItem {
817
824
 
818
825
  declare const SlideBlueprintItemSchema: z.ZodObject<{
819
826
  slideIndex: z.ZodNumber;
820
- clusterId: z.ZodDefault<z.ZodNumber>;
821
- clusterTitle: z.ZodDefault<z.ZodString>;
822
- lessonPhase: z.ZodDefault<z.ZodString>;
827
+ clusterId: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
828
+ clusterTitle: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
829
+ lessonPhase: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
823
830
  layoutId: z.ZodEnum<["hero-cover", "split-concept-code", "two-columns-compare", "three-cards-grid", "timeline-steps", "metric-callout", "checkpoint-quiz", "tiered-practice-3cards", "summary-takeaways"]>;
824
831
  title: z.ZodString;
825
- pedagogicalGoal: z.ZodDefault<z.ZodString>;
826
- contentFocus: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
827
- codeSnippetIntent: z.ZodOptional<z.ZodString>;
828
- visualIntent: z.ZodOptional<z.ZodString>;
832
+ pedagogicalGoal: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
833
+ contentFocus: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>>;
834
+ codeSnippetIntent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
835
+ visualIntent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
829
836
  }, "strip", z.ZodTypeAny, {
830
837
  title: string;
831
- clusterId: number;
832
- clusterTitle: string;
838
+ clusterId: number | null;
839
+ clusterTitle: string | null;
833
840
  slideIndex: number;
834
- lessonPhase: string;
841
+ lessonPhase: string | null;
835
842
  layoutId: "tiered-practice-3cards" | "split-concept-code" | "hero-cover" | "two-columns-compare" | "three-cards-grid" | "timeline-steps" | "metric-callout" | "checkpoint-quiz" | "summary-takeaways";
836
- pedagogicalGoal: string;
837
- contentFocus: string[];
838
- codeSnippetIntent?: string | undefined;
839
- visualIntent?: string | undefined;
843
+ pedagogicalGoal: string | null;
844
+ contentFocus: string[] | null;
845
+ codeSnippetIntent?: string | null | undefined;
846
+ visualIntent?: string | null | undefined;
840
847
  }, {
841
848
  title: string;
842
849
  slideIndex: number;
843
850
  layoutId: "tiered-practice-3cards" | "split-concept-code" | "hero-cover" | "two-columns-compare" | "three-cards-grid" | "timeline-steps" | "metric-callout" | "checkpoint-quiz" | "summary-takeaways";
844
- clusterId?: number | undefined;
845
- clusterTitle?: string | undefined;
846
- lessonPhase?: string | undefined;
847
- pedagogicalGoal?: string | undefined;
848
- contentFocus?: string[] | undefined;
849
- codeSnippetIntent?: string | undefined;
850
- visualIntent?: string | undefined;
851
+ clusterId?: number | null | undefined;
852
+ clusterTitle?: string | null | undefined;
853
+ lessonPhase?: string | null | undefined;
854
+ pedagogicalGoal?: string | null | undefined;
855
+ contentFocus?: string[] | null | undefined;
856
+ codeSnippetIntent?: string | null | undefined;
857
+ visualIntent?: string | null | undefined;
851
858
  }>;
852
859
  declare const SlideBlueprintArraySchema: z.ZodArray<z.ZodObject<{
853
860
  slideIndex: z.ZodNumber;
854
- clusterId: z.ZodDefault<z.ZodNumber>;
855
- clusterTitle: z.ZodDefault<z.ZodString>;
856
- lessonPhase: z.ZodDefault<z.ZodString>;
861
+ clusterId: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
862
+ clusterTitle: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
863
+ lessonPhase: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
857
864
  layoutId: z.ZodEnum<["hero-cover", "split-concept-code", "two-columns-compare", "three-cards-grid", "timeline-steps", "metric-callout", "checkpoint-quiz", "tiered-practice-3cards", "summary-takeaways"]>;
858
865
  title: z.ZodString;
859
- pedagogicalGoal: z.ZodDefault<z.ZodString>;
860
- contentFocus: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
861
- codeSnippetIntent: z.ZodOptional<z.ZodString>;
862
- visualIntent: z.ZodOptional<z.ZodString>;
866
+ pedagogicalGoal: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
867
+ contentFocus: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>>;
868
+ codeSnippetIntent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
869
+ visualIntent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
863
870
  }, "strip", z.ZodTypeAny, {
864
871
  title: string;
865
- clusterId: number;
866
- clusterTitle: string;
872
+ clusterId: number | null;
873
+ clusterTitle: string | null;
867
874
  slideIndex: number;
868
- lessonPhase: string;
875
+ lessonPhase: string | null;
869
876
  layoutId: "tiered-practice-3cards" | "split-concept-code" | "hero-cover" | "two-columns-compare" | "three-cards-grid" | "timeline-steps" | "metric-callout" | "checkpoint-quiz" | "summary-takeaways";
870
- pedagogicalGoal: string;
871
- contentFocus: string[];
872
- codeSnippetIntent?: string | undefined;
873
- visualIntent?: string | undefined;
877
+ pedagogicalGoal: string | null;
878
+ contentFocus: string[] | null;
879
+ codeSnippetIntent?: string | null | undefined;
880
+ visualIntent?: string | null | undefined;
874
881
  }, {
875
882
  title: string;
876
883
  slideIndex: number;
877
884
  layoutId: "tiered-practice-3cards" | "split-concept-code" | "hero-cover" | "two-columns-compare" | "three-cards-grid" | "timeline-steps" | "metric-callout" | "checkpoint-quiz" | "summary-takeaways";
878
- clusterId?: number | undefined;
879
- clusterTitle?: string | undefined;
880
- lessonPhase?: string | undefined;
881
- pedagogicalGoal?: string | undefined;
882
- contentFocus?: string[] | undefined;
883
- codeSnippetIntent?: string | undefined;
884
- visualIntent?: string | undefined;
885
+ clusterId?: number | null | undefined;
886
+ clusterTitle?: string | null | undefined;
887
+ lessonPhase?: string | null | undefined;
888
+ pedagogicalGoal?: string | null | undefined;
889
+ contentFocus?: string[] | null | undefined;
890
+ codeSnippetIntent?: string | null | undefined;
891
+ visualIntent?: string | null | undefined;
885
892
  }>, "many">;
886
893
  declare const GeneratedSlideSchema: z.ZodObject<{
887
- id: z.ZodOptional<z.ZodString>;
894
+ id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
888
895
  layoutId: z.ZodString;
889
896
  title: z.ZodString;
890
- slots: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
891
- notes: z.ZodDefault<z.ZodString>;
897
+ slots: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>>;
898
+ notes: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
892
899
  }, "strip", z.ZodTypeAny, {
893
900
  title: string;
894
901
  layoutId: string;
895
- slots: Record<string, any>;
896
- notes: string;
897
- id?: string | undefined;
902
+ slots: Record<string, any> | null;
903
+ notes: string | null;
904
+ id?: string | null | undefined;
898
905
  }, {
899
906
  title: string;
900
907
  layoutId: string;
901
- id?: string | undefined;
902
- slots?: Record<string, any> | undefined;
903
- notes?: string | undefined;
908
+ id?: string | null | undefined;
909
+ slots?: Record<string, any> | null | undefined;
910
+ notes?: string | null | undefined;
904
911
  }>;
905
912
  declare const GeneratedSlideArraySchema: z.ZodArray<z.ZodObject<{
906
- id: z.ZodOptional<z.ZodString>;
913
+ id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
914
+ layoutId: z.ZodString;
915
+ title: z.ZodString;
916
+ slots: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>>;
917
+ notes: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
918
+ }, "strip", z.ZodTypeAny, {
919
+ title: string;
920
+ layoutId: string;
921
+ slots: Record<string, any> | null;
922
+ notes: string | null;
923
+ id?: string | null | undefined;
924
+ }, {
925
+ title: string;
926
+ layoutId: string;
927
+ id?: string | null | undefined;
928
+ slots?: Record<string, any> | null | undefined;
929
+ notes?: string | null | undefined;
930
+ }>, "many">;
931
+ declare const HybridBlueprintItemSchema: z.ZodObject<{
932
+ slideIndex: z.ZodNumber;
933
+ clusterId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
934
+ clusterTitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
935
+ lessonPhase: z.ZodOptional<z.ZodNullable<z.ZodString>>;
936
+ layoutId: z.ZodEnum<["hero-cover", "split-concept-code", "two-columns-compare", "three-cards-grid", "timeline-steps", "metric-callout", "checkpoint-quiz", "tiered-practice-3cards", "summary-takeaways"]>;
937
+ title: z.ZodString;
938
+ pedagogicalGoal: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
939
+ contentFocus: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>>;
940
+ codeSnippetIntent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
941
+ visualIntent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
942
+ }, "strip", z.ZodTypeAny, {
943
+ title: string;
944
+ slideIndex: number;
945
+ layoutId: "tiered-practice-3cards" | "split-concept-code" | "hero-cover" | "two-columns-compare" | "three-cards-grid" | "timeline-steps" | "metric-callout" | "checkpoint-quiz" | "summary-takeaways";
946
+ pedagogicalGoal: string | null;
947
+ contentFocus: string[] | null;
948
+ clusterId?: number | null | undefined;
949
+ clusterTitle?: string | null | undefined;
950
+ lessonPhase?: string | null | undefined;
951
+ codeSnippetIntent?: string | null | undefined;
952
+ visualIntent?: string | null | undefined;
953
+ }, {
954
+ title: string;
955
+ slideIndex: number;
956
+ layoutId: "tiered-practice-3cards" | "split-concept-code" | "hero-cover" | "two-columns-compare" | "three-cards-grid" | "timeline-steps" | "metric-callout" | "checkpoint-quiz" | "summary-takeaways";
957
+ clusterId?: number | null | undefined;
958
+ clusterTitle?: string | null | undefined;
959
+ lessonPhase?: string | null | undefined;
960
+ pedagogicalGoal?: string | null | undefined;
961
+ contentFocus?: string[] | null | undefined;
962
+ codeSnippetIntent?: string | null | undefined;
963
+ visualIntent?: string | null | undefined;
964
+ }>;
965
+ declare const HybridBlueprintArraySchema: z.ZodArray<z.ZodObject<{
966
+ slideIndex: z.ZodNumber;
967
+ clusterId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
968
+ clusterTitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
969
+ lessonPhase: z.ZodOptional<z.ZodNullable<z.ZodString>>;
970
+ layoutId: z.ZodEnum<["hero-cover", "split-concept-code", "two-columns-compare", "three-cards-grid", "timeline-steps", "metric-callout", "checkpoint-quiz", "tiered-practice-3cards", "summary-takeaways"]>;
971
+ title: z.ZodString;
972
+ pedagogicalGoal: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
973
+ contentFocus: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>>;
974
+ codeSnippetIntent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
975
+ visualIntent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
976
+ }, "strip", z.ZodTypeAny, {
977
+ title: string;
978
+ slideIndex: number;
979
+ layoutId: "tiered-practice-3cards" | "split-concept-code" | "hero-cover" | "two-columns-compare" | "three-cards-grid" | "timeline-steps" | "metric-callout" | "checkpoint-quiz" | "summary-takeaways";
980
+ pedagogicalGoal: string | null;
981
+ contentFocus: string[] | null;
982
+ clusterId?: number | null | undefined;
983
+ clusterTitle?: string | null | undefined;
984
+ lessonPhase?: string | null | undefined;
985
+ codeSnippetIntent?: string | null | undefined;
986
+ visualIntent?: string | null | undefined;
987
+ }, {
988
+ title: string;
989
+ slideIndex: number;
990
+ layoutId: "tiered-practice-3cards" | "split-concept-code" | "hero-cover" | "two-columns-compare" | "three-cards-grid" | "timeline-steps" | "metric-callout" | "checkpoint-quiz" | "summary-takeaways";
991
+ clusterId?: number | null | undefined;
992
+ clusterTitle?: string | null | undefined;
993
+ lessonPhase?: string | null | undefined;
994
+ pedagogicalGoal?: string | null | undefined;
995
+ contentFocus?: string[] | null | undefined;
996
+ codeSnippetIntent?: string | null | undefined;
997
+ visualIntent?: string | null | undefined;
998
+ }>, "many">;
999
+ declare const HybridDeckSlideSchema: z.ZodObject<{
1000
+ id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1001
+ layoutId: z.ZodString;
1002
+ title: z.ZodString;
1003
+ slots: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>>;
1004
+ notes: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
1005
+ }, "strip", z.ZodTypeAny, {
1006
+ title: string;
1007
+ layoutId: string;
1008
+ slots: Record<string, any> | null;
1009
+ notes: string | null;
1010
+ id?: string | null | undefined;
1011
+ }, {
1012
+ title: string;
1013
+ layoutId: string;
1014
+ id?: string | null | undefined;
1015
+ slots?: Record<string, any> | null | undefined;
1016
+ notes?: string | null | undefined;
1017
+ }>;
1018
+ declare const HybridDeckSlideArraySchema: z.ZodArray<z.ZodObject<{
1019
+ id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
907
1020
  layoutId: z.ZodString;
908
1021
  title: z.ZodString;
909
- slots: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
910
- notes: z.ZodDefault<z.ZodString>;
1022
+ slots: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>>;
1023
+ notes: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
911
1024
  }, "strip", z.ZodTypeAny, {
912
1025
  title: string;
913
1026
  layoutId: string;
914
- slots: Record<string, any>;
915
- notes: string;
916
- id?: string | undefined;
1027
+ slots: Record<string, any> | null;
1028
+ notes: string | null;
1029
+ id?: string | null | undefined;
917
1030
  }, {
918
1031
  title: string;
919
1032
  layoutId: string;
920
- id?: string | undefined;
921
- slots?: Record<string, any> | undefined;
922
- notes?: string | undefined;
1033
+ id?: string | null | undefined;
1034
+ slots?: Record<string, any> | null | undefined;
1035
+ notes?: string | null | undefined;
923
1036
  }>, "many">;
1037
+ type SlideEngine = 'hybrid' | 'chunked';
924
1038
  interface SlideProductionWorkflowOptions {
925
1039
  lessonMarkdown: string;
926
1040
  lessonCode: string;
@@ -930,11 +1044,24 @@ interface SlideProductionWorkflowOptions {
930
1044
  language?: string;
931
1045
  languageDirective?: string;
932
1046
  headingDirective?: string;
1047
+ /**
1048
+ * Ground-truth context (framework, style guide, glossary, GROUND TRUTH KX+RefPack,
1049
+ * session slice, horizon, symbol registry) injected into the PRIMARY system prompt
1050
+ * of every authoring call — hybrid full-deck and chunked batches alike.
1051
+ * Without it, only the legacy raw-fetch fallback sees this context.
1052
+ * Deliberately EXCLUDES the canonical lesson excerpt: lesson phase content is
1053
+ * already injected into user prompts via parseLessonFlow (no duplication).
1054
+ */
1055
+ groundContext?: string;
933
1056
  satelliteContext?: any;
934
1057
  /** Vercel AI SDK model resolution options (provider/model/apiKey). */
935
1058
  modelOptions?: ModelResolutionOptions;
936
- /** Max attempts per inference unit (blueprint / each cluster). Default 3. */
1059
+ /** Which engine to run. Default 'hybrid'; 'hybrid' auto-falls back to 'chunked'. */
1060
+ engine?: SlideEngine;
1061
+ /** Max attempts per inference unit (blueprint / each cluster / full deck). Default 3. */
937
1062
  maxRetries?: number;
1063
+ /** Max output tokens for hybrid generateText calls. Default 65536. */
1064
+ maxOutputTokens?: number;
938
1065
  /** When true (default), falls back to the legacy raw-fetch runner if generateObject fails. */
939
1066
  allowLegacyFallback?: boolean;
940
1067
  runnerOptions?: any;
@@ -946,7 +1073,38 @@ interface SlideProductionWorkflowResult {
946
1073
  markdownWrapper: string;
947
1074
  blueprint: SlideBlueprintItem[];
948
1075
  slideCount: number;
1076
+ /** Which engine actually produced the deck (hybrid may fall back to chunked). */
1077
+ engine: SlideEngine;
949
1078
  }
1079
+ /** Thrown when the hybrid engine exhausts its attempts; triggers chunked fallback. */
1080
+ declare class HybridPipelineError extends Error {
1081
+ }
1082
+ interface ExtractedJson {
1083
+ value?: unknown;
1084
+ error?: string;
1085
+ head?: string;
1086
+ tail?: string;
1087
+ }
1088
+ declare function extractJsonArray(raw: string | undefined | null): ExtractedJson;
1089
+ declare function validateHybridDeckSlides(slides: any[], blueprint: SlideBlueprintItem[]): string[];
1090
+ /**
1091
+ * Normalize the AI SDK's usage shape and forward it through onProgress in the
1092
+ * kit's canonical usage contract (`JSON.stringify({ promptTokens,
1093
+ * completionTokens, totalTokens, reasoningTokens })` + `meta.type = 'usage'`).
1094
+ *
1095
+ * 5-Whys RC-telemetry (2026-09-13): the slide workflow never emitted usage, so
1096
+ * the app-side queue recorded inputTokens=0/outputTokens=0 for every SLIDE
1097
+ * execution. AI SDK v5+ renames the fields (inputTokens/outputTokens) — read
1098
+ * both shapes defensively.
1099
+ */
1100
+ declare function emitUsage(usage: {
1101
+ promptTokens?: number;
1102
+ completionTokens?: number;
1103
+ inputTokens?: number;
1104
+ outputTokens?: number;
1105
+ totalTokens?: number;
1106
+ reasoningTokens?: number;
1107
+ } | undefined, onProgress?: (agent: string, message: string, meta?: any) => void): void;
950
1108
  declare function executeSlideProductionWorkflow(options: SlideProductionWorkflowOptions): Promise<SlideProductionWorkflowResult>;
951
1109
 
952
1110
  /**
@@ -1247,4 +1405,4 @@ declare function getSlideLayoutPresetById(id: string): SlideLayoutPreset | undef
1247
1405
  */
1248
1406
  declare function getSlideLayoutPresetsByCategory(category: SlideLayoutCategory): SlideLayoutPreset[];
1249
1407
 
1250
- export { ACT_TEMPLATE, AIProviderName, ARTIFACT_DEPENDENCY_ROUTING, ARTIFACT_EXECUTION_ORDER, type AcademicAuditFinding, AcademicAuditor, type AcademicDimension, ActivityLab, type ArtifactDependencyRule, type ArtifactProductionSpec, type AuditBundleInput, BELL_RINGER_TEMPLATE, BLOOM_ACTION_VERBS, BOM_TEMPLATE, BloomTaxonomyEvaluator, type BuildContextOptions, CHOICE_BOARD_TEMPLATE, CODE_LAB_TEMPLATE, CURRICULUM_SLASH_COMMANDS, CodeHardwareFeasibilityEvaluator, CodeLab, type ComprehensiveAcademicReport, ConstructiveAlignmentEvaluator, type ContextInjectionMeta, type ContextSourceKey, CoverageGateReport, CrossArtifactDriftEvaluator, CurriculumError, type CurriculumErrorCode, type CurriculumErrorDetail, CurriculumPlan, DEFAULT_KX_PRIORITIES, DEFAULT_LESSON_PRIORITIES, DEFAULT_STREAM_IDLE_MS, DEFAULT_STREAM_TOTAL_MS, DEFAULT_VIETNAMESE_SECTION_HEADINGS, DependencyEdge, type DependencyValidationResult, DeterministicPipelineRunner, DeterministicStructuralLinter, DiagnosticQuiz, DiagnosticQuizInput, type DimensionScore, EXIT_TICKET_TEMPLATE, EXPOSITION_REL, EXT_TEMPLATE, type ExcerptOptions, type ExcerptResult, type ExecuteCommandResult, ExpositionApprovalError, type ExpositionLlmFn, type ExpositionResult, type ExpositionStorage, type ExtractedStreamChunk, type FindingSeverity, FiveEInstructionalEvaluator, type FrameworkLintFinding, type FrameworkLintReport, FrameworkPack, GLOSSARY_TEMPLATE, GRAPHIC_ORGANIZER_TEMPLATE, type GenerateExpositionOptions, GeneratedSlideArraySchema, GeneratedSlideSchema, HANDOUT_TEMPLATE, ICurriculumStorage, LAYER_IDLE_BUDGET_MS, LAYER_TOTAL_BUDGET_MS, LESSON_PLAN_TEMPLATE, type LayerChunkCallback, type LayerPrefillOptions, type LayerPrefillResult, type LayoutBoxConfig, LessonPlan, MisconceptionEvaluator, ModelResolutionOptions, PROJECT_INSTRUCTION_TEMPLATE, 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, QUIZ_TEMPLATE, QualityAuditReport, REVIEW_GAME_TEMPLATE, RUBRIC_TEMPLATE, ResolvedGateSettings, SCIENCE_LAB_TEMPLATE, SELF_LAB_TEMPLATE, SLIDE_LAYOUT_PRESETS, SLIDE_TEMPLATE, STATION_ROTATION_TEMPLATE, type SlashCommandDefinition, SlideBlueprintArraySchema, SlideBlueprintItemSchema, SlideDeck, type SlideLayoutCategory, type SlideLayoutData, type SlideLayoutPreset, type SlideProductionWorkflowOptions, type SlideProductionWorkflowResult, SmartResumeContext, type StreamAbortHandle, type StreamBudget, type StreamChunkExtractor, StreamRunnerOptions, type SymbolLedgerResult, TASK_CARDS_TEMPLATE, TEACHER_GUIDE_TEMPLATE, TIERED_PRACTICE_TEMPLATE, TranslationPolicy, type TranslationTarget, type TranslationTrigger, type ValidationOptions, WORKSHEET_TEMPLATE, analyzeProjectCreationIntent, assertAcyclic, auditQualityReport, buildCurriculumContext, buildCurriculumPlan, buildDomainLexiconGuardrail, buildExpositionContext, buildExpositionExcerpt, buildHeadingDirective, buildLanguageDirective, buildLessonExcerpt, buildSectionAwareExcerpt, buildSessionSliceContext, closeTruncatedJson, computePackingSpec, conductPreliminaryResearch, createAiInferenceError, createContextMissingError, createStreamAbortSignal, createStreamChunkExtractor, detectProjectPedagogy, ensureExpositionForLesson, ensureKnowledgeExposition, executeCurriculumCommand, executeSlideProductionWorkflow, expositionCacheKey, extractScopeSequenceRows, extractSectionHeadingsFromSLC, extractSessionSlice, extractStreamChunk, extractSymbolLedger, generatePhase1SotArtifacts, generatePhase2SotArtifacts, getLessonMetadata, getProjectArtifactScope, getProjectStatusReport, getSlideLayoutPresetById, getSlideLayoutPresetsByCategory, getSmartResumeContext, glossaryTermsForSession, ingestProjectGraphIntoProject, initializeProjectInStorage, isExpositionFresh, isTranslationDue, lintCurriculumFramework, loadCurriculumTemplate, loadSotTemplate, normalizePlanningGraph, normalizeSlcContract, parseRoadmapJsonToProjectPayload, produceBatchLessons, produceSingleLesson, renderFrameworkFromPlan, resolveStreamBudget, resolveTargetLanguageCode, resolveTranslationTargets, safeParseJson, slugifyProjectName, streamLLMWithFallback, streamLayerPrefillWithFallback, stripLlmJsonWrappers, targetLanguageDisplayName, topoSort, validateArtifactDependencies };
1408
+ export { ACT_TEMPLATE, AIProviderName, ARTIFACT_DEPENDENCY_ROUTING, ARTIFACT_EXECUTION_ORDER, type AcademicAuditFinding, AcademicAuditor, type AcademicDimension, ActivityLab, type ArtifactDependencyRule, type ArtifactProductionSpec, type AuditBundleInput, BELL_RINGER_TEMPLATE, BLOOM_ACTION_VERBS, BOM_TEMPLATE, BloomTaxonomyEvaluator, type BuildContextOptions, CHOICE_BOARD_TEMPLATE, CODE_LAB_TEMPLATE, CURRICULUM_SLASH_COMMANDS, CodeHardwareFeasibilityEvaluator, CodeLab, type ComprehensiveAcademicReport, ConstructiveAlignmentEvaluator, type ContextInjectionMeta, type ContextSourceKey, CoverageGateReport, CrossArtifactDriftEvaluator, CurriculumError, type CurriculumErrorCode, type CurriculumErrorDetail, CurriculumPlan, DEFAULT_KX_PRIORITIES, DEFAULT_LESSON_PRIORITIES, DEFAULT_STREAM_IDLE_MS, DEFAULT_STREAM_TOTAL_MS, DEFAULT_VIETNAMESE_SECTION_HEADINGS, DependencyEdge, type DependencyValidationResult, DeterministicPipelineRunner, DeterministicStructuralLinter, DiagnosticQuiz, DiagnosticQuizInput, type DimensionScore, EXIT_TICKET_TEMPLATE, EXPOSITION_REL, EXT_TEMPLATE, type ExcerptOptions, type ExcerptResult, type ExecuteCommandResult, ExpositionApprovalError, type ExpositionLlmFn, type ExpositionResult, type ExpositionStorage, type ExtractedJson, type ExtractedStreamChunk, type FindingSeverity, FiveEInstructionalEvaluator, type FrameworkLintFinding, type FrameworkLintReport, FrameworkPack, GLOSSARY_TEMPLATE, GRAPHIC_ORGANIZER_TEMPLATE, type GenerateExpositionOptions, GeneratedSlideArraySchema, GeneratedSlideSchema, HANDOUT_TEMPLATE, HybridBlueprintArraySchema, HybridBlueprintItemSchema, HybridDeckSlideArraySchema, HybridDeckSlideSchema, HybridPipelineError, ICurriculumStorage, LAYER_IDLE_BUDGET_MS, LAYER_TOTAL_BUDGET_MS, LESSON_PLAN_TEMPLATE, type LayerChunkCallback, type LayerPrefillOptions, type LayerPrefillResult, type LayoutBoxConfig, LessonPlan, MisconceptionEvaluator, ModelResolutionOptions, PROJECT_INSTRUCTION_TEMPLATE, 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, QUIZ_TEMPLATE, QualityAuditReport, REVIEW_GAME_TEMPLATE, RUBRIC_TEMPLATE, ResolvedGateSettings, SATELLITE_LESSON_PRIORITIES, SCIENCE_LAB_TEMPLATE, SELF_LAB_TEMPLATE, SLIDE_LAYOUT_PRESETS, SLIDE_TEMPLATE, STATION_ROTATION_TEMPLATE, type SlashCommandDefinition, SlideBlueprintArraySchema, SlideBlueprintItemSchema, SlideDeck, type SlideEngine, type SlideLayoutCategory, type SlideLayoutData, type SlideLayoutPreset, type SlideProductionWorkflowOptions, type SlideProductionWorkflowResult, SmartResumeContext, type StreamAbortHandle, type StreamBudget, type StreamChunkExtractor, StreamRunnerOptions, type SymbolLedgerResult, TASK_CARDS_TEMPLATE, TEACHER_GUIDE_TEMPLATE, TIERED_PRACTICE_TEMPLATE, TranslationPolicy, type TranslationTarget, type TranslationTrigger, type ValidationOptions, WORKSHEET_TEMPLATE, analyzeProjectCreationIntent, assertAcyclic, auditQualityReport, buildCurriculumContext, buildCurriculumPlan, buildDomainLexiconGuardrail, buildExpositionContext, buildExpositionExcerpt, buildHeadingDirective, buildLanguageDirective, buildLessonExcerpt, buildSectionAwareExcerpt, buildSessionSliceContext, closeTruncatedJson, computePackingSpec, conductPreliminaryResearch, createAiInferenceError, createContextMissingError, createStreamAbortSignal, createStreamChunkExtractor, detectProjectPedagogy, emitUsage, ensureExpositionForLesson, ensureKnowledgeExposition, executeCurriculumCommand, executeSlideProductionWorkflow, expositionCacheKey, extractJsonArray, extractScopeSequenceRows, extractSectionHeadingsFromSLC, extractSessionSlice, extractStreamChunk, extractSymbolLedger, generatePhase1SotArtifacts, generatePhase2SotArtifacts, getLessonMetadata, getProjectArtifactScope, getProjectStatusReport, getSlideLayoutPresetById, getSlideLayoutPresetsByCategory, getSmartResumeContext, glossaryTermsForSession, ingestProjectGraphIntoProject, initializeProjectInStorage, isExpositionFresh, isTranslationDue, lintCurriculumFramework, loadCurriculumTemplate, loadSotTemplate, normalizePlanningGraph, normalizeSlcContract, parseRoadmapJsonToProjectPayload, produceBatchLessons, produceSingleLesson, renderFrameworkFromPlan, resolveStreamBudget, resolveTargetLanguageCode, resolveTranslationTargets, safeParseJson, slugifyProjectName, streamLLMWithFallback, streamLayerPrefillWithFallback, stripLlmJsonWrappers, targetLanguageDisplayName, topoSort, validateArtifactDependencies, validateHybridDeckSlides };