@b3os/cli 0.2.1 → 0.2.2
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 +87 -8
- package/assets/b3os-run.py +137 -0
- package/assets/skill/b3os/SKILL.md +111 -0
- package/dist/commands/_agents.d.ts +14 -0
- package/dist/commands/_agents.js +33 -0
- package/dist/commands/_agents.js.map +1 -0
- package/dist/commands/_common.js +6 -2
- package/dist/commands/_common.js.map +1 -1
- package/dist/commands/_context.d.ts +49 -0
- package/dist/commands/_context.js +260 -0
- package/dist/commands/_context.js.map +1 -0
- package/dist/commands/_next.d.ts +39 -0
- package/dist/commands/_next.js +77 -0
- package/dist/commands/_next.js.map +1 -0
- package/dist/commands/agent.d.ts +42 -0
- package/dist/commands/agent.js +218 -0
- package/dist/commands/agent.js.map +1 -0
- package/dist/commands/app.d.ts +2 -5
- package/dist/commands/app.js +229 -69
- package/dist/commands/app.js.map +1 -1
- package/dist/commands/auth.d.ts +70 -2
- package/dist/commands/auth.js +308 -33
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/docs.d.ts +54 -0
- package/dist/commands/docs.js +202 -0
- package/dist/commands/docs.js.map +1 -0
- package/dist/commands/doctor.d.ts +23 -0
- package/dist/commands/doctor.js +313 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/init.d.ts +38 -1
- package/dist/commands/init.js +259 -60
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/listen.d.ts +30 -0
- package/dist/commands/listen.js +194 -0
- package/dist/commands/listen.js.map +1 -0
- package/dist/commands/manifest.d.ts +13 -1
- package/dist/commands/manifest.js +59 -7
- package/dist/commands/manifest.js.map +1 -1
- package/dist/commands/mcp.d.ts +25 -2
- package/dist/commands/mcp.js +120 -11
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/sandbox.d.ts +35 -6
- package/dist/commands/sandbox.js +208 -9
- package/dist/commands/sandbox.js.map +1 -1
- package/dist/commands/setup.d.ts +39 -0
- package/dist/commands/setup.js +203 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/tool.d.ts +109 -1
- package/dist/commands/tool.js +635 -47
- package/dist/commands/tool.js.map +1 -1
- package/dist/config.d.ts +30 -6
- package/dist/config.js +39 -8
- package/dist/config.js.map +1 -1
- package/dist/ctx.d.ts +5 -45
- package/dist/ctx.js +25 -160
- package/dist/ctx.js.map +1 -1
- package/dist/docs/index.json +1 -0
- package/dist/docs/pages/actions/call.md +300 -0
- package/dist/docs/pages/actions/catalog/airtable.md +737 -0
- package/dist/docs/pages/actions/catalog/arxiv.md +166 -0
- package/dist/docs/pages/actions/catalog/chainalysis-sanctions.md +125 -0
- package/dist/docs/pages/actions/catalog/coingecko.md +1558 -0
- package/dist/docs/pages/actions/catalog/deps-dev.md +465 -0
- package/dist/docs/pages/actions/catalog/dexscreener.md +568 -0
- package/dist/docs/pages/actions/catalog/discord.md +784 -0
- package/dist/docs/pages/actions/catalog/finnhub.md +776 -0
- package/dist/docs/pages/actions/catalog/frankfurter.md +438 -0
- package/dist/docs/pages/actions/catalog/github.md +1853 -0
- package/dist/docs/pages/actions/catalog/gmail.md +575 -0
- package/dist/docs/pages/actions/catalog/google-calendar.md +654 -0
- package/dist/docs/pages/actions/catalog/google-drive.md +502 -0
- package/dist/docs/pages/actions/catalog/google-sheets.md +700 -0
- package/dist/docs/pages/actions/catalog/hacker-news.md +542 -0
- package/dist/docs/pages/actions/catalog/http.md +824 -0
- package/dist/docs/pages/actions/catalog/hyperliquid.md +942 -0
- package/dist/docs/pages/actions/catalog/jira.md +920 -0
- package/dist/docs/pages/actions/catalog/kalshi.md +917 -0
- package/dist/docs/pages/actions/catalog/linear.md +1030 -0
- package/dist/docs/pages/actions/catalog/markets.md +21 -0
- package/dist/docs/pages/actions/catalog/morpho.md +247 -0
- package/dist/docs/pages/actions/catalog/notion.md +1077 -0
- package/dist/docs/pages/actions/catalog/nws.md +485 -0
- package/dist/docs/pages/actions/catalog/open-meteo.md +559 -0
- package/dist/docs/pages/actions/catalog/polymarket.md +1523 -0
- package/dist/docs/pages/actions/catalog/pushbullet.md +220 -0
- package/dist/docs/pages/actions/catalog/resend.md +307 -0
- package/dist/docs/pages/actions/catalog/s3.md +513 -0
- package/dist/docs/pages/actions/catalog/sec-edgar.md +487 -0
- package/dist/docs/pages/actions/catalog/slack.md +2629 -0
- package/dist/docs/pages/actions/catalog/stripe.md +1405 -0
- package/dist/docs/pages/actions/catalog/wikipedia.md +379 -0
- package/dist/docs/pages/actions/catalog.md +46 -0
- package/dist/docs/pages/actions/limits.md +50 -0
- package/dist/docs/pages/actions/model-tools.md +225 -0
- package/dist/docs/pages/actions/packs.md +148 -0
- package/dist/docs/pages/actions/settings.md +69 -0
- package/dist/docs/pages/actions/tools.md +244 -0
- package/dist/docs/pages/actions/triggers.md +149 -0
- package/dist/docs/pages/actions.md +88 -0
- package/dist/docs/pages/compat/anthropic.md +168 -0
- package/dist/docs/pages/compat/e2b.md +194 -0
- package/dist/docs/pages/compat/firecrawl.md +138 -0
- package/dist/docs/pages/compat/openai.md +168 -0
- package/dist/docs/pages/concepts/auth.md +151 -0
- package/dist/docs/pages/concepts/beta.md +55 -0
- package/dist/docs/pages/concepts/glossary.md +71 -0
- package/dist/docs/pages/concepts/ids.md +98 -0
- package/dist/docs/pages/concepts/jobs.md +229 -0
- package/dist/docs/pages/concepts/latency.md +138 -0
- package/dist/docs/pages/concepts/limits.md +191 -0
- package/dist/docs/pages/concepts/stack.md +59 -0
- package/dist/docs/pages/concepts/timing.md +86 -0
- package/dist/docs/pages/concepts/usage.md +110 -0
- package/dist/docs/pages/design/b3os-yaml.md +370 -0
- package/dist/docs/pages/design/deploy-from-github.md +122 -0
- package/dist/docs/pages/design/observability.md +134 -0
- package/dist/docs/pages/errors.md +1824 -0
- package/dist/docs/pages/infer/chat.md +570 -0
- package/dist/docs/pages/infer/limits.md +55 -0
- package/dist/docs/pages/infer/messages.md +185 -0
- package/dist/docs/pages/infer/responses.md +173 -0
- package/dist/docs/pages/infer/settings.md +154 -0
- package/dist/docs/pages/infer/speech.md +323 -0
- package/dist/docs/pages/infer.md +154 -0
- package/dist/docs/pages/introduction.md +162 -0
- package/dist/docs/pages/platform/addresses.md +174 -0
- package/dist/docs/pages/platform/call-log.md +99 -0
- package/dist/docs/pages/platform/custom-domains.md +104 -0
- package/dist/docs/pages/platform/keys.md +79 -0
- package/dist/docs/pages/platform/limits.md +57 -0
- package/dist/docs/pages/platform/members.md +101 -0
- package/dist/docs/pages/platform/requests.md +116 -0
- package/dist/docs/pages/platform/settings.md +129 -0
- package/dist/docs/pages/platform/webhooks.md +68 -0
- package/dist/docs/pages/platform.md +67 -0
- package/dist/docs/pages/quickstart/mcp.md +94 -0
- package/dist/docs/pages/quickstart/sandbox-agent.md +205 -0
- package/dist/docs/pages/quickstart/scrape.md +134 -0
- package/dist/docs/pages/quickstart.md +45 -0
- package/dist/docs/pages/render/inspections.md +162 -0
- package/dist/docs/pages/render/limits.md +72 -0
- package/dist/docs/pages/render/screenshots.md +179 -0
- package/dist/docs/pages/render/settings.md +431 -0
- package/dist/docs/pages/render/styles.md +342 -0
- package/dist/docs/pages/render/videos.md +272 -0
- package/dist/docs/pages/render.md +118 -0
- package/dist/docs/pages/routines/callables.md +174 -0
- package/dist/docs/pages/routines/definitions.md +361 -0
- package/dist/docs/pages/routines/limits.md +117 -0
- package/dist/docs/pages/routines/runs.md +328 -0
- package/dist/docs/pages/routines/settings.md +104 -0
- package/dist/docs/pages/routines/triggers.md +339 -0
- package/dist/docs/pages/routines.md +216 -0
- package/dist/docs/pages/sandboxes/agents.md +217 -0
- package/dist/docs/pages/sandboxes/commands.md +272 -0
- package/dist/docs/pages/sandboxes/images.md +166 -0
- package/dist/docs/pages/sandboxes/limits.md +143 -0
- package/dist/docs/pages/sandboxes/ports.md +260 -0
- package/dist/docs/pages/sandboxes/settings.md +358 -0
- package/dist/docs/pages/sandboxes/snapshots.md +423 -0
- package/dist/docs/pages/sandboxes/swarms.md +146 -0
- package/dist/docs/pages/sandboxes/volumes.md +131 -0
- package/dist/docs/pages/sandboxes.md +231 -0
- package/dist/docs/pages/sdks/cli.md +121 -0
- package/dist/docs/pages/sdks/mcp.md +169 -0
- package/dist/docs/pages/sdks/python.md +146 -0
- package/dist/docs/pages/sdks/typescript.md +202 -0
- package/dist/docs/pages/sdks.md +282 -0
- package/dist/docs/pages/settings.md +33 -0
- package/dist/docs/pages/vault/limits.md +46 -0
- package/dist/docs/pages/vault.md +133 -0
- package/dist/docs/pages/vision/agent-browser.md +115 -0
- package/dist/docs/pages/vision/crawl.md +333 -0
- package/dist/docs/pages/vision/extract.md +152 -0
- package/dist/docs/pages/vision/fetcher.md +15 -0
- package/dist/docs/pages/vision/limits.md +79 -0
- package/dist/docs/pages/vision/profiles.md +111 -0
- package/dist/docs/pages/vision/proxy.md +131 -0
- package/dist/docs/pages/vision/scrape.md +356 -0
- package/dist/docs/pages/vision/sessions.md +311 -0
- package/dist/docs/pages/vision/settings.md +656 -0
- package/dist/docs/pages/vision.md +175 -0
- package/dist/errors.d.ts +129 -0
- package/dist/errors.js +326 -0
- package/dist/errors.js.map +1 -0
- package/dist/main.d.ts +1 -1
- package/dist/main.js +26 -13
- package/dist/main.js.map +1 -1
- package/dist/manifest/domains.d.ts +50 -0
- package/dist/manifest/domains.js +159 -0
- package/dist/manifest/domains.js.map +1 -0
- package/dist/manifest/link.d.ts +20 -0
- package/dist/manifest/link.js +24 -0
- package/dist/manifest/link.js.map +1 -0
- package/dist/manifest/record.d.ts +1 -1
- package/dist/tool/archive.d.ts +33 -0
- package/dist/tool/archive.js +174 -0
- package/dist/tool/archive.js.map +1 -0
- package/dist/tool/calls.d.ts +46 -0
- package/dist/tool/calls.js +274 -0
- package/dist/tool/calls.js.map +1 -0
- package/dist/tool/checks.d.ts +21 -0
- package/dist/tool/checks.js +145 -0
- package/dist/tool/checks.js.map +1 -0
- package/dist/tool/elf.d.ts +19 -0
- package/dist/tool/elf.js +107 -0
- package/dist/tool/elf.js.map +1 -0
- package/dist/tool/predict.d.ts +8 -0
- package/dist/tool/predict.js +38 -0
- package/dist/tool/predict.js.map +1 -0
- package/dist/tool/ustar.d.ts +5 -0
- package/dist/tool/ustar.js +220 -0
- package/dist/tool/ustar.js.map +1 -0
- package/package.json +6 -5
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
# Videos
|
|
2
|
+
|
|
3
|
+
> Record a scripted, narrated product demo as MP4, GIF, poster and captions, follow it as a job, and restyle it later without recording again.
|
|
4
|
+
|
|
5
|
+
Source: https://docs.beta.b3os.org/render/videos.md
|
|
6
|
+
|
|
7
|
+
`POST /v1/render/videos` records a demo of a web app from a script. The script is a list of **beats**: each beat says one line of narration and performs browser steps while the line is said. The result is a job.
|
|
8
|
+
|
|
9
|
+
## Record a video
|
|
10
|
+
|
|
11
|
+
**curl**
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
curl -s "https://beta-api.b3os.org/v1/render/videos?wait=30" \
|
|
15
|
+
-H "Authorization: Bearer $B3OS_API_KEY" \
|
|
16
|
+
-H "Content-Type: application/json" \
|
|
17
|
+
-d '{
|
|
18
|
+
"source": {"url": "https://beta.b3os.org/demo/"},
|
|
19
|
+
"beats": [
|
|
20
|
+
{"say": "Open the billing page.",
|
|
21
|
+
"do": [{"kind": "click", "target": {"role": "link", "name": "Billing"}}]},
|
|
22
|
+
{"say": "Switch to annual and watch the price update.",
|
|
23
|
+
"do": [{"kind": "click", "target": {"text": "Annual", "exact": true}}]}
|
|
24
|
+
],
|
|
25
|
+
"voice": {"model": "kokoro-82m", "voice": "af_heart"},
|
|
26
|
+
"captions": {"burn_in": "karaoke", "sidecars": ["vtt"]},
|
|
27
|
+
"style": {"background": "midnight", "frame": "browser-dark", "cursor": "arrow"},
|
|
28
|
+
"formats": ["mp4", "gif", "poster"]
|
|
29
|
+
}'
|
|
30
|
+
```
|
|
31
|
+
**TypeScript**
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import { B3OS } from "@b3os/sdk";
|
|
35
|
+
|
|
36
|
+
const b3os = new B3OS();
|
|
37
|
+
// .wait() resolves with the finished job
|
|
38
|
+
const done = await b3os.render
|
|
39
|
+
.createVideo({
|
|
40
|
+
source: { url: "https://beta.b3os.org/demo/" },
|
|
41
|
+
beats: [
|
|
42
|
+
{ say: "Open the billing page.", do: [{ kind: "click", target: { role: "link", name: "Billing" } }] },
|
|
43
|
+
{
|
|
44
|
+
say: "Switch to annual and watch the price update.",
|
|
45
|
+
do: [{ kind: "click", target: { text: "Annual", exact: true } }],
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
voice: { model: "kokoro-82m", voice: "af_heart" },
|
|
49
|
+
captions: { burn_in: "karaoke", sidecars: ["vtt"] },
|
|
50
|
+
style: { background: "midnight", frame: "browser-dark", cursor: "arrow" },
|
|
51
|
+
formats: ["mp4", "gif", "poster"],
|
|
52
|
+
})
|
|
53
|
+
.wait();
|
|
54
|
+
for (const artifact of done.result?.artifacts ?? []) console.log(artifact.kind, artifact.url);
|
|
55
|
+
```
|
|
56
|
+
**Python**
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
from b3os import B3OS
|
|
60
|
+
|
|
61
|
+
b3os = B3OS()
|
|
62
|
+
done = b3os.render.create_video(
|
|
63
|
+
{
|
|
64
|
+
"source": {"url": "https://beta.b3os.org/demo/"},
|
|
65
|
+
"beats": [
|
|
66
|
+
{"say": "Open the billing page.",
|
|
67
|
+
"do": [{"kind": "click", "target": {"role": "link", "name": "Billing"}}]},
|
|
68
|
+
{"say": "Switch to annual and watch the price update.",
|
|
69
|
+
"do": [{"kind": "click", "target": {"text": "Annual", "exact": True}}]},
|
|
70
|
+
],
|
|
71
|
+
"voice": {"model": "kokoro-82m", "voice": "af_heart"},
|
|
72
|
+
"captions": {"burn_in": "karaoke", "sidecars": ["vtt"]},
|
|
73
|
+
"style": {"background": "midnight", "frame": "browser-dark", "cursor": "arrow"},
|
|
74
|
+
"formats": ["mp4", "gif", "poster"],
|
|
75
|
+
},
|
|
76
|
+
wait=True, # returns the finished job
|
|
77
|
+
)
|
|
78
|
+
for artifact in done["result"]["artifacts"]:
|
|
79
|
+
print(artifact["kind"], artifact["url"])
|
|
80
|
+
```
|
|
81
|
+
**MCP**
|
|
82
|
+
|
|
83
|
+
```text
|
|
84
|
+
Record a short demo of https://beta.b3os.org/demo/: open Billing, then switch to annual pricing. Narrate each step.
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The agent writes the beats and calls `render_video` with them as `request`. The tool waits up to `wait_s` seconds and returns the artifact URLs, or the video ID while the job still runs, to call again with `job_id`. `render_video` is on the local MCP server only.
|
|
88
|
+
|
|
89
|
+
The voice `model` and `voice` come from `GET /v1/infer/models` and `GET /v1/infer/audio/voices`; the values above are examples. Leave `voice` out and every beat with `say` is narrated in `af_heart`; send `"voice": null` for a silent video. Narration is speech made with your key, so the key needs `infer:run` as well as `render:run`. A key without `infer:run` still gets the video, silent with word times estimated from the text: `result.narration.spoken` is false, its `reason` names the scope, and `result.warnings` has a `narration_scope` entry. A beat without `say` is silent, and `hold_ms` keeps the camera on a beat after its steps end.
|
|
90
|
+
|
|
91
|
+
The video below is a request like the one above, recorded in production: three beats, a voice reading each line,
|
|
92
|
+
karaoke captions burned in and a WebVTT sidecar. It sets no `frame`, so it is the bare window, and in place of
|
|
93
|
+
`midnight` it names a library image, a violet glow: `"overrides": {"background_ref": "high-exposure-gradients/hiexp-01"}`
|
|
94
|
+
in `style`.
|
|
95
|
+
|
|
96
|
+
[Open the video](https://beta.b3os.org/gallery/render/video-base/62ddbb29c2a65c6f.mp4) · [Transcript (WebVTT)](https://beta.b3os.org/gallery/render/video-base/c4360cf63e654afb.vtt)
|
|
97
|
+
|
|
98
|
+
<details>
|
|
99
|
+
<summary>Transcript</summary>
|
|
100
|
+
|
|
101
|
+
`0:00` This is the launch plan board for the whole team.
|
|
102
|
+
|
|
103
|
+
`0:03` Open the billing page.
|
|
104
|
+
|
|
105
|
+
`0:06` Switch to annual and watch the price update.
|
|
106
|
+
|
|
107
|
+
</details>
|
|
108
|
+
|
|
109
|
+
<sub>Captured 2026-11-14 from commit `541f54ca` on a GitHub Actions runner (colo IAD), one call, label `live-recorded` (recorded from production). Case `render/video-base`.</sub>
|
|
110
|
+
|
|
111
|
+
## The script
|
|
112
|
+
|
|
113
|
+
| Field | Meaning |
|
|
114
|
+
|---|---|
|
|
115
|
+
| `source.url` | Where the recording starts |
|
|
116
|
+
| `source.profile` | A vision [profile](https://docs.beta.b3os.org/vision/profiles), by ID or name, to record signed in. Its cookies and storage load before the page loads, into the probe and every capture segment, so the whole video is signed in; it needs `vision:profiles:use`. The video's record, timeline and events name it by its `prof_` ID only, but the video shows whatever the signed-in pages show: treat it and its links as private. A page that opens still signed out (a sign-in form, a 401 or 403, or a move to a sign-in page) ends the job with [`profile_expired`](https://docs.beta.b3os.org/errors#profile_expired) before any step runs, and nothing is billed. A recording made with a profile is reused only by videos with the same profile |
|
|
117
|
+
| `recording` | `reuse: true` replays the newest recording this project made of the same source URL, steps, viewport, seed and start time within `max_age_s` (a day at most) instead of loading the site again: faster, and the content is what the site served then. Videos without `start_time` match each other, and the replay runs on the clock the recording was made on, so the page shows that time. A video that sends back such a video's `result.start_time` replays that recording too. Off by default; `result.recording` says which happened |
|
|
118
|
+
| `beats` | Up to 100 beats, each with `say` (up to 2,000 characters), `do` (up to 50 steps), an optional `title` and `hold_ms` |
|
|
119
|
+
| `voice` | Speech `model`, `voice` and `speed` (0.5 to 2); see [voices](#voices). Left out, the narration is `kokoro-82m` `af_heart`; `null` is silent. The narration track is normalized to -16 LUFS with a -1.5 dBTP ceiling |
|
|
120
|
+
| `captions` | `burn_in` (`static`: each cue as a small pill in the margin under the window, on one line when that fits and the line limits are the defaults; when captions are too large for the margin, every cue sits over the page near its foot instead; a cue never moves to the other edge, and the camera keeps what it frames 24 px clear of it instead; the default pill is 96% near-black with a faint white edge and a soft shadow, fades in over the 150 ms before a cue starts (so its first word reads when spoken) and out over its last 150 ms, and between cues that follow within 0.3 s stays on while its text crossfades and its width follows; a cue shows at least 1.2 s when the next starts late enough, and one still under 0.8 s joins the next when they fit one cue; `karaoke`, the same in step with the narration: the words already spoken white, the word being spoken lit in a light B3 blue, the words to come dimmed, each word lighting over 80 ms centred on when it is spoken; or `none`, files only; left out, `karaoke` on a narrated video and `static` on a silent one), `sidecars` (`vtt`, `srt`), and line limits: 42 characters, 2 lines and 20 characters per second by default. Captions are your `say` text, timed by the word timings that come back with the narration; nothing is transcribed from the audio, so a word is captioned as you wrote it even when the voice says it differently |
|
|
121
|
+
| `style` | Background, frame, cursor, caption and click-effect presets, plus `overrides`; see [styles and captions](https://docs.beta.b3os.org/render/styles). Left out, or `{}`, the B3OS look: the bare rounded window, with no bar, 22 pixel corners at 1080p and the layered `soft` shadow, on one of 24 library images picked for the page (`background: "auto"`: a small vision model picks the image that suits the app from those that keep the window's edges clear, and later videos and screenshots of the same site draw the same one; see [the auto background](https://docs.beta.b3os.org/render/styles#the-auto-background); `"studio"` is the soft studio mesh videos drew before), as tall as screen recorders frame one and as wide as a desktop page needs: 8% of the frame's height above and below the window and 6.5% of its width at each side, room for the captions under it, so at 1920x1080 the window is 1668x864, 80% of the frame's height (`window_shape: "wide"` gives 9% of the long edge on every side instead); `{"frame": "window"}` adds a macOS title bar with the traffic lights in the page's own top color, and `{"frame": "browser"}` an address pill. The cursor shows from the first frame, parked on a plain spot of the page (62% across and 68% down, or the first of five more that is plain and clear of text and images). What moves is filmed with a half-frame shutter, as a camera would (`overrides.motion_blur`, on by default): every frame of a zoom or pan faster than `motion_blur_onset` smears the window, the page and the background by its motion, and a moving cursor stays a sharp arrow over a faint trail behind it; held frames, and frames the camera moves through slowly, stay sharp, exactly as captured. Videos are 60 fps by default |
|
|
122
|
+
| `auto_background` | How the default `auto` background picks its library image: `pin` an image, `repick` for this site, or `vision: false` for the color rules alone. The pick is kept per site, so later videos and screenshots of it match; see [the auto background](https://docs.beta.b3os.org/render/styles#the-auto-background). `result.auto_background` says which image was drawn and how it was chosen (`vision`, `heuristic`, `pinned` or `stored`) |
|
|
123
|
+
| `camera` | `style` (`auto` by default) moves the camera with the steps. The camera moves over the whole frame: as it zooms in, the window, its shadow, the page and the cursor grow together and the background and the window's edges leave the frame; captions stay where they are. By default (`framing: "subject"`, below) each page is held in one of three compositions: the whole window, the page's main content area, or one panel. With `framing: "point"`, before a click, select or typing step it zooms in on the element, so the element and a little around it fill about 45% of the frame width, from 1.25x up to `max_zoom`, never past it (3 at most; left out, 1.7, or the zoom within 10% of it where one captured pixel lands on one output pixel: a small element zooms 1.73x on the default canvas and viewport, two output pixels per CSS pixel, so zoomed text is as sharp as the page, and never past three output pixels per CSS pixel at 1080p, so a phone layout on a portrait video, already drawn at about twice its size, zooms about 1.4x; above it the zoom enlarges the capture and text is a little softer); an element in a nav, aside or header bar zooms 1.25x, since the change it causes is usually elsewhere on the page. A zoom under 1.4x is not worth the move: a session that would zoom less stays wide (typing shots included), and an element inside a zoomed session that would zoom less is framed at the session's zoom. After a move lands the next waits at least 1.2 s: an element that comes sooner is framed with the one before it when both fit one view at 1.4x or more, else the camera stays where it is for the earlier one and moves once, to the later one; a re-centre under 96 px at 1080p is left out. With `scroll: "comfortable"` the view changes (camera moves and page scrolls together) at most once per 2.5 s on average over the video: over that, the move with the least change of zoom whose element was already in view is left out, and the element is framed where the camera stands. A click that loads a new page ends the zoom: the camera starts going wide 0.1 s after the new page first shows, also when the page's address changes only by the next step; while the new page loads, a captured frame that is blank or less than half as sharp as the new page once drawn (a loading skeleton) shows the page before it instead, for 0.15 s at most. A zoom is captured at twice the page's pixels on its whole way in and out, so the capture's sharpness changes only on the whole window, and there over six frames as the camera lands, not in one. On a portrait frame it zooms at most as far as keeps the whole window across, and the 1.4x floor applies after that limit, so a portrait video whose window fills the frame's width stays on the whole window while its page scrolls. With burned-in captions every element it frames, and the cursor resting by it, stays at least 24 px (at 1080p) above the caption pill (below it with captions at the top), and a zoomed hold keeps the window's bottom edge where it rests, so the pill sits on the background under it, whenever the element ends at least 20 px above that edge and starts at least 120 px below the frame's top; otherwise the pill lies over the page. A hold never leaves the window's bottom edge between y 960 and 1080 at 1080p, where the pill would sit half on the page: it moves that edge to 950 or below the frame. The pill never moves. An element near an edge of the window zooms with that edge held where it rests, so the margin and shadow beside it stay in view, and held against one edge the view keeps the window's edge on the other axis at its resting margin when it shows. It stays in through the whole step (a type until its last key) and for 1.5 s at least, and for the next step when that one starts within 2.5 s, or within 3 s when its element is nearby (within 60% of the viewport width), or when zooming out would leave less than 1.5 s on the whole window. It pans only when the next element is within 10% of the frame's edge, and only as far as brings it 12% inside; where the whole window or page fits the frame, it stays whole, with the room beside it split evenly when there is little to spare. It rests at least 1.5 s on what it shows last before it zooms out, when the video has room before its end; the last zoom holds until the narration line about it has nearly ended. Every move, in, out or across, is one quick damped spring with no overshoot, 90% there after about 0.28 s: a zoom in or out takes 0.6 s (the first zoom-in less when the first step comes in under 1.1 s), and a move to the next element sets off with the cursor, never before it, and takes longer the farther it goes, so the middle of the frame moves at most 60 px a frame at 60 fps, or faster where that keeps the cursor 8% of the frame inside its edges (the default demo's lean from the header's 1.25x to the field's 1.73x takes 1.38 s). A move longer than the frame is wide zooms out about where the camera is until both elements are in view, or to the whole window when they fit only below 1.25x, crosses there and zooms back in on the next; it stays out only when going back in would leave no time to zoom out before the video ends. The video opens on the whole window for at least 0.5 s and ends on it for at least 1 s: when a step ends its last beat, the video runs up to about 3 s past that beat. `background_motion` (0.1 by default) is how far the background follows the window: 0 holds it still, 1 zooms it with the window, so the whole frame zooms as one; `background_blur` (on by default for an image background, the default look's library images among them, and off for gradients, solid colors and patterns; a default video drawn on its studio fallback blurs that mesh too, since it is decided before the first frame) softens it: an image background is drawn 4 px soft on the whole window (at 1080p, scaled with the frame), so the window stays the busiest thing in the frame, and softer as the camera zooms in, about 7 px at 1.6x on a 1080p video; `false` keeps it sharp throughout, and gradients, solid colors and patterns are never blurred at rest. `subtle` makes the same moves at 1.25x (kept under 1.4x); `off`, or the older `auto_zoom: false`, keeps the whole window in view. A field typed into (a `type` step, or a click that a `type` without a target follows) is one shot: the camera zooms to `typing_zoom` (2 by default, never past `max_zoom` nor past the zoom where the page is as sharp as captured, so 1.73x on the default canvas), framed from the start of the field, lands by the first key (the cursor reaches a typed field half a second before it, and the camera sets off with the cursor) and holds there through the last, with no move per key; a click right after it on something already in view, such as the button that submits the field, stays in the same shot. `framing` (`subject` by default) is what the camera holds. `subject` holds each page in one of three compositions: the whole window; MAIN, the page's main content area across the frame (the content box of its `main` or `role="main"` element when that is wider than half the viewport, else the viewport less a fixed or sticky sidebar or header bar) with 24 CSS px each side, from 1.25x up to `max_zoom` (1.42x on the B3OS console), or, on a page with neither, the whole window, where the first element a step acts on or the narration names is a DETAIL whatever the length of its line (an element with no enclosing panel framed by its own box), an element that DETAIL shows stays in it, and a page's DETAILs come at most one per 4 s; and DETAIL, one panel or control: the nearest enclosing element that draws a box of its own (a background, a border, a shadow or rounded corners) or is a section, article, main, form, table, list, dialog or region, at least 240 x 120 CSS px or 1.3 times the element on both axes, or the element's own row when that panel is too wide for 1.4x, at up to `max_zoom`, only when it is narrower than 45% of MAIN's view, its narration line (or its typing) lasts 2 s or more from the step, it zooms at least 1.1x MAIN's zoom and its view keeps the window's bottom edge where it rests or holds the element above the caption band. A page opens on the whole window, goes to MAIN at its first step or narrated element, may go to a DETAIL (held through its line) and back, goes from one DETAIL to another only within 40% of the frame's width, and goes wide again only at a click that loads a new page or at the end; an element outside MAIN across, such as a sidebar link, is reached wide. MAIN keeps the window's bottom edge where it rests, the caption pill on the background under it; for a beat whose element lies above that view, or whose label starts less than 24 CSS px under that view's top edge, its top is the window's top, the pill over the page, and a page moves between the two at most once, in one 0.4 s vertical move (it stays top-anchored when its elements would need more). Where that top edge would cut an element's label, MAIN gives up as much as 3% of its zoom, then moves the edge up by up to 40 px while the window still ends at least 24 px above the pill, then takes the other position (top-anchored, moved down by up to 40 px to lift its elements out of the caption band); only then is that element reached on the whole window, on its own: a page with a narrated step is never left on the whole window by this rule. Two pages whose MAINs differ only by that 3% cut between them as the new page first shows. With captions at the top, MAIN top-anchored keeps the window's top where it rests, the pill on the background above it, and is the position MAIN prefers. A click that loads a new path starts a new page, which takes its own position as it first shows: where the camera holds MAIN across the click at one zoom, it cuts there with the page, with no move. Where page content lies under the captions, no element the camera frames, no typed text and no resting cursor sits within 120 px (at 1080p) above the pill's top. A DETAIL's view is placed by its panel, never by the click: centred on it, or from 24 px left of its left edge when it is wider than the view, with the element and the cursor kept 24 px inside, and an edge that would cut a neighbouring panel moves to the gap beside it when that is within 20% of the frame's width. A held view's top edge never cuts a line of text: the view moves up or down by up to 40 px to the gap between two lines (up first), and when a scroll in the hold brings another line under it the camera moves with the scroll; with captions at the top, a scroll stops up to 48 px further or shorter so the window's top falls between lines. A move never leaves the window's edge less than 24 px (at 1080p) from the caption pill unless the pill lies wholly over the page, and a stretch between two scrolls with no gap in reach gives up 3% of its zoom with the scroll instead; with captions at the top and the page under the pill, the line that must fall between lines of text is the blur band's lower edge. A hover the narration speaks over, and an element a `wait` step waits for (by `for.selector` or `for.text`) while a line is spoken, are followed too, a wait only when no click, hover, select or typing follows it in its beat, since that step is then what the line is about; the first such element of a line is in view from 0.3 s before the line starts, and so is an element waited for after clicks in its line that all land inside it (a tab of the panel the line is about), once a scroll before it has landed. A click that opens a beat after the first lands 0.3 s after its line starts, the cursor setting off in the pause before the line, and an element waited for after it is that line's element; a `wait` for a heading names its section's first panel. The closing zoom-out starts at least 1.2 s after the last narrated element is shown. After a click that loads a new page, the first element waited for or hovered on it is the new page's subject: the camera zooms in to the new page's MAIN 0.3 s after the new page first shows, or, still in MAIN on the page the click left at the same zoom, cuts to it as it first shows, and holds until 0.8 s after its line ends, and the video leaves room for that; a last beat ends with at most 1.2 s without a caption or a step before the closing shot on the whole window, its `hold_ms` included. `point` frames the click point and leaves hovers and waits to the cursor, as before. A restyle onto another layout frames the same panels again; with `look: 1` the camera frames the point |
|
|
124
|
+
| `scroll` | How the page scrolls to what a step acts on or waits for. `comfortable` (the default): an element outside the middle of the viewport (8% to 85% of its height) scrolls its panel to the middle, its top at 20% when the panel is taller than 40% of the viewport, else centred at 45%, the element kept in that band, and up to 24 px further so the viewport's edges fall between lines of text: before the cursor sets off for it (the scroll lasts 300 ms plus 0.6 ms per CSS px, from 0.45 s to 0.9 s, starts and stops gently with its fastest moment at its middle, and lands 0.3 s before), and as a waited-for element appears. A scroll always runs its whole length: the step and the rest of its beat wait for it. A scroll that brings in the element a narration line names runs in the pause before the line and ends by its start (0.3 s before it when there is room); when the pause is shorter than the scroll, the line and everything after it wait for it, 0.8 s at most. Before the scrolls are planned step by step, a page whose elements all show in the camera's view at one scroll position scrolls once, to that position, in the pause before the first line that needs it, and never again. A scroll that serves a later beat runs before that beat. An element already in the band never scrolls the page, and while the camera is zoomed, an element whose panel the viewport shows whole is reached by moving the camera (`framing: "point"`); with the default framing the camera holds the page's view instead, so the scroll is left out only when that view already shows the panel whole above the caption. The page never goes up and back down: of two scrolls in opposite directions within 4 s that move it on by less than 25% of their total, one or both are left out whenever the steps they serve stay in the viewport without them, or the two become one scroll to a position that keeps them all in view (a step's element is never left out of the viewport); when neither works, both run at their whole length, and `result.warnings` and the timeline's `warnings` have `scroll_round_trip`. A scroll for an element in a sticky box is left out when it can be. A scroll never runs during a camera move (it ends 0.1 s before one starts, or starts 0.1 s after one lands; a zoom-out waits for the scroll that brings a waited-for element; a scroll that would then run while a line is spoken sets off in the last 200 ms of the zoom-out after the line instead, as one motion), a scrolled result stays put 1.2 s, and a narration line scrolls the page once. Before the closing zoom-out a scrolled page goes back to the top whenever the last 0.9 s or more before it have no caption and no step, and otherwise as the zoom-out starts. So name a step's result with a `wait` step (`for.selector` or `for.text`) and the camera brings it into view. `minimal` scrolls only an element outside the viewport, to its middle, as before; `off` moves the page only by your own `scroll` steps, and a step whose element is outside the viewport fails as one whose element is not found. With `look: 1` the page scrolls as `minimal` |
|
|
125
|
+
| `cursor` | How the cursor moves. It shows from the first frame, with no fade-in, parked on the first of six spots that is plain on the video's first frame and on its frame just before the cursor first moves, as captured, and clear of text, controls and images on the page just before the first step: 62% across and 68% down the page, near its bottom right (88%, 88%), low in the middle (50%, 92%), at its right edge (92%, 50%), in its bottom-right corner (96%, 96%) or at the middle of its bottom edge (50%, 97%). When none is plain, it parks on the first of them, or of the spots one and two arrow heights round each, with nothing under its arrow. The page gets no pointer event until the cursor's first move has ended, so nothing on it is hovered from the first frame or on the cursor's way to its first target. Each move starts softly and settles over about `smoothing_ms` (100 by default), as Screen Studio's smoothed cursor does, and still arrives when it would have. After a click, a select or the first key typed into a field, it moves just below the element (above it near the bottom of the page) when the next move can wait, so it never covers the label or the text being typed while the camera holds; `move_aside: false` leaves it on the element. After a hover, and while typing, it rests where its arrow covers no text, badge or control and stays at least 8 px inside the page: below and right of the hovered label's own text (of the hovered point on a target wider than 400 px whose text runs as wide, such as a table row), else right of it, else another spot that keeps the arrow's tip within 24 px of the label (a table's header cells count as text); while typing, under the field, beside it or above it, else another spot within 24 px of it, else inside it past the end of the typed text. A hover's rest is checked again on the captured page as the cursor sets off for it: where its arrow would lie on text there, it rests at the first clear spot beside, below or above the element (or on the element itself), the least busy one when none is clear. A rest the capture moves gets a real move: the cursor sets off from where it last stood still and travels on its usual curve to the new spot, never a jump, and a rest moved off the element acted on stays within 64 px of it. When the page scrolls under the resting cursor, it stands still while the page moves, then, 150 ms after the scroll ends, moves once to the nearest spot with nothing under its arrow: 24 to 40 px away when there is one, else up to 64 px, across a label it landed on first at the same distance; it stays when no such spot is within 64 px, and a cursor the scroll left on a clear spot does not move. Still for `hide_after_ms` (2,000 by default; 0 never), it fades out over 0.4 s and fades back in 0.3 s before its next move; still to the end of the video, it stays hidden. On the frame it is 48 px tall at 1080p, as Screen Studio's, and grows with the zoom (`overrides.cursor_size` scales it). A click shrinks it to 0.8 of its size and springs it back (`overrides.cursor_press_scale`). It never tilts. A restyle keeps the path its video was recorded with |
|
|
126
|
+
| `viewport` | The browser's size in CSS pixels. Left out, 1440 wide (430 for a portrait output) at the shape of the space the page gets in the frame, so the window fills it: 1440x746 at 1920x1080 in the default look with the default captions, drawn 1.16 times its CSS size, or 1440x771 with none. A square or near-square output (no wider than 4:3) gets about its window's width instead of 1440, so its page is drawn at least one pixel per CSS pixel. The whole window is captured at the scale the page is drawn at (1.159 device pixels per CSS pixel at 1440x746 on 1920x1080), so its text is as sharp as a zoom's, except a closing shot on the whole window shorter than 2 s, which is captured with the zoom before it at twice the page's pixels; a page drawn under 1.01 times its CSS size is captured at 1 |
|
|
127
|
+
| `output` | `width`, `height` and `fps` (24, 25, 30, 50 or 60) of the video. The page is captured at 30 frames a second and the camera, the cursor and the captions are drawn at `fps`; while the page scrolls, a 60 fps video captures it at 60, once per output frame, so a scroll moves the page a little every frame instead of every other frame (the timeline's `capture.stride` and `capture.full_rate`) |
|
|
128
|
+
| `formats` | Any of `mp4`, `gif` and `poster`; `mp4` and `poster` by default |
|
|
129
|
+
| `seed`, `start_time` | Seed the page's randomness and set its clock. Left out, `start_time` is when the job was created, so the page shows the day the video was made. `result.start_time` gives the value used: send it back with the same request, `seed` and `recording.reuse` and the re-render replays the same recording on the same clock, so it is identical. Without `recording.reuse` the site loads again, and a page that changed shows the change |
|
|
130
|
+
|
|
131
|
+
The word being spoken in karaoke captions takes its color from the video's background unless you set it: the background's own accent, made to read on the pill, to stand apart from the words already spoken and to be lighter than the words still to come, the same for the whole video. Set `caption_highlight` to pick it, as a hex or a CSS color name: `"style": {"overrides": {"caption_highlight": "orange"}}`. Captions sit under the window by default; `caption_position` puts them above it, and the camera, the blur under the caption and the cursor keep clear of them there the same way: `"style": {"overrides": {"caption_position": "top"}}`.
|
|
132
|
+
|
|
133
|
+
Steps use the browser action kinds `navigate`, `click`, `hover`, `type`, `key`, `scroll`, `select` and `wait`, with the same fields as in [browser sessions](https://docs.beta.b3os.org/vision/sessions#browser-actions). A `type` step types a character every 35 ms of the video unless its `interval_ms` says otherwise. A script that fails validation is refused with [`script_invalid`](https://docs.beta.b3os.org/errors#script_invalid) before anything records; a step that fails while recording ends the job with [`script_step_failed`](https://docs.beta.b3os.org/errors#script_step_failed), and `step` names it, such as `beats/1/do/0`.
|
|
134
|
+
|
|
135
|
+
The page runs on a recorded clock that only moves between frames, and it waits for what the page is loading. A single-page app works as recorded: when a click opens a client-side route, the route's code and data load and its loading delays (a Suspense fallback, a skeleton) pass between two frames, so the next frame shows the route drawn. A `wait` step for a selector, text or URL works the same way: the page runs on between two frames until the condition holds. If the page asked for its code, styles or fonts, or for its own site's data, while the video was captured and the recording made when it loaded did not hold it, the request failed and `result.warnings` has a `page_requests` entry naming it. Trackers, beacons and prefetches that fail the same way are not counted. When a page draws differently from one part of the capture to the next and the rest of the video needs a sharper capture for its zooms, the video is captured again from the start on one browser, which takes longer; if that fails, or the video is too long for it, the video still finishes and `result.warnings` has a `zoom_soft` entry saying from when its zooms are softer than the page.
|
|
136
|
+
|
|
137
|
+
## Plan from a goal
|
|
138
|
+
|
|
139
|
+
Give `goal`, a sentence of what the video should show, in place of `beats`, and the node plans the beats itself. Exactly one of the two: both, or neither, answers [`script_invalid`](https://docs.beta.b3os.org/errors#script_invalid).
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
curl -s "https://beta-api.b3os.org/v1/render/videos?wait=60" \
|
|
143
|
+
-H "Authorization: Bearer $B3OS_API_KEY" \
|
|
144
|
+
-H "Content-Type: application/json" \
|
|
145
|
+
-d '{"source": {"url": "https://beta.b3os.org/demo/"}, "goal": "Show how to open billing and change the plan"}'
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
The job's first phase, `draft`, reads the start page with one vision scrape at the video's viewport, asks the node's chat model for beats under a JSON Schema whose targets can only be the buttons, links and fields that page listed, runs the drafted steps once in a second scrape to check them, and asks once more on the page they left when it shows new controls. At most 2 scrapes and 2 answers, 6 beats, 3 steps a beat, and 90 seconds for the whole plan (`render.goal.plan_s`). The model writes only clicks, hovers and typing on listed controls, never a navigation or a URL. The video's `goal` shows the planned `beats`, whether they were `checked`, how many steps were `dropped` and the `model`; the job's `video.drafted` event carries them too. Send `goal.beats` back as `beats` to record the same steps again; the same `goal` plans again, on the page as it is then.
|
|
149
|
+
|
|
150
|
+
Planning runs as your key, so the key needs `vision:run` and `infer:run` besides `render:run`; without them the call answers 403 [`forbidden`](https://docs.beta.b3os.org/errors#forbidden) and no job is made. A goal is planned on public pages only: the check runs the drafted steps on the page before anyone sees them, so a goal with `source.profile` answers 422 [`script_invalid`](https://docs.beta.b3os.org/errors#script_invalid) at `/source/profile`. Send `beats` to record a signed-in page. It bills the vision pages and model tokens it used, whether or not planning succeeds. When planning fails the job fails with [`goal_unplanned`](https://docs.beta.b3os.org/errors#goal_unplanned), whose `reason` says why (`no_controls` when the start page lists no buttons, links or fields, `steps_unrunnable` when the drafted steps did not run there, and others), and bills no `render.video_s`.
|
|
151
|
+
|
|
152
|
+
## Follow the job
|
|
153
|
+
|
|
154
|
+
A video is a [job](https://docs.beta.b3os.org/concepts/jobs). Its events stream at `GET /v1/render/videos/{video_id}/events`: the lifecycle events, `video.phase` as it moves through voice, plan, capture, compose, encode and upload, and `video.artifact` as each file becomes available, poster first. A node records a few videos at a time; a video that waits for its turn is `queued` and has `queue_position`, where 1 means it starts next. `job.queued` carries the position the video had when it was created, and `GET /v1/render/videos/{video_id}` the current one. You can also wait on the create call with `?wait=`. With `webhook: {url, events}` on the create call, B3OS also sends each selected event, in order, to your endpoint as a signed [webhook](https://docs.beta.b3os.org/platform/webhooks).
|
|
155
|
+
|
|
156
|
+
When it succeeds, `result` holds the duration, size and frame rate, the page's clock at the start (`start_time`), and `artifacts` lists the files with signed URLs: the MP4 first, then the poster, the caption files and the GIF. When any beat has a `title`, the last artifact is `chapters` (`chapters.vtt`, WebVTT): one cue per titled beat, starting where that beat starts, so a player can show chapter marks; a beat without a title stays in the chapter before it. MP4 files are H.264 with BT.709 color, at an encoding quality the beta fixes ([render settings](https://docs.beta.b3os.org/render/settings#video-encoding)). `POST /v1/render/videos/{video_id}/cancel` stops the job. A video bills `render.video_s` only when it succeeds: a failed or canceled video bills nothing.
|
|
157
|
+
|
|
158
|
+
`GET /v1/render/videos/{video_id}/timeline` returns the compiled timeline once planning is done: the narration with word timings, the timed actions the recorder replayed, the cursor path, camera keyframes, captions and style. Add `frames=true` for the per-frame compositor state when you need to debug a frame.
|
|
159
|
+
|
|
160
|
+
## Restyle a video
|
|
161
|
+
|
|
162
|
+
Restyling re-composes the archived raw capture with a new style, captions, output size or formats. No browser runs and the narration is reused; camera moves do not change, unless the new style or size puts the page elsewhere on the frame: then a video recorded with `framing: "subject"` is framed again from the panels its recording measured, at the same times and up to the same zoom.
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
curl -s "https://beta-api.b3os.org/v1/render/videos/$VIDEO_ID/restyle?wait=30" \
|
|
166
|
+
-H "Authorization: Bearer $B3OS_API_KEY" \
|
|
167
|
+
-H "Content-Type: application/json" \
|
|
168
|
+
-d '{"style": {"background": "sunset", "frame": "browser"}, "captions": {"burn_in": "static"}}'
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
The result is a new video whose `restyled_from` names the source. The raw capture lives as long as the source video, 7 days; after that, or for a video that did not succeed, restyle fails with [`restyle_unavailable`](https://docs.beta.b3os.org/errors#restyle_unavailable).
|
|
172
|
+
|
|
173
|
+
## Share a video
|
|
174
|
+
|
|
175
|
+
A share is a public page that plays a finished video in any browser and as an iframe on any site, with its poster, captions and chapters, Open Graph tags and a JSON-LD `VideoObject`, so a pasted link shows a preview. Sharing is on for every organization; a video is public only once you share it. A video recorded with a [browser profile](https://docs.beta.b3os.org/vision/profiles) shows signed-in pages, so share it only if those pages may be public.
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
curl -s -X POST "https://beta-api.b3os.org/v1/render/videos/$VIDEO_ID/share" \
|
|
179
|
+
-H "Authorization: Bearer $B3OS_API_KEY" \
|
|
180
|
+
-H "Content-Type: application/json" \
|
|
181
|
+
-d '{"title": "The Example launch plan in 30 seconds"}'
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
The answer's `url` is the page, `https://usercontent.b3os.org/s/shr-…`. The share ID is 128 random bits: the URL is the only key, and the page is `noindex`. `media` gives stable links to the share's files, for a README image or a `<video>` you write yourself: `…/video.mp4`, `…/poster.jpg`, `…/video.gif`, `…/captions.vtt` and `…/chapters.vtt`. No script runs on the page (`Content-Security-Policy: sandbox`, which allows only popups, so its footer links open). Sharing again returns the same share (200). A video's share lasts as long as the video, 7 days by default, and as long as an alias keeps the video (its `expires_at` is then `null`); share an [alias](#keep-a-demo-current-with-an-alias) to keep a demo longer. A video can be shared once it has succeeded with an MP4; before that the call answers [`conflict`](https://docs.beta.b3os.org/errors#conflict). A share's files come from B3OS's storage only, never from the node that recorded the video: a share made before its upload lands, seconds after the video succeeded, says Processing and loads the video by itself once it is stored (the page reloads every 2 seconds for 2 minutes), its files answer 404 with `Retry-After` until then, and a video whose MP4 will never reach storage (over 100 MiB, or more than its node uploads in 60 seconds, 75 MB by default; or one whose upload was given up) answers [`conflict`](https://docs.beta.b3os.org/errors#conflict) with the reason.
|
|
185
|
+
|
|
186
|
+
`DELETE /v1/render/videos/{video_id}/share` stops the share, and so does deleting the video. The answer comes only once B3OS's storage confirmed it: from the next request on, the page answers 404, and so do its files and its oEmbed answer. Every answer of a share may be cached for 60 seconds at most, so a browser or a shared cache keeps a copy no longer than that. Out of reach: bytes a player already downloaded, and copies other services made of the public URLs (link previews in Slack or Discord, an image proxy such as the one GitHub runs for README images). When storage cannot be reached the call answers 503 [`product_unavailable`](https://docs.beta.b3os.org/errors#product_unavailable) with `Retry-After` and the share stays live: call it again.
|
|
187
|
+
|
|
188
|
+
The page takes player parameters in its URL, and ignores any other: `autoplay=1` (starts muted, as browsers require), `muted=1`, `loop=1`, `controls=0` and `t=<seconds>` (0 to 86400, where it starts). A page answers 600 requests a minute per address and 6,000 a minute per share (`render.share.address.rpm`, `render.share.rpm`, counted per Cloudflare location), then 429 with `Retry-After`.
|
|
189
|
+
|
|
190
|
+
Each page's footer has a Report link. To report a share, or to ask about one B3 took down, write to abuse@b3os.org. A share B3 took down answers 451 on its page and 404 on its files, and so does every other share of the same video, alias shares included. The takedown covers the bytes too: the video's own artifact links (`/a/…`) answer 404 as well. Sharing that video again, or restyling it, answers 403 [`share_blocked`](https://docs.beta.b3os.org/errors#share_blocked) while the takedown stands. The owner sees it: within about 10 minutes the video's `share` and the alias's share say `blocked: true`, and the dashboard shows the video as taken down; the reason stays with B3.
|
|
191
|
+
|
|
192
|
+
## Keep a demo current with an alias
|
|
193
|
+
|
|
194
|
+
An alias names a recording, such as `billing-tour`. Record with `alias` and the alias points at the newest video made with it that succeeded; share the alias and the page, its embed and its stable file links always play that video, so a re-record updates every embed with no change to its HTML.
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
curl -s "https://beta-api.b3os.org/v1/render/videos?wait=60" \
|
|
198
|
+
-H "Authorization: Bearer $B3OS_API_KEY" \
|
|
199
|
+
-H "Content-Type: application/json" \
|
|
200
|
+
-d '{"source": {"url": "https://beta.b3os.org/demo/"}, "alias": "billing-tour",
|
|
201
|
+
"beats": [{"say": "Open billing.", "do": [{"kind": "click", "target": {"role": "link", "name": "Billing"}}]}]}'
|
|
202
|
+
|
|
203
|
+
curl -s -X POST "https://beta-api.b3os.org/v1/render/aliases/billing-tour/share" \
|
|
204
|
+
-H "Authorization: Bearer $B3OS_API_KEY"
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Run the first call again, from CI after a deploy for example, and the alias moves to the new video once it succeeds (one whose MP4 will never reach storage leaves it where it was: `alias_unshareable`); until the new video's files have uploaded, the page and its stable links play the video the alias left. It only moves forward: an older job that finishes later, or a re-record that fails, leaves it where it was. The page names the files of one video, so a viewer who loaded it before the move keeps playing that video; the video the alias left stays served at its versioned links for an hour (`[render] share_grace_s` on the node).
|
|
208
|
+
|
|
209
|
+
- **Retention.** While the alias points at a video, the video is kept past the 7-day retention: `GET` shows `expires_at: null` and `kept_by_alias`, and it can still be restyled. The video it leaves is kept 24 hours more, or to its own expiry when that is later.
|
|
210
|
+
- **Scope.** `alias` on a create or a restyle needs `render:write` besides `render:run`, the scope sharing needs, since a tag can change what a live share plays; without it the call answers 403 [`forbidden`](https://docs.beta.b3os.org/errors#forbidden).
|
|
211
|
+
- **Signed-in recordings.** A video recorded with `source.profile` (or a restyle of one) shows signed-in pages, so it never moves an alias that has a share: the alias stays where it is and the video's `result.warnings` says `alias_signed_in`. Point the alias at it with `PUT` and `video_id` once those pages may be public. An alias with no share moves to it as to any video.
|
|
212
|
+
- **Pin and follow.** `PUT /v1/render/aliases/{alias}` with `{"video_id": "vid_…"}` points it at an older video tagged with it and pins it there (`follow: false`), which rolls an embed back; `{"follow": true}` moves it to the newest succeeded video again (while it has a share, not to a signed-in one). A video not tagged with the alias is refused with [`conflict`](https://docs.beta.b3os.org/errors#conflict): restyle it with `alias` to add it, which takes seconds and no browser.
|
|
213
|
+
- **Restyle.** `POST /v1/render/videos/{video_id}/restyle` with `alias` adds the restyled video to the alias. A restyle without `alias` never moves one, so styles can be tried without changing a live embed.
|
|
214
|
+
- **Delete.** Deleting the alias's video moves it to its newest remaining video, or to none (its page then answers 404 until a re-record). `DELETE /v1/render/aliases/{alias}` stops its share, releases its video to the normal retention and removes the alias; the tagged videos stay.
|
|
215
|
+
- **Limits.** 50 aliases per organization (`render.aliases.max`) and 2 GiB of kept files (`render.kept.bytes`). A tagged video that would pass the storage limit still succeeds, is kept 7 days like any video, leaves the alias where it was and says so in `result.warnings` (`alias_storage`). An alias belongs to one project.
|
|
216
|
+
|
|
217
|
+
`GET /v1/render/aliases` lists the project's aliases, and `GET /v1/render/aliases/{alias}` shows one: the video it points at, its newest 20 videos and its share.
|
|
218
|
+
|
|
219
|
+
## Embed it
|
|
220
|
+
|
|
221
|
+
Paste `embed_html`, an `<iframe>` of the page 960 pixels wide (less for a narrower video) at the video's aspect ratio plus the page's 32-pixel footer. Sites that read oEmbed embed the share's link by itself: `GET https://usercontent.b3os.org/oembed?url=<share URL>` (the answer's `oembed_url`) answers type `video` with the same iframe, its size, the title and the poster as the thumbnail, smaller when you pass `maxwidth` or `maxheight`. The player parameters above work in the iframe's `src` too, for example `?autoplay=1&loop=1` for a looping preview. oEmbed answers 60 requests a minute per address (`render.oembed.address.rpm`).
|
|
222
|
+
|
|
223
|
+
## Delete
|
|
224
|
+
|
|
225
|
+
`DELETE /v1/render/videos/{video_id}` cancels the job if it is still running, then deletes the video, its artifacts, its share and its raw capture.
|
|
226
|
+
|
|
227
|
+
## In the dashboard
|
|
228
|
+
|
|
229
|
+
The same calls without code: **Render > New video** in the [dashboard](https://beta.b3os.org/app/renders/new) opens a studio with this page's example script against the demo app. Edit the beats as a table (a step's target box takes visible text, `=Exact text`, a CSS selector such as `#plan`, or a role and name such as `link:Billing`) or as the request JSON, pick the presets, a library background and a voice with their previews and samples, and copy the request as curl, TypeScript, Python or an MCP call. A video's page follows its phases live, plays the MP4 with its captions, and has Cancel, Restyle (shown beside the original), Copy embed, Share (the link, the embed code, the oEmbed URL and the GIF link, and Stop sharing) and Delete; a video an alias keeps says so in place of its expiry. The studio's Alias field records with `alias`.
|
|
230
|
+
|
|
231
|
+
## Voices
|
|
232
|
+
|
|
233
|
+
Narration uses the node's speech model, `kokoro-82m`, and any of its voices. This is `af_heart`, the voice the examples on this page use:
|
|
234
|
+
|
|
235
|
+
**af\_heart (Heart, American English, female)**
|
|
236
|
+
|
|
237
|
+
<audio preload="none" controls aria-label="af_heart (Heart, American English, female)" src="https://beta.b3os.org/assets/voices/af_heart.mp3"></audio>
|
|
238
|
+
|
|
239
|
+
[Download the audio](https://beta.b3os.org/assets/voices/af_heart.mp3)
|
|
240
|
+
|
|
241
|
+
It says "Hi, I'm Heart. I can narrate your product demo, timed to every click." Each file below has its voice saying the same sentence with its own name. These are the English voices; `GET /v1/infer/audio/voices` is the full list, with the same `sample_url` for each, and also lists voices in other languages where the node serves them.
|
|
242
|
+
|
|
243
|
+
| Voice | Speaker | Sample |
|
|
244
|
+
|---|---|---|
|
|
245
|
+
| `af_heart` | Heart, American English, female | [af_heart.mp3](https://beta.b3os.org/assets/voices/af_heart.mp3) |
|
|
246
|
+
| `af_alloy` | Alloy, American English, female | [af_alloy.mp3](https://beta.b3os.org/assets/voices/af_alloy.mp3) |
|
|
247
|
+
| `af_aoede` | Aoede, American English, female | [af_aoede.mp3](https://beta.b3os.org/assets/voices/af_aoede.mp3) |
|
|
248
|
+
| `af_bella` | Bella, American English, female | [af_bella.mp3](https://beta.b3os.org/assets/voices/af_bella.mp3) |
|
|
249
|
+
| `af_jessica` | Jessica, American English, female | [af_jessica.mp3](https://beta.b3os.org/assets/voices/af_jessica.mp3) |
|
|
250
|
+
| `af_kore` | Kore, American English, female | [af_kore.mp3](https://beta.b3os.org/assets/voices/af_kore.mp3) |
|
|
251
|
+
| `af_nicole` | Nicole, American English, female | [af_nicole.mp3](https://beta.b3os.org/assets/voices/af_nicole.mp3) |
|
|
252
|
+
| `af_nova` | Nova, American English, female | [af_nova.mp3](https://beta.b3os.org/assets/voices/af_nova.mp3) |
|
|
253
|
+
| `af_river` | River, American English, female | [af_river.mp3](https://beta.b3os.org/assets/voices/af_river.mp3) |
|
|
254
|
+
| `af_sarah` | Sarah, American English, female | [af_sarah.mp3](https://beta.b3os.org/assets/voices/af_sarah.mp3) |
|
|
255
|
+
| `af_sky` | Sky, American English, female | [af_sky.mp3](https://beta.b3os.org/assets/voices/af_sky.mp3) |
|
|
256
|
+
| `am_adam` | Adam, American English, male | [am_adam.mp3](https://beta.b3os.org/assets/voices/am_adam.mp3) |
|
|
257
|
+
| `am_echo` | Echo, American English, male | [am_echo.mp3](https://beta.b3os.org/assets/voices/am_echo.mp3) |
|
|
258
|
+
| `am_eric` | Eric, American English, male | [am_eric.mp3](https://beta.b3os.org/assets/voices/am_eric.mp3) |
|
|
259
|
+
| `am_fenrir` | Fenrir, American English, male | [am_fenrir.mp3](https://beta.b3os.org/assets/voices/am_fenrir.mp3) |
|
|
260
|
+
| `am_liam` | Liam, American English, male | [am_liam.mp3](https://beta.b3os.org/assets/voices/am_liam.mp3) |
|
|
261
|
+
| `am_michael` | Michael, American English, male | [am_michael.mp3](https://beta.b3os.org/assets/voices/am_michael.mp3) |
|
|
262
|
+
| `am_onyx` | Onyx, American English, male | [am_onyx.mp3](https://beta.b3os.org/assets/voices/am_onyx.mp3) |
|
|
263
|
+
| `am_puck` | Puck, American English, male | [am_puck.mp3](https://beta.b3os.org/assets/voices/am_puck.mp3) |
|
|
264
|
+
| `am_santa` | Santa, American English, male | [am_santa.mp3](https://beta.b3os.org/assets/voices/am_santa.mp3) |
|
|
265
|
+
| `bf_alice` | Alice, British English, female | [bf_alice.mp3](https://beta.b3os.org/assets/voices/bf_alice.mp3) |
|
|
266
|
+
| `bf_emma` | Emma, British English, female | [bf_emma.mp3](https://beta.b3os.org/assets/voices/bf_emma.mp3) |
|
|
267
|
+
| `bf_isabella` | Isabella, British English, female | [bf_isabella.mp3](https://beta.b3os.org/assets/voices/bf_isabella.mp3) |
|
|
268
|
+
| `bf_lily` | Lily, British English, female | [bf_lily.mp3](https://beta.b3os.org/assets/voices/bf_lily.mp3) |
|
|
269
|
+
| `bm_daniel` | Daniel, British English, male | [bm_daniel.mp3](https://beta.b3os.org/assets/voices/bm_daniel.mp3) |
|
|
270
|
+
| `bm_fable` | Fable, British English, male | [bm_fable.mp3](https://beta.b3os.org/assets/voices/bm_fable.mp3) |
|
|
271
|
+
| `bm_george` | George, British English, male | [bm_george.mp3](https://beta.b3os.org/assets/voices/bm_george.mp3) |
|
|
272
|
+
| `bm_lewis` | Lewis, British English, male | [bm_lewis.mp3](https://beta.b3os.org/assets/voices/bm_lewis.mp3) |
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Render
|
|
2
|
+
|
|
3
|
+
> Screenshots, scripted product videos and frame-by-frame inspections rendered on the node, with narration, captions and restyling, served from signed URLs.
|
|
4
|
+
|
|
5
|
+
Source: https://docs.beta.b3os.org/render.md
|
|
6
|
+
|
|
7
|
+
Render turns a web page into a finished image or a product video. A screenshot is captured from a warm browser, composed with a background and a window frame, and encoded once, in one call. A video follows a script of beats: lines of narration and the browser steps performed while each line is said.
|
|
8
|
+
|
|
9
|
+
Measured on the B3OS node, from the [benchmark board](https://docs.beta.b3os.org/benchmarks#headline-results). Each figure links its raw data; the board has the conditions.
|
|
10
|
+
|
|
11
|
+
- **Under 120 ms**: Styled 1600x900 screenshot, no background load (JPEG at DPR 1, p50 timed by the server, 2026-11-02). [Raw data](https://beta.b3os.org/raw/bench/bench/results/20261102T082836Z-w4q-idle/render-screenshot/render.screenshot.b2b-c1.result.json)
|
|
12
|
+
- **Under 15 ms**: Each extra format of a screenshot (three variants (WebP, PNG, JPEG at 800 px) from one capture, p50 timed by the server, 2026-11-02). [Raw data](https://beta.b3os.org/raw/bench/bench/results/20261102T082836Z-w4q-idle/render-variants/render.screenshot_variants.b2b-c1.result.json)
|
|
13
|
+
|
|
14
|
+
The two images below are real output of the [first screenshot example](https://docs.beta.b3os.org/render/screenshots#take-a-styled-screenshot), run against the demo app: once without `style`, and once as written.
|
|
15
|
+
|
|
16
|
+
<img src="https://beta.b3os.org/assets/presets/raw.webp" alt="The demo app's Launch plan board, captured without a style: the page edge to edge, no background or window frame." />
|
|
17
|
+
|
|
18
|
+
<img src="https://beta.b3os.org/assets/presets/styled.webp" alt="The same board inside a dark browser window frame with rounded corners and a shadow, on a dark blue gradient background." />
|
|
19
|
+
|
|
20
|
+
## What to call
|
|
21
|
+
|
|
22
|
+
| You want | Call | Bills |
|
|
23
|
+
|---|---|---|
|
|
24
|
+
| A styled image of a page or one element | [`POST /v1/render/screenshots`](https://docs.beta.b3os.org/render/screenshots) | One `render.screenshot`, plus one per extra variant |
|
|
25
|
+
| A narrated product demo as MP4, GIF, poster and captions | [`POST /v1/render/videos`](https://docs.beta.b3os.org/render/videos) | `render.video_s`, seconds of output |
|
|
26
|
+
| The same video with a different look | [`POST /v1/render/videos/{video_id}/restyle`](https://docs.beta.b3os.org/render/videos#restyle-a-video) | `render.video_s` |
|
|
27
|
+
| What moved, flashed or changed on a page, or in a video, frame by frame | [`POST /v1/render/inspections`](https://docs.beta.b3os.org/render/inspections) | `render.inspection_s`, seconds of window |
|
|
28
|
+
| The style presets you can name, with previews | [`GET /v1/render/presets`](https://docs.beta.b3os.org/render/styles#presets) | Nothing |
|
|
29
|
+
|
|
30
|
+
A screenshot or video that produces no artifact bills nothing, and neither does a canceled video.
|
|
31
|
+
|
|
32
|
+
## Settings
|
|
33
|
+
|
|
34
|
+
| Setting | Default |
|
|
35
|
+
|---|---|
|
|
36
|
+
| [Screenshot format and quality](https://docs.beta.b3os.org/render/settings#screenshot-format-and-quality): `format` | `webp` (`format`), 90 (`quality`) |
|
|
37
|
+
| [Pixel ratio](https://docs.beta.b3os.org/render/settings#pixel-ratio): `dpr` | 1 |
|
|
38
|
+
| [When the page is ready](https://docs.beta.b3os.org/render/settings#when-the-page-is-ready): `wait_until` | `auto` (`wait_until`), 0 ms (`wait_for_ms`) |
|
|
39
|
+
| [Video formats](https://docs.beta.b3os.org/render/settings#video-formats): `formats` | `mp4`, `poster` |
|
|
40
|
+
| [Output size and frame rate](https://docs.beta.b3os.org/render/settings#output-size-and-frame-rate): `output` | 1920 by 1080 at 60 frames a second |
|
|
41
|
+
|
|
42
|
+
[Render settings](https://docs.beta.b3os.org/render/settings) has all 25, each with its values, what it changes and an example, and what is fixed in the beta.
|
|
43
|
+
|
|
44
|
+
## How a video is made
|
|
45
|
+
|
|
46
|
+
Videos are narration first. B3OS synthesizes each beat's line with the node's speech model before it records anything, then places the browser steps on the words that describe them, so a click lands on "click". The recorder drives a browser on a virtual clock, records segments of the script in parallel, and composes every frame with the background, window frame, cursor and captions in Rust before encoding. The same `seed` and `start_time` give the same video again.
|
|
47
|
+
|
|
48
|
+
Restyling skips the browser: it re-composes the archived raw capture with a new style, captions or output size, and reuses the narration.
|
|
49
|
+
|
|
50
|
+
Render made this tour of the dashboard from one request.
|
|
51
|
+
|
|
52
|
+
[Open the video](https://beta.b3os.org/gallery/render/narrated-dashboard-demo/1ba1361cff18781e.mp4) · [Transcript (WebVTT)](https://beta.b3os.org/gallery/render/narrated-dashboard-demo/7f18087c08bd68c8.vtt)
|
|
53
|
+
|
|
54
|
+
<details>
|
|
55
|
+
<summary>Transcript</summary>
|
|
56
|
+
|
|
57
|
+
`0:00` This is the B3OS dashboard: applications, sandboxes and requests.
|
|
58
|
+
|
|
59
|
+
`0:06` Render lists your recent screenshots and videos.
|
|
60
|
+
|
|
61
|
+
`0:10` Routines are durable workflows that survive a restart.
|
|
62
|
+
|
|
63
|
+
</details>
|
|
64
|
+
|
|
65
|
+
<sub>Captured 2026-11-15 from commit `2aac696d` on a GitHub Actions runner (colo MSP), one call, label `mock` (the dashboard in mock mode). Case `render/narrated-dashboard-demo`.</sub>
|
|
66
|
+
|
|
67
|
+
## Artifacts
|
|
68
|
+
|
|
69
|
+
Every file render produces is an artifact (`art_`): the image, the MP4, the GIF, the poster frame, the WebVTT or SRT captions. Each has a signed URL on `usercontent.b3os.org`:
|
|
70
|
+
|
|
71
|
+
```text
|
|
72
|
+
https://usercontent.b3os.org/a/art-01m5t41x77fg4pdnm2ryq73wgs/screenshot.webp?node=n1&exp=1793040000&sig=...
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
- The URL needs no credentials and is safe to embed. It works for anyone who has it until `url_expires_at`; `GET /v1/render/artifacts/{artifact_id}` returns a fresh one, valid for 24 hours.
|
|
76
|
+
- The bytes are always served with `Content-Security-Policy: sandbox`, so an image or page never runs scripts or reads the origin, and `usercontent.b3os.org` never uses cookies.
|
|
77
|
+
- A URL works as soon as the artifact is reported, while its upload to storage is still finishing.
|
|
78
|
+
- Artifacts are kept for 7 days unless you delete them first.
|
|
79
|
+
|
|
80
|
+
Your recent screenshots and videos, in the dashboard.
|
|
81
|
+
|
|
82
|
+
[Open the video](https://beta.b3os.org/gallery/docs-site/demo-renders/5e4976f3d693319b.mp4) · [Transcript (WebVTT)](https://beta.b3os.org/gallery/docs-site/demo-renders/8e44857acd773b29.vtt)
|
|
83
|
+
|
|
84
|
+
<details>
|
|
85
|
+
<summary>Transcript</summary>
|
|
86
|
+
|
|
87
|
+
`0:00` Your recent screenshots are here.
|
|
88
|
+
|
|
89
|
+
`0:03` Videos too, with their captions and poster.
|
|
90
|
+
|
|
91
|
+
`0:06` Open one for its player and its files.
|
|
92
|
+
|
|
93
|
+
</details>
|
|
94
|
+
|
|
95
|
+
<sub>Captured 2026-11-15 from commit `2aac696d` on a GitHub Actions runner (colo MSP), one call, label `mock` (the dashboard in mock mode). Case `docs-site/demo-renders`.</sub>
|
|
96
|
+
|
|
97
|
+
## Scopes
|
|
98
|
+
|
|
99
|
+
| Scope | For |
|
|
100
|
+
|---|---|
|
|
101
|
+
| `render:run` | Take screenshots; record videos; read, restyle and cancel the videos the same sandbox or key created; inspect pages and videos |
|
|
102
|
+
| `render:read` | List and read screenshots, videos (any of the project's), artifacts, timelines and presets; with `render:run`, restyle and cancel any of the project's videos |
|
|
103
|
+
| `render:write` | Delete screenshots and videos |
|
|
104
|
+
|
|
105
|
+
Style values you send are escaped before they reach any HTML or CSS. The browsers that compose your output never load a profile or touch the network.
|
|
106
|
+
|
|
107
|
+
## Guides
|
|
108
|
+
|
|
109
|
+
- [Screenshots](https://docs.beta.b3os.org/render/screenshots)
|
|
110
|
+
A page or one element, styled and encoded in one call.
|
|
111
|
+
- [Videos](https://docs.beta.b3os.org/render/videos)
|
|
112
|
+
Scripted, narrated demos with captions, and restyling.
|
|
113
|
+
- [Inspections](https://docs.beta.b3os.org/render/inspections)
|
|
114
|
+
What changed from frame to frame, with a contact sheet.
|
|
115
|
+
- [Styles and captions](https://docs.beta.b3os.org/render/styles)
|
|
116
|
+
Presets, overrides, colors, and how captions are timed and drawn.
|
|
117
|
+
|
|
118
|
+
[Limits and FAQ](https://docs.beta.b3os.org/render/limits) lists the caps and the common questions.
|