@b3os/sdk 0.2.1 → 0.2.3
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 +1 -1
- package/dist/cjs/core/util.d.ts +1 -1
- package/dist/cjs/core/util.js +1 -1
- package/dist/cjs/generated/client.d.ts +18 -0
- package/dist/cjs/generated/client.js +34 -0
- package/dist/cjs/generated/client.js.map +1 -1
- package/dist/cjs/generated/errors.d.ts +1 -1
- package/dist/cjs/generated/errors.js +120 -0
- package/dist/cjs/generated/errors.js.map +1 -1
- package/dist/cjs/generated/ids.d.ts +89 -0
- package/dist/cjs/generated/ids.js +22 -0
- package/dist/cjs/generated/ids.js.map +1 -1
- package/dist/cjs/generated/jobs.js +4 -0
- package/dist/cjs/generated/jobs.js.map +1 -1
- package/dist/cjs/generated/ns/actions.d.ts +267 -33
- package/dist/cjs/generated/ns/actions.js +375 -33
- package/dist/cjs/generated/ns/actions.js.map +1 -1
- package/dist/cjs/generated/ns/agents.d.ts +656 -0
- package/dist/cjs/generated/ns/agents.js +989 -0
- package/dist/cjs/generated/ns/agents.js.map +1 -0
- package/dist/cjs/generated/ns/images.d.ts +162 -0
- package/dist/cjs/generated/ns/images.js +246 -0
- package/dist/cjs/generated/ns/images.js.map +1 -0
- package/dist/cjs/generated/ns/infer.d.ts +71 -3
- package/dist/cjs/generated/ns/infer.js +98 -3
- package/dist/cjs/generated/ns/infer.js.map +1 -1
- package/dist/cjs/generated/ns/keys.d.ts +3 -1
- package/dist/cjs/generated/ns/keys.js +3 -1
- package/dist/cjs/generated/ns/keys.js.map +1 -1
- package/dist/cjs/generated/ns/listeners.d.ts +163 -0
- package/dist/cjs/generated/ns/listeners.js +268 -0
- package/dist/cjs/generated/ns/listeners.js.map +1 -0
- package/dist/cjs/generated/ns/orgs.d.ts +10 -0
- package/dist/cjs/generated/ns/orgs.js +26 -1
- package/dist/cjs/generated/ns/orgs.js.map +1 -1
- package/dist/cjs/generated/ns/projects.d.ts +32 -0
- package/dist/cjs/generated/ns/projects.js +66 -0
- package/dist/cjs/generated/ns/projects.js.map +1 -1
- package/dist/cjs/generated/ns/render.d.ts +192 -21
- package/dist/cjs/generated/ns/render.js +267 -24
- package/dist/cjs/generated/ns/render.js.map +1 -1
- package/dist/cjs/generated/ns/requests.d.ts +3 -1
- package/dist/cjs/generated/ns/requests.js +3 -1
- package/dist/cjs/generated/ns/requests.js.map +1 -1
- package/dist/cjs/generated/ns/routines.d.ts +22 -4
- package/dist/cjs/generated/ns/routines.js +22 -4
- package/dist/cjs/generated/ns/routines.js.map +1 -1
- package/dist/cjs/generated/ns/sandboxes.d.ts +431 -7
- package/dist/cjs/generated/ns/sandboxes.js +633 -6
- package/dist/cjs/generated/ns/sandboxes.js.map +1 -1
- package/dist/cjs/generated/ns/usage.d.ts +1 -1
- package/dist/cjs/generated/ns/usage.js +1 -1
- package/dist/cjs/generated/ns/vision.d.ts +113 -17
- package/dist/cjs/generated/ns/vision.js +152 -21
- package/dist/cjs/generated/ns/vision.js.map +1 -1
- package/dist/cjs/generated/ns/workspaces.d.ts +225 -0
- package/dist/cjs/generated/ns/workspaces.js +410 -0
- package/dist/cjs/generated/ns/workspaces.js.map +1 -0
- package/dist/cjs/generated/types.d.ts +5259 -605
- package/dist/cjs/helpers/sandboxes.d.ts +20 -1
- package/dist/cjs/helpers/sandboxes.js +13 -1
- package/dist/cjs/helpers/sandboxes.js.map +1 -1
- package/dist/esm/core/util.d.ts +1 -1
- package/dist/esm/core/util.js +1 -1
- package/dist/esm/generated/client.d.ts +18 -0
- package/dist/esm/generated/client.js +34 -0
- package/dist/esm/generated/client.js.map +1 -1
- package/dist/esm/generated/errors.d.ts +1 -1
- package/dist/esm/generated/errors.js +120 -0
- package/dist/esm/generated/errors.js.map +1 -1
- package/dist/esm/generated/ids.d.ts +89 -0
- package/dist/esm/generated/ids.js +22 -0
- package/dist/esm/generated/ids.js.map +1 -1
- package/dist/esm/generated/jobs.js +4 -0
- package/dist/esm/generated/jobs.js.map +1 -1
- package/dist/esm/generated/ns/actions.d.ts +267 -33
- package/dist/esm/generated/ns/actions.js +375 -33
- package/dist/esm/generated/ns/actions.js.map +1 -1
- package/dist/esm/generated/ns/agents.d.ts +656 -0
- package/dist/esm/generated/ns/agents.js +985 -0
- package/dist/esm/generated/ns/agents.js.map +1 -0
- package/dist/esm/generated/ns/images.d.ts +162 -0
- package/dist/esm/generated/ns/images.js +242 -0
- package/dist/esm/generated/ns/images.js.map +1 -0
- package/dist/esm/generated/ns/infer.d.ts +71 -3
- package/dist/esm/generated/ns/infer.js +98 -3
- package/dist/esm/generated/ns/infer.js.map +1 -1
- package/dist/esm/generated/ns/keys.d.ts +3 -1
- package/dist/esm/generated/ns/keys.js +3 -1
- package/dist/esm/generated/ns/keys.js.map +1 -1
- package/dist/esm/generated/ns/listeners.d.ts +163 -0
- package/dist/esm/generated/ns/listeners.js +264 -0
- package/dist/esm/generated/ns/listeners.js.map +1 -0
- package/dist/esm/generated/ns/orgs.d.ts +10 -0
- package/dist/esm/generated/ns/orgs.js +26 -1
- package/dist/esm/generated/ns/orgs.js.map +1 -1
- package/dist/esm/generated/ns/projects.d.ts +32 -0
- package/dist/esm/generated/ns/projects.js +66 -0
- package/dist/esm/generated/ns/projects.js.map +1 -1
- package/dist/esm/generated/ns/render.d.ts +192 -21
- package/dist/esm/generated/ns/render.js +267 -24
- package/dist/esm/generated/ns/render.js.map +1 -1
- package/dist/esm/generated/ns/requests.d.ts +3 -1
- package/dist/esm/generated/ns/requests.js +3 -1
- package/dist/esm/generated/ns/requests.js.map +1 -1
- package/dist/esm/generated/ns/routines.d.ts +22 -4
- package/dist/esm/generated/ns/routines.js +22 -4
- package/dist/esm/generated/ns/routines.js.map +1 -1
- package/dist/esm/generated/ns/sandboxes.d.ts +431 -7
- package/dist/esm/generated/ns/sandboxes.js +633 -6
- package/dist/esm/generated/ns/sandboxes.js.map +1 -1
- package/dist/esm/generated/ns/usage.d.ts +1 -1
- package/dist/esm/generated/ns/usage.js +1 -1
- package/dist/esm/generated/ns/vision.d.ts +113 -17
- package/dist/esm/generated/ns/vision.js +152 -21
- package/dist/esm/generated/ns/vision.js.map +1 -1
- package/dist/esm/generated/ns/workspaces.d.ts +225 -0
- package/dist/esm/generated/ns/workspaces.js +406 -0
- package/dist/esm/generated/ns/workspaces.js.map +1 -0
- package/dist/esm/generated/types.d.ts +5259 -605
- package/dist/esm/helpers/sandboxes.d.ts +20 -1
- package/dist/esm/helpers/sandboxes.js +13 -1
- package/dist/esm/helpers/sandboxes.js.map +1 -1
- package/package.json +1 -1
- package/src/core/util.ts +1 -1
- package/src/generated/client.ts +38 -0
- package/src/generated/errors.ts +240 -0
- package/src/generated/ids.ts +22 -0
- package/src/generated/jobs.ts +4 -0
- package/src/generated/ns/actions.ts +403 -33
- package/src/generated/ns/agents.ts +1102 -0
- package/src/generated/ns/images.ts +256 -0
- package/src/generated/ns/infer.ts +100 -3
- package/src/generated/ns/keys.ts +3 -1
- package/src/generated/ns/listeners.ts +300 -0
- package/src/generated/ns/orgs.ts +27 -1
- package/src/generated/ns/projects.ts +74 -0
- package/src/generated/ns/render.ts +277 -24
- package/src/generated/ns/requests.ts +3 -1
- package/src/generated/ns/routines.ts +22 -4
- package/src/generated/ns/sandboxes.ts +694 -7
- package/src/generated/ns/usage.ts +1 -1
- package/src/generated/ns/vision.ts +159 -21
- package/src/generated/ns/workspaces.ts +448 -0
- package/src/generated/types.ts +5684 -601
- package/src/helpers/sandboxes.ts +31 -2
|
@@ -5,6 +5,55 @@ exports.RenderAPI = exports.renderOps = void 0;
|
|
|
5
5
|
const jobs_ts_1 = require("../../core/jobs.js");
|
|
6
6
|
const namespace_ts_1 = require("../../core/namespace.js");
|
|
7
7
|
const render_ts_1 = require("../../helpers/render.js");
|
|
8
|
+
const listAliasesOp = {
|
|
9
|
+
id: "renderListAliases",
|
|
10
|
+
method: "GET",
|
|
11
|
+
path: "/v1/render/aliases",
|
|
12
|
+
timeoutMs: 10000,
|
|
13
|
+
scope: "render:read",
|
|
14
|
+
};
|
|
15
|
+
const deleteAliasOp = {
|
|
16
|
+
id: "renderDeleteAlias",
|
|
17
|
+
method: "DELETE",
|
|
18
|
+
path: "/v1/render/aliases/{alias}",
|
|
19
|
+
params: ["alias"],
|
|
20
|
+
timeoutMs: 15000,
|
|
21
|
+
scope: "render:write",
|
|
22
|
+
};
|
|
23
|
+
const getAliasOp = {
|
|
24
|
+
id: "renderGetAlias",
|
|
25
|
+
method: "GET",
|
|
26
|
+
path: "/v1/render/aliases/{alias}",
|
|
27
|
+
params: ["alias"],
|
|
28
|
+
timeoutMs: 10000,
|
|
29
|
+
scope: "render:read",
|
|
30
|
+
};
|
|
31
|
+
const putAliasOp = {
|
|
32
|
+
id: "renderPutAlias",
|
|
33
|
+
method: "PUT",
|
|
34
|
+
path: "/v1/render/aliases/{alias}",
|
|
35
|
+
params: ["alias"],
|
|
36
|
+
body: "json",
|
|
37
|
+
timeoutMs: 15000,
|
|
38
|
+
scope: "render:write",
|
|
39
|
+
};
|
|
40
|
+
const unshareAliasOp = {
|
|
41
|
+
id: "renderUnshareAlias",
|
|
42
|
+
method: "DELETE",
|
|
43
|
+
path: "/v1/render/aliases/{alias}/share",
|
|
44
|
+
params: ["alias"],
|
|
45
|
+
timeoutMs: 15000,
|
|
46
|
+
scope: "render:write",
|
|
47
|
+
};
|
|
48
|
+
const shareAliasOp = {
|
|
49
|
+
id: "renderShareAlias",
|
|
50
|
+
method: "POST",
|
|
51
|
+
path: "/v1/render/aliases/{alias}/share",
|
|
52
|
+
params: ["alias"],
|
|
53
|
+
body: "json",
|
|
54
|
+
timeoutMs: 15000,
|
|
55
|
+
scope: "render:write",
|
|
56
|
+
};
|
|
8
57
|
const getArtifactOp = {
|
|
9
58
|
id: "renderGetArtifact",
|
|
10
59
|
method: "GET",
|
|
@@ -27,6 +76,15 @@ const listBackgroundPacksOp = {
|
|
|
27
76
|
timeoutMs: 10000,
|
|
28
77
|
scope: "public",
|
|
29
78
|
};
|
|
79
|
+
const createInspectionOp = {
|
|
80
|
+
id: "renderCreateInspection",
|
|
81
|
+
method: "POST",
|
|
82
|
+
path: "/v1/render/inspections",
|
|
83
|
+
body: "json",
|
|
84
|
+
idem: true,
|
|
85
|
+
timeoutMs: 65000,
|
|
86
|
+
scope: "render:run",
|
|
87
|
+
};
|
|
30
88
|
const listPresetsOp = {
|
|
31
89
|
id: "renderListPresets",
|
|
32
90
|
method: "GET",
|
|
@@ -87,7 +145,7 @@ const getVideoOp = {
|
|
|
87
145
|
path: "/v1/render/videos/{video_id}",
|
|
88
146
|
params: ["video_id"],
|
|
89
147
|
timeoutMs: 10000,
|
|
90
|
-
scope: "
|
|
148
|
+
scope: "authenticated",
|
|
91
149
|
};
|
|
92
150
|
const cancelVideoOp = {
|
|
93
151
|
id: "renderCancelVideo",
|
|
@@ -111,7 +169,7 @@ const unshareVideoOp = {
|
|
|
111
169
|
method: "DELETE",
|
|
112
170
|
path: "/v1/render/videos/{video_id}/share",
|
|
113
171
|
params: ["video_id"],
|
|
114
|
-
timeoutMs:
|
|
172
|
+
timeoutMs: 15000,
|
|
115
173
|
scope: "render:write",
|
|
116
174
|
};
|
|
117
175
|
const shareVideoOp = {
|
|
@@ -120,7 +178,7 @@ const shareVideoOp = {
|
|
|
120
178
|
path: "/v1/render/videos/{video_id}/share",
|
|
121
179
|
params: ["video_id"],
|
|
122
180
|
body: "json",
|
|
123
|
-
timeoutMs:
|
|
181
|
+
timeoutMs: 15000,
|
|
124
182
|
scope: "render:write",
|
|
125
183
|
};
|
|
126
184
|
const getVideoTimelineOp = {
|
|
@@ -156,9 +214,16 @@ const restyleVideoOp = {
|
|
|
156
214
|
};
|
|
157
215
|
/** Descriptors of every render operation, keyed by method name (for tooling and custom clients). */
|
|
158
216
|
exports.renderOps = {
|
|
217
|
+
listAliases: listAliasesOp,
|
|
218
|
+
deleteAlias: deleteAliasOp,
|
|
219
|
+
getAlias: getAliasOp,
|
|
220
|
+
putAlias: putAliasOp,
|
|
221
|
+
unshareAlias: unshareAliasOp,
|
|
222
|
+
shareAlias: shareAliasOp,
|
|
159
223
|
getArtifact: getArtifactOp,
|
|
160
224
|
listBackgrounds: listBackgroundsOp,
|
|
161
225
|
listBackgroundPacks: listBackgroundPacksOp,
|
|
226
|
+
createInspection: createInspectionOp,
|
|
162
227
|
listPresets: listPresetsOp,
|
|
163
228
|
listScreenshots: listScreenshotsOp,
|
|
164
229
|
createScreenshot: createScreenshotOp,
|
|
@@ -177,6 +242,85 @@ exports.renderOps = {
|
|
|
177
242
|
};
|
|
178
243
|
/** Styled screenshots and product videos (`/v1/render`). */
|
|
179
244
|
class RenderAPI extends namespace_ts_1.Namespace {
|
|
245
|
+
/**
|
|
246
|
+
* List aliases
|
|
247
|
+
*
|
|
248
|
+
* Lists the project's aliases, by name. An alias names a recording (`onboarding`, `billing-tour`): it points at
|
|
249
|
+
* the newest succeeded video tagged with it, so a share of the alias always plays the latest re-record with no
|
|
250
|
+
* change to the embed.
|
|
251
|
+
*
|
|
252
|
+
* `GET /v1/render/aliases` · scope `render:read` · served by the node
|
|
253
|
+
*/
|
|
254
|
+
listAliases(params, options) {
|
|
255
|
+
return this._client._list(listAliasesOp, { query: params }, options);
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Delete an alias
|
|
259
|
+
*
|
|
260
|
+
* Stops the alias's share (as `DELETE /v1/render/aliases/{alias}/share` does: 503 and nothing changed when
|
|
261
|
+
* storage cannot be reached), releases the video it pointed at to the normal retention (it expires 24 hours
|
|
262
|
+
* from now, or at its own expiry when that is later) and removes the alias. The tagged videos stay.
|
|
263
|
+
*
|
|
264
|
+
* `DELETE /v1/render/aliases/{alias}` · scope `render:write` · served by the node
|
|
265
|
+
*/
|
|
266
|
+
deleteAlias(alias, options) {
|
|
267
|
+
return this._client._call(deleteAliasOp, { path: [alias] }, options);
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Get an alias
|
|
271
|
+
*
|
|
272
|
+
* The alias, the video it points at, its newest 20 tagged videos and its share.
|
|
273
|
+
*
|
|
274
|
+
* `GET /v1/render/aliases/{alias}` · scope `render:read` · served by the node
|
|
275
|
+
*/
|
|
276
|
+
getAlias(alias, options) {
|
|
277
|
+
return this._client._call(getAliasOp, { path: [alias] }, options);
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Point or pin an alias
|
|
281
|
+
*
|
|
282
|
+
* Makes the alias (201) or changes it (200). `video_id` points it at a video tagged with it that has not
|
|
283
|
+
* expired, and pins it there (`follow: false`): re-records no longer move it, which is how to roll an embed
|
|
284
|
+
* back. `follow: true` makes it follow again and moves it to the newest succeeded tagged video at once (while
|
|
285
|
+
* the alias has a share, not to one recorded with `source.profile`: only `video_id` puts that on a share). A
|
|
286
|
+
* video not tagged with the alias is refused with 409 `conflict`: restyle it with `alias: <name>` to add it
|
|
287
|
+
* (its files then go to the alias's storage). The video an alias points at is kept past the 7-day retention;
|
|
288
|
+
* the one it leaves is kept 24 hours more, and its versioned file URLs keep working for an hour.
|
|
289
|
+
*
|
|
290
|
+
* `PUT /v1/render/aliases/{alias}` · scope `render:write` · served by the node
|
|
291
|
+
*/
|
|
292
|
+
putAlias(alias, body, options) {
|
|
293
|
+
return this._client._call(putAliasOp, { path: [alias], body }, options);
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Stop sharing an alias
|
|
297
|
+
*
|
|
298
|
+
* Stops the alias's share, the same way as stopping a video's share: the answer comes once storage confirmed
|
|
299
|
+
* it, the next request to the page, its files or its oEmbed answer answers 404, caches keep a copy for at most
|
|
300
|
+
* 60 seconds, and 503 `product_unavailable` leaves it live. Stopping a share that does not exist succeeds.
|
|
301
|
+
*
|
|
302
|
+
* `DELETE /v1/render/aliases/{alias}/share` · scope `render:write` · served by the node
|
|
303
|
+
*/
|
|
304
|
+
unshareAlias(alias, options) {
|
|
305
|
+
return this._client._call(unshareAliasOp, { path: [alias] }, options);
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Share an alias
|
|
309
|
+
*
|
|
310
|
+
* Makes a public share of the alias: the same page, files and oEmbed answer as a video's share, but they play
|
|
311
|
+
* the video the alias points at, so an embed shows the newest re-record with no change to its HTML. Its stable
|
|
312
|
+
* URLs (`url`, `media`) change bytes when the alias moves; the page names the files of one version, so a
|
|
313
|
+
* player that loaded it before the move keeps playing that video. The share lasts while the alias exists
|
|
314
|
+
* (`expires_at: null`). Sharing again returns the live share (200). Answers 409 `conflict` while the alias
|
|
315
|
+
* points at no video or its video's MP4 does not reach storage (files are served from storage only; while a
|
|
316
|
+
* re-record's files upload, the page plays the video the alias left), 403 `share_blocked` when B3 took its
|
|
317
|
+
* share down, and 503 `product_unavailable` without object storage.
|
|
318
|
+
*
|
|
319
|
+
* `POST /v1/render/aliases/{alias}/share` · scope `render:write` · served by the node
|
|
320
|
+
*/
|
|
321
|
+
shareAlias(alias, body, options) {
|
|
322
|
+
return this._client._call(shareAliasOp, { path: [alias], body }, options);
|
|
323
|
+
}
|
|
180
324
|
/**
|
|
181
325
|
* Get an artifact
|
|
182
326
|
*
|
|
@@ -227,6 +371,42 @@ class RenderAPI extends namespace_ts_1.Namespace {
|
|
|
227
371
|
listBackgroundPacks(options) {
|
|
228
372
|
return this._client._call(listBackgroundPacksOp, {}, options);
|
|
229
373
|
}
|
|
374
|
+
/**
|
|
375
|
+
* Inspect a page or a video
|
|
376
|
+
*
|
|
377
|
+
* Records a short window frame by frame and reports what changed from each frame to the next. With `url`, it
|
|
378
|
+
* loads the page in a browser at device scale 1, runs `steps` on a virtual clock and takes every frame of
|
|
379
|
+
* `duration_ms` at `fps` (at most 300 frames). With `video_id`, it reads the same window from a finished video
|
|
380
|
+
* of this project. It answers in one call: up to 8 `summary` lines, the change `report` (changed regions,
|
|
381
|
+
* layout shifts, flashes, cuts, scroll stalls), a `trace` of each `watch` target's box over time, and one
|
|
382
|
+
* contact sheet (`sheet`, WebP, at most 1568x1176 px) with up to 12 timestamped frames and before/after crops
|
|
383
|
+
* of the two main changes. Nothing is drawn over the page's pixels except outlines of the changed regions.
|
|
384
|
+
*
|
|
385
|
+
* Positions are CSS px for a page and video px for a video (`window.units`); times are ms from the start of
|
|
386
|
+
* the page's clock, or of the video. Page time is virtual: it holds while code, data, style and font requests
|
|
387
|
+
* are in flight, so network waits never show as page time (`report.network` says how long it held). Web
|
|
388
|
+
* workers and other wall-clock work run in real time against it. Unlike a video's capture, banners are left
|
|
389
|
+
* in place, lazy content is not loaded ahead and client-side routes are not run ahead of the clock. The window
|
|
390
|
+
* starts after the page's `load` event, its images, a short network quiet and 1 s of page time, so how the page
|
|
391
|
+
* loaded is not in it: to see a change, make it with `steps` (a click, or a `navigate`).
|
|
392
|
+
*
|
|
393
|
+
* The browser, the page's load and the capture must fit in about a minute: a load or a step that waits past
|
|
394
|
+
* that answers 504 `job_timed_out`.
|
|
395
|
+
*
|
|
396
|
+
* A video source drops shifts and flashes while the video's camera moves, reports the camera's planned cuts
|
|
397
|
+
* as `camera_cut`, and leaves the caption rows out (`report.masked`). `steps`, `watch`, `viewport` and `theme`
|
|
398
|
+
* are for `url` only.
|
|
399
|
+
*
|
|
400
|
+
* The sheet is an artifact kept for 24 hours; the inspection itself is not stored (there is no GET for it).
|
|
401
|
+
* `sheet.tokens` is what the sheet costs a vision model that reads 28 px patches: ceil(width / 28) x
|
|
402
|
+
* ceil(height / 28), at most 2352. Bills `render.inspection_s`, one per second of window rounded up, once the
|
|
403
|
+
* sheet is saved; an error bills nothing.
|
|
404
|
+
*
|
|
405
|
+
* `POST /v1/render/inspections` · scope `render:run` · served by the node
|
|
406
|
+
*/
|
|
407
|
+
createInspection(body, options) {
|
|
408
|
+
return this._client._call(createInspectionOp, { body }, options);
|
|
409
|
+
}
|
|
230
410
|
/**
|
|
231
411
|
* List style presets
|
|
232
412
|
*
|
|
@@ -306,6 +486,27 @@ class RenderAPI extends namespace_ts_1.Namespace {
|
|
|
306
486
|
* nothing is billed. A recording made with a
|
|
307
487
|
* profile is reused (`recording.reuse`) only by videos with the same revision of the same profile.
|
|
308
488
|
*
|
|
489
|
+
* `goal` instead of `beats` says what the video should show and lets the node plan the steps: the job's first
|
|
490
|
+
* phase, `draft`, reads the start page with a vision scrape (as the caller), asks the node's chat model for
|
|
491
|
+
* beats whose steps can only click, hover or type into controls that page listed, runs those steps once in a
|
|
492
|
+
* second scrape to check them, and asks once more for the rest of the goal when they revealed new controls. At most 2 vision pages, 2 model answers and 6 beats, within the
|
|
493
|
+
* `render.goal.plan_s` limit (90 s). The drafted beats are the video's script from then on (`goal.beats`, the
|
|
494
|
+
* `video.drafted` event); send them back as `beats` to record the same steps again. Planning needs `vision:run`
|
|
495
|
+
* and `infer:run` in the key's scopes (403 `forbidden` before the job exists otherwise). When it fails, the job
|
|
496
|
+
* fails with `goal_unplanned` and its `reason`, and no `render.video_s` is billed; the vision pages and model
|
|
497
|
+
* tokens planning used are billed by those operations (`vision.page`, `infer.input_tokens`,
|
|
498
|
+
* `infer.output_tokens`), whether or not it succeeds. A goal is planned on public pages only: with
|
|
499
|
+
* `source.profile` it is refused with 422 `script_invalid` at `/source/profile` before the job exists, since the
|
|
500
|
+
* check runs the drafted steps on the page before anyone sees them; send `beats` for a signed-in page.
|
|
501
|
+
*
|
|
502
|
+
* `alias` tags the video with a name of the project, such as `onboarding`, and makes the alias if it does not
|
|
503
|
+
* exist: when the video succeeds the alias points at it (it never moves back to an older video), and a share
|
|
504
|
+
* of the alias (`POST /v1/render/aliases/{alias}/share`) plays it. While an alias points at a video, the video
|
|
505
|
+
* is kept past the 7-day retention (`expires_at: null`, `kept_by_alias`). A tag can change what a live share
|
|
506
|
+
* plays, so `alias` needs `render:write` besides `render:run` (403 `forbidden`, reason `scope`, otherwise). A
|
|
507
|
+
* video recorded with `source.profile` never moves an alias that has a share: the alias stays where it is,
|
|
508
|
+
* `result.warnings` says `alias_signed_in`, and `PUT /v1/render/aliases/{alias}` with `video_id` moves it.
|
|
509
|
+
*
|
|
309
510
|
* `POST /v1/render/videos` · scope `render:run` · served by the node
|
|
310
511
|
*/
|
|
311
512
|
createVideo(body, options) {
|
|
@@ -314,7 +515,9 @@ class RenderAPI extends namespace_ts_1.Namespace {
|
|
|
314
515
|
/**
|
|
315
516
|
* Delete a video
|
|
316
517
|
*
|
|
317
|
-
* Cancels the job if it is still running, then deletes the video, its artifacts, its share
|
|
518
|
+
* Cancels the job if it is still running, then deletes the video, its artifacts, its share and its archived
|
|
519
|
+
* capture. When an alias points at the video, the alias moves to the newest other succeeded video tagged with
|
|
520
|
+
* it that has not expired, or to none (its share page then answers 404 until a new video succeeds).
|
|
318
521
|
*
|
|
319
522
|
* `DELETE /v1/render/videos/{video_id}` · scope `render:write` · served by the node
|
|
320
523
|
*/
|
|
@@ -326,7 +529,15 @@ class RenderAPI extends namespace_ts_1.Namespace {
|
|
|
326
529
|
*
|
|
327
530
|
* Returns the video job; once it succeeded, `result.artifacts` lists its files with fresh signed URLs.
|
|
328
531
|
*
|
|
329
|
-
* `
|
|
532
|
+
* Needs `render:read`, or `render:run` when the caller created the video (node release 1119): the creating
|
|
533
|
+
* sandbox for a video a sandbox made, the creating key for one a key made, so a service that may only record
|
|
534
|
+
* videos can wait for its own. A fork is a new sandbox, so it reads the videos its parent made only with
|
|
535
|
+
* `render:read`. A `render:run` caller that did not create the video gets the `404 video_not_found` an unknown
|
|
536
|
+
* id gets; a credential with neither scope gets `403 forbidden` (`reason: scope`, `required_scope:
|
|
537
|
+
* render:read`). A video created before the release, or by a credential with neither a sandbox nor a key (a
|
|
538
|
+
* dashboard session), has no recorded creator: only `render:read` reads it.
|
|
539
|
+
*
|
|
540
|
+
* `GET /v1/render/videos/{video_id}` · scope `authenticated` · served by the node
|
|
330
541
|
*/
|
|
331
542
|
getVideo(videoId, options) {
|
|
332
543
|
return this._client._call(getVideoOp, { path: [videoId] }, options);
|
|
@@ -335,7 +546,9 @@ class RenderAPI extends namespace_ts_1.Namespace {
|
|
|
335
546
|
* Cancel a video
|
|
336
547
|
*
|
|
337
548
|
* Stops the job and marks the video canceled. A canceled video bills nothing: `render.video_s` is billed only
|
|
338
|
-
* when a video succeeds. A video that already finished answers 409.
|
|
549
|
+
* when a video succeeds. A video that already finished answers 409. Since node release 1119 the caller must
|
|
550
|
+
* be able to read the video: its creator, or a credential with `render:read`; anyone else gets the
|
|
551
|
+
* `404 video_not_found` an unknown id gets.
|
|
339
552
|
*
|
|
340
553
|
* `POST /v1/render/videos/{video_id}/cancel` · scope `render:run` · served by the node
|
|
341
554
|
*/
|
|
@@ -345,9 +558,10 @@ class RenderAPI extends namespace_ts_1.Namespace {
|
|
|
345
558
|
/**
|
|
346
559
|
* Stream a video's events
|
|
347
560
|
*
|
|
348
|
-
* Server-sent events for the video job: lifecycle events, `video.phase` as the job moves through
|
|
349
|
-
* capture, compose, encode and upload,
|
|
350
|
-
*
|
|
561
|
+
* Server-sent events for the video job: lifecycle events, `video.phase` as the job moves through draft (a
|
|
562
|
+
* video made from a `goal`), voice, plan, capture, compose, encode and upload, `video.drafted` once a goal's
|
|
563
|
+
* beats are planned, and `video.artifact` as each file becomes available. Ends after the terminal event;
|
|
564
|
+
* reconnect with `Last-Event-ID` to resume.
|
|
351
565
|
*
|
|
352
566
|
* `GET /v1/render/videos/{video_id}/events` · scope `render:read` · served by the node
|
|
353
567
|
*/
|
|
@@ -363,7 +577,20 @@ class RenderAPI extends namespace_ts_1.Namespace {
|
|
|
363
577
|
* Starts a job that re-composes the source video's archived raw capture with a new style, captions, output
|
|
364
578
|
* size or formats. No browser runs and narration is reused, so it takes seconds. Camera moves are not
|
|
365
579
|
* changed. The result is a new video (`restyled_from` names the source). The raw capture is kept as long as
|
|
366
|
-
* the source video (7 days).
|
|
580
|
+
* the source video (7 days, or while an alias keeps it).
|
|
581
|
+
*
|
|
582
|
+
* A restyle does not inherit its source's alias, so trying styles never moves a live embed. Give `alias` to
|
|
583
|
+
* tag the new video with one: when it succeeds the alias points at it, in seconds and without a browser. That
|
|
584
|
+
* is also how a video made without an alias joins one. `alias` needs `render:write` besides `render:run` (403
|
|
585
|
+
* `forbidden`, reason `scope`, otherwise). A restyle of a video recorded with `source.profile` keeps its
|
|
586
|
+
* `source.profile`, and so never moves an alias that has a share (`alias_signed_in`).
|
|
587
|
+
*
|
|
588
|
+
* Since node release 1119 the caller must be able to read the source: its creator, or a credential with
|
|
589
|
+
* `render:read`; anyone else gets the `404 video_not_found` an unknown id gets. The new video's creator is the
|
|
590
|
+
* caller, who reads it with `render:run`.
|
|
591
|
+
*
|
|
592
|
+
* A video B3 took down is not restyled while the takedown stands (403 `share_blocked`): the node asks B3OS's
|
|
593
|
+
* storage first, and answers 503 `product_unavailable` with `Retry-After` when it cannot.
|
|
367
594
|
*
|
|
368
595
|
* `POST /v1/render/videos/{video_id}/restyle` · scope `render:run` · served by the node
|
|
369
596
|
*/
|
|
@@ -373,9 +600,11 @@ class RenderAPI extends namespace_ts_1.Namespace {
|
|
|
373
600
|
/**
|
|
374
601
|
* Stop sharing a video
|
|
375
602
|
*
|
|
376
|
-
*
|
|
377
|
-
*
|
|
378
|
-
*
|
|
603
|
+
* Stops the video's share. The answer comes once B3OS's storage confirmed the share is gone: from then on its
|
|
604
|
+
* page, its files and its oEmbed answer answer 404 at once, and a browser or shared cache keeps a copy for at
|
|
605
|
+
* most 60 seconds. When storage cannot be reached the share stays live and the call answers 503
|
|
606
|
+
* `product_unavailable` with `Retry-After`; call it again. The video stays. Stopping a share that does not
|
|
607
|
+
* exist succeeds.
|
|
379
608
|
*
|
|
380
609
|
* `DELETE /v1/render/videos/{video_id}/share` · scope `render:write` · served by the node
|
|
381
610
|
*/
|
|
@@ -385,17 +614,31 @@ class RenderAPI extends namespace_ts_1.Namespace {
|
|
|
385
614
|
/**
|
|
386
615
|
* Share a video
|
|
387
616
|
*
|
|
388
|
-
* Makes a share
|
|
389
|
-
* poster, captions and chapters, carries Open Graph tags
|
|
390
|
-
*
|
|
391
|
-
*
|
|
392
|
-
*
|
|
393
|
-
*
|
|
394
|
-
*
|
|
395
|
-
*
|
|
396
|
-
*
|
|
397
|
-
*
|
|
398
|
-
*
|
|
617
|
+
* Makes a public share of a finished video: a page at `https://usercontent.b3os.org/s/<share id>` that plays
|
|
618
|
+
* the MP4 with its poster, captions and chapters, carries Open Graph tags and a JSON-LD `VideoObject` for link
|
|
619
|
+
* previews, is its own iframe embed (`embed_html`), and answers oEmbed (`oembed_url`). `media` gives stable
|
|
620
|
+
* URLs of the files for a README image or a `<video>` written by hand (`…/video.gif`, `…/poster.jpg`,
|
|
621
|
+
* `…/video.mp4`). The share ID is 128 random bits: the URL is the only key, and the page is `noindex`. No
|
|
622
|
+
* script runs on the page (`Content-Security-Policy: sandbox`, which allows only popups, so its footer links
|
|
623
|
+
* open).
|
|
624
|
+
*
|
|
625
|
+
* A video's share lasts as long as the video (7 days by default); to keep a demo past that, share an alias
|
|
626
|
+
* instead (`POST /v1/render/aliases/{alias}/share`). Sharing again returns the live share (200); a new one
|
|
627
|
+
* answers 201. Videos are never public until shared: a video recorded with a profile shows signed-in pages,
|
|
628
|
+
* so share it only if those pages may be public.
|
|
629
|
+
*
|
|
630
|
+
* Stopping the share (`DELETE`) or deleting the video takes the page, its files and its oEmbed answer down for
|
|
631
|
+
* every viewer: the next request answers 404, and a browser or shared cache keeps a copy for at most 60
|
|
632
|
+
* seconds. Bytes a player already downloaded, and copies other services made of public URLs (link previews,
|
|
633
|
+
* an image proxy for a README), are out of reach. Answers 503 `product_unavailable` when the node has no
|
|
634
|
+
* object storage to publish to (`[render.upload] kind = "none"`), and 403 `share_blocked` when B3 took the
|
|
635
|
+
* video's share down.
|
|
636
|
+
*
|
|
637
|
+
* A share's files come from B3OS's storage only, never from the node that recorded the video. A file that is
|
|
638
|
+
* still uploading (seconds after the video succeeded) answers 404 at its share URLs until it lands; a file
|
|
639
|
+
* that will never reach storage (larger than the node uploads: 100 MiB, or what its upload pace sends in 60
|
|
640
|
+
* seconds, 75 MB by default; or its upload was given up) is left out of the share. A video whose MP4 is such a
|
|
641
|
+
* file is refused with 409 `conflict`, whose `detail` says why.
|
|
399
642
|
*
|
|
400
643
|
* `POST /v1/render/videos/{video_id}/share` · scope `render:write` · served by the node
|
|
401
644
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","sourceRoot":"","sources":["../../../../src/generated/ns/render.ts"],"names":[],"mappings":";AAAA,4GAA4G;;;AAG5G,gDAAwD;AACxD,0DAAoD;AAIpD,uDAA4E;AAG5E,MAAM,aAAa,GAAO;IACxB,EAAE,EAAE,mBAAmB;IACvB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,oCAAoC;IAC1C,MAAM,EAAE,CAAC,aAAa,CAAC;IACvB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,aAAa;CACrB,CAAC;AACF,MAAM,iBAAiB,GAAO;IAC5B,EAAE,EAAE,uBAAuB;IAC3B,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,wBAAwB;IAC9B,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,MAAM,qBAAqB,GAAO;IAChC,EAAE,EAAE,2BAA2B;IAC/B,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,8BAA8B;IACpC,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,MAAM,aAAa,GAAO;IACxB,EAAE,EAAE,mBAAmB;IACvB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,oBAAoB;IAC1B,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,MAAM,iBAAiB,GAAO;IAC5B,EAAE,EAAE,uBAAuB;IAC3B,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,wBAAwB;IAC9B,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,aAAa;CACrB,CAAC;AACF,MAAM,kBAAkB,GAAO;IAC7B,EAAE,EAAE,wBAAwB;IAC5B,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,YAAY;CACpB,CAAC;AACF,MAAM,kBAAkB,GAAO;IAC7B,EAAE,EAAE,wBAAwB;IAC5B,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,wCAAwC;IAC9C,MAAM,EAAE,CAAC,eAAe,CAAC;IACzB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,cAAc;CACtB,CAAC;AACF,MAAM,eAAe,GAAO;IAC1B,EAAE,EAAE,qBAAqB;IACzB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,wCAAwC;IAC9C,MAAM,EAAE,CAAC,eAAe,CAAC;IACzB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,aAAa;CACrB,CAAC;AACF,MAAM,YAAY,GAAO;IACvB,EAAE,EAAE,kBAAkB;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,mBAAmB;IACzB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,aAAa;CACrB,CAAC;AACF,MAAM,aAAa,GAAO;IACxB,EAAE,EAAE,mBAAmB;IACvB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,8BAA8B;IACpC,MAAM,EAAE,CAAC,UAAU,CAAC;IACpB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,cAAc;CACtB,CAAC;AACF,MAAM,UAAU,GAAO;IACrB,EAAE,EAAE,gBAAgB;IACpB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,8BAA8B;IACpC,MAAM,EAAE,CAAC,UAAU,CAAC;IACpB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"render.js","sourceRoot":"","sources":["../../../../src/generated/ns/render.ts"],"names":[],"mappings":";AAAA,4GAA4G;;;AAG5G,gDAAwD;AACxD,0DAAoD;AAIpD,uDAA4E;AAG5E,MAAM,aAAa,GAAO;IACxB,EAAE,EAAE,mBAAmB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OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/G,CAAC;IAED;;;;OAIG;IACH,aAAa,CACX,QAA2D,EAC3D,OAAwB;QAExB,OAAO,IAAA,yBAAa,EAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;CACF;AApgBD,8BAogBC"}
|
|
@@ -14,7 +14,9 @@ export declare class RequestsAPI extends Namespace {
|
|
|
14
14
|
* List requests
|
|
15
15
|
*
|
|
16
16
|
* Lists the requests the node served for your project in the last 7 days, newest first, over every connection
|
|
17
|
-
* kind, filterable by product, operation, status, key, source, connection kind, sandbox and
|
|
17
|
+
* kind, filterable by product, operation, status, key, source, connection kind, sandbox, trace and pack (the
|
|
18
|
+
* records whose `action` ran one of that pack's actions: a sandbox's tool calls over MCP and its
|
|
19
|
+
* `POST /v1/actions/call` calls). Every source
|
|
18
20
|
* is listed unless `source` narrows it (the dashboard's Requests page leaves `dashboard` out until you show it).
|
|
19
21
|
* Requests the edge answered
|
|
20
22
|
* without forwarding them (edge-served operations, or requests refused before forwarding) are not listed; get
|
|
@@ -26,7 +26,9 @@ class RequestsAPI extends namespace_ts_1.Namespace {
|
|
|
26
26
|
* List requests
|
|
27
27
|
*
|
|
28
28
|
* Lists the requests the node served for your project in the last 7 days, newest first, over every connection
|
|
29
|
-
* kind, filterable by product, operation, status, key, source, connection kind, sandbox and
|
|
29
|
+
* kind, filterable by product, operation, status, key, source, connection kind, sandbox, trace and pack (the
|
|
30
|
+
* records whose `action` ran one of that pack's actions: a sandbox's tool calls over MCP and its
|
|
31
|
+
* `POST /v1/actions/call` calls). Every source
|
|
30
32
|
* is listed unless `source` narrows it (the dashboard's Requests page leaves `dashboard` out until you show it).
|
|
31
33
|
* Requests the edge answered
|
|
32
34
|
* without forwarding them (edge-served operations, or requests refused before forwarding) are not listed; get
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requests.js","sourceRoot":"","sources":["../../../../src/generated/ns/requests.ts"],"names":[],"mappings":";AAAA,4GAA4G;;;AAG5G,0DAAoD;AAKpD,MAAM,cAAc,GAAO;IACzB,EAAE,EAAE,sBAAsB;IAC1B,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,cAAc;IACpB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,eAAe;CACvB,CAAC;AACF,MAAM,YAAY,GAAO;IACvB,EAAE,EAAE,oBAAoB;IACxB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,2BAA2B;IACjC,MAAM,EAAE,CAAC,YAAY,CAAC;IACtB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,eAAe;CACvB,CAAC;AAEF,sGAAsG;AACzF,QAAA,WAAW,GAAG,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAW,CAAC;AAE/F,sEAAsE;AACtE,MAAa,WAAY,SAAQ,wBAAS;IACxC
|
|
1
|
+
{"version":3,"file":"requests.js","sourceRoot":"","sources":["../../../../src/generated/ns/requests.ts"],"names":[],"mappings":";AAAA,4GAA4G;;;AAG5G,0DAAoD;AAKpD,MAAM,cAAc,GAAO;IACzB,EAAE,EAAE,sBAAsB;IAC1B,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,cAAc;IACpB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,eAAe;CACvB,CAAC;AACF,MAAM,YAAY,GAAO;IACvB,EAAE,EAAE,oBAAoB;IACxB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,2BAA2B;IACjC,MAAM,EAAE,CAAC,YAAY,CAAC;IACtB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,eAAe;CACvB,CAAC;AAEF,sGAAsG;AACzF,QAAA,WAAW,GAAG,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAW,CAAC;AAE/F,sEAAsE;AACtE,MAAa,WAAY,SAAQ,wBAAS;IACxC;;;;;;;;;;;;;OAaG;IACH,YAAY,CACV,MAAqC,EACrC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAuC,cAAc,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9G,CAAC;IAED;;;;;;;;;;OAUG;IACH,UAAU,CAAC,SAAiB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAkB,YAAY,EAAE,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAC3F,CAAC;CACF;AApCD,kCAoCC"}
|
|
@@ -65,7 +65,8 @@ export declare class RoutinesAPI extends Namespace {
|
|
|
65
65
|
* Events are not buffered: a step that starts waiting after the event does not see it, and an event no step
|
|
66
66
|
* waits for answers `delivered: 0`. Runs of other projects never see your events. Each step journals the
|
|
67
67
|
* event, so an event's JSON plus 256 bytes a step may add up to at most 4 MiB across the steps it resumes; past
|
|
68
|
-
* that it is refused whole with `event_fan_out_too_large` and no step continues.
|
|
68
|
+
* that it is refused whole with `event_fan_out_too_large` and no step continues. An event sent from inside a
|
|
69
|
+
* sandbox whose grant has an actions rule resumes only runs within that rule (ones such a sandbox started).
|
|
69
70
|
*
|
|
70
71
|
* `POST /v1/routines/events` · scope `routines:run` · served by the node
|
|
71
72
|
*/
|
|
@@ -141,7 +142,8 @@ export declare class RoutinesAPI extends Namespace {
|
|
|
141
142
|
* `run_not_waiting` when the run already finished or the buffer for this name is full. The payload counts
|
|
142
143
|
* against the organization's run data on the node (`max_org_run_bytes`): one that does not fit answers 429
|
|
143
144
|
* `concurrency_limited` (503 `capacity_unavailable` at the node's cap), except a payload of up to 1 KiB that
|
|
144
|
-
* ends a wait, so a run can always be let go.
|
|
145
|
+
* ends a wait, so a run can always be let go. From inside a sandbox whose grant has an actions rule, only a run
|
|
146
|
+
* within that rule (one such a sandbox started) takes the signal; any other answers `403 action_not_allowed`.
|
|
145
147
|
*
|
|
146
148
|
* `POST /v1/routines/runs/{run_id}/signal` · scope `routines:run` · served by the node
|
|
147
149
|
*/
|
|
@@ -226,6 +228,17 @@ export declare class RoutinesAPI extends Namespace {
|
|
|
226
228
|
* fails with `routine_invalid` and an `errors[]` item at that trigger. A webhook trigger that names a vault
|
|
227
229
|
* connection (`verify.secret`, `challenge.token_connection`) needs `vault:run` on top of `routines:write`
|
|
228
230
|
* (403 `forbidden`, `required_scope: vault:run`), as a connection in a pack trigger does.
|
|
231
|
+
* Listener triggers (`type: listener`) are listeners: publishing creates one (`lsn_`, read-only at
|
|
232
|
+
* `GET /v1/listeners/{listener_id}`) per listener trigger as the publishing key, which needs `routines:run`;
|
|
233
|
+
* a trigger whose `listener` and publishing key are unchanged keeps its listener, and the listeners of
|
|
234
|
+
* listener triggers the new version drops or changes are removed. When the listeners product refuses one,
|
|
235
|
+
* the publish fails with `routine_invalid` and `errors[]` items under that trigger's `listener`; when this
|
|
236
|
+
* node runs no listeners product it fails with 503 `product_unavailable`, and nothing is published.
|
|
237
|
+
* A listener trigger whose `listener` is a string (preview, flag `routines.named_listeners`) names a listener
|
|
238
|
+
* that already exists in the project by id or name: the publishing key needs `listeners:read` (and
|
|
239
|
+
* `listeners:write` when the listener's sink points anywhere else), the listener is checked before anything is
|
|
240
|
+
* committed, and once the version is active its sink becomes this routine and trigger (`sink.bound`). A
|
|
241
|
+
* version without the trigger, or a delete, unbinds it and pauses it.
|
|
229
242
|
*
|
|
230
243
|
* `PUT /v1/routines/{routine}` · scope `routines:write` · served by the node
|
|
231
244
|
*/
|
|
@@ -293,8 +306,9 @@ export declare class RoutinesAPI extends Namespace {
|
|
|
293
306
|
*
|
|
294
307
|
* Starts a run of the active version (or `version`) with `input`, validated against the routine's `inputs`
|
|
295
308
|
* schema. Use `?wait=` for tool-call style use (an `ephemeral` run that finishes within the wait never touches
|
|
296
|
-
* the journal), `Accept: text/event-stream` to follow steps live, or `webhook`.
|
|
297
|
-
*
|
|
309
|
+
* the journal), `Accept: text/event-stream` to follow steps live, or `webhook`. Only `core/http@1`, `wait` and
|
|
310
|
+
* `sleep_ms` steps bill `routines.effect_step`, one for each such step that ends (a skipped one bills nothing);
|
|
311
|
+
* a product step bills its product's unit, a pack step `actions.call`, and other steps bill nothing.
|
|
298
312
|
*
|
|
299
313
|
* Once an `ephemeral` run ends, only its summary is stored: status, timing, `input`, `result`, `error` and its
|
|
300
314
|
* IDs, without its step history. The `?wait=` answer, the event stream and the webhook carry its steps as it
|
|
@@ -312,6 +326,10 @@ export declare class RoutinesAPI extends Namespace {
|
|
|
312
326
|
* sandbox and then waits a long time pauses that sandbox until its next exec there (or until the run ends),
|
|
313
327
|
* unless another run on the node execs in it too.
|
|
314
328
|
*
|
|
329
|
+
* A run started from inside a sandbox whose grant has an actions rule (`api.actions.allow`) acts as the
|
|
330
|
+
* routine's publisher within that rule: a pack step outside it fails with `action_not_allowed`, and a
|
|
331
|
+
* sub-routine inherits the rule. The rule is kept with the run, across restarts.
|
|
332
|
+
*
|
|
315
333
|
* `POST /v1/routines/{routine}/runs` · scope `routines:run` · served by the node
|
|
316
334
|
*/
|
|
317
335
|
createRun(routine: string, body?: T.RunCreateRequest, options?: RequestOptions): JobPromise<T.RoutineRun, T.RunEvent>;
|
|
@@ -278,7 +278,8 @@ class RoutinesAPI extends namespace_ts_1.Namespace {
|
|
|
278
278
|
* Events are not buffered: a step that starts waiting after the event does not see it, and an event no step
|
|
279
279
|
* waits for answers `delivered: 0`. Runs of other projects never see your events. Each step journals the
|
|
280
280
|
* event, so an event's JSON plus 256 bytes a step may add up to at most 4 MiB across the steps it resumes; past
|
|
281
|
-
* that it is refused whole with `event_fan_out_too_large` and no step continues.
|
|
281
|
+
* that it is refused whole with `event_fan_out_too_large` and no step continues. An event sent from inside a
|
|
282
|
+
* sandbox whose grant has an actions rule resumes only runs within that rule (ones such a sandbox started).
|
|
282
283
|
*
|
|
283
284
|
* `POST /v1/routines/events` · scope `routines:run` · served by the node
|
|
284
285
|
*/
|
|
@@ -369,7 +370,8 @@ class RoutinesAPI extends namespace_ts_1.Namespace {
|
|
|
369
370
|
* `run_not_waiting` when the run already finished or the buffer for this name is full. The payload counts
|
|
370
371
|
* against the organization's run data on the node (`max_org_run_bytes`): one that does not fit answers 429
|
|
371
372
|
* `concurrency_limited` (503 `capacity_unavailable` at the node's cap), except a payload of up to 1 KiB that
|
|
372
|
-
* ends a wait, so a run can always be let go.
|
|
373
|
+
* ends a wait, so a run can always be let go. From inside a sandbox whose grant has an actions rule, only a run
|
|
374
|
+
* within that rule (one such a sandbox started) takes the signal; any other answers `403 action_not_allowed`.
|
|
373
375
|
*
|
|
374
376
|
* `POST /v1/routines/runs/{run_id}/signal` · scope `routines:run` · served by the node
|
|
375
377
|
*/
|
|
@@ -468,6 +470,17 @@ class RoutinesAPI extends namespace_ts_1.Namespace {
|
|
|
468
470
|
* fails with `routine_invalid` and an `errors[]` item at that trigger. A webhook trigger that names a vault
|
|
469
471
|
* connection (`verify.secret`, `challenge.token_connection`) needs `vault:run` on top of `routines:write`
|
|
470
472
|
* (403 `forbidden`, `required_scope: vault:run`), as a connection in a pack trigger does.
|
|
473
|
+
* Listener triggers (`type: listener`) are listeners: publishing creates one (`lsn_`, read-only at
|
|
474
|
+
* `GET /v1/listeners/{listener_id}`) per listener trigger as the publishing key, which needs `routines:run`;
|
|
475
|
+
* a trigger whose `listener` and publishing key are unchanged keeps its listener, and the listeners of
|
|
476
|
+
* listener triggers the new version drops or changes are removed. When the listeners product refuses one,
|
|
477
|
+
* the publish fails with `routine_invalid` and `errors[]` items under that trigger's `listener`; when this
|
|
478
|
+
* node runs no listeners product it fails with 503 `product_unavailable`, and nothing is published.
|
|
479
|
+
* A listener trigger whose `listener` is a string (preview, flag `routines.named_listeners`) names a listener
|
|
480
|
+
* that already exists in the project by id or name: the publishing key needs `listeners:read` (and
|
|
481
|
+
* `listeners:write` when the listener's sink points anywhere else), the listener is checked before anything is
|
|
482
|
+
* committed, and once the version is active its sink becomes this routine and trigger (`sink.bound`). A
|
|
483
|
+
* version without the trigger, or a delete, unbinds it and pauses it.
|
|
471
484
|
*
|
|
472
485
|
* `PUT /v1/routines/{routine}` · scope `routines:write` · served by the node
|
|
473
486
|
*/
|
|
@@ -547,8 +560,9 @@ class RoutinesAPI extends namespace_ts_1.Namespace {
|
|
|
547
560
|
*
|
|
548
561
|
* Starts a run of the active version (or `version`) with `input`, validated against the routine's `inputs`
|
|
549
562
|
* schema. Use `?wait=` for tool-call style use (an `ephemeral` run that finishes within the wait never touches
|
|
550
|
-
* the journal), `Accept: text/event-stream` to follow steps live, or `webhook`.
|
|
551
|
-
*
|
|
563
|
+
* the journal), `Accept: text/event-stream` to follow steps live, or `webhook`. Only `core/http@1`, `wait` and
|
|
564
|
+
* `sleep_ms` steps bill `routines.effect_step`, one for each such step that ends (a skipped one bills nothing);
|
|
565
|
+
* a product step bills its product's unit, a pack step `actions.call`, and other steps bill nothing.
|
|
552
566
|
*
|
|
553
567
|
* Once an `ephemeral` run ends, only its summary is stored: status, timing, `input`, `result`, `error` and its
|
|
554
568
|
* IDs, without its step history. The `?wait=` answer, the event stream and the webhook carry its steps as it
|
|
@@ -566,6 +580,10 @@ class RoutinesAPI extends namespace_ts_1.Namespace {
|
|
|
566
580
|
* sandbox and then waits a long time pauses that sandbox until its next exec there (or until the run ends),
|
|
567
581
|
* unless another run on the node execs in it too.
|
|
568
582
|
*
|
|
583
|
+
* A run started from inside a sandbox whose grant has an actions rule (`api.actions.allow`) acts as the
|
|
584
|
+
* routine's publisher within that rule: a pack step outside it fails with `action_not_allowed`, and a
|
|
585
|
+
* sub-routine inherits the rule. The rule is kept with the run, across restarts.
|
|
586
|
+
*
|
|
569
587
|
* `POST /v1/routines/{routine}/runs` · scope `routines:run` · served by the node
|
|
570
588
|
*/
|
|
571
589
|
createRun(routine, body, options) {
|