feat: HLS streaming, transcripts, agent course generation & landing-page course previews (#663)

New features:
- HLS video encoding/streaming (hls routes, hls-encoder) and a media
  transcripts pipeline (transcripts route + media-transcript queries)
- AI assistant chat vs. run model: agent-course-generation worker/queue,
  run-monitor pane, chat-changes card, content ask-ai bar
- Per-theme course-page previews across org landing-page themes (bold,
  classic, corporate, editorial, etc.) with a shared course token/component set
- View-as-student mode and login-link / link-invite invite flows

Refactor:
- Extract packages/core consolidating config (env, storage, dashboard-url),
  services and utils previously duplicated under apps/api/src/config
- Remove legacy agent service modules (chat-tools, chat-context,
  context-window, document, fetch-url, lesson-content)
- Relax Cross-Origin-Resource-Policy to allow cross-origin media embedding
- Add format script to tenant-router so turbo run format covers it
This commit is contained in:
Rotimi Best
2026-06-07 18:43:05 +01:00
committed by GitHub
parent a2e70779a0
commit d5b07d356e
496 changed files with 19050 additions and 8312 deletions
@@ -13,14 +13,21 @@
import { courseApi } from '$features/course/api';
import ContentCreateModal from '$features/course/components/content/content-create-modal.svelte';
import CourseCompletionModal from '$features/course/components/ceritficate/course-completion-modal.svelte';
import { aiAssistantPanelDefinition } from '$features/ai-assistant';
import { aiAssistantPanelDefinition, ContentAskAiBar, AI_ASSISTANT_PANEL_ID } from '$features/ai-assistant';
import {
getContentAskAiBarWidthClass,
isCourseContentLockedForStudent
} from '$features/ai-assistant/utils/content-ask-ai-bar';
import { initialChatPrompt, openAiAssistant } from '$features/ai-assistant/utils/store';
import { sidePanel, SidePanelRail } from '$features/side-panel';
import { transcriptPanelDefinition } from '$features/course/components/lesson/video/transcript-panel-definition';
import { get } from 'svelte/store';
import { page } from '$app/state';
import { profile } from '$lib/utils/store/user';
import { isOrgAdmin } from '$lib/utils/store/org';
import { isOrgStudent } from '$lib/utils/store/app';
import { t } from '$lib/utils/functions/translations';
import { ContentType } from '@cio/utils/constants/content';
import type { CourseMember } from '$features/course/utils/types';
import {
COURSE_SIDEBAR_DEFAULT_WIDTH,
@@ -79,6 +86,28 @@
const isExercisePage = $derived(!!data.exerciseId);
const lessonId = $derived(page.params.lessonId as string | undefined);
const exerciseId = $derived((page.params.exerciseId as string | undefined) ?? data.exerciseId);
const isLessonOrExercisePage = $derived(Boolean(lessonId || exerciseId));
const isLessonEditMode = $derived(page.url.searchParams.get('mode') === 'edit');
const contentAskAiWidthClass = $derived(getContentAskAiBarWidthClass({ lessonId, isLessonEditMode }));
const isContentLockedForStudent = $derived(
isCourseContentLockedForStudent(
courseApi.course,
lessonId ?? exerciseId,
lessonId ? ContentType.Lesson : exerciseId ? ContentType.Exercise : null
)
);
const showContentAskAiBar = $derived(
isCourseReady &&
isLessonOrExercisePage &&
!($isOrgStudent && isContentLockedForStudent) &&
sidePanel.activePanelId !== AI_ASSISTANT_PANEL_ID
);
function clampSidebarWidth(width: number) {
return Math.min(COURSE_SIDEBAR_MAX_WIDTH, Math.max(COURSE_SIDEBAR_MIN_WIDTH, width));
}
@@ -188,6 +217,10 @@
{/if}
{@render children?.()}
{#if showContentAskAiBar}
<ContentAskAiBar class={contentAskAiWidthClass} />
{/if}
{/if}
</Sidebar.Inset>