Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 22 additions & 12 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ player's unless a section says otherwise.
packages/player/ @missing-elements/h5p-offline-player — the published package
src/
h5p-offline-player.ts the <h5p-player> custom element — the only public entry point
plan.ts `./plan` -> dist/h5p-plan.js: the player's library rules (`planPack`, `librariesNamedIn`,
`addonPatterns`, `textMatches`, `dependenciesIn`) for the packages that write what it
plays; not covered by docs/compatibility.md, so they pin the player exactly (#106)
plan.ts `./plan` -> dist/h5p-plan.js: the player's library rules (`planPack`, `ownLibraries`,
`librariesNamedIn`, `addonPatterns`, `textMatches`, `dependenciesIn`, `reachableFolder`,
`walkDependencies` and the folder helpers) for the packages that write what it plays,
h5p-author and embed; not covered by docs/compatibility.md, so they pin the player
exactly (#106, #109)
jobs-worker-handle.ts starts the Jobs worker from the first script the page's CSP allows, holding jobs until it runs
user-data-store.ts the learner's saved state for `resume`, in a database of the page's own
shadow.css the element's own box, imported `?inline` so Vite minifies it into the bundle
Expand All @@ -63,6 +65,10 @@ packages/player/ @missing-elements/h5p-offline-player — the published
content-libraries.ts which libraries `h5p.json`, a `library.json` and content's parameters name, and an
addon's patterns: out of package-reader.ts on 2026-11-02, so that the plan and
`./plan` carry no zip.js (#106)
library-folders.ts which folder serves a library (`reachableFolder`, `resolveLibraryFolder`), what a
manifest names that nothing carries, and `walkDependencies`, the walk through what
the libraries need in turn, which the reader's check and embed's SCORM writer both
run: out of package-reader.ts on 2026-11-02, for `./plan` (#109)
pack-index.ts generated by sync-h5p-assets from packages/libraries/parts/index.json: the pinned
pack's index, which the worker plans from and checks each part against
metadata.ts `h5p.json`'s metadata in the shape the runtime reads, held to the core's licence table
Expand Down Expand Up @@ -223,11 +229,13 @@ packages/embed/ @missing-elements/h5p-embed — the embed page as a st
lib/build.mjs buildSite(): copies the page, the player's dist/, the runtime's dist/ as
frame-assets/ and the library pack; writes config.js, the policy into the
page, the headers for five kinds of host and NOTICE.txt
lib/scorm.mjs buildScorm(), `--scorm`: one .h5p, the player and the runtime as a SCORM 1.2
zip, refused when the package does not carry its libraries
lib/scorm.mjs buildScorm(), `--scorm`: one .h5p, the player, the runtime and the parts of the
pack it needs as a SCORM 1.2 zip, planned with the player's `./plan`; refused for
a library neither the package nor the pack carries
scorm/ the SCORM package's launch page (index.html, its title, language and
build filled in by the writer) and scorm.js, its bridge to the LMS's API
bin/h5p-embed.mjs the command
scripts/ check-player-published.mjs, the publish guard for the player it pins exactly (#109)
tests/ build.test.ts, no browser; site.test.ts, a written site on 127.0.0.1
framed by a page on localhost, as deployed; scorm.test.ts, the zip in Node
and the launch page under a stand-in for an LMS's player page in
Expand Down Expand Up @@ -2287,19 +2295,21 @@ one row each; an LMS added here gets a row there.
LMS's origin by design, so the package's own code runs, as any SCORM package's does. An export
without its libraries, from h5p.com or h5p.org, gets the parts of the pack it needs, in the zip
(the owner's call, the same day: those exports are what many teachers have). The writer runs the
player's planner as the launch page has the element run it, filling gaps only: `planParts` is
`planPack` with `refresh` off and nothing attached before, and `librariesNamedIn`,
`addonPatterns`, `textMatches` and `ownLibraries` are copies of the player's. Keep them in step
until #109 has the writer import them from the player's `./plan`, as h5p-author does.
player's own planner as the launch page has the element run it, filling gaps only: `planPack`
from the player's `./plan` with `refresh` off and nothing provided, over `ownLibraries`,
`dependenciesIn` and `librariesNamedIn` from the same module. Until #109 (2026-11-02) those were
copies kept in step by hand, which nothing checked; since then embed pins the player exactly, as
h5p-author does, and `scripts/check-player-published.mjs` refuses to publish until the pinned
version is on npm with `./plan`.
It writes those parts into `libraries/`, with an `index.json` that lists only them, and the page
names the folder with `libraries="pack"`, `pack-base` and `refresh-libraries="off"`. The element
then plans the same parts and finds each in the zip, and plays a package's own libraries as
exported. Because the index lists only what the zip carries, a plan that ever came out different
could only fall short: a gap the element refuses by name, or an addon left out, never a request
for a part the zip lacks. What neither the package nor the pack supplies is refused when the zip
is written, by the walk the player makes (`servingFolder` mirrors `reachableFolder`, the walk
`missingDependencies`), run over the package without the folders a part replaces and over the
parts. The walk starts from the sub-content the parameters name as well, which the player found
is written, by the walk the player makes (`walkDependencies` over `reachableFolder`, the same
functions `PackageReader.checkDependencies` runs), run over the package without the folders a
part replaces and over the parts. The walk starts from the sub-content the parameters name as well, which the player found
missing only when the runtime reached it until #85, and since then finds at index only where a
source has the library's major. So a gap shows up when the teacher writes the zip,
not when a learner opens it. Measured: the demo's formulas quiz, a stripped export, took 11 parts,
Expand Down
4 changes: 2 additions & 2 deletions docs/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ warning can come in any release.
- Exports and files this page does not name: a package's other exports, the rest of the
player's `dist/`, the files inside the runtime's. Nor anything reached by a path a package does
not export. Among them the player's `./plan`, its library rules for the packages of this
repository that write what it plays, which depend on an exact version of the player for that
reason.
repository that write what it plays, h5p-author and the embed command, which depend on an exact
version of the player for that reason.
- The demo site, including `/app/` and `/embed` there, and this repository's scripts and
workflows.

Expand Down
Loading
Loading