@mereon/demo 0.1.0 → 0.2.1

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 (4) hide show
  1. package/NOTICE +19 -0
  2. package/README.md +132 -21
  3. package/dist/demo.mjs +18744 -5135
  4. package/package.json +6 -5
package/NOTICE CHANGED
@@ -34,3 +34,22 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
34
34
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
35
35
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
36
36
  SOFTWARE.
37
+
38
+ ------------------------------------------------------------------------------
39
+ yaml
40
+ https://github.com/eemeli/yaml
41
+ ISC License
42
+
43
+ Copyright Eemeli Aro <eemeli@gmail.com>
44
+
45
+ Permission to use, copy, modify, and/or distribute this software for any purpose
46
+ with or without fee is hereby granted, provided that the above copyright notice
47
+ and this permission notice appear in all copies.
48
+
49
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
50
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
51
+ FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
52
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
53
+ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
54
+ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
55
+ THIS SOFTWARE.
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Record a narrated demo of a change to your app, as a guide or a video, and file it in your Mereon organization so your colleagues see what changed.
4
4
 
5
+ The setup guide is at https://docs.mereon.ai/demo-recorder/.
6
+
5
7
  It is built to be driven by a coding agent. You ask your agent for a demo, it writes a short script from the change it just made, and this tool records the script and uploads the result. You need a Mereon account, since every command signs in to your organization.
6
8
 
7
9
  ## Set up
@@ -14,11 +16,11 @@ npx @mereon/demo login
14
16
  npx @mereon/demo doctor
15
17
  ```
16
18
 
17
- `init` writes `demo/config.json` and a `demo/scripts/` folder, and installs instructions for the coding agent it finds in your project (or the ones you name with `--harness <name>`) so the agent knows when and how to record a demo. Commit what it writes. The instructions pin the version of this tool that wrote them.
19
+ `init` writes `demo/config.json` and a `demo/scripts/` folder, and installs instructions for the coding agent it finds in your project (or the ones you name with `--harness <name>`) so the agent knows when and how to record a demo. At a terminal it first asks where your app opens when you start it for development (`url`), because a guessed port is often one another project is already answering on; run by an agent, it writes `http://localhost:3000` and says that is a guess. Commit what it writes. The instructions pin the version of this tool that wrote them, and so does `demo/config.json` (`version`): a bare `npx @mereon/demo` that starts another version runs the pinned one instead, and says so (`DEMO_VERSION_CHECK=off` runs it as it is). To move a project to a newer version, run `init` with it, which updates the instructions and the pin together. You can also add the tool as a devDependency (`npm install --save-dev @mereon/demo`), which npx then runs without downloading it. The instructions are a short guide, `demo/AGENT.md`, and six files under `demo/agent/` that it sends the agent to only when a demo needs them: who it is for and what it is filed under, branding, secrets, announcing, showing more than one page, and showing more (a before-and-after, a loop, a slow push in).
18
20
 
19
21
  `init` also installs a research skill. Ask your agent to research a change, or say yes when it offers, and it checks the feature, fix or chore against how your organization works: who does the work it touches, the procedures and policies that govern it, problems people have reported, and the training that describes it today. It reports blockers, warnings and ideas in the conversation, each with the code it would change, and with your agreement it can file a gap in your organization's own material as a Mereon issue. It needs the [Mereon MCP server](https://docs.mereon.ai/mcp/overview/) connected to your organization, and it only reads otherwise.
20
22
 
21
- `login` opens your browser to sign in and remembers the grant on this machine. `doctor` checks that everything the tool needs is in place and says what to fix if it is not.
23
+ `login` opens your browser to sign in and remembers the grant on this machine. When the project does not yet say which organization its demos are filed in, `init` asks, listing the organizations you are signed in to by name, or signs you in to choose one, and writes the choice to `demo/config.json`. Then `login` has nothing left to do. `doctor` checks that everything the tool needs is in place and says what to fix if it is not.
22
24
 
23
25
  You need Node 24 or later, and ffmpeg on your path (with Opus support, plus H.264 and AAC if you want video). The tool downloads the browser it records with the first time it needs it. It runs on macOS and Linux, including Windows through WSL.
24
26
 
@@ -31,11 +33,31 @@ npx @mereon/demo record <script-id> # render it
31
33
  npx @mereon/demo upload # file the latest recording
32
34
  ```
33
35
 
34
- `record` checks the whole script first, without spending anything, and fails naming the step if a selector does not match one visible element. It starts your app if you have told it how, records, and stops the app afterwards. A guide is a screenshot for each step with one narration track. A video is one continuous recording with the voice placed against the picture, and `--draft` makes a smaller one for a quick look.
36
+ `record` checks the whole script first, without spending anything, and fails naming the step if a selector does not match one visible element. It starts your app if you have told it how, records, and stops the app afterwards. A guide is a screenshot for each step with one narration track. A video is the steps' narration with the voice placed against the picture, and `--draft` makes a smaller one for a quick look, laid out exactly as the final will be.
37
+
38
+ Name several scripts to record a series in one run: `record intro invoices reports`. The app is started once and the takes are recorded one after another, since they share the app and its seed data. Each video is made once every take is in, two at a time, or as many as `--parallel <n>` says. A script that fails does not stop the rest, and the run then fails, listing what was recorded and what was not.
39
+
40
+ A viewer only sees narrated steps on settled screens, never the plumbing between them:
41
+
42
+ - **Setup is off camera.** A script's `setup({ page, baseUrl, secret })` runs before anything is recorded, in the same browser, to sign in, prepare data or open the first screen. Or the browser starts already signed in, from a session you saved by hand (`auth`, below) or a storage state file (`storageState`).
43
+ - **Actions are cut.** Each step's action (navigating, filling in, waiting for data) is cut from the video, and the step before dissolves into the new one. A step can ask for a plain `transition: 'cut'`, or `'show'` to keep its action on screen when moving between screens is the point.
44
+ - **Narration waits for the page.** After the action, the recorder waits until the page is still: fonts loaded, no requests in flight, nothing marked busy or moving, for at most three seconds. A step can wait for a selector instead (`settle: '#cards'`), or skip it (`settle: false`).
45
+ - **A slow cue makes the narration wait.** Each cue runs as its words are spoken. When the cue before it is still running, it can start up to half a second late; later than that, the narration stops at its words until it starts, and the wait is cut from the video, so a slow save does not cost a take.
46
+ - **Warnings say what to fix.** The result's `warnings` names a screen that flashes by, a step that signed in on camera, narration that started over a page still loading, or a wait for a slow cue, each with its step and a hint.
47
+
48
+ `inspect /invoices` opens that page of your app as a recording would (signed in with `--auth <profile>`, settled, at the recording's size) and lists the headings and the elements a script can act on, in reading order, each with its role, accessible name, and a selector in the tool's syntax that matches exactly it: its role and whole name where that is unique, a `data-testid` where names repeat, its text otherwise. `--near "<text>"` puts what is closest to that text first. JSON on stdout, for an agent writing a script.
49
+
50
+ `check` runs a script's actions and cues as fast as the page allows, with no narration and nothing bought or written, and reports every problem in one pass: each step or cue whose selector did not match exactly one visible element, and any secret that showed uncovered. For a video (`--output video`, or the project's `output`), it also times each cue, counts the cursor's glides, typing and pauses a video adds, and, for the steps whose narration is already made, fails a cue its own motion would make late: typing a name with one word before the next cue, say. `record` makes the same check once it has made the narration, before the take. It carries on past a failing cue, and past a step whose action fails, so a script with three broken selectors is fixed in one round rather than three. `--only-step <n>` runs the steps before it to reach it, then checks only that step; `--from-step <n>` checks from there to the end. It needs no Mereon sign-in. A check of every step that passes stands for `record`'s own check for ten minutes, while the script and the app's address are unchanged, so `record` goes straight to the take.
35
51
 
36
- `upload` files the recording. Running the same script again updates the guide it made instead of adding another. If you cannot publish to your whole organization, the upload becomes a proposal for an administrator and the tool tells you so, and an update to a guide that is already published stays a proposal until it is approved: the published guide is not touched before then.
52
+ A video keeps its take beside it, in `demo/out/<script-id>/video/take/`: the raw recording and when each step, narration and cue happened. `render` makes the video again from it in seconds, with no browser and no app, when what changed is post-production: the branding (title and end cards, the frame, step labels, zoom), a step's `transition`, or narration that still fits the time each step took. `--brand` tries a level or parts (`--brand standard`, `--brand titleCard,frame`) without changing the script. It refuses, saying why, when the take no longer matches the script: a step's action, cues or settle, the setup or saved session, the secrets or redact list, narration too long for its step or a cue whose words moved more than half a second, or the highlights, which are drawn in the page while it is recorded. Then record again.
37
53
 
38
- When an upload updates a published guide, `--retraining` says whether people who already learned it should be retrained: `changed-material` gives them a short lesson on what changed, `full-retake` has them take the original lesson again, and `none` (the default) asks nothing of them. A video cannot be updated yet, so the flag is for guides.
54
+ The helpers wait for what they act on: an element the app draws again under them (a list that renders twice as its data arrives) is found again, and a click or a key that loads another screen or saves something waits for the page to settle before the next cue runs. `demo.select(selector, option)` chooses an option of a native select, and `demo.type` fills a date or time input with the value whole (`2026-08-01`, `14:30`). An outline on something a dialog then opens over is cleared.
55
+
56
+ Selectors are Playwright's. In `role=link[name="..."]` the name must be the whole accessible name, exactly; add `i` after the closing quote to ignore case, or use a regular expression such as `role=link[name=/Reply to/]` to match part of it. When a role selector matches nothing, the error lists the names that role has on the page.
57
+
58
+ `upload` files the recording. A video carries its script, which Mereon keeps as the transcript instead of transcribing the narration, and, when every step has a `label`, its steps as the video's chapters. Running the same script again updates the guide or video it made instead of adding another: a guide gets a new version, and a video a new recording, which replaces the current one once it has finished processing. If you cannot publish to your whole organization, the upload becomes a proposal for an administrator and the tool tells you so, and an update to a guide or video that is already published stays a proposal until it is approved: the published one is not touched before then.
59
+
60
+ When an upload updates a published guide or video, `--retraining` says whether people who already learned it should be retrained: `changed-material` gives them a short lesson on what changed, `full-retake` has them take the original lesson again, and `none` (the default) asks nothing of them.
39
61
 
40
62
  | Command | What it does |
41
63
  | --- | --- |
@@ -45,25 +67,38 @@ When an upload updates a published guide, `--retraining` says whether people who
45
67
  | `logout [--organization <id>]` | Signs out of one organization and revokes its grants, the one for announcements included. |
46
68
  | `logout --all` | Signs out of every organization and deletes this tool's credentials, the ElevenLabs key included. Run it when you remove the tool. |
47
69
  | `logout --elevenlabs` | Forgets the stored ElevenLabs key and leaves your sign-ins. |
48
- | `doctor` | Checks that everything needed is in place. |
70
+ | `auth capture [--name <profile>] [--url <path>]` | Opens your app in a browser for you to sign in by hand, and saves the session for scripts to start from. See below. |
71
+ | `secrets set <NAME>` / `secrets list` | Sets a secret a script uses, asked for without showing it, or lists them by name and whether each is set. See "Secrets and personal data". |
72
+ | `doctor` | Checks that everything needed is in place, and whether each saved session still signs in. When the app is not running, it runs your start command to show that it starts the app, and stops it again. |
49
73
  | `config set <key> <value>` | Changes a setting in `demo/config.json`. |
50
74
  | `voices` | Lists the narration voices and says which one this project uses. Needs no login. |
51
75
  | `audience` | Lists your organization's roles and teams, so your agent can check with you who a demo is for. |
52
- | `record <script-id> [--output guide\|video] [--draft] [--allow-remote]` | Records a script. |
53
- | `upload [<script-id>] [--output guide\|video] [--stack] [--hold\|--publish-now] [--retraining <choice>] [--confirm-redacted]` | Files a recording in your organization. A recording that used secrets needs `--confirm-redacted`. |
54
- | `announce [<script-id>] --text-file <path> [--tell <who>] [--title <title>] [--visible-to everyone\|admins] [--pop-quiz\|--no-pop-quiz] [--publish-now] [--confirm-redacted] [--send]` | Files a video and announces it to the people you choose. Sends only with `--send`. See below. |
76
+ | `tags` | Lists your organization's tags, so your agent can suggest what a demo is filed under. |
77
+ | `tags create <name>` | Adds a tag to your organization, if you may edit content. Mereon stores the name lowercase with hyphens. |
78
+ | `record <script-id>... [--output guide\|video] [--draft] [--parallel <n>] [--allow-remote]` | Records a script, or several in one run. See below. |
79
+ | `inspect <path> [--auth <profile>] [--near <text>] [--limit <n>] [--split] [--allow-remote]` | Lists a page's elements and headings, each with a selector that matches only it. See below. |
80
+ | `check <script-id> [--only-step <n> \| --from-step <n>] [--output guide\|video] [--allow-remote]` | Runs a script's actions and cues headless, without narration, and reports every problem in one pass. See below. |
81
+ | `render <script-id> [--brand <level or parts>]` | Makes a recorded video again from its kept take, without the browser. See below. |
82
+ | `upload [<script-id>] [--output guide\|video] [--tag <name>]... [--stack] [--hold\|--publish-now] [--retraining <choice>] [--confirm-redacted]` | Files a recording in your organization, under the script's tags and any `--tag`. A recording that used secrets needs `--confirm-redacted`. |
83
+ | `announce [<script-id>] --text-file <path> [--tell <who>] [--title <title>] [--visible-to everyone\|admins] [--tag <name>]... [--pop-quiz\|--no-pop-quiz] [--publish-now] [--confirm-redacted] [--send]` | Files a video and announces it to the people you choose. Sends only with `--send`. See below. |
55
84
  | `release [--dry-run] [--strict]` | In CI after a deploy, publishes the demos held for it. See below. |
85
+ | `ci setup [--after <job>] [--workflow <file>] [--yes]` | Adds the job that runs `release` after your GitHub Actions production deploy, holds uploads for it, and stores the release token as its secret, checked first. See below. |
56
86
  | `reel <script-id>... [--title <text>] [--output <file>] [--confirm-redacted]` | Joins the latest videos of those scripts behind a card that lists them, for sharing what a release changed. Nothing is uploaded. A recording that used secrets needs `--confirm-redacted`, as for `upload`. |
57
87
 
58
88
  Logs go to stderr, and a command that succeeds prints one JSON object to stdout.
59
89
 
60
90
  ## Showing a change
61
91
 
62
- Every video's cursor glides to what it points at, and while a demo highlights or calls out something, the rest of the page dims. A script can also:
92
+ Every video's cursor glides to what it points at, the page glides to something off screen rather than jumping, and while a demo highlights or calls out something, the rest of the page dims. A script can also:
63
93
 
64
94
  - show a keyboard shortcut as it is pressed, with `demo.press('ControlOrMeta+K')`;
65
95
  - show the screen before the change and wipe across to it now, with `demo.before('http://localhost:3001/invoices')`, given the earlier version of your app running on another local port;
66
- - cut a few silent seconds of one step as `loop.mp4` for the pull request, with `loop: { step: 2 }`.
96
+ - cut a few silent seconds of one step as `loop.mp4` for the pull request, with `loop: { step: 2 }`;
97
+ - show two people's screens at once, each signed in as someone else: name the other pages in `pages`, and a step shows one beside the app's with `side: 'client'`, split side by side or, with `layout: 'pip'`, small in a corner. A cue acts on another page with `demo.on('client')`, so the viewer sees the cause in one screen and the effect in the other;
98
+ - burn in captions of everything said, as it is said, with `captions: true`;
99
+ - push in slowly on a screen the viewer reads for a while, with `camera: 'drift'` on the step, keeping what it highlights in view;
100
+ - open a long overview with a card listing what it covers, with `intro: { contents: true }`, from the steps' labels;
101
+ - put a card between two steps, as a map between screens: a step's `interlude` is a section heading, a short list, or a flow of stages drawn in left to right with the one coming next picked out, in your brand's look when the demo is branded, with narration of its own if you like.
67
102
 
68
103
  Your agent decides when these help, from the instructions `init` installed. Once several demos for one release are recorded, `reel` joins them into one video.
69
104
 
@@ -81,6 +116,30 @@ audience: {
81
116
 
82
117
  `visibleTo` is who can see the demo in your library. A role cannot limit that, but a team can. `tell` is who `announce` tells when you do not give it `--tell`. Both are requests: if you cannot publish to that audience, the upload goes to an administrator for review. If the script names a team you cannot see, because you see only the teams you belong to, your upload asks for administrators only and goes to review, and the reviewer chooses who sees it. Only a demo everyone can see can be announced to a role, a team or everyone: an announcement is readable by everyone or by administrators only, so a demo shared with some teams or with administrators is announced to named people, and only the administrators among them are told. They apply when an upload creates a demo, and an update keeps the audience the demo already has. The recording carries the audience, so to change it, change the script and record again.
83
118
 
119
+ ## Tags
120
+
121
+ A demo can be filed under your organization's tags, the labels your library is filtered by. Your agent suggests some from `demo tags` when it asks who the demo is for, and records the ones you agree in the script:
122
+
123
+ ```js
124
+ tags: ['billing', 'onboarding'],
125
+ ```
126
+
127
+ Write them as you like: `Fire Safety` is the tag `fire-safety`. `upload --tag <name>` adds a tag for that one upload, and can be given more than once. Each has to be a tag your organization already has. If none fits, `demo tags create <name>` adds one, if you may edit content (or someone who can adds it in Mereon); your agent runs it only once you agree to the name. `record` checks the script's tags before it records anything, and `upload` refuses a `--tag` your organization lacks before anything is sent. Both messages list the tags it has. A tag renamed or deleted after recording is left out of the upload with a warning, so the recording can still be filed.
128
+
129
+ A demo that goes to an administrator for review carries its tags too. An upload that updates a guide adds the tags it lacks and keeps the ones it has, so to take a tag off, do it in Mereon. An update that waits for a release or a reviewer adds them when it is applied. `announce` takes `--tag` only on the run that uploads the video.
130
+
131
+ ## Signing in once, by hand
132
+
133
+ An app whose sign-in sends a code by email or text, goes through single sign-on, or asks for a passkey is hard to sign in to from a script. Sign in yourself instead, once:
134
+
135
+ ```sh
136
+ npx @mereon/demo auth capture --name support
137
+ ```
138
+
139
+ It starts your app if it is not running and opens it in a browser. Sign in however the app asks, and when you see the app signed in, press Enter in the terminal. The session (the browser's cookies, local storage and IndexedDB) is saved as `demo/.auth/support.json`, which `init` and `auth capture` keep out of git. Where your machine has a keychain (the macOS Keychain, or the Secret Service on most Linux desktops) the file is encrypted with a key kept there; where it has none, the file is readable only by you, and `auth capture` says so. Without `--name` the profile is called `default`, and `--url /inbox` opens a page other than the app's address.
140
+
141
+ A script starts from it with `auth: 'support'`, so it declares no secrets for signing in and its `setup` does not sign in. Save one profile for each role a demo shows, such as `admin` and `client`. Sessions expire: `record` opens the page you saved it on before anything is recorded, and if that page asks you to sign in again it stops and says to run `auth capture` again. `doctor` lists every saved session with its age and whether it still signs in.
142
+
84
143
  ## Secrets and personal data
85
144
 
86
145
  Some demos need real values: an account to sign in with, an API key an integration checks before it saves, or a page that shows a person's email address or phone number. A script can use them without ever holding them. It names the values it uses and types them with `demo.typeSecret`:
@@ -91,7 +150,13 @@ secrets: ['DEMO_EMAIL', 'DEMO_PASSWORD'],
91
150
  do: async ({ demo }) => demo.typeSecret('input[type="password"]', 'DEMO_PASSWORD'),
92
151
  ```
93
152
 
94
- The values come from `demo/.secrets`, a file of `NAME=value` lines that `init` keeps out of git. To use a file you already keep, point at it in `demo/config.json` with `"secrets": { "file": "api/.env", "names": { "DEMO_PASSWORD": "SEED_ADMIN_PASSWORD" } }`. `doctor` lists any secret a script declares that the file lacks, by name only.
153
+ The values come from `demo/.secrets`, a file of `NAME=value` lines that `init` keeps out of git. Set one without opening it:
154
+
155
+ ```sh
156
+ npx @mereon/demo secrets set DEMO_PASSWORD
157
+ ```
158
+
159
+ It asks for the value without showing it (or reads it from a pipe, such as `op read ... | npx @mereon/demo secrets set DEMO_PASSWORD`), writes it so it reads back exactly, and keeps the file readable only by you. `secrets list` shows each secret the scripts declare, by name, whether it is set, and which scripts use it. To use a file you already keep, point at it in `demo/config.json` with `"secrets": { "file": "api/.env", "names": { "DEMO_PASSWORD": "SEED_ADMIN_PASSWORD" } }`; `secrets set` then writes there, under the mapped name, and leaves the rest of the file and its permissions as they were. `doctor` and `record` name any secret a script declares that the file lacks, with the command that sets it.
95
160
 
96
161
  The recorder covers each value with a solid mask (or a heavy blur, with `redactStyle` below) wherever it shows, from the first frame it appears in: the field it was typed into, text that contains it, and its last four characters when those are letters and digits, which is how apps show a saved key ("Key ending ABCD") or a phone number ("ending 4477"). That includes a modal dialog, which the browser draws above everything else. A run fails, naming the step and the element, if a value shows anywhere without a mask over it, and the check runs on the trial pass before any narration is paid for. It cannot see inside a canvas or an image, so list a CSS selector for anything like that in the script's `redact` list, and use `demo.redact(selector)` for something private that is not one of the values, such as another person's details on the same screen. The page's address and title, narration, cue phrases, callouts and selectors are refused if they hold a value, and logs and errors print its name instead.
97
162
 
@@ -121,19 +186,36 @@ The cards show what the script gives them: `intro: { subtitle, narration }` and
121
186
  | `url` | Where your app is served. Must be on your own machine unless you pass `--allow-remote`. |
122
187
  | `start` | The command that starts your app, used only if nothing is already listening at `url`. |
123
188
  | `ready` | A URL that answers when the app is ready. Defaults to `url`. |
124
- | `seed` | A command that puts the app in a known state. It runs before the check and again before the recording. |
189
+ | `seed` | A command that puts the app in a known state. It runs before the check and again before the recording, and must leave the app ready to serve: end it by polling an address that reads the database and is not rate-limited. A failed seed's message leads with its own last error line. |
125
190
  | `output` | `guide` (default) or `video`. |
126
191
  | `upload` | Whether recordings are filed in Mereon. |
127
192
  | `voiceProvider` | `mereon` uses your organization's included narration. `byo` uses your own ElevenLabs key. |
128
193
  | `voiceId` | The narrating voice, by name (`Matilda`) or id. Run `voices` to see the choices. With `voiceProvider` set to `byo`, any voice id from your own ElevenLabs account also works. Changing it narrates every step again. |
194
+ | `voices` | A voice for each speaker, for demos in which more than one person talks: `config set voices.owner Matilda`. A step or a card says who speaks with `voice: 'owner'`; the rest use `voiceId`. Each speaker's narration is kept apart in the cache, as each voice's is. |
195
+ | `music` | A music bed under every video's narration: an audio file, from the project root, that you have the right to use. It is brought to a level under speech, turned down further while anyone speaks, and faded in and out. A script's own `music` replaces it, and `music: false` turns it off for one demo. |
129
196
  | `organization` | The Mereon organization this project files into, by id. `login` sets it the first time. See below. |
130
197
  | `release` | `upload` (default): a demo goes live when it is uploaded. `ci`: it is held until your CI runs `release` after the change is deployed. See below. |
131
198
  | `releaseBranch` | The branch a held upload must already be on. Defaults to the remote's default branch. |
132
199
  | `source.repo` | Names where demos come from, so a second upload updates the first. |
200
+ | `version` | The version of this tool the project uses, which `init` writes. A bare `npx @mereon/demo` of another version runs this one. |
133
201
  | `brand` | How branded demos are when a script does not say: `none` (default), `light`, `standard` or `full`. See "Branding". |
134
202
  | `redactStyle` | How a covered value looks: `mask` (default), a solid fill, or `blur`, a heavy blur with a faint tint that lets viewers see typing happen. A blur still shows roughly how long a value is, so choose it only where that is fine. |
135
203
  | `secrets` | Where the values of a script's secrets are read from: `file` (default `demo/.secrets`), `names` to map a script's name to the name in that file, and `suffix` to change how many of a value's last characters count as showing it (4 by default, and only when they are letters and digits; 0 for only the whole value; a number you set applies whatever the characters). Edit it by hand: `config set` refuses anything that looks like a credential. |
136
204
 
205
+ ### On one machine
206
+
207
+ Where the app runs, and how it starts and is seeded, can differ from one machine to the next: port 3000 may belong to another project on yours. `url`, `ready`, `start` and `seed` can be set for this machine alone, over `demo/config.json`, in `demo/config.local.json` (which `init` keeps out of git, and which takes only those four), and over both in the environment: `DEMO_URL`, `DEMO_START` and `DEMO_SEED`. A `ready` URL on the same address as `url` moves with it. `doctor` and `record` say which settings this machine overrides and where each came from, and `config set` says when the value it just wrote is overridden here.
208
+
209
+ When nothing answers at the app's address and there is no `start`, `doctor` lists the commands that look like they start and seed the app, from your `package.json` scripts (run with the package manager your lockfile names), a Docker Compose file, or a `Procfile.dev`. In a terminal it offers them, and sets what you choose. `start` waits up to two minutes for the app to answer, and shows the end of what the command printed if it does not.
210
+
211
+ ## The three credentials
212
+
213
+ The tool uses up to three, each kept apart from the others, and `doctor` names each one it checks:
214
+
215
+ - **Your own sign-in** (`login`), for recording, uploading and narrating with your organization's voices. Stored on your machine, in `~/.config/mereon/`.
216
+ - **The release token**, for CI to publish held demos after a deploy. It belongs to the organization, lives only in your CI as `MEREON_RELEASE_TOKEN`, and `ci setup` stores it there.
217
+ - **An ElevenLabs key** (`login --elevenlabs`), only for narrating with your own ElevenLabs account.
218
+
137
219
  ## More than one organization
138
220
 
139
221
  A login belongs to one organization, which you choose on the sign-in page. If you work with several, sign in once for each: `login` keeps all of them. A project says which one it files into with `organization` in `demo/config.json`, and the first `login` you run from a project writes it for you. Commit it, so a teammate signed in to a different organization is stopped instead of filing into the wrong library.
@@ -142,7 +224,7 @@ The first login from a project has nothing to start the sign-in page on, so it s
142
224
 
143
225
  From then on the project uses only that organization. The sign-in page starts on it, `record` and `upload` stop if you are not signed in to it, and `login` saves nothing if you choose a different one on the page. `upload` says which organization it is filing into before it sends anything, and `doctor` shows it too.
144
226
 
145
- A project that names no organization uses the only one you are signed in to, and stops with a list as soon as you sign in to a second. Name one with `demo config set organization <id>`. The id is what `login` and `doctor` print. `logout` signs out of the project's organization and leaves the others signed in. Outside a project, say which with `logout --organization <id>`. `logout --all` signs out of all of them at once.
227
+ A project that names no organization uses the only one you are signed in to, and stops with a list as soon as you sign in to a second. Name one with `demo config set organization <id>`, or run `init` in a terminal to choose by name. `login`, `doctor` and the refusal that lists your organizations show each one's name beside its id. `logout` signs out of the project's organization and leaves the others signed in. Outside a project, say which with `logout --organization <id>`. `logout --all` signs out of all of them at once.
146
228
 
147
229
  ## Publishing when the change ships
148
230
 
@@ -154,29 +236,58 @@ The workflow:
154
236
  2. Once the pull request has merged, upload from the default branch: `demo upload`. The upload records the commit it was made from, and is refused from a commit that is not on the default branch yet.
155
237
  3. After each production deploy, CI runs `demo release`. It publishes each held demo whose script is unchanged in the deployed code and whose upload commit is part of the deploy, and reports the rest.
156
238
 
157
- An update to a guide that is already published is held the same way. The published guide stays exactly as it is until the release replaces it, then learners are asked to retrain as the upload's `--retraining` said. A video cannot be updated yet, so only a video's first upload can be held.
239
+ An update to a guide or video that is already published is held the same way. The published one stays exactly as it is until the release replaces it, then learners are asked to retrain as the upload's `--retraining` said. A video's new recording is processed while it is held, and replaces the current one once the release has published it and it has been brought into the knowledge base.
240
+
241
+ CI authenticates with a release token, which an administrator creates in Mereon under Settings, Release tokens, for this repository (the `source.repo` above). It belongs to the organization rather than a person, can only release this repository's held demos, and is never written anywhere by the tool.
242
+
243
+ With GitHub Actions, one command sets all of it up:
244
+
245
+ ```sh
246
+ npx @mereon/demo ci setup
247
+ ```
158
248
 
159
- CI authenticates with a release token, which an administrator creates in Mereon under Settings, Release tokens, for this repository (the `source.repo` above). Store it as a secret named `MEREON_RELEASE_TOKEN`. It belongs to the organization rather than a person, can only release this repository's held demos, and is never written anywhere by the tool.
249
+ It finds the job that deploys to production (or the one you name with `--after <job>`), shows the job it adds after it as a diff, and writes it when you agree. It sets `release` to `ci`. Then it asks you to paste the release token, without showing it, checks it with Mereon, and stores it as the repository's `MEREON_RELEASE_TOKEN` Actions secret with `gh` (or says where to add it by hand). Run it again at any time: it skips what is already done. A coding agent can add the job with `--yes`, but pasting the token is yours to do.
160
250
 
161
- In GitHub Actions, after the job that deploys to production:
251
+ The job it adds, which you can also write yourself, in GitHub Actions or adapted to another CI:
162
252
 
163
253
  ```yaml
164
254
  release-demos:
255
+ name: Release demos
165
256
  needs: deploy-production
166
257
  runs-on: ubuntu-latest
258
+ permissions:
259
+ contents: read
167
260
  steps:
261
+ - name: Check for the release token
262
+ id: token
263
+ env:
264
+ MEREON_RELEASE_TOKEN: ${{ secrets.MEREON_RELEASE_TOKEN }}
265
+ run: |
266
+ if [ -z "$MEREON_RELEASE_TOKEN" ]; then
267
+ echo "::notice title=Demos not released::MEREON_RELEASE_TOKEN is not set, so no held demos were released. Run demo ci setup to set it."
268
+ echo "present=false" >> "$GITHUB_OUTPUT"
269
+ else
270
+ echo "present=true" >> "$GITHUB_OUTPUT"
271
+ fi
168
272
  - uses: actions/checkout@v4
273
+ if: steps.token.outputs.present == 'true'
169
274
  with:
275
+ ref: ${{ github.sha }} # what was deployed
170
276
  fetch-depth: 0 # release checks the upload commits against this history
171
277
  - uses: actions/setup-node@v4
278
+ if: steps.token.outputs.present == 'true'
172
279
  with:
173
280
  node-version: 24
174
- - run: npx @mereon/demo@<version> release
281
+ - name: Release held demos
282
+ if: steps.token.outputs.present == 'true'
283
+ run: npx --yes @mereon/demo@<version> release
175
284
  env:
176
285
  MEREON_RELEASE_TOKEN: ${{ secrets.MEREON_RELEASE_TOKEN }}
177
286
  ```
178
287
 
179
- `release` fails the step only when it cannot release at all (a missing or revoked token, a network error, a shallow checkout) or when a demo could not be published this time, which the next run retries. A demo whose script changed after it was recorded, that is still processing, or whose upload commit is no longer in the repository's history (the default branch was force-pushed), is reported and left held, and the others are released. `--strict` fails on those too, and `--dry-run` reports what would happen without publishing anything, which is how to check a new token. `release` refuses to publish from a pull request build, because a pull request opened after the merge contains everything a release looks for.
288
+ It has no `environment`, so it runs without asking the production environment's reviewers a second time, and that is why the token is a repository secret rather than an environment's. It skips with a notice while the secret is not set, so a deploy never fails for want of it. In a workflow started by another (`workflow_run`), check out `${{ github.event.workflow_run.head_sha }}` instead.
289
+
290
+ `release` fails the step only when it cannot release at all (a missing or revoked token, a network error, a shallow checkout) or when a demo could not be published this time, which the next run retries. A demo whose script changed after it was recorded, that is still processing, or whose upload commit is no longer in the repository's history (the default branch was force-pushed), is reported and left held, and the others are released. `--strict` fails on those too, and `--dry-run` reports what would happen without publishing anything, which is how to check a new token. Every run says which repository and organization the token releases for, and checks it with Mereon even before the repository has any scripts. `release` refuses to publish from a pull request build, because a pull request opened after the merge contains everything a release looks for.
180
291
 
181
292
  ## Announcing a demo
182
293
 
@@ -206,11 +317,11 @@ The tool sends something only when you run a command, and there is no telemetry
206
317
  - `login` opens Mereon in your browser and keeps the tokens Mereon issues for you. Logos and the brand's font files come from Mereon too, so a branded demo needs no font service of its own.
207
318
  - An upload sends the screenshots and narration, or the video, to your organization. A guide's steps also carry each page's path and title and what identifies the element acted on (its id, `aria-label`, `name`, `title` and role), and every upload carries its source key (`repo#script-id`). An upload held for a release also sends the commit it was made from and a hash of its script.
208
319
  - Narration text goes to Mereon, which turns it into speech with ElevenLabs. With your own ElevenLabs key, the text goes straight to ElevenLabs under your own account instead, and never through Mereon.
209
- - `audience` reads your organization's role and team names, and `announce` sends the announcement's text and who it is for.
320
+ - `audience` reads your organization's role and team names, and `tags`, and a `record` or upload whose script names tags, read its tag names. `announce` sends the announcement's text and who it is for.
210
321
 
211
322
  Two other places are contacted. The first `record` downloads Chromium with Playwright's own installer, from Playwright's download servers, and a recording opens the app you are demoing, which is one served from your own machine unless you say otherwise. Your coding agent reads what the tool prints, so the role and team names from `audience`, like the rest of its output, reach whichever model your agent uses.
212
323
 
213
- `announce` keeps a note of the announcement it started beside the recording, in `demo/out/<script-id>/video/announcement.json`, which is not committed. Your Mereon sign-ins and any ElevenLabs key are stored in `~/.config/mereon/`, in files only you can read, and are never written to your project.
324
+ `announce` keeps a note of the announcement it started beside the recording, in `demo/out/<script-id>/video/announcement.json`, which is not committed. Sessions saved with `auth capture` stay in `demo/.auth/`, which is not committed either, and are never printed or sent anywhere. Your Mereon sign-ins and any ElevenLabs key are stored in `~/.config/mereon/`, in files only you can read, and are never written to your project.
214
325
 
215
326
  `logout` signs you out of one organization: it hands that organization's grants back to Mereon and removes them here, and leaves your other organizations and your ElevenLabs key as they are. To remove everything, run `logout --all`, which signs you out of every organization and deletes both credentials files, your ElevenLabs key included. `logout --elevenlabs` forgets only the key. If Mereon cannot be reached, signing out still removes the grants here and names the ones that were not revoked, and you can end those from your connected apps in the web app. None of these touches what is in your projects, such as `demo/.secrets`, or an `ELEVENLABS_API_KEY` you set in your environment.
216
327