@lincyaw/skills 1.0.0-rc.112 → 1.0.0-rc.114
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.
- package/README.md +1 -1
- package/package.json +4 -3
- package/skills/index.json +14 -5
- package/skills/presmium-author/SKILL.md +1 -0
- package/skills/presmium-author/references/publishing.md +2 -2
- package/skills/presmium-figure/SKILL.md +89 -0
- package/skills/presmium-present/SKILL.md +35 -0
- package/skills/presmium-present/references/classroom.md +64 -0
- package/skills/presmium-present/references/delivery.md +122 -0
- package/skills/presmium-present/references/lecture.md +74 -0
- package/src/resources.ts +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @lincyaw/skills
|
|
2
2
|
|
|
3
|
-
The bundled `presmium-author`, `presmium-animate`, `presmium-develop` and `presmium-paper-to-xiaohongshu` skills, with their references and animation gallery text. The paper workflow produces a narrated animation, independent cover and brief introduction, continues the configured account's episode numbering and verifies the Xiaohongshu submission. Their authority is the repository’s `.agents/skills`; packaging generates this package’s `skills/` resources and index.
|
|
3
|
+
The bundled `presmium-author`, `presmium-animate`, `presmium-develop`, `presmium-figure` and `presmium-paper-to-xiaohongshu` skills, with their references and animation gallery text. The paper workflow produces a narrated animation, independent cover and brief introduction, continues the configured account's episode numbering and verifies the Xiaohongshu submission. Their authority is the repository’s `.agents/skills`; packaging generates this package’s `skills/` resources and index.
|
|
4
4
|
|
|
5
5
|
`listBundledSkills()` returns names, descriptions and relative file lists. `readBundledSkill({ name, path, offset, limit })` reads at most 12,000 Unicode characters and returns the next offset, package version and file SHA-256. `skillDirectory(name)` supplies a resource base to a host integration. Unsafe paths and unavailable files raise `SkillError` with a stable code.
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lincyaw/skills",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
4
|
-
"description": "Presmium's bundled authoring, animation, presentation and plugin-development skills for coding agents",
|
|
3
|
+
"version": "1.0.0-rc.114",
|
|
4
|
+
"description": "Presmium's bundled authoring, animation, figure, presentation and plugin-development skills for coding agents",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -36,13 +36,14 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"jiti": "^2.7.0",
|
|
39
|
-
"@lincyaw/kernel": "1.0.0-rc.
|
|
39
|
+
"@lincyaw/kernel": "1.0.0-rc.114"
|
|
40
40
|
},
|
|
41
41
|
"presmium": {
|
|
42
42
|
"skills": [
|
|
43
43
|
"presmium-author",
|
|
44
44
|
"presmium-animate",
|
|
45
45
|
"presmium-develop",
|
|
46
|
+
"presmium-figure",
|
|
46
47
|
"presmium-paper-to-xiaohongshu"
|
|
47
48
|
],
|
|
48
49
|
"generated": [
|
package/skills/index.json
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"references/publishing.md",
|
|
13
13
|
"references/writing.md"
|
|
14
14
|
],
|
|
15
|
-
"version": "1.0.0-rc.
|
|
16
|
-
"hash": "
|
|
15
|
+
"version": "1.0.0-rc.114",
|
|
16
|
+
"hash": "1928a5016e46469882f83cebc3197bda2de6219cebfecc78a8d0895bd383b80b"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"name": "presmium-animate",
|
|
@@ -546,7 +546,7 @@
|
|
|
546
546
|
"references/team.md",
|
|
547
547
|
"references/timeline.md"
|
|
548
548
|
],
|
|
549
|
-
"version": "1.0.0-rc.
|
|
549
|
+
"version": "1.0.0-rc.114",
|
|
550
550
|
"hash": "278048c31db270706e3ac00172af8e181b2425eef4e6d635561873f6edf65e08"
|
|
551
551
|
},
|
|
552
552
|
{
|
|
@@ -557,9 +557,18 @@
|
|
|
557
557
|
"references/plugin.md",
|
|
558
558
|
"references/testing.md"
|
|
559
559
|
],
|
|
560
|
-
"version": "1.0.0-rc.
|
|
560
|
+
"version": "1.0.0-rc.114",
|
|
561
561
|
"hash": "96422f5cef6a97bba23c9c67b7fb0ee491b18f01f789e262ca24b274e7fabaa1"
|
|
562
562
|
},
|
|
563
|
+
{
|
|
564
|
+
"name": "presmium-figure",
|
|
565
|
+
"description": "Draw SVG figures (diagrams, schematics, charts for a paper, a slide or a post) as React components in a Presmium lecture.json document, build them up step by step like slide builds, and export each step as a standalone SVG file. Use when the person wants SVG graphics, vector figures, a diagram that grows or changes over several pictures, or 'export every step as SVG'. 画 SVG 图形、矢量图、示意图,按步骤逐步增加或修改,每一步导出一张 SVG 时使用。",
|
|
566
|
+
"files": [
|
|
567
|
+
"SKILL.md"
|
|
568
|
+
],
|
|
569
|
+
"version": "1.0.0-rc.114",
|
|
570
|
+
"hash": "a03595b333993f0b2561aa34b23b1c68c946f744fa8f56d2912044a494b482ac"
|
|
571
|
+
},
|
|
563
572
|
{
|
|
564
573
|
"name": "presmium-paper-to-xiaohongshu",
|
|
565
574
|
"description": "Turn paper links into narrated Presmium animations, independent covers and brief introductions, then save drafts, schedule or publish authorized Xiaohongshu posts with continuing episode numbers. Use for the configured paper-sharing workflow or an explicit paper-to-Xiaohongshu request; research-only links do not authorize posting. 论文链接制作动画、配音、封面与简介,支持批量草稿、定时与接续期数发布。",
|
|
@@ -567,7 +576,7 @@
|
|
|
567
576
|
"SKILL.md",
|
|
568
577
|
"references/publication.md"
|
|
569
578
|
],
|
|
570
|
-
"version": "1.0.0-rc.
|
|
579
|
+
"version": "1.0.0-rc.114",
|
|
571
580
|
"hash": "fd786b61de15a588205eb3c99c28481a4be9d46127a09fdc29b6e5f28e8f684c"
|
|
572
581
|
}
|
|
573
582
|
]
|
|
@@ -29,6 +29,7 @@ Terms used throughout:
|
|
|
29
29
|
| Write a lecture, revise text, plan pages, write slide text or narration | [Writing](references/writing.md) first, then [Document format](references/document.md) |
|
|
30
30
|
| Show code, reference project files or run code | [Code](references/code.md) |
|
|
31
31
|
| Show something moving or explain a process | `presmium-animate` |
|
|
32
|
+
| Draw an SVG figure that builds up step by step, exported as SVG files | `presmium-figure` |
|
|
32
33
|
| Make one large piece with several agents in parallel | `presmium-animate/references/team.md` |
|
|
33
34
|
| Generate voiceover, choose voices, set captions, record or make the video | [Lecture production](references/lecture.md) |
|
|
34
35
|
| Turn a paper link into an animation, voiceover, cover and brief introduction, then post to Xiaohongshu | `presmium-paper-to-xiaohongshu` |
|
|
@@ -62,7 +62,7 @@ Each section heading on the web page links to the same place in the slides. When
|
|
|
62
62
|
{ "presmium.web": { "slidesUrl": "https://example.com/slides/" } }
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
## Export a PDF, images or
|
|
65
|
+
## Export a PDF, images, PowerPoint or SVG figures
|
|
66
66
|
|
|
67
67
|
Export prints the slides in Chromium. Set it up once in the project:
|
|
68
68
|
|
|
@@ -79,7 +79,7 @@ pnpm exec presmium-export --format pdf --output lecture.pdf
|
|
|
79
79
|
|
|
80
80
|
| Option | Does |
|
|
81
81
|
|---|---|
|
|
82
|
-
| `--format pdf` (default), `png`, `pptx` | PDF; PNG images, one per slide, into the `--output` folder; PowerPoint, each slide a picture, the narration as speaker notes, no links |
|
|
82
|
+
| `--format pdf` (default), `png`, `pptx`, `svg` | PDF; PNG images, one per slide, into the `--output` folder; PowerPoint, each slide a picture, the narration as speaker notes, no links; SVG, each figure (`<svg data-figure>`) at each step that changes it, into the `--output` folder (see the `presmium-figure` skill) |
|
|
83
83
|
| `--output <file or folder>` | Where to write |
|
|
84
84
|
| `--with-clicks` | One page (or image) per step instead of per slide |
|
|
85
85
|
| `--range 1,3-5` | Only these slides |
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: presmium-figure
|
|
3
|
+
description: "Draw SVG figures (diagrams, schematics, charts for a paper, a slide or a post) as React components in a Presmium lecture.json document, build them up step by step like slide builds, and export each step as a standalone SVG file. Use when the person wants SVG graphics, vector figures, a diagram that grows or changes over several pictures, or 'export every step as SVG'. 画 SVG 图形、矢量图、示意图,按步骤逐步增加或修改,每一步导出一张 SVG 时使用。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Step-built SVG figures
|
|
7
|
+
|
|
8
|
+
A figure is a React component that returns one `<svg data-figure="name">`. The document's steps tell it which picture to draw, the way a slide build adds or changes one thing per click. `presmium-export --format svg` writes the figure at each step as its own `.svg` file: only the figure, not the page around it, with the look written on each element, so the file opens the same in a browser, Figma, Inkscape or Illustrator.
|
|
9
|
+
|
|
10
|
+
For moving animation (motion between states, timelines, narration) use the `presmium-animate` skill instead. A figure has no motion: each step is a still picture.
|
|
11
|
+
|
|
12
|
+
## 1. Plan the pictures
|
|
13
|
+
|
|
14
|
+
Write down the pictures in order before any code, one line each: what is added or changed in it. Give each picture a short state ID (`input`, `model`, `output`, `focus`). One figure, one idea; a second idea is a second figure.
|
|
15
|
+
|
|
16
|
+
Each picture must be drawable from its state ID alone: the component must not remember the previous step. Going back to step 2 draws exactly picture 2.
|
|
17
|
+
|
|
18
|
+
## 2. Write the component
|
|
19
|
+
|
|
20
|
+
Put it in a project file such as `figures/Pipeline.tsx`. Read the current state with `useStepScope()` from `@lincyaw/host` and draw from it:
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import { useStepScope } from '@lincyaw/host'
|
|
24
|
+
import './figure.css'
|
|
25
|
+
|
|
26
|
+
const ORDER = ['input', 'model', 'output', 'focus'] as const
|
|
27
|
+
|
|
28
|
+
export default function Pipeline({ title = 'Pipeline' }: { title?: string }) {
|
|
29
|
+
const state = (useStepScope().state ?? 'focus') as typeof ORDER[number]
|
|
30
|
+
const shown = ORDER.indexOf(state)
|
|
31
|
+
return (
|
|
32
|
+
<svg data-figure="pipeline" className="figure" viewBox="0 0 600 160" role="img" aria-label={title}>
|
|
33
|
+
{shown >= 0 && <rect x="20" y="50" width="160" height="60" rx="10" />}
|
|
34
|
+
{shown >= 1 && <rect x="220" y="50" width="160" height="60" rx="10" className={state === 'focus' ? 'is-focus' : undefined} />}
|
|
35
|
+
{/* … one element group per picture */}
|
|
36
|
+
</svg>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Rules:
|
|
42
|
+
|
|
43
|
+
- The root element is one `<svg>` with `data-figure="<name>"` and a `viewBox`. The name becomes the file name; use lowercase words with hyphens, unique in the document. A figure without `data-figure` is not exported.
|
|
44
|
+
- Without a state (the reading page shows the whole figure) draw the last picture.
|
|
45
|
+
- Draw elements only from the state; add an element by rendering it, remove it by not rendering it. Change a look by changing a class or attribute.
|
|
46
|
+
- Style with a CSS file next to the component and the design tokens (`var(--pm-color-accent)`, `var(--pm-color-ink)`, `var(--pm-color-line-strong)`, `var(--pm-color-bg)`, `var(--pm-color-accent-soft)`, `var(--pm-font-sans)`). The export resolves them to plain colors; `--dark` exports the dark palette.
|
|
47
|
+
- Text stays text in the SVG. The file names the font but does not embed it; where the font is missing, the viewer substitutes one. Leave room in boxes for that.
|
|
48
|
+
- Pictures (`<image href>`) are embedded into the file as data.
|
|
49
|
+
- Give `<marker>`, gradient and pattern IDs a prefix of the figure's name, since several figures share one page.
|
|
50
|
+
- Do not give the definition a static `fallback`: the print page that the export reads shows a component's fallback instead of the component.
|
|
51
|
+
|
|
52
|
+
## 3. Register it in the document
|
|
53
|
+
|
|
54
|
+
In `lecture.json`, add a definition, a component block that uses it, and one step per picture that sets the block's state. The complete working document is in [example/lecture.json](example/lecture.json), its component in [example/figures/Pipeline.tsx](example/figures/Pipeline.tsx):
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
"definitions": {
|
|
58
|
+
"pipeline-definition": {
|
|
59
|
+
"id": "pipeline-definition", "kind": "component", "schemaVersion": 1,
|
|
60
|
+
"implementation": { "type": "file", "path": "figures/Pipeline.tsx" },
|
|
61
|
+
"parameterSchema": { "type": "object", "properties": { "title": { "type": "string", "title": "Title" } } },
|
|
62
|
+
"states": [{ "id": "input" }, { "id": "model" }, { "id": "output" }, { "id": "focus" }]
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"blocks": {
|
|
66
|
+
"pipeline-figure": { "id": "pipeline-figure", "type": "component", "definitionId": "pipeline-definition", "parameters": { "title": "Tokens to logits" } }
|
|
67
|
+
},
|
|
68
|
+
"steps": {
|
|
69
|
+
"pipeline-input": { "id": "pipeline-input", "sectionId": "pipeline", "visuals": [{ "blockId": "pipeline-figure", "visible": true, "state": "input" }], "narrationIds": [] }
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The section lists the steps in order in `stepOrder` and the block in `children`. IDs are unique across the whole document: a definition cannot share its ID with a section. Values that differ per picture (a number, a label) can go in the visual's `parameters`; the component receives them as props.
|
|
74
|
+
|
|
75
|
+
Run `presmium check` and fix every error before exporting.
|
|
76
|
+
|
|
77
|
+
## 4. Look, then export
|
|
78
|
+
|
|
79
|
+
Preview with `presmium dev` and step through the slides forward and backward; each step must show its picture. Then export from the document folder (set up once: `pnpm add -D @lincyaw/addon-publish playwright-chromium` and `pnpm exec playwright install chromium`):
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
pnpm exec presmium-export --format svg --output figures-out
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
It writes, for each figure, `<name>-1.svg`, `<name>-2.svg`, … one per step that changes it (a step that leaves the figure as it was writes no new file), or `<name>.svg` when it never changes. Every `.svg` file already in that folder is removed first, so export into a folder of its own. `--range 2,4-5` limits the export to those slides, `--dark` uses the dark palette. In the studio, **Export → Figures as SVG** makes the same files.
|
|
86
|
+
|
|
87
|
+
The export fails with "the slides draw no figure" when no `<svg data-figure>` was drawn: check the attribute, and that the definition has no `fallback`.
|
|
88
|
+
|
|
89
|
+
Afterwards open a few of the files on their own (in a browser tab, not inside the slides) and check that every picture is complete and that text fits its boxes.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: presmium-present
|
|
3
|
+
description: "Present and deliver a Presmium document, run classroom interaction, export or record it, and manage structured narration, real speech synthesis, subtitles and video playback from lecture.json production settings. 放映、上课、导出、录课、配音、字幕与讲授视频时使用。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Presenting and producing a lecture
|
|
7
|
+
|
|
8
|
+
The editable document is `lecture.json`. Reading, slides, notebook and narrated lecture are derived forms. The **lecture** is narrated playback/video, not a second editable source. Keep document editing, compiled presentation and video production separate.
|
|
9
|
+
|
|
10
|
+
| Task | Read |
|
|
11
|
+
|---|---|
|
|
12
|
+
| Present, share or prepare offline outputs | [Delivery](references/delivery.md) |
|
|
13
|
+
| Classroom questions, quizzes and interaction | [Classroom](references/classroom.md) |
|
|
14
|
+
| Narration, voice, captions, recording or video | [Lecture production](references/lecture.md) |
|
|
15
|
+
|
|
16
|
+
Read the document and installed plugin capabilities before operating. Compilation can fail while the document remains saved; identify which source version a displayed snapshot represents. Never use stale audio or a stale generated result as the current document's result.
|
|
17
|
+
|
|
18
|
+
## Run only the requested output
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
presmium check lesson --json
|
|
22
|
+
presmium dev lesson
|
|
23
|
+
presmium build lesson --to slides
|
|
24
|
+
presmium build lesson --to lecture
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Renderers are configured in `metadata.renderers`; document plugins in `metadata.plugins` and document plugin settings in `metadata.presmium`. Operator credentials and provider endpoints remain outside the document. Read the installed renderer's public configuration for actual export support.
|
|
28
|
+
|
|
29
|
+
## Narration and playback rules
|
|
30
|
+
|
|
31
|
+
Steps explicitly reference structured narrations. Voice source and playback timing are owned by `production`. Resolve actual provider voices and supported parameters instead of inventing a catalogue. Changing a voice or script does not synthesize automatically. Explain the target/provider and scope before an explicit paid action.
|
|
32
|
+
|
|
33
|
+
Audition and formal playback share exclusive ownership: starting either stops or pauses the other. Seeking pauses first and reconstructs the selected step state. Cancel a task without deleting valid completed cache entries. Confirm saved/generated results against target document, request and version.
|
|
34
|
+
|
|
35
|
+
Check visible content, captions, step navigation and audio on the actual output. A successful compile alone does not prove playable speech or a working exporter.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
> Editable source is `lecture.json`; renderer settings are under `metadata.renderers`, steps and narrations are explicit entities, and production timing/voices live only in `production`.
|
|
2
|
+
|
|
3
|
+
# Classroom
|
|
4
|
+
|
|
5
|
+
A classroom lets students scan a QR code, follow the presenter's position on their own device, answer quizzes and polls, submit exercises and ask questions. It has three parts, each on its own address:
|
|
6
|
+
|
|
7
|
+
- the **student site**: a static build of the document for students, served on the class network;
|
|
8
|
+
- the **classroom server** (`presmium-classroom-server`): a small sync server the presenter and all students connect to;
|
|
9
|
+
- the **presenter's page**: the whole document, built with the same classroom server setting, opened by the teacher.
|
|
10
|
+
|
|
11
|
+
Do not run a class from `presmium dev` or `presmium serve`. Their built-in classroom sync is for the teacher rehearsing on this computer; anyone who reaches those services has the teacher's rights and sees the whole document.
|
|
12
|
+
|
|
13
|
+
## Prepare the site and the server
|
|
14
|
+
|
|
15
|
+
1. **Plugins.** List `@lincyaw/addon-session` (joining and following) and `@lincyaw/addon-classroom` (quizzes, polls, questions) in the `metadata.plugins`; add `@lincyaw/addon-exec` when students submit code exercises that are checked. Install each with `pnpm add -D <package>`.
|
|
16
|
+
|
|
17
|
+
2. **Start the classroom server** on a computer in the class network:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
pnpm add -g @lincyaw/classroom-server
|
|
21
|
+
presmium-classroom-server --port 1234 --deck .
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Run it in the document folder: `--deck` is the folder where archived classrooms are written (default: the current folder). `--port` defaults to 1234 (`0` picks a free one); `--host` limits the address it listens on (default: every interface). It prints the addresses it can be reached at; pick the local-network one (such as `192.168.1.10`), not `localhost`, because student devices reach it there.
|
|
25
|
+
|
|
26
|
+
3. **Point the document at the server.** In `lecture.json` under `metadata.presmium`, with the address printed in step 2:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{ "presmium.session": { "server": "ws://192.168.1.10:1234" } }
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`metadata.presmium` holds settings per plugin; `presmium.session` is the session plugin's. An `http://` address is turned into `ws://`. The address is written into the build, so rebuild after changing it.
|
|
33
|
+
|
|
34
|
+
4. **Build both versions** with that setting, each into its own folder:
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
presmium build --to web --audience student --out dist-student
|
|
38
|
+
presmium build --to web --out dist-full
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`--audience student` leaves out content marked for teachers only (for example a block with `audience: ["teacher"]`; the markers are explained in `presmium-author/references/publishing.md`, "Content for students"). The two versions keep students at the same section as the presenter by the sections' ids, so keep stable section IDs when you edit between builds.
|
|
42
|
+
|
|
43
|
+
5. **Serve them** as static sites on the class network (commands in [delivery.md](delivery.md), "Give readers a web address"): `dist-student/web` for students, `dist-full/web` for the teacher.
|
|
44
|
+
|
|
45
|
+
**Network and safety.** The classroom server has no TLS and no login: anyone with the join link can join, so run it on the class's own network. A site served over HTTPS needs a `wss://` server address the browsers can reach. Only the browser window that created a classroom can end or archive it, open and close its quizzes, or move its students; everyone else writes only their own answers, questions, votes and submissions.
|
|
46
|
+
|
|
47
|
+
## Run a class
|
|
48
|
+
|
|
49
|
+
1. **Create the classroom.** The teacher opens the full site's address (the local-network address, not `localhost`), clicks **Classroom** in the navigation bar, then **Create classroom** (in the slides form, the classroom is in the presenter window's panel). A join link and a QR code appear. Scan it from a phone or open it in another browser to check that joining works.
|
|
50
|
+
2. **Following.** Students follow the presenter by default: when the teacher moves to another section or step, each student lands at the same place. A student who clicks **Browse alone** moves on their own; **Back to the presenter** resumes following. Check this once with your test student before class. Teacher-only content does not appear on students' screens, because their site was built without it.
|
|
51
|
+
3. **Quizzes.** On a quiz, the teacher clicks **Open answering**; students submit; the correct answer is shown only after the teacher clicks **Close answering**. For an exercise, the teacher sees who passed after students submit. Questions, polls and understanding checks are collected under **Interaction** in the teacher's classroom panel.
|
|
52
|
+
4. **After class.** Click **End classroom**, then **Archive classroom**. The archive is written to `.presmium/classroom/<room>.json` in the server's `--deck` folder; after that nobody can join or write. Personal notes are not archived. The archive is ignored by git by default; back it up separately when it must be kept.
|
|
53
|
+
|
|
54
|
+
A classroom lives in the server's memory: restarting the server before archiving loses its records. If the teacher's window closes by accident, reopen the same address in the same browser and choose **Rejoin classroom <room> as presenter**.
|
|
55
|
+
|
|
56
|
+
## Predictions and AI answers
|
|
57
|
+
|
|
58
|
+
The prediction component asks students to write a prediction before what follows is shown. In the web Document view the student must save a prediction first; in Present and in the slides, the teacher's next step reveals it as usual. When a document uses it, check it on a student device; the teacher's screen does not show the student side.
|
|
59
|
+
|
|
60
|
+
With `@lincyaw/addon-assistant` in `metadata.plugins` and a model set up in the teacher's browser (students need no model key), the teacher can generate an AI answer to a student's question, read it in their own window, and click **Send to the classroom**. Until it is sent, nobody else sees it.
|
|
61
|
+
|
|
62
|
+
## When students cannot join
|
|
63
|
+
|
|
64
|
+
Check separately that a student device opens the student site, and that it connects to the classroom server: the address, the port, and `ws://` for an `http://` site or `wss://` for an `https://` site. After changing the `server` setting: rebuild, restart the static server, and create the classroom again to get a new join link.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
> Editable source is `lecture.json`; renderer settings are under `metadata.renderers`, steps and narrations are explicit entities, and production timing/voices live only in `production`.
|
|
2
|
+
|
|
3
|
+
# Publishing, export and offline
|
|
4
|
+
|
|
5
|
+
Pick the build from what the teacher hands out. Run every command in the document folder. Before building, read the `metadata.renderers`: it lists the forms (`web`, `slides`, `notebook`, `lecture`) with their options, among them `base`, the URL path a form's site is served at (such as `/course/week1/`). When `base` is already set, the site is meant for that path: keep it and the hosting the teacher already uses.
|
|
6
|
+
|
|
7
|
+
`presmium build` writes into `dist/` (or the folder given with `--out`): one subfolder per form, such as `dist/web/`. Building is not deploying: copy the output to whatever host the teacher chooses.
|
|
8
|
+
|
|
9
|
+
## Give readers a web address
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
presmium build --to web
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
When only the web form is built and `base` is not set, `dist/web/` is a site for the root path `/`. To serve it on this computer when the project has no static server yet:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
pnpm add -D sirv-cli
|
|
19
|
+
pnpm exec sirv dist/web --port 8080
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Open the address the terminal prints; the document's first page appears. Chapter pages have their own HTML files; a document with `metadata.renderers.web.layout: landing` combines all sections into one HTML page. A host needs no single-page-app fallback rule. Restart sirv after every rebuild: the file names change and a running sirv does not see the new ones.
|
|
23
|
+
|
|
24
|
+
**Student version.** Build it into its own folder so nothing from a full build is mixed in, and serve `dist-student/web` instead:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
presmium build --to web --audience student --out dist-student
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`--audience student` leaves out content marked for teachers only (markers such as `:audience: teacher` are explained in `presmium-author/references/publishing.md`, "Content for students"). Every file written is then scanned for sentences of the left-out content; a hit is reported as `presmium.audience` and means teacher content leaked into the student version through some output; trace and fix it in the source. Then open the student site and look for teacher narration, answers and media.
|
|
31
|
+
|
|
32
|
+
## Publish a themed workspace
|
|
33
|
+
|
|
34
|
+
A website created with `presmium new my-site --type site --theme course` has an independent homepage (`site/home.json`), a teaching document (`intro/lecture.json`), workspace configuration and `.github/workflows/pages.yml`. In that project, use `pnpm install`, `pnpm serve` for local preview, and `pnpm build` to write `dist/web/`.
|
|
35
|
+
|
|
36
|
+
Read the workspace's `site` before changing appearance or hosting. `site.theme` selects `course`, `docs` or `showcase`; `site.params` selects `accent` (`blue`, `teal`, `violet`, `amber`), `typography` (`reading`, `sans`), `contentWidth` (`comfortable`, `wide`), and optional `logo`/`logoAlt`. Preserve a configured `base`. A workspace applies one theme and brand across documents; a document can set `metadata.renderers.web.layout` to `article`, `landing` or `wide`. When building a document by itself, its `metadata.renderers.web` can also select `theme` and `params`.
|
|
37
|
+
|
|
38
|
+
`site.landing: { source: './site/home.json' }` selects an independent homepage; the same site page object may be written inline. Its own title, hero and sections introduce the site without using a teaching-document model. Homepage files are outside `documents`; teaching content still has `lecture.json` as its only editable source.
|
|
39
|
+
|
|
40
|
+
`site.landing: { template: './site/home.html' }` selects a free HTML/CSS/JavaScript homepage instead. Its local assets are built with Vite and its injected `script#presmium-site-data` holds only the public site title, base, language and document collection. Read the JSON and use the published document links. Refresh the page to rebuild a served template; there is no template hot update channel. Build again before deployment.
|
|
41
|
+
|
|
42
|
+
Existing string configuration `site.landing: welcome` intentionally uses all sections of `welcome/lecture.json` at the website root and keeps its document URL and normal chapter pagination. A document's own `metadata.renderers.web.layout: landing` combines its sections into one webpage at that document's address. `site.home` retains redirect behavior and cannot be set together with any form of `landing`.
|
|
43
|
+
|
|
44
|
+
Each translation chooses its own document layout; an omitted layout means `article`, while the workspace's theme stays shared. Restart `pnpm serve` after editing website settings in `presmium.workspace.yaml`, or run `pnpm build` again to export them.
|
|
45
|
+
|
|
46
|
+
For GitHub Pages, the generated workflow reads the deployment base path and publishes `dist/web/`. The repository's Pages source must be GitHub Actions. After deploying, open the real root address and an inner-page direct link, use search, and play the media. Ordinary file links can publish PowerPoint or Word downloads; choosing a theme does not add Office import or an Office previewer.
|
|
47
|
+
|
|
48
|
+
## Hand out the web page and the slides together
|
|
49
|
+
|
|
50
|
+
Built together, with `base` set on neither, the web page is at `/web/` and the slides at `/slides/` of one site. Serve the whole `dist/` folder:
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
presmium build --to web,slides
|
|
54
|
+
pnpm exec sirv dist --port 8080
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Open `<address>/web/` and `<address>/slides/`. The slides are one page (`index.html`); the slide and step are in the address's query (`?slide=<number>&step=<step>`), so a host needs no fallback rule here either.
|
|
58
|
+
|
|
59
|
+
When only the slides are built and `base` is not set, serve `dist/slides` instead (`pnpm exec sirv dist/slides --port 8080`). When the site already lives under a sub-path, serve the output at that path.
|
|
60
|
+
|
|
61
|
+
Each section heading on the web page links to the same place in the slides. When the two are deployed at different addresses, write the slides' real address in the document metadata, then check that a heading link lands on the right slide and step:
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{ "presmium.web": { "slidesUrl": "https://example.com/slides/" } }
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Export a PDF, images or PowerPoint
|
|
68
|
+
|
|
69
|
+
Export prints the slides in Chromium. Set it up once in the project:
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
pnpm add -D @lincyaw/addon-publish playwright-chromium
|
|
73
|
+
pnpm exec playwright install chromium
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
and list `'@lincyaw/addon-publish'` in the document metadata's `plugins`. Then, in the document folder:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
pnpm exec presmium-export --format pdf --output lecture.pdf
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
| Option | Does |
|
|
83
|
+
|---|---|
|
|
84
|
+
| `--format pdf` (default), `png`, `pptx` | PDF; PNG images, one per slide, into the `--output` folder; PowerPoint, each slide a picture, the narration as speaker notes, no links |
|
|
85
|
+
| `--output <file or folder>` | Where to write |
|
|
86
|
+
| `--with-clicks` | One page (or image) per step instead of per slide |
|
|
87
|
+
| `--range 1,3-5` | Only these slides |
|
|
88
|
+
| `--dark` | The dark theme |
|
|
89
|
+
| `--timeout <ms>` | How long a page may take to be ready (default 120000) |
|
|
90
|
+
| `--json` | Print the result as JSON |
|
|
91
|
+
|
|
92
|
+
`presmium-export` builds its own copy of the slides before printing, so the site's `base` does not affect it. A PDF export checks that every link the slides show is still a link in the PDF, and exits with code 1 when one was lost. Exit code 2 means a page was missing or the export timed out: read the error, then retry or raise `--timeout`. A file from a failed run is not a finished export.
|
|
93
|
+
|
|
94
|
+
In the studio, **Export** in the command bar makes the same PDFs, images and PowerPoint (and lecture videos) without the publish plugin listed; the files can be opened, played and downloaded there.
|
|
95
|
+
|
|
96
|
+
Afterwards, open the file and check the page count, missing pages, long code running off the page and the key links. Code that readers can run in the browser is printed with its recorded output.
|
|
97
|
+
|
|
98
|
+
## Give students a runnable notebook
|
|
99
|
+
|
|
100
|
+
```sh
|
|
101
|
+
presmium build --to notebook
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
This writes `dist/notebook/<name>.ipynb`, named after the entry file (`lecture.ipynb` for `lecture.json`), with images and other files in `media/` beside it; hand out the whole `dist/notebook/` folder. The kernel is `python3` unless the `metadata.renderers.notebook` says otherwise. Interactive components that a notebook cannot hold become a static form; the build report lists them. To link them to the online version, set the web address:
|
|
105
|
+
|
|
106
|
+
```json
|
|
107
|
+
{ "notebook": { "kernel": "python3", "webUrl": "https://example.com/course/" } }
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Open the notebook in Jupyter and check that images show and code cells run.
|
|
111
|
+
|
|
112
|
+
## Prepare an offline class
|
|
113
|
+
|
|
114
|
+
A built web site keeps each document's pages and search in a separate browser cache after that document is opened. The code runtimes (what runs code in the browser) are larger and fetched only the first time code runs. So, while still online:
|
|
115
|
+
|
|
116
|
+
1. Open every document you will teach from at its exact deployed address, in the browser you will teach with, and wait until each page has loaded.
|
|
117
|
+
2. Run each piece of code the class uses once, or, with the publish plugin listed, click **Save for offline use** in the toolbar, which fetches the runtimes in advance. The publish plugin also copies remote images into the document at build time, so they show offline.
|
|
118
|
+
3. Disconnect the network and rehearse in the same browser at the same address: moving through slides, search, media, running code.
|
|
119
|
+
|
|
120
|
+
Remote Jupyter, the classroom server and AI models still need the network. When the class must be fully offline, prepare recorded outputs or a runtime that works locally.
|
|
121
|
+
|
|
122
|
+
`metadata.presmium["presmium.publish"].offline = false` in the document metadata turns the offline cache off; check whether it is set. Rehearse again after the site's address changes or after a rebuild: "it was opened before" does not prove this build's files are all cached.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Narration, speech and lecture production
|
|
2
|
+
|
|
3
|
+
`lecture.json` is the only content authority. Narrations contain typed text, pronunciation and cue nodes; steps name narration IDs. Read the installed kernel contract for exact fields. Captions, spoken text and alignments derive from the same narration structure. A transcript becomes authored text only through an explicit adopt action. Read a Whisper transcript before adopting it: `.en` models translate non-English speech into English; it invents "Thank you." over silence, so drop words that start inside a final silence (`silencedetect=noise=-35dB:d=0.6`); more than 20% `♪` or `�` tokens means it failed; Chinese can come back as one "word" per sentence, sometimes in Traditional characters for Simplified speech, so split it into phrases and spread the time by character count.
|
|
4
|
+
|
|
5
|
+
## Open the saved version in the studio
|
|
6
|
+
|
|
7
|
+
Use the document toolbar's presentation preview action after the authoring save is acknowledged. Preparation compiles the exact confirmed document and stays in the editor until compilation succeeds. Continue editing to cancel that transition; a late response must not take the author away from new input or another document. A compilation error leaves the document and draft intact with a readable failure.
|
|
8
|
+
|
|
9
|
+
The presentation identifies its confirmed source version. When the source or an observed project dependency changes, use the refresh icon's explicit recompile action to adopt the new result. Unconfirmed runtime revisions are hidden. This version check does not freeze historical project assets or external dependencies.
|
|
10
|
+
|
|
11
|
+
To embed a lecture in another page of the same site, put its presentation in an iframe: `slides/?view=present&track=<id>&autoplay`, adding `§ion=<id>&step=<k>` to start at a step. The player starts once it is ready; browsers allow sound only after a click on the embedding page, so load the iframe from that click. Where the browser still refuses, the presentation waits at its start with a large Play button. The presentation posts `{ type: 'presmium:state', drawn, section, step, lecture }` to the embedding page (`lecture`: `loading`, `waiting`, `playing`, `paused` or `failed`); `whenPresentationReady` from `@lincyaw/presmium/site` waits for it. Audio clips are positioned by seeking, so the host must answer byte-range requests (GitHub Pages does).
|
|
12
|
+
|
|
13
|
+
Keys while presenting: left/right arrows move a step, Space plays or pauses the lecture (with nothing to play it moves to the next step), O opens the overview, Shift+F goes full screen, Escape ends the show. In Video production, Space plays or pauses and left/right arrows select the previous or next step across pages, also while the preview has the focus. Ctrl+S (⌘S) saves at once anywhere in the studio. Text fields, editors, open menus and dialogs keep their keys; a control reached with Tab keeps Space; after a click on a control, Space and the arrows do the shortcut instead of pressing that control again. Settings → Keyboard Shortcuts lists these keys.
|
|
14
|
+
|
|
15
|
+
## Edit scripts and voices in video production
|
|
16
|
+
|
|
17
|
+
Use the document toolbar's **Video production** action for the independent production workspace. Its page and step controls select stable authoring steps; the script and timing fields write to the same canonical source. The visual preview compiles a confirmed saved version separately. Returning to the document retains the original body editor.
|
|
18
|
+
|
|
19
|
+
In Document editor, **Captions** opens only caption text and narration start. Pronunciation tools, hold, trailing pause and media properties belong in Video production; do not add routine explanations of the data model to the editor.
|
|
20
|
+
|
|
21
|
+
**Choose a voice** edits a recoverable settings draft. Choose this step, selected steps, this page or the document; review the affected scope before applying. Batch changes preserve independent settings by default, including explicit silence and recording sources. Replacing them requires a separate count-based confirmation. Restoring inheritance removes voice settings at the chosen level; it does not mean explicit silence. A changed source invalidates the confirmation and keeps the draft.
|
|
22
|
+
|
|
23
|
+
**Clone a voice…** appears under the voice list when the speech service can train cloned voices. It trains a voice from one person's recordings: give the voice a name (on Volcengine, a voice slot bought in its console, starting with `S_`, or a new name for a pay-as-you-go voice), the speaker and where the voice may be used; then record or choose two recordings of that speaker, the consent statement the dialog shows read aloud, and a 10 to 30 second sample. Recordings are converted to 24 kHz mono WAV in the browser. Training asks for its own confirmation because the provider charges for it; the consent record is saved on this machine before the sample is sent. The dialog then follows the training until it is ready and **Use this voice** selects it in the voice draft. Cloned voices are off until the operator allows them in the workspace settings, and without the consent record the voice cannot be synthesized. A pay-as-you-go Volcengine voice is charged at its first synthesis, previews included, and cannot be retrained after that: audition it deliberately.
|
|
24
|
+
|
|
25
|
+
Auditions and batch generation retain their confirmation. In Video production, clicking Play authorizes one cancellable on-demand playback: exact cached audio plays immediately; missing speech buffers, uses the shared voiceover job and cache, then continues in the same mounted player. Pause, step navigation, another audio start, or source/project changes retire that intent. Explicit silence and recordings never become TTS. No connected provider does not invalidate exact existing cache audio. The generation dialog reports actual cache, missing and unavailable counts; these are not a price quote. Closing requests cancellation of work confirmed in that dialog, retaining completed exact caches. Video production provides local audio import and clip forms as described below. Video files and subtitle alignment are not yet supported. In Video production, **Original audio** records a candidate or selects saved audio. **Save as audio asset** only saves the material; **Use as step voiceover** explicitly adopts the whole file for this stable step through the same authoring API as MCP.
|
|
26
|
+
|
|
27
|
+
The production timeline shows the current page's visuals, voiceover and captions from the shared `ProductionPlan`. Waveforms come from decoding the actual cached audio. The exact position field uses seconds relative to the page; the transport displays time in the whole lecture. Seeking pauses first and uses the existing lecture player to reconstruct the selected step. Zoom and fit change only the view. On narrow screens use Pages and Assets, Visuals, Step Properties, and Timeline; the inspector has Script, Voiceover, and Captions tabs. Changing tabs retains the same playback runtime.
|
|
28
|
+
|
|
29
|
+
Focus an overflowing caption to read its complete text with native wheel, Home/End, PageUp/PageDown, up/down arrows or Space; Shift+Space scrolls up. These reading keys do not select another step. Left/right arrows and Escape retain the existing presentation behavior. Captions are not automatically split or realigned by scrolling.
|
|
30
|
+
|
|
31
|
+
With genuine word timing and a complete display-text mapping, Web playback and VTT use readable caption groups from the same production plan. In Video, fine-pointer users can activate a confirmed caption group to pause and seek its actual word boundary. With a coarse pointer, choose the stable step using the existing full-size buttons, then use Caption segment: its 44px action selector works at default zoom and can select the same sentence again to return to its start. Native keyboard activation remains available; zoom changes only the view. Unaligned recording/silence, proportional timing, translations without their own timing and unreliable word mappings retain the whole caption. Grouping does not edit narration, resynthesize audio, create manual alignment or turn estimated timing into exact timing.
|
|
32
|
+
|
|
33
|
+
For an explicit manual arrangement, open **Set caption times** in Video after preparing the current step with actual audio. **Split at line breaks** partitions the original typed narration; enter each segment's start and end in seconds relative to the step, then Apply. Times must increase without overlap and stay within that step. The original text, audio, pronunciation and cues stay unchanged; this is manual segment timing, never word alignment. Web, VTT and burned captions share the same segments and leave authored gaps blank. Changing narration, audio or step timing invalidates the old map until explicit review; replacing audio does not silently rebind its times. Restore automatic removes the manual map through the same action boundary. This form retains pending input across closing and step changes only while the same Video session remains mounted; leaving Video or reloading has no draft recovery. Doc keeps caption text and narration start only.
|
|
34
|
+
|
|
35
|
+
Only confirmed timing permits arbitrary time seeking and export. Video production can play stable steps with estimated missing speech, buffering at each missing utterance instead of silently advancing; unknown animation duration, unsupported recording cues/video clips and silent text-anchored cues have explicit diagnostics. Step selection remains available. Explicit `none` supports simple silent scripts and authored hold/pause timing without a provider; an unset voice with narration is not silence. A nonzero text cue in a silent script needs confirmed timing or audio.
|
|
36
|
+
|
|
37
|
+
Documents created in Studio declare the standard production plugins and lecture renderer. Studio's new documents and pages hold each static step for 4 seconds plus a 0.5-second trailing pause; validation does not insert these defaults into other documents. Existing documents keep their source unchanged until the author chooses Enable video production; enabling does not select a voice or generate speech. Use the production toolbar's compile icon after source changes or an explicit cache update. An unchanged plan remains paused at its actual time and rate; a new source or plan invalidates the old playback binding.
|
|
38
|
+
|
|
39
|
+
## Configure the intended source
|
|
40
|
+
|
|
41
|
+
Put lecture renderer options in `metadata.renderers.lecture`. Put timing and voice choice only in `production`: document defaults, optional section overrides and step overrides. A voice source is `none`, TTS with an actual engine/voice, or a recording asset. Do not keep a second `voice` or timing decision on renderer options, a step or narration text.
|
|
42
|
+
|
|
43
|
+
In Studio, use Settings → Voice Service (also linked from Video Production → Voiceover). The page defaults to Volcengine speech synthesis 2.0 and accepts a speech-console API Key, or an access token with its matching optional App ID. No Secret Key or console-version choice is needed. Empty inputs keep saved credentials; a new key without an App ID switches to API-key authentication. Save applies immediately; it does not select a voice or generate audio. Credentials stay in the local operator directory outside the workspace and are never returned by reads. Check Configuration only checks the saved local configuration; real provider permissions are checked by explicit playback, a confirmed sample, or batch generation after the service is enabled. Clearing the saved key restores any launch-environment fallback.
|
|
44
|
+
|
|
45
|
+
TTS providers, credentials and endpoints are operator configuration. Check the speech service's real engines and voice catalogue. `unavailable` differs from an empty available list. Unknown parameter capability stays unknown; do not imply unsupported style/rate options work.
|
|
46
|
+
|
|
47
|
+
## Generate explicitly
|
|
48
|
+
|
|
49
|
+
A cache-only preview can play existing exact-text/exact-voice audio; missing audio is generated on the explicit Video Play intent, or through batch generation before export. Use the installed lecture/speech generation action or documented API to synthesize an explicit revision-bound scope. Show provider, count and target before a paid operation. Never synthesize merely by opening the document, editing text, auditioning another voice or refreshing preview.
|
|
50
|
+
|
|
51
|
+
Checks, lecture builds and video exports read only exact cached voiceover. A configured engine does not make missing audio ready: generate it explicitly before exporting; these read/output actions never synthesize it.
|
|
52
|
+
|
|
53
|
+
The video export encodes with FFmpeg when it is installed (`ffmpeg` on the path, or `PRESMIUM_FFMPEG` naming the program) and then writes MP4 (H.264, AAC) at full quality. Without it the export falls back to a WebM encoded in the browser, which is softer, and its warning gives the install command. Before exporting a video for others, make sure FFmpeg is installed: `brew install ffmpeg` (macOS), `sudo apt install ffmpeg` (Debian, Ubuntu), `winget install --id Gyan.FFmpeg` (Windows).
|
|
54
|
+
|
|
55
|
+
Completed audio belongs to the exact content and voice configuration that produced it. Old callbacks cannot clear new input or label old audio current. Cancellation stops remaining work and retains completed valid cache. Reuse requires the synthesis key, current non-credential engine profile and actual audio SHA. Without that engine configured, commit the cache and matching speech lock: one locked profile can satisfy a request; multiple profiles are ambiguous. Builds and exports preserve the document's speech lock, including clips omitted by audience or form filtering. Legacy locked audio is still readable offline, but is not proof of a configured provider's identity. Unknown or mismatched alignment bindings are unavailable, not precise timing.
|
|
56
|
+
|
|
57
|
+
## Align and produce
|
|
58
|
+
|
|
59
|
+
Cue content supplies stable targets and actions; `production.cueTimings` owns delays. Timing defaults/overrides decide narration start, minimum hold and trailing pause. Recording/media clips use asset references, explicit source ranges and step attachments. Derived absolute playback times stay in the playback plan.
|
|
60
|
+
|
|
61
|
+
Local audio `production.mediaClips` can reference an existing canonical audio asset in the same document. Set `sourceRange` in milliseconds, an attached stable step and offset, `volume` from 0 to 1, and optional `muted`; muting retains the volume. The inspected audio range must fit entirely inside that confirmed step. Adjust trimming, offset or the authored hold when it does not fit; the plan does not retime cues or cross steps automatically. These clips mix with cached speech in preview and video export, without generating or changing captions. Files must be non-hidden, regular local audio; symlinks, remote/shared paths and video are rejected. Use the source-bound `production-asset` reader to inspect a referenced AssetID and the plan diagnostics to confirm availability. Saving JSON does not confirm the actual audio range.
|
|
62
|
+
|
|
63
|
+
To use original audio as narration, use Video’s **Original audio → Use as step voiceover**, or explicitly call the shared `adopt_recording` action for a saved source, stable step, audio asset and actual SHA-256; see `DocumentRecordingAdoption`. This sets `voiceSource.recording`, never a fabricated media clip. Each effective step plays its selected source range once; without a range it plays the whole file. In Video, **Narration range** edits the already adopted same-asset step with real in/out bounds. Restore full changes pending input and needs explicit Apply. Editing one step does not trim the asset or another step. Without an explicitly applied valid manual timing map, current Narration display text forms one whole-clip caption without word alignment; empty narration produces no caption. Trim keeps the whole authored script as an unaligned step caption and requires review; original ASR word times do not become trimmed alignment. Continuous cross-step recording, internal pauses, non-start cues and conflicting narration starts remain unsupported. Adoption preserves all narration and pronunciation, and does not start ASR, TTS or playback. The accepted version is prepared paused; late replies preserve newer input and microphone captures. Browser-controlled recording evidence does not verify a physical microphone, and MCP recording-client control is not connected.
|
|
64
|
+
|
|
65
|
+
In Video production, use **Audio clip → Import audio**, then select the asset and edit the paired in/out fields, step offset, volume and mute. Import only adds an asset; **Add to step** or **Apply** explicitly saves the clip. Invalid text remains editable. **Restore full** changes the pending range; removing a clip retains the asset. Pending input follows its document, stable step and clip; accepting a saved media change prepares that version and stays paused.
|
|
66
|
+
|
|
67
|
+
The workspace authoring API imports original audio through `document/audio`: multipart fields are `change` (JSON with `id` and `baseDocumentVersion`) and `file`. Original bytes and the canonical asset declaration share one version-checked transaction and history entry. The same route's GET uses `assetId` and `baseDocumentVersion` to inspect even an unused declared asset, without requesting compilation. Explicit `document/media-clip` changes carry the source version and full production binding; they save trim, offset, gain and mute only when the real range fits a confirmed step.
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
presmium check lesson --json
|
|
71
|
+
presmium build lesson --to lecture
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Build only when the required speech cache and provider capability actually exist. Inspect missing/stale diagnostics, caption text, pronunciation, cue timing, arbitrary step navigation and the exported video. A prior successful snapshot must be visibly identified when current compilation failed.
|
package/src/resources.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { closeSync, constants, fstatSync, lstatSync, openSync, readdirSync, read
|
|
|
3
3
|
import { isAbsolute, join, relative, sep } from 'node:path'
|
|
4
4
|
import { fileURLToPath } from 'node:url'
|
|
5
5
|
|
|
6
|
-
export const SKILL_NAMES = ['presmium-author', 'presmium-animate', 'presmium-develop', 'presmium-paper-to-xiaohongshu'] as const
|
|
6
|
+
export const SKILL_NAMES = ['presmium-author', 'presmium-animate', 'presmium-develop', 'presmium-figure', 'presmium-paper-to-xiaohongshu'] as const
|
|
7
7
|
export type SkillName = typeof SKILL_NAMES[number]
|
|
8
8
|
export type SkillErrorCode = 'skill-not-found' | 'skill-path-invalid' | 'skill-file-unavailable' | 'skill-page-invalid' | 'skill-project-invalid' | 'skill-install-unsafe' | 'skill-install-cancelled' | 'skill-unavailable'
|
|
9
9
|
|