cueframe 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/analyze-6ETMHDG5.js +2 -0
- package/dist/chunk-JHOJIRD5.js +12 -0
- package/dist/cueframe.js +73 -27
- package/package.json +14 -12
- package/skills/composing-video/SKILL.md +442 -0
- package/skills/cueframe-brand-demo/SKILL.md +248 -0
- package/skills/cueframe-cli/SKILL.md +40 -9
- package/skills/cueframe-component-authoring/SKILL.md +67 -0
- package/skills/cueframe-storyboard/SKILL.md +96 -0
- package/dist/analyze-JQBFZK57.js +0 -2
- package/dist/chunk-KEYFXLX4.js +0 -12
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var ut=Object.defineProperty;var ee=(r,t)=>{for(var s in t)ut(r,s,{get:t[s],enumerable:!0})};var N=class extends Error{status;code;details;requestId;constructor(t,s,i){super(s.message),this.name="ApiError",this.status=t,this.code=s.code,this.details=s.details,this.requestId=i}},K={baseUrl:""};function De(r){return K={timeoutMs:3e4,...r},K}function We(){return K}function ft(r,t){return/^https?:\/\//.test(t)?t:r.replace(/\/$/,"")+(t.startsWith("/")?t:`/${t}`)}async function Qe(r,t={}){if(!K.baseUrl)throw new Error("@cueframe/sdk: createClient({baseUrl}) must be called before issuing requests.");let s=K.fetch??fetch,i=ft(K.baseUrl,r),d=new Headers({accept:"application/json"});for(let[M,D]of Object.entries(K.headers??{}))d.set(M,D);t.headers&&new Headers(t.headers).forEach((M,D)=>d.set(D,M)),K.apiKey&&!d.has("authorization")&&d.set("authorization",`Bearer ${K.apiKey}`);let p=new AbortController,l=setTimeout(()=>p.abort(),K.timeoutMs??3e4),f=t.signal??p.signal,y;try{y=await s(i,{...t,headers:d,signal:f})}finally{clearTimeout(l)}let S={};y.headers.forEach((M,D)=>{S[D.toLowerCase()]=M});let k=null;if(y.status!==204)if((y.headers.get("content-type")??"").includes("application/json"))try{k=await y.json()}catch{k=null}else k=await y.text();return{status:y.status,statusText:y.statusText,headers:S,body:k,requestId:S["x-request-id"]}}async function v(r,t={}){let s=await Qe(r,t);if(s.status>=400){let i;throw s.body&&typeof s.body=="object"&&"error"in s.body?i=s.body.error??{code:"unknown",message:s.statusText}:i={code:"unknown",message:s.statusText},new N(s.status,i,s.requestId)}if(s.status!==204)return s.body}var gt={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(r){return r instanceof N?gt[r.code]??null:null}async function*ht(r,t,s){let i=We();if(!i?.baseUrl)throw new Error(`@cueframe/sdk: createClient({baseUrl}) must be called before ${t}.`);let d=i.baseUrl.replace(/\/$/,"")+r,p=new Headers({accept:"text/event-stream",...i.headers??{}});i.apiKey&&!p.has("authorization")&&p.set("authorization",`Bearer ${i.apiKey}`);let f=await(i.fetch??fetch)(d,{method:"GET",headers:p,signal:s.signal});if(!f.ok){let M;try{M=(await f.json()).error??{code:"unknown",message:f.statusText}}catch{M={code:"unknown",message:f.statusText}}throw new N(f.status,M,f.headers.get("x-request-id")??void 0)}if(!f.body)throw new Error("SSE response has no body");let y=f.body.getReader(),S=new TextDecoder("utf-8"),k="";try{for(;;){let{value:M,done:D}=await y.read();if(D)break;k+=S.decode(M,{stream:!0});let Q=k.indexOf(`
|
|
3
|
+
|
|
4
|
+
`);for(;Q!==-1;){let lt=k.slice(0,Q);k=k.slice(Q+2);let Xe=zt(lt);Xe&&(yield Xe),Q=k.indexOf(`
|
|
5
|
+
|
|
6
|
+
`)}}}finally{try{y.releaseLock()}catch{}}}function zt(r){if(!r.trim())return null;let t=null,s=[];for(let i of r.split(`
|
|
7
|
+
`)){if(!i||i.startsWith(":"))continue;let d=i.indexOf(":");if(d===-1)continue;let p=i.slice(0,d),l=i.slice(d+1).replace(/^ /,"");p==="event"?t=l:p==="data"&&s.push(l)}return!t||s.length===0?null:{event:t,data:s.join(`
|
|
8
|
+
`)}}async function*xt(r,t,s={}){let i=`/v1/projects/${encodeURIComponent(r)}/renders/${encodeURIComponent(t)}/stream`;for await(let d of ht(i,"iterRenderEvents",s)){let p=yt(d);p&&(yield p)}}function yt(r){let{event:t,data:s}=r;if(s===null||t!=="progress"&&t!=="complete"&&t!=="error")return null;let i;try{i=JSON.parse(s)}catch{return null}return{event:t,data:i}}var mo={};ee(mo,{createMediaUpload:()=>St,deleteMedia:()=>It,generateMedia:()=>vt,getCreateMediaUploadUrl:()=>eo,getDeleteMediaUrl:()=>ro,getGenerateMediaUrl:()=>to,getGetMediaContextUrl:()=>ao,getGetMediaPerformanceUrl:()=>co,getGetMediaTranscriptUrl:()=>io,getGetMediaUrl:()=>so,getImportMediaUrl:()=>no,getListMediaUrl:()=>oo,getMedia:()=>kt,getMediaContext:()=>wt,getMediaPerformance:()=>Bt,getMediaTranscript:()=>Ot,getTriggerSubjectDetectionUrl:()=>po,importMedia:()=>Rt,listMedia:()=>Ct,triggerSubjectDetection:()=>Tt});var eo=()=>"/v1/media",St=async(r,t)=>v(eo(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(r)}),oo=()=>"/v1/media",Ct=async r=>v(oo(),{...r,method:"GET"}),to=()=>"/v1/media/generate",vt=async(r,t)=>v(to(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(r)}),no=()=>"/v1/media/import",Rt=async(r,t)=>v(no(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(r)}),ro=r=>`/v1/media/${r}`,It=async(r,t)=>v(ro(r),{...t,method:"DELETE"}),so=r=>`/v1/media/${r}`,kt=async(r,t)=>v(so(r),{...t,method:"GET"}),io=r=>`/v1/media/${r}/transcript`,Ot=async(r,t)=>v(io(r),{...t,method:"GET"}),ao=r=>`/v1/media/${r}/context`,wt=async(r,t)=>v(ao(r),{...t,method:"GET"}),po=r=>`/v1/media/${r}/detect-subjects`,Tt=async(r,t)=>v(po(r),{...t,method:"POST"}),co=r=>`/v1/media/${r}/performance`,Bt=async(r,t)=>v(co(r),{...t,method:"GET"});var zo={};ee(zo,{createProject:()=>jt,deleteProject:()=>_t,getCreateProjectUrl:()=>uo,getDeleteProjectUrl:()=>ho,getGetProjectUrl:()=>fo,getListProjectsUrl:()=>lo,getPatchProjectUrl:()=>go,getProject:()=>Pt,listProjects:()=>Mt,patchProject:()=>Et});var lo=()=>"/v1/projects",Mt=async r=>v(lo(),{...r,method:"GET"}),uo=()=>"/v1/projects",jt=async(r,t)=>v(uo(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(r)}),fo=r=>`/v1/projects/${r}`,Pt=async(r,t)=>v(fo(r),{...t,method:"GET"}),go=r=>`/v1/projects/${r}`,Et=async(r,t,s)=>v(go(r),{...s,method:"PATCH",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),ho=r=>`/v1/projects/${r}`,_t=async(r,t)=>v(ho(r),{...t,method:"DELETE"});var ko={};ee(ko,{cancelRender:()=>Gt,createRender:()=>At,getCancelRenderUrl:()=>Co,getCreateRenderUrl:()=>xo,getGetRenderUrl:()=>So,getListProjectRendersUrl:()=>yo,getPreviewClipUrl:()=>bo,getRefreshRenderUrlUrl:()=>Ro,getRender:()=>Ft,getRetryRenderUrl:()=>vo,getStreamRenderUrl:()=>Io,listProjectRenders:()=>qt,previewClip:()=>Nt,refreshRenderUrl:()=>Dt,retryRender:()=>Ut,streamRender:()=>Wt});var xo=r=>`/v1/projects/${r}/renders`,At=async(r,t,s)=>v(xo(r),{...s,method:"POST",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),yo=r=>`/v1/projects/${r}/renders`,qt=async(r,t)=>v(yo(r),{...t,method:"GET"}),bo=r=>`/v1/projects/${r}/preview-clip`,Nt=async(r,t,s)=>v(bo(r),{...s,method:"POST",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),So=(r,t)=>`/v1/projects/${r}/renders/${t}`,Ft=async(r,t,s)=>v(So(r,t),{...s,method:"GET"}),Co=(r,t)=>`/v1/projects/${r}/renders/${t}/cancel`,Gt=async(r,t,s)=>v(Co(r,t),{...s,method:"POST"}),vo=(r,t)=>`/v1/projects/${r}/renders/${t}/retry`,Ut=async(r,t,s)=>v(vo(r,t),{...s,method:"POST"}),Ro=(r,t)=>`/v1/projects/${r}/renders/${t}/refresh-url`,Dt=async(r,t,s)=>v(Ro(r,t),{...s,method:"POST"}),Io=(r,t)=>`/v1/projects/${r}/renders/${t}/stream`,Wt=async(r,t,s)=>v(Io(r,t),{...s,method:"GET"});var Bo={};ee(Bo,{createFcpxmlExport:()=>Lt,createPremiereExport:()=>Kt,getCreateFcpxmlExportUrl:()=>Oo,getCreatePremiereExportUrl:()=>wo,getExport:()=>$t,getGetExportUrl:()=>To});var Oo=r=>`/v1/projects/${r}/exports/fcpxml`,Lt=async(r,t,s)=>v(Oo(r),{...s,method:"POST",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),wo=r=>`/v1/projects/${r}/exports/premiere`,Kt=async(r,t,s)=>v(wo(r),{...s,method:"POST",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),To=(r,t)=>`/v1/projects/${r}/exports/${t}`,$t=async(r,t,s)=>v(To(r,t),{...s,method:"GET"});var qo={};ee(qo,{createSession:()=>Jt,deleteSession:()=>Xt,getCreateSessionUrl:()=>jo,getDeleteSessionUrl:()=>Eo,getGetMuxJobUrl:()=>Ao,getGetSessionUrl:()=>Po,getListSessionsUrl:()=>Mo,getMuxJob:()=>en,getSession:()=>Yt,getTriggerMuxJobUrl:()=>_o,listSessions:()=>Vt,triggerMuxJob:()=>Qt});var Mo=()=>"/v1/sessions",Vt=async r=>v(Mo(),{...r,method:"GET"}),jo=()=>"/v1/sessions",Jt=async(r,t)=>v(jo(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(r)}),Po=r=>`/v1/sessions/${r}`,Yt=async(r,t)=>v(Po(r),{...t,method:"GET"}),Eo=r=>`/v1/sessions/${r}`,Xt=async(r,t)=>v(Eo(r),{...t,method:"DELETE"}),_o=r=>`/v1/sessions/${r}/mux-job`,Qt=async(r,t)=>v(_o(r),{...t,method:"POST"}),Ao=r=>`/v1/sessions/${r}/mux-job`,en=async(r,t)=>v(Ao(r),{...t,method:"GET"});var Wo={};ee(Wo,{createComponent:()=>tn,getComponent:()=>rn,getComponentSource:()=>sn,getCreateComponentUrl:()=>Fo,getGetComponentSourceUrl:()=>Do,getGetComponentUrl:()=>Uo,getListCatalogUrl:()=>No,getUpdateComponentUrl:()=>Go,listCatalog:()=>on,updateComponent:()=>nn});var No=r=>{let t=new URLSearchParams;Object.entries(r||{}).forEach(([i,d])=>{d!==void 0&&t.append(i,d===null?"null":d.toString())});let s=t.toString();return s.length>0?`/v1/components?${s}`:"/v1/components"},on=async(r,t)=>v(No(r),{...t,method:"GET"}),Fo=()=>"/v1/components",tn=async(r,t)=>v(Fo(),{...t,method:"POST",headers:{"Content-Type":"application/json",...t?.headers},body:JSON.stringify(r)}),Go=r=>`/v1/components/${r}`,nn=async(r,t,s)=>v(Go(r),{...s,method:"PUT",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),Uo=r=>`/v1/components/${r}`,rn=async(r,t)=>v(Uo(r),{...t,method:"GET"}),Do=r=>`/v1/components/${r}/source`,sn=async(r,t)=>v(Do(r),{...t,method:"GET"});var Me={};ee(Me,{composeFromSuggestion:()=>fn,getComposeFromSuggestionUrl:()=>Lo,getListMediaSuggestionsUrl:()=>Ko,getResetMediaSuggestionsUrl:()=>Ho,getSuggestBriefsUrl:()=>$o,listMediaSuggestions:()=>gn,resetMediaSuggestions:()=>zn,suggestBriefs:()=>hn});var Lo=r=>`/v1/projects/${r}/composition/from-suggestion`,fn=async(r,t,s)=>v(Lo(r),{...s,method:"POST",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(t)}),Ko=r=>`/v1/media/${r}/suggestions`,gn=async(r,t)=>v(Ko(r),{...t,method:"GET"}),$o=r=>`/v1/media/${r}/suggestions`,hn=async(r,t)=>v($o(r),{...t,method:"POST"}),Ho=r=>`/v1/media/${r}/suggestions`,zn=async(r,t)=>v(Ho(r),{...t,method:"DELETE"});var tt={};ee(tt,{BRAND:()=>Jn,DIRTY:()=>se,EMPTY_PATH:()=>wn,INVALID:()=>I,NEVER:()=>kr,OK:()=>E,ParseStatus:()=>P,Schema:()=>T,ZodAny:()=>ne,ZodArray:()=>X,ZodBigInt:()=>ae,ZodBoolean:()=>de,ZodBranded:()=>Pe,ZodCatch:()=>ye,ZodDate:()=>pe,ZodDefault:()=>xe,ZodDiscriminatedUnion:()=>Fe,ZodEffects:()=>U,ZodEnum:()=>he,ZodError:()=>_,ZodFirstPartyTypeKind:()=>O,ZodFunction:()=>Ue,ZodIntersection:()=>ue,ZodIssueCode:()=>z,ZodLazy:()=>fe,ZodLiteral:()=>ge,ZodMap:()=>ke,ZodNaN:()=>we,ZodNativeEnum:()=>ze,ZodNever:()=>W,ZodNull:()=>me,ZodNullable:()=>Z,ZodNumber:()=>ie,ZodObject:()=>A,ZodOptional:()=>F,ZodParsedType:()=>C,ZodPipeline:()=>Ee,ZodPromise:()=>re,ZodReadonly:()=>be,ZodRecord:()=>Ge,ZodSchema:()=>T,ZodSet:()=>Oe,ZodString:()=>te,ZodSymbol:()=>Re,ZodTransformer:()=>U,ZodTuple:()=>H,ZodType:()=>T,ZodUndefined:()=>ce,ZodUnion:()=>le,ZodUnknown:()=>Y,ZodVoid:()=>Ie,addIssueToContext:()=>b,any:()=>rr,array:()=>c,bigint:()=>er,boolean:()=>h,coerce:()=>Ir,custom:()=>ot,date:()=>or,datetimeRegex:()=>Qo,defaultErrorMap:()=>V,discriminatedUnion:()=>dr,effect:()=>zr,enum:()=>a,function:()=>ur,getErrorMap:()=>Se,getParsedType:()=>$,instanceof:()=>Xn,intersection:()=>pr,isAborted:()=>qe,isAsync:()=>Ce,isDirty:()=>Ne,isValid:()=>oe,late:()=>Yn,lazy:()=>fr,literal:()=>m,makeIssue:()=>je,map:()=>mr,nan:()=>Qn,nativeEnum:()=>gr,never:()=>sr,null:()=>L,nullable:()=>yr,number:()=>o,object:()=>n,objectUtil:()=>Ke,oboolean:()=>Rr,onumber:()=>vr,optional:()=>xr,ostring:()=>Cr,pipeline:()=>Sr,preprocess:()=>br,promise:()=>hr,quotelessJson:()=>In,record:()=>u,set:()=>lr,setErrorMap:()=>On,strictObject:()=>ar,string:()=>e,symbol:()=>tr,transformer:()=>zr,tuple:()=>cr,undefined:()=>nr,union:()=>x,unknown:()=>g,util:()=>B,void:()=>ir});var B;(function(r){r.assertEqual=d=>{};function t(d){}r.assertIs=t;function s(d){throw new Error}r.assertNever=s,r.arrayToEnum=d=>{let p={};for(let l of d)p[l]=l;return p},r.getValidEnumValues=d=>{let p=r.objectKeys(d).filter(f=>typeof d[d[f]]!="number"),l={};for(let f of p)l[f]=d[f];return r.objectValues(l)},r.objectValues=d=>r.objectKeys(d).map(function(p){return d[p]}),r.objectKeys=typeof Object.keys=="function"?d=>Object.keys(d):d=>{let p=[];for(let l in d)Object.prototype.hasOwnProperty.call(d,l)&&p.push(l);return p},r.find=(d,p)=>{for(let l of d)if(p(l))return l},r.isInteger=typeof Number.isInteger=="function"?d=>Number.isInteger(d):d=>typeof d=="number"&&Number.isFinite(d)&&Math.floor(d)===d;function i(d,p=" | "){return d.map(l=>typeof l=="string"?`'${l}'`:l).join(p)}r.joinValues=i,r.jsonStringifyReplacer=(d,p)=>typeof p=="bigint"?p.toString():p})(B||(B={}));var Ke;(function(r){r.mergeShapes=(t,s)=>({...t,...s})})(Ke||(Ke={}));var C=B.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$=r=>{switch(typeof r){case"undefined":return C.undefined;case"string":return C.string;case"number":return Number.isNaN(r)?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(r)?C.array:r===null?C.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?C.promise:typeof Map<"u"&&r instanceof Map?C.map:typeof Set<"u"&&r instanceof Set?C.set:typeof Date<"u"&&r 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"]),In=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),_=class r extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=t}format(t){let s=t||function(p){return p.message},i={_errors:[]},d=p=>{for(let l of p.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)i._errors.push(s(l));else{let f=i,y=0;for(;y<l.path.length;){let S=l.path[y];y===l.path.length-1?(f[S]=f[S]||{_errors:[]},f[S]._errors.push(s(l))):f[S]=f[S]||{_errors:[]},f=f[S],y++}}};return d(this),i}static assert(t){if(!(t instanceof r))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,B.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=s=>s.message){let s={},i=[];for(let d of this.issues)if(d.path.length>0){let p=d.path[0];s[p]=s[p]||[],s[p].push(t(d))}else i.push(t(d));return{formErrors:i,fieldErrors:s}}get formErrors(){return this.flatten()}};_.create=r=>new _(r);var kn=(r,t)=>{let s;switch(r.code){case z.invalid_type:r.received===C.undefined?s="Required":s=`Expected ${r.expected}, received ${r.received}`;break;case z.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(r.expected,B.jsonStringifyReplacer)}`;break;case z.unrecognized_keys:s=`Unrecognized key(s) in object: ${B.joinValues(r.keys,", ")}`;break;case z.invalid_union:s="Invalid input";break;case z.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${B.joinValues(r.options)}`;break;case z.invalid_enum_value:s=`Invalid enum value. Expected ${B.joinValues(r.options)}, received '${r.received}'`;break;case z.invalid_arguments:s="Invalid function arguments";break;case z.invalid_return_type:s="Invalid function return type";break;case z.invalid_date:s="Invalid date";break;case z.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(s=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?s=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?s=`Invalid input: must end with "${r.validation.endsWith}"`:B.assertNever(r.validation):r.validation!=="regex"?s=`Invalid ${r.validation}`:s="Invalid";break;case z.too_small:r.type==="array"?s=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?s=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?s=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?s=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?s=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:s="Invalid input";break;case z.too_big:r.type==="array"?s=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?s=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?s=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?s=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?s=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:s="Invalid input";break;case z.custom:s="Invalid input";break;case z.invalid_intersection_types:s="Intersection results could not be merged";break;case z.not_multiple_of:s=`Number must be a multiple of ${r.multipleOf}`;break;case z.not_finite:s="Number must be finite";break;default:s=t.defaultError,B.assertNever(r)}return{message:s}},V=kn;var Zo=V;function On(r){Zo=r}function Se(){return Zo}var je=r=>{let{data:t,path:s,errorMaps:i,issueData:d}=r,p=[...s,...d.path||[]],l={...d,path:p};if(d.message!==void 0)return{...d,path:p,message:d.message};let f="",y=i.filter(S=>!!S).slice().reverse();for(let S of y)f=S(l,{data:t,defaultError:f}).message;return{...d,path:p,message:f}},wn=[];function b(r,t){let s=Se(),i=je({issueData:t,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,s,s===V?void 0:V].filter(d=>!!d)});r.common.issues.push(i)}var P=class r{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,s){let i=[];for(let d of s){if(d.status==="aborted")return I;d.status==="dirty"&&t.dirty(),i.push(d.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,s){let i=[];for(let d of s){let p=await d.key,l=await d.value;i.push({key:p,value:l})}return r.mergeObjectSync(t,i)}static mergeObjectSync(t,s){let i={};for(let d of s){let{key:p,value:l}=d;if(p.status==="aborted"||l.status==="aborted")return I;p.status==="dirty"&&t.dirty(),l.status==="dirty"&&t.dirty(),p.value!=="__proto__"&&(typeof l.value<"u"||d.alwaysSet)&&(i[p.value]=l.value)}return{status:t.value,value:i}}},I=Object.freeze({status:"aborted"}),se=r=>({status:"dirty",value:r}),E=r=>({status:"valid",value:r}),qe=r=>r.status==="aborted",Ne=r=>r.status==="dirty",oe=r=>r.status==="valid",Ce=r=>typeof Promise<"u"&&r instanceof Promise;var R;(function(r){r.errToObj=t=>typeof t=="string"?{message:t}:t||{},r.toString=t=>typeof t=="string"?t:t?.message})(R||(R={}));var G=class{constructor(t,s,i,d){this._cachedPath=[],this.parent=t,this.data=s,this._path=i,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}},Vo=(r,t)=>{if(oe(t))return{success:!0,data:t.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let s=new _(r.common.issues);return this._error=s,this._error}}};function w(r){if(!r)return{};let{errorMap:t,invalid_type_error:s,required_error:i,description:d}=r;if(t&&(s||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:d}:{errorMap:(l,f)=>{let{message:y}=r;return l.code==="invalid_enum_value"?{message:y??f.defaultError}:typeof f.data>"u"?{message:y??i??f.defaultError}:l.code!=="invalid_type"?{message:f.defaultError}:{message:y??s??f.defaultError}},description:d}}var T=class{get description(){return this._def.description}_getType(t){return $(t.data)}_getOrReturnCtx(t,s){return s||{common:t.parent.common,data:t.data,parsedType:$(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new P,ctx:{common:t.parent.common,data:t.data,parsedType:$(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let s=this._parse(t);if(Ce(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(t){let s=this._parse(t);return Promise.resolve(s)}parse(t,s){let i=this.safeParse(t,s);if(i.success)return i.data;throw i.error}safeParse(t,s){let i={common:{issues:[],async:s?.async??!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:$(t)},d=this._parseSync({data:t,path:i.path,parent:i});return Vo(i,d)}"~validate"(t){let s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:$(t)};if(!this["~standard"].async)try{let i=this._parseSync({data:t,path:[],parent:s});return oe(i)?{value:i.value}:{issues:s.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:s}).then(i=>oe(i)?{value:i.value}:{issues:s.common.issues})}async parseAsync(t,s){let i=await this.safeParseAsync(t,s);if(i.success)return i.data;throw i.error}async safeParseAsync(t,s){let i={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:$(t)},d=this._parse({data:t,path:i.path,parent:i}),p=await(Ce(d)?d:Promise.resolve(d));return Vo(i,p)}refine(t,s){let i=d=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(d):s;return this._refinement((d,p)=>{let l=t(d),f=()=>p.addIssue({code:z.custom,...i(d)});return typeof Promise<"u"&&l instanceof Promise?l.then(y=>y?!0:(f(),!1)):l?!0:(f(),!1)})}refinement(t,s){return this._refinement((i,d)=>t(i)?!0:(d.addIssue(typeof s=="function"?s(i,d):s),!1))}_refinement(t){return new U({schema:this,typeName:O.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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:s=>this["~validate"](s)}}optional(){return F.create(this,this._def)}nullable(){return Z.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return X.create(this)}promise(){return re.create(this,this._def)}or(t){return le.create([this,t],this._def)}and(t){return ue.create(this,t,this._def)}transform(t){return new U({...w(this._def),schema:this,typeName:O.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let s=typeof t=="function"?t:()=>t;return new xe({...w(this._def),innerType:this,defaultValue:s,typeName:O.ZodDefault})}brand(){return new Pe({typeName:O.ZodBranded,type:this,...w(this._def)})}catch(t){let s=typeof t=="function"?t:()=>t;return new ye({...w(this._def),innerType:this,catchValue:s,typeName:O.ZodCatch})}describe(t){let s=this.constructor;return new s({...this._def,description:t})}pipe(t){return Ee.create(this,t)}readonly(){return be.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Tn=/^c[^\s-]{8,}$/i,Bn=/^[0-9a-z]+$/,Mn=/^[0-9A-HJKMNP-TV-Z]{26}$/i,jn=/^[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,Pn=/^[a-z0-9_-]{21}$/i,En=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,_n=/^[-+]?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)?)??$/,An=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,qn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",$e,Nn=/^(?:(?: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])$/,Fn=/^(?:(?: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])$/,Gn=/^(([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]))$/,Un=/^(([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])$/,Dn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Wn=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Yo="((\\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])))",Ln=new RegExp(`^${Yo}$`);function Xo(r){let t="[0-5]\\d";r.precision?t=`${t}\\.\\d{${r.precision}}`:r.precision==null&&(t=`${t}(\\.\\d+)?`);let s=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${s}`}function Kn(r){return new RegExp(`^${Xo(r)}$`)}function Qo(r){let t=`${Yo}T${Xo(r)}`,s=[];return s.push(r.local?"Z?":"Z"),r.offset&&s.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${s.join("|")})`,new RegExp(`^${t}$`)}function $n(r,t){return!!((t==="v4"||!t)&&Nn.test(r)||(t==="v6"||!t)&&Gn.test(r))}function Hn(r,t){if(!En.test(r))return!1;try{let[s]=r.split(".");if(!s)return!1;let i=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),d=JSON.parse(atob(i));return!(typeof d!="object"||d===null||"typ"in d&&d?.typ!=="JWT"||!d.alg||t&&d.alg!==t)}catch{return!1}}function Zn(r,t){return!!((t==="v4"||!t)&&Fn.test(r)||(t==="v6"||!t)&&Un.test(r))}var te=class r extends T{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==C.string){let p=this._getOrReturnCtx(t);return b(p,{code:z.invalid_type,expected:C.string,received:p.parsedType}),I}let i=new P,d;for(let p of this._def.checks)if(p.kind==="min")t.data.length<p.value&&(d=this._getOrReturnCtx(t,d),b(d,{code:z.too_small,minimum:p.value,type:"string",inclusive:!0,exact:!1,message:p.message}),i.dirty());else if(p.kind==="max")t.data.length>p.value&&(d=this._getOrReturnCtx(t,d),b(d,{code:z.too_big,maximum:p.value,type:"string",inclusive:!0,exact:!1,message:p.message}),i.dirty());else if(p.kind==="length"){let l=t.data.length>p.value,f=t.data.length<p.value;(l||f)&&(d=this._getOrReturnCtx(t,d),l?b(d,{code:z.too_big,maximum:p.value,type:"string",inclusive:!0,exact:!0,message:p.message}):f&&b(d,{code:z.too_small,minimum:p.value,type:"string",inclusive:!0,exact:!0,message:p.message}),i.dirty())}else if(p.kind==="email")An.test(t.data)||(d=this._getOrReturnCtx(t,d),b(d,{validation:"email",code:z.invalid_string,message:p.message}),i.dirty());else if(p.kind==="emoji")$e||($e=new RegExp(qn,"u")),$e.test(t.data)||(d=this._getOrReturnCtx(t,d),b(d,{validation:"emoji",code:z.invalid_string,message:p.message}),i.dirty());else if(p.kind==="uuid")jn.test(t.data)||(d=this._getOrReturnCtx(t,d),b(d,{validation:"uuid",code:z.invalid_string,message:p.message}),i.dirty());else if(p.kind==="nanoid")Pn.test(t.data)||(d=this._getOrReturnCtx(t,d),b(d,{validation:"nanoid",code:z.invalid_string,message:p.message}),i.dirty());else if(p.kind==="cuid")Tn.test(t.data)||(d=this._getOrReturnCtx(t,d),b(d,{validation:"cuid",code:z.invalid_string,message:p.message}),i.dirty());else if(p.kind==="cuid2")Bn.test(t.data)||(d=this._getOrReturnCtx(t,d),b(d,{validation:"cuid2",code:z.invalid_string,message:p.message}),i.dirty());else if(p.kind==="ulid")Mn.test(t.data)||(d=this._getOrReturnCtx(t,d),b(d,{validation:"ulid",code:z.invalid_string,message:p.message}),i.dirty());else if(p.kind==="url")try{new URL(t.data)}catch{d=this._getOrReturnCtx(t,d),b(d,{validation:"url",code:z.invalid_string,message:p.message}),i.dirty()}else p.kind==="regex"?(p.regex.lastIndex=0,p.regex.test(t.data)||(d=this._getOrReturnCtx(t,d),b(d,{validation:"regex",code:z.invalid_string,message:p.message}),i.dirty())):p.kind==="trim"?t.data=t.data.trim():p.kind==="includes"?t.data.includes(p.value,p.position)||(d=this._getOrReturnCtx(t,d),b(d,{code:z.invalid_string,validation:{includes:p.value,position:p.position},message:p.message}),i.dirty()):p.kind==="toLowerCase"?t.data=t.data.toLowerCase():p.kind==="toUpperCase"?t.data=t.data.toUpperCase():p.kind==="startsWith"?t.data.startsWith(p.value)||(d=this._getOrReturnCtx(t,d),b(d,{code:z.invalid_string,validation:{startsWith:p.value},message:p.message}),i.dirty()):p.kind==="endsWith"?t.data.endsWith(p.value)||(d=this._getOrReturnCtx(t,d),b(d,{code:z.invalid_string,validation:{endsWith:p.value},message:p.message}),i.dirty()):p.kind==="datetime"?Qo(p).test(t.data)||(d=this._getOrReturnCtx(t,d),b(d,{code:z.invalid_string,validation:"datetime",message:p.message}),i.dirty()):p.kind==="date"?Ln.test(t.data)||(d=this._getOrReturnCtx(t,d),b(d,{code:z.invalid_string,validation:"date",message:p.message}),i.dirty()):p.kind==="time"?Kn(p).test(t.data)||(d=this._getOrReturnCtx(t,d),b(d,{code:z.invalid_string,validation:"time",message:p.message}),i.dirty()):p.kind==="duration"?_n.test(t.data)||(d=this._getOrReturnCtx(t,d),b(d,{validation:"duration",code:z.invalid_string,message:p.message}),i.dirty()):p.kind==="ip"?$n(t.data,p.version)||(d=this._getOrReturnCtx(t,d),b(d,{validation:"ip",code:z.invalid_string,message:p.message}),i.dirty()):p.kind==="jwt"?Hn(t.data,p.alg)||(d=this._getOrReturnCtx(t,d),b(d,{validation:"jwt",code:z.invalid_string,message:p.message}),i.dirty()):p.kind==="cidr"?Zn(t.data,p.version)||(d=this._getOrReturnCtx(t,d),b(d,{validation:"cidr",code:z.invalid_string,message:p.message}),i.dirty()):p.kind==="base64"?Dn.test(t.data)||(d=this._getOrReturnCtx(t,d),b(d,{validation:"base64",code:z.invalid_string,message:p.message}),i.dirty()):p.kind==="base64url"?Wn.test(t.data)||(d=this._getOrReturnCtx(t,d),b(d,{validation:"base64url",code:z.invalid_string,message:p.message}),i.dirty()):B.assertNever(p);return{status:i.value,value:t.data}}_regex(t,s,i){return this.refinement(d=>t.test(d),{validation:s,code:z.invalid_string,...R.errToObj(i)})}_addCheck(t){return new r({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...R.errToObj(t)})}url(t){return this._addCheck({kind:"url",...R.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...R.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...R.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...R.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...R.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...R.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...R.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...R.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...R.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...R.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...R.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...R.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...R.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...R.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...R.errToObj(t)})}regex(t,s){return this._addCheck({kind:"regex",regex:t,...R.errToObj(s)})}includes(t,s){return this._addCheck({kind:"includes",value:t,position:s?.position,...R.errToObj(s?.message)})}startsWith(t,s){return this._addCheck({kind:"startsWith",value:t,...R.errToObj(s)})}endsWith(t,s){return this._addCheck({kind:"endsWith",value:t,...R.errToObj(s)})}min(t,s){return this._addCheck({kind:"min",value:t,...R.errToObj(s)})}max(t,s){return this._addCheck({kind:"max",value:t,...R.errToObj(s)})}length(t,s){return this._addCheck({kind:"length",value:t,...R.errToObj(s)})}nonempty(t){return this.min(1,R.errToObj(t))}trim(){return new r({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxLength(){let t=null;for(let s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}};te.create=r=>new te({checks:[],typeName:O.ZodString,coerce:r?.coerce??!1,...w(r)});function Vn(r,t){let s=(r.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,d=s>i?s:i,p=Number.parseInt(r.toFixed(d).replace(".","")),l=Number.parseInt(t.toFixed(d).replace(".",""));return p%l/10**d}var ie=class r extends T{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==C.number){let p=this._getOrReturnCtx(t);return b(p,{code:z.invalid_type,expected:C.number,received:p.parsedType}),I}let i,d=new P;for(let p of this._def.checks)p.kind==="int"?B.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),b(i,{code:z.invalid_type,expected:"integer",received:"float",message:p.message}),d.dirty()):p.kind==="min"?(p.inclusive?t.data<p.value:t.data<=p.value)&&(i=this._getOrReturnCtx(t,i),b(i,{code:z.too_small,minimum:p.value,type:"number",inclusive:p.inclusive,exact:!1,message:p.message}),d.dirty()):p.kind==="max"?(p.inclusive?t.data>p.value:t.data>=p.value)&&(i=this._getOrReturnCtx(t,i),b(i,{code:z.too_big,maximum:p.value,type:"number",inclusive:p.inclusive,exact:!1,message:p.message}),d.dirty()):p.kind==="multipleOf"?Vn(t.data,p.value)!==0&&(i=this._getOrReturnCtx(t,i),b(i,{code:z.not_multiple_of,multipleOf:p.value,message:p.message}),d.dirty()):p.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),b(i,{code:z.not_finite,message:p.message}),d.dirty()):B.assertNever(p);return{status:d.value,value:t.data}}gte(t,s){return this.setLimit("min",t,!0,R.toString(s))}gt(t,s){return this.setLimit("min",t,!1,R.toString(s))}lte(t,s){return this.setLimit("max",t,!0,R.toString(s))}lt(t,s){return this.setLimit("max",t,!1,R.toString(s))}setLimit(t,s,i,d){return new r({...this._def,checks:[...this._def.checks,{kind:t,value:s,inclusive:i,message:R.toString(d)}]})}_addCheck(t){return new r({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:R.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:R.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:R.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:R.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:R.toString(t)})}multipleOf(t,s){return this._addCheck({kind:"multipleOf",value:t,message:R.toString(s)})}finite(t){return this._addCheck({kind:"finite",message:R.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:R.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:R.toString(t)})}get minValue(){let t=null;for(let s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxValue(){let t=null;for(let s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&B.isInteger(t.value))}get isFinite(){let t=null,s=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(s===null||i.value>s)&&(s=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(s)&&Number.isFinite(t)}};ie.create=r=>new ie({checks:[],typeName:O.ZodNumber,coerce:r?.coerce||!1,...w(r)});var ae=class r extends T{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==C.bigint)return this._getInvalidInput(t);let i,d=new P;for(let p of this._def.checks)p.kind==="min"?(p.inclusive?t.data<p.value:t.data<=p.value)&&(i=this._getOrReturnCtx(t,i),b(i,{code:z.too_small,type:"bigint",minimum:p.value,inclusive:p.inclusive,message:p.message}),d.dirty()):p.kind==="max"?(p.inclusive?t.data>p.value:t.data>=p.value)&&(i=this._getOrReturnCtx(t,i),b(i,{code:z.too_big,type:"bigint",maximum:p.value,inclusive:p.inclusive,message:p.message}),d.dirty()):p.kind==="multipleOf"?t.data%p.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),b(i,{code:z.not_multiple_of,multipleOf:p.value,message:p.message}),d.dirty()):B.assertNever(p);return{status:d.value,value:t.data}}_getInvalidInput(t){let s=this._getOrReturnCtx(t);return b(s,{code:z.invalid_type,expected:C.bigint,received:s.parsedType}),I}gte(t,s){return this.setLimit("min",t,!0,R.toString(s))}gt(t,s){return this.setLimit("min",t,!1,R.toString(s))}lte(t,s){return this.setLimit("max",t,!0,R.toString(s))}lt(t,s){return this.setLimit("max",t,!1,R.toString(s))}setLimit(t,s,i,d){return new r({...this._def,checks:[...this._def.checks,{kind:t,value:s,inclusive:i,message:R.toString(d)}]})}_addCheck(t){return new r({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:R.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:R.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:R.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:R.toString(t)})}multipleOf(t,s){return this._addCheck({kind:"multipleOf",value:t,message:R.toString(s)})}get minValue(){let t=null;for(let s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t}get maxValue(){let t=null;for(let s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t}};ae.create=r=>new ae({checks:[],typeName:O.ZodBigInt,coerce:r?.coerce??!1,...w(r)});var de=class extends T{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==C.boolean){let i=this._getOrReturnCtx(t);return b(i,{code:z.invalid_type,expected:C.boolean,received:i.parsedType}),I}return E(t.data)}};de.create=r=>new de({typeName:O.ZodBoolean,coerce:r?.coerce||!1,...w(r)});var pe=class r extends T{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==C.date){let p=this._getOrReturnCtx(t);return b(p,{code:z.invalid_type,expected:C.date,received:p.parsedType}),I}if(Number.isNaN(t.data.getTime())){let p=this._getOrReturnCtx(t);return b(p,{code:z.invalid_date}),I}let i=new P,d;for(let p of this._def.checks)p.kind==="min"?t.data.getTime()<p.value&&(d=this._getOrReturnCtx(t,d),b(d,{code:z.too_small,message:p.message,inclusive:!0,exact:!1,minimum:p.value,type:"date"}),i.dirty()):p.kind==="max"?t.data.getTime()>p.value&&(d=this._getOrReturnCtx(t,d),b(d,{code:z.too_big,message:p.message,inclusive:!0,exact:!1,maximum:p.value,type:"date"}),i.dirty()):B.assertNever(p);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new r({...this._def,checks:[...this._def.checks,t]})}min(t,s){return this._addCheck({kind:"min",value:t.getTime(),message:R.toString(s)})}max(t,s){return this._addCheck({kind:"max",value:t.getTime(),message:R.toString(s)})}get minDate(){let t=null;for(let s of this._def.checks)s.kind==="min"&&(t===null||s.value>t)&&(t=s.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let s of this._def.checks)s.kind==="max"&&(t===null||s.value<t)&&(t=s.value);return t!=null?new Date(t):null}};pe.create=r=>new pe({checks:[],coerce:r?.coerce||!1,typeName:O.ZodDate,...w(r)});var Re=class extends T{_parse(t){if(this._getType(t)!==C.symbol){let i=this._getOrReturnCtx(t);return b(i,{code:z.invalid_type,expected:C.symbol,received:i.parsedType}),I}return E(t.data)}};Re.create=r=>new Re({typeName:O.ZodSymbol,...w(r)});var ce=class extends T{_parse(t){if(this._getType(t)!==C.undefined){let i=this._getOrReturnCtx(t);return b(i,{code:z.invalid_type,expected:C.undefined,received:i.parsedType}),I}return E(t.data)}};ce.create=r=>new ce({typeName:O.ZodUndefined,...w(r)});var me=class extends T{_parse(t){if(this._getType(t)!==C.null){let i=this._getOrReturnCtx(t);return b(i,{code:z.invalid_type,expected:C.null,received:i.parsedType}),I}return E(t.data)}};me.create=r=>new me({typeName:O.ZodNull,...w(r)});var ne=class extends T{constructor(){super(...arguments),this._any=!0}_parse(t){return E(t.data)}};ne.create=r=>new ne({typeName:O.ZodAny,...w(r)});var Y=class extends T{constructor(){super(...arguments),this._unknown=!0}_parse(t){return E(t.data)}};Y.create=r=>new Y({typeName:O.ZodUnknown,...w(r)});var W=class extends T{_parse(t){let s=this._getOrReturnCtx(t);return b(s,{code:z.invalid_type,expected:C.never,received:s.parsedType}),I}};W.create=r=>new W({typeName:O.ZodNever,...w(r)});var Ie=class extends T{_parse(t){if(this._getType(t)!==C.undefined){let i=this._getOrReturnCtx(t);return b(i,{code:z.invalid_type,expected:C.void,received:i.parsedType}),I}return E(t.data)}};Ie.create=r=>new Ie({typeName:O.ZodVoid,...w(r)});var X=class r extends T{_parse(t){let{ctx:s,status:i}=this._processInputParams(t),d=this._def;if(s.parsedType!==C.array)return b(s,{code:z.invalid_type,expected:C.array,received:s.parsedType}),I;if(d.exactLength!==null){let l=s.data.length>d.exactLength.value,f=s.data.length<d.exactLength.value;(l||f)&&(b(s,{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}),i.dirty())}if(d.minLength!==null&&s.data.length<d.minLength.value&&(b(s,{code:z.too_small,minimum:d.minLength.value,type:"array",inclusive:!0,exact:!1,message:d.minLength.message}),i.dirty()),d.maxLength!==null&&s.data.length>d.maxLength.value&&(b(s,{code:z.too_big,maximum:d.maxLength.value,type:"array",inclusive:!0,exact:!1,message:d.maxLength.message}),i.dirty()),s.common.async)return Promise.all([...s.data].map((l,f)=>d.type._parseAsync(new G(s,l,s.path,f)))).then(l=>P.mergeArray(i,l));let p=[...s.data].map((l,f)=>d.type._parseSync(new G(s,l,s.path,f)));return P.mergeArray(i,p)}get element(){return this._def.type}min(t,s){return new r({...this._def,minLength:{value:t,message:R.toString(s)}})}max(t,s){return new r({...this._def,maxLength:{value:t,message:R.toString(s)}})}length(t,s){return new r({...this._def,exactLength:{value:t,message:R.toString(s)}})}nonempty(t){return this.min(1,t)}};X.create=(r,t)=>new X({type:r,minLength:null,maxLength:null,exactLength:null,typeName:O.ZodArray,...w(t)});function ve(r){if(r instanceof A){let t={};for(let s in r.shape){let i=r.shape[s];t[s]=F.create(ve(i))}return new A({...r._def,shape:()=>t})}else return r instanceof X?new X({...r._def,type:ve(r.element)}):r instanceof F?F.create(ve(r.unwrap())):r instanceof Z?Z.create(ve(r.unwrap())):r instanceof H?H.create(r.items.map(t=>ve(t))):r}var A=class r extends T{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),s=B.objectKeys(t);return this._cached={shape:t,keys:s},this._cached}_parse(t){if(this._getType(t)!==C.object){let S=this._getOrReturnCtx(t);return b(S,{code:z.invalid_type,expected:C.object,received:S.parsedType}),I}let{status:i,ctx:d}=this._processInputParams(t),{shape:p,keys:l}=this._getCached(),f=[];if(!(this._def.catchall instanceof W&&this._def.unknownKeys==="strip"))for(let S in d.data)l.includes(S)||f.push(S);let y=[];for(let S of l){let k=p[S],M=d.data[S];y.push({key:{status:"valid",value:S},value:k._parse(new G(d,M,d.path,S)),alwaysSet:S in d.data})}if(this._def.catchall instanceof W){let S=this._def.unknownKeys;if(S==="passthrough")for(let k of f)y.push({key:{status:"valid",value:k},value:{status:"valid",value:d.data[k]}});else if(S==="strict")f.length>0&&(b(d,{code:z.unrecognized_keys,keys:f}),i.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 M=d.data[k];y.push({key:{status:"valid",value:k},value:S._parse(new G(d,M,d.path,k)),alwaysSet:k in d.data})}}return d.common.async?Promise.resolve().then(async()=>{let S=[];for(let k of y){let M=await k.key,D=await k.value;S.push({key:M,value:D,alwaysSet:k.alwaysSet})}return S}).then(S=>P.mergeObjectSync(i,S)):P.mergeObjectSync(i,y)}get shape(){return this._def.shape()}strict(t){return R.errToObj,new r({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(s,i)=>{let d=this._def.errorMap?.(s,i).message??i.defaultError;return s.code==="unrecognized_keys"?{message:R.errToObj(t).message??d}:{message:d}}}:{}})}strip(){return new r({...this._def,unknownKeys:"strip"})}passthrough(){return new r({...this._def,unknownKeys:"passthrough"})}extend(t){return new r({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new r({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:O.ZodObject})}setKey(t,s){return this.augment({[t]:s})}catchall(t){return new r({...this._def,catchall:t})}pick(t){let s={};for(let i of B.objectKeys(t))t[i]&&this.shape[i]&&(s[i]=this.shape[i]);return new r({...this._def,shape:()=>s})}omit(t){let s={};for(let i of B.objectKeys(this.shape))t[i]||(s[i]=this.shape[i]);return new r({...this._def,shape:()=>s})}deepPartial(){return ve(this)}partial(t){let s={};for(let i of B.objectKeys(this.shape)){let d=this.shape[i];t&&!t[i]?s[i]=d:s[i]=d.optional()}return new r({...this._def,shape:()=>s})}required(t){let s={};for(let i of B.objectKeys(this.shape))if(t&&!t[i])s[i]=this.shape[i];else{let p=this.shape[i];for(;p instanceof F;)p=p._def.innerType;s[i]=p}return new r({...this._def,shape:()=>s})}keyof(){return et(B.objectKeys(this.shape))}};A.create=(r,t)=>new A({shape:()=>r,unknownKeys:"strip",catchall:W.create(),typeName:O.ZodObject,...w(t)});A.strictCreate=(r,t)=>new A({shape:()=>r,unknownKeys:"strict",catchall:W.create(),typeName:O.ZodObject,...w(t)});A.lazycreate=(r,t)=>new A({shape:r,unknownKeys:"strip",catchall:W.create(),typeName:O.ZodObject,...w(t)});var le=class extends T{_parse(t){let{ctx:s}=this._processInputParams(t),i=this._def.options;function d(p){for(let f of p)if(f.result.status==="valid")return f.result;for(let f of p)if(f.result.status==="dirty")return s.common.issues.push(...f.ctx.common.issues),f.result;let l=p.map(f=>new _(f.ctx.common.issues));return b(s,{code:z.invalid_union,unionErrors:l}),I}if(s.common.async)return Promise.all(i.map(async p=>{let l={...s,common:{...s.common,issues:[]},parent:null};return{result:await p._parseAsync({data:s.data,path:s.path,parent:l}),ctx:l}})).then(d);{let p,l=[];for(let y of i){let S={...s,common:{...s.common,issues:[]},parent:null},k=y._parseSync({data:s.data,path:s.path,parent:S});if(k.status==="valid")return k;k.status==="dirty"&&!p&&(p={result:k,ctx:S}),S.common.issues.length&&l.push(S.common.issues)}if(p)return s.common.issues.push(...p.ctx.common.issues),p.result;let f=l.map(y=>new _(y));return b(s,{code:z.invalid_union,unionErrors:f}),I}}get options(){return this._def.options}};le.create=(r,t)=>new le({options:r,typeName:O.ZodUnion,...w(t)});var J=r=>r instanceof fe?J(r.schema):r instanceof U?J(r.innerType()):r instanceof ge?[r.value]:r instanceof he?r.options:r instanceof ze?B.objectValues(r.enum):r instanceof xe?J(r._def.innerType):r instanceof ce?[void 0]:r instanceof me?[null]:r instanceof F?[void 0,...J(r.unwrap())]:r instanceof Z?[null,...J(r.unwrap())]:r instanceof Pe||r instanceof be?J(r.unwrap()):r instanceof ye?J(r._def.innerType):[],Fe=class r extends T{_parse(t){let{ctx:s}=this._processInputParams(t);if(s.parsedType!==C.object)return b(s,{code:z.invalid_type,expected:C.object,received:s.parsedType}),I;let i=this.discriminator,d=s.data[i],p=this.optionsMap.get(d);return p?s.common.async?p._parseAsync({data:s.data,path:s.path,parent:s}):p._parseSync({data:s.data,path:s.path,parent:s}):(b(s,{code:z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),I)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,s,i){let d=new Map;for(let p of s){let l=J(p.shape[t]);if(!l.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let f of l){if(d.has(f))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(f)}`);d.set(f,p)}}return new r({typeName:O.ZodDiscriminatedUnion,discriminator:t,options:s,optionsMap:d,...w(i)})}};function He(r,t){let s=$(r),i=$(t);if(r===t)return{valid:!0,data:r};if(s===C.object&&i===C.object){let d=B.objectKeys(t),p=B.objectKeys(r).filter(f=>d.indexOf(f)!==-1),l={...r,...t};for(let f of p){let y=He(r[f],t[f]);if(!y.valid)return{valid:!1};l[f]=y.data}return{valid:!0,data:l}}else if(s===C.array&&i===C.array){if(r.length!==t.length)return{valid:!1};let d=[];for(let p=0;p<r.length;p++){let l=r[p],f=t[p],y=He(l,f);if(!y.valid)return{valid:!1};d.push(y.data)}return{valid:!0,data:d}}else return s===C.date&&i===C.date&&+r==+t?{valid:!0,data:r}:{valid:!1}}var ue=class extends T{_parse(t){let{status:s,ctx:i}=this._processInputParams(t),d=(p,l)=>{if(qe(p)||qe(l))return I;let f=He(p.value,l.value);return f.valid?((Ne(p)||Ne(l))&&s.dirty(),{status:s.value,value:f.data}):(b(i,{code:z.invalid_intersection_types}),I)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([p,l])=>d(p,l)):d(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};ue.create=(r,t,s)=>new ue({left:r,right:t,typeName:O.ZodIntersection,...w(s)});var H=class r extends T{_parse(t){let{status:s,ctx:i}=this._processInputParams(t);if(i.parsedType!==C.array)return b(i,{code:z.invalid_type,expected:C.array,received:i.parsedType}),I;if(i.data.length<this._def.items.length)return b(i,{code:z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),I;!this._def.rest&&i.data.length>this._def.items.length&&(b(i,{code:z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());let p=[...i.data].map((l,f)=>{let y=this._def.items[f]||this._def.rest;return y?y._parse(new G(i,l,i.path,f)):null}).filter(l=>!!l);return i.common.async?Promise.all(p).then(l=>P.mergeArray(s,l)):P.mergeArray(s,p)}get items(){return this._def.items}rest(t){return new r({...this._def,rest:t})}};H.create=(r,t)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new H({items:r,typeName:O.ZodTuple,rest:null,...w(t)})};var Ge=class r extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:s,ctx:i}=this._processInputParams(t);if(i.parsedType!==C.object)return b(i,{code:z.invalid_type,expected:C.object,received:i.parsedType}),I;let d=[],p=this._def.keyType,l=this._def.valueType;for(let f in i.data)d.push({key:p._parse(new G(i,f,i.path,f)),value:l._parse(new G(i,i.data[f],i.path,f)),alwaysSet:f in i.data});return i.common.async?P.mergeObjectAsync(s,d):P.mergeObjectSync(s,d)}get element(){return this._def.valueType}static create(t,s,i){return s instanceof T?new r({keyType:t,valueType:s,typeName:O.ZodRecord,...w(i)}):new r({keyType:te.create(),valueType:t,typeName:O.ZodRecord,...w(s)})}},ke=class extends T{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:s,ctx:i}=this._processInputParams(t);if(i.parsedType!==C.map)return b(i,{code:z.invalid_type,expected:C.map,received:i.parsedType}),I;let d=this._def.keyType,p=this._def.valueType,l=[...i.data.entries()].map(([f,y],S)=>({key:d._parse(new G(i,f,i.path,[S,"key"])),value:p._parse(new G(i,y,i.path,[S,"value"]))}));if(i.common.async){let f=new Map;return Promise.resolve().then(async()=>{for(let y of l){let S=await y.key,k=await y.value;if(S.status==="aborted"||k.status==="aborted")return I;(S.status==="dirty"||k.status==="dirty")&&s.dirty(),f.set(S.value,k.value)}return{status:s.value,value:f}})}else{let f=new Map;for(let y of l){let S=y.key,k=y.value;if(S.status==="aborted"||k.status==="aborted")return I;(S.status==="dirty"||k.status==="dirty")&&s.dirty(),f.set(S.value,k.value)}return{status:s.value,value:f}}}};ke.create=(r,t,s)=>new ke({valueType:t,keyType:r,typeName:O.ZodMap,...w(s)});var Oe=class r extends T{_parse(t){let{status:s,ctx:i}=this._processInputParams(t);if(i.parsedType!==C.set)return b(i,{code:z.invalid_type,expected:C.set,received:i.parsedType}),I;let d=this._def;d.minSize!==null&&i.data.size<d.minSize.value&&(b(i,{code:z.too_small,minimum:d.minSize.value,type:"set",inclusive:!0,exact:!1,message:d.minSize.message}),s.dirty()),d.maxSize!==null&&i.data.size>d.maxSize.value&&(b(i,{code:z.too_big,maximum:d.maxSize.value,type:"set",inclusive:!0,exact:!1,message:d.maxSize.message}),s.dirty());let p=this._def.valueType;function l(y){let S=new Set;for(let k of y){if(k.status==="aborted")return I;k.status==="dirty"&&s.dirty(),S.add(k.value)}return{status:s.value,value:S}}let f=[...i.data.values()].map((y,S)=>p._parse(new G(i,y,i.path,S)));return i.common.async?Promise.all(f).then(y=>l(y)):l(f)}min(t,s){return new r({...this._def,minSize:{value:t,message:R.toString(s)}})}max(t,s){return new r({...this._def,maxSize:{value:t,message:R.toString(s)}})}size(t,s){return this.min(t,s).max(t,s)}nonempty(t){return this.min(1,t)}};Oe.create=(r,t)=>new Oe({valueType:r,minSize:null,maxSize:null,typeName:O.ZodSet,...w(t)});var Ue=class r extends T{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:s}=this._processInputParams(t);if(s.parsedType!==C.function)return b(s,{code:z.invalid_type,expected:C.function,received:s.parsedType}),I;function i(f,y){return je({data:f,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,Se(),V].filter(S=>!!S),issueData:{code:z.invalid_arguments,argumentsError:y}})}function d(f,y){return je({data:f,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,Se(),V].filter(S=>!!S),issueData:{code:z.invalid_return_type,returnTypeError:y}})}let p={errorMap:s.common.contextualErrorMap},l=s.data;if(this._def.returns instanceof re){let f=this;return E(async function(...y){let S=new _([]),k=await f._def.args.parseAsync(y,p).catch(Q=>{throw S.addIssue(i(y,Q)),S}),M=await Reflect.apply(l,this,k);return await f._def.returns._def.type.parseAsync(M,p).catch(Q=>{throw S.addIssue(d(M,Q)),S})})}else{let f=this;return E(function(...y){let S=f._def.args.safeParse(y,p);if(!S.success)throw new _([i(y,S.error)]);let k=Reflect.apply(l,this,S.data),M=f._def.returns.safeParse(k,p);if(!M.success)throw new _([d(k,M.error)]);return M.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new r({...this._def,args:H.create(t).rest(Y.create())})}returns(t){return new r({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,s,i){return new r({args:t||H.create([]).rest(Y.create()),returns:s||Y.create(),typeName:O.ZodFunction,...w(i)})}},fe=class extends T{get schema(){return this._def.getter()}_parse(t){let{ctx:s}=this._processInputParams(t);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}};fe.create=(r,t)=>new fe({getter:r,typeName:O.ZodLazy,...w(t)});var ge=class extends T{_parse(t){if(t.data!==this._def.value){let s=this._getOrReturnCtx(t);return b(s,{received:s.data,code:z.invalid_literal,expected:this._def.value}),I}return{status:"valid",value:t.data}}get value(){return this._def.value}};ge.create=(r,t)=>new ge({value:r,typeName:O.ZodLiteral,...w(t)});function et(r,t){return new he({values:r,typeName:O.ZodEnum,...w(t)})}var he=class r extends T{_parse(t){if(typeof t.data!="string"){let s=this._getOrReturnCtx(t),i=this._def.values;return b(s,{expected:B.joinValues(i),received:s.parsedType,code:z.invalid_type}),I}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let s=this._getOrReturnCtx(t),i=this._def.values;return b(s,{received:s.data,code:z.invalid_enum_value,options:i}),I}return E(t.data)}get options(){return this._def.values}get enum(){let t={};for(let s of this._def.values)t[s]=s;return t}get Values(){let t={};for(let s of this._def.values)t[s]=s;return t}get Enum(){let t={};for(let s of this._def.values)t[s]=s;return t}extract(t,s=this._def){return r.create(t,{...this._def,...s})}exclude(t,s=this._def){return r.create(this.options.filter(i=>!t.includes(i)),{...this._def,...s})}};he.create=et;var ze=class extends T{_parse(t){let s=B.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==C.string&&i.parsedType!==C.number){let d=B.objectValues(s);return b(i,{expected:B.joinValues(d),received:i.parsedType,code:z.invalid_type}),I}if(this._cache||(this._cache=new Set(B.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let d=B.objectValues(s);return b(i,{received:i.data,code:z.invalid_enum_value,options:d}),I}return E(t.data)}get enum(){return this._def.values}};ze.create=(r,t)=>new ze({values:r,typeName:O.ZodNativeEnum,...w(t)});var re=class extends T{unwrap(){return this._def.type}_parse(t){let{ctx:s}=this._processInputParams(t);if(s.parsedType!==C.promise&&s.common.async===!1)return b(s,{code:z.invalid_type,expected:C.promise,received:s.parsedType}),I;let i=s.parsedType===C.promise?s.data:Promise.resolve(s.data);return E(i.then(d=>this._def.type.parseAsync(d,{path:s.path,errorMap:s.common.contextualErrorMap})))}};re.create=(r,t)=>new re({type:r,typeName:O.ZodPromise,...w(t)});var U=class extends T{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===O.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:s,ctx:i}=this._processInputParams(t),d=this._def.effect||null,p={addIssue:l=>{b(i,l),l.fatal?s.abort():s.dirty()},get path(){return i.path}};if(p.addIssue=p.addIssue.bind(p),d.type==="preprocess"){let l=d.transform(i.data,p);if(i.common.async)return Promise.resolve(l).then(async f=>{if(s.value==="aborted")return I;let y=await this._def.schema._parseAsync({data:f,path:i.path,parent:i});return y.status==="aborted"?I:y.status==="dirty"?se(y.value):s.value==="dirty"?se(y.value):y});{if(s.value==="aborted")return I;let f=this._def.schema._parseSync({data:l,path:i.path,parent:i});return f.status==="aborted"?I:f.status==="dirty"?se(f.value):s.value==="dirty"?se(f.value):f}}if(d.type==="refinement"){let l=f=>{let y=d.refinement(f,p);if(i.common.async)return Promise.resolve(y);if(y instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return f};if(i.common.async===!1){let f=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return f.status==="aborted"?I:(f.status==="dirty"&&s.dirty(),l(f.value),{status:s.value,value:f.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(f=>f.status==="aborted"?I:(f.status==="dirty"&&s.dirty(),l(f.value).then(()=>({status:s.value,value:f.value}))))}if(d.type==="transform")if(i.common.async===!1){let l=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!oe(l))return I;let f=d.transform(l.value,p);if(f instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:f}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(l=>oe(l)?Promise.resolve(d.transform(l.value,p)).then(f=>({status:s.value,value:f})):I);B.assertNever(d)}};U.create=(r,t,s)=>new U({schema:r,typeName:O.ZodEffects,effect:t,...w(s)});U.createWithPreprocess=(r,t,s)=>new U({schema:t,effect:{type:"preprocess",transform:r},typeName:O.ZodEffects,...w(s)});var F=class extends T{_parse(t){return this._getType(t)===C.undefined?E(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};F.create=(r,t)=>new F({innerType:r,typeName:O.ZodOptional,...w(t)});var Z=class extends T{_parse(t){return this._getType(t)===C.null?E(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Z.create=(r,t)=>new Z({innerType:r,typeName:O.ZodNullable,...w(t)});var xe=class extends T{_parse(t){let{ctx:s}=this._processInputParams(t),i=s.data;return s.parsedType===C.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:s.path,parent:s})}removeDefault(){return this._def.innerType}};xe.create=(r,t)=>new xe({innerType:r,typeName:O.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...w(t)});var ye=class extends T{_parse(t){let{ctx:s}=this._processInputParams(t),i={...s,common:{...s.common,issues:[]}},d=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Ce(d)?d.then(p=>({status:"valid",value:p.status==="valid"?p.value:this._def.catchValue({get error(){return new _(i.common.issues)},input:i.data})})):{status:"valid",value:d.status==="valid"?d.value:this._def.catchValue({get error(){return new _(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};ye.create=(r,t)=>new ye({innerType:r,typeName:O.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...w(t)});var we=class extends T{_parse(t){if(this._getType(t)!==C.nan){let i=this._getOrReturnCtx(t);return b(i,{code:z.invalid_type,expected:C.nan,received:i.parsedType}),I}return{status:"valid",value:t.data}}};we.create=r=>new we({typeName:O.ZodNaN,...w(r)});var Jn=Symbol("zod_brand"),Pe=class extends T{_parse(t){let{ctx:s}=this._processInputParams(t),i=s.data;return this._def.type._parse({data:i,path:s.path,parent:s})}unwrap(){return this._def.type}},Ee=class r extends T{_parse(t){let{status:s,ctx:i}=this._processInputParams(t);if(i.common.async)return(async()=>{let p=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return p.status==="aborted"?I:p.status==="dirty"?(s.dirty(),se(p.value)):this._def.out._parseAsync({data:p.value,path:i.path,parent:i})})();{let d=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return d.status==="aborted"?I:d.status==="dirty"?(s.dirty(),{status:"dirty",value:d.value}):this._def.out._parseSync({data:d.value,path:i.path,parent:i})}}static create(t,s){return new r({in:t,out:s,typeName:O.ZodPipeline})}},be=class extends T{_parse(t){let s=this._def.innerType._parse(t),i=d=>(oe(d)&&(d.value=Object.freeze(d.value)),d);return Ce(s)?s.then(d=>i(d)):i(s)}unwrap(){return this._def.innerType}};be.create=(r,t)=>new be({innerType:r,typeName:O.ZodReadonly,...w(t)});function Jo(r,t){let s=typeof r=="function"?r(t):typeof r=="string"?{message:r}:r;return typeof s=="string"?{message:s}:s}function ot(r,t={},s){return r?ne.create().superRefine((i,d)=>{let p=r(i);if(p instanceof Promise)return p.then(l=>{if(!l){let f=Jo(t,i),y=f.fatal??s??!0;d.addIssue({code:"custom",...f,fatal:y})}});if(!p){let l=Jo(t,i),f=l.fatal??s??!0;d.addIssue({code:"custom",...l,fatal:f})}}):ne.create()}var Yn={object:A.lazycreate},O;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(O||(O={}));var Xn=(r,t={message:`Input not instance of ${r.name}`})=>ot(s=>s instanceof r,t),e=te.create,o=ie.create,Qn=we.create,er=ae.create,h=de.create,or=pe.create,tr=Re.create,nr=ce.create,L=me.create,rr=ne.create,g=Y.create,sr=W.create,ir=Ie.create,c=X.create,n=A.create,ar=A.strictCreate,x=le.create,dr=Fe.create,pr=ue.create,cr=H.create,u=Ge.create,mr=ke.create,lr=Oe.create,ur=Ue.create,fr=fe.create,m=ge.create,a=he.create,gr=ze.create,hr=re.create,zr=U.create,xr=F.create,yr=Z.create,br=U.createWithPreprocess,Sr=Ee.create,Cr=()=>e().optional(),vr=()=>o().optional(),Rr=()=>h().optional(),Ir={string:(r=>te.create({...r,coerce:!0})),number:(r=>ie.create({...r,coerce:!0})),boolean:(r=>de.create({...r,coerce:!0})),bigint:(r=>ae.create({...r,coerce:!0})),date:(r=>pe.create({...r,coerce:!0}))};var kr=I;var Yy=n({name:e().min(1),permissions:n({media:c(a(["read","write"])).min(1).optional(),sessions:c(a(["read","write"])).min(1).optional(),projects:c(a(["read","write"])).min(1).optional(),renders:c(a(["read","write"])).min(1).optional(),webhooks:c(a(["read","write"])).min(1).optional(),billing:c(a(["read","write"])).min(1).optional()}).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.")});var Qy=n({data:c(n({featureId:e().describe("The metered plan feature (exports, compose, compose_verify, \u2026)."),value:o().optional().describe("Metered amount (absent = one discrete use)."),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:n({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}),eb=n({plans:c(n({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 ob=n({plan:a(["pro","business","studio"]).describe("Plan tier to subscribe to."),interval:a(["month","year"]).describe("Billing interval: 'month' (monthly) or 'year' (annual, ~2 months free).")}),tb=n({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 rb=n({data:c(n({id:e(),name:e(),description:e().nullable(),tagline:e().nullable(),colors:u(e(),e()),extraColors:c(n({name:e(),value:e()})).optional(),fonts:n({heading:n({family:e(),weight:x([o(),e()]).optional()}).nullable(),body:n({family:e(),weight:x([o(),e()]).optional()}).nullable()}),voiceGuidelines:e().nullable(),captions:n({sync:h(),profile:u(e(),g()).nullable()}),motion:n({duration:o().optional(),easing:x([a(["linear","ease","ease-in","ease-out","ease-in-out"]),n({kind:m("cubic-bezier"),x1:o(),y1:o(),x2:o(),y2:o()})]).optional(),entrance:a(["none","fade","word-pop","stagger-up"]).optional(),staggerMs:o().optional(),exitMs:o().optional()}).optional(),logo:n({src:e(),alt:e().optional(),placement:a(["tl","tr","bl","br"]).optional(),sizePct:o().optional()}).optional(),intro:n({kind:a(["card","video"]),src:e().optional(),title:e().optional(),subtitle:e().optional(),durationMs:o().optional()}).optional(),outro:n({kind:a(["card","video"]),src:e().optional(),title:e().optional(),subtitle:e().optional(),durationMs:o().optional()}).optional(),watermark:n({src:e(),opacity:o().optional(),placement:a(["tl","tr","bl","br"]).optional()}).optional(),spacing:n({base:o().optional(),lg:o().optional(),sm:o().optional()}).optional(),sizing:n({fontSizeHeading:o().optional(),fontSizeBody:o().optional(),fontSizeLabel:o().optional(),borderRadius:o().optional()}).optional(),createdAt:e(),updatedAt:e()}).describe("Brand kit response per \xA7Brand Kits.")),pagination:n({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}),Or=200,wr=200,Tr=2e3,Br=500,Mr=500,jr=5e3,Pr=0,Er=1,sb=n({kitId:e().min(1).max(Or),name:e().min(1).max(wr),description:e().max(Tr).optional(),tagline:e().max(Br).optional(),secondaryTagline:e().max(Mr).optional(),colors:n({primary:e().min(1),secondary:e().min(1),accent:e().min(1),background:e().min(1),text:e().min(1)}),extraColors:c(n({hex:e().min(1),label:e().min(1),usage:e().optional()})).optional(),headingFont:n({fontFamily:e().min(1),fontWeight:o()}),bodyFont:n({fontFamily:e().min(1),fontWeight:o()}),voiceGuidelines:e().max(jr).optional(),syncCaptions:h().optional(),captionProfile:n({fontFamily:e().optional(),fontSize:o().optional(),fontWeight:o().optional(),color:e().optional(),highlightColor:e().optional(),backgroundColor:e().optional(),position:a(["top","center","bottom"]).optional(),textTransform:a(["none","uppercase"]).optional(),emphasisColor:e().optional(),emphasisScale:o().optional(),emphasisFontFamily:e().optional(),emphasisFontWeight:o().optional(),emphasisTextTransform:a(["none","uppercase"]).optional(),emphasisLetterSpacing:o().optional()}).optional(),motion:n({duration:o().optional(),easing:x([a(["linear","ease","ease-in","ease-out","ease-in-out"]),n({kind:m("cubic-bezier"),x1:o(),y1:o(),x2:o(),y2:o()})]).optional(),entrance:a(["none","fade","word-pop","stagger-up"]).optional(),staggerMs:o().optional(),exitMs:o().optional()}).optional(),logo:n({src:e().min(1),alt:e().optional(),placement:a(["tl","tr","bl","br"]).optional(),sizePct:o().optional()}).optional(),intro:n({kind:a(["card","video"]),src:e().min(1).optional(),title:e().optional(),subtitle:e().optional(),durationMs:o().optional()}).optional(),outro:n({kind:a(["card","video"]),src:e().min(1).optional(),title:e().optional(),subtitle:e().optional(),durationMs:o().optional()}).optional(),watermark:n({src:e().min(1),opacity:o().min(Pr).max(Er).optional(),placement:a(["tl","tr","bl","br"]).optional()}).optional(),spacing:n({base:o().optional(),lg:o().optional(),sm:o().optional()}).optional(),sizing:n({fontSizeHeading:o().optional(),fontSizeBody:o().optional(),fontSizeLabel:o().optional(),borderRadius:o().optional()}).optional()}).describe("POST /brand-kits body. Org/user are server-resolved; never accepted from the body."),ib=n({url:e().url()}).describe("POST /brand-kits/extract body \u2014 the website URL to extract brand tokens from."),ab=n({id:e()}),db=n({id:e(),name:e(),description:e().nullable(),tagline:e().nullable(),colors:u(e(),e()),extraColors:c(n({name:e(),value:e()})).optional(),fonts:n({heading:n({family:e(),weight:x([o(),e()]).optional()}).nullable(),body:n({family:e(),weight:x([o(),e()]).optional()}).nullable()}),voiceGuidelines:e().nullable(),captions:n({sync:h(),profile:u(e(),g()).nullable()}),motion:n({duration:o().optional(),easing:x([a(["linear","ease","ease-in","ease-out","ease-in-out"]),n({kind:m("cubic-bezier"),x1:o(),y1:o(),x2:o(),y2:o()})]).optional(),entrance:a(["none","fade","word-pop","stagger-up"]).optional(),staggerMs:o().optional(),exitMs:o().optional()}).optional(),logo:n({src:e(),alt:e().optional(),placement:a(["tl","tr","bl","br"]).optional(),sizePct:o().optional()}).optional(),intro:n({kind:a(["card","video"]),src:e().optional(),title:e().optional(),subtitle:e().optional(),durationMs:o().optional()}).optional(),outro:n({kind:a(["card","video"]),src:e().optional(),title:e().optional(),subtitle:e().optional(),durationMs:o().optional()}).optional(),watermark:n({src:e(),opacity:o().optional(),placement:a(["tl","tr","bl","br"]).optional()}).optional(),spacing:n({base:o().optional(),lg:o().optional(),sm:o().optional()}).optional(),sizing:n({fontSizeHeading:o().optional(),fontSizeBody:o().optional(),fontSizeLabel:o().optional(),borderRadius:o().optional()}).optional(),createdAt:e(),updatedAt:e()}).describe("Brand kit response per \xA7Brand Kits.");var _r=200,Ar=2e3,qr=500,Nr=100,Fr=3600,Gr=500,Ur=500,Dr=35,Wr=500,Lr=2e3,Kr=0,$r=24,Hr=24,Zr=12,Vr=24,Jr=0,Yr=0,Xr=0,Qr=0,es=0,os=0,ts=4,ns=0,rs=0,ss=0,is=0,as=1,ds=0,ps=1;var cs=.1,ms=1,ls=0,us=0,fs=-.3,gs=.3,hs=-.3,zs=.3,xs=0,ys=1,bs=0,Ss=1,Cs=-.3,vs=.3,Rs=0,Is=1,ks=0,Os=1,ws=0,Ts=1,Bs=1,Ms=1,js=16,Ps=8,Es=3,cb=n({projectId:e().min(1),name:e().max(_r).optional(),goal:e().min(1).max(Ar).describe("What the video must accomplish."),audience:e().max(qr).optional(),platform:e().max(Nr).optional(),format:n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["hd","fhd","4k"]).optional()}).optional().describe("Output-format spec per \xA7Format."),durationSec:o().max(Fr).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(Gr).optional(),cta:e().max(Ur).optional(),locale:e().max(Dr).optional().describe("Output language (BCP-47 tag, e.g. 'es-419'): ALL on-screen copy + captions."),hook:e().max(Wr).optional(),caption:e().max(Lr).optional(),beats:c(n({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:n({mediaId:e().min(1),startSec:o().min(Kr),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).")})).max($r).optional(),mustIncludes:c(e().min(1)).max(Hr).optional(),references:c(e()).max(Zr).optional(),captions:n({styleId:e().min(1).optional().describe("Caption style id (e.g. 'serif-emphasis@1')."),emphasisPhrases:c(e().min(1)).max(Vr).optional().describe("Phrases rendered in the caption EMPHASIS style (the big-serif treatment). Matched against the transcript; drives CaptionWord.emphasis.")}).optional(),motionStyle:n({textAnimation:e().optional(),transitions:e().optional(),colorMood:e().optional(),captionStyle:e().optional()}).optional(),seededGraphics:c(n({id:e().min(1),startTime:o().min(Jr),duration:o(),source:x([n({kind:m("media"),mediaId:e().min(1),trim:n({start:o().min(Yr),end:o().min(Xr)}).optional(),excludedRanges:c(n({start:o().min(Qr),end:o().min(es),reason:e().optional()})).optional(),volume:o().min(os).max(ts).optional(),muted:h().optional(),playbackRate:o().optional(),sync:a(["video","independent"]).optional(),kenBurns:a(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(ns).optional(),fadeOutMs:o().min(rs).optional(),loop:h().optional(),reframe:n({segments:c(n({startSec:o().min(ss).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([n({mode:m("frame-center")}),n({mode:m("point"),x:o().min(is).max(as),y:o().min(ds).max(ps)}),n({mode:m("face"),faceId:e().min(1),shotScale:a(["close","standard","wide"]).optional()}),n({mode:m("all-faces")}),n({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(cs).max(ms).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). Default 1."),ease:n({in:o().min(ls).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(us).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:n({x:o().min(fs).max(gs).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(hs).max(zs).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()}),n({kind:m("component"),componentId:e().min(1),props:u(e(),g())}),n({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:a(["front","behind-subject"]).optional(),anchor:n({space:m("scene"),x:o().min(xs).max(ys),y:o().min(bs).max(Ss)}).optional(),parallax:o().min(Cs).max(vs).optional()}),n({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}),n({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()})]),kind:a(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(Rs).max(Is).optional(),scale:o().optional(),rotation:o().optional(),position:n({x:o(),y:o()}).optional(),region:n({x:o().min(ks).max(Os),y:o().min(ws).max(Ts),w:o().max(Bs),h:o().max(Ms)}).optional(),fit:a(["cover","contain"]).optional(),effects:c(n({primitiveId:e().min(1),params:u(e(),g()).optional()})).optional(),transitionIn:n({type:e().min(1),duration:o()}).optional()})).max(js).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:c(a(["overlay","component","card","no-transitions"])).max(Ps).optional(),gates:n({holdAt:c(a(["content","layout","motion"])).max(Es).optional().describe("Checkpoint gates \u2014 the compose pauses at each named stage for review via resume."),autoApprove:h().optional().describe("true = fully autonomous (compose runs with NO gates \u2014 the headless mode). Mutually exclusive with a non-empty holdAt."),reviewMode:a(["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()}),_s=200,As=2e3,qs=500,Ns=100,Fs=3600,Gs=500,Us=500,Ds=35,Ws=500,Ls=2e3,Ks=0,$s=24,Hs=24,Zs=12,Vs=24,Js=0,Ys=0,Xs=0,Qs=0,ei=0,oi=0,ti=4,ni=0,ri=0,si=0,ii=0,ai=1,di=0,pi=1;var ci=.1,mi=1,li=0,ui=0,fi=-.3,gi=.3,hi=-.3,zi=.3,xi=0,yi=1,bi=0,Si=1,Ci=-.3,vi=.3,Ri=0,Ii=1,ki=0,Oi=1,wi=0,Ti=1,Bi=1,Mi=1,ji=16,Pi=8,Ei=3,mb=n({data:c(n({id:e(),projectId:e(),kind:a(["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(_s).optional(),goal:e().min(1).max(As).describe("What the video must accomplish."),audience:e().max(qs).optional(),platform:e().max(Ns).optional(),format:n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["hd","fhd","4k"]).optional()}).optional().describe("Output-format spec per \xA7Format."),durationSec:o().max(Fs).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(Gs).optional(),cta:e().max(Us).optional(),locale:e().max(Ds).optional().describe("Output language (BCP-47 tag, e.g. 'es-419'): ALL on-screen copy + captions."),hook:e().max(Ws).optional(),caption:e().max(Ls).optional(),beats:c(n({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:n({mediaId:e().min(1),startSec:o().min(Ks),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).")})).max($s).optional(),mustIncludes:c(e().min(1)).max(Hs).optional(),references:c(e()).max(Zs).optional(),captions:n({styleId:e().min(1).optional().describe("Caption style id (e.g. 'serif-emphasis@1')."),emphasisPhrases:c(e().min(1)).max(Vs).optional().describe("Phrases rendered in the caption EMPHASIS style (the big-serif treatment). Matched against the transcript; drives CaptionWord.emphasis.")}).optional(),motionStyle:n({textAnimation:e().optional(),transitions:e().optional(),colorMood:e().optional(),captionStyle:e().optional()}).optional(),seededGraphics:c(n({id:e().min(1),startTime:o().min(Js),duration:o(),source:x([n({kind:m("media"),mediaId:e().min(1),trim:n({start:o().min(Ys),end:o().min(Xs)}).optional(),excludedRanges:c(n({start:o().min(Qs),end:o().min(ei),reason:e().optional()})).optional(),volume:o().min(oi).max(ti).optional(),muted:h().optional(),playbackRate:o().optional(),sync:a(["video","independent"]).optional(),kenBurns:a(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(ni).optional(),fadeOutMs:o().min(ri).optional(),loop:h().optional(),reframe:n({segments:c(n({startSec:o().min(si).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([n({mode:m("frame-center")}),n({mode:m("point"),x:o().min(ii).max(ai),y:o().min(di).max(pi)}),n({mode:m("face"),faceId:e().min(1),shotScale:a(["close","standard","wide"]).optional()}),n({mode:m("all-faces")}),n({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(ci).max(mi).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). Default 1."),ease:n({in:o().min(li).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(ui).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:n({x:o().min(fi).max(gi).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(hi).max(zi).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()}),n({kind:m("component"),componentId:e().min(1),props:u(e(),g())}),n({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:a(["front","behind-subject"]).optional(),anchor:n({space:m("scene"),x:o().min(xi).max(yi),y:o().min(bi).max(Si)}).optional(),parallax:o().min(Ci).max(vi).optional()}),n({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}),n({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()})]),kind:a(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(Ri).max(Ii).optional(),scale:o().optional(),rotation:o().optional(),position:n({x:o(),y:o()}).optional(),region:n({x:o().min(ki).max(Oi),y:o().min(wi).max(Ti),w:o().max(Bi),h:o().max(Mi)}).optional(),fit:a(["cover","contain"]).optional(),effects:c(n({primitiveId:e().min(1),params:u(e(),g()).optional()})).optional(),transitionIn:n({type:e().min(1),duration:o()}).optional()})).max(ji).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:c(a(["overlay","component","card","no-transitions"])).max(Pi).optional(),gates:n({holdAt:c(a(["content","layout","motion"])).max(Ei).optional().describe("Checkpoint gates \u2014 the compose pauses at each named stage for review via resume."),autoApprove:h().optional().describe("true = fully autonomous (compose runs with NO gates \u2014 the headless mode). Mutually exclusive with a non-empty holdAt."),reviewMode:a(["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(),quote:n({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:n({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}),lb=n({id:e()}),_i=200,Ai=2e3,qi=500,Ni=100,Fi=3600,Gi=500,Ui=500,Di=35,Wi=500,Li=2e3,Ki=0,$i=24,Hi=24,Zi=12,Vi=24,Ji=0,Yi=0,Xi=0,Qi=0,ea=0,oa=0,ta=4,na=0,ra=0,sa=0,ia=0,aa=1,da=0,pa=1;var ca=.1,ma=1,la=0,ua=0,fa=-.3,ga=.3,ha=-.3,za=.3,xa=0,ya=1,ba=0,Sa=1,Ca=-.3,va=.3,Ra=0,Ia=1,ka=0,Oa=1,wa=0,Ta=1,Ba=1,Ma=1,ja=16,Pa=8,Ea=3,ub=n({id:e(),projectId:e(),kind:a(["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(_i).optional(),goal:e().min(1).max(Ai).describe("What the video must accomplish."),audience:e().max(qi).optional(),platform:e().max(Ni).optional(),format:n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["hd","fhd","4k"]).optional()}).optional().describe("Output-format spec per \xA7Format."),durationSec:o().max(Fi).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(Gi).optional(),cta:e().max(Ui).optional(),locale:e().max(Di).optional().describe("Output language (BCP-47 tag, e.g. 'es-419'): ALL on-screen copy + captions."),hook:e().max(Wi).optional(),caption:e().max(Li).optional(),beats:c(n({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:n({mediaId:e().min(1),startSec:o().min(Ki),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).")})).max($i).optional(),mustIncludes:c(e().min(1)).max(Hi).optional(),references:c(e()).max(Zi).optional(),captions:n({styleId:e().min(1).optional().describe("Caption style id (e.g. 'serif-emphasis@1')."),emphasisPhrases:c(e().min(1)).max(Vi).optional().describe("Phrases rendered in the caption EMPHASIS style (the big-serif treatment). Matched against the transcript; drives CaptionWord.emphasis.")}).optional(),motionStyle:n({textAnimation:e().optional(),transitions:e().optional(),colorMood:e().optional(),captionStyle:e().optional()}).optional(),seededGraphics:c(n({id:e().min(1),startTime:o().min(Ji),duration:o(),source:x([n({kind:m("media"),mediaId:e().min(1),trim:n({start:o().min(Yi),end:o().min(Xi)}).optional(),excludedRanges:c(n({start:o().min(Qi),end:o().min(ea),reason:e().optional()})).optional(),volume:o().min(oa).max(ta).optional(),muted:h().optional(),playbackRate:o().optional(),sync:a(["video","independent"]).optional(),kenBurns:a(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(na).optional(),fadeOutMs:o().min(ra).optional(),loop:h().optional(),reframe:n({segments:c(n({startSec:o().min(sa).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([n({mode:m("frame-center")}),n({mode:m("point"),x:o().min(ia).max(aa),y:o().min(da).max(pa)}),n({mode:m("face"),faceId:e().min(1),shotScale:a(["close","standard","wide"]).optional()}),n({mode:m("all-faces")}),n({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(ca).max(ma).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). Default 1."),ease:n({in:o().min(la).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(ua).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:n({x:o().min(fa).max(ga).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(ha).max(za).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()}),n({kind:m("component"),componentId:e().min(1),props:u(e(),g())}),n({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:a(["front","behind-subject"]).optional(),anchor:n({space:m("scene"),x:o().min(xa).max(ya),y:o().min(ba).max(Sa)}).optional(),parallax:o().min(Ca).max(va).optional()}),n({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}),n({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()})]),kind:a(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(Ra).max(Ia).optional(),scale:o().optional(),rotation:o().optional(),position:n({x:o(),y:o()}).optional(),region:n({x:o().min(ka).max(Oa),y:o().min(wa).max(Ta),w:o().max(Ba),h:o().max(Ma)}).optional(),fit:a(["cover","contain"]).optional(),effects:c(n({primitiveId:e().min(1),params:u(e(),g()).optional()})).optional(),transitionIn:n({type:e().min(1),duration:o()}).optional()})).max(ja).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:c(a(["overlay","component","card","no-transitions"])).max(Pa).optional(),gates:n({holdAt:c(a(["content","layout","motion"])).max(Ea).optional().describe("Checkpoint gates \u2014 the compose pauses at each named stage for review via resume."),autoApprove:h().optional().describe("true = fully autonomous (compose runs with NO gates \u2014 the headless mode). Mutually exclusive with a non-empty holdAt."),reviewMode:a(["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(),quote:n({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()}),fb=n({id:e()}),_a=200,Aa=2e3,qa=500,Na=100,Fa=3600,Ga=500,Ua=500,Da=35,Wa=500,La=2e3,Ka=0,$a=24,Ha=24,Za=12,Va=24,Ja=0,Ya=0,Xa=0,Qa=0,ed=0,od=0,td=4,nd=0,rd=0,sd=0,id=0,ad=1,dd=0,pd=1;var cd=.1,md=1,ld=0,ud=0,fd=-.3,gd=.3,hd=-.3,zd=.3,xd=0,yd=1,bd=0,Sd=1,Cd=-.3,vd=.3,Rd=0,Id=1,kd=0,Od=1,wd=0,Td=1,Bd=1,Md=1,jd=16,Pd=8,Ed=3,gb=n({name:e().max(_a).optional(),goal:e().min(1).max(Aa).optional().describe("What the video must accomplish."),audience:e().max(qa).optional(),platform:e().max(Na).optional(),format:n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["hd","fhd","4k"]).optional()}).optional().describe("Output-format spec per \xA7Format."),durationSec:o().max(Fa).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(Ga).optional(),cta:e().max(Ua).optional(),locale:e().max(Da).optional().describe("Output language (BCP-47 tag, e.g. 'es-419'): ALL on-screen copy + captions."),hook:e().max(Wa).optional(),caption:e().max(La).optional(),beats:c(n({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:n({mediaId:e().min(1),startSec:o().min(Ka),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).")})).max($a).optional(),mustIncludes:c(e().min(1)).max(Ha).optional(),references:c(e()).max(Za).optional(),captions:n({styleId:e().min(1).optional().describe("Caption style id (e.g. 'serif-emphasis@1')."),emphasisPhrases:c(e().min(1)).max(Va).optional().describe("Phrases rendered in the caption EMPHASIS style (the big-serif treatment). Matched against the transcript; drives CaptionWord.emphasis.")}).optional(),motionStyle:n({textAnimation:e().optional(),transitions:e().optional(),colorMood:e().optional(),captionStyle:e().optional()}).optional(),seededGraphics:c(n({id:e().min(1),startTime:o().min(Ja),duration:o(),source:x([n({kind:m("media"),mediaId:e().min(1),trim:n({start:o().min(Ya),end:o().min(Xa)}).optional(),excludedRanges:c(n({start:o().min(Qa),end:o().min(ed),reason:e().optional()})).optional(),volume:o().min(od).max(td).optional(),muted:h().optional(),playbackRate:o().optional(),sync:a(["video","independent"]).optional(),kenBurns:a(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(nd).optional(),fadeOutMs:o().min(rd).optional(),loop:h().optional(),reframe:n({segments:c(n({startSec:o().min(sd).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([n({mode:m("frame-center")}),n({mode:m("point"),x:o().min(id).max(ad),y:o().min(dd).max(pd)}),n({mode:m("face"),faceId:e().min(1),shotScale:a(["close","standard","wide"]).optional()}),n({mode:m("all-faces")}),n({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(cd).max(md).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). Default 1."),ease:n({in:o().min(ld).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(ud).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:n({x:o().min(fd).max(gd).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(hd).max(zd).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()}),n({kind:m("component"),componentId:e().min(1),props:u(e(),g())}),n({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:a(["front","behind-subject"]).optional(),anchor:n({space:m("scene"),x:o().min(xd).max(yd),y:o().min(bd).max(Sd)}).optional(),parallax:o().min(Cd).max(vd).optional()}),n({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}),n({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()})]),kind:a(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(Rd).max(Id).optional(),scale:o().optional(),rotation:o().optional(),position:n({x:o(),y:o()}).optional(),region:n({x:o().min(kd).max(Od),y:o().min(wd).max(Td),w:o().max(Bd),h:o().max(Md)}).optional(),fit:a(["cover","contain"]).optional(),effects:c(n({primitiveId:e().min(1),params:u(e(),g()).optional()})).optional(),transitionIn:n({type:e().min(1),duration:o()}).optional()})).max(jd).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:c(a(["overlay","component","card","no-transitions"])).max(Pd).optional(),gates:n({holdAt:c(a(["content","layout","motion"])).max(Ed).optional().describe("Checkpoint gates \u2014 the compose pauses at each named stage for review via resume."),autoApprove:h().optional().describe("true = fully autonomous (compose runs with NO gates \u2014 the headless mode). Mutually exclusive with a non-empty holdAt."),reviewMode:a(["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()}),_d=200,Ad=2e3,qd=500,Nd=100,Fd=3600,Gd=500,Ud=500,Dd=35,Wd=500,Ld=2e3,Kd=0,$d=24,Hd=24,Zd=12,Vd=24,Jd=0,Yd=0,Xd=0,Qd=0,ep=0,op=0,tp=4,np=0,rp=0,sp=0,ip=0,ap=1,dp=0,pp=1;var cp=.1,mp=1,lp=0,up=0,fp=-.3,gp=.3,hp=-.3,zp=.3,xp=0,yp=1,bp=0,Sp=1,Cp=-.3,vp=.3,Rp=0,Ip=1,kp=0,Op=1,wp=0,Tp=1,Bp=1,Mp=1,jp=16,Pp=8,Ep=3,hb=n({id:e(),projectId:e(),kind:a(["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(_d).optional(),goal:e().min(1).max(Ad).describe("What the video must accomplish."),audience:e().max(qd).optional(),platform:e().max(Nd).optional(),format:n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["hd","fhd","4k"]).optional()}).optional().describe("Output-format spec per \xA7Format."),durationSec:o().max(Fd).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(Gd).optional(),cta:e().max(Ud).optional(),locale:e().max(Dd).optional().describe("Output language (BCP-47 tag, e.g. 'es-419'): ALL on-screen copy + captions."),hook:e().max(Wd).optional(),caption:e().max(Ld).optional(),beats:c(n({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:n({mediaId:e().min(1),startSec:o().min(Kd),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).")})).max($d).optional(),mustIncludes:c(e().min(1)).max(Hd).optional(),references:c(e()).max(Zd).optional(),captions:n({styleId:e().min(1).optional().describe("Caption style id (e.g. 'serif-emphasis@1')."),emphasisPhrases:c(e().min(1)).max(Vd).optional().describe("Phrases rendered in the caption EMPHASIS style (the big-serif treatment). Matched against the transcript; drives CaptionWord.emphasis.")}).optional(),motionStyle:n({textAnimation:e().optional(),transitions:e().optional(),colorMood:e().optional(),captionStyle:e().optional()}).optional(),seededGraphics:c(n({id:e().min(1),startTime:o().min(Jd),duration:o(),source:x([n({kind:m("media"),mediaId:e().min(1),trim:n({start:o().min(Yd),end:o().min(Xd)}).optional(),excludedRanges:c(n({start:o().min(Qd),end:o().min(ep),reason:e().optional()})).optional(),volume:o().min(op).max(tp).optional(),muted:h().optional(),playbackRate:o().optional(),sync:a(["video","independent"]).optional(),kenBurns:a(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(np).optional(),fadeOutMs:o().min(rp).optional(),loop:h().optional(),reframe:n({segments:c(n({startSec:o().min(sp).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([n({mode:m("frame-center")}),n({mode:m("point"),x:o().min(ip).max(ap),y:o().min(dp).max(pp)}),n({mode:m("face"),faceId:e().min(1),shotScale:a(["close","standard","wide"]).optional()}),n({mode:m("all-faces")}),n({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(cp).max(mp).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). Default 1."),ease:n({in:o().min(lp).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(up).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:n({x:o().min(fp).max(gp).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(hp).max(zp).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()}),n({kind:m("component"),componentId:e().min(1),props:u(e(),g())}),n({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:a(["front","behind-subject"]).optional(),anchor:n({space:m("scene"),x:o().min(xp).max(yp),y:o().min(bp).max(Sp)}).optional(),parallax:o().min(Cp).max(vp).optional()}),n({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}),n({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()})]),kind:a(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(Rp).max(Ip).optional(),scale:o().optional(),rotation:o().optional(),position:n({x:o(),y:o()}).optional(),region:n({x:o().min(kp).max(Op),y:o().min(wp).max(Tp),w:o().max(Bp),h:o().max(Mp)}).optional(),fit:a(["cover","contain"]).optional(),effects:c(n({primitiveId:e().min(1),params:u(e(),g()).optional()})).optional(),transitionIn:n({type:e().min(1),duration:o()}).optional()})).max(jp).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:c(a(["overlay","component","card","no-transitions"])).max(Pp).optional(),gates:n({holdAt:c(a(["content","layout","motion"])).max(Ep).optional().describe("Checkpoint gates \u2014 the compose pauses at each named stage for review via resume."),autoApprove:h().optional().describe("true = fully autonomous (compose runs with NO gates \u2014 the headless mode). Mutually exclusive with a non-empty holdAt."),reviewMode:a(["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(),quote:n({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()}),zb=n({id:e()});var yb=n({id:e()}),bb=n({id:e(),projectId:e(),composeJobId:e().optional(),briefId:e().optional(),kind:a(["gate","score"]),stage:a(["content","layout","motion"]).optional(),version:o(),status:a(["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:c(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:n({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:a(["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:c(n({id:e(),version:o(),stage:a(["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.")}),Sb=n({id:e()}),Cb=n({ok:h(),stage:a(["content","layout","motion"]).optional(),version:o().optional(),composeJobId:e().optional()}).describe("Decision recorded; the run resumes (the SAME rail as POST /checkpoints/{id}/resume)."),vb=n({data:c(n({id:e(),projectId:e(),composeJobId:e().optional(),briefId:e().optional(),kind:a(["gate","score"]),stage:a(["content","layout","motion"]).optional(),version:o(),status:a(["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:c(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:n({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:a(["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:n({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}),Rb=n({id:e()}),Ib=n({id:e(),projectId:e(),composeJobId:e().optional(),briefId:e().optional(),kind:a(["gate","score"]),stage:a(["content","layout","motion"]).optional(),version:o(),status:a(["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:c(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:n({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:a(["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()}),kb=n({id:e()}),_p=0,Ap=2e3,qp=24,Np=4e3,Ob=n({decision:a(["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:c(n({anchor:x([n({beatId:e().min(1)}),n({timecodeMs:o().min(_p)})]).describe("What the comment is about: a plan beat (content gate) or a timecode on the artifact (layout/motion gates)."),verdict:a(["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(Ap).optional()})).max(qp).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(Np).optional()}).describe("POST /checkpoints/:id/resume body \u2014 the A1 review grammar."),wb=n({ok:h()}).describe("POST /checkpoints/:id/resume response.");var Bb=n({id:e()}),Mb=n({composition:g().optional().describe("The composition to judge. Absent \u21D2 the project's ACTIVE composition."),editorialIntent:e().optional(),brandContext:e().optional()}),jb=n({id:e()}),Pb=n({composition:g().optional().describe("The composition to render. Absent \u21D2 the project's ACTIVE composition."),timestamps:c(o()).min(1)}),Eb=g(),_b=n({id:e()}),Ab=n({componentId:e().min(1),params:u(e(),g()).optional(),width:o().optional(),height:o().optional()});var Nb=n({id:e()}),Fb=n({suggestionId:e().min(1),format:n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["hd","fhd","4k"]).optional(),platform:e().optional()}).optional()}),Gb=n({id:e()}),Ub=n({status:a(["idle","generating","completed","failed"]),createdAt:e().nullable(),analyzedAt:e().nullable(),jobId:e().nullable(),topics:c(e()),suggestions:c(n({id:e(),briefId:e().nullable(),rank:o(),trim:n({start:o(),end:o()}),score:o(),title:e(),reason:e(),topic:e(),hook:e(),platforms:c(e()),format:e(),caption:e(),hashtags:c(e()),textOverlays:c(e()),editingNotes:e(),motionStyle:n({textAnimation:e(),transitions:e(),colorMood:e(),captionStyle:e()}),visualTreatment:c(n({time:x([o(),e()]),visual:e()})),brollSuggestions:c(n({moment:e(),searchTerms:c(e()),rationale:e()})),thumbnailConcept:e()}).describe("Single ranked clip suggestion.")),pagination:n({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}).describe("GET /media/:id/suggestions envelope."),Db=n({id:e()}),Wb=n({id:e()});var Fp=100,Kb=n({category:a(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]).optional().describe("Filter to one category bucket (text|effects|transitions|layouts|backgrounds|ui-blocks|scenes)."),kind:a(["component","transition","scene"]).optional().describe("Filter by render kind (component|transition|scene)."),tier:a(["recommended","standard","niche"]).optional().describe("Filter by curation tier (recommended|standard|niche)."),useCase:a(["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(Fp).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).")}),$b=n({data:c(n({id:e(),name:e(),description:e(),source:a(["default","installed"]).describe("'default' = built-in primitive (place by primitiveId); 'installed' = org-authored component (place by componentId)."),category:a(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]),kind:a(["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:n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["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:c(e()).optional().describe("Authoring guidance: ids of primitives that COMPOSE well with this one in the same edit."),avoidWith:c(e()).optional().describe("Authoring guidance: ids of primitives that CONFLICT with this one \u2014 do not place together."),tags:c(e()).optional().describe("Free-text search keywords."),mood:c(e()).optional().describe("Vibe/tone tags (e.g. 'cinematic', 'minimal'). Filter to match the edit's mood."),tier:a(["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:c(a(["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:c(n({name:e(),mood:c(e()).optional(),params:u(e(),g()).optional(),description:e().optional()})).optional(),fixedCopy:c(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:c(n({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:n({clipSourceKind:a(["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:a(["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.")})}).describe("Component catalog entry per \xA7Components.")),pagination:n({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata."),brandTokens:c(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.")}),Gp=200,Up=200,Dp=2e3,Wp=200,Hb=n({componentId:e().min(1).max(Gp),tsxSource:e().min(1),name:e().min(1).max(Up),description:e().max(Dp),category:a(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]),propSchema:u(e(),g()).optional(),origin:a(["repo-owned","server-native"]).optional(),ejectedFrom:e().max(Wp).optional(),tokens:u(e(),g()).optional(),examples:c(u(e(),g())).optional(),durationInFrames:o().optional()}).describe("POST /components body. Org/user are server-resolved; never accepted from the body."),Zb=n({id:e()}),Lp=200,Kp=2e3,$p=200,Vb=n({tsxSource:e().min(1).optional(),name:e().min(1).max(Lp).optional(),description:e().max(Kp).optional(),category:a(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]).optional(),propSchema:u(e(),g()).optional(),origin:a(["repo-owned","server-native"]).optional(),ejectedFrom:e().max($p).optional(),tokens:u(e(),g()).optional(),examples:c(u(e(),g())).optional(),durationInFrames:o().optional()}).describe("PUT /components/:id body. Org/user are server-resolved; never accepted from the body."),Jb=n({id:e(),name:e(),description:e(),source:a(["default","installed"]).describe("'default' = built-in primitive (place by primitiveId); 'installed' = org-authored component (place by componentId)."),category:a(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]),kind:a(["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:n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["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:c(e()).optional().describe("Authoring guidance: ids of primitives that COMPOSE well with this one in the same edit."),avoidWith:c(e()).optional().describe("Authoring guidance: ids of primitives that CONFLICT with this one \u2014 do not place together."),tags:c(e()).optional().describe("Free-text search keywords."),mood:c(e()).optional().describe("Vibe/tone tags (e.g. 'cinematic', 'minimal'). Filter to match the edit's mood."),tier:a(["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:c(a(["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:c(n({name:e(),mood:c(e()).optional(),params:u(e(),g()).optional(),description:e().optional()})).optional(),fixedCopy:c(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:c(n({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:n({clipSourceKind:a(["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:a(["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.")})}).describe("Component catalog entry per \xA7Components."),Yb=n({id:e()}),Xb=n({id:e(),name:e(),description:e(),source:a(["default","installed"]).describe("'default' = built-in primitive (place by primitiveId); 'installed' = org-authored component (place by componentId)."),category:a(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]),kind:a(["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:n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["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:c(e()).optional().describe("Authoring guidance: ids of primitives that COMPOSE well with this one in the same edit."),avoidWith:c(e()).optional().describe("Authoring guidance: ids of primitives that CONFLICT with this one \u2014 do not place together."),tags:c(e()).optional().describe("Free-text search keywords."),mood:c(e()).optional().describe("Vibe/tone tags (e.g. 'cinematic', 'minimal'). Filter to match the edit's mood."),tier:a(["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:c(a(["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:c(n({name:e(),mood:c(e()).optional(),params:u(e(),g()).optional(),description:e().optional()})).optional(),fixedCopy:c(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:c(n({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:n({clipSourceKind:a(["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:a(["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.")})}).describe("Component catalog entry per \xA7Components."),Qb=n({id:e()}),eS=n({id:e(),name:e(),description:e(),source:a(["default","installed"]),tsxSource:e(),propSchema:u(e(),g()),origin:a(["repo-owned","server-native"]).optional(),ejectedFrom:e().optional(),tokens:u(e(),g()).optional(),examples:c(u(e(),g())).optional(),durationInFrames:o().optional()}).describe("Installed component SOURCE (TSX) + ownership provenance per \xA7Components.");var tS=n({id:e()}),Hp=2e3,Zp=5,Vp=0,Jp=10,Yp=64,Xp=3,nS=n({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:n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["hd","fhd","4k"]).optional()}).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(Hp).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(Zp).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(Vp).max(Jp).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(Yp).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:c(a(["content","layout","motion"])).max(Xp).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.")}).describe("POST /projects/:id/compose body."),rS=n({id:e(),composeJobId:e()}),sS=n({id:e(),composeJobId:e()}),Qp=0,iS=n({candidateIndex:o().min(Qp),selectStrategy:a(["agent-authoritative","editor-merge","editor-replace"]),ifMatch:e().optional()}).describe("POST /projects/:id/compose/jobs/:jobId/select body."),ec=0,aS=n({newCompositionEtag:e(),mergeResult:n({replayedEdits:o().min(ec),droppedEdits:c(n({trackId:e(),clipId:e().optional(),wordStartMs:o().optional(),reason:a(["target_removed","conflict"])}))}).optional()}).describe("POST /projects/:id/compose/jobs/:jobId/select response."),dS=n({id:e()}),pS=n({jobs:c(n({composeJobId:e(),projectId:e(),status:a(["queued","running","awaiting_input","complete","failed","cancelled"]),suggestionId:e().optional(),createdAt:o(),completedAt:o().nullable()}))}),cS=n({id:e(),composeJobId:e()}),oc=0,tc=0,nc=0,rc=0,sc=0,ic=0,mS=n({composeJobId:e(),projectId:e(),status:a(["queued","running","awaiting_input","complete","failed","cancelled"]),error:e().nullable(),request:n({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:c(g()),winner:n({candidateIndex:o().min(oc),compositionRunId:e()}).nullable(),cost:n({llmUsd:o().min(tc),visionUsd:o().min(nc),modalUsd:o().min(rc),totalUsd:o().min(sc)}).nullable(),listUsd:o().optional(),startedAt:o(),completedAt:o().nullable(),advisoryResult:n({mode:a(["advise","amend","explore"]),assessment:n({editorial:n({score:o(),grounding:a(["measured","judged"]),abstained:h(),reliability:o().optional()}),spatial:n({score:o(),grounding:a(["measured","judged"]),abstained:h(),reliability:o().optional()}),brand:n({score:o(),grounding:a(["measured","judged"]),abstained:h(),reliability:o().optional()}),caption:n({score:o(),grounding:a(["measured","judged"]),abstained:h(),reliability:o().optional()})}).optional().describe("Grounded critique of the CURRENT composition. Omitted for mode=advise."),proposals:c(n({label:e(),candidateIndex:o().min(ic).optional().describe("Present for amend/explore \u2014 adopt via POST /compose/jobs/:jobId/select with this candidateIndex. Absent for advise."),changeSummary:c(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:c(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:n({checkpointId:e(),stage:a(["content","layout","motion"]),version:o()}).optional()});var uS=n({id:e()}),fS=n({seedComposition:g().optional()}),gS=n({sessionId:e()}),hS=n({id:e(),sessionId:e()}),zS=n({sessionId:e(),ready:h(),sandboxId:e().optional(),status:e()}),xS=n({id:e(),sessionId:e()}),yS=n({ok:h()}),bS=n({id:e(),sessionId:e()}),SS=n({composition:g().optional()}),CS=n({id:e(),sessionId:e()}),vS=n({composition:g().optional(),timestamps:c(o()).min(1)}),RS=g(),IS=n({id:e(),sessionId:e()}),kS=n({composition:g().optional(),editorialIntent:e().optional(),brandContext:e().optional()}),OS=n({id:e(),sessionId:e()}),wS=n({componentId:e().min(1),params:u(e(),g()).optional(),width:o().optional(),height:o().optional()}),TS=n({id:e(),sessionId:e()}),BS=n({etag:e()});var jS=n({id:e()}),ac=2e3,PS=n({intent:e().min(1).max(ac).describe("Plain-English goal \u2014 what you're trying to achieve with this edit."),mode:a(["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:a(["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.")}).describe("POST /projects/:id/consult body.");var dc=0,pc=10,cc=6,_S=n({criticId:e().min(1).describe("Stable client id; re-registering the same id UPSERTS."),label:e().min(1),tier:a(["rules","rubric","evaluator"]),phase:a(["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(dc).max(pc).optional().describe("Score below this routes a refine like a built-in criterion. Defaults to 6."),rules:c(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:c(e()).max(cc).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.')}).describe("Register a custom compose critic."),AS=n({critics:c(n({criticId:e(),label:e(),tier:a(["rules","rubric","evaluator"]),phase:a(["static","temporal"]),floor:o(),referenceMediaIds:c(e()).optional()}).describe("One registered critic (rubric/rules/url stay write-only \u2014 never echoed)."))}),qS=n({criticId:e()});var FS=n({id:e()}),mc=0,lc=0,uc=0,fc=0,gc=0,hc=0,zc=4,xc=0,yc=0,bc=0,Sc=0,Cc=1,vc=0,Rc=1;var Ic=.1,kc=1,Oc=0,wc=0,Tc=-.3,Bc=.3,Mc=-.3,jc=.3,Pc=0,Ec=1,_c=0,Ac=1,qc=-.3,Nc=.3,Fc=0,Gc=1,Uc=0,Dc=1,Wc=0,Lc=1,Kc=1,$c=1,Hc=0,Zc=0,Vc=0,Jc=0,Yc=0,Xc=100,Qc=900,em=100,om=900,tm=0,nm=0,rm=0,sm=0,GS=n({v:o(),format:n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["hd","fhd","4k"]).optional(),platform:e().optional()}),tracks:c(n({id:e().min(1),kind:a(["video","audio","image","overlay","effect"]),name:e().optional(),enabled:h().optional(),contents:c(x([n({id:e().min(1),startTime:o().min(mc),duration:o(),source:x([n({kind:m("media"),mediaId:e().min(1),trim:n({start:o().min(lc),end:o().min(uc)}).optional(),excludedRanges:c(n({start:o().min(fc),end:o().min(gc),reason:e().optional()})).optional(),volume:o().min(hc).max(zc).optional(),muted:h().optional(),playbackRate:o().optional(),sync:a(["video","independent"]).optional(),kenBurns:a(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(xc).optional(),fadeOutMs:o().min(yc).optional(),loop:h().optional(),reframe:n({segments:c(n({startSec:o().min(bc).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([n({mode:m("frame-center")}),n({mode:m("point"),x:o().min(Sc).max(Cc),y:o().min(vc).max(Rc)}),n({mode:m("face"),faceId:e().min(1),shotScale:a(["close","standard","wide"]).optional()}),n({mode:m("all-faces")}),n({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(Ic).max(kc).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). Default 1."),ease:n({in:o().min(Oc).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(wc).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:n({x:o().min(Tc).max(Bc).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(Mc).max(jc).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()}),n({kind:m("component"),componentId:e().min(1),props:u(e(),g())}),n({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:a(["front","behind-subject"]).optional(),anchor:n({space:m("scene"),x:o().min(Pc).max(Ec),y:o().min(_c).max(Ac)}).optional(),parallax:o().min(qc).max(Nc).optional()}),n({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}),n({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()})]),kind:a(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(Fc).max(Gc).optional(),scale:o().optional(),rotation:o().optional(),position:n({x:o(),y:o()}).optional(),region:n({x:o().min(Uc).max(Dc),y:o().min(Wc).max(Lc),w:o().max(Kc),h:o().max($c)}).optional(),fit:a(["cover","contain"]).optional(),effects:c(n({primitiveId:e().min(1),params:u(e(),g()).optional()})).optional(),transitionIn:n({type:e().min(1),duration:o()}).optional()}),n({id:e().min(1),startTime:o().min(Hc),duration:o()})]))})),markers:c(n({id:e().min(1),startTime:o().min(Zc),endTime:o().min(Vc).optional(),kind:e().min(1),name:e().optional(),metadata:u(e(),g()).optional()})).optional(),captions:n({segments:c(n({words:c(n({text:e().min(1),startMs:o().min(Jc),endMs:o().min(Yc),emphasis:h().optional(),annotate:a(["circle","underline"]).optional()}))})),style:n({fontFamily:e().min(1).optional(),fontSize:o().optional(),fontWeight:o().min(Xc).max(Qc).optional(),color:e().min(1).optional(),highlightColor:e().min(1).optional(),backgroundColor:e().optional(),plate:a(["glass","solid","none"]).optional(),position:a(["top","center","bottom"]).optional(),textTransform:a(["none","uppercase","capitalize"]).optional(),emphasisColor:e().optional(),emphasisGradient:e().optional(),emphasisScale:o().optional(),emphasisFontFamily:e().optional(),emphasisFontWeight:o().min(em).max(om).optional(),emphasisTextTransform:a(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:o().optional(),emphasisFontStyle:a(["normal","italic"]).optional(),entrance:a(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:o().min(tm).optional(),entranceStaggerMs:o().min(nm).optional(),exitMs:o().min(rm).optional(),emphasisPlate:h().optional(),emphasisPlateColor:e().optional(),emphasisPlateTextColor:e().optional(),emphasisPlateAltColor:e().optional(),emphasisPlateAltTextColor:e().optional(),emphasisPlateRadius:o().min(sm).optional(),emphasisPlatePadX:o().optional(),emphasisPlatePadY:o().optional(),annotationColor:e().optional(),maxWidthPercent:o().optional()}).optional()}).optional(),license:n({type:e().min(1),source:e().optional(),notes:e().optional()}).optional(),accessibility:n({audioDescriptionTrackId:e().optional(),captionsTrackId:e().optional(),signLanguageTrackId:e().optional(),notes:e().optional()}).optional()}).describe("Canonical composition wire shape (multi-track; carries reframe, captions, markers)."),US=n({id:e()}),im=0,am=0,dm=0,pm=0,cm=0,mm=0,lm=4,um=0,fm=0,gm=0,hm=0,zm=1,xm=0,ym=1;var bm=.1,Sm=1,Cm=0,vm=0,Rm=-.3,Im=.3,km=-.3,Om=.3,wm=0,Tm=1,Bm=0,Mm=1,jm=-.3,Pm=.3,Em=0,_m=1,Am=0,qm=1,Nm=0,Fm=1,Gm=1,Um=1,Dm=0,Wm=0,Lm=0,Km=0,$m=0,Hm=100,Zm=900,Vm=100,Jm=900,Ym=0,Xm=0,Qm=0,el=0,DS=n({v:o(),format:n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["hd","fhd","4k"]).optional(),platform:e().optional()}),tracks:c(n({id:e().min(1),kind:a(["video","audio","image","overlay","effect"]),name:e().optional(),enabled:h().optional(),contents:c(x([n({id:e().min(1),startTime:o().min(im),duration:o(),source:x([n({kind:m("media"),mediaId:e().min(1),trim:n({start:o().min(am),end:o().min(dm)}).optional(),excludedRanges:c(n({start:o().min(pm),end:o().min(cm),reason:e().optional()})).optional(),volume:o().min(mm).max(lm).optional(),muted:h().optional(),playbackRate:o().optional(),sync:a(["video","independent"]).optional(),kenBurns:a(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(um).optional(),fadeOutMs:o().min(fm).optional(),loop:h().optional(),reframe:n({segments:c(n({startSec:o().min(gm).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([n({mode:m("frame-center")}),n({mode:m("point"),x:o().min(hm).max(zm),y:o().min(xm).max(ym)}),n({mode:m("face"),faceId:e().min(1),shotScale:a(["close","standard","wide"]).optional()}),n({mode:m("all-faces")}),n({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(bm).max(Sm).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). Default 1."),ease:n({in:o().min(Cm).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(vm).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:n({x:o().min(Rm).max(Im).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(km).max(Om).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()}),n({kind:m("component"),componentId:e().min(1),props:u(e(),g())}),n({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:a(["front","behind-subject"]).optional(),anchor:n({space:m("scene"),x:o().min(wm).max(Tm),y:o().min(Bm).max(Mm)}).optional(),parallax:o().min(jm).max(Pm).optional()}),n({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}),n({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()})]),kind:a(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(Em).max(_m).optional(),scale:o().optional(),rotation:o().optional(),position:n({x:o(),y:o()}).optional(),region:n({x:o().min(Am).max(qm),y:o().min(Nm).max(Fm),w:o().max(Gm),h:o().max(Um)}).optional(),fit:a(["cover","contain"]).optional(),effects:c(n({primitiveId:e().min(1),params:u(e(),g()).optional()})).optional(),transitionIn:n({type:e().min(1),duration:o()}).optional()}),n({id:e().min(1),startTime:o().min(Dm),duration:o()})]))})),markers:c(n({id:e().min(1),startTime:o().min(Wm),endTime:o().min(Lm).optional(),kind:e().min(1),name:e().optional(),metadata:u(e(),g()).optional()})).optional(),captions:n({segments:c(n({words:c(n({text:e().min(1),startMs:o().min(Km),endMs:o().min($m),emphasis:h().optional(),annotate:a(["circle","underline"]).optional()}))})),style:n({fontFamily:e().min(1).optional(),fontSize:o().optional(),fontWeight:o().min(Hm).max(Zm).optional(),color:e().min(1).optional(),highlightColor:e().min(1).optional(),backgroundColor:e().optional(),plate:a(["glass","solid","none"]).optional(),position:a(["top","center","bottom"]).optional(),textTransform:a(["none","uppercase","capitalize"]).optional(),emphasisColor:e().optional(),emphasisGradient:e().optional(),emphasisScale:o().optional(),emphasisFontFamily:e().optional(),emphasisFontWeight:o().min(Vm).max(Jm).optional(),emphasisTextTransform:a(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:o().optional(),emphasisFontStyle:a(["normal","italic"]).optional(),entrance:a(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:o().min(Ym).optional(),entranceStaggerMs:o().min(Xm).optional(),exitMs:o().min(Qm).optional(),emphasisPlate:h().optional(),emphasisPlateColor:e().optional(),emphasisPlateTextColor:e().optional(),emphasisPlateAltColor:e().optional(),emphasisPlateAltTextColor:e().optional(),emphasisPlateRadius:o().min(el).optional(),emphasisPlatePadX:o().optional(),emphasisPlatePadY:o().optional(),annotationColor:e().optional(),maxWidthPercent:o().optional()}).optional()}).optional(),license:n({type:e().min(1),source:e().optional(),notes:e().optional()}).optional(),accessibility:n({audioDescriptionTrackId:e().optional(),captionsTrackId:e().optional(),signLanguageTrackId:e().optional(),notes:e().optional()}).optional()}).describe("Canonical composition wire shape (multi-track; carries reframe, captions, markers)."),WS=n({id:e()}),ol=200,LS=n({name:e().min(1).max(ol).optional(),format:n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["hd","fhd","4k"]).optional()}).optional().describe("Output-format spec per \xA7Format.")}).describe("POST /projects/:id/compositions body \u2014 create a new video (composition) in the project. `format` defaults to the project's compositionFormat when omitted."),KS=n({id:e()}),tl=0,$S=n({data:c(n({compositionId:e(),format:n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["hd","fhd","4k"]).optional()}).describe("Output-format spec per \xA7Format."),etag:e(),isActive:h(),updatedAt:o(),sceneCount:o().min(tl)}).describe("A composition in a project, flagging the active one."))}).describe("GET /projects/:id/compositions response."),HS=n({id:e()}),nl=0,rl=0,sl=0,il=0,al=0,dl=0,pl=4,cl=0,ml=0,ll=0,ul=0,fl=1,gl=0,hl=1;var zl=.1,xl=1,yl=0,bl=0,Sl=-.3,Cl=.3,vl=-.3,Rl=.3,Il=0,kl=1,Ol=0,wl=1,Tl=-.3,Bl=.3,Ml=0,jl=1,Pl=0,El=1,_l=0,Al=1,ql=1,Nl=1,Fl=0,Gl=0,Ul=0,Dl=0,Wl=0,Ll=0,Kl=4,$l=0,Hl=0,Zl=0,Vl=0,Jl=1,Yl=0,Xl=1;var Ql=.1,eu=1,ou=0,tu=0,nu=-.3,ru=.3,su=-.3,iu=.3,au=0,du=1,pu=0,cu=1,mu=-.3,lu=.3,uu=0,fu=1,gu=0,hu=1,zu=0,xu=1,yu=1,bu=1,Su=0,Cu=0,vu=0,Ru=0,Iu=0,ku=0,Ou=4,wu=0,Tu=0,Bu=0,Mu=0,ju=1,Pu=0,Eu=1;var _u=.1,Au=1,qu=0,Nu=0,Fu=-.3,Gu=.3,Uu=-.3,Du=.3,Wu=0,Lu=1,Ku=0,$u=1,Hu=-.3,Zu=.3,Vu=0,Ju=1,Yu=0,Xu=1,Qu=0,ef=1,of=1,tf=1,nf=0,rf=0,sf=0,af=0,df=0,pf=0,cf=1,mf=0,lf=1;var uf=.1,ff=1,gf=0,hf=0,zf=-.3,xf=.3,yf=-.3,bf=.3,Sf=100,Cf=900,vf=100,Rf=900,If=0,kf=0,Of=0,wf=0,ZS=x([n({type:m("clip.add"),clip:n({id:e().min(1),startTime:o().min(nl),duration:o(),source:x([n({kind:m("media"),mediaId:e().min(1),trim:n({start:o().min(rl),end:o().min(sl)}).optional(),excludedRanges:c(n({start:o().min(il),end:o().min(al),reason:e().optional()})).optional(),volume:o().min(dl).max(pl).optional(),muted:h().optional(),playbackRate:o().optional(),sync:a(["video","independent"]).optional(),kenBurns:a(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(cl).optional(),fadeOutMs:o().min(ml).optional(),loop:h().optional(),reframe:n({segments:c(n({startSec:o().min(ll).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([n({mode:m("frame-center")}),n({mode:m("point"),x:o().min(ul).max(fl),y:o().min(gl).max(hl)}),n({mode:m("face"),faceId:e().min(1),shotScale:a(["close","standard","wide"]).optional()}),n({mode:m("all-faces")}),n({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(zl).max(xl).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). Default 1."),ease:n({in:o().min(yl).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(bl).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:n({x:o().min(Sl).max(Cl).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(vl).max(Rl).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()}),n({kind:m("component"),componentId:e().min(1),props:u(e(),g())}),n({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:a(["front","behind-subject"]).optional(),anchor:n({space:m("scene"),x:o().min(Il).max(kl),y:o().min(Ol).max(wl)}).optional(),parallax:o().min(Tl).max(Bl).optional()}),n({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}),n({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()})]),kind:a(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(Ml).max(jl).optional(),scale:o().optional(),rotation:o().optional(),position:n({x:o(),y:o()}).optional(),region:n({x:o().min(Pl).max(El),y:o().min(_l).max(Al),w:o().max(ql),h:o().max(Nl)}).optional(),fit:a(["cover","contain"]).optional(),effects:c(n({primitiveId:e().min(1),params:u(e(),g()).optional()})).optional(),transitionIn:n({type:e().min(1),duration:o()}).optional()}),trackId:e().optional(),newTrack:h().optional(),newTrackId:e().optional()}).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."),n({type:m("clip.remove"),clipId:e()}).describe("Remove a clip by id (located across every track)."),n({type:m("clip.update"),clipId:e(),patch:n({id:e().min(1).optional(),startTime:o().min(Fl).optional(),duration:o().optional(),source:x([n({kind:m("media"),mediaId:e().min(1),trim:n({start:o().min(Gl),end:o().min(Ul)}).optional(),excludedRanges:c(n({start:o().min(Dl),end:o().min(Wl),reason:e().optional()})).optional(),volume:o().min(Ll).max(Kl).optional(),muted:h().optional(),playbackRate:o().optional(),sync:a(["video","independent"]).optional(),kenBurns:a(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min($l).optional(),fadeOutMs:o().min(Hl).optional(),loop:h().optional(),reframe:n({segments:c(n({startSec:o().min(Zl).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([n({mode:m("frame-center")}),n({mode:m("point"),x:o().min(Vl).max(Jl),y:o().min(Yl).max(Xl)}),n({mode:m("face"),faceId:e().min(1),shotScale:a(["close","standard","wide"]).optional()}),n({mode:m("all-faces")}),n({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(Ql).max(eu).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). Default 1."),ease:n({in:o().min(ou).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(tu).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:n({x:o().min(nu).max(ru).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(su).max(iu).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()}),n({kind:m("component"),componentId:e().min(1),props:u(e(),g())}),n({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:a(["front","behind-subject"]).optional(),anchor:n({space:m("scene"),x:o().min(au).max(du),y:o().min(pu).max(cu)}).optional(),parallax:o().min(mu).max(lu).optional()}),n({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}),n({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()})]).optional(),kind:a(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(uu).max(fu).optional(),scale:o().optional(),rotation:o().optional(),position:n({x:o(),y:o()}).optional(),region:n({x:o().min(gu).max(hu),y:o().min(zu).max(xu),w:o().max(yu),h:o().max(bu)}).optional(),fit:a(["cover","contain"]).optional(),effects:c(n({primitiveId:e().min(1),params:u(e(),g()).optional()})).optional(),transitionIn:n({type:e().min(1),duration:o()}).optional()})}).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.)"),n({type:m("removeClipsByMediaId"),mediaId:e()}).describe("Remove EVERY clip sourced from a given mediaId (e.g. after deleting that media)."),n({type:m("loadOverlays"),clips:c(n({id:e().min(1),startTime:o().min(Su),duration:o(),source:x([n({kind:m("media"),mediaId:e().min(1),trim:n({start:o().min(Cu),end:o().min(vu)}).optional(),excludedRanges:c(n({start:o().min(Ru),end:o().min(Iu),reason:e().optional()})).optional(),volume:o().min(ku).max(Ou).optional(),muted:h().optional(),playbackRate:o().optional(),sync:a(["video","independent"]).optional(),kenBurns:a(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(wu).optional(),fadeOutMs:o().min(Tu).optional(),loop:h().optional(),reframe:n({segments:c(n({startSec:o().min(Bu).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([n({mode:m("frame-center")}),n({mode:m("point"),x:o().min(Mu).max(ju),y:o().min(Pu).max(Eu)}),n({mode:m("face"),faceId:e().min(1),shotScale:a(["close","standard","wide"]).optional()}),n({mode:m("all-faces")}),n({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(_u).max(Au).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). Default 1."),ease:n({in:o().min(qu).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(Nu).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:n({x:o().min(Fu).max(Gu).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(Uu).max(Du).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()}),n({kind:m("component"),componentId:e().min(1),props:u(e(),g())}),n({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:a(["front","behind-subject"]).optional(),anchor:n({space:m("scene"),x:o().min(Wu).max(Lu),y:o().min(Ku).max($u)}).optional(),parallax:o().min(Hu).max(Zu).optional()}),n({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}),n({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()})]),kind:a(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(Vu).max(Ju).optional(),scale:o().optional(),rotation:o().optional(),position:n({x:o(),y:o()}).optional(),region:n({x:o().min(Yu).max(Xu),y:o().min(Qu).max(ef),w:o().max(of),h:o().max(tf)}).optional(),fit:a(["cover","contain"]).optional(),effects:c(n({primitiveId:e().min(1),params:u(e(),g()).optional()})).optional(),transitionIn:n({type:e().min(1),duration:o()}).optional()}))}).describe("Replace the overlay channel wholesale with the given clips (bulk set, not a merge)."),n({type:m("addMarker"),marker:n({id:e().min(1),startTime:o().min(nf),endTime:o().min(rf).optional(),kind:e().min(1),name:e().optional(),metadata:u(e(),g()).optional()})}).describe("Add a timeline marker (a named time point/range; carry extensions in `metadata`)."),n({type:m("removeMarker"),markerId:e()}).describe("Remove a marker by id."),n({type:m("updateMarker"),markerId:e(),updates:n({id:e().min(1).optional(),startTime:o().min(sf).optional(),endTime:o().min(af).optional(),kind:e().min(1).optional(),name:e().optional(),metadata:u(e(),g()).optional()})}).describe("Patch a marker's fields by id (partial merge)."),n({type:m("setCropIntents"),clipId:e(),segments:c(n({startSec:o().min(df).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([n({mode:m("frame-center")}),n({mode:m("point"),x:o().min(pf).max(cf),y:o().min(mf).max(lf)}),n({mode:m("face"),faceId:e().min(1),shotScale:a(["close","standard","wide"]).optional()}),n({mode:m("all-faces")}),n({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(uf).max(ff).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). Default 1."),ease:n({in:o().min(gf).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.")}).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:n({x:o().min(zf).max(xf).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(yf).max(bf).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.")})).nullable()}).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."),n({type:m("setCaptionStyle"),style:n({fontFamily:e().min(1).optional(),fontSize:o().optional(),fontWeight:o().min(Sf).max(Cf).optional(),color:e().min(1).optional(),highlightColor:e().min(1).optional(),backgroundColor:e().optional(),plate:a(["glass","solid","none"]).optional(),position:a(["top","center","bottom"]).optional(),textTransform:a(["none","uppercase","capitalize"]).optional(),emphasisColor:e().optional(),emphasisGradient:e().optional(),emphasisScale:o().optional(),emphasisFontFamily:e().optional(),emphasisFontWeight:o().min(vf).max(Rf).optional(),emphasisTextTransform:a(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:o().optional(),emphasisFontStyle:a(["normal","italic"]).optional(),entrance:a(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:o().min(If).optional(),entranceStaggerMs:o().min(kf).optional(),exitMs:o().min(Of).optional(),emphasisPlate:h().optional(),emphasisPlateColor:e().optional(),emphasisPlateTextColor:e().optional(),emphasisPlateAltColor:e().optional(),emphasisPlateAltTextColor:e().optional(),emphasisPlateRadius:o().min(wf).optional(),emphasisPlatePadX:o().optional(),emphasisPlatePadY:o().optional(),annotationColor:e().optional(),maxWidthPercent:o().optional()})}).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."),n({type:m("setFormat"),format:n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["hd","fhd","4k"]).optional()})}).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."),n({type:m("addTrack"),kind:a(["video","audio","image","overlay","effect"]),name:e().optional(),id:e().optional()}).describe("Add an EMPTY track of a given family (video|audio|image|overlay|effect). Optional pinned `id`."),n({type:m("removeTrack"),trackId:e()}).describe("Remove a track AND all its clips by id."),n({type:m("updateTrack"),trackId:e(),updates:n({name:e().optional(),enabled:h().optional()})}).describe("Patch a track's `name` / `enabled` by id."),n({type:m("reorderTracks"),fromIndex:o(),toIndex:o()}).describe("Move a track from one index to another (changes layer/compositing order)."),n({type:m("moveClipToTrack"),clipId:e(),targetTrackId:e(),newStartTime:o().optional()}).describe("Move a clip to another SAME-family track, optionally at a new `newStartTime`."),n({type:m("duplicateClip"),clipId:e(),newClipId:e().optional()}).describe("Duplicate a clip by id. Pin `newClipId` to make the copy's id deterministic (required for a clean undo/inverse)."),n({type:m("cutAndRipple"),start:o(),end:o()}).describe("Server-authoritative: delete the [start,end] time window and ripple every downstream clip/marker/caption earlier to close the gap."),n({type:m("ripple"),time:o(),amount:o()}).describe("Server-authoritative: shift everything at/after `time` by `amount` seconds (+ opens a gap, \u2212 closes one)."),n({type:m("addExcludedRange"),clipId:e(),sourceStart:o(),sourceEnd:o(),reason:e().optional()}).describe("Server-authoritative: exclude a [sourceStart,sourceEnd] span of a clip's SOURCE (an internal trim) and ripple downstream \u2014 the preferred way to drop a sub-range vs a source patch."),n({type:m("removeExcludedRange"),clipId:e(),rangeIdx:o()}).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."),VS=n({id:e()}),Tf=0,Bf=0,Mf=0,jf=0,Pf=0,Ef=0,_f=4,Af=0,qf=0,Nf=0,Ff=0,Gf=1,Uf=0,Df=1;var Wf=.1,Lf=1,Kf=0,$f=0,Hf=-.3,Zf=.3,Vf=-.3,Jf=.3,Yf=0,Xf=1,Qf=0,eg=1,og=-.3,tg=.3,ng=0,rg=1,sg=0,ig=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,yg=0,bg=0,Sg=0,Cg=1,vg=0,Rg=1;var Ig=.1,kg=1,Og=0,wg=0,Tg=-.3,Bg=.3,Mg=-.3,jg=.3,Pg=0,Eg=1,_g=0,Ag=1,qg=-.3,Ng=.3,Fg=0,Gg=1,Ug=0,Dg=1,Wg=0,Lg=1,Kg=1,$g=1,Hg=0,Zg=0,Vg=0,Jg=0,Yg=0,Xg=0,Qg=4,eh=0,oh=0,th=0,nh=0,rh=1,sh=0,ih=1;var ah=.1,dh=1,ph=0,ch=0,mh=-.3,lh=.3,uh=-.3,fh=.3,gh=0,hh=1,zh=0,xh=1,yh=-.3,bh=.3,Sh=0,Ch=1,vh=0,Rh=1,Ih=0,kh=1,Oh=1,wh=1,Th=0,Bh=0,Mh=0,jh=0,Ph=0,Eh=0,_h=1,Ah=0,qh=1;var Nh=.1,Fh=1,Gh=0,Uh=0,Dh=-.3,Wh=.3,Lh=-.3,Kh=.3,$h=100,Hh=900,Zh=100,Vh=900,Jh=0,Yh=0,Xh=0,Qh=0,JS=n({ops:c(x([n({type:m("clip.add"),clip:n({id:e().min(1),startTime:o().min(Tf),duration:o(),source:x([n({kind:m("media"),mediaId:e().min(1),trim:n({start:o().min(Bf),end:o().min(Mf)}).optional(),excludedRanges:c(n({start:o().min(jf),end:o().min(Pf),reason:e().optional()})).optional(),volume:o().min(Ef).max(_f).optional(),muted:h().optional(),playbackRate:o().optional(),sync:a(["video","independent"]).optional(),kenBurns:a(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(Af).optional(),fadeOutMs:o().min(qf).optional(),loop:h().optional(),reframe:n({segments:c(n({startSec:o().min(Nf).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([n({mode:m("frame-center")}),n({mode:m("point"),x:o().min(Ff).max(Gf),y:o().min(Uf).max(Df)}),n({mode:m("face"),faceId:e().min(1),shotScale:a(["close","standard","wide"]).optional()}),n({mode:m("all-faces")}),n({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(Wf).max(Lf).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). Default 1."),ease:n({in:o().min(Kf).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min($f).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:n({x:o().min(Hf).max(Zf).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(Vf).max(Jf).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()}),n({kind:m("component"),componentId:e().min(1),props:u(e(),g())}),n({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:a(["front","behind-subject"]).optional(),anchor:n({space:m("scene"),x:o().min(Yf).max(Xf),y:o().min(Qf).max(eg)}).optional(),parallax:o().min(og).max(tg).optional()}),n({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}),n({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()})]),kind:a(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(ng).max(rg).optional(),scale:o().optional(),rotation:o().optional(),position:n({x:o(),y:o()}).optional(),region:n({x:o().min(sg).max(ig),y:o().min(ag).max(dg),w:o().max(pg),h:o().max(cg)}).optional(),fit:a(["cover","contain"]).optional(),effects:c(n({primitiveId:e().min(1),params:u(e(),g()).optional()})).optional(),transitionIn:n({type:e().min(1),duration:o()}).optional()}),trackId:e().optional(),newTrack:h().optional(),newTrackId:e().optional()}).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."),n({type:m("clip.remove"),clipId:e()}).describe("Remove a clip by id (located across every track)."),n({type:m("clip.update"),clipId:e(),patch:n({id:e().min(1).optional(),startTime:o().min(mg).optional(),duration:o().optional(),source:x([n({kind:m("media"),mediaId:e().min(1),trim:n({start:o().min(lg),end:o().min(ug)}).optional(),excludedRanges:c(n({start:o().min(fg),end:o().min(gg),reason:e().optional()})).optional(),volume:o().min(hg).max(zg).optional(),muted:h().optional(),playbackRate:o().optional(),sync:a(["video","independent"]).optional(),kenBurns:a(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(xg).optional(),fadeOutMs:o().min(yg).optional(),loop:h().optional(),reframe:n({segments:c(n({startSec:o().min(bg).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([n({mode:m("frame-center")}),n({mode:m("point"),x:o().min(Sg).max(Cg),y:o().min(vg).max(Rg)}),n({mode:m("face"),faceId:e().min(1),shotScale:a(["close","standard","wide"]).optional()}),n({mode:m("all-faces")}),n({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(Ig).max(kg).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). Default 1."),ease:n({in:o().min(Og).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(wg).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:n({x:o().min(Tg).max(Bg).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(Mg).max(jg).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()}),n({kind:m("component"),componentId:e().min(1),props:u(e(),g())}),n({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:a(["front","behind-subject"]).optional(),anchor:n({space:m("scene"),x:o().min(Pg).max(Eg),y:o().min(_g).max(Ag)}).optional(),parallax:o().min(qg).max(Ng).optional()}),n({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}),n({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()})]).optional(),kind:a(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(Fg).max(Gg).optional(),scale:o().optional(),rotation:o().optional(),position:n({x:o(),y:o()}).optional(),region:n({x:o().min(Ug).max(Dg),y:o().min(Wg).max(Lg),w:o().max(Kg),h:o().max($g)}).optional(),fit:a(["cover","contain"]).optional(),effects:c(n({primitiveId:e().min(1),params:u(e(),g()).optional()})).optional(),transitionIn:n({type:e().min(1),duration:o()}).optional()})}).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.)"),n({type:m("removeClipsByMediaId"),mediaId:e()}).describe("Remove EVERY clip sourced from a given mediaId (e.g. after deleting that media)."),n({type:m("loadOverlays"),clips:c(n({id:e().min(1),startTime:o().min(Hg),duration:o(),source:x([n({kind:m("media"),mediaId:e().min(1),trim:n({start:o().min(Zg),end:o().min(Vg)}).optional(),excludedRanges:c(n({start:o().min(Jg),end:o().min(Yg),reason:e().optional()})).optional(),volume:o().min(Xg).max(Qg).optional(),muted:h().optional(),playbackRate:o().optional(),sync:a(["video","independent"]).optional(),kenBurns:a(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(eh).optional(),fadeOutMs:o().min(oh).optional(),loop:h().optional(),reframe:n({segments:c(n({startSec:o().min(th).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([n({mode:m("frame-center")}),n({mode:m("point"),x:o().min(nh).max(rh),y:o().min(sh).max(ih)}),n({mode:m("face"),faceId:e().min(1),shotScale:a(["close","standard","wide"]).optional()}),n({mode:m("all-faces")}),n({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(ah).max(dh).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). Default 1."),ease:n({in:o().min(ph).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(ch).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:n({x:o().min(mh).max(lh).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(uh).max(fh).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()}),n({kind:m("component"),componentId:e().min(1),props:u(e(),g())}),n({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:a(["front","behind-subject"]).optional(),anchor:n({space:m("scene"),x:o().min(gh).max(hh),y:o().min(zh).max(xh)}).optional(),parallax:o().min(yh).max(bh).optional()}),n({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}),n({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()})]),kind:a(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(Sh).max(Ch).optional(),scale:o().optional(),rotation:o().optional(),position:n({x:o(),y:o()}).optional(),region:n({x:o().min(vh).max(Rh),y:o().min(Ih).max(kh),w:o().max(Oh),h:o().max(wh)}).optional(),fit:a(["cover","contain"]).optional(),effects:c(n({primitiveId:e().min(1),params:u(e(),g()).optional()})).optional(),transitionIn:n({type:e().min(1),duration:o()}).optional()}))}).describe("Replace the overlay channel wholesale with the given clips (bulk set, not a merge)."),n({type:m("addMarker"),marker:n({id:e().min(1),startTime:o().min(Th),endTime:o().min(Bh).optional(),kind:e().min(1),name:e().optional(),metadata:u(e(),g()).optional()})}).describe("Add a timeline marker (a named time point/range; carry extensions in `metadata`)."),n({type:m("removeMarker"),markerId:e()}).describe("Remove a marker by id."),n({type:m("updateMarker"),markerId:e(),updates:n({id:e().min(1).optional(),startTime:o().min(Mh).optional(),endTime:o().min(jh).optional(),kind:e().min(1).optional(),name:e().optional(),metadata:u(e(),g()).optional()})}).describe("Patch a marker's fields by id (partial merge)."),n({type:m("setCropIntents"),clipId:e(),segments:c(n({startSec:o().min(Ph).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([n({mode:m("frame-center")}),n({mode:m("point"),x:o().min(Eh).max(_h),y:o().min(Ah).max(qh)}),n({mode:m("face"),faceId:e().min(1),shotScale:a(["close","standard","wide"]).optional()}),n({mode:m("all-faces")}),n({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(Nh).max(Fh).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). Default 1."),ease:n({in:o().min(Gh).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(Uh).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:n({x:o().min(Dh).max(Wh).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(Lh).max(Kh).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.")})).nullable()}).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."),n({type:m("setCaptionStyle"),style:n({fontFamily:e().min(1).optional(),fontSize:o().optional(),fontWeight:o().min($h).max(Hh).optional(),color:e().min(1).optional(),highlightColor:e().min(1).optional(),backgroundColor:e().optional(),plate:a(["glass","solid","none"]).optional(),position:a(["top","center","bottom"]).optional(),textTransform:a(["none","uppercase","capitalize"]).optional(),emphasisColor:e().optional(),emphasisGradient:e().optional(),emphasisScale:o().optional(),emphasisFontFamily:e().optional(),emphasisFontWeight:o().min(Zh).max(Vh).optional(),emphasisTextTransform:a(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:o().optional(),emphasisFontStyle:a(["normal","italic"]).optional(),entrance:a(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:o().min(Jh).optional(),entranceStaggerMs:o().min(Yh).optional(),exitMs:o().min(Xh).optional(),emphasisPlate:h().optional(),emphasisPlateColor:e().optional(),emphasisPlateTextColor:e().optional(),emphasisPlateAltColor:e().optional(),emphasisPlateAltTextColor:e().optional(),emphasisPlateRadius:o().min(Qh).optional(),emphasisPlatePadX:o().optional(),emphasisPlatePadY:o().optional(),annotationColor:e().optional(),maxWidthPercent:o().optional()})}).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."),n({type:m("setFormat"),format:n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["hd","fhd","4k"]).optional()})}).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."),n({type:m("addTrack"),kind:a(["video","audio","image","overlay","effect"]),name:e().optional(),id:e().optional()}).describe("Add an EMPTY track of a given family (video|audio|image|overlay|effect). Optional pinned `id`."),n({type:m("removeTrack"),trackId:e()}).describe("Remove a track AND all its clips by id."),n({type:m("updateTrack"),trackId:e(),updates:n({name:e().optional(),enabled:h().optional()})}).describe("Patch a track's `name` / `enabled` by id."),n({type:m("reorderTracks"),fromIndex:o(),toIndex:o()}).describe("Move a track from one index to another (changes layer/compositing order)."),n({type:m("moveClipToTrack"),clipId:e(),targetTrackId:e(),newStartTime:o().optional()}).describe("Move a clip to another SAME-family track, optionally at a new `newStartTime`."),n({type:m("duplicateClip"),clipId:e(),newClipId:e().optional()}).describe("Duplicate a clip by id. Pin `newClipId` to make the copy's id deterministic (required for a clean undo/inverse)."),n({type:m("cutAndRipple"),start:o(),end:o()}).describe("Server-authoritative: delete the [start,end] time window and ripple every downstream clip/marker/caption earlier to close the gap."),n({type:m("ripple"),time:o(),amount:o()}).describe("Server-authoritative: shift everything at/after `time` by `amount` seconds (+ opens a gap, \u2212 closes one)."),n({type:m("addExcludedRange"),clipId:e(),sourceStart:o(),sourceEnd:o(),reason:e().optional()}).describe("Server-authoritative: exclude a [sourceStart,sourceEnd] span of a clip's SOURCE (an internal trim) and ripple downstream \u2014 the preferred way to drop a sub-range vs a source patch."),n({type:m("removeExcludedRange"),clipId:e(),rangeIdx:o()}).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.")}).describe("POST /projects/:id/composition/apply body \u2014 a batch of CompositionOps."),YS=n({id:e()}),XS=n({fromCompositionId:e().min(1).describe("Source composition to reframe a sibling from."),targetFormat:n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["hd","fhd","4k"]).optional()}).describe("Output-format spec per \xA7Format.")}).describe("Derive a reframed sibling composition for a new aspect (Auto-Reframe / Magic-Resize, agent-native)."),QS=n({compositionId:e().describe("The new sibling composition's id.")}).describe("POST /projects/:id/compositions/derive response."),ez=0,oz=0,tz=0,nz=0,rz=0,sz=0,iz=4,az=0,dz=0,pz=0,cz=0,mz=1,lz=0,uz=1;var fz=.1,gz=1,hz=0,zz=0,xz=-.3,yz=.3,bz=-.3,Sz=.3,Cz=0,vz=1,Rz=0,Iz=1,kz=-.3,Oz=.3,wz=0,Tz=1,Bz=0,Mz=1,jz=0,Pz=1,Ez=1,_z=1,Az=0,qz=0,Nz=0,Fz=0,Gz=0,Uz=100,Dz=900,Wz=100,Lz=900,Kz=0,$z=0,Hz=0,Zz=0,eC=n({v:o(),format:n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["hd","fhd","4k"]).optional(),platform:e().optional()}),tracks:c(n({id:e().min(1),kind:a(["video","audio","image","overlay","effect"]),name:e().optional(),enabled:h().optional(),contents:c(x([n({id:e().min(1),startTime:o().min(ez),duration:o(),source:x([n({kind:m("media"),mediaId:e().min(1),trim:n({start:o().min(oz),end:o().min(tz)}).optional(),excludedRanges:c(n({start:o().min(nz),end:o().min(rz),reason:e().optional()})).optional(),volume:o().min(sz).max(iz).optional(),muted:h().optional(),playbackRate:o().optional(),sync:a(["video","independent"]).optional(),kenBurns:a(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:o().optional(),fadeInMs:o().min(az).optional(),fadeOutMs:o().min(dz).optional(),loop:h().optional(),reframe:n({segments:c(n({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([n({mode:m("frame-center")}),n({mode:m("point"),x:o().min(cz).max(mz),y:o().min(lz).max(uz)}),n({mode:m("face"),faceId:e().min(1),shotScale:a(["close","standard","wide"]).optional()}),n({mode:m("all-faces")}),n({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(fz).max(gz).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). Default 1."),ease:n({in:o().min(hz).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:o().min(zz).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:n({x:o().min(xz).max(yz).describe("Horizontal nudge, source-normalized (+ = right)."),y:o().min(bz).max(Sz).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()}),n({kind:m("component"),componentId:e().min(1),props:u(e(),g())}),n({kind:m("overlay"),primitiveId:e().min(1),params:u(e(),g()),zPlane:a(["front","behind-subject"]).optional(),anchor:n({space:m("scene"),x:o().min(Cz).max(vz),y:o().min(Rz).max(Iz)}).optional(),parallax:o().min(kz).max(Oz).optional()}),n({kind:m("effect"),primitiveId:e().min(1),params:u(e(),g()).optional()}),n({kind:m("card"),html:e().min(1),tokens:u(e(),e()).optional(),zPlane:m("front").optional()})]),kind:a(["video","audio","image","overlay","effect"]).optional(),opacity:o().min(wz).max(Tz).optional(),scale:o().optional(),rotation:o().optional(),position:n({x:o(),y:o()}).optional(),region:n({x:o().min(Bz).max(Mz),y:o().min(jz).max(Pz),w:o().max(Ez),h:o().max(_z)}).optional(),fit:a(["cover","contain"]).optional(),effects:c(n({primitiveId:e().min(1),params:u(e(),g()).optional()})).optional(),transitionIn:n({type:e().min(1),duration:o()}).optional()}),n({id:e().min(1),startTime:o().min(Az),duration:o()})]))})),markers:c(n({id:e().min(1),startTime:o().min(qz),endTime:o().min(Nz).optional(),kind:e().min(1),name:e().optional(),metadata:u(e(),g()).optional()})).optional(),captions:n({segments:c(n({words:c(n({text:e().min(1),startMs:o().min(Fz),endMs:o().min(Gz),emphasis:h().optional(),annotate:a(["circle","underline"]).optional()}))})),style:n({fontFamily:e().min(1).optional(),fontSize:o().optional(),fontWeight:o().min(Uz).max(Dz).optional(),color:e().min(1).optional(),highlightColor:e().min(1).optional(),backgroundColor:e().optional(),plate:a(["glass","solid","none"]).optional(),position:a(["top","center","bottom"]).optional(),textTransform:a(["none","uppercase","capitalize"]).optional(),emphasisColor:e().optional(),emphasisGradient:e().optional(),emphasisScale:o().optional(),emphasisFontFamily:e().optional(),emphasisFontWeight:o().min(Wz).max(Lz).optional(),emphasisTextTransform:a(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:o().optional(),emphasisFontStyle:a(["normal","italic"]).optional(),entrance:a(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:o().min(Kz).optional(),entranceStaggerMs:o().min($z).optional(),exitMs:o().min(Hz).optional(),emphasisPlate:h().optional(),emphasisPlateColor:e().optional(),emphasisPlateTextColor:e().optional(),emphasisPlateAltColor:e().optional(),emphasisPlateAltTextColor:e().optional(),emphasisPlateRadius:o().min(Zz).optional(),emphasisPlatePadX:o().optional(),emphasisPlatePadY:o().optional(),annotationColor:e().optional(),maxWidthPercent:o().optional()}).optional()}).optional(),license:n({type:e().min(1),source:e().optional(),notes:e().optional()}).optional(),accessibility:n({audioDescriptionTrackId:e().optional(),captionsTrackId:e().optional(),signLanguageTrackId:e().optional(),notes:e().optional()}).optional()}).describe("Canonical composition wire shape (multi-track; carries reframe, captions, markers)."),oC=n({valid:h(),errors:c(n({code:e(),stage:e(),category:e(),retryable:h(),message:e(),fix:u(e(),g()).optional()})),quote:n({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.")}),tC=n({id:e(),compositionId:e()});var rC=n({id:e()}),sC=n({clipSuggestionId:e().min(1)}).describe("POST /projects/:id/exports/{fcpxml,premiere} body."),iC=n({id:e()}),aC=n({clipSuggestionId:e().min(1)}).describe("POST /projects/:id/exports/{fcpxml,premiere} body."),dC=n({id:e(),exportId:e()}),Vz=0,Jz=1,pC=n({id:e(),format:a(["fcpxml","premiere"]),status:a(["queued","trimming","building","uploading","complete","error","cancelled"]),progress:o().min(Vz).max(Jz).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([n({phase:a(["trim","build","upload","trigger"]),message:e(),detail:e().optional(),retryable:h()}),L()]).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 Yz=200,Xz=50,mC=n({query:e().min(1).max(Yz),perPage:o().max(Xz).optional()}).describe("POST /fonts/search body."),lC=n({results:c(n({family:e(),category:e().optional(),variants:c(e()).optional(),cssUrl:e().optional(),previewText:e().optional()}))}).describe("POST /fonts/search response.");var fC=n({status:a(["ok","degraded"]),version:e(),checks:u(e(),n({ok:h(),detail:e().optional()})).optional()}).describe("Health probe response."),gC=n({orgId:e(),permissions:u(e(),c(e())),keyId:e(),keyName:e()}).describe("Whoami response."),hC=n({});var Qz=500,ex=10737418240,xC=n({filename:e().min(1).max(Qz),contentType:a(["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(ex)}).describe("POST /media upload initiation body."),yC=n({data:c(n({id:e(),status:e(),source:a(["upload","generated"]),name:e(),mimeType:e(),fileSize:o(),duration:o().nullable(),width:o().nullable(),height:o().nullable(),frameRate:o().nullable(),progress:n({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:c(e()).nullable(),attribution:n({provider:a(["pexels","pixabay","freesound","klipy"]),externalId:e().nullable(),assetUrl:e().nullable(),license:e().nullable()}).nullable(),processingStatus:x([n({phase:a(["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()}),L()]),createdAt:e(),updatedAt:e()}).describe("Media item response per \xA7Media.")),pagination:n({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}),ox=1e4,bC=n({generator:a(["manim","text-to-video","text-to-image","image-to-video","auto"]),prompt:e().min(1).max(ox),style:u(e(),g()).optional(),refs:n({firstFrameMediaId:e().optional(),lastFrameMediaId:e().optional(),imageMediaIds:c(e()).optional()}).optional()}).describe("POST /media/generate body."),tx=2048,nx=500,rx=10737418240,SC=n({url:e().url().max(tx),filename:e().min(1).max(nx),contentType:a(["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(rx).optional()}).describe("POST /media/import body."),CC=n({id:e()}),vC=n({id:e()}),RC=n({id:e(),status:e(),source:a(["upload","generated"]),name:e(),mimeType:e(),fileSize:o(),duration:o().nullable(),width:o().nullable(),height:o().nullable(),frameRate:o().nullable(),progress:n({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:c(e()).nullable(),attribution:n({provider:a(["pexels","pixabay","freesound","klipy"]),externalId:e().nullable(),assetUrl:e().nullable(),license:e().nullable()}).nullable(),processingStatus:x([n({phase:a(["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()}),L()]),createdAt:e(),updatedAt:e()}).describe("Media item response per \xA7Media."),IC=n({id:e()}),kC=n({mediaItemId:e(),language:e().nullable(),model:e().nullable(),fullText:e(),utterances:c(u(e(),g())),data:c(u(e(),g())).optional(),pagination:n({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).optional().describe("Cursor pagination metadata.")}).describe("Transcript response."),OC=n({id:e()}),wC=n({mediaId:e(),durationSec:o().nullable(),width:o().nullable(),height:o().nullable(),thumbnail:n({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:n({status:a(["ready","not_detected"]),windows:c(n({window:n({startSec:o(),endSec:o()}),faces:c(n({faceId:e(),bbox:n({x:o(),y:o(),width:o(),height:o()}),speakingShare:o().optional()}))}))}),transcript:n({status:a(["ready","not_transcribed","unavailable"]),data:x([n({mediaItemId:e(),language:e().nullable(),model:e().nullable(),fullText:e(),utterances:c(u(e(),g())),data:c(u(e(),g())).optional(),pagination:n({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).optional().describe("Cursor pagination metadata.")}).describe("Transcript response."),L()])})}).describe("Read-only authoring context for a source media item: detected face roster + transcript."),TC=n({id:e()}),BC=n({id:e()}),MC=n({media:n({id:e(),name:e(),createdAt:e(),fileSize:o(),duration:o().nullable(),status:e()}),window:n({startIso:e(),endIso:e()}),workflowCount:o(),workflows:c(n({name:e(),startedAt:e(),durationMs:o(),activities:c(n({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 sx=0,PC=n({data:c(n({id:e(),name:e(),description:e().nullable(),format:x([n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["hd","fhd","4k"]).optional()}).describe("Output-format spec per \xA7Format."),L()]),brandKitId:e().nullable(),activeCompositionId:e().nullable(),composition:n({hasComposition:h(),sceneCount:o().min(sx),duration:o().nullable(),updatedAt:e().nullable()}).describe("Summary of a project's stored composition."),lastRender:n({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:n({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}),ix=200,EC=n({name:e().min(1).max(ix),description:e().optional(),format:n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["hd","fhd","4k"]).optional()}).optional().describe("Output-format spec per \xA7Format."),brandKitId:e().min(1).optional(),width:o().optional(),height:o().optional()}).describe("POST /projects body."),_C=n({id:e()}),ax=0,AC=n({id:e(),name:e(),description:e().nullable(),format:x([n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["hd","fhd","4k"]).optional()}).describe("Output-format spec per \xA7Format."),L()]),brandKitId:e().nullable(),activeCompositionId:e().nullable(),composition:n({hasComposition:h(),sceneCount:o().min(ax),duration:o().nullable(),updatedAt:e().nullable()}).describe("Summary of a project's stored composition."),lastRender:n({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."),qC=n({id:e()}),dx=200,NC=n({name:e().min(1).max(dx).optional(),description:e().optional(),format:n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["hd","fhd","4k"]).optional()}).optional().describe("Output-format spec per \xA7Format."),brandKitId:e().min(1).optional()}).describe("PATCH /projects/:id body."),px=0,FC=n({id:e(),name:e(),description:e().nullable(),format:x([n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["hd","fhd","4k"]).optional()}).describe("Output-format spec per \xA7Format."),L()]),brandKitId:e().nullable(),activeCompositionId:e().nullable(),composition:n({hasComposition:h(),sceneCount:o().min(px),duration:o().nullable(),updatedAt:e().nullable()}).describe("Summary of a project's stored composition."),lastRender:n({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."),GC=n({id:e()});var DC=n({id:e()}),WC=n({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:n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["hd","fhd","4k"]).optional()}).optional().describe("Output-format spec per \xA7Format."),priority:a(["interactive","standard","background"]).optional(),intent:a(["preview","final"]).optional(),brandKitId:e().min(1).nullish()}).describe("POST /projects/:id/renders body."),LC=n({id:e()}),cx=0,mx=0,KC=n({data:c(n({id:e(),status:a(["queued","pending","rendering","complete","error","cancelled"]),progress:n({phase:a(["queued","validating","presigning","collecting-artifacts","resolving","detecting","baking-matte","translating","spawning","encoding","uploading"]),percent:o(),scenesCompleted:o().min(cx).optional(),scenesTotal:o().min(mx).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:c(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:n({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}),$C=n({id:e()}),lx=0,HC=n({fromSec:o().min(lx).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.")}).describe("POST /projects/:id/preview-clip body."),ZC=n({id:e(),renderId:e()}),ux=0,fx=0,VC=n({id:e(),status:a(["queued","pending","rendering","complete","error","cancelled"]),progress:n({phase:a(["queued","validating","presigning","collecting-artifacts","resolving","detecting","baking-matte","translating","spawning","encoding","uploading"]),percent:o(),scenesCompleted:o().min(ux).optional(),scenesTotal:o().min(fx).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:c(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."),JC=n({id:e(),renderId:e()}),gx=0,hx=0,YC=n({id:e(),status:a(["queued","pending","rendering","complete","error","cancelled"]),progress:n({phase:a(["queued","validating","presigning","collecting-artifacts","resolving","detecting","baking-matte","translating","spawning","encoding","uploading"]),percent:o(),scenesCompleted:o().min(gx).optional(),scenesTotal:o().min(hx).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:c(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."),XC=n({id:e(),renderId:e()}),QC=n({id:e(),renderId:e()}),ev=n({outputUrl:e(),outputExpiresAt:e()}).describe("POST /refresh-url response."),ov=n({id:e(),renderId:e()});var zx=200,xx=50,nv=n({query:e().min(1).max(zx),kind:a(["video","photo","sfx","gif"]).optional(),provider:a(["pexels","pixabay","freesound","klipy"]).optional(),limit:o().max(xx).optional()}).describe("POST /resources/search body."),rv=n({provider:a(["pexels","pixabay","freesound","klipy"]),kind:a(["video","photo","sfx","gif"]),candidates:c(n({candidateId:e(),provider:a(["pexels","pixabay","freesound","klipy"]),kind:a(["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."),sv=n({projectId:e().min(1),candidateId:e().min(1)}).describe("POST /resources/import body.");var av=n({id:e()}),dv=n({projectId:e(),groupId:e(),selectorVersion:e(),signalVersions:u(e(),e()),moments:c(n({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:c(n({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:c(e())}))})),recommendation:n({cutSchedule:c(n({startSec:o(),endSec:o(),candidateId:e(),sourceInSec:o().describe("Chosen source window start (declared-offset resolved)."),sourceOutSec:o(),reasons:c(e())})),audioBed:c(n({startSec:o(),endSec:o(),candidateId:e().describe("The chosen audio source (the clearest mic) for this span \u2192 programAudioSourceId."),reasons:c(e())})).describe("Best-audio bed (instance #3): the clearest mic per span."),suppressedSwitches:c(n({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."),pv=n({id:e()}),yx=0,bx=0,Sx=0,cv=n({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(yx).optional(),switchMargin:o().min(bx).optional(),cooldownSec:o().min(Sx).optional(),maxHoldSec:o().optional(),lockSourceId:e().optional().describe("Pin a camera/angle for the whole timeline."),overrides:c(n({startSec:o(),endSec:o(),candidateId:e()})).optional()}),mv=n({projectId:e(),groupId:e(),selectorVersion:e(),signalVersions:u(e(),e()),moments:c(n({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:c(n({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:c(e())}))})),recommendation:n({cutSchedule:c(n({startSec:o(),endSec:o(),candidateId:e(),sourceInSec:o().describe("Chosen source window start (declared-offset resolved)."),sourceOutSec:o(),reasons:c(e())})),audioBed:c(n({startSec:o(),endSec:o(),candidateId:e().describe("The chosen audio source (the clearest mic) for this span \u2192 programAudioSourceId."),reasons:c(e())})).describe("Best-audio bed (instance #3): the clearest mic per span."),suppressedSwitches:c(n({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 Cx=0,uv=n({data:c(n({id:e(),name:e(),fileCount:o().min(Cx),muxStatus:e().nullable(),createdAt:e()}).describe("Session list summary (per list endpoint).")),pagination:n({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}),vx=200,Rx=50,Ix=20,fv=n({name:e().min(1).max(vx),files:c(n({mediaId:e().min(1),role:e().min(1).max(Rx)})).min(1).max(Ix)}).describe("POST /sessions body."),gv=n({id:e()}),hv=n({id:e(),name:e(),files:c(n({mediaId:e(),role:e(),status:e().nullable()}).describe("One file member of a session, with optional role + status.")),mux:n({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."),zv=n({id:e()}),xv=n({id:e()}),yv=n({id:e()}),bv=n({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 Cv=n({skills:c(n({name:e(),title:e(),description:e()}).describe("A CueFrame agent skill (metadata)."))}).describe("GET /skills response \u2014 the available agent skills."),vv=n({name:e()});var kx=0,Ox=0,Iv=n({data:c(n({id:e(),url:e().url(),events:c(a(["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(kx),enabled:h(),verificationStatus:a(["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(Ox)}).describe("Webhook endpoint record (secret omitted after create).")),pagination:n({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}),wx=0,Tx=6e4,kv=n({url:e().min(1),events:c(a(["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(wx).max(Tx).optional()}).describe("POST /webhooks body."),Ov=n({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:c(n({event:a(["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."),wv=n({id:e()}),Bx=0,Mx=0,Tv=n({id:e(),url:e().url(),events:c(a(["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(Bx),enabled:h(),verificationStatus:a(["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(Mx)}).describe("Webhook endpoint record (secret omitted after create)."),Bv=n({id:e()}),jx=0,Px=6e4,Mv=n({url:e().min(1).optional(),events:c(a(["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(jx).max(Px).optional(),enabled:h().optional()}).describe("PATCH /webhooks/:id body."),Ex=0,_x=0,jv=n({id:e(),url:e().url(),events:c(a(["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(Ex),enabled:h(),verificationStatus:a(["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(_x)}).describe("Webhook endpoint record (secret omitted after create)."),Pv=n({id:e()}),Ev=n({id:e()}),_v=n({id:e()}),Av=n({id:e(),status:a(["active","pending"]).describe("active = ownership verified + receiving events; pending = challenge not echoed."),verification:n({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 Ax=2048,Nv=n({videoUrl:e().url().max(Ax),format:n({aspectRatio:a(["16:9","9:16","1:1","4:5"]),fps:x([o(),o(),o()]).optional(),resolution:a(["hd","fhd","4k"]).optional()}).optional().describe("Output-format spec per \xA7Format.")});import{readFileSync as Nx,writeFileSync as Fx,mkdirSync as Gx,existsSync as Ux}from"fs";import{join as nt}from"path";import{homedir as Dx}from"os";var rt=nt(Dx(),".cueframe"),Ze=nt(rt,"auth.json"),Te={local:"http://127.0.0.1:3211",dev:"https://api-dev.cueframe.ai",prod:"https://api.cueframe.ai"},Wx="prod";function zU(r=Wx){return process.env.CUEFRAME_API_URL??Te[r]??Te.prod}function st(){return Ux(Ze)?JSON.parse(Nx(Ze,"utf-8")):{targets:{}}}function Lx(r){Gx(rt,{recursive:!0}),Fx(Ze,JSON.stringify(r,null,2))}function xU(r,t="prod",s){let i=st(),d=Te[t]??Te.prod;i.targets[t]={apiKey:r,apiUrl:s??d},Lx(i)}function it(r="prod"){let t=process.env.CUEFRAME_API_KEY,s=process.env.CUEFRAME_API_URL;if(t)return{apiKey:t,apiUrl:s??Te[r]??Te.prod};let d=st().targets[r];return d||(console.error(`No auth configured for target "${r}". Run: cueframe auth <api-key> --target ${r}`),process.exit(1)),d}function at(r){let{apiKey:t,apiUrl:s}=it(r);De({baseUrl:s,apiKey:t})}function dt(r){let t=r instanceof N?`${r.message} (${r.code}${r.status?`, ${r.status}`:""})`:r instanceof Error?r.message:String(r),s=Le(r);return s?`${t}
|
|
9
|
+
\u2192 ${s}`:t}var q={Success:0,UserError:2,ApiClientError:3,ApiServerError:4,NetworkError:5,PaymentRequired:6};function Ve(r){if(r instanceof N){if(r.status===402)return q.PaymentRequired;if(r.status>=500)return q.ApiServerError;if(r.status>=400)return q.ApiClientError}return q.NetworkError}function RU(r){return r===402?q.PaymentRequired:r>=500?q.ApiServerError:r>=400?q.ApiClientError:q.Success}function _e(r){process.exit(r)}import Kx from"ora";import $x from"pino";var Hx="v1",pt=$x({level:"trace",base:{schemaVersion:Hx},messageKey:"event",timestamp:()=>`,"ts":${Date.now()}`,formatters:{level:()=>({_:0})}});function Je(r,t){return Kx({text:r,isSilent:!!t}).start()}function Be(r,t,s={}){r.json&&pt.info(s,t)}function wU(r,t,s){if(r.json){console.log(JSON.stringify(t,null,2));return}s()}function Ae(r,t,s,i){let d=s instanceof Error?s.message:String(s),p=typeof s?.code=="string"?s.code:void 0,l=s?.status;r.json?pt.info({phase:t,message:d,...p?{code:p}:{},...typeof l=="number"?{status:l}:{},exitCode:i},"error"):process.stderr.write(`\u2716 ${t}: ${d}
|
|
10
|
+
`)}function TU(r,t){t.json||console.log(r)}function Zx(r){for(let t=0;t<r.length;t++){let s=r.charCodeAt(t);if(s<=31||s===127)return!0}return!1}function mt(r,t,s){r.length===0&&ct(`${t} is empty.`,s),Zx(r)&&ct(`${t} contains a control character (newline, tab, or null byte). Identifiers must be plain text \u2014 check for a stray copy-paste artifact.`,s)}function ct(r,t){Ae(t,"preflight",new Error(r),q.UserError),_e(q.UserError)}var Vx=5e3,Ye=300*1e3;async function FU(r,t){if(mt(r,"mediaItemId",t),t.dryRun){Be(t,"analyze_dry_run",{mediaItemId:r,target:t.target,wait:!!t.wait,wouldCall:"POST /v1/media/:id/suggestions"}),t.json||console.log(`[dry-run] Would trigger clip analysis for ${r} on ${t.target}.`);return}at(t.target),Be(t,"analyze_prepare",{mediaItemId:r,target:t.target,wait:!!t.wait});let s=Je("Triggering clip analysis\u2026",t.json),i;try{i=await Me.suggestBriefs(r),s.succeed(i.workflowId?`Analysis started (workflow: ${i.workflowId})`:`Analysis ${i.alreadyRunning?"already running":"started"}`)}catch(l){s.fail(`Failed to start analysis: ${dt(l)}`),Ae(t,"analyze_prepare",l,Ve(l)),_e(Ve(l))}if(Be(t,"analyze_ready",{mediaItemId:r,workflowId:i.workflowId,alreadyRunning:!!i.alreadyRunning}),!t.wait){t.json||console.log(`
|
|
11
|
+
Run \`cueframe clips ${r}\` to check results.`);return}let d=Je("Waiting for analysis to complete\u2026",t.json),p=Date.now();for(;;){await new Promise(l=>setTimeout(l,Vx)),Date.now()-p>Ye&&(d.fail(`Timed out after ${Math.round(Ye/1e3)}s. Run \`cueframe clips ${r}\` to check later.`),Ae(t,"analyze_progress",new Error(`Analysis did not complete within ${Math.round(Ye/1e3)}s`),q.UserError),_e(q.UserError));try{let l=await Me.listMediaSuggestions(r);if(l.suggestions.length>0){d.succeed(`Analysis complete \u2014 ${l.suggestions.length} clips found`),Be(t,"analyze_complete",{mediaItemId:r,durationMs:Date.now()-p,suggestionCount:l.suggestions.length,suggestions:l.suggestions}),t.json||l.suggestions.forEach((y,S)=>{let k=(y.trim.end-y.trim.start).toFixed(1);console.log(`
|
|
12
|
+
${S+1}. ${y.title} (${y.id})`),console.log(` ${y.trim.start.toFixed(1)}s \u2013 ${y.trim.end.toFixed(1)}s (${k}s) score: ${y.score}`),console.log(` ${y.reason}`)});return}let f=Math.round((Date.now()-p)/1e3);d.text=`Waiting for analysis\u2026 (${f}s)`,Be(t,"analyze_progress",{mediaItemId:r,elapsedSec:f})}catch{}}}export{Je as a,Be as b,wU as c,Ae as d,TU as e,N as f,De as g,We as h,Qe as i,v as j,Le as k,xt as l,mo as m,zo as n,ko as o,Bo as p,qo as q,Wo as r,Me as s,tt as t,q as u,Ve as v,RU as w,_e as x,mt as y,zU as z,xU as A,at as B,dt as C,FU as D};
|