@b3os/sdk 0.1.3 → 0.2.0

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 (80) hide show
  1. package/README.md +4 -3
  2. package/dist/cjs/core/client.d.ts +21 -2
  3. package/dist/cjs/core/client.js +26 -1
  4. package/dist/cjs/core/client.js.map +1 -1
  5. package/dist/cjs/core/handle.d.ts +5 -0
  6. package/dist/cjs/core/handle.js +13 -2
  7. package/dist/cjs/core/handle.js.map +1 -1
  8. package/dist/cjs/core/index.d.ts +2 -0
  9. package/dist/cjs/core/index.js +7 -1
  10. package/dist/cjs/core/index.js.map +1 -1
  11. package/dist/cjs/core/traces-api.d.ts +42 -0
  12. package/dist/cjs/core/traces-api.js +54 -0
  13. package/dist/cjs/core/traces-api.js.map +1 -0
  14. package/dist/cjs/core/traces.d.ts +120 -0
  15. package/dist/cjs/core/traces.js +306 -0
  16. package/dist/cjs/core/traces.js.map +1 -0
  17. package/dist/cjs/core/util.d.ts +1 -1
  18. package/dist/cjs/core/util.js +1 -1
  19. package/dist/cjs/generated/errors.d.ts +1 -1
  20. package/dist/cjs/generated/errors.js +12 -0
  21. package/dist/cjs/generated/errors.js.map +1 -1
  22. package/dist/cjs/generated/ids.d.ts +12 -0
  23. package/dist/cjs/generated/ids.js +3 -0
  24. package/dist/cjs/generated/ids.js.map +1 -1
  25. package/dist/cjs/generated/ns/keys.d.ts +2 -1
  26. package/dist/cjs/generated/ns/keys.js +2 -1
  27. package/dist/cjs/generated/ns/keys.js.map +1 -1
  28. package/dist/cjs/generated/ns/render.d.ts +22 -2
  29. package/dist/cjs/generated/ns/render.js +13 -2
  30. package/dist/cjs/generated/ns/render.js.map +1 -1
  31. package/dist/cjs/generated/ns/sandboxes.d.ts +29 -0
  32. package/dist/cjs/generated/ns/sandboxes.js +49 -0
  33. package/dist/cjs/generated/ns/sandboxes.js.map +1 -1
  34. package/dist/cjs/generated/types.d.ts +820 -53
  35. package/dist/esm/core/client.d.ts +21 -2
  36. package/dist/esm/core/client.js +27 -2
  37. package/dist/esm/core/client.js.map +1 -1
  38. package/dist/esm/core/handle.d.ts +5 -0
  39. package/dist/esm/core/handle.js +13 -2
  40. package/dist/esm/core/handle.js.map +1 -1
  41. package/dist/esm/core/index.d.ts +2 -0
  42. package/dist/esm/core/index.js +2 -0
  43. package/dist/esm/core/index.js.map +1 -1
  44. package/dist/esm/core/traces-api.d.ts +42 -0
  45. package/dist/esm/core/traces-api.js +50 -0
  46. package/dist/esm/core/traces-api.js.map +1 -0
  47. package/dist/esm/core/traces.d.ts +120 -0
  48. package/dist/esm/core/traces.js +295 -0
  49. package/dist/esm/core/traces.js.map +1 -0
  50. package/dist/esm/core/util.d.ts +1 -1
  51. package/dist/esm/core/util.js +1 -1
  52. package/dist/esm/generated/errors.d.ts +1 -1
  53. package/dist/esm/generated/errors.js +12 -0
  54. package/dist/esm/generated/errors.js.map +1 -1
  55. package/dist/esm/generated/ids.d.ts +12 -0
  56. package/dist/esm/generated/ids.js +3 -0
  57. package/dist/esm/generated/ids.js.map +1 -1
  58. package/dist/esm/generated/ns/keys.d.ts +2 -1
  59. package/dist/esm/generated/ns/keys.js +2 -1
  60. package/dist/esm/generated/ns/keys.js.map +1 -1
  61. package/dist/esm/generated/ns/render.d.ts +22 -2
  62. package/dist/esm/generated/ns/render.js +13 -2
  63. package/dist/esm/generated/ns/render.js.map +1 -1
  64. package/dist/esm/generated/ns/sandboxes.d.ts +29 -0
  65. package/dist/esm/generated/ns/sandboxes.js +49 -0
  66. package/dist/esm/generated/ns/sandboxes.js.map +1 -1
  67. package/dist/esm/generated/types.d.ts +820 -53
  68. package/package.json +1 -1
  69. package/src/core/client.ts +36 -4
  70. package/src/core/handle.ts +12 -2
  71. package/src/core/index.ts +10 -0
  72. package/src/core/traces-api.ts +80 -0
  73. package/src/core/traces.ts +375 -0
  74. package/src/core/util.ts +1 -1
  75. package/src/generated/errors.ts +24 -0
  76. package/src/generated/ids.ts +3 -0
  77. package/src/generated/ns/keys.ts +2 -1
  78. package/src/generated/ns/render.ts +22 -2
  79. package/src/generated/ns/sandboxes.ts +59 -0
  80. package/src/generated/types.ts +825 -52
@@ -1311,11 +1311,21 @@ export type PresetRef = string;
1311
1311
  export type PresetKind = "background" | "frame" | "cursor" | "captions" | "click_effect";
1312
1312
  /** A background preset (`GET /v1/render/presets?kind=background` has a preview of each). */
1313
1313
  export type BackgroundPreset = "b3os-light" | "b3os-dark" | "b3os-blue" | "midnight" | "aurora" | "sunset" | "ocean" | "arctic" | "dusk" | "forest" | "ember" | "graphite" | "paper";
1314
- /** A window frame preset (`GET /v1/render/presets?kind=frame` has a preview of each). */
1315
- export type FramePreset = "mac" | "mac-dark" | "browser" | "browser-dark" | "windows" | "windows-dark" | "phone" | "tablet" | "laptop" | "laptop-dark" | "desktop";
1314
+ /**
1315
+ * A window frame preset (`GET /v1/render/presets?kind=frame` has a preview of each). `window` is a macOS window whose 28 px bar (at 1080p) holds the traffic lights and nothing else, in the page's own top color, so it reads as the page's toolbar. `mac` adds a centered title (or the host), `browser` an address pill with the host, `windows` caption buttons; the `-dark` ones keep a dark bar whatever the page. A video has no frame by default: the bare rounded window.
1316
+ */
1317
+ export type FramePreset = "window" | "window-dark" | "mac" | "mac-dark" | "browser" | "browser-dark" | "windows" | "windows-dark" | "phone" | "tablet" | "laptop" | "laptop-dark" | "desktop";
1316
1318
  /** A cursor preset (`GET /v1/render/presets?kind=cursor` has a preview of each). */
1317
1319
  export type CursorPreset = "arrow" | "arrow-light" | "dot";
1318
- /** A caption style preset (`GET /v1/render/presets?kind=captions` has a preview of each). */
1320
+ /**
1321
+ * A caption style preset (`GET /v1/render/presets?kind=captions` has a preview of each): `default`, a small
1322
+ * neutral near-black pill that never takes on the background's hue (where the darkest 30% of what it covers is
1323
+ * darker than luma 24, its fill is lifted 18 levels above that and its edge brightened, so it still reads as a
1324
+ * pill), whose
1325
+ * karaoke shows the spoken words white,
1326
+ * the word being spoken in a light B3 blue and the words to come dimmed; `bold`, a large dark pill with a yellow
1327
+ * karaoke word; `minimal`, outlined text with no box; `light`, dark text on a white box.
1328
+ */
1319
1329
  export type CaptionsPreset = "default" | "bold" | "minimal" | "light";
1320
1330
  /** A click effect preset (`GET /v1/render/presets?kind=click_effect` has a preview of each). */
1321
1331
  export type ClickEffectPreset = "ripple" | "ring";
@@ -1324,15 +1334,34 @@ export type ClickEffectPreset = "ripple" | "ring";
1324
1334
  * this). Every field is optional. The per-kind enums (`BackgroundPreset`, `FramePreset`, `CursorPreset`,
1325
1335
  * `CaptionsPreset`, `ClickEffectPreset`) list today's presets; the schema also takes any preset ID so a preset
1326
1336
  * added later needs no client update, and the node refuses an ID that is not a preset of that kind with
1327
- * `style_invalid`. `none` draws nothing for that part; `auto` (the default background) picks one of the studio
1328
- * backgrounds (`GET /v1/render/backgrounds`, pack `studio`, tag `auto`) for the page, one whose color just
1329
- * outside the window's edges is at least 12 L* from the page's own (a dark page gets one at least 20 L*
1330
- * lighter), the same pick for the same page every time; `transparent` leaves the background transparent.
1337
+ * `style_invalid`. `none` draws nothing for that part; `auto` is the default background. On a video and on a
1338
+ * styled screenshot it draws one of the library images tagged `video` (the node's set, by default 24: macOS-style
1339
+ * waves, calm cool, warm and pastel gradient fields, deep dark fields, a grey grain and five soft photographs),
1340
+ * picked from the page (a video's first frame, a screenshot's capture). Only images at least 12 L* from the page
1341
+ * all along just outside the window's edges compete (a dark page: 20 L* lighter outside its dark edges). Among
1342
+ * them a small vision model (`b3os/qwen3.5-9b`, run by the node, not billed to you) picks the one that best
1343
+ * matches the app's look and brand, from the page and one labelled sheet of the candidates. Without the model,
1344
+ * when it does not answer within 4 s, or when one image clears, the color rules pick: the image whose hue suits
1345
+ * the page's accent color and whose tone sits behind the page (deeper behind a light page, airier behind a dark
1346
+ * one), ties broken by the page's host. The first pick for a site (the page's registrable domain, such as
1347
+ * `linear.app`; the host for `localhost` and IP addresses) is kept for your organization, so later videos and
1348
+ * screenshots of the site draw the same image while it clears their page's edges; `auto_background` pins an
1349
+ * image, picks again or turns the model off. The studio pick when no image clears the edges (or the node has no
1350
+ * set). The pick reads the page in CSS pixels, so it does not depend on the device scale; the result's
1351
+ * `auto_background` says which image was drawn and how it was chosen. On a video the timeline's `style` then
1352
+ * names the image in `overrides.background_ref`, and its `look` records it as the `auto` pick with how it was
1353
+ * chosen. If the node cannot load it in time (2 s for a file it has, 0.5 s for one it must fetch,
1354
+ * none while the image store is failing: a minute after it fails, or its Retry-After, 1 s to 10 min), the video
1355
+ * draws the studio pick and `warnings` says so
1356
+ * (`background_fallback`). `studio` is the studio pick by name, on screenshots and videos (what `auto` drew
1357
+ * before 2026-11-11, and what a restyle without a style draws for a timeline from before then: the mesh it
1358
+ * drew, read from the first frame's own pixels as production read it). `transparent` leaves
1359
+ * the background transparent.
1331
1360
  * Strings are drawn by the compositor and escaped before they reach any HTML or CSS.
1332
1361
  */
1333
1362
  export interface RenderStyle {
1334
- /** A background preset, or `auto`, `transparent` or `none`. */
1335
- background?: BackgroundPreset | "auto" | "transparent" | "none" | (string & {});
1363
+ /** A background preset, or `auto`, `studio`, `transparent` or `none`. */
1364
+ background?: BackgroundPreset | "auto" | "studio" | "transparent" | "none" | (string & {});
1336
1365
  /** A window frame preset, or `none`. */
1337
1366
  frame?: FramePreset | "none" | (string & {});
1338
1367
  /** A cursor preset, or `none`. */
@@ -1345,7 +1374,8 @@ export interface RenderStyle {
1345
1374
  }
1346
1375
  /**
1347
1376
  * A color: `#rgb`, `#rgba`, `#rrggbb`, `#rrggbbaa`, `rgb(r,g,b)`, `rgba(r,g,b,a)`, `rgb(r g b / a)` (channels
1348
- * 0-255 or percentages, alpha 0-1 or a percentage), or `white`, `black` or `transparent`.
1377
+ * 0-255 or percentages, alpha 0-1 or a percentage), a CSS color name such as `orange` or `rebeccapurple` (any
1378
+ * of the 148), or `transparent`. A value that is none of these is refused with an error that names it.
1349
1379
  */
1350
1380
  export type RenderColor = string;
1351
1381
  /** One shadow, in CSS pixels; a field left out is 0, and the color defaults to black at 25% alpha. */
@@ -1369,14 +1399,24 @@ export type RenderGradientStop = RenderColor | {
1369
1399
  * videos (relative to 1080p).
1370
1400
  */
1371
1401
  export interface RenderStyleOverrides {
1372
- /** Space around the page, the same on every side or `{x, y}`. */
1402
+ /**
1403
+ * Space around the page, the same on every side or `{x, y}`. Left out, 6% of the canvas's long edge on a
1404
+ * screenshot (48 to 160 pixels), and on a video what `window_shape` gives: by default 8% of the frame's
1405
+ * height above and below the window and 6.5% of its width at each side on a landscape frame (86 and 126
1406
+ * pixels at 1920x1080, the window on even pixels), with room under the window for burned-in captions.
1407
+ */
1373
1408
  padding?: number | {
1374
1409
  x?: number;
1375
1410
  y?: number;
1376
1411
  };
1412
+ /**
1413
+ * The window's corner radius in style px. Left out, 14 on a screenshot and 22 at 1080p on a video (2% of the output's short edge, scaled with it).
1414
+ */
1377
1415
  corner_radius?: number;
1378
- /** A shadow preset, one shadow, or a list of up to 4 drawn together. */
1379
- shadow?: "none" | "soft" | "float" | "hard" | "glow" | RenderShadow | RenderShadow[];
1416
+ /**
1417
+ * A shadow preset, one shadow, or a list of up to 6 drawn together. Left out, the default look's shadow, tinted with the background's own hue: on a video the `soft` one, on a screenshot a contact and an ambient shadow fading out 48-64 px below the window, which `classic` names (a video's before 2026-11-11). `subtle`, `soft` and `deep` are a directional layered shadow (a main shadow, a key light and a contact shadow), tinted the same way, deeper and stronger where the background under the window is deep: `soft` is 0 44 120 -12 at 30%, 0 14 36 -6 at 10% and 0 1 2 0 at 7% at 1080p on a light background, as screen recorders draw a window, deep below and faint above; `subtle` is about two thirds as deep and wide, `deep` about a quarter more. `none` draws none; `float`, `hard` and `glow` are black (glow blue) and untinted.
1418
+ */
1419
+ shadow?: "none" | "subtle" | "soft" | "deep" | "classic" | "float" | "hard" | "glow" | RenderShadow | RenderShadow[];
1380
1420
  /**
1381
1421
  * `none`, or a border of `width` (default 1) and `color`. Left out, a hairline matched to the background.
1382
1422
  */
@@ -1399,14 +1439,16 @@ export interface RenderStyleOverrides {
1399
1439
  * first use there and cached; if it cannot be loaded the request fails with `background_unavailable` (503,
1400
1440
  * retry).
1401
1441
  *
1402
- * `"auto"` (screenshots only) picks a library image that fits the captured page: one of the quiet, bold or
1403
- * soft-photo backgrounds (quiet ones first), in the page's light or dark theme (or `theme`'s), so a light
1404
- * page gets a light, soft background and a dark page a dark one, with clear lightness separation, a hue
1405
- * analogous or complementary to the page's accent, little detail where it shows around the window, and
1442
+ * `"auto"` picks a library image that fits the captured page (a video's first frame): one of the quiet,
1443
+ * bold or soft-photo backgrounds (quiet ones first), in the page's light or dark theme (or `theme`'s), so a
1444
+ * light page gets a light, soft background and a dark page a dark one, with clear lightness separation, a
1445
+ * hue analogous or complementary to the page's accent, little detail where it shows around the window, and
1406
1446
  * enough pixels for the output. The same page gets the same background; the screenshot's `background_ref`
1407
- * names the one drawn. If the chosen image cannot be loaded within 2 s, the screenshot keeps the style's own
1408
- * background (the `auto` background preset unless `background` names another) and `warnings` says so
1409
- * (`background_fallback`).
1447
+ * names the one drawn, a video's timeline `style` does. If the chosen image cannot be loaded within 2 s, the
1448
+ * screenshot or video keeps the style's own background (the `auto` background preset unless `background`
1449
+ * names another) and `warnings` says so (`background_fallback`). The default `auto` background already
1450
+ * draws a library image, on videos and styled screenshots; this picks from the whole library instead of
1451
+ * the video set.
1410
1452
  */
1411
1453
  background_ref?: string;
1412
1454
  /**
@@ -1535,26 +1577,156 @@ export interface RenderStyleOverrides {
1535
1577
  layout?: "default" | "bottom-cropped";
1536
1578
  /** Text for the window's title bar, drawn by the compositor and never parsed as HTML. */
1537
1579
  frame_title?: string;
1538
- /** Text for the address pill of a browser frame, drawn by the compositor and never parsed as HTML. */
1580
+ /**
1581
+ * Text for the address pill of a browser frame, and for a `mac` title bar that has no title (a video's
1582
+ * never does), drawn by the compositor and never parsed as HTML.
1583
+ */
1539
1584
  frame_url?: string;
1540
1585
  /** Flips the frame and the `auto` background. */
1541
1586
  theme?: "light" | "dark";
1542
- /** Cursor scale, 1 by default. */
1587
+ /**
1588
+ * Cursor scale, 1 by default. On a video, 1 is an arrow 48 px tall on a 1080p frame (4.4% of the frame's
1589
+ * short side), about twice a system cursor against the page, as in Screen Studio; it grows with the camera's
1590
+ * zoom. On a screenshot, and with `look: 1`, 1 is the 22 px arrow on the page's scale.
1591
+ */
1543
1592
  cursor_size?: number;
1544
1593
  /** `false` keeps the cursor's size while the camera zooms. */
1545
1594
  cursor_zoom?: boolean;
1595
+ /**
1596
+ * How small the cursor gets when it clicks: it shrinks to this over 70 ms and springs back over 220 ms
1597
+ * after the release, with no overshoot. 0.8 by default; 1 turns it off. A video's only.
1598
+ */
1599
+ cursor_press_scale?: number;
1600
+ /**
1601
+ * The click effect's color. Left out, B3 blue (#2F43FF), and on a video white at 45% where the page under
1602
+ * the click is darker than luma 100 or more saturated than 0.6, such as a blue button, so the ring shows
1603
+ * there (not with `look: 1`). Set, it is that color on every page.
1604
+ */
1546
1605
  click_color?: RenderColor;
1547
1606
  /** How long the click effect lasts, 450 by default. */
1548
1607
  click_duration_ms?: number;
1549
- /** Caption text size in pixels at 1080p, 44 by default. */
1608
+ /**
1609
+ * Caption text size in pixels at 1080p, 34 by default. Each captions preset starts at its own size: 34 for
1610
+ * `default`, 42 for `bold`, 40 for `minimal` and 44 for `light`. A caption's box keeps at least 48 px (at
1611
+ * 1080p) from each side of a video's frame: a cue too wide for that wraps between its words, and a word too
1612
+ * wide for it alone draws that cue smaller (not with `look: 1`).
1613
+ */
1550
1614
  caption_size?: number;
1551
1615
  caption_color?: RenderColor;
1552
- caption_highlight?: RenderColor;
1616
+ /**
1617
+ * The karaoke word being spoken: a color (`RenderColor`: hex, `rgb()` or a CSS color name), or `auto`, the
1618
+ * `default` captions' setting. `auto` takes the color from the video's background: a preset background
1619
+ * of the video set carries its own accent (the image's most characteristic color), any other image or a
1620
+ * gradient gives the most saturated color covering at least 5% of it, and a flat or grey one gives
1621
+ * #9CB0FF. That color is then lightened or darkened, its hue kept, until it reads at 4.5:1 or more
1622
+ * against the caption's box (or the background under the caption when the box is clear), stands 12
1623
+ * or more (CIELAB Delta E) from `caption_color` and, where the words to come are dimmer than the spoken
1624
+ * ones (`caption_upcoming` under 1), is 10 or more points of CIELAB lightness further from the box than
1625
+ * they are, so the word being spoken always stands apart from the words already spoken and is never the
1626
+ * dimmest word in the caption. A color set here is drawn as it is. The color chosen is the same for the whole video and is recorded in the
1627
+ * timeline's `captions.highlight`, so a restyle without a style and a re-export repeat it; a restyle
1628
+ * that brings a style takes the word from that style, `auto` fitted to the background it draws. `bold` lights it in yellow; with `look: 1` the `default` captions light it in
1629
+ * #8B97FF, as before.
1630
+ */
1631
+ caption_highlight?: RenderColor | "auto";
1553
1632
  caption_background?: RenderColor;
1633
+ /**
1634
+ * Where burned-in captions sit for the whole video: `bottom` (the default) or `top`, centred in the caption
1635
+ * band beside the window. A cue never moves; the camera keeps every target it frames, and the cursor, at
1636
+ * least 24 px (at 1080p) clear of the pill instead. With `look: 1` a cue still moves to the other edge when a
1637
+ * step's target sits under it.
1638
+ */
1554
1639
  caption_position?: "bottom" | "top";
1555
- /** Smear the cursor while it moves; on by default. */
1640
+ /**
1641
+ * Karaoke: how bright the words still to come are, as an opacity of `caption_color`; the words already
1642
+ * spoken are `caption_color` and the word being spoken `caption_highlight`. 0.55 for the `default`
1643
+ * captions; 1 for the other presets, which draw the words to come like the spoken ones.
1644
+ */
1645
+ caption_upcoming?: number;
1646
+ /**
1647
+ * Karaoke: how long a word takes to light, from the shade of the words to come to `caption_highlight`,
1648
+ * while the word before it settles to `caption_color`, so the light passes from one word to the next with
1649
+ * no frame where none is lit. Only colors change: the line never moves as words light. 80 for the
1650
+ * `default` captions; 0 (at once) for the other presets.
1651
+ */
1652
+ caption_fade_ms?: number;
1653
+ /**
1654
+ * What a video draws around the caption where the window lies under it: when the camera zooms in until
1655
+ * the page fills the frame, or when the captions sit over the page. `blur`, the default on every preset,
1656
+ * blurs the window's pixels from 120 px (at 1080p) above the caption's box to the frame's edge,
1657
+ * progressively, from nothing to a 16 px blur (a Gaussian's standard deviation, as CSS `blur(16px)`) at
1658
+ * the box's edge and past it, and darkens light content there by up to 6% (dark content not at all), so
1659
+ * text beside, above and below the caption dissolves and is never cut by its edge. The wallpaper, the
1660
+ * caption and the cursor stay sharp; where the caption lies on the wallpaper, as at rest, nothing changes.
1661
+ * The blur keeps its own time: it stays through the pause between two lines on one page when the pause
1662
+ * is 1 s or less and the page lies under the caption at both of its ends, while only the caption fades,
1663
+ * and it fades in and out over 200 ms before the first line, after the last, at a page change and across
1664
+ * a longer pause (the timeline's `captions.backdrop`). `none` leaves the page around the caption as it is.
1665
+ * With `look: 1` there is none.
1666
+ */
1667
+ caption_backdrop?: "blur" | "none";
1668
+ /**
1669
+ * A video's window proportions under the default `padding`. `tall` (the default) gives the window the
1670
+ * height screen recorders give it and the width a desktop page needs: 8% of the frame's height above and
1671
+ * below the window (more on the captions' side when they need it) and, on a landscape frame, 6.5% of the
1672
+ * width at each side, the window never wider than 2:1; at 1920x1080 a 1668x864 window, 80% of the frame's
1673
+ * height, over a 1440x746 default viewport, the page drawn 1.16 times its CSS size. `wide` is the first look
1674
+ * v2 shape: 9% of the frame's long edge on every side, the window as wide as that leaves (1568x734 at
1675
+ * 1920x1080 over a 1440x674 viewport, 2.14:1).
1676
+ */
1677
+ window_shape?: "tall" | "wide";
1678
+ /**
1679
+ * Smear what moves over each frame's shutter, as a camera would: the window, page and background on every
1680
+ * frame of a zoom or pan that moves faster than `motion_blur_onset`, by its motion past it over half a
1681
+ * frame. On by default. Held frames, and frames the camera moves through slowly, stay sharp, exactly as
1682
+ * without it. At the default 60 fps the fastest frames of the default zoom-in soften and a paused one still
1683
+ * reads. A moving cursor stays
1684
+ * a sharp arrow on every frame, over a faint trail behind it of its motion across the shutter, at most three
1685
+ * quarters of the arrow long. With `look: 1` only the cursor's trail shows, as its smear did before.
1686
+ */
1556
1687
  motion_blur?: boolean;
1688
+ /**
1689
+ * How long the shutter stays open, in frames, centered on each frame's time: 0.5 by default (half a frame at the
1690
+ * default 60 fps). 1 is Screen Studio's whole frame (1/60 s at 60 fps), twice as long a smear.
1691
+ */
1692
+ motion_blur_shutter?: number;
1693
+ /**
1694
+ * How fast what the camera shows must move at the frame's edge, on average and with the zoom's own rate,
1695
+ * before the window, page and background smear, in the frame's short sides a second, whatever the frame
1696
+ * rate: 0.45 by default, about 8 px a frame at 1080p and 60 fps, so slower frames stay sharp and a faster one
1697
+ * smears by `motion_blur_shutter` of the motion past it, up to `motion_blur_max`. Read at the edge, a zoom
1698
+ * about the middle of the frame blurs like a zoom into a corner. 0 smears every frame of a move from its first
1699
+ * pixel. The cursor's trail shows its own motion whatever this is.
1700
+ */
1701
+ motion_blur_onset?: number;
1702
+ /**
1703
+ * The longest smear a camera move leaves at the frame's edge, on average, in pixels at 1080p: 6.5 by
1704
+ * default, so the fastest frames of every zoom soften alike (to about a quarter of the sharpness at rest)
1705
+ * and a paused one still reads. 200 lifts the limit.
1706
+ */
1707
+ motion_blur_max?: number;
1708
+ /**
1709
+ * How close to its camera move's top speed a frame must be to smear: 0 by default, no such gate. 0.9 smears
1710
+ * only the two or three fastest frames of a move, as before 11-10.
1711
+ * `{"motion_blur_shutter": 1, "motion_blur_onset": 0, "motion_blur_max": 200}` smears every camera move by the
1712
+ * whole frame, as Screen Studio does.
1713
+ */
1714
+ motion_blur_peak?: number;
1557
1715
  matte?: RenderColor;
1716
+ /**
1717
+ * `1` draws a video in production's look from before 2026-11-11: its frame and layout (`padding`, 64 px at
1718
+ * 1080p by default, on every side, and the default viewport of then, 1440x730 at 1920x1080 in the browser
1719
+ * frame), the captions over the page near the window's foot, the 60% black caption pill, `bold` as 52 px
1720
+ * outlined text, the studio background for `auto`, 14 pixel corners, the old default shadow and a cursor
1721
+ * shown from the start. A new video gets a page-only camera, which zooms the page inside a window that
1722
+ * stands still, capped at 1.6x by default (`max_zoom` sets another; no `background_motion` or
1723
+ * `background_blur`), with today's move timings, and makes the poster the whole window after the last
1724
+ * step. Send it with `"frame": "browser"` to keep a video's old look. With it, `shadow: "soft"` is the old
1725
+ * black two-layer shadow, on a screenshot too. A restyle keeps the camera its video was recorded with, and
1726
+ * draws today's cursor, a sharp arrow over a faint trail, where production stamped copies of it. `2`, the
1727
+ * default, is the current look.
1728
+ */
1729
+ look?: 1 | 2;
1558
1730
  }
1559
1731
  /** Give `url` or `html`. */
1560
1732
  export type ScreenshotCreateRequest = {
@@ -1562,7 +1734,9 @@ export type ScreenshotCreateRequest = {
1562
1734
  url?: string;
1563
1735
  /** HTML to render instead of loading a URL. Rendered with no network access. */
1564
1736
  html?: string;
1565
- /** A vision profile ID or name to load before navigating (with `url` only). */
1737
+ /**
1738
+ * A vision profile ID or name of this project to load before the page loads, to capture it signed in (with `url` only; needs `vision:profiles:use`). A page that is still signed out fails with `profile_expired`.
1739
+ */
1566
1740
  profile?: string;
1567
1741
  viewport?: Viewport;
1568
1742
  /**
@@ -1619,6 +1793,7 @@ export type ScreenshotCreateRequest = {
1619
1793
  quality?: number;
1620
1794
  /** Extra encodings of the same capture, each an artifact. */
1621
1795
  variants?: ScreenshotVariant[];
1796
+ auto_background?: AutoBackgroundOptions;
1622
1797
  metadata?: Metadata;
1623
1798
  };
1624
1799
  export interface ScreenshotVariant {
@@ -1654,7 +1829,7 @@ export interface Screenshot {
1654
1829
  final_url?: string;
1655
1830
  page_state?: ScreenshotPageState;
1656
1831
  /**
1657
- * Non-fatal problems, each starting with a code and a colon: `http_status` (the site answered an error, or a 200 whose title says the page is missing), `blank_main_area` (the main area was still one color after the readiness wait), `still_animating` (content was still fading in when the wait ended), `login_form` (a sign-in form instead of the content), `video_not_shown` (a video or video player in view had no frame to show and its box is empty in the image: a format this browser cannot play, or still loading), `image_not_shown` (a large image in view had not loaded and its box is empty in the image), `content_placeholder` (loading placeholders, the gray skeleton blocks a site draws while its content loads, were still in view), `partial_page` (when the wait ended, the lower part of the first screen was empty or a loading indicator stood alone above the page's footer, and the site had answered 202 or the page still had work under way: the page may not have finished drawing, or may have finished with a spinner left in view), `overlays_kept` (overlays in view with `overlays: "keep"`), `paywall` (a subscription wall covers the content and was left in place), `login_wall` (a registration or sign-in wall covers the content and was left in place), `load_incomplete` (`wait_until: "auto"` took the page before its load event, with how many images and videos in view had not arrived), `text_glyph_missing` (characters of the style's text, frame title or host that no font on the node has, or in a script the compositor does not shape yet, such as Devanagari and Thai; they are left blank), `background_fallback` (the image `background_ref: "auto"` chose could not be loaded within 2 s; the style's own background was drawn).
1832
+ * Non-fatal problems, each starting with a code and a colon: `http_status` (the site answered an error, or a 200 whose title says the page is missing), `blank_main_area` (the main area was still one color after the readiness wait), `still_animating` (content was still fading in when the wait ended), `login_form` (a sign-in form instead of the content), `video_not_shown` (a video or video player in view had no frame to show and its box is empty in the image: a format this browser cannot play, or still loading), `image_not_shown` (a large image in view had not loaded and its box is empty in the image), `content_placeholder` (loading placeholders, the gray skeleton blocks a site draws while its content loads, were still in view), `partial_page` (when the wait ended, the lower part of the first screen was empty or a loading indicator stood alone above the page's footer, and the site had answered 202 or the page still had work under way: the page may not have finished drawing, or may have finished with a spinner left in view), `overlays_kept` (overlays in view with `overlays: "keep"`), `paywall` (a subscription wall covers the content and was left in place), `login_wall` (a registration or sign-in wall covers the content and was left in place), `load_incomplete` (`wait_until: "auto"` took the page before its load event, with how many images and videos in view had not arrived), `text_glyph_missing` (characters of the style's text, frame title or host that no font on the node has, or in a script the compositor does not shape yet, such as Devanagari and Thai; they are left blank), `background_fallback` (the library image the `auto` background or `background_ref: "auto"` chose could not be loaded within 2 s; the style's own background was drawn), `auto_background_pin` (the project's, organization's or node's `auto_background` pin does not clear the page's edges, so `auto` picked another image; it names both).
1658
1833
  */
1659
1834
  warnings?: string[];
1660
1835
  /** What the clean capture hid, by kind and signal, with how many (`overlays`, `block_ads`). */
@@ -1666,6 +1841,7 @@ export interface Screenshot {
1666
1841
  * this page. Absent when the style draws no library background.
1667
1842
  */
1668
1843
  background_ref?: string;
1844
+ auto_background?: AutoBackgroundChoice;
1669
1845
  }
1670
1846
  /**
1671
1847
  * What kind of page the screenshot captured, with vision's `PageState` field names: `ok`; `error` (an error status, signal `status`, or a 200 whose title says the page is missing, signal `title`); `loading` (the main area stayed blank, signal `blank_main_area`, or images or videos in view had not arrived when `wait_until: "auto"` took the page, signal `images_pending`, or skeleton blocks were still in view, signal `placeholders`, or, when the wait ended, the lower part of the first screen was empty or a loading indicator stood alone above the page's footer while the site had answered 202 or the page still had work under way, signal `partial_page`); `login` (a sign-in form instead of the content, signal `password_form`, or a registration or sign-in wall over it, signal `login_wall`); `paywall` (a subscription wall over the content, signal `paywall`; render's own state, as vision reads the HTML and has none); `cookie_wall` (a consent overlay left in view with `overlays: "keep"`). A wall is kept in the image, never hidden. A challenge or block page is not a screenshot: it fails with 502 `capture_failed` and reason `bot_challenge`.
@@ -1743,8 +1919,9 @@ export interface StepType {
1743
1919
  target?: Target;
1744
1920
  text: string;
1745
1921
  /**
1746
- * Delay between characters on the video's clock.
1747
- * @default 80
1922
+ * Delay between characters on the video's clock. Left out, 35 ms: quick, steady typing, which reads well
1923
+ * on screen. The camera holds one shot on the field for the whole burst (`camera.typing_zoom`).
1924
+ * @default 35
1748
1925
  */
1749
1926
  interval_ms?: number;
1750
1927
  }
@@ -1789,7 +1966,9 @@ export interface Beat {
1789
1966
  export interface VideoSource {
1790
1967
  /** Where the recording starts. */
1791
1968
  url: string;
1792
- /** A vision profile ID or name to start signed in. Responses show the resolved `prof_` ID. */
1969
+ /**
1970
+ * A vision profile ID or name of this project to record signed in: loaded into the probe and every capture segment (needs `vision:profiles:use`). Responses show the resolved `prof_` ID. A page that opens still signed out fails the video with `profile_expired`.
1971
+ */
1793
1972
  profile?: string;
1794
1973
  }
1795
1974
  export interface VoiceSpec {
@@ -1802,8 +1981,7 @@ export interface VoiceSpec {
1802
1981
  }
1803
1982
  export interface CaptionOptions {
1804
1983
  /**
1805
- * `none`: sidecar files only. `static` (the default): draw each cue, as a small pill near the foot of the frame that moves to the top while a step clicks what it would cover. `karaoke`: also highlight the spoken word.
1806
- * @default "static"
1984
+ * `none`: sidecar files only. `static`: draw each cue as a small pill in the margin under the window, which grows to hold it, on one line when that fits and `max_chars_per_line` and `max_lines` are left out. When the captions are too large for the margin, every cue sits over the page near its foot instead, and moves to the top while a step clicks what it would cover. `karaoke`: the same, with the words in step with the narration: on the default pill the words already spoken are white, the word being spoken is lit in a light B3 blue and the words to come are dimmed, each word lighting over 80 ms. A cue stays up until 0.2 s after its last word and 0.3 s after the last step of its beat is done; one still up when a click loads a new page ends 0.1 s after that page first shows, or 0.2 s after its last word when that is later. Left out: `karaoke` when the video is narrated, `static` when it is silent (`voice: null`, or a key without `infer:run`), whose word times are only estimated.
1807
1985
  */
1808
1986
  burn_in?: "none" | "static" | "karaoke";
1809
1987
  /** @default ["vtt"] */
@@ -1818,6 +1996,11 @@ export interface CaptionOptions {
1818
1996
  export interface VideoOutput {
1819
1997
  width: number;
1820
1998
  height: number;
1999
+ /**
2000
+ * Frames per second of the video. The page is captured at 30 frames a second and the camera, cursor and
2001
+ * captions are drawn at this rate; while the page scrolls, a 60 fps video captures it at 60, once per output
2002
+ * frame (the timeline's `capture.stride` and `capture.full_rate`).
2003
+ */
1821
2004
  fps: 24 | 25 | 30 | 50 | 60;
1822
2005
  }
1823
2006
  export type VideoFormat = "mp4" | "gif" | "poster";
@@ -1834,39 +2017,310 @@ export interface VideoCreateRequest {
1834
2017
  voice?: VoiceSpec | null;
1835
2018
  captions?: CaptionOptions;
1836
2019
  /**
1837
- * The look. Leave it out for the B3OS look in a browser window (`{"frame": "browser"}`); `{}` is the look
1838
- * without a window frame.
2020
+ * The look. Leave it out, or send `{}`, for the B3OS look on the bare rounded window, with no bar;
2021
+ * `{"frame": "window"}` adds the traffic lights on a slim bar in the page's top color, and `{"frame":
2022
+ * "browser"}` an address pill.
1839
2023
  */
1840
2024
  style?: RenderStyle;
2025
+ /**
2026
+ * How the camera follows the steps. The camera moves over the whole frame: as it zooms in, the window, its
2027
+ * shadow and the page grow together and the background and the window's edges leave the frame, while
2028
+ * captions stay where they are. By default (`framing: subject`) each page is held in one of three
2029
+ * compositions: the whole window, the page's main content area, or one panel (see `framing`). With
2030
+ * `framing: point`, before a click, select or typing step it zooms in on the element and stays in through
2031
+ * the whole step (a type until its last key), for 1.5 s at least; it stays in for the next step when that
2032
+ * one starts within 2.5 s, or is close by, and pans only when the next element nears the edge of the frame,
2033
+ * and only as far as brings it back in. Every move is one quick, damped spring with no overshoot:
2034
+ * a zoom in or out takes 0.6 s (the first zoom-in less when the first step comes in under 1.1 s); a move to
2035
+ * the next element sets off with the cursor, never before it, and takes longer the farther it goes, so the
2036
+ * middle of the frame moves at most 60 px a frame at 60 fps, or faster where that keeps the cursor 8% of
2037
+ * the frame inside its edges. An element near an edge of the window zooms with that edge held in place, so
2038
+ * the margin beside it stays in view, and where the whole window or page fits the frame, it stays whole,
2039
+ * with the room beside it split evenly when there is little to spare. The camera rests 1.5 s at least on
2040
+ * what it shows last before it zooms out, when the video has room before its end, and the last zoom holds
2041
+ * until the narration line about it has nearly ended. The video opens on the whole window
2042
+ * for half a second at least and ends on it for a second at least, so it can run a little past the last
2043
+ * beat.
2044
+ */
1841
2045
  camera?: {
1842
2046
  /**
1843
- * Zoom toward the element each step acts on.
1844
- * @default true
2047
+ * `auto` moves the camera. With `framing: subject`, the default, its zooms are its compositions' (see
2048
+ * `framing`) and what follows holds where it says so. With `framing: point` it zooms so the element and a
2049
+ * little around it fill about 45% of the frame width, from 1.25x up to `max_zoom`, and 1.25x on an
2050
+ * element in a nav, aside or header bar, where the change it causes is
2051
+ * usually elsewhere on the page. A zoom under 1.4x is not worth the move: the camera stays wide for it
2052
+ * (a nav element starting a session, a typing shot under 1.4x), and an element inside a zoomed session
2053
+ * that would zoom less is framed at the session's zoom. After a move lands, the next waits 1.2 s at
2054
+ * least: an element that comes sooner is framed with the one before it when both fit one view at 1.4x
2055
+ * or more, else the camera stays where it is for the earlier one and moves once, to the later one. With
2056
+ * `scroll: comfortable` the view changes (camera moves and page scrolls together) at most once per 2.5 s
2057
+ * on average over the video: over that, the move with the least change of zoom whose element was
2058
+ * already in view is left out, and the element is framed where the camera stands. A
2059
+ * re-centre under 96 px at 1080p is left out. A click that loads a new page ends the zoom: the camera
2060
+ * starts going wide 0.1 s after the new page first shows, also when the page's address changes only by
2061
+ * the next step. On a portrait frame the camera zooms at most as far as keeps the whole window across the
2062
+ * frame, and the 1.4x floor applies after that, so a portrait video stays on the whole window and only
2063
+ * its page scrolls. Held against one window edge, a view keeps a window edge on the other axis that shows
2064
+ * in the frame at its resting margin. With burned-in captions every element the camera frames, and the
2065
+ * cursor resting by it, stays at least 24 px (at 1080p) clear of the caption pill, and a zoomed hold keeps
2066
+ * the window's bottom edge where it rests, so the pill sits on the background under it, whenever the
2067
+ * element ends at least 20 px above that edge and starts at least 120 px below the frame's top; otherwise
2068
+ * the pill lies over the page. A hold never leaves the window's bottom edge between y 960 and 1080 at
2069
+ * 1080p: it moves it to 950 or below the frame. With both framings the 1.2 s between moves, the 2.5 s
2070
+ * budget, the click that loads a new page and the portrait limit hold. The pill never moves. `subtle` makes the same moves at 1.25x (its zooms
2071
+ * are kept, under 1.4x). `off` keeps the whole window in view.
2072
+ * @default "auto"
2073
+ */
2074
+ style?: "auto" | "subtle" | "off";
2075
+ /**
2076
+ * The older spelling of `style`: `false` is `off`, `true` is `auto`. Send `style` instead. A request
2077
+ * whose `auto_zoom` and `style` disagree is refused with `invalid_request`.
2078
+ * @deprecated
1845
2079
  */
1846
2080
  auto_zoom?: boolean;
1847
- /** @default 2 */
2081
+ /**
2082
+ * The most the camera zooms, never exceeded. A small button reaches it; a wide element zooms less, so it
2083
+ * fits. Left out, the camera zooms up to 1.7x, or to the zoom within 10% of it where one captured pixel
2084
+ * lands on one output pixel (1.73x on the default canvas and viewport, two output pixels per CSS pixel;
2085
+ * 1.84x with `window_shape: wide`), so zoomed text is as sharp as the page. Left out, it never magnifies
2086
+ * the page past three output pixels per CSS pixel at 1080p, so a phone layout on a portrait video, drawn
2087
+ * at about twice its size, zooms about 1.4x. Above that the zoom enlarges the capture, and text is a
2088
+ * little softer. The zoom magnifies the whole frame, window and page alike. With `look: 1`, left out
2089
+ * it is 1.6, production's cap, which lands at 1.61x, one to one, on that look's default canvas, and
2090
+ * the zoom magnifies the page inside the window.
2091
+ * @default 1.7
2092
+ */
1848
2093
  max_zoom?: number;
2094
+ /**
2095
+ * How far the background follows the window as the camera moves: 0 holds it still, 1 moves and zooms
2096
+ * it with the window, so the whole frame zooms as one. At the default it moves and zooms a tenth as
2097
+ * much, a slight depth behind the window.
2098
+ * @default 0.1
2099
+ */
2100
+ background_motion?: number;
2101
+ /**
2102
+ * Blur the background: an image background is drawn 4 px soft on the whole window (at 1080p, scaled
2103
+ * with the frame), so the window stays the busiest thing in the frame, and softens further as the camera
2104
+ * zooms in, about 7 px at 1.6x on a 1080p video, at most 16 px. `false` keeps it sharp throughout, and
2105
+ * `overrides.look: 1` draws it sharp at rest. Left out, it is on for an image background (the default
2106
+ * look's library images among them) and off for gradients, solid colors and patterns, where a blur shows
2107
+ * little or erases the pattern. Gradients, solid colors and patterns are never blurred at rest. It is
2108
+ * decided before the first frame, so a default video drawn on its studio fallback (no library image
2109
+ * clears the page's edges, or the image could not be loaded) blurs that mesh as the camera zooms; send
2110
+ * `false` to keep it sharp.
2111
+ */
2112
+ background_blur?: boolean;
2113
+ /**
2114
+ * The zoom of a typing shot: a field typed into (a `type` step, or a click a `type` without a target
2115
+ * follows) is framed from its start at this zoom, reached by the first key (the cursor gets there half a
2116
+ * second early) and held for the whole
2117
+ * burst, with no move per key; a click right after it on something already in view stays in the
2118
+ * same shot.
2119
+ * It is never less than the camera's least zoom, 1.25x, which is what 1 gives, never more than
2120
+ * `max_zoom`, nor more than the zoom where the page is as sharp as captured (1.73x on the default
2121
+ * canvas), so the default types at 1.73x. `style: subtle` keeps its own ceiling, and a field in a nav,
2122
+ * aside or header bar its own zoom. With `framing: subject` a field typed into is a DETAIL when it
2123
+ * qualifies (see `framing`), at this zoom at most, and otherwise held in the page's main content area.
2124
+ * @default 2
2125
+ */
2126
+ typing_zoom?: number;
2127
+ /**
2128
+ * What the camera holds. `subject` (the default) holds each page in one of three compositions. The
2129
+ * whole window. MAIN, the page's main content area across the frame: the content box of its `main` (or
2130
+ * `role="main"`) element when that is wider than half the viewport, else the viewport less a fixed or
2131
+ * sticky sidebar or header bar, with 24 CSS px each side, from 1.25x up to `max_zoom` (1.42x on the B3OS
2132
+ * console); a page with neither has no MAIN and is held on the whole window, where the first element a
2133
+ * step acts on or the narration names is a DETAIL whatever the length of its line (an element with no
2134
+ * enclosing panel framed by its own box), an element that DETAIL shows stays in it, and a page's DETAILs
2135
+ * come at most one per 4 s. DETAIL, one panel or control:
2136
+ * the nearest enclosing element that draws a box of its own (a background, a border, a shadow or
2137
+ * rounded corners) or is a section, article, main, form, table, list, dialog or region, at least 240 x
2138
+ * 120 CSS px or 1.3 times the element on both axes, or the element's own row when that panel is too wide
2139
+ * for 1.4x, at up to `max_zoom`, only when it is narrower than 45% of MAIN's view, its narration line (or
2140
+ * its typing) lasts 2 s or more from the step, it zooms at least 1.1x MAIN's zoom, and its view keeps the
2141
+ * window's bottom edge where it rests or holds the element above the caption band. A page opens on the
2142
+ * whole window, goes to MAIN at its first step or narrated element, may go to a DETAIL (held through its
2143
+ * line) and back, goes from one DETAIL to another only within 40% of the frame's width, and goes wide
2144
+ * again only at a click that loads a new page or at the end; an element outside MAIN across, such as a
2145
+ * sidebar link, is reached wide. MAIN keeps the window's bottom edge where it rests, the caption pill on
2146
+ * the background under it; for a beat whose element lies above that view, or whose label starts less than
2147
+ * 24 CSS px under that view's top edge, its top is the window's top,
2148
+ * the pill over the page, and a page moves between the two at most once, in one 0.4 s vertical move (it
2149
+ * stays top-anchored when its elements would need more). A click that loads a new path starts a new page,
2150
+ * which takes its own position as it first shows: where the camera holds MAIN across the click at one
2151
+ * zoom, it cuts there with the page, with no move. Where page content lies under the captions, no
2152
+ * element the camera frames, no typed text and no resting cursor sits within 120 px (at 1080p) above the
2153
+ * pill's top. A DETAIL's view is placed by its panel, never by the click: centred on it, or from 24 px
2154
+ * left of its left edge when it is wider than the view, with the element and the cursor kept 24 px
2155
+ * inside, and an edge that would cut a neighbouring panel moves to the gap beside it when that is within
2156
+ * 20% of the frame's width. A hover the narration speaks over, and an element a `wait` step waits for (by
2157
+ * `for.selector` or `for.text`) while a line is spoken, are followed too, a wait only when no click,
2158
+ * hover, select or typing follows it in its beat; the first such element of a line is in view from 0.3 s
2159
+ * before the line starts, and so is an element waited for after clicks in its line that all land inside
2160
+ * it, once a scroll before it has landed. A click that opens a beat after the first lands 0.3 s after its
2161
+ * line starts, the cursor setting off in the pause before the line, and an element waited for after it is
2162
+ * that line's element; a `wait` for a heading names its section's first panel. The closing zoom-out starts
2163
+ * at least 1.2 s after the last narrated element is shown. After a click that loads a new page, the first
2164
+ * element waited
2165
+ * 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
2166
+ * the new page first shows, or, still in MAIN on the page the click left at the same zoom, cuts to it as
2167
+ * it first shows, and holds until 0.8 s after its line ends, and the video leaves
2168
+ * room for that; without one, the camera goes wide 0.1 s after the new page first shows. The recorder measures each element's panels and the
2169
+ * page's main content box as its step runs (`observed.subject` in the timeline). `point` frames the click
2170
+ * point, at the zoom that fits the element, and leaves hovers and waits to the cursor, as before. With
2171
+ * `look: 1` the camera frames the point.
2172
+ * @default "subject"
2173
+ */
2174
+ framing?: "subject" | "point";
1849
2175
  };
2176
+ /**
2177
+ * How the page scrolls to what a step acts on or waits for. `comfortable`: an element outside the middle of
2178
+ * the viewport (8% to 85% of its height) scrolls its panel (see `camera.framing`) to the middle, its top at
2179
+ * 20% when the panel is taller than 40% of the viewport, else centred at 45%, the element kept in that band,
2180
+ * and up to 24 px further so the viewport's edges fall between lines of text: before the cursor sets off
2181
+ * 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
2182
+ * with its fastest moment at its middle, and lands 0.3 s before), and as a waited-for element appears. A
2183
+ * 60 fps video captures its page once per output frame while it scrolls (at 30 fps elsewhere), so the page
2184
+ * moves a little every frame. A scroll always runs its whole length: the step and the rest of its beat wait
2185
+ * for it. A scroll that brings in the element a narration line names runs in the pause before the line and
2186
+ * ends by its start (0.3 s before it when there is room); when the pause is shorter than the scroll, the line
2187
+ * and everything after it wait for it, 0.8 s at most. Before the scrolls are planned step by step, a page
2188
+ * whose elements all show in the camera's view at one scroll position scrolls once, to that position, in the
2189
+ * pause before the first line that needs it, and never again. A scroll that serves a later beat runs before
2190
+ * that beat. An element already in
2191
+ * the band never scrolls the page, and while the camera is zoomed, an element whose panel the viewport
2192
+ * shows whole is reached by moving the camera (`framing: "point"`); with the default framing the camera
2193
+ * holds the page's view instead, so the scroll is left out only when that view already shows the panel
2194
+ * whole above the caption. The page never goes up and back down: of two scrolls in
2195
+ * opposite directions within 4 s that move it on by less than 25% of their total, one or both are left out
2196
+ * whenever the steps they serve stay in the viewport without them, or the two become one scroll to a position
2197
+ * that keeps them all in view (a step's element is never left out of the viewport); when neither works, both
2198
+ * run at their whole length, and `result.warnings` and the timeline's `warnings` have `scroll_round_trip`. A
2199
+ * scroll for an element in a sticky box is left out when it can be. A scroll never runs
2200
+ * during a camera move (it ends 0.1 s before one starts, or starts 0.1 s after one lands; a zoom-out waits
2201
+ * for the scroll that brings a waited-for element), a scrolled result stays put 1.2 s, and a narration line
2202
+ * scrolls the page once. Before the closing zoom-out a scrolled page goes back to the top whenever the last
2203
+ * 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
2204
+ * result with a `wait` step
2205
+ * (`for.selector` or `for.text`) and the camera brings it into view. `minimal` scrolls only an
2206
+ * element outside the viewport, to its middle, as before. `off` moves the page only by the script's own
2207
+ * `scroll` steps: a step whose element is outside the viewport fails as one whose element is not found. With
2208
+ * `look: 1` the page scrolls as `minimal`.
2209
+ * @default "comfortable"
2210
+ */
2211
+ scroll?: "comfortable" | "minimal" | "off";
2212
+ /**
2213
+ * How the cursor moves. It shows from the first frame, with no fade-in, parked on the first of six spots
2214
+ * that is plain on the video's first frame and on its frame just before the cursor first moves, as
2215
+ * captured, and clear of text, controls and images on the page just before the first step: right of
2216
+ * and below the middle of the page (62% across, 68% down), near its bottom right (88%, 88%), low in the
2217
+ * middle (50%, 92%), at its right edge (92%, 50%), in its bottom-right corner (96%, 96%) or at the middle
2218
+ * of its bottom edge (50%, 97%); the page gets no pointer event until the cursor's first move has ended, so
2219
+ * nothing on it is hovered from the first frame or on the cursor's way to its first target. Each move settles smoothly, the way Screen Studio's smoothed cursor
2220
+ * does, and lands when it would have; after a click, a select or the first key typed into a field, the
2221
+ * cursor moves just off the element, so it never covers its label or the text being typed while the camera
2222
+ * holds. After a hover, and while typing, it rests where its arrow covers no text, badge or control and
2223
+ * stays at least 8 px inside the page: below and right of the hovered label's own text (of the hovered
2224
+ * point on a target wider than 400 px whose text runs as wide, such as a table row), else right of it,
2225
+ * else another spot that keeps the arrow's tip within 24 px of the label (a table's header cells count as
2226
+ * text); while typing, under the field, beside
2227
+ * it or above it, else another spot within 24 px of it, else inside it past the end of the typed text. A
2228
+ * hover's rest is checked again on the captured page as the cursor sets off for it: where its arrow would
2229
+ * lie on text there, it rests at the first clear spot beside, below or above the element (or on the
2230
+ * element itself), the least busy one when none is clear.
2231
+ * When the page scrolls under the resting cursor, it stands still while the page moves, then, 150 ms
2232
+ * after the scroll ends, moves once off what it landed on, across it (under or above a label, beside a
2233
+ * tall box) up to 64 px, else up to 40 px to the nearest spot clear of what scrolled there; it stays when
2234
+ * that spot is under 24 px away. Still for 2 s, it fades out, and it fades back in before its next move. It never tilts. A restyle keeps the path its video was recorded with; `look: 1`
2235
+ * moves it as before (hidden until it fades in at the middle before its first move).
2236
+ */
2237
+ cursor?: {
2238
+ /**
2239
+ * How long each move takes to settle: the remaining distance falls to about a third of itself every
2240
+ * 100 ms near the end at the default. 0 keeps the eased path without smoothing.
2241
+ * @default 100
2242
+ */
2243
+ smoothing_ms?: number;
2244
+ /**
2245
+ * Still this long, the cursor fades out over 0.4 s, and it fades back in over 0.3 s before its next
2246
+ * move; still to the end of the video, it stays hidden. 0 never hides it; under 500 counts as 500.
2247
+ * @default 2000
2248
+ */
2249
+ hide_after_ms?: number;
2250
+ /**
2251
+ * After a click, a select or the first key typed into a field, move the cursor just below the element
2252
+ * (above it near the bottom of the page) when the next move can wait for it. A hover never moves off.
2253
+ * @default true
2254
+ */
2255
+ move_aside?: boolean;
2256
+ };
2257
+ /**
2258
+ * The page's CSS size. Left out, 1440 px wide on a landscape frame and 430 on a portrait one, as tall as the
2259
+ * window's shape; a square or near-square frame (no wider than 4:3) gets about its window's width, so its page
2260
+ * is drawn at least one pixel per CSS pixel at rest.
2261
+ */
1850
2262
  viewport?: Viewport;
1851
2263
  output?: VideoOutput;
1852
2264
  /** @default ["mp4","poster"] */
1853
2265
  formats?: VideoFormat[];
1854
2266
  /** Seeds the page's randomness so a re-render is identical. */
1855
2267
  seed?: number;
1856
- /** The page's `Date` at the start of the video; the clock then advances with the video. */
2268
+ /**
2269
+ * The page's `Date` at the start of the video; the clock then advances with the video. Left out, it is the job's creation time, the same as `created_at`, so the page shows when the video was made. `result.start_time` gives the value used. Send it back in the same request with `recording.reuse` to replay the same recording on the same clock while it is kept; without `recording.reuse` the site is loaded again, so a page that changed shows the change.
2270
+ */
1857
2271
  start_time?: string;
1858
2272
  recording?: RecordingOptions;
2273
+ auto_background?: AutoBackgroundOptions;
1859
2274
  webhook?: WebhookConfig;
1860
2275
  metadata?: Metadata;
1861
2276
  }
2277
+ /**
2278
+ * How the default `background: auto` picks its library image, for this request. Each field overrides the
2279
+ * project's, then the organization's, then the node's setting. By default the node keeps one pick per
2280
+ * organization and site (the page's registrable domain, such as `linear.app` for `app.linear.app`; the host for
2281
+ * `localhost` and IP addresses): the vision model's first pick for a site is kept, and later videos and
2282
+ * screenshots of the site draw the same image while it clears their page's edges. A color-rules pick is not
2283
+ * kept, so the site's next video or screenshot asks the model again.
2284
+ */
2285
+ export interface AutoBackgroundOptions {
2286
+ /**
2287
+ * Draw this library image instead of picking one (an image `auto` could pick: in an auto pack, as `GET /v1/render/backgrounds` lists them), on any page. Another value is refused with 422 `invalid_request` at `/auto_background/pin`. A project's, organization's or node's pin is drawn on pages whose edges its image clears; on another page `auto` picks instead and `warnings` names the pin (`auto_background_pin`), and when no image of the set clears that page either, the pin is drawn after all.
2288
+ */
2289
+ pin?: string;
2290
+ /**
2291
+ * Ask the model again for this site and keep its answer in place of the one kept. Where the vision model is off (the node's setting, or `vision: false`), it makes no call and the color rules pick.
2292
+ * @default false
2293
+ */
2294
+ repick?: boolean;
2295
+ /**
2296
+ * `false`: pick with the color rules alone, without the vision model or the site's kept pick. Default: the project's, the organization's or the node's setting (on where the node has the model). `true` does not turn the model on where the node has turned it off.
2297
+ */
2298
+ vision?: boolean;
2299
+ }
2300
+ /**
2301
+ * The library image the default `background: auto` drew and how it was chosen. Absent when the style draws another background, or when the image could not be loaded in time (`background_fallback`).
2302
+ */
2303
+ export interface AutoBackgroundChoice {
2304
+ ref: string;
2305
+ /**
2306
+ * `vision`: the vision model chose it among the images that clear the page's edges. `heuristic`: the color rules chose it (vision off or unavailable, an `html` source, the model did not answer in time, or one image clears); it is not kept. `pinned`: `auto_background.pin` named it, or a project, organization or node setting did, where its image clears the page's edges or no image of the set clears them. `stored`: the pick kept for this site.
2307
+ */
2308
+ chosen_by: "vision" | "heuristic" | "pinned" | "stored";
2309
+ /** The site the pick is kept under. Absent for an `html` source. */
2310
+ key?: string;
2311
+ /** The model's one-line reason (`vision`), or why the color rules chose (`heuristic`). */
2312
+ reason?: string;
2313
+ }
1862
2314
  /**
1863
2315
  * Where the page's network traffic comes from. By default every video loads the site live and records that
1864
2316
  * load (its capture segments replay the recording, so they all see the same content). With `reuse: true` the
1865
2317
  * video replays the newest recording another video of this project made of the same source URL, steps,
1866
2318
  * viewport, seed and start time within `max_age_s`, instead of loading the site again: faster, and the
1867
- * content is what the site served then. When no such recording exists the site is loaded and recorded as
1868
- * usual. `result.recording` says which happened. Recordings hold the page's responses; they are deleted
1869
- * 24 hours after they were made, or earlier with the last video that used them.
2319
+ * content is what the site served then. Videos without `start_time` match each other, and the replay runs on
2320
+ * the clock the recording was made on, so the page shows that time. A video that sends back such a video's
2321
+ * `result.start_time` replays that recording too. When no such recording exists the site is loaded and
2322
+ * recorded as usual. `result.recording` says which happened. Recordings hold the page's
2323
+ * responses; they are deleted 24 hours after they were made, or earlier with the last video that used them.
1870
2324
  */
1871
2325
  export interface RecordingOptions {
1872
2326
  /** @default false */
@@ -1918,6 +2372,10 @@ export interface VideoResult {
1918
2372
  width: number;
1919
2373
  height: number;
1920
2374
  fps: number;
2375
+ /**
2376
+ * The page's clock at the start of the video: the request's `start_time`, or the job's `created_at` when it had none (with `recording.reuse`, a replayed recording's own clock). Sent back as `start_time` with `recording.reuse`, the same request replays a recording made on that clock while one is kept, so the content and clock are the same; without `recording.reuse` the site is loaded again. A restyle repeats its source's. Absent on videos made before this field, and on a restyle of one whose `start_time` is not an RFC 3339 date and time.
2377
+ */
2378
+ start_time?: string;
1921
2379
  /**
1922
2380
  * The MP4 first (when asked for), then the poster, the caption files, the GIF and, when a beat has a title, the chapters file.
1923
2381
  */
@@ -1925,9 +2383,10 @@ export interface VideoResult {
1925
2383
  recording?: RecordingInfo;
1926
2384
  narration?: NarrationInfo;
1927
2385
  /**
1928
- * Non-fatal problems, each starting with a code and a colon: `narration_scope` (the beats' `say` lines were not spoken because the key lacks `infer:run`, which narration needs; the video has no narration track); `page_requests` (requests for the page's code, styles or fonts, or for its own site's data, made while the video was captured, were not in the network recording made when it loaded, so they failed and the video can show a page that did not finish loading; up to three are named, without their query; trackers, beacons and prefetches that fail the same way are not counted); `zoom_soft` (the page drew differently between two parts of the capture and the video could not be captured again whole, so from the time it names on the video comes from a lower device scale and its zooms are softer than the page). A restyle repeats its source's. Absent when there is nothing to say.
2386
+ * Non-fatal problems, each starting with a code and a colon: `narration_scope` (the beats' `say` lines were not spoken because the key lacks `infer:run`, which narration needs; the video has no narration track); `page_requests` (requests for the page's code, styles or fonts, or for its own site's data, made while the video was captured, were not in the network recording made when it loaded, so they failed and the video can show a page that did not finish loading; up to three are named, without their query; trackers, beacons and prefetches that fail the same way are not counted); `zoom_soft` (the page drew differently between two parts of the capture and the video could not be captured again whole, so from the time it names on the video comes from a lower device scale and its zooms are softer than the page); `background_fallback` (the library image the `auto` background or `background_ref: "auto"` chose could not be loaded in time; the video was drawn on the studio pick, or the style's own background, and a restyle tries again); `scroll_round_trip` (the steps make the page scroll down and back up, or up and back down, within 4 s and no one scroll position shows every element they act on, so the video runs both scrolls; the timeline's `warnings` has the code too); `auto_background_pin` (the project's, organization's or node's `auto_background` pin does not clear the first frame's edges, so `auto` picked another image; it names both). A restyle repeats its source's, except `background_fallback`, which it decides again, and `auto_background_pin`, which it repeats only when it draws the source's image again (a restyle that picks the background again says its own, and one that draws another background says none). Absent when there is nothing to say.
1929
2387
  */
1930
2388
  warnings?: string[];
2389
+ auto_background?: AutoBackgroundChoice;
1931
2390
  }
1932
2391
  /**
1933
2392
  * Present when the request has `voice` and at least one beat has `say` (a restyle repeats its source's).
@@ -1989,7 +2448,7 @@ export interface RenderTimeline {
1989
2448
  };
1990
2449
  capture: {
1991
2450
  /**
1992
- * Page capture rate. Capture frame seq is taken at virtual time t(seq) = round(seq * 1e6 / fps) us.
2451
+ * Page capture clock. Capture frame seq is taken at virtual time t(seq) = round(seq * 1e6 / fps) us (with stride, only the seqs it takes).
1993
2452
  * @default 30
1994
2453
  */
1995
2454
  fps: number;
@@ -2011,14 +2470,22 @@ export interface RenderTimeline {
2011
2470
  */
2012
2471
  segments?: number;
2013
2472
  /**
2014
- * Device scale factor of the capture (ARCHITECTURE 5.2, orchestrator decision D1): 1 or 2 for every segment, or auto: segments whose zoom plan goes past about 1.2x are captured at 2, the rest at 1. segment_dsf records what each segment got.
2473
+ * Device scale factor of the capture (ARCHITECTURE 5.2, orchestrator decision D1): 1 or 2 for every segment, or auto: segments whose zoom plan goes past about 1.2x are captured at 2, the rest at 1, or, in look v2, at the video's rest scale (its page layer's output pixels per CSS pixel rounded up to a thousandth, 1.159 on the default 1920x1080 canvas), so the whole window is the capture drawn one to one, and a zoom at 2 (a node may capture a zoom at the least of 1.5, 1.75 and 2 that its frames need, never enlarged); a closing shot on the whole window shorter than 2 s right after a zoom is captured with it. segment_dsf records what each segment got.
2015
2474
  * @default "auto"
2016
2475
  */
2017
2476
  dsf?: 1 | 2 | "auto";
2018
2477
  /**
2019
- * The device scale factor each segment was captured at (index = segment number), written when the capture is planned; a restyle from the archived capture reads it instead of inferring it from image sizes. A page image larger than the page layer by more than 4/3 is box-halved by the compositor before resampling.
2478
+ * The device scale factor each segment was captured at (index = segment number), written when the capture is planned; a restyle from the archived capture reads it instead of inferring it from image sizes. 1 or 2, or a scale between them in thousandths: a rest scale (1.159) for the segments of a look v2 video that do not zoom, 1.5 or 1.75 for a look v2 zoom that needs no more where the node captures zooms at a mid scale; timelines written before 2026-11-11 hold only 1 and 2. A page image larger than the page layer by more than 4/3 is box-halved by the compositor before resampling; one up to 3 pixels larger (a rest-scale capture) is cut to the layer and drawn one to one.
2479
+ */
2480
+ segment_dsf?: number[];
2481
+ /**
2482
+ * Look v2 (2026-11-11): outside full_rate, only the capture seqs that are a multiple of stride are taken (captured and drawn); every output frame shows the latest taken seq at or before its time. A video whose page scrolls runs its capture clock (fps) at the output rate with stride 2 (60 over the node's 30), so its scrolls are captured once per output frame and the rest of it at 30 fps as before. Absent: every seq is taken.
2020
2483
  */
2021
- segment_dsf?: Array<1 | 2>;
2484
+ stride?: number;
2485
+ /**
2486
+ * Capture seq ranges [from, to) taken at the full fps whatever the stride: each page scroll from one frame before it starts to one after it lands.
2487
+ */
2488
+ full_rate?: number[][];
2022
2489
  };
2023
2490
  /** Composed video. Output frame index i is presented at t = round(i * 1e6 / fps) us. */
2024
2491
  output: {
@@ -2044,10 +2511,29 @@ export interface RenderTimeline {
2044
2511
  captions?: RenderTimelinePresetRef;
2045
2512
  click_effect?: RenderTimelinePresetRef;
2046
2513
  /**
2047
- * Style fields that override the presets, validated by b3os-compose against its Style type (NOTES/render-compose.md 1.1): padding, corner_radius, shadow, border, background_color, background_gradient, background_ref, background_tokens, aspect_ratio, canvas, fit, frame_title, frame_url, theme, cursor_size, cursor_zoom, click_color, click_duration_ms, caption_size, caption_color, caption_highlight, caption_background, caption_position, motion_blur, matte, text, perspective, perspective_intensity, camera, tilt_x, tilt_y, roll, camera_offset, frame_scale, depth_blur, depth_blur_type, depth_blur_angle, depth_blur_position, depth_blur_band, depth_blur_width, layout (these sixteen for screenshots only). Unknown keys and bad values are refused with 422 style_invalid.
2514
+ * Style fields that override the presets, validated by b3os-compose against its Style type (NOTES/render-compose.md 1.1): padding, corner_radius, shadow, border, background_color, background_gradient, background_ref, background_tokens, aspect_ratio, canvas, fit, frame_title, frame_url, theme, cursor_size, cursor_zoom, cursor_press_scale, click_color, click_duration_ms, caption_size, caption_color, caption_highlight, caption_background, caption_position, caption_upcoming, caption_fade_ms, caption_backdrop, window_shape, motion_blur, motion_blur_shutter, motion_blur_onset, motion_blur_peak, matte, text, perspective, perspective_intensity, camera, tilt_x, tilt_y, roll, camera_offset, frame_scale, depth_blur, depth_blur_type, depth_blur_angle, depth_blur_position, depth_blur_band, depth_blur_width, layout (these sixteen for screenshots only), look. Unknown keys and bad values are refused with 422 style_invalid.
2048
2515
  */
2049
2516
  overrides?: Record<string, unknown>;
2050
2517
  };
2518
+ /**
2519
+ * The default look the video was drawn in: version 2 (2026-11-11: a library image behind the page, the bare rounded window with no bar, 22 px corners on 1080p, the layered shadow, the tall window: 8% of the frame's height above and below it and 6.5% of a landscape frame's width at each side). Absent on a timeline from before it, whose restyle without a style draws production's look of then: its style (`{"frame": "browser"}` when it names none), a 64 px margin at 1080p, the captions over the page, the 60% black pill, the studio mesh it drew, 14 px corners and the contact and ambient shadow pair; the cursor is today's, a sharp arrow over a faint trail.
2520
+ */
2521
+ look?: {
2522
+ version: 2;
2523
+ /**
2524
+ * The library image `background: auto` picked from the first frame (also in `style.overrides.background_ref`). A restyle without a style loads it again the way `auto` does: if it cannot be had in time, the studio pick and a `background_fallback` warning, never a failed job.
2525
+ */
2526
+ background_pick?: string;
2527
+ /**
2528
+ * How the first frame chose the image `background: auto` drew: by the vision model among the images that clear the page's edges, by the color rules, pinned by an option, or the pick kept for the site (`key`, the page's registrable domain).
2529
+ */
2530
+ background_choice?: {
2531
+ ref: string;
2532
+ chosen_by: "vision" | "heuristic" | "pinned" | "stored";
2533
+ key?: string;
2534
+ reason?: string;
2535
+ };
2536
+ };
2051
2537
  /**
2052
2538
  * Where the page layer lands in the output frame, computed by b3os-compose from style and output size and recorded for reproducibility.
2053
2539
  */
@@ -2072,7 +2558,7 @@ export interface RenderTimeline {
2072
2558
  */
2073
2559
  actions: RenderTimelineAction[];
2074
2560
  /**
2075
- * Composited cursor (not drawn in the page). Position is linear between consecutive points; pressed and visible keep their last value until a point changes them. Before the first point and after the last, the nearest point applies.
2561
+ * Composited cursor (not drawn in the page). Position is linear between consecutive points; pressed and visible keep their last value until a point changes them. Before the first point and after the last, the nearest point applies. The director hides the cursor until it fades in over 300 ms before its first move, where that move starts.
2076
2562
  */
2077
2563
  cursor?: {
2078
2564
  points: {
@@ -2081,12 +2567,34 @@ export interface RenderTimeline {
2081
2567
  y: number;
2082
2568
  pressed?: boolean;
2083
2569
  visible?: boolean;
2570
+ /**
2571
+ * On a point that changes visible: turning it true, the cursor's opacity rises from 0 to 1 over this long from t_us; turning it false (the idle hide), it falls from 1 to 0 and the cursor is drawn until t_us + fade_us (smoothstep).
2572
+ */
2573
+ fade_us?: RenderTimelineUs;
2084
2574
  }[];
2575
+ /**
2576
+ * The page gets the pointer from this time on: the end of the cursor's first move (look v2; round 4 gave it from that move's start). Before it the recorder sends the page no pointer event, so nothing under the parked cursor, or on its way to its first target, is hovered, and the capture's frame 0 may park the cursor again. A look v2 cursor parks at the first of (62%, 68%), (88%, 88%), (50%, 92%), (92%, 50%), (96%, 96%) and (50%, 97%) of the viewport whose 96 px box (output px) is plain on the capture's frame 0 and that the probe found clear of text, controls and media; the timeline's path is parked there. Absent: the pointer follows the cursor from frame 0, as before.
2577
+ */
2578
+ pointer_from_us?: RenderTimelineUs;
2085
2579
  };
2086
2580
  /**
2087
- * Camera keyframes. For t between keyframes k-1 and k: u = (t - t[k-1]) / (t[k] - t[k-1]), e = easing[k](u), zoom = zoom[k-1] * (zoom[k] / zoom[k-1])^e, center = center[k-1] + (center[k] - center[k-1]) * e. Before the first keyframe and after the last, the nearest keyframe holds. The camera rect is width = viewport.width / zoom, height = viewport.height / zoom, x = clamp(center.x - width / 2, 0, viewport.width - width), y likewise. Absent: zoom 1 centered.
2581
+ * Camera keyframes. For t between keyframes k-1 and k: u = (t - t[k-1]) / (t[k] - t[k-1]), e = easing[k](u), zoom = zoom[k-1] * (zoom[k] / zoom[k-1])^e, center = center[k-1] + (center[k] - center[k-1]) * e. Before the first keyframe and after the last, the nearest keyframe holds. Page space (space absent or page): the camera rect is width = viewport.width / zoom, height = viewport.height / zoom, x = clamp(center.x - width / 2, 0, viewport.width - width), y likewise; the page is cropped and scaled inside a fixed window. Canvas space: the camera moves over the whole composition (output px, canvas W x H = output size, page rect P = layout.page, s = P.size / viewport). center is the zoom's focus, the point that keeps its place on the frame: F = P.xy + center * s on the canvas; the card's view (frame_state view.card) is width = W / zoom, height = H / zoom, x = clamp(F.x * (1 - 1 / zoom), 0, W - width), y likewise, and every card layer (window, shadow, page, border, cursor, click effects) shows it scaled to the frame; zoom keeps its meaning (output px per CSS px = s * zoom). The background's view has zoom zb = 1 + p * (zoom - 1) (p = background_motion) about (W / 2 + p * (cx - W / 2), H / 2 + p * (cy - H / 2)), (cx, cy) the card view's center, clamped likewise, and blurs by a Gaussian of sigma = min(7 / 0.6 * (zoom - 1), 16) * min(W, H) / 1080 output px when background_blur is on (drawn at the nearest whole multiple of min(W, H) / 1080 px; frame_state view.blur gives sigma unrounded). Captions stay fixed on the frame. Absent: zoom 1 centered.
2088
2582
  */
2089
2583
  camera?: {
2584
+ /**
2585
+ * What the keyframes move: the page inside a fixed window (page; every timeline from before look v2), or the whole composition (canvas).
2586
+ * @default "page"
2587
+ */
2588
+ space?: "page" | "canvas";
2589
+ /**
2590
+ * Canvas space: how far the background follows the card, 0 (still) to 1 (zooms with it: the whole composition zooms as one).
2591
+ * @default 0.1
2592
+ */
2593
+ background_motion?: number;
2594
+ /**
2595
+ * Canvas space: whether the background blurs as the card zooms in, as the request's camera.background_blur set it. Absent, the request left it out, and the background the video draws decides: on for an image, the default look's library images among them, off for gradients, solid colors and patterns. A restyle decides again for the background it draws.
2596
+ */
2597
+ background_blur?: boolean;
2090
2598
  keyframes: {
2091
2599
  t_us: RenderTimelineUs;
2092
2600
  center: RenderTimelinePoint;
@@ -2107,6 +2615,26 @@ export interface RenderTimeline {
2107
2615
  /** @default 20 */
2108
2616
  max_chars_per_second?: number;
2109
2617
  cues: RenderTimelineCue[];
2618
+ /**
2619
+ * Look v2 round 4f: the karaoke word's color the frames drew and where it came from, so a restyle and a re-export repeat it. Written by the node for karaoke captions in the new look; absent on a timeline from before, with look 1 and without karaoke.
2620
+ */
2621
+ highlight?: {
2622
+ /** The word's color, #rrggbb. */
2623
+ color: string;
2624
+ /**
2625
+ * auto: from the background's pixels (an image outside the presets, a gradient; a flat or grey one gives #9cb0ff), fitted to the caption. preset: a preset background's own accent, fitted. request: the request's caption_highlight or its captions preset's own color.
2626
+ */
2627
+ source: "auto" | "preset" | "request";
2628
+ };
2629
+ /**
2630
+ * Look v2: when the caption backdrop's band (the blur under the pill where page content lies under the captions) holds, as runs it is drawn at full strength in; it fades in over 200 ms before each run and out over 200 ms after it, and only the pill fades between the cues of a run. The node decides the runs from the final cues, pages and camera: two cues share a run when their gap is 1.0 s or less, no new page paints in it and page content lies under the band at both of its ends (abutting cues always do). Written by the node and decided again by a restyle; absent (a timeline from before, look 1, no burned-in captions): the band fades with the pill.
2631
+ */
2632
+ backdrop?: {
2633
+ /** The run's first cue's start. */
2634
+ start_us: number;
2635
+ /** The run's last cue's end. */
2636
+ end_us: number;
2637
+ }[];
2110
2638
  };
2111
2639
  /**
2112
2640
  * Per capture frame: the viewport region to capture. Sent to the recorder for each segment. Frames not listed are not captured.
@@ -2114,6 +2642,10 @@ export interface RenderTimeline {
2114
2642
  capture_plan?: RenderTimelineCaptureFrame[];
2115
2643
  /** Optional FrameState dump (debugging, tests, GET .../timeline?frames=true). */
2116
2644
  frames?: RenderTimelineFrameState[];
2645
+ /**
2646
+ * What the planner rendered as the script asked although the look would do it otherwise, as codes (look v2). `scroll_round_trip`: the script's own steps scroll the page one way and back within 4 s and no one position shows them all, so both scrolls run. Absent when there are none.
2647
+ */
2648
+ warnings?: string[];
2117
2649
  }
2118
2650
  /** Microseconds on the virtual timeline. */
2119
2651
  export type RenderTimelineUs = number;
@@ -2175,10 +2707,74 @@ export interface RenderTimelineObservation {
2175
2707
  * The target sits inside nav, aside or a header bar (or their landmark roles); the camera zooms less there (1.25x).
2176
2708
  */
2177
2709
  landmark?: "nav" | "aside" | "header";
2710
+ /**
2711
+ * Look v2 round 4e: the least height (CSS px) the document had in the probe from the step before this one up to this one. The planner gives a page no offset a later step's page could not keep (a list that empties while a filter loads shortens the page and the browser scrolls it back).
2712
+ */
2713
+ doc_min?: number;
2714
+ /**
2715
+ * Look v2 round 4f: after the step, the rows where the page draws ink as [top, bottom, left, right] in page CSS px (text lines, media, fields, buttons, fills and borders that stand off the page's background; columns apart; a sticky element where it stood when the probe read it). The planner puts the top edge of a held view in a gap between them, so no line is cut by the frame's edge.
2716
+ */
2717
+ ink?: number[][];
2718
+ /** Look v2 round 4f: the same rows for what fixed elements draw, in viewport CSS px. */
2719
+ ink_fixed?: number[][];
2178
2720
  /**
2179
2721
  * Page time the action ran the page clock ahead of the timeline, off camera: a client-side route its click opened drawing (its code, its data, a Suspense delay), or a wait whose condition held after a timer. Capture passes run exactly as far ahead. Absent when 0.
2180
2722
  */
2181
2723
  ahead_us?: RenderTimelineUs;
2724
+ /**
2725
+ * Look v2 round 4 (a new video's camera.framing and scroll): what the camera frames the target by, measured in the page in the same evaluate as the target when the action ran, in CSS px in page coordinates (the viewport position plus scroll), so a restyle can frame it again. For a wait: its element (the one for.selector matches, or the first visible element showing for.text), whose viewport box is then also rect and point.
2726
+ */
2727
+ subject?: {
2728
+ /** The document's scroll offset when the boxes were measured. */
2729
+ scroll: RenderTimelinePoint;
2730
+ /**
2731
+ * The scroll offset before the recorder scrolled the page to the target (scroll: comfortable); absent when it did not.
2732
+ */
2733
+ from?: RenderTimelinePoint;
2734
+ target: RenderTimelineRect;
2735
+ /** The target's ancestors with a box, nearest first, up to the body (left out). */
2736
+ ancestors?: {
2737
+ rect: RenderTimelineRect;
2738
+ tag?: string;
2739
+ role?: string;
2740
+ /** It draws a box of its own: a background, a border, a shadow or rounded corners. */
2741
+ panel?: boolean;
2742
+ /**
2743
+ * A sectioning or grouping element or role: table, form, section, article, main, dialog, fieldset, figure, a list, a region, group, tab panel or grid.
2744
+ */
2745
+ group?: boolean;
2746
+ /** A row or list item: tr, li, row, listitem, option, treeitem. */
2747
+ row?: boolean;
2748
+ }[];
2749
+ /**
2750
+ * The index in ancestors of the target's subject as the recorder chose it: the nearest panel or group that holds the target and is at least 240 x 120 CSS px or 1.3 times the target on both axes. The camera chooses again by the same rule.
2751
+ */
2752
+ panel?: number;
2753
+ /**
2754
+ * The boxes of that subject's siblings: a held view's edge never rests inside one when a gap beside it is near.
2755
+ */
2756
+ siblings?: RenderTimelineRect[];
2757
+ /**
2758
+ * Look v2 round 4b: the rows in the viewport (lines of text and table rows). No longer written or read since round 4c, when the camera's three compositions and the blur band under the caption pill replaced the shift that kept the pill's edges off them; accepted on a timeline from before.
2759
+ */
2760
+ rows?: RenderTimelineRect[];
2761
+ /**
2762
+ * Look v2 round 4c: the page's main content box, which the camera's MAIN view frames with 24 CSS px each side across the frame: the content box (padding and border left out) of the main or [role=main] element when that is wider than half the viewport, else the viewport less the fixed or sticky elements that span a full edge of it (a sidebar, a header bar), 24 px in from them. Absent on a page with neither: its MAIN is the whole window. The camera reads the first one measured on each page.
2763
+ */
2764
+ main?: RenderTimelineRect;
2765
+ /**
2766
+ * Look v2 round 4c: the target or one of its ancestors is position: sticky; the page does not scroll for it when what the scroll served stays in the viewport without it.
2767
+ */
2768
+ sticky?: boolean;
2769
+ };
2770
+ /**
2771
+ * Where the cursor's tip can rest after a hover or a type, viewport space at at_us (look v2, round 4): its arrow's box at least 8 px inside the viewport and over no text, badge, control or media, as the probe found it with elementFromPoint: 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 or that has none), right of it plus 16 px, or (round 4b) another spot within 24 px of it (round 4c: with the arrow's tip within 24 px, so never above it, where round 4's spot put the tip an arrow's height over the label; a table's header cells count as text); for a field typed into, under it, beside it, above it, another spot within 24 px of it, or inside it 12 px from its right end when the typed text ends at least 24 px before the arrow. A type without a target is probed on the focused field, and the click into that field carries the type's rest. Absent when no spot was clear, or the probe was not asked.
2772
+ */
2773
+ rest?: RenderTimelinePoint;
2774
+ /**
2775
+ * Look v2 round 4b: after the probe's framing scrolled the page for this action, the boxes (viewport space after the scroll) of the text lines, badges, controls, fields and media near where the cursor rests after the last pointer action. The resting cursor stands still while the scroll plays, then (round 4c) moves once, 150 ms after it ends, up to 40 px to a spot clear of them; it stays when that spot is under 24 px away. Absent when the page did not scroll for the action, nothing was near, or the probe was not asked.
2776
+ */
2777
+ busy?: RenderTimelineRect[];
2182
2778
  error?: {
2183
2779
  code: string;
2184
2780
  detail?: string;
@@ -2218,8 +2814,7 @@ export type RenderTimelineAction = {
2218
2814
  /** scroll: delta from the current offset. */
2219
2815
  by?: RenderTimelinePoint;
2220
2816
  /**
2221
- * scroll: animation length on the virtual clock.
2222
- * @default 600000
2817
+ * scroll: animation length on the virtual clock, at most 10 s, 600000 (0.6 s) when absent. type: how long the typing runs, its characters times interval_us, at most the video's length (the director writes it; the recorder times each key from interval_us, and a type without it lasts that long all the same).
2223
2818
  */
2224
2819
  duration_us?: number;
2225
2820
  easing?: RenderTimelineEasing;
@@ -2325,6 +2920,16 @@ export interface RenderTimelineFrameState {
2325
2920
  y: number;
2326
2921
  visible: boolean;
2327
2922
  pressed: boolean;
2923
+ /**
2924
+ * Below 1 while the cursor fades in or out (a point's fade_us).
2925
+ * @default 1
2926
+ */
2927
+ opacity?: number;
2928
+ /**
2929
+ * How far the last press has shrunk the cursor: from the press it rises to 1 over 70 ms (a critically damped spring from rest), and from the release it falls back to 0 over 220 ms. The style's cursor_press_scale is the cursor's size at 1.
2930
+ * @default 0
2931
+ */
2932
+ press?: number;
2328
2933
  };
2329
2934
  effects: {
2330
2935
  kind: "click";
@@ -2336,13 +2941,40 @@ export interface RenderTimelineFrameState {
2336
2941
  caption: null | {
2337
2942
  cue: RenderTimelineLocalId;
2338
2943
  lines: string[];
2944
+ /**
2945
+ * Karaoke: the word being spoken, the last whose start is at or before t_us (look v2: at or before t_us plus half of caption_fade_ms, so its fade is centred on the word's start). The style draws the words before it in the caption color, it in caption_highlight and the words after it at caption_upcoming of the caption color; over caption_fade_ms from its start it lights from that shade while the previous word settles from caption_highlight to the caption color (ease-out cubic).
2946
+ */
2339
2947
  highlight?: {
2340
2948
  line: number;
2341
2949
  byte_start: number;
2342
2950
  byte_end: number;
2951
+ /** How long ago the word started, at most 1 s. Absent: lit in full. */
2952
+ since_us?: number;
2953
+ /** The word before it in the cue. */
2954
+ previous?: {
2955
+ line: number;
2956
+ byte_start: number;
2957
+ byte_end: number;
2958
+ };
2343
2959
  };
2344
2960
  /** The cue's own position, over the caption style's. */
2345
2961
  position?: "top" | "bottom";
2962
+ /**
2963
+ * Look v2: below 1 while the caption fades in over the 150 ms before its cue starts (as much of them as the cue before leaves) or out over its last 150 ms (a cue that abuts the one before or after it does not fade on that side).
2964
+ * @default 1
2965
+ */
2966
+ opacity?: number;
2967
+ /**
2968
+ * Look v2: the cue before it, which this one abuts, while the text crossfades from it (120 ms) and the box resizes from its size (200 ms), both ease-out cubic from the boundary.
2969
+ */
2970
+ from?: {
2971
+ lines: string[];
2972
+ position?: "top" | "bottom";
2973
+ /** How far the text has crossfaded to this cue. */
2974
+ text: number;
2975
+ /** How far the box has moved from the old cue's size to this one's. */
2976
+ size: number;
2977
+ };
2346
2978
  };
2347
2979
  /**
2348
2980
  * Opacity of the window layer (page, frame chrome, shadow, border, cursor, click effects) over the background; the background and the caption stay opaque.
@@ -2358,6 +2990,60 @@ export interface RenderTimelineFrameState {
2358
2990
  cursor_dx?: number;
2359
2991
  cursor_dy?: number;
2360
2992
  };
2993
+ /**
2994
+ * Canvas-space camera only: what the frame shows of the composition, in canvas px (output px at zoom 1). camera is then the part of the viewport in view (view.card cut to layout.page), the whole viewport at zoom 1. A view of the whole canvas composes as a frame without a camera.
2995
+ */
2996
+ view?: {
2997
+ /**
2998
+ * The card's view: the window, its shadow, the page, the cursor and click effects show this rect scaled to the frame.
2999
+ */
3000
+ card: RenderTimelineRect;
3001
+ /** The background's own view. Absent: the background moves with the card, unblurred. */
3002
+ background?: RenderTimelineRect;
3003
+ /**
3004
+ * The background's Gaussian blur, sigma in output px.
3005
+ * @default 0
3006
+ */
3007
+ blur?: number;
3008
+ };
3009
+ /**
3010
+ * Where the camera and the cursor are when the frame's shutter opens and closes, half an output frame before and after t_us ([open, close]); present when either moves over it. With the style's motion_blur, a zoomed canvas frame whose card moves faster than motion_blur_onset and than motion_blur_peak of move_reach is the average of the composition over motion_blur_shutter of it, shortened by that onset (the card, its background at its own views), and the cursor is smeared along its own motion over motion_blur_shutter and along the camera's by the card's share.
3011
+ */
3012
+ shutter?: {
3013
+ /** Canvas space: view.card at open and close, when the camera moves. */
3014
+ card?: RenderTimelineRect[];
3015
+ /** Canvas space: view.background at open and close, when the frame has one. */
3016
+ background?: RenderTimelineRect[];
3017
+ /** The cursor's position (viewport px) at open and close. */
3018
+ cursor: RenderTimelinePoint[];
3019
+ /**
3020
+ * How long the shutter is open (µs): a whole output frame. The style's motion_blur_onset is a speed, so the compositor needs it; 0 or absent (a frame state written before it) counts as a 60 fps frame.
3021
+ */
3022
+ length_us?: number;
3023
+ /**
3024
+ * Output px: the most the card's far corner moves over such a shutter at any frame of the camera move (keyframe segment) this frame is in. The style's motion_blur_peak keeps frames under that share of it sharp; 0 or absent: no such floor.
3025
+ */
3026
+ move_reach?: number;
3027
+ };
3028
+ /**
3029
+ * Look v2: the caption backdrop's band on this frame, from captions.backdrop: its own opacity (the pill's fades do not fade it) and, when it is not the caption's, the cue whose caption box it lies under. Absent: no band, or, from a timeline without captions.backdrop, the band at the caption's own opacity.
3030
+ */
3031
+ backdrop?: {
3032
+ /** How much of the band shows (smoothstep over its 200 ms fades). */
3033
+ opacity: number;
3034
+ /**
3035
+ * The cue the band's box comes from: while no caption is drawn (a gap its run holds across, the fade after its last cue or before its first), or the cue before a held gap while the band's box moves from its box to the caption's.
3036
+ */
3037
+ under?: {
3038
+ lines: string[];
3039
+ position?: "top" | "bottom";
3040
+ /**
3041
+ * With a caption drawn: how far the band's box has moved from this cue's box to the caption's (0 to 1, ease-out cubic over 200 ms from when the caption starts to show).
3042
+ * @default 0
3043
+ */
3044
+ size?: number;
3045
+ };
3046
+ };
2361
3047
  }
2362
3048
  export interface Preset {
2363
3049
  id: PresetRef;
@@ -2379,7 +3065,7 @@ export interface RenderBackground {
2379
3065
  ref: string;
2380
3066
  object: "render.background";
2381
3067
  /**
2382
- * `css`: drawn by the compositor from gradient layers. `procedural`: one of our own studio meshes (pack `studio`), computed in float, dithered, with 1% grain on stills; the set `style: {}` picks from carries the tag `auto`. `image`: a stored WebP (see `image`).
3068
+ * `css`: drawn by the compositor from gradient layers. `procedural`: one of our own studio meshes (pack `studio`), computed in float, dithered, with 1% grain on stills; the set the studio pick chooses from (`background: "studio"`) carries the tag `auto`. `image`: a stored WebP (see `image`).
2383
3069
  */
2384
3070
  kind: "css" | "procedural" | "image";
2385
3071
  pack: string;
@@ -2510,6 +3196,14 @@ export interface SandboxPort {
2510
3196
  * @default false
2511
3197
  */
2512
3198
  public?: boolean;
3199
+ /**
3200
+ * How long a request through the port's preview waits for the app to start its response (status and
3201
+ * headers), counted from when the node lets the request in. Past it the request answers `504
3202
+ * upstream_first_byte_timeout`. A response that has started may stream for up to an hour. At most 95: the
3203
+ * path in front of the node gives up on a response that has not started after 100 seconds.
3204
+ * @default 65
3205
+ */
3206
+ first_byte_s?: number;
2513
3207
  }
2514
3208
  /**
2515
3209
  * What code inside the sandbox may call at `http://127.0.0.1:7700`. Empty by default, revoked when the sandbox stops.
@@ -2709,6 +3403,10 @@ export interface Sandbox {
2709
3403
  * this sandbox and this sandbox is not within that sandbox's reach (`sandboxesCreateSandbox`).
2710
3404
  */
2711
3405
  url: string | null;
3406
+ /**
3407
+ * How long a preview request waits for the app to start its response, seconds (65 unless the create said otherwise).
3408
+ */
3409
+ first_byte_s?: number;
2712
3410
  }[];
2713
3411
  api: {
2714
3412
  scopes: string[];
@@ -2851,6 +3549,44 @@ export interface SandboxProcess {
2851
3549
  started_at: string;
2852
3550
  exited_at: string | null;
2853
3551
  }
3552
+ /** What a running sandbox uses now (`GET /v1/sandboxes/{sandbox_id}/stats`). */
3553
+ export interface SandboxStats {
3554
+ object: "sandbox_stats";
3555
+ sandbox_id: string;
3556
+ /** When the node read it. */
3557
+ taken_at: string;
3558
+ cpu: {
3559
+ /**
3560
+ * The share of all the sandbox's vCPUs that was busy over `interval_ms`, one decimal (100 is every vCPU busy). Null when the node could not read the sandbox's CPU counter.
3561
+ */
3562
+ percent: number | null;
3563
+ /** The sandbox's vCPUs. */
3564
+ vcpu: number;
3565
+ /** The window `percent` covers. */
3566
+ interval_ms: number | null;
3567
+ };
3568
+ memory: {
3569
+ /** `total_bytes` minus `available_bytes`. */
3570
+ used_bytes: number;
3571
+ /** What the guest kernel can still give programs (`MemAvailable`). */
3572
+ available_bytes: number;
3573
+ /** The memory the guest kernel manages (`MemTotal`), a little under the sandbox's `memory_mib`. */
3574
+ total_bytes: number;
3575
+ };
3576
+ /** The root filesystem, or null in a sandbox whose image does not report it. */
3577
+ disk: null | {
3578
+ used_bytes: number;
3579
+ total_bytes: number;
3580
+ };
3581
+ processes: {
3582
+ /** Background processes started with exec that still run (as `GET …/processes` lists them). */
3583
+ running: number;
3584
+ /**
3585
+ * Every user process in the sandbox, kernel threads left out; null in a sandbox whose image does not report it.
3586
+ */
3587
+ total: number | null;
3588
+ };
3589
+ }
2854
3590
  export type SandboxProcessList = Omit<ListEnvelope, "data"> & {
2855
3591
  data: SandboxProcess[];
2856
3592
  };
@@ -5307,6 +6043,12 @@ export interface CurrentPrincipal {
5307
6043
  project_id: string;
5308
6044
  scopes: Scope[];
5309
6045
  spend_cap_usd: number | null;
6046
+ /**
6047
+ * What the key has spent this billing period (the UTC calendar month, from `spend_period_start`): its usage at the configured unit prices, the number a metered call's `402 spend_cap_exceeded` check compares with `spend_cap_usd`. Up to 10 seconds old. The free beta prices no usage yet, so it reads 0. Null for a dashboard session or a sandbox, which have no key of their own.
6048
+ */
6049
+ spend_usd?: number | null;
6050
+ /** Start of the billing period `spend_usd` covers. */
6051
+ spend_period_start?: string;
5310
6052
  expires_at: string | null;
5311
6053
  }
5312
6054
  export interface UsageSummary {
@@ -5473,6 +6215,12 @@ export interface RequestRecord {
5473
6215
  product: string | null;
5474
6216
  status_code: number;
5475
6217
  error_code: string | null;
6218
+ /**
6219
+ * Why a 4xx or 5xx answer failed, in the server's own words: the first 200 characters of its problem's
6220
+ * `detail` (or a compatibility surface's message). `null` for a success, or when the server recorded none;
6221
+ * absent from records written before it was recorded.
6222
+ */
6223
+ error_detail?: string | null;
5476
6224
  org_id: string;
5477
6225
  project_id: string;
5478
6226
  /** The API key behind the request (for sandbox calls, the key that created the sandbox). */
@@ -5846,7 +6594,9 @@ export interface RenderListBackgroundsParams {
5846
6594
  theme?: "light" | "dark";
5847
6595
  /** Only CSS, only procedural (the studio pack) or only image backgrounds. */
5848
6596
  kind?: "css" | "procedural" | "image";
5849
- /** Only backgrounds with this tag (case-insensitive, whole tag). */
6597
+ /**
6598
+ * Only backgrounds with this tag (case-insensitive, whole tag). `video` lists the images the `auto` background picks from, on videos and styled screenshots; `auto` the studio meshes of the studio pick (`background: "studio"`, and `auto` when no image clears the page's edges).
6599
+ */
5850
6600
  tag?: string;
5851
6601
  /**
5852
6602
  * Only full-bleed backgrounds, or only transparent shapes (`cutout`, `partial`, `sliver`). CSS backgrounds are full-bleed.
@@ -5991,6 +6741,23 @@ export interface SandboxesOpenPtyParams {
5991
6741
  */
5992
6742
  session?: string;
5993
6743
  }
6744
+ /** Parameters of `listRequests`. */
6745
+ export interface SandboxesListRequestsParams {
6746
+ /**
6747
+ * Page size, from 1 to 100.
6748
+ * @default 20
6749
+ */
6750
+ limit?: number;
6751
+ /** Opaque cursor from the previous page's `next_cursor`. Omit it for the first page. */
6752
+ cursor?: string;
6753
+ product?: string;
6754
+ operation_id?: string;
6755
+ /** Only requests that succeeded (`2xx`) or failed (`4xx`, `5xx`). */
6756
+ status?: "2xx" | "4xx" | "5xx";
6757
+ /** Only requests of this W3C trace (the trace id of their `traceparent`). */
6758
+ trace_id?: string;
6759
+ since?: string;
6760
+ }
5994
6761
  /** Parameters of `listRoutines`. */
5995
6762
  export interface RoutinesListRoutinesParams {
5996
6763
  /**