@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
|
@@ -8,7 +8,7 @@ export type Metadata = Record<string, string>;
|
|
|
8
8
|
* for every scope. The build generates `enum` from the catalog, the same list as `dist/scopes.json` plus
|
|
9
9
|
* `<product>:*` and `*`.
|
|
10
10
|
*/
|
|
11
|
-
export type Scope = "vision:read" | "vision:write" | "vision:run" | "vision:profiles:use" | "vision:profiles:export" | "render:read" | "render:write" | "render:run" | "sandboxes:read" | "sandboxes:write" | "sandboxes:run" | "routines:read" | "routines:write" | "routines:run" | "actions:read" | "actions:write" | "actions:run" | "infer:read" | "infer:write" | "infer:run" | "vault:read" | "vault:write" | "vault:run" | "platform:read" | "platform:write" | "vision:*" | "render:*" | "sandboxes:*" | "routines:*" | "actions:*" | "infer:*" | "vault:*" | "platform:*" | "*";
|
|
11
|
+
export type Scope = "vision:read" | "vision:write" | "vision:run" | "vision:profiles:use" | "vision:profiles:export" | "render:read" | "render:write" | "render:run" | "sandboxes:read" | "sandboxes:write" | "sandboxes:run" | "routines:read" | "routines:write" | "routines:run" | "actions:read" | "actions:write" | "actions:run" | "actions:tools:publish" | "infer:read" | "infer:write" | "infer:run" | "vault:read" | "vault:write" | "vault:run" | "platform:read" | "platform:write" | "vision:*" | "render:*" | "sandboxes:*" | "routines:*" | "actions:*" | "infer:*" | "vault:*" | "platform:*" | "*";
|
|
12
12
|
/**
|
|
13
13
|
* Server-side phase durations in milliseconds with microsecond resolution: the same phases as the
|
|
14
14
|
* `Server-Timing` header, keyed `<phase>_ms`. `total_ms` is always present. Phase names are product-specific
|
|
@@ -104,6 +104,32 @@ export interface Problem {
|
|
|
104
104
|
allowed?: unknown[];
|
|
105
105
|
/** What set the bound a refused value is outside (`option_not_allowed`); `node` is the node's policy. */
|
|
106
106
|
bound_by?: "node" | "org" | "flag" | "limit";
|
|
107
|
+
/** The application's service a refusal is about, with `port` (the address codes, `app_host_*`). */
|
|
108
|
+
service?: string;
|
|
109
|
+
/** The port of `service` a refusal is about (the address codes, `app_host_*`). */
|
|
110
|
+
port?: number;
|
|
111
|
+
/** The exit status of a hosted tool's command (`tool_failed` with `reason: exit`). */
|
|
112
|
+
exit_code?: number;
|
|
113
|
+
/**
|
|
114
|
+
* The signal that ended a hosted tool's command, such as `SIGKILL` (`tool_failed` with `reason: signal`).
|
|
115
|
+
*/
|
|
116
|
+
signal?: string;
|
|
117
|
+
/**
|
|
118
|
+
* 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.
|
|
119
|
+
*/
|
|
120
|
+
tool_code?: string;
|
|
121
|
+
/**
|
|
122
|
+
* 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.
|
|
123
|
+
*/
|
|
124
|
+
tool_message?: string;
|
|
125
|
+
/**
|
|
126
|
+
* Whether a hosted tool says the same call may succeed later (`tool_failed` with `reason: tool_error`).
|
|
127
|
+
*/
|
|
128
|
+
retryable?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* 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.
|
|
131
|
+
*/
|
|
132
|
+
stderr?: string;
|
|
107
133
|
[key: string]: unknown;
|
|
108
134
|
}
|
|
109
135
|
/** Returned by deletes. */
|
|
@@ -463,6 +489,10 @@ export interface ScrapeResult {
|
|
|
463
489
|
content_type?: string;
|
|
464
490
|
/** What served the page. */
|
|
465
491
|
tier: "cache" | "fetch" | "browser";
|
|
492
|
+
/**
|
|
493
|
+
* 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).
|
|
494
|
+
*/
|
|
495
|
+
tier_reason?: "host_prefers_browser" | "needs_js" | "empty_page" | "thin_page" | "fetch_failed";
|
|
466
496
|
cache: CacheInfo;
|
|
467
497
|
markdown?: string;
|
|
468
498
|
html?: string;
|
|
@@ -1311,11 +1341,21 @@ export type PresetRef = string;
|
|
|
1311
1341
|
export type PresetKind = "background" | "frame" | "cursor" | "captions" | "click_effect";
|
|
1312
1342
|
/** A background preset (`GET /v1/render/presets?kind=background` has a preview of each). */
|
|
1313
1343
|
export type BackgroundPreset = "b3os-light" | "b3os-dark" | "b3os-blue" | "midnight" | "aurora" | "sunset" | "ocean" | "arctic" | "dusk" | "forest" | "ember" | "graphite" | "paper";
|
|
1314
|
-
/**
|
|
1315
|
-
|
|
1344
|
+
/**
|
|
1345
|
+
* 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.
|
|
1346
|
+
*/
|
|
1347
|
+
export type FramePreset = "window" | "window-dark" | "mac" | "mac-dark" | "browser" | "browser-dark" | "windows" | "windows-dark" | "phone" | "tablet" | "laptop" | "laptop-dark" | "desktop";
|
|
1316
1348
|
/** A cursor preset (`GET /v1/render/presets?kind=cursor` has a preview of each). */
|
|
1317
1349
|
export type CursorPreset = "arrow" | "arrow-light" | "dot";
|
|
1318
|
-
/**
|
|
1350
|
+
/**
|
|
1351
|
+
* A caption style preset (`GET /v1/render/presets?kind=captions` has a preview of each): `default`, a small
|
|
1352
|
+
* neutral near-black pill that never takes on the background's hue (where the darkest 30% of what it covers is
|
|
1353
|
+
* darker than luma 24, its fill is lifted 18 levels above that and its edge brightened, so it still reads as a
|
|
1354
|
+
* pill), whose
|
|
1355
|
+
* karaoke shows the spoken words white,
|
|
1356
|
+
* the word being spoken in a light B3 blue and the words to come dimmed; `bold`, a large dark pill with a yellow
|
|
1357
|
+
* karaoke word; `minimal`, outlined text with no box; `light`, dark text on a white box.
|
|
1358
|
+
*/
|
|
1319
1359
|
export type CaptionsPreset = "default" | "bold" | "minimal" | "light";
|
|
1320
1360
|
/** A click effect preset (`GET /v1/render/presets?kind=click_effect` has a preview of each). */
|
|
1321
1361
|
export type ClickEffectPreset = "ripple" | "ring";
|
|
@@ -1324,15 +1364,34 @@ export type ClickEffectPreset = "ripple" | "ring";
|
|
|
1324
1364
|
* this). Every field is optional. The per-kind enums (`BackgroundPreset`, `FramePreset`, `CursorPreset`,
|
|
1325
1365
|
* `CaptionsPreset`, `ClickEffectPreset`) list today's presets; the schema also takes any preset ID so a preset
|
|
1326
1366
|
* added later needs no client update, and the node refuses an ID that is not a preset of that kind with
|
|
1327
|
-
* `style_invalid`. `none` draws nothing for that part; `auto`
|
|
1328
|
-
*
|
|
1329
|
-
*
|
|
1330
|
-
*
|
|
1367
|
+
* `style_invalid`. `none` draws nothing for that part; `auto` is the default background. On a video and on a
|
|
1368
|
+
* styled screenshot it draws one of the library images tagged `video` (the node's set, by default 24: macOS-style
|
|
1369
|
+
* waves, calm cool, warm and pastel gradient fields, deep dark fields, a grey grain and five soft photographs),
|
|
1370
|
+
* picked from the page (a video's first frame, a screenshot's capture). Only images at least 12 L* from the page
|
|
1371
|
+
* all along just outside the window's edges compete (a dark page: 20 L* lighter outside its dark edges). Among
|
|
1372
|
+
* them a small vision model (`b3os/qwen3.5-9b`, run by the node, not billed to you) picks the one that best
|
|
1373
|
+
* matches the app's look and brand, from the page and one labelled sheet of the candidates. Without the model,
|
|
1374
|
+
* when it does not answer within 4 s, or when one image clears, the color rules pick: the image whose hue suits
|
|
1375
|
+
* the page's accent color and whose tone sits behind the page (deeper behind a light page, airier behind a dark
|
|
1376
|
+
* one), ties broken by the page's host. The first pick for a site (the page's registrable domain, such as
|
|
1377
|
+
* `linear.app`; the host for `localhost` and IP addresses) is kept for your organization, so later videos and
|
|
1378
|
+
* screenshots of the site draw the same image while it clears their page's edges; `auto_background` pins an
|
|
1379
|
+
* image, picks again or turns the model off. The studio pick when no image clears the edges (or the node has no
|
|
1380
|
+
* set). The pick reads the page in CSS pixels, so it does not depend on the device scale; the result's
|
|
1381
|
+
* `auto_background` says which image was drawn and how it was chosen. On a video the timeline's `style` then
|
|
1382
|
+
* names the image in `overrides.background_ref`, and its `look` records it as the `auto` pick with how it was
|
|
1383
|
+
* chosen. If the node cannot load it in time (2 s for a file it has, 0.5 s for one it must fetch,
|
|
1384
|
+
* none while the image store is failing: a minute after it fails, or its Retry-After, 1 s to 10 min), the video
|
|
1385
|
+
* draws the studio pick and `warnings` says so
|
|
1386
|
+
* (`background_fallback`). `studio` is the studio pick by name, on screenshots and videos (what `auto` drew
|
|
1387
|
+
* before 2026-11-11, and what a restyle without a style draws for a timeline from before then: the mesh it
|
|
1388
|
+
* drew, read from the first frame's own pixels as production read it). `transparent` leaves
|
|
1389
|
+
* the background transparent.
|
|
1331
1390
|
* Strings are drawn by the compositor and escaped before they reach any HTML or CSS.
|
|
1332
1391
|
*/
|
|
1333
1392
|
export interface RenderStyle {
|
|
1334
|
-
/** A background preset, or `auto`, `transparent` or `none`. */
|
|
1335
|
-
background?: BackgroundPreset | "auto" | "transparent" | "none" | (string & {});
|
|
1393
|
+
/** A background preset, or `auto`, `studio`, `transparent` or `none`. */
|
|
1394
|
+
background?: BackgroundPreset | "auto" | "studio" | "transparent" | "none" | (string & {});
|
|
1336
1395
|
/** A window frame preset, or `none`. */
|
|
1337
1396
|
frame?: FramePreset | "none" | (string & {});
|
|
1338
1397
|
/** A cursor preset, or `none`. */
|
|
@@ -1345,7 +1404,8 @@ export interface RenderStyle {
|
|
|
1345
1404
|
}
|
|
1346
1405
|
/**
|
|
1347
1406
|
* A color: `#rgb`, `#rgba`, `#rrggbb`, `#rrggbbaa`, `rgb(r,g,b)`, `rgba(r,g,b,a)`, `rgb(r g b / a)` (channels
|
|
1348
|
-
* 0-255 or percentages, alpha 0-1 or a percentage),
|
|
1407
|
+
* 0-255 or percentages, alpha 0-1 or a percentage), a CSS color name such as `orange` or `rebeccapurple` (any
|
|
1408
|
+
* of the 148), or `transparent`. A value that is none of these is refused with an error that names it.
|
|
1349
1409
|
*/
|
|
1350
1410
|
export type RenderColor = string;
|
|
1351
1411
|
/** One shadow, in CSS pixels; a field left out is 0, and the color defaults to black at 25% alpha. */
|
|
@@ -1369,14 +1429,24 @@ export type RenderGradientStop = RenderColor | {
|
|
|
1369
1429
|
* videos (relative to 1080p).
|
|
1370
1430
|
*/
|
|
1371
1431
|
export interface RenderStyleOverrides {
|
|
1372
|
-
/**
|
|
1432
|
+
/**
|
|
1433
|
+
* Space around the page, the same on every side or `{x, y}`. Left out, 6% of the canvas's long edge on a
|
|
1434
|
+
* screenshot (48 to 160 pixels), and on a video what `window_shape` gives: by default 8% of the frame's
|
|
1435
|
+
* height above and below the window and 6.5% of its width at each side on a landscape frame (86 and 126
|
|
1436
|
+
* pixels at 1920x1080, the window on even pixels), with room under the window for burned-in captions.
|
|
1437
|
+
*/
|
|
1373
1438
|
padding?: number | {
|
|
1374
1439
|
x?: number;
|
|
1375
1440
|
y?: number;
|
|
1376
1441
|
};
|
|
1442
|
+
/**
|
|
1443
|
+
* 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).
|
|
1444
|
+
*/
|
|
1377
1445
|
corner_radius?: number;
|
|
1378
|
-
/**
|
|
1379
|
-
|
|
1446
|
+
/**
|
|
1447
|
+
* 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.
|
|
1448
|
+
*/
|
|
1449
|
+
shadow?: "none" | "subtle" | "soft" | "deep" | "classic" | "float" | "hard" | "glow" | RenderShadow | RenderShadow[];
|
|
1380
1450
|
/**
|
|
1381
1451
|
* `none`, or a border of `width` (default 1) and `color`. Left out, a hairline matched to the background.
|
|
1382
1452
|
*/
|
|
@@ -1399,14 +1469,16 @@ export interface RenderStyleOverrides {
|
|
|
1399
1469
|
* first use there and cached; if it cannot be loaded the request fails with `background_unavailable` (503,
|
|
1400
1470
|
* retry).
|
|
1401
1471
|
*
|
|
1402
|
-
* `"auto"`
|
|
1403
|
-
* soft-photo backgrounds (quiet ones first), in the page's light or dark theme (or `theme`'s), so a
|
|
1404
|
-
* page gets a light, soft background and a dark page a dark one, with clear lightness separation, a
|
|
1405
|
-
* analogous or complementary to the page's accent, little detail where it shows around the window, and
|
|
1472
|
+
* `"auto"` picks a library image that fits the captured page (a video's first frame): one of the quiet,
|
|
1473
|
+
* bold or soft-photo backgrounds (quiet ones first), in the page's light or dark theme (or `theme`'s), so a
|
|
1474
|
+
* light page gets a light, soft background and a dark page a dark one, with clear lightness separation, a
|
|
1475
|
+
* hue analogous or complementary to the page's accent, little detail where it shows around the window, and
|
|
1406
1476
|
* enough pixels for the output. The same page gets the same background; the screenshot's `background_ref`
|
|
1407
|
-
* names the one drawn. If the chosen image cannot be loaded within 2 s, the
|
|
1408
|
-
* background (the `auto` background preset unless `background`
|
|
1409
|
-
* (`background_fallback`).
|
|
1477
|
+
* names the one drawn, a video's timeline `style` does. If the chosen image cannot be loaded within 2 s, the
|
|
1478
|
+
* screenshot or video keeps the style's own background (the `auto` background preset unless `background`
|
|
1479
|
+
* names another) and `warnings` says so (`background_fallback`). The default `auto` background already
|
|
1480
|
+
* draws a library image, on videos and styled screenshots; this picks from the whole library instead of
|
|
1481
|
+
* the video set.
|
|
1410
1482
|
*/
|
|
1411
1483
|
background_ref?: string;
|
|
1412
1484
|
/**
|
|
@@ -1535,26 +1607,156 @@ export interface RenderStyleOverrides {
|
|
|
1535
1607
|
layout?: "default" | "bottom-cropped";
|
|
1536
1608
|
/** Text for the window's title bar, drawn by the compositor and never parsed as HTML. */
|
|
1537
1609
|
frame_title?: string;
|
|
1538
|
-
/**
|
|
1610
|
+
/**
|
|
1611
|
+
* Text for the address pill of a browser frame, and for a `mac` title bar that has no title (a video's
|
|
1612
|
+
* never does), drawn by the compositor and never parsed as HTML.
|
|
1613
|
+
*/
|
|
1539
1614
|
frame_url?: string;
|
|
1540
1615
|
/** Flips the frame and the `auto` background. */
|
|
1541
1616
|
theme?: "light" | "dark";
|
|
1542
|
-
/**
|
|
1617
|
+
/**
|
|
1618
|
+
* 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
|
|
1619
|
+
* short side), about twice a system cursor against the page, as in Screen Studio; it grows with the camera's
|
|
1620
|
+
* zoom. On a screenshot, and with `look: 1`, 1 is the 22 px arrow on the page's scale.
|
|
1621
|
+
*/
|
|
1543
1622
|
cursor_size?: number;
|
|
1544
1623
|
/** `false` keeps the cursor's size while the camera zooms. */
|
|
1545
1624
|
cursor_zoom?: boolean;
|
|
1625
|
+
/**
|
|
1626
|
+
* How small the cursor gets when it clicks: it shrinks to this over 70 ms and springs back over 220 ms
|
|
1627
|
+
* after the release, with no overshoot. 0.8 by default; 1 turns it off. A video's only.
|
|
1628
|
+
*/
|
|
1629
|
+
cursor_press_scale?: number;
|
|
1630
|
+
/**
|
|
1631
|
+
* The click effect's color. Left out, B3 blue (#2F43FF), and on a video white at 45% where the page under
|
|
1632
|
+
* the click is darker than luma 100 or more saturated than 0.6, such as a blue button, so the ring shows
|
|
1633
|
+
* there (not with `look: 1`). Set, it is that color on every page.
|
|
1634
|
+
*/
|
|
1546
1635
|
click_color?: RenderColor;
|
|
1547
1636
|
/** How long the click effect lasts, 450 by default. */
|
|
1548
1637
|
click_duration_ms?: number;
|
|
1549
|
-
/**
|
|
1638
|
+
/**
|
|
1639
|
+
* Caption text size in pixels at 1080p, 34 by default. Each captions preset starts at its own size: 34 for
|
|
1640
|
+
* `default`, 42 for `bold`, 40 for `minimal` and 44 for `light`. A caption's box keeps at least 48 px (at
|
|
1641
|
+
* 1080p) from each side of a video's frame: a cue too wide for that wraps between its words, and a word too
|
|
1642
|
+
* wide for it alone draws that cue smaller (not with `look: 1`).
|
|
1643
|
+
*/
|
|
1550
1644
|
caption_size?: number;
|
|
1551
1645
|
caption_color?: RenderColor;
|
|
1552
|
-
|
|
1646
|
+
/**
|
|
1647
|
+
* The karaoke word being spoken: a color (`RenderColor`: hex, `rgb()` or a CSS color name), or `auto`, the
|
|
1648
|
+
* `default` captions' setting. `auto` takes the color from the video's background: a preset background
|
|
1649
|
+
* of the video set carries its own accent (the image's most characteristic color), any other image or a
|
|
1650
|
+
* gradient gives the most saturated color covering at least 5% of it, and a flat or grey one gives
|
|
1651
|
+
* #9CB0FF. That color is then lightened or darkened, its hue kept, until it reads at 4.5:1 or more
|
|
1652
|
+
* against the caption's box (or the background under the caption when the box is clear), stands 12
|
|
1653
|
+
* or more (CIELAB Delta E) from `caption_color` and, where the words to come are dimmer than the spoken
|
|
1654
|
+
* ones (`caption_upcoming` under 1), is 10 or more points of CIELAB lightness further from the box than
|
|
1655
|
+
* they are, so the word being spoken always stands apart from the words already spoken and is never the
|
|
1656
|
+
* 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
|
|
1657
|
+
* timeline's `captions.highlight`, so a restyle without a style and a re-export repeat it; a restyle
|
|
1658
|
+
* 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
|
|
1659
|
+
* #8B97FF, as before.
|
|
1660
|
+
*/
|
|
1661
|
+
caption_highlight?: RenderColor | "auto";
|
|
1553
1662
|
caption_background?: RenderColor;
|
|
1663
|
+
/**
|
|
1664
|
+
* Where burned-in captions sit for the whole video: `bottom` (the default) or `top`, centred in the caption
|
|
1665
|
+
* band beside the window. A cue never moves; the camera keeps every target it frames, and the cursor, at
|
|
1666
|
+
* least 24 px (at 1080p) clear of the pill instead. With `look: 1` a cue still moves to the other edge when a
|
|
1667
|
+
* step's target sits under it.
|
|
1668
|
+
*/
|
|
1554
1669
|
caption_position?: "bottom" | "top";
|
|
1555
|
-
/**
|
|
1670
|
+
/**
|
|
1671
|
+
* Karaoke: how bright the words still to come are, as an opacity of `caption_color`; the words already
|
|
1672
|
+
* spoken are `caption_color` and the word being spoken `caption_highlight`. 0.55 for the `default`
|
|
1673
|
+
* captions; 1 for the other presets, which draw the words to come like the spoken ones.
|
|
1674
|
+
*/
|
|
1675
|
+
caption_upcoming?: number;
|
|
1676
|
+
/**
|
|
1677
|
+
* Karaoke: how long a word takes to light, from the shade of the words to come to `caption_highlight`,
|
|
1678
|
+
* while the word before it settles to `caption_color`, so the light passes from one word to the next with
|
|
1679
|
+
* no frame where none is lit. Only colors change: the line never moves as words light. 80 for the
|
|
1680
|
+
* `default` captions; 0 (at once) for the other presets.
|
|
1681
|
+
*/
|
|
1682
|
+
caption_fade_ms?: number;
|
|
1683
|
+
/**
|
|
1684
|
+
* What a video draws around the caption where the window lies under it: when the camera zooms in until
|
|
1685
|
+
* the page fills the frame, or when the captions sit over the page. `blur`, the default on every preset,
|
|
1686
|
+
* blurs the window's pixels from 120 px (at 1080p) above the caption's box to the frame's edge,
|
|
1687
|
+
* progressively, from nothing to a 16 px blur (a Gaussian's standard deviation, as CSS `blur(16px)`) at
|
|
1688
|
+
* the box's edge and past it, and darkens light content there by up to 6% (dark content not at all), so
|
|
1689
|
+
* text beside, above and below the caption dissolves and is never cut by its edge. The wallpaper, the
|
|
1690
|
+
* caption and the cursor stay sharp; where the caption lies on the wallpaper, as at rest, nothing changes.
|
|
1691
|
+
* The blur keeps its own time: it stays through the pause between two lines on one page when the pause
|
|
1692
|
+
* is 1 s or less and the page lies under the caption at both of its ends, while only the caption fades,
|
|
1693
|
+
* and it fades in and out over 200 ms before the first line, after the last, at a page change and across
|
|
1694
|
+
* a longer pause (the timeline's `captions.backdrop`). `none` leaves the page around the caption as it is.
|
|
1695
|
+
* With `look: 1` there is none.
|
|
1696
|
+
*/
|
|
1697
|
+
caption_backdrop?: "blur" | "none";
|
|
1698
|
+
/**
|
|
1699
|
+
* A video's window proportions under the default `padding`. `tall` (the default) gives the window the
|
|
1700
|
+
* height screen recorders give it and the width a desktop page needs: 8% of the frame's height above and
|
|
1701
|
+
* below the window (more on the captions' side when they need it) and, on a landscape frame, 6.5% of the
|
|
1702
|
+
* width at each side, the window never wider than 2:1; at 1920x1080 a 1668x864 window, 80% of the frame's
|
|
1703
|
+
* height, over a 1440x746 default viewport, the page drawn 1.16 times its CSS size. `wide` is the first look
|
|
1704
|
+
* v2 shape: 9% of the frame's long edge on every side, the window as wide as that leaves (1568x734 at
|
|
1705
|
+
* 1920x1080 over a 1440x674 viewport, 2.14:1).
|
|
1706
|
+
*/
|
|
1707
|
+
window_shape?: "tall" | "wide";
|
|
1708
|
+
/**
|
|
1709
|
+
* Smear what moves over each frame's shutter, as a camera would: the window, page and background on every
|
|
1710
|
+
* frame of a zoom or pan that moves faster than `motion_blur_onset`, by its motion past it over half a
|
|
1711
|
+
* frame. On by default. Held frames, and frames the camera moves through slowly, stay sharp, exactly as
|
|
1712
|
+
* without it. At the default 60 fps the fastest frames of the default zoom-in soften and a paused one still
|
|
1713
|
+
* reads. A moving cursor stays
|
|
1714
|
+
* a sharp arrow on every frame, over a faint trail behind it of its motion across the shutter, at most three
|
|
1715
|
+
* quarters of the arrow long. With `look: 1` only the cursor's trail shows, as its smear did before.
|
|
1716
|
+
*/
|
|
1556
1717
|
motion_blur?: boolean;
|
|
1718
|
+
/**
|
|
1719
|
+
* How long the shutter stays open, in frames, centered on each frame's time: 0.5 by default (half a frame at the
|
|
1720
|
+
* default 60 fps). 1 is Screen Studio's whole frame (1/60 s at 60 fps), twice as long a smear.
|
|
1721
|
+
*/
|
|
1722
|
+
motion_blur_shutter?: number;
|
|
1723
|
+
/**
|
|
1724
|
+
* How fast what the camera shows must move at the frame's edge, on average and with the zoom's own rate,
|
|
1725
|
+
* before the window, page and background smear, in the frame's short sides a second, whatever the frame
|
|
1726
|
+
* rate: 0.45 by default, about 8 px a frame at 1080p and 60 fps, so slower frames stay sharp and a faster one
|
|
1727
|
+
* smears by `motion_blur_shutter` of the motion past it, up to `motion_blur_max`. Read at the edge, a zoom
|
|
1728
|
+
* about the middle of the frame blurs like a zoom into a corner. 0 smears every frame of a move from its first
|
|
1729
|
+
* pixel. The cursor's trail shows its own motion whatever this is.
|
|
1730
|
+
*/
|
|
1731
|
+
motion_blur_onset?: number;
|
|
1732
|
+
/**
|
|
1733
|
+
* The longest smear a camera move leaves at the frame's edge, on average, in pixels at 1080p: 6.5 by
|
|
1734
|
+
* default, so the fastest frames of every zoom soften alike (to about a quarter of the sharpness at rest)
|
|
1735
|
+
* and a paused one still reads. 200 lifts the limit.
|
|
1736
|
+
*/
|
|
1737
|
+
motion_blur_max?: number;
|
|
1738
|
+
/**
|
|
1739
|
+
* How close to its camera move's top speed a frame must be to smear: 0 by default, no such gate. 0.9 smears
|
|
1740
|
+
* only the two or three fastest frames of a move, as before 11-10.
|
|
1741
|
+
* `{"motion_blur_shutter": 1, "motion_blur_onset": 0, "motion_blur_max": 200}` smears every camera move by the
|
|
1742
|
+
* whole frame, as Screen Studio does.
|
|
1743
|
+
*/
|
|
1744
|
+
motion_blur_peak?: number;
|
|
1557
1745
|
matte?: RenderColor;
|
|
1746
|
+
/**
|
|
1747
|
+
* `1` draws a video in production's look from before 2026-11-11: its frame and layout (`padding`, 64 px at
|
|
1748
|
+
* 1080p by default, on every side, and the default viewport of then, 1440x730 at 1920x1080 in the browser
|
|
1749
|
+
* frame), the captions over the page near the window's foot, the 60% black caption pill, `bold` as 52 px
|
|
1750
|
+
* outlined text, the studio background for `auto`, 14 pixel corners, the old default shadow and a cursor
|
|
1751
|
+
* shown from the start. A new video gets a page-only camera, which zooms the page inside a window that
|
|
1752
|
+
* stands still, capped at 1.6x by default (`max_zoom` sets another; no `background_motion` or
|
|
1753
|
+
* `background_blur`), with today's move timings, and makes the poster the whole window after the last
|
|
1754
|
+
* step. Send it with `"frame": "browser"` to keep a video's old look. With it, `shadow: "soft"` is the old
|
|
1755
|
+
* black two-layer shadow, on a screenshot too. A restyle keeps the camera its video was recorded with, and
|
|
1756
|
+
* draws today's cursor, a sharp arrow over a faint trail, where production stamped copies of it. `2`, the
|
|
1757
|
+
* default, is the current look.
|
|
1758
|
+
*/
|
|
1759
|
+
look?: 1 | 2;
|
|
1558
1760
|
}
|
|
1559
1761
|
/** Give `url` or `html`. */
|
|
1560
1762
|
export type ScreenshotCreateRequest = {
|
|
@@ -1562,7 +1764,9 @@ export type ScreenshotCreateRequest = {
|
|
|
1562
1764
|
url?: string;
|
|
1563
1765
|
/** HTML to render instead of loading a URL. Rendered with no network access. */
|
|
1564
1766
|
html?: string;
|
|
1565
|
-
/**
|
|
1767
|
+
/**
|
|
1768
|
+
* 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`.
|
|
1769
|
+
*/
|
|
1566
1770
|
profile?: string;
|
|
1567
1771
|
viewport?: Viewport;
|
|
1568
1772
|
/**
|
|
@@ -1619,6 +1823,7 @@ export type ScreenshotCreateRequest = {
|
|
|
1619
1823
|
quality?: number;
|
|
1620
1824
|
/** Extra encodings of the same capture, each an artifact. */
|
|
1621
1825
|
variants?: ScreenshotVariant[];
|
|
1826
|
+
auto_background?: AutoBackgroundOptions;
|
|
1622
1827
|
metadata?: Metadata;
|
|
1623
1828
|
};
|
|
1624
1829
|
export interface ScreenshotVariant {
|
|
@@ -1654,7 +1859,7 @@ export interface Screenshot {
|
|
|
1654
1859
|
final_url?: string;
|
|
1655
1860
|
page_state?: ScreenshotPageState;
|
|
1656
1861
|
/**
|
|
1657
|
-
* Non-fatal problems, each starting with a code and a colon: `http_status` (the site answered an error, or a 200 whose title says the page is missing), `blank_main_area` (the main area was still one color after the readiness wait), `still_animating` (content was still fading in when the wait ended), `login_form` (a sign-in form instead of the content), `video_not_shown` (a video or video player in view had no frame to show and its box is empty in the image: a format this browser cannot play, or still loading), `image_not_shown` (a large image in view had not loaded and its box is empty in the image), `content_placeholder` (loading placeholders, the gray skeleton blocks a site draws while its content loads, were still in view), `partial_page` (when the wait ended, the lower part of the first screen was empty or a loading indicator stood alone above the page's footer, and the site had answered 202 or the page still had work under way: the page may not have finished drawing, or may have finished with a spinner left in view), `overlays_kept` (overlays in view with `overlays: "keep"`), `paywall` (a subscription wall covers the content and was left in place), `login_wall` (a registration or sign-in wall covers the content and was left in place), `load_incomplete` (`wait_until: "auto"` took the page before its load event, with how many images and videos in view had not arrived), `text_glyph_missing` (characters of the style's text, frame title or host that no font on the node has, or in a script the compositor does not shape yet, such as Devanagari and Thai; they are left blank), `background_fallback` (the image `background_ref: "auto"` chose could not be loaded within 2 s; the style's own background was drawn).
|
|
1862
|
+
* Non-fatal problems, each starting with a code and a colon: `http_status` (the site answered an error, or a 200 whose title says the page is missing), `blank_main_area` (the main area was still one color after the readiness wait), `still_animating` (content was still fading in when the wait ended), `login_form` (a sign-in form instead of the content), `video_not_shown` (a video or video player in view had no frame to show and its box is empty in the image: a format this browser cannot play, or still loading), `image_not_shown` (a large image in view had not loaded and its box is empty in the image), `content_placeholder` (loading placeholders, the gray skeleton blocks a site draws while its content loads, were still in view), `partial_page` (when the wait ended, the lower part of the first screen was empty or a loading indicator stood alone above the page's footer, and the site had answered 202 or the page still had work under way: the page may not have finished drawing, or may have finished with a spinner left in view), `overlays_kept` (overlays in view with `overlays: "keep"`), `paywall` (a subscription wall covers the content and was left in place), `login_wall` (a registration or sign-in wall covers the content and was left in place), `load_incomplete` (`wait_until: "auto"` took the page before its load event, with how many images and videos in view had not arrived), `text_glyph_missing` (characters of the style's text, frame title or host that no font on the node has, or in a script the compositor does not shape yet, such as Devanagari and Thai; they are left blank), `background_fallback` (the library image the `auto` background or `background_ref: "auto"` chose could not be loaded within 2 s; the style's own background was drawn), `auto_background_pin` (the project's, organization's or node's `auto_background` pin does not clear the page's edges, so `auto` picked another image; it names both).
|
|
1658
1863
|
*/
|
|
1659
1864
|
warnings?: string[];
|
|
1660
1865
|
/** What the clean capture hid, by kind and signal, with how many (`overlays`, `block_ads`). */
|
|
@@ -1666,6 +1871,7 @@ export interface Screenshot {
|
|
|
1666
1871
|
* this page. Absent when the style draws no library background.
|
|
1667
1872
|
*/
|
|
1668
1873
|
background_ref?: string;
|
|
1874
|
+
auto_background?: AutoBackgroundChoice;
|
|
1669
1875
|
}
|
|
1670
1876
|
/**
|
|
1671
1877
|
* What kind of page the screenshot captured, with vision's `PageState` field names: `ok`; `error` (an error status, signal `status`, or a 200 whose title says the page is missing, signal `title`); `loading` (the main area stayed blank, signal `blank_main_area`, or images or videos in view had not arrived when `wait_until: "auto"` took the page, signal `images_pending`, or skeleton blocks were still in view, signal `placeholders`, or, when the wait ended, the lower part of the first screen was empty or a loading indicator stood alone above the page's footer while the site had answered 202 or the page still had work under way, signal `partial_page`); `login` (a sign-in form instead of the content, signal `password_form`, or a registration or sign-in wall over it, signal `login_wall`); `paywall` (a subscription wall over the content, signal `paywall`; render's own state, as vision reads the HTML and has none); `cookie_wall` (a consent overlay left in view with `overlays: "keep"`). A wall is kept in the image, never hidden. A challenge or block page is not a screenshot: it fails with 502 `capture_failed` and reason `bot_challenge`.
|
|
@@ -1743,8 +1949,9 @@ export interface StepType {
|
|
|
1743
1949
|
target?: Target;
|
|
1744
1950
|
text: string;
|
|
1745
1951
|
/**
|
|
1746
|
-
* Delay between characters on the video's clock.
|
|
1747
|
-
*
|
|
1952
|
+
* Delay between characters on the video's clock. Left out, 35 ms: quick, steady typing, which reads well
|
|
1953
|
+
* on screen. The camera holds one shot on the field for the whole burst (`camera.typing_zoom`).
|
|
1954
|
+
* @default 35
|
|
1748
1955
|
*/
|
|
1749
1956
|
interval_ms?: number;
|
|
1750
1957
|
}
|
|
@@ -1789,7 +1996,9 @@ export interface Beat {
|
|
|
1789
1996
|
export interface VideoSource {
|
|
1790
1997
|
/** Where the recording starts. */
|
|
1791
1998
|
url: string;
|
|
1792
|
-
/**
|
|
1999
|
+
/**
|
|
2000
|
+
* 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`.
|
|
2001
|
+
*/
|
|
1793
2002
|
profile?: string;
|
|
1794
2003
|
}
|
|
1795
2004
|
export interface VoiceSpec {
|
|
@@ -1802,8 +2011,7 @@ export interface VoiceSpec {
|
|
|
1802
2011
|
}
|
|
1803
2012
|
export interface CaptionOptions {
|
|
1804
2013
|
/**
|
|
1805
|
-
* `none`: sidecar files only. `static
|
|
1806
|
-
* @default "static"
|
|
2014
|
+
* `none`: sidecar files only. `static`: draw each cue as a small pill in the margin under the window, which grows to hold it, on one line when that fits and `max_chars_per_line` and `max_lines` are left out. When the captions are too large for the margin, every cue sits over the page near its foot instead, and moves to the top while a step clicks what it would cover. `karaoke`: the same, with the words in step with the narration: on the default pill the words already spoken are white, the word being spoken is lit in a light B3 blue and the words to come are dimmed, each word lighting over 80 ms. A cue stays up until 0.2 s after its last word and 0.3 s after the last step of its beat is done; one still up when a click loads a new page ends 0.1 s after that page first shows, or 0.2 s after its last word when that is later. Left out: `karaoke` when the video is narrated, `static` when it is silent (`voice: null`, or a key without `infer:run`), whose word times are only estimated.
|
|
1807
2015
|
*/
|
|
1808
2016
|
burn_in?: "none" | "static" | "karaoke";
|
|
1809
2017
|
/** @default ["vtt"] */
|
|
@@ -1818,6 +2026,11 @@ export interface CaptionOptions {
|
|
|
1818
2026
|
export interface VideoOutput {
|
|
1819
2027
|
width: number;
|
|
1820
2028
|
height: number;
|
|
2029
|
+
/**
|
|
2030
|
+
* Frames per second of the video. The page is captured at 30 frames a second and the camera, cursor and
|
|
2031
|
+
* captions are drawn at this rate; while the page scrolls, a 60 fps video captures it at 60, once per output
|
|
2032
|
+
* frame (the timeline's `capture.stride` and `capture.full_rate`).
|
|
2033
|
+
*/
|
|
1821
2034
|
fps: 24 | 25 | 30 | 50 | 60;
|
|
1822
2035
|
}
|
|
1823
2036
|
export type VideoFormat = "mp4" | "gif" | "poster";
|
|
@@ -1834,39 +2047,310 @@ export interface VideoCreateRequest {
|
|
|
1834
2047
|
voice?: VoiceSpec | null;
|
|
1835
2048
|
captions?: CaptionOptions;
|
|
1836
2049
|
/**
|
|
1837
|
-
* The look. Leave it out for the B3OS look
|
|
1838
|
-
*
|
|
2050
|
+
* The look. Leave it out, or send `{}`, for the B3OS look on the bare rounded window, with no bar;
|
|
2051
|
+
* `{"frame": "window"}` adds the traffic lights on a slim bar in the page's top color, and `{"frame":
|
|
2052
|
+
* "browser"}` an address pill.
|
|
1839
2053
|
*/
|
|
1840
2054
|
style?: RenderStyle;
|
|
2055
|
+
/**
|
|
2056
|
+
* How the camera follows the steps. The camera moves over the whole frame: as it zooms in, the window, its
|
|
2057
|
+
* shadow and the page grow together and the background and the window's edges leave the frame, while
|
|
2058
|
+
* captions stay where they are. By default (`framing: subject`) each page is held in one of three
|
|
2059
|
+
* compositions: the whole window, the page's main content area, or one panel (see `framing`). With
|
|
2060
|
+
* `framing: point`, before a click, select or typing step it zooms in on the element and stays in through
|
|
2061
|
+
* the whole step (a type until its last key), for 1.5 s at least; it stays in for the next step when that
|
|
2062
|
+
* one starts within 2.5 s, or is close by, and pans only when the next element nears the edge of the frame,
|
|
2063
|
+
* and only as far as brings it back in. Every move is one quick, damped spring with no overshoot:
|
|
2064
|
+
* 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
|
|
2065
|
+
* the next element sets off with the cursor, never before it, and takes longer the farther it goes, so the
|
|
2066
|
+
* middle of the frame moves at most 60 px a frame at 60 fps, or faster where that keeps the cursor 8% of
|
|
2067
|
+
* the frame inside its edges. An element near an edge of the window zooms with that edge held in place, so
|
|
2068
|
+
* the margin beside it stays in view, and where the whole window or page fits the frame, it stays whole,
|
|
2069
|
+
* with the room beside it split evenly when there is little to spare. The camera rests 1.5 s at least on
|
|
2070
|
+
* what it shows last before it zooms out, when the video has room before its end, and the last zoom holds
|
|
2071
|
+
* until the narration line about it has nearly ended. The video opens on the whole window
|
|
2072
|
+
* for half a second at least and ends on it for a second at least, so it can run a little past the last
|
|
2073
|
+
* beat.
|
|
2074
|
+
*/
|
|
1841
2075
|
camera?: {
|
|
1842
2076
|
/**
|
|
1843
|
-
*
|
|
1844
|
-
*
|
|
2077
|
+
* `auto` moves the camera. With `framing: subject`, the default, its zooms are its compositions' (see
|
|
2078
|
+
* `framing`) and what follows holds where it says so. With `framing: point` it zooms so the element and a
|
|
2079
|
+
* little around it fill about 45% of the frame width, from 1.25x up to `max_zoom`, and 1.25x on an
|
|
2080
|
+
* element in a nav, aside or header bar, where the change it causes is
|
|
2081
|
+
* usually elsewhere on the page. A zoom under 1.4x is not worth the move: the camera stays wide for it
|
|
2082
|
+
* (a nav element starting a session, a typing shot under 1.4x), and an element inside a zoomed session
|
|
2083
|
+
* that would zoom less is framed at the session's zoom. After a move lands, the next waits 1.2 s at
|
|
2084
|
+
* least: an element that comes sooner is framed with the one before it when both fit one view at 1.4x
|
|
2085
|
+
* or more, else the camera stays where it is for the earlier one and moves once, to the later one. With
|
|
2086
|
+
* `scroll: comfortable` the view changes (camera moves and page scrolls together) at most once per 2.5 s
|
|
2087
|
+
* on average over the video: over that, the move with the least change of zoom whose element was
|
|
2088
|
+
* already in view is left out, and the element is framed where the camera stands. A
|
|
2089
|
+
* re-centre under 96 px at 1080p is left out. A click that loads a new page ends the zoom: the camera
|
|
2090
|
+
* starts going wide 0.1 s after the new page first shows, also when the page's address changes only by
|
|
2091
|
+
* the next step. On a portrait frame the camera zooms at most as far as keeps the whole window across the
|
|
2092
|
+
* frame, and the 1.4x floor applies after that, so a portrait video stays on the whole window and only
|
|
2093
|
+
* its page scrolls. Held against one window edge, a view keeps a window edge on the other axis that shows
|
|
2094
|
+
* in the frame at its resting margin. With burned-in captions every element the camera frames, and the
|
|
2095
|
+
* cursor resting by it, stays at least 24 px (at 1080p) clear of the caption pill, and a zoomed hold keeps
|
|
2096
|
+
* the window's bottom edge where it rests, so the pill sits on the background under it, whenever the
|
|
2097
|
+
* element ends at least 20 px above that edge and starts at least 120 px below the frame's top; otherwise
|
|
2098
|
+
* the pill lies over the page. A hold never leaves the window's bottom edge between y 960 and 1080 at
|
|
2099
|
+
* 1080p: it moves it to 950 or below the frame. With both framings the 1.2 s between moves, the 2.5 s
|
|
2100
|
+
* 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
|
|
2101
|
+
* are kept, under 1.4x). `off` keeps the whole window in view.
|
|
2102
|
+
* @default "auto"
|
|
2103
|
+
*/
|
|
2104
|
+
style?: "auto" | "subtle" | "off";
|
|
2105
|
+
/**
|
|
2106
|
+
* The older spelling of `style`: `false` is `off`, `true` is `auto`. Send `style` instead. A request
|
|
2107
|
+
* whose `auto_zoom` and `style` disagree is refused with `invalid_request`.
|
|
2108
|
+
* @deprecated
|
|
1845
2109
|
*/
|
|
1846
2110
|
auto_zoom?: boolean;
|
|
1847
|
-
/**
|
|
2111
|
+
/**
|
|
2112
|
+
* The most the camera zooms, never exceeded. A small button reaches it; a wide element zooms less, so it
|
|
2113
|
+
* fits. Left out, the camera zooms up to 1.7x, or to the zoom within 10% of it where one captured pixel
|
|
2114
|
+
* lands on one output pixel (1.73x on the default canvas and viewport, two output pixels per CSS pixel;
|
|
2115
|
+
* 1.84x with `window_shape: wide`), so zoomed text is as sharp as the page. Left out, it never magnifies
|
|
2116
|
+
* the page past three output pixels per CSS pixel at 1080p, so a phone layout on a portrait video, drawn
|
|
2117
|
+
* at about twice its size, zooms about 1.4x. Above that the zoom enlarges the capture, and text is a
|
|
2118
|
+
* little softer. The zoom magnifies the whole frame, window and page alike. With `look: 1`, left out
|
|
2119
|
+
* it is 1.6, production's cap, which lands at 1.61x, one to one, on that look's default canvas, and
|
|
2120
|
+
* the zoom magnifies the page inside the window.
|
|
2121
|
+
* @default 1.7
|
|
2122
|
+
*/
|
|
1848
2123
|
max_zoom?: number;
|
|
2124
|
+
/**
|
|
2125
|
+
* How far the background follows the window as the camera moves: 0 holds it still, 1 moves and zooms
|
|
2126
|
+
* it with the window, so the whole frame zooms as one. At the default it moves and zooms a tenth as
|
|
2127
|
+
* much, a slight depth behind the window.
|
|
2128
|
+
* @default 0.1
|
|
2129
|
+
*/
|
|
2130
|
+
background_motion?: number;
|
|
2131
|
+
/**
|
|
2132
|
+
* Blur the background: an image background is drawn 4 px soft on the whole window (at 1080p, scaled
|
|
2133
|
+
* with the frame), so the window stays the busiest thing in the frame, and softens further as the camera
|
|
2134
|
+
* zooms in, about 7 px at 1.6x on a 1080p video, at most 16 px. `false` keeps it sharp throughout, and
|
|
2135
|
+
* `overrides.look: 1` draws it sharp at rest. Left out, it is on for an image background (the default
|
|
2136
|
+
* look's library images among them) and off for gradients, solid colors and patterns, where a blur shows
|
|
2137
|
+
* little or erases the pattern. Gradients, solid colors and patterns are never blurred at rest. It is
|
|
2138
|
+
* decided before the first frame, so a default video drawn on its studio fallback (no library image
|
|
2139
|
+
* clears the page's edges, or the image could not be loaded) blurs that mesh as the camera zooms; send
|
|
2140
|
+
* `false` to keep it sharp.
|
|
2141
|
+
*/
|
|
2142
|
+
background_blur?: boolean;
|
|
2143
|
+
/**
|
|
2144
|
+
* The zoom of a typing shot: a field typed into (a `type` step, or a click a `type` without a target
|
|
2145
|
+
* follows) is framed from its start at this zoom, reached by the first key (the cursor gets there half a
|
|
2146
|
+
* second early) and held for the whole
|
|
2147
|
+
* burst, with no move per key; a click right after it on something already in view stays in the
|
|
2148
|
+
* same shot.
|
|
2149
|
+
* It is never less than the camera's least zoom, 1.25x, which is what 1 gives, never more than
|
|
2150
|
+
* `max_zoom`, nor more than the zoom where the page is as sharp as captured (1.73x on the default
|
|
2151
|
+
* canvas), so the default types at 1.73x. `style: subtle` keeps its own ceiling, and a field in a nav,
|
|
2152
|
+
* aside or header bar its own zoom. With `framing: subject` a field typed into is a DETAIL when it
|
|
2153
|
+
* qualifies (see `framing`), at this zoom at most, and otherwise held in the page's main content area.
|
|
2154
|
+
* @default 2
|
|
2155
|
+
*/
|
|
2156
|
+
typing_zoom?: number;
|
|
2157
|
+
/**
|
|
2158
|
+
* What the camera holds. `subject` (the default) holds each page in one of three compositions. The
|
|
2159
|
+
* whole window. MAIN, the page's main content area across the frame: the content box of its `main` (or
|
|
2160
|
+
* `role="main"`) element when that is wider than half the viewport, else the viewport less a fixed or
|
|
2161
|
+
* sticky sidebar or header bar, with 24 CSS px each side, from 1.25x up to `max_zoom` (1.42x on the B3OS
|
|
2162
|
+
* console); a page with neither has no MAIN and is held on the whole window, where the first element a
|
|
2163
|
+
* step acts on or the narration names is a DETAIL whatever the length of its line (an element with no
|
|
2164
|
+
* enclosing panel framed by its own box), an element that DETAIL shows stays in it, and a page's DETAILs
|
|
2165
|
+
* come at most one per 4 s. DETAIL, one panel or control:
|
|
2166
|
+
* the nearest enclosing element that draws a box of its own (a background, a border, a shadow or
|
|
2167
|
+
* rounded corners) or is a section, article, main, form, table, list, dialog or region, at least 240 x
|
|
2168
|
+
* 120 CSS px or 1.3 times the element on both axes, or the element's own row when that panel is too wide
|
|
2169
|
+
* for 1.4x, at up to `max_zoom`, only when it is narrower than 45% of MAIN's view, its narration line (or
|
|
2170
|
+
* its typing) lasts 2 s or more from the step, it zooms at least 1.1x MAIN's zoom, and its view keeps the
|
|
2171
|
+
* window's bottom edge where it rests or holds the element above the caption band. A page opens on the
|
|
2172
|
+
* whole window, goes to MAIN at its first step or narrated element, may go to a DETAIL (held through its
|
|
2173
|
+
* line) and back, goes from one DETAIL to another only within 40% of the frame's width, and goes wide
|
|
2174
|
+
* again only at a click that loads a new page or at the end; an element outside MAIN across, such as a
|
|
2175
|
+
* sidebar link, is reached wide. MAIN keeps the window's bottom edge where it rests, the caption pill on
|
|
2176
|
+
* the background under it; for a beat whose element lies above that view, or whose label starts less than
|
|
2177
|
+
* 24 CSS px under that view's top edge, its top is the window's top,
|
|
2178
|
+
* the pill over the page, and a page moves between the two at most once, in one 0.4 s vertical move (it
|
|
2179
|
+
* stays top-anchored when its elements would need more). A click that loads a new path starts a new page,
|
|
2180
|
+
* which takes its own position as it first shows: where the camera holds MAIN across the click at one
|
|
2181
|
+
* zoom, it cuts there with the page, with no move. Where page content lies under the captions, no
|
|
2182
|
+
* element the camera frames, no typed text and no resting cursor sits within 120 px (at 1080p) above the
|
|
2183
|
+
* pill's top. A DETAIL's view is placed by its panel, never by the click: centred on it, or from 24 px
|
|
2184
|
+
* left of its left edge when it is wider than the view, with the element and the cursor kept 24 px
|
|
2185
|
+
* inside, and an edge that would cut a neighbouring panel moves to the gap beside it when that is within
|
|
2186
|
+
* 20% of the frame's width. A hover the narration speaks over, and an element a `wait` step waits for (by
|
|
2187
|
+
* `for.selector` or `for.text`) while a line is spoken, are followed too, a wait only when no click,
|
|
2188
|
+
* hover, select or typing follows it in its beat; the first such element of a line is in view from 0.3 s
|
|
2189
|
+
* before the line starts, and so is an element waited for after clicks in its line that all land inside
|
|
2190
|
+
* it, once a scroll before it has landed. A click that opens a beat after the first lands 0.3 s after its
|
|
2191
|
+
* line starts, the cursor setting off in the pause before the line, and an element waited for after it is
|
|
2192
|
+
* that line's element; a `wait` for a heading names its section's first panel. The closing zoom-out starts
|
|
2193
|
+
* at least 1.2 s after the last narrated element is shown. After a click that loads a new page, the first
|
|
2194
|
+
* element waited
|
|
2195
|
+
* 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
|
|
2196
|
+
* the new page first shows, or, still in MAIN on the page the click left at the same zoom, cuts to it as
|
|
2197
|
+
* it first shows, and holds until 0.8 s after its line ends, and the video leaves
|
|
2198
|
+
* 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
|
|
2199
|
+
* page's main content box as its step runs (`observed.subject` in the timeline). `point` frames the click
|
|
2200
|
+
* point, at the zoom that fits the element, and leaves hovers and waits to the cursor, as before. With
|
|
2201
|
+
* `look: 1` the camera frames the point.
|
|
2202
|
+
* @default "subject"
|
|
2203
|
+
*/
|
|
2204
|
+
framing?: "subject" | "point";
|
|
1849
2205
|
};
|
|
2206
|
+
/**
|
|
2207
|
+
* How the page scrolls to what a step acts on or waits for. `comfortable`: an element outside the middle of
|
|
2208
|
+
* the viewport (8% to 85% of its height) scrolls its panel (see `camera.framing`) to the middle, its top at
|
|
2209
|
+
* 20% when the panel is taller than 40% of the viewport, else centred at 45%, the element kept in that band,
|
|
2210
|
+
* and up to 24 px further so the viewport's edges fall between lines of text: before the cursor sets off
|
|
2211
|
+
* 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
|
|
2212
|
+
* with its fastest moment at its middle, and lands 0.3 s before), and as a waited-for element appears. A
|
|
2213
|
+
* 60 fps video captures its page once per output frame while it scrolls (at 30 fps elsewhere), so the page
|
|
2214
|
+
* moves a little every frame. A scroll always runs its whole length: the step and the rest of its beat wait
|
|
2215
|
+
* for it. A scroll that brings in the element a narration line names runs in the pause before the line and
|
|
2216
|
+
* ends by its start (0.3 s before it when there is room); when the pause is shorter than the scroll, the line
|
|
2217
|
+
* and everything after it wait for it, 0.8 s at most. Before the scrolls are planned step by step, a page
|
|
2218
|
+
* whose elements all show in the camera's view at one scroll position scrolls once, to that position, in the
|
|
2219
|
+
* pause before the first line that needs it, and never again. A scroll that serves a later beat runs before
|
|
2220
|
+
* that beat. An element already in
|
|
2221
|
+
* the band never scrolls the page, and while the camera is zoomed, an element whose panel the viewport
|
|
2222
|
+
* shows whole is reached by moving the camera (`framing: "point"`); with the default framing the camera
|
|
2223
|
+
* holds the page's view instead, so the scroll is left out only when that view already shows the panel
|
|
2224
|
+
* whole above the caption. The page never goes up and back down: of two scrolls in
|
|
2225
|
+
* opposite directions within 4 s that move it on by less than 25% of their total, one or both are left out
|
|
2226
|
+
* whenever the steps they serve stay in the viewport without them, or the two become one scroll to a position
|
|
2227
|
+
* that keeps them all in view (a step's element is never left out of the viewport); when neither works, both
|
|
2228
|
+
* run at their whole length, and `result.warnings` and the timeline's `warnings` have `scroll_round_trip`. A
|
|
2229
|
+
* scroll for an element in a sticky box is left out when it can be. A scroll never runs
|
|
2230
|
+
* during a camera move (it ends 0.1 s before one starts, or starts 0.1 s after one lands; a zoom-out waits
|
|
2231
|
+
* for the scroll that brings a waited-for element), a scrolled result stays put 1.2 s, and a narration line
|
|
2232
|
+
* scrolls the page once. Before the closing zoom-out a scrolled page goes back to the top whenever the last
|
|
2233
|
+
* 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
|
|
2234
|
+
* result with a `wait` step
|
|
2235
|
+
* (`for.selector` or `for.text`) and the camera brings it into view. `minimal` scrolls only an
|
|
2236
|
+
* element outside the viewport, to its middle, as before. `off` moves the page only by the script's own
|
|
2237
|
+
* `scroll` steps: a step whose element is outside the viewport fails as one whose element is not found. With
|
|
2238
|
+
* `look: 1` the page scrolls as `minimal`.
|
|
2239
|
+
* @default "comfortable"
|
|
2240
|
+
*/
|
|
2241
|
+
scroll?: "comfortable" | "minimal" | "off";
|
|
2242
|
+
/**
|
|
2243
|
+
* How the cursor moves. It shows from the first frame, with no fade-in, parked on the first of six spots
|
|
2244
|
+
* that is plain on the video's first frame and on its frame just before the cursor first moves, as
|
|
2245
|
+
* captured, and clear of text, controls and images on the page just before the first step: right of
|
|
2246
|
+
* and below the middle of the page (62% across, 68% down), near its bottom right (88%, 88%), low in the
|
|
2247
|
+
* middle (50%, 92%), at its right edge (92%, 50%), in its bottom-right corner (96%, 96%) or at the middle
|
|
2248
|
+
* of its bottom edge (50%, 97%); the page gets no pointer event until the cursor's first move has ended, so
|
|
2249
|
+
* 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
|
|
2250
|
+
* does, and lands when it would have; after a click, a select or the first key typed into a field, the
|
|
2251
|
+
* cursor moves just off the element, so it never covers its label or the text being typed while the camera
|
|
2252
|
+
* holds. After a hover, and while typing, it rests where its arrow covers no text, badge or control and
|
|
2253
|
+
* stays at least 8 px inside the page: below and right of the hovered label's own text (of the hovered
|
|
2254
|
+
* point on a target wider than 400 px whose text runs as wide, such as a table row), else right of it,
|
|
2255
|
+
* else another spot that keeps the arrow's tip within 24 px of the label (a table's header cells count as
|
|
2256
|
+
* text); while typing, under the field, beside
|
|
2257
|
+
* it or above it, else another spot within 24 px of it, else inside it past the end of the typed text. A
|
|
2258
|
+
* hover's rest is checked again on the captured page as the cursor sets off for it: where its arrow would
|
|
2259
|
+
* lie on text there, it rests at the first clear spot beside, below or above the element (or on the
|
|
2260
|
+
* element itself), the least busy one when none is clear.
|
|
2261
|
+
* When the page scrolls under the resting cursor, it stands still while the page moves, then, 150 ms
|
|
2262
|
+
* after the scroll ends, moves once off what it landed on, across it (under or above a label, beside a
|
|
2263
|
+
* tall box) up to 64 px, else up to 40 px to the nearest spot clear of what scrolled there; it stays when
|
|
2264
|
+
* 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`
|
|
2265
|
+
* moves it as before (hidden until it fades in at the middle before its first move).
|
|
2266
|
+
*/
|
|
2267
|
+
cursor?: {
|
|
2268
|
+
/**
|
|
2269
|
+
* How long each move takes to settle: the remaining distance falls to about a third of itself every
|
|
2270
|
+
* 100 ms near the end at the default. 0 keeps the eased path without smoothing.
|
|
2271
|
+
* @default 100
|
|
2272
|
+
*/
|
|
2273
|
+
smoothing_ms?: number;
|
|
2274
|
+
/**
|
|
2275
|
+
* Still this long, the cursor fades out over 0.4 s, and it fades back in over 0.3 s before its next
|
|
2276
|
+
* move; still to the end of the video, it stays hidden. 0 never hides it; under 500 counts as 500.
|
|
2277
|
+
* @default 2000
|
|
2278
|
+
*/
|
|
2279
|
+
hide_after_ms?: number;
|
|
2280
|
+
/**
|
|
2281
|
+
* After a click, a select or the first key typed into a field, move the cursor just below the element
|
|
2282
|
+
* (above it near the bottom of the page) when the next move can wait for it. A hover never moves off.
|
|
2283
|
+
* @default true
|
|
2284
|
+
*/
|
|
2285
|
+
move_aside?: boolean;
|
|
2286
|
+
};
|
|
2287
|
+
/**
|
|
2288
|
+
* The page's CSS size. Left out, 1440 px wide on a landscape frame and 430 on a portrait one, as tall as the
|
|
2289
|
+
* window's shape; a square or near-square frame (no wider than 4:3) gets about its window's width, so its page
|
|
2290
|
+
* is drawn at least one pixel per CSS pixel at rest.
|
|
2291
|
+
*/
|
|
1850
2292
|
viewport?: Viewport;
|
|
1851
2293
|
output?: VideoOutput;
|
|
1852
2294
|
/** @default ["mp4","poster"] */
|
|
1853
2295
|
formats?: VideoFormat[];
|
|
1854
2296
|
/** Seeds the page's randomness so a re-render is identical. */
|
|
1855
2297
|
seed?: number;
|
|
1856
|
-
/**
|
|
2298
|
+
/**
|
|
2299
|
+
* 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.
|
|
2300
|
+
*/
|
|
1857
2301
|
start_time?: string;
|
|
1858
2302
|
recording?: RecordingOptions;
|
|
2303
|
+
auto_background?: AutoBackgroundOptions;
|
|
1859
2304
|
webhook?: WebhookConfig;
|
|
1860
2305
|
metadata?: Metadata;
|
|
1861
2306
|
}
|
|
2307
|
+
/**
|
|
2308
|
+
* How the default `background: auto` picks its library image, for this request. Each field overrides the
|
|
2309
|
+
* project's, then the organization's, then the node's setting. By default the node keeps one pick per
|
|
2310
|
+
* organization and site (the page's registrable domain, such as `linear.app` for `app.linear.app`; the host for
|
|
2311
|
+
* `localhost` and IP addresses): the vision model's first pick for a site is kept, and later videos and
|
|
2312
|
+
* screenshots of the site draw the same image while it clears their page's edges. A color-rules pick is not
|
|
2313
|
+
* kept, so the site's next video or screenshot asks the model again.
|
|
2314
|
+
*/
|
|
2315
|
+
export interface AutoBackgroundOptions {
|
|
2316
|
+
/**
|
|
2317
|
+
* 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.
|
|
2318
|
+
*/
|
|
2319
|
+
pin?: string;
|
|
2320
|
+
/**
|
|
2321
|
+
* 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.
|
|
2322
|
+
* @default false
|
|
2323
|
+
*/
|
|
2324
|
+
repick?: boolean;
|
|
2325
|
+
/**
|
|
2326
|
+
* `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.
|
|
2327
|
+
*/
|
|
2328
|
+
vision?: boolean;
|
|
2329
|
+
}
|
|
2330
|
+
/**
|
|
2331
|
+
* 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`).
|
|
2332
|
+
*/
|
|
2333
|
+
export interface AutoBackgroundChoice {
|
|
2334
|
+
ref: string;
|
|
2335
|
+
/**
|
|
2336
|
+
* `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.
|
|
2337
|
+
*/
|
|
2338
|
+
chosen_by: "vision" | "heuristic" | "pinned" | "stored";
|
|
2339
|
+
/** The site the pick is kept under. Absent for an `html` source. */
|
|
2340
|
+
key?: string;
|
|
2341
|
+
/** The model's one-line reason (`vision`), or why the color rules chose (`heuristic`). */
|
|
2342
|
+
reason?: string;
|
|
2343
|
+
}
|
|
1862
2344
|
/**
|
|
1863
2345
|
* Where the page's network traffic comes from. By default every video loads the site live and records that
|
|
1864
2346
|
* load (its capture segments replay the recording, so they all see the same content). With `reuse: true` the
|
|
1865
2347
|
* video replays the newest recording another video of this project made of the same source URL, steps,
|
|
1866
2348
|
* viewport, seed and start time within `max_age_s`, instead of loading the site again: faster, and the
|
|
1867
|
-
* content is what the site served then.
|
|
1868
|
-
*
|
|
1869
|
-
*
|
|
2349
|
+
* content is what the site served then. Videos without `start_time` match each other, and the replay runs on
|
|
2350
|
+
* the clock the recording was made on, so the page shows that time. A video that sends back such a video's
|
|
2351
|
+
* `result.start_time` replays that recording too. When no such recording exists the site is loaded and
|
|
2352
|
+
* recorded as usual. `result.recording` says which happened. Recordings hold the page's
|
|
2353
|
+
* responses; they are deleted 24 hours after they were made, or earlier with the last video that used them.
|
|
1870
2354
|
*/
|
|
1871
2355
|
export interface RecordingOptions {
|
|
1872
2356
|
/** @default false */
|
|
@@ -1918,6 +2402,10 @@ export interface VideoResult {
|
|
|
1918
2402
|
width: number;
|
|
1919
2403
|
height: number;
|
|
1920
2404
|
fps: number;
|
|
2405
|
+
/**
|
|
2406
|
+
* 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.
|
|
2407
|
+
*/
|
|
2408
|
+
start_time?: string;
|
|
1921
2409
|
/**
|
|
1922
2410
|
* The MP4 first (when asked for), then the poster, the caption files, the GIF and, when a beat has a title, the chapters file.
|
|
1923
2411
|
*/
|
|
@@ -1925,9 +2413,10 @@ export interface VideoResult {
|
|
|
1925
2413
|
recording?: RecordingInfo;
|
|
1926
2414
|
narration?: NarrationInfo;
|
|
1927
2415
|
/**
|
|
1928
|
-
* Non-fatal problems, each starting with a code and a colon: `narration_scope` (the beats' `say` lines were not spoken because the key lacks `infer:run`, which narration needs; the video has no narration track); `page_requests` (requests for the page's code, styles or fonts, or for its own site's data, made while the video was captured, were not in the network recording made when it loaded, so they failed and the video can show a page that did not finish loading; up to three are named, without their query; trackers, beacons and prefetches that fail the same way are not counted); `zoom_soft` (the page drew differently between two parts of the capture and the video could not be captured again whole, so from the time it names on the video comes from a lower device scale and its zooms are softer than the page). A restyle repeats its source's. Absent when there is nothing to say.
|
|
2416
|
+
* Non-fatal problems, each starting with a code and a colon: `narration_scope` (the beats' `say` lines were not spoken because the key lacks `infer:run`, which narration needs; the video has no narration track); `page_requests` (requests for the page's code, styles or fonts, or for its own site's data, made while the video was captured, were not in the network recording made when it loaded, so they failed and the video can show a page that did not finish loading; up to three are named, without their query; trackers, beacons and prefetches that fail the same way are not counted); `zoom_soft` (the page drew differently between two parts of the capture and the video could not be captured again whole, so from the time it names on the video comes from a lower device scale and its zooms are softer than the page); `background_fallback` (the library image the `auto` background or `background_ref: "auto"` chose could not be loaded in time; the video was drawn on the studio pick, or the style's own background, and a restyle tries again); `scroll_round_trip` (the steps make the page scroll down and back up, or up and back down, within 4 s and no one scroll position shows every element they act on, so the video runs both scrolls; the timeline's `warnings` has the code too); `auto_background_pin` (the project's, organization's or node's `auto_background` pin does not clear the first frame's edges, so `auto` picked another image; it names both). A restyle repeats its source's, except `background_fallback`, which it decides again, and `auto_background_pin`, which it repeats only when it draws the source's image again (a restyle that picks the background again says its own, and one that draws another background says none). Absent when there is nothing to say.
|
|
1929
2417
|
*/
|
|
1930
2418
|
warnings?: string[];
|
|
2419
|
+
auto_background?: AutoBackgroundChoice;
|
|
1931
2420
|
}
|
|
1932
2421
|
/**
|
|
1933
2422
|
* Present when the request has `voice` and at least one beat has `say` (a restyle repeats its source's).
|
|
@@ -1989,7 +2478,7 @@ export interface RenderTimeline {
|
|
|
1989
2478
|
};
|
|
1990
2479
|
capture: {
|
|
1991
2480
|
/**
|
|
1992
|
-
* Page capture
|
|
2481
|
+
* Page capture clock. Capture frame seq is taken at virtual time t(seq) = round(seq * 1e6 / fps) us (with stride, only the seqs it takes).
|
|
1993
2482
|
* @default 30
|
|
1994
2483
|
*/
|
|
1995
2484
|
fps: number;
|
|
@@ -2011,14 +2500,22 @@ export interface RenderTimeline {
|
|
|
2011
2500
|
*/
|
|
2012
2501
|
segments?: number;
|
|
2013
2502
|
/**
|
|
2014
|
-
* Device scale factor of the capture (ARCHITECTURE 5.2, orchestrator decision D1): 1 or 2 for every segment, or auto: segments whose zoom plan goes past about 1.2x are captured at 2, the rest at 1. segment_dsf records what each segment got.
|
|
2503
|
+
* Device scale factor of the capture (ARCHITECTURE 5.2, orchestrator decision D1): 1 or 2 for every segment, or auto: segments whose zoom plan goes past about 1.2x are captured at 2, the rest at 1, or, in look v2, at the video's rest scale (its page layer's output pixels per CSS pixel rounded up to a thousandth, 1.159 on the default 1920x1080 canvas), so the whole window is the capture drawn one to one, and a zoom at 2 (a node may capture a zoom at the least of 1.5, 1.75 and 2 that its frames need, never enlarged); a closing shot on the whole window shorter than 2 s right after a zoom is captured with it. segment_dsf records what each segment got.
|
|
2015
2504
|
* @default "auto"
|
|
2016
2505
|
*/
|
|
2017
2506
|
dsf?: 1 | 2 | "auto";
|
|
2018
2507
|
/**
|
|
2019
|
-
* The device scale factor each segment was captured at (index = segment number), written when the capture is planned; a restyle from the archived capture reads it instead of inferring it from image sizes. A page image larger than the page layer by more than 4/3 is box-halved by the compositor before resampling.
|
|
2508
|
+
* 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.
|
|
2020
2509
|
*/
|
|
2021
|
-
segment_dsf?:
|
|
2510
|
+
segment_dsf?: number[];
|
|
2511
|
+
/**
|
|
2512
|
+
* 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.
|
|
2513
|
+
*/
|
|
2514
|
+
stride?: number;
|
|
2515
|
+
/**
|
|
2516
|
+
* 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.
|
|
2517
|
+
*/
|
|
2518
|
+
full_rate?: number[][];
|
|
2022
2519
|
};
|
|
2023
2520
|
/** Composed video. Output frame index i is presented at t = round(i * 1e6 / fps) us. */
|
|
2024
2521
|
output: {
|
|
@@ -2044,10 +2541,29 @@ export interface RenderTimeline {
|
|
|
2044
2541
|
captions?: RenderTimelinePresetRef;
|
|
2045
2542
|
click_effect?: RenderTimelinePresetRef;
|
|
2046
2543
|
/**
|
|
2047
|
-
* Style fields that override the presets, validated by b3os-compose against its Style type (NOTES/render-compose.md 1.1): padding, corner_radius, shadow, border, background_color, background_gradient, background_ref, background_tokens, aspect_ratio, canvas, fit, frame_title, frame_url, theme, cursor_size, cursor_zoom, click_color, click_duration_ms, caption_size, caption_color, caption_highlight, caption_background, caption_position, motion_blur, matte, text, perspective, perspective_intensity, camera, tilt_x, tilt_y, roll, camera_offset, frame_scale, depth_blur, depth_blur_type, depth_blur_angle, depth_blur_position, depth_blur_band, depth_blur_width, layout (these sixteen for screenshots only). Unknown keys and bad values are refused with 422 style_invalid.
|
|
2544
|
+
* Style fields that override the presets, validated by b3os-compose against its Style type (NOTES/render-compose.md 1.1): padding, corner_radius, shadow, border, background_color, background_gradient, background_ref, background_tokens, aspect_ratio, canvas, fit, frame_title, frame_url, theme, cursor_size, cursor_zoom, cursor_press_scale, click_color, click_duration_ms, caption_size, caption_color, caption_highlight, caption_background, caption_position, caption_upcoming, caption_fade_ms, caption_backdrop, window_shape, motion_blur, motion_blur_shutter, motion_blur_onset, motion_blur_peak, matte, text, perspective, perspective_intensity, camera, tilt_x, tilt_y, roll, camera_offset, frame_scale, depth_blur, depth_blur_type, depth_blur_angle, depth_blur_position, depth_blur_band, depth_blur_width, layout (these sixteen for screenshots only), look. Unknown keys and bad values are refused with 422 style_invalid.
|
|
2048
2545
|
*/
|
|
2049
2546
|
overrides?: Record<string, unknown>;
|
|
2050
2547
|
};
|
|
2548
|
+
/**
|
|
2549
|
+
* 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.
|
|
2550
|
+
*/
|
|
2551
|
+
look?: {
|
|
2552
|
+
version: 2;
|
|
2553
|
+
/**
|
|
2554
|
+
* 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.
|
|
2555
|
+
*/
|
|
2556
|
+
background_pick?: string;
|
|
2557
|
+
/**
|
|
2558
|
+
* 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).
|
|
2559
|
+
*/
|
|
2560
|
+
background_choice?: {
|
|
2561
|
+
ref: string;
|
|
2562
|
+
chosen_by: "vision" | "heuristic" | "pinned" | "stored";
|
|
2563
|
+
key?: string;
|
|
2564
|
+
reason?: string;
|
|
2565
|
+
};
|
|
2566
|
+
};
|
|
2051
2567
|
/**
|
|
2052
2568
|
* Where the page layer lands in the output frame, computed by b3os-compose from style and output size and recorded for reproducibility.
|
|
2053
2569
|
*/
|
|
@@ -2072,7 +2588,7 @@ export interface RenderTimeline {
|
|
|
2072
2588
|
*/
|
|
2073
2589
|
actions: RenderTimelineAction[];
|
|
2074
2590
|
/**
|
|
2075
|
-
* Composited cursor (not drawn in the page). Position is linear between consecutive points; pressed and visible keep their last value until a point changes them. Before the first point and after the last, the nearest point applies.
|
|
2591
|
+
* Composited cursor (not drawn in the page). Position is linear between consecutive points; pressed and visible keep their last value until a point changes them. Before the first point and after the last, the nearest point applies. The director hides the cursor until it fades in over 300 ms before its first move, where that move starts.
|
|
2076
2592
|
*/
|
|
2077
2593
|
cursor?: {
|
|
2078
2594
|
points: {
|
|
@@ -2081,12 +2597,34 @@ export interface RenderTimeline {
|
|
|
2081
2597
|
y: number;
|
|
2082
2598
|
pressed?: boolean;
|
|
2083
2599
|
visible?: boolean;
|
|
2600
|
+
/**
|
|
2601
|
+
* 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).
|
|
2602
|
+
*/
|
|
2603
|
+
fade_us?: RenderTimelineUs;
|
|
2084
2604
|
}[];
|
|
2605
|
+
/**
|
|
2606
|
+
* 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.
|
|
2607
|
+
*/
|
|
2608
|
+
pointer_from_us?: RenderTimelineUs;
|
|
2085
2609
|
};
|
|
2086
2610
|
/**
|
|
2087
|
-
* Camera keyframes. For t between keyframes k-1 and k: u = (t - t[k-1]) / (t[k] - t[k-1]), e = easing[k](u), zoom = zoom[k-1] * (zoom[k] / zoom[k-1])^e, center = center[k-1] + (center[k] - center[k-1]) * e. Before the first keyframe and after the last, the nearest keyframe holds.
|
|
2611
|
+
* Camera keyframes. For t between keyframes k-1 and k: u = (t - t[k-1]) / (t[k] - t[k-1]), e = easing[k](u), zoom = zoom[k-1] * (zoom[k] / zoom[k-1])^e, center = center[k-1] + (center[k] - center[k-1]) * e. Before the first keyframe and after the last, the nearest keyframe holds. Page space (space absent or page): the camera rect is width = viewport.width / zoom, height = viewport.height / zoom, x = clamp(center.x - width / 2, 0, viewport.width - width), y likewise; the page is cropped and scaled inside a fixed window. Canvas space: the camera moves over the whole composition (output px, canvas W x H = output size, page rect P = layout.page, s = P.size / viewport). center is the zoom's focus, the point that keeps its place on the frame: F = P.xy + center * s on the canvas; the card's view (frame_state view.card) is width = W / zoom, height = H / zoom, x = clamp(F.x * (1 - 1 / zoom), 0, W - width), y likewise, and every card layer (window, shadow, page, border, cursor, click effects) shows it scaled to the frame; zoom keeps its meaning (output px per CSS px = s * zoom). The background's view has zoom zb = 1 + p * (zoom - 1) (p = background_motion) about (W / 2 + p * (cx - W / 2), H / 2 + p * (cy - H / 2)), (cx, cy) the card view's center, clamped likewise, and blurs by a Gaussian of sigma = min(7 / 0.6 * (zoom - 1), 16) * min(W, H) / 1080 output px when background_blur is on (drawn at the nearest whole multiple of min(W, H) / 1080 px; frame_state view.blur gives sigma unrounded). Captions stay fixed on the frame. Absent: zoom 1 centered.
|
|
2088
2612
|
*/
|
|
2089
2613
|
camera?: {
|
|
2614
|
+
/**
|
|
2615
|
+
* What the keyframes move: the page inside a fixed window (page; every timeline from before look v2), or the whole composition (canvas).
|
|
2616
|
+
* @default "page"
|
|
2617
|
+
*/
|
|
2618
|
+
space?: "page" | "canvas";
|
|
2619
|
+
/**
|
|
2620
|
+
* Canvas space: how far the background follows the card, 0 (still) to 1 (zooms with it: the whole composition zooms as one).
|
|
2621
|
+
* @default 0.1
|
|
2622
|
+
*/
|
|
2623
|
+
background_motion?: number;
|
|
2624
|
+
/**
|
|
2625
|
+
* 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.
|
|
2626
|
+
*/
|
|
2627
|
+
background_blur?: boolean;
|
|
2090
2628
|
keyframes: {
|
|
2091
2629
|
t_us: RenderTimelineUs;
|
|
2092
2630
|
center: RenderTimelinePoint;
|
|
@@ -2107,6 +2645,26 @@ export interface RenderTimeline {
|
|
|
2107
2645
|
/** @default 20 */
|
|
2108
2646
|
max_chars_per_second?: number;
|
|
2109
2647
|
cues: RenderTimelineCue[];
|
|
2648
|
+
/**
|
|
2649
|
+
* 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.
|
|
2650
|
+
*/
|
|
2651
|
+
highlight?: {
|
|
2652
|
+
/** The word's color, #rrggbb. */
|
|
2653
|
+
color: string;
|
|
2654
|
+
/**
|
|
2655
|
+
* 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.
|
|
2656
|
+
*/
|
|
2657
|
+
source: "auto" | "preset" | "request";
|
|
2658
|
+
};
|
|
2659
|
+
/**
|
|
2660
|
+
* 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.
|
|
2661
|
+
*/
|
|
2662
|
+
backdrop?: {
|
|
2663
|
+
/** The run's first cue's start. */
|
|
2664
|
+
start_us: number;
|
|
2665
|
+
/** The run's last cue's end. */
|
|
2666
|
+
end_us: number;
|
|
2667
|
+
}[];
|
|
2110
2668
|
};
|
|
2111
2669
|
/**
|
|
2112
2670
|
* Per capture frame: the viewport region to capture. Sent to the recorder for each segment. Frames not listed are not captured.
|
|
@@ -2114,6 +2672,10 @@ export interface RenderTimeline {
|
|
|
2114
2672
|
capture_plan?: RenderTimelineCaptureFrame[];
|
|
2115
2673
|
/** Optional FrameState dump (debugging, tests, GET .../timeline?frames=true). */
|
|
2116
2674
|
frames?: RenderTimelineFrameState[];
|
|
2675
|
+
/**
|
|
2676
|
+
* 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.
|
|
2677
|
+
*/
|
|
2678
|
+
warnings?: string[];
|
|
2117
2679
|
}
|
|
2118
2680
|
/** Microseconds on the virtual timeline. */
|
|
2119
2681
|
export type RenderTimelineUs = number;
|
|
@@ -2175,10 +2737,74 @@ export interface RenderTimelineObservation {
|
|
|
2175
2737
|
* The target sits inside nav, aside or a header bar (or their landmark roles); the camera zooms less there (1.25x).
|
|
2176
2738
|
*/
|
|
2177
2739
|
landmark?: "nav" | "aside" | "header";
|
|
2740
|
+
/**
|
|
2741
|
+
* 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).
|
|
2742
|
+
*/
|
|
2743
|
+
doc_min?: number;
|
|
2744
|
+
/**
|
|
2745
|
+
* 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.
|
|
2746
|
+
*/
|
|
2747
|
+
ink?: number[][];
|
|
2748
|
+
/** Look v2 round 4f: the same rows for what fixed elements draw, in viewport CSS px. */
|
|
2749
|
+
ink_fixed?: number[][];
|
|
2178
2750
|
/**
|
|
2179
2751
|
* Page time the action ran the page clock ahead of the timeline, off camera: a client-side route its click opened drawing (its code, its data, a Suspense delay), or a wait whose condition held after a timer. Capture passes run exactly as far ahead. Absent when 0.
|
|
2180
2752
|
*/
|
|
2181
2753
|
ahead_us?: RenderTimelineUs;
|
|
2754
|
+
/**
|
|
2755
|
+
* 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.
|
|
2756
|
+
*/
|
|
2757
|
+
subject?: {
|
|
2758
|
+
/** The document's scroll offset when the boxes were measured. */
|
|
2759
|
+
scroll: RenderTimelinePoint;
|
|
2760
|
+
/**
|
|
2761
|
+
* The scroll offset before the recorder scrolled the page to the target (scroll: comfortable); absent when it did not.
|
|
2762
|
+
*/
|
|
2763
|
+
from?: RenderTimelinePoint;
|
|
2764
|
+
target: RenderTimelineRect;
|
|
2765
|
+
/** The target's ancestors with a box, nearest first, up to the body (left out). */
|
|
2766
|
+
ancestors?: {
|
|
2767
|
+
rect: RenderTimelineRect;
|
|
2768
|
+
tag?: string;
|
|
2769
|
+
role?: string;
|
|
2770
|
+
/** It draws a box of its own: a background, a border, a shadow or rounded corners. */
|
|
2771
|
+
panel?: boolean;
|
|
2772
|
+
/**
|
|
2773
|
+
* A sectioning or grouping element or role: table, form, section, article, main, dialog, fieldset, figure, a list, a region, group, tab panel or grid.
|
|
2774
|
+
*/
|
|
2775
|
+
group?: boolean;
|
|
2776
|
+
/** A row or list item: tr, li, row, listitem, option, treeitem. */
|
|
2777
|
+
row?: boolean;
|
|
2778
|
+
}[];
|
|
2779
|
+
/**
|
|
2780
|
+
* 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.
|
|
2781
|
+
*/
|
|
2782
|
+
panel?: number;
|
|
2783
|
+
/**
|
|
2784
|
+
* The boxes of that subject's siblings: a held view's edge never rests inside one when a gap beside it is near.
|
|
2785
|
+
*/
|
|
2786
|
+
siblings?: RenderTimelineRect[];
|
|
2787
|
+
/**
|
|
2788
|
+
* 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.
|
|
2789
|
+
*/
|
|
2790
|
+
rows?: RenderTimelineRect[];
|
|
2791
|
+
/**
|
|
2792
|
+
* 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.
|
|
2793
|
+
*/
|
|
2794
|
+
main?: RenderTimelineRect;
|
|
2795
|
+
/**
|
|
2796
|
+
* 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.
|
|
2797
|
+
*/
|
|
2798
|
+
sticky?: boolean;
|
|
2799
|
+
};
|
|
2800
|
+
/**
|
|
2801
|
+
* 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.
|
|
2802
|
+
*/
|
|
2803
|
+
rest?: RenderTimelinePoint;
|
|
2804
|
+
/**
|
|
2805
|
+
* 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.
|
|
2806
|
+
*/
|
|
2807
|
+
busy?: RenderTimelineRect[];
|
|
2182
2808
|
error?: {
|
|
2183
2809
|
code: string;
|
|
2184
2810
|
detail?: string;
|
|
@@ -2218,8 +2844,7 @@ export type RenderTimelineAction = {
|
|
|
2218
2844
|
/** scroll: delta from the current offset. */
|
|
2219
2845
|
by?: RenderTimelinePoint;
|
|
2220
2846
|
/**
|
|
2221
|
-
* scroll: animation length on the virtual clock.
|
|
2222
|
-
* @default 600000
|
|
2847
|
+
* scroll: animation length on the virtual clock, at most 10 s, 600000 (0.6 s) when absent. type: how long the typing runs, its characters times interval_us, at most the video's length (the director writes it; the recorder times each key from interval_us, and a type without it lasts that long all the same).
|
|
2223
2848
|
*/
|
|
2224
2849
|
duration_us?: number;
|
|
2225
2850
|
easing?: RenderTimelineEasing;
|
|
@@ -2325,6 +2950,16 @@ export interface RenderTimelineFrameState {
|
|
|
2325
2950
|
y: number;
|
|
2326
2951
|
visible: boolean;
|
|
2327
2952
|
pressed: boolean;
|
|
2953
|
+
/**
|
|
2954
|
+
* Below 1 while the cursor fades in or out (a point's fade_us).
|
|
2955
|
+
* @default 1
|
|
2956
|
+
*/
|
|
2957
|
+
opacity?: number;
|
|
2958
|
+
/**
|
|
2959
|
+
* 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.
|
|
2960
|
+
* @default 0
|
|
2961
|
+
*/
|
|
2962
|
+
press?: number;
|
|
2328
2963
|
};
|
|
2329
2964
|
effects: {
|
|
2330
2965
|
kind: "click";
|
|
@@ -2336,13 +2971,40 @@ export interface RenderTimelineFrameState {
|
|
|
2336
2971
|
caption: null | {
|
|
2337
2972
|
cue: RenderTimelineLocalId;
|
|
2338
2973
|
lines: string[];
|
|
2974
|
+
/**
|
|
2975
|
+
* 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).
|
|
2976
|
+
*/
|
|
2339
2977
|
highlight?: {
|
|
2340
2978
|
line: number;
|
|
2341
2979
|
byte_start: number;
|
|
2342
2980
|
byte_end: number;
|
|
2981
|
+
/** How long ago the word started, at most 1 s. Absent: lit in full. */
|
|
2982
|
+
since_us?: number;
|
|
2983
|
+
/** The word before it in the cue. */
|
|
2984
|
+
previous?: {
|
|
2985
|
+
line: number;
|
|
2986
|
+
byte_start: number;
|
|
2987
|
+
byte_end: number;
|
|
2988
|
+
};
|
|
2343
2989
|
};
|
|
2344
2990
|
/** The cue's own position, over the caption style's. */
|
|
2345
2991
|
position?: "top" | "bottom";
|
|
2992
|
+
/**
|
|
2993
|
+
* 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).
|
|
2994
|
+
* @default 1
|
|
2995
|
+
*/
|
|
2996
|
+
opacity?: number;
|
|
2997
|
+
/**
|
|
2998
|
+
* 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.
|
|
2999
|
+
*/
|
|
3000
|
+
from?: {
|
|
3001
|
+
lines: string[];
|
|
3002
|
+
position?: "top" | "bottom";
|
|
3003
|
+
/** How far the text has crossfaded to this cue. */
|
|
3004
|
+
text: number;
|
|
3005
|
+
/** How far the box has moved from the old cue's size to this one's. */
|
|
3006
|
+
size: number;
|
|
3007
|
+
};
|
|
2346
3008
|
};
|
|
2347
3009
|
/**
|
|
2348
3010
|
* Opacity of the window layer (page, frame chrome, shadow, border, cursor, click effects) over the background; the background and the caption stay opaque.
|
|
@@ -2358,6 +3020,60 @@ export interface RenderTimelineFrameState {
|
|
|
2358
3020
|
cursor_dx?: number;
|
|
2359
3021
|
cursor_dy?: number;
|
|
2360
3022
|
};
|
|
3023
|
+
/**
|
|
3024
|
+
* 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.
|
|
3025
|
+
*/
|
|
3026
|
+
view?: {
|
|
3027
|
+
/**
|
|
3028
|
+
* The card's view: the window, its shadow, the page, the cursor and click effects show this rect scaled to the frame.
|
|
3029
|
+
*/
|
|
3030
|
+
card: RenderTimelineRect;
|
|
3031
|
+
/** The background's own view. Absent: the background moves with the card, unblurred. */
|
|
3032
|
+
background?: RenderTimelineRect;
|
|
3033
|
+
/**
|
|
3034
|
+
* The background's Gaussian blur, sigma in output px.
|
|
3035
|
+
* @default 0
|
|
3036
|
+
*/
|
|
3037
|
+
blur?: number;
|
|
3038
|
+
};
|
|
3039
|
+
/**
|
|
3040
|
+
* 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.
|
|
3041
|
+
*/
|
|
3042
|
+
shutter?: {
|
|
3043
|
+
/** Canvas space: view.card at open and close, when the camera moves. */
|
|
3044
|
+
card?: RenderTimelineRect[];
|
|
3045
|
+
/** Canvas space: view.background at open and close, when the frame has one. */
|
|
3046
|
+
background?: RenderTimelineRect[];
|
|
3047
|
+
/** The cursor's position (viewport px) at open and close. */
|
|
3048
|
+
cursor: RenderTimelinePoint[];
|
|
3049
|
+
/**
|
|
3050
|
+
* 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.
|
|
3051
|
+
*/
|
|
3052
|
+
length_us?: number;
|
|
3053
|
+
/**
|
|
3054
|
+
* 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.
|
|
3055
|
+
*/
|
|
3056
|
+
move_reach?: number;
|
|
3057
|
+
};
|
|
3058
|
+
/**
|
|
3059
|
+
* 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.
|
|
3060
|
+
*/
|
|
3061
|
+
backdrop?: {
|
|
3062
|
+
/** How much of the band shows (smoothstep over its 200 ms fades). */
|
|
3063
|
+
opacity: number;
|
|
3064
|
+
/**
|
|
3065
|
+
* 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.
|
|
3066
|
+
*/
|
|
3067
|
+
under?: {
|
|
3068
|
+
lines: string[];
|
|
3069
|
+
position?: "top" | "bottom";
|
|
3070
|
+
/**
|
|
3071
|
+
* 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).
|
|
3072
|
+
* @default 0
|
|
3073
|
+
*/
|
|
3074
|
+
size?: number;
|
|
3075
|
+
};
|
|
3076
|
+
};
|
|
2361
3077
|
}
|
|
2362
3078
|
export interface Preset {
|
|
2363
3079
|
id: PresetRef;
|
|
@@ -2379,7 +3095,7 @@ export interface RenderBackground {
|
|
|
2379
3095
|
ref: string;
|
|
2380
3096
|
object: "render.background";
|
|
2381
3097
|
/**
|
|
2382
|
-
* `css`: drawn by the compositor from gradient layers. `procedural`: one of our own studio meshes (pack `studio`), computed in float, dithered, with 1% grain on stills; the set `
|
|
3098
|
+
* `css`: drawn by the compositor from gradient layers. `procedural`: one of our own studio meshes (pack `studio`), computed in float, dithered, with 1% grain on stills; the set the studio pick chooses from (`background: "studio"`) carries the tag `auto`. `image`: a stored WebP (see `image`).
|
|
2383
3099
|
*/
|
|
2384
3100
|
kind: "css" | "procedural" | "image";
|
|
2385
3101
|
pack: string;
|
|
@@ -2503,6 +3219,11 @@ export type SecretValue = string | {
|
|
|
2503
3219
|
field?: string;
|
|
2504
3220
|
};
|
|
2505
3221
|
export interface SandboxPort {
|
|
3222
|
+
/**
|
|
3223
|
+
* The port the app listens on inside the sandbox. Not 53, 1080, 3128, 7700 or 15001: the B3OS guest agent
|
|
3224
|
+
* listens on those in every sandbox (its API proxy, egress proxies and DNS), so they are never proxied and
|
|
3225
|
+
* a create that declares one is `400 invalid_request`.
|
|
3226
|
+
*/
|
|
2506
3227
|
port: number;
|
|
2507
3228
|
/**
|
|
2508
3229
|
* Reachable by anyone with the sandbox's long-lived port URL (`ports[].url` in the sandbox; its token lasts 7
|
|
@@ -2510,6 +3231,22 @@ export interface SandboxPort {
|
|
|
2510
3231
|
* @default false
|
|
2511
3232
|
*/
|
|
2512
3233
|
public?: boolean;
|
|
3234
|
+
/**
|
|
3235
|
+
* How long a request through the port's preview waits for the app to start its response (status and
|
|
3236
|
+
* headers), counted from when the node lets the request in. Past it the request answers `504
|
|
3237
|
+
* upstream_first_byte_timeout`. A response that has started may stream for up to an hour. At most 95: the
|
|
3238
|
+
* path in front of the node gives up on a response that has not started after 100 seconds.
|
|
3239
|
+
* @default 65
|
|
3240
|
+
*/
|
|
3241
|
+
first_byte_s?: number;
|
|
3242
|
+
/**
|
|
3243
|
+
* The port has an app address (`<label>.b3os.io`); `b3os apply` sets it on such a port and keeps the port
|
|
3244
|
+
* private (no long-lived URL). The sandbox then counts as reachable from the internet for as long as it
|
|
3245
|
+
* lives, as with a public port: code in another sandbox whose egress is not `public` cannot reach into it,
|
|
3246
|
+
* and code in such a sandbox cannot start one with an addressed port (`403 egress_escalation`).
|
|
3247
|
+
* @default false
|
|
3248
|
+
*/
|
|
3249
|
+
addressed?: boolean;
|
|
2513
3250
|
}
|
|
2514
3251
|
/**
|
|
2515
3252
|
* What code inside the sandbox may call at `http://127.0.0.1:7700`. Empty by default, revoked when the sandbox stops.
|
|
@@ -2703,12 +3440,18 @@ export interface Sandbox {
|
|
|
2703
3440
|
ports: {
|
|
2704
3441
|
port: number;
|
|
2705
3442
|
public: boolean;
|
|
3443
|
+
/** The port has an app address (the create set `addressed`); always sent by this node. */
|
|
3444
|
+
addressed?: boolean;
|
|
2706
3445
|
/**
|
|
2707
3446
|
* Public ports: the long-lived preview URL, token included. Private ports: `null`; mint a URL with
|
|
2708
3447
|
* `POST /v1/sandboxes/{sandbox_id}/ports/{port}/url`. Also `null` when code in another sandbox reads
|
|
2709
3448
|
* this sandbox and this sandbox is not within that sandbox's reach (`sandboxesCreateSandbox`).
|
|
2710
3449
|
*/
|
|
2711
3450
|
url: string | null;
|
|
3451
|
+
/**
|
|
3452
|
+
* How long a preview request waits for the app to start its response, seconds (65 unless the create said otherwise).
|
|
3453
|
+
*/
|
|
3454
|
+
first_byte_s?: number;
|
|
2712
3455
|
}[];
|
|
2713
3456
|
api: {
|
|
2714
3457
|
scopes: string[];
|
|
@@ -2851,6 +3594,44 @@ export interface SandboxProcess {
|
|
|
2851
3594
|
started_at: string;
|
|
2852
3595
|
exited_at: string | null;
|
|
2853
3596
|
}
|
|
3597
|
+
/** What a running sandbox uses now (`GET /v1/sandboxes/{sandbox_id}/stats`). */
|
|
3598
|
+
export interface SandboxStats {
|
|
3599
|
+
object: "sandbox_stats";
|
|
3600
|
+
sandbox_id: string;
|
|
3601
|
+
/** When the node read it. */
|
|
3602
|
+
taken_at: string;
|
|
3603
|
+
cpu: {
|
|
3604
|
+
/**
|
|
3605
|
+
* 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.
|
|
3606
|
+
*/
|
|
3607
|
+
percent: number | null;
|
|
3608
|
+
/** The sandbox's vCPUs. */
|
|
3609
|
+
vcpu: number;
|
|
3610
|
+
/** The window `percent` covers. */
|
|
3611
|
+
interval_ms: number | null;
|
|
3612
|
+
};
|
|
3613
|
+
memory: {
|
|
3614
|
+
/** `total_bytes` minus `available_bytes`. */
|
|
3615
|
+
used_bytes: number;
|
|
3616
|
+
/** What the guest kernel can still give programs (`MemAvailable`). */
|
|
3617
|
+
available_bytes: number;
|
|
3618
|
+
/** The memory the guest kernel manages (`MemTotal`), a little under the sandbox's `memory_mib`. */
|
|
3619
|
+
total_bytes: number;
|
|
3620
|
+
};
|
|
3621
|
+
/** The root filesystem, or null in a sandbox whose image does not report it. */
|
|
3622
|
+
disk: null | {
|
|
3623
|
+
used_bytes: number;
|
|
3624
|
+
total_bytes: number;
|
|
3625
|
+
};
|
|
3626
|
+
processes: {
|
|
3627
|
+
/** Background processes started with exec that still run (as `GET …/processes` lists them). */
|
|
3628
|
+
running: number;
|
|
3629
|
+
/**
|
|
3630
|
+
* Every user process in the sandbox, kernel threads left out; null in a sandbox whose image does not report it.
|
|
3631
|
+
*/
|
|
3632
|
+
total: number | null;
|
|
3633
|
+
};
|
|
3634
|
+
}
|
|
2854
3635
|
export type SandboxProcessList = Omit<ListEnvelope, "data"> & {
|
|
2855
3636
|
data: SandboxProcess[];
|
|
2856
3637
|
};
|
|
@@ -3671,7 +4452,7 @@ export interface SignalRequest {
|
|
|
3671
4452
|
payload?: unknown;
|
|
3672
4453
|
}
|
|
3673
4454
|
/**
|
|
3674
|
-
* One manifest per pack: connections, egress, actions (T0 declarative HTTP
|
|
4455
|
+
* 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.
|
|
3675
4456
|
*/
|
|
3676
4457
|
export interface B3Pack {
|
|
3677
4458
|
/** Optional pointer to this schema for editors. Ignored by the runtime. */
|
|
@@ -3704,7 +4485,7 @@ export interface B3Pack {
|
|
|
3704
4485
|
sizes?: string[];
|
|
3705
4486
|
}[];
|
|
3706
4487
|
/**
|
|
3707
|
-
* Pack runtime API the pack needs, as a caret range (npm and Cargo read it the same way). The
|
|
4488
|
+
* 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.
|
|
3708
4489
|
*/
|
|
3709
4490
|
engine: string;
|
|
3710
4491
|
/**
|
|
@@ -3718,9 +4499,10 @@ export interface B3Pack {
|
|
|
3718
4499
|
actions: B3PackAction[];
|
|
3719
4500
|
triggers?: B3PackTrigger[];
|
|
3720
4501
|
/**
|
|
3721
|
-
* Default price for every action that does not set its own.
|
|
4502
|
+
* 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).
|
|
3722
4503
|
*/
|
|
3723
4504
|
pricing?: B3PackPricing;
|
|
4505
|
+
tool?: B3PackTool;
|
|
3724
4506
|
compat?: {
|
|
3725
4507
|
/**
|
|
3726
4508
|
* 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.
|
|
@@ -3772,7 +4554,7 @@ export interface B3PackEgressEntry {
|
|
|
3772
4554
|
schemes?: Array<"https" | "http">;
|
|
3773
4555
|
}
|
|
3774
4556
|
/**
|
|
3775
|
-
* 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.
|
|
4557
|
+
* 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).
|
|
3776
4558
|
*/
|
|
3777
4559
|
export type B3PackJsonSchemaObject = JsonSchemaDocument & {
|
|
3778
4560
|
type: "object";
|
|
@@ -3827,7 +4609,7 @@ export interface B3PackEffects {
|
|
|
3827
4609
|
class: "pure" | "read" | "write" | "irreversible";
|
|
3828
4610
|
}
|
|
3829
4611
|
/**
|
|
3830
|
-
* Publisher price on top of the platform's actions.
|
|
4612
|
+
* 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.
|
|
3831
4613
|
*/
|
|
3832
4614
|
export interface B3PackPricing {
|
|
3833
4615
|
model: "free" | "per_call";
|
|
@@ -3883,7 +4665,7 @@ export interface B3PackHttpResponse {
|
|
|
3883
4665
|
}[];
|
|
3884
4666
|
}
|
|
3885
4667
|
/**
|
|
3886
|
-
* 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).
|
|
4668
|
+
* 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').
|
|
3887
4669
|
*/
|
|
3888
4670
|
export type B3PackImpl = {
|
|
3889
4671
|
kind: "http";
|
|
@@ -3900,6 +4682,16 @@ export type B3PackImpl = {
|
|
|
3900
4682
|
* @default "run"
|
|
3901
4683
|
*/
|
|
3902
4684
|
export?: string;
|
|
4685
|
+
} | {
|
|
4686
|
+
kind: "vm";
|
|
4687
|
+
/**
|
|
4688
|
+
* 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.
|
|
4689
|
+
*/
|
|
4690
|
+
protocol: "json-stdio";
|
|
4691
|
+
/**
|
|
4692
|
+
* 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).
|
|
4693
|
+
*/
|
|
4694
|
+
cmd: string[];
|
|
3903
4695
|
};
|
|
3904
4696
|
export type B3PackExample = {
|
|
3905
4697
|
fixture: B3PackFixturePath;
|
|
@@ -3933,9 +4725,17 @@ export type B3PackAction = {
|
|
|
3933
4725
|
egress?: B3PackEgressEntry[];
|
|
3934
4726
|
execution?: {
|
|
3935
4727
|
/**
|
|
3936
|
-
* Wall-clock budget per call, including upstream time. Default 10000 for http, 30000 for js. A caller's shorter deadline wins.
|
|
4728
|
+
* 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.
|
|
3937
4729
|
*/
|
|
3938
4730
|
timeoutMs?: number;
|
|
4731
|
+
/**
|
|
4732
|
+
* vm only, reserved for files that are not inline (slice B): the most input file data a call may carry. Refused in this version.
|
|
4733
|
+
*/
|
|
4734
|
+
maxInputMb?: number;
|
|
4735
|
+
/** vm only, reserved (slice B): the most output file data a call may return. Refused in this version. */
|
|
4736
|
+
maxOutputMb?: number;
|
|
4737
|
+
/** vm only, reserved (slice B): the most output files a call may return. Refused in this version. */
|
|
4738
|
+
maxOutputFiles?: number;
|
|
3939
4739
|
/** T1 only: V8 old-generation limit of the worker running the call. Default 128. */
|
|
3940
4740
|
memoryMb?: number;
|
|
3941
4741
|
/**
|
|
@@ -4104,6 +4904,101 @@ export type B3PackTrigger = {
|
|
|
4104
4904
|
/** Task phrases for this trigger (when an issue is opened). */
|
|
4105
4905
|
aliases?: B3PackSearchPhrases;
|
|
4106
4906
|
};
|
|
4907
|
+
/**
|
|
4908
|
+
* 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.
|
|
4909
|
+
*/
|
|
4910
|
+
export interface B3PackTool {
|
|
4911
|
+
/**
|
|
4912
|
+
* cli: a command that reads a request on stdin and writes an answer on stdout. mcp (later): an MCP server. Shown on the listing.
|
|
4913
|
+
*/
|
|
4914
|
+
kind: "cli" | "mcp";
|
|
4915
|
+
/** The shared template the tool runs on. Bases have no versions yet. */
|
|
4916
|
+
base: {
|
|
4917
|
+
name: "base" | "files" | "browser" | "code-interpreter";
|
|
4918
|
+
/** Reserved: not read, because bases have no versions yet. Refused in this version. */
|
|
4919
|
+
range?: string;
|
|
4920
|
+
};
|
|
4921
|
+
/**
|
|
4922
|
+
* The tool VM's size, one of the base's size classes. Absent: 1 vCPU and 512 MiB, the only size of this version.
|
|
4923
|
+
*/
|
|
4924
|
+
size?: {
|
|
4925
|
+
vcpu: number;
|
|
4926
|
+
memoryMb: number;
|
|
4927
|
+
};
|
|
4928
|
+
/**
|
|
4929
|
+
* Where the tool's files come from. This version reads one archive, unpacked at /tool before each call.
|
|
4930
|
+
*/
|
|
4931
|
+
bundle?: {
|
|
4932
|
+
archive?: B3PackToolArchive;
|
|
4933
|
+
/**
|
|
4934
|
+
* Reserved: files carried inside the pack bundle under tool/, with their sources (later versions). Refused in this version.
|
|
4935
|
+
*/
|
|
4936
|
+
files?: unknown[];
|
|
4937
|
+
};
|
|
4938
|
+
/**
|
|
4939
|
+
* call: one fresh VM per call, deleted before the call answers. session (later): a keyed instance kept between calls.
|
|
4940
|
+
*/
|
|
4941
|
+
runtime?: {
|
|
4942
|
+
mode: "call" | "session";
|
|
4943
|
+
/** Reserved for session tools. */
|
|
4944
|
+
start?: unknown;
|
|
4945
|
+
/** Reserved for session tools. */
|
|
4946
|
+
ready?: unknown;
|
|
4947
|
+
/** Reserved for session tools. */
|
|
4948
|
+
idleS?: number;
|
|
4949
|
+
/** Reserved for session tools. */
|
|
4950
|
+
maxS?: number;
|
|
4951
|
+
};
|
|
4952
|
+
/**
|
|
4953
|
+
* 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.
|
|
4954
|
+
*/
|
|
4955
|
+
network?: {
|
|
4956
|
+
mode: "none" | "hosts" | "caller";
|
|
4957
|
+
};
|
|
4958
|
+
/** The software the tool runs and did not write. Stored and returned by describe. */
|
|
4959
|
+
upstream?: {
|
|
4960
|
+
name: string;
|
|
4961
|
+
url: string;
|
|
4962
|
+
version: string;
|
|
4963
|
+
/** SPDX license expression. */
|
|
4964
|
+
license: string;
|
|
4965
|
+
/** Where the publisher got the upstream's files, and their digest. */
|
|
4966
|
+
obtained?: {
|
|
4967
|
+
url: string;
|
|
4968
|
+
sha256?: string;
|
|
4969
|
+
};
|
|
4970
|
+
patchedBy?: string;
|
|
4971
|
+
trademarkPolicy?: string;
|
|
4972
|
+
}[];
|
|
4973
|
+
/**
|
|
4974
|
+
* Bundle-relative path of the notices file (licences, attributions, 'Not affiliated with ...'). It must be a file of the pack bundle.
|
|
4975
|
+
*/
|
|
4976
|
+
notices?: string;
|
|
4977
|
+
/**
|
|
4978
|
+
* Reserved: a command run once when the node prepares the tool's snapshot (later). Refused in this version.
|
|
4979
|
+
*/
|
|
4980
|
+
setup?: unknown;
|
|
4981
|
+
/** Reserved: an imported image's artifact (later). Refused in this version. */
|
|
4982
|
+
image?: unknown;
|
|
4983
|
+
/** Reserved: output formats a takedown can turn off by name (later). Refused in this version. */
|
|
4984
|
+
formats?: unknown;
|
|
4985
|
+
/** Reserved: the tool's own error codes, as an enum (later). Refused in this version. */
|
|
4986
|
+
errors?: unknown;
|
|
4987
|
+
}
|
|
4988
|
+
/**
|
|
4989
|
+
* 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.
|
|
4990
|
+
*/
|
|
4991
|
+
export interface B3PackToolArchive {
|
|
4992
|
+
/** Lowercase hex sha256 of the archive's bytes. */
|
|
4993
|
+
sha256: string;
|
|
4994
|
+
/** The archive's size in bytes. */
|
|
4995
|
+
bytes: number;
|
|
4996
|
+
format: "tar.gz" | "tar";
|
|
4997
|
+
/** The sum of the sizes of the archive's regular files. */
|
|
4998
|
+
unpackedBytes: number;
|
|
4999
|
+
/** Files, directories and links in the archive. */
|
|
5000
|
+
entries: number;
|
|
5001
|
+
}
|
|
4107
5002
|
/**
|
|
4108
5003
|
* 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).
|
|
4109
5004
|
*/
|
|
@@ -4278,6 +5173,23 @@ export interface ActionDescription {
|
|
|
4278
5173
|
* when the node loads the pack. Their inputs also appear as `examples` in `mcp.inputSchema`.
|
|
4279
5174
|
*/
|
|
4280
5175
|
examples: ActionExample[];
|
|
5176
|
+
/**
|
|
5177
|
+
* For a hosted tool's action (`impl.kind` `vm`), what it runs on and what it costs; absent for other actions.
|
|
5178
|
+
*/
|
|
5179
|
+
tool?: {
|
|
5180
|
+
kind: "cli";
|
|
5181
|
+
/** The template its VM is made from. */
|
|
5182
|
+
base: string;
|
|
5183
|
+
network: "none";
|
|
5184
|
+
/**
|
|
5185
|
+
* The publisher's price per call that answered validly, in micro-USD (millionths of a US dollar); 0 when free.
|
|
5186
|
+
*/
|
|
5187
|
+
price_micro_usd: number;
|
|
5188
|
+
/** The software the tool runs and did not write (the manifest's `tool.upstream`). */
|
|
5189
|
+
upstream: Record<string, unknown>[];
|
|
5190
|
+
/** The bundle path of the tool's notices file. */
|
|
5191
|
+
notices?: string;
|
|
5192
|
+
};
|
|
4281
5193
|
}
|
|
4282
5194
|
export interface ActionCallRequest {
|
|
4283
5195
|
ref: ActionRef;
|
|
@@ -4298,12 +5210,29 @@ export interface ActionResult {
|
|
|
4298
5210
|
object: "action_result";
|
|
4299
5211
|
/** The exact version that ran. */
|
|
4300
5212
|
ref: string;
|
|
4301
|
-
/** Matches the action's output schema. */
|
|
5213
|
+
/** Matches the action's output schema. A hosted tool's output file is a `ToolFileOutput`. */
|
|
4302
5214
|
output: unknown;
|
|
4303
5215
|
/** HTTP status of the upstream call, for declarative HTTP actions. */
|
|
4304
5216
|
upstream_status?: number;
|
|
5217
|
+
/**
|
|
5218
|
+
* `vm` for a hosted tool's call (its command ran in a microVM made for the call). Absent for other actions.
|
|
5219
|
+
*/
|
|
5220
|
+
tier?: "vm";
|
|
5221
|
+
cost?: ToolCallCost;
|
|
4305
5222
|
timing: Timing;
|
|
4306
5223
|
}
|
|
5224
|
+
/**
|
|
5225
|
+
* What a hosted tool's call costs, in micro-USD (millionths of a US dollar), from the node's unit prices when
|
|
5226
|
+
* the call ran: `compute` (`actions.vcpu_ms` and `actions.gib_ms`), `floor` (`actions.tool_call`), `price` (the
|
|
5227
|
+
* publisher's, `actions.publisher_microusd`; 0 when the tool failed or is free) and their sum, `total`. The
|
|
5228
|
+
* same numbers are in the `actions.tool_call` usage record's `meta.cost_micro_usd`.
|
|
5229
|
+
*/
|
|
5230
|
+
export interface ToolCallCost {
|
|
5231
|
+
compute: number;
|
|
5232
|
+
floor: number;
|
|
5233
|
+
price: number;
|
|
5234
|
+
total: number;
|
|
5235
|
+
}
|
|
4307
5236
|
export interface TriggerSummary {
|
|
4308
5237
|
ref: string;
|
|
4309
5238
|
pack: string;
|
|
@@ -5307,6 +6236,12 @@ export interface CurrentPrincipal {
|
|
|
5307
6236
|
project_id: string;
|
|
5308
6237
|
scopes: Scope[];
|
|
5309
6238
|
spend_cap_usd: number | null;
|
|
6239
|
+
/**
|
|
6240
|
+
* 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.
|
|
6241
|
+
*/
|
|
6242
|
+
spend_usd?: number | null;
|
|
6243
|
+
/** Start of the billing period `spend_usd` covers. */
|
|
6244
|
+
spend_period_start?: string;
|
|
5310
6245
|
expires_at: string | null;
|
|
5311
6246
|
}
|
|
5312
6247
|
export interface UsageSummary {
|
|
@@ -5443,6 +6378,17 @@ export interface RegistryPackVersion {
|
|
|
5443
6378
|
published_at: string;
|
|
5444
6379
|
yanked: boolean;
|
|
5445
6380
|
download_url: string;
|
|
6381
|
+
/**
|
|
6382
|
+
* 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.
|
|
6383
|
+
*/
|
|
6384
|
+
published_by?: string | null;
|
|
6385
|
+
}
|
|
6386
|
+
/** A hosted tool's archive in the registry's blob store, named by its sha256. */
|
|
6387
|
+
export interface RegistryBlob {
|
|
6388
|
+
object: "registry_blob";
|
|
6389
|
+
digest: string;
|
|
6390
|
+
bytes: number;
|
|
6391
|
+
created_at: string;
|
|
5446
6392
|
}
|
|
5447
6393
|
/**
|
|
5448
6394
|
* How the request reached B3OS: `edge` (through beta-api.b3os.org or the dashboard; forwarded to the node, or
|
|
@@ -5454,10 +6400,12 @@ export type RequestConnection = "edge" | "uds" | "tcp" | "sandbox";
|
|
|
5454
6400
|
* Who made the request: `api_key` (an API key), `cli_token` (the CLI's device-login token), `dashboard` (a
|
|
5455
6401
|
* signed-in dashboard session; its successful reads are not logged, its changes and errors are), `sandbox` (code
|
|
5456
6402
|
* inside a sandbox, as its creating key), `routine` (a routine run, as the key that published its version),
|
|
5457
|
-
* `local` (a host-local caller on the node's Unix socket)
|
|
5458
|
-
* callback to a public route, or a request refused before authentication)
|
|
6403
|
+
* `local` (a host-local caller on the node's Unix socket), `public` (no credential: a webhook or signed
|
|
6404
|
+
* callback to a public route, or a request refused before authentication), `address` (a visitor of an app
|
|
6405
|
+
* address, `<label>.b3os.io`) or `preview` (a visitor of a sandbox port preview). `address` and `preview`
|
|
6406
|
+
* records belong to the sandbox's project; their `path` is the app's path, without the query, cut at 1,024 bytes.
|
|
5459
6407
|
*/
|
|
5460
|
-
export type RequestSource = "api_key" | "cli_token" | "dashboard" | "sandbox" | "routine" | "local" | "public";
|
|
6408
|
+
export type RequestSource = "api_key" | "cli_token" | "dashboard" | "sandbox" | "routine" | "local" | "public" | "address" | "preview";
|
|
5461
6409
|
export interface RequestPhase {
|
|
5462
6410
|
name: string;
|
|
5463
6411
|
source: "edge" | "node";
|
|
@@ -5473,6 +6421,12 @@ export interface RequestRecord {
|
|
|
5473
6421
|
product: string | null;
|
|
5474
6422
|
status_code: number;
|
|
5475
6423
|
error_code: string | null;
|
|
6424
|
+
/**
|
|
6425
|
+
* Why a 4xx or 5xx answer failed, in the server's own words: the first 200 characters of its problem's
|
|
6426
|
+
* `detail` (or a compatibility surface's message). `null` for a success, or when the server recorded none;
|
|
6427
|
+
* absent from records written before it was recorded.
|
|
6428
|
+
*/
|
|
6429
|
+
error_detail?: string | null;
|
|
5476
6430
|
org_id: string;
|
|
5477
6431
|
project_id: string;
|
|
5478
6432
|
/** The API key behind the request (for sandbox calls, the key that created the sandbox). */
|
|
@@ -5846,7 +6800,9 @@ export interface RenderListBackgroundsParams {
|
|
|
5846
6800
|
theme?: "light" | "dark";
|
|
5847
6801
|
/** Only CSS, only procedural (the studio pack) or only image backgrounds. */
|
|
5848
6802
|
kind?: "css" | "procedural" | "image";
|
|
5849
|
-
/**
|
|
6803
|
+
/**
|
|
6804
|
+
* 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).
|
|
6805
|
+
*/
|
|
5850
6806
|
tag?: string;
|
|
5851
6807
|
/**
|
|
5852
6808
|
* Only full-bleed backgrounds, or only transparent shapes (`cutout`, `partial`, `sliver`). CSS backgrounds are full-bleed.
|
|
@@ -5991,6 +6947,23 @@ export interface SandboxesOpenPtyParams {
|
|
|
5991
6947
|
*/
|
|
5992
6948
|
session?: string;
|
|
5993
6949
|
}
|
|
6950
|
+
/** Parameters of `listRequests`. */
|
|
6951
|
+
export interface SandboxesListRequestsParams {
|
|
6952
|
+
/**
|
|
6953
|
+
* Page size, from 1 to 100.
|
|
6954
|
+
* @default 20
|
|
6955
|
+
*/
|
|
6956
|
+
limit?: number;
|
|
6957
|
+
/** Opaque cursor from the previous page's `next_cursor`. Omit it for the first page. */
|
|
6958
|
+
cursor?: string;
|
|
6959
|
+
product?: string;
|
|
6960
|
+
operation_id?: string;
|
|
6961
|
+
/** Only requests that succeeded (`2xx`) or failed (`4xx`, `5xx`). */
|
|
6962
|
+
status?: "2xx" | "4xx" | "5xx";
|
|
6963
|
+
/** Only requests of this W3C trace (the trace id of their `traceparent`). */
|
|
6964
|
+
trace_id?: string;
|
|
6965
|
+
since?: string;
|
|
6966
|
+
}
|
|
5994
6967
|
/** Parameters of `listRoutines`. */
|
|
5995
6968
|
export interface RoutinesListRoutinesParams {
|
|
5996
6969
|
/**
|