@scenerok/sdk 0.24.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scenerok/sdk",
3
- "version": "0.24.0",
3
+ "version": "0.26.0",
4
4
  "description": "TypeScript-first SceneRok authoring SDK — build IRTimeline for complex agent-authored scenes",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schema": "https://scenerok.com/catalog-index/v1",
3
- "generatedAt": "2026-10-25T10:25:48.562Z",
3
+ "generatedAt": "2026-10-26T01:38:31.092Z",
4
4
  "cdnBase": "https://assets-public.scenerok.com/catalog",
5
5
  "categories": [
6
6
  {
@@ -44,7 +44,32 @@ match, and prefer a plugin whenever the user pasted structured source data.
44
44
  `scenerok_render_video` the edited copy. See
45
45
  [Editing a generated video](#editing-a-generated-video).
46
46
 
47
- The tool list is stable: six plugin tools, not one tool per plugin.
47
+ The tool list is stable: seven plugin tools, not one tool per plugin.
48
+
49
+ ## UI actions (headless)
50
+
51
+ A plugin with a UI can expose non-interactive actions. Use
52
+ `scenerok_ui_action` with `{ ref, component, props?, inputs?, action, payload? }`
53
+ when the plugin's `component.json#agent.actions` lists what you need (the
54
+ component listing on the plugin page shows it). It runs the same controller the
55
+ UI runs, with no browser, and returns:
56
+
57
+ ```jsonc
58
+ {
59
+ "inputs": { "trimStartMs": 2000 }, // a proposed tier-1 patch
60
+ "document": { "api": "scenerok.ui.document/1", "root": {} },
61
+ "events": [{ "name": "trim", "payload": { "startMs": 2000 } }]
62
+ }
63
+ ```
64
+
65
+ Feed the patch into `scenerok_run_plugin`. Nothing is applied or charged by the
66
+ action itself.
67
+
68
+ An interactive action (recording a take, opening a picker) returns an **error**
69
+ with `code: "ui_required"` and `{ component, action, fallbackInput, hint }`. Do
70
+ not retry it: pass an existing value for `fallbackInput` (usually a
71
+ `scenerok://asset/<id>` from the user's workspace) to the normal plugin inputs,
72
+ or ask the user to open the run page. Actions never spend tokens.
48
73
 
49
74
  ## CLI equivalents
50
75
 
@@ -194,6 +219,18 @@ Notes:
194
219
  render afterwards. A failed draft costs no fee; a draft refused by the
195
220
  balance preflight costs nothing at all.
196
221
 
222
+ ## Permission grants
223
+
224
+ A **third-party** plugin needs a first-run permission grant per account and per
225
+ version before it can run or draft. The grant covers the capabilities the
226
+ version declares (AI providers, network domains, connected accounts, host
227
+ features) and is stored with the version's `capabilitiesHash`. The six
228
+ `@scenerok` first-party plugins are pre-installed and never ask.
229
+
230
+ | MCP result | Meaning | What to do |
231
+ | --- | --- | --- |
232
+ | `error.code: "permission_escalation"` (HTTP 409) | This account has not granted this version's permissions, or the version's `capabilitiesHash` changed since the last grant. `error.details.capabilities[]` lists exactly what is missing and `details.grantUrl` names the run page. | Tell the user which permissions are listed and ask them to open `details.grantUrl`, sign in, and allow them. Then call the same tool again. Do not loop on the retry and do not invent a grant. A `dryRun: true` still works and is free. |
233
+
197
234
  ## Reference
198
235
 
199
236
  - Environments and what they can call: `environments.md`