lens-content-processor 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/bundler/video.d.ts +12 -6
  2. package/dist/bundler/video.js +57 -34
  3. package/dist/bundler/video.js.map +1 -1
  4. package/dist/cli.d.ts +11 -2
  5. package/dist/cli.js +36 -19
  6. package/dist/cli.js.map +1 -1
  7. package/dist/content-schema.js +71 -16
  8. package/dist/content-schema.js.map +1 -1
  9. package/dist/dedupe-errors.d.ts +14 -0
  10. package/dist/dedupe-errors.js +33 -0
  11. package/dist/dedupe-errors.js.map +1 -0
  12. package/dist/flattener/index.d.ts +3 -28
  13. package/dist/flattener/index.js +507 -745
  14. package/dist/flattener/index.js.map +1 -1
  15. package/dist/flattener/resolve-text-links.d.ts +25 -0
  16. package/dist/flattener/resolve-text-links.js +248 -0
  17. package/dist/flattener/resolve-text-links.js.map +1 -0
  18. package/dist/flattener/test-helpers.d.ts +1 -1
  19. package/dist/flattener/test-helpers.js +1 -3
  20. package/dist/flattener/test-helpers.js.map +1 -1
  21. package/dist/index.d.ts +53 -21
  22. package/dist/index.js +285 -140
  23. package/dist/index.js.map +1 -1
  24. package/dist/parser/article.d.ts +2 -1
  25. package/dist/parser/article.js +75 -14
  26. package/dist/parser/article.js.map +1 -1
  27. package/dist/parser/course.d.ts +1 -1
  28. package/dist/parser/course.js +79 -22
  29. package/dist/parser/course.js.map +1 -1
  30. package/dist/parser/frontmatter.d.ts +1 -1
  31. package/dist/parser/frontmatter.js +38 -12
  32. package/dist/parser/frontmatter.js.map +1 -1
  33. package/dist/parser/learning-outcome.d.ts +5 -2
  34. package/dist/parser/learning-outcome.js +75 -37
  35. package/dist/parser/learning-outcome.js.map +1 -1
  36. package/dist/parser/lens.d.ts +40 -41
  37. package/dist/parser/lens.js +365 -349
  38. package/dist/parser/lens.js.map +1 -1
  39. package/dist/parser/module.d.ts +7 -15
  40. package/dist/parser/module.js +135 -171
  41. package/dist/parser/module.js.map +1 -1
  42. package/dist/parser/sections.d.ts +12 -1
  43. package/dist/parser/sections.js +74 -95
  44. package/dist/parser/sections.js.map +1 -1
  45. package/dist/parser/video-transcript.d.ts +2 -1
  46. package/dist/parser/video-transcript.js +8 -7
  47. package/dist/parser/video-transcript.js.map +1 -1
  48. package/dist/reference-graph.d.ts +8 -0
  49. package/dist/reference-graph.js +105 -0
  50. package/dist/reference-graph.js.map +1 -0
  51. package/dist/validator/card-module-membership.d.ts +2 -0
  52. package/dist/validator/card-module-membership.js +80 -0
  53. package/dist/validator/card-module-membership.js.map +1 -0
  54. package/dist/validator/output-integrity.js +5 -5
  55. package/dist/validator/output-integrity.js.map +1 -1
  56. package/dist/validator/segment-fields.d.ts +1 -1
  57. package/dist/validator/segment-fields.js +2 -2
  58. package/dist/validator/segment-fields.js.map +1 -1
  59. package/dist/validator/test-segments.d.ts +12 -0
  60. package/dist/validator/test-segments.js +40 -0
  61. package/dist/validator/test-segments.js.map +1 -0
  62. package/dist/validator/url-reachability.d.ts +2 -1
  63. package/dist/validator/url-reachability.js +40 -20
  64. package/dist/validator/url-reachability.js.map +1 -1
  65. package/package.json +1 -1
  66. package/dist/validator/chat-precedence.d.ts +0 -9
  67. package/dist/validator/chat-precedence.js +0 -32
  68. package/dist/validator/chat-precedence.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export interface UrlToValidate {
3
3
  file: string;
4
4
  line: number;
5
5
  label: string;
6
+ allowUnreachable?: boolean;
6
7
  }
7
8
  export interface ProcessResult {
8
9
  modules: FlattenedModule[];
@@ -15,40 +16,57 @@ export interface FlattenedModule {
15
16
  title: string;
16
17
  contentId: string | null;
17
18
  sections: Section[];
19
+ sourcePath?: string;
18
20
  parentSlug?: string;
19
21
  parentTitle?: string;
20
22
  error?: string;
21
23
  warnings?: string[];
24
+ addToAiContext?: string[] | null;
25
+ }
26
+ /** Light co-branding for a partnership/demo course (e.g. the Iliad demo). */
27
+ export interface CoursePartner {
28
+ /** Display name of the partner org, e.g. "Iliad". Used as alt/aria text. */
29
+ name: string;
30
+ /** Big lockup logo: bare filename served from /assets/partners/, or an absolute URL/path. */
31
+ logo: string;
32
+ /** Optional small/square mark for narrow (mobile) headers; falls back to logo. */
33
+ logoSmall?: string;
34
+ /** Optional click-through URL — the logo links here when set. */
35
+ url?: string;
22
36
  }
23
37
  export interface Course {
24
38
  slug: string;
25
39
  title: string;
40
+ slugAliases?: string[];
41
+ /** Present only when both partner-name and partner-logo are set in frontmatter. */
42
+ partner?: CoursePartner;
26
43
  progression: ProgressionItem[];
27
44
  error?: string;
28
45
  }
29
46
  export interface Section {
30
- type: 'page' | 'lens-video' | 'lens-article' | 'test';
47
+ type: "lens" | "test";
48
+ displayType?: "lens-article" | "lens-video" | "lens-mixed";
31
49
  meta: SectionMeta;
32
50
  segments: Segment[];
51
+ sourcePath?: string;
33
52
  optional?: boolean;
53
+ hide?: boolean;
34
54
  feedback?: boolean;
35
55
  contentId: string | null;
36
56
  learningOutcomeId: string | null;
37
57
  learningOutcomeName: string | null;
38
- videoId: string | null;
39
58
  wordCount?: number;
40
59
  videoDurationSeconds?: number;
41
60
  tldr?: string;
61
+ summaryForTutor?: string;
62
+ addToAiContext?: string[] | null;
63
+ addToAiContextLo?: string[] | null;
42
64
  }
43
65
  export interface SectionMeta {
44
66
  title?: string;
45
- author?: string;
46
- sourceUrl?: string;
47
- published?: string;
48
- channel?: string;
49
67
  }
50
68
  export interface ProgressionItem {
51
- type: 'module' | 'meeting';
69
+ type: "module" | "meeting";
52
70
  slug?: string;
53
71
  path?: string;
54
72
  name?: string;
@@ -59,37 +77,47 @@ export interface ContentError {
59
77
  line?: number;
60
78
  message: string;
61
79
  suggestion?: string;
62
- severity: 'error' | 'warning';
63
- category?: 'production' | 'wip';
80
+ severity: "error" | "warning";
81
+ category?: "production" | "wip";
64
82
  }
65
83
  export interface TextSegment {
66
- type: 'text';
84
+ type: "text";
67
85
  content: string;
68
86
  optional?: boolean;
69
87
  }
70
88
  export interface ChatSegment {
71
- type: 'chat';
89
+ type: "chat";
72
90
  instructions?: string;
73
91
  hidePreviousContentFromUser?: boolean;
74
92
  hidePreviousContentFromTutor?: boolean;
75
93
  optional?: boolean;
94
+ minMessages?: number;
76
95
  }
77
- export interface ArticleExcerptSegment {
78
- type: 'article-excerpt';
96
+ export interface ArticleSegment {
97
+ type: "article";
79
98
  content: string;
80
99
  collapsed_before?: string;
81
100
  collapsed_after?: string;
101
+ title?: string;
102
+ author?: string;
103
+ sourceUrl?: string;
104
+ published?: string;
105
+ sourcePath?: string;
82
106
  optional?: boolean;
83
107
  }
84
- export interface VideoExcerptSegment {
85
- type: 'video-excerpt';
108
+ export interface VideoSegment {
109
+ type: "video";
86
110
  from: number;
87
111
  to: number | null;
88
- transcript: string;
112
+ transcript: TranscriptSentence[];
113
+ title?: string;
114
+ channel?: string;
115
+ videoId?: string;
116
+ isShort?: boolean;
89
117
  optional?: boolean;
90
118
  }
91
119
  export interface QuestionSegment {
92
- type: 'question';
120
+ type: "question";
93
121
  content: string;
94
122
  assessmentInstructions?: string;
95
123
  maxTime?: string;
@@ -97,18 +125,22 @@ export interface QuestionSegment {
97
125
  enforceVoice?: boolean;
98
126
  optional?: boolean;
99
127
  feedback?: boolean;
128
+ minMessages?: number;
100
129
  }
101
130
  export interface RoleplaySegment {
102
- type: 'roleplay';
131
+ type: "roleplay";
103
132
  id: string;
104
133
  content: string;
105
134
  aiInstructions: string;
106
135
  openingMessage?: string;
107
136
  assessmentInstructions?: string;
137
+ userCustomizable?: boolean;
108
138
  optional?: boolean;
109
139
  feedback?: boolean;
110
140
  }
111
- export type Segment = TextSegment | ChatSegment | ArticleExcerptSegment | VideoExcerptSegment | QuestionSegment | RoleplaySegment;
112
- export type { ContentTier } from './validator/tier.js';
113
- export { checkTierViolation } from './validator/tier.js';
141
+ export type Segment = TextSegment | ChatSegment | ArticleSegment | VideoSegment | QuestionSegment | RoleplaySegment;
142
+ import { type TranscriptSentence } from "./bundler/video.js";
143
+ export type { TranscriptSentence } from "./bundler/video.js";
144
+ export type { ContentTier } from "./validator/tier.js";
145
+ export { checkTierViolation } from "./validator/tier.js";
114
146
  export declare function processContent(files: Map<string, string>): ProcessResult;