egatari 0.6.9 → 0.6.10

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 (35) hide show
  1. package/CHANGELOG.md +28 -1
  2. package/README.ja.md +151 -116
  3. package/README.md +145 -116
  4. package/bin/egatari.mjs +10 -7
  5. package/components.lock.json +12 -6
  6. package/components2.lock.json +151 -1
  7. package/kit/check-messages.mjs +123 -114
  8. package/kit/check.mjs +12 -8
  9. package/kit/core/article-messages.mjs +7 -7
  10. package/kit/core/build-core.mjs +8 -8
  11. package/kit/core/check-parity.mjs +1 -1
  12. package/kit/core/check-source.mjs +4 -0
  13. package/kit/core/colab-core.mjs +1 -1
  14. package/kit/core/llm-fix.mjs +15 -15
  15. package/kit/core/llm-insert.mjs +7 -7
  16. package/kit/core/llm-outline.mjs +6 -6
  17. package/kit/core/llm-pack-data.mjs +33 -33
  18. package/kit/core/narration-parse.mjs +3 -3
  19. package/kit/core/new-deck.mjs +1 -1
  20. package/kit/core/predict-steps.mjs +46 -0
  21. package/kit/core/template-text.mjs +2 -2
  22. package/kit/instruction-version.json +1 -1
  23. package/kit/player.json +1 -1
  24. package/kit/player.lock.json +2 -2
  25. package/kit/templates/new-deck.mjs +1 -1
  26. package/package.json +1 -1
  27. package/render/only.mjs +2 -2
  28. package/render/render.mjs +4 -4
  29. package/tools/ids.mjs +7 -7
  30. package/vendor/components/CATALOG.md +1 -1
  31. package/vendor/components/sha256/19f34ad938c3513d9268fcedb947e0049380232da2293d5c00922fe32ec1a088/README.en.md +32 -0
  32. package/vendor/components/sha256/19f34ad938c3513d9268fcedb947e0049380232da2293d5c00922fe32ec1a088/index.js +352 -0
  33. package/vendor/components/sha256/1d10fec0552198e3926b3d960046606668fa7f42f562cea539c6a16cc3e83338/README.en.md +40 -0
  34. package/vendor/components/sha256/1d10fec0552198e3926b3d960046606668fa7f42f562cea539c6a16cc3e83338/index.js +341 -0
  35. package/vendor/components-2/manifest-2.6.2.json +2104 -0
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- i18n: pair=README.ja.md sha256=57a9c47c38482fca -->
1
+ <!-- i18n: pair=README.ja.md sha256=401708e4a0f149b7 -->
2
2
  <p align="center">
3
3
  <picture>
4
4
  <source media="(prefers-color-scheme: dark)" srcset="assets/logo/egatari-dark.svg">
@@ -12,24 +12,43 @@
12
12
 
13
13
  English | [日本語](README.ja.md)
14
14
 
15
- *Egatari Studio (formerly motion-academic-slides). The npm package, the skills and the commands keep their names.*
15
+ Egatari makes lessons and presentations, with narration, for classes, training and public guides.
16
+
17
+ A lesson is one self-contained HTML file, with step-by-step reveals and parts that follow the order of your explanation. One set of slides and script (`deck.html` + `narration.md`) gives you a live talk (with later steps shown faintly if you like), a PDF, and, optionally, a narrated video made with TTS. It is designed to be driven by [Claude Code](https://claude.com/claude-code) through the skills in `skills/`, but every step is a plain Node command and works without it.
16
18
 
17
- Academic slides as one self-contained HTML file, with step-by-step reveals and parts that follow the order of your explanation. One set of slides and script (`deck.html` + `narration.md`) gives you a live talk (with later steps shown faintly if you like), a PDF, and, optionally, a narrated video made with TTS. It is designed to be driven by [Claude Code](https://claude.com/claude-code) through the skills in `skills/`, but every step is a plain Node command and works without it.
19
+ *Egatari Studio (formerly motion-academic-slides). The npm package, the skills and the commands keep their names.*
18
20
 
19
21
  ![A slide from the TMLR 2026 example](docs/images/hero.png)
20
22
 
23
+ ## Get started
24
+
25
+ Pick one.
26
+
27
+ - **Editor app, nothing to install**: open <https://studio.egatari.org/> in Chrome or Edge and make or open a lesson there ([Editor app](#editor-app-no-install)).
28
+ - **With a chat AI**: install the Egatari skill for Claude or Codex, turn on its updates (Claude Code: `/plugin` → Marketplaces → egatari → Enable auto-update; Codex: `npx egatari@0.6.x skills update` after each Studio release) and ask for a lesson ([Claude Code](#using-it-with-claude-code), [Codex](#using-it-with-codex)).
29
+ - **Command line**:
30
+
31
+ ```bash
32
+ npx egatari new mytalk --lang en
33
+ npx egatari dev mytalk/deck.html
34
+ npx egatari check mytalk/deck.html
35
+ npx egatari build mytalk/deck.html --portable
36
+ ```
37
+
38
+ Needs Node.js ≥ 22.23.4 ([Requirements](#requirements)). More commands: [With npm (no clone)](#with-npm-no-clone); to work from a clone of the repository, see [Working from a clone](#working-from-a-clone).
39
+
21
40
  ## Features
22
41
 
23
42
  - **Steps**: `data-step="k"` shows content in the order you speak. The conclusion line (`.concl`) always comes last
24
43
  - **Math**: KaTeX, rendered at build time. `\hlE{…}` / `\hlT{…}` / `\hlM{…}` color a term using the theme
25
- - **Parts**: Web Components from [egatari/components](https://github.com/egatari/components) (vendored in `vendor/components/`: `m-sweep`, `m-curves`, `m-flow`, `m-collect`, `m-seq`, and for business and pitch lessons `m-bars`, `m-quad`, `m-market`, `m-kpi`, and for coding lectures `m-codetree` (decoding a bit string with a code tree); `m-flow` also draws money and service flows). The screen depends only on (slide, step, time), so the same lesson can be exported frame by frame to video
44
+ - **Parts**: Web Components from [egatari/components](https://github.com/egatari/components) (vendored in `vendor/components/`: `m-sweep`, `m-curves`, `m-flow`, `m-collect`, `m-seq`, and for business and pitch lessons `m-bars`, `m-quad`, `m-market`, `m-kpi`, and for coding lectures `m-codetree` (decoding a bit string with a code tree); `m-flow` also draws money and service flows). Parts come in sets by subject: stats, data (`m-code`, `m-sampling`, `m-ci` …), math, maps, kokugo, english, music, business, tools and science ([part sets](docs/llm-parts/)). The screen depends only on (slide, step, time), so the same lesson can be exported frame by frame to video
26
45
  - **Links to slides**: an ordinary `<a href="#<slide id>">` (or `#<slide id>:<step>`) jumps to that slide or step and offers **Back** (button, Backspace, Alt+←, browser back); `m-menu` lays such links out as a grid of cards for a contents or choice slide. Plain anchors, no script, so an Egatari file (`.ega.html`) stays Core. See [contract §9](docs/contract.md#9-links-to-slides)
27
46
  - **Japanese language arts (国語)**: vertical writing (`.tate`), ruby, a Mincho font (BIZ UDPMincho) and theme `kokugo`; `m-kanbun` (白文 → 返り点 and 送り仮名 → the reading order traced character by character → 書き下し文), `m-kobun` (品詞分解 sentence by sentence, auxiliary-verb conjugation cards, modern translation), `m-gendai` (side lines, demonstrative → referent arrows, paragraph roles). See [reference](docs/reference.md#japanese-language-arts-kokugo)
28
47
  - **Emphasis**: `{mark:ID|circle}` in the script draws a hand-drawn underline, circle, box, spotlight or laser pointer dot on the slide at that word
29
48
  - **Morph transitions**: `data-morph` slides an equation or element from its place on the previous slide to its new place (like Keynote's Magic Move)
30
49
  - **Two modes from one source**: slide show (`?mode=talk`) and video (`?mode=video`). Show later steps faintly is an option of the slide show (`l`; `?mode=lecture` opens it with the option on)
31
50
  - **Presenter tools**: presenter view with speaker notes and timer, slide overview, laser pointer, pen, fading pen, toolbar
32
- - **Themes**: one base color per theme (`themes/<name>/tokens.css`). Parts only use theme variables. Seven bundled themes: 藍 Indigo (`default`), 墨 Ink (`sumi`), 国語 Kokugo, 常盤 Evergreen, 江戸紫 Edo purple, 焦茶 Dark brown, 浅葱 Teal ([reference](docs/reference.md#themes))
51
+ - **Themes**: one base color per theme (`themes/<name>/tokens.css`). Parts only use theme variables. Eight bundled themes; new lessons choose from seven: 藍 Indigo (`default`), 墨 Ink (`sumi`), 国語 Kokugo, 常盤 Evergreen, 江戸紫 Edo purple, 焦茶 Dark brown, 浅葱 Teal. `business` stays bundled so that lessons using it still build ([reference](docs/reference.md#themes))
33
52
  - **Quality control**: the standards (R-fit, R-steps, …) say what a lesson must meet; the quality checker `kit/check.mjs` (`npm run check`) reports overflow, text size, steps, script coverage, contrast, part determinism, emphasis and morphs
34
53
  - **Dev server**: edit text and the script in the browser, leave comments for your AI coding tool
35
54
  - **Egatari file (`.ega.html`)**: `--portable` writes one HTML file (at the top of the lesson folder, named from the lesson title; the path is printed) that plays offline and also carries its source and audio, so it can be unpacked back into a working folder (`npm run portable -- unpack|pack`); `--play-only` writes a copy without the editable slides and script. It follows **Egatari** (絵語り, “narrating with pictures”), an open [format for Egatari files](https://github.com/egatari/egatari-spec) (draft 1.0). See [reference](docs/reference.md#single-file---portable)
@@ -45,114 +64,6 @@ Academic slides as one self-contained HTML file, with step-by-step reveals and p
45
64
  |---|---|
46
65
  | ![presenter view](docs/images/presenter.png) | ![overview](docs/images/overview.png) |
47
66
 
48
- ## Two ways to use it
49
-
50
- | | Tier 1: slides (core) | Tier 2: narrated video (optional) |
51
- |---|---|---|
52
- | You get | HTML slides, presenter view, the option to show later steps faintly, PDF | per-step MP4 clips, a full video, an Egatari file with audio |
53
- | Needs | Node ≥ 22; Google Chrome only for the quality checker, PDF and tests | everything in tier 1, plus ffmpeg, uv, a TTS server and reference voices |
54
- | Optional | uv (font subsetting) | |
55
-
56
- **Slides are fully usable without TTS.** No tier-1 command imports anything from `tts/` or `render/`, and `build`, `check` and the dev server work when `audio/` and `voice.json` are absent. Without audio, autoplay (`a`) uses the default timing for each step, and the script still shows in the presenter view as speaker notes.
57
-
58
- ## Requirements
59
-
60
- **Tier 1 (slides)**
61
-
62
- - [Node.js](https://nodejs.org/) 22 or newer, a release with the latest security fixes (see [SECURITY.md](SECURITY.md))
63
- - Google Chrome or Microsoft Edge for `kit/check.mjs`, `tools/pdf.mjs`, screenshots and tests (through `playwright-core`: Chrome first, then Edge). Building and presenting only need a browser to open the file. Without either, run `npx playwright-core install chromium` (the tools then fall back to Playwright's Chromium) or set `CHROME_PATH=/path/to/chrome-or-chromium`
64
- - Optional: [uv](https://docs.astral.sh/uv/). After `node tools/get-fonts.mjs` downloads the BIZ UDPGothic (and BIZ UDPMincho) TTF files, the build uses uv to run `pyftsubset` and embeds only the glyphs you use. Without the TTF files (or without uv) it embeds the matching `@fontsource` WOFF2 subsets instead. Those files are larger but look the same
65
-
66
- **Windows**
67
-
68
- A fresh Windows has neither Node.js nor Git. In PowerShell:
69
-
70
- ```powershell
71
- winget install OpenJS.NodeJS.LTS Git.Git # then open a new terminal
72
- winget install astral-sh.uv Gyan.FFmpeg # optional: uv (smaller fonts), ffmpeg (video)
73
- ```
74
-
75
- Edge is already there, so the quality checker and PDF work without Chrome. Run the commands below in PowerShell or Git Bash; replace `open` with `start`. Without Git, download the ZIP from GitHub (Code → Download ZIP). Making the script audio (tier 2) needs a TTS server; mlx-audio, the one we test with, runs only on a Mac with Apple silicon. On Windows, use another OpenAI-compatible TTS server, or make or record each step's audio in the editor app ([docs/video.md](docs/video.md#tts-server-mac-windows-linux)).
76
-
77
- **Browsers**
78
-
79
- - Presenting the built HTML: Chrome/Edge 119+, Firefox 128+ or Safari 18+ (these support the CSS relative color syntax and `color-mix()` that themes use to derive tints from `--base`). Older browsers still show the slides, with fixed fallback colors taken from the default theme instead of colors derived from the theme's `--base`
80
- - PDF (`tools/pdf.mjs`), video (`render/`), `kit/check.mjs` and the tests are produced and tested with Google Chrome (or Playwright's Chromium) only; Edge uses the same engine
81
-
82
- **Tier 2 (video)**
83
-
84
- - ffmpeg and ffprobe on `PATH`
85
- - uv (runs the small Python project in `tts/`)
86
- - A TTS server with an OpenAI-compatible speech API, e.g. [mlx-audio](https://github.com/Blaizzy/mlx-audio) serving `mlx-community/Irodori-TTS-v4.1-Small-fp16` (Japanese) or `mlx-community/VoxCPM2-8bit` (English and others). Set `IRODORI_URL` (default `http://localhost:8882`). mlx-audio runs only on a Mac with Apple silicon; on Windows and Linux, see [other TTS servers](docs/video.md#tts-server-mac-windows-linux)
87
- - Reference voices: the default voices `bob` and `alice` (synthetic, Japanese and English) are in `tts/voices/` of the repository ([details](tts/voices/README.md)). The npm package does not carry them: the first `egatari tts` that needs one downloads it from this repository at a pinned tag, checks its sha256 against `tts/voices.json` and keeps it in your cache folder (`~/Library/Caches/egatari/voices/` on macOS, `~/.cache/egatari/voices/` on Linux, `%LOCALAPPDATA%\egatari\voices\` on Windows). Add your own as `<name>.wav` there (gitignored) or in `IRODORI_REF_DIR`
88
-
89
- ## Quick start (tier 1: slides)
90
-
91
- ```bash
92
- git clone --depth 1 https://github.com/egatari/egatari-studio.git
93
- cd egatari-studio
94
- npm ci
95
- node tools/get-fonts.mjs # optional: smaller font embedding (uses uv at build time)
96
-
97
- node kit/build.mjs examples/minimal/deck.html # -> examples/minimal/out/deck.html
98
- open examples/minimal/out/deck.html # macOS; elsewhere, open the file in a browser
99
-
100
- node kit/check.mjs examples/minimal/deck.html # quality check; the last line should read "エラー 0" (0 errors)
101
- node tools/pdf.mjs examples/minimal/out/deck.html examples/minimal/out/deck.pdf # PDF, one page per slide
102
- npm run sheet -- examples/minimal # one PNG with every slide at its final step (look at it: the check cannot see everything)
103
- node server/dev.mjs examples/minimal/deck.html # dev server at http://127.0.0.1:8730/ (Ctrl+C to stop)
104
- ```
105
-
106
- ### Start your own lesson
107
-
108
- ```bash
109
- npm run new -- talks/mytalk --lang en --theme default --title "My talk"
110
- npm run build -- talks/mytalk/deck.html # -> talks/mytalk/out/deck.html
111
- npm run dev -- talks/mytalk/deck.html # edit in the browser
112
- npm run check -- talks/mytalk/deck.html # the last line should read "エラー 0" (0 errors)
113
- ```
114
-
115
- `npm run new -- <folder>` creates `deck.html` and `narration.md` from a clean template: a cover and sample slides showing steps, math, emphasis and a part, with a script for every step. It also writes `egatari.json` with `"componentsCatalogue": "2"`: new lessons are built with parts library 2, the parts the chat AI's instructions describe (a folder without that setting, such as an older lesson, keeps parts library 1). Options: `--lang en|ja` (default `ja`), `--theme <name>` (default `default`), `--title "…"`. It refuses to write into a folder that is not empty. You can change the theme later with `<html data-theme="business">` or `--theme business`. With `<html lang="en">` body text is set in Source Sans 3 and the quality check uses the English standards. For a fuller example, see `examples/minimal/`.
116
-
117
- Every slide of a new lesson has a stable id (`<section class="slide" id="s-k3f9q2">`), and its script heading names it (`## Heading {#s-k3f9q2}`), so you can rename headings without breaking the script, audio or timing. For a lesson made before ids, run `npm run ids -- talks/mytalk` once: it adds ids and renames the keys in `narration.md`, `audio/manifest.json`, `timeline.json` and `comments.json` (keeping backups in `.cache/edits/`).
118
-
119
- ### With npm (no clone)
120
-
121
- The npm package `egatari` has the same tools as one command, `egatari`:
122
-
123
- ```bash
124
- npx egatari new mytalk --lang en # creates mytalk/deck.html, mytalk/narration.md and mytalk/egatari.json
125
- npx egatari build mytalk/deck.html # -> mytalk/out/deck.html (--portable, --play-only and the other build options work too)
126
- npx egatari dev mytalk/deck.html # edit in the browser
127
- npx egatari check mytalk/deck.html # the last line should read "エラー 0" (0 errors)
128
- npx egatari doctor # Node, uv, ffmpeg, a browser and the parts: what is there and how to install what is missing
129
- ```
130
-
131
- Also runs with Bun (`bunx egatari`).
132
-
133
- `npx egatari --help` lists the other commands (`ids`, `ids-of`, `sheet`, `comment-shots`, `portable`, `video`, `tts`). `npx egatari ids-of <file.ega.html> […]` prints, one line per file (tab-separated; `--json` for JSON), the `docId`, the `sourceSha256` recomputed from the file's source (the version of the source: it leaves out audio and built parts; a warning on stderr if it differs from the value written in the file) and the SHA-256 of the whole file (identifies the file itself, for checking at distribution or LMS upload). Who released it is a matter for signatures (format §10, not implemented yet). `npx egatari video <working folder | .ega.html>` builds and exports a lesson with its existing audio to video (needs ffmpeg). Relative paths are resolved from the current folder. The package carries the default fonts the build embeds (no `get-fonts`) and the fonts of the bundled themes (Zen Maru Gothic of `asagi`), so every bundled theme works from `npx egatari` alone. The other optional fonts, which only a lesson's own CSS or theme can name (such as Klee One), are in the separate package `@egatari/fonts-extra` (`npm i -D @egatari/fonts-extra`, or `npx -p egatari -p @egatari/fonts-extra egatari …`; `egatari build` and `check` say so when a lesson needs it). Of each vendored part, the package carries the `index.js` the build reads and its licence (not its README, demo or changelog; `egatari doctor` checks every `index.js` against `components.lock.json` and the manifests' per-file sha256). The default TTS voices are downloaded on the first `egatari tts` (see Requirements above). `egatari tts` runs `tts/synth.py` with uv and keeps its Python environment in your cache folder (set `UV_PROJECT_ENVIRONMENT` to put it elsewhere).
134
-
135
- ## Editing in the browser (dev server)
136
-
137
- You rarely need to open `deck.html` by hand. Start the dev server and fix things on the slide itself:
138
-
139
- ```bash
140
- node server/dev.mjs path/to/deck.html # then open http://127.0.0.1:8730/ (Ctrl+C to stop)
141
- ```
142
-
143
- The page shows the slides (arrow keys, `p`, `a`, … all work), with the editing tools around it: the slides run in a sandboxed frame and can only point at what to edit, and nothing is written until you press Save in the editing tools. It reloads by itself whenever a file of the slides changes, and stays on the same slide and step.
144
-
145
- 1. **Fix text: `e`, then double-click.** Editable elements get a dotted outline. Double-click one to open its source (HTML, with math as `\( … \)`), edit, and press ⌘/Ctrl+Enter. Only that element is replaced in `deck.html`.
146
- 2. **Fix the script: `n`.** A drawer shows the script of the current step. Edit the text (add or remove turns, change the speaker) and save. Only that step is replaced in `narration.md`.
147
- 3. **Leave a comment: Alt+click (on a Mac, hold ⌥ Option and click).** Write what you want changed ("make this figure larger", "split this slide"). Comments go to `comments.json`; `c` lists them. Then ask your AI coding tool (Claude Code, Codex, Gemini CLI …) to "apply the comments in comments.json" and it edits the slides; the page updates as soon as it saves.
148
- 4. **Undo:** the previous versions of `deck.html` and `narration.md` are kept in `.cache/edits/` (last 30).
149
-
150
- | `e` + double-click: edit the source | `n`: edit the script | Alt / ⌥ Option + click: comment |
151
- |---|---|---|
152
- | ![editor](docs/images/dev-editor.png) | ![narration](docs/images/dev-narration.png) | ![comment](docs/images/dev-comment.png) |
153
-
154
- Details: [docs/dev-server.md](docs/dev-server.md) ([日本語](docs/dev-server.ja.md)).
155
-
156
67
  ## Editor app (no install)
157
68
 
158
69
  The same editing as the dev server, as a web page that opens an Egatari file (`.ega.html`) or a working folder directly. Nothing to install: no Node, no terminal. An Egatari file opens and edits in any current browser; working folders need **Google Chrome or Microsoft Edge on a computer** (the File System Access API, which Safari and Firefox do not have).
@@ -192,7 +103,9 @@ First delete the old `~/.claude/skills/motion-*` entries (and any copies in a pr
192
103
  /plugin install egatari-studio@egatari
193
104
  ```
194
105
 
195
- The studio skill runs its commands through the egatari npm package (`npx egatari@0.6.x …`, see "With npm (no clone)" above): no clone and no `npm ci`, only Node.js (it starts with `npx egatari@0.6.x doctor`, which shows what is missing and how to install it). Update with `/plugin update egatari@egatari` and `/plugin update egatari-studio@egatari`, or, for every tool you have (Claude Code and Codex) at once, run `npx egatari@0.6.x skills update` and restart the tool. For zero effort in Claude Code, open `/plugin` → Marketplaces → egatari → Enable auto-update. With make alone, open the finished working folder at <https://studio.egatari.org/> in Chrome or Edge. On Mac, Safari uses the single file (.ega.html) path.
106
+ Then turn on auto-update: `/plugin` → Marketplaces → egatari → Enable auto-update. Claude Code turns auto-update on by default only for Anthropic's official marketplaces; others such as egatari start with it off. The skill's instructions and quality checks change with each Studio release, so an old skill misses the newer rules and fixes. When the skill finds that it is old, it tells you once (and keeps working).
107
+
108
+ The studio skill runs its commands through the egatari npm package (`npx egatari@0.6.x …`, see [With npm (no clone)](#with-npm-no-clone)): no clone and no `npm ci`, only Node.js (it starts with `npx egatari@0.6.x doctor`, which shows what is missing and how to install it). Update with `/plugin update egatari@egatari` and `/plugin update egatari-studio@egatari`, or, for every tool you have (Claude Code and Codex) at once, run `npx egatari@0.6.x skills update` and restart the tool. With make alone, open the finished working folder at <https://studio.egatari.org/> in Chrome or Edge. On Mac, Safari uses the single file (.ega.html) path.
196
109
 
197
110
  ## Using it with Codex
198
111
 
@@ -204,9 +117,11 @@ codex plugin add egatari@egatari
204
117
  codex plugin add egatari-studio@egatari
205
118
  ```
206
119
 
120
+ Then, after each Studio release, run `npx egatari@0.6.x skills update` and restart Codex. The skill's instructions and quality checks change with each Studio release, so an old skill misses the newer rules and fixes.
121
+
207
122
  Add `egatari` alone for authoring (no Node.js needed); add `egatari-studio` too for local checks, builds, parts and video. Restart Codex, then ask for a lesson. Codex's workspace-write sandbox blocks the network and the browser, so run `check` and `build` outside it, or with network and browser access allowed. Update with `codex plugin marketplace upgrade egatari` and `codex plugin add egatari@egatari` / `codex plugin add egatari-studio@egatari` again (Codex has no separate update command), or run `npx egatari@0.6.x skills update`, which does this for Claude Code and Codex alike. `npx egatari@0.6.x doctor` warns when an installed skill is older than the package.
208
123
 
209
- For a chat AI, upload `egatari-make-skill.zip`. Developers can create it with `node tools/make-llm-guide.mjs --zip out/release`. Its `make/` contents match the generated, committed `plugins/egatari/skills/make/` directory.
124
+ For a chat AI, upload `egatari-make-skill.zip`. When Studio is updated, add it again with “Download the AI skill” in Studio. Developers can create it with `node tools/make-llm-guide.mjs --zip out/release`. Its `make/` contents match the generated, committed `plugins/egatari/skills/make/` directory.
210
125
 
211
126
  | Skill | Use it for |
212
127
  |---|---|
@@ -222,6 +137,22 @@ Example prompts:
222
137
 
223
138
  The skill first shows you an outline and writes HTML only after you approve it.
224
139
 
140
+ ## With npm (no clone)
141
+
142
+ The npm package `egatari` has the same tools as one command, `egatari`:
143
+
144
+ ```bash
145
+ npx egatari new mytalk --lang en # creates mytalk/deck.html, mytalk/narration.md and mytalk/egatari.json
146
+ npx egatari build mytalk/deck.html # -> mytalk/out/deck.html (--portable, --play-only and the other build options work too)
147
+ npx egatari dev mytalk/deck.html # edit in the browser
148
+ npx egatari check mytalk/deck.html # the last line should read "エラー 0" (0 errors)
149
+ npx egatari doctor # Node, uv, ffmpeg, a browser and the parts: what is there and how to install what is missing
150
+ ```
151
+
152
+ Also runs with Bun (`bunx egatari`).
153
+
154
+ More commands and settings (`ids-of`, extra fonts, vendored parts, TTS environment variables): [docs/cli.md](docs/cli.md) ([日本語](docs/cli.ja.md)). `npx egatari --help` lists every command.
155
+
225
156
  ## Making a video (tier 2)
226
157
 
227
158
  ```bash
@@ -238,6 +169,18 @@ node render/render.mjs $D/out/deck.html --out $D/video # add --only "更新の
238
169
  - **Self-playing HTML with audio**: `node kit/build.mjs $D/deck.html --embed-audio` puts the script audio inside the HTML, so the HTML file plays with `a` (autoplay) anywhere. The audio is compressed to AAC (64 kbps, mono; about 4.5 MB for a 5-minute talk, instead of ~30 MB as WAV), which every current browser plays. Without `--embed-audio` the HTML refers to the WAV files in `audio/` and nothing is converted. If ffmpeg is missing, the WAV files are embedded as they are and the build warns
239
170
  - Details (caching, timing overrides in `timeline.json`, the reading dictionary): [docs/video.md](docs/video.md) ([日本語](docs/video.ja.md))
240
171
 
172
+ What video needs (ffmpeg, uv, a TTS server, reference voices) is under Tier 2 in [Requirements](#requirements). The difference between tier 1 and tier 2 is in "Two ways to use it", next.
173
+
174
+ ## Two ways to use it
175
+
176
+ | | Tier 1: slides (core) | Tier 2: narrated video (optional) |
177
+ |---|---|---|
178
+ | You get | HTML slides, presenter view, the option to show later steps faintly, PDF | per-step MP4 clips, a full video, an Egatari file with audio |
179
+ | Needs | Node ≥ 22; Google Chrome only for the quality checker, PDF and tests | everything in tier 1, plus ffmpeg, uv, a TTS server and reference voices |
180
+ | Optional | uv (font subsetting) | |
181
+
182
+ **Slides are fully usable without TTS.** No tier-1 command imports anything from `tts/` or `render/`, and `build`, `check` and the dev server work when `audio/` and `voice.json` are absent. Without audio, autoplay (`a`) uses the default timing for each step, and the script still shows in the presenter view as speaker notes.
183
+
241
184
  ## Keys (presenting)
242
185
 
243
186
  | Key | Action |
@@ -304,7 +247,93 @@ The `voice.json` of `examples/tmlr2026-calibration` uses the engine's default vo
304
247
 
305
248
  ![kokugo-kanbun example](docs/images/kokugo-kanbun.png)
306
249
 
307
- ## Repository layout
250
+ ## Working from a clone
251
+
252
+ The steps below run the tools from a clone of this repository (to work on Studio itself, or to use the `node` scripts directly). To use it without a clone, see [With npm (no clone)](#with-npm-no-clone).
253
+
254
+ ### Requirements
255
+
256
+ **Tier 1 (slides)**
257
+
258
+ - [Node.js](https://nodejs.org/) 22 or newer, a release with the latest security fixes (see [SECURITY.md](SECURITY.md))
259
+ - Google Chrome or Microsoft Edge for `kit/check.mjs`, `tools/pdf.mjs`, screenshots and tests (through `playwright-core`: Chrome first, then Edge). Building and presenting only need a browser to open the file. Without either, run `npx playwright-core install chromium` (the tools then fall back to Playwright's Chromium) or set `CHROME_PATH=/path/to/chrome-or-chromium`
260
+ - Optional: [uv](https://docs.astral.sh/uv/). After `node tools/get-fonts.mjs` downloads the BIZ UDPGothic (and BIZ UDPMincho) TTF files, the build uses uv to run `pyftsubset` and embeds only the glyphs you use. Without the TTF files (or without uv) it embeds the matching `@fontsource` WOFF2 subsets instead. Those files are larger but look the same
261
+
262
+ **Windows**
263
+
264
+ A fresh Windows has neither Node.js nor Git. In PowerShell:
265
+
266
+ ```powershell
267
+ winget install OpenJS.NodeJS.LTS Git.Git # then open a new terminal
268
+ winget install astral-sh.uv Gyan.FFmpeg # optional: uv (smaller fonts), ffmpeg (video)
269
+ ```
270
+
271
+ Edge is already there, so the quality checker and PDF work without Chrome. Run the commands below in PowerShell or Git Bash; replace `open` with `start`. Without Git, download the ZIP from GitHub (Code → Download ZIP). Making the script audio (tier 2) needs a TTS server; mlx-audio, the one we test with, runs only on a Mac with Apple silicon. On Windows, use another OpenAI-compatible TTS server, or make or record each step's audio in the editor app ([docs/video.md](docs/video.md#tts-server-mac-windows-linux)).
272
+
273
+ **Browsers**
274
+
275
+ - Presenting the built HTML: Chrome/Edge 119+, Firefox 128+ or Safari 18+ (these support the CSS relative color syntax and `color-mix()` that themes use to derive tints from `--base`). Older browsers still show the slides, with fixed fallback colors taken from the default theme instead of colors derived from the theme's `--base`
276
+ - PDF (`tools/pdf.mjs`), video (`render/`), `kit/check.mjs` and the tests are produced and tested with Google Chrome (or Playwright's Chromium) only; Edge uses the same engine
277
+
278
+ **Tier 2 (video)**
279
+
280
+ - ffmpeg and ffprobe on `PATH`
281
+ - uv (runs the small Python project in `tts/`)
282
+ - A TTS server with an OpenAI-compatible speech API, e.g. [mlx-audio](https://github.com/Blaizzy/mlx-audio) serving `mlx-community/Irodori-TTS-v4.1-Small-fp16` (Japanese) or `mlx-community/VoxCPM2-8bit` (English and others). Set `IRODORI_URL` (default `http://localhost:8882`). mlx-audio runs only on a Mac with Apple silicon; on Windows and Linux, see [other TTS servers](docs/video.md#tts-server-mac-windows-linux)
283
+ - Reference voices: the default voices `bob` and `alice` (synthetic, Japanese and English) are in `tts/voices/` of the repository ([details](tts/voices/README.md)). The npm package does not carry them: the first `egatari tts` that needs one downloads it from this repository at a pinned tag, checks its sha256 against `tts/voices.json` and keeps it in your cache folder (`~/Library/Caches/egatari/voices/` on macOS, `~/.cache/egatari/voices/` on Linux, `%LOCALAPPDATA%\egatari\voices\` on Windows). Add your own as `<name>.wav` there (gitignored) or in `IRODORI_REF_DIR`
284
+
285
+ ### Quick start (tier 1: slides)
286
+
287
+ ```bash
288
+ git clone --depth 1 https://github.com/egatari/egatari-studio.git
289
+ cd egatari-studio
290
+ npm ci
291
+ node tools/get-fonts.mjs # optional: smaller font embedding (uses uv at build time)
292
+
293
+ node kit/build.mjs examples/minimal/deck.html # -> examples/minimal/out/deck.html
294
+ open examples/minimal/out/deck.html # macOS; elsewhere, open the file in a browser
295
+
296
+ node kit/check.mjs examples/minimal/deck.html # quality check; the last line should read "エラー 0" (0 errors)
297
+ node tools/pdf.mjs examples/minimal/out/deck.html examples/minimal/out/deck.pdf # PDF, one page per slide
298
+ npm run sheet -- examples/minimal # one PNG with every slide at its final step (look at it: the check cannot see everything)
299
+ node server/dev.mjs examples/minimal/deck.html # dev server at http://127.0.0.1:8730/ (Ctrl+C to stop)
300
+ ```
301
+
302
+ #### Start your own lesson
303
+
304
+ ```bash
305
+ npm run new -- talks/mytalk --lang en --theme default --title "My talk"
306
+ npm run build -- talks/mytalk/deck.html # -> talks/mytalk/out/deck.html
307
+ npm run dev -- talks/mytalk/deck.html # edit in the browser
308
+ npm run check -- talks/mytalk/deck.html # the last line should read "エラー 0" (0 errors)
309
+ ```
310
+
311
+ `npm run new -- <folder>` creates `deck.html` and `narration.md` from a clean template: a cover and sample slides showing steps, math, emphasis and a part, with a script for every step. It also writes `egatari.json` with `"componentsCatalogue": "2"`: new lessons are built with parts library 2, the parts the chat AI's instructions describe (a folder without that setting, such as an older lesson, keeps parts library 1). Options: `--lang en|ja` (default `ja`), `--theme <name>` (default `default`), `--title "…"`. It refuses to write into a folder that is not empty. You can change the theme later with `<html data-theme="business">` or `--theme business`. With `<html lang="en">` body text is set in Source Sans 3 and the quality check uses the English standards. For a fuller example, see `examples/minimal/`.
312
+
313
+ Every slide of a new lesson has a stable id (`<section class="slide" id="s-k3f9q2">`), and its script heading names it (`## Heading {#s-k3f9q2}`), so you can rename headings without breaking the script, audio or timing. For a lesson made before ids, run `npm run ids -- talks/mytalk` once: it adds ids and renames the keys in `narration.md`, `audio/manifest.json`, `timeline.json` and `comments.json` (keeping backups in `.cache/edits/`).
314
+
315
+ ### Editing in the browser (dev server)
316
+
317
+ You rarely need to open `deck.html` by hand. Start the dev server and fix things on the slide itself:
318
+
319
+ ```bash
320
+ node server/dev.mjs path/to/deck.html # then open http://127.0.0.1:8730/ (Ctrl+C to stop)
321
+ ```
322
+
323
+ The page shows the slides (arrow keys, `p`, `a`, … all work), with the editing tools around it: the slides run in a sandboxed frame and can only point at what to edit, and nothing is written until you press Save in the editing tools. It reloads by itself whenever a file of the slides changes, and stays on the same slide and step.
324
+
325
+ 1. **Fix text: `e`, then double-click.** Editable elements get a dotted outline. Double-click one to open its source (HTML, with math as `\( … \)`), edit, and press ⌘/Ctrl+Enter. Only that element is replaced in `deck.html`.
326
+ 2. **Fix the script: `n`.** A drawer shows the script of the current step. Edit the text (add or remove turns, change the speaker) and save. Only that step is replaced in `narration.md`.
327
+ 3. **Leave a comment: Alt+click (on a Mac, hold ⌥ Option and click).** Write what you want changed ("make this figure larger", "split this slide"). Comments go to `comments.json`; `c` lists them. Then ask your AI coding tool (Claude Code, Codex, Gemini CLI …) to "apply the comments in comments.json" and it edits the slides; the page updates as soon as it saves.
328
+ 4. **Undo:** the previous versions of `deck.html` and `narration.md` are kept in `.cache/edits/` (last 30).
329
+
330
+ | `e` + double-click: edit the source | `n`: edit the script | Alt / ⌥ Option + click: comment |
331
+ |---|---|---|
332
+ | ![editor](docs/images/dev-editor.png) | ![narration](docs/images/dev-narration.png) | ![comment](docs/images/dev-comment.png) |
333
+
334
+ Details: [docs/dev-server.md](docs/dev-server.md) ([日本語](docs/dev-server.ja.md)).
335
+
336
+ ### Repository layout
308
337
 
309
338
  | Path | Contents |
310
339
  |---|---|
package/bin/egatari.mjs CHANGED
@@ -15,15 +15,15 @@ const PKG = JSON.parse(fs.readFileSync(path.join(ROOT, 'package.json'), 'utf8'))
15
15
 
16
16
  // 名前 → [スクリプト, 説明(日本語 / English), 引数の形]
17
17
  const SCRIPTS = {
18
- new: ['tools/new.mjs', '新しい作業フォルダを雛形から作る / create a working folder from the template', '<folder> [--lang en|ja] [--theme name] [--title "…"]'],
19
- build: ['kit/build.mjs', '原稿を 1 つの HTML に組む / build deck.html into one HTML file', '<deck.html> [-o out.html] [--portable] [--play-only] [--scorm] [--embed-audio] [--theme name] …'],
18
+ new: ['tools/new.mjs', '新しい作業フォルダをテンプレートから作る / create a working folder from the template', '<folder> [--lang en|ja] [--theme name] [--title "…"]'],
19
+ build: ['kit/build.mjs', 'スライド(deck.html)を 1 つの HTML に組む / build deck.html into one HTML file', '<deck.html> [-o out.html] [--portable] [--play-only] [--scorm] [--embed-audio] [--theme name] …'],
20
20
  check: ['kit/check.mjs', '品質チェック(ブラウザが要る)/ quality check (needs a browser)', '<deck.html> [--json]'],
21
21
  dev: ['server/dev.mjs', '開発サーバー(ブラウザで編集)/ dev server (edit in the browser)', '<deck.html> [--port 8730] [--theme name]'],
22
- sheet: ['tools/sheet.mjs', '全スライドの最終段階を 1 枚の画像に / contact sheet of every slide\'s last step', '<folder | deck.html | .ega.html> [out.png] [--steps] [--tiles] [--cols 4]'],
22
+ sheet: ['tools/sheet.mjs', '全スライドの最後のステップを 1 枚の画像に / contact sheet of every slide\'s last step', '<folder | deck.html | .ega.html> [out.png] [--steps] [--tiles] [--cols 4]'],
23
23
  'comment-shots': ['tools/comment-shots.mjs', '開発サーバーのコメントの画面を撮る / screenshots of open dev-server comments', '<folder | deck.html> [id …] [--all]'],
24
24
  ids: ['tools/ids.mjs', 'スライドに安定した id を付ける / give slides stable ids', '<folder | deck.html> [--dry-run]'],
25
25
  'ids-of': ['tools/ids-of.mjs', 'Egatari ファイルの docId・sourceSha256・ファイル全体の SHA-256 を 1 行ずつ出す / print docId, sourceSha256 and the whole-file SHA-256 of Egatari files', '<file.ega.html> [<file> …] [--json]'],
26
- portable: ['tools/portable.mjs', '1 ファイル(.ega.html)と作業フォルダの行き来 / single file (.ega.html) <-> working folder', 'unpack|pack|attach|compare …'],
26
+ portable: ['tools/portable.mjs', 'Egatari ファイル(.ega.html)と作業フォルダの行き来 / Egatari file (.ega.html) <-> working folder', 'unpack|pack|attach|compare …'],
27
27
  video: ['render/render.mjs', '音声の入った教材を動画に(ffmpeg が要る。音声は作らない)/ export a lesson with its audio to video (needs ffmpeg; makes no audio)', '<folder | .ega.html> または / or <out/deck.html> --out <dir> [--full] [--only key,…]'],
28
28
  };
29
29
 
@@ -35,8 +35,8 @@ function help() {
35
35
  使い方 / usage: egatari <command> [args…]
36
36
 
37
37
  ${Object.entries(SCRIPTS).map(([k, [, d, u]]) => line(k, d, u)).join('\n')}
38
- ${line('tts', '口述原稿を AI 音声にする(uv が要る)/ synthesize the script with TTS (needs uv)', '<folder> [--dry-run] [--voices expert=bob,novice=alice] …')}
39
- ${line('doctor', 'Node・uv・ffmpeg・ブラウザがあるか、部品の写しが正しいか、入れたスキルが古くないか調べる / check Node, uv, ffmpeg, a browser, the parts and the installed skills', '')}
38
+ ${line('tts', '台本を AI 音声にする(uv が要る)/ make AI voice audio from the script (needs uv)', '<folder> [--dry-run] [--voices expert=bob,novice=alice] …')}
39
+ ${line('doctor', 'Node・uv・ffmpeg・ブラウザがあるか、パーツの写しが正しいか、入れたスキルが古くないか調べる / check Node, uv, ffmpeg, a browser, the parts and the installed skills', '')}
40
40
  ${line('skills', 'Claude Code・Codex に入れたスキルを更新する / update the skills installed in Claude Code and Codex', 'update')}
41
41
 
42
42
  --version 版を出す / print the version
@@ -232,7 +232,7 @@ async function doctor() {
232
232
  }
233
233
  // 部品の写し:組み立てが読む index.js を、固定(components.lock.json)と manifest のファイルごとの sha256 で(kit/vendor-verify.mjs)
234
234
  const vv = verifyVendorIndex(ROOT);
235
- show(!vv.problems.length, 'parts', vv.problems.length ? `部品の写しが固定と合わない / the vendored parts do not match their pins: ${vv.problems.slice(0, 3).join('; ')}${vv.problems.length > 3 ? ` (+${vv.problems.length - 3})` : ''}`
235
+ show(!vv.problems.length, 'parts', vv.problems.length ? `パーツの写しが固定と合わない / the vendored parts do not match their pins: ${vv.problems.slice(0, 3).join('; ')}${vv.problems.length > 3 ? ` (+${vv.problems.length - 3})` : ''}`
236
236
  : `index.js ${vv.versions} 版、固定と manifest の sha256 に合う / ${vv.versions} versions match the lock and the manifests`, '包みを入れ直す / reinstall the package (`npm install egatari`)', true);
237
237
  try {
238
238
  const dv = defaultVoices();
@@ -241,6 +241,9 @@ async function doctor() {
241
241
  } catch (e) { show(false, 'voices', `tts/voices.json: ${e.message}`, '', false); }
242
242
  const old = oldSkillLinks();
243
243
  show(!old.length, 'skills', old.length ? `古いスキルの置き場が残っている / old skill entries left: ${old.map((o) => `${o.path} (${o.why})`).join(', ')}` : '古いスキルの置き場なし / no old skill entries', MIGRATE_STEPS, false);
244
+ // この包みが持つスキルの指示の版と Studio の版(npx egatari@X.Y.x なら、その系の最新)。スキルは自分の版とこの行を比べ、古ければ 1 回知らせる(v0.6.10)
245
+ const kit = kitInstruction();
246
+ if (kit) show(true, 'skills', `指示の版 ${kit}(Studio ${PKG.version})/ skill instructions ${kit} (Studio ${PKG.version})`, '', false);
244
247
  skillsCheck();
245
248
  console.log(bad ? `足りないもの ${bad} / ${bad} required missing` : 'ok');
246
249
  process.exit(bad ? 1 : 0);
@@ -938,7 +938,8 @@
938
938
  "2.0.0",
939
939
  "2.0.1",
940
940
  "2.0.2",
941
- "2.0.3"
941
+ "2.0.3",
942
+ "2.0.4"
942
943
  ],
943
944
  "sha256": {
944
945
  "1.0.0": "20be414e2dc3b813150887bb93041140b99b2b61352165bb50b74e9b664982a1",
@@ -966,7 +967,8 @@
966
967
  "2.0.0": "a72751c88bb2d7843fff1ca118b453491269e0a56af92f108d79a7a275f04d29",
967
968
  "2.0.1": "c309b80743e3b165b6993cbc57d827557ecc6b9ddedd1ab6d0bfa638da0147d8",
968
969
  "2.0.2": "f72c8087d3b5bd4331207bbb91c8bae1abfbe00fa98ee1c942b44a77fd7e1e32",
969
- "2.0.3": "ad6cb79c15b5131c2ba9076ce14124d643936bcf997d19428e57717eda224f1f"
970
+ "2.0.3": "ad6cb79c15b5131c2ba9076ce14124d643936bcf997d19428e57717eda224f1f",
971
+ "2.0.4": "db5f113e49ce3a2904a4db7665f7637a0409f77445bcfd89f02077dc1276035f"
970
972
  },
971
973
  "crlfSha256": {
972
974
  "1.0.0": "b7329ff977d28502ea6bf6d478383f422fd138d956b3910a6edf4129f69e1642",
@@ -1018,7 +1020,8 @@
1018
1020
  "2.0.0": "cbf9ffaca099ee9ed0d079c1cfecb1c5222e5f7e6d3c8a0f3f4f64626defe08a",
1019
1021
  "2.0.1": "10598b84d3e070ece84905f83ce55eaac9d2df7fc4746e129fe8196bb23d8200",
1020
1022
  "2.0.2": "128a9110ebb4e49be79c099aa7d742914e0fcf937bb15256f1352aa42cfb9b0d",
1021
- "2.0.3": "3395706f819e0e70b4047da33486a4b59e65118faf8f918677061e397dae408c"
1023
+ "2.0.3": "3395706f819e0e70b4047da33486a4b59e65118faf8f918677061e397dae408c",
1024
+ "2.0.4": "1d10fec0552198e3926b3d960046606668fa7f42f562cea539c6a16cc3e83338"
1022
1025
  }
1023
1026
  },
1024
1027
  "gendai": {
@@ -2189,7 +2192,8 @@
2189
2192
  "2.0.0",
2190
2193
  "2.0.1",
2191
2194
  "2.0.2",
2192
- "2.0.3"
2195
+ "2.0.3",
2196
+ "2.0.5"
2193
2197
  ],
2194
2198
  "sha256": {
2195
2199
  "1.7.0": "6807eca03d1980b2bcdda2b020d5c5a2bcd3e118ee508fd0ea110e1584d31a70",
@@ -2205,7 +2209,8 @@
2205
2209
  "2.0.0": "40029453a3a0fd31dce947ba78556a1e0b5b0b24aaa138481a16bf1b0d71193f",
2206
2210
  "2.0.1": "493f43633660203e22f11954f33ab122e3d1d9e097be4b79afecc14523f51311",
2207
2211
  "2.0.2": "bbe72d9268c240e4b5b4e9b4005f4ee66aa2a2d12b8c5c3de86f6ac9379b4100",
2208
- "2.0.3": "c6d88aca60f261322cfc0a0bf9f6bb98111d6a0c674460f45e9d691cfa9b4aa1"
2212
+ "2.0.3": "c6d88aca60f261322cfc0a0bf9f6bb98111d6a0c674460f45e9d691cfa9b4aa1",
2213
+ "2.0.5": "db6fed238aa539e1d93f9cf6b7fb2129632149e31e9f0ed1356e555ae4ac1f6a"
2209
2214
  },
2210
2215
  "crlfSha256": {
2211
2216
  "1.7.0": "bd044d2f9238f6ffc7c3d35875fcdf6bec47e30d615423cba4453f1422bc83b3",
@@ -2233,7 +2238,8 @@
2233
2238
  "2.0.0": "2ec05263e6fe8c9cfd7919e4e8031202997d40dceaa93b962fb47c29c3aa972d",
2234
2239
  "2.0.1": "7324349691c265ff4cd5f9219bb9326bf966dbf0feb93dbe893edadd2c0595bc",
2235
2240
  "2.0.2": "34970c3ad1133fefb3ea2c8bc77431885fa8d8fb157c2e2ee892d243f83bd3f1",
2236
- "2.0.3": "2c9490ac960a5bb04ebc0c8fa0622392775f85ef8b8ebe93065991ce40afc097"
2241
+ "2.0.3": "2c9490ac960a5bb04ebc0c8fa0622392775f85ef8b8ebe93065991ce40afc097",
2242
+ "2.0.5": "19f34ad938c3513d9268fcedb947e0049380232da2293d5c00922fe32ec1a088"
2237
2243
  }
2238
2244
  },
2239
2245
  "quad": {