2.1 KiB
2.1 KiB
Contract requests from WP-B (Importer)
loadConfigshould add<dataDir>/coursestocourseDirs. The importer writes courses there. Worked around inapps/server/src/main.ts(the main guard pushes it) and inpackages/feature-import/dev/serve.ts./api/import/inforeportscoursesDirServedand the UI warns when it is false.startServeraccepts feature factories (Feature | ((ctx) => Feature)). AFeatureneedsServerContext, butServerContext.jobsis built from the features' job handlers.importFeature(ctx)only readsctxwhile a job or request runs, somain.tsnow buildsctxfirst, resolves the factories, then assignsctx.jobs. The edit is about ten lines inapps/server/src/main.ts; Phase 2 should keep or replace it.- Web entry for features.
apps/webmust not pull a package's server code into the browser bundle.@stc/feature-importexposes a browser-safe entry as./web(package.jsonexports), but the root tsconfigpaths(@stc/*topackages/*/src) cannot resolve@stc/feature-import/web, soapps/web/src/features.tsimports it by relative path. Suggest a tsconfigpathsentry per feature, or asrc/web.tsconvention. - Derived cache layout (no contract defines one). Written by the importer, to be read by the learner and AI packages:
<dataDir>/cache/decks/<courseId>/<deckId>/p-001.jpg ...(1280px wide JPEGs) andtext.json([{ page, text }]);<dataDir>/cache/covers/<courseId>/frame-N.jpganddeck-<deckId>.jpg(cover candidates);<dataDir>/cache/transcripts/<courseId>/<lessonId>.json({ lessonId, text, segments: [{ start, end, text }] }). Suggest acacheDir/deckPageUrlhelper in core, and a media route forcache/decksso the deck viewer can load pages.
- Video lessons have no description field. Packt clips come with a one-line description. It is dropped, because
transcriptis the only Markdown a video lesson can carry and the transcription job writes it. STC_IMPORT_ROOTS(":"-separated, default<dataDir>/import-inbox, created whenimportFeatureis built) is read inside the import package. Core config could own it later.