cueframe 0.11.4 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/README.md +36 -30
  2. package/dist/analyze-OBHAAM3S.js +2 -0
  3. package/dist/{chunk-HB4NDWMH.js → chunk-JBQC3HBB.js} +9 -9
  4. package/dist/cueframe.js +65 -65
  5. package/dist/skills/composing-video/SKILL.md +2 -0
  6. package/dist/skills/composing-video/references/tool-map.md +14 -0
  7. package/dist/skills/cueframe-brand-demo/SKILL.md +1 -1
  8. package/dist/skills/cueframe-cli/SKILL.md +44 -44
  9. package/dist/skills/cueframe-component-authoring/SKILL.md +4 -2
  10. package/dist/skills/cueframe-component-authoring/references/native-component-workflows.md +29 -12
  11. package/dist/skills/cueframe-component-authoring/references/optical-pill-study.md +38 -0
  12. package/dist/skills/cueframe-component-authoring/references/optical-pill-study.scene.json +212 -0
  13. package/dist/skills/cueframe-component-authoring/references/parented-device-card.json +1 -1
  14. package/dist/skills/cueframe-component-authoring/references/parented-motion.md +6 -0
  15. package/dist/skills/cueframe-component-authoring/references/worked-examples.md +56 -0
  16. package/dist/skills/cueframe-compose-loop/SKILL.md +6 -2
  17. package/dist/skills/cueframe-connect/SKILL.md +1 -1
  18. package/dist/skills/cueframe-connect/references/tools.md +14 -4
  19. package/dist/skills/cueframe-product-video/SKILL.md +7 -7
  20. package/dist/skills/cueframe-reference-video/SKILL.md +3 -1
  21. package/dist/skills/cueframe-reference-video/references/measurement-and-comparison.md +6 -0
  22. package/dist/skills/cueframe-scene-shot/SKILL.md +34 -6
  23. package/package.json +3 -3
  24. package/dist/analyze-I7B5SFLM.js +0 -2
package/README.md CHANGED
@@ -2,18 +2,18 @@
2
2
 
3
3
  Agent-native CLI for **CueFrame** — turn media into rendered video from the
4
4
  terminal. Commands support `--json` for structured output and the binary
5
- self-describes via `npx -y cueframe@0.11 describe --json`, so agents can drive it without
5
+ self-describes via `npx -y cueframe@0.12 describe --json`, so agents can drive it without
6
6
  guesswork.
7
7
 
8
8
  > Connects to the hosted CueFrame service — create an API key at
9
- > [app.cueframe.ai](https://app.cueframe.ai), or use `npx -y cueframe@0.11 login`.
9
+ > [app.cueframe.ai](https://app.cueframe.ai), or use `npx -y cueframe@0.12 login`.
10
10
 
11
11
  ## Run it
12
12
 
13
13
  Run the CLI without a global installation:
14
14
 
15
15
  ```bash
16
- npx -y cueframe@0.11 --help
16
+ npx -y cueframe@0.12 --help
17
17
  ```
18
18
 
19
19
  Requires **Node.js 24 or newer**. The `@0.8` selector keeps these commands on the documented minor release. `npx` downloads the package into its cache; it does not install a persistent binary on your `PATH`.
@@ -21,7 +21,7 @@ Requires **Node.js 24 or newer**. The `@0.8` selector keeps these commands on th
21
21
  For repeated terminal use, you can install that release globally:
22
22
 
23
23
  ```bash
24
- npm install -g cueframe@0.11
24
+ npm install -g cueframe@0.12
25
25
  ```
26
26
 
27
27
  The same commands then run as `cueframe …`.
@@ -29,9 +29,9 @@ The same commands then run as `cueframe …`.
29
29
  ## Authenticate
30
30
 
31
31
  ```bash
32
- npx -y cueframe@0.11 auth <cf_live_… key> # static API key (CI / headless)
32
+ npx -y cueframe@0.12 auth <cf_live_… key> # static API key (CI / headless)
33
33
  # or
34
- npx -y cueframe@0.11 login # OAuth device flow (browser)
34
+ npx -y cueframe@0.12 login # OAuth device flow (browser)
35
35
  ```
36
36
 
37
37
  The key can also be supplied via the `CUEFRAME_API_KEY` environment variable.
@@ -39,47 +39,53 @@ The key can also be supplied via the `CUEFRAME_API_KEY` environment variable.
39
39
  ## Check your connection
40
40
 
41
41
  ```bash
42
- npx -y cueframe@0.11 api GET /v1/me --json
42
+ npx -y cueframe@0.12 api GET /v1/me --json
43
43
  ```
44
44
 
45
45
  This reads your account and credit entitlements without rendering. Cloud processing and rendering consume credits; see [cloud rates](https://cueframe.ai/pricing).
46
46
 
47
+ For a bounded operation that needs a longer client wait, `api` accepts an explicit
48
+ `--timeout-ms <milliseconds>` integer from 1 to 2147483647. Omitting it preserves
49
+ the SDK default. This changes only the request wait; server deadlines and operation
50
+ outcomes remain authoritative. After a timeout, inspect the saved outcome before
51
+ retrying a write, and retain its original command identity.
52
+
47
53
  ## Quick start — upload → author → render
48
54
 
49
55
  To compare an exact certified reference frame with an existing composition preview:
50
56
 
51
57
  ```bash
52
- npx -y cueframe@0.11 compare <projectId> --reference-media <mediaId> --reference-representation <identity> --reference-frame 117 --candidate-job <jobId> --candidate-artifact <artifactId> --out ./comparison --json
58
+ npx -y cueframe@0.12 compare <projectId> --reference-media <mediaId> --reference-representation <identity> --reference-frame 117 --candidate-job <jobId> --candidate-artifact <artifactId> --out ./comparison --json
53
59
  ```
54
60
 
55
61
  This uses the shared comparison operation without rendering the composition again. The default views are side-by-side and an unaligned 50% overlay. Select `--views overlay,difference` or one shared-coordinate `--crop x,y,width,height` when useful. `--out` saves verified PNGs; NDJSON reports compact source and image receipts. Without `--out`, receipts describe the images but do not save them. These diagnostics do not replace motion or sound review.
56
62
 
57
63
  ```bash
58
64
  # 1. Register media (video / image / audio)
59
- npx -y cueframe@0.11 upload ./source.mp4 --json # → mediaItemId
65
+ npx -y cueframe@0.12 upload ./source.mp4 --json # → mediaItemId
60
66
 
61
67
  # 2. Create a project (sets aspect / format)
62
- npx -y cueframe@0.11 project create -n promo -a 9:16 --json # → projectId
68
+ npx -y cueframe@0.12 project create -n promo -a 9:16 --json # → projectId
63
69
 
64
70
  # 3. Author the composition — tracks of clips, per-clip reframe/trim,
65
71
  # optional captions. The composition is the source of truth. A put needs the
66
72
  # ETag your edit started from (`composition get`), or --create for the first one.
67
- npx -y cueframe@0.11 composition put <projectId> -b @composition.json --if-match <etag>
73
+ npx -y cueframe@0.12 composition put <projectId> -b @composition.json --if-match <etag>
68
74
 
69
75
  # 4. Render the saved composition to MP4 (queues, SSE-watches, downloads)
70
- npx -y cueframe@0.11 render <projectId> -o out.mp4 --json
76
+ npx -y cueframe@0.12 render <projectId> -o out.mp4 --json
71
77
  ```
72
78
 
73
79
  `render` takes only a project id and renders whatever composition is saved on
74
- it — no clip suggestion required. Run `npx -y cueframe@0.11 describe --json` for command arguments and options. See the [API reference](https://docs.cueframe.ai/docs/api) for composition fields.
80
+ it — no clip suggestion required. Run `npx -y cueframe@0.12 describe --json` for command arguments and options. See the [API reference](https://docs.cueframe.ai/docs/api) for composition fields.
75
81
 
76
82
  ## Let CueFrame pick the clip (podcast → short)
77
83
 
78
84
  ```bash
79
- npx -y cueframe@0.11 upload ./long.mp4 --analyze --json # media + AI clip suggestions
80
- npx -y cueframe@0.11 clips <mediaItemId> --json # list suggestions (sug_…)
81
- npx -y cueframe@0.11 project create -n short -a 9:16 --from-suggestion <sug_…> --json
82
- npx -y cueframe@0.11 render <projectId> -o short.mp4 --json
85
+ npx -y cueframe@0.12 upload ./long.mp4 --analyze --json # media + AI clip suggestions
86
+ npx -y cueframe@0.12 clips <mediaItemId> --json # list suggestions (sug_…)
87
+ npx -y cueframe@0.12 project create -n short -a 9:16 --from-suggestion <sug_…> --json
88
+ npx -y cueframe@0.12 render <projectId> -o short.mp4 --json
83
89
  ```
84
90
 
85
91
  Both paths converge on `render`; the suggestion on-ramp just authors the
@@ -93,10 +99,10 @@ The public catalog lives in `cueframe-ai/cueframe-templates`; your org keeps
93
99
  its own under `POST /v1/templates`.
94
100
 
95
101
  ```bash
96
- npx -y cueframe@0.11 template run yosemite-warp-text --preset granite --media source=sample --values text=CARVED -o carved.mp4
97
- npx -y cueframe@0.11 template run ./template.cueframe --media source=./clip.mp4 --values title="Journey" --no-render --json
98
- npx -y cueframe@0.11 template status <jobId> --wait --json # reconnect to a running preparation
99
- npx -y cueframe@0.11 template validate ./template.cueframe # on the API with your key; nothing is stored
102
+ npx -y cueframe@0.12 template run yosemite-warp-text --preset granite --media source=sample --values text=CARVED -o carved.mp4
103
+ npx -y cueframe@0.12 template run ./template.cueframe --media source=./clip.mp4 --values title="Journey" --no-render --json
104
+ npx -y cueframe@0.12 template status <jobId> --wait --json # reconnect to a running preparation
105
+ npx -y cueframe@0.12 template validate ./template.cueframe # on the API with your key; nothing is stored
100
106
  ```
101
107
 
102
108
  `run` publishes a local document to your org (a catalog slug is imported on
@@ -122,13 +128,13 @@ prepared matte at another bake version.
122
128
  ## Wire it into your agents
123
129
 
124
130
  ```bash
125
- npx -y cueframe@0.11 install
131
+ npx -y cueframe@0.12 install
126
132
  ```
127
133
 
128
134
  Detects supported local agents and adds `https://api.cueframe.ai/v1/mcp` to their configuration. It also copies the bundled skills to `~/.agents/skills` and `~/.claude/skills`, preserving locally changed skills by default. This can update multiple detected clients; inspect the changes first:
129
135
 
130
136
  ```bash
131
- npx -y cueframe@0.11 install --dry-run --json
137
+ npx -y cueframe@0.12 install --dry-run --json
132
138
  ```
133
139
 
134
140
  Restart your agent session after installation. Interactive MCP clients open a browser to authorize on the first call. ChatGPT uses its hosted connector setup separately; see the [connection guide](https://docs.cueframe.ai/docs/setup).
@@ -136,17 +142,17 @@ Restart your agent session after installation. Interactive MCP clients open a br
136
142
  ## For agents
137
143
 
138
144
  - **`--json`** — lifecycle events use NDJSON: `<verb>_prepare → <verb>_progress* → <verb>_complete | error`, plus a non-zero exit on failure.
139
- - **`npx -y cueframe@0.11 describe --json`** — the full command tree as structured JSON.
140
- - **`npx -y cueframe@0.11 api <METHOD> <path>`** — raw escape hatch over the v1 API.
145
+ - **`npx -y cueframe@0.12 describe --json`** — the full command tree as structured JSON.
146
+ - **`npx -y cueframe@0.12 api <METHOD> <path>`** — raw escape hatch over the v1 API.
141
147
 
142
148
  ## Common commands
143
149
 
144
150
  | Need to… | Command |
145
151
  |---|---|
146
- | List projects | `npx -y cueframe@0.11 list` |
147
- | Read a composition + ETag | `npx -y cueframe@0.11 composition get <projectId> --json` |
148
- | Write a composition | `npx -y cueframe@0.11 composition put <projectId> -b @comp.json --if-match <etag>` (`--create` for a project's first composition) |
149
- | Export to Final Cut / Premiere | `npx -y cueframe@0.11 export fcpxml \| premiere <projectId> -s <sug_…> --wait -o cut.zip` |
152
+ | List projects | `npx -y cueframe@0.12 list` |
153
+ | Read a composition + ETag | `npx -y cueframe@0.12 composition get <projectId> --json` |
154
+ | Write a composition | `npx -y cueframe@0.12 composition put <projectId> -b @comp.json --if-match <etag>` (`--create` for a project's first composition) |
155
+ | Export to Final Cut / Premiere | `npx -y cueframe@0.12 export fcpxml \| premiere <projectId> -s <sug_…> --wait -o cut.zip` |
150
156
  | Validate without mutating | use `--dry-run` where command help lists it |
151
157
 
152
158
  ## Render existing projects from a script
@@ -156,7 +162,7 @@ After authentication, render each saved project in sequence. This uses the exist
156
162
  ```bash
157
163
  set -e
158
164
  for project_id in "$@"; do
159
- npx -y cueframe@0.11 render "$project_id" -o "${project_id}.mp4" --json
165
+ npx -y cueframe@0.12 render "$project_id" -o "${project_id}.mp4" --json
160
166
  done
161
167
  ```
162
168
 
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{L as a}from"./chunk-JBQC3HBB.js";import"./chunk-3QSA3EBY.js";export{a as analyzeCommand};
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env node
2
- import{a as y}from"./chunk-3QSA3EBY.js";var u=class extends Error{status;code;details;requestId;constructor(t,r,n){super(r.message),this.name="ApiError",this.status=t,this.code=r.code,this.details=r.details,this.requestId=n}},v=class extends Error{url;timeoutMs;constructor(t,r){super(`Request timed out after ${r}ms: ${t}`),this.name="TimeoutError",this.url=t,this.timeoutMs=r}},q=class extends Error{url;constructor(t,r){super(`Request failed before a response: ${t}`,{cause:r}),this.name="NetworkError",this.url=t}},g={baseUrl:""};function I(e){return g={timeoutMs:3e4,...e},g}function O(){return g}function ft(e,t){return/^https?:\/\//.test(t)?t:e.replace(/\/$/,"")+(t.startsWith("/")?t:`/${t}`)}async function j(e,t={}){if(!g.baseUrl)throw new Error("@cueframe/sdk: createClient({baseUrl}) must be called before issuing requests.");let r=g.fetch??fetch,n=ft(g.baseUrl,e),o=new Headers({accept:"application/json"});for(let[c,d]of Object.entries(g.headers??{}))o.set(c,d);t.headers&&new Headers(t.headers).forEach((c,d)=>o.set(d,c)),g.apiKey&&!o.has("authorization")&&o.set("authorization",`Bearer ${g.apiKey}`);let s=g.timeoutMs??3e4,i=new AbortController,p=setTimeout(()=>i.abort(),s),m=t.signal?AbortSignal.any([t.signal,i.signal]):i.signal;try{let c=await r(n,{...t,headers:o,signal:m}),d={};c.headers.forEach((b,x)=>{d[x.toLowerCase()]=b});let l=null;if(c.status!==204)if((c.headers.get("content-type")??"").includes("application/json"))try{l=await c.json()}catch{l=null}else l=await c.text();return{status:c.status,statusText:c.statusText,headers:d,body:l,requestId:d["x-request-id"]}}catch(c){throw t.signal?.aborted?c:i.signal.aborted?new v(n,s):new q(n,c)}finally{clearTimeout(p)}}async function a(e,t={}){let r=await j(e,t);if(r.status>=400){let n;throw r.body&&typeof r.body=="object"&&"error"in r.body?n=r.body.error??{code:"unknown",message:r.statusText}:n={code:"unknown",message:r.statusText},new u(r.status,n,r.requestId)}if(r.status!==204)return r.body}var mt={unauthorized:"The credential is invalid or expired for this target, or it belongs to a different environment. Re-authenticate the way you connected: reconnect the MCP server, run `cueframe login` in a terminal, or supply a current API key.",forbidden:"The credential's permissions don't cover this operation. The server message above names the exact missing ones and the `permissions` body that grants them; a key's permissions are fixed at creation, so this needs a NEW key, not a change to this one.",not_found:"No such resource in this org (cross-org access also reads as 404). Check the id, or enumerate with the matching list command/tool.",media_not_ready:"Media is still processing. Wait for the `media.transcribed` webhook or retry after ~30s.",suggestions_already_complete:"Suggestions already exist for this media item. To re-run, call DELETE /v1/media/:id/suggestions first to reset state.",precondition_required:"Fetch the resource with GET first to obtain its ETag, then resend the write with `If-Match: <etag>`. `cueframe composition get` returns one for you.",stale_etag:"Resource was modified since your last GET \u2014 `details.currentEtag` is the value to thread next. Re-GET (or run `cueframe composition get`) and rebase your edits before retrying.",conflict:"ETag mismatch \u2014 the resource was modified since your last GET. Re-fetch and merge before retrying.",media_in_use:"Media is referenced by other resources. See `details.projectIds` and `details.sessionIds` \u2014 remove those references before deleting.",session_in_use:"Session is referenced by a composition. See `details.projectIds` \u2014 remove those references before deleting.",render_not_cancellable:"Render is already in a terminal state (complete / error / cancelled) and cannot be cancelled.",rate_limited:"Rate limit exceeded. Back off using the `retry-after` response header.",invalid_composition:"Composition violates an invariant (see `details`). Common ones: clip_source_track_kind_mismatch, track_clips_overlap, transition_no_predecessor.",clip_not_found:"The clip suggestion publicId doesn't exist in this org. Run `cueframe clips <mediaItemId>` to enumerate valid sug_* ids.",service_unavailable:"The processing pipeline is temporarily unavailable. Retry shortly; if it persists, contact support@cueframe.ai with the requestId.",payment_required:"The request exceeds a billing limit. For generation, the estimated cost is over the per-call ceiling (see `details.estimateUsd` / `details.ceilingUsd`) \u2014 lower the requested duration or raise the ceiling."};function A(e){return e instanceof u?mt[e.code]??null:null}async function*ut(e,t,r){let n=O();if(!n?.baseUrl)throw new Error(`@cueframe/sdk: createClient({baseUrl}) must be called before ${t}.`);let o=n.baseUrl.replace(/\/$/,"")+e,s=new Headers({accept:"text/event-stream",...n.headers??{}});n.apiKey&&!s.has("authorization")&&s.set("authorization",`Bearer ${n.apiKey}`);let p=await(n.fetch??fetch)(o,{method:"GET",headers:s,signal:r.signal});if(!p.ok){let l;try{l=(await p.json()).error??{code:"unknown",message:p.statusText}}catch{l={code:"unknown",message:p.statusText}}throw new u(p.status,l,p.headers.get("x-request-id")??void 0)}if(!p.body)throw new Error("SSE response has no body");let m=p.body.getReader(),c=new TextDecoder("utf-8"),d="";try{for(;;){let{value:l,done:b}=await m.read();if(b)break;d+=c.decode(l,{stream:!0});let x=d.indexOf(`
2
+ import{a as y}from"./chunk-3QSA3EBY.js";var l=class extends Error{status;code;details;requestId;constructor(t,r,n){super(r.message),this.name="ApiError",this.status=t,this.code=r.code,this.details=r.details,this.requestId=n}},v=class extends Error{url;timeoutMs;constructor(t,r){super(`Request timed out after ${r}ms: ${t}`),this.name="TimeoutError",this.url=t,this.timeoutMs=r}},q=class extends Error{url;constructor(t,r){super(`Request failed before a response: ${t}`,{cause:r}),this.name="NetworkError",this.url=t}},g={baseUrl:""};function I(e){return g={timeoutMs:3e4,...e},g}function O(){return g}function ft(e,t){return/^https?:\/\//.test(t)?t:e.replace(/\/$/,"")+(t.startsWith("/")?t:`/${t}`)}async function j(e,t={}){if(!g.baseUrl)throw new Error("@cueframe/sdk: createClient({baseUrl}) must be called before issuing requests.");let r=g.fetch??fetch,n=ft(g.baseUrl,e),o=new Headers({accept:"application/json"});for(let[c,m]of Object.entries(g.headers??{}))o.set(c,m);t.headers&&new Headers(t.headers).forEach((c,m)=>o.set(m,c)),g.apiKey&&!o.has("authorization")&&o.set("authorization",`Bearer ${g.apiKey}`);let s=g.timeoutMs??3e4,i=new AbortController,p=setTimeout(()=>i.abort(),s),d=t.signal?AbortSignal.any([t.signal,i.signal]):i.signal;try{let c=await r(n,{...t,headers:o,signal:d}),m={};c.headers.forEach((b,x)=>{m[x.toLowerCase()]=b});let u=null;if(c.status!==204)if((c.headers.get("content-type")??"").includes("application/json"))try{u=await c.json()}catch{u=null}else u=await c.text();return{status:c.status,statusText:c.statusText,headers:m,body:u,requestId:m["x-request-id"]}}catch(c){throw t.signal?.aborted?c:i.signal.aborted?new v(n,s):new q(n,c)}finally{clearTimeout(p)}}async function a(e,t={}){let r=await j(e,t);if(r.status>=400){let n;throw r.body&&typeof r.body=="object"&&"error"in r.body?n=r.body.error??{code:"unknown",message:r.statusText}:n={code:"unknown",message:r.statusText},new l(r.status,n,r.requestId)}if(r.status!==204)return r.body}var dt={unauthorized:"The credential is invalid or expired for this target, or it belongs to a different environment. Re-authenticate the way you connected: reconnect the MCP server, run `cueframe login` in a terminal, or supply a current API key.",forbidden:"The credential's permissions don't cover this operation. The server message above names the exact missing ones and the `permissions` body that grants them; a key's permissions are fixed at creation, so this needs a NEW key, not a change to this one.",not_found:"No such resource in this org (cross-org access also reads as 404). Check the id, or enumerate with the matching list command/tool.",media_not_ready:"Media is still processing. Wait for the `media.transcribed` webhook or retry after ~30s.",suggestions_already_complete:"Suggestions already exist for this media item. To re-run, call DELETE /v1/media/:id/suggestions first to reset state.",precondition_required:"Fetch the resource with GET first to obtain its ETag, then resend the write with `If-Match: <etag>`. `cueframe composition get` returns one for you.",stale_etag:"Resource was modified since your last GET \u2014 `details.currentEtag` is the value to thread next. Re-GET (or run `cueframe composition get`) and rebase your edits before retrying.",conflict:"ETag mismatch \u2014 the resource was modified since your last GET. Re-fetch and merge before retrying.",media_in_use:"Media is referenced by other resources. See `details.projectIds` and `details.sessionIds` \u2014 remove those references before deleting.",session_in_use:"Session is referenced by a composition. See `details.projectIds` \u2014 remove those references before deleting.",render_not_cancellable:"Render is already in a terminal state (complete / error / cancelled) and cannot be cancelled.",rate_limited:"Rate limit exceeded. Back off using the `retry-after` response header.",invalid_composition:"Composition violates an invariant (see `details`). Common ones: clip_source_track_kind_mismatch, track_clips_overlap, transition_no_predecessor.",clip_not_found:"The clip suggestion publicId doesn't exist in this org. Run `cueframe clips <mediaItemId>` to enumerate valid sug_* ids.",service_unavailable:"The processing pipeline is temporarily unavailable. Retry shortly; if it persists, contact support@cueframe.ai with the requestId.",payment_required:"The request exceeds a billing limit. For generation, the estimated cost is over the per-call ceiling (see `details.estimateUsd` / `details.ceilingUsd`) \u2014 lower the requested duration or raise the ceiling."};function A(e){return e instanceof l?dt[e.code]??null:null}async function*lt(e,t,r){let n=O();if(!n?.baseUrl)throw new Error(`@cueframe/sdk: createClient({baseUrl}) must be called before ${t}.`);let o=n.baseUrl.replace(/\/$/,"")+e,s=new Headers({accept:"text/event-stream",...n.headers??{}});n.apiKey&&!s.has("authorization")&&s.set("authorization",`Bearer ${n.apiKey}`);let p=await(n.fetch??fetch)(o,{method:"GET",headers:s,signal:r.signal});if(!p.ok){let u;try{u=(await p.json()).error??{code:"unknown",message:p.statusText}}catch{u={code:"unknown",message:p.statusText}}throw new l(p.status,u,p.headers.get("x-request-id")??void 0)}if(!p.body)throw new Error("SSE response has no body");let d=p.body.getReader(),c=new TextDecoder("utf-8"),m="";try{for(;;){let{value:u,done:b}=await d.read();if(b)break;m+=c.decode(u,{stream:!0});let x=m.indexOf(`
3
3
 
4
- `);for(;x!==-1;){let dt=d.slice(0,x);d=d.slice(x+2);let N=lt(dt);N&&(yield N),x=d.indexOf(`
4
+ `);for(;x!==-1;){let mt=m.slice(0,x);m=m.slice(x+2);let B=ut(mt);B&&(yield B),x=m.indexOf(`
5
5
 
6
- `)}}}finally{try{m.releaseLock()}catch{}}}function lt(e){if(!e.trim())return null;let t=null,r=[];for(let n of e.split(`
6
+ `)}}}finally{try{d.releaseLock()}catch{}}}function ut(e){if(!e.trim())return null;let t=null,r=[];for(let n of e.split(`
7
7
  `)){if(!n||n.startsWith(":"))continue;let o=n.indexOf(":");if(o===-1)continue;let s=n.slice(0,o),i=n.slice(o+1).replace(/^ /,"");s==="event"?t=i:s==="data"&&r.push(i)}return!t||r.length===0?null:{event:t,data:r.join(`
8
- `)}}async function*gt(e,t,r={}){let n=`/v1/projects/${encodeURIComponent(e)}/renders/${encodeURIComponent(t)}/stream`;for await(let o of ut(n,"iterRenderEvents",r)){let s=yt(o);s&&(yield s)}}function yt(e){let{event:t,data:r}=e;if(r===null||t!=="progress"&&t!=="complete"&&t!=="error")return null;let n;try{n=JSON.parse(r)}catch{return null}return{event:t,data:n}}var P={};y(P,{composeFromSuggestion:()=>ht,getComposeFromSuggestionUrl:()=>L,getListMediaSuggestionsUrl:()=>G,getResetMediaSuggestionsUrl:()=>F,getSuggestBriefsUrl:()=>$,listMediaSuggestions:()=>vt,resetMediaSuggestions:()=>Et,suggestBriefs:()=>qt});var L=e=>`/v1/projects/${e}/composition/from-suggestion`,ht=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(L(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},G=(e,t)=>{let r=new URLSearchParams;Object.entries(t||{}).forEach(([o,s])=>{s!==void 0&&r.append(o,s===null?"null":String(s))});let n=r.toString();return n.length>0?`/v1/media/${e}/suggestions?${n}`:`/v1/media/${e}/suggestions`},vt=async(e,t,r)=>a(G(e,t),{...r,method:"GET"}),$=e=>`/v1/media/${e}/suggestions`,qt=async(e,t)=>a($(e),{...t,method:"POST"}),F=e=>`/v1/media/${e}/suggestions`,Et=async(e,t)=>a(F(e),{...t,method:"DELETE"});var Z={};y(Z,{createComponent:()=>jt,getBlankComponentSource:()=>Tt,getComponent:()=>Mt,getComponentSource:()=>Ut,getCreateComponentUrl:()=>V,getGetBlankComponentSourceUrl:()=>H,getGetComponentSourceUrl:()=>Y,getGetComponentUrl:()=>X,getListCatalogUrl:()=>D,getPatchComponentUrl:()=>z,getRepinComponentUrl:()=>_,getResolveBuiltinComponentUrl:()=>J,getUpdateComponentUrl:()=>W,listCatalog:()=>Ot,patchComponent:()=>wt,repinComponent:()=>kt,resolveBuiltinComponent:()=>It,updateComponent:()=>At});var _=e=>`/v1/projects/${e}/components/native-upgrade`,kt=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(_(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},H=()=>"/v1/components/blank-source",Tt=async e=>a(H(),{...e,method:"GET"}),J=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([n,o])=>{o!==void 0&&t.append(n,o===null?"null":String(o))});let r=t.toString();return r.length>0?`/v1/components/builtin/resolve?${r}`:"/v1/components/builtin/resolve"},It=async(e,t)=>a(J(e),{...t,method:"GET"}),D=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([n,o])=>{o!==void 0&&t.append(n,o===null?"null":String(o))});let r=t.toString();return r.length>0?`/v1/components?${r}`:"/v1/components"},Ot=async(e,t)=>a(D(e),{...t,method:"GET"}),V=()=>"/v1/components",jt=async(e,t)=>{let r=n=>{if(!n)return{};if(n instanceof Headers)return Object.fromEntries(n.entries());if(Symbol.iterator in n)return Object.fromEntries(Array.from(n,s=>Array.from(s)));let o={};for(let[s,i]of Object.entries(n))i!==void 0&&(o[s]=i);return o};return a(V(),{...t,method:"POST",headers:{"Content-Type":"application/json",...r(t?.headers)},body:JSON.stringify(e)})},W=e=>`/v1/components/${e}`,At=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(W(e),{...r,method:"PUT",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},z=e=>`/v1/components/${e}`,wt=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(z(e),{...r,method:"PATCH",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},X=e=>`/v1/components/${e}`,Mt=async(e,t)=>a(X(e),{...t,method:"GET"}),Y=(e,t)=>{let r=new URLSearchParams;Object.entries(t||{}).forEach(([o,s])=>{s!==void 0&&r.append(o,s===null?"null":String(s))});let n=r.toString();return n.length>0?`/v1/components/${e}/source?${n}`:`/v1/components/${e}/source`},Ut=async(e,t,r)=>a(Y(e,t),{...r,method:"GET"});var se={};y(se,{cancelExport:()=>Wt,createFcpxmlExport:()=>_t,createPremiereExport:()=>Ht,createVideoClipExport:()=>Jt,getCancelExportUrl:()=>ne,getCreateFcpxmlExportUrl:()=>Q,getCreatePremiereExportUrl:()=>ee,getCreateVideoClipExportUrl:()=>te,getExport:()=>Vt,getGetExportUrl:()=>oe,getRetryExportUrl:()=>re,retryExport:()=>Dt});var Q=e=>`/v1/projects/${e}/exports/fcpxml`,_t=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(Q(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},ee=e=>`/v1/projects/${e}/exports/premiere`,Ht=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(ee(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},te=e=>`/v1/projects/${e}/exports/videoClip`,Jt=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(te(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},re=(e,t)=>`/v1/projects/${e}/exports/${t}/retry`,Dt=async(e,t,r)=>a(re(e,t),{...r,method:"POST"}),oe=(e,t)=>`/v1/projects/${e}/exports/${t}`,Vt=async(e,t,r)=>a(oe(e,t),{...r,method:"GET"}),ne=(e,t)=>`/v1/projects/${e}/exports/${t}/cancel`,Wt=async(e,t,r)=>a(ne(e,t),{...r,method:"POST"});var Te={};y(Te,{analyzeTimeline:()=>Cr,analyzeTranscript:()=>Rr,cancelHostedProcessingRun:()=>rr,createMediaUpload:()=>nr,createUploadToken:()=>or,deleteMedia:()=>cr,finalizeMedia:()=>ir,generateMedia:()=>ar,getAnalyzeTimelineUrl:()=>ke,getAnalyzeTranscriptUrl:()=>Ee,getCancelHostedProcessingRunUrl:()=>de,getCreateMediaUploadUrl:()=>me,getCreateUploadTokenUrl:()=>fe,getDeleteMediaUrl:()=>xe,getFinalizeMediaUrl:()=>le,getGenerateMediaUrl:()=>ge,getGetHostedProcessingArtifactUrl:()=>ce,getGetHostedProcessingRunUrl:()=>pe,getGetMediaContextUrl:()=>Pe,getGetMediaDownloadUrlUrl:()=>Ce,getGetMediaTranscriptUrl:()=>be,getGetMediaUrl:()=>Re,getHostedProcessingArtifact:()=>tr,getHostedProcessingRun:()=>er,getImportMediaUrl:()=>ye,getListMediaFactsUrl:()=>ve,getListMediaUrl:()=>ue,getMedia:()=>dr,getMediaContext:()=>ur,getMediaDownloadUrl:()=>fr,getMediaTranscript:()=>mr,getPurchaseMediaFactUrl:()=>qe,getSearchLibraryUrl:()=>ie,getStartHostedProcessingRunUrl:()=>ae,getTriggerMatteBakeUrl:()=>he,getTriggerSubjectDetectionUrl:()=>Se,importMedia:()=>pr,listMedia:()=>sr,listMediaFacts:()=>yr,purchaseMediaFact:()=>xr,searchLibrary:()=>Zt,startHostedProcessingRun:()=>Qt,triggerMatteBake:()=>gr,triggerSubjectDetection:()=>lr});var ie=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([n,o])=>{let s=["mediaId"];if(Array.isArray(o)&&s.includes(n)){o.forEach(i=>{t.append(n,i===null?"null":String(i))});return}o!==void 0&&t.append(n,o===null?"null":String(o))});let r=t.toString();return r.length>0?`/v1/media/search?${r}`:"/v1/media/search"},Zt=async(e,t)=>a(ie(e),{...t,method:"GET"}),ae=e=>`/v1/media/${e}/processing-runs`,Qt=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(ae(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},pe=(e,t)=>`/v1/media/${e}/processing-runs/${t}`,er=async(e,t,r)=>a(pe(e,t),{...r,method:"GET"}),ce=(e,t,r)=>`/v1/media/${e}/processing-runs/${t}/artifacts/${r}`,tr=async(e,t,r,n)=>a(ce(e,t,r),{...n,method:"GET"}),de=(e,t)=>`/v1/media/${e}/processing-runs/${t}/cancel`,rr=async(e,t,r)=>a(de(e,t),{...r,method:"POST"}),fe=()=>"/v1/uploads/token",or=async(e,t)=>{let r=n=>{if(!n)return{};if(n instanceof Headers)return Object.fromEntries(n.entries());if(Symbol.iterator in n)return Object.fromEntries(Array.from(n,s=>Array.from(s)));let o={};for(let[s,i]of Object.entries(n))i!==void 0&&(o[s]=i);return o};return a(fe(),{...t,method:"POST",headers:{"Content-Type":"application/json",...r(t?.headers)},body:JSON.stringify(e)})},me=()=>"/v1/media",nr=async(e,t)=>{let r=n=>{if(!n)return{};if(n instanceof Headers)return Object.fromEntries(n.entries());if(Symbol.iterator in n)return Object.fromEntries(Array.from(n,s=>Array.from(s)));let o={};for(let[s,i]of Object.entries(n))i!==void 0&&(o[s]=i);return o};return a(me(),{...t,method:"POST",headers:{"Content-Type":"application/json",...r(t?.headers)},body:JSON.stringify(e)})},ue=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([n,o])=>{o!==void 0&&t.append(n,o===null?"null":String(o))});let r=t.toString();return r.length>0?`/v1/media?${r}`:"/v1/media"},sr=async(e,t)=>a(ue(e),{...t,method:"GET"}),le=e=>`/v1/media/${e}/finalize`,ir=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(le(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},ge=()=>"/v1/media/generate",ar=async(e,t)=>{let r=n=>{if(!n)return{};if(n instanceof Headers)return Object.fromEntries(n.entries());if(Symbol.iterator in n)return Object.fromEntries(Array.from(n,s=>Array.from(s)));let o={};for(let[s,i]of Object.entries(n))i!==void 0&&(o[s]=i);return o};return a(ge(),{...t,method:"POST",headers:{"Content-Type":"application/json",...r(t?.headers)},body:JSON.stringify(e)})},ye=()=>"/v1/media/import",pr=async(e,t)=>{let r=n=>{if(!n)return{};if(n instanceof Headers)return Object.fromEntries(n.entries());if(Symbol.iterator in n)return Object.fromEntries(Array.from(n,s=>Array.from(s)));let o={};for(let[s,i]of Object.entries(n))i!==void 0&&(o[s]=i);return o};return a(ye(),{...t,method:"POST",headers:{"Content-Type":"application/json",...r(t?.headers)},body:JSON.stringify(e)})},xe=e=>`/v1/media/${e}`,cr=async(e,t)=>a(xe(e),{...t,method:"DELETE"}),Re=(e,t)=>{let r=new URLSearchParams;Object.entries(t||{}).forEach(([o,s])=>{s!==void 0&&r.append(o,s===null?"null":String(s))});let n=r.toString();return n.length>0?`/v1/media/${e}?${n}`:`/v1/media/${e}`},dr=async(e,t,r)=>a(Re(e,t),{...r,method:"GET"}),Ce=(e,t)=>{let r=new URLSearchParams;Object.entries(t||{}).forEach(([o,s])=>{s!==void 0&&r.append(o,s===null?"null":String(s))});let n=r.toString();return n.length>0?`/v1/media/${e}/download-url?${n}`:`/v1/media/${e}/download-url`},fr=async(e,t,r)=>a(Ce(e,t),{...r,method:"GET"}),be=(e,t)=>{let r=new URLSearchParams;Object.entries(t||{}).forEach(([o,s])=>{s!==void 0&&r.append(o,s===null?"null":String(s))});let n=r.toString();return n.length>0?`/v1/media/${e}/transcript?${n}`:`/v1/media/${e}/transcript`},mr=async(e,t,r)=>a(be(e,t),{...r,method:"GET"}),Pe=(e,t)=>{let r=new URLSearchParams;Object.entries(t||{}).forEach(([o,s])=>{s!==void 0&&r.append(o,s===null?"null":String(s))});let n=r.toString();return n.length>0?`/v1/media/${e}/context?${n}`:`/v1/media/${e}/context`},ur=async(e,t,r)=>a(Pe(e,t),{...r,method:"GET"}),Se=(e,t)=>{let r=new URLSearchParams;Object.entries(t||{}).forEach(([o,s])=>{s!==void 0&&r.append(o,s===null?"null":String(s))});let n=r.toString();return n.length>0?`/v1/media/${e}/detect-subjects?${n}`:`/v1/media/${e}/detect-subjects`},lr=async(e,t,r)=>a(Se(e,t),{...r,method:"POST"}),he=e=>`/v1/media/${e}/matte`,gr=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(he(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},ve=(e,t)=>{let r=new URLSearchParams;Object.entries(t||{}).forEach(([o,s])=>{s!==void 0&&r.append(o,s===null?"null":String(s))});let n=r.toString();return n.length>0?`/v1/media/${e}/facts?${n}`:`/v1/media/${e}/facts`},yr=async(e,t,r)=>a(ve(e,t),{...r,method:"GET"}),qe=e=>`/v1/media/${e}/facts`,xr=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(qe(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},Ee=e=>`/v1/media/${e}/transcript/analyze`,Rr=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(Ee(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},ke=()=>"/v1/timeline-analysis",Cr=async(e,t)=>{let r=n=>{if(!n)return{};if(n instanceof Headers)return Object.fromEntries(n.entries());if(Symbol.iterator in n)return Object.fromEntries(Array.from(n,s=>Array.from(s)));let o={};for(let[s,i]of Object.entries(n))i!==void 0&&(o[s]=i);return o};return a(ke(),{...t,method:"POST",headers:{"Content-Type":"application/json",...r(t?.headers)},body:JSON.stringify(e)})};var Ue={};y(Ue,{createProject:()=>Pr,deleteProject:()=>vr,getCreateProjectUrl:()=>Oe,getDeleteProjectUrl:()=>we,getGetProjectContextUrl:()=>Me,getGetProjectUrl:()=>je,getListProjectsUrl:()=>Ie,getPatchProjectUrl:()=>Ae,getProject:()=>Sr,getProjectContext:()=>qr,listProjects:()=>br,patchProject:()=>hr});var Ie=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([n,o])=>{o!==void 0&&t.append(n,o===null?"null":String(o))});let r=t.toString();return r.length>0?`/v1/projects?${r}`:"/v1/projects"},br=async(e,t)=>a(Ie(e),{...t,method:"GET"}),Oe=()=>"/v1/projects",Pr=async(e,t)=>{let r=n=>{if(!n)return{};if(n instanceof Headers)return Object.fromEntries(n.entries());if(Symbol.iterator in n)return Object.fromEntries(Array.from(n,s=>Array.from(s)));let o={};for(let[s,i]of Object.entries(n))i!==void 0&&(o[s]=i);return o};return a(Oe(),{...t,method:"POST",headers:{"Content-Type":"application/json",...r(t?.headers)},body:JSON.stringify(e)})},je=e=>`/v1/projects/${e}`,Sr=async(e,t)=>a(je(e),{...t,method:"GET"}),Ae=e=>`/v1/projects/${e}`,hr=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(Ae(e),{...r,method:"PATCH",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},we=e=>`/v1/projects/${e}`,vr=async(e,t)=>a(we(e),{...t,method:"DELETE"}),Me=e=>`/v1/projects/${e}/context`,qr=async(e,t)=>a(Me(e),{...t,method:"GET"});var He={};y(He,{cancelRender:()=>Or,createRender:()=>Er,getCancelRenderUrl:()=>Ge,getCreateRenderUrl:()=>Ke,getGetRenderUrl:()=>Le,getListProjectRendersUrl:()=>Be,getPreviewClipUrl:()=>Ne,getRefreshRenderUrlUrl:()=>Fe,getRender:()=>Ir,getRetryRenderUrl:()=>$e,getStreamRenderUrl:()=>_e,listProjectRenders:()=>kr,previewClip:()=>Tr,refreshRenderUrl:()=>Ar,retryRender:()=>jr,streamRender:()=>wr});var Ke=e=>`/v1/projects/${e}/renders`,Er=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(Ke(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},Be=(e,t)=>{let r=new URLSearchParams;Object.entries(t||{}).forEach(([o,s])=>{s!==void 0&&r.append(o,s===null?"null":String(s))});let n=r.toString();return n.length>0?`/v1/projects/${e}/renders?${n}`:`/v1/projects/${e}/renders`},kr=async(e,t,r)=>a(Be(e,t),{...r,method:"GET"}),Ne=e=>`/v1/projects/${e}/preview-clip`,Tr=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(Ne(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},Le=(e,t)=>`/v1/projects/${e}/renders/${t}`,Ir=async(e,t,r)=>a(Le(e,t),{...r,method:"GET"}),Ge=(e,t)=>`/v1/projects/${e}/renders/${t}/cancel`,Or=async(e,t,r)=>a(Ge(e,t),{...r,method:"POST"}),$e=(e,t)=>`/v1/projects/${e}/renders/${t}/retry`,jr=async(e,t,r)=>a($e(e,t),{...r,method:"POST"}),Fe=(e,t)=>`/v1/projects/${e}/renders/${t}/refresh-url`,Ar=async(e,t,r)=>a(Fe(e,t),{...r,method:"POST"}),_e=(e,t)=>`/v1/projects/${e}/renders/${t}/stream`,wr=async(e,t,r)=>a(_e(e,t),{...r,method:"GET"});var Ze={};y(Ze,{cancelMuxJob:()=>$r,createSession:()=>Kr,deleteSession:()=>Nr,getCancelMuxJobUrl:()=>Ye,getCreateSessionUrl:()=>De,getDeleteSessionUrl:()=>We,getGetMuxJobUrl:()=>Xe,getGetSessionUrl:()=>Ve,getListSessionsUrl:()=>Je,getMuxJob:()=>Gr,getSession:()=>Br,getTriggerMuxJobUrl:()=>ze,listSessions:()=>Ur,triggerMuxJob:()=>Lr});var Je=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([n,o])=>{o!==void 0&&t.append(n,o===null?"null":String(o))});let r=t.toString();return r.length>0?`/v1/sessions?${r}`:"/v1/sessions"},Ur=async(e,t)=>a(Je(e),{...t,method:"GET"}),De=()=>"/v1/sessions",Kr=async(e,t)=>{let r=n=>{if(!n)return{};if(n instanceof Headers)return Object.fromEntries(n.entries());if(Symbol.iterator in n)return Object.fromEntries(Array.from(n,s=>Array.from(s)));let o={};for(let[s,i]of Object.entries(n))i!==void 0&&(o[s]=i);return o};return a(De(),{...t,method:"POST",headers:{"Content-Type":"application/json",...r(t?.headers)},body:JSON.stringify(e)})},Ve=e=>`/v1/sessions/${e}`,Br=async(e,t)=>a(Ve(e),{...t,method:"GET"}),We=e=>`/v1/sessions/${e}`,Nr=async(e,t)=>a(We(e),{...t,method:"DELETE"}),ze=e=>`/v1/sessions/${e}/mux-job`,Lr=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(ze(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},Xe=e=>`/v1/sessions/${e}/mux-job`,Gr=async(e,t)=>a(Xe(e),{...t,method:"GET"}),Ye=e=>`/v1/sessions/${e}/mux-job/cancel`,$r=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(Ye(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})};var Ci={"16:9":"16:9","9:16":"9:16","1:1":"1:1","4:5":"4:5"};var Pi={hd:"hd",fhd:"fhd","4k":"4k"};var la={preview:"preview",final:"final"};var ya={interactive:"interactive",standard:"standard",background:"background"};var Qe=[3,4],Vr={version:4,componentId:"blank-component",template:`<template><div id="root" data-composition-id="blank-component" data-width="1920" data-height="1080" data-no-timeline data-composition-variables='[{"id":"background","type":"color","label":"Background","default":"#101014"}]'><div data-cf-scene></div></div><script>
8
+ `)}}async function*gt(e,t,r={}){let n=`/v1/projects/${encodeURIComponent(e)}/renders/${encodeURIComponent(t)}/stream`;for await(let o of lt(n,"iterRenderEvents",r)){let s=yt(o);s&&(yield s)}}function yt(e){let{event:t,data:r}=e;if(r===null||t!=="progress"&&t!=="complete"&&t!=="error")return null;let n;try{n=JSON.parse(r)}catch{return null}return{event:t,data:n}}var P={};y(P,{composeFromSuggestion:()=>ht,getComposeFromSuggestionUrl:()=>G,getListMediaSuggestionsUrl:()=>L,getResetMediaSuggestionsUrl:()=>F,getSuggestBriefsUrl:()=>$,listMediaSuggestions:()=>vt,resetMediaSuggestions:()=>Et,suggestBriefs:()=>qt});var G=e=>`/v1/projects/${e}/composition/from-suggestion`,ht=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(G(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},L=(e,t)=>{let r=new URLSearchParams;Object.entries(t||{}).forEach(([o,s])=>{s!==void 0&&r.append(o,s===null?"null":String(s))});let n=r.toString();return n.length>0?`/v1/media/${e}/suggestions?${n}`:`/v1/media/${e}/suggestions`},vt=async(e,t,r)=>a(L(e,t),{...r,method:"GET"}),$=e=>`/v1/media/${e}/suggestions`,qt=async(e,t)=>a($(e),{...t,method:"POST"}),F=e=>`/v1/media/${e}/suggestions`,Et=async(e,t)=>a(F(e),{...t,method:"DELETE"});var Z={};y(Z,{createComponent:()=>jt,getBlankComponentSource:()=>kt,getComponent:()=>Mt,getComponentSource:()=>Ut,getCreateComponentUrl:()=>V,getGetBlankComponentSourceUrl:()=>H,getGetComponentSourceUrl:()=>X,getGetComponentUrl:()=>Y,getListCatalogUrl:()=>D,getPatchComponentUrl:()=>z,getRepinComponentUrl:()=>_,getResolveBuiltinComponentUrl:()=>J,getUpdateComponentUrl:()=>W,listCatalog:()=>Ot,patchComponent:()=>wt,repinComponent:()=>Tt,resolveBuiltinComponent:()=>It,updateComponent:()=>At});var _=e=>`/v1/projects/${e}/components/native-upgrade`,Tt=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(_(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},H=()=>"/v1/components/blank-source",kt=async e=>a(H(),{...e,method:"GET"}),J=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([n,o])=>{o!==void 0&&t.append(n,o===null?"null":String(o))});let r=t.toString();return r.length>0?`/v1/components/builtin/resolve?${r}`:"/v1/components/builtin/resolve"},It=async(e,t)=>a(J(e),{...t,method:"GET"}),D=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([n,o])=>{o!==void 0&&t.append(n,o===null?"null":String(o))});let r=t.toString();return r.length>0?`/v1/components?${r}`:"/v1/components"},Ot=async(e,t)=>a(D(e),{...t,method:"GET"}),V=()=>"/v1/components",jt=async(e,t)=>{let r=n=>{if(!n)return{};if(n instanceof Headers)return Object.fromEntries(n.entries());if(Symbol.iterator in n)return Object.fromEntries(Array.from(n,s=>Array.from(s)));let o={};for(let[s,i]of Object.entries(n))i!==void 0&&(o[s]=i);return o};return a(V(),{...t,method:"POST",headers:{"Content-Type":"application/json",...r(t?.headers)},body:JSON.stringify(e)})},W=e=>`/v1/components/${e}`,At=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(W(e),{...r,method:"PUT",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},z=e=>`/v1/components/${e}`,wt=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(z(e),{...r,method:"PATCH",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},Y=e=>`/v1/components/${e}`,Mt=async(e,t)=>a(Y(e),{...t,method:"GET"}),X=(e,t)=>{let r=new URLSearchParams;Object.entries(t||{}).forEach(([o,s])=>{s!==void 0&&r.append(o,s===null?"null":String(s))});let n=r.toString();return n.length>0?`/v1/components/${e}/source?${n}`:`/v1/components/${e}/source`},Ut=async(e,t,r)=>a(X(e,t),{...r,method:"GET"});var se={};y(se,{cancelExport:()=>Wt,createFcpxmlExport:()=>_t,createPremiereExport:()=>Ht,createVideoClipExport:()=>Jt,getCancelExportUrl:()=>ne,getCreateFcpxmlExportUrl:()=>Q,getCreatePremiereExportUrl:()=>ee,getCreateVideoClipExportUrl:()=>te,getExport:()=>Vt,getGetExportUrl:()=>oe,getRetryExportUrl:()=>re,retryExport:()=>Dt});var Q=e=>`/v1/projects/${e}/exports/fcpxml`,_t=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(Q(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},ee=e=>`/v1/projects/${e}/exports/premiere`,Ht=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(ee(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},te=e=>`/v1/projects/${e}/exports/videoClip`,Jt=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(te(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},re=(e,t)=>`/v1/projects/${e}/exports/${t}/retry`,Dt=async(e,t,r)=>a(re(e,t),{...r,method:"POST"}),oe=(e,t)=>`/v1/projects/${e}/exports/${t}`,Vt=async(e,t,r)=>a(oe(e,t),{...r,method:"GET"}),ne=(e,t)=>`/v1/projects/${e}/exports/${t}/cancel`,Wt=async(e,t,r)=>a(ne(e,t),{...r,method:"POST"});var ke={};y(ke,{analyzeTimeline:()=>Cr,analyzeTranscript:()=>Rr,cancelHostedProcessingRun:()=>rr,createMediaUpload:()=>nr,createUploadToken:()=>or,deleteMedia:()=>cr,finalizeMedia:()=>ir,generateMedia:()=>ar,getAnalyzeTimelineUrl:()=>Te,getAnalyzeTranscriptUrl:()=>Ee,getCancelHostedProcessingRunUrl:()=>me,getCreateMediaUploadUrl:()=>de,getCreateUploadTokenUrl:()=>fe,getDeleteMediaUrl:()=>xe,getFinalizeMediaUrl:()=>ue,getGenerateMediaUrl:()=>ge,getGetHostedProcessingArtifactUrl:()=>ce,getGetHostedProcessingRunUrl:()=>pe,getGetMediaContextUrl:()=>Pe,getGetMediaDownloadUrlUrl:()=>Ce,getGetMediaTranscriptUrl:()=>be,getGetMediaUrl:()=>Re,getHostedProcessingArtifact:()=>tr,getHostedProcessingRun:()=>er,getImportMediaUrl:()=>ye,getListMediaFactsUrl:()=>ve,getListMediaUrl:()=>le,getMedia:()=>mr,getMediaContext:()=>lr,getMediaDownloadUrl:()=>fr,getMediaTranscript:()=>dr,getPurchaseMediaFactUrl:()=>qe,getSearchLibraryUrl:()=>ie,getStartHostedProcessingRunUrl:()=>ae,getTriggerMatteBakeUrl:()=>he,getTriggerSubjectDetectionUrl:()=>Se,importMedia:()=>pr,listMedia:()=>sr,listMediaFacts:()=>yr,purchaseMediaFact:()=>xr,searchLibrary:()=>Zt,startHostedProcessingRun:()=>Qt,triggerMatteBake:()=>gr,triggerSubjectDetection:()=>ur});var ie=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([n,o])=>{let s=["mediaId"];if(Array.isArray(o)&&s.includes(n)){o.forEach(i=>{t.append(n,i===null?"null":String(i))});return}o!==void 0&&t.append(n,o===null?"null":String(o))});let r=t.toString();return r.length>0?`/v1/media/search?${r}`:"/v1/media/search"},Zt=async(e,t)=>a(ie(e),{...t,method:"GET"}),ae=e=>`/v1/media/${e}/processing-runs`,Qt=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(ae(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},pe=(e,t)=>`/v1/media/${e}/processing-runs/${t}`,er=async(e,t,r)=>a(pe(e,t),{...r,method:"GET"}),ce=(e,t,r)=>`/v1/media/${e}/processing-runs/${t}/artifacts/${r}`,tr=async(e,t,r,n)=>a(ce(e,t,r),{...n,method:"GET"}),me=(e,t)=>`/v1/media/${e}/processing-runs/${t}/cancel`,rr=async(e,t,r)=>a(me(e,t),{...r,method:"POST"}),fe=()=>"/v1/uploads/token",or=async(e,t)=>{let r=n=>{if(!n)return{};if(n instanceof Headers)return Object.fromEntries(n.entries());if(Symbol.iterator in n)return Object.fromEntries(Array.from(n,s=>Array.from(s)));let o={};for(let[s,i]of Object.entries(n))i!==void 0&&(o[s]=i);return o};return a(fe(),{...t,method:"POST",headers:{"Content-Type":"application/json",...r(t?.headers)},body:JSON.stringify(e)})},de=()=>"/v1/media",nr=async(e,t)=>{let r=n=>{if(!n)return{};if(n instanceof Headers)return Object.fromEntries(n.entries());if(Symbol.iterator in n)return Object.fromEntries(Array.from(n,s=>Array.from(s)));let o={};for(let[s,i]of Object.entries(n))i!==void 0&&(o[s]=i);return o};return a(de(),{...t,method:"POST",headers:{"Content-Type":"application/json",...r(t?.headers)},body:JSON.stringify(e)})},le=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([n,o])=>{o!==void 0&&t.append(n,o===null?"null":String(o))});let r=t.toString();return r.length>0?`/v1/media?${r}`:"/v1/media"},sr=async(e,t)=>a(le(e),{...t,method:"GET"}),ue=e=>`/v1/media/${e}/finalize`,ir=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(ue(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},ge=()=>"/v1/media/generate",ar=async(e,t)=>{let r=n=>{if(!n)return{};if(n instanceof Headers)return Object.fromEntries(n.entries());if(Symbol.iterator in n)return Object.fromEntries(Array.from(n,s=>Array.from(s)));let o={};for(let[s,i]of Object.entries(n))i!==void 0&&(o[s]=i);return o};return a(ge(),{...t,method:"POST",headers:{"Content-Type":"application/json",...r(t?.headers)},body:JSON.stringify(e)})},ye=()=>"/v1/media/import",pr=async(e,t)=>{let r=n=>{if(!n)return{};if(n instanceof Headers)return Object.fromEntries(n.entries());if(Symbol.iterator in n)return Object.fromEntries(Array.from(n,s=>Array.from(s)));let o={};for(let[s,i]of Object.entries(n))i!==void 0&&(o[s]=i);return o};return a(ye(),{...t,method:"POST",headers:{"Content-Type":"application/json",...r(t?.headers)},body:JSON.stringify(e)})},xe=e=>`/v1/media/${e}`,cr=async(e,t)=>a(xe(e),{...t,method:"DELETE"}),Re=(e,t)=>{let r=new URLSearchParams;Object.entries(t||{}).forEach(([o,s])=>{s!==void 0&&r.append(o,s===null?"null":String(s))});let n=r.toString();return n.length>0?`/v1/media/${e}?${n}`:`/v1/media/${e}`},mr=async(e,t,r)=>a(Re(e,t),{...r,method:"GET"}),Ce=(e,t)=>{let r=new URLSearchParams;Object.entries(t||{}).forEach(([o,s])=>{s!==void 0&&r.append(o,s===null?"null":String(s))});let n=r.toString();return n.length>0?`/v1/media/${e}/download-url?${n}`:`/v1/media/${e}/download-url`},fr=async(e,t,r)=>a(Ce(e,t),{...r,method:"GET"}),be=(e,t)=>{let r=new URLSearchParams;Object.entries(t||{}).forEach(([o,s])=>{s!==void 0&&r.append(o,s===null?"null":String(s))});let n=r.toString();return n.length>0?`/v1/media/${e}/transcript?${n}`:`/v1/media/${e}/transcript`},dr=async(e,t,r)=>a(be(e,t),{...r,method:"GET"}),Pe=(e,t)=>{let r=new URLSearchParams;Object.entries(t||{}).forEach(([o,s])=>{s!==void 0&&r.append(o,s===null?"null":String(s))});let n=r.toString();return n.length>0?`/v1/media/${e}/context?${n}`:`/v1/media/${e}/context`},lr=async(e,t,r)=>a(Pe(e,t),{...r,method:"GET"}),Se=(e,t)=>{let r=new URLSearchParams;Object.entries(t||{}).forEach(([o,s])=>{s!==void 0&&r.append(o,s===null?"null":String(s))});let n=r.toString();return n.length>0?`/v1/media/${e}/detect-subjects?${n}`:`/v1/media/${e}/detect-subjects`},ur=async(e,t,r)=>a(Se(e,t),{...r,method:"POST"}),he=e=>`/v1/media/${e}/matte`,gr=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(he(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},ve=(e,t)=>{let r=new URLSearchParams;Object.entries(t||{}).forEach(([o,s])=>{s!==void 0&&r.append(o,s===null?"null":String(s))});let n=r.toString();return n.length>0?`/v1/media/${e}/facts?${n}`:`/v1/media/${e}/facts`},yr=async(e,t,r)=>a(ve(e,t),{...r,method:"GET"}),qe=e=>`/v1/media/${e}/facts`,xr=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(qe(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},Ee=e=>`/v1/media/${e}/transcript/analyze`,Rr=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(Ee(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},Te=()=>"/v1/timeline-analysis",Cr=async(e,t)=>{let r=n=>{if(!n)return{};if(n instanceof Headers)return Object.fromEntries(n.entries());if(Symbol.iterator in n)return Object.fromEntries(Array.from(n,s=>Array.from(s)));let o={};for(let[s,i]of Object.entries(n))i!==void 0&&(o[s]=i);return o};return a(Te(),{...t,method:"POST",headers:{"Content-Type":"application/json",...r(t?.headers)},body:JSON.stringify(e)})};var Ue={};y(Ue,{createProject:()=>Pr,deleteProject:()=>vr,getCreateProjectUrl:()=>Oe,getDeleteProjectUrl:()=>we,getGetProjectContextUrl:()=>Me,getGetProjectUrl:()=>je,getListProjectsUrl:()=>Ie,getPatchProjectUrl:()=>Ae,getProject:()=>Sr,getProjectContext:()=>qr,listProjects:()=>br,patchProject:()=>hr});var Ie=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([n,o])=>{o!==void 0&&t.append(n,o===null?"null":String(o))});let r=t.toString();return r.length>0?`/v1/projects?${r}`:"/v1/projects"},br=async(e,t)=>a(Ie(e),{...t,method:"GET"}),Oe=()=>"/v1/projects",Pr=async(e,t)=>{let r=n=>{if(!n)return{};if(n instanceof Headers)return Object.fromEntries(n.entries());if(Symbol.iterator in n)return Object.fromEntries(Array.from(n,s=>Array.from(s)));let o={};for(let[s,i]of Object.entries(n))i!==void 0&&(o[s]=i);return o};return a(Oe(),{...t,method:"POST",headers:{"Content-Type":"application/json",...r(t?.headers)},body:JSON.stringify(e)})},je=e=>`/v1/projects/${e}`,Sr=async(e,t)=>a(je(e),{...t,method:"GET"}),Ae=e=>`/v1/projects/${e}`,hr=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(Ae(e),{...r,method:"PATCH",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},we=e=>`/v1/projects/${e}`,vr=async(e,t)=>a(we(e),{...t,method:"DELETE"}),Me=e=>`/v1/projects/${e}/context`,qr=async(e,t)=>a(Me(e),{...t,method:"GET"});var He={};y(He,{cancelRender:()=>jr,createRender:()=>Tr,getCancelRenderUrl:()=>Le,getCreateRenderUrl:()=>Ke,getGetRenderUrl:()=>Ge,getListProjectRendersUrl:()=>Ne,getPreviewClipUrl:()=>Be,getRefreshRenderUrlUrl:()=>Fe,getRender:()=>Or,getRetryRenderUrl:()=>$e,getStreamRenderUrl:()=>_e,listProjectRenders:()=>kr,previewClip:()=>Ir,refreshRenderUrl:()=>wr,retryRender:()=>Ar,streamRender:()=>Mr});var Ke=e=>`/v1/projects/${e}/renders`,Tr=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(Ke(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},Ne=(e,t)=>{let r=new URLSearchParams;Object.entries(t||{}).forEach(([o,s])=>{s!==void 0&&r.append(o,s===null?"null":String(s))});let n=r.toString();return n.length>0?`/v1/projects/${e}/renders?${n}`:`/v1/projects/${e}/renders`},kr=async(e,t,r)=>a(Ne(e,t),{...r,method:"GET"}),Be=e=>`/v1/projects/${e}/preview-clip`,Ir=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(Be(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},Ge=(e,t)=>`/v1/projects/${e}/renders/${t}`,Or=async(e,t,r)=>a(Ge(e,t),{...r,method:"GET"}),Le=(e,t)=>`/v1/projects/${e}/renders/${t}/cancel`,jr=async(e,t,r)=>a(Le(e,t),{...r,method:"POST"}),$e=(e,t)=>`/v1/projects/${e}/renders/${t}/retry`,Ar=async(e,t,r)=>a($e(e,t),{...r,method:"POST"}),Fe=(e,t)=>`/v1/projects/${e}/renders/${t}/refresh-url`,wr=async(e,t,r)=>a(Fe(e,t),{...r,method:"POST"}),_e=(e,t)=>`/v1/projects/${e}/renders/${t}/stream`,Mr=async(e,t,r)=>a(_e(e,t),{...r,method:"GET"});var Ze={};y(Ze,{cancelMuxJob:()=>Fr,createSession:()=>Nr,deleteSession:()=>Gr,getCancelMuxJobUrl:()=>Xe,getCreateSessionUrl:()=>De,getDeleteSessionUrl:()=>We,getGetMuxJobUrl:()=>Ye,getGetSessionUrl:()=>Ve,getListSessionsUrl:()=>Je,getMuxJob:()=>$r,getSession:()=>Br,getTriggerMuxJobUrl:()=>ze,listSessions:()=>Kr,triggerMuxJob:()=>Lr});var Je=e=>{let t=new URLSearchParams;Object.entries(e||{}).forEach(([n,o])=>{o!==void 0&&t.append(n,o===null?"null":String(o))});let r=t.toString();return r.length>0?`/v1/sessions?${r}`:"/v1/sessions"},Kr=async(e,t)=>a(Je(e),{...t,method:"GET"}),De=()=>"/v1/sessions",Nr=async(e,t)=>{let r=n=>{if(!n)return{};if(n instanceof Headers)return Object.fromEntries(n.entries());if(Symbol.iterator in n)return Object.fromEntries(Array.from(n,s=>Array.from(s)));let o={};for(let[s,i]of Object.entries(n))i!==void 0&&(o[s]=i);return o};return a(De(),{...t,method:"POST",headers:{"Content-Type":"application/json",...r(t?.headers)},body:JSON.stringify(e)})},Ve=e=>`/v1/sessions/${e}`,Br=async(e,t)=>a(Ve(e),{...t,method:"GET"}),We=e=>`/v1/sessions/${e}`,Gr=async(e,t)=>a(We(e),{...t,method:"DELETE"}),ze=e=>`/v1/sessions/${e}/mux-job`,Lr=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(ze(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})},Ye=e=>`/v1/sessions/${e}/mux-job`,$r=async(e,t)=>a(Ye(e),{...t,method:"GET"}),Xe=e=>`/v1/sessions/${e}/mux-job/cancel`,Fr=async(e,t,r)=>{let n=o=>{if(!o)return{};if(o instanceof Headers)return Object.fromEntries(o.entries());if(Symbol.iterator in o)return Object.fromEntries(Array.from(o,i=>Array.from(i)));let s={};for(let[i,p]of Object.entries(o))p!==void 0&&(s[i]=p);return s};return a(Xe(e),{...r,method:"POST",headers:{"Content-Type":"application/json",...n(r?.headers)},body:JSON.stringify(t)})};var ji={"16:9":"16:9","9:16":"9:16","1:1":"1:1","4:5":"4:5"};var wi={hd:"hd",fhd:"fhd","4k":"4k"};var Ua={preview:"preview",final:"final"};var Na={interactive:"interactive",standard:"standard",background:"background"};var Qe=[3,4],Wr={version:4,componentId:"blank-component",template:`<template><div id="root" data-composition-id="blank-component" data-width="1920" data-height="1080" data-no-timeline data-composition-variables='[{"id":"background","type":"color","label":"Background","default":"#101014"}]'><div data-cf-scene></div></div><script>
9
9
  const { h, MediaTileScene } = __cfScene;
10
10
  function Blank({ params }) {
11
11
  return h(MediaTileScene, { streams: {}, tiles: [], background: params.background ?? '#101014' });
12
12
  }
13
13
  __cfScene.mount({ root: document.getElementById('root'), component: Blank, variables: __hyperframes.getVariables() });
14
- </script></template>`,manifest:{version:4,runtime:"hyperframes",hfContract:1,kind:"scene",assets:{},graphics:{api:"webgl2",required:!0,accelerationPreference:"software-allowed"},alphaPolicy:"allows-opaque"},definition:{inputSchema:{type:"object",additionalProperties:!1,properties:{background:{type:"string",pattern:"^#[0-9a-fA-F]{6}$",default:"#101014",title:"Background"}}},defaults:{},brandBindings:[],timing:{defaultDuration:{frames:90,fps:30}},capabilities:[{kind:"clip"}]}};function Wr(e){return e.replace(/^W\//,"").replace(/-gzip(?=("?)$)/,"")}var E="X-CueFrame-Client";var zr=/^[A-Za-z0-9][A-Za-z0-9._+-]{0,31}$/,Xr=["web","console","clips"];function Yr(e,t){return Xr.includes(e)===(t==="browser")}function et(e){if(!zr.test(e.version))throw new Error(`${E} cannot carry the version ${JSON.stringify(e.version)}.`);if(!Yr(e.surface,e.os))throw new Error(`${E} cannot carry ${e.surface} on ${e.os}.`);return`${e.surface}/${e.version}/${e.os}`}function tt(e){return e==="darwin"?"macos":e==="win32"?"windows":e==="linux"?"linux":"unknown"}import{readFileSync as Zr,writeFileSync as Qr,mkdirSync as eo,existsSync as to}from"fs";import{join as rt}from"path";import{homedir as ro}from"os";var f={Success:0,UserError:2,ApiClientError:3,ApiServerError:4,NetworkError:5,PaymentRequired:6};function w(e){if(e instanceof u){if(e.status===402)return f.PaymentRequired;if(e.status>=500)return f.ApiServerError;if(e.status>=400)return f.ApiClientError}let t=e?.exitCode;return typeof t=="number"?t:f.NetworkError}function xv(e){return e===402?f.PaymentRequired:e>=500?f.ApiServerError:e>=400?f.ApiClientError:f.Success}function S(e){process.exit(e)}var ot=rt(ro(),".cueframe"),k=rt(ot,"auth.json"),R={local:"http://127.0.0.1:3211",prod:"https://api.cueframe.ai"},oo="prod";function hv(e=oo){return process.env.CUEFRAME_API_URL??R[e]??R.prod}var h=class extends Error{constructor(r,n){super(n);this.code=r;this.name="AuthStoreError"}code;exitCode=f.UserError};function vv(e){if(!/^cf_(?:live|test)_[A-Za-z0-9_-]{8,}$/.test(e))throw new h("auth_invalid","Invalid API key. Expected a key beginning with cf_live_ or cf_test_.")}function nt(){if(!to(k))return{targets:{}};let e=Zr(k,"utf-8");try{return JSON.parse(e)}catch{throw new h("auth_config_corrupt",`${k} is corrupt and cannot be parsed. Delete it and re-run \`cueframe login\`.`)}}function no(e){eo(ot,{recursive:!0,mode:448}),Qr(k,JSON.stringify(e,null,2),{mode:384})}function qv(e,t="prod",r){let n=nt(),o=R[t]??R.prod;n.targets[t]={apiKey:e,apiUrl:r??o},no(n)}function st(e="prod"){let t=process.env.CUEFRAME_API_KEY,r=process.env.CUEFRAME_API_URL;if(t)return{apiKey:t,apiUrl:r??R[e]??R.prod};let o=nt().targets[e];if(!o)throw new h("auth_missing",`No auth configured for target "${e}". Run \`cueframe login --target ${e}\` (browser sign-in) or \`cueframe auth <api-key> --target ${e}\` (CI / headless).`);return o}function so(){return{[E]:et({surface:"cli",version:"0.11.4",os:tt(process.platform)})}}function it(e,t={}){let{apiKey:r,apiUrl:n}=st(e);I({baseUrl:n,apiKey:r,headers:so(),...t})}function T(e){let t=e instanceof u?`${e.message} (${e.code}${e.status?`, ${e.status}`:""})`:e instanceof Error?e.message:String(e),r=A(e);return r?`${t}
15
- \u2192 ${r}`:t}import io from"ora";import ao from"pino";var po="v1",at=ao({level:"trace",base:{schemaVersion:po},messageKey:"event",timestamp:()=>`,"ts":${Date.now()}`,formatters:{level:()=>({_:0})}});function M(e,t){return io({text:e,isSilent:!!t}).start()}function C(e,t,r={}){e.json&&at.info(r,t)}function Mv(e,t,r){if(e.json){console.log(JSON.stringify(t,null,2));return}r()}function U(e,t,r,n){let o=r instanceof Error?r.message:String(r),s=typeof r?.code=="string"?r.code:void 0,i=r?.status;e.json?at.info({phase:t,message:o,...s?{code:s}:{},...typeof i=="number"?{status:i}:{},exitCode:n},"error"):process.stderr.write(`\u2716 ${t}: ${T(r)}
16
- `)}function K(e,t,r,n){e.json&&U(e,t,r,n)}function Uv(e,t){t.json||console.log(e)}function co(e){for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r<=31||r===127)return!0}return!1}function ct(e,t,r){e.length===0&&pt(`${t} is empty.`,r),co(e)&&pt(`${t} contains a control character (newline, tab, or null byte). Identifiers must be plain text \u2014 check for a stray copy-paste artifact.`,r)}function pt(e,t){U(t,"preflight",new Error(e),f.UserError),S(f.UserError)}var fo=5e3,B=300*1e3;async function Jv(e,t){if(ct(e,"mediaItemId",t),t.dryRun){C(t,"analyze_dry_run",{mediaItemId:e,target:t.target,wait:!!t.wait,wouldCall:"POST /v1/media/:id/suggestions"}),t.json||console.log(`[dry-run] Would trigger clip analysis for ${e} on ${t.target}.`);return}it(t.target),C(t,"analyze_prepare",{mediaItemId:e,target:t.target,wait:!!t.wait});let r=M("Triggering clip analysis\u2026",t.json),n;try{n=await P.suggestBriefs(e),r.succeed(`Analysis ${n.alreadyRunning?"already running":"started"}`)}catch(i){r.fail(`Failed to start analysis: ${T(i)}`),K(t,"analyze_prepare",i,w(i)),S(w(i))}if(C(t,"analyze_ready",{mediaItemId:e,status:n.status,alreadyRunning:!!n.alreadyRunning}),!t.wait){t.json||console.log(`
17
- Run \`cueframe clips ${e}\` to check results.`);return}let o=M("Waiting for analysis to complete\u2026",t.json),s=Date.now();for(;;){await new Promise(i=>setTimeout(i,fo)),Date.now()-s>B&&(o.fail(`Timed out after ${Math.round(B/1e3)}s. Run \`cueframe clips ${e}\` to check later.`),K(t,"analyze_progress",new Error(`Analysis did not complete within ${Math.round(B/1e3)}s`),f.UserError),S(f.UserError));try{let i=await P.listMediaSuggestions(e);if(i.suggestions.length>0){o.succeed(`Analysis complete \u2014 ${i.suggestions.length} clips found`),C(t,"analyze_complete",{mediaItemId:e,durationMs:Date.now()-s,suggestionCount:i.suggestions.length,suggestions:i.suggestions}),t.json||i.suggestions.forEach((m,c)=>{let d=(m.trim.end-m.trim.start).toFixed(1);console.log(`
18
- ${c+1}. ${m.title} (${m.id})`),console.log(` ${m.trim.start.toFixed(1)}s \u2013 ${m.trim.end.toFixed(1)}s (${d}s) score: ${m.score}`),console.log(` ${m.reason}`)});return}let p=Math.round((Date.now()-s)/1e3);o.text=`Waiting for analysis\u2026 (${p}s)`,C(t,"analyze_progress",{mediaItemId:e,elapsedSec:p})}catch{}}}export{u as a,I as b,j as c,a as d,A as e,gt as f,P as g,Z as h,se as i,Te as j,Ue as k,He as l,Ze as m,Ci as n,Pi as o,la as p,ya as q,Qe as r,Vr as s,Wr as t,f as u,w as v,xv as w,S as x,hv as y,vv as z,qv as A,so as B,it as C,T as D,M as E,C as F,Mv as G,U as H,K as I,Uv as J,ct as K,Jv as L};
14
+ </script></template>`,manifest:{version:4,runtime:"hyperframes",hfContract:1,kind:"scene",assets:{},graphics:{api:"webgl2",required:!0,accelerationPreference:"software-allowed"},alphaPolicy:"allows-opaque"},definition:{inputSchema:{type:"object",additionalProperties:!1,properties:{background:{type:"string",pattern:"^#[0-9a-fA-F]{6}$",default:"#101014",title:"Background"}}},defaults:{},brandBindings:[],timing:{defaultDuration:{frames:90,fps:30}},capabilities:[{kind:"clip"}]}};function zr(e){return e.replace(/^W\//,"").replace(/-gzip(?=("?)$)/,"")}var E="X-CueFrame-Client";var Yr=/^[A-Za-z0-9][A-Za-z0-9._+-]{0,31}$/,Xr=["web","console","clips"];function Zr(e,t){return Xr.includes(e)===(t==="browser")}function et(e){if(!Yr.test(e.version))throw new Error(`${E} cannot carry the version ${JSON.stringify(e.version)}.`);if(!Zr(e.surface,e.os))throw new Error(`${E} cannot carry ${e.surface} on ${e.os}.`);return`${e.surface}/${e.version}/${e.os}`}function tt(e){return e==="darwin"?"macos":e==="win32"?"windows":e==="linux"?"linux":"unknown"}import{readFileSync as Qr,writeFileSync as eo,mkdirSync as to,existsSync as ro}from"fs";import{join as rt}from"path";import{homedir as oo}from"os";var f={Success:0,UserError:2,ApiClientError:3,ApiServerError:4,NetworkError:5,PaymentRequired:6};function w(e){if(e instanceof l){if(e.status===402)return f.PaymentRequired;if(e.status>=500)return f.ApiServerError;if(e.status>=400)return f.ApiClientError}let t=e?.exitCode;return typeof t=="number"?t:f.NetworkError}function lT(e){return e===402?f.PaymentRequired:e>=500?f.ApiServerError:e>=400?f.ApiClientError:f.Success}function S(e){process.exit(e)}var ot=rt(oo(),".cueframe"),T=rt(ot,"auth.json"),R={local:"http://127.0.0.1:3211",prod:"https://api.cueframe.ai"},no="prod";function CT(e=no){return process.env.CUEFRAME_API_URL??R[e]??R.prod}var h=class extends Error{constructor(r,n){super(n);this.code=r;this.name="AuthStoreError"}code;exitCode=f.UserError};function bT(e){if(!/^cf_(?:live|test)_[A-Za-z0-9_-]{8,}$/.test(e))throw new h("auth_invalid","Invalid API key. Expected a key beginning with cf_live_ or cf_test_.")}function nt(){if(!ro(T))return{targets:{}};let e=Qr(T,"utf-8");try{return JSON.parse(e)}catch{throw new h("auth_config_corrupt",`${T} is corrupt and cannot be parsed. Delete it and re-run \`cueframe login\`.`)}}function so(e){to(ot,{recursive:!0,mode:448}),eo(T,JSON.stringify(e,null,2),{mode:384})}function PT(e,t="prod",r){let n=nt(),o=R[t]??R.prod;n.targets[t]={apiKey:e,apiUrl:r??o},so(n)}function st(e="prod"){let t=process.env.CUEFRAME_API_KEY,r=process.env.CUEFRAME_API_URL;if(t)return{apiKey:t,apiUrl:r??R[e]??R.prod};let o=nt().targets[e];if(!o)throw new h("auth_missing",`No auth configured for target "${e}". Run \`cueframe login --target ${e}\` (browser sign-in) or \`cueframe auth <api-key> --target ${e}\` (CI / headless).`);return o}function io(){return{[E]:et({surface:"cli",version:"0.12.0",os:tt(process.platform)})}}function it(e,t={}){let{apiKey:r,apiUrl:n}=st(e);I({baseUrl:n,apiKey:r,headers:io(),...t})}function k(e){let t=e instanceof l?`${e.message} (${e.code}${e.status?`, ${e.status}`:""})`:e instanceof Error?e.message:String(e),r=A(e);return r?`${t}
15
+ \u2192 ${r}`:t}import ao from"ora";import po from"pino";var co="v1",at=po({level:"trace",base:{schemaVersion:co},messageKey:"event",timestamp:()=>`,"ts":${Date.now()}`,formatters:{level:()=>({_:0})}});function M(e,t){return ao({text:e,isSilent:!!t}).start()}function C(e,t,r={}){e.json&&at.info(r,t)}function OT(e,t,r){if(e.json){console.log(JSON.stringify(t,null,2));return}r()}function U(e,t,r,n){let o=r instanceof Error?r.message:String(r),s=typeof r?.code=="string"?r.code:void 0,i=r?.status;e.json?at.info({phase:t,message:o,...s?{code:s}:{},...typeof i=="number"?{status:i}:{},exitCode:n},"error"):process.stderr.write(`\u2716 ${t}: ${k(r)}
16
+ `)}function K(e,t,r,n){e.json&&U(e,t,r,n)}function jT(e,t){t.json||console.log(e)}function mo(e){for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r<=31||r===127)return!0}return!1}function ct(e,t,r){e.length===0&&pt(`${t} is empty.`,r),mo(e)&&pt(`${t} contains a control character (newline, tab, or null byte). Identifiers must be plain text \u2014 check for a stray copy-paste artifact.`,r)}function pt(e,t){U(t,"preflight",new Error(e),f.UserError),S(f.UserError)}var fo=5e3,N=300*1e3;async function $T(e,t){if(ct(e,"mediaItemId",t),t.dryRun){C(t,"analyze_dry_run",{mediaItemId:e,target:t.target,wait:!!t.wait,wouldCall:"POST /v1/media/:id/suggestions"}),t.json||console.log(`[dry-run] Would trigger clip analysis for ${e} on ${t.target}.`);return}it(t.target),C(t,"analyze_prepare",{mediaItemId:e,target:t.target,wait:!!t.wait});let r=M("Triggering clip analysis\u2026",t.json),n;try{n=await P.suggestBriefs(e),r.succeed(`Analysis ${n.alreadyRunning?"already running":"started"}`)}catch(i){r.fail(`Failed to start analysis: ${k(i)}`),K(t,"analyze_prepare",i,w(i)),S(w(i))}if(C(t,"analyze_ready",{mediaItemId:e,status:n.status,alreadyRunning:!!n.alreadyRunning}),!t.wait){t.json||console.log(`
17
+ Run \`cueframe clips ${e}\` to check results.`);return}let o=M("Waiting for analysis to complete\u2026",t.json),s=Date.now();for(;;){await new Promise(i=>setTimeout(i,fo)),Date.now()-s>N&&(o.fail(`Timed out after ${Math.round(N/1e3)}s. Run \`cueframe clips ${e}\` to check later.`),K(t,"analyze_progress",new Error(`Analysis did not complete within ${Math.round(N/1e3)}s`),f.UserError),S(f.UserError));try{let i=await P.listMediaSuggestions(e);if(i.suggestions.length>0){o.succeed(`Analysis complete \u2014 ${i.suggestions.length} clips found`),C(t,"analyze_complete",{mediaItemId:e,durationMs:Date.now()-s,suggestionCount:i.suggestions.length,suggestions:i.suggestions}),t.json||i.suggestions.forEach((d,c)=>{let m=(d.trim.end-d.trim.start).toFixed(1);console.log(`
18
+ ${c+1}. ${d.title} (${d.id})`),console.log(` ${d.trim.start.toFixed(1)}s \u2013 ${d.trim.end.toFixed(1)}s (${m}s) score: ${d.score}`),console.log(` ${d.reason}`)});return}let p=Math.round((Date.now()-s)/1e3);o.text=`Waiting for analysis\u2026 (${p}s)`,C(t,"analyze_progress",{mediaItemId:e,elapsedSec:p})}catch{}}}export{l as a,I as b,j as c,a as d,A as e,gt as f,P as g,Z as h,se as i,ke as j,Ue as k,He as l,Ze as m,ji as n,wi as o,Ua as p,Na as q,Qe as r,Wr as s,zr as t,f as u,w as v,lT as w,S as x,CT as y,bT as z,PT as A,io as B,it as C,k as D,M as E,C as F,OT as G,U as H,K as I,jT as J,ct as K,$T as L};