cueframe 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analyze-4EZTZEAG.js +2 -0
- package/dist/chunk-3QSA3EBY.js +2 -0
- package/dist/chunk-4FMFWW74.js +12 -0
- package/dist/cueframe.js +35 -31
- package/dist/supportedAgents.js +2 -0
- package/package.json +4 -3
- package/skills/add-music-bed/SKILL.md +105 -0
- package/skills/brand-reel/SKILL.md +105 -0
- package/skills/clip-a-talking-head/SKILL.md +97 -0
- package/skills/composing-video/SKILL.md +240 -16
- package/skills/cueframe-brand-demo/SKILL.md +3 -0
- package/skills/cueframe-cli/SKILL.md +1 -1
- package/skills/cueframe-component-authoring/SKILL.md +1 -1
- package/skills/cueframe-compose-loop/SKILL.md +3 -0
- package/skills/cueframe-storyboard/SKILL.md +3 -0
- package/skills/every-format-from-one-edit/SKILL.md +93 -0
- package/skills/extracting-brand-kits/SKILL.md +156 -0
- package/skills/launch-video/SKILL.md +97 -0
- package/skills/make-a-social-reel/SKILL.md +105 -0
- package/skills/rebrand-a-video/SKILL.md +101 -0
- package/skills/video-craft-standards/SKILL.md +119 -0
- package/dist/analyze-6ETMHDG5.js +0 -2
- package/dist/chunk-JHOJIRD5.js +0 -12
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as ee}from"./chunk-3QSA3EBY.js";var F=class extends Error{status;code;details;requestId;constructor(r,i,a){super(i.message),this.name="ApiError",this.status=r,this.code=i.code,this.details=i.details,this.requestId=a}},W={baseUrl:""};function Ue(n){return W={timeoutMs:3e4,...n},W}function Ke(){return W}function gt(n,r){return/^https?:\/\//.test(r)?r:n.replace(/\/$/,"")+(r.startsWith("/")?r:`/${r}`)}async function Qe(n,r={}){if(!W.baseUrl)throw new Error("@cueframe/sdk: createClient({baseUrl}) must be called before issuing requests.");let i=W.fetch??fetch,a=gt(W.baseUrl,n),d=new Headers({accept:"application/json"});for(let[T,K]of Object.entries(W.headers??{}))d.set(T,K);r.headers&&new Headers(r.headers).forEach((T,K)=>d.set(K,T)),W.apiKey&&!d.has("authorization")&&d.set("authorization",`Bearer ${W.apiKey}`);let c=new AbortController,l=setTimeout(()=>c.abort(),W.timeoutMs??3e4),f=r.signal??c.signal,b;try{b=await i(a,{...r,headers:d,signal:f})}finally{clearTimeout(l)}let S={};b.headers.forEach((T,K)=>{S[K.toLowerCase()]=T});let k=null;if(b.status!==204)if((b.headers.get("content-type")??"").includes("application/json"))try{k=await b.json()}catch{k=null}else k=await b.text();return{status:b.status,statusText:b.statusText,headers:S,body:k,requestId:S["x-request-id"]}}async function R(n,r={}){let i=await Qe(n,r);if(i.status>=400){let a;throw i.body&&typeof i.body=="object"&&"error"in i.body?a=i.body.error??{code:"unknown",message:i.statusText}:a={code:"unknown",message:i.statusText},new F(i.status,a,i.requestId)}if(i.status!==204)return i.body}var ht={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:"Upstream pipeline is unavailable. Retry shortly; if persistent, the worker is down \u2014 check status / ops dashboards.",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 Le(n){return n instanceof F?ht[n.code]??null:null}async function*zt(n,r,i){let a=Ke();if(!a?.baseUrl)throw new Error(`@cueframe/sdk: createClient({baseUrl}) must be called before ${r}.`);let d=a.baseUrl.replace(/\/$/,"")+n,c=new Headers({accept:"text/event-stream",...a.headers??{}});a.apiKey&&!c.has("authorization")&&c.set("authorization",`Bearer ${a.apiKey}`);let f=await(a.fetch??fetch)(d,{method:"GET",headers:c,signal:i.signal});if(!f.ok){let T;try{T=(await f.json()).error??{code:"unknown",message:f.statusText}}catch{T={code:"unknown",message:f.statusText}}throw new F(f.status,T,f.headers.get("x-request-id")??void 0)}if(!f.body)throw new Error("SSE response has no body");let b=f.body.getReader(),S=new TextDecoder("utf-8"),k="";try{for(;;){let{value:T,done:K}=await b.read();if(K)break;k+=S.decode(T,{stream:!0});let Q=k.indexOf(`
|
|
3
|
+
|
|
4
|
+
`);for(;Q!==-1;){let ft=k.slice(0,Q);k=k.slice(Q+2);let Ze=xt(ft);Ze&&(yield Ze),Q=k.indexOf(`
|
|
5
|
+
|
|
6
|
+
`)}}}finally{try{b.releaseLock()}catch{}}}function xt(n){if(!n.trim())return null;let r=null,i=[];for(let a of n.split(`
|
|
7
|
+
`)){if(!a||a.startsWith(":"))continue;let d=a.indexOf(":");if(d===-1)continue;let c=a.slice(0,d),l=a.slice(d+1).replace(/^ /,"");c==="event"?r=l:c==="data"&&i.push(l)}return!r||i.length===0?null:{event:r,data:i.join(`
|
|
8
|
+
`)}}async function*bt(n,r,i={}){let a=`/v1/projects/${encodeURIComponent(n)}/renders/${encodeURIComponent(r)}/stream`;for await(let d of zt(a,"iterRenderEvents",i)){let c=yt(d);c&&(yield c)}}function yt(n){let{event:r,data:i}=n;if(i===null||r!=="progress"&&r!=="complete"&&r!=="error")return null;let a;try{a=JSON.parse(i)}catch{return null}return{event:r,data:a}}var lo={};ee(lo,{createMediaUpload:()=>Ct,deleteMedia:()=>Ot,finalizeMedia:()=>vt,generateMedia:()=>It,getCreateMediaUploadUrl:()=>eo,getDeleteMediaUrl:()=>io,getFinalizeMediaUrl:()=>to,getGenerateMediaUrl:()=>ro,getGetMediaContextUrl:()=>po,getGetMediaPerformanceUrl:()=>mo,getGetMediaTranscriptUrl:()=>ao,getGetMediaUrl:()=>so,getImportMediaUrl:()=>no,getListMediaUrl:()=>oo,getMedia:()=>Mt,getMediaContext:()=>Bt,getMediaPerformance:()=>jt,getMediaTranscript:()=>wt,getTriggerSubjectDetectionUrl:()=>co,importMedia:()=>kt,listMedia:()=>Rt,triggerSubjectDetection:()=>Tt});var eo=()=>"/v1/media",Ct=async(n,r)=>R(eo(),{...r,method:"POST",headers:{"Content-Type":"application/json",...r?.headers},body:JSON.stringify(n)}),oo=()=>"/v1/media",Rt=async n=>R(oo(),{...n,method:"GET"}),to=n=>`/v1/media/${n}/finalize`,vt=async(n,r,i)=>R(to(n),{...i,method:"POST",headers:{"Content-Type":"application/json",...i?.headers},body:JSON.stringify(r)}),ro=()=>"/v1/media/generate",It=async(n,r)=>R(ro(),{...r,method:"POST",headers:{"Content-Type":"application/json",...r?.headers},body:JSON.stringify(n)}),no=()=>"/v1/media/import",kt=async(n,r)=>R(no(),{...r,method:"POST",headers:{"Content-Type":"application/json",...r?.headers},body:JSON.stringify(n)}),io=n=>`/v1/media/${n}`,Ot=async(n,r)=>R(io(n),{...r,method:"DELETE"}),so=n=>`/v1/media/${n}`,Mt=async(n,r)=>R(so(n),{...r,method:"GET"}),ao=n=>`/v1/media/${n}/transcript`,wt=async(n,r)=>R(ao(n),{...r,method:"GET"}),po=n=>`/v1/media/${n}/context`,Bt=async(n,r)=>R(po(n),{...r,method:"GET"}),co=n=>`/v1/media/${n}/detect-subjects`,Tt=async(n,r)=>R(co(n),{...r,method:"POST"}),mo=n=>`/v1/media/${n}/performance`,jt=async(n,r)=>R(mo(n),{...r,method:"GET"});var xo={};ee(xo,{createProject:()=>Pt,deleteProject:()=>qt,getCreateProjectUrl:()=>fo,getDeleteProjectUrl:()=>zo,getGetProjectUrl:()=>go,getListProjectsUrl:()=>uo,getPatchProjectUrl:()=>ho,getProject:()=>At,listProjects:()=>Et,patchProject:()=>_t});var uo=()=>"/v1/projects",Et=async n=>R(uo(),{...n,method:"GET"}),fo=()=>"/v1/projects",Pt=async(n,r)=>R(fo(),{...r,method:"POST",headers:{"Content-Type":"application/json",...r?.headers},body:JSON.stringify(n)}),go=n=>`/v1/projects/${n}`,At=async(n,r)=>R(go(n),{...r,method:"GET"}),ho=n=>`/v1/projects/${n}`,_t=async(n,r,i)=>R(ho(n),{...i,method:"PATCH",headers:{"Content-Type":"application/json",...i?.headers},body:JSON.stringify(r)}),zo=n=>`/v1/projects/${n}`,qt=async(n,r)=>R(zo(n),{...r,method:"DELETE"});var Oo={};ee(Oo,{cancelRender:()=>Ut,createRender:()=>Ft,getCancelRenderUrl:()=>Ro,getCreateRenderUrl:()=>bo,getGetRenderUrl:()=>Co,getListProjectRendersUrl:()=>yo,getPreviewClipUrl:()=>So,getRefreshRenderUrlUrl:()=>Io,getRender:()=>Nt,getRetryRenderUrl:()=>vo,getStreamRenderUrl:()=>ko,listProjectRenders:()=>Dt,previewClip:()=>Gt,refreshRenderUrl:()=>Lt,retryRender:()=>Kt,streamRender:()=>Wt});var bo=n=>`/v1/projects/${n}/renders`,Ft=async(n,r,i)=>R(bo(n),{...i,method:"POST",headers:{"Content-Type":"application/json",...i?.headers},body:JSON.stringify(r)}),yo=n=>`/v1/projects/${n}/renders`,Dt=async(n,r)=>R(yo(n),{...r,method:"GET"}),So=n=>`/v1/projects/${n}/preview-clip`,Gt=async(n,r,i)=>R(So(n),{...i,method:"POST",headers:{"Content-Type":"application/json",...i?.headers},body:JSON.stringify(r)}),Co=(n,r)=>`/v1/projects/${n}/renders/${r}`,Nt=async(n,r,i)=>R(Co(n,r),{...i,method:"GET"}),Ro=(n,r)=>`/v1/projects/${n}/renders/${r}/cancel`,Ut=async(n,r,i)=>R(Ro(n,r),{...i,method:"POST"}),vo=(n,r)=>`/v1/projects/${n}/renders/${r}/retry`,Kt=async(n,r,i)=>R(vo(n,r),{...i,method:"POST"}),Io=(n,r)=>`/v1/projects/${n}/renders/${r}/refresh-url`,Lt=async(n,r,i)=>R(Io(n,r),{...i,method:"POST"}),ko=(n,r)=>`/v1/projects/${n}/renders/${r}/stream`,Wt=async(n,r,i)=>R(ko(n,r),{...i,method:"GET"});var jo={};ee(jo,{cancelExport:()=>Yt,createFcpxmlExport:()=>Ht,createPremiereExport:()=>$t,getCancelExportUrl:()=>To,getCreateFcpxmlExportUrl:()=>Mo,getCreatePremiereExportUrl:()=>wo,getExport:()=>Vt,getGetExportUrl:()=>Bo});var Mo=n=>`/v1/projects/${n}/exports/fcpxml`,Ht=async(n,r,i)=>R(Mo(n),{...i,method:"POST",headers:{"Content-Type":"application/json",...i?.headers},body:JSON.stringify(r)}),wo=n=>`/v1/projects/${n}/exports/premiere`,$t=async(n,r,i)=>R(wo(n),{...i,method:"POST",headers:{"Content-Type":"application/json",...i?.headers},body:JSON.stringify(r)}),Bo=(n,r)=>`/v1/projects/${n}/exports/${r}`,Vt=async(n,r,i)=>R(Bo(n,r),{...i,method:"GET"}),To=(n,r)=>`/v1/projects/${n}/exports/${r}/cancel`,Yt=async(n,r,i)=>R(To(n,r),{...i,method:"POST"});var Do={};ee(Do,{createSession:()=>Qt,deleteSession:()=>or,getCreateSessionUrl:()=>Po,getDeleteSessionUrl:()=>_o,getGetMuxJobUrl:()=>Fo,getGetSessionUrl:()=>Ao,getListSessionsUrl:()=>Eo,getMuxJob:()=>rr,getSession:()=>er,getTriggerMuxJobUrl:()=>qo,listSessions:()=>Zt,triggerMuxJob:()=>tr});var Eo=()=>"/v1/sessions",Zt=async n=>R(Eo(),{...n,method:"GET"}),Po=()=>"/v1/sessions",Qt=async(n,r)=>R(Po(),{...r,method:"POST",headers:{"Content-Type":"application/json",...r?.headers},body:JSON.stringify(n)}),Ao=n=>`/v1/sessions/${n}`,er=async(n,r)=>R(Ao(n),{...r,method:"GET"}),_o=n=>`/v1/sessions/${n}`,or=async(n,r)=>R(_o(n),{...r,method:"DELETE"}),qo=n=>`/v1/sessions/${n}/mux-job`,tr=async(n,r)=>R(qo(n),{...r,method:"POST"}),Fo=n=>`/v1/sessions/${n}/mux-job`,rr=async(n,r)=>R(Fo(n),{...r,method:"GET"});var Wo={};ee(Wo,{createComponent:()=>ir,getComponent:()=>ar,getComponentSource:()=>dr,getCreateComponentUrl:()=>No,getGetComponentSourceUrl:()=>Lo,getGetComponentUrl:()=>Ko,getListCatalogUrl:()=>Go,getUpdateComponentUrl:()=>Uo,listCatalog:()=>nr,updateComponent:()=>sr});var Go=n=>{let r=new URLSearchParams;Object.entries(n||{}).forEach(([a,d])=>{d!==void 0&&r.append(a,d===null?"null":d.toString())});let i=r.toString();return i.length>0?`/v1/components?${i}`:"/v1/components"},nr=async(n,r)=>R(Go(n),{...r,method:"GET"}),No=()=>"/v1/components",ir=async(n,r)=>R(No(),{...r,method:"POST",headers:{"Content-Type":"application/json",...r?.headers},body:JSON.stringify(n)}),Uo=n=>`/v1/components/${n}`,sr=async(n,r,i)=>R(Uo(n),{...i,method:"PUT",headers:{"Content-Type":"application/json",...i?.headers},body:JSON.stringify(r)}),Ko=n=>`/v1/components/${n}`,ar=async(n,r)=>R(Ko(n),{...r,method:"GET"}),Lo=n=>`/v1/components/${n}/source`,dr=async(n,r)=>R(Lo(n),{...r,method:"GET"});var Te={};ee(Te,{composeFromSuggestion:()=>hr,getComposeFromSuggestionUrl:()=>Ho,getListMediaSuggestionsUrl:()=>$o,getResetMediaSuggestionsUrl:()=>Yo,getSuggestBriefsUrl:()=>Vo,listMediaSuggestions:()=>zr,resetMediaSuggestions:()=>br,suggestBriefs:()=>xr});var Ho=n=>`/v1/projects/${n}/composition/from-suggestion`,hr=async(n,r,i)=>R(Ho(n),{...i,method:"POST",headers:{"Content-Type":"application/json",...i?.headers},body:JSON.stringify(r)}),$o=n=>`/v1/media/${n}/suggestions`,zr=async(n,r)=>R($o(n),{...r,method:"GET"}),Vo=n=>`/v1/media/${n}/suggestions`,xr=async(n,r)=>R(Vo(n),{...r,method:"POST"}),Yo=n=>`/v1/media/${n}/suggestions`,br=async(n,r)=>R(Yo(n),{...r,method:"DELETE"});var nt={};ee(nt,{BRAND:()=>Zr,DIRTY:()=>ie,EMPTY_PATH:()=>Br,INVALID:()=>I,NEVER:()=>wn,OK:()=>P,ParseStatus:()=>E,Schema:()=>w,ZodAny:()=>re,ZodArray:()=>Z,ZodBigInt:()=>ae,ZodBoolean:()=>de,ZodBranded:()=>Ee,ZodCatch:()=>be,ZodDate:()=>pe,ZodDefault:()=>xe,ZodDiscriminatedUnion:()=>De,ZodEffects:()=>N,ZodEnum:()=>he,ZodError:()=>A,ZodFirstPartyTypeKind:()=>O,ZodFunction:()=>Ne,ZodIntersection:()=>ue,ZodIssueCode:()=>z,ZodLazy:()=>fe,ZodLiteral:()=>ge,ZodMap:()=>ke,ZodNaN:()=>Me,ZodNativeEnum:()=>ze,ZodNever:()=>L,ZodNull:()=>me,ZodNullable:()=>V,ZodNumber:()=>se,ZodObject:()=>_,ZodOptional:()=>D,ZodParsedType:()=>C,ZodPipeline:()=>Pe,ZodPromise:()=>ne,ZodReadonly:()=>ye,ZodRecord:()=>Ge,ZodSchema:()=>w,ZodSet:()=>Oe,ZodString:()=>te,ZodSymbol:()=>ve,ZodTransformer:()=>N,ZodTuple:()=>$,ZodType:()=>w,ZodUndefined:()=>ce,ZodUnion:()=>le,ZodUnknown:()=>X,ZodVoid:()=>Ie,addIssueToContext:()=>y,any:()=>an,array:()=>p,bigint:()=>tn,boolean:()=>h,coerce:()=>Mn,custom:()=>rt,date:()=>rn,datetimeRegex:()=>ot,defaultErrorMap:()=>Y,discriminatedUnion:()=>mn,effect:()=>yn,enum:()=>s,function:()=>hn,getErrorMap:()=>Se,getParsedType:()=>H,instanceof:()=>en,intersection:()=>ln,isAborted:()=>qe,isAsync:()=>Ce,isDirty:()=>Fe,isValid:()=>oe,late:()=>Qr,lazy:()=>zn,literal:()=>m,makeIssue:()=>je,map:()=>fn,nan:()=>on,nativeEnum:()=>xn,never:()=>dn,null:()=>U,nullable:()=>Cn,number:()=>o,object:()=>t,objectUtil:()=>We,oboolean:()=>On,onumber:()=>kn,optional:()=>Sn,ostring:()=>In,pipeline:()=>vn,preprocess:()=>Rn,promise:()=>bn,quotelessJson:()=>Or,record:()=>u,set:()=>gn,setErrorMap:()=>wr,strictObject:()=>cn,string:()=>e,symbol:()=>nn,transformer:()=>yn,tuple:()=>un,undefined:()=>sn,union:()=>x,unknown:()=>g,util:()=>B,void:()=>pn});var B;(function(n){n.assertEqual=d=>{};function r(d){}n.assertIs=r;function i(d){throw new Error}n.assertNever=i,n.arrayToEnum=d=>{let c={};for(let l of d)c[l]=l;return c},n.getValidEnumValues=d=>{let c=n.objectKeys(d).filter(f=>typeof d[d[f]]!="number"),l={};for(let f of c)l[f]=d[f];return n.objectValues(l)},n.objectValues=d=>n.objectKeys(d).map(function(c){return d[c]}),n.objectKeys=typeof Object.keys=="function"?d=>Object.keys(d):d=>{let c=[];for(let l in d)Object.prototype.hasOwnProperty.call(d,l)&&c.push(l);return c},n.find=(d,c)=>{for(let l of d)if(c(l))return l},n.isInteger=typeof Number.isInteger=="function"?d=>Number.isInteger(d):d=>typeof d=="number"&&Number.isFinite(d)&&Math.floor(d)===d;function a(d,c=" | "){return d.map(l=>typeof l=="string"?`'${l}'`:l).join(c)}n.joinValues=a,n.jsonStringifyReplacer=(d,c)=>typeof c=="bigint"?c.toString():c})(B||(B={}));var We;(function(n){n.mergeShapes=(r,i)=>({...r,...i})})(We||(We={}));var C=B.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),H=n=>{switch(typeof n){case"undefined":return C.undefined;case"string":return C.string;case"number":return Number.isNaN(n)?C.nan:C.number;case"boolean":return C.boolean;case"function":return C.function;case"bigint":return C.bigint;case"symbol":return C.symbol;case"object":return Array.isArray(n)?C.array:n===null?C.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?C.promise:typeof Map<"u"&&n instanceof Map?C.map:typeof Set<"u"&&n instanceof Set?C.set:typeof Date<"u"&&n instanceof Date?C.date:C.object;default:return C.unknown}};var z=B.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Or=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:"),A=class n extends Error{get errors(){return this.issues}constructor(r){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};let i=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,i):this.__proto__=i,this.name="ZodError",this.issues=r}format(r){let i=r||function(c){return c.message},a={_errors:[]},d=c=>{for(let l of c.issues)if(l.code==="invalid_union")l.unionErrors.map(d);else if(l.code==="invalid_return_type")d(l.returnTypeError);else if(l.code==="invalid_arguments")d(l.argumentsError);else if(l.path.length===0)a._errors.push(i(l));else{let f=a,b=0;for(;b<l.path.length;){let S=l.path[b];b===l.path.length-1?(f[S]=f[S]||{_errors:[]},f[S]._errors.push(i(l))):f[S]=f[S]||{_errors:[]},f=f[S],b++}}};return d(this),a}static assert(r){if(!(r instanceof n))throw new Error(`Not a ZodError: ${r}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,B.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(r=i=>i.message){let i={},a=[];for(let d of this.issues)if(d.path.length>0){let c=d.path[0];i[c]=i[c]||[],i[c].push(r(d))}else a.push(r(d));return{formErrors:a,fieldErrors:i}}get formErrors(){return this.flatten()}};A.create=n=>new A(n);var Mr=(n,r)=>{let i;switch(n.code){case z.invalid_type:n.received===C.undefined?i="Required":i=`Expected ${n.expected}, received ${n.received}`;break;case z.invalid_literal:i=`Invalid literal value, expected ${JSON.stringify(n.expected,B.jsonStringifyReplacer)}`;break;case z.unrecognized_keys:i=`Unrecognized key(s) in object: ${B.joinValues(n.keys,", ")}`;break;case z.invalid_union:i="Invalid input";break;case z.invalid_union_discriminator:i=`Invalid discriminator value. Expected ${B.joinValues(n.options)}`;break;case z.invalid_enum_value:i=`Invalid enum value. Expected ${B.joinValues(n.options)}, received '${n.received}'`;break;case z.invalid_arguments:i="Invalid function arguments";break;case z.invalid_return_type:i="Invalid function return type";break;case z.invalid_date:i="Invalid date";break;case z.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(i=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(i=`${i} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?i=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?i=`Invalid input: must end with "${n.validation.endsWith}"`:B.assertNever(n.validation):n.validation!=="regex"?i=`Invalid ${n.validation}`:i="Invalid";break;case z.too_small:n.type==="array"?i=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?i=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?i=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="bigint"?i=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?i=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:i="Invalid input";break;case z.too_big:n.type==="array"?i=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?i=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?i=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?i=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?i=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:i="Invalid input";break;case z.custom:i="Invalid input";break;case z.invalid_intersection_types:i="Intersection results could not be merged";break;case z.not_multiple_of:i=`Number must be a multiple of ${n.multipleOf}`;break;case z.not_finite:i="Number must be finite";break;default:i=r.defaultError,B.assertNever(n)}return{message:i}},Y=Mr;var Jo=Y;function wr(n){Jo=n}function Se(){return Jo}var je=n=>{let{data:r,path:i,errorMaps:a,issueData:d}=n,c=[...i,...d.path||[]],l={...d,path:c};if(d.message!==void 0)return{...d,path:c,message:d.message};let f="",b=a.filter(S=>!!S).slice().reverse();for(let S of b)f=S(l,{data:r,defaultError:f}).message;return{...d,path:c,message:f}},Br=[];function y(n,r){let i=Se(),a=je({issueData:r,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,i,i===Y?void 0:Y].filter(d=>!!d)});n.common.issues.push(a)}var E=class n{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(r,i){let a=[];for(let d of i){if(d.status==="aborted")return I;d.status==="dirty"&&r.dirty(),a.push(d.value)}return{status:r.value,value:a}}static async mergeObjectAsync(r,i){let a=[];for(let d of i){let c=await d.key,l=await d.value;a.push({key:c,value:l})}return n.mergeObjectSync(r,a)}static mergeObjectSync(r,i){let a={};for(let d of i){let{key:c,value:l}=d;if(c.status==="aborted"||l.status==="aborted")return I;c.status==="dirty"&&r.dirty(),l.status==="dirty"&&r.dirty(),c.value!=="__proto__"&&(typeof l.value<"u"||d.alwaysSet)&&(a[c.value]=l.value)}return{status:r.value,value:a}}},I=Object.freeze({status:"aborted"}),ie=n=>({status:"dirty",value:n}),P=n=>({status:"valid",value:n}),qe=n=>n.status==="aborted",Fe=n=>n.status==="dirty",oe=n=>n.status==="valid",Ce=n=>typeof Promise<"u"&&n instanceof Promise;var v;(function(n){n.errToObj=r=>typeof r=="string"?{message:r}:r||{},n.toString=r=>typeof r=="string"?r:r?.message})(v||(v={}));var G=class{constructor(r,i,a,d){this._cachedPath=[],this.parent=r,this.data=i,this._path=a,this._key=d}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Xo=(n,r)=>{if(oe(r))return{success:!0,data:r.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let i=new A(n.common.issues);return this._error=i,this._error}}};function M(n){if(!n)return{};let{errorMap:r,invalid_type_error:i,required_error:a,description:d}=n;if(r&&(i||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return r?{errorMap:r,description:d}:{errorMap:(l,f)=>{let{message:b}=n;return l.code==="invalid_enum_value"?{message:b??f.defaultError}:typeof f.data>"u"?{message:b??a??f.defaultError}:l.code!=="invalid_type"?{message:f.defaultError}:{message:b??i??f.defaultError}},description:d}}var w=class{get description(){return this._def.description}_getType(r){return H(r.data)}_getOrReturnCtx(r,i){return i||{common:r.parent.common,data:r.data,parsedType:H(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}_processInputParams(r){return{status:new E,ctx:{common:r.parent.common,data:r.data,parsedType:H(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}}_parseSync(r){let i=this._parse(r);if(Ce(i))throw new Error("Synchronous parse encountered promise.");return i}_parseAsync(r){let i=this._parse(r);return Promise.resolve(i)}parse(r,i){let a=this.safeParse(r,i);if(a.success)return a.data;throw a.error}safeParse(r,i){let a={common:{issues:[],async:i?.async??!1,contextualErrorMap:i?.errorMap},path:i?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:H(r)},d=this._parseSync({data:r,path:a.path,parent:a});return Xo(a,d)}"~validate"(r){let i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:H(r)};if(!this["~standard"].async)try{let a=this._parseSync({data:r,path:[],parent:i});return oe(a)?{value:a.value}:{issues:i.common.issues}}catch(a){a?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:r,path:[],parent:i}).then(a=>oe(a)?{value:a.value}:{issues:i.common.issues})}async parseAsync(r,i){let a=await this.safeParseAsync(r,i);if(a.success)return a.data;throw a.error}async safeParseAsync(r,i){let a={common:{issues:[],contextualErrorMap:i?.errorMap,async:!0},path:i?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:H(r)},d=this._parse({data:r,path:a.path,parent:a}),c=await(Ce(d)?d:Promise.resolve(d));return Xo(a,c)}refine(r,i){let a=d=>typeof i=="string"||typeof i>"u"?{message:i}:typeof i=="function"?i(d):i;return this._refinement((d,c)=>{let l=r(d),f=()=>c.addIssue({code:z.custom,...a(d)});return typeof Promise<"u"&&l instanceof Promise?l.then(b=>b?!0:(f(),!1)):l?!0:(f(),!1)})}refinement(r,i){return this._refinement((a,d)=>r(a)?!0:(d.addIssue(typeof i=="function"?i(a,d):i),!1))}_refinement(r){return new N({schema:this,typeName:O.ZodEffects,effect:{type:"refinement",refinement:r}})}superRefine(r){return this._refinement(r)}constructor(r){this.spa=this.safeParseAsync,this._def=r,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:i=>this["~validate"](i)}}optional(){return D.create(this,this._def)}nullable(){return V.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Z.create(this)}promise(){return ne.create(this,this._def)}or(r){return le.create([this,r],this._def)}and(r){return ue.create(this,r,this._def)}transform(r){return new N({...M(this._def),schema:this,typeName:O.ZodEffects,effect:{type:"transform",transform:r}})}default(r){let i=typeof r=="function"?r:()=>r;return new xe({...M(this._def),innerType:this,defaultValue:i,typeName:O.ZodDefault})}brand(){return new Ee({typeName:O.ZodBranded,type:this,...M(this._def)})}catch(r){let i=typeof r=="function"?r:()=>r;return new be({...M(this._def),innerType:this,catchValue:i,typeName:O.ZodCatch})}describe(r){let i=this.constructor;return new i({...this._def,description:r})}pipe(r){return Pe.create(this,r)}readonly(){return ye.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Tr=/^c[^\s-]{8,}$/i,jr=/^[0-9a-z]+$/,Er=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Pr=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ar=/^[a-z0-9_-]{21}$/i,_r=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,qr=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Fr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Dr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",He,Gr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Nr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Ur=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Kr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Lr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Wr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Qo="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Hr=new RegExp(`^${Qo}$`);function et(n){let r="[0-5]\\d";n.precision?r=`${r}\\.\\d{${n.precision}}`:n.precision==null&&(r=`${r}(\\.\\d+)?`);let i=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${r})${i}`}function $r(n){return new RegExp(`^${et(n)}$`)}function ot(n){let r=`${Qo}T${et(n)}`,i=[];return i.push(n.local?"Z?":"Z"),n.offset&&i.push("([+-]\\d{2}:?\\d{2})"),r=`${r}(${i.join("|")})`,new RegExp(`^${r}$`)}function Vr(n,r){return!!((r==="v4"||!r)&&Gr.test(n)||(r==="v6"||!r)&&Ur.test(n))}function Yr(n,r){if(!_r.test(n))return!1;try{let[i]=n.split(".");if(!i)return!1;let a=i.replace(/-/g,"+").replace(/_/g,"/").padEnd(i.length+(4-i.length%4)%4,"="),d=JSON.parse(atob(a));return!(typeof d!="object"||d===null||"typ"in d&&d?.typ!=="JWT"||!d.alg||r&&d.alg!==r)}catch{return!1}}function Jr(n,r){return!!((r==="v4"||!r)&&Nr.test(n)||(r==="v6"||!r)&&Kr.test(n))}var te=class n extends w{_parse(r){if(this._def.coerce&&(r.data=String(r.data)),this._getType(r)!==C.string){let c=this._getOrReturnCtx(r);return y(c,{code:z.invalid_type,expected:C.string,received:c.parsedType}),I}let a=new E,d;for(let c of this._def.checks)if(c.kind==="min")r.data.length<c.value&&(d=this._getOrReturnCtx(r,d),y(d,{code:z.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),a.dirty());else if(c.kind==="max")r.data.length>c.value&&(d=this._getOrReturnCtx(r,d),y(d,{code:z.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),a.dirty());else if(c.kind==="length"){let l=r.data.length>c.value,f=r.data.length<c.value;(l||f)&&(d=this._getOrReturnCtx(r,d),l?y(d,{code:z.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}):f&&y(d,{code:z.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}),a.dirty())}else if(c.kind==="email")Fr.test(r.data)||(d=this._getOrReturnCtx(r,d),y(d,{validation:"email",code:z.invalid_string,message:c.message}),a.dirty());else if(c.kind==="emoji")He||(He=new RegExp(Dr,"u")),He.test(r.data)||(d=this._getOrReturnCtx(r,d),y(d,{validation:"emoji",code:z.invalid_string,message:c.message}),a.dirty());else if(c.kind==="uuid")Pr.test(r.data)||(d=this._getOrReturnCtx(r,d),y(d,{validation:"uuid",code:z.invalid_string,message:c.message}),a.dirty());else if(c.kind==="nanoid")Ar.test(r.data)||(d=this._getOrReturnCtx(r,d),y(d,{validation:"nanoid",code:z.invalid_string,message:c.message}),a.dirty());else if(c.kind==="cuid")Tr.test(r.data)||(d=this._getOrReturnCtx(r,d),y(d,{validation:"cuid",code:z.invalid_string,message:c.message}),a.dirty());else if(c.kind==="cuid2")jr.test(r.data)||(d=this._getOrReturnCtx(r,d),y(d,{validation:"cuid2",code:z.invalid_string,message:c.message}),a.dirty());else if(c.kind==="ulid")Er.test(r.data)||(d=this._getOrReturnCtx(r,d),y(d,{validation:"ulid",code:z.invalid_string,message:c.message}),a.dirty());else if(c.kind==="url")try{new URL(r.data)}catch{d=this._getOrReturnCtx(r,d),y(d,{validation:"url",code:z.invalid_string,message:c.message}),a.dirty()}else c.kind==="regex"?(c.regex.lastIndex=0,c.regex.test(r.data)||(d=this._getOrReturnCtx(r,d),y(d,{validation:"regex",code:z.invalid_string,message:c.message}),a.dirty())):c.kind==="trim"?r.data=r.data.trim():c.kind==="includes"?r.data.includes(c.value,c.position)||(d=this._getOrReturnCtx(r,d),y(d,{code:z.invalid_string,validation:{includes:c.value,position:c.position},message:c.message}),a.dirty()):c.kind==="toLowerCase"?r.data=r.data.toLowerCase():c.kind==="toUpperCase"?r.data=r.data.toUpperCase():c.kind==="startsWith"?r.data.startsWith(c.value)||(d=this._getOrReturnCtx(r,d),y(d,{code:z.invalid_string,validation:{startsWith:c.value},message:c.message}),a.dirty()):c.kind==="endsWith"?r.data.endsWith(c.value)||(d=this._getOrReturnCtx(r,d),y(d,{code:z.invalid_string,validation:{endsWith:c.value},message:c.message}),a.dirty()):c.kind==="datetime"?ot(c).test(r.data)||(d=this._getOrReturnCtx(r,d),y(d,{code:z.invalid_string,validation:"datetime",message:c.message}),a.dirty()):c.kind==="date"?Hr.test(r.data)||(d=this._getOrReturnCtx(r,d),y(d,{code:z.invalid_string,validation:"date",message:c.message}),a.dirty()):c.kind==="time"?$r(c).test(r.data)||(d=this._getOrReturnCtx(r,d),y(d,{code:z.invalid_string,validation:"time",message:c.message}),a.dirty()):c.kind==="duration"?qr.test(r.data)||(d=this._getOrReturnCtx(r,d),y(d,{validation:"duration",code:z.invalid_string,message:c.message}),a.dirty()):c.kind==="ip"?Vr(r.data,c.version)||(d=this._getOrReturnCtx(r,d),y(d,{validation:"ip",code:z.invalid_string,message:c.message}),a.dirty()):c.kind==="jwt"?Yr(r.data,c.alg)||(d=this._getOrReturnCtx(r,d),y(d,{validation:"jwt",code:z.invalid_string,message:c.message}),a.dirty()):c.kind==="cidr"?Jr(r.data,c.version)||(d=this._getOrReturnCtx(r,d),y(d,{validation:"cidr",code:z.invalid_string,message:c.message}),a.dirty()):c.kind==="base64"?Lr.test(r.data)||(d=this._getOrReturnCtx(r,d),y(d,{validation:"base64",code:z.invalid_string,message:c.message}),a.dirty()):c.kind==="base64url"?Wr.test(r.data)||(d=this._getOrReturnCtx(r,d),y(d,{validation:"base64url",code:z.invalid_string,message:c.message}),a.dirty()):B.assertNever(c);return{status:a.value,value:r.data}}_regex(r,i,a){return this.refinement(d=>r.test(d),{validation:i,code:z.invalid_string,...v.errToObj(a)})}_addCheck(r){return new n({...this._def,checks:[...this._def.checks,r]})}email(r){return this._addCheck({kind:"email",...v.errToObj(r)})}url(r){return this._addCheck({kind:"url",...v.errToObj(r)})}emoji(r){return this._addCheck({kind:"emoji",...v.errToObj(r)})}uuid(r){return this._addCheck({kind:"uuid",...v.errToObj(r)})}nanoid(r){return this._addCheck({kind:"nanoid",...v.errToObj(r)})}cuid(r){return this._addCheck({kind:"cuid",...v.errToObj(r)})}cuid2(r){return this._addCheck({kind:"cuid2",...v.errToObj(r)})}ulid(r){return this._addCheck({kind:"ulid",...v.errToObj(r)})}base64(r){return this._addCheck({kind:"base64",...v.errToObj(r)})}base64url(r){return this._addCheck({kind:"base64url",...v.errToObj(r)})}jwt(r){return this._addCheck({kind:"jwt",...v.errToObj(r)})}ip(r){return this._addCheck({kind:"ip",...v.errToObj(r)})}cidr(r){return this._addCheck({kind:"cidr",...v.errToObj(r)})}datetime(r){return typeof r=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:r}):this._addCheck({kind:"datetime",precision:typeof r?.precision>"u"?null:r?.precision,offset:r?.offset??!1,local:r?.local??!1,...v.errToObj(r?.message)})}date(r){return this._addCheck({kind:"date",message:r})}time(r){return typeof r=="string"?this._addCheck({kind:"time",precision:null,message:r}):this._addCheck({kind:"time",precision:typeof r?.precision>"u"?null:r?.precision,...v.errToObj(r?.message)})}duration(r){return this._addCheck({kind:"duration",...v.errToObj(r)})}regex(r,i){return this._addCheck({kind:"regex",regex:r,...v.errToObj(i)})}includes(r,i){return this._addCheck({kind:"includes",value:r,position:i?.position,...v.errToObj(i?.message)})}startsWith(r,i){return this._addCheck({kind:"startsWith",value:r,...v.errToObj(i)})}endsWith(r,i){return this._addCheck({kind:"endsWith",value:r,...v.errToObj(i)})}min(r,i){return this._addCheck({kind:"min",value:r,...v.errToObj(i)})}max(r,i){return this._addCheck({kind:"max",value:r,...v.errToObj(i)})}length(r,i){return this._addCheck({kind:"length",value:r,...v.errToObj(i)})}nonempty(r){return this.min(1,v.errToObj(r))}trim(){return new n({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new n({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new n({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(r=>r.kind==="datetime")}get isDate(){return!!this._def.checks.find(r=>r.kind==="date")}get isTime(){return!!this._def.checks.find(r=>r.kind==="time")}get isDuration(){return!!this._def.checks.find(r=>r.kind==="duration")}get isEmail(){return!!this._def.checks.find(r=>r.kind==="email")}get isURL(){return!!this._def.checks.find(r=>r.kind==="url")}get isEmoji(){return!!this._def.checks.find(r=>r.kind==="emoji")}get isUUID(){return!!this._def.checks.find(r=>r.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(r=>r.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(r=>r.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(r=>r.kind==="cuid2")}get isULID(){return!!this._def.checks.find(r=>r.kind==="ulid")}get isIP(){return!!this._def.checks.find(r=>r.kind==="ip")}get isCIDR(){return!!this._def.checks.find(r=>r.kind==="cidr")}get isBase64(){return!!this._def.checks.find(r=>r.kind==="base64")}get isBase64url(){return!!this._def.checks.find(r=>r.kind==="base64url")}get minLength(){let r=null;for(let i of this._def.checks)i.kind==="min"&&(r===null||i.value>r)&&(r=i.value);return r}get maxLength(){let r=null;for(let i of this._def.checks)i.kind==="max"&&(r===null||i.value<r)&&(r=i.value);return r}};te.create=n=>new te({checks:[],typeName:O.ZodString,coerce:n?.coerce??!1,...M(n)});function Xr(n,r){let i=(n.toString().split(".")[1]||"").length,a=(r.toString().split(".")[1]||"").length,d=i>a?i:a,c=Number.parseInt(n.toFixed(d).replace(".","")),l=Number.parseInt(r.toFixed(d).replace(".",""));return c%l/10**d}var se=class n extends w{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(r){if(this._def.coerce&&(r.data=Number(r.data)),this._getType(r)!==C.number){let c=this._getOrReturnCtx(r);return y(c,{code:z.invalid_type,expected:C.number,received:c.parsedType}),I}let a,d=new E;for(let c of this._def.checks)c.kind==="int"?B.isInteger(r.data)||(a=this._getOrReturnCtx(r,a),y(a,{code:z.invalid_type,expected:"integer",received:"float",message:c.message}),d.dirty()):c.kind==="min"?(c.inclusive?r.data<c.value:r.data<=c.value)&&(a=this._getOrReturnCtx(r,a),y(a,{code:z.too_small,minimum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),d.dirty()):c.kind==="max"?(c.inclusive?r.data>c.value:r.data>=c.value)&&(a=this._getOrReturnCtx(r,a),y(a,{code:z.too_big,maximum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),d.dirty()):c.kind==="multipleOf"?Xr(r.data,c.value)!==0&&(a=this._getOrReturnCtx(r,a),y(a,{code:z.not_multiple_of,multipleOf:c.value,message:c.message}),d.dirty()):c.kind==="finite"?Number.isFinite(r.data)||(a=this._getOrReturnCtx(r,a),y(a,{code:z.not_finite,message:c.message}),d.dirty()):B.assertNever(c);return{status:d.value,value:r.data}}gte(r,i){return this.setLimit("min",r,!0,v.toString(i))}gt(r,i){return this.setLimit("min",r,!1,v.toString(i))}lte(r,i){return this.setLimit("max",r,!0,v.toString(i))}lt(r,i){return this.setLimit("max",r,!1,v.toString(i))}setLimit(r,i,a,d){return new n({...this._def,checks:[...this._def.checks,{kind:r,value:i,inclusive:a,message:v.toString(d)}]})}_addCheck(r){return new n({...this._def,checks:[...this._def.checks,r]})}int(r){return this._addCheck({kind:"int",message:v.toString(r)})}positive(r){return this._addCheck({kind:"min",value:0,inclusive:!1,message:v.toString(r)})}negative(r){return this._addCheck({kind:"max",value:0,inclusive:!1,message:v.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:0,inclusive:!0,message:v.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:0,inclusive:!0,message:v.toString(r)})}multipleOf(r,i){return this._addCheck({kind:"multipleOf",value:r,message:v.toString(i)})}finite(r){return this._addCheck({kind:"finite",message:v.toString(r)})}safe(r){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:v.toString(r)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:v.toString(r)})}get minValue(){let r=null;for(let i of this._def.checks)i.kind==="min"&&(r===null||i.value>r)&&(r=i.value);return r}get maxValue(){let r=null;for(let i of this._def.checks)i.kind==="max"&&(r===null||i.value<r)&&(r=i.value);return r}get isInt(){return!!this._def.checks.find(r=>r.kind==="int"||r.kind==="multipleOf"&&B.isInteger(r.value))}get isFinite(){let r=null,i=null;for(let a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(i===null||a.value>i)&&(i=a.value):a.kind==="max"&&(r===null||a.value<r)&&(r=a.value)}return Number.isFinite(i)&&Number.isFinite(r)}};se.create=n=>new se({checks:[],typeName:O.ZodNumber,coerce:n?.coerce||!1,...M(n)});var ae=class n extends w{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(r){if(this._def.coerce)try{r.data=BigInt(r.data)}catch{return this._getInvalidInput(r)}if(this._getType(r)!==C.bigint)return this._getInvalidInput(r);let a,d=new E;for(let c of this._def.checks)c.kind==="min"?(c.inclusive?r.data<c.value:r.data<=c.value)&&(a=this._getOrReturnCtx(r,a),y(a,{code:z.too_small,type:"bigint",minimum:c.value,inclusive:c.inclusive,message:c.message}),d.dirty()):c.kind==="max"?(c.inclusive?r.data>c.value:r.data>=c.value)&&(a=this._getOrReturnCtx(r,a),y(a,{code:z.too_big,type:"bigint",maximum:c.value,inclusive:c.inclusive,message:c.message}),d.dirty()):c.kind==="multipleOf"?r.data%c.value!==BigInt(0)&&(a=this._getOrReturnCtx(r,a),y(a,{code:z.not_multiple_of,multipleOf:c.value,message:c.message}),d.dirty()):B.assertNever(c);return{status:d.value,value:r.data}}_getInvalidInput(r){let i=this._getOrReturnCtx(r);return y(i,{code:z.invalid_type,expected:C.bigint,received:i.parsedType}),I}gte(r,i){return this.setLimit("min",r,!0,v.toString(i))}gt(r,i){return this.setLimit("min",r,!1,v.toString(i))}lte(r,i){return this.setLimit("max",r,!0,v.toString(i))}lt(r,i){return this.setLimit("max",r,!1,v.toString(i))}setLimit(r,i,a,d){return new n({...this._def,checks:[...this._def.checks,{kind:r,value:i,inclusive:a,message:v.toString(d)}]})}_addCheck(r){return new n({...this._def,checks:[...this._def.checks,r]})}positive(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:v.toString(r)})}negative(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:v.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:v.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:v.toString(r)})}multipleOf(r,i){return this._addCheck({kind:"multipleOf",value:r,message:v.toString(i)})}get minValue(){let r=null;for(let i of this._def.checks)i.kind==="min"&&(r===null||i.value>r)&&(r=i.value);return r}get maxValue(){let r=null;for(let i of this._def.checks)i.kind==="max"&&(r===null||i.value<r)&&(r=i.value);return r}};ae.create=n=>new ae({checks:[],typeName:O.ZodBigInt,coerce:n?.coerce??!1,...M(n)});var de=class extends w{_parse(r){if(this._def.coerce&&(r.data=!!r.data),this._getType(r)!==C.boolean){let a=this._getOrReturnCtx(r);return y(a,{code:z.invalid_type,expected:C.boolean,received:a.parsedType}),I}return P(r.data)}};de.create=n=>new de({typeName:O.ZodBoolean,coerce:n?.coerce||!1,...M(n)});var pe=class n extends w{_parse(r){if(this._def.coerce&&(r.data=new Date(r.data)),this._getType(r)!==C.date){let c=this._getOrReturnCtx(r);return y(c,{code:z.invalid_type,expected:C.date,received:c.parsedType}),I}if(Number.isNaN(r.data.getTime())){let c=this._getOrReturnCtx(r);return y(c,{code:z.invalid_date}),I}let a=new E,d;for(let c of this._def.checks)c.kind==="min"?r.data.getTime()<c.value&&(d=this._getOrReturnCtx(r,d),y(d,{code:z.too_small,message:c.message,inclusive:!0,exact:!1,minimum:c.value,type:"date"}),a.dirty()):c.kind==="max"?r.data.getTime()>c.value&&(d=this._getOrReturnCtx(r,d),y(d,{code:z.too_big,message:c.message,inclusive:!0,exact:!1,maximum:c.value,type:"date"}),a.dirty()):B.assertNever(c);return{status:a.value,value:new Date(r.data.getTime())}}_addCheck(r){return new n({...this._def,checks:[...this._def.checks,r]})}min(r,i){return this._addCheck({kind:"min",value:r.getTime(),message:v.toString(i)})}max(r,i){return this._addCheck({kind:"max",value:r.getTime(),message:v.toString(i)})}get minDate(){let r=null;for(let i of this._def.checks)i.kind==="min"&&(r===null||i.value>r)&&(r=i.value);return r!=null?new Date(r):null}get maxDate(){let r=null;for(let i of this._def.checks)i.kind==="max"&&(r===null||i.value<r)&&(r=i.value);return r!=null?new Date(r):null}};pe.create=n=>new pe({checks:[],coerce:n?.coerce||!1,typeName:O.ZodDate,...M(n)});var ve=class extends w{_parse(r){if(this._getType(r)!==C.symbol){let a=this._getOrReturnCtx(r);return y(a,{code:z.invalid_type,expected:C.symbol,received:a.parsedType}),I}return P(r.data)}};ve.create=n=>new ve({typeName:O.ZodSymbol,...M(n)});var ce=class extends w{_parse(r){if(this._getType(r)!==C.undefined){let a=this._getOrReturnCtx(r);return y(a,{code:z.invalid_type,expected:C.undefined,received:a.parsedType}),I}return P(r.data)}};ce.create=n=>new ce({typeName:O.ZodUndefined,...M(n)});var me=class extends w{_parse(r){if(this._getType(r)!==C.null){let a=this._getOrReturnCtx(r);return y(a,{code:z.invalid_type,expected:C.null,received:a.parsedType}),I}return P(r.data)}};me.create=n=>new me({typeName:O.ZodNull,...M(n)});var re=class extends w{constructor(){super(...arguments),this._any=!0}_parse(r){return P(r.data)}};re.create=n=>new re({typeName:O.ZodAny,...M(n)});var X=class extends w{constructor(){super(...arguments),this._unknown=!0}_parse(r){return P(r.data)}};X.create=n=>new X({typeName:O.ZodUnknown,...M(n)});var L=class extends w{_parse(r){let i=this._getOrReturnCtx(r);return y(i,{code:z.invalid_type,expected:C.never,received:i.parsedType}),I}};L.create=n=>new L({typeName:O.ZodNever,...M(n)});var Ie=class extends w{_parse(r){if(this._getType(r)!==C.undefined){let a=this._getOrReturnCtx(r);return y(a,{code:z.invalid_type,expected:C.void,received:a.parsedType}),I}return P(r.data)}};Ie.create=n=>new Ie({typeName:O.ZodVoid,...M(n)});var Z=class n extends w{_parse(r){let{ctx:i,status:a}=this._processInputParams(r),d=this._def;if(i.parsedType!==C.array)return y(i,{code:z.invalid_type,expected:C.array,received:i.parsedType}),I;if(d.exactLength!==null){let l=i.data.length>d.exactLength.value,f=i.data.length<d.exactLength.value;(l||f)&&(y(i,{code:l?z.too_big:z.too_small,minimum:f?d.exactLength.value:void 0,maximum:l?d.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:d.exactLength.message}),a.dirty())}if(d.minLength!==null&&i.data.length<d.minLength.value&&(y(i,{code:z.too_small,minimum:d.minLength.value,type:"array",inclusive:!0,exact:!1,message:d.minLength.message}),a.dirty()),d.maxLength!==null&&i.data.length>d.maxLength.value&&(y(i,{code:z.too_big,maximum:d.maxLength.value,type:"array",inclusive:!0,exact:!1,message:d.maxLength.message}),a.dirty()),i.common.async)return Promise.all([...i.data].map((l,f)=>d.type._parseAsync(new G(i,l,i.path,f)))).then(l=>E.mergeArray(a,l));let c=[...i.data].map((l,f)=>d.type._parseSync(new G(i,l,i.path,f)));return E.mergeArray(a,c)}get element(){return this._def.type}min(r,i){return new n({...this._def,minLength:{value:r,message:v.toString(i)}})}max(r,i){return new n({...this._def,maxLength:{value:r,message:v.toString(i)}})}length(r,i){return new n({...this._def,exactLength:{value:r,message:v.toString(i)}})}nonempty(r){return this.min(1,r)}};Z.create=(n,r)=>new Z({type:n,minLength:null,maxLength:null,exactLength:null,typeName:O.ZodArray,...M(r)});function Re(n){if(n instanceof _){let r={};for(let i in n.shape){let a=n.shape[i];r[i]=D.create(Re(a))}return new _({...n._def,shape:()=>r})}else return n instanceof Z?new Z({...n._def,type:Re(n.element)}):n instanceof D?D.create(Re(n.unwrap())):n instanceof V?V.create(Re(n.unwrap())):n instanceof $?$.create(n.items.map(r=>Re(r))):n}var _=class n extends w{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let r=this._def.shape(),i=B.objectKeys(r);return this._cached={shape:r,keys:i},this._cached}_parse(r){if(this._getType(r)!==C.object){let S=this._getOrReturnCtx(r);return y(S,{code:z.invalid_type,expected:C.object,received:S.parsedType}),I}let{status:a,ctx:d}=this._processInputParams(r),{shape:c,keys:l}=this._getCached(),f=[];if(!(this._def.catchall instanceof L&&this._def.unknownKeys==="strip"))for(let S in d.data)l.includes(S)||f.push(S);let b=[];for(let S of l){let k=c[S],T=d.data[S];b.push({key:{status:"valid",value:S},value:k._parse(new G(d,T,d.path,S)),alwaysSet:S in d.data})}if(this._def.catchall instanceof L){let S=this._def.unknownKeys;if(S==="passthrough")for(let k of f)b.push({key:{status:"valid",value:k},value:{status:"valid",value:d.data[k]}});else if(S==="strict")f.length>0&&(y(d,{code:z.unrecognized_keys,keys:f}),a.dirty());else if(S!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let S=this._def.catchall;for(let k of f){let T=d.data[k];b.push({key:{status:"valid",value:k},value:S._parse(new G(d,T,d.path,k)),alwaysSet:k in d.data})}}return d.common.async?Promise.resolve().then(async()=>{let S=[];for(let k of b){let T=await k.key,K=await k.value;S.push({key:T,value:K,alwaysSet:k.alwaysSet})}return S}).then(S=>E.mergeObjectSync(a,S)):E.mergeObjectSync(a,b)}get shape(){return this._def.shape()}strict(r){return v.errToObj,new n({...this._def,unknownKeys:"strict",...r!==void 0?{errorMap:(i,a)=>{let d=this._def.errorMap?.(i,a).message??a.defaultError;return i.code==="unrecognized_keys"?{message:v.errToObj(r).message??d}:{message:d}}}:{}})}strip(){return new n({...this._def,unknownKeys:"strip"})}passthrough(){return new n({...this._def,unknownKeys:"passthrough"})}extend(r){return new n({...this._def,shape:()=>({...this._def.shape(),...r})})}merge(r){return new n({unknownKeys:r._def.unknownKeys,catchall:r._def.catchall,shape:()=>({...this._def.shape(),...r._def.shape()}),typeName:O.ZodObject})}setKey(r,i){return this.augment({[r]:i})}catchall(r){return new n({...this._def,catchall:r})}pick(r){let i={};for(let a of B.objectKeys(r))r[a]&&this.shape[a]&&(i[a]=this.shape[a]);return new n({...this._def,shape:()=>i})}omit(r){let i={};for(let a of B.objectKeys(this.shape))r[a]||(i[a]=this.shape[a]);return new n({...this._def,shape:()=>i})}deepPartial(){return Re(this)}partial(r){let i={};for(let a of B.objectKeys(this.shape)){let d=this.shape[a];r&&!r[a]?i[a]=d:i[a]=d.optional()}return new n({...this._def,shape:()=>i})}required(r){let i={};for(let a of B.objectKeys(this.shape))if(r&&!r[a])i[a]=this.shape[a];else{let c=this.shape[a];for(;c instanceof D;)c=c._def.innerType;i[a]=c}return new n({...this._def,shape:()=>i})}keyof(){return tt(B.objectKeys(this.shape))}};_.create=(n,r)=>new _({shape:()=>n,unknownKeys:"strip",catchall:L.create(),typeName:O.ZodObject,...M(r)});_.strictCreate=(n,r)=>new _({shape:()=>n,unknownKeys:"strict",catchall:L.create(),typeName:O.ZodObject,...M(r)});_.lazycreate=(n,r)=>new _({shape:n,unknownKeys:"strip",catchall:L.create(),typeName:O.ZodObject,...M(r)});var le=class extends w{_parse(r){let{ctx:i}=this._processInputParams(r),a=this._def.options;function d(c){for(let f of c)if(f.result.status==="valid")return f.result;for(let f of c)if(f.result.status==="dirty")return i.common.issues.push(...f.ctx.common.issues),f.result;let l=c.map(f=>new A(f.ctx.common.issues));return y(i,{code:z.invalid_union,unionErrors:l}),I}if(i.common.async)return Promise.all(a.map(async c=>{let l={...i,common:{...i.common,issues:[]},parent:null};return{result:await c._parseAsync({data:i.data,path:i.path,parent:l}),ctx:l}})).then(d);{let c,l=[];for(let b of a){let S={...i,common:{...i.common,issues:[]},parent:null},k=b._parseSync({data:i.data,path:i.path,parent:S});if(k.status==="valid")return k;k.status==="dirty"&&!c&&(c={result:k,ctx:S}),S.common.issues.length&&l.push(S.common.issues)}if(c)return i.common.issues.push(...c.ctx.common.issues),c.result;let f=l.map(b=>new A(b));return y(i,{code:z.invalid_union,unionErrors:f}),I}}get options(){return this._def.options}};le.create=(n,r)=>new le({options:n,typeName:O.ZodUnion,...M(r)});var J=n=>n instanceof fe?J(n.schema):n instanceof N?J(n.innerType()):n instanceof ge?[n.value]:n instanceof he?n.options:n instanceof ze?B.objectValues(n.enum):n instanceof xe?J(n._def.innerType):n instanceof ce?[void 0]:n instanceof me?[null]:n instanceof D?[void 0,...J(n.unwrap())]:n instanceof V?[null,...J(n.unwrap())]:n instanceof Ee||n instanceof ye?J(n.unwrap()):n instanceof be?J(n._def.innerType):[],De=class n extends w{_parse(r){let{ctx:i}=this._processInputParams(r);if(i.parsedType!==C.object)return y(i,{code:z.invalid_type,expected:C.object,received:i.parsedType}),I;let a=this.discriminator,d=i.data[a],c=this.optionsMap.get(d);return c?i.common.async?c._parseAsync({data:i.data,path:i.path,parent:i}):c._parseSync({data:i.data,path:i.path,parent:i}):(y(i,{code:z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),I)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(r,i,a){let d=new Map;for(let c of i){let l=J(c.shape[r]);if(!l.length)throw new Error(`A discriminator value for key \`${r}\` could not be extracted from all schema options`);for(let f of l){if(d.has(f))throw new Error(`Discriminator property ${String(r)} has duplicate value ${String(f)}`);d.set(f,c)}}return new n({typeName:O.ZodDiscriminatedUnion,discriminator:r,options:i,optionsMap:d,...M(a)})}};function $e(n,r){let i=H(n),a=H(r);if(n===r)return{valid:!0,data:n};if(i===C.object&&a===C.object){let d=B.objectKeys(r),c=B.objectKeys(n).filter(f=>d.indexOf(f)!==-1),l={...n,...r};for(let f of c){let b=$e(n[f],r[f]);if(!b.valid)return{valid:!1};l[f]=b.data}return{valid:!0,data:l}}else if(i===C.array&&a===C.array){if(n.length!==r.length)return{valid:!1};let d=[];for(let c=0;c<n.length;c++){let l=n[c],f=r[c],b=$e(l,f);if(!b.valid)return{valid:!1};d.push(b.data)}return{valid:!0,data:d}}else return i===C.date&&a===C.date&&+n==+r?{valid:!0,data:n}:{valid:!1}}var ue=class extends w{_parse(r){let{status:i,ctx:a}=this._processInputParams(r),d=(c,l)=>{if(qe(c)||qe(l))return I;let f=$e(c.value,l.value);return f.valid?((Fe(c)||Fe(l))&&i.dirty(),{status:i.value,value:f.data}):(y(a,{code:z.invalid_intersection_types}),I)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([c,l])=>d(c,l)):d(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}};ue.create=(n,r,i)=>new ue({left:n,right:r,typeName:O.ZodIntersection,...M(i)});var $=class n extends w{_parse(r){let{status:i,ctx:a}=this._processInputParams(r);if(a.parsedType!==C.array)return y(a,{code:z.invalid_type,expected:C.array,received:a.parsedType}),I;if(a.data.length<this._def.items.length)return y(a,{code:z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),I;!this._def.rest&&a.data.length>this._def.items.length&&(y(a,{code:z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty());let c=[...a.data].map((l,f)=>{let b=this._def.items[f]||this._def.rest;return b?b._parse(new G(a,l,a.path,f)):null}).filter(l=>!!l);return a.common.async?Promise.all(c).then(l=>E.mergeArray(i,l)):E.mergeArray(i,c)}get items(){return this._def.items}rest(r){return new n({...this._def,rest:r})}};$.create=(n,r)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $({items:n,typeName:O.ZodTuple,rest:null,...M(r)})};var Ge=class n extends w{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){let{status:i,ctx:a}=this._processInputParams(r);if(a.parsedType!==C.object)return y(a,{code:z.invalid_type,expected:C.object,received:a.parsedType}),I;let d=[],c=this._def.keyType,l=this._def.valueType;for(let f in a.data)d.push({key:c._parse(new G(a,f,a.path,f)),value:l._parse(new G(a,a.data[f],a.path,f)),alwaysSet:f in a.data});return a.common.async?E.mergeObjectAsync(i,d):E.mergeObjectSync(i,d)}get element(){return this._def.valueType}static create(r,i,a){return i instanceof w?new n({keyType:r,valueType:i,typeName:O.ZodRecord,...M(a)}):new n({keyType:te.create(),valueType:r,typeName:O.ZodRecord,...M(i)})}},ke=class extends w{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){let{status:i,ctx:a}=this._processInputParams(r);if(a.parsedType!==C.map)return y(a,{code:z.invalid_type,expected:C.map,received:a.parsedType}),I;let d=this._def.keyType,c=this._def.valueType,l=[...a.data.entries()].map(([f,b],S)=>({key:d._parse(new G(a,f,a.path,[S,"key"])),value:c._parse(new G(a,b,a.path,[S,"value"]))}));if(a.common.async){let f=new Map;return Promise.resolve().then(async()=>{for(let b of l){let S=await b.key,k=await b.value;if(S.status==="aborted"||k.status==="aborted")return I;(S.status==="dirty"||k.status==="dirty")&&i.dirty(),f.set(S.value,k.value)}return{status:i.value,value:f}})}else{let f=new Map;for(let b of l){let S=b.key,k=b.value;if(S.status==="aborted"||k.status==="aborted")return I;(S.status==="dirty"||k.status==="dirty")&&i.dirty(),f.set(S.value,k.value)}return{status:i.value,value:f}}}};ke.create=(n,r,i)=>new ke({valueType:r,keyType:n,typeName:O.ZodMap,...M(i)});var Oe=class n extends w{_parse(r){let{status:i,ctx:a}=this._processInputParams(r);if(a.parsedType!==C.set)return y(a,{code:z.invalid_type,expected:C.set,received:a.parsedType}),I;let d=this._def;d.minSize!==null&&a.data.size<d.minSize.value&&(y(a,{code:z.too_small,minimum:d.minSize.value,type:"set",inclusive:!0,exact:!1,message:d.minSize.message}),i.dirty()),d.maxSize!==null&&a.data.size>d.maxSize.value&&(y(a,{code:z.too_big,maximum:d.maxSize.value,type:"set",inclusive:!0,exact:!1,message:d.maxSize.message}),i.dirty());let c=this._def.valueType;function l(b){let S=new Set;for(let k of b){if(k.status==="aborted")return I;k.status==="dirty"&&i.dirty(),S.add(k.value)}return{status:i.value,value:S}}let f=[...a.data.values()].map((b,S)=>c._parse(new G(a,b,a.path,S)));return a.common.async?Promise.all(f).then(b=>l(b)):l(f)}min(r,i){return new n({...this._def,minSize:{value:r,message:v.toString(i)}})}max(r,i){return new n({...this._def,maxSize:{value:r,message:v.toString(i)}})}size(r,i){return this.min(r,i).max(r,i)}nonempty(r){return this.min(1,r)}};Oe.create=(n,r)=>new Oe({valueType:n,minSize:null,maxSize:null,typeName:O.ZodSet,...M(r)});var Ne=class n extends w{constructor(){super(...arguments),this.validate=this.implement}_parse(r){let{ctx:i}=this._processInputParams(r);if(i.parsedType!==C.function)return y(i,{code:z.invalid_type,expected:C.function,received:i.parsedType}),I;function a(f,b){return je({data:f,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Se(),Y].filter(S=>!!S),issueData:{code:z.invalid_arguments,argumentsError:b}})}function d(f,b){return je({data:f,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Se(),Y].filter(S=>!!S),issueData:{code:z.invalid_return_type,returnTypeError:b}})}let c={errorMap:i.common.contextualErrorMap},l=i.data;if(this._def.returns instanceof ne){let f=this;return P(async function(...b){let S=new A([]),k=await f._def.args.parseAsync(b,c).catch(Q=>{throw S.addIssue(a(b,Q)),S}),T=await Reflect.apply(l,this,k);return await f._def.returns._def.type.parseAsync(T,c).catch(Q=>{throw S.addIssue(d(T,Q)),S})})}else{let f=this;return P(function(...b){let S=f._def.args.safeParse(b,c);if(!S.success)throw new A([a(b,S.error)]);let k=Reflect.apply(l,this,S.data),T=f._def.returns.safeParse(k,c);if(!T.success)throw new A([d(k,T.error)]);return T.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...r){return new n({...this._def,args:$.create(r).rest(X.create())})}returns(r){return new n({...this._def,returns:r})}implement(r){return this.parse(r)}strictImplement(r){return this.parse(r)}static create(r,i,a){return new n({args:r||$.create([]).rest(X.create()),returns:i||X.create(),typeName:O.ZodFunction,...M(a)})}},fe=class extends w{get schema(){return this._def.getter()}_parse(r){let{ctx:i}=this._processInputParams(r);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}};fe.create=(n,r)=>new fe({getter:n,typeName:O.ZodLazy,...M(r)});var ge=class extends w{_parse(r){if(r.data!==this._def.value){let i=this._getOrReturnCtx(r);return y(i,{received:i.data,code:z.invalid_literal,expected:this._def.value}),I}return{status:"valid",value:r.data}}get value(){return this._def.value}};ge.create=(n,r)=>new ge({value:n,typeName:O.ZodLiteral,...M(r)});function tt(n,r){return new he({values:n,typeName:O.ZodEnum,...M(r)})}var he=class n extends w{_parse(r){if(typeof r.data!="string"){let i=this._getOrReturnCtx(r),a=this._def.values;return y(i,{expected:B.joinValues(a),received:i.parsedType,code:z.invalid_type}),I}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(r.data)){let i=this._getOrReturnCtx(r),a=this._def.values;return y(i,{received:i.data,code:z.invalid_enum_value,options:a}),I}return P(r.data)}get options(){return this._def.values}get enum(){let r={};for(let i of this._def.values)r[i]=i;return r}get Values(){let r={};for(let i of this._def.values)r[i]=i;return r}get Enum(){let r={};for(let i of this._def.values)r[i]=i;return r}extract(r,i=this._def){return n.create(r,{...this._def,...i})}exclude(r,i=this._def){return n.create(this.options.filter(a=>!r.includes(a)),{...this._def,...i})}};he.create=tt;var ze=class extends w{_parse(r){let i=B.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(r);if(a.parsedType!==C.string&&a.parsedType!==C.number){let d=B.objectValues(i);return y(a,{expected:B.joinValues(d),received:a.parsedType,code:z.invalid_type}),I}if(this._cache||(this._cache=new Set(B.getValidEnumValues(this._def.values))),!this._cache.has(r.data)){let d=B.objectValues(i);return y(a,{received:a.data,code:z.invalid_enum_value,options:d}),I}return P(r.data)}get enum(){return this._def.values}};ze.create=(n,r)=>new ze({values:n,typeName:O.ZodNativeEnum,...M(r)});var ne=class extends w{unwrap(){return this._def.type}_parse(r){let{ctx:i}=this._processInputParams(r);if(i.parsedType!==C.promise&&i.common.async===!1)return y(i,{code:z.invalid_type,expected:C.promise,received:i.parsedType}),I;let a=i.parsedType===C.promise?i.data:Promise.resolve(i.data);return P(a.then(d=>this._def.type.parseAsync(d,{path:i.path,errorMap:i.common.contextualErrorMap})))}};ne.create=(n,r)=>new ne({type:n,typeName:O.ZodPromise,...M(r)});var N=class extends w{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===O.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(r){let{status:i,ctx:a}=this._processInputParams(r),d=this._def.effect||null,c={addIssue:l=>{y(a,l),l.fatal?i.abort():i.dirty()},get path(){return a.path}};if(c.addIssue=c.addIssue.bind(c),d.type==="preprocess"){let l=d.transform(a.data,c);if(a.common.async)return Promise.resolve(l).then(async f=>{if(i.value==="aborted")return I;let b=await this._def.schema._parseAsync({data:f,path:a.path,parent:a});return b.status==="aborted"?I:b.status==="dirty"?ie(b.value):i.value==="dirty"?ie(b.value):b});{if(i.value==="aborted")return I;let f=this._def.schema._parseSync({data:l,path:a.path,parent:a});return f.status==="aborted"?I:f.status==="dirty"?ie(f.value):i.value==="dirty"?ie(f.value):f}}if(d.type==="refinement"){let l=f=>{let b=d.refinement(f,c);if(a.common.async)return Promise.resolve(b);if(b instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return f};if(a.common.async===!1){let f=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return f.status==="aborted"?I:(f.status==="dirty"&&i.dirty(),l(f.value),{status:i.value,value:f.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(f=>f.status==="aborted"?I:(f.status==="dirty"&&i.dirty(),l(f.value).then(()=>({status:i.value,value:f.value}))))}if(d.type==="transform")if(a.common.async===!1){let l=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!oe(l))return I;let f=d.transform(l.value,c);if(f instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:f}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(l=>oe(l)?Promise.resolve(d.transform(l.value,c)).then(f=>({status:i.value,value:f})):I);B.assertNever(d)}};N.create=(n,r,i)=>new N({schema:n,typeName:O.ZodEffects,effect:r,...M(i)});N.createWithPreprocess=(n,r,i)=>new N({schema:r,effect:{type:"preprocess",transform:n},typeName:O.ZodEffects,...M(i)});var D=class extends w{_parse(r){return this._getType(r)===C.undefined?P(void 0):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}};D.create=(n,r)=>new D({innerType:n,typeName:O.ZodOptional,...M(r)});var V=class extends w{_parse(r){return this._getType(r)===C.null?P(null):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}};V.create=(n,r)=>new V({innerType:n,typeName:O.ZodNullable,...M(r)});var xe=class extends w{_parse(r){let{ctx:i}=this._processInputParams(r),a=i.data;return i.parsedType===C.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:i.path,parent:i})}removeDefault(){return this._def.innerType}};xe.create=(n,r)=>new xe({innerType:n,typeName:O.ZodDefault,defaultValue:typeof r.default=="function"?r.default:()=>r.default,...M(r)});var be=class extends w{_parse(r){let{ctx:i}=this._processInputParams(r),a={...i,common:{...i.common,issues:[]}},d=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Ce(d)?d.then(c=>({status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new A(a.common.issues)},input:a.data})})):{status:"valid",value:d.status==="valid"?d.value:this._def.catchValue({get error(){return new A(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}};be.create=(n,r)=>new be({innerType:n,typeName:O.ZodCatch,catchValue:typeof r.catch=="function"?r.catch:()=>r.catch,...M(r)});var Me=class extends w{_parse(r){if(this._getType(r)!==C.nan){let a=this._getOrReturnCtx(r);return y(a,{code:z.invalid_type,expected:C.nan,received:a.parsedType}),I}return{status:"valid",value:r.data}}};Me.create=n=>new Me({typeName:O.ZodNaN,...M(n)});var Zr=Symbol("zod_brand"),Ee=class extends w{_parse(r){let{ctx:i}=this._processInputParams(r),a=i.data;return this._def.type._parse({data:a,path:i.path,parent:i})}unwrap(){return this._def.type}},Pe=class n extends w{_parse(r){let{status:i,ctx:a}=this._processInputParams(r);if(a.common.async)return(async()=>{let c=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return c.status==="aborted"?I:c.status==="dirty"?(i.dirty(),ie(c.value)):this._def.out._parseAsync({data:c.value,path:a.path,parent:a})})();{let d=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return d.status==="aborted"?I:d.status==="dirty"?(i.dirty(),{status:"dirty",value:d.value}):this._def.out._parseSync({data:d.value,path:a.path,parent:a})}}static create(r,i){return new n({in:r,out:i,typeName:O.ZodPipeline})}},ye=class extends w{_parse(r){let i=this._def.innerType._parse(r),a=d=>(oe(d)&&(d.value=Object.freeze(d.value)),d);return Ce(i)?i.then(d=>a(d)):a(i)}unwrap(){return this._def.innerType}};ye.create=(n,r)=>new ye({innerType:n,typeName:O.ZodReadonly,...M(r)});function Zo(n,r){let i=typeof n=="function"?n(r):typeof n=="string"?{message:n}:n;return typeof i=="string"?{message:i}:i}function rt(n,r={},i){return n?re.create().superRefine((a,d)=>{let c=n(a);if(c instanceof Promise)return c.then(l=>{if(!l){let f=Zo(r,a),b=f.fatal??i??!0;d.addIssue({code:"custom",...f,fatal:b})}});if(!c){let l=Zo(r,a),f=l.fatal??i??!0;d.addIssue({code:"custom",...l,fatal:f})}}):re.create()}var Qr={object:_.lazycreate},O;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(O||(O={}));var en=(n,r={message:`Input not instance of ${n.name}`})=>rt(i=>i instanceof n,r),e=te.create,o=se.create,on=Me.create,tn=ae.create,h=de.create,rn=pe.create,nn=ve.create,sn=ce.create,U=me.create,an=re.create,g=X.create,dn=L.create,pn=Ie.create,p=Z.create,t=_.create,cn=_.strictCreate,x=le.create,mn=De.create,ln=ue.create,un=$.create,u=Ge.create,fn=ke.create,gn=Oe.create,hn=Ne.create,zn=fe.create,m=ge.create,s=he.create,xn=ze.create,bn=ne.create,yn=N.create,Sn=D.create,Cn=V.create,Rn=N.createWithPreprocess,vn=Pe.create,In=()=>e().optional(),kn=()=>o().optional(),On=()=>h().optional(),Mn={string:(n=>te.create({...n,coerce:!0})),number:(n=>se.create({...n,coerce:!0})),boolean:(n=>de.create({...n,coerce:!0})),bigint:(n=>ae.create({...n,coerce:!0})),date:(n=>pe.create({...n,coerce:!0}))};var wn=I;var CR=t({name:e().min(1),permissions:t({media:p(s(["read","write"])).min(1).optional(),sessions:p(s(["read","write"])).min(1).optional(),projects:p(s(["read","write"])).min(1).optional(),renders:p(s(["read","write"])).min(1).optional(),webhooks:p(s(["read","write"])).min(1).optional(),billing:p(s(["read","write"])).min(1).optional()}).strict().describe("Resource \u2192 actions grant. Resources: media, sessions, projects, renders, webhooks, billing. Actions: read, write. Least-privilege \u2014 grant only what's needed (billing:write is required to start a checkout)."),expiresIn:o().optional().describe("Lifetime in seconds; omit for no expiry.")}).strict();var vR=t({data:p(t({featureId:e().describe("The metered plan feature (exports, compose, compose_verify, \u2026)."),value:o().optional().describe("Metered amount, in the feature's own unit (exports = render-minutes, storage = GB). Absent for a discrete single use, AND deliberately absent on the cost-plus lines (compose, generate, ai_tokens, compose_verify) whose internal metered unit is not a quantity \u2014 read `listUsd` for what those events cost you."),projectId:e().optional(),jobId:e().optional().describe("The job/render/compose/media id that produced the meter."),jobKind:e().optional().describe("render | compose | consult_* | verify | preview | generate | session_uptime | \u2026"),listUsd:o().optional().describe("LIST price of this metered event, USD. Honest naming: the invoice may zero it inside a plan allowance \u2014 this is the event's list price, not a Stripe line item."),createdAt:o().describe("Epoch-ms when the meter landed.")})),pagination:t({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}),IR=t({plans:p(t({id:e().describe("Autumn product id (e.g. pro, pro_yearly)."),tier:e().describe("Plan tier: pro | business | studio."),name:e(),interval:e().describe("month | year."),priceUsd:o().describe("Price in USD for the interval.")})).describe("Every purchasable {tier, interval} and its product id."),billingConfigured:h()});var kR=t({plan:s(["credit_pack_10","credit_pack_30","credit_pack_100"]).describe("Plan tier to subscribe to."),interval:s(["month","year"]).describe("Billing interval: 'month' (monthly) or 'year' (annual, ~2 months free).")}).strict(),OR=t({url:e().describe("Hosted Stripe checkout URL to open in a browser to complete payment. Always present on success \u2014 an existing saved card is never charged without confirming here."),plan:e(),interval:e(),productId:e().describe("Resolved Autumn product id.")});var Bn=300,Tn=0,jn=1e4,En=120,Pn=24,An=40,_n=500,qn=0,Fn=5e3,Dn=0,Gn=5e3,Nn=0,Un=2e3,Kn=0,Ln=24,Wn=0,Hn=1,$n=300,Vn=24,Yn=4e3,Jn=0,Xn=60,Zn=6,Qn=24,ei=60,wR=t({data:p(t({id:e(),name:e(),description:e().nullable(),tagline:e().nullable(),colors:u(e(),e()),extraColors:p(t({name:e(),value:e()})).optional(),fonts:t({heading:t({family:e(),weight:x([o(),e()]).optional()}).nullable(),body:t({family:e(),weight:x([o(),e()]).optional()}).nullable()}),voiceGuidelines:e().nullable(),captions:t({sync:h(),profile:u(e(),g()).nullable()}),motion:t({duration:o().optional(),easing:x([s(["linear","ease","ease-in","ease-out","ease-in-out"]),t({kind:m("cubic-bezier"),x1:o(),y1:o(),x2:o(),y2:o()})]).optional(),entrance:s(["none","fade","word-pop","stagger-up"]).optional(),staggerMs:o().optional(),exitMs:o().optional()}).optional(),logo:t({src:e(),alt:e().optional(),placement:s(["tl","tr","bl","br"]).optional(),sizePct:o().optional()}).optional(),intro:t({kind:s(["card","video"]),src:e().optional(),title:e().optional(),subtitle:e().optional(),durationMs:o().optional()}).optional(),outro:t({kind:s(["card","video"]),src:e().optional(),title:e().optional(),subtitle:e().optional(),durationMs:o().optional()}).optional(),watermark:t({src:e(),opacity:o().optional(),placement:s(["tl","tr","bl","br"]).optional()}).optional(),spacing:t({base:o().optional(),lg:o().optional(),sm:o().optional()}).optional(),sizing:t({fontSizeHeading:o().optional(),fontSizeBody:o().optional(),fontSizeLabel:o().optional(),borderRadius:o().optional()}).optional(),audio:t({sfxIntensity:s(["off","light","standard","dense"]).optional(),musicEnabled:h().optional(),musicMood:e().max(Bn).optional(),sonicLogo:t({ref:e().min(1),placement:s(["intro","outro","both"]),offsetMs:o().min(Tn).max(jn).optional()}).optional().describe("A brand sound signature bound to the intro/outro bookend. `ref` = a palette reference; bound only when the kit carries the matching bumper (intro/outro), else a non-blocking advisory."),uiSoundSet:t({tick:e().min(1).optional(),pop:e().min(1).optional(),impact:e().min(1).optional(),confirm:e().min(1).optional(),error:e().min(1).optional(),whoosh:e().min(1).optional(),riser:e().min(1).optional()}).optional().describe("Per-family SFX overrides (the brand's own tick/pop/\u2026). Highest-priority tier over the org palette + pack default in the compose SFX draw."),bedStyle:t({bedId:e().min(1).optional(),genre:e().max(En).optional(),bpmRange:t({min:o(),max:o()}).optional()}).optional().describe("Preferred music bed (`bedId`) or a style hint (`genre` / `bpmRange`). Surfaced for driving agents; compose does not auto-select a pack bed."),ambiencePreference:t({ref:e().min(1)}).nullish().describe("Preferred ambience bed (`{ref}`) or explicit null (opt-out). Surfaced for driving agents; compose has no ambience auto-placement.")}).optional(),exemplarKeys:p(e().min(1)).max(Pn).optional(),contactSheetKey:e().min(1).optional(),motifs:p(t({id:e().min(1).max(An),observed:e().min(1).max(_n),body:x([t({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional()}),t({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()).optional()}),t({kind:m("component"),componentId:e().min(1),props:u(e(),g()).optional()})]),motion:t({preset:s(["fade-up","slide-in-left","slide-in-right","scale-pop","stagger-reveal"]),enterMs:o().min(qn).max(Fn).optional(),exitMs:o().min(Dn).max(Gn).optional(),staggerMs:o().min(Nn).max(Un).optional(),confidence:s(["high","low"]).optional()}).optional(),role:s(["title-card","stat","lower-third","pull-quote","hero","logo-tag","enumeration","sequence","comparison"]),zone:t({x:o(),y:o(),w:o(),h:o()}).optional(),evidence:p(o().min(Kn)).max(Ln).optional(),diffScore:o().min(Wn).max(Hn).optional(),coverage:s(["reproduced","approximated","skipped"]),skipReason:e().max($n).optional()})).max(Vn).optional(),styleRubric:e().max(Yn).optional(),density:t({graphicsPerMin:o().min(Jn).max(Xn),maxSimultaneous:o().min(1).max(Zn)}).optional(),inspiration:t({sources:p(e()).min(1).max(Qn),extractedAt:o(),extractionVersion:e().min(1).max(ei)}).optional(),createdAt:e(),updatedAt:e()}).describe("Brand kit response per \xA7Brand Kits.")),pagination:t({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}),oi=200,ti=200,ri=2e3,ni=500,ii=500,si=5e3,ai=0,di=1,pi=300,ci=0,mi=1e4,li=120,ui=24,fi=40,gi=500,hi=0,zi=5e3,xi=0,bi=5e3,yi=0,Si=2e3,Ci=0,Ri=24,vi=0,Ii=1,ki=300,Oi=24,Mi=4e3,wi=0,Bi=60,Ti=6,ji=24,Ei=60,BR=t({kitId:e().min(1).max(oi),name:e().min(1).max(ti),description:e().max(ri).optional(),tagline:e().max(ni).optional(),secondaryTagline:e().max(ii).optional(),colors:t({primary:e().min(1),secondary:e().min(1),accent:e().min(1),background:e().min(1),text:e().min(1)}).strict(),extraColors:p(t({hex:e().min(1),label:e().min(1),usage:e().optional()}).strict()).optional(),headingFont:t({fontFamily:e().min(1),fontWeight:o()}).strict(),bodyFont:t({fontFamily:e().min(1),fontWeight:o()}).strict(),voiceGuidelines:e().max(si).optional(),syncCaptions:h().optional(),captionProfile:t({fontFamily:e().optional(),fontSize:o().optional(),fontWeight:o().optional(),color:e().optional(),highlightColor:e().optional(),backgroundColor:e().optional(),plate:s(["glass","solid","none"]).optional(),position:s(["top","center","bottom"]).optional(),textTransform:s(["none","uppercase"]).optional(),entrance:s(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:o().optional(),entranceStaggerMs:o().optional(),exitMs:o().optional(),emphasisColor:e().optional(),emphasisScale:o().optional(),emphasisFontFamily:e().optional(),emphasisFontWeight:o().optional(),emphasisFontStyle:s(["normal","italic"]).optional(),emphasisTextTransform:s(["none","uppercase"]).optional(),emphasisLetterSpacing:o().optional(),emphasisPlate:h().optional(),emphasisPlateColor:e().optional(),emphasisPlateTextColor:e().optional()}).strict().optional(),motion:t({duration:o().optional(),easing:x([s(["linear","ease","ease-in","ease-out","ease-in-out"]),t({kind:m("cubic-bezier"),x1:o(),y1:o(),x2:o(),y2:o()}).strict()]).optional(),entrance:s(["none","fade","word-pop","stagger-up"]).optional(),staggerMs:o().optional(),exitMs:o().optional()}).strict().optional(),logo:t({src:e().min(1),alt:e().optional(),placement:s(["tl","tr","bl","br"]).optional(),sizePct:o().optional()}).strict().optional(),intro:t({kind:s(["card","video"]),src:e().min(1).optional(),title:e().optional(),subtitle:e().optional(),durationMs:o().optional()}).strict().optional(),outro:t({kind:s(["card","video"]),src:e().min(1).optional(),title:e().optional(),subtitle:e().optional(),durationMs:o().optional()}).strict().optional(),watermark:t({src:e().min(1),opacity:o().min(ai).max(di).optional(),placement:s(["tl","tr","bl","br"]).optional()}).strict().optional(),spacing:t({base:o().optional(),lg:o().optional(),sm:o().optional()}).strict().optional(),sizing:t({fontSizeHeading:o().optional(),fontSizeBody:o().optional(),fontSizeLabel:o().optional(),borderRadius:o().optional()}).strict().optional(),audio:t({sfxIntensity:s(["off","light","standard","dense"]).optional(),musicEnabled:h().optional(),musicMood:e().max(pi).optional(),sonicLogo:t({ref:e().min(1),placement:s(["intro","outro","both"]),offsetMs:o().min(ci).max(mi).optional()}).strict().optional().describe("A brand sound signature bound to the intro/outro bookend. `ref` = a palette reference; bound only when the kit carries the matching bumper (intro/outro), else a non-blocking advisory."),uiSoundSet:t({tick:e().min(1).optional(),pop:e().min(1).optional(),impact:e().min(1).optional(),confirm:e().min(1).optional(),error:e().min(1).optional(),whoosh:e().min(1).optional(),riser:e().min(1).optional()}).strict().optional().describe("Per-family SFX overrides (the brand's own tick/pop/\u2026). Highest-priority tier over the org palette + pack default in the compose SFX draw."),bedStyle:t({bedId:e().min(1).optional(),genre:e().max(li).optional(),bpmRange:t({min:o(),max:o()}).strict().optional()}).strict().optional().describe("Preferred music bed (`bedId`) or a style hint (`genre` / `bpmRange`). Surfaced for driving agents; compose does not auto-select a pack bed."),ambiencePreference:t({ref:e().min(1)}).strict().nullish().describe("Preferred ambience bed (`{ref}`) or explicit null (opt-out). Surfaced for driving agents; compose has no ambience auto-placement.")}).strict().optional(),exemplarKeys:p(e().min(1)).max(ui).optional(),contactSheetKey:e().min(1).optional(),motifs:p(t({id:e().min(1).max(fi),observed:e().min(1).max(gi),body:x([t({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional()}).strict(),t({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()).optional()}).strict(),t({kind:m("component"),componentId:e().min(1),props:u(e(),g()).optional()}).strict()]),motion:t({preset:s(["fade-up","slide-in-left","slide-in-right","scale-pop","stagger-reveal"]),enterMs:o().min(hi).max(zi).optional(),exitMs:o().min(xi).max(bi).optional(),staggerMs:o().min(yi).max(Si).optional(),confidence:s(["high","low"]).optional()}).strict().optional(),role:s(["title-card","stat","lower-third","pull-quote","hero","logo-tag","enumeration","sequence","comparison"]),zone:t({x:o(),y:o(),w:o(),h:o()}).strict().optional(),evidence:p(o().min(Ci)).max(Ri).optional(),diffScore:o().min(vi).max(Ii).optional(),coverage:s(["reproduced","approximated","skipped"]),skipReason:e().max(ki).optional()}).strict()).max(Oi).optional(),styleRubric:e().max(Mi).optional(),density:t({graphicsPerMin:o().min(wi).max(Bi),maxSimultaneous:o().min(1).max(Ti)}).strict().optional(),inspiration:t({sources:p(e()).min(1).max(ji),extractedAt:o(),extractionVersion:e().min(1).max(Ei)}).strict().optional()}).strict().describe("POST /brand-kits body. Org/user are server-resolved; never accepted from the body."),TR=t({url:e().url()}).strict().describe("POST /brand-kits/extract body \u2014 the website URL to extract brand tokens from."),jR=t({id:e()}),Pi=300,Ai=0,_i=1e4,qi=120,Fi=24,Di=40,Gi=500,Ni=0,Ui=5e3,Ki=0,Li=5e3,Wi=0,Hi=2e3,$i=0,Vi=24,Yi=0,Ji=1,Xi=300,Zi=24,Qi=4e3,es=0,os=60,ts=6,rs=24,ns=60,ER=t({id:e(),name:e(),description:e().nullable(),tagline:e().nullable(),colors:u(e(),e()),extraColors:p(t({name:e(),value:e()})).optional(),fonts:t({heading:t({family:e(),weight:x([o(),e()]).optional()}).nullable(),body:t({family:e(),weight:x([o(),e()]).optional()}).nullable()}),voiceGuidelines:e().nullable(),captions:t({sync:h(),profile:u(e(),g()).nullable()}),motion:t({duration:o().optional(),easing:x([s(["linear","ease","ease-in","ease-out","ease-in-out"]),t({kind:m("cubic-bezier"),x1:o(),y1:o(),x2:o(),y2:o()})]).optional(),entrance:s(["none","fade","word-pop","stagger-up"]).optional(),staggerMs:o().optional(),exitMs:o().optional()}).optional(),logo:t({src:e(),alt:e().optional(),placement:s(["tl","tr","bl","br"]).optional(),sizePct:o().optional()}).optional(),intro:t({kind:s(["card","video"]),src:e().optional(),title:e().optional(),subtitle:e().optional(),durationMs:o().optional()}).optional(),outro:t({kind:s(["card","video"]),src:e().optional(),title:e().optional(),subtitle:e().optional(),durationMs:o().optional()}).optional(),watermark:t({src:e(),opacity:o().optional(),placement:s(["tl","tr","bl","br"]).optional()}).optional(),spacing:t({base:o().optional(),lg:o().optional(),sm:o().optional()}).optional(),sizing:t({fontSizeHeading:o().optional(),fontSizeBody:o().optional(),fontSizeLabel:o().optional(),borderRadius:o().optional()}).optional(),audio:t({sfxIntensity:s(["off","light","standard","dense"]).optional(),musicEnabled:h().optional(),musicMood:e().max(Pi).optional(),sonicLogo:t({ref:e().min(1),placement:s(["intro","outro","both"]),offsetMs:o().min(Ai).max(_i).optional()}).optional().describe("A brand sound signature bound to the intro/outro bookend. `ref` = a palette reference; bound only when the kit carries the matching bumper (intro/outro), else a non-blocking advisory."),uiSoundSet:t({tick:e().min(1).optional(),pop:e().min(1).optional(),impact:e().min(1).optional(),confirm:e().min(1).optional(),error:e().min(1).optional(),whoosh:e().min(1).optional(),riser:e().min(1).optional()}).optional().describe("Per-family SFX overrides (the brand's own tick/pop/\u2026). Highest-priority tier over the org palette + pack default in the compose SFX draw."),bedStyle:t({bedId:e().min(1).optional(),genre:e().max(qi).optional(),bpmRange:t({min:o(),max:o()}).optional()}).optional().describe("Preferred music bed (`bedId`) or a style hint (`genre` / `bpmRange`). Surfaced for driving agents; compose does not auto-select a pack bed."),ambiencePreference:t({ref:e().min(1)}).nullish().describe("Preferred ambience bed (`{ref}`) or explicit null (opt-out). Surfaced for driving agents; compose has no ambience auto-placement.")}).optional(),exemplarKeys:p(e().min(1)).max(Fi).optional(),contactSheetKey:e().min(1).optional(),motifs:p(t({id:e().min(1).max(Di),observed:e().min(1).max(Gi),body:x([t({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional()}),t({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()).optional()}),t({kind:m("component"),componentId:e().min(1),props:u(e(),g()).optional()})]),motion:t({preset:s(["fade-up","slide-in-left","slide-in-right","scale-pop","stagger-reveal"]),enterMs:o().min(Ni).max(Ui).optional(),exitMs:o().min(Ki).max(Li).optional(),staggerMs:o().min(Wi).max(Hi).optional(),confidence:s(["high","low"]).optional()}).optional(),role:s(["title-card","stat","lower-third","pull-quote","hero","logo-tag","enumeration","sequence","comparison"]),zone:t({x:o(),y:o(),w:o(),h:o()}).optional(),evidence:p(o().min($i)).max(Vi).optional(),diffScore:o().min(Yi).max(Ji).optional(),coverage:s(["reproduced","approximated","skipped"]),skipReason:e().max(Xi).optional()})).max(Zi).optional(),styleRubric:e().max(Qi).optional(),density:t({graphicsPerMin:o().min(es).max(os),maxSimultaneous:o().min(1).max(ts)}).optional(),inspiration:t({sources:p(e()).min(1).max(rs),extractedAt:o(),extractionVersion:e().min(1).max(ns)}).optional(),createdAt:e(),updatedAt:e()}).describe("Brand kit response per \xA7Brand Kits."),PR=t({id:e()}),is=12,AR=t({motifId:e().min(1).optional(),limit:o().min(1).max(is).optional()}).strict().describe("POST /brand-kits/{id}/exemplars body \u2014 select which exemplar frames to presign."),_R=t({exemplars:p(t({index:o(),url:e()})),contactSheetUrl:e().optional()}),ss=24,qR=t({count:o().min(1).max(ss),contentType:s(["image/jpeg","image/png"]).optional(),includeContactSheet:h().optional()}).strict().describe("POST /brand-kits/exemplar-uploads body. Reserve presigned PUT slots for curated reference frames (\u2264720px recommended \u2014 they are vision input tokens downstream).");var as=200,ds=2e3,ps=500,cs=100,ms=3600,ls=500,us=500,fs=35,gs=500,hs=2e3,zs=0,xs=80,bs=8,ys=24,Ss=24,Cs=12,Rs=24,vs=0,Is=0,ks=0,Os=0,Ms=0,ws=0,Bs=4,Ts=0,js=0,Es=0,Ps=0,As=0,_s=0,qs=0,Fs=1,Ds=0,Gs=1,Ns=.1,Us=1,Ks=0,Ls=0,Ws=-.3,Hs=.3,$s=-.3,Vs=.3,Ys=0,Js=1,Xs=0,Zs=1,Qs=-.3,ea=.3,oa=0,ta=1,ra=0,na=1,ia=0,sa=1,aa=1,da=1,pa=16,ca=8,ma=3,la=300,DR=t({projectId:e().min(1),name:e().max(as).optional(),goal:e().min(1).max(ds).describe("What the video must accomplish."),audience:e().max(ps).optional(),platform:e().max(cs).optional(),format:t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional()}).strict().optional().describe("Output-format spec per \xA7Format."),durationSec:o().max(ms).optional().describe("Target output duration. HONOR-OR-REFUSE: compose validates it against the beat-source window (\xB11.5s) and refuses a brief it cannot honor."),tone:e().max(ls).optional(),cta:e().max(us).optional(),locale:e().max(fs).optional().describe("Output language (BCP-47 tag, e.g. 'es-419'): ALL on-screen copy + captions."),hook:e().max(gs).optional(),caption:e().max(hs).optional(),beats:p(t({id:e().min(1),intent:e().min(1).describe("What this beat DOES editorially (hook the claim, prove it, CTA\u2026)."),durationSec:o().optional(),source:t({mediaId:e().min(1),startSec:o().min(zs),endSec:o()}).strict().optional().describe("MOMENT PINNING: this beat uses EXACTLY this window of this media item \u2014 honored to-the-frame or refused. v1: every sourced beat must reference the SAME mediaId (multi-source briefs are refused loudly, not silently merged)."),graphic:t({role:s(["title-card","stat","lower-third","pull-quote","hero","logo-tag","enumeration","sequence","comparison"]).describe("The mandated graphic's editorial role (the graphics-plan GraphicRole vocabulary)."),items:p(e().min(1).max(xs)).max(bs).optional().describe("Mandated list items (enumeration/sequence) \u2014 carried VERBATIM into the plan's copy.items.")}).strict().optional().describe("GRAPHICS MANDATE: the plan MUST carry a graphics request of this role overlapping this beat's window \u2014 enforced at the plan gate (honor-or-refuse, like moment pinning). Prose mustIncludes reaches only the judge; this is the checkable form.")}).strict()).max(ys).optional(),mustIncludes:p(e().min(1)).max(Ss).optional(),references:p(e()).max(Cs).optional(),captions:t({styleId:e().min(1).optional().describe("Caption style id (e.g. 'serif-emphasis@1')."),emphasisPhrases:p(e().min(1)).max(Rs).optional().describe("Phrases rendered in the caption EMPHASIS style (the big-serif treatment). Matched against the transcript; drives CaptionWord.emphasis.")}).strict().optional(),motionStyle:t({textAnimation:e().optional(),transitions:e().optional(),colorMood:e().optional(),captionStyle:e().optional()}).strict().optional(),seededGraphics:p(t({id:e().min(1),startTime:o().min(vs).describe("Timeline start (seconds)."),duration:o().describe("Clip duration (seconds)."),source:x([t({kind:m("media"),mediaId:e().min(1),trim:t({start:o().min(Is).describe("Source trim start (seconds)."),end:o().min(ks).describe("Source trim end (seconds).")}).strict().optional(),excludedRanges:p(t({start:o().min(Os),end:o().min(Ms),reason:e().optional()}).strict()).optional(),volume:o().min(ws).max(Bs).optional(),muted:h().optional(),playbackRate:o().optional(),sync:s(["video","independent"]).optional(),kenBurns:s(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(Ts).optional(),fadeOutMs:o().min(js).optional(),loop:h().optional(),audioRole:s(["sfx","music","vo","ambience"]).optional(),duck:t({duckDb:o().max(Es),attackMs:o().min(Ps),releaseMs:o().min(As),windows:p(t({startMs:o(),endMs:o()}).strict()).optional()}).strict().optional(),anchor:t({clipId:e().min(1),offsetMs:o()}).strict().optional(),reframe:t({segments:p(t({startSec:o().min(_s).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:o().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:x([t({mode:m("frame-center")}).strict(),t({mode:m("point"),x:o().min(qs).max(Fs),y:o().min(Ds).max(Gs)}).strict(),t({mode:m("face"),faceId:e().min(1),shotScale:s(["close","standard","wide"]).optional()}).strict(),t({mode:m("all-faces")}).strict(),t({mode:m("active-speaker")}).strict()]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:o().min(Ns).max(Us).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:t({in:o().min(Ks).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(Ls).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).strict().optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:t({x:o().min(Ws).max(Hs).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min($s).max(Vs).describe("Vertical nudge, source-normalized (+ = down).")}).strict().optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")}).strict()).min(1)}).strict().optional()}).strict(),t({kind:m("component"),componentId:e().min(1),props:u(e(),g())}).strict(),t({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:s(["front","behind-subject"]).optional(),anchor:t({space:m("scene"),x:o().min(Ys).max(Js),y:o().min(Xs).max(Zs)}).strict().optional(),parallax:o().min(Qs).max(ea).optional()}).strict(),t({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}).strict(),t({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()}).strict()]),kind:s(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(oa).max(ta).optional(),scale:o().optional(),rotation:o().optional(),position:t({x:o(),y:o()}).strict().optional(),region:t({x:o().min(ra).max(na),y:o().min(ia).max(sa),w:o().max(aa),h:o().max(da)}).strict().optional(),fit:s(["cover","contain"]).optional(),effects:p(t({primitiveId:e().min(1),params:u(e(),g()).optional()}).strict()).optional(),transitionIn:t({type:e().min(1),duration:o()}).strict().optional()}).strict()).max(pa).optional().describe("Client-authored graphic clips the Director must carry VERBATIM: seeded into the design loop's base composition as LOCKED clips (never re-authored, never discarded)."),exclusions:p(s(["overlay","component","card","no-transitions"])).max(ca).optional(),gates:t({holdAt:p(s(["content","layout","motion"])).max(ma).optional().describe("Checkpoint gates \u2014 the compose pauses at each named stage for review via resume. DEFAULT (gates absent): the compose holds at EVERY stage \u2014 your agent reviews and resumes each one; an unreviewed checkpoint times out loudly after 60min. Auto-progression is the opt-in (gates.autoApprove: true)."),autoApprove:h().optional().describe("true = fully autonomous (compose runs with NO gates \u2014 the headless opt-in; without it a brief holds at every stage by default). Mutually exclusive with a non-empty holdAt."),reviewMode:s(["agent","hosted"]).optional().describe("Who captures the review decision. Default 'agent': you relay the packet and call resume. 'hosted': every checkpoint mints a review-page URL (checkpoint.ready payload + get_checkpoint's reviewUrl) where a human approves/revises from the browser \u2014 no account, no agent session; the recorded decision rides the SAME resume rail and you learn of it via checkpoint webhooks / wait_job.")}).strict().optional(),audio:t({music:t({enabled:h().describe("Whether the compose carries a music bed."),mood:e().max(la).optional().describe("Freeform mood/genre prompt for the GENERATED bed (e.g. 'understated editorial, warm'). Ignored when mediaId pins a track."),mediaId:e().min(1).optional().describe("Pin a client-imported track as the bed. HONOR-OR-REFUSE: must be an org-owned kind:'audio' media item, else 422 \u2014 never accept-and-ignore. Absent \u21D2 generate from mood.")}).strict().optional(),sfx:t({intensity:s(["off","light","standard","dense"]).describe("SFX placement density. Real-footage content keeps restraint caps regardless ('dense' is the explicit opt-out); generated/graphic-led content unlocks the standard tier.")}).strict().optional()}).strict().optional()}).strict(),ua=200,fa=2e3,ga=500,ha=100,za=3600,xa=500,ba=500,ya=35,Sa=500,Ca=2e3,Ra=0,va=80,Ia=8,ka=24,Oa=24,Ma=12,wa=24,Ba=0,Ta=0,ja=0,Ea=0,Pa=0,Aa=0,_a=4,qa=0,Fa=0,Da=0,Ga=0,Na=0,Ua=0,Ka=0,La=1,Wa=0,Ha=1,$a=.1,Va=1,Ya=0,Ja=0,Xa=-.3,Za=.3,Qa=-.3,ed=.3,od=0,td=1,rd=0,nd=1,id=-.3,sd=.3,ad=0,dd=1,pd=0,cd=1,md=0,ld=1,ud=1,fd=1,gd=16,hd=8,zd=3,xd=300,GR=t({data:p(t({id:e(),projectId:e(),kind:s(["authored","clip"]).describe("authored = create_brief; clip = minted by suggest_briefs from an AI clip suggestion."),sourceSuggestionId:e().optional().describe("kind:'clip' provenance \u2014 the suggestion this Brief was minted from."),name:e().max(ua).optional(),goal:e().min(1).max(fa).describe("What the video must accomplish."),audience:e().max(ga).optional(),platform:e().max(ha).optional(),format:t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional()}).optional().describe("Output-format spec per \xA7Format."),durationSec:o().max(za).optional().describe("Target output duration. HONOR-OR-REFUSE: compose validates it against the beat-source window (\xB11.5s) and refuses a brief it cannot honor."),tone:e().max(xa).optional(),cta:e().max(ba).optional(),locale:e().max(ya).optional().describe("Output language (BCP-47 tag, e.g. 'es-419'): ALL on-screen copy + captions."),hook:e().max(Sa).optional(),caption:e().max(Ca).optional(),beats:p(t({id:e().min(1),intent:e().min(1).describe("What this beat DOES editorially (hook the claim, prove it, CTA\u2026)."),durationSec:o().optional(),source:t({mediaId:e().min(1),startSec:o().min(Ra),endSec:o()}).optional().describe("MOMENT PINNING: this beat uses EXACTLY this window of this media item \u2014 honored to-the-frame or refused. v1: every sourced beat must reference the SAME mediaId (multi-source briefs are refused loudly, not silently merged)."),graphic:t({role:s(["title-card","stat","lower-third","pull-quote","hero","logo-tag","enumeration","sequence","comparison"]).describe("The mandated graphic's editorial role (the graphics-plan GraphicRole vocabulary)."),items:p(e().min(1).max(va)).max(Ia).optional().describe("Mandated list items (enumeration/sequence) \u2014 carried VERBATIM into the plan's copy.items.")}).optional().describe("GRAPHICS MANDATE: the plan MUST carry a graphics request of this role overlapping this beat's window \u2014 enforced at the plan gate (honor-or-refuse, like moment pinning). Prose mustIncludes reaches only the judge; this is the checkable form.")})).max(ka).optional(),mustIncludes:p(e().min(1)).max(Oa).optional(),references:p(e()).max(Ma).optional(),captions:t({styleId:e().min(1).optional().describe("Caption style id (e.g. 'serif-emphasis@1')."),emphasisPhrases:p(e().min(1)).max(wa).optional().describe("Phrases rendered in the caption EMPHASIS style (the big-serif treatment). Matched against the transcript; drives CaptionWord.emphasis.")}).optional(),motionStyle:t({textAnimation:e().optional(),transitions:e().optional(),colorMood:e().optional(),captionStyle:e().optional()}).optional(),seededGraphics:p(t({id:e().min(1),startTime:o().min(Ba).describe("Timeline start (seconds)."),duration:o().describe("Clip duration (seconds)."),source:x([t({kind:m("media"),mediaId:e().min(1),trim:t({start:o().min(Ta).describe("Source trim start (seconds)."),end:o().min(ja).describe("Source trim end (seconds).")}).optional(),excludedRanges:p(t({start:o().min(Ea),end:o().min(Pa),reason:e().optional()})).optional(),volume:o().min(Aa).max(_a).optional(),muted:h().optional(),playbackRate:o().optional(),sync:s(["video","independent"]).optional(),kenBurns:s(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(qa).optional(),fadeOutMs:o().min(Fa).optional(),loop:h().optional(),audioRole:s(["sfx","music","vo","ambience"]).optional(),duck:t({duckDb:o().max(Da),attackMs:o().min(Ga),releaseMs:o().min(Na),windows:p(t({startMs:o(),endMs:o()})).optional()}).optional(),anchor:t({clipId:e().min(1),offsetMs:o()}).optional(),reframe:t({segments:p(t({startSec:o().min(Ua).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:o().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:x([t({mode:m("frame-center")}),t({mode:m("point"),x:o().min(Ka).max(La),y:o().min(Wa).max(Ha)}),t({mode:m("face"),faceId:e().min(1),shotScale:s(["close","standard","wide"]).optional()}),t({mode:m("all-faces")}),t({mode:m("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:o().min($a).max(Va).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:t({in:o().min(Ya).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(Ja).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:t({x:o().min(Xa).max(Za).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(Qa).max(ed).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),t({kind:m("component"),componentId:e().min(1),props:u(e(),g())}),t({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:s(["front","behind-subject"]).optional(),anchor:t({space:m("scene"),x:o().min(od).max(td),y:o().min(rd).max(nd)}).optional(),parallax:o().min(id).max(sd).optional()}),t({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}),t({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()})]),kind:s(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(ad).max(dd).optional(),scale:o().optional(),rotation:o().optional(),position:t({x:o(),y:o()}).optional(),region:t({x:o().min(pd).max(cd),y:o().min(md).max(ld),w:o().max(ud),h:o().max(fd)}).optional(),fit:s(["cover","contain"]).optional(),effects:p(t({primitiveId:e().min(1),params:u(e(),g()).optional()})).optional(),transitionIn:t({type:e().min(1),duration:o()}).optional()})).max(gd).optional().describe("Client-authored graphic clips the Director must carry VERBATIM: seeded into the design loop's base composition as LOCKED clips (never re-authored, never discarded)."),exclusions:p(s(["overlay","component","card","no-transitions"])).max(hd).optional(),gates:t({holdAt:p(s(["content","layout","motion"])).max(zd).optional().describe("Checkpoint gates \u2014 the compose pauses at each named stage for review via resume. DEFAULT (gates absent): the compose holds at EVERY stage \u2014 your agent reviews and resumes each one; an unreviewed checkpoint times out loudly after 60min. Auto-progression is the opt-in (gates.autoApprove: true)."),autoApprove:h().optional().describe("true = fully autonomous (compose runs with NO gates \u2014 the headless opt-in; without it a brief holds at every stage by default). Mutually exclusive with a non-empty holdAt."),reviewMode:s(["agent","hosted"]).optional().describe("Who captures the review decision. Default 'agent': you relay the packet and call resume. 'hosted': every checkpoint mints a review-page URL (checkpoint.ready payload + get_checkpoint's reviewUrl) where a human approves/revises from the browser \u2014 no account, no agent session; the recorded decision rides the SAME resume rail and you learn of it via checkpoint webhooks / wait_job.")}).optional(),audio:t({music:t({enabled:h().describe("Whether the compose carries a music bed."),mood:e().max(xd).optional().describe("Freeform mood/genre prompt for the GENERATED bed (e.g. 'understated editorial, warm'). Ignored when mediaId pins a track."),mediaId:e().min(1).optional().describe("Pin a client-imported track as the bed. HONOR-OR-REFUSE: must be an org-owned kind:'audio' media item, else 422 \u2014 never accept-and-ignore. Absent \u21D2 generate from mood.")}).optional(),sfx:t({intensity:s(["off","light","standard","dense"]).describe("SFX placement density. Real-footage content keeps restraint caps regardless ('dense' is the explicit opt-out); generated/graphic-led content unlocks the standard tier.")}).optional()}).optional(),quote:t({composeUsd:o(),renderUsdPerExport:o(),estimatedJourneyUsd:o().describe("compose + expected renders \u2014 relay this BEFORE composing."),revisionCyclesIncluded:o().describe("Revise cycles the compose price includes per gate (A1). Beyond this, resume(revise) is refused with `revision_cycles_exhausted` \u2014 saying no never silently charges.")}),createdAt:o(),updatedAt:o()})),pagination:t({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}),NR=t({id:e()}),bd=200,yd=2e3,Sd=500,Cd=100,Rd=3600,vd=500,Id=500,kd=35,Od=500,Md=2e3,wd=0,Bd=80,Td=8,jd=24,Ed=24,Pd=12,Ad=24,_d=0,qd=0,Fd=0,Dd=0,Gd=0,Nd=0,Ud=4,Kd=0,Ld=0,Wd=0,Hd=0,$d=0,Vd=0,Yd=0,Jd=1,Xd=0,Zd=1,Qd=.1,ep=1,op=0,tp=0,rp=-.3,np=.3,ip=-.3,sp=.3,ap=0,dp=1,pp=0,cp=1,mp=-.3,lp=.3,up=0,fp=1,gp=0,hp=1,zp=0,xp=1,bp=1,yp=1,Sp=16,Cp=8,Rp=3,vp=300,UR=t({id:e(),projectId:e(),kind:s(["authored","clip"]).describe("authored = create_brief; clip = minted by suggest_briefs from an AI clip suggestion."),sourceSuggestionId:e().optional().describe("kind:'clip' provenance \u2014 the suggestion this Brief was minted from."),name:e().max(bd).optional(),goal:e().min(1).max(yd).describe("What the video must accomplish."),audience:e().max(Sd).optional(),platform:e().max(Cd).optional(),format:t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional()}).optional().describe("Output-format spec per \xA7Format."),durationSec:o().max(Rd).optional().describe("Target output duration. HONOR-OR-REFUSE: compose validates it against the beat-source window (\xB11.5s) and refuses a brief it cannot honor."),tone:e().max(vd).optional(),cta:e().max(Id).optional(),locale:e().max(kd).optional().describe("Output language (BCP-47 tag, e.g. 'es-419'): ALL on-screen copy + captions."),hook:e().max(Od).optional(),caption:e().max(Md).optional(),beats:p(t({id:e().min(1),intent:e().min(1).describe("What this beat DOES editorially (hook the claim, prove it, CTA\u2026)."),durationSec:o().optional(),source:t({mediaId:e().min(1),startSec:o().min(wd),endSec:o()}).optional().describe("MOMENT PINNING: this beat uses EXACTLY this window of this media item \u2014 honored to-the-frame or refused. v1: every sourced beat must reference the SAME mediaId (multi-source briefs are refused loudly, not silently merged)."),graphic:t({role:s(["title-card","stat","lower-third","pull-quote","hero","logo-tag","enumeration","sequence","comparison"]).describe("The mandated graphic's editorial role (the graphics-plan GraphicRole vocabulary)."),items:p(e().min(1).max(Bd)).max(Td).optional().describe("Mandated list items (enumeration/sequence) \u2014 carried VERBATIM into the plan's copy.items.")}).optional().describe("GRAPHICS MANDATE: the plan MUST carry a graphics request of this role overlapping this beat's window \u2014 enforced at the plan gate (honor-or-refuse, like moment pinning). Prose mustIncludes reaches only the judge; this is the checkable form.")})).max(jd).optional(),mustIncludes:p(e().min(1)).max(Ed).optional(),references:p(e()).max(Pd).optional(),captions:t({styleId:e().min(1).optional().describe("Caption style id (e.g. 'serif-emphasis@1')."),emphasisPhrases:p(e().min(1)).max(Ad).optional().describe("Phrases rendered in the caption EMPHASIS style (the big-serif treatment). Matched against the transcript; drives CaptionWord.emphasis.")}).optional(),motionStyle:t({textAnimation:e().optional(),transitions:e().optional(),colorMood:e().optional(),captionStyle:e().optional()}).optional(),seededGraphics:p(t({id:e().min(1),startTime:o().min(_d).describe("Timeline start (seconds)."),duration:o().describe("Clip duration (seconds)."),source:x([t({kind:m("media"),mediaId:e().min(1),trim:t({start:o().min(qd).describe("Source trim start (seconds)."),end:o().min(Fd).describe("Source trim end (seconds).")}).optional(),excludedRanges:p(t({start:o().min(Dd),end:o().min(Gd),reason:e().optional()})).optional(),volume:o().min(Nd).max(Ud).optional(),muted:h().optional(),playbackRate:o().optional(),sync:s(["video","independent"]).optional(),kenBurns:s(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(Kd).optional(),fadeOutMs:o().min(Ld).optional(),loop:h().optional(),audioRole:s(["sfx","music","vo","ambience"]).optional(),duck:t({duckDb:o().max(Wd),attackMs:o().min(Hd),releaseMs:o().min($d),windows:p(t({startMs:o(),endMs:o()})).optional()}).optional(),anchor:t({clipId:e().min(1),offsetMs:o()}).optional(),reframe:t({segments:p(t({startSec:o().min(Vd).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:o().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:x([t({mode:m("frame-center")}),t({mode:m("point"),x:o().min(Yd).max(Jd),y:o().min(Xd).max(Zd)}),t({mode:m("face"),faceId:e().min(1),shotScale:s(["close","standard","wide"]).optional()}),t({mode:m("all-faces")}),t({mode:m("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:o().min(Qd).max(ep).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:t({in:o().min(op).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(tp).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:t({x:o().min(rp).max(np).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(ip).max(sp).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),t({kind:m("component"),componentId:e().min(1),props:u(e(),g())}),t({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:s(["front","behind-subject"]).optional(),anchor:t({space:m("scene"),x:o().min(ap).max(dp),y:o().min(pp).max(cp)}).optional(),parallax:o().min(mp).max(lp).optional()}),t({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}),t({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()})]),kind:s(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(up).max(fp).optional(),scale:o().optional(),rotation:o().optional(),position:t({x:o(),y:o()}).optional(),region:t({x:o().min(gp).max(hp),y:o().min(zp).max(xp),w:o().max(bp),h:o().max(yp)}).optional(),fit:s(["cover","contain"]).optional(),effects:p(t({primitiveId:e().min(1),params:u(e(),g()).optional()})).optional(),transitionIn:t({type:e().min(1),duration:o()}).optional()})).max(Sp).optional().describe("Client-authored graphic clips the Director must carry VERBATIM: seeded into the design loop's base composition as LOCKED clips (never re-authored, never discarded)."),exclusions:p(s(["overlay","component","card","no-transitions"])).max(Cp).optional(),gates:t({holdAt:p(s(["content","layout","motion"])).max(Rp).optional().describe("Checkpoint gates \u2014 the compose pauses at each named stage for review via resume. DEFAULT (gates absent): the compose holds at EVERY stage \u2014 your agent reviews and resumes each one; an unreviewed checkpoint times out loudly after 60min. Auto-progression is the opt-in (gates.autoApprove: true)."),autoApprove:h().optional().describe("true = fully autonomous (compose runs with NO gates \u2014 the headless opt-in; without it a brief holds at every stage by default). Mutually exclusive with a non-empty holdAt."),reviewMode:s(["agent","hosted"]).optional().describe("Who captures the review decision. Default 'agent': you relay the packet and call resume. 'hosted': every checkpoint mints a review-page URL (checkpoint.ready payload + get_checkpoint's reviewUrl) where a human approves/revises from the browser \u2014 no account, no agent session; the recorded decision rides the SAME resume rail and you learn of it via checkpoint webhooks / wait_job.")}).optional(),audio:t({music:t({enabled:h().describe("Whether the compose carries a music bed."),mood:e().max(vp).optional().describe("Freeform mood/genre prompt for the GENERATED bed (e.g. 'understated editorial, warm'). Ignored when mediaId pins a track."),mediaId:e().min(1).optional().describe("Pin a client-imported track as the bed. HONOR-OR-REFUSE: must be an org-owned kind:'audio' media item, else 422 \u2014 never accept-and-ignore. Absent \u21D2 generate from mood.")}).optional(),sfx:t({intensity:s(["off","light","standard","dense"]).describe("SFX placement density. Real-footage content keeps restraint caps regardless ('dense' is the explicit opt-out); generated/graphic-led content unlocks the standard tier.")}).optional()}).optional(),quote:t({composeUsd:o(),renderUsdPerExport:o(),estimatedJourneyUsd:o().describe("compose + expected renders \u2014 relay this BEFORE composing."),revisionCyclesIncluded:o().describe("Revise cycles the compose price includes per gate (A1). Beyond this, resume(revise) is refused with `revision_cycles_exhausted` \u2014 saying no never silently charges.")}),createdAt:o(),updatedAt:o()}),KR=t({id:e()}),Ip=200,kp=2e3,Op=500,Mp=100,wp=3600,Bp=500,Tp=500,jp=35,Ep=500,Pp=2e3,Ap=0,_p=80,qp=8,Fp=24,Dp=24,Gp=12,Np=24,Up=0,Kp=0,Lp=0,Wp=0,Hp=0,$p=0,Vp=4,Yp=0,Jp=0,Xp=0,Zp=0,Qp=0,ec=0,oc=0,tc=1,rc=0,nc=1,ic=.1,sc=1,ac=0,dc=0,pc=-.3,cc=.3,mc=-.3,lc=.3,uc=0,fc=1,gc=0,hc=1,zc=-.3,xc=.3,bc=0,yc=1,Sc=0,Cc=1,Rc=0,vc=1,Ic=1,kc=1,Oc=16,Mc=8,wc=3,Bc=300,LR=t({name:e().max(Ip).optional(),goal:e().min(1).max(kp).optional().describe("What the video must accomplish."),audience:e().max(Op).optional(),platform:e().max(Mp).optional(),format:t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional()}).strict().optional().describe("Output-format spec per \xA7Format."),durationSec:o().max(wp).optional().describe("Target output duration. HONOR-OR-REFUSE: compose validates it against the beat-source window (\xB11.5s) and refuses a brief it cannot honor."),tone:e().max(Bp).optional(),cta:e().max(Tp).optional(),locale:e().max(jp).optional().describe("Output language (BCP-47 tag, e.g. 'es-419'): ALL on-screen copy + captions."),hook:e().max(Ep).optional(),caption:e().max(Pp).optional(),beats:p(t({id:e().min(1),intent:e().min(1).describe("What this beat DOES editorially (hook the claim, prove it, CTA\u2026)."),durationSec:o().optional(),source:t({mediaId:e().min(1),startSec:o().min(Ap),endSec:o()}).strict().optional().describe("MOMENT PINNING: this beat uses EXACTLY this window of this media item \u2014 honored to-the-frame or refused. v1: every sourced beat must reference the SAME mediaId (multi-source briefs are refused loudly, not silently merged)."),graphic:t({role:s(["title-card","stat","lower-third","pull-quote","hero","logo-tag","enumeration","sequence","comparison"]).describe("The mandated graphic's editorial role (the graphics-plan GraphicRole vocabulary)."),items:p(e().min(1).max(_p)).max(qp).optional().describe("Mandated list items (enumeration/sequence) \u2014 carried VERBATIM into the plan's copy.items.")}).strict().optional().describe("GRAPHICS MANDATE: the plan MUST carry a graphics request of this role overlapping this beat's window \u2014 enforced at the plan gate (honor-or-refuse, like moment pinning). Prose mustIncludes reaches only the judge; this is the checkable form.")}).strict()).max(Fp).optional(),mustIncludes:p(e().min(1)).max(Dp).optional(),references:p(e()).max(Gp).optional(),captions:t({styleId:e().min(1).optional().describe("Caption style id (e.g. 'serif-emphasis@1')."),emphasisPhrases:p(e().min(1)).max(Np).optional().describe("Phrases rendered in the caption EMPHASIS style (the big-serif treatment). Matched against the transcript; drives CaptionWord.emphasis.")}).strict().optional(),motionStyle:t({textAnimation:e().optional(),transitions:e().optional(),colorMood:e().optional(),captionStyle:e().optional()}).strict().optional(),seededGraphics:p(t({id:e().min(1),startTime:o().min(Up).describe("Timeline start (seconds)."),duration:o().describe("Clip duration (seconds)."),source:x([t({kind:m("media"),mediaId:e().min(1),trim:t({start:o().min(Kp).describe("Source trim start (seconds)."),end:o().min(Lp).describe("Source trim end (seconds).")}).strict().optional(),excludedRanges:p(t({start:o().min(Wp),end:o().min(Hp),reason:e().optional()}).strict()).optional(),volume:o().min($p).max(Vp).optional(),muted:h().optional(),playbackRate:o().optional(),sync:s(["video","independent"]).optional(),kenBurns:s(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(Yp).optional(),fadeOutMs:o().min(Jp).optional(),loop:h().optional(),audioRole:s(["sfx","music","vo","ambience"]).optional(),duck:t({duckDb:o().max(Xp),attackMs:o().min(Zp),releaseMs:o().min(Qp),windows:p(t({startMs:o(),endMs:o()}).strict()).optional()}).strict().optional(),anchor:t({clipId:e().min(1),offsetMs:o()}).strict().optional(),reframe:t({segments:p(t({startSec:o().min(ec).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:o().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:x([t({mode:m("frame-center")}).strict(),t({mode:m("point"),x:o().min(oc).max(tc),y:o().min(rc).max(nc)}).strict(),t({mode:m("face"),faceId:e().min(1),shotScale:s(["close","standard","wide"]).optional()}).strict(),t({mode:m("all-faces")}).strict(),t({mode:m("active-speaker")}).strict()]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:o().min(ic).max(sc).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:t({in:o().min(ac).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(dc).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).strict().optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:t({x:o().min(pc).max(cc).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(mc).max(lc).describe("Vertical nudge, source-normalized (+ = down).")}).strict().optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")}).strict()).min(1)}).strict().optional()}).strict(),t({kind:m("component"),componentId:e().min(1),props:u(e(),g())}).strict(),t({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:s(["front","behind-subject"]).optional(),anchor:t({space:m("scene"),x:o().min(uc).max(fc),y:o().min(gc).max(hc)}).strict().optional(),parallax:o().min(zc).max(xc).optional()}).strict(),t({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}).strict(),t({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()}).strict()]),kind:s(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(bc).max(yc).optional(),scale:o().optional(),rotation:o().optional(),position:t({x:o(),y:o()}).strict().optional(),region:t({x:o().min(Sc).max(Cc),y:o().min(Rc).max(vc),w:o().max(Ic),h:o().max(kc)}).strict().optional(),fit:s(["cover","contain"]).optional(),effects:p(t({primitiveId:e().min(1),params:u(e(),g()).optional()}).strict()).optional(),transitionIn:t({type:e().min(1),duration:o()}).strict().optional()}).strict()).max(Oc).optional().describe("Client-authored graphic clips the Director must carry VERBATIM: seeded into the design loop's base composition as LOCKED clips (never re-authored, never discarded)."),exclusions:p(s(["overlay","component","card","no-transitions"])).max(Mc).optional(),gates:t({holdAt:p(s(["content","layout","motion"])).max(wc).optional().describe("Checkpoint gates \u2014 the compose pauses at each named stage for review via resume. DEFAULT (gates absent): the compose holds at EVERY stage \u2014 your agent reviews and resumes each one; an unreviewed checkpoint times out loudly after 60min. Auto-progression is the opt-in (gates.autoApprove: true)."),autoApprove:h().optional().describe("true = fully autonomous (compose runs with NO gates \u2014 the headless opt-in; without it a brief holds at every stage by default). Mutually exclusive with a non-empty holdAt."),reviewMode:s(["agent","hosted"]).optional().describe("Who captures the review decision. Default 'agent': you relay the packet and call resume. 'hosted': every checkpoint mints a review-page URL (checkpoint.ready payload + get_checkpoint's reviewUrl) where a human approves/revises from the browser \u2014 no account, no agent session; the recorded decision rides the SAME resume rail and you learn of it via checkpoint webhooks / wait_job.")}).strict().optional(),audio:t({music:t({enabled:h().describe("Whether the compose carries a music bed."),mood:e().max(Bc).optional().describe("Freeform mood/genre prompt for the GENERATED bed (e.g. 'understated editorial, warm'). Ignored when mediaId pins a track."),mediaId:e().min(1).optional().describe("Pin a client-imported track as the bed. HONOR-OR-REFUSE: must be an org-owned kind:'audio' media item, else 422 \u2014 never accept-and-ignore. Absent \u21D2 generate from mood.")}).strict().optional(),sfx:t({intensity:s(["off","light","standard","dense"]).describe("SFX placement density. Real-footage content keeps restraint caps regardless ('dense' is the explicit opt-out); generated/graphic-led content unlocks the standard tier.")}).strict().optional()}).strict().optional()}).strict(),Tc=200,jc=2e3,Ec=500,Pc=100,Ac=3600,_c=500,qc=500,Fc=35,Dc=500,Gc=2e3,Nc=0,Uc=80,Kc=8,Lc=24,Wc=24,Hc=12,$c=24,Vc=0,Yc=0,Jc=0,Xc=0,Zc=0,Qc=0,em=4,om=0,tm=0,rm=0,nm=0,im=0,sm=0,am=0,dm=1,pm=0,cm=1,mm=.1,lm=1,um=0,fm=0,gm=-.3,hm=.3,zm=-.3,xm=.3,bm=0,ym=1,Sm=0,Cm=1,Rm=-.3,vm=.3,Im=0,km=1,Om=0,Mm=1,wm=0,Bm=1,Tm=1,jm=1,Em=16,Pm=8,Am=3,_m=300,WR=t({id:e(),projectId:e(),kind:s(["authored","clip"]).describe("authored = create_brief; clip = minted by suggest_briefs from an AI clip suggestion."),sourceSuggestionId:e().optional().describe("kind:'clip' provenance \u2014 the suggestion this Brief was minted from."),name:e().max(Tc).optional(),goal:e().min(1).max(jc).describe("What the video must accomplish."),audience:e().max(Ec).optional(),platform:e().max(Pc).optional(),format:t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional()}).optional().describe("Output-format spec per \xA7Format."),durationSec:o().max(Ac).optional().describe("Target output duration. HONOR-OR-REFUSE: compose validates it against the beat-source window (\xB11.5s) and refuses a brief it cannot honor."),tone:e().max(_c).optional(),cta:e().max(qc).optional(),locale:e().max(Fc).optional().describe("Output language (BCP-47 tag, e.g. 'es-419'): ALL on-screen copy + captions."),hook:e().max(Dc).optional(),caption:e().max(Gc).optional(),beats:p(t({id:e().min(1),intent:e().min(1).describe("What this beat DOES editorially (hook the claim, prove it, CTA\u2026)."),durationSec:o().optional(),source:t({mediaId:e().min(1),startSec:o().min(Nc),endSec:o()}).optional().describe("MOMENT PINNING: this beat uses EXACTLY this window of this media item \u2014 honored to-the-frame or refused. v1: every sourced beat must reference the SAME mediaId (multi-source briefs are refused loudly, not silently merged)."),graphic:t({role:s(["title-card","stat","lower-third","pull-quote","hero","logo-tag","enumeration","sequence","comparison"]).describe("The mandated graphic's editorial role (the graphics-plan GraphicRole vocabulary)."),items:p(e().min(1).max(Uc)).max(Kc).optional().describe("Mandated list items (enumeration/sequence) \u2014 carried VERBATIM into the plan's copy.items.")}).optional().describe("GRAPHICS MANDATE: the plan MUST carry a graphics request of this role overlapping this beat's window \u2014 enforced at the plan gate (honor-or-refuse, like moment pinning). Prose mustIncludes reaches only the judge; this is the checkable form.")})).max(Lc).optional(),mustIncludes:p(e().min(1)).max(Wc).optional(),references:p(e()).max(Hc).optional(),captions:t({styleId:e().min(1).optional().describe("Caption style id (e.g. 'serif-emphasis@1')."),emphasisPhrases:p(e().min(1)).max($c).optional().describe("Phrases rendered in the caption EMPHASIS style (the big-serif treatment). Matched against the transcript; drives CaptionWord.emphasis.")}).optional(),motionStyle:t({textAnimation:e().optional(),transitions:e().optional(),colorMood:e().optional(),captionStyle:e().optional()}).optional(),seededGraphics:p(t({id:e().min(1),startTime:o().min(Vc).describe("Timeline start (seconds)."),duration:o().describe("Clip duration (seconds)."),source:x([t({kind:m("media"),mediaId:e().min(1),trim:t({start:o().min(Yc).describe("Source trim start (seconds)."),end:o().min(Jc).describe("Source trim end (seconds).")}).optional(),excludedRanges:p(t({start:o().min(Xc),end:o().min(Zc),reason:e().optional()})).optional(),volume:o().min(Qc).max(em).optional(),muted:h().optional(),playbackRate:o().optional(),sync:s(["video","independent"]).optional(),kenBurns:s(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(om).optional(),fadeOutMs:o().min(tm).optional(),loop:h().optional(),audioRole:s(["sfx","music","vo","ambience"]).optional(),duck:t({duckDb:o().max(rm),attackMs:o().min(nm),releaseMs:o().min(im),windows:p(t({startMs:o(),endMs:o()})).optional()}).optional(),anchor:t({clipId:e().min(1),offsetMs:o()}).optional(),reframe:t({segments:p(t({startSec:o().min(sm).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:o().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:x([t({mode:m("frame-center")}),t({mode:m("point"),x:o().min(am).max(dm),y:o().min(pm).max(cm)}),t({mode:m("face"),faceId:e().min(1),shotScale:s(["close","standard","wide"]).optional()}),t({mode:m("all-faces")}),t({mode:m("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:o().min(mm).max(lm).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:t({in:o().min(um).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(fm).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:t({x:o().min(gm).max(hm).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(zm).max(xm).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),t({kind:m("component"),componentId:e().min(1),props:u(e(),g())}),t({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:s(["front","behind-subject"]).optional(),anchor:t({space:m("scene"),x:o().min(bm).max(ym),y:o().min(Sm).max(Cm)}).optional(),parallax:o().min(Rm).max(vm).optional()}),t({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}),t({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()})]),kind:s(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(Im).max(km).optional(),scale:o().optional(),rotation:o().optional(),position:t({x:o(),y:o()}).optional(),region:t({x:o().min(Om).max(Mm),y:o().min(wm).max(Bm),w:o().max(Tm),h:o().max(jm)}).optional(),fit:s(["cover","contain"]).optional(),effects:p(t({primitiveId:e().min(1),params:u(e(),g()).optional()})).optional(),transitionIn:t({type:e().min(1),duration:o()}).optional()})).max(Em).optional().describe("Client-authored graphic clips the Director must carry VERBATIM: seeded into the design loop's base composition as LOCKED clips (never re-authored, never discarded)."),exclusions:p(s(["overlay","component","card","no-transitions"])).max(Pm).optional(),gates:t({holdAt:p(s(["content","layout","motion"])).max(Am).optional().describe("Checkpoint gates \u2014 the compose pauses at each named stage for review via resume. DEFAULT (gates absent): the compose holds at EVERY stage \u2014 your agent reviews and resumes each one; an unreviewed checkpoint times out loudly after 60min. Auto-progression is the opt-in (gates.autoApprove: true)."),autoApprove:h().optional().describe("true = fully autonomous (compose runs with NO gates \u2014 the headless opt-in; without it a brief holds at every stage by default). Mutually exclusive with a non-empty holdAt."),reviewMode:s(["agent","hosted"]).optional().describe("Who captures the review decision. Default 'agent': you relay the packet and call resume. 'hosted': every checkpoint mints a review-page URL (checkpoint.ready payload + get_checkpoint's reviewUrl) where a human approves/revises from the browser \u2014 no account, no agent session; the recorded decision rides the SAME resume rail and you learn of it via checkpoint webhooks / wait_job.")}).optional(),audio:t({music:t({enabled:h().describe("Whether the compose carries a music bed."),mood:e().max(_m).optional().describe("Freeform mood/genre prompt for the GENERATED bed (e.g. 'understated editorial, warm'). Ignored when mediaId pins a track."),mediaId:e().min(1).optional().describe("Pin a client-imported track as the bed. HONOR-OR-REFUSE: must be an org-owned kind:'audio' media item, else 422 \u2014 never accept-and-ignore. Absent \u21D2 generate from mood.")}).optional(),sfx:t({intensity:s(["off","light","standard","dense"]).describe("SFX placement density. Real-footage content keeps restraint caps regardless ('dense' is the explicit opt-out); generated/graphic-led content unlocks the standard tier.")}).optional()}).optional(),quote:t({composeUsd:o(),renderUsdPerExport:o(),estimatedJourneyUsd:o().describe("compose + expected renders \u2014 relay this BEFORE composing."),revisionCyclesIncluded:o().describe("Revise cycles the compose price includes per gate (A1). Beyond this, resume(revise) is refused with `revision_cycles_exhausted` \u2014 saying no never silently charges.")}),createdAt:o(),updatedAt:o()}),HR=t({id:e()});var VR=t({id:e()}),YR=t({id:e(),projectId:e(),composeJobId:e().optional(),briefId:e().optional(),kind:s(["gate","score"]),stage:s(["content","layout","motion"]).optional(),version:o(),status:s(["awaiting","approved","revised","abandoned","expired","superseded"]),artifact:g().optional().describe("The stage artifact under review: the locked ComposePlan at content; the composition wire shape at layout/motion; the judged composition snapshot on kind:'score'."),stillUrls:p(e()).optional().describe("Presigned storyboard/eval stills \u2014 the packet's visual evidence (may be GC'd by the retention sweep after the job goes terminal; the decision record is immortal)."),criticVerdicts:g().optional().describe("Per-criterion scores + critique from the design loop / judge, incl. lock_violation entries."),quote:t({thisStepUsd:o().describe("What approving costs NEXT (the render at the final gate; $0 earlier)."),jobSpendSoFarUsd:o().describe("What has SETTLED so far \u2014 $0 while the run is live (compose is charge-on-delivery on both rails), so abandoning at a gate charges nothing."),estimatedJourneyTotalUsd:o().describe("The same journey number the Brief quoted.")}).optional(),revisionCycle:o().describe("Revise cycles this gate has consumed. The brief quote states the included count (revisionCyclesIncluded); beyond it, resume(revise) is refused with a typed error."),decision:g().optional().describe("The recorded decision {decision, comments?, globalNote?, decidedAt} once resolved."),reviewMode:s(["agent","hosted"]).optional().describe("How this packet is decided (from the Brief's gates). 'hosted' = the review PAGE captures the decision; absent/'agent' = the decision flows back through the driving agent."),createdAt:o(),updatedAt:o(),versionStack:p(t({id:e(),version:o(),stage:s(["content","layout","motion"]).optional(),status:e(),decision:e().optional(),createdAt:o()})).describe("The run's v1\u2192vN gate history \u2014 per-version status + decision summaries.")}),JR=t({id:e()}),XR=t({ok:h(),stage:s(["content","layout","motion"]).optional(),version:o().optional(),composeJobId:e().optional()}).describe("Decision recorded; the run resumes (the SAME rail as POST /checkpoints/{id}/resume)."),ZR=t({data:p(t({id:e(),projectId:e(),composeJobId:e().optional(),briefId:e().optional(),kind:s(["gate","score"]),stage:s(["content","layout","motion"]).optional(),version:o(),status:s(["awaiting","approved","revised","abandoned","expired","superseded"]),artifact:g().optional().describe("The stage artifact under review: the locked ComposePlan at content; the composition wire shape at layout/motion; the judged composition snapshot on kind:'score'."),stillUrls:p(e()).optional().describe("Presigned storyboard/eval stills \u2014 the packet's visual evidence (may be GC'd by the retention sweep after the job goes terminal; the decision record is immortal)."),criticVerdicts:g().optional().describe("Per-criterion scores + critique from the design loop / judge, incl. lock_violation entries."),quote:t({thisStepUsd:o().describe("What approving costs NEXT (the render at the final gate; $0 earlier)."),jobSpendSoFarUsd:o().describe("What has SETTLED so far \u2014 $0 while the run is live (compose is charge-on-delivery on both rails), so abandoning at a gate charges nothing."),estimatedJourneyTotalUsd:o().describe("The same journey number the Brief quoted.")}).optional(),revisionCycle:o().describe("Revise cycles this gate has consumed. The brief quote states the included count (revisionCyclesIncluded); beyond it, resume(revise) is refused with a typed error."),decision:g().optional().describe("The recorded decision {decision, comments?, globalNote?, decidedAt} once resolved."),reviewMode:s(["agent","hosted"]).optional().describe("How this packet is decided (from the Brief's gates). 'hosted' = the review PAGE captures the decision; absent/'agent' = the decision flows back through the driving agent."),reviewUrl:e().optional().describe("Hosted review-page URL (present when reviewMode is 'hosted') \u2014 a human decides from this link, no account or agent session; the recorded decision rides the SAME resume rail, and the agent learns of it via checkpoint webhooks / wait_job."),createdAt:o(),updatedAt:o()})),pagination:t({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}),QR=t({id:e()}),ev=t({id:e(),projectId:e(),composeJobId:e().optional(),briefId:e().optional(),kind:s(["gate","score"]),stage:s(["content","layout","motion"]).optional(),version:o(),status:s(["awaiting","approved","revised","abandoned","expired","superseded"]),artifact:g().optional().describe("The stage artifact under review: the locked ComposePlan at content; the composition wire shape at layout/motion; the judged composition snapshot on kind:'score'."),stillUrls:p(e()).optional().describe("Presigned storyboard/eval stills \u2014 the packet's visual evidence (may be GC'd by the retention sweep after the job goes terminal; the decision record is immortal)."),criticVerdicts:g().optional().describe("Per-criterion scores + critique from the design loop / judge, incl. lock_violation entries."),quote:t({thisStepUsd:o().describe("What approving costs NEXT (the render at the final gate; $0 earlier)."),jobSpendSoFarUsd:o().describe("What has SETTLED so far \u2014 $0 while the run is live (compose is charge-on-delivery on both rails), so abandoning at a gate charges nothing."),estimatedJourneyTotalUsd:o().describe("The same journey number the Brief quoted.")}).optional(),revisionCycle:o().describe("Revise cycles this gate has consumed. The brief quote states the included count (revisionCyclesIncluded); beyond it, resume(revise) is refused with a typed error."),decision:g().optional().describe("The recorded decision {decision, comments?, globalNote?, decidedAt} once resolved."),reviewMode:s(["agent","hosted"]).optional().describe("How this packet is decided (from the Brief's gates). 'hosted' = the review PAGE captures the decision; absent/'agent' = the decision flows back through the driving agent."),reviewUrl:e().optional().describe("Hosted review-page URL (present when reviewMode is 'hosted') \u2014 a human decides from this link, no account or agent session; the recorded decision rides the SAME resume rail, and the agent learns of it via checkpoint webhooks / wait_job."),createdAt:o(),updatedAt:o()}),ov=t({id:e()}),qm=0,Fm=2e3,Dm=24,Gm=4e3,tv=t({decision:s(["approve","revise","abandon"]).describe("The ONE verdict for this gate (GitHub review grammar). approve = proceed (comments allowed \u2014 they record as taste signal without gating); revise = the director revises per comments/edits and RE-PRESENTS this same gate (in-job, no re-meter); abandon = end the run."),comments:p(t({anchor:x([t({beatId:e().min(1)}).strict(),t({timecodeMs:o().min(qm)}).strict()]).describe("What the comment is about: a plan beat (content gate) or a timecode on the artifact (layout/motion gates)."),verdict:s(["approve","revise","lock"]).describe("Per-anchor verdict under the single gate decision. `lock` = contractually frozen \u2014 the director touching a locked element is a defect, surfaced as a lock_violation verdict on the next packet (the no-discard machinery)."),note:e().max(Fm).optional()}).strict()).max(Dm).optional(),edits:g().optional().describe("Your edited stage artifact (the power path). With edits the re-presented packet carries exactly what you supplied; with comments alone the director re-authors scoped by them."),globalNote:e().max(Gm).optional()}).strict().describe("POST /checkpoints/:id/resume body \u2014 the A1 review grammar."),rv=t({ok:h()}).describe("POST /checkpoints/:id/resume response.");var iv=t({id:e()}),sv=t({composition:g().optional().describe("The composition to judge. Absent \u21D2 the project's ACTIVE composition."),compositionId:e().optional().describe("Judge a SPECIFIC persisted composition of this project (create_render parity). Absent \u21D2 the active one. A stale/foreign id is a 404 \u2014 never a silent fall-through."),session_id:e().optional().describe("Compose-session id: judge that session's SCRATCH composition (what the session has been editing) instead of the active row. Ignored when `composition` is passed."),editorialIntent:e().optional(),brandContext:e().optional()}).strict(),av=t({id:e()}),Nm=.1,Um=1,Km=100,dv=t({composition:g().optional().describe("The composition to render. Absent \u21D2 the project's ACTIVE composition \u2014 what create_render will encode. The response's `previewed.source` names what was rendered."),compositionId:e().optional().describe("Preview a SPECIFIC persisted composition of this project (create_render parity). Absent \u21D2 the active one. A stale/foreign id is a 404 \u2014 never a silent fall-through."),session_id:e().optional().describe("Compose-session id: render that session's SCRATCH composition (what the session has been editing) instead of the active row. Ignored when `composition` is passed."),timestamps:p(o()).min(1),imageFormat:s(["png","jpeg"]).optional().describe("Still format. Default png (full-fidelity human preview)."),scale:o().min(Nm).max(Um).optional().describe("Render scale 0.1\u20131. Vision-bound agent looks should pass 0.5."),jpegQuality:o().min(1).max(Km).optional().describe("JPEG quality (jpeg only). Vision-bound agent looks should pass 70.")}).strict(),pv=g(),cv=t({id:e()}),mv=t({componentId:e().min(1),params:u(e(),g()).optional(),width:o().optional(),height:o().optional()}).strict();var uv=t({id:e()}),fv=t({suggestionId:e().min(1),format:t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional(),platform:e().optional()}).strict().optional()}).strict(),gv=t({id:e()}),hv=t({status:s(["idle","generating","completed","failed"]),createdAt:e().nullable(),analyzedAt:e().nullable(),jobId:e().nullable(),topics:p(e()),suggestions:p(t({id:e(),briefId:e().nullable(),rank:o(),trim:t({start:o(),end:o()}),score:o(),title:e(),reason:e(),topic:e(),hook:e(),platforms:p(e()),format:e(),caption:e(),hashtags:p(e()),textOverlays:p(e()),editingNotes:e(),motionStyle:t({textAnimation:e(),transitions:e(),colorMood:e(),captionStyle:e()}),visualTreatment:p(t({time:x([o(),e()]),visual:e()})),brollSuggestions:p(t({moment:e(),searchTerms:p(e()),rationale:e()})),thumbnailConcept:e()}).describe("Single ranked clip suggestion.")),pagination:t({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}).describe("GET /media/:id/suggestions envelope."),zv=t({id:e()}),xv=t({id:e()});var Lm=100,yv=t({category:s(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]).optional().describe("Filter to one category bucket (text|effects|transitions|layouts|backgrounds|ui-blocks|scenes)."),kind:s(["component","transition","scene"]).optional().describe("Filter by render kind (component|transition|scene)."),tier:s(["recommended","standard","niche"]).optional().describe("Filter by curation tier (recommended|standard|niche)."),useCase:s(["intro","outro","full-scene","title-over-footage","transition","background","grade","emphasis","explainer","social-cut"]).optional().describe("Filter to entries whose useCase includes this edit role (e.g. intro, title-over-footage, grade)."),mood:e().optional().describe("Filter to entries whose mood tags include this value (e.g. cinematic, minimal)."),q:e().optional().describe("Free-text match across id/name/description/intent/useWhen/tags/mood. Recommend-orders results."),intent:e().optional().describe("Alias of `q` framed as recommend-by-intent (e.g. intent=intro). Recommend-orders results."),limit:o().min(1).max(Lm).optional().describe("Page size (1..100). Omit to return the whole filtered catalog in one page."),after:e().optional().describe("Opaque cursor from a previous page's nextCursor (forward-only).")}),Sv=t({data:p(t({id:e(),name:e(),description:e(),source:s(["default","installed"]).describe("'default' = built-in primitive (place by primitiveId); 'installed' = org-authored component (place by componentId)."),category:s(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]),kind:s(["component","transition","scene"]).describe("RENDER kind (component | transition | scene). NOT the ClipSource variant \u2014 see `placement` for how to author it on the timeline."),version:e(),propSchema:u(e(),g()),propDefaults:u(e(),g()).optional(),textParam:e().nullish().describe("The param field that carries this primitive's primary text; null = no single text slot."),subtextParam:e().nullish().describe("The param field for secondary text (subtitle/byline); null = none."),format:t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional()}).optional(),durationInFrames:o().optional(),intent:e().optional().describe("Selection signal: a verb naming what this primitive accomplishes (e.g. 'product-trailer'). Match it to the beat you are authoring."),useWhen:e().optional().describe("When to use this \u2014 AND when not to. The negative guidance is load-bearing; read it before picking."),pairsWith:p(e()).optional().describe("Authoring guidance: ids of primitives that COMPOSE well with this one in the same edit."),avoidWith:p(e()).optional().describe("Authoring guidance: ids of primitives that CONFLICT with this one \u2014 do not place together."),tags:p(e()).optional().describe("Free-text search keywords."),mood:p(e()).optional().describe("Vibe/tone tags (e.g. 'cinematic', 'minimal'). Filter to match the edit's mood."),tier:s(["recommended","standard","niche"]).optional().describe("Quality/applicability RANKING (a preference, not a flag). Prefer 'recommended'; reach for 'niche' only when its specific use-case is exactly the beat."),useCase:p(s(["intro","outro","full-scene","title-over-footage","transition","background","grade","emphasis","explainer","social-cut"])).optional().describe("The edit ROLE(s) this primitive fills \u2014 the dimension to filter by for a beat (e.g. 'intro', 'title-over-footage', 'grade')."),examples:p(t({name:e(),mood:p(e()).optional(),params:u(e(),g()).optional(),description:e().optional()})).optional(),fixedCopy:p(e()).optional().describe("On-screen strings this primitive BAKES \u2014 the read-side counterpart to propSchema. These literals render REGARDLESS of params (no param can change them); fork the source via get_component_source to edit them. Use this to see at author time what fixed copy (someone-else's marketing text, faux-code, faux-data) will appear before you render."),brandBindings:p(t({param:e(),brandToken:e()})).optional().describe("Params that can follow the project brand kit. Each {param, brandToken} says: set `param` to `brandToken` (a `$brand:` ref, e.g. '$brand:colors.accent') to track the brand instead of a literal. See the list response's `brandTokens` for the full ref vocabulary. Omitted when nothing is brand-bound."),placement:t({clipSourceKind:s(["overlay","effect","component"]).describe("The ClipSource `kind` to author this entry as: 'overlay' (built-in text/ui/scene/background/layout), 'effect' (built-in effect/transition), or 'component' (an org-INSTALLED custom component)."),refField:s(["primitiveId","componentId"]).describe("Which id field keys the ClipSource: 'primitiveId' for built-ins (source:'default'), 'componentId' for installed components (source:'installed'). Using the wrong field will NOT resolve at render.")}),warnings:p(e()).optional().describe("Non-blocking save-time advisories \u2014 the create/update SUCCEEDED. Currently: a `fontFamily` string literal referencing a NON-vendored font (a bare CSS generic like 'serif', or an unknown named family like 'Arial') whose LIVE-lane pixels vary by render host \u2014 re-author with a vendored family or 'Georgia'. Omitted when there is nothing to flag; only present on the create/update responses.")}).describe("Component catalog entry per \xA7Components.")),pagination:t({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata."),brandTokens:p(e()).optional().describe("Catalog-level reference: the valid `$brand:` token refs a param value may carry (e.g. accentColor: \"$brand:colors.accent\"). Colors + fonts are the common bindings; the full design-token vocabulary is listed. Derived from the brand kit resolver so it can't drift. See each entry's `brandBindings` for which params are brand-bound by default."),sfx:p(t({soundId:e().describe("Stable pack id (also the R2 basename)."),family:s(["tick","pop","impact","confirm","error","whoosh","riser"]).describe("Editorial family the compose sfx pass binds by."),envelopeClass:s(["transient","sweep","ambient"]).describe("Coarse envelope shape \u2014 the browse grouping."),intensity:s(["subtle","standard","strong"]),durationSec:o().describe("Duration of the mastered asset (seconds)."),description:e().describe("One-line human-legible caption."),attribution:e().describe("CC0 provenance string.")})).optional().describe("Catalog-level reference: the curated CC0 SFX pack (closed, versioned). The compose sfx pass places these deterministically; this is the pack-only structural inventory to pick a `soundId` by family. Present on the first page only."),audio:p(t({ref:e().describe("Placement handle: a pack soundId/bedId, or an org media id."),role:s(["vo","music","sfx","ambience"]).describe("Declared role for mix policy."),envelopeClass:s(["transient","sweep","ambient"]).describe("Coarse envelope shape \u2014 the browse grouping."),description:e(),durationSec:o(),evidence:t({envelopeClass:s(["transient","sweep","ambient"]),attackMs:o().optional(),spectralCentroidHz:o().optional(),meanVolumeDb:o().optional(),maxVolumeDb:o().optional()}).describe("Envelope probe evidence (always carries envelopeClass)."),source:s(["pack","org","generated"]).describe("Provenance discriminant."),license:e().describe('"CC0" (pack), "org-owned"/a CC token (org), or "generated".'),provenance:e().describe("Human-legible provenance (pack attribution / org-owned / generator + prompt)."),bpm:o().optional().describe("Tempo \u2014 present for music-role entries."),mood:p(e()).optional().describe("Editorial mood tags \u2014 present for pack music beds.")})).optional().describe(`The UNIFIED org sound palette (audio-substrate Phase 2): the curated packs (SFX + music beds) unioned with THIS org's own uploads/imports (source:"org") and generated audio (source:"generated"), one uniform entry shape carrying role + envelopeClass + provenance + license; music entries carry bpm. Prefer an org sound when it fits \u2014 an org that uploads its product's real UI sounds hears ITS product. Present on the first page only.`)}),Wm=200,Hm=200,$m=2e3,Vm=200,Cv=t({componentId:e().min(1).max(Wm),tsxSource:e().min(1),name:e().min(1).max(Hm),description:e().max($m),category:s(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]),propSchema:u(e(),g()).optional(),origin:s(["repo-owned","server-native"]).optional(),ejectedFrom:e().max(Vm).optional(),tokens:u(e(),g()).optional(),examples:p(u(e(),g())).optional(),durationInFrames:o().optional(),executionMode:s(["live","baked"]).optional()}).strict().describe("POST /components body. Org/user are server-resolved; never accepted from the body."),Rv=t({id:e()}),Ym=200,Jm=2e3,Xm=200,vv=t({tsxSource:e().min(1).optional(),name:e().min(1).max(Ym).optional(),description:e().max(Jm).optional(),category:s(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]).optional(),propSchema:u(e(),g()).optional(),origin:s(["repo-owned","server-native"]).optional(),ejectedFrom:e().max(Xm).optional(),tokens:u(e(),g()).optional(),examples:p(u(e(),g())).optional(),durationInFrames:o().optional(),executionMode:s(["live","baked"]).optional()}).strict().describe("PUT /components/:id body. Org/user are server-resolved; never accepted from the body."),Iv=t({id:e(),name:e(),description:e(),source:s(["default","installed"]).describe("'default' = built-in primitive (place by primitiveId); 'installed' = org-authored component (place by componentId)."),category:s(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]),kind:s(["component","transition","scene"]).describe("RENDER kind (component | transition | scene). NOT the ClipSource variant \u2014 see `placement` for how to author it on the timeline."),version:e(),propSchema:u(e(),g()),propDefaults:u(e(),g()).optional(),textParam:e().nullish().describe("The param field that carries this primitive's primary text; null = no single text slot."),subtextParam:e().nullish().describe("The param field for secondary text (subtitle/byline); null = none."),format:t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional()}).optional(),durationInFrames:o().optional(),intent:e().optional().describe("Selection signal: a verb naming what this primitive accomplishes (e.g. 'product-trailer'). Match it to the beat you are authoring."),useWhen:e().optional().describe("When to use this \u2014 AND when not to. The negative guidance is load-bearing; read it before picking."),pairsWith:p(e()).optional().describe("Authoring guidance: ids of primitives that COMPOSE well with this one in the same edit."),avoidWith:p(e()).optional().describe("Authoring guidance: ids of primitives that CONFLICT with this one \u2014 do not place together."),tags:p(e()).optional().describe("Free-text search keywords."),mood:p(e()).optional().describe("Vibe/tone tags (e.g. 'cinematic', 'minimal'). Filter to match the edit's mood."),tier:s(["recommended","standard","niche"]).optional().describe("Quality/applicability RANKING (a preference, not a flag). Prefer 'recommended'; reach for 'niche' only when its specific use-case is exactly the beat."),useCase:p(s(["intro","outro","full-scene","title-over-footage","transition","background","grade","emphasis","explainer","social-cut"])).optional().describe("The edit ROLE(s) this primitive fills \u2014 the dimension to filter by for a beat (e.g. 'intro', 'title-over-footage', 'grade')."),examples:p(t({name:e(),mood:p(e()).optional(),params:u(e(),g()).optional(),description:e().optional()})).optional(),fixedCopy:p(e()).optional().describe("On-screen strings this primitive BAKES \u2014 the read-side counterpart to propSchema. These literals render REGARDLESS of params (no param can change them); fork the source via get_component_source to edit them. Use this to see at author time what fixed copy (someone-else's marketing text, faux-code, faux-data) will appear before you render."),brandBindings:p(t({param:e(),brandToken:e()})).optional().describe("Params that can follow the project brand kit. Each {param, brandToken} says: set `param` to `brandToken` (a `$brand:` ref, e.g. '$brand:colors.accent') to track the brand instead of a literal. See the list response's `brandTokens` for the full ref vocabulary. Omitted when nothing is brand-bound."),placement:t({clipSourceKind:s(["overlay","effect","component"]).describe("The ClipSource `kind` to author this entry as: 'overlay' (built-in text/ui/scene/background/layout), 'effect' (built-in effect/transition), or 'component' (an org-INSTALLED custom component)."),refField:s(["primitiveId","componentId"]).describe("Which id field keys the ClipSource: 'primitiveId' for built-ins (source:'default'), 'componentId' for installed components (source:'installed'). Using the wrong field will NOT resolve at render.")}),warnings:p(e()).optional().describe("Non-blocking save-time advisories \u2014 the create/update SUCCEEDED. Currently: a `fontFamily` string literal referencing a NON-vendored font (a bare CSS generic like 'serif', or an unknown named family like 'Arial') whose LIVE-lane pixels vary by render host \u2014 re-author with a vendored family or 'Georgia'. Omitted when there is nothing to flag; only present on the create/update responses.")}).describe("Component catalog entry per \xA7Components."),kv=t({id:e()}),Ov=t({id:e(),name:e(),description:e(),source:s(["default","installed"]).describe("'default' = built-in primitive (place by primitiveId); 'installed' = org-authored component (place by componentId)."),category:s(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]),kind:s(["component","transition","scene"]).describe("RENDER kind (component | transition | scene). NOT the ClipSource variant \u2014 see `placement` for how to author it on the timeline."),version:e(),propSchema:u(e(),g()),propDefaults:u(e(),g()).optional(),textParam:e().nullish().describe("The param field that carries this primitive's primary text; null = no single text slot."),subtextParam:e().nullish().describe("The param field for secondary text (subtitle/byline); null = none."),format:t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional()}).optional(),durationInFrames:o().optional(),intent:e().optional().describe("Selection signal: a verb naming what this primitive accomplishes (e.g. 'product-trailer'). Match it to the beat you are authoring."),useWhen:e().optional().describe("When to use this \u2014 AND when not to. The negative guidance is load-bearing; read it before picking."),pairsWith:p(e()).optional().describe("Authoring guidance: ids of primitives that COMPOSE well with this one in the same edit."),avoidWith:p(e()).optional().describe("Authoring guidance: ids of primitives that CONFLICT with this one \u2014 do not place together."),tags:p(e()).optional().describe("Free-text search keywords."),mood:p(e()).optional().describe("Vibe/tone tags (e.g. 'cinematic', 'minimal'). Filter to match the edit's mood."),tier:s(["recommended","standard","niche"]).optional().describe("Quality/applicability RANKING (a preference, not a flag). Prefer 'recommended'; reach for 'niche' only when its specific use-case is exactly the beat."),useCase:p(s(["intro","outro","full-scene","title-over-footage","transition","background","grade","emphasis","explainer","social-cut"])).optional().describe("The edit ROLE(s) this primitive fills \u2014 the dimension to filter by for a beat (e.g. 'intro', 'title-over-footage', 'grade')."),examples:p(t({name:e(),mood:p(e()).optional(),params:u(e(),g()).optional(),description:e().optional()})).optional(),fixedCopy:p(e()).optional().describe("On-screen strings this primitive BAKES \u2014 the read-side counterpart to propSchema. These literals render REGARDLESS of params (no param can change them); fork the source via get_component_source to edit them. Use this to see at author time what fixed copy (someone-else's marketing text, faux-code, faux-data) will appear before you render."),brandBindings:p(t({param:e(),brandToken:e()})).optional().describe("Params that can follow the project brand kit. Each {param, brandToken} says: set `param` to `brandToken` (a `$brand:` ref, e.g. '$brand:colors.accent') to track the brand instead of a literal. See the list response's `brandTokens` for the full ref vocabulary. Omitted when nothing is brand-bound."),placement:t({clipSourceKind:s(["overlay","effect","component"]).describe("The ClipSource `kind` to author this entry as: 'overlay' (built-in text/ui/scene/background/layout), 'effect' (built-in effect/transition), or 'component' (an org-INSTALLED custom component)."),refField:s(["primitiveId","componentId"]).describe("Which id field keys the ClipSource: 'primitiveId' for built-ins (source:'default'), 'componentId' for installed components (source:'installed'). Using the wrong field will NOT resolve at render.")}),warnings:p(e()).optional().describe("Non-blocking save-time advisories \u2014 the create/update SUCCEEDED. Currently: a `fontFamily` string literal referencing a NON-vendored font (a bare CSS generic like 'serif', or an unknown named family like 'Arial') whose LIVE-lane pixels vary by render host \u2014 re-author with a vendored family or 'Georgia'. Omitted when there is nothing to flag; only present on the create/update responses.")}).describe("Component catalog entry per \xA7Components."),Mv=t({id:e()}),wv=t({id:e(),name:e(),description:e(),source:s(["default","installed"]),tsxSource:e(),propSchema:u(e(),g()),origin:s(["repo-owned","server-native"]).optional(),ejectedFrom:e().optional(),tokens:u(e(),g()).optional(),examples:p(u(e(),g())).optional(),durationInFrames:o().optional()}).describe("Installed component SOURCE (TSX) + ownership provenance per \xA7Components.");var Tv=t({id:e()}),Zm=2e3,Qm=5,el=0,ol=10,tl=64,rl=3,jv=t({suggestionId:e().min(1).optional(),fromComposition:h().optional().describe("Reuse the project's current composition as the compose starting point (critique-retry path). The Director RE-AUTHORS graphics: if the current composition is client-authored and contains graphic clips (overlay/component/card), the request is refused (validation_error naming the clips) \u2014 render it verbatim with create_render instead. The director's own output (critique-retry) is exempt."),briefId:e().min(1).optional().describe("Compose from a persisted Brief (create_brief) \u2014 the intent-first door: every Brief field is HONORED or the request is refused loudly naming the field (window from beat moment-pinning; seeded graphics carried VERBATIM as locked clips; exclusions enforced; locale + caption emphasis threaded to the Director). Exactly ONE of suggestionId | fromComposition | briefId."),format:t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional()}).strict().optional().describe("Output-format spec per \xA7Format."),scope:g().optional().describe("RequestScope discriminated union (per compose-api-contract.md). Editor-only scopes (captions/overlay-track/broll/overlay-instance/segment) require an editor-session token; API tokens get 403 on those."),critique:e().max(Zm).optional().describe("Structured critique block (per compose-api-contract.md decision #11). Capped at 2KB total; per-criterion blocks capped at 500 chars."),parentJobId:e().optional().describe("Pointer to the prior compose job this run iterates on. Surfaced on the resulting composeJobs row as baselineComposeJobId."),maxCandidates:o().min(1).max(Qm).optional().describe("Ensemble size. TEMPORARILY PINNED TO 1 \u2014 the multi-candidate ensemble is disabled pending a global capture-concurrency bound (N>1 candidates overflow the org's Daytona capture disk and drop perception), so any value >1 is ignored and every compose runs a single candidate. Still accepted for forward-compat; will honor [1, 5] again once re-enabled."),budgetUsd:o().optional().describe("Per-job budget cap (USD). Clamped at the route against the org's composeMaxBudgetUsdPerJob setting."),qualityThreshold:o().min(el).max(ol).optional().describe("Composite-score accept threshold. Server default per contract."),seed:o().optional().describe("Deterministic seed for replay. Threaded into the workflow id."),clientNonce:e().max(tl).optional().describe("Opaque caller token that disambiguates intentional same-critique retries. Without it, identical (project, sug, seed, critique) tuples deduplicate at Temporal; with it, retries fire fresh workflows."),holdAt:p(s(["content","layout","motion"])).max(rl).optional().describe("Opt-in checkpoint gates. Each named stage pauses the compose at its boundary (status \u2192 awaiting_input) for client review via resume. Absent/empty \u21D2 fully autonomous. Non-empty \u21D2 the run is a single spine.")}).strict().describe("POST /projects/:id/compose body."),Ev=t({id:e(),composeJobId:e()}),Pv=t({id:e(),composeJobId:e()}),nl=0,Av=t({candidateIndex:o().min(nl),selectStrategy:s(["agent-authoritative","editor-merge","editor-replace"]),ifMatch:e().optional()}).strict().describe("POST /projects/:id/compose/jobs/:jobId/select body."),il=0,_v=t({newCompositionEtag:e(),mergeResult:t({replayedEdits:o().min(il),droppedEdits:p(t({trackId:e(),clipId:e().optional(),wordStartMs:o().optional(),reason:s(["target_removed","conflict"])}))}).optional()}).describe("POST /projects/:id/compose/jobs/:jobId/select response."),qv=t({id:e(),composeJobId:e()}),sl=0,al=0,dl=0,pl=0,cl=0,ml=0,Fv=t({composeJobId:e(),projectId:e(),status:s(["queued","running","awaiting_input","complete","failed","cancelled"]),error:e().nullable(),request:t({suggestionId:e().optional(),fromComposition:h().optional(),scope:g().optional(),critique:e().optional(),parentJobId:e().optional(),maxCandidates:o().optional(),budgetUsd:o().optional(),qualityThreshold:o().optional()}),candidates:p(g()),winner:t({candidateIndex:o().min(sl),compositionRunId:e()}).nullable(),cost:t({llmUsd:o().min(al),visionUsd:o().min(dl),modalUsd:o().min(pl),totalUsd:o().min(cl)}).nullable(),listUsd:o().optional(),startedAt:o(),completedAt:o().nullable(),advisoryResult:t({mode:s(["advise","amend","explore"]),assessment:t({editorial:t({score:o(),grounding:s(["measured","judged"]),abstained:h(),reliability:o().optional()}),spatial:t({score:o(),grounding:s(["measured","judged"]),abstained:h(),reliability:o().optional()}),brand:t({score:o(),grounding:s(["measured","judged"]),abstained:h(),reliability:o().optional()}),caption:t({score:o(),grounding:s(["measured","judged"]),abstained:h(),reliability:o().optional()})}).optional().describe("Grounded critique of the CURRENT composition. Omitted for mode=advise."),proposals:p(t({label:e(),candidateIndex:o().min(ml).optional().describe("Present for amend/explore \u2014 adopt via POST /compose/jobs/:jobId/select with this candidateIndex. Absent for advise."),changeSummary:p(e()).describe("Human-legible edit-pattern labels."),boundToEtag:e().optional().describe("The composition etag this proposal was computed against."),expectedDelta:u(e(),e()).optional().describe("Advisory per-criterion score lift; NOT authoritative pre-recalibration.")})),principles:p(e()).describe("Reusable, grounded lessons for the client's next authoring."),plan:g().optional().describe("Present for mode=advise \u2014 the planner agent's ComposePlan (framing/cuts/captions/graphics intents) as GUIDANCE. The client agent reads it and re-authors; it is NOT converted to ops."),checkpointId:e().optional().describe("The durable kind:'score' Checkpoint minted from this advisory (evidence convergence \u2014 get_checkpoint re-reads the envelope later). Stamped at the consult success terminal.")}).optional().describe("The advisory envelope returned by a completed consult job (on ComposeJobDetailResponse.advisoryResult)."),checkpoint:t({checkpointId:e(),stage:s(["content","layout","motion"]),version:o()}).optional()}),Dv=t({id:e()}),Gv=t({jobs:p(t({composeJobId:e(),projectId:e(),status:s(["queued","running","awaiting_input","complete","failed","cancelled"]),suggestionId:e().optional(),createdAt:o(),completedAt:o().nullable()}))}),Nv=t({id:e(),composeJobId:e()}),ll=0,ul=0,fl=0,gl=0,hl=0,zl=0,Uv=t({composeJobId:e(),projectId:e(),status:s(["queued","running","awaiting_input","complete","failed","cancelled"]),error:e().nullable(),request:t({suggestionId:e().optional(),fromComposition:h().optional(),scope:g().optional(),critique:e().optional(),parentJobId:e().optional(),maxCandidates:o().optional(),budgetUsd:o().optional(),qualityThreshold:o().optional()}),candidates:p(g()),winner:t({candidateIndex:o().min(ll),compositionRunId:e()}).nullable(),cost:t({llmUsd:o().min(ul),visionUsd:o().min(fl),modalUsd:o().min(gl),totalUsd:o().min(hl)}).nullable(),listUsd:o().optional(),startedAt:o(),completedAt:o().nullable(),advisoryResult:t({mode:s(["advise","amend","explore"]),assessment:t({editorial:t({score:o(),grounding:s(["measured","judged"]),abstained:h(),reliability:o().optional()}),spatial:t({score:o(),grounding:s(["measured","judged"]),abstained:h(),reliability:o().optional()}),brand:t({score:o(),grounding:s(["measured","judged"]),abstained:h(),reliability:o().optional()}),caption:t({score:o(),grounding:s(["measured","judged"]),abstained:h(),reliability:o().optional()})}).optional().describe("Grounded critique of the CURRENT composition. Omitted for mode=advise."),proposals:p(t({label:e(),candidateIndex:o().min(zl).optional().describe("Present for amend/explore \u2014 adopt via POST /compose/jobs/:jobId/select with this candidateIndex. Absent for advise."),changeSummary:p(e()).describe("Human-legible edit-pattern labels."),boundToEtag:e().optional().describe("The composition etag this proposal was computed against."),expectedDelta:u(e(),e()).optional().describe("Advisory per-criterion score lift; NOT authoritative pre-recalibration.")})),principles:p(e()).describe("Reusable, grounded lessons for the client's next authoring."),plan:g().optional().describe("Present for mode=advise \u2014 the planner agent's ComposePlan (framing/cuts/captions/graphics intents) as GUIDANCE. The client agent reads it and re-authors; it is NOT converted to ops."),checkpointId:e().optional().describe("The durable kind:'score' Checkpoint minted from this advisory (evidence convergence \u2014 get_checkpoint re-reads the envelope later). Stamped at the consult success terminal.")}).optional().describe("The advisory envelope returned by a completed consult job (on ComposeJobDetailResponse.advisoryResult)."),checkpoint:t({checkpointId:e(),stage:s(["content","layout","motion"]),version:o()}).optional()});var Lv=t({id:e()}),xl=64,Wv=t({seedComposition:g().optional(),leaseJobId:e().min(1).max(xl).optional()}).strict(),Hv=t({sessionId:e()}),$v=t({id:e(),sessionId:e()}),Vv=t({composition:g().optional()}),Yv=t({id:e(),sessionId:e()}),Jv=t({ok:h()}),Xv=t({id:e(),sessionId:e()}),Zv=t({etag:e()});var eI=t({id:e()}),bl=2e3,oI=t({intent:e().min(1).max(bl).describe("Plain-English goal \u2014 what you're trying to achieve with this edit."),mode:s(["advise","amend","explore"]).optional().describe("advise = proposer-only (no render/judge, no grounded assessment); amend (default) = grade the current composition + author the fix for the weakest criterion; explore = ranked slate of diverse directions. All modes are async \u2014 poll the returned job."),focus:s(["editorial","spatial","brand","caption"]).optional().describe("Optional criterion to concentrate the advice on."),ifMatch:e().optional().describe("Etag of the composition the advice is computed against. Proposals are bound to it; apply a proposal BEFORE any other edit or it will 409.")}).strict().describe("POST /projects/:id/consult body.");var yl=0,Sl=10,Cl=6,rI=t({criticId:e().min(1).describe("Stable client id; re-registering the same id UPSERTS."),label:e().min(1),tier:s(["rules","rubric","evaluator"]),phase:s(["static","temporal"]).optional().describe("static (default) \u2192 runs each in-loop attempt AND in score_composition. temporal (final-render evaluation) is accepted but NOT yet wired \u2014 a temporal critic produces no verdicts today; use static."),floor:o().min(yl).max(Sl).optional().describe("Score below this routes a refine like a built-in criterion. Defaults to 6."),rules:p(u(e(),g())).optional().describe('tier "rules": declarative ClientRule[] (data).'),rubric:e().optional().describe('tier "rubric": your criterion + description; scored as an extra column.'),referenceMediaIds:p(e()).max(Cl).optional().describe('tier "rubric"/"evaluator": up to 6 org media ids whose thumbnails the judge sees as YOUR reference standard \u2014 "looks like mine" becomes a machine check. Each must be an org-owned media item with a visual thumbnail (422 names any that is not).'),url:e().url().optional().describe('tier "evaluator": your HTTPS webhook; CueFrame POSTs the artifact.')}).strict().describe("Register a custom compose critic."),nI=t({critics:p(t({criticId:e(),label:e(),tier:s(["rules","rubric","evaluator"]),phase:s(["static","temporal"]),floor:o(),referenceMediaIds:p(e()).optional()}).describe("One registered critic (rubric/rules/url stay write-only \u2014 never echoed)."))}),iI=t({criticId:e()});var aI=t({id:e()}),Rl=0,vl=0,Il=0,kl=0,Ol=0,Ml=0,wl=4,Bl=0,Tl=0,jl=0,El=0,Pl=0,Al=0,_l=0,ql=1,Fl=0,Dl=1,Gl=.1,Nl=1,Ul=0,Kl=0,Ll=-.3,Wl=.3,Hl=-.3,$l=.3,Vl=0,Yl=1,Jl=0,Xl=1,Zl=-.3,Ql=.3,eu=0,ou=1,tu=0,ru=1,nu=0,iu=1,su=1,au=1,du=0,pu=0,cu=0,mu=0,lu=0,uu=15,fu=100,gu=900,hu=100,zu=900,xu=0,bu=0,yu=0,Su=0,Cu=100,dI=t({v:o(),format:t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional(),platform:e().optional()}),tracks:p(t({id:e().min(1),kind:s(["video","audio","image","overlay","effect"]),name:e().optional(),enabled:h().optional(),contents:p(x([t({id:e().min(1),startTime:o().min(Rl).describe("Timeline start (seconds)."),duration:o().describe("Clip duration (seconds)."),source:x([t({kind:m("media"),mediaId:e().min(1),trim:t({start:o().min(vl).describe("Source trim start (seconds)."),end:o().min(Il).describe("Source trim end (seconds).")}).optional(),excludedRanges:p(t({start:o().min(kl),end:o().min(Ol),reason:e().optional()})).optional(),volume:o().min(Ml).max(wl).optional(),muted:h().optional(),playbackRate:o().optional(),sync:s(["video","independent"]).optional(),kenBurns:s(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(Bl).optional(),fadeOutMs:o().min(Tl).optional(),loop:h().optional(),audioRole:s(["sfx","music","vo","ambience"]).optional(),duck:t({duckDb:o().max(jl),attackMs:o().min(El),releaseMs:o().min(Pl),windows:p(t({startMs:o(),endMs:o()})).optional()}).optional(),anchor:t({clipId:e().min(1),offsetMs:o()}).optional(),reframe:t({segments:p(t({startSec:o().min(Al).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:o().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:x([t({mode:m("frame-center")}),t({mode:m("point"),x:o().min(_l).max(ql),y:o().min(Fl).max(Dl)}),t({mode:m("face"),faceId:e().min(1),shotScale:s(["close","standard","wide"]).optional()}),t({mode:m("all-faces")}),t({mode:m("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:o().min(Gl).max(Nl).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:t({in:o().min(Ul).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(Kl).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:t({x:o().min(Ll).max(Wl).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(Hl).max($l).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),t({kind:m("component"),componentId:e().min(1),props:u(e(),g())}),t({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:s(["front","behind-subject"]).optional(),anchor:t({space:m("scene"),x:o().min(Vl).max(Yl),y:o().min(Jl).max(Xl)}).optional(),parallax:o().min(Zl).max(Ql).optional()}),t({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}),t({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()})]),kind:s(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(eu).max(ou).optional(),scale:o().optional(),rotation:o().optional(),position:t({x:o(),y:o()}).optional(),region:t({x:o().min(tu).max(ru),y:o().min(nu).max(iu),w:o().max(su),h:o().max(au)}).optional(),fit:s(["cover","contain"]).optional(),effects:p(t({primitiveId:e().min(1),params:u(e(),g()).optional()})).optional(),transitionIn:t({type:e().min(1),duration:o()}).optional()}),t({id:e().min(1),startTime:o().min(du).describe("Timeline start (seconds)."),duration:o().describe("Gap duration (seconds).")})]))})),markers:p(t({id:e().min(1),startTime:o().min(pu),endTime:o().min(cu).optional(),kind:e().min(1),name:e().optional(),metadata:u(e(),g()).optional()})).optional(),captions:t({segments:p(t({words:p(t({text:e().min(1),startMs:o().min(mu),endMs:o().min(lu),emphasis:h().optional(),annotate:s(["circle","underline"]).optional()}))})),style:t({fontFamily:e().min(1).optional(),fontSize:o().min(1).max(uu).optional(),fontWeight:o().min(fu).max(gu).optional(),color:e().min(1).optional(),highlightColor:e().min(1).optional(),backgroundColor:e().optional(),plate:s(["glass","solid","none"]).optional(),position:s(["top","center","bottom"]).optional(),textTransform:s(["none","uppercase","capitalize"]).optional(),emphasisColor:e().optional(),emphasisGradient:e().optional(),emphasisScale:o().optional(),emphasisFontFamily:e().optional(),emphasisFontWeight:o().min(hu).max(zu).optional(),emphasisTextTransform:s(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:o().optional(),emphasisFontStyle:s(["normal","italic"]).optional(),entrance:s(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:o().min(xu).optional(),entranceStaggerMs:o().min(bu).optional(),exitMs:o().min(yu).optional(),emphasisPlate:h().optional(),emphasisPlateColor:e().optional(),emphasisPlateTextColor:e().optional(),emphasisPlateAltColor:e().optional(),emphasisPlateAltTextColor:e().optional(),emphasisPlateRadius:o().min(Su).optional(),emphasisPlatePadX:o().optional(),emphasisPlatePadY:o().optional(),annotationColor:e().optional(),maxWidthPercent:o().max(Cu).optional()}).optional()}).optional(),license:t({type:e().min(1),source:e().optional(),notes:e().optional()}).optional(),accessibility:t({audioDescriptionTrackId:e().optional(),captionsTrackId:e().optional(),signLanguageTrackId:e().optional(),notes:e().optional()}).optional()}).describe("Canonical composition wire shape (multi-track; carries reframe, captions, markers)."),pI=t({id:e()}),Ru=0,vu=0,Iu=0,ku=0,Ou=0,Mu=0,wu=4,Bu=0,Tu=0,ju=0,Eu=0,Pu=0,Au=0,_u=0,qu=1,Fu=0,Du=1,Gu=.1,Nu=1,Uu=0,Ku=0,Lu=-.3,Wu=.3,Hu=-.3,$u=.3,Vu=0,Yu=1,Ju=0,Xu=1,Zu=-.3,Qu=.3,ef=0,of=1,tf=0,rf=1,nf=0,sf=1,af=1,df=1,pf=0,cf=0,mf=0,lf=0,uf=0,ff=15,gf=100,hf=900,zf=100,xf=900,bf=0,yf=0,Sf=0,Cf=0,Rf=100,cI=t({v:o(),format:t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional(),platform:e().optional()}).strict(),tracks:p(t({id:e().min(1),kind:s(["video","audio","image","overlay","effect"]),name:e().optional(),enabled:h().optional(),contents:p(x([t({id:e().min(1),startTime:o().min(Ru).describe("Timeline start (seconds)."),duration:o().describe("Clip duration (seconds)."),source:x([t({kind:m("media"),mediaId:e().min(1),trim:t({start:o().min(vu).describe("Source trim start (seconds)."),end:o().min(Iu).describe("Source trim end (seconds).")}).strict().optional(),excludedRanges:p(t({start:o().min(ku),end:o().min(Ou),reason:e().optional()}).strict()).optional(),volume:o().min(Mu).max(wu).optional(),muted:h().optional(),playbackRate:o().optional(),sync:s(["video","independent"]).optional(),kenBurns:s(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(Bu).optional(),fadeOutMs:o().min(Tu).optional(),loop:h().optional(),audioRole:s(["sfx","music","vo","ambience"]).optional(),duck:t({duckDb:o().max(ju),attackMs:o().min(Eu),releaseMs:o().min(Pu),windows:p(t({startMs:o(),endMs:o()}).strict()).optional()}).strict().optional(),anchor:t({clipId:e().min(1),offsetMs:o()}).strict().optional(),reframe:t({segments:p(t({startSec:o().min(Au).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:o().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:x([t({mode:m("frame-center")}).strict(),t({mode:m("point"),x:o().min(_u).max(qu),y:o().min(Fu).max(Du)}).strict(),t({mode:m("face"),faceId:e().min(1),shotScale:s(["close","standard","wide"]).optional()}).strict(),t({mode:m("all-faces")}).strict(),t({mode:m("active-speaker")}).strict()]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:o().min(Gu).max(Nu).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:t({in:o().min(Uu).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(Ku).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).strict().optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:t({x:o().min(Lu).max(Wu).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(Hu).max($u).describe("Vertical nudge, source-normalized (+ = down).")}).strict().optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")}).strict()).min(1)}).strict().optional()}).strict(),t({kind:m("component"),componentId:e().min(1),props:u(e(),g())}).strict(),t({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:s(["front","behind-subject"]).optional(),anchor:t({space:m("scene"),x:o().min(Vu).max(Yu),y:o().min(Ju).max(Xu)}).strict().optional(),parallax:o().min(Zu).max(Qu).optional()}).strict(),t({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}).strict(),t({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()}).strict()]),kind:s(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(ef).max(of).optional(),scale:o().optional(),rotation:o().optional(),position:t({x:o(),y:o()}).strict().optional(),region:t({x:o().min(tf).max(rf),y:o().min(nf).max(sf),w:o().max(af),h:o().max(df)}).strict().optional(),fit:s(["cover","contain"]).optional(),effects:p(t({primitiveId:e().min(1),params:u(e(),g()).optional()}).strict()).optional(),transitionIn:t({type:e().min(1),duration:o()}).strict().optional()}).strict(),t({id:e().min(1),startTime:o().min(pf).describe("Timeline start (seconds)."),duration:o().describe("Gap duration (seconds).")}).strict()]))}).strict()),markers:p(t({id:e().min(1),startTime:o().min(cf),endTime:o().min(mf).optional(),kind:e().min(1),name:e().optional(),metadata:u(e(),g()).optional()}).strict()).optional(),captions:t({segments:p(t({words:p(t({text:e().min(1),startMs:o().min(lf),endMs:o().min(uf),emphasis:h().optional(),annotate:s(["circle","underline"]).optional()}).strict())}).strict()),style:t({fontFamily:e().min(1).optional(),fontSize:o().min(1).max(ff).optional(),fontWeight:o().min(gf).max(hf).optional(),color:e().min(1).optional(),highlightColor:e().min(1).optional(),backgroundColor:e().optional(),plate:s(["glass","solid","none"]).optional(),position:s(["top","center","bottom"]).optional(),textTransform:s(["none","uppercase","capitalize"]).optional(),emphasisColor:e().optional(),emphasisGradient:e().optional(),emphasisScale:o().optional(),emphasisFontFamily:e().optional(),emphasisFontWeight:o().min(zf).max(xf).optional(),emphasisTextTransform:s(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:o().optional(),emphasisFontStyle:s(["normal","italic"]).optional(),entrance:s(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:o().min(bf).optional(),entranceStaggerMs:o().min(yf).optional(),exitMs:o().min(Sf).optional(),emphasisPlate:h().optional(),emphasisPlateColor:e().optional(),emphasisPlateTextColor:e().optional(),emphasisPlateAltColor:e().optional(),emphasisPlateAltTextColor:e().optional(),emphasisPlateRadius:o().min(Cf).optional(),emphasisPlatePadX:o().optional(),emphasisPlatePadY:o().optional(),annotationColor:e().optional(),maxWidthPercent:o().max(Rf).optional()}).strict().optional()}).strict().optional(),license:t({type:e().min(1),source:e().optional(),notes:e().optional()}).strict().optional(),accessibility:t({audioDescriptionTrackId:e().optional(),captionsTrackId:e().optional(),signLanguageTrackId:e().optional(),notes:e().optional()}).strict().optional()}).strict().describe("Canonical composition wire shape (multi-track; carries reframe, captions, markers)."),mI=t({id:e()}),vf=200,lI=t({name:e().min(1).max(vf).optional(),format:t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional()}).strict().optional().describe("Output-format spec per \xA7Format.")}).strict().describe("POST /projects/:id/compositions body \u2014 create a new video (composition) in the project. `format` defaults to the project's compositionFormat when omitted."),uI=t({id:e()}),If=0,fI=t({data:p(t({compositionId:e(),format:t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional()}).describe("Output-format spec per \xA7Format."),etag:e(),isActive:h(),updatedAt:o(),sceneCount:o().min(If)}).describe("A composition in a project, flagging the active one."))}).describe("GET /projects/:id/compositions response."),gI=t({id:e()}),kf=0,Of=0,Mf=0,wf=0,Bf=0,Tf=0,jf=4,Ef=0,Pf=0,Af=0,_f=0,qf=0,Ff=0,Df=0,Gf=1,Nf=0,Uf=1,Kf=.1,Lf=1,Wf=0,Hf=0,$f=-.3,Vf=.3,Yf=-.3,Jf=.3,Xf=0,Zf=1,Qf=0,eg=1,og=-.3,tg=.3,rg=0,ng=1,ig=0,sg=1,ag=0,dg=1,pg=1,cg=1,mg=0,lg=0,ug=0,fg=0,gg=0,hg=0,zg=4,xg=0,bg=0,yg=0,Sg=0,Cg=0,Rg=0,vg=0,Ig=1,kg=0,Og=1,Mg=.1,wg=1,Bg=0,Tg=0,jg=-.3,Eg=.3,Pg=-.3,Ag=.3,_g=0,qg=1,Fg=0,Dg=1,Gg=-.3,Ng=.3,Ug=0,Kg=1,Lg=0,Wg=1,Hg=0,$g=1,Vg=1,Yg=1,Jg=0,Xg=0,Zg=0,Qg=0,eh=0,oh=0,th=4,rh=0,nh=0,ih=0,sh=0,ah=0,dh=0,ph=0,ch=1,mh=0,lh=1,uh=.1,fh=1,gh=0,hh=0,zh=-.3,xh=.3,bh=-.3,yh=.3,Sh=0,Ch=1,Rh=0,vh=1,Ih=-.3,kh=.3,Oh=0,Mh=1,wh=0,Bh=1,Th=0,jh=1,Eh=1,Ph=1,Ah=0,_h=0,qh=0,Fh=0,Dh=0,Gh=0,Nh=1,Uh=0,Kh=1,Lh=.1,Wh=1,Hh=0,$h=0,Vh=-.3,Yh=.3,Jh=-.3,Xh=.3,Zh=15,Qh=100,ez=900,oz=100,tz=900,rz=0,nz=0,iz=0,sz=0,az=100,dz=0,pz=0,cz=15,mz=100,lz=900,uz=100,fz=900,gz=0,hz=0,zz=0,xz=0,bz=100,yz=0,Sz=2e3,hI=x([t({type:m("clip.add"),clip:t({id:e().min(1),startTime:o().min(kf).describe("Timeline start (seconds)."),duration:o().describe("Clip duration (seconds)."),source:x([t({kind:m("media"),mediaId:e().min(1),trim:t({start:o().min(Of).describe("Source trim start (seconds)."),end:o().min(Mf).describe("Source trim end (seconds).")}).strict().optional(),excludedRanges:p(t({start:o().min(wf),end:o().min(Bf),reason:e().optional()}).strict()).optional(),volume:o().min(Tf).max(jf).optional(),muted:h().optional(),playbackRate:o().optional(),sync:s(["video","independent"]).optional(),kenBurns:s(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(Ef).optional(),fadeOutMs:o().min(Pf).optional(),loop:h().optional(),audioRole:s(["sfx","music","vo","ambience"]).optional(),duck:t({duckDb:o().max(Af),attackMs:o().min(_f),releaseMs:o().min(qf),windows:p(t({startMs:o(),endMs:o()}).strict()).optional()}).strict().optional(),anchor:t({clipId:e().min(1),offsetMs:o()}).strict().optional(),reframe:t({segments:p(t({startSec:o().min(Ff).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:o().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:x([t({mode:m("frame-center")}).strict(),t({mode:m("point"),x:o().min(Df).max(Gf),y:o().min(Nf).max(Uf)}).strict(),t({mode:m("face"),faceId:e().min(1),shotScale:s(["close","standard","wide"]).optional()}).strict(),t({mode:m("all-faces")}).strict(),t({mode:m("active-speaker")}).strict()]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:o().min(Kf).max(Lf).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:t({in:o().min(Wf).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(Hf).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).strict().optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:t({x:o().min($f).max(Vf).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(Yf).max(Jf).describe("Vertical nudge, source-normalized (+ = down).")}).strict().optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")}).strict()).min(1)}).strict().optional()}).strict(),t({kind:m("component"),componentId:e().min(1),props:u(e(),g())}).strict(),t({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:s(["front","behind-subject"]).optional(),anchor:t({space:m("scene"),x:o().min(Xf).max(Zf),y:o().min(Qf).max(eg)}).strict().optional(),parallax:o().min(og).max(tg).optional()}).strict(),t({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}).strict(),t({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()}).strict()]),kind:s(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(rg).max(ng).optional(),scale:o().optional(),rotation:o().optional(),position:t({x:o(),y:o()}).strict().optional(),region:t({x:o().min(ig).max(sg),y:o().min(ag).max(dg),w:o().max(pg),h:o().max(cg)}).strict().optional(),fit:s(["cover","contain"]).optional(),effects:p(t({primitiveId:e().min(1),params:u(e(),g()).optional()}).strict()).optional(),transitionIn:t({type:e().min(1),duration:o()}).strict().optional()}).strict(),trackId:e().optional(),newTrack:h().optional(),newTrackId:e().optional()}).strict().describe("Add a clip to the timeline. The clip self-routes to a track by FAMILY (`clip.kind`, else derived from `source.kind`, else the target track) \u2014 a `media` clip MUST carry `kind` (video|audio|image) or a `trackId`, else it is rejected as ambiguous. `trackId` targets an existing SAME-family track; `newTrack:true` (with optional pinned `newTrackId`) creates a fresh track of that family."),t({type:m("clip.remove"),clipId:e()}).strict().describe("Remove a clip by id (located across every track)."),t({type:m("clip.update"),clipId:e(),patch:t({id:e().min(1).optional(),startTime:o().min(mg).optional().describe("Timeline start (seconds)."),duration:o().optional().describe("Clip duration (seconds)."),source:x([t({kind:m("media"),mediaId:e().min(1),trim:t({start:o().min(lg).describe("Source trim start (seconds)."),end:o().min(ug).describe("Source trim end (seconds).")}).strict().optional(),excludedRanges:p(t({start:o().min(fg),end:o().min(gg),reason:e().optional()}).strict()).optional(),volume:o().min(hg).max(zg).optional(),muted:h().optional(),playbackRate:o().optional(),sync:s(["video","independent"]).optional(),kenBurns:s(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(xg).optional(),fadeOutMs:o().min(bg).optional(),loop:h().optional(),audioRole:s(["sfx","music","vo","ambience"]).optional(),duck:t({duckDb:o().max(yg),attackMs:o().min(Sg),releaseMs:o().min(Cg),windows:p(t({startMs:o(),endMs:o()}).strict()).optional()}).strict().optional(),anchor:t({clipId:e().min(1),offsetMs:o()}).strict().optional(),reframe:t({segments:p(t({startSec:o().min(Rg).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:o().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:x([t({mode:m("frame-center")}).strict(),t({mode:m("point"),x:o().min(vg).max(Ig),y:o().min(kg).max(Og)}).strict(),t({mode:m("face"),faceId:e().min(1),shotScale:s(["close","standard","wide"]).optional()}).strict(),t({mode:m("all-faces")}).strict(),t({mode:m("active-speaker")}).strict()]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:o().min(Mg).max(wg).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:t({in:o().min(Bg).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(Tg).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).strict().optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:t({x:o().min(jg).max(Eg).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(Pg).max(Ag).describe("Vertical nudge, source-normalized (+ = down).")}).strict().optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")}).strict()).min(1)}).strict().optional()}).strict(),t({kind:m("component"),componentId:e().min(1),props:u(e(),g())}).strict(),t({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:s(["front","behind-subject"]).optional(),anchor:t({space:m("scene"),x:o().min(_g).max(qg),y:o().min(Fg).max(Dg)}).strict().optional(),parallax:o().min(Gg).max(Ng).optional()}).strict(),t({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}).strict(),t({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()}).strict()]).optional(),kind:s(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(Ug).max(Kg).optional(),scale:o().optional(),rotation:o().optional(),position:t({x:o(),y:o()}).strict().optional(),region:t({x:o().min(Lg).max(Wg),y:o().min(Hg).max($g),w:o().max(Vg),h:o().max(Yg)}).strict().optional(),fit:s(["cover","contain"]).optional(),effects:p(t({primitiveId:e().min(1),params:u(e(),g()).optional()}).strict()).optional(),transitionIn:t({type:e().min(1),duration:o()}).strict().optional()}).strict()}).strict().describe("Patch an existing clip by id (cross-family). The patch is a partial TimelineClip. NOTE: `source` is REPLACED wholesale \u2014 the patch merges at the top level only, so a partial `source` WIPES the source fields you omit. Patch the whole source object when changing it. (To change reframe/excluded ranges, prefer setCropIntents / addExcludedRange, not a source patch.)"),t({type:m("removeClipsByMediaId"),mediaId:e()}).strict().describe("Remove EVERY clip sourced from a given mediaId (e.g. after deleting that media)."),t({type:m("loadOverlays"),clips:p(t({id:e().min(1),startTime:o().min(Jg).describe("Timeline start (seconds)."),duration:o().describe("Clip duration (seconds)."),source:x([t({kind:m("media"),mediaId:e().min(1),trim:t({start:o().min(Xg).describe("Source trim start (seconds)."),end:o().min(Zg).describe("Source trim end (seconds).")}).strict().optional(),excludedRanges:p(t({start:o().min(Qg),end:o().min(eh),reason:e().optional()}).strict()).optional(),volume:o().min(oh).max(th).optional(),muted:h().optional(),playbackRate:o().optional(),sync:s(["video","independent"]).optional(),kenBurns:s(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(rh).optional(),fadeOutMs:o().min(nh).optional(),loop:h().optional(),audioRole:s(["sfx","music","vo","ambience"]).optional(),duck:t({duckDb:o().max(ih),attackMs:o().min(sh),releaseMs:o().min(ah),windows:p(t({startMs:o(),endMs:o()}).strict()).optional()}).strict().optional(),anchor:t({clipId:e().min(1),offsetMs:o()}).strict().optional(),reframe:t({segments:p(t({startSec:o().min(dh).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:o().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:x([t({mode:m("frame-center")}).strict(),t({mode:m("point"),x:o().min(ph).max(ch),y:o().min(mh).max(lh)}).strict(),t({mode:m("face"),faceId:e().min(1),shotScale:s(["close","standard","wide"]).optional()}).strict(),t({mode:m("all-faces")}).strict(),t({mode:m("active-speaker")}).strict()]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:o().min(uh).max(fh).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:t({in:o().min(gh).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(hh).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).strict().optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:t({x:o().min(zh).max(xh).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(bh).max(yh).describe("Vertical nudge, source-normalized (+ = down).")}).strict().optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")}).strict()).min(1)}).strict().optional()}).strict(),t({kind:m("component"),componentId:e().min(1),props:u(e(),g())}).strict(),t({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:s(["front","behind-subject"]).optional(),anchor:t({space:m("scene"),x:o().min(Sh).max(Ch),y:o().min(Rh).max(vh)}).strict().optional(),parallax:o().min(Ih).max(kh).optional()}).strict(),t({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}).strict(),t({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()}).strict()]),kind:s(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(Oh).max(Mh).optional(),scale:o().optional(),rotation:o().optional(),position:t({x:o(),y:o()}).strict().optional(),region:t({x:o().min(wh).max(Bh),y:o().min(Th).max(jh),w:o().max(Eh),h:o().max(Ph)}).strict().optional(),fit:s(["cover","contain"]).optional(),effects:p(t({primitiveId:e().min(1),params:u(e(),g()).optional()}).strict()).optional(),transitionIn:t({type:e().min(1),duration:o()}).strict().optional()}).strict())}).strict().describe("Replace the overlay channel wholesale with the given clips (bulk set, not a merge)."),t({type:m("addMarker"),marker:t({id:e().min(1),startTime:o().min(Ah),endTime:o().min(_h).optional(),kind:e().min(1),name:e().optional(),metadata:u(e(),g()).optional()}).strict()}).strict().describe("Add a timeline marker (a named time point/range; carry extensions in `metadata`)."),t({type:m("removeMarker"),markerId:e()}).strict().describe("Remove a marker by id."),t({type:m("updateMarker"),markerId:e(),updates:t({id:e().min(1).optional(),startTime:o().min(qh).optional(),endTime:o().min(Fh).optional(),kind:e().min(1).optional(),name:e().optional(),metadata:u(e(),g()).optional()}).strict()}).strict().describe("Patch a marker's fields by id (partial merge)."),t({type:m("setCropIntents"),clipId:e(),segments:p(t({startSec:o().min(Dh).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:o().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:x([t({mode:m("frame-center")}).strict(),t({mode:m("point"),x:o().min(Gh).max(Nh),y:o().min(Uh).max(Kh)}).strict(),t({mode:m("face"),faceId:e().min(1),shotScale:s(["close","standard","wide"]).optional()}).strict(),t({mode:m("all-faces")}).strict(),t({mode:m("active-speaker")}).strict()]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:o().min(Lh).max(Wh).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:t({in:o().min(Hh).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min($h).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).strict().optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:t({x:o().min(Vh).max(Yh).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(Jh).max(Xh).describe("Vertical nudge, source-normalized (+ = down).")}).strict().optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")}).strict()).nullable()}).strict().describe("Set (or CLEAR, with `segments: null`) the camera/reframe channel on a MEDIA clip \u2014 the time-aligned source\u2192output viewport (focus, zoom, ease, bias). This is the PREFERRED way to author reframing; do NOT reframe via a whole-source `clip.update` patch. Segments tile the clip's duration."),t({type:m("setCaptionStyle"),style:t({fontFamily:e().min(1).optional(),fontSize:o().min(1).max(Zh).optional(),fontWeight:o().min(Qh).max(ez).optional(),color:e().min(1).optional(),highlightColor:e().min(1).optional(),backgroundColor:e().optional(),plate:s(["glass","solid","none"]).optional(),position:s(["top","center","bottom"]).optional(),textTransform:s(["none","uppercase","capitalize"]).optional(),emphasisColor:e().optional(),emphasisGradient:e().optional(),emphasisScale:o().optional(),emphasisFontFamily:e().optional(),emphasisFontWeight:o().min(oz).max(tz).optional(),emphasisTextTransform:s(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:o().optional(),emphasisFontStyle:s(["normal","italic"]).optional(),entrance:s(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:o().min(rz).optional(),entranceStaggerMs:o().min(nz).optional(),exitMs:o().min(iz).optional(),emphasisPlate:h().optional(),emphasisPlateColor:e().optional(),emphasisPlateTextColor:e().optional(),emphasisPlateAltColor:e().optional(),emphasisPlateAltTextColor:e().optional(),emphasisPlateRadius:o().min(sz).optional(),emphasisPlatePadX:o().optional(),emphasisPlatePadY:o().optional(),annotationColor:e().optional(),maxWidthPercent:o().max(az).optional()}).strict()}).strict().describe("Merge style overrides (font/color/position/emphasis) onto the composition's caption layer. Partial \u2014 omitted fields keep their current value; creates the caption container if absent."),t({type:m("setCaptions"),segments:p(t({words:p(t({text:e().min(1),startMs:o().min(dz),endMs:o().min(pz),emphasis:h().optional(),annotate:s(["circle","underline"]).optional()}).strict())}).strict()),style:t({fontFamily:e().min(1).optional(),fontSize:o().min(1).max(cz).optional(),fontWeight:o().min(mz).max(lz).optional(),color:e().min(1).optional(),highlightColor:e().min(1).optional(),backgroundColor:e().optional(),plate:s(["glass","solid","none"]).optional(),position:s(["top","center","bottom"]).optional(),textTransform:s(["none","uppercase","capitalize"]).optional(),emphasisColor:e().optional(),emphasisGradient:e().optional(),emphasisScale:o().optional(),emphasisFontFamily:e().optional(),emphasisFontWeight:o().min(uz).max(fz).optional(),emphasisTextTransform:s(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:o().optional(),emphasisFontStyle:s(["normal","italic"]).optional(),entrance:s(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:o().min(gz).optional(),entranceStaggerMs:o().min(hz).optional(),exitMs:o().min(zz).optional(),emphasisPlate:h().optional(),emphasisPlateColor:e().optional(),emphasisPlateTextColor:e().optional(),emphasisPlateAltColor:e().optional(),emphasisPlateAltTextColor:e().optional(),emphasisPlateRadius:o().min(xz).optional(),emphasisPlatePadX:o().optional(),emphasisPlatePadY:o().optional(),annotationColor:e().optional(),maxWidthPercent:o().max(bz).optional()}).strict().optional()}).strict().describe("Replace the caption SEGMENTS wholesale \u2014 author the word-timed caption layer directly (each segment = one sentence/page of `words` with timeline-ms `startMs`/`endMs`, optional `emphasis`). This is how a client with its OWN word timings (e.g. a generated VO take) gets word-synced captions without a source transcript; the compose lane's transcript slice writes the same layer. `style`, when given, merges with setCaptionStyle semantics; an omitted style keeps the existing one. Renderer paginates within a segment and never pools words across two \u2014 keep segments sentence-bounded."),t({type:m("captions.fromTranscript"),mediaId:e().min(1),window:t({startSec:o().min(yz),endSec:o()}).strict().optional()}).strict().describe("Attach caption CONTENT from the media's cached transcript \u2014 no pasting words. ROUTE-MATERIALIZED like applyMotionPreset/materializeGrid: the server slices the word-timed transcript to `window` (source seconds; absent = the whole media), rebases times, sentence-splits into segments, and applies it as `setCaptions`. 422 media_no_transcript when the media has no transcript or no words in the window. For your OWN word timings use setCaptions directly."),t({type:m("applyMotionPreset"),clipId:e(),preset:e(),params:t({enterMs:o().optional(),exitMs:o().optional(),staggerMs:o().optional()}).strict().optional()}).strict().describe("Shell a STATIC `card` clip with a frame-driven MOTION preset \u2014 the public card-shelling op (the layout renders VERBATIM; only the container animates in/out). The server wraps the card in the chosen `preset` (fade-up / slide-in-left / slide-in-right / scale-pop / stagger-reveal), transpiles it, mints it as a LIVE component, and swaps the clip source to that component (the bakeless live lane \u2014 no box). `params` tunes timing (`enterMs`/`exitMs`, `staggerMs` for stagger-reveal). The target must be a static card (components already carry motion; library overlays already move); re-run overwrites idempotently ONLY while the target is still a card (an uncompilable shell); once shelled, the clip is a COMPONENT \u2014 to change its motion, remove and re-add the card, then re-shell. Honored under `dry_run` (validates preset + target without transpiling or persisting). ORDERING: the preset resolves its target against the PERSISTED composition \u2014 a card added in the SAME batch is not yet visible to it. Persist the clip.add batch first, then shell in a following call."),t({type:m("materializeGrid"),clipId:e(),grid:s(["beat","word","shot"]),maxMarkers:o().max(Sz).optional()}).strict().describe('Materialize a clip\'s SOURCE-media temporal GRID as timeline markers \u2014 the rhythm authority you cut to. `grid:"beat"` reads a MUSIC bed\'s beat map (get_media_context.beatGrid), `grid:"word"` the VO word onsets (wordGrid); each grid point is projected from media time to TIMELINE time through the clip\'s placement (startTime, trim, playbackRate, excludedRanges) and written as a `kind:"beat"|"word"` marker (`metadata.sourceClipId` set). Points outside the clip\'s visible window are skipped. Re-running REPLACES the prior markers from the same clip+grid (idempotent). Land cuts and transition MIDPOINTS on the markers (a 0.5s transition starts 0.25s before its marker). `maxMarkers` (default 500, ceiling 2000) \u2014 exceeding it fails loud with the count. `grid:"shot"` is not yet exposed (shot_grid_unavailable). The target must be a media clip; absent evidence fails loud (grid_unavailable) naming how to get it (declare audioRole:"music" at ingest / transcribe).'),t({type:m("setFormat"),format:t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional()}).strict()}).strict().describe("Set the output format \u2014 `aspectRatio` (16:9|9:16|1:1|4:5) plus optional `fps` and `resolution`. Merges: an omitted field keeps the current value."),t({type:m("addTrack"),kind:s(["video","audio","image","overlay","effect"]),name:e().optional(),id:e().optional()}).strict().describe("Add an EMPTY track of a given family (video|audio|image|overlay|effect). Optional pinned `id`."),t({type:m("removeTrack"),trackId:e()}).strict().describe("Remove a track AND all its clips by id."),t({type:m("updateTrack"),trackId:e(),updates:t({name:e().optional(),enabled:h().optional()}).strict()}).strict().describe("Patch a track's `name` / `enabled` by id."),t({type:m("reorderTracks"),fromIndex:o(),toIndex:o()}).strict().describe("Move a track from one index to another (changes layer/compositing order)."),t({type:m("moveClipToTrack"),clipId:e(),targetTrackId:e(),newStartTime:o().optional()}).strict().describe("Move a clip to another SAME-family track, optionally at a new `newStartTime`."),t({type:m("duplicateClip"),clipId:e(),newClipId:e().optional()}).strict().describe("Duplicate a clip by id. Pin `newClipId` to make the copy's id deterministic (required for a clean undo/inverse)."),t({type:m("cutAndRipple"),start:o(),end:o()}).strict().describe("Server-authoritative: delete the [start,end] time window (seconds) and ripple every downstream clip/marker/caption earlier to close the gap."),t({type:m("ripple"),time:o(),amount:o()}).strict().describe("Server-authoritative: shift everything at/after `time` (seconds) by `amount` seconds (+ opens a gap, \u2212 closes one)."),t({type:m("addExcludedRange"),clipId:e(),sourceStart:o(),sourceEnd:o(),reason:e().optional()}).strict().describe("Server-authoritative: exclude a [sourceStart,sourceEnd] span (seconds) of a clip's SOURCE (an internal trim) and ripple downstream \u2014 the preferred way to drop a sub-range vs a source patch."),t({type:m("removeExcludedRange"),clipId:e(),rangeIdx:o()}).strict().describe("Server-authoritative: remove a clip's previously-added excluded range by index (re-includes that span, ripples downstream).")]).describe("One scoped composition operation. Discriminated by `type` \u2014 `clip.add` / `clip.remove` / `clip.update` patch clips across any family; the rest cover markers, reframe, captions, format, tracks, and the server-authoritative ripple recomputes. Validated strictly server-side against the runtime CompositionOp vocabulary."),zI=t({id:e()}),Cz=0,Rz=0,vz=0,Iz=0,kz=0,Oz=0,Mz=4,wz=0,Bz=0,Tz=0,jz=0,Ez=0,Pz=0,Az=0,_z=1,qz=0,Fz=1,Dz=.1,Gz=1,Nz=0,Uz=0,Kz=-.3,Lz=.3,Wz=-.3,Hz=.3,$z=0,Vz=1,Yz=0,Jz=1,Xz=-.3,Zz=.3,Qz=0,ex=1,ox=0,tx=1,rx=0,nx=1,ix=1,sx=1,ax=0,dx=0,px=0,cx=0,mx=0,lx=0,ux=4,fx=0,gx=0,hx=0,zx=0,xx=0,bx=0,yx=0,Sx=1,Cx=0,Rx=1,vx=.1,Ix=1,kx=0,Ox=0,Mx=-.3,wx=.3,Bx=-.3,Tx=.3,jx=0,Ex=1,Px=0,Ax=1,_x=-.3,qx=.3,Fx=0,Dx=1,Gx=0,Nx=1,Ux=0,Kx=1,Lx=1,Wx=1,Hx=0,$x=0,Vx=0,Yx=0,Jx=0,Xx=0,Zx=4,Qx=0,eb=0,ob=0,tb=0,rb=0,nb=0,ib=0,sb=1,ab=0,db=1,pb=.1,cb=1,mb=0,lb=0,ub=-.3,fb=.3,gb=-.3,hb=.3,zb=0,xb=1,bb=0,yb=1,Sb=-.3,Cb=.3,Rb=0,vb=1,Ib=0,kb=1,Ob=0,Mb=1,wb=1,Bb=1,Tb=0,jb=0,Eb=0,Pb=0,Ab=0,_b=0,qb=1,Fb=0,Db=1,Gb=.1,Nb=1,Ub=0,Kb=0,Lb=-.3,Wb=.3,Hb=-.3,$b=.3,Vb=15,Yb=100,Jb=900,Xb=100,Zb=900,Qb=0,ey=0,oy=0,ty=0,ry=100,ny=0,iy=0,sy=15,ay=100,dy=900,py=100,cy=900,my=0,ly=0,uy=0,fy=0,gy=100,hy=0,zy=2e3,xI=t({ops:p(x([t({type:m("clip.add"),clip:t({id:e().min(1),startTime:o().min(Cz).describe("Timeline start (seconds)."),duration:o().describe("Clip duration (seconds)."),source:x([t({kind:m("media"),mediaId:e().min(1),trim:t({start:o().min(Rz).describe("Source trim start (seconds)."),end:o().min(vz).describe("Source trim end (seconds).")}).strict().optional(),excludedRanges:p(t({start:o().min(Iz),end:o().min(kz),reason:e().optional()}).strict()).optional(),volume:o().min(Oz).max(Mz).optional(),muted:h().optional(),playbackRate:o().optional(),sync:s(["video","independent"]).optional(),kenBurns:s(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(wz).optional(),fadeOutMs:o().min(Bz).optional(),loop:h().optional(),audioRole:s(["sfx","music","vo","ambience"]).optional(),duck:t({duckDb:o().max(Tz),attackMs:o().min(jz),releaseMs:o().min(Ez),windows:p(t({startMs:o(),endMs:o()}).strict()).optional()}).strict().optional(),anchor:t({clipId:e().min(1),offsetMs:o()}).strict().optional(),reframe:t({segments:p(t({startSec:o().min(Pz).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:o().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:x([t({mode:m("frame-center")}).strict(),t({mode:m("point"),x:o().min(Az).max(_z),y:o().min(qz).max(Fz)}).strict(),t({mode:m("face"),faceId:e().min(1),shotScale:s(["close","standard","wide"]).optional()}).strict(),t({mode:m("all-faces")}).strict(),t({mode:m("active-speaker")}).strict()]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:o().min(Dz).max(Gz).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:t({in:o().min(Nz).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(Uz).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).strict().optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:t({x:o().min(Kz).max(Lz).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(Wz).max(Hz).describe("Vertical nudge, source-normalized (+ = down).")}).strict().optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")}).strict()).min(1)}).strict().optional()}).strict(),t({kind:m("component"),componentId:e().min(1),props:u(e(),g())}).strict(),t({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:s(["front","behind-subject"]).optional(),anchor:t({space:m("scene"),x:o().min($z).max(Vz),y:o().min(Yz).max(Jz)}).strict().optional(),parallax:o().min(Xz).max(Zz).optional()}).strict(),t({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}).strict(),t({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()}).strict()]),kind:s(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(Qz).max(ex).optional(),scale:o().optional(),rotation:o().optional(),position:t({x:o(),y:o()}).strict().optional(),region:t({x:o().min(ox).max(tx),y:o().min(rx).max(nx),w:o().max(ix),h:o().max(sx)}).strict().optional(),fit:s(["cover","contain"]).optional(),effects:p(t({primitiveId:e().min(1),params:u(e(),g()).optional()}).strict()).optional(),transitionIn:t({type:e().min(1),duration:o()}).strict().optional()}).strict(),trackId:e().optional(),newTrack:h().optional(),newTrackId:e().optional()}).strict().describe("Add a clip to the timeline. The clip self-routes to a track by FAMILY (`clip.kind`, else derived from `source.kind`, else the target track) \u2014 a `media` clip MUST carry `kind` (video|audio|image) or a `trackId`, else it is rejected as ambiguous. `trackId` targets an existing SAME-family track; `newTrack:true` (with optional pinned `newTrackId`) creates a fresh track of that family."),t({type:m("clip.remove"),clipId:e()}).strict().describe("Remove a clip by id (located across every track)."),t({type:m("clip.update"),clipId:e(),patch:t({id:e().min(1).optional(),startTime:o().min(ax).optional().describe("Timeline start (seconds)."),duration:o().optional().describe("Clip duration (seconds)."),source:x([t({kind:m("media"),mediaId:e().min(1),trim:t({start:o().min(dx).describe("Source trim start (seconds)."),end:o().min(px).describe("Source trim end (seconds).")}).strict().optional(),excludedRanges:p(t({start:o().min(cx),end:o().min(mx),reason:e().optional()}).strict()).optional(),volume:o().min(lx).max(ux).optional(),muted:h().optional(),playbackRate:o().optional(),sync:s(["video","independent"]).optional(),kenBurns:s(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(fx).optional(),fadeOutMs:o().min(gx).optional(),loop:h().optional(),audioRole:s(["sfx","music","vo","ambience"]).optional(),duck:t({duckDb:o().max(hx),attackMs:o().min(zx),releaseMs:o().min(xx),windows:p(t({startMs:o(),endMs:o()}).strict()).optional()}).strict().optional(),anchor:t({clipId:e().min(1),offsetMs:o()}).strict().optional(),reframe:t({segments:p(t({startSec:o().min(bx).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:o().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:x([t({mode:m("frame-center")}).strict(),t({mode:m("point"),x:o().min(yx).max(Sx),y:o().min(Cx).max(Rx)}).strict(),t({mode:m("face"),faceId:e().min(1),shotScale:s(["close","standard","wide"]).optional()}).strict(),t({mode:m("all-faces")}).strict(),t({mode:m("active-speaker")}).strict()]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:o().min(vx).max(Ix).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:t({in:o().min(kx).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(Ox).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).strict().optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:t({x:o().min(Mx).max(wx).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(Bx).max(Tx).describe("Vertical nudge, source-normalized (+ = down).")}).strict().optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")}).strict()).min(1)}).strict().optional()}).strict(),t({kind:m("component"),componentId:e().min(1),props:u(e(),g())}).strict(),t({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:s(["front","behind-subject"]).optional(),anchor:t({space:m("scene"),x:o().min(jx).max(Ex),y:o().min(Px).max(Ax)}).strict().optional(),parallax:o().min(_x).max(qx).optional()}).strict(),t({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}).strict(),t({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()}).strict()]).optional(),kind:s(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(Fx).max(Dx).optional(),scale:o().optional(),rotation:o().optional(),position:t({x:o(),y:o()}).strict().optional(),region:t({x:o().min(Gx).max(Nx),y:o().min(Ux).max(Kx),w:o().max(Lx),h:o().max(Wx)}).strict().optional(),fit:s(["cover","contain"]).optional(),effects:p(t({primitiveId:e().min(1),params:u(e(),g()).optional()}).strict()).optional(),transitionIn:t({type:e().min(1),duration:o()}).strict().optional()}).strict()}).strict().describe("Patch an existing clip by id (cross-family). The patch is a partial TimelineClip. NOTE: `source` is REPLACED wholesale \u2014 the patch merges at the top level only, so a partial `source` WIPES the source fields you omit. Patch the whole source object when changing it. (To change reframe/excluded ranges, prefer setCropIntents / addExcludedRange, not a source patch.)"),t({type:m("removeClipsByMediaId"),mediaId:e()}).strict().describe("Remove EVERY clip sourced from a given mediaId (e.g. after deleting that media)."),t({type:m("loadOverlays"),clips:p(t({id:e().min(1),startTime:o().min(Hx).describe("Timeline start (seconds)."),duration:o().describe("Clip duration (seconds)."),source:x([t({kind:m("media"),mediaId:e().min(1),trim:t({start:o().min($x).describe("Source trim start (seconds)."),end:o().min(Vx).describe("Source trim end (seconds).")}).strict().optional(),excludedRanges:p(t({start:o().min(Yx),end:o().min(Jx),reason:e().optional()}).strict()).optional(),volume:o().min(Xx).max(Zx).optional(),muted:h().optional(),playbackRate:o().optional(),sync:s(["video","independent"]).optional(),kenBurns:s(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(Qx).optional(),fadeOutMs:o().min(eb).optional(),loop:h().optional(),audioRole:s(["sfx","music","vo","ambience"]).optional(),duck:t({duckDb:o().max(ob),attackMs:o().min(tb),releaseMs:o().min(rb),windows:p(t({startMs:o(),endMs:o()}).strict()).optional()}).strict().optional(),anchor:t({clipId:e().min(1),offsetMs:o()}).strict().optional(),reframe:t({segments:p(t({startSec:o().min(nb).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:o().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:x([t({mode:m("frame-center")}).strict(),t({mode:m("point"),x:o().min(ib).max(sb),y:o().min(ab).max(db)}).strict(),t({mode:m("face"),faceId:e().min(1),shotScale:s(["close","standard","wide"]).optional()}).strict(),t({mode:m("all-faces")}).strict(),t({mode:m("active-speaker")}).strict()]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:o().min(pb).max(cb).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:t({in:o().min(mb).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(lb).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).strict().optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:t({x:o().min(ub).max(fb).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(gb).max(hb).describe("Vertical nudge, source-normalized (+ = down).")}).strict().optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")}).strict()).min(1)}).strict().optional()}).strict(),t({kind:m("component"),componentId:e().min(1),props:u(e(),g())}).strict(),t({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:s(["front","behind-subject"]).optional(),anchor:t({space:m("scene"),x:o().min(zb).max(xb),y:o().min(bb).max(yb)}).strict().optional(),parallax:o().min(Sb).max(Cb).optional()}).strict(),t({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}).strict(),t({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()}).strict()]),kind:s(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(Rb).max(vb).optional(),scale:o().optional(),rotation:o().optional(),position:t({x:o(),y:o()}).strict().optional(),region:t({x:o().min(Ib).max(kb),y:o().min(Ob).max(Mb),w:o().max(wb),h:o().max(Bb)}).strict().optional(),fit:s(["cover","contain"]).optional(),effects:p(t({primitiveId:e().min(1),params:u(e(),g()).optional()}).strict()).optional(),transitionIn:t({type:e().min(1),duration:o()}).strict().optional()}).strict())}).strict().describe("Replace the overlay channel wholesale with the given clips (bulk set, not a merge)."),t({type:m("addMarker"),marker:t({id:e().min(1),startTime:o().min(Tb),endTime:o().min(jb).optional(),kind:e().min(1),name:e().optional(),metadata:u(e(),g()).optional()}).strict()}).strict().describe("Add a timeline marker (a named time point/range; carry extensions in `metadata`)."),t({type:m("removeMarker"),markerId:e()}).strict().describe("Remove a marker by id."),t({type:m("updateMarker"),markerId:e(),updates:t({id:e().min(1).optional(),startTime:o().min(Eb).optional(),endTime:o().min(Pb).optional(),kind:e().min(1).optional(),name:e().optional(),metadata:u(e(),g()).optional()}).strict()}).strict().describe("Patch a marker's fields by id (partial merge)."),t({type:m("setCropIntents"),clipId:e(),segments:p(t({startSec:o().min(Ab).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:o().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:x([t({mode:m("frame-center")}).strict(),t({mode:m("point"),x:o().min(_b).max(qb),y:o().min(Fb).max(Db)}).strict(),t({mode:m("face"),faceId:e().min(1),shotScale:s(["close","standard","wide"]).optional()}).strict(),t({mode:m("all-faces")}).strict(),t({mode:m("active-speaker")}).strict()]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:o().min(Gb).max(Nb).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:t({in:o().min(Ub).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(Kb).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).strict().optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:t({x:o().min(Lb).max(Wb).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(Hb).max($b).describe("Vertical nudge, source-normalized (+ = down).")}).strict().optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")}).strict()).nullable()}).strict().describe("Set (or CLEAR, with `segments: null`) the camera/reframe channel on a MEDIA clip \u2014 the time-aligned source\u2192output viewport (focus, zoom, ease, bias). This is the PREFERRED way to author reframing; do NOT reframe via a whole-source `clip.update` patch. Segments tile the clip's duration."),t({type:m("setCaptionStyle"),style:t({fontFamily:e().min(1).optional(),fontSize:o().min(1).max(Vb).optional(),fontWeight:o().min(Yb).max(Jb).optional(),color:e().min(1).optional(),highlightColor:e().min(1).optional(),backgroundColor:e().optional(),plate:s(["glass","solid","none"]).optional(),position:s(["top","center","bottom"]).optional(),textTransform:s(["none","uppercase","capitalize"]).optional(),emphasisColor:e().optional(),emphasisGradient:e().optional(),emphasisScale:o().optional(),emphasisFontFamily:e().optional(),emphasisFontWeight:o().min(Xb).max(Zb).optional(),emphasisTextTransform:s(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:o().optional(),emphasisFontStyle:s(["normal","italic"]).optional(),entrance:s(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:o().min(Qb).optional(),entranceStaggerMs:o().min(ey).optional(),exitMs:o().min(oy).optional(),emphasisPlate:h().optional(),emphasisPlateColor:e().optional(),emphasisPlateTextColor:e().optional(),emphasisPlateAltColor:e().optional(),emphasisPlateAltTextColor:e().optional(),emphasisPlateRadius:o().min(ty).optional(),emphasisPlatePadX:o().optional(),emphasisPlatePadY:o().optional(),annotationColor:e().optional(),maxWidthPercent:o().max(ry).optional()}).strict()}).strict().describe("Merge style overrides (font/color/position/emphasis) onto the composition's caption layer. Partial \u2014 omitted fields keep their current value; creates the caption container if absent."),t({type:m("setCaptions"),segments:p(t({words:p(t({text:e().min(1),startMs:o().min(ny),endMs:o().min(iy),emphasis:h().optional(),annotate:s(["circle","underline"]).optional()}).strict())}).strict()),style:t({fontFamily:e().min(1).optional(),fontSize:o().min(1).max(sy).optional(),fontWeight:o().min(ay).max(dy).optional(),color:e().min(1).optional(),highlightColor:e().min(1).optional(),backgroundColor:e().optional(),plate:s(["glass","solid","none"]).optional(),position:s(["top","center","bottom"]).optional(),textTransform:s(["none","uppercase","capitalize"]).optional(),emphasisColor:e().optional(),emphasisGradient:e().optional(),emphasisScale:o().optional(),emphasisFontFamily:e().optional(),emphasisFontWeight:o().min(py).max(cy).optional(),emphasisTextTransform:s(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:o().optional(),emphasisFontStyle:s(["normal","italic"]).optional(),entrance:s(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:o().min(my).optional(),entranceStaggerMs:o().min(ly).optional(),exitMs:o().min(uy).optional(),emphasisPlate:h().optional(),emphasisPlateColor:e().optional(),emphasisPlateTextColor:e().optional(),emphasisPlateAltColor:e().optional(),emphasisPlateAltTextColor:e().optional(),emphasisPlateRadius:o().min(fy).optional(),emphasisPlatePadX:o().optional(),emphasisPlatePadY:o().optional(),annotationColor:e().optional(),maxWidthPercent:o().max(gy).optional()}).strict().optional()}).strict().describe("Replace the caption SEGMENTS wholesale \u2014 author the word-timed caption layer directly (each segment = one sentence/page of `words` with timeline-ms `startMs`/`endMs`, optional `emphasis`). This is how a client with its OWN word timings (e.g. a generated VO take) gets word-synced captions without a source transcript; the compose lane's transcript slice writes the same layer. `style`, when given, merges with setCaptionStyle semantics; an omitted style keeps the existing one. Renderer paginates within a segment and never pools words across two \u2014 keep segments sentence-bounded."),t({type:m("captions.fromTranscript"),mediaId:e().min(1),window:t({startSec:o().min(hy),endSec:o()}).strict().optional()}).strict().describe("Attach caption CONTENT from the media's cached transcript \u2014 no pasting words. ROUTE-MATERIALIZED like applyMotionPreset/materializeGrid: the server slices the word-timed transcript to `window` (source seconds; absent = the whole media), rebases times, sentence-splits into segments, and applies it as `setCaptions`. 422 media_no_transcript when the media has no transcript or no words in the window. For your OWN word timings use setCaptions directly."),t({type:m("applyMotionPreset"),clipId:e(),preset:e(),params:t({enterMs:o().optional(),exitMs:o().optional(),staggerMs:o().optional()}).strict().optional()}).strict().describe("Shell a STATIC `card` clip with a frame-driven MOTION preset \u2014 the public card-shelling op (the layout renders VERBATIM; only the container animates in/out). The server wraps the card in the chosen `preset` (fade-up / slide-in-left / slide-in-right / scale-pop / stagger-reveal), transpiles it, mints it as a LIVE component, and swaps the clip source to that component (the bakeless live lane \u2014 no box). `params` tunes timing (`enterMs`/`exitMs`, `staggerMs` for stagger-reveal). The target must be a static card (components already carry motion; library overlays already move); re-run overwrites idempotently ONLY while the target is still a card (an uncompilable shell); once shelled, the clip is a COMPONENT \u2014 to change its motion, remove and re-add the card, then re-shell. Honored under `dry_run` (validates preset + target without transpiling or persisting). ORDERING: the preset resolves its target against the PERSISTED composition \u2014 a card added in the SAME batch is not yet visible to it. Persist the clip.add batch first, then shell in a following call."),t({type:m("materializeGrid"),clipId:e(),grid:s(["beat","word","shot"]),maxMarkers:o().max(zy).optional()}).strict().describe('Materialize a clip\'s SOURCE-media temporal GRID as timeline markers \u2014 the rhythm authority you cut to. `grid:"beat"` reads a MUSIC bed\'s beat map (get_media_context.beatGrid), `grid:"word"` the VO word onsets (wordGrid); each grid point is projected from media time to TIMELINE time through the clip\'s placement (startTime, trim, playbackRate, excludedRanges) and written as a `kind:"beat"|"word"` marker (`metadata.sourceClipId` set). Points outside the clip\'s visible window are skipped. Re-running REPLACES the prior markers from the same clip+grid (idempotent). Land cuts and transition MIDPOINTS on the markers (a 0.5s transition starts 0.25s before its marker). `maxMarkers` (default 500, ceiling 2000) \u2014 exceeding it fails loud with the count. `grid:"shot"` is not yet exposed (shot_grid_unavailable). The target must be a media clip; absent evidence fails loud (grid_unavailable) naming how to get it (declare audioRole:"music" at ingest / transcribe).'),t({type:m("setFormat"),format:t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional()}).strict()}).strict().describe("Set the output format \u2014 `aspectRatio` (16:9|9:16|1:1|4:5) plus optional `fps` and `resolution`. Merges: an omitted field keeps the current value."),t({type:m("addTrack"),kind:s(["video","audio","image","overlay","effect"]),name:e().optional(),id:e().optional()}).strict().describe("Add an EMPTY track of a given family (video|audio|image|overlay|effect). Optional pinned `id`."),t({type:m("removeTrack"),trackId:e()}).strict().describe("Remove a track AND all its clips by id."),t({type:m("updateTrack"),trackId:e(),updates:t({name:e().optional(),enabled:h().optional()}).strict()}).strict().describe("Patch a track's `name` / `enabled` by id."),t({type:m("reorderTracks"),fromIndex:o(),toIndex:o()}).strict().describe("Move a track from one index to another (changes layer/compositing order)."),t({type:m("moveClipToTrack"),clipId:e(),targetTrackId:e(),newStartTime:o().optional()}).strict().describe("Move a clip to another SAME-family track, optionally at a new `newStartTime`."),t({type:m("duplicateClip"),clipId:e(),newClipId:e().optional()}).strict().describe("Duplicate a clip by id. Pin `newClipId` to make the copy's id deterministic (required for a clean undo/inverse)."),t({type:m("cutAndRipple"),start:o(),end:o()}).strict().describe("Server-authoritative: delete the [start,end] time window (seconds) and ripple every downstream clip/marker/caption earlier to close the gap."),t({type:m("ripple"),time:o(),amount:o()}).strict().describe("Server-authoritative: shift everything at/after `time` (seconds) by `amount` seconds (+ opens a gap, \u2212 closes one)."),t({type:m("addExcludedRange"),clipId:e(),sourceStart:o(),sourceEnd:o(),reason:e().optional()}).strict().describe("Server-authoritative: exclude a [sourceStart,sourceEnd] span (seconds) of a clip's SOURCE (an internal trim) and ripple downstream \u2014 the preferred way to drop a sub-range vs a source patch."),t({type:m("removeExcludedRange"),clipId:e(),rangeIdx:o()}).strict().describe("Server-authoritative: remove a clip's previously-added excluded range by index (re-includes that span, ripples downstream).")]).describe("One scoped composition operation. Discriminated by `type` \u2014 `clip.add` / `clip.remove` / `clip.update` patch clips across any family; the rest cover markers, reframe, captions, format, tracks, and the server-authoritative ripple recomputes. Validated strictly server-side against the runtime CompositionOp vocabulary.")).min(1),if_match:e().optional().describe('Optional OCC precondition \u2014 the strong etag (`"<hex>"`) the caller last saw. On mismatch the batch is rejected (409 stale_etag) before any op applies.'),dry_run:h().optional().describe("When true, validate the batch (apply + projection accept/reject guards) WITHOUT persisting. Returns `{ valid, errors }` instead of applying."),session_id:e().optional().describe("Optional compose-session id. When present, the ops target the session's SCRATCH composition (a derived sibling) instead of the project's active composition \u2014 the server never mutates active until commit.")}).strict().describe("POST /projects/:id/composition/apply body \u2014 a batch of CompositionOps."),bI=t({id:e()}),yI=t({fromCompositionId:e().min(1).describe("Source composition to reframe a sibling from."),targetFormat:t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional()}).strict().describe("Output-format spec per \xA7Format.")}).strict().describe("Derive a reframed sibling composition for a new aspect (Auto-Reframe / Magic-Resize, agent-native)."),SI=t({compositionId:e().describe("The new sibling composition's id.")}).describe("POST /projects/:id/compositions/derive response."),xy=0,by=0,yy=0,Sy=0,Cy=0,Ry=0,vy=4,Iy=0,ky=0,Oy=0,My=0,wy=0,By=0,Ty=0,jy=1,Ey=0,Py=1,Ay=.1,_y=1,qy=0,Fy=0,Dy=-.3,Gy=.3,Ny=-.3,Uy=.3,Ky=0,Ly=1,Wy=0,Hy=1,$y=-.3,Vy=.3,Yy=0,Jy=1,Xy=0,Zy=1,Qy=0,eS=1,oS=1,tS=1,rS=0,nS=0,iS=0,sS=0,aS=0,dS=15,pS=100,cS=900,mS=100,lS=900,uS=0,fS=0,gS=0,hS=0,zS=100,CI=t({v:o(),format:t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional(),platform:e().optional()}).strict(),tracks:p(t({id:e().min(1),kind:s(["video","audio","image","overlay","effect"]),name:e().optional(),enabled:h().optional(),contents:p(x([t({id:e().min(1),startTime:o().min(xy).describe("Timeline start (seconds)."),duration:o().describe("Clip duration (seconds)."),source:x([t({kind:m("media"),mediaId:e().min(1),trim:t({start:o().min(by).describe("Source trim start (seconds)."),end:o().min(yy).describe("Source trim end (seconds).")}).strict().optional(),excludedRanges:p(t({start:o().min(Sy),end:o().min(Cy),reason:e().optional()}).strict()).optional(),volume:o().min(Ry).max(vy).optional(),muted:h().optional(),playbackRate:o().optional(),sync:s(["video","independent"]).optional(),kenBurns:s(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(Iy).optional(),fadeOutMs:o().min(ky).optional(),loop:h().optional(),audioRole:s(["sfx","music","vo","ambience"]).optional(),duck:t({duckDb:o().max(Oy),attackMs:o().min(My),releaseMs:o().min(wy),windows:p(t({startMs:o(),endMs:o()}).strict()).optional()}).strict().optional(),anchor:t({clipId:e().min(1),offsetMs:o()}).strict().optional(),reframe:t({segments:p(t({startSec:o().min(By).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:o().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:x([t({mode:m("frame-center")}).strict(),t({mode:m("point"),x:o().min(Ty).max(jy),y:o().min(Ey).max(Py)}).strict(),t({mode:m("face"),faceId:e().min(1),shotScale:s(["close","standard","wide"]).optional()}).strict(),t({mode:m("all-faces")}).strict(),t({mode:m("active-speaker")}).strict()]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:o().min(Ay).max(_y).optional().describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Omit for the full frame. MUTUALLY EXCLUSIVE with `focus.shotScale` \u2014 a face-tracked shot is sized EITHER by the editorial scale (shotScale, which the bake calibrates to the detected face) OR by an explicit zoom, never both. A segment carrying both is REJECTED: shotScale wins at bake time and the zoom would be silently discarded."),ease:t({in:o().min(qy).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(Fy).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).strict().optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:t({x:o().min(Dy).max(Gy).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(Ny).max(Uy).describe("Vertical nudge, source-normalized (+ = down).")}).strict().optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")}).strict()).min(1)}).strict().optional()}).strict(),t({kind:m("component"),componentId:e().min(1),props:u(e(),g())}).strict(),t({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:s(["front","behind-subject"]).optional(),anchor:t({space:m("scene"),x:o().min(Ky).max(Ly),y:o().min(Wy).max(Hy)}).strict().optional(),parallax:o().min($y).max(Vy).optional()}).strict(),t({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}).strict(),t({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()}).strict()]),kind:s(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(Yy).max(Jy).optional(),scale:o().optional(),rotation:o().optional(),position:t({x:o(),y:o()}).strict().optional(),region:t({x:o().min(Xy).max(Zy),y:o().min(Qy).max(eS),w:o().max(oS),h:o().max(tS)}).strict().optional(),fit:s(["cover","contain"]).optional(),effects:p(t({primitiveId:e().min(1),params:u(e(),g()).optional()}).strict()).optional(),transitionIn:t({type:e().min(1),duration:o()}).strict().optional()}).strict(),t({id:e().min(1),startTime:o().min(rS).describe("Timeline start (seconds)."),duration:o().describe("Gap duration (seconds).")}).strict()]))}).strict()),markers:p(t({id:e().min(1),startTime:o().min(nS),endTime:o().min(iS).optional(),kind:e().min(1),name:e().optional(),metadata:u(e(),g()).optional()}).strict()).optional(),captions:t({segments:p(t({words:p(t({text:e().min(1),startMs:o().min(sS),endMs:o().min(aS),emphasis:h().optional(),annotate:s(["circle","underline"]).optional()}).strict())}).strict()),style:t({fontFamily:e().min(1).optional(),fontSize:o().min(1).max(dS).optional(),fontWeight:o().min(pS).max(cS).optional(),color:e().min(1).optional(),highlightColor:e().min(1).optional(),backgroundColor:e().optional(),plate:s(["glass","solid","none"]).optional(),position:s(["top","center","bottom"]).optional(),textTransform:s(["none","uppercase","capitalize"]).optional(),emphasisColor:e().optional(),emphasisGradient:e().optional(),emphasisScale:o().optional(),emphasisFontFamily:e().optional(),emphasisFontWeight:o().min(mS).max(lS).optional(),emphasisTextTransform:s(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:o().optional(),emphasisFontStyle:s(["normal","italic"]).optional(),entrance:s(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:o().min(uS).optional(),entranceStaggerMs:o().min(fS).optional(),exitMs:o().min(gS).optional(),emphasisPlate:h().optional(),emphasisPlateColor:e().optional(),emphasisPlateTextColor:e().optional(),emphasisPlateAltColor:e().optional(),emphasisPlateAltTextColor:e().optional(),emphasisPlateRadius:o().min(hS).optional(),emphasisPlatePadX:o().optional(),emphasisPlatePadY:o().optional(),annotationColor:e().optional(),maxWidthPercent:o().max(zS).optional()}).strict().optional()}).strict().optional(),license:t({type:e().min(1),source:e().optional(),notes:e().optional()}).strict().optional(),accessibility:t({audioDescriptionTrackId:e().optional(),captionsTrackId:e().optional(),signLanguageTrackId:e().optional(),notes:e().optional()}).strict().optional()}).strict().describe("Canonical composition wire shape (multi-track; carries reframe, captions, markers)."),RI=t({valid:h(),errors:p(t({code:e(),stage:e(),category:e(),retryable:h(),message:e(),fix:u(e(),g()).optional()})),advisories:p(t({rule:e(),criterion:e(),clipId:e().optional(),detail:e(),fix:e()})).describe("Deterministic, render-free QUALITY floors (the SAME named defects the Director's in-loop verify and score_composition surface: static-hold, caption-spine, sfx-density, sfx-speech-collision, bed-coverage, audio-role). NON-blocking \u2014 they never flip `valid` (an editorially-weak composition still renders); fix them for quality, not to save. Empty when the composition is clean or the wire shape failed (they need a parsed composition)."),quote:t({thisStepUsd:o(),jobSpendSoFarUsd:o(),estimatedJourneyTotalUsd:o()}).describe("The A2 money triple for the commodity lane: validate is free; estimatedJourneyTotalUsd is the render price to finish from a valid composition \u2014 relay it BEFORE create_render.")}),vI=t({id:e(),compositionId:e()});var kI=t({id:e()}),OI=t({clipSuggestionId:e().min(1)}).strict().describe("POST /projects/:id/exports/{fcpxml,premiere} body."),MI=t({id:e()}),wI=t({clipSuggestionId:e().min(1)}).strict().describe("POST /projects/:id/exports/{fcpxml,premiere} body."),BI=t({id:e(),exportId:e()}),xS=0,bS=1,TI=t({id:e(),format:s(["fcpxml","premiere"]),status:s(["queued","trimming","building","uploading","complete","error","cancelled"]),progress:o().min(xS).max(bS).describe("Fractional progress 0..1 across the trim/build/upload pipeline. Reaches 1 only on `complete`."),outputUrl:e().nullable(),outputExpiresAt:e().nullable(),outputSizeBytes:o().nullable(),outputDurationSec:o().nullable(),error:x([t({phase:s(["trim","build","upload","trigger"]),message:e(),detail:e().optional(),retryable:h()}),U()]).describe("Set when status is `error`; null otherwise. The phase field localizes the failure to trim / build / upload / trigger."),trimCacheHit:h().nullable(),clipSuggestionId:e().nullable(),createdAt:e(),updatedAt:e()}).describe("NLE export job response."),jI=t({id:e(),exportId:e()}),yS=0,SS=1,EI=t({id:e(),format:s(["fcpxml","premiere"]),status:s(["queued","trimming","building","uploading","complete","error","cancelled"]),progress:o().min(yS).max(SS).describe("Fractional progress 0..1 across the trim/build/upload pipeline. Reaches 1 only on `complete`."),outputUrl:e().nullable(),outputExpiresAt:e().nullable(),outputSizeBytes:o().nullable(),outputDurationSec:o().nullable(),error:x([t({phase:s(["trim","build","upload","trigger"]),message:e(),detail:e().optional(),retryable:h()}),U()]).describe("Set when status is `error`; null otherwise. The phase field localizes the failure to trim / build / upload / trigger."),trimCacheHit:h().nullable(),clipSuggestionId:e().nullable(),createdAt:e(),updatedAt:e()}).describe("NLE export job response.");var CS=200,RS=50,AI=t({query:e().min(1).max(CS),perPage:o().max(RS).optional()}).strict().describe("POST /fonts/search body."),_I=t({results:p(t({family:e(),category:e().optional(),variants:p(e()).optional(),cssUrl:e().optional(),previewText:e().optional()}))}).describe("POST /fonts/search response.");var FI=t({status:s(["ok","degraded"]),version:e(),checks:u(e(),t({ok:h(),detail:e().optional()})).optional()}).describe("Health probe response."),DI=t({orgId:e(),permissions:u(e(),p(e())),keyId:e(),keyName:e()}).describe("Whoami response."),GI=t({});var vS=500,IS=10737418240,UI=t({filename:e().min(1).max(vS),contentType:s(["video/mp4","video/quicktime","video/x-matroska","video/webm","audio/mpeg","audio/wav","audio/x-wav","audio/mp4","audio/aac","image/png","image/jpeg","image/webp","image/gif","image/svg+xml","application/json","font/ttf","font/otf","font/woff","font/woff2"]),size:o().max(IS)}).strict().describe("POST /media upload initiation body."),KI=t({data:p(t({id:e(),status:e(),source:s(["upload","generated"]),name:e(),mimeType:e(),fileSize:o(),duration:o().nullable(),width:o().nullable(),height:o().nullable(),frameRate:o().nullable(),progress:t({phase:e(),percent:o().nullable()}).nullable(),analysis:u(e(),g()).nullable(),listUsd:o().optional().describe("A2 money stamp \u2014 GENERATED media only: the generate meter's LIST price (USD) at the success terminal. A plan allowance may zero the invoice line. Absent for uploads/imports, failures, x402 (on-chain receipts)."),thumbnailUrl:e().nullable(),previewUrl:e().nullable(),kind:e().nullable(),tags:p(e()).nullable(),attribution:t({provider:s(["pexels","pixabay","freesound","klipy"]),externalId:e().nullable(),assetUrl:e().nullable(),license:e().nullable()}).nullable(),processingStatus:x([t({phase:s(["idle","pending_import","pending_upload","uploading","extracting","loading_model","transcribing","proxy","embedding","analyzing","indexing","generating","rendering","processing","complete","error","cancelled"]),percent:o().nullish(),message:e().nullish(),error:e().nullish()}),U()]),createdAt:e(),updatedAt:e()}).describe("Media item response per \xA7Media.")),pagination:t({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}),LI=t({id:e()}),WI=t({audioRole:s(["vo","music","sfx","ambience"]).optional().describe("Declared audio role: 'vo' (narration), 'music' (bed that ducks under speech), 'sfx' (one-shot hit), 'ambience' (a bed that HOLDS under VO \u2014 never ducks).")}).strict().describe("POST /media/:id/finalize body \u2014 optional declared audioRole."),HI=t({id:e(),status:s(["processing","complete"]),processingPhase:e()}).describe("POST /media/:id/finalize response: ingest triggered (audio/video \u2192 processing) or the item is immediately ready (image/asset \u2192 complete)."),kS=1e4,$I=t({generator:s(["text-to-video","text-to-image","image-to-video","text-to-music","text-to-speech","text-to-sfx","auto"]),prompt:e().min(1).max(kS),style:u(e(),g()).optional().describe('Free-form generation parameters, read per generator. All generators honor `aspect` (string) + `durationSec` (number) where applicable. text-to-speech honors `voice` (string, a fal ElevenLabs voice id/name; default "Rachel"), `speed` (number 0.7-1.2), `stability` (number 0-1), and `styleExaggeration` (number 0-1 \u2192 the endpoint\'s style exaggeration). text-to-music honors `model` ("elevenlabs" | "minimax"; default "elevenlabs") to pick the music backend (minimax has no duration control).'),refs:t({firstFrameMediaId:e().optional(),lastFrameMediaId:e().optional(),imageMediaIds:p(e()).optional()}).strict().optional()}).strict().describe("POST /media/generate body."),OS=2048,MS=500,wS=10737418240,VI=t({url:e().url().max(OS),filename:e().min(1).max(MS),contentType:s(["video/mp4","video/quicktime","video/x-matroska","video/webm","audio/mpeg","audio/wav","audio/x-wav","audio/mp4","audio/aac","image/png","image/jpeg","image/webp","image/gif","image/svg+xml","application/json","font/ttf","font/otf","font/woff","font/woff2"]),size:o().max(wS).optional(),audioRole:s(["vo","music","sfx","ambience"]).optional().describe("Declared audio role: 'vo' (narration), 'music' (bed that ducks under speech), 'sfx' (one-shot hit), 'ambience' (a bed that HOLDS under VO \u2014 never ducks).")}).strict().describe("POST /media/import body."),YI=t({id:e()}),JI=t({id:e()}),XI=t({id:e(),status:e(),source:s(["upload","generated"]),name:e(),mimeType:e(),fileSize:o(),duration:o().nullable(),width:o().nullable(),height:o().nullable(),frameRate:o().nullable(),progress:t({phase:e(),percent:o().nullable()}).nullable(),analysis:u(e(),g()).nullable(),listUsd:o().optional().describe("A2 money stamp \u2014 GENERATED media only: the generate meter's LIST price (USD) at the success terminal. A plan allowance may zero the invoice line. Absent for uploads/imports, failures, x402 (on-chain receipts)."),thumbnailUrl:e().nullable(),previewUrl:e().nullable(),kind:e().nullable(),tags:p(e()).nullable(),attribution:t({provider:s(["pexels","pixabay","freesound","klipy"]),externalId:e().nullable(),assetUrl:e().nullable(),license:e().nullable()}).nullable(),processingStatus:x([t({phase:s(["idle","pending_import","pending_upload","uploading","extracting","loading_model","transcribing","proxy","embedding","analyzing","indexing","generating","rendering","processing","complete","error","cancelled"]),percent:o().nullish(),message:e().nullish(),error:e().nullish()}),U()]),createdAt:e(),updatedAt:e()}).describe("Media item response per \xA7Media."),ZI=t({id:e()}),QI=t({mediaItemId:e(),language:e().nullable(),model:e().nullable(),fullText:e(),utterances:p(u(e(),g())),data:p(u(e(),g())).optional(),pagination:t({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).optional().describe("Cursor pagination metadata.")}).describe("Transcript response."),ek=t({id:e()}),ok=t({mediaId:e(),durationSec:o().nullable(),width:o().nullable(),height:o().nullable(),thumbnail:t({url:e()}).nullable().describe("Presigned processing thumbnail (~1 week) \u2014 the footage at a glance. For stills at chosen timestamps, use preview_frame with a one-clip composition over this media."),faces:t({status:s(["ready","not_detected"]),windows:p(t({window:t({startSec:o(),endSec:o()}),faces:p(t({faceId:e(),bbox:t({x:o(),y:o(),width:o(),height:o()}),speakingShare:o().optional()}))}))}),transcript:t({status:s(["ready","not_transcribed","unavailable"]),data:x([t({mediaItemId:e(),language:e().nullable(),model:e().nullable(),fullText:e(),utterances:p(u(e(),g())),data:p(u(e(),g())).optional(),pagination:t({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).optional().describe("Cursor pagination metadata.")}).describe("Transcript response."),U()])}),beatGrid:t({bpm:o(),beatTimesMs:p(o()).describe("Beat onset times in MILLISECONDS \u2014 divide by 1000 for timeline startTime (composition timeline fields are seconds)."),confidence:o().describe("Rhythmic-periodicity strength (0\u20131). Trust the grid for cutting when high; a beatless bed reports low."),method:s(["requested-anchored","detected"]).describe("`requested-anchored` = phase-locked to a requested BPM (a generated bed whose prompt named a tempo); `detected` = full beat tracking (import/upload).")}).nullable().describe("The MUSIC-role rhythm grid (audio-substrate MVP). Present only for a music bed that carries a computed beat grid; null otherwise. For a music-driven film, cut on these beats (transition midpoints on beats, risers resolving on downbeats)."),wordGrid:t({wordTimesMs:p(o()).describe("Word onset times in MILLISECONDS, in order \u2014 divide by 1000 for timeline startTime (composition timeline fields are seconds).")}).nullable().describe("The VO-role rhythm grid: word onsets surfaced from the transcript (pure exposure). Present only when a transcript exists; null otherwise. For a VO-driven (narration) film, cut every beat boundary to the voice \u2014 the film-spine rule."),audioRole:x([m("vo"),m("music"),m("sfx"),m("ambience"),m(null)]).nullable().describe("DECLARED audio role of this asset (audio-substrate P0): 'vo' (narration), 'music' (bed that ducks under speech), 'sfx' (one-shot hit), 'ambience' (a bed that HOLDS under VO \u2014 never ducks). Author the clip source's `audioRole` from this. Null for footage/images or an undeclared audio asset."),envelope:t({envelopeClass:s(["transient","sweep","ambient"]).describe("Coarse temporal shape: 'transient' (a sharp one-shot), 'sweep' (a bounded rise/fall over ~0.5\u20132s), 'ambient' (an unbounded bed)."),attackMs:o().optional(),spectralCentroidHz:o().optional(),meanVolumeDb:o().optional(),maxVolumeDb:o().optional()}).nullable().describe("Envelope evidence (audio-substrate P0). `envelopeClass` is always present when an envelope exists (the SFX pack carries it); the numeric probe stats are present only when an audio probe has run. Null when no envelope is stored.")}).describe("Read-only authoring context for a source media item: detected face roster + transcript + the temporal grids (beat / word) an agent cuts to, plus the DECLARED audioRole + envelope of an audio asset."),tk=t({id:e()}),rk=t({id:e()}),nk=t({media:t({id:e(),name:e(),createdAt:e(),fileSize:o(),duration:o().nullable(),status:e()}),window:t({startIso:e(),endIso:e()}),workflowCount:o(),workflows:p(t({name:e(),startedAt:e(),durationMs:o(),activities:p(t({name:e(),startedAt:e(),durationMs:o(),service:e()}))}))}).describe("Per-media performance breakdown: every Temporal workflow + activity span (plus Modal sub-spans) that ran for the requested media item, grouped under its owning workflow by time-range containment. Backed by Axiom proxy \u2014 see the `cueframe stats` CLI subcommand.");var BS=0,sk=t({data:p(t({id:e(),name:e(),description:e().nullable(),format:x([t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional()}).describe("Output-format spec per \xA7Format."),U()]),brandKitId:e().nullable(),activeCompositionId:e().nullable(),composition:t({hasComposition:h(),sceneCount:o().min(BS),duration:o().nullable(),updatedAt:e().nullable()}).describe("Summary of a project's stored composition."),lastRender:t({id:e(),status:e(),createdAt:e(),outputUrl:e().nullable(),outputExpiresAt:e().nullable()}).nullable().describe("Most recent render for a project, if any."),createdAt:e()}).describe("Project response per \xA7Projects.")),pagination:t({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}),TS=200,ak=t({name:e().min(1).max(TS),description:e().optional(),format:t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional()}).strict().optional().describe("Output-format spec per \xA7Format."),brandKitId:e().min(1).optional(),width:o().optional(),height:o().optional()}).strict().describe("POST /projects body."),dk=t({id:e()}),jS=0,pk=t({id:e(),name:e(),description:e().nullable(),format:x([t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional()}).describe("Output-format spec per \xA7Format."),U()]),brandKitId:e().nullable(),activeCompositionId:e().nullable(),composition:t({hasComposition:h(),sceneCount:o().min(jS),duration:o().nullable(),updatedAt:e().nullable()}).describe("Summary of a project's stored composition."),lastRender:t({id:e(),status:e(),createdAt:e(),outputUrl:e().nullable(),outputExpiresAt:e().nullable()}).nullable().describe("Most recent render for a project, if any."),createdAt:e()}).describe("Project response per \xA7Projects."),ck=t({id:e()}),ES=200,mk=t({name:e().min(1).max(ES).optional(),description:e().optional(),format:t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional()}).strict().optional().describe("Output-format spec per \xA7Format."),brandKitId:e().min(1).optional()}).strict().describe("PATCH /projects/:id body."),PS=0,lk=t({id:e(),name:e(),description:e().nullable(),format:x([t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional()}).describe("Output-format spec per \xA7Format."),U()]),brandKitId:e().nullable(),activeCompositionId:e().nullable(),composition:t({hasComposition:h(),sceneCount:o().min(PS),duration:o().nullable(),updatedAt:e().nullable()}).describe("Summary of a project's stored composition."),lastRender:t({id:e(),status:e(),createdAt:e(),outputUrl:e().nullable(),outputExpiresAt:e().nullable()}).nullable().describe("Most recent render for a project, if any."),createdAt:e()}).describe("Project response per \xA7Projects."),uk=t({id:e()});var gk=t({id:e()}),hk=t({clipSuggestionId:e().min(1).optional(),compositionId:e().min(1).optional().describe("Target a specific composition in the project; defaults to the project's active composition."),format:t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional()}).strict().optional().describe("Output-format spec per \xA7Format."),priority:s(["interactive","standard","background"]).optional(),intent:s(["preview","final"]).optional(),brandKitId:e().min(1).nullish()}).strict().describe("POST /projects/:id/renders body."),zk=t({id:e()}),AS=0,_S=0,xk=t({data:p(t({id:e(),status:s(["queued","pending","rendering","complete","error","cancelled"]),progress:t({phase:s(["queued","validating","presigning","collecting-artifacts","resolving","detecting","baking-matte","translating","spawning","encoding","uploading"]),percent:o(),scenesCompleted:o().min(AS).optional(),scenesTotal:o().min(_S).optional()}).optional().describe("Non-terminal render progress; phase is one of the worker's emitted stages."),outputUrl:e().nullable(),outputExpiresAt:e().nullable(),error:e().nullable().describe("Human-readable failure message. Pair with `errorCode` for a stable, machine-readable code an agent runner can branch on."),errorCode:e().nullable().describe("Stable error code per docs/api-design-2026-04-14.md \xA7Error Model (e.g. `render_pipeline_unavailable`, `render_route_missing`, `render_pipeline_failed`). Null when status is not `error`, or for legacy rows that predate this field."),errorDetails:u(e(),g()).nullable().describe("Structured failure context \u2014 `{ targetUrl?, upstreamStatus?, upstreamCode?, attemptedAt? }`. Surfaced so agent runners can distinguish operator-config issues from upstream-down vs route-missing without parsing `error`."),category:x([m("authoring"),m("transient"),m("internal"),m(null)]).nullable().describe("Failure taxonomy when status is `error`; null otherwise. `authoring` = deterministic defect in YOUR composition/request \u2014 fix it, retrying is futile; `transient` = temporary pipeline/infra failure \u2014 safe to retry_render; `internal` = unexpected server fault \u2014 retry once then escalate. Mirrors the render.failed webhook's `category`."),retryable:h().nullable().describe("Whether re-attempting the SAME render can succeed (status `error`); null otherwise. true \u2192 call retry_render. false \u2192 deterministic (category authoring/internal); fix the composition first \u2014 retry_render alone reproduces it. Mirrors the render.failed webhook's `retryable`."),createdAt:e(),updatedAt:e().describe("ISO-8601 timestamp of the most recent write to this render row. For a non-terminal render (queued/pending/rendering) every status, progress, and phase patch bumps it, so it IS the last-progress heartbeat: compute staleness = now \u2212 updatedAt to tell a WEDGED render (percent frozen AND updatedAt far in the past) from a merely SLOW one (percent frozen but updatedAt recent). Use it to decide wait vs cancel vs retry."),listUsd:o().optional().describe("A2 money stamp: the metered event's LIST price (USD), stamped at the success terminal (exports for deliverable renders, compose_capture for A8 previews). A plan allowance may zero the actual invoice line \u2014 this is the list price, never a Stripe charge. Absent while running, on failure, and for x402 orgs (on-chain receipts). Mirrors the get_usage ledger."),warnings:p(e()).optional().describe("Non-fatal advisories surfaced at render-CREATE (omitted when none, and on GET \u2014 create-time only).")}).describe("Render job response per \xA7Renders.")),pagination:t({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}),bk=t({id:e()}),qS=0,yk=t({fromSec:o().min(qS).describe("Window start, seconds into the composition."),toSec:o().describe("Window end (exclusive), seconds."),compositionId:e().min(1).optional().describe("Target a specific composition; defaults to the project's active composition.")}).strict().describe("POST /projects/:id/preview-clip body."),Sk=t({id:e(),renderId:e()}),FS=0,DS=0,Ck=t({id:e(),status:s(["queued","pending","rendering","complete","error","cancelled"]),progress:t({phase:s(["queued","validating","presigning","collecting-artifacts","resolving","detecting","baking-matte","translating","spawning","encoding","uploading"]),percent:o(),scenesCompleted:o().min(FS).optional(),scenesTotal:o().min(DS).optional()}).optional().describe("Non-terminal render progress; phase is one of the worker's emitted stages."),outputUrl:e().nullable(),outputExpiresAt:e().nullable(),error:e().nullable().describe("Human-readable failure message. Pair with `errorCode` for a stable, machine-readable code an agent runner can branch on."),errorCode:e().nullable().describe("Stable error code per docs/api-design-2026-04-14.md \xA7Error Model (e.g. `render_pipeline_unavailable`, `render_route_missing`, `render_pipeline_failed`). Null when status is not `error`, or for legacy rows that predate this field."),errorDetails:u(e(),g()).nullable().describe("Structured failure context \u2014 `{ targetUrl?, upstreamStatus?, upstreamCode?, attemptedAt? }`. Surfaced so agent runners can distinguish operator-config issues from upstream-down vs route-missing without parsing `error`."),category:x([m("authoring"),m("transient"),m("internal"),m(null)]).nullable().describe("Failure taxonomy when status is `error`; null otherwise. `authoring` = deterministic defect in YOUR composition/request \u2014 fix it, retrying is futile; `transient` = temporary pipeline/infra failure \u2014 safe to retry_render; `internal` = unexpected server fault \u2014 retry once then escalate. Mirrors the render.failed webhook's `category`."),retryable:h().nullable().describe("Whether re-attempting the SAME render can succeed (status `error`); null otherwise. true \u2192 call retry_render. false \u2192 deterministic (category authoring/internal); fix the composition first \u2014 retry_render alone reproduces it. Mirrors the render.failed webhook's `retryable`."),createdAt:e(),updatedAt:e().describe("ISO-8601 timestamp of the most recent write to this render row. For a non-terminal render (queued/pending/rendering) every status, progress, and phase patch bumps it, so it IS the last-progress heartbeat: compute staleness = now \u2212 updatedAt to tell a WEDGED render (percent frozen AND updatedAt far in the past) from a merely SLOW one (percent frozen but updatedAt recent). Use it to decide wait vs cancel vs retry."),listUsd:o().optional().describe("A2 money stamp: the metered event's LIST price (USD), stamped at the success terminal (exports for deliverable renders, compose_capture for A8 previews). A plan allowance may zero the actual invoice line \u2014 this is the list price, never a Stripe charge. Absent while running, on failure, and for x402 orgs (on-chain receipts). Mirrors the get_usage ledger."),warnings:p(e()).optional().describe("Non-fatal advisories surfaced at render-CREATE (omitted when none, and on GET \u2014 create-time only).")}).describe("Render job response per \xA7Renders."),Rk=t({id:e(),renderId:e()}),GS=0,NS=0,vk=t({id:e(),status:s(["queued","pending","rendering","complete","error","cancelled"]),progress:t({phase:s(["queued","validating","presigning","collecting-artifacts","resolving","detecting","baking-matte","translating","spawning","encoding","uploading"]),percent:o(),scenesCompleted:o().min(GS).optional(),scenesTotal:o().min(NS).optional()}).optional().describe("Non-terminal render progress; phase is one of the worker's emitted stages."),outputUrl:e().nullable(),outputExpiresAt:e().nullable(),error:e().nullable().describe("Human-readable failure message. Pair with `errorCode` for a stable, machine-readable code an agent runner can branch on."),errorCode:e().nullable().describe("Stable error code per docs/api-design-2026-04-14.md \xA7Error Model (e.g. `render_pipeline_unavailable`, `render_route_missing`, `render_pipeline_failed`). Null when status is not `error`, or for legacy rows that predate this field."),errorDetails:u(e(),g()).nullable().describe("Structured failure context \u2014 `{ targetUrl?, upstreamStatus?, upstreamCode?, attemptedAt? }`. Surfaced so agent runners can distinguish operator-config issues from upstream-down vs route-missing without parsing `error`."),category:x([m("authoring"),m("transient"),m("internal"),m(null)]).nullable().describe("Failure taxonomy when status is `error`; null otherwise. `authoring` = deterministic defect in YOUR composition/request \u2014 fix it, retrying is futile; `transient` = temporary pipeline/infra failure \u2014 safe to retry_render; `internal` = unexpected server fault \u2014 retry once then escalate. Mirrors the render.failed webhook's `category`."),retryable:h().nullable().describe("Whether re-attempting the SAME render can succeed (status `error`); null otherwise. true \u2192 call retry_render. false \u2192 deterministic (category authoring/internal); fix the composition first \u2014 retry_render alone reproduces it. Mirrors the render.failed webhook's `retryable`."),createdAt:e(),updatedAt:e().describe("ISO-8601 timestamp of the most recent write to this render row. For a non-terminal render (queued/pending/rendering) every status, progress, and phase patch bumps it, so it IS the last-progress heartbeat: compute staleness = now \u2212 updatedAt to tell a WEDGED render (percent frozen AND updatedAt far in the past) from a merely SLOW one (percent frozen but updatedAt recent). Use it to decide wait vs cancel vs retry."),listUsd:o().optional().describe("A2 money stamp: the metered event's LIST price (USD), stamped at the success terminal (exports for deliverable renders, compose_capture for A8 previews). A plan allowance may zero the actual invoice line \u2014 this is the list price, never a Stripe charge. Absent while running, on failure, and for x402 orgs (on-chain receipts). Mirrors the get_usage ledger."),warnings:p(e()).optional().describe("Non-fatal advisories surfaced at render-CREATE (omitted when none, and on GET \u2014 create-time only).")}).describe("Render job response per \xA7Renders."),Ik=t({id:e(),renderId:e()}),kk=t({id:e(),renderId:e()}),Ok=t({outputUrl:e(),outputExpiresAt:e()}).describe("POST /refresh-url response."),Mk=t({id:e(),renderId:e()});var US=200,KS=50,LS=0,Bk=t({query:e().min(1).max(US),kind:s(["video","photo","sfx","gif"]).optional(),provider:s(["pexels","pixabay","freesound","klipy"]).optional(),limit:o().max(KS).optional(),durationSec:t({min:o().min(LS).optional(),max:o().optional()}).strict().optional().describe("sfx-only clip-length bound in seconds \u2192 Freesound native filter.")}).strict().describe("POST /resources/search body."),Tk=t({provider:s(["pexels","pixabay","freesound","klipy"]),kind:s(["video","photo","sfx","gif"]),candidates:p(t({candidateId:e(),provider:s(["pexels","pixabay","freesound","klipy"]),kind:s(["video","photo","sfx","gif"]),thumbnail:e(),previewUrl:e(),duration:o().optional(),width:o().optional(),height:o().optional(),author:e(),authorUrl:e().optional(),assetUrl:e().optional(),license:e().optional()}).describe("A stock resource search candidate."))}).describe("POST /resources/search response."),jk=t({kind:s(["sfx-pack","music-pack"]).optional(),id:e().min(1).optional(),projectId:e().min(1).optional(),candidateId:e().min(1).optional()}).strict().describe('POST /resources/import body \u2014 stock candidate lane { projectId, candidateId } OR curated pack lane { kind:"sfx-pack"|"music-pack", id }.');var Pk=t({id:e()}),Ak=t({projectId:e(),groupId:e(),selectorVersion:e(),signalVersions:u(e(),e()),moments:p(t({startSec:o().describe("Span start (output seconds)."),endSec:o().describe("Span end (output seconds)."),chosen:e().describe('The recommended candidateId, or "__hold__" (abstain).'),pacingNote:e().nullish().describe("Which mechanism produced the pick (argmax / hysteresis / override / hold \u2026)."),candidates:p(t({candidateId:e().describe("Stable angle/source id. An unknown id is rejected, never remapped."),role:e().nullish().describe('Agent-declared semantic tag (e.g. "wide", "webcam").'),score:o().describe("The weighted prominence score (\u03A3 weights\xB7signal)."),contributions:u(e(),o()).describe("signalKey \u2192 weighted contribution (the agent reweights from this)."),reasons:p(e())}))})),recommendation:t({cutSchedule:p(t({startSec:o(),endSec:o(),candidateId:e(),sourceInSec:o().describe("Chosen source window start (declared-offset resolved)."),sourceOutSec:o(),reasons:p(e())})),audioBed:p(t({startSec:o(),endSec:o(),candidateId:e().describe("The chosen audio source (the clearest mic) for this span \u2192 programAudioSourceId."),reasons:p(e())})).describe("Best-audio bed (instance #3): the clearest mic per span."),suppressedSwitches:p(t({atSec:o(),wouldHaveBeenCandidateId:e(),byScore:o(),blockedBy:e(),releaseAtSec:o().nullable()})).describe("Switches the stabilizer suppressed (the anti-ping-pong audit).")}),divergesFromComposition:h().optional()}).describe("Selector (switch) candidates + recommendation for a synced-angle group. Every candidate carries score + contributions + reasons so the agent reweights from evidence; the recommendation is the lowered cut schedule + best-audio bed."),_k=t({id:e()}),WS=0,HS=0,$S=0,qk=t({groupId:e().min(1),weights:u(e(),o()).optional().describe("Sparse prominence weights (the taste knob, non-negative). Default = DOMINANCE_WEIGHTS."),minHoldSec:o().optional(),enterSec:o().min(WS).optional(),switchMargin:o().min(HS).optional(),cooldownSec:o().min($S).optional(),maxHoldSec:o().optional(),lockSourceId:e().optional().describe("Pin a camera/angle for the whole timeline."),overrides:p(t({startSec:o(),endSec:o(),candidateId:e()}).strict()).optional()}).strict(),Fk=t({projectId:e(),groupId:e(),selectorVersion:e(),signalVersions:u(e(),e()),moments:p(t({startSec:o().describe("Span start (output seconds)."),endSec:o().describe("Span end (output seconds)."),chosen:e().describe('The recommended candidateId, or "__hold__" (abstain).'),pacingNote:e().nullish().describe("Which mechanism produced the pick (argmax / hysteresis / override / hold \u2026)."),candidates:p(t({candidateId:e().describe("Stable angle/source id. An unknown id is rejected, never remapped."),role:e().nullish().describe('Agent-declared semantic tag (e.g. "wide", "webcam").'),score:o().describe("The weighted prominence score (\u03A3 weights\xB7signal)."),contributions:u(e(),o()).describe("signalKey \u2192 weighted contribution (the agent reweights from this)."),reasons:p(e())}))})),recommendation:t({cutSchedule:p(t({startSec:o(),endSec:o(),candidateId:e(),sourceInSec:o().describe("Chosen source window start (declared-offset resolved)."),sourceOutSec:o(),reasons:p(e())})),audioBed:p(t({startSec:o(),endSec:o(),candidateId:e().describe("The chosen audio source (the clearest mic) for this span \u2192 programAudioSourceId."),reasons:p(e())})).describe("Best-audio bed (instance #3): the clearest mic per span."),suppressedSwitches:p(t({atSec:o(),wouldHaveBeenCandidateId:e(),byScore:o(),blockedBy:e(),releaseAtSec:o().nullable()})).describe("Switches the stabilizer suppressed (the anti-ping-pong audit).")}),divergesFromComposition:h().optional()}).describe("Selector (switch) candidates + recommendation for a synced-angle group. Every candidate carries score + contributions + reasons so the agent reweights from evidence; the recommendation is the lowered cut schedule + best-audio bed.");var VS=0,Gk=t({data:p(t({id:e(),name:e(),fileCount:o().min(VS),muxStatus:e().nullable(),createdAt:e()}).describe("Session list summary (per list endpoint).")),pagination:t({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}),YS=200,JS=50,XS=20,Nk=t({name:e().min(1).max(YS),files:p(t({mediaId:e().min(1),role:e().min(1).max(JS)}).strict()).min(1).max(XS)}).strict().describe("POST /sessions body."),Uk=t({id:e()}),Kk=t({id:e(),name:e(),files:p(t({mediaId:e(),role:e(),status:e().nullable()}).describe("One file member of a session, with optional role + status.")),mux:t({status:e().nullable(),jobId:e().nullable(),muxedItems:u(e(),e()).nullable(),error:e().nullable(),startedAt:e().nullable(),completedAt:e().nullable()}),createdAt:e()}).describe("Session response per \xA7Sessions."),Lk=t({id:e()}),Wk=t({id:e()}),Hk=t({id:e()}),$k=t({jobId:e(),status:e(),workflowId:e().optional(),muxedItems:u(e(),e()).nullish(),error:e().nullish(),startedAt:e().nullish(),completedAt:e().nullish()}).describe("Mux job response.");var Yk=t({skills:p(t({name:e(),title:e(),description:e()}).describe("A CueFrame agent skill (metadata)."))}).describe("GET /skills response \u2014 the available agent skills."),Jk=t({name:e()});var ZS=0,QS=0,Zk=t({data:p(t({id:e(),url:e().url(),events:p(s(["media.transcribed","media.completed","suggest.completed","session.mux.complete","session.mux.failed","render.completed","compose.completed","checkpoint.ready","project.updated","composition.updated","webhook.test"])),settleMs:o().min(ZS),enabled:h(),verificationStatus:s(["pending","verified"]).describe("pending = callback URL has not echoed the ownership challenge (receives no events); verified = ownership proven."),createdAt:e(),lastDeliveredAt:e().nullable(),lastFailedAt:e().nullable(),consecutiveFailures:o().min(QS)}).describe("Webhook endpoint record (secret omitted after create).")),pagination:t({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}),eC=0,oC=6e4,Qk=t({url:e().min(1),events:p(s(["media.transcribed","media.completed","suggest.completed","session.mux.complete","session.mux.failed","render.completed","compose.completed","checkpoint.ready","project.updated","composition.updated","webhook.test"])).min(1),settleMs:o().min(eC).max(oC).optional()}).strict().describe("POST /webhooks body."),eO=t({delivery:u(e(),g()).describe("The shared HTTP envelope + headers + retry semantics."),signing:u(e(),g()).describe("Standard Webhooks signing: secret format, signed content, how to verify."),ownershipVerification:u(e(),g()).describe("The synchronous echo-the-token activation handshake + recovery."),events:p(t({event:s(["media.transcribed","media.completed","suggest.completed","session.mux.complete","session.mux.failed","render.completed","compose.completed","checkpoint.ready","project.updated","composition.updated","webhook.test"]),when:e(),data:u(e(),e())})).describe("Every subscribable event with its exact delivery `data` fields."),sample:u(e(),g()).describe("A fully-worked example delivery (headers + body).")}).describe("The webhook delivery/signing/verification contract, as data. Read this before building a receiver."),oO=t({id:e()}),tC=0,rC=0,tO=t({id:e(),url:e().url(),events:p(s(["media.transcribed","media.completed","suggest.completed","session.mux.complete","session.mux.failed","render.completed","compose.completed","checkpoint.ready","project.updated","composition.updated","webhook.test"])),settleMs:o().min(tC),enabled:h(),verificationStatus:s(["pending","verified"]).describe("pending = callback URL has not echoed the ownership challenge (receives no events); verified = ownership proven."),createdAt:e(),lastDeliveredAt:e().nullable(),lastFailedAt:e().nullable(),consecutiveFailures:o().min(rC)}).describe("Webhook endpoint record (secret omitted after create)."),rO=t({id:e()}),nC=0,iC=6e4,nO=t({url:e().min(1).optional(),events:p(s(["media.transcribed","media.completed","suggest.completed","session.mux.complete","session.mux.failed","render.completed","compose.completed","checkpoint.ready","project.updated","composition.updated","webhook.test"])).min(1).optional(),settleMs:o().min(nC).max(iC).optional(),enabled:h().optional()}).strict().describe("PATCH /webhooks/:id body."),sC=0,aC=0,iO=t({id:e(),url:e().url(),events:p(s(["media.transcribed","media.completed","suggest.completed","session.mux.complete","session.mux.failed","render.completed","compose.completed","checkpoint.ready","project.updated","composition.updated","webhook.test"])),settleMs:o().min(sC),enabled:h(),verificationStatus:s(["pending","verified"]).describe("pending = callback URL has not echoed the ownership challenge (receives no events); verified = ownership proven."),createdAt:e(),lastDeliveredAt:e().nullable(),lastFailedAt:e().nullable(),consecutiveFailures:o().min(aC)}).describe("Webhook endpoint record (secret omitted after create)."),sO=t({id:e()}),aO=t({id:e()}),dO=t({id:e()}),pO=t({id:e(),status:s(["active","pending"]).describe("active = ownership verified + receiving events; pending = challenge not echoed."),verification:t({status:m("pending"),reason:e()}).optional().describe("Present only when the re-challenge did not verify; `reason` names why (see WebhookCreateResponse.verification).")}).describe("POST /webhooks/:id/verify response.");var dC=2048,mO=t({videoUrl:e().url().max(dC),format:t({aspectRatio:s(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:s(["hd","fhd","4k"]).optional()}).strict().optional().describe("Output-format spec per \xA7Format.")}).strict();import{readFileSync as cC,writeFileSync as mC,mkdirSync as lC,existsSync as uC}from"fs";import{join as it}from"path";import{homedir as fC}from"os";var st=it(fC(),".cueframe"),Ve=it(st,"auth.json"),we={local:"http://127.0.0.1:3211",dev:"https://api-dev.cueframe.ai",prod:"https://api.cueframe.ai"},gC="prod";function MH(n=gC){return process.env.CUEFRAME_API_URL??we[n]??we.prod}function at(){return uC(Ve)?JSON.parse(cC(Ve,"utf-8")):{targets:{}}}function hC(n){lC(st,{recursive:!0}),mC(Ve,JSON.stringify(n,null,2))}function wH(n,r="prod",i){let a=at(),d=we[r]??we.prod;a.targets[r]={apiKey:n,apiUrl:i??d},hC(a)}function dt(n="prod"){let r=process.env.CUEFRAME_API_KEY,i=process.env.CUEFRAME_API_URL;if(r)return{apiKey:r,apiUrl:i??we[n]??we.prod};let d=at().targets[n];return d||(console.error(`No auth configured for target "${n}". Run: cueframe auth <api-key> --target ${n}`),process.exit(1)),d}function pt(n){let{apiKey:r,apiUrl:i}=dt(n);Ue({baseUrl:i,apiKey:r})}function ct(n){let r=n instanceof F?`${n.message} (${n.code}${n.status?`, ${n.status}`:""})`:n instanceof Error?n.message:String(n),i=Le(n);return i?`${r}
|
|
9
|
+
\u2192 ${i}`:r}var q={Success:0,UserError:2,ApiClientError:3,ApiServerError:4,NetworkError:5,PaymentRequired:6};function Ye(n){if(n instanceof F){if(n.status===402)return q.PaymentRequired;if(n.status>=500)return q.ApiServerError;if(n.status>=400)return q.ApiClientError}return q.NetworkError}function AH(n){return n===402?q.PaymentRequired:n>=500?q.ApiServerError:n>=400?q.ApiClientError:q.Success}function Ae(n){process.exit(n)}import zC from"ora";import xC from"pino";var bC="v1",mt=xC({level:"trace",base:{schemaVersion:bC},messageKey:"event",timestamp:()=>`,"ts":${Date.now()}`,formatters:{level:()=>({_:0})}});function Je(n,r){return zC({text:n,isSilent:!!r}).start()}function Be(n,r,i={}){n.json&&mt.info(i,r)}function DH(n,r,i){if(n.json){console.log(JSON.stringify(r,null,2));return}i()}function _e(n,r,i,a){let d=i instanceof Error?i.message:String(i),c=typeof i?.code=="string"?i.code:void 0,l=i?.status;n.json?mt.info({phase:r,message:d,...c?{code:c}:{},...typeof l=="number"?{status:l}:{},exitCode:a},"error"):process.stderr.write(`\u2716 ${r}: ${d}
|
|
10
|
+
`)}function GH(n,r){r.json||console.log(n)}function yC(n){for(let r=0;r<n.length;r++){let i=n.charCodeAt(r);if(i<=31||i===127)return!0}return!1}function ut(n,r,i){n.length===0&<(`${r} is empty.`,i),yC(n)&<(`${r} contains a control character (newline, tab, or null byte). Identifiers must be plain text \u2014 check for a stray copy-paste artifact.`,i)}function lt(n,r){_e(r,"preflight",new Error(n),q.UserError),Ae(q.UserError)}var SC=5e3,Xe=300*1e3;async function JH(n,r){if(ut(n,"mediaItemId",r),r.dryRun){Be(r,"analyze_dry_run",{mediaItemId:n,target:r.target,wait:!!r.wait,wouldCall:"POST /v1/media/:id/suggestions"}),r.json||console.log(`[dry-run] Would trigger clip analysis for ${n} on ${r.target}.`);return}pt(r.target),Be(r,"analyze_prepare",{mediaItemId:n,target:r.target,wait:!!r.wait});let i=Je("Triggering clip analysis\u2026",r.json),a;try{a=await Te.suggestBriefs(n),i.succeed(a.workflowId?`Analysis started (workflow: ${a.workflowId})`:`Analysis ${a.alreadyRunning?"already running":"started"}`)}catch(l){i.fail(`Failed to start analysis: ${ct(l)}`),_e(r,"analyze_prepare",l,Ye(l)),Ae(Ye(l))}if(Be(r,"analyze_ready",{mediaItemId:n,workflowId:a.workflowId,alreadyRunning:!!a.alreadyRunning}),!r.wait){r.json||console.log(`
|
|
11
|
+
Run \`cueframe clips ${n}\` to check results.`);return}let d=Je("Waiting for analysis to complete\u2026",r.json),c=Date.now();for(;;){await new Promise(l=>setTimeout(l,SC)),Date.now()-c>Xe&&(d.fail(`Timed out after ${Math.round(Xe/1e3)}s. Run \`cueframe clips ${n}\` to check later.`),_e(r,"analyze_progress",new Error(`Analysis did not complete within ${Math.round(Xe/1e3)}s`),q.UserError),Ae(q.UserError));try{let l=await Te.listMediaSuggestions(n);if(l.suggestions.length>0){d.succeed(`Analysis complete \u2014 ${l.suggestions.length} clips found`),Be(r,"analyze_complete",{mediaItemId:n,durationMs:Date.now()-c,suggestionCount:l.suggestions.length,suggestions:l.suggestions}),r.json||l.suggestions.forEach((b,S)=>{let k=(b.trim.end-b.trim.start).toFixed(1);console.log(`
|
|
12
|
+
${S+1}. ${b.title} (${b.id})`),console.log(` ${b.trim.start.toFixed(1)}s \u2013 ${b.trim.end.toFixed(1)}s (${k}s) score: ${b.score}`),console.log(` ${b.reason}`)});return}let f=Math.round((Date.now()-c)/1e3);d.text=`Waiting for analysis\u2026 (${f}s)`,Be(r,"analyze_progress",{mediaItemId:n,elapsedSec:f})}catch{}}}export{MH as a,wH as b,Je as c,Be as d,DH as e,_e as f,GH as g,F as h,Ue as i,Ke as j,Qe as k,R as l,Le as m,bt as n,lo as o,xo as p,Oo as q,jo as r,Do as s,Wo as t,Te as u,nt as v,q as w,Ye as x,AH as y,Ae as z,ut as A,pt as B,ct as C,JH as D};
|