@b3os/sdk 0.1.3 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/dist/cjs/core/client.d.ts +21 -2
- package/dist/cjs/core/client.js +26 -1
- package/dist/cjs/core/client.js.map +1 -1
- package/dist/cjs/core/handle.d.ts +5 -0
- package/dist/cjs/core/handle.js +13 -2
- package/dist/cjs/core/handle.js.map +1 -1
- package/dist/cjs/core/index.d.ts +2 -0
- package/dist/cjs/core/index.js +7 -1
- package/dist/cjs/core/index.js.map +1 -1
- package/dist/cjs/core/sse.d.ts +2 -0
- package/dist/cjs/core/sse.js +17 -5
- package/dist/cjs/core/sse.js.map +1 -1
- package/dist/cjs/core/traces-api.d.ts +42 -0
- package/dist/cjs/core/traces-api.js +54 -0
- package/dist/cjs/core/traces-api.js.map +1 -0
- package/dist/cjs/core/traces.d.ts +120 -0
- package/dist/cjs/core/traces.js +306 -0
- package/dist/cjs/core/traces.js.map +1 -0
- package/dist/cjs/core/util.d.ts +1 -1
- package/dist/cjs/core/util.js +1 -1
- package/dist/cjs/generated/errors.d.ts +1 -1
- package/dist/cjs/generated/errors.js +32 -0
- package/dist/cjs/generated/errors.js.map +1 -1
- package/dist/cjs/generated/ids.d.ts +12 -0
- package/dist/cjs/generated/ids.js +3 -0
- package/dist/cjs/generated/ids.js.map +1 -1
- package/dist/cjs/generated/ns/actions.d.ts +66 -1
- package/dist/cjs/generated/ns/actions.js +101 -1
- package/dist/cjs/generated/ns/actions.js.map +1 -1
- package/dist/cjs/generated/ns/keys.d.ts +2 -1
- package/dist/cjs/generated/ns/keys.js +2 -1
- package/dist/cjs/generated/ns/keys.js.map +1 -1
- package/dist/cjs/generated/ns/render.d.ts +22 -2
- package/dist/cjs/generated/ns/render.js +13 -2
- package/dist/cjs/generated/ns/render.js.map +1 -1
- package/dist/cjs/generated/ns/sandboxes.d.ts +29 -0
- package/dist/cjs/generated/ns/sandboxes.js +49 -0
- package/dist/cjs/generated/ns/sandboxes.js.map +1 -1
- package/dist/cjs/generated/types.d.ts +1038 -65
- package/dist/cjs/helpers/sandboxes.d.ts +26 -2
- package/dist/cjs/helpers/sandboxes.js +114 -13
- package/dist/cjs/helpers/sandboxes.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/core/client.d.ts +21 -2
- package/dist/esm/core/client.js +27 -2
- package/dist/esm/core/client.js.map +1 -1
- package/dist/esm/core/handle.d.ts +5 -0
- package/dist/esm/core/handle.js +13 -2
- package/dist/esm/core/handle.js.map +1 -1
- package/dist/esm/core/index.d.ts +2 -0
- package/dist/esm/core/index.js +2 -0
- package/dist/esm/core/index.js.map +1 -1
- package/dist/esm/core/sse.d.ts +2 -0
- package/dist/esm/core/sse.js +17 -5
- package/dist/esm/core/sse.js.map +1 -1
- package/dist/esm/core/traces-api.d.ts +42 -0
- package/dist/esm/core/traces-api.js +50 -0
- package/dist/esm/core/traces-api.js.map +1 -0
- package/dist/esm/core/traces.d.ts +120 -0
- package/dist/esm/core/traces.js +295 -0
- package/dist/esm/core/traces.js.map +1 -0
- package/dist/esm/core/util.d.ts +1 -1
- package/dist/esm/core/util.js +1 -1
- package/dist/esm/generated/errors.d.ts +1 -1
- package/dist/esm/generated/errors.js +32 -0
- package/dist/esm/generated/errors.js.map +1 -1
- package/dist/esm/generated/ids.d.ts +12 -0
- package/dist/esm/generated/ids.js +3 -0
- package/dist/esm/generated/ids.js.map +1 -1
- package/dist/esm/generated/ns/actions.d.ts +66 -1
- package/dist/esm/generated/ns/actions.js +101 -1
- package/dist/esm/generated/ns/actions.js.map +1 -1
- package/dist/esm/generated/ns/keys.d.ts +2 -1
- package/dist/esm/generated/ns/keys.js +2 -1
- package/dist/esm/generated/ns/keys.js.map +1 -1
- package/dist/esm/generated/ns/render.d.ts +22 -2
- package/dist/esm/generated/ns/render.js +13 -2
- package/dist/esm/generated/ns/render.js.map +1 -1
- package/dist/esm/generated/ns/sandboxes.d.ts +29 -0
- package/dist/esm/generated/ns/sandboxes.js +49 -0
- package/dist/esm/generated/ns/sandboxes.js.map +1 -1
- package/dist/esm/generated/types.d.ts +1038 -65
- package/dist/esm/helpers/sandboxes.d.ts +26 -2
- package/dist/esm/helpers/sandboxes.js +113 -12
- package/dist/esm/helpers/sandboxes.js.map +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/core/client.ts +36 -4
- package/src/core/handle.ts +12 -2
- package/src/core/index.ts +10 -0
- package/src/core/sse.ts +17 -5
- package/src/core/traces-api.ts +80 -0
- package/src/core/traces.ts +375 -0
- package/src/core/util.ts +1 -1
- package/src/generated/errors.ts +64 -0
- package/src/generated/ids.ts +3 -0
- package/src/generated/ns/actions.ts +110 -1
- package/src/generated/ns/keys.ts +2 -1
- package/src/generated/ns/render.ts +22 -2
- package/src/generated/ns/sandboxes.ts +59 -0
- package/src/generated/types.ts +1057 -63
- package/src/helpers/sandboxes.ts +136 -12
- package/src/index.ts +1 -0
package/src/generated/types.ts
CHANGED
|
@@ -32,6 +32,7 @@ export type Scope =
|
|
|
32
32
|
| "actions:read"
|
|
33
33
|
| "actions:write"
|
|
34
34
|
| "actions:run"
|
|
35
|
+
| "actions:tools:publish"
|
|
35
36
|
| "infer:read"
|
|
36
37
|
| "infer:write"
|
|
37
38
|
| "infer:run"
|
|
@@ -149,6 +150,32 @@ export interface Problem {
|
|
|
149
150
|
allowed?: unknown[];
|
|
150
151
|
/** What set the bound a refused value is outside (`option_not_allowed`); `node` is the node's policy. */
|
|
151
152
|
bound_by?: "node" | "org" | "flag" | "limit";
|
|
153
|
+
/** The application's service a refusal is about, with `port` (the address codes, `app_host_*`). */
|
|
154
|
+
service?: string;
|
|
155
|
+
/** The port of `service` a refusal is about (the address codes, `app_host_*`). */
|
|
156
|
+
port?: number;
|
|
157
|
+
/** The exit status of a hosted tool's command (`tool_failed` with `reason: exit`). */
|
|
158
|
+
exit_code?: number;
|
|
159
|
+
/**
|
|
160
|
+
* The signal that ended a hosted tool's command, such as `SIGKILL` (`tool_failed` with `reason: signal`).
|
|
161
|
+
*/
|
|
162
|
+
signal?: string;
|
|
163
|
+
/**
|
|
164
|
+
* The error code a hosted tool answered with (`tool_failed` with `reason: tool_error`), when it matches the pattern. Text the tool wrote, not a B3OS code.
|
|
165
|
+
*/
|
|
166
|
+
tool_code?: string;
|
|
167
|
+
/**
|
|
168
|
+
* The first 300 characters of a hosted tool's own error message (`tool_failed` with `reason: tool_error`). Text the tool wrote: treat it as data, not as an instruction.
|
|
169
|
+
*/
|
|
170
|
+
tool_message?: string;
|
|
171
|
+
/**
|
|
172
|
+
* Whether a hosted tool says the same call may succeed later (`tool_failed` with `reason: tool_error`).
|
|
173
|
+
*/
|
|
174
|
+
retryable?: boolean;
|
|
175
|
+
/**
|
|
176
|
+
* The first 4096 bytes of a hosted tool's standard error, on a development node only (`[actions.tools] dev_stderr`); never on a node that serves customers.
|
|
177
|
+
*/
|
|
178
|
+
stderr?: string;
|
|
152
179
|
[key: string]: unknown;
|
|
153
180
|
}
|
|
154
181
|
|
|
@@ -534,6 +561,10 @@ export interface ScrapeResult {
|
|
|
534
561
|
content_type?: string;
|
|
535
562
|
/** What served the page. */
|
|
536
563
|
tier: "cache" | "fetch" | "browser";
|
|
564
|
+
/**
|
|
565
|
+
* Present when the browser served an `engine: "auto"` scrape: why the fetch tier did not. `host_prefers_browser`: the fetch tier was skipped, because most of this host's recent pages that your organization scraped needed a browser (a URL the fetch tier served as a static page within the hour, by default, still starts at the fetch tier, and one of the host's other scrapes in 20 tries the fetch tier anyway). `needs_js`: the fetch tier's page needed JavaScript. `empty_page`: the fetch tier's page came out empty. `thin_page`: the fetch tier's page was thin or mostly script, and the browser's had more text. `fetch_failed`: the fetch failed in a way a browser may not (TLS, a connection, a redirect loop, a timeout).
|
|
566
|
+
*/
|
|
567
|
+
tier_reason?: "host_prefers_browser" | "needs_js" | "empty_page" | "thin_page" | "fetch_failed";
|
|
537
568
|
cache: CacheInfo;
|
|
538
569
|
markdown?: string;
|
|
539
570
|
html?: string;
|
|
@@ -1511,8 +1542,12 @@ export type BackgroundPreset =
|
|
|
1511
1542
|
| "graphite"
|
|
1512
1543
|
| "paper";
|
|
1513
1544
|
|
|
1514
|
-
/**
|
|
1545
|
+
/**
|
|
1546
|
+
* 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.
|
|
1547
|
+
*/
|
|
1515
1548
|
export type FramePreset =
|
|
1549
|
+
| "window"
|
|
1550
|
+
| "window-dark"
|
|
1516
1551
|
| "mac"
|
|
1517
1552
|
| "mac-dark"
|
|
1518
1553
|
| "browser"
|
|
@@ -1528,7 +1563,15 @@ export type FramePreset =
|
|
|
1528
1563
|
/** A cursor preset (`GET /v1/render/presets?kind=cursor` has a preview of each). */
|
|
1529
1564
|
export type CursorPreset = "arrow" | "arrow-light" | "dot";
|
|
1530
1565
|
|
|
1531
|
-
/**
|
|
1566
|
+
/**
|
|
1567
|
+
* A caption style preset (`GET /v1/render/presets?kind=captions` has a preview of each): `default`, a small
|
|
1568
|
+
* neutral near-black pill that never takes on the background's hue (where the darkest 30% of what it covers is
|
|
1569
|
+
* darker than luma 24, its fill is lifted 18 levels above that and its edge brightened, so it still reads as a
|
|
1570
|
+
* pill), whose
|
|
1571
|
+
* karaoke shows the spoken words white,
|
|
1572
|
+
* the word being spoken in a light B3 blue and the words to come dimmed; `bold`, a large dark pill with a yellow
|
|
1573
|
+
* karaoke word; `minimal`, outlined text with no box; `light`, dark text on a white box.
|
|
1574
|
+
*/
|
|
1532
1575
|
export type CaptionsPreset = "default" | "bold" | "minimal" | "light";
|
|
1533
1576
|
|
|
1534
1577
|
/** A click effect preset (`GET /v1/render/presets?kind=click_effect` has a preview of each). */
|
|
@@ -1539,15 +1582,34 @@ export type ClickEffectPreset = "ripple" | "ring";
|
|
|
1539
1582
|
* this). Every field is optional. The per-kind enums (`BackgroundPreset`, `FramePreset`, `CursorPreset`,
|
|
1540
1583
|
* `CaptionsPreset`, `ClickEffectPreset`) list today's presets; the schema also takes any preset ID so a preset
|
|
1541
1584
|
* added later needs no client update, and the node refuses an ID that is not a preset of that kind with
|
|
1542
|
-
* `style_invalid`. `none` draws nothing for that part; `auto`
|
|
1543
|
-
*
|
|
1544
|
-
*
|
|
1545
|
-
*
|
|
1585
|
+
* `style_invalid`. `none` draws nothing for that part; `auto` is the default background. On a video and on a
|
|
1586
|
+
* styled screenshot it draws one of the library images tagged `video` (the node's set, by default 24: macOS-style
|
|
1587
|
+
* waves, calm cool, warm and pastel gradient fields, deep dark fields, a grey grain and five soft photographs),
|
|
1588
|
+
* picked from the page (a video's first frame, a screenshot's capture). Only images at least 12 L* from the page
|
|
1589
|
+
* all along just outside the window's edges compete (a dark page: 20 L* lighter outside its dark edges). Among
|
|
1590
|
+
* them a small vision model (`b3os/qwen3.5-9b`, run by the node, not billed to you) picks the one that best
|
|
1591
|
+
* matches the app's look and brand, from the page and one labelled sheet of the candidates. Without the model,
|
|
1592
|
+
* when it does not answer within 4 s, or when one image clears, the color rules pick: the image whose hue suits
|
|
1593
|
+
* the page's accent color and whose tone sits behind the page (deeper behind a light page, airier behind a dark
|
|
1594
|
+
* one), ties broken by the page's host. The first pick for a site (the page's registrable domain, such as
|
|
1595
|
+
* `linear.app`; the host for `localhost` and IP addresses) is kept for your organization, so later videos and
|
|
1596
|
+
* screenshots of the site draw the same image while it clears their page's edges; `auto_background` pins an
|
|
1597
|
+
* image, picks again or turns the model off. The studio pick when no image clears the edges (or the node has no
|
|
1598
|
+
* set). The pick reads the page in CSS pixels, so it does not depend on the device scale; the result's
|
|
1599
|
+
* `auto_background` says which image was drawn and how it was chosen. On a video the timeline's `style` then
|
|
1600
|
+
* names the image in `overrides.background_ref`, and its `look` records it as the `auto` pick with how it was
|
|
1601
|
+
* chosen. If the node cannot load it in time (2 s for a file it has, 0.5 s for one it must fetch,
|
|
1602
|
+
* none while the image store is failing: a minute after it fails, or its Retry-After, 1 s to 10 min), the video
|
|
1603
|
+
* draws the studio pick and `warnings` says so
|
|
1604
|
+
* (`background_fallback`). `studio` is the studio pick by name, on screenshots and videos (what `auto` drew
|
|
1605
|
+
* before 2026-11-11, and what a restyle without a style draws for a timeline from before then: the mesh it
|
|
1606
|
+
* drew, read from the first frame's own pixels as production read it). `transparent` leaves
|
|
1607
|
+
* the background transparent.
|
|
1546
1608
|
* Strings are drawn by the compositor and escaped before they reach any HTML or CSS.
|
|
1547
1609
|
*/
|
|
1548
1610
|
export interface RenderStyle {
|
|
1549
|
-
/** A background preset, or `auto`, `transparent` or `none`. */
|
|
1550
|
-
background?: BackgroundPreset | "auto" | "transparent" | "none" | (string & {});
|
|
1611
|
+
/** A background preset, or `auto`, `studio`, `transparent` or `none`. */
|
|
1612
|
+
background?: BackgroundPreset | "auto" | "studio" | "transparent" | "none" | (string & {});
|
|
1551
1613
|
/** A window frame preset, or `none`. */
|
|
1552
1614
|
frame?: FramePreset | "none" | (string & {});
|
|
1553
1615
|
/** A cursor preset, or `none`. */
|
|
@@ -1561,7 +1623,8 @@ export interface RenderStyle {
|
|
|
1561
1623
|
|
|
1562
1624
|
/**
|
|
1563
1625
|
* A color: `#rgb`, `#rgba`, `#rrggbb`, `#rrggbbaa`, `rgb(r,g,b)`, `rgba(r,g,b,a)`, `rgb(r g b / a)` (channels
|
|
1564
|
-
* 0-255 or percentages, alpha 0-1 or a percentage),
|
|
1626
|
+
* 0-255 or percentages, alpha 0-1 or a percentage), a CSS color name such as `orange` or `rebeccapurple` (any
|
|
1627
|
+
* of the 148), or `transparent`. A value that is none of these is refused with an error that names it.
|
|
1565
1628
|
*/
|
|
1566
1629
|
export type RenderColor = string;
|
|
1567
1630
|
|
|
@@ -1590,16 +1653,26 @@ export type RenderGradientStop =
|
|
|
1590
1653
|
* videos (relative to 1080p).
|
|
1591
1654
|
*/
|
|
1592
1655
|
export interface RenderStyleOverrides {
|
|
1593
|
-
/**
|
|
1656
|
+
/**
|
|
1657
|
+
* Space around the page, the same on every side or `{x, y}`. Left out, 6% of the canvas's long edge on a
|
|
1658
|
+
* screenshot (48 to 160 pixels), and on a video what `window_shape` gives: by default 8% of the frame's
|
|
1659
|
+
* height above and below the window and 6.5% of its width at each side on a landscape frame (86 and 126
|
|
1660
|
+
* pixels at 1920x1080, the window on even pixels), with room under the window for burned-in captions.
|
|
1661
|
+
*/
|
|
1594
1662
|
padding?:
|
|
1595
1663
|
| number
|
|
1596
1664
|
| {
|
|
1597
1665
|
x?: number;
|
|
1598
1666
|
y?: number;
|
|
1599
1667
|
};
|
|
1668
|
+
/**
|
|
1669
|
+
* 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).
|
|
1670
|
+
*/
|
|
1600
1671
|
corner_radius?: number;
|
|
1601
|
-
/**
|
|
1602
|
-
|
|
1672
|
+
/**
|
|
1673
|
+
* 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.
|
|
1674
|
+
*/
|
|
1675
|
+
shadow?: "none" | "subtle" | "soft" | "deep" | "classic" | "float" | "hard" | "glow" | RenderShadow | RenderShadow[];
|
|
1603
1676
|
/**
|
|
1604
1677
|
* `none`, or a border of `width` (default 1) and `color`. Left out, a hairline matched to the background.
|
|
1605
1678
|
*/
|
|
@@ -1624,14 +1697,16 @@ export interface RenderStyleOverrides {
|
|
|
1624
1697
|
* first use there and cached; if it cannot be loaded the request fails with `background_unavailable` (503,
|
|
1625
1698
|
* retry).
|
|
1626
1699
|
*
|
|
1627
|
-
* `"auto"`
|
|
1628
|
-
* soft-photo backgrounds (quiet ones first), in the page's light or dark theme (or `theme`'s), so a
|
|
1629
|
-
* page gets a light, soft background and a dark page a dark one, with clear lightness separation, a
|
|
1630
|
-
* analogous or complementary to the page's accent, little detail where it shows around the window, and
|
|
1700
|
+
* `"auto"` picks a library image that fits the captured page (a video's first frame): one of the quiet,
|
|
1701
|
+
* bold or soft-photo backgrounds (quiet ones first), in the page's light or dark theme (or `theme`'s), so a
|
|
1702
|
+
* light page gets a light, soft background and a dark page a dark one, with clear lightness separation, a
|
|
1703
|
+
* hue analogous or complementary to the page's accent, little detail where it shows around the window, and
|
|
1631
1704
|
* enough pixels for the output. The same page gets the same background; the screenshot's `background_ref`
|
|
1632
|
-
* names the one drawn. If the chosen image cannot be loaded within 2 s, the
|
|
1633
|
-
* background (the `auto` background preset unless `background`
|
|
1634
|
-
* (`background_fallback`).
|
|
1705
|
+
* names the one drawn, a video's timeline `style` does. If the chosen image cannot be loaded within 2 s, the
|
|
1706
|
+
* screenshot or video keeps the style's own background (the `auto` background preset unless `background`
|
|
1707
|
+
* names another) and `warnings` says so (`background_fallback`). The default `auto` background already
|
|
1708
|
+
* draws a library image, on videos and styled screenshots; this picks from the whole library instead of
|
|
1709
|
+
* the video set.
|
|
1635
1710
|
*/
|
|
1636
1711
|
background_ref?: string;
|
|
1637
1712
|
/**
|
|
@@ -1769,26 +1844,156 @@ export interface RenderStyleOverrides {
|
|
|
1769
1844
|
layout?: "default" | "bottom-cropped";
|
|
1770
1845
|
/** Text for the window's title bar, drawn by the compositor and never parsed as HTML. */
|
|
1771
1846
|
frame_title?: string;
|
|
1772
|
-
/**
|
|
1847
|
+
/**
|
|
1848
|
+
* Text for the address pill of a browser frame, and for a `mac` title bar that has no title (a video's
|
|
1849
|
+
* never does), drawn by the compositor and never parsed as HTML.
|
|
1850
|
+
*/
|
|
1773
1851
|
frame_url?: string;
|
|
1774
1852
|
/** Flips the frame and the `auto` background. */
|
|
1775
1853
|
theme?: "light" | "dark";
|
|
1776
|
-
/**
|
|
1854
|
+
/**
|
|
1855
|
+
* 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
|
|
1856
|
+
* short side), about twice a system cursor against the page, as in Screen Studio; it grows with the camera's
|
|
1857
|
+
* zoom. On a screenshot, and with `look: 1`, 1 is the 22 px arrow on the page's scale.
|
|
1858
|
+
*/
|
|
1777
1859
|
cursor_size?: number;
|
|
1778
1860
|
/** `false` keeps the cursor's size while the camera zooms. */
|
|
1779
1861
|
cursor_zoom?: boolean;
|
|
1862
|
+
/**
|
|
1863
|
+
* How small the cursor gets when it clicks: it shrinks to this over 70 ms and springs back over 220 ms
|
|
1864
|
+
* after the release, with no overshoot. 0.8 by default; 1 turns it off. A video's only.
|
|
1865
|
+
*/
|
|
1866
|
+
cursor_press_scale?: number;
|
|
1867
|
+
/**
|
|
1868
|
+
* The click effect's color. Left out, B3 blue (#2F43FF), and on a video white at 45% where the page under
|
|
1869
|
+
* the click is darker than luma 100 or more saturated than 0.6, such as a blue button, so the ring shows
|
|
1870
|
+
* there (not with `look: 1`). Set, it is that color on every page.
|
|
1871
|
+
*/
|
|
1780
1872
|
click_color?: RenderColor;
|
|
1781
1873
|
/** How long the click effect lasts, 450 by default. */
|
|
1782
1874
|
click_duration_ms?: number;
|
|
1783
|
-
/**
|
|
1875
|
+
/**
|
|
1876
|
+
* Caption text size in pixels at 1080p, 34 by default. Each captions preset starts at its own size: 34 for
|
|
1877
|
+
* `default`, 42 for `bold`, 40 for `minimal` and 44 for `light`. A caption's box keeps at least 48 px (at
|
|
1878
|
+
* 1080p) from each side of a video's frame: a cue too wide for that wraps between its words, and a word too
|
|
1879
|
+
* wide for it alone draws that cue smaller (not with `look: 1`).
|
|
1880
|
+
*/
|
|
1784
1881
|
caption_size?: number;
|
|
1785
1882
|
caption_color?: RenderColor;
|
|
1786
|
-
|
|
1883
|
+
/**
|
|
1884
|
+
* The karaoke word being spoken: a color (`RenderColor`: hex, `rgb()` or a CSS color name), or `auto`, the
|
|
1885
|
+
* `default` captions' setting. `auto` takes the color from the video's background: a preset background
|
|
1886
|
+
* of the video set carries its own accent (the image's most characteristic color), any other image or a
|
|
1887
|
+
* gradient gives the most saturated color covering at least 5% of it, and a flat or grey one gives
|
|
1888
|
+
* #9CB0FF. That color is then lightened or darkened, its hue kept, until it reads at 4.5:1 or more
|
|
1889
|
+
* against the caption's box (or the background under the caption when the box is clear), stands 12
|
|
1890
|
+
* or more (CIELAB Delta E) from `caption_color` and, where the words to come are dimmer than the spoken
|
|
1891
|
+
* ones (`caption_upcoming` under 1), is 10 or more points of CIELAB lightness further from the box than
|
|
1892
|
+
* they are, so the word being spoken always stands apart from the words already spoken and is never the
|
|
1893
|
+
* 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
|
|
1894
|
+
* timeline's `captions.highlight`, so a restyle without a style and a re-export repeat it; a restyle
|
|
1895
|
+
* 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
|
|
1896
|
+
* #8B97FF, as before.
|
|
1897
|
+
*/
|
|
1898
|
+
caption_highlight?: RenderColor | "auto";
|
|
1787
1899
|
caption_background?: RenderColor;
|
|
1900
|
+
/**
|
|
1901
|
+
* Where burned-in captions sit for the whole video: `bottom` (the default) or `top`, centred in the caption
|
|
1902
|
+
* band beside the window. A cue never moves; the camera keeps every target it frames, and the cursor, at
|
|
1903
|
+
* least 24 px (at 1080p) clear of the pill instead. With `look: 1` a cue still moves to the other edge when a
|
|
1904
|
+
* step's target sits under it.
|
|
1905
|
+
*/
|
|
1788
1906
|
caption_position?: "bottom" | "top";
|
|
1789
|
-
/**
|
|
1907
|
+
/**
|
|
1908
|
+
* Karaoke: how bright the words still to come are, as an opacity of `caption_color`; the words already
|
|
1909
|
+
* spoken are `caption_color` and the word being spoken `caption_highlight`. 0.55 for the `default`
|
|
1910
|
+
* captions; 1 for the other presets, which draw the words to come like the spoken ones.
|
|
1911
|
+
*/
|
|
1912
|
+
caption_upcoming?: number;
|
|
1913
|
+
/**
|
|
1914
|
+
* Karaoke: how long a word takes to light, from the shade of the words to come to `caption_highlight`,
|
|
1915
|
+
* while the word before it settles to `caption_color`, so the light passes from one word to the next with
|
|
1916
|
+
* no frame where none is lit. Only colors change: the line never moves as words light. 80 for the
|
|
1917
|
+
* `default` captions; 0 (at once) for the other presets.
|
|
1918
|
+
*/
|
|
1919
|
+
caption_fade_ms?: number;
|
|
1920
|
+
/**
|
|
1921
|
+
* What a video draws around the caption where the window lies under it: when the camera zooms in until
|
|
1922
|
+
* the page fills the frame, or when the captions sit over the page. `blur`, the default on every preset,
|
|
1923
|
+
* blurs the window's pixels from 120 px (at 1080p) above the caption's box to the frame's edge,
|
|
1924
|
+
* progressively, from nothing to a 16 px blur (a Gaussian's standard deviation, as CSS `blur(16px)`) at
|
|
1925
|
+
* the box's edge and past it, and darkens light content there by up to 6% (dark content not at all), so
|
|
1926
|
+
* text beside, above and below the caption dissolves and is never cut by its edge. The wallpaper, the
|
|
1927
|
+
* caption and the cursor stay sharp; where the caption lies on the wallpaper, as at rest, nothing changes.
|
|
1928
|
+
* The blur keeps its own time: it stays through the pause between two lines on one page when the pause
|
|
1929
|
+
* is 1 s or less and the page lies under the caption at both of its ends, while only the caption fades,
|
|
1930
|
+
* and it fades in and out over 200 ms before the first line, after the last, at a page change and across
|
|
1931
|
+
* a longer pause (the timeline's `captions.backdrop`). `none` leaves the page around the caption as it is.
|
|
1932
|
+
* With `look: 1` there is none.
|
|
1933
|
+
*/
|
|
1934
|
+
caption_backdrop?: "blur" | "none";
|
|
1935
|
+
/**
|
|
1936
|
+
* A video's window proportions under the default `padding`. `tall` (the default) gives the window the
|
|
1937
|
+
* height screen recorders give it and the width a desktop page needs: 8% of the frame's height above and
|
|
1938
|
+
* below the window (more on the captions' side when they need it) and, on a landscape frame, 6.5% of the
|
|
1939
|
+
* width at each side, the window never wider than 2:1; at 1920x1080 a 1668x864 window, 80% of the frame's
|
|
1940
|
+
* height, over a 1440x746 default viewport, the page drawn 1.16 times its CSS size. `wide` is the first look
|
|
1941
|
+
* v2 shape: 9% of the frame's long edge on every side, the window as wide as that leaves (1568x734 at
|
|
1942
|
+
* 1920x1080 over a 1440x674 viewport, 2.14:1).
|
|
1943
|
+
*/
|
|
1944
|
+
window_shape?: "tall" | "wide";
|
|
1945
|
+
/**
|
|
1946
|
+
* Smear what moves over each frame's shutter, as a camera would: the window, page and background on every
|
|
1947
|
+
* frame of a zoom or pan that moves faster than `motion_blur_onset`, by its motion past it over half a
|
|
1948
|
+
* frame. On by default. Held frames, and frames the camera moves through slowly, stay sharp, exactly as
|
|
1949
|
+
* without it. At the default 60 fps the fastest frames of the default zoom-in soften and a paused one still
|
|
1950
|
+
* reads. A moving cursor stays
|
|
1951
|
+
* a sharp arrow on every frame, over a faint trail behind it of its motion across the shutter, at most three
|
|
1952
|
+
* quarters of the arrow long. With `look: 1` only the cursor's trail shows, as its smear did before.
|
|
1953
|
+
*/
|
|
1790
1954
|
motion_blur?: boolean;
|
|
1955
|
+
/**
|
|
1956
|
+
* How long the shutter stays open, in frames, centered on each frame's time: 0.5 by default (half a frame at the
|
|
1957
|
+
* default 60 fps). 1 is Screen Studio's whole frame (1/60 s at 60 fps), twice as long a smear.
|
|
1958
|
+
*/
|
|
1959
|
+
motion_blur_shutter?: number;
|
|
1960
|
+
/**
|
|
1961
|
+
* How fast what the camera shows must move at the frame's edge, on average and with the zoom's own rate,
|
|
1962
|
+
* before the window, page and background smear, in the frame's short sides a second, whatever the frame
|
|
1963
|
+
* rate: 0.45 by default, about 8 px a frame at 1080p and 60 fps, so slower frames stay sharp and a faster one
|
|
1964
|
+
* smears by `motion_blur_shutter` of the motion past it, up to `motion_blur_max`. Read at the edge, a zoom
|
|
1965
|
+
* about the middle of the frame blurs like a zoom into a corner. 0 smears every frame of a move from its first
|
|
1966
|
+
* pixel. The cursor's trail shows its own motion whatever this is.
|
|
1967
|
+
*/
|
|
1968
|
+
motion_blur_onset?: number;
|
|
1969
|
+
/**
|
|
1970
|
+
* The longest smear a camera move leaves at the frame's edge, on average, in pixels at 1080p: 6.5 by
|
|
1971
|
+
* default, so the fastest frames of every zoom soften alike (to about a quarter of the sharpness at rest)
|
|
1972
|
+
* and a paused one still reads. 200 lifts the limit.
|
|
1973
|
+
*/
|
|
1974
|
+
motion_blur_max?: number;
|
|
1975
|
+
/**
|
|
1976
|
+
* How close to its camera move's top speed a frame must be to smear: 0 by default, no such gate. 0.9 smears
|
|
1977
|
+
* only the two or three fastest frames of a move, as before 11-10.
|
|
1978
|
+
* `{"motion_blur_shutter": 1, "motion_blur_onset": 0, "motion_blur_max": 200}` smears every camera move by the
|
|
1979
|
+
* whole frame, as Screen Studio does.
|
|
1980
|
+
*/
|
|
1981
|
+
motion_blur_peak?: number;
|
|
1791
1982
|
matte?: RenderColor;
|
|
1983
|
+
/**
|
|
1984
|
+
* `1` draws a video in production's look from before 2026-11-11: its frame and layout (`padding`, 64 px at
|
|
1985
|
+
* 1080p by default, on every side, and the default viewport of then, 1440x730 at 1920x1080 in the browser
|
|
1986
|
+
* frame), the captions over the page near the window's foot, the 60% black caption pill, `bold` as 52 px
|
|
1987
|
+
* outlined text, the studio background for `auto`, 14 pixel corners, the old default shadow and a cursor
|
|
1988
|
+
* shown from the start. A new video gets a page-only camera, which zooms the page inside a window that
|
|
1989
|
+
* stands still, capped at 1.6x by default (`max_zoom` sets another; no `background_motion` or
|
|
1990
|
+
* `background_blur`), with today's move timings, and makes the poster the whole window after the last
|
|
1991
|
+
* step. Send it with `"frame": "browser"` to keep a video's old look. With it, `shadow: "soft"` is the old
|
|
1992
|
+
* black two-layer shadow, on a screenshot too. A restyle keeps the camera its video was recorded with, and
|
|
1993
|
+
* draws today's cursor, a sharp arrow over a faint trail, where production stamped copies of it. `2`, the
|
|
1994
|
+
* default, is the current look.
|
|
1995
|
+
*/
|
|
1996
|
+
look?: 1 | 2;
|
|
1792
1997
|
}
|
|
1793
1998
|
|
|
1794
1999
|
/** Give `url` or `html`. */
|
|
@@ -1797,7 +2002,9 @@ export type ScreenshotCreateRequest = {
|
|
|
1797
2002
|
url?: string;
|
|
1798
2003
|
/** HTML to render instead of loading a URL. Rendered with no network access. */
|
|
1799
2004
|
html?: string;
|
|
1800
|
-
/**
|
|
2005
|
+
/**
|
|
2006
|
+
* 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`.
|
|
2007
|
+
*/
|
|
1801
2008
|
profile?: string;
|
|
1802
2009
|
viewport?: Viewport;
|
|
1803
2010
|
/**
|
|
@@ -1854,6 +2061,7 @@ export type ScreenshotCreateRequest = {
|
|
|
1854
2061
|
quality?: number;
|
|
1855
2062
|
/** Extra encodings of the same capture, each an artifact. */
|
|
1856
2063
|
variants?: ScreenshotVariant[];
|
|
2064
|
+
auto_background?: AutoBackgroundOptions;
|
|
1857
2065
|
metadata?: Metadata;
|
|
1858
2066
|
};
|
|
1859
2067
|
|
|
@@ -1892,7 +2100,7 @@ export interface Screenshot {
|
|
|
1892
2100
|
final_url?: string;
|
|
1893
2101
|
page_state?: ScreenshotPageState;
|
|
1894
2102
|
/**
|
|
1895
|
-
* 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).
|
|
2103
|
+
* 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).
|
|
1896
2104
|
*/
|
|
1897
2105
|
warnings?: string[];
|
|
1898
2106
|
/** What the clean capture hid, by kind and signal, with how many (`overlays`, `block_ads`). */
|
|
@@ -1904,6 +2112,7 @@ export interface Screenshot {
|
|
|
1904
2112
|
* this page. Absent when the style draws no library background.
|
|
1905
2113
|
*/
|
|
1906
2114
|
background_ref?: string;
|
|
2115
|
+
auto_background?: AutoBackgroundChoice;
|
|
1907
2116
|
}
|
|
1908
2117
|
|
|
1909
2118
|
/**
|
|
@@ -1990,8 +2199,9 @@ export interface StepType {
|
|
|
1990
2199
|
target?: Target;
|
|
1991
2200
|
text: string;
|
|
1992
2201
|
/**
|
|
1993
|
-
* Delay between characters on the video's clock.
|
|
1994
|
-
*
|
|
2202
|
+
* Delay between characters on the video's clock. Left out, 35 ms: quick, steady typing, which reads well
|
|
2203
|
+
* on screen. The camera holds one shot on the field for the whole burst (`camera.typing_zoom`).
|
|
2204
|
+
* @default 35
|
|
1995
2205
|
*/
|
|
1996
2206
|
interval_ms?: number;
|
|
1997
2207
|
}
|
|
@@ -2042,7 +2252,9 @@ export interface Beat {
|
|
|
2042
2252
|
export interface VideoSource {
|
|
2043
2253
|
/** Where the recording starts. */
|
|
2044
2254
|
url: string;
|
|
2045
|
-
/**
|
|
2255
|
+
/**
|
|
2256
|
+
* 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`.
|
|
2257
|
+
*/
|
|
2046
2258
|
profile?: string;
|
|
2047
2259
|
}
|
|
2048
2260
|
|
|
@@ -2057,8 +2269,7 @@ export interface VoiceSpec {
|
|
|
2057
2269
|
|
|
2058
2270
|
export interface CaptionOptions {
|
|
2059
2271
|
/**
|
|
2060
|
-
* `none`: sidecar files only. `static
|
|
2061
|
-
* @default "static"
|
|
2272
|
+
* `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.
|
|
2062
2273
|
*/
|
|
2063
2274
|
burn_in?: "none" | "static" | "karaoke";
|
|
2064
2275
|
/** @default ["vtt"] */
|
|
@@ -2074,6 +2285,11 @@ export interface CaptionOptions {
|
|
|
2074
2285
|
export interface VideoOutput {
|
|
2075
2286
|
width: number;
|
|
2076
2287
|
height: number;
|
|
2288
|
+
/**
|
|
2289
|
+
* Frames per second of the video. The page is captured at 30 frames a second and the camera, cursor and
|
|
2290
|
+
* captions are drawn at this rate; while the page scrolls, a 60 fps video captures it at 60, once per output
|
|
2291
|
+
* frame (the timeline's `capture.stride` and `capture.full_rate`).
|
|
2292
|
+
*/
|
|
2077
2293
|
fps: 24 | 25 | 30 | 50 | 60;
|
|
2078
2294
|
}
|
|
2079
2295
|
|
|
@@ -2092,40 +2308,313 @@ export interface VideoCreateRequest {
|
|
|
2092
2308
|
voice?: VoiceSpec | null;
|
|
2093
2309
|
captions?: CaptionOptions;
|
|
2094
2310
|
/**
|
|
2095
|
-
* The look. Leave it out for the B3OS look
|
|
2096
|
-
*
|
|
2311
|
+
* The look. Leave it out, or send `{}`, for the B3OS look on the bare rounded window, with no bar;
|
|
2312
|
+
* `{"frame": "window"}` adds the traffic lights on a slim bar in the page's top color, and `{"frame":
|
|
2313
|
+
* "browser"}` an address pill.
|
|
2097
2314
|
*/
|
|
2098
2315
|
style?: RenderStyle;
|
|
2316
|
+
/**
|
|
2317
|
+
* How the camera follows the steps. The camera moves over the whole frame: as it zooms in, the window, its
|
|
2318
|
+
* shadow and the page grow together and the background and the window's edges leave the frame, while
|
|
2319
|
+
* captions stay where they are. By default (`framing: subject`) each page is held in one of three
|
|
2320
|
+
* compositions: the whole window, the page's main content area, or one panel (see `framing`). With
|
|
2321
|
+
* `framing: point`, before a click, select or typing step it zooms in on the element and stays in through
|
|
2322
|
+
* the whole step (a type until its last key), for 1.5 s at least; it stays in for the next step when that
|
|
2323
|
+
* one starts within 2.5 s, or is close by, and pans only when the next element nears the edge of the frame,
|
|
2324
|
+
* and only as far as brings it back in. Every move is one quick, damped spring with no overshoot:
|
|
2325
|
+
* 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
|
|
2326
|
+
* the next element sets off with the cursor, never before it, and takes longer the farther it goes, so the
|
|
2327
|
+
* middle of the frame moves at most 60 px a frame at 60 fps, or faster where that keeps the cursor 8% of
|
|
2328
|
+
* the frame inside its edges. An element near an edge of the window zooms with that edge held in place, so
|
|
2329
|
+
* the margin beside it stays in view, and where the whole window or page fits the frame, it stays whole,
|
|
2330
|
+
* with the room beside it split evenly when there is little to spare. The camera rests 1.5 s at least on
|
|
2331
|
+
* what it shows last before it zooms out, when the video has room before its end, and the last zoom holds
|
|
2332
|
+
* until the narration line about it has nearly ended. The video opens on the whole window
|
|
2333
|
+
* for half a second at least and ends on it for a second at least, so it can run a little past the last
|
|
2334
|
+
* beat.
|
|
2335
|
+
*/
|
|
2099
2336
|
camera?: {
|
|
2100
2337
|
/**
|
|
2101
|
-
*
|
|
2102
|
-
*
|
|
2338
|
+
* `auto` moves the camera. With `framing: subject`, the default, its zooms are its compositions' (see
|
|
2339
|
+
* `framing`) and what follows holds where it says so. With `framing: point` it zooms so the element and a
|
|
2340
|
+
* little around it fill about 45% of the frame width, from 1.25x up to `max_zoom`, and 1.25x on an
|
|
2341
|
+
* element in a nav, aside or header bar, where the change it causes is
|
|
2342
|
+
* usually elsewhere on the page. A zoom under 1.4x is not worth the move: the camera stays wide for it
|
|
2343
|
+
* (a nav element starting a session, a typing shot under 1.4x), and an element inside a zoomed session
|
|
2344
|
+
* that would zoom less is framed at the session's zoom. After a move lands, the next waits 1.2 s at
|
|
2345
|
+
* least: an element that comes sooner is framed with the one before it when both fit one view at 1.4x
|
|
2346
|
+
* or more, else the camera stays where it is for the earlier one and moves once, to the later one. With
|
|
2347
|
+
* `scroll: comfortable` the view changes (camera moves and page scrolls together) at most once per 2.5 s
|
|
2348
|
+
* on average over the video: over that, the move with the least change of zoom whose element was
|
|
2349
|
+
* already in view is left out, and the element is framed where the camera stands. A
|
|
2350
|
+
* re-centre under 96 px at 1080p is left out. A click that loads a new page ends the zoom: the camera
|
|
2351
|
+
* starts going wide 0.1 s after the new page first shows, also when the page's address changes only by
|
|
2352
|
+
* the next step. On a portrait frame the camera zooms at most as far as keeps the whole window across the
|
|
2353
|
+
* frame, and the 1.4x floor applies after that, so a portrait video stays on the whole window and only
|
|
2354
|
+
* its page scrolls. Held against one window edge, a view keeps a window edge on the other axis that shows
|
|
2355
|
+
* in the frame at its resting margin. With burned-in captions every element the camera frames, and the
|
|
2356
|
+
* cursor resting by it, stays at least 24 px (at 1080p) clear of the caption pill, and a zoomed hold keeps
|
|
2357
|
+
* the window's bottom edge where it rests, so the pill sits on the background under it, whenever the
|
|
2358
|
+
* element ends at least 20 px above that edge and starts at least 120 px below the frame's top; otherwise
|
|
2359
|
+
* the pill lies over the page. A hold never leaves the window's bottom edge between y 960 and 1080 at
|
|
2360
|
+
* 1080p: it moves it to 950 or below the frame. With both framings the 1.2 s between moves, the 2.5 s
|
|
2361
|
+
* 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
|
|
2362
|
+
* are kept, under 1.4x). `off` keeps the whole window in view.
|
|
2363
|
+
* @default "auto"
|
|
2364
|
+
*/
|
|
2365
|
+
style?: "auto" | "subtle" | "off";
|
|
2366
|
+
/**
|
|
2367
|
+
* The older spelling of `style`: `false` is `off`, `true` is `auto`. Send `style` instead. A request
|
|
2368
|
+
* whose `auto_zoom` and `style` disagree is refused with `invalid_request`.
|
|
2369
|
+
* @deprecated
|
|
2103
2370
|
*/
|
|
2104
2371
|
auto_zoom?: boolean;
|
|
2105
|
-
/**
|
|
2372
|
+
/**
|
|
2373
|
+
* The most the camera zooms, never exceeded. A small button reaches it; a wide element zooms less, so it
|
|
2374
|
+
* fits. Left out, the camera zooms up to 1.7x, or to the zoom within 10% of it where one captured pixel
|
|
2375
|
+
* lands on one output pixel (1.73x on the default canvas and viewport, two output pixels per CSS pixel;
|
|
2376
|
+
* 1.84x with `window_shape: wide`), so zoomed text is as sharp as the page. Left out, it never magnifies
|
|
2377
|
+
* the page past three output pixels per CSS pixel at 1080p, so a phone layout on a portrait video, drawn
|
|
2378
|
+
* at about twice its size, zooms about 1.4x. Above that the zoom enlarges the capture, and text is a
|
|
2379
|
+
* little softer. The zoom magnifies the whole frame, window and page alike. With `look: 1`, left out
|
|
2380
|
+
* it is 1.6, production's cap, which lands at 1.61x, one to one, on that look's default canvas, and
|
|
2381
|
+
* the zoom magnifies the page inside the window.
|
|
2382
|
+
* @default 1.7
|
|
2383
|
+
*/
|
|
2106
2384
|
max_zoom?: number;
|
|
2385
|
+
/**
|
|
2386
|
+
* How far the background follows the window as the camera moves: 0 holds it still, 1 moves and zooms
|
|
2387
|
+
* it with the window, so the whole frame zooms as one. At the default it moves and zooms a tenth as
|
|
2388
|
+
* much, a slight depth behind the window.
|
|
2389
|
+
* @default 0.1
|
|
2390
|
+
*/
|
|
2391
|
+
background_motion?: number;
|
|
2392
|
+
/**
|
|
2393
|
+
* Blur the background: an image background is drawn 4 px soft on the whole window (at 1080p, scaled
|
|
2394
|
+
* with the frame), so the window stays the busiest thing in the frame, and softens further as the camera
|
|
2395
|
+
* zooms in, about 7 px at 1.6x on a 1080p video, at most 16 px. `false` keeps it sharp throughout, and
|
|
2396
|
+
* `overrides.look: 1` draws it sharp at rest. Left out, it is on for an image background (the default
|
|
2397
|
+
* look's library images among them) and off for gradients, solid colors and patterns, where a blur shows
|
|
2398
|
+
* little or erases the pattern. Gradients, solid colors and patterns are never blurred at rest. It is
|
|
2399
|
+
* decided before the first frame, so a default video drawn on its studio fallback (no library image
|
|
2400
|
+
* clears the page's edges, or the image could not be loaded) blurs that mesh as the camera zooms; send
|
|
2401
|
+
* `false` to keep it sharp.
|
|
2402
|
+
*/
|
|
2403
|
+
background_blur?: boolean;
|
|
2404
|
+
/**
|
|
2405
|
+
* The zoom of a typing shot: a field typed into (a `type` step, or a click a `type` without a target
|
|
2406
|
+
* follows) is framed from its start at this zoom, reached by the first key (the cursor gets there half a
|
|
2407
|
+
* second early) and held for the whole
|
|
2408
|
+
* burst, with no move per key; a click right after it on something already in view stays in the
|
|
2409
|
+
* same shot.
|
|
2410
|
+
* It is never less than the camera's least zoom, 1.25x, which is what 1 gives, never more than
|
|
2411
|
+
* `max_zoom`, nor more than the zoom where the page is as sharp as captured (1.73x on the default
|
|
2412
|
+
* canvas), so the default types at 1.73x. `style: subtle` keeps its own ceiling, and a field in a nav,
|
|
2413
|
+
* aside or header bar its own zoom. With `framing: subject` a field typed into is a DETAIL when it
|
|
2414
|
+
* qualifies (see `framing`), at this zoom at most, and otherwise held in the page's main content area.
|
|
2415
|
+
* @default 2
|
|
2416
|
+
*/
|
|
2417
|
+
typing_zoom?: number;
|
|
2418
|
+
/**
|
|
2419
|
+
* What the camera holds. `subject` (the default) holds each page in one of three compositions. The
|
|
2420
|
+
* whole window. MAIN, the page's main content area across the frame: the content box of its `main` (or
|
|
2421
|
+
* `role="main"`) element when that is wider than half the viewport, else the viewport less a fixed or
|
|
2422
|
+
* sticky sidebar or header bar, with 24 CSS px each side, from 1.25x up to `max_zoom` (1.42x on the B3OS
|
|
2423
|
+
* console); a page with neither has no MAIN and is held on the whole window, where the first element a
|
|
2424
|
+
* step acts on or the narration names is a DETAIL whatever the length of its line (an element with no
|
|
2425
|
+
* enclosing panel framed by its own box), an element that DETAIL shows stays in it, and a page's DETAILs
|
|
2426
|
+
* come at most one per 4 s. DETAIL, one panel or control:
|
|
2427
|
+
* the nearest enclosing element that draws a box of its own (a background, a border, a shadow or
|
|
2428
|
+
* rounded corners) or is a section, article, main, form, table, list, dialog or region, at least 240 x
|
|
2429
|
+
* 120 CSS px or 1.3 times the element on both axes, or the element's own row when that panel is too wide
|
|
2430
|
+
* for 1.4x, at up to `max_zoom`, only when it is narrower than 45% of MAIN's view, its narration line (or
|
|
2431
|
+
* its typing) lasts 2 s or more from the step, it zooms at least 1.1x MAIN's zoom, and its view keeps the
|
|
2432
|
+
* window's bottom edge where it rests or holds the element above the caption band. A page opens on the
|
|
2433
|
+
* whole window, goes to MAIN at its first step or narrated element, may go to a DETAIL (held through its
|
|
2434
|
+
* line) and back, goes from one DETAIL to another only within 40% of the frame's width, and goes wide
|
|
2435
|
+
* again only at a click that loads a new page or at the end; an element outside MAIN across, such as a
|
|
2436
|
+
* sidebar link, is reached wide. MAIN keeps the window's bottom edge where it rests, the caption pill on
|
|
2437
|
+
* the background under it; for a beat whose element lies above that view, or whose label starts less than
|
|
2438
|
+
* 24 CSS px under that view's top edge, its top is the window's top,
|
|
2439
|
+
* the pill over the page, and a page moves between the two at most once, in one 0.4 s vertical move (it
|
|
2440
|
+
* stays top-anchored when its elements would need more). A click that loads a new path starts a new page,
|
|
2441
|
+
* which takes its own position as it first shows: where the camera holds MAIN across the click at one
|
|
2442
|
+
* zoom, it cuts there with the page, with no move. Where page content lies under the captions, no
|
|
2443
|
+
* element the camera frames, no typed text and no resting cursor sits within 120 px (at 1080p) above the
|
|
2444
|
+
* pill's top. A DETAIL's view is placed by its panel, never by the click: centred on it, or from 24 px
|
|
2445
|
+
* left of its left edge when it is wider than the view, with the element and the cursor kept 24 px
|
|
2446
|
+
* inside, and an edge that would cut a neighbouring panel moves to the gap beside it when that is within
|
|
2447
|
+
* 20% of the frame's width. A hover the narration speaks over, and an element a `wait` step waits for (by
|
|
2448
|
+
* `for.selector` or `for.text`) while a line is spoken, are followed too, a wait only when no click,
|
|
2449
|
+
* hover, select or typing follows it in its beat; the first such element of a line is in view from 0.3 s
|
|
2450
|
+
* before the line starts, and so is an element waited for after clicks in its line that all land inside
|
|
2451
|
+
* it, once a scroll before it has landed. A click that opens a beat after the first lands 0.3 s after its
|
|
2452
|
+
* line starts, the cursor setting off in the pause before the line, and an element waited for after it is
|
|
2453
|
+
* that line's element; a `wait` for a heading names its section's first panel. The closing zoom-out starts
|
|
2454
|
+
* at least 1.2 s after the last narrated element is shown. After a click that loads a new page, the first
|
|
2455
|
+
* element waited
|
|
2456
|
+
* 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
|
|
2457
|
+
* the new page first shows, or, still in MAIN on the page the click left at the same zoom, cuts to it as
|
|
2458
|
+
* it first shows, and holds until 0.8 s after its line ends, and the video leaves
|
|
2459
|
+
* 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
|
|
2460
|
+
* page's main content box as its step runs (`observed.subject` in the timeline). `point` frames the click
|
|
2461
|
+
* point, at the zoom that fits the element, and leaves hovers and waits to the cursor, as before. With
|
|
2462
|
+
* `look: 1` the camera frames the point.
|
|
2463
|
+
* @default "subject"
|
|
2464
|
+
*/
|
|
2465
|
+
framing?: "subject" | "point";
|
|
2466
|
+
};
|
|
2467
|
+
/**
|
|
2468
|
+
* How the page scrolls to what a step acts on or waits for. `comfortable`: an element outside the middle of
|
|
2469
|
+
* the viewport (8% to 85% of its height) scrolls its panel (see `camera.framing`) to the middle, its top at
|
|
2470
|
+
* 20% when the panel is taller than 40% of the viewport, else centred at 45%, the element kept in that band,
|
|
2471
|
+
* and up to 24 px further so the viewport's edges fall between lines of text: before the cursor sets off
|
|
2472
|
+
* 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
|
|
2473
|
+
* with its fastest moment at its middle, and lands 0.3 s before), and as a waited-for element appears. A
|
|
2474
|
+
* 60 fps video captures its page once per output frame while it scrolls (at 30 fps elsewhere), so the page
|
|
2475
|
+
* moves a little every frame. A scroll always runs its whole length: the step and the rest of its beat wait
|
|
2476
|
+
* for it. A scroll that brings in the element a narration line names runs in the pause before the line and
|
|
2477
|
+
* ends by its start (0.3 s before it when there is room); when the pause is shorter than the scroll, the line
|
|
2478
|
+
* and everything after it wait for it, 0.8 s at most. Before the scrolls are planned step by step, a page
|
|
2479
|
+
* whose elements all show in the camera's view at one scroll position scrolls once, to that position, in the
|
|
2480
|
+
* pause before the first line that needs it, and never again. A scroll that serves a later beat runs before
|
|
2481
|
+
* that beat. An element already in
|
|
2482
|
+
* the band never scrolls the page, and while the camera is zoomed, an element whose panel the viewport
|
|
2483
|
+
* shows whole is reached by moving the camera (`framing: "point"`); with the default framing the camera
|
|
2484
|
+
* holds the page's view instead, so the scroll is left out only when that view already shows the panel
|
|
2485
|
+
* whole above the caption. The page never goes up and back down: of two scrolls in
|
|
2486
|
+
* opposite directions within 4 s that move it on by less than 25% of their total, one or both are left out
|
|
2487
|
+
* whenever the steps they serve stay in the viewport without them, or the two become one scroll to a position
|
|
2488
|
+
* that keeps them all in view (a step's element is never left out of the viewport); when neither works, both
|
|
2489
|
+
* run at their whole length, and `result.warnings` and the timeline's `warnings` have `scroll_round_trip`. A
|
|
2490
|
+
* scroll for an element in a sticky box is left out when it can be. A scroll never runs
|
|
2491
|
+
* during a camera move (it ends 0.1 s before one starts, or starts 0.1 s after one lands; a zoom-out waits
|
|
2492
|
+
* for the scroll that brings a waited-for element), a scrolled result stays put 1.2 s, and a narration line
|
|
2493
|
+
* scrolls the page once. Before the closing zoom-out a scrolled page goes back to the top whenever the last
|
|
2494
|
+
* 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
|
|
2495
|
+
* result with a `wait` step
|
|
2496
|
+
* (`for.selector` or `for.text`) and the camera brings it into view. `minimal` scrolls only an
|
|
2497
|
+
* element outside the viewport, to its middle, as before. `off` moves the page only by the script's own
|
|
2498
|
+
* `scroll` steps: a step whose element is outside the viewport fails as one whose element is not found. With
|
|
2499
|
+
* `look: 1` the page scrolls as `minimal`.
|
|
2500
|
+
* @default "comfortable"
|
|
2501
|
+
*/
|
|
2502
|
+
scroll?: "comfortable" | "minimal" | "off";
|
|
2503
|
+
/**
|
|
2504
|
+
* How the cursor moves. It shows from the first frame, with no fade-in, parked on the first of six spots
|
|
2505
|
+
* that is plain on the video's first frame and on its frame just before the cursor first moves, as
|
|
2506
|
+
* captured, and clear of text, controls and images on the page just before the first step: right of
|
|
2507
|
+
* and below the middle of the page (62% across, 68% down), near its bottom right (88%, 88%), low in the
|
|
2508
|
+
* middle (50%, 92%), at its right edge (92%, 50%), in its bottom-right corner (96%, 96%) or at the middle
|
|
2509
|
+
* of its bottom edge (50%, 97%); the page gets no pointer event until the cursor's first move has ended, so
|
|
2510
|
+
* 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
|
|
2511
|
+
* does, and lands when it would have; after a click, a select or the first key typed into a field, the
|
|
2512
|
+
* cursor moves just off the element, so it never covers its label or the text being typed while the camera
|
|
2513
|
+
* holds. After a hover, and while typing, it rests where its arrow covers no text, badge or control and
|
|
2514
|
+
* stays at least 8 px inside the page: below and right of the hovered label's own text (of the hovered
|
|
2515
|
+
* point on a target wider than 400 px whose text runs as wide, such as a table row), else right of it,
|
|
2516
|
+
* else another spot that keeps the arrow's tip within 24 px of the label (a table's header cells count as
|
|
2517
|
+
* text); while typing, under the field, beside
|
|
2518
|
+
* it or above it, else another spot within 24 px of it, else inside it past the end of the typed text. A
|
|
2519
|
+
* hover's rest is checked again on the captured page as the cursor sets off for it: where its arrow would
|
|
2520
|
+
* lie on text there, it rests at the first clear spot beside, below or above the element (or on the
|
|
2521
|
+
* element itself), the least busy one when none is clear.
|
|
2522
|
+
* When the page scrolls under the resting cursor, it stands still while the page moves, then, 150 ms
|
|
2523
|
+
* after the scroll ends, moves once off what it landed on, across it (under or above a label, beside a
|
|
2524
|
+
* tall box) up to 64 px, else up to 40 px to the nearest spot clear of what scrolled there; it stays when
|
|
2525
|
+
* 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`
|
|
2526
|
+
* moves it as before (hidden until it fades in at the middle before its first move).
|
|
2527
|
+
*/
|
|
2528
|
+
cursor?: {
|
|
2529
|
+
/**
|
|
2530
|
+
* How long each move takes to settle: the remaining distance falls to about a third of itself every
|
|
2531
|
+
* 100 ms near the end at the default. 0 keeps the eased path without smoothing.
|
|
2532
|
+
* @default 100
|
|
2533
|
+
*/
|
|
2534
|
+
smoothing_ms?: number;
|
|
2535
|
+
/**
|
|
2536
|
+
* Still this long, the cursor fades out over 0.4 s, and it fades back in over 0.3 s before its next
|
|
2537
|
+
* move; still to the end of the video, it stays hidden. 0 never hides it; under 500 counts as 500.
|
|
2538
|
+
* @default 2000
|
|
2539
|
+
*/
|
|
2540
|
+
hide_after_ms?: number;
|
|
2541
|
+
/**
|
|
2542
|
+
* After a click, a select or the first key typed into a field, move the cursor just below the element
|
|
2543
|
+
* (above it near the bottom of the page) when the next move can wait for it. A hover never moves off.
|
|
2544
|
+
* @default true
|
|
2545
|
+
*/
|
|
2546
|
+
move_aside?: boolean;
|
|
2107
2547
|
};
|
|
2548
|
+
/**
|
|
2549
|
+
* The page's CSS size. Left out, 1440 px wide on a landscape frame and 430 on a portrait one, as tall as the
|
|
2550
|
+
* window's shape; a square or near-square frame (no wider than 4:3) gets about its window's width, so its page
|
|
2551
|
+
* is drawn at least one pixel per CSS pixel at rest.
|
|
2552
|
+
*/
|
|
2108
2553
|
viewport?: Viewport;
|
|
2109
2554
|
output?: VideoOutput;
|
|
2110
2555
|
/** @default ["mp4","poster"] */
|
|
2111
2556
|
formats?: VideoFormat[];
|
|
2112
2557
|
/** Seeds the page's randomness so a re-render is identical. */
|
|
2113
2558
|
seed?: number;
|
|
2114
|
-
/**
|
|
2559
|
+
/**
|
|
2560
|
+
* 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.
|
|
2561
|
+
*/
|
|
2115
2562
|
start_time?: string;
|
|
2116
2563
|
recording?: RecordingOptions;
|
|
2564
|
+
auto_background?: AutoBackgroundOptions;
|
|
2117
2565
|
webhook?: WebhookConfig;
|
|
2118
2566
|
metadata?: Metadata;
|
|
2119
2567
|
}
|
|
2120
2568
|
|
|
2569
|
+
/**
|
|
2570
|
+
* How the default `background: auto` picks its library image, for this request. Each field overrides the
|
|
2571
|
+
* project's, then the organization's, then the node's setting. By default the node keeps one pick per
|
|
2572
|
+
* organization and site (the page's registrable domain, such as `linear.app` for `app.linear.app`; the host for
|
|
2573
|
+
* `localhost` and IP addresses): the vision model's first pick for a site is kept, and later videos and
|
|
2574
|
+
* screenshots of the site draw the same image while it clears their page's edges. A color-rules pick is not
|
|
2575
|
+
* kept, so the site's next video or screenshot asks the model again.
|
|
2576
|
+
*/
|
|
2577
|
+
export interface AutoBackgroundOptions {
|
|
2578
|
+
/**
|
|
2579
|
+
* 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.
|
|
2580
|
+
*/
|
|
2581
|
+
pin?: string;
|
|
2582
|
+
/**
|
|
2583
|
+
* 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.
|
|
2584
|
+
* @default false
|
|
2585
|
+
*/
|
|
2586
|
+
repick?: boolean;
|
|
2587
|
+
/**
|
|
2588
|
+
* `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.
|
|
2589
|
+
*/
|
|
2590
|
+
vision?: boolean;
|
|
2591
|
+
}
|
|
2592
|
+
|
|
2593
|
+
/**
|
|
2594
|
+
* 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`).
|
|
2595
|
+
*/
|
|
2596
|
+
export interface AutoBackgroundChoice {
|
|
2597
|
+
ref: string;
|
|
2598
|
+
/**
|
|
2599
|
+
* `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.
|
|
2600
|
+
*/
|
|
2601
|
+
chosen_by: "vision" | "heuristic" | "pinned" | "stored";
|
|
2602
|
+
/** The site the pick is kept under. Absent for an `html` source. */
|
|
2603
|
+
key?: string;
|
|
2604
|
+
/** The model's one-line reason (`vision`), or why the color rules chose (`heuristic`). */
|
|
2605
|
+
reason?: string;
|
|
2606
|
+
}
|
|
2607
|
+
|
|
2121
2608
|
/**
|
|
2122
2609
|
* Where the page's network traffic comes from. By default every video loads the site live and records that
|
|
2123
2610
|
* load (its capture segments replay the recording, so they all see the same content). With `reuse: true` the
|
|
2124
2611
|
* video replays the newest recording another video of this project made of the same source URL, steps,
|
|
2125
2612
|
* viewport, seed and start time within `max_age_s`, instead of loading the site again: faster, and the
|
|
2126
|
-
* content is what the site served then.
|
|
2127
|
-
*
|
|
2128
|
-
*
|
|
2613
|
+
* content is what the site served then. Videos without `start_time` match each other, and the replay runs on
|
|
2614
|
+
* the clock the recording was made on, so the page shows that time. A video that sends back such a video's
|
|
2615
|
+
* `result.start_time` replays that recording too. When no such recording exists the site is loaded and
|
|
2616
|
+
* recorded as usual. `result.recording` says which happened. Recordings hold the page's
|
|
2617
|
+
* responses; they are deleted 24 hours after they were made, or earlier with the last video that used them.
|
|
2129
2618
|
*/
|
|
2130
2619
|
export interface RecordingOptions {
|
|
2131
2620
|
/** @default false */
|
|
@@ -2182,6 +2671,10 @@ export interface VideoResult {
|
|
|
2182
2671
|
width: number;
|
|
2183
2672
|
height: number;
|
|
2184
2673
|
fps: number;
|
|
2674
|
+
/**
|
|
2675
|
+
* 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.
|
|
2676
|
+
*/
|
|
2677
|
+
start_time?: string;
|
|
2185
2678
|
/**
|
|
2186
2679
|
* The MP4 first (when asked for), then the poster, the caption files, the GIF and, when a beat has a title, the chapters file.
|
|
2187
2680
|
*/
|
|
@@ -2189,9 +2682,10 @@ export interface VideoResult {
|
|
|
2189
2682
|
recording?: RecordingInfo;
|
|
2190
2683
|
narration?: NarrationInfo;
|
|
2191
2684
|
/**
|
|
2192
|
-
* 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.
|
|
2685
|
+
* 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.
|
|
2193
2686
|
*/
|
|
2194
2687
|
warnings?: string[];
|
|
2688
|
+
auto_background?: AutoBackgroundChoice;
|
|
2195
2689
|
}
|
|
2196
2690
|
|
|
2197
2691
|
/**
|
|
@@ -2258,7 +2752,7 @@ export interface RenderTimeline {
|
|
|
2258
2752
|
};
|
|
2259
2753
|
capture: {
|
|
2260
2754
|
/**
|
|
2261
|
-
* Page capture
|
|
2755
|
+
* 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).
|
|
2262
2756
|
* @default 30
|
|
2263
2757
|
*/
|
|
2264
2758
|
fps: number;
|
|
@@ -2280,14 +2774,22 @@ export interface RenderTimeline {
|
|
|
2280
2774
|
*/
|
|
2281
2775
|
segments?: number;
|
|
2282
2776
|
/**
|
|
2283
|
-
* 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.
|
|
2777
|
+
* 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.
|
|
2284
2778
|
* @default "auto"
|
|
2285
2779
|
*/
|
|
2286
2780
|
dsf?: 1 | 2 | "auto";
|
|
2287
2781
|
/**
|
|
2288
|
-
* 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.
|
|
2782
|
+
* 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.
|
|
2783
|
+
*/
|
|
2784
|
+
segment_dsf?: number[];
|
|
2785
|
+
/**
|
|
2786
|
+
* 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.
|
|
2289
2787
|
*/
|
|
2290
|
-
|
|
2788
|
+
stride?: number;
|
|
2789
|
+
/**
|
|
2790
|
+
* 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.
|
|
2791
|
+
*/
|
|
2792
|
+
full_rate?: number[][];
|
|
2291
2793
|
};
|
|
2292
2794
|
/** Composed video. Output frame index i is presented at t = round(i * 1e6 / fps) us. */
|
|
2293
2795
|
output: {
|
|
@@ -2313,10 +2815,29 @@ export interface RenderTimeline {
|
|
|
2313
2815
|
captions?: RenderTimelinePresetRef;
|
|
2314
2816
|
click_effect?: RenderTimelinePresetRef;
|
|
2315
2817
|
/**
|
|
2316
|
-
* 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.
|
|
2818
|
+
* 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.
|
|
2317
2819
|
*/
|
|
2318
2820
|
overrides?: Record<string, unknown>;
|
|
2319
2821
|
};
|
|
2822
|
+
/**
|
|
2823
|
+
* 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.
|
|
2824
|
+
*/
|
|
2825
|
+
look?: {
|
|
2826
|
+
version: 2;
|
|
2827
|
+
/**
|
|
2828
|
+
* 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.
|
|
2829
|
+
*/
|
|
2830
|
+
background_pick?: string;
|
|
2831
|
+
/**
|
|
2832
|
+
* 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).
|
|
2833
|
+
*/
|
|
2834
|
+
background_choice?: {
|
|
2835
|
+
ref: string;
|
|
2836
|
+
chosen_by: "vision" | "heuristic" | "pinned" | "stored";
|
|
2837
|
+
key?: string;
|
|
2838
|
+
reason?: string;
|
|
2839
|
+
};
|
|
2840
|
+
};
|
|
2320
2841
|
/**
|
|
2321
2842
|
* Where the page layer lands in the output frame, computed by b3os-compose from style and output size and recorded for reproducibility.
|
|
2322
2843
|
*/
|
|
@@ -2341,7 +2862,7 @@ export interface RenderTimeline {
|
|
|
2341
2862
|
*/
|
|
2342
2863
|
actions: RenderTimelineAction[];
|
|
2343
2864
|
/**
|
|
2344
|
-
* 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.
|
|
2865
|
+
* 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.
|
|
2345
2866
|
*/
|
|
2346
2867
|
cursor?: {
|
|
2347
2868
|
points: {
|
|
@@ -2350,12 +2871,34 @@ export interface RenderTimeline {
|
|
|
2350
2871
|
y: number;
|
|
2351
2872
|
pressed?: boolean;
|
|
2352
2873
|
visible?: boolean;
|
|
2874
|
+
/**
|
|
2875
|
+
* 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).
|
|
2876
|
+
*/
|
|
2877
|
+
fade_us?: RenderTimelineUs;
|
|
2353
2878
|
}[];
|
|
2879
|
+
/**
|
|
2880
|
+
* 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.
|
|
2881
|
+
*/
|
|
2882
|
+
pointer_from_us?: RenderTimelineUs;
|
|
2354
2883
|
};
|
|
2355
2884
|
/**
|
|
2356
|
-
* 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.
|
|
2885
|
+
* 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.
|
|
2357
2886
|
*/
|
|
2358
2887
|
camera?: {
|
|
2888
|
+
/**
|
|
2889
|
+
* What the keyframes move: the page inside a fixed window (page; every timeline from before look v2), or the whole composition (canvas).
|
|
2890
|
+
* @default "page"
|
|
2891
|
+
*/
|
|
2892
|
+
space?: "page" | "canvas";
|
|
2893
|
+
/**
|
|
2894
|
+
* Canvas space: how far the background follows the card, 0 (still) to 1 (zooms with it: the whole composition zooms as one).
|
|
2895
|
+
* @default 0.1
|
|
2896
|
+
*/
|
|
2897
|
+
background_motion?: number;
|
|
2898
|
+
/**
|
|
2899
|
+
* 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.
|
|
2900
|
+
*/
|
|
2901
|
+
background_blur?: boolean;
|
|
2359
2902
|
keyframes: {
|
|
2360
2903
|
t_us: RenderTimelineUs;
|
|
2361
2904
|
center: RenderTimelinePoint;
|
|
@@ -2376,6 +2919,26 @@ export interface RenderTimeline {
|
|
|
2376
2919
|
/** @default 20 */
|
|
2377
2920
|
max_chars_per_second?: number;
|
|
2378
2921
|
cues: RenderTimelineCue[];
|
|
2922
|
+
/**
|
|
2923
|
+
* 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.
|
|
2924
|
+
*/
|
|
2925
|
+
highlight?: {
|
|
2926
|
+
/** The word's color, #rrggbb. */
|
|
2927
|
+
color: string;
|
|
2928
|
+
/**
|
|
2929
|
+
* 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.
|
|
2930
|
+
*/
|
|
2931
|
+
source: "auto" | "preset" | "request";
|
|
2932
|
+
};
|
|
2933
|
+
/**
|
|
2934
|
+
* 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.
|
|
2935
|
+
*/
|
|
2936
|
+
backdrop?: {
|
|
2937
|
+
/** The run's first cue's start. */
|
|
2938
|
+
start_us: number;
|
|
2939
|
+
/** The run's last cue's end. */
|
|
2940
|
+
end_us: number;
|
|
2941
|
+
}[];
|
|
2379
2942
|
};
|
|
2380
2943
|
/**
|
|
2381
2944
|
* Per capture frame: the viewport region to capture. Sent to the recorder for each segment. Frames not listed are not captured.
|
|
@@ -2383,6 +2946,10 @@ export interface RenderTimeline {
|
|
|
2383
2946
|
capture_plan?: RenderTimelineCaptureFrame[];
|
|
2384
2947
|
/** Optional FrameState dump (debugging, tests, GET .../timeline?frames=true). */
|
|
2385
2948
|
frames?: RenderTimelineFrameState[];
|
|
2949
|
+
/**
|
|
2950
|
+
* 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.
|
|
2951
|
+
*/
|
|
2952
|
+
warnings?: string[];
|
|
2386
2953
|
}
|
|
2387
2954
|
|
|
2388
2955
|
/** Microseconds on the virtual timeline. */
|
|
@@ -2459,10 +3026,74 @@ export interface RenderTimelineObservation {
|
|
|
2459
3026
|
* The target sits inside nav, aside or a header bar (or their landmark roles); the camera zooms less there (1.25x).
|
|
2460
3027
|
*/
|
|
2461
3028
|
landmark?: "nav" | "aside" | "header";
|
|
3029
|
+
/**
|
|
3030
|
+
* 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).
|
|
3031
|
+
*/
|
|
3032
|
+
doc_min?: number;
|
|
3033
|
+
/**
|
|
3034
|
+
* 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.
|
|
3035
|
+
*/
|
|
3036
|
+
ink?: number[][];
|
|
3037
|
+
/** Look v2 round 4f: the same rows for what fixed elements draw, in viewport CSS px. */
|
|
3038
|
+
ink_fixed?: number[][];
|
|
2462
3039
|
/**
|
|
2463
3040
|
* 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.
|
|
2464
3041
|
*/
|
|
2465
3042
|
ahead_us?: RenderTimelineUs;
|
|
3043
|
+
/**
|
|
3044
|
+
* 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.
|
|
3045
|
+
*/
|
|
3046
|
+
subject?: {
|
|
3047
|
+
/** The document's scroll offset when the boxes were measured. */
|
|
3048
|
+
scroll: RenderTimelinePoint;
|
|
3049
|
+
/**
|
|
3050
|
+
* The scroll offset before the recorder scrolled the page to the target (scroll: comfortable); absent when it did not.
|
|
3051
|
+
*/
|
|
3052
|
+
from?: RenderTimelinePoint;
|
|
3053
|
+
target: RenderTimelineRect;
|
|
3054
|
+
/** The target's ancestors with a box, nearest first, up to the body (left out). */
|
|
3055
|
+
ancestors?: {
|
|
3056
|
+
rect: RenderTimelineRect;
|
|
3057
|
+
tag?: string;
|
|
3058
|
+
role?: string;
|
|
3059
|
+
/** It draws a box of its own: a background, a border, a shadow or rounded corners. */
|
|
3060
|
+
panel?: boolean;
|
|
3061
|
+
/**
|
|
3062
|
+
* A sectioning or grouping element or role: table, form, section, article, main, dialog, fieldset, figure, a list, a region, group, tab panel or grid.
|
|
3063
|
+
*/
|
|
3064
|
+
group?: boolean;
|
|
3065
|
+
/** A row or list item: tr, li, row, listitem, option, treeitem. */
|
|
3066
|
+
row?: boolean;
|
|
3067
|
+
}[];
|
|
3068
|
+
/**
|
|
3069
|
+
* 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.
|
|
3070
|
+
*/
|
|
3071
|
+
panel?: number;
|
|
3072
|
+
/**
|
|
3073
|
+
* The boxes of that subject's siblings: a held view's edge never rests inside one when a gap beside it is near.
|
|
3074
|
+
*/
|
|
3075
|
+
siblings?: RenderTimelineRect[];
|
|
3076
|
+
/**
|
|
3077
|
+
* 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.
|
|
3078
|
+
*/
|
|
3079
|
+
rows?: RenderTimelineRect[];
|
|
3080
|
+
/**
|
|
3081
|
+
* 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.
|
|
3082
|
+
*/
|
|
3083
|
+
main?: RenderTimelineRect;
|
|
3084
|
+
/**
|
|
3085
|
+
* 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.
|
|
3086
|
+
*/
|
|
3087
|
+
sticky?: boolean;
|
|
3088
|
+
};
|
|
3089
|
+
/**
|
|
3090
|
+
* 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.
|
|
3091
|
+
*/
|
|
3092
|
+
rest?: RenderTimelinePoint;
|
|
3093
|
+
/**
|
|
3094
|
+
* 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.
|
|
3095
|
+
*/
|
|
3096
|
+
busy?: RenderTimelineRect[];
|
|
2466
3097
|
error?: {
|
|
2467
3098
|
code: string;
|
|
2468
3099
|
detail?: string;
|
|
@@ -2504,8 +3135,7 @@ export type RenderTimelineAction = {
|
|
|
2504
3135
|
/** scroll: delta from the current offset. */
|
|
2505
3136
|
by?: RenderTimelinePoint;
|
|
2506
3137
|
/**
|
|
2507
|
-
* scroll: animation length on the virtual clock.
|
|
2508
|
-
* @default 600000
|
|
3138
|
+
* 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).
|
|
2509
3139
|
*/
|
|
2510
3140
|
duration_us?: number;
|
|
2511
3141
|
easing?: RenderTimelineEasing;
|
|
@@ -2616,6 +3246,16 @@ export interface RenderTimelineFrameState {
|
|
|
2616
3246
|
y: number;
|
|
2617
3247
|
visible: boolean;
|
|
2618
3248
|
pressed: boolean;
|
|
3249
|
+
/**
|
|
3250
|
+
* Below 1 while the cursor fades in or out (a point's fade_us).
|
|
3251
|
+
* @default 1
|
|
3252
|
+
*/
|
|
3253
|
+
opacity?: number;
|
|
3254
|
+
/**
|
|
3255
|
+
* 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.
|
|
3256
|
+
* @default 0
|
|
3257
|
+
*/
|
|
3258
|
+
press?: number;
|
|
2619
3259
|
};
|
|
2620
3260
|
effects: {
|
|
2621
3261
|
kind: "click";
|
|
@@ -2627,13 +3267,40 @@ export interface RenderTimelineFrameState {
|
|
|
2627
3267
|
caption: null | {
|
|
2628
3268
|
cue: RenderTimelineLocalId;
|
|
2629
3269
|
lines: string[];
|
|
3270
|
+
/**
|
|
3271
|
+
* 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).
|
|
3272
|
+
*/
|
|
2630
3273
|
highlight?: {
|
|
2631
3274
|
line: number;
|
|
2632
3275
|
byte_start: number;
|
|
2633
3276
|
byte_end: number;
|
|
3277
|
+
/** How long ago the word started, at most 1 s. Absent: lit in full. */
|
|
3278
|
+
since_us?: number;
|
|
3279
|
+
/** The word before it in the cue. */
|
|
3280
|
+
previous?: {
|
|
3281
|
+
line: number;
|
|
3282
|
+
byte_start: number;
|
|
3283
|
+
byte_end: number;
|
|
3284
|
+
};
|
|
2634
3285
|
};
|
|
2635
3286
|
/** The cue's own position, over the caption style's. */
|
|
2636
3287
|
position?: "top" | "bottom";
|
|
3288
|
+
/**
|
|
3289
|
+
* 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).
|
|
3290
|
+
* @default 1
|
|
3291
|
+
*/
|
|
3292
|
+
opacity?: number;
|
|
3293
|
+
/**
|
|
3294
|
+
* 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.
|
|
3295
|
+
*/
|
|
3296
|
+
from?: {
|
|
3297
|
+
lines: string[];
|
|
3298
|
+
position?: "top" | "bottom";
|
|
3299
|
+
/** How far the text has crossfaded to this cue. */
|
|
3300
|
+
text: number;
|
|
3301
|
+
/** How far the box has moved from the old cue's size to this one's. */
|
|
3302
|
+
size: number;
|
|
3303
|
+
};
|
|
2637
3304
|
};
|
|
2638
3305
|
/**
|
|
2639
3306
|
* Opacity of the window layer (page, frame chrome, shadow, border, cursor, click effects) over the background; the background and the caption stay opaque.
|
|
@@ -2649,6 +3316,60 @@ export interface RenderTimelineFrameState {
|
|
|
2649
3316
|
cursor_dx?: number;
|
|
2650
3317
|
cursor_dy?: number;
|
|
2651
3318
|
};
|
|
3319
|
+
/**
|
|
3320
|
+
* 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.
|
|
3321
|
+
*/
|
|
3322
|
+
view?: {
|
|
3323
|
+
/**
|
|
3324
|
+
* The card's view: the window, its shadow, the page, the cursor and click effects show this rect scaled to the frame.
|
|
3325
|
+
*/
|
|
3326
|
+
card: RenderTimelineRect;
|
|
3327
|
+
/** The background's own view. Absent: the background moves with the card, unblurred. */
|
|
3328
|
+
background?: RenderTimelineRect;
|
|
3329
|
+
/**
|
|
3330
|
+
* The background's Gaussian blur, sigma in output px.
|
|
3331
|
+
* @default 0
|
|
3332
|
+
*/
|
|
3333
|
+
blur?: number;
|
|
3334
|
+
};
|
|
3335
|
+
/**
|
|
3336
|
+
* 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.
|
|
3337
|
+
*/
|
|
3338
|
+
shutter?: {
|
|
3339
|
+
/** Canvas space: view.card at open and close, when the camera moves. */
|
|
3340
|
+
card?: RenderTimelineRect[];
|
|
3341
|
+
/** Canvas space: view.background at open and close, when the frame has one. */
|
|
3342
|
+
background?: RenderTimelineRect[];
|
|
3343
|
+
/** The cursor's position (viewport px) at open and close. */
|
|
3344
|
+
cursor: RenderTimelinePoint[];
|
|
3345
|
+
/**
|
|
3346
|
+
* 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.
|
|
3347
|
+
*/
|
|
3348
|
+
length_us?: number;
|
|
3349
|
+
/**
|
|
3350
|
+
* 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.
|
|
3351
|
+
*/
|
|
3352
|
+
move_reach?: number;
|
|
3353
|
+
};
|
|
3354
|
+
/**
|
|
3355
|
+
* 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.
|
|
3356
|
+
*/
|
|
3357
|
+
backdrop?: {
|
|
3358
|
+
/** How much of the band shows (smoothstep over its 200 ms fades). */
|
|
3359
|
+
opacity: number;
|
|
3360
|
+
/**
|
|
3361
|
+
* 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.
|
|
3362
|
+
*/
|
|
3363
|
+
under?: {
|
|
3364
|
+
lines: string[];
|
|
3365
|
+
position?: "top" | "bottom";
|
|
3366
|
+
/**
|
|
3367
|
+
* 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).
|
|
3368
|
+
* @default 0
|
|
3369
|
+
*/
|
|
3370
|
+
size?: number;
|
|
3371
|
+
};
|
|
3372
|
+
};
|
|
2652
3373
|
}
|
|
2653
3374
|
|
|
2654
3375
|
export interface Preset {
|
|
@@ -2673,7 +3394,7 @@ export interface RenderBackground {
|
|
|
2673
3394
|
ref: string;
|
|
2674
3395
|
object: "render.background";
|
|
2675
3396
|
/**
|
|
2676
|
-
* `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 `
|
|
3397
|
+
* `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`).
|
|
2677
3398
|
*/
|
|
2678
3399
|
kind: "css" | "procedural" | "image";
|
|
2679
3400
|
pack: string;
|
|
@@ -2806,6 +3527,11 @@ export type SecretValue =
|
|
|
2806
3527
|
};
|
|
2807
3528
|
|
|
2808
3529
|
export interface SandboxPort {
|
|
3530
|
+
/**
|
|
3531
|
+
* The port the app listens on inside the sandbox. Not 53, 1080, 3128, 7700 or 15001: the B3OS guest agent
|
|
3532
|
+
* listens on those in every sandbox (its API proxy, egress proxies and DNS), so they are never proxied and
|
|
3533
|
+
* a create that declares one is `400 invalid_request`.
|
|
3534
|
+
*/
|
|
2809
3535
|
port: number;
|
|
2810
3536
|
/**
|
|
2811
3537
|
* Reachable by anyone with the sandbox's long-lived port URL (`ports[].url` in the sandbox; its token lasts 7
|
|
@@ -2813,6 +3539,22 @@ export interface SandboxPort {
|
|
|
2813
3539
|
* @default false
|
|
2814
3540
|
*/
|
|
2815
3541
|
public?: boolean;
|
|
3542
|
+
/**
|
|
3543
|
+
* How long a request through the port's preview waits for the app to start its response (status and
|
|
3544
|
+
* headers), counted from when the node lets the request in. Past it the request answers `504
|
|
3545
|
+
* upstream_first_byte_timeout`. A response that has started may stream for up to an hour. At most 95: the
|
|
3546
|
+
* path in front of the node gives up on a response that has not started after 100 seconds.
|
|
3547
|
+
* @default 65
|
|
3548
|
+
*/
|
|
3549
|
+
first_byte_s?: number;
|
|
3550
|
+
/**
|
|
3551
|
+
* The port has an app address (`<label>.b3os.io`); `b3os apply` sets it on such a port and keeps the port
|
|
3552
|
+
* private (no long-lived URL). The sandbox then counts as reachable from the internet for as long as it
|
|
3553
|
+
* lives, as with a public port: code in another sandbox whose egress is not `public` cannot reach into it,
|
|
3554
|
+
* and code in such a sandbox cannot start one with an addressed port (`403 egress_escalation`).
|
|
3555
|
+
* @default false
|
|
3556
|
+
*/
|
|
3557
|
+
addressed?: boolean;
|
|
2816
3558
|
}
|
|
2817
3559
|
|
|
2818
3560
|
/**
|
|
@@ -3015,12 +3757,18 @@ export interface Sandbox {
|
|
|
3015
3757
|
ports: {
|
|
3016
3758
|
port: number;
|
|
3017
3759
|
public: boolean;
|
|
3760
|
+
/** The port has an app address (the create set `addressed`); always sent by this node. */
|
|
3761
|
+
addressed?: boolean;
|
|
3018
3762
|
/**
|
|
3019
3763
|
* Public ports: the long-lived preview URL, token included. Private ports: `null`; mint a URL with
|
|
3020
3764
|
* `POST /v1/sandboxes/{sandbox_id}/ports/{port}/url`. Also `null` when code in another sandbox reads
|
|
3021
3765
|
* this sandbox and this sandbox is not within that sandbox's reach (`sandboxesCreateSandbox`).
|
|
3022
3766
|
*/
|
|
3023
3767
|
url: string | null;
|
|
3768
|
+
/**
|
|
3769
|
+
* How long a preview request waits for the app to start its response, seconds (65 unless the create said otherwise).
|
|
3770
|
+
*/
|
|
3771
|
+
first_byte_s?: number;
|
|
3024
3772
|
}[];
|
|
3025
3773
|
api: {
|
|
3026
3774
|
scopes: string[];
|
|
@@ -3172,6 +3920,45 @@ export interface SandboxProcess {
|
|
|
3172
3920
|
exited_at: string | null;
|
|
3173
3921
|
}
|
|
3174
3922
|
|
|
3923
|
+
/** What a running sandbox uses now (`GET /v1/sandboxes/{sandbox_id}/stats`). */
|
|
3924
|
+
export interface SandboxStats {
|
|
3925
|
+
object: "sandbox_stats";
|
|
3926
|
+
sandbox_id: string;
|
|
3927
|
+
/** When the node read it. */
|
|
3928
|
+
taken_at: string;
|
|
3929
|
+
cpu: {
|
|
3930
|
+
/**
|
|
3931
|
+
* 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.
|
|
3932
|
+
*/
|
|
3933
|
+
percent: number | null;
|
|
3934
|
+
/** The sandbox's vCPUs. */
|
|
3935
|
+
vcpu: number;
|
|
3936
|
+
/** The window `percent` covers. */
|
|
3937
|
+
interval_ms: number | null;
|
|
3938
|
+
};
|
|
3939
|
+
memory: {
|
|
3940
|
+
/** `total_bytes` minus `available_bytes`. */
|
|
3941
|
+
used_bytes: number;
|
|
3942
|
+
/** What the guest kernel can still give programs (`MemAvailable`). */
|
|
3943
|
+
available_bytes: number;
|
|
3944
|
+
/** The memory the guest kernel manages (`MemTotal`), a little under the sandbox's `memory_mib`. */
|
|
3945
|
+
total_bytes: number;
|
|
3946
|
+
};
|
|
3947
|
+
/** The root filesystem, or null in a sandbox whose image does not report it. */
|
|
3948
|
+
disk: null | {
|
|
3949
|
+
used_bytes: number;
|
|
3950
|
+
total_bytes: number;
|
|
3951
|
+
};
|
|
3952
|
+
processes: {
|
|
3953
|
+
/** Background processes started with exec that still run (as `GET …/processes` lists them). */
|
|
3954
|
+
running: number;
|
|
3955
|
+
/**
|
|
3956
|
+
* Every user process in the sandbox, kernel threads left out; null in a sandbox whose image does not report it.
|
|
3957
|
+
*/
|
|
3958
|
+
total: number | null;
|
|
3959
|
+
};
|
|
3960
|
+
}
|
|
3961
|
+
|
|
3175
3962
|
export type SandboxProcessList = Omit<ListEnvelope, "data"> & {
|
|
3176
3963
|
data: SandboxProcess[];
|
|
3177
3964
|
};
|
|
@@ -4063,7 +4850,7 @@ export interface SignalRequest {
|
|
|
4063
4850
|
}
|
|
4064
4851
|
|
|
4065
4852
|
/**
|
|
4066
|
-
* One manifest per pack: connections, egress, actions (T0 declarative HTTP
|
|
4853
|
+
* One manifest per pack: connections, egress, actions (T0 declarative HTTP, T1 first-party JS, or vm: a hosted tool's command run in a fresh microVM), triggers (webhook, poll, schedule), fixtures, pricing and the publisher signature. A pack whose actions are vm is a hosted tool and has a tool block. Field names follow research/b3os-actions.md section 12.3 (camelCase, like MCP). Every string that contains ${{ }} is a CEL template; the template rules and CEL contexts are in packages/spec/schemas/README.md. Rules JSON Schema cannot express (unique action keys, egress subset, connection references, effect consistency, what a hosted tool may declare in this version) are listed in the README under 'b3pack publish checks' and are enforced by the actions registry and by examples/validate.mjs. Owner after freeze: actions.
|
|
4067
4854
|
*/
|
|
4068
4855
|
export interface B3Pack {
|
|
4069
4856
|
/** Optional pointer to this schema for editors. Ignored by the runtime. */
|
|
@@ -4096,7 +4883,7 @@ export interface B3Pack {
|
|
|
4096
4883
|
sizes?: string[];
|
|
4097
4884
|
}[];
|
|
4098
4885
|
/**
|
|
4099
|
-
* Pack runtime API the pack needs, as a caret range (npm and Cargo read it the same way). The
|
|
4886
|
+
* Pack runtime API the pack needs, as a caret range (npm and Cargo read it the same way). The runtime is 1.1.0: packs without a tool block declare ^1, ^1.0 or ^1.1; a pack with a tool block declares ^1.1 or later (the vm kind is runtime API 1.1), so a node from before hosted tools refuses it instead of loading half of it.
|
|
4100
4887
|
*/
|
|
4101
4888
|
engine: string;
|
|
4102
4889
|
/**
|
|
@@ -4110,9 +4897,10 @@ export interface B3Pack {
|
|
|
4110
4897
|
actions: B3PackAction[];
|
|
4111
4898
|
triggers?: B3PackTrigger[];
|
|
4112
4899
|
/**
|
|
4113
|
-
* Default price for every action that does not set its own.
|
|
4900
|
+
* Default price for every action that does not set its own. A price is charged on vm actions only (a hosted tool's publisher price, usage unit actions.publisher_microusd); packs without vm actions are free and the node still meters actions.call (ARCHITECTURE 4.5).
|
|
4114
4901
|
*/
|
|
4115
4902
|
pricing?: B3PackPricing;
|
|
4903
|
+
tool?: B3PackTool;
|
|
4116
4904
|
compat?: {
|
|
4117
4905
|
/**
|
|
4118
4906
|
* Maps an action key in this pack to the flat action id it replaces in the old B3OS catalog (research 12.3, 13). Used by the importer so old workflows resolve.
|
|
@@ -4174,7 +4962,7 @@ export interface B3PackEgressEntry {
|
|
|
4174
4962
|
}
|
|
4175
4963
|
|
|
4176
4964
|
/**
|
|
4177
|
-
* A JSON Schema 2020-12 document whose top level describes an object (MCP requires object-typed inputSchema and outputSchema). Objects should be closed (additionalProperties false) unless declared open (research 12.4). x-b3-* keywords (x-b3-widget, x-b3-semantic, x-b3-options, ...) are allowed as annotations and ignored by validation.
|
|
4965
|
+
* A JSON Schema 2020-12 document whose top level describes an object (MCP requires object-typed inputSchema and outputSchema). Objects should be closed (additionalProperties false) unless declared open (research 12.4). x-b3-* keywords (x-b3-widget, x-b3-semantic, x-b3-options, ...) are allowed as annotations and ignored by validation. x-b3os-file marks a file field of a vm action: on a top-level property of inputSchema it is {"accept": [media types]} and the property's value is a file value; on a top-level property of outputSchema it is {"produces": [media types]} and the tool answers {"path": "/out/<name>"} there (README, 'b3pack publish checks' 19).
|
|
4178
4966
|
*/
|
|
4179
4967
|
export type B3PackJsonSchemaObject = JsonSchemaDocument & {
|
|
4180
4968
|
type: "object";
|
|
@@ -4236,7 +5024,7 @@ export interface B3PackEffects {
|
|
|
4236
5024
|
}
|
|
4237
5025
|
|
|
4238
5026
|
/**
|
|
4239
|
-
* Publisher price on top of the platform's actions.
|
|
5027
|
+
* Publisher price, charged on vm actions only, on top of the platform's own meters (a hosted tool's call bills actions.tool_call, actions.vcpu_ms and actions.gib_ms; the price is actions.publisher_microusd). First-party packs are free. Amounts are decimal strings in USD to avoid float rounding; the publish checks hold a per_call price to at most 1 USD and 6 decimal places, so it is a whole number of micro-USD.
|
|
4240
5028
|
*/
|
|
4241
5029
|
export interface B3PackPricing {
|
|
4242
5030
|
model: "free" | "per_call";
|
|
@@ -4296,7 +5084,7 @@ export interface B3PackHttpResponse {
|
|
|
4296
5084
|
}
|
|
4297
5085
|
|
|
4298
5086
|
/**
|
|
4299
|
-
* How the action runs. http = T0, declarative HTTP inside b3osd. js = T1, a first-party ES module run by the actions-js sidecar (packages/spec/sidecars/actions-js.md).
|
|
5087
|
+
* How the action runs. http = T0, declarative HTTP inside b3osd. js = T1, a first-party ES module run by the actions-js sidecar (packages/spec/sidecars/actions-js.md). vm = a hosted tool: each call runs cmd in a fresh microVM of tool.base with the tool's archive unpacked at /tool, the request as one JSON object on stdin and one JSON object as the last line of stdout (protocol json-stdio, README 'Hosted tools').
|
|
4300
5088
|
*/
|
|
4301
5089
|
export type B3PackImpl =
|
|
4302
5090
|
| {
|
|
@@ -4315,6 +5103,17 @@ export type B3PackImpl =
|
|
|
4315
5103
|
* @default "run"
|
|
4316
5104
|
*/
|
|
4317
5105
|
export?: string;
|
|
5106
|
+
}
|
|
5107
|
+
| {
|
|
5108
|
+
kind: "vm";
|
|
5109
|
+
/**
|
|
5110
|
+
* The request is one JSON object on stdin; the answer is the last line of stdout, {"output": ...} or {"error": {code, message, retryable}}, with exit status 0 either way.
|
|
5111
|
+
*/
|
|
5112
|
+
protocol: "json-stdio";
|
|
5113
|
+
/**
|
|
5114
|
+
* The command and its arguments, run with no shell, working directory /work, as the guest's user. Fixed text: no caller value ever enters it. cmd[0] is a path under /tool/ (publish check 18).
|
|
5115
|
+
*/
|
|
5116
|
+
cmd: string[];
|
|
4318
5117
|
};
|
|
4319
5118
|
|
|
4320
5119
|
export type B3PackExample =
|
|
@@ -4353,9 +5152,17 @@ export type B3PackAction = {
|
|
|
4353
5152
|
egress?: B3PackEgressEntry[];
|
|
4354
5153
|
execution?: {
|
|
4355
5154
|
/**
|
|
4356
|
-
* Wall-clock budget per call, including upstream time. Default 10000 for http, 30000 for js. A caller's shorter deadline wins.
|
|
5155
|
+
* Wall-clock budget per call, including upstream time. Default 10000 for http, 30000 for js and vm; at most 60000 for vm. A caller's shorter deadline wins, except on a priced vm action, where a shorter timeout_ms is refused.
|
|
4357
5156
|
*/
|
|
4358
5157
|
timeoutMs?: number;
|
|
5158
|
+
/**
|
|
5159
|
+
* vm only, reserved for files that are not inline (slice B): the most input file data a call may carry. Refused in this version.
|
|
5160
|
+
*/
|
|
5161
|
+
maxInputMb?: number;
|
|
5162
|
+
/** vm only, reserved (slice B): the most output file data a call may return. Refused in this version. */
|
|
5163
|
+
maxOutputMb?: number;
|
|
5164
|
+
/** vm only, reserved (slice B): the most output files a call may return. Refused in this version. */
|
|
5165
|
+
maxOutputFiles?: number;
|
|
4359
5166
|
/** T1 only: V8 old-generation limit of the worker running the call. Default 128. */
|
|
4360
5167
|
memoryMb?: number;
|
|
4361
5168
|
/**
|
|
@@ -4530,6 +5337,103 @@ export type B3PackTrigger = {
|
|
|
4530
5337
|
aliases?: B3PackSearchPhrases;
|
|
4531
5338
|
};
|
|
4532
5339
|
|
|
5340
|
+
/**
|
|
5341
|
+
* A hosted tool: the software a pack's vm actions run, and what it needs to run. Required when any action is vm and refused otherwise (publish checks 13 to 20). The schema admits the values of later versions (mcp, the other bases, session, hosts, caller, any size) and the reserved keys (setup, image, formats, errors, bundle.files, base.range), so that what this version refuses is refused with a plain sentence of the publish checks rather than a schema error.
|
|
5342
|
+
*/
|
|
5343
|
+
export interface B3PackTool {
|
|
5344
|
+
/**
|
|
5345
|
+
* cli: a command that reads a request on stdin and writes an answer on stdout. mcp (later): an MCP server. Shown on the listing.
|
|
5346
|
+
*/
|
|
5347
|
+
kind: "cli" | "mcp";
|
|
5348
|
+
/** The shared template the tool runs on. Bases have no versions yet. */
|
|
5349
|
+
base: {
|
|
5350
|
+
name: "base" | "files" | "browser" | "code-interpreter";
|
|
5351
|
+
/** Reserved: not read, because bases have no versions yet. Refused in this version. */
|
|
5352
|
+
range?: string;
|
|
5353
|
+
};
|
|
5354
|
+
/**
|
|
5355
|
+
* The tool VM's size, one of the base's size classes. Absent: 1 vCPU and 512 MiB, the only size of this version.
|
|
5356
|
+
*/
|
|
5357
|
+
size?: {
|
|
5358
|
+
vcpu: number;
|
|
5359
|
+
memoryMb: number;
|
|
5360
|
+
};
|
|
5361
|
+
/**
|
|
5362
|
+
* Where the tool's files come from. This version reads one archive, unpacked at /tool before each call.
|
|
5363
|
+
*/
|
|
5364
|
+
bundle?: {
|
|
5365
|
+
archive?: B3PackToolArchive;
|
|
5366
|
+
/**
|
|
5367
|
+
* Reserved: files carried inside the pack bundle under tool/, with their sources (later versions). Refused in this version.
|
|
5368
|
+
*/
|
|
5369
|
+
files?: unknown[];
|
|
5370
|
+
};
|
|
5371
|
+
/**
|
|
5372
|
+
* call: one fresh VM per call, deleted before the call answers. session (later): a keyed instance kept between calls.
|
|
5373
|
+
*/
|
|
5374
|
+
runtime?: {
|
|
5375
|
+
mode: "call" | "session";
|
|
5376
|
+
/** Reserved for session tools. */
|
|
5377
|
+
start?: unknown;
|
|
5378
|
+
/** Reserved for session tools. */
|
|
5379
|
+
ready?: unknown;
|
|
5380
|
+
/** Reserved for session tools. */
|
|
5381
|
+
idleS?: number;
|
|
5382
|
+
/** Reserved for session tools. */
|
|
5383
|
+
maxS?: number;
|
|
5384
|
+
};
|
|
5385
|
+
/**
|
|
5386
|
+
* What the tool's VM may reach. none: nothing (egress deny); the pack's egress list is empty. hosts (later): the pack's egress list, port 443 only. caller (later, first-party only): hosts the caller names.
|
|
5387
|
+
*/
|
|
5388
|
+
network?: {
|
|
5389
|
+
mode: "none" | "hosts" | "caller";
|
|
5390
|
+
};
|
|
5391
|
+
/** The software the tool runs and did not write. Stored and returned by describe. */
|
|
5392
|
+
upstream?: {
|
|
5393
|
+
name: string;
|
|
5394
|
+
url: string;
|
|
5395
|
+
version: string;
|
|
5396
|
+
/** SPDX license expression. */
|
|
5397
|
+
license: string;
|
|
5398
|
+
/** Where the publisher got the upstream's files, and their digest. */
|
|
5399
|
+
obtained?: {
|
|
5400
|
+
url: string;
|
|
5401
|
+
sha256?: string;
|
|
5402
|
+
};
|
|
5403
|
+
patchedBy?: string;
|
|
5404
|
+
trademarkPolicy?: string;
|
|
5405
|
+
}[];
|
|
5406
|
+
/**
|
|
5407
|
+
* Bundle-relative path of the notices file (licences, attributions, 'Not affiliated with ...'). It must be a file of the pack bundle.
|
|
5408
|
+
*/
|
|
5409
|
+
notices?: string;
|
|
5410
|
+
/**
|
|
5411
|
+
* Reserved: a command run once when the node prepares the tool's snapshot (later). Refused in this version.
|
|
5412
|
+
*/
|
|
5413
|
+
setup?: unknown;
|
|
5414
|
+
/** Reserved: an imported image's artifact (later). Refused in this version. */
|
|
5415
|
+
image?: unknown;
|
|
5416
|
+
/** Reserved: output formats a takedown can turn off by name (later). Refused in this version. */
|
|
5417
|
+
formats?: unknown;
|
|
5418
|
+
/** Reserved: the tool's own error codes, as an enum (later). Refused in this version. */
|
|
5419
|
+
errors?: unknown;
|
|
5420
|
+
}
|
|
5421
|
+
|
|
5422
|
+
/**
|
|
5423
|
+
* One archive of the tool's files, named by its sha256, uploaded to the registry's blob store before the pack is published, and unpacked at /tool before each call. The publish checks cap it at 64 MiB packed (bytes 67108864), 512 MiB unpacked (unpackedBytes 536870912) and 20,000 entries.
|
|
5424
|
+
*/
|
|
5425
|
+
export interface B3PackToolArchive {
|
|
5426
|
+
/** Lowercase hex sha256 of the archive's bytes. */
|
|
5427
|
+
sha256: string;
|
|
5428
|
+
/** The archive's size in bytes. */
|
|
5429
|
+
bytes: number;
|
|
5430
|
+
format: "tar.gz" | "tar";
|
|
5431
|
+
/** The sum of the sizes of the archive's regular files. */
|
|
5432
|
+
unpackedBytes: number;
|
|
5433
|
+
/** Files, directories and links in the archive. */
|
|
5434
|
+
entries: number;
|
|
5435
|
+
}
|
|
5436
|
+
|
|
4533
5437
|
/**
|
|
4534
5438
|
* Publisher signature written by the publish tool and repeated in the registry record. contentHash covers the whole bundle with this member removed (README, 'Pack content hash and signature'). sig is Ed25519 over the UTF-8 bytes of 'b3pack-sig-v1\n<pack>\n<version>\n<contentHash>'. Nodes verify contentHash and sig against the registry record and the publisher's registered key before loading (ARCHITECTURE 5.5).
|
|
4535
5439
|
*/
|
|
@@ -4716,6 +5620,23 @@ export interface ActionDescription {
|
|
|
4716
5620
|
* when the node loads the pack. Their inputs also appear as `examples` in `mcp.inputSchema`.
|
|
4717
5621
|
*/
|
|
4718
5622
|
examples: ActionExample[];
|
|
5623
|
+
/**
|
|
5624
|
+
* For a hosted tool's action (`impl.kind` `vm`), what it runs on and what it costs; absent for other actions.
|
|
5625
|
+
*/
|
|
5626
|
+
tool?: {
|
|
5627
|
+
kind: "cli";
|
|
5628
|
+
/** The template its VM is made from. */
|
|
5629
|
+
base: string;
|
|
5630
|
+
network: "none";
|
|
5631
|
+
/**
|
|
5632
|
+
* The publisher's price per call that answered validly, in micro-USD (millionths of a US dollar); 0 when free.
|
|
5633
|
+
*/
|
|
5634
|
+
price_micro_usd: number;
|
|
5635
|
+
/** The software the tool runs and did not write (the manifest's `tool.upstream`). */
|
|
5636
|
+
upstream: Record<string, unknown>[];
|
|
5637
|
+
/** The bundle path of the tool's notices file. */
|
|
5638
|
+
notices?: string;
|
|
5639
|
+
};
|
|
4719
5640
|
}
|
|
4720
5641
|
|
|
4721
5642
|
export interface ActionCallRequest {
|
|
@@ -4738,13 +5659,31 @@ export interface ActionResult {
|
|
|
4738
5659
|
object: "action_result";
|
|
4739
5660
|
/** The exact version that ran. */
|
|
4740
5661
|
ref: string;
|
|
4741
|
-
/** Matches the action's output schema. */
|
|
5662
|
+
/** Matches the action's output schema. A hosted tool's output file is a `ToolFileOutput`. */
|
|
4742
5663
|
output: unknown;
|
|
4743
5664
|
/** HTTP status of the upstream call, for declarative HTTP actions. */
|
|
4744
5665
|
upstream_status?: number;
|
|
5666
|
+
/**
|
|
5667
|
+
* `vm` for a hosted tool's call (its command ran in a microVM made for the call). Absent for other actions.
|
|
5668
|
+
*/
|
|
5669
|
+
tier?: "vm";
|
|
5670
|
+
cost?: ToolCallCost;
|
|
4745
5671
|
timing: Timing;
|
|
4746
5672
|
}
|
|
4747
5673
|
|
|
5674
|
+
/**
|
|
5675
|
+
* What a hosted tool's call costs, in micro-USD (millionths of a US dollar), from the node's unit prices when
|
|
5676
|
+
* the call ran: `compute` (`actions.vcpu_ms` and `actions.gib_ms`), `floor` (`actions.tool_call`), `price` (the
|
|
5677
|
+
* publisher's, `actions.publisher_microusd`; 0 when the tool failed or is free) and their sum, `total`. The
|
|
5678
|
+
* same numbers are in the `actions.tool_call` usage record's `meta.cost_micro_usd`.
|
|
5679
|
+
*/
|
|
5680
|
+
export interface ToolCallCost {
|
|
5681
|
+
compute: number;
|
|
5682
|
+
floor: number;
|
|
5683
|
+
price: number;
|
|
5684
|
+
total: number;
|
|
5685
|
+
}
|
|
5686
|
+
|
|
4748
5687
|
export interface TriggerSummary {
|
|
4749
5688
|
ref: string;
|
|
4750
5689
|
pack: string;
|
|
@@ -5852,6 +6791,12 @@ export interface CurrentPrincipal {
|
|
|
5852
6791
|
project_id: string;
|
|
5853
6792
|
scopes: Scope[];
|
|
5854
6793
|
spend_cap_usd: number | null;
|
|
6794
|
+
/**
|
|
6795
|
+
* 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.
|
|
6796
|
+
*/
|
|
6797
|
+
spend_usd?: number | null;
|
|
6798
|
+
/** Start of the billing period `spend_usd` covers. */
|
|
6799
|
+
spend_period_start?: string;
|
|
5855
6800
|
expires_at: string | null;
|
|
5856
6801
|
}
|
|
5857
6802
|
|
|
@@ -6005,6 +6950,18 @@ export interface RegistryPackVersion {
|
|
|
6005
6950
|
published_at: string;
|
|
6006
6951
|
yanked: boolean;
|
|
6007
6952
|
download_url: string;
|
|
6953
|
+
/**
|
|
6954
|
+
* The API key (`key_...`) or dashboard user (`usr_...`) that published the version, shown to the namespace's owner and to B3's organizations; `null` for any other reader, a node, and versions published before it was recorded.
|
|
6955
|
+
*/
|
|
6956
|
+
published_by?: string | null;
|
|
6957
|
+
}
|
|
6958
|
+
|
|
6959
|
+
/** A hosted tool's archive in the registry's blob store, named by its sha256. */
|
|
6960
|
+
export interface RegistryBlob {
|
|
6961
|
+
object: "registry_blob";
|
|
6962
|
+
digest: string;
|
|
6963
|
+
bytes: number;
|
|
6964
|
+
created_at: string;
|
|
6008
6965
|
}
|
|
6009
6966
|
|
|
6010
6967
|
/**
|
|
@@ -6018,10 +6975,21 @@ export type RequestConnection = "edge" | "uds" | "tcp" | "sandbox";
|
|
|
6018
6975
|
* Who made the request: `api_key` (an API key), `cli_token` (the CLI's device-login token), `dashboard` (a
|
|
6019
6976
|
* signed-in dashboard session; its successful reads are not logged, its changes and errors are), `sandbox` (code
|
|
6020
6977
|
* inside a sandbox, as its creating key), `routine` (a routine run, as the key that published its version),
|
|
6021
|
-
* `local` (a host-local caller on the node's Unix socket)
|
|
6022
|
-
* callback to a public route, or a request refused before authentication)
|
|
6978
|
+
* `local` (a host-local caller on the node's Unix socket), `public` (no credential: a webhook or signed
|
|
6979
|
+
* callback to a public route, or a request refused before authentication), `address` (a visitor of an app
|
|
6980
|
+
* address, `<label>.b3os.io`) or `preview` (a visitor of a sandbox port preview). `address` and `preview`
|
|
6981
|
+
* records belong to the sandbox's project; their `path` is the app's path, without the query, cut at 1,024 bytes.
|
|
6023
6982
|
*/
|
|
6024
|
-
export type RequestSource =
|
|
6983
|
+
export type RequestSource =
|
|
6984
|
+
| "api_key"
|
|
6985
|
+
| "cli_token"
|
|
6986
|
+
| "dashboard"
|
|
6987
|
+
| "sandbox"
|
|
6988
|
+
| "routine"
|
|
6989
|
+
| "local"
|
|
6990
|
+
| "public"
|
|
6991
|
+
| "address"
|
|
6992
|
+
| "preview";
|
|
6025
6993
|
|
|
6026
6994
|
export interface RequestPhase {
|
|
6027
6995
|
name: string;
|
|
@@ -6039,6 +7007,12 @@ export interface RequestRecord {
|
|
|
6039
7007
|
product: string | null;
|
|
6040
7008
|
status_code: number;
|
|
6041
7009
|
error_code: string | null;
|
|
7010
|
+
/**
|
|
7011
|
+
* Why a 4xx or 5xx answer failed, in the server's own words: the first 200 characters of its problem's
|
|
7012
|
+
* `detail` (or a compatibility surface's message). `null` for a success, or when the server recorded none;
|
|
7013
|
+
* absent from records written before it was recorded.
|
|
7014
|
+
*/
|
|
7015
|
+
error_detail?: string | null;
|
|
6042
7016
|
org_id: string;
|
|
6043
7017
|
project_id: string;
|
|
6044
7018
|
/** The API key behind the request (for sandbox calls, the key that created the sandbox). */
|
|
@@ -6463,7 +7437,9 @@ export interface RenderListBackgroundsParams {
|
|
|
6463
7437
|
theme?: "light" | "dark";
|
|
6464
7438
|
/** Only CSS, only procedural (the studio pack) or only image backgrounds. */
|
|
6465
7439
|
kind?: "css" | "procedural" | "image";
|
|
6466
|
-
/**
|
|
7440
|
+
/**
|
|
7441
|
+
* 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).
|
|
7442
|
+
*/
|
|
6467
7443
|
tag?: string;
|
|
6468
7444
|
/**
|
|
6469
7445
|
* Only full-bleed backgrounds, or only transparent shapes (`cutout`, `partial`, `sliver`). CSS backgrounds are full-bleed.
|
|
@@ -6621,6 +7597,24 @@ export interface SandboxesOpenPtyParams {
|
|
|
6621
7597
|
session?: string;
|
|
6622
7598
|
}
|
|
6623
7599
|
|
|
7600
|
+
/** Parameters of `listRequests`. */
|
|
7601
|
+
export interface SandboxesListRequestsParams {
|
|
7602
|
+
/**
|
|
7603
|
+
* Page size, from 1 to 100.
|
|
7604
|
+
* @default 20
|
|
7605
|
+
*/
|
|
7606
|
+
limit?: number;
|
|
7607
|
+
/** Opaque cursor from the previous page's `next_cursor`. Omit it for the first page. */
|
|
7608
|
+
cursor?: string;
|
|
7609
|
+
product?: string;
|
|
7610
|
+
operation_id?: string;
|
|
7611
|
+
/** Only requests that succeeded (`2xx`) or failed (`4xx`, `5xx`). */
|
|
7612
|
+
status?: "2xx" | "4xx" | "5xx";
|
|
7613
|
+
/** Only requests of this W3C trace (the trace id of their `traceparent`). */
|
|
7614
|
+
trace_id?: string;
|
|
7615
|
+
since?: string;
|
|
7616
|
+
}
|
|
7617
|
+
|
|
6624
7618
|
/** Parameters of `listRoutines`. */
|
|
6625
7619
|
export interface RoutinesListRoutinesParams {
|
|
6626
7620
|
/**
|