@nativestudio/sdk 0.3.0-rc.2 → 0.3.0-rc.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (282) hide show
  1. package/COMPATIBILITY.json +4 -4
  2. package/LICENSE +201 -21
  3. package/dist/_chunks/chunk-2QDPFLIO.js +1 -0
  4. package/dist/_chunks/chunk-7DXSLHXW.js +1 -0
  5. package/dist/_chunks/chunk-AFUVP2DC.js +1 -0
  6. package/dist/_chunks/chunk-ASUZJSEP.js +1 -0
  7. package/dist/_chunks/chunk-K3TIFCD3.js +1 -0
  8. package/dist/_chunks/chunk-NNDKZ5H5.js +1 -0
  9. package/dist/_chunks/chunk-Q53Q74OP.js +1 -0
  10. package/dist/_chunks/chunk-QVP4AMRJ.js +1 -0
  11. package/dist/_chunks/chunk-TT7IA5HB.js +1 -0
  12. package/dist/_chunks/chunk-UKPD77FB.js +1 -0
  13. package/dist/_chunks/chunk-V636KA7B.js +1 -0
  14. package/dist/_chunks/chunk-VXBIT7XN.js +1 -0
  15. package/dist/_chunks/chunk-WNXKJRZ6.js +1 -0
  16. package/dist/_types/contracts/agent-execution-lifecycle.d.ts +55 -43
  17. package/dist/_types/contracts/agent-execution-oauth.d.ts +2 -2
  18. package/dist/_types/contracts/agent-execution-registration.d.ts +59 -15
  19. package/dist/_types/contracts/agent-execution-selection.d.ts +7 -7
  20. package/dist/_types/contracts/agent-host-contract.d.ts +189 -0
  21. package/dist/_types/contracts/agent-host-execution.d.ts +92 -61
  22. package/dist/_types/contracts/agent-host-generic-transport.d.ts +4 -4
  23. package/dist/_types/contracts/agent-host-legacy-release.d.ts +31 -0
  24. package/dist/_types/contracts/agent-host-protocol.d.ts +71 -0
  25. package/dist/_types/contracts/agent-host-wire.d.ts +263 -0
  26. package/dist/_types/contracts/agent-host.d.ts +126 -65
  27. package/dist/_types/contracts/artifact-discovery.d.ts +143 -11
  28. package/dist/_types/contracts/audio.d.ts +166 -0
  29. package/dist/_types/contracts/component-status.d.ts +241 -0
  30. package/dist/_types/contracts/composition-authoring.d.ts +8 -8
  31. package/dist/_types/contracts/composition-frame-render.d.ts +4 -4
  32. package/dist/_types/contracts/composition-observation.d.ts +1 -1
  33. package/dist/_types/contracts/composition-render-base.d.ts +5 -4
  34. package/dist/_types/contracts/composition-render.d.ts +8 -8
  35. package/dist/_types/contracts/composition-repair.d.ts +10 -10
  36. package/dist/_types/contracts/composition-source-review.d.ts +13 -13
  37. package/dist/_types/contracts/consistency-profile.d.ts +102 -6
  38. package/dist/_types/contracts/continuity-evaluation.d.ts +1 -1
  39. package/dist/_types/contracts/delivery-completion.d.ts +1 -1
  40. package/dist/_types/contracts/delivery-manifest.d.ts +25 -11729
  41. package/dist/_types/contracts/delivery-operations.d.ts +207 -3915
  42. package/dist/_types/contracts/delivery-summary.d.ts +4 -4
  43. package/dist/_types/contracts/delivery-validation.d.ts +25 -2
  44. package/dist/_types/contracts/device-onboarding.d.ts +35 -0
  45. package/dist/_types/contracts/device-render.d.ts +113 -0
  46. package/dist/_types/contracts/editor-intelligence.d.ts +392 -2531
  47. package/dist/_types/contracts/enterprise-brand.d.ts +302 -0
  48. package/dist/_types/contracts/exploration-recommendation.d.ts +263 -11607
  49. package/dist/_types/contracts/external-agent-access.d.ts +4 -6
  50. package/dist/_types/contracts/federation-event-link-receiver.d.ts +200 -0
  51. package/dist/_types/contracts/federation-event-link.d.ts +485 -0
  52. package/dist/_types/contracts/federation-result.d.ts +239 -0
  53. package/dist/_types/contracts/final-ready.d.ts +24 -24
  54. package/dist/_types/contracts/final-render.d.ts +1742 -6949
  55. package/dist/_types/contracts/human-identity.d.ts +13 -0
  56. package/dist/_types/contracts/human-links.d.ts +58 -0
  57. package/dist/_types/contracts/index.d.ts +26 -0
  58. package/dist/_types/contracts/interface/common.d.ts +18 -0
  59. package/dist/_types/contracts/interface/execution-output.d.ts +9 -6
  60. package/dist/_types/contracts/interface/media-output.d.ts +118 -0
  61. package/dist/_types/contracts/interface/operation.d.ts +89 -0
  62. package/dist/_types/contracts/interface/production-snapshot.d.ts +106 -199
  63. package/dist/_types/contracts/interface/query.d.ts +85 -0
  64. package/dist/_types/contracts/keyframe-generation.d.ts +31 -2
  65. package/dist/_types/contracts/keyframe-review.d.ts +7 -7
  66. package/dist/_types/contracts/lifecycle-event-projections.d.ts +19 -4
  67. package/dist/_types/contracts/lifecycle-events.d.ts +54 -2
  68. package/dist/_types/contracts/local-execution/agent-component-status.d.ts +109 -0
  69. package/dist/_types/contracts/local-execution/agent-context.d.ts +385 -0
  70. package/dist/_types/contracts/local-execution/agent-evidence.d.ts +79 -0
  71. package/dist/_types/contracts/local-execution/agent-grant.d.ts +31 -0
  72. package/dist/_types/contracts/local-execution/agent-review.d.ts +529 -71
  73. package/dist/_types/contracts/local-execution/audio-profile.d.ts +6 -0
  74. package/dist/_types/contracts/local-execution/common.d.ts +12 -11
  75. package/dist/_types/contracts/local-execution/completion.d.ts +41 -45
  76. package/dist/_types/contracts/local-execution/components.d.ts +45 -0
  77. package/dist/_types/contracts/local-execution/cpu-preparation.d.ts +46 -0
  78. package/dist/_types/contracts/local-execution/cpu-resources.d.ts +55 -0
  79. package/dist/_types/contracts/local-execution/cpu-speech-job.d.ts +70 -0
  80. package/dist/_types/contracts/local-execution/cpu-speech.d.ts +161 -0
  81. package/dist/_types/contracts/local-execution/descriptor.d.ts +38 -0
  82. package/dist/_types/contracts/local-execution/device-authority.d.ts +31 -0
  83. package/dist/_types/contracts/local-execution/device-inventory.d.ts +108 -0
  84. package/dist/_types/contracts/local-execution/device-workspace.d.ts +11 -0
  85. package/dist/_types/contracts/local-execution/device.d.ts +24 -55
  86. package/dist/_types/contracts/local-execution/enrollment-credential.d.ts +141 -0
  87. package/dist/_types/contracts/local-execution/enrollment-handoff.d.ts +44 -0
  88. package/dist/_types/contracts/local-execution/external-generation.d.ts +199 -0
  89. package/dist/_types/contracts/local-execution/index.d.ts +36 -0
  90. package/dist/_types/contracts/local-execution/ipc.d.ts +2809 -231
  91. package/dist/_types/contracts/local-execution/library-command.d.ts +620 -0
  92. package/dist/_types/contracts/local-execution/library-result.d.ts +428 -0
  93. package/dist/_types/contracts/local-execution/library.d.ts +873 -0
  94. package/dist/_types/contracts/local-execution/lifecycle.d.ts +262 -48
  95. package/dist/_types/contracts/local-execution/local-navigation.d.ts +304 -67
  96. package/dist/_types/contracts/local-execution/management.d.ts +407 -0
  97. package/dist/_types/contracts/local-execution/media-recipe.d.ts +207 -0
  98. package/dist/_types/contracts/local-execution/media-validation-request.d.ts +232 -0
  99. package/dist/_types/contracts/local-execution/media-validation.d.ts +262 -0
  100. package/dist/_types/contracts/local-execution/object-transfer.d.ts +155 -0
  101. package/dist/_types/contracts/local-execution/offline.d.ts +59 -0
  102. package/dist/_types/contracts/local-execution/preview.d.ts +177 -3561
  103. package/dist/_types/contracts/local-execution/processor-capability.d.ts +49 -0
  104. package/dist/_types/contracts/local-execution/processor-direct.d.ts +290 -0
  105. package/dist/_types/contracts/local-execution/processor-recipes.d.ts +1194 -0
  106. package/dist/_types/contracts/local-execution/processor-toolchain.d.ts +47 -0
  107. package/dist/_types/contracts/local-execution/processor.d.ts +6424 -0
  108. package/dist/_types/contracts/local-execution/project-source-direct.d.ts +201 -0
  109. package/dist/_types/contracts/local-execution/qwen-tts.d.ts +31 -0
  110. package/dist/_types/contracts/local-execution/recognition.d.ts +170 -0
  111. package/dist/_types/contracts/local-execution/speech.d.ts +95 -0
  112. package/dist/_types/contracts/local-execution/tool-selection.d.ts +71 -5
  113. package/dist/_types/contracts/local-execution/whisper.d.ts +24 -0
  114. package/dist/_types/contracts/local-execution/work.d.ts +124 -3402
  115. package/dist/_types/contracts/local-execution/workspace.d.ts +141 -0
  116. package/dist/_types/contracts/mcp-capabilities.d.ts +16 -0
  117. package/dist/_types/contracts/media-category.d.ts +11 -0
  118. package/dist/_types/contracts/media-observation.d.ts +930 -9
  119. package/dist/_types/contracts/native-speech-model.d.ts +53 -0
  120. package/dist/_types/contracts/native-speech-options.d.ts +25 -0
  121. package/dist/_types/contracts/native-tool-authority.d.ts +25 -21
  122. package/dist/_types/contracts/native-tool-execution.d.ts +60 -39
  123. package/dist/_types/contracts/navigation-context.d.ts +76 -8
  124. package/dist/_types/contracts/navigation-groups.d.ts +2 -2
  125. package/dist/_types/contracts/navigation.d.ts +79 -26
  126. package/dist/_types/contracts/observation-profile.d.ts +3 -3
  127. package/dist/_types/contracts/production-creation.d.ts +30 -0
  128. package/dist/_types/contracts/production-feedback.d.ts +452 -0
  129. package/dist/_types/contracts/production.d.ts +30 -0
  130. package/dist/_types/contracts/programmatic-composition.d.ts +24 -24
  131. package/dist/_types/contracts/programmatic-exploration.d.ts +362 -5999
  132. package/dist/_types/contracts/programmatic-video-review.d.ts +5 -5
  133. package/dist/_types/contracts/project-library.d.ts +30 -0
  134. package/dist/_types/contracts/project.d.ts +30 -0
  135. package/dist/_types/contracts/provider-catalog.d.ts +3 -3
  136. package/dist/_types/contracts/provider-models.d.ts +209 -8
  137. package/dist/_types/contracts/provider.d.ts +66 -1
  138. package/dist/_types/contracts/reference-preview.d.ts +20 -0
  139. package/dist/_types/contracts/render-readiness.d.ts +175 -0
  140. package/dist/_types/contracts/repair-lifecycle.d.ts +64 -396
  141. package/dist/_types/contracts/repair-plan.d.ts +18 -100
  142. package/dist/_types/contracts/repair-strategy.d.ts +163 -4478
  143. package/dist/_types/contracts/review-intelligence-final-output.d.ts +418 -8150
  144. package/dist/_types/contracts/review-intelligence.d.ts +455 -11423
  145. package/dist/_types/contracts/review1-repair-source.d.ts +6 -6
  146. package/dist/_types/contracts/review1-repair-strategy.d.ts +4 -4
  147. package/dist/_types/contracts/rough-cut-manifest.d.ts +27 -7
  148. package/dist/_types/contracts/rough-cut-profile.d.ts +12 -3
  149. package/dist/_types/contracts/rough-cut-review.d.ts +144 -12495
  150. package/dist/_types/contracts/rough-cut.d.ts +1170 -5673
  151. package/dist/_types/contracts/series-canon.d.ts +97 -0
  152. package/dist/_types/contracts/series-character.d.ts +23 -0
  153. package/dist/_types/contracts/series-improvement.d.ts +1639 -0
  154. package/dist/_types/contracts/series-standard.d.ts +1641 -0
  155. package/dist/_types/contracts/shares.d.ts +135 -0
  156. package/dist/_types/contracts/shot-preparation-basis.d.ts +2 -2
  157. package/dist/_types/contracts/shot-preparation.d.ts +4 -4
  158. package/dist/_types/contracts/sound-making-plan.d.ts +210 -2
  159. package/dist/_types/contracts/speech-cost.d.ts +96 -0
  160. package/dist/_types/contracts/speech-parameters.d.ts +39 -0
  161. package/dist/_types/contracts/speech.d.ts +603 -23
  162. package/dist/_types/contracts/temporal-evidence-operation.d.ts +2 -1
  163. package/dist/_types/contracts/timeline-audio.d.ts +20 -4
  164. package/dist/_types/contracts/timeline-manifest.d.ts +40 -8
  165. package/dist/_types/contracts/timeline-source-sound.d.ts +42 -4
  166. package/dist/_types/contracts/timeline-v2.d.ts +124 -16
  167. package/dist/_types/contracts/timeline-version-reader.d.ts +288 -40
  168. package/dist/_types/contracts/timeline-visual-layers.d.ts +124 -16
  169. package/dist/_types/contracts/timeline.d.ts +50 -4850
  170. package/dist/_types/contracts/transcription.d.ts +1 -1
  171. package/dist/_types/contracts/video-generation.d.ts +35 -2
  172. package/dist/_types/contracts/video-review.d.ts +7 -7
  173. package/dist/_types/contracts/visual-exploration.d.ts +3 -3
  174. package/dist/_types/contracts/visual-layer-render.d.ts +298 -47
  175. package/dist/_types/contracts/visual-sequence.d.ts +22 -0
  176. package/dist/_types/contracts/voice-consistency.d.ts +183 -0
  177. package/dist/_types/contracts/voice-profile/contracts.d.ts +821 -0
  178. package/dist/_types/contracts/voice-profile/identity.d.ts +27 -0
  179. package/dist/_types/contracts/voice-profile/interface.d.ts +89 -0
  180. package/dist/_types/contracts/voice-profile/reference.d.ts +106 -0
  181. package/dist/_types/contracts/voice-review.d.ts +1194 -0
  182. package/dist/_types/contracts/workspace.d.ts +83 -0
  183. package/dist/_types/sdk/account.d.ts +13 -0
  184. package/dist/_types/sdk/auxiliary-media.d.ts +1 -0
  185. package/dist/_types/sdk/catalog/agent-host-execution.d.ts +324 -112
  186. package/dist/_types/sdk/catalog/agent-host.d.ts +222 -70
  187. package/dist/_types/sdk/catalog/assembly.d.ts +26 -37628
  188. package/dist/_types/sdk/catalog/audio-caption.d.ts +126 -22
  189. package/dist/_types/sdk/catalog/canonical-repair.d.ts +132 -132
  190. package/dist/_types/sdk/catalog/carriers.d.ts +59 -0
  191. package/dist/_types/sdk/catalog/composition-source.d.ts +14 -14
  192. package/dist/_types/sdk/catalog/composition.d.ts +17 -2813
  193. package/dist/_types/sdk/catalog/core.d.ts +636 -18
  194. package/dist/_types/sdk/catalog/delivery.d.ts +12 -14167
  195. package/dist/_types/sdk/catalog/device-library.d.ts +1024 -0
  196. package/dist/_types/sdk/catalog/device-management.d.ts +921 -0
  197. package/dist/_types/sdk/catalog/discovery.d.ts +38 -4
  198. package/dist/_types/sdk/catalog/editor.d.ts +23 -6538
  199. package/dist/_types/sdk/catalog/enterprise-brand.d.ts +462 -0
  200. package/dist/_types/sdk/catalog/federation.d.ts +4164 -0
  201. package/dist/_types/sdk/catalog/generation.d.ts +284 -8
  202. package/dist/_types/sdk/catalog/imported-visual.d.ts +246 -816
  203. package/dist/_types/sdk/catalog/keyframe-review.d.ts +10 -10
  204. package/dist/_types/sdk/catalog/lifecycle-events.d.ts +442 -16
  205. package/dist/_types/sdk/catalog/mcp.d.ts +115 -7
  206. package/dist/_types/sdk/catalog/media-descriptors.d.ts +214 -11
  207. package/dist/_types/sdk/catalog/media-observation.d.ts +1031 -14
  208. package/dist/_types/sdk/catalog/native-tool-authority.d.ts +54 -24
  209. package/dist/_types/sdk/catalog/navigation.d.ts +379 -28
  210. package/dist/_types/sdk/catalog/planning-intelligence.d.ts +136 -8
  211. package/dist/_types/sdk/catalog/programmatic-exploration.d.ts +327 -9853
  212. package/dist/_types/sdk/catalog/programmatic-review.d.ts +8 -8
  213. package/dist/_types/sdk/catalog/provider.d.ts +394 -20
  214. package/dist/_types/sdk/catalog/reference-preview.d.ts +94 -30
  215. package/dist/_types/sdk/catalog/repair-strategy.d.ts +180 -8914
  216. package/dist/_types/sdk/catalog/reviewer.d.ts +276 -23131
  217. package/dist/_types/sdk/catalog/series-standard.d.ts +5402 -0
  218. package/dist/_types/sdk/catalog/shares.d.ts +305 -0
  219. package/dist/_types/sdk/catalog/shot-preparation.d.ts +51 -2972
  220. package/dist/_types/sdk/catalog/sound-making-plan.d.ts +6 -1776
  221. package/dist/_types/sdk/catalog/source-sync.d.ts +8 -498
  222. package/dist/_types/sdk/catalog/spec.d.ts +10 -2
  223. package/dist/_types/sdk/catalog/speech.d.ts +856 -4
  224. package/dist/_types/sdk/catalog/temporal-evidence.d.ts +4 -2
  225. package/dist/_types/sdk/catalog/video-review.d.ts +10 -10
  226. package/dist/_types/sdk/catalog/visual-exploration.d.ts +556 -440
  227. package/dist/_types/sdk/catalog/voice-profile.d.ts +1547 -0
  228. package/dist/_types/sdk/catalog/voice-review.d.ts +1125 -0
  229. package/dist/_types/sdk/client.d.ts +30 -3
  230. package/dist/_types/sdk/desktop-previews.d.ts +3 -3
  231. package/dist/_types/sdk/desktop-releases.d.ts +2 -2
  232. package/dist/_types/sdk/device-enrollment-handoff.d.ts +249 -0
  233. package/dist/_types/sdk/device-renders.d.ts +3751 -0
  234. package/dist/_types/sdk/direct-source.d.ts +147 -0
  235. package/dist/_types/sdk/errors.d.ts +9 -3
  236. package/dist/_types/sdk/federation-notice-result.d.ts +22 -0
  237. package/dist/_types/sdk/feedback-observer.d.ts +10 -0
  238. package/dist/_types/sdk/host-protocol.d.ts +8 -0
  239. package/dist/_types/sdk/image-media.d.ts +2 -2
  240. package/dist/_types/sdk/immutable-media.d.ts +24 -0
  241. package/dist/_types/sdk/index.d.ts +16 -1
  242. package/dist/_types/sdk/local-runtime/components.d.ts +2 -0
  243. package/dist/_types/sdk/local-runtime/device-client.d.ts +181 -19
  244. package/dist/_types/sdk/local-runtime/library.d.ts +268 -0
  245. package/dist/_types/sdk/local-runtime/workspace.d.ts +186 -0
  246. package/dist/_types/sdk/local-runtime-client.d.ts +1934 -96
  247. package/dist/_types/sdk/mcp-client.d.ts +13 -5
  248. package/dist/_types/sdk/mcp-discovery.d.ts +14 -0
  249. package/dist/_types/sdk/mcp-image.d.ts +4 -4
  250. package/dist/_types/sdk/mcp-port.d.ts +73 -0
  251. package/dist/_types/sdk/media.d.ts +11 -9
  252. package/dist/_types/sdk/navigation-client.d.ts +56 -122
  253. package/dist/_types/sdk/navigation-facade.d.ts +191 -17
  254. package/dist/_types/sdk/observe.d.ts +31 -0
  255. package/dist/_types/sdk/runtime-authority.d.ts +18 -8
  256. package/dist/_types/sdk/transport/http.d.ts +2 -0
  257. package/dist/_types/sdk/webhook-receiver.d.ts +38 -0
  258. package/dist/account.js +1 -1
  259. package/dist/errors.js +1 -1
  260. package/dist/host-protocol.d.ts +1 -0
  261. package/dist/host-protocol.js +1 -0
  262. package/dist/index.d.ts +2 -2
  263. package/dist/index.js +1 -1
  264. package/dist/local-runtime.js +1 -1
  265. package/dist/mcp-discovery.d.ts +1 -0
  266. package/dist/mcp-discovery.js +1 -0
  267. package/dist/native/helper.exe +0 -0
  268. package/dist/native/helper.json +1 -0
  269. package/dist/runtime-authority.js +1 -1
  270. package/package.json +10 -8
  271. package/README.md +0 -75
  272. package/dist/_chunks/chunk-34KSWLCI.js +0 -1
  273. package/dist/_chunks/chunk-4IOFVNFG.js +0 -1
  274. package/dist/_chunks/chunk-4M3AGNTZ.js +0 -1
  275. package/dist/_chunks/chunk-6NVIN2NI.js +0 -1
  276. package/dist/_chunks/chunk-7YCEMDNZ.js +0 -1
  277. package/dist/native/Bootstrap.ps1 +0 -90
  278. package/dist/native/JobNative.cs +0 -127
  279. package/dist/native/JobRunner.cs +0 -360
  280. package/dist/native/NativeMain.cs +0 -146
  281. package/dist/native/PipeBridge.cs +0 -260
  282. package/dist/native/PrivateAccess.cs +0 -152
@@ -1 +0,0 @@
1
- import{ArtifactIdSchema,ArtifactRepresentationIdSchema,BriefIdSchema,BriefVersionIdSchema,ContinuationSchema,ContinuityEdgeIdSchema,DeliveryOutputProfileSchema,OperationIdSchema,PrincipalIdSchema,ProductionIdSchema,ProjectIdSchema,QueryLimitSchema,QueryPageInfoSchema,SceneIdSchema,SceneShotPlanIdSchema,SceneShotPlanVersionIdSchema,ShotIdSchema,StoryIdSchema,StoryVersionIdSchema,TenantIdSchema}from"./chunk-4M3AGNTZ.js";import{z as z2}from"zod";import{z}from"zod";var Id=z.uuid().transform(value2=>value2.toLowerCase());var ReadId=z.uuid().regex(/^[0-9a-f-]{36}$/);var Key=z.string().regex(/^[a-z0-9][a-z0-9_-]{0,63}$/);var Revision=z.int().min(0).max(999999999);var AgentHostScopeSchema=z.strictObject({tenantId:Id,projectId:Id});var ReadScope=z.strictObject({tenantId:ReadId,projectId:ReadId});var AgentHostSelectionSchema=z.strictObject({hostKey:Key,tenantKey:Key,workspaceKey:Key,projectKey:Key,agentKey:Key,agentVersion:z.int().positive().max(1e9),modelOptionKey:Key});var ConfigureAgentHostSchema=AgentHostScopeSchema.extend({requestId:Id,bindingId:Id,expectedRevision:z.int().min(0).max(999999998),selection:AgentHostSelectionSchema,apiCredential:z.string().regex(/^agxk_[A-Za-z0-9_-]{43}$/).meta({writeOnly:true})});var RevokeAgentHostSchema=AgentHostScopeSchema.extend({requestId:Id,bindingId:Id,expectedRevision:z.int().min(1).max(999999998)});var AgentHostBindingSchema=ReadScope.extend({bindingId:ReadId,revision:Revision.refine(value2=>value2>0),configurationVersion:Revision.refine(value2=>value2>0),enabled:z.boolean(),selection:AgentHostSelectionSchema,updatedAt:z.iso.datetime({offset:true})}).refine(value2=>value2.configurationVersion<=value2.revision);var UpdateAgentHostSelectionSchema=ConfigureAgentHostSchema.omit({apiCredential:true}).extend({expectedRevision:z.int().min(1).max(999999998),expectedConfigurationVersion:z.int().positive().max(999999998)});var AgentHostCurrentSchema=z.strictObject({binding:AgentHostBindingSchema.nullable()});var AgentHostHistoryQuerySchema=AgentHostScopeSchema.extend({limit:z.int().min(1).max(100).default(20),beforeVersion:z.int().positive().max(999999999).optional()});var AgentHostConfigurationVersionSchema=ReadScope.extend({bindingId:ReadId,version:z.int().positive().max(999999999),selection:AgentHostSelectionSchema,createdByPrincipalId:ReadId,createdAt:z.iso.datetime({offset:true}),revokedAt:z.iso.datetime({offset:true}).nullable()});var AgentHostHistoryPageSchema=z.strictObject({items:z.array(AgentHostConfigurationVersionSchema).max(100),hasMore:z.boolean(),nextBeforeVersion:z.int().positive().max(999999999).nullable()}).refine(page=>page.hasMore===(page.nextBeforeVersion!==null)&&(!page.hasMore||page.items.length>0));var AgentHostReadinessSchema=ReadScope.extend({binding:AgentHostBindingSchema.nullable(),registeredHostKeys:z.array(Key).max(16),configurationStatus:z.enum(["NOT_CONFIGURED","REVOKED","HOST_UNAVAILABLE","CREDENTIAL_UNAVAILABLE","CONFIGURATION_CHANGED","CONFIGURED"]),remoteCredentialVerification:z.enum(["NOT_CHECKED","VERIFIED"]),nativeToolAuthority:z.enum(["NOT_CONNECTED","UNVERIFIED","VERIFIED"]),executionAvailability:z.enum(["UNAVAILABLE","AVAILABLE"]),reason:z.enum(["NATIVE_TOOL_AUTHORITY_NOT_CONNECTED","NATIVE_TOOL_AUTHORITY_NOT_QUALIFIED","CONFIGURATION_CHANGED"]).nullable(),checkedAt:z.iso.datetime({offset:true})}).refine(v=>{const verified=v.nativeToolAuthority==="VERIFIED";return(v.binding===null||v.binding.tenantId===v.tenantId&&v.binding.projectId===v.projectId)&&verified===(v.remoteCredentialVerification==="VERIFIED")&&verified===(v.executionAvailability==="AVAILABLE")&&verified===(v.reason===null)&&(!verified||v.configurationStatus==="CONFIGURED"&&v.binding?.enabled===true)});var AgentHostFailureSchema=z.strictObject({semanticStatus:z.enum(["INVALID_INPUT","NOT_FOUND","BLOCKED","REVISION_CONFLICT","CAPABILITY_UNAVAILABLE","INTERNAL_OPERATIONAL_FAILURE"]),error:z.strictObject({code:z.enum(["INVALID_INPUT","UNAUTHENTICATED","FORBIDDEN","NOT_FOUND","REVISION_CONFLICT","REQUEST_CONFLICT","HOST_UNAVAILABLE","CREDENTIAL_UNAVAILABLE","CREDENTIAL_SCOPE_MISMATCH","BINDING_REVOKED","INTERNAL_OPERATIONAL_FAILURE"]),message:z.literal("Agent Host operation did not complete")})});var id=z2.uuid().regex(/^[0-9a-f-]{36}$/);var requestId=z2.uuid().transform(v=>v.toLowerCase());var key=z2.string().regex(/^[A-Za-z0-9_-]{1,160}$/);var NativeRuntimePublicKeySchema=z2.strictObject({kty:z2.literal("EC"),crv:z2.literal("P-256"),x:z2.string().regex(/^[A-Za-z0-9_-]{43}$/),y:z2.string().regex(/^[A-Za-z0-9_-]{43}$/)});var ConfigureNativeToolGrantSchema=AgentHostScopeSchema.extend({requestId,bindingId:requestId,expectedBindingRevision:z2.int().positive(),expectedConfigurationVersion:z2.int().positive(),runtimeKey:key,installationId:key,installationRevisionId:key,publicKey:NativeRuntimePublicKeySchema,expiresAt:z2.iso.datetime({offset:true})});var NativeToolGrantGetSchema=AgentHostScopeSchema.extend({grantId:requestId});var RevokeNativeToolGrantSchema=NativeToolGrantGetSchema.extend({requestId,expectedRevision:z2.int().positive()});var NativeRuntimeProofRequestSchema=NativeToolGrantGetSchema.extend({assertion:z2.string().regex(/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/).max(4096).meta({writeOnly:true})});var NativeRuntimeStatusClaimsSchema=z2.strictObject({iss:key,sub:key,aud:z2.url().max(2048),grantId:id,installationRevisionId:key,jti:id,iat:z2.int().nonnegative(),exp:z2.int().positive()}).refine(v=>v.exp>v.iat&&v.exp-v.iat<=60);var NativeRuntimeProofClaimsSchema=z2.strictObject({iss:key,sub:key,aud:z2.url().max(2048),grantId:id,grantRevision:z2.int().positive(),installationRevisionId:key,challengeId:id,jti:id,iat:z2.int().nonnegative(),exp:z2.int().positive()}).refine(v=>v.exp>v.iat&&v.exp-v.iat<=60);var NativeToolGrantViewSchema=z2.strictObject({tenantId:id,projectId:id}).extend({protocol:z2.literal("NATIVESTUDIO_RUNTIME_REGISTRATION_V1"),grantId:id,bindingId:id,bindingRevision:z2.int().positive(),configurationVersion:z2.int().positive(),selection:AgentHostSelectionSchema,runtimeKey:key,installationId:key,installationRevisionId:key,publicKey:NativeRuntimePublicKeySchema,resource:z2.url().max(2048),revision:z2.int().positive(),enabled:z2.boolean(),createdByPrincipalId:id,runtimePrincipalId:id,createdAt:z2.iso.datetime({offset:true}),expiresAt:z2.iso.datetime({offset:true}),challengeId:id,challengeExpiresAt:z2.iso.datetime({offset:true}),verifiedAt:z2.iso.datetime({offset:true}).nullable(),revokedAt:z2.iso.datetime({offset:true}).nullable()}).refine(v=>{const resource=new URL(v.resource);return resource.protocol==="https:"&&!resource.username&&!resource.password&&!resource.search&&!resource.hash&&resource.pathname===`/mcp/native/v1/projects/${v.projectId}`&&v.enabled===(v.revokedAt===null)&&Date.parse(v.challengeExpiresAt)<=Date.parse(v.expiresAt)});import{z as z3}from"zod";var offset=z3.int().min(0).max(4094).multipleOf(2);var dimension=z3.int().min(2).max(4096).multipleOf(2);var ClipFramingSchema=z3.strictObject({algorithm:z3.literal("CROP_PAD_V1"),crop:z3.strictObject({x:offset,y:offset,width:dimension,height:dimension}),anchorXPermille:z3.int().min(0).max(1e3),anchorYPermille:z3.int().min(0).max(1e3)});var PicturePolicySchema=z3.literal("CROP_PAD_V1");import{z as z4}from"zod";var ClipTransitionSchema=z4.union([z4.literal("CUT"),z4.strictObject({kind:z4.literal("CROSS_DISSOLVE_V1"),durationFrames:z4.int().min(2).max(30)})]);import{z as z5}from"zod";var sha=z5.string().regex(/^[0-9a-f]{64}$/);var GraphicPlacementSchema=z5.strictObject({startFrame:z5.int().nonnegative().max(1800),endFrame:z5.int().positive().max(1800),anchor:z5.enum(["TOP_LEFT","TOP_RIGHT","BOTTOM_LEFT","BOTTOM_RIGHT"]),widthPermille:z5.int().min(50).max(400),marginXPermille:z5.int().min(0).max(100),marginYPermille:z5.int().min(0).max(100),opacityPermille:z5.int().min(100).max(1e3)}).refine(v=>v.endFrame>v.startFrame,"Graphic frame interval must advance");var TimelineGraphicInputSchema=z5.strictObject({artifactId:ArtifactIdSchema,placement:GraphicPlacementSchema});var TimelineGraphicSourceSchema=z5.strictObject({tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema.nullable(),artifactId:ArtifactIdSchema,representationId:ArtifactRepresentationIdSchema,checksumSha256:sha,contentType:z5.enum(["image/png","image/webp"]),byteSize:z5.int().positive().max(16*1024*1024),width:z5.int().positive().max(8192),height:z5.int().positive().max(8192)});var TimelineGraphicSchema=z5.strictObject({source:TimelineGraphicSourceSchema,placement:GraphicPlacementSchema});import{z as z6}from"zod";var sha2=z6.string().regex(/^[0-9a-f]{64}$/);var AudioPurposeSchema=z6.enum(["VOICEOVER","MUSIC"]);var AudioProductionScopeSchema=z6.strictObject({tenantId:TenantIdSchema,productionId:ProductionIdSchema});var AudioScopeSchema=AudioProductionScopeSchema.extend({purpose:AudioPurposeSchema});var AudioMediaSchema=z6.strictObject({profile:z6.literal("PCM_S16LE_48000_V1"),audioCodec:z6.literal("pcm_s16le"),sampleRateHz:z6.literal(48e3),audioChannels:z6.union([z6.literal(1),z6.literal(2)]),sampleCount:z6.int().min(4800).max(288e4),durationMs:z6.int().min(100).max(6e4)}).refine(m=>m.sampleCount*1e3===m.durationMs*m.sampleRateHz,{message:"Exact PCM sample count must match duration"});var AudioImportSchema=AudioScopeSchema.extend({expectedProductionRevision:z6.int().positive(),expectedAudioVersion:z6.int().nonnegative(),idempotencyKey:z6.string().trim().min(1).max(200),contentType:z6.literal("audio/wav"),originalName:z6.string().trim().min(1).max(255).regex(/^[^\p{Cc}]*$/u).optional()});var AudioImportRequestSchema=AudioImportSchema.extend({contentBase64:z6.string().min(60).max(16777216).regex(/^[A-Za-z0-9+/]*={0,2}$/)});var AudioGetSchema=AudioScopeSchema.extend({versionId:z6.uuid()});var AudioQuerySchema=AudioScopeSchema.extend({limit:QueryLimitSchema,next:ContinuationSchema.optional()});var AudioRepresentationSchema=z6.strictObject({id:z6.uuid(),checksumSha256:sha2,byteSize:z6.int().min(44).max(12582912)});var AudioVersionSchema=AudioScopeSchema.extend({id:z6.uuid(),audioId:z6.uuid(),projectId:z6.uuid(),version:z6.int().positive(),artifactId:z6.uuid(),original:AudioRepresentationSchema,media:AudioMediaSchema,originalName:z6.string().trim().min(1).max(255).regex(/^[^\p{Cc}]*$/u).nullable(),previousVersionId:z6.uuid().nullable(),createdByPrincipalId:z6.uuid(),createdAt:z6.iso.datetime({offset:true}),generation:z6.strictObject({generationId:z6.uuid(),executionClass:z6.enum(["LIVE","TEST_ONLY"]),sourceArtifactId:z6.uuid(),sourceRepresentationId:z6.uuid(),sourceChecksumSha256:sha2,sourceByteSize:z6.int().min(44).max(12582912),sourceMedia:z6.strictObject({sampleRateHz:z6.int().positive().max(48e3),audioChannels:z6.union([z6.literal(1),z6.literal(2)]),sampleCount:z6.int().positive()}),normalizationVersion:z6.literal("SPEECH_PCM_V1"),padSamples:z6.int().min(0).max(47)}).optional()}).refine(v=>v.version===1===(v.previousVersionId===null),{message:"Audio replacement history must preserve exact preceding version"});var AudioViewSchema=z6.strictObject({version:AudioVersionSchema,isCurrent:z6.boolean(),availability:z6.enum(["AVAILABLE","UNAVAILABLE"])});var AudioReceiptSchema=z6.strictObject({semanticStatus:z6.literal("SUCCESS"),version:AudioVersionSchema,productionRevision:z6.int().positive()});var AudioBasisSchema=AudioScopeSchema.extend({productionRevision:z6.int().positive(),currentVersion:z6.int().nonnegative(),currentVersionId:z6.uuid().nullable(),importable:z6.boolean()});var AudioPageSchema=z6.strictObject({items:z6.array(AudioViewSchema).max(200),page:QueryPageInfoSchema});var AudioSnapshotSchema=z6.strictObject({tracks:z6.array(z6.strictObject({purpose:AudioPurposeSchema,currentVersion:z6.int().positive().nullable(),currentVersionId:z6.uuid().nullable(),artifactId:z6.uuid().nullable(),availability:z6.enum(["NONE","AVAILABLE","UNAVAILABLE"]),durationMs:z6.int().min(100).max(6e4).nullable(),audioChannels:z6.union([z6.literal(1),z6.literal(2)]).nullable(),attachedToTimeline:z6.boolean()})).length(2)});import{z as z7}from"zod";var placement={sourceInMs:z7.int().nonnegative().max(6e4),sourceOutMs:z7.int().positive().max(6e4),startMs:z7.int().nonnegative().max(6e4),gainPermille:z7.int().nonnegative().max(1e3)};var TimelineAudioInputSchema=z7.strictObject({tracks:z7.array(z7.strictObject({purpose:AudioPurposeSchema,versionId:z7.uuid(),...placement})).min(1).max(2),duckingMusicPermille:z7.int().nonnegative().max(1e3).default(1e3)}).superRefine((audio,ctx)=>{if(new Set(audio.tracks.map(t=>t.purpose)).size!==audio.tracks.length||audio.tracks.some(t=>t.sourceOutMs<=t.sourceInMs)||audio.duckingMusicPermille<1e3&&audio.tracks.length!==2)ctx.addIssue({code:"custom",message:"Distinct purposes, advancing trims and explicit ducking pair required"})});var AudioMixProfileSchema=z7.strictObject({id:z7.literal("PCM_WINDOW_MIX_AAC_V1"),sampleRateHz:z7.literal(48e3),audioChannels:z7.literal(2),audioCodec:z7.literal("aac"),bitrate:z7.literal(192e3),peakPermille:z7.literal(950),duckingMusicPermille:z7.int().nonnegative().max(1e3)});var TimelineAudioCompositionSchema=z7.strictObject({mix:AudioMixProfileSchema,tracks:z7.array(z7.strictObject({source:AudioVersionSchema,...placement})).min(1).max(2)}).superRefine((audio,ctx)=>{if(new Set(audio.tracks.map(t=>t.source.purpose)).size!==audio.tracks.length||audio.tracks.some(t=>t.sourceOutMs<=t.sourceInMs||t.sourceOutMs>t.source.media.durationMs)||audio.mix.duckingMusicPermille<1e3&&audio.tracks.length!==2)ctx.addIssue({code:"custom",message:"Invalid exact audio composition"})});var RenderedAudioSchema=z7.strictObject({audioCodec:z7.literal("aac"),sampleRateHz:z7.literal(48e3),audioChannels:z7.literal(2),sampleCount:z7.int().positive().max(288e4)});import{z as z8}from"zod";var id2=z8.uuid().toLowerCase();var hash=z8.string().regex(/^[0-9a-f]{64}$/);var NativeVideoAudioMetadataSchema=z8.strictObject({normalizationVersion:z8.literal("VIDEO_AUDIO_PCM_V1"),sourceCodec:z8.literal("aac"),sourceSampleRateHz:z8.int().min(8e3).max(96e3),sourceChannels:z8.union([z8.literal(1),z8.literal(2)]),sourceFrameRateHz:z8.union([z8.literal(24),z8.literal(30)]),sourceFrameCount:z8.int().positive().max(905),sourceStartOffsetMs:z8.number().finite().min(-500).max(5e3),sourceDeclaredDurationMs:z8.number().positive().max(31e3),alignment:z8.literal("TRIM_PAD_PCM_TO_VIDEO_ZERO_V1"),media:z8.strictObject({profile:z8.literal("PCM_S16LE_48000_NATIVE_VIDEO_V1"),audioCodec:z8.literal("pcm_s16le"),sampleRateHz:z8.literal(48e3),audioChannels:z8.union([z8.literal(1),z8.literal(2)]),sampleCount:z8.int().positive().max(1448e3),durationMs:z8.number().positive().max(30200)}).refine(m=>m.durationMs===m.sampleCount/48),checksumSha256:hash}).superRefine((v,ctx)=>{if(v.media.sampleCount!==v.sourceFrameCount*(48e3/v.sourceFrameRateHz)||v.media.audioChannels!==v.sourceChannels)ctx.addIssue({code:"custom",message:"Native PCM must follow the exact source video frame clock"})});var NativeVideoSoundReferenceSchema=z8.strictObject({id:id2,tenantId:id2,projectId:id2,productionId:id2,shotId:id2,generationId:id2,videoArtifactId:id2,videoRepresentationId:id2,videoChecksumSha256:hash,artifactId:id2,representationId:id2,checksumSha256:hash,byteSize:z8.int().min(44).max(12582912),metadata:NativeVideoAudioMetadataSchema,executionClass:z8.enum(["LIVE","TEST_ONLY"])});import{z as z9}from"zod";var SourceSoundTreatmentSchema=z9.strictObject({policy:z9.enum(["KEEP","MUTE","DUCK"]),gainPermille:z9.int().min(0).max(1e3),duckingPermille:z9.int().min(0).max(1e3)}).superRefine((v,c)=>{if(v.policy==="MUTE"&&v.gainPermille!==0||v.policy!=="DUCK"&&v.duckingPermille!==1e3)c.addIssue({code:"custom",message:"Mute requires zero gain; ducking requires explicit DUCK"})});import{z as z10}from"zod";var ProviderIdSchema=z10.enum(["QWEN_CN","VOLCENGINE_CN","GEMINI","OPENAI","XAI"]);var ProviderConnectionIdSchema=z10.uuid().brand();var ModelProfileIdSchema=z10.string().regex(/^[a-z][a-z0-9-]{1,79}$/);var GeometryPolicySchema=z10.enum(["STRICT","PAD_TO_ASPECT"]);var ProviderSelectionSchema=z10.strictObject({connectionId:ProviderConnectionIdSchema,modelProfileId:ModelProfileIdSchema});var ProviderConfigurationSchema=z10.strictObject({providerId:ProviderIdSchema,label:z10.string().trim().min(1).max(100),allowedModelProfileIds:z10.array(ModelProfileIdSchema).min(1).max(16),qwenEndpoint:z10.literal("QIANWEN_PLATFORM").optional(),credentialService:z10.enum(["ARK","DOUBAO_SPEECH"]).optional(),qwenWorkspaceId:z10.string().regex(/^[a-z0-9][a-z0-9-]{0,63}$/).optional(),geometryPolicy:GeometryPolicySchema.default("STRICT")}).superRefine((v,c)=>{if(new Set(v.allowedModelProfileIds).size!==v.allowedModelProfileIds.length)c.addIssue({code:"custom",message:"Duplicate model profile"});if(v.qwenWorkspaceId&&v.providerId!=="QWEN_CN")c.addIssue({code:"custom",message:"Workspace only applies to Qwen China"});if(v.credentialService&&v.providerId!=="VOLCENGINE_CN")c.addIssue({code:"custom",message:"Credential service applies to Volcengine"});if(v.qwenEndpoint&&(v.providerId!=="QWEN_CN"||v.qwenWorkspaceId))c.addIssue({code:"custom",message:"Qianwen platform requires an exact Qwen route without a workspace"})});var ConfigureProviderInputSchema=z10.strictObject({tenantId:TenantIdSchema,connectionId:ProviderConnectionIdSchema,expectedVersion:z10.int().nonnegative(),configuration:ProviderConfigurationSchema,apiKey:z10.string().min(8).max(4096).regex(/^[!-~]+$/)});var ProviderConnectionViewSchema=z10.strictObject({tenantId:TenantIdSchema,connectionId:ProviderConnectionIdSchema,version:z10.int().positive(),enabled:z10.boolean(),credentialConfigured:z10.boolean(),configuration:ProviderConfigurationSchema,createdByPrincipalId:PrincipalIdSchema,updatedAt:z10.iso.datetime({offset:true})});var ProviderConnectionCommandSchema=z10.strictObject({tenantId:TenantIdSchema,connectionId:ProviderConnectionIdSchema,expectedVersion:z10.int().positive()});var ProviderCredentialRevokeSchema=z10.strictObject({tenantId:TenantIdSchema,connectionId:ProviderConnectionIdSchema,version:z10.int().positive()});var SetKeyframeDefaultSchema=z10.strictObject({tenantId:TenantIdSchema,selection:ProviderSelectionSchema,expectedRevision:z10.int().nonnegative()});var ProviderExecutionBindingSchema=z10.strictObject({tenantId:TenantIdSchema,connectionId:ProviderConnectionIdSchema,connectionVersion:z10.int().positive(),providerId:ProviderIdSchema,modelProfileId:ModelProfileIdSchema,modelProfileVersion:z10.int().positive(),modelId:z10.string().min(1).max(160),credentialRef:z10.uuid(),credentialVersion:z10.int().positive(),geometryPolicy:GeometryPolicySchema,qwenEndpoint:z10.literal("QIANWEN_PLATFORM").optional()}).refine(binding=>!binding.qwenEndpoint||binding.providerId==="QWEN_CN",{message:"Qianwen platform binding requires Qwen China"});import{z as z11}from"zod";var SpeechParameterValueSchema=z11.union([z11.string().max(4096),z11.number().finite(),z11.boolean(),z11.array(z11.string().max(4096)).max(100),z11.record(z11.string().min(1).max(100),z11.string().max(4096)).refine(v=>Object.keys(v).length<=100)]);var SpeechParameterRuleSchema=z11.strictObject({label:z11.string().trim().min(1).max(100).regex(/^[^\p{Cc}]*$/u),type:z11.enum(["NUMBER","INTEGER","STRING","BOOLEAN","STRING_ARRAY","STRING_MAP"]),required:z11.boolean().default(false),min:z11.number().optional(),max:z11.number().optional(),maxLength:z11.int().positive().max(4096).optional(),options:z11.array(z11.string().min(1).max(100)).max(100).optional(),default:SpeechParameterValueSchema.optional(),unit:z11.string().max(40).optional(),description:z11.string().max(500).optional(),maxItems:z11.int().positive().max(100).optional(),maxKeyLength:z11.int().positive().max(100).optional()});var SpeechParametersSchema=z11.record(z11.string().regex(/^[a-z][a-z0-9_]{0,49}$/),SpeechParameterValueSchema).refine(p=>Object.keys(p).length<=24);var SpeechModelProfileSchema=z11.strictObject({id:ModelProfileIdSchema,version:z11.int().positive(),providerId:ProviderIdSchema,modelId:z11.string().min(1).max(160).nullable(),protocol:z11.enum(["QWEN_TTS","QWEN_AUDIO_TTS","OPENAI_TTS","XAI_TTS","GEMINI_INTERACTIONS_TTS","VOLCENGINE_TTS"]),label:z11.string().trim().min(1).max(100).regex(/^[^\p{Cc}]*$/u),textMaxCharacters:z11.int().positive().max(6e3),requestTimeoutMs:z11.int().positive().max(3e5),workspaceRequired:z11.boolean(),voices:z11.array(z11.strictObject({id:z11.string().min(1).max(100),label:z11.string().min(1).max(100),languages:z11.array(z11.string().min(2).max(20)).min(1).max(32).optional(),parameterDefaults:SpeechParametersSchema.optional(),parameterOptions:z11.record(z11.string(),z11.array(z11.string().min(1).max(100)).min(1).max(100)).optional(),unsupportedParameters:z11.array(z11.string()).max(24).optional()})).min(1).max(100),languages:z11.array(z11.string().min(2).max(20)).min(1).max(32),parameters:z11.record(z11.string().regex(/^[a-z][a-z0-9_]{0,49}$/),SpeechParameterRuleSchema),sourceUrl:z11.url().max(2048),verifiedAt:z11.iso.date(),providerTextMaxCharacters:z11.int().positive().nullable(),resourceId:z11.string().min(1).max(100).nullable(),output:z11.literal("PCM_S16LE_48000_V1"),normalizationVersion:z11.literal("SPEECH_PCM_V1")});var SpeechScopeSchema=z11.strictObject({tenantId:TenantIdSchema,productionId:ProductionIdSchema});var SpeechExecutionBindingSchema=z11.strictObject({tenantId:TenantIdSchema,connectionId:z11.uuid(),connectionVersion:z11.int().positive(),credentialRef:z11.uuid(),credentialVersion:z11.int().positive(),profile:SpeechModelProfileSchema,executionClass:z11.enum(["LIVE","TEST_ONLY"])});var SpeechStartSchema=SpeechScopeSchema.extend({soundCue:z11.strictObject({soundPlanVersionId:z11.uuid(),cueId:z11.string().regex(/^[a-z][a-z0-9_-]{0,63}$/)}).optional(),expectedProductionRevision:z11.int().positive(),expectedAudioVersion:z11.int().nonnegative(),expectedModelProfileVersion:z11.int().positive(),idempotencyKey:z11.string().trim().min(1).max(200),selection:ProviderSelectionSchema,text:z11.string().min(1).max(6e3).refine(s=>s.trim().length>0&&!s.includes("\0")),voice:z11.string().min(1).max(100),parameters:SpeechParametersSchema.default({})});var SpeechGetSchema=SpeechScopeSchema.extend({generationId:z11.uuid()});var SpeechAdmissionSchema=z11.strictObject({semanticStatus:z11.literal("ACCEPTED"),generationId:z11.uuid(),runtimeJobId:z11.uuid(),productionRevision:z11.int().positive(),executionClass:z11.enum(["LIVE","TEST_ONLY"])});var SpeechGenerationViewSchema=SpeechAdmissionSchema.omit({semanticStatus:true}).extend({tenantId:TenantIdSchema,productionId:ProductionIdSchema,soundCue:SpeechStartSchema.shape.soundCue,text:z11.string().min(1).max(6e3),voice:z11.string().min(1).max(100),parameters:SpeechParametersSchema,profile:SpeechModelProfileSchema,connectionId:z11.uuid(),connectionVersion:z11.int().positive(),runtimeStatus:z11.enum(["PENDING","READY","RUNNING","WAITING","SUCCEEDED","FAILED","CANCELLED","SUPERSEDED"]),providerStatus:z11.enum(["NOT_SUBMITTED","SUBMITTING","UNKNOWN","SUCCEEDED","REJECTED"]),cancellationRequested:z11.boolean(),result:AudioReceiptSchema.nullable(),createdAt:z11.iso.datetime({offset:true})});var SpeechOptionsSchema=SpeechScopeSchema.extend({options:z11.array(z11.strictObject({selection:ProviderSelectionSchema,profile:SpeechModelProfileSchema,connectionLabel:z11.string().min(1).max(100),connectionVersion:z11.int().positive()})).max(100),possiblyTruncated:z11.boolean()});import{z as z12}from"zod";var KeyframePurposeSchema=z12.enum(["START_FRAME","END_FRAME","SUBJECT_REFERENCE"]);var AcceptedKeyframeReferenceSchema=z12.strictObject({acceptanceId:z12.uuid(),reviewId:z12.uuid(),generationId:z12.uuid(),candidateId:z12.uuid(),shotId:ShotIdSchema,framePurpose:KeyframePurposeSchema,artifactId:ArtifactIdSchema,representationId:ArtifactRepresentationIdSchema,checksumSha256:z12.string().regex(/^[0-9a-f]{64}$/),artifactChecksumSha256:z12.string().regex(/^[0-9a-f]{64}$/),planVersionId:SceneShotPlanVersionIdSchema,planVersion:z12.int().positive(),shotPlanningRevision:z12.int().positive(),executionClass:z12.enum(["LIVE","TEST_ONLY"])});import{z as z13}from"zod";var ConsistencyReviewScaleSchema=z13.enum(["INTRA_SHOT","INTER_SHOT","PRODUCTION"]);var State=z13.string().trim().min(1).max(300);var StoryTime=z13.int().nonnegative().max(31536e8);var position=z13.int().min(1).max(999);var StateChange=z13.strictObject({atPermille:position,from:State,to:State,reason:State});var TimeJump=z13.strictObject({atPermille:position,fromMs:StoryTime,toMs:StoryTime,reason:State});var ContinuityExpectationSchema=z13.discriminatedUnion("kind",[z13.strictObject({kind:z13.literal("STATE"),mode:z13.enum(["PRESERVE","PLANNED_TRANSITIONS"]),entry:State,exit:State,changes:z13.array(StateChange).min(1).max(16).optional()}).superRefine((v,c)=>{const changes=v.changes??[];if(v.mode==="PLANNED_TRANSITIONS"!==!!changes.length||!changes.length&&v.entry!==v.exit||changes.length&&(changes[0].from!==v.entry||changes.at(-1).to!==v.exit)||changes.some((x,i)=>x.from===x.to||i>0&&(x.atPermille<=changes[i-1].atPermille||x.from!==changes[i-1].to)))c.addIssue({code:"custom",message:"State changes require an ordered explicit plan with exact entry and exit"})}),z13.strictObject({kind:z13.literal("TIME"),mode:z13.enum(["MONOTONIC","PLANNED_JUMPS"]),entryMs:StoryTime,exitMs:StoryTime,jumps:z13.array(TimeJump).min(1).max(16).optional()}).superRefine((v,c)=>{const jumps=v.jumps??[];if(v.mode==="PLANNED_JUMPS"!==!!jumps.length||!jumps.length&&v.exitMs<v.entryMs||jumps.length&&(jumps[0].fromMs<v.entryMs||jumps.at(-1).toMs>v.exitMs)||jumps.some((x,i)=>x.fromMs===x.toMs||i>0&&(x.atPermille<=jumps[i-1].atPermille||x.fromMs<jumps[i-1].toMs)))c.addIssue({code:"custom",message:"Story time requires monotonic segments separated by exact planned jumps"})})]);var ContinuitySampleSchema=z13.strictObject({atMs:z13.int().nonnegative().max(6e4),state:State.optional(),storyTimeMs:StoryTime.optional()}).superRefine((v,c)=>{if(v.state!==void 0===(v.storyTimeMs!==void 0))c.addIssue({code:"custom",message:"A sample observes exactly one state or story-time value"})});var ContinuitySamplesSchema=z13.array(ContinuitySampleSchema).min(3).max(64);import{z as z14}from"zod";var PreparationIdSchema=z14.uuid().brand();var GenerationContractIdSchema=z14.uuid().brand();var ContentFingerprintSchema=z14.string().regex(/^[0-9a-f]{64}$/);var PreparationTargetSchema=z14.discriminatedUnion("mediaType",[z14.strictObject({mediaType:z14.literal("IMAGE"),purpose:z14.enum(["KEYFRAME","REFERENCE_FRAME"]),framePurpose:z14.enum(["START_FRAME","END_FRAME","SUBJECT_REFERENCE"])}),z14.strictObject({mediaType:z14.literal("VIDEO"),purpose:z14.literal("SHOT_CANDIDATE")})]);var PreparationBasisSchema=z14.strictObject({tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,sceneId:SceneIdSchema,shotId:ShotIdSchema,productionRevision:z14.int().positive(),briefVersionId:BriefVersionIdSchema,briefVersion:z14.int().positive(),storyVersionId:StoryVersionIdSchema,storyVersion:z14.int().positive(),planVersionId:SceneShotPlanVersionIdSchema,planVersion:z14.int().positive(),shotPlanningRevision:z14.int().positive(),resolverVersion:z14.literal("w7-product-preflight-v1"),consistencyProfile:z14.strictObject({id:z14.uuid(),version:z14.int().positive(),effectiveFingerprint:ContentFingerprintSchema}).optional()});var ReferenceRoleSchema=z14.enum(["PRODUCT_IDENTITY","PRODUCT_PACKSHOT","CHARACTER_IDENTITY","WARDROBE","LOCATION","STYLE","START_FRAME_ANCHOR","END_FRAME_ANCHOR"]);var ReferenceBindingInputSchema=z14.strictObject({keyframeAcceptanceId:z14.uuid().optional(),role:ReferenceRoleSchema,artifactId:ArtifactIdSchema,representationId:ArtifactRepresentationIdSchema,checksumSha256:ContentFingerprintSchema,reason:z14.string().trim().min(1).max(500)});var ExactEvidenceReferenceSchema=z14.strictObject({artifactId:ArtifactIdSchema,representationId:ArtifactRepresentationIdSchema,checksumSha256:ContentFingerprintSchema,artifactChecksumSha256:ContentFingerprintSchema});var ResolvedReferenceSchema=ReferenceBindingInputSchema.extend({artifactChecksumSha256:ContentFingerprintSchema,contentType:z14.enum(["image/png","image/jpeg","image/webp"]),acceptedKeyframe:AcceptedKeyframeReferenceSchema.optional(),consistencyRuleId:z14.uuid().optional(),subjectId:z14.uuid().optional(),authority:z14.enum(["BRIEF_SOURCE_AND_EXPLICIT_BINDING","EXPLICIT_SHOT_BINDING","CANONICAL_PROFILE_MASTER","ACCEPTED_KEYFRAME_AND_EXPLICIT_BINDING"])});var ResolvedConstraintSchema=z14.strictObject({continuity:ContinuityExpectationSchema.optional(),reviewScales:z14.array(ConsistencyReviewScaleSchema).min(1).max(3).optional(),key:z14.string().min(1).max(200),family:z14.enum(["PRODUCT_IDENTITY","CHARACTER_IDENTITY","WARDROBE","LOCATION","STYLE","SHOT_INTENT","BOUNDARY_CONTINUITY"]),scope:z14.enum(["PROJECT","PRODUCTION","SCENE","SHOT","CONTINUITY_EDGE"]),subjectId:z14.uuid().optional(),dimension:z14.string().regex(/^[A-Z][A-Z0-9_]{0,63}$/).optional(),enforcement:z14.enum(["LOCKED","REQUIRED","PREFERRED"]),expected:z14.string().min(1).max(1e3),source:z14.strictObject({kind:z14.enum(["BRIEF","SCENE","SHOT","CONTINUITY_EDGE","CONSISTENCY_PROFILE"]),id:z14.uuid(),version:z14.int().positive()})});var PreparationBlockerSchema=z14.strictObject({code:z14.enum(["MISSING_PRODUCT_REFERENCE","CANONICAL_SOURCE_UNAVAILABLE","CONSTRAINT_CONFLICT","PREVIOUS_SHOT_EVIDENCE_UNAVAILABLE","GENERATED_KEYFRAME_REQUIRED"]),summary:z14.string().min(1).max(1e3),relatedShotId:ShotIdSchema.optional(),edgeId:ContinuityEdgeIdSchema.optional()});var ConstraintSetSchema=z14.strictObject({preparationId:PreparationIdSchema,version:z14.int().positive(),fingerprint:ContentFingerprintSchema,items:z14.array(ResolvedConstraintSchema).max(2048)});var ReferenceSetSchema=z14.strictObject({preparationId:PreparationIdSchema,version:z14.int().positive(),fingerprint:ContentFingerprintSchema,bindings:z14.array(ResolvedReferenceSchema).max(12)});import{z as z15}from"zod";var GenerationCostVariantSchema=z15.strictObject({mode:z15.enum(["REFERENCE_TO_IMAGE","REFERENCE_TO_VIDEO","FIRST_FRAME_TO_VIDEO","FIRST_LAST_FRAME_TO_VIDEO"]),aspectRatio:z15.enum(["16:9","9:16"]),workingWidth:z15.int().min(0).max(4096),workingHeight:z15.int().min(0).max(4096),hasAudio:z15.boolean(),references:z15.int().min(0).max(24),durationSeconds:z15.number().finite().min(0).max(30)});var GenerationCostPolicySchema=z15.strictObject({currency:z15.literal("USD"),sourceUrl:z15.url({protocol:/^https$/}).max(2e3),rationale:z15.string().trim().min(1).max(2e3),validUntil:z15.iso.datetime({offset:true}),rules:z15.array(z15.strictObject({id:z15.string().regex(/^[a-zA-Z0-9_-]{1,80}$/),variant:GenerationCostVariantSchema,upperBoundMicros:z15.int().nonnegative().max(1e9)})).min(1).max(64)}).refine(p=>new Set(p.rules.map(r=>r.id)).size===p.rules.length,"Duplicate cost rule");var ExpectedGenerationExecutionSchema=z15.strictObject({connectionVersion:z15.int().positive(),modelProfileVersion:z15.int().positive(),quoteValidUntil:z15.iso.datetime({offset:true})});var GenerationCostQuoteSchema=z15.strictObject({currency:z15.literal("USD"),upperBoundMicros:z15.int().nonnegative().max(1e9),selection:ProviderSelectionSchema,expectedExecution:ExpectedGenerationExecutionSchema,sourceUrl:z15.url({protocol:/^https$/}).max(2e3),ruleIds:z15.array(z15.string()).min(1).max(64),preparationId:z15.uuid(),contractFingerprint:z15.string().regex(/^[a-f0-9]{64}$/)});import{z as z16}from"zod";var KeyframeGenerationIdSchema=z16.uuid().brand();var KeyframeProviderProfileSchema=z16.strictObject({id:z16.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,79}$/),adapterVersion:z16.string().min(1).max(80),model:z16.string().min(1).max(120),executionClass:z16.enum(["LIVE","TEST_ONLY"]),mediaType:z16.literal("IMAGE"),mode:z16.literal("REFERENCE_TO_IMAGE"),referenceRoles:z16.array(ReferenceRoleSchema).min(1).max(6),aspectRatios:z16.array(z16.enum(["16:9","9:16"])).min(1).max(2),maxReferences:z16.int().min(1).max(12),correlationLookup:z16.boolean()});var KeyframeStartInputSchema=z16.strictObject({expectedExecution:ExpectedGenerationExecutionSchema.optional(),selection:ProviderSelectionSchema.optional(),tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,shotId:ShotIdSchema,preparationId:PreparationIdSchema,contractId:GenerationContractIdSchema,contractFingerprint:ContentFingerprintSchema,idempotencyKey:z16.string().trim().min(1).max(200)});var KeyframeGetInputSchema=z16.strictObject({tenantId:TenantIdSchema,productionId:ProductionIdSchema,generationId:KeyframeGenerationIdSchema});var KeyframeQueryInputSchema=z16.strictObject({tenantId:TenantIdSchema,productionId:ProductionIdSchema,shotId:ShotIdSchema.optional(),limit:QueryLimitSchema,next:ContinuationSchema.optional()});var KeyframeAdmissionSchema=z16.strictObject({semanticStatus:z16.literal("ACCEPTED"),generationId:KeyframeGenerationIdSchema,operationId:OperationIdSchema,productionId:ProductionIdSchema,contractId:GenerationContractIdSchema,executionClass:z16.enum(["LIVE","TEST_ONLY"])});var KeyframeCandidateSchema=z16.strictObject({id:z16.uuid(),artifactId:ArtifactIdSchema,representationId:ArtifactRepresentationIdSchema,availability:z16.enum(["AVAILABLE","INVALID"]),observation:z16.enum(["NOT_OBSERVED","OBSERVED"]),evaluation:z16.enum(["UNREVIEWED","PASS","WARNING","FAIL"]),accepted:z16.boolean(),reviewId:z16.uuid().optional(),reviewVersion:z16.int().positive().optional(),acceptanceDecisionId:z16.uuid().optional(),freshness:z16.enum(["CURRENT_BASIS","STALE_BASIS"]),checksumSha256:ContentFingerprintSchema,contentType:z16.enum(["image/png","image/jpeg","image/webp"]),byteSize:z16.int().positive(),width:z16.int().positive(),height:z16.int().positive()});var KeyframeGenerationViewSchema=z16.strictObject({connection:z16.strictObject({connectionId:z16.uuid(),connectionVersion:z16.int().positive(),modelProfileId:z16.string(),modelProfileVersion:z16.int().positive()}).optional(),generationId:KeyframeGenerationIdSchema,tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,shotId:ShotIdSchema,preparationId:PreparationIdSchema,contractId:GenerationContractIdSchema,contractFingerprint:ContentFingerprintSchema,operationId:OperationIdSchema,provider:KeyframeProviderProfileSchema,runtimeStatus:z16.enum(["PENDING","READY","RUNNING","WAITING","SUCCEEDED","FAILED","CANCELLED","SUPERSEDED"]),providerStatus:z16.enum(["NOT_SUBMITTED","SUBMITTING","PENDING","UNKNOWN","SUCCEEDED","FAILED"]),freshness:z16.enum(["CURRENT_BASIS","STALE_BASIS"]),cancellationRequested:z16.boolean(),candidate:KeyframeCandidateSchema.nullable(),createdByPrincipalId:PrincipalIdSchema,createdAt:z16.iso.datetime({offset:true})});var KeyframeQueryPageSchema=z16.strictObject({items:z16.array(KeyframeGenerationViewSchema),page:QueryPageInfoSchema});var KeyframeMediaSchema=z16.strictObject({contentType:z16.enum(["image/png","image/jpeg","image/webp"]),checksumSha256:ContentFingerprintSchema,byteSize:z16.int().positive().max(8*1024*1024),contentBase64:z16.string().min(4).max(4*Math.ceil(8*1024*1024/3))});var KeyframeSummarySchema=z16.strictObject({generations:z16.int().nonnegative(),running:z16.int().nonnegative(),waiting:z16.int().nonnegative(),registeredCandidates:z16.int().nonnegative(),testCandidates:z16.int().nonnegative(),liveCandidates:z16.int().nonnegative()});import{z as z17}from"zod";var VideoGenerationIdSchema=z17.uuid().brand();var VideoProviderProfileSchema=z17.strictObject({id:z17.string().regex(/^[a-z][a-z0-9-]{1,79}$/),adapterVersion:z17.string().min(1).max(80),model:z17.string().min(1).max(160),executionClass:z17.enum(["LIVE","TEST_ONLY"]),mediaType:z17.literal("VIDEO"),modes:z17.array(z17.enum(["REFERENCE_TO_VIDEO","FIRST_FRAME_TO_VIDEO","FIRST_LAST_FRAME_TO_VIDEO"])).min(1).max(3),referenceRoles:z17.array(ReferenceRoleSchema).min(1).max(8),aspectRatios:z17.array(z17.enum(["16:9","9:16"])).min(1).max(2),minDurationSeconds:z17.int().min(1),maxDurationSeconds:z17.int().max(30),maxReferences:z17.int().min(1).max(10),combineAnchorsAndReferences:z17.boolean(),workingWidth:z17.int().positive().max(4096),workingHeight:z17.int().positive().max(4096),frameRate:z17.union([z17.literal(24),z17.literal(30)]),sourceFormat:z17.strictObject({videoCodec:z17.literal("hevc"),pixelFormat:z17.literal("yuv420p10le")}).optional(),hasAudio:z17.boolean(),nativeAudioChannels:z17.union([z17.literal(1),z17.literal(2)]).optional(),correlationStrategy:z17.literal("PROVIDER_TASK_ID")});var VideoStartInputSchema=z17.strictObject({expectedExecution:ExpectedGenerationExecutionSchema.optional(),tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,shotId:ShotIdSchema,preparationId:PreparationIdSchema,contractId:GenerationContractIdSchema,contractFingerprint:ContentFingerprintSchema,selection:ProviderSelectionSchema,idempotencyKey:z17.string().trim().min(1).max(200)});var VideoGetInputSchema=z17.strictObject({tenantId:TenantIdSchema,productionId:ProductionIdSchema,generationId:VideoGenerationIdSchema});var VideoQueryInputSchema=z17.strictObject({tenantId:TenantIdSchema,productionId:ProductionIdSchema,shotId:ShotIdSchema.optional(),limit:QueryLimitSchema,next:ContinuationSchema.optional()});var VideoAdmissionSchema=z17.strictObject({semanticStatus:z17.literal("ACCEPTED"),generationId:VideoGenerationIdSchema,operationId:OperationIdSchema,productionId:ProductionIdSchema,contractId:GenerationContractIdSchema,executionClass:z17.enum(["LIVE","TEST_ONLY"])});var VideoTechnicalMetadataSchema=z17.strictObject({contentType:z17.literal("video/mp4"),checksumSha256:ContentFingerprintSchema,byteSize:z17.int().positive().max(128*1024*1024),width:z17.int().positive().max(4096),height:z17.int().positive().max(4096),durationMs:z17.int().min(1).max(30150),frameRate:z17.number().positive().max(120),videoCodec:z17.enum(["h264","hevc"]),pixelFormat:z17.literal("yuv420p10le").optional(),hasAudio:z17.boolean(),nativeAudio:NativeVideoAudioMetadataSchema.optional()});var VideoPosterSchema=z17.strictObject({representationId:ArtifactRepresentationIdSchema,contentType:z17.literal("image/png"),checksumSha256:ContentFingerprintSchema,byteSize:z17.int().positive().max(2*1024*1024),width:z17.int().positive().max(320),height:z17.int().positive().max(320)});var VideoCandidateSchema=VideoTechnicalMetadataSchema.extend({nativeSound:NativeVideoSoundReferenceSchema.optional(),id:z17.uuid(),artifactId:ArtifactIdSchema,representationId:ArtifactRepresentationIdSchema,poster:VideoPosterSchema,availability:z17.enum(["AVAILABLE","INVALID"]),observation:z17.enum(["NOT_OBSERVED","OBSERVED"]),evaluation:z17.enum(["UNREVIEWED","PASS","WARNING","FAIL"]),accepted:z17.boolean(),reviewId:z17.uuid().optional(),reviewVersion:z17.int().positive().optional(),acceptanceDecisionId:z17.uuid().optional(),freshness:z17.enum(["CURRENT_BASIS","STALE_BASIS"])});var VideoGenerationViewSchema=z17.strictObject({generationId:VideoGenerationIdSchema,tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,shotId:ShotIdSchema,preparationId:PreparationIdSchema,contractId:GenerationContractIdSchema,contractFingerprint:ContentFingerprintSchema,connection:z17.strictObject({connectionId:z17.uuid(),connectionVersion:z17.int().positive(),modelProfileId:z17.string(),modelProfileVersion:z17.int().positive()}),operationId:OperationIdSchema,provider:VideoProviderProfileSchema,runtimeStatus:z17.enum(["PENDING","READY","RUNNING","WAITING","SUCCEEDED","FAILED","CANCELLED","SUPERSEDED"]),providerStatus:z17.enum(["NOT_SUBMITTED","SUBMITTING","PENDING","UNKNOWN","SUCCEEDED","FAILED"]),freshness:z17.enum(["CURRENT_BASIS","STALE_BASIS"]),cancellationRequested:z17.boolean(),candidate:VideoCandidateSchema.nullable(),createdByPrincipalId:PrincipalIdSchema,createdAt:z17.iso.datetime({offset:true})});var VideoQueryPageSchema=z17.strictObject({items:z17.array(VideoGenerationViewSchema),page:QueryPageInfoSchema});var VideoSummarySchema=z17.strictObject({generations:z17.int().nonnegative(),running:z17.int().nonnegative(),waiting:z17.int().nonnegative(),registeredCandidates:z17.int().nonnegative(),testCandidates:z17.int().nonnegative(),liveCandidates:z17.int().nonnegative()});import{z as z18}from"zod";var MatrixParameterRuleSchema=SpeechParameterRuleSchema.extend({numberOptions:z18.array(z18.number().finite()).min(1).max(32).optional()}).superRefine((r,ctx)=>{const numeric=r.type==="NUMBER"||r.type==="INTEGER";const stringValid=v=>typeof v==="string"&&v.length<=(r.maxLength??4096)&&(!r.options||r.options.includes(v));const valid=v=>numeric?typeof v==="number"&&Number.isFinite(v)&&(r.type!=="INTEGER"||Number.isInteger(v))&&(r.min===void 0||v>=r.min)&&(r.max===void 0||v<=r.max)&&(!r.numberOptions||r.numberOptions.includes(v)):r.type==="BOOLEAN"?typeof v==="boolean":r.type==="STRING"?stringValid(v):r.type==="STRING_ARRAY"?Array.isArray(v)&&v.length<=(r.maxItems??100)&&v.every(stringValid):!!v&&typeof v==="object"&&!Array.isArray(v)&&Object.keys(v).length<=(r.maxItems??100)&&Object.entries(v).every(([k,item])=>k.length>0&&k.length<=(r.maxKeyLength??100)&&stringValid(item));if(r.min!==void 0&&r.max!==void 0&&r.min>r.max||r.numberOptions&&(!numeric||new Set(r.numberOptions).size!==r.numberOptions.length||r.numberOptions.some(v=>!valid(v)))||r.default!==void 0&&!valid(r.default))ctx.addIssue({code:"custom",message:"Typed parameter range, choices and default must agree"})});import{z as z19}from"zod";var AsrProfileSchema=z19.strictObject({id:ModelProfileIdSchema,version:z19.int().positive(),providerId:ProviderIdSchema,sourceUrl:z19.url().max(2048),verifiedAt:z19.iso.date(),modelId:z19.string().min(1).max(160),label:z19.string().min(1).max(100),protocol:z19.enum(["OPENAI_TRANSCRIPTION_V1","OPENAI_WHISPER_TRANSCRIPTION_V1","QWEN_ASR_V1"]),modes:z19.tuple([z19.literal("TRANSCRIPTION")]),inputKinds:z19.array(z19.enum(["AUDIO","VIDEO"])).min(1).max(2),requestTimeoutMs:z19.int().min(1e3).max(18e4),maxBytes:z19.int().positive().max(12582912),maxDurationMs:z19.int().positive().max(6e4),parameters:z19.record(z19.string().regex(/^[a-z][a-z0-9_]{0,49}$/),MatrixParameterRuleSchema)}).superRefine((p,c)=>{const openai=p.providerId==="OPENAI";const whisper=p.protocol==="OPENAI_WHISPER_TRANSCRIPTION_V1";const fields=openai?whisper?{prompt:"STRING",language:"STRING",temperature:"NUMBER",timestamp_granularities:"STRING_ARRAY"}:{prompt:"STRING",languages:"STRING_ARRAY",keywords:"STRING_ARRAY"}:{context:"STRING",language:"STRING",enable_itn:"BOOLEAN"};if(p.providerId!==(p.protocol==="QWEN_ASR_V1"?"QWEN_CN":"OPENAI")||new Set(p.inputKinds).size!==p.inputKinds.length||!openai&&(p.maxBytes>7340032||p.inputKinds.includes("VIDEO"))||Object.entries(p.parameters).some(([key4,rule])=>fields[key4]!==rule.type))c.addIssue({code:"custom",message:"ASR protocol capability mismatch"});if(whisper){const rule=p.parameters.timestamp_granularities;if(!rule?.required||!rule.options?.length||rule.options.some(v=>!["word","segment"].includes(v)))c.addIssue({code:"custom",message:"Timed ASR requires explicit supported granularities"});const temperature=p.parameters.temperature;if(temperature&&(temperature.min===void 0||temperature.min<0||temperature.max===void 0||temperature.max>1))c.addIssue({code:"custom",message:"Whisper temperature must stay within 0\u20131"})}});var TranscriptText={schemaVersion:z19.literal(1),text:z19.string().max(6e4),languages:z19.array(z19.string().min(2).max(40)).max(32)};var TimedText=z19.strictObject({text:z19.string().min(1).max(2500),startMs:z19.int().nonnegative().max(6e4),endMs:z19.int().positive().max(6e4)}).refine(v=>v.endMs>v.startMs,"Transcript interval must advance");var TranscriptSchema=z19.discriminatedUnion("timing",[z19.strictObject({...TranscriptText,timing:z19.literal("UNAVAILABLE")}),z19.strictObject({...TranscriptText,timing:z19.literal("PROVIDER_REPORTED"),timeBase:z19.literal("ORIGINAL_MEDIA_MS"),granularities:z19.array(z19.enum(["word","segment"])).min(1).max(2),words:z19.array(TimedText).max(1200),segments:z19.array(TimedText).max(240)}).superRefine((v,c)=>{if(new Set(v.granularities).size!==v.granularities.length)c.addIssue({code:"custom",message:"Duplicate timing granularity"});for(const[kind,items]of[["word",v.words],["segment",v.segments]]){if(!v.granularities.includes(kind)&&items.length>0||v.granularities.includes(kind)&&v.text.trim()&&!items.length||items.some((item,i)=>i>0&&item.startMs<items[i-1].endMs))c.addIssue({code:"custom",message:"Missing, unordered or overlapping Provider timing"})}})]);import{z as z20}from"zod";var ObservationModeSchema=z20.enum(["AUDIO","AUDIOVISUAL","VIDEO","VIDEO_ALL_FRAMES","TRANSCRIPTION"]);var ObservationParametersSchema=SpeechParametersSchema;var VisualObservationProfileSchema=z20.strictObject({id:ModelProfileIdSchema,version:z20.int().positive(),providerId:ProviderIdSchema,sourceUrl:z20.url().max(2048),modelId:z20.string().min(1).max(160),label:z20.string().min(1).max(100),protocol:z20.enum(["GEMINI_INTERACTIONS_V1","QIANWEN_VIDEO_V1"]),modes:z20.array(z20.enum(["AUDIO","AUDIOVISUAL","VIDEO","VIDEO_ALL_FRAMES"])).min(1).max(4),requestTimeoutMs:z20.int().min(1e3).max(18e4),maxBytes:z20.int().positive().max(12582912),maxDurationMs:z20.int().positive().max(6e4),parameters:z20.record(z20.string(),z20.strictObject({type:z20.enum(["NUMBER","INTEGER","BOOLEAN","STRING"]),min:z20.number().optional(),max:z20.number().optional(),options:z20.array(z20.string()).max(20).optional(),default:z20.union([z20.number().finite(),z20.boolean(),z20.string().max(200)])}))}).superRefine((p,c)=>{if(new Set(p.modes).size!==p.modes.length)c.addIssue({code:"custom",message:"Duplicate observation mode"});if((p.protocol==="QIANWEN_VIDEO_V1"||p.modes.includes("AUDIOVISUAL"))&&p.maxBytes>8388608)c.addIssue({code:"custom",message:"Video observation input exceeds supported bound"});const gemini=p.protocol==="GEMINI_INTERACTIONS_V1";const allowed=gemini?["max_output_tokens"]:["fps","max_tokens"];if(p.providerId!==(gemini?"GEMINI":"QWEN_CN")||p.modes.some(m=>!(gemini?["AUDIO","AUDIOVISUAL"]:["VIDEO","VIDEO_ALL_FRAMES"]).includes(m))||Object.keys(p.parameters).some(k=>!allowed.includes(k))||allowed.some(k=>!p.parameters[k]))c.addIssue({code:"custom",message:"Observation protocol/profile mismatch"});for(const[k,r]of Object.entries(p.parameters)){const n=r.default;const lo=k==="fps"?1:256,hi=k==="fps"?10:4096;if(typeof n!=="number"||!["NUMBER","INTEGER"].includes(r.type)||k!=="fps"&&r.type!=="INTEGER"||r.min===void 0||r.max===void 0||r.min<lo||r.max>hi||r.min>r.max||n<r.min||n>r.max||r.type==="INTEGER"&&!Number.isSafeInteger(n))c.addIssue({code:"custom",message:"Unsupported observation parameter rule"})}});var ObservationProfileSchema=z20.union([VisualObservationProfileSchema,AsrProfileSchema]);import{z as z21}from"zod";var ProviderTenantInputSchema=z21.strictObject({tenantId:TenantIdSchema});var ImageModelProfileSchema=z21.strictObject({referenceRoles:z21.array(ReferenceRoleSchema.exclude(["START_FRAME_ANCHOR","END_FRAME_ANCHOR"])).min(1).max(6).optional(),id:ModelProfileIdSchema,version:z21.int().positive(),providerId:ProviderIdSchema,modelId:z21.string().min(1).max(160),protocol:z21.enum(["QWEN_EDIT","ARK_IMAGE","GEMINI_IMAGE","OPENAI_IMAGE","XAI_IMAGE"]),maxReferences:z21.int().positive(),promptMaxUtf8Bytes:z21.int().positive(),requestTimeoutMs:z21.int().positive(),workingWidth:z21.int().nonnegative(),workingHeight:z21.int().nonnegative()});var VideoModelProfileSchema=z21.strictObject({id:ModelProfileIdSchema,version:z21.int().positive(),providerId:ProviderIdSchema,modelId:z21.string().min(1).max(160),protocol:z21.enum(["QWEN_VIDEO","VOLCENGINE_VIDEO"]),requestTimeoutMs:z21.int().positive(),promptMaxCharacters:z21.int().positive(),resolution:z21.enum(["720P","1080P"]),adapterVersion:z21.string().min(1).max(80),capabilities:VideoProviderProfileSchema.omit({id:true,adapterVersion:true,model:true,executionClass:true})});var ProviderDefaultViewSchema=z21.strictObject({selection:ProviderSelectionSchema,revision:z21.int().positive()});var scan=z21.strictObject({limit:z21.literal(100),possiblyTruncated:z21.boolean()});var ProviderConnectionPageSchema=scan.extend({items:z21.array(ProviderConnectionViewSchema).max(100)});var ProviderModelsViewSchema=z21.strictObject({catalog:z21.array(ImageModelProfileSchema).max(100),videoCatalog:z21.array(VideoModelProfileSchema).max(100),speechCatalog:z21.array(SpeechModelProfileSchema).max(100).default([]),observationCatalog:z21.array(ObservationProfileSchema).max(100).default([]),available:z21.array(z21.strictObject({selection:ProviderSelectionSchema,profile:KeyframeProviderProfileSchema})).max(1600),defaultSelection:ProviderDefaultViewSchema.nullable(),connectionScan:scan});import{z as z22}from"zod";var key2=z22.string().regex(/^[A-Za-z][A-Za-z0-9_.-]{0,99}$/);var value=z22.union([z22.string().max(160),z22.number().finite(),z22.boolean()]);var ModelAudioCapabilitySchema=z22.enum(["SYNCHRONIZED_AUDIO","SPEECH_GENERATION","SPEECH_RECOGNITION","TRANSCRIPT_TIMESTAMPS","VOICE_REFERENCE","AUDIO_REFERENCE","AUDIO_DRIVEN_VIDEO","LIP_SYNCHRONIZATION","AUDIO_EDITING","SEPARATE_STEMS"]);var ModelCapabilityMatrixSchema=z22.strictObject({schemaVersion:z22.literal(1),service:key2,lifecycle:z22.enum(["ACTIVE","DEPRECATED","RETIRED"]),sources:z22.array(z22.strictObject({url:z22.url().max(2048),checkedAt:z22.iso.date()})).min(1).max(8),modes:z22.array(key2).min(1).max(16),claims:z22.array(z22.strictObject({capability:ModelAudioCapabilitySchema,modes:z22.array(key2).min(1).max(16),support:z22.enum(["SUPPORTED","UNSUPPORTED","UNKNOWN"]),control:z22.enum(["PARAMETER","PROMPT","ALWAYS_ON","MEDIA_INPUT","NONE"]),parameterPath:key2.optional(),access:z22.enum(["PUBLIC","QUALIFIED_ACCOUNT"]).default("PUBLIC"),description:z22.string().max(600).optional()})).max(64),parameters:z22.record(key2,MatrixParameterRuleSchema),constraints:z22.array(z22.strictObject({modes:z22.array(key2).min(1).max(16),when:z22.strictObject({parameter:key2,equals:value}).optional(),require:z22.array(key2).max(16).default([]),forbid:z22.array(key2).max(16).default([]),requireValues:z22.record(key2,value).default({}),reason:z22.string().min(1).max(300)})).max(32),references:z22.array(z22.strictObject({kind:z22.enum(["VOICE_ID","AUDIO_REFERENCE","DRIVING_AUDIO"]),modes:z22.array(key2).min(1).max(16),parameterPath:key2,maxItems:z22.int().min(1).max(10),minDurationMs:z22.int().positive().optional(),maxDurationMs:z22.int().positive().max(6e4).optional(),maxTotalDurationMs:z22.int().positive().max(6e4).optional(),maxBytes:z22.int().positive().max(67108864).optional(),formats:z22.array(z22.enum(["WAV","MP3"])).max(2),requiresVisual:z22.boolean(),access:z22.enum(["PUBLIC","QUALIFIED_ACCOUNT"])})).max(16),outputAudioChannels:z22.union([z22.literal(1),z22.literal(2)]).optional()}).superRefine((m,ctx)=>{const modes=new Set(m.modes);const claims=m.claims.flatMap(c=>c.modes.map(mode=>`${c.capability}:${mode}:${c.access}`));if(modes.size!==m.modes.length||new Set(claims).size!==claims.length||Object.keys(m.parameters).length>48||[...m.claims,...m.constraints,...m.references].some(r=>r.modes.some(mode=>!modes.has(mode)))||m.claims.some(r=>r.control==="PARAMETER"&&(!r.parameterPath||!Object.hasOwn(m.parameters,r.parameterPath)))||m.constraints.some(r=>r.when&&!Object.hasOwn(m.parameters,r.when.parameter)))ctx.addIssue({code:"custom",message:"Matrix modes and parameter references must resolve"});for(const rule of Object.values(m.parameters))if(rule.min!==void 0&&rule.max!==void 0&&rule.min>rule.max)ctx.addIssue({code:"custom",message:"Matrix parameter range must advance"})});import{z as z23}from"zod";var cost={costPolicy:GenerationCostPolicySchema.optional()};var matrix={matrix:ModelCapabilityMatrixSchema.optional()};var ProviderModelDefinitionSchema=z23.discriminatedUnion("family",[z23.strictObject({family:z23.literal("IMAGE"),profile:ImageModelProfileSchema,...matrix,...cost}),z23.strictObject({family:z23.literal("VIDEO"),profile:VideoModelProfileSchema,...matrix,...cost}),z23.strictObject({family:z23.literal("SPEECH"),profile:SpeechModelProfileSchema,...matrix}),z23.strictObject({family:z23.literal("OBSERVATION"),profile:ObservationProfileSchema,...matrix}),z23.strictObject({family:z23.literal("DECLARED"),profile:z23.strictObject({id:ModelProfileIdSchema,version:z23.int().positive(),providerId:ProviderIdSchema,modelId:z23.string().min(1).max(160),protocol:z23.literal("DOCUMENTED_ONLY")}),matrix:ModelCapabilityMatrixSchema})]);var ProviderModelViewSchema=z23.strictObject({tenantId:TenantIdSchema,id:ModelProfileIdSchema,version:z23.int().positive(),enabled:z23.boolean(),definition:ProviderModelDefinitionSchema}).refine(v=>v.id===v.definition.profile.id&&v.version===v.definition.profile.version,{message:"Model version identity mismatch"});var ConfigureProviderModelSchema=z23.strictObject({tenantId:TenantIdSchema,expectedVersion:z23.int().nonnegative(),definition:ProviderModelDefinitionSchema}).refine(v=>v.definition.profile.version===v.expectedVersion+1,{message:"Next model version required"}).refine(v=>new TextEncoder().encode(JSON.stringify(v.definition)).length<=65536,{message:"Model definition too large"});var DisableProviderModelSchema=z23.strictObject({tenantId:TenantIdSchema,id:ModelProfileIdSchema,expectedVersion:z23.int().positive()});var ProviderModelPageSchema=z23.strictObject({items:z23.array(ProviderModelViewSchema).max(100),possiblyTruncated:z23.boolean()});var ProviderModelGetSchema=z23.strictObject({tenantId:TenantIdSchema,id:ModelProfileIdSchema,version:z23.int().positive().optional()});import{z as z24}from"zod";var id3=z24.uuid().toLowerCase();var SoundPlanScopeSchema=z24.strictObject({tenantId:id3,productionId:id3});var SoundPlanBasisSchema=z24.strictObject({briefVersionId:id3,briefVersion:z24.int().positive(),storyVersionId:id3,storyVersion:z24.int().positive(),planVersionId:id3,planVersion:z24.int().positive()});var SoundPlanModelSchema=z24.strictObject({modelProfileId:z24.string().regex(/^[a-z][a-z0-9-]{1,79}$/),modelProfileVersion:z24.int().positive(),connectionId:id3});var SoundMakingPlanContentSchema=z24.strictObject({visuals:z24.array(z24.strictObject({shotId:id3,method:z24.enum(["CODE","GENERATED","IMPORTED"]),model:SoundPlanModelSchema.optional(),nativeAudio:z24.boolean().optional(),sourceSound:SourceSoundTreatmentSchema,rationale:z24.string().trim().min(1).max(600)})).min(1).max(200),cues:z24.array(z24.strictObject({id:z24.string().regex(/^[a-z][a-z0-9_-]{0,63}$/),role:z24.enum(["NARRATION","DIALOGUE","MUSIC","AMBIENCE","SOUND_EFFECT"]),source:z24.enum(["TTS","NATIVE_VIDEO","IMPORTED_AUDIO","EXISTING_AUDIO"]),shotIds:z24.array(id3).min(1).max(200),startMs:z24.int().min(0).max(6e4),endMs:z24.int().positive().max(6e4),text:z24.string().trim().min(1).max(6e3).optional(),voice:z24.string().min(1).max(100).optional(),model:SoundPlanModelSchema.optional(),parameters:SpeechParametersSchema.optional(),audio:z24.strictObject({purpose:z24.enum(["VOICEOVER","MUSIC"]),versionId:z24.uuid()}).optional(),lipSync:z24.enum(["REQUIRED","NONE"]),exactSpeech:z24.boolean()})).max(64),unknowns:z24.array(z24.string().trim().min(1).max(300)).max(16)}).superRefine((v,c)=>{if(new Set(v.visuals.map(s=>s.shotId)).size!==v.visuals.length||new Set(v.cues.map(s=>s.id)).size!==v.cues.length)c.addIssue({code:"custom",message:"Visual Shot and cue identities must be unique"});for(const s of v.visuals)if(s.method==="GENERATED"!==!!s.model||s.method==="GENERATED"&&s.nativeAudio===void 0||s.method!=="GENERATED"&&s.nativeAudio!==void 0||s.method==="CODE"&&s.sourceSound.policy!=="MUTE")c.addIssue({code:"custom",message:"Generated visuals require a model; CODE has no native sound"});for(const cue of v.cues)if(cue.endMs<=cue.startMs||new Set(cue.shotIds).size!==cue.shotIds.length||cue.source==="TTS"&&(!cue.text||!cue.voice||!cue.model||!["NARRATION","DIALOGUE"].includes(cue.role))||cue.exactSpeech&&!cue.text||["NARRATION","DIALOGUE"].includes(cue.role)&&!cue.text||["IMPORTED_AUDIO","EXISTING_AUDIO"].includes(cue.source)!==!!cue.audio||cue.audio&&((["NARRATION","DIALOGUE"].includes(cue.role)?"VOICEOVER":"MUSIC")!==cue.audio.purpose||!["NARRATION","DIALOGUE","MUSIC"].includes(cue.role))||cue.source!=="TTS"&&(!!cue.voice||!!cue.model||!!cue.parameters)||cue.source==="NATIVE_VIDEO"&&["NARRATION","DIALOGUE"].includes(cue.role)&&cue.shotIds.length!==1||cue.lipSync==="REQUIRED"&&(cue.source!=="NATIVE_VIDEO"||cue.shotIds.length!==1))c.addIssue({code:"custom",message:"Invalid speech, cue timing or synchronization intent"})});var SoundPlanVersionSchema=SoundPlanScopeSchema.extend({id:id3,soundPlanId:id3,projectId:id3,version:z24.int().positive(),basis:SoundPlanBasisSchema,content:SoundMakingPlanContentSchema,createdByPrincipalId:id3,createdAt:z24.iso.datetime({offset:true})});var SoundPlanValidateSchema=SoundPlanScopeSchema.extend({expectedProductionRevision:z24.int().positive(),basis:SoundPlanBasisSchema,content:SoundMakingPlanContentSchema});var SoundPlanAcceptSchema=SoundPlanValidateSchema.extend({expectedVersion:z24.int().nonnegative(),idempotencyKey:z24.string().trim().min(1).max(200)});var SoundPlanGetSchema=SoundPlanScopeSchema.extend({versionId:id3.optional()});var SoundPlanDiagnosticSchema=z24.strictObject({severity:z24.enum(["ERROR","WARNING"]),code:z24.string().regex(/^[A-Z][A-Z0-9_]{0,79}$/),shotId:id3.optional(),cueId:z24.string().max(64).optional(),message:z24.string().max(500)});var SoundPlanValidationSchema=z24.strictObject({executable:z24.boolean(),diagnostics:z24.array(SoundPlanDiagnosticSchema).max(256),semantics:z24.literal("PLAN_VALIDATION_NOT_CREATIVE_OR_LISTENING_APPROVAL")});var SoundPlanViewSchema=z24.strictObject({version:SoundPlanVersionSchema,current:z24.boolean(),freshness:z24.enum(["CURRENT_BASIS","STALE_BASIS"])});var SoundPlanReceiptSchema=z24.strictObject({semanticStatus:z24.literal("SUCCESS"),version:SoundPlanVersionSchema,productionRevision:z24.int().positive()});var SoundPlanContextSchema=SoundPlanScopeSchema.extend({projectId:id3,productionRevision:z24.int().positive(),runnable:z24.boolean(),basis:SoundPlanBasisSchema.nullable(),targetDurationMs:z24.int().positive().nullable(),shots:z24.array(z24.strictObject({shotId:id3,durationMs:z24.int().positive()})).max(200),currentVersion:z24.int().nonnegative(),currentVersionId:id3.nullable(),capabilities:z24.strictObject({models:z24.array(ProviderModelViewSchema).max(100),video:z24.array(z24.strictObject({selection:ProviderSelectionSchema,profile:VideoProviderProfileSchema})).max(1600),speech:SpeechOptionsSchema.shape.options,audio:z24.array(AudioViewSchema).max(64)})});import{z as z27}from"zod";import{z as z26}from"zod";import{z as z25}from"zod";var id4=z25.uuid().toLowerCase();var hash2=z25.string().regex(/^[0-9a-f]{64}$/);var ImportedSynchronousAudioPurposeSchema=z25.literal("SOURCE_SYNC");var SourceSyncPcmMediaSchema=z25.strictObject({profile:z25.literal("PCM_S16LE_48000_SOURCE_SYNC_V1"),audioCodec:z25.literal("pcm_s16le"),sampleRateHz:z25.literal(48e3),audioChannels:z25.union([z25.literal(1),z25.literal(2)]),sampleCount:z25.int().min(1600).max(576e3),durationMs:z25.number().positive().max(12e3)}).refine(m=>m.sampleCount%1600===0&&m.durationMs===m.sampleCount/48);var ImportedSynchronousAudioExtractionSchema=z25.strictObject({schemaVersion:z25.literal(1),purpose:ImportedSynchronousAudioPurposeSchema,tenantId:id4,projectId:id4,productionId:id4,shotId:id4,sourceId:id4,sourceVersionId:id4,normalizationId:id4,originalArtifactId:id4,originalRepresentationId:id4,originalChecksumSha256:hash2,sourceRange:z25.strictObject({clock:z25.literal("SOURCE_ZERO_BASED_CFR30"),startFrame:z25.int().nonnegative().max(1799),endFrame:z25.int().positive().max(1800)}),destinationStartSample:z25.literal(0)}).refine(v=>v.sourceRange.endFrame>v.sourceRange.startFrame&&v.sourceRange.endFrame-v.sourceRange.startFrame<=360);var ImportedSynchronousAudioSourceSchema=z25.strictObject({schemaVersion:z25.literal(1),purpose:ImportedSynchronousAudioPurposeSchema,tenantId:id4,projectId:id4,productionId:id4,shotId:id4,sourceId:id4,sourceVersionId:id4,normalizationId:id4,originalArtifactId:id4,originalRepresentationId:id4,originalChecksumSha256:hash2,sourceRange:z25.strictObject({clock:z25.literal("SOURCE_ZERO_BASED_CFR30"),startFrame:z25.int().nonnegative(),endFrame:z25.int().positive()}),destinationStartSample:z25.int().nonnegative(),media:z25.union([AudioMediaSchema,SourceSyncPcmMediaSchema]),wavChecksumSha256:hash2,wavByteSize:z25.int().min(44).max(12582912)}).superRefine((v,ctx)=>{if(v.sourceRange.endFrame<=v.sourceRange.startFrame||(v.sourceRange.endFrame-v.sourceRange.startFrame)*1600!==v.media.sampleCount)ctx.addIssue({code:"custom",message:"Exact CFR30 interval and PCM48k sample mapping required"})});var id5=z26.uuid().toLowerCase();var key3=z26.string().trim().min(1).max(200);var SourceSyncAudioStartSchema=z26.strictObject({tenantId:id5,productionId:id5,normalizationId:id5,expectedProductionRevision:z26.int().positive(),expectedVersion:z26.int().nonnegative(),idempotencyKey:key3});var SourceSyncAudioGetSchema=z26.strictObject({tenantId:id5,productionId:id5,shotId:id5,versionId:id5});var SourceSyncAudioVersionSchema=z26.strictObject({schemaVersion:z26.literal(1),purpose:z26.literal("SOURCE_SYNC"),id:id5,audioId:id5,version:z26.int().positive(),tenantId:id5,projectId:id5,productionId:id5,shotId:id5,normalizationId:id5,artifactId:id5,representationId:id5,provenance:ImportedSynchronousAudioSourceSchema,previousVersionId:id5.nullable(),executionClass:z26.enum(["LIVE","TEST_ONLY"]),createdByPrincipalId:id5,createdAt:z26.iso.datetime({offset:true})});var SourceSyncAudioReceiptSchema=z26.strictObject({semanticStatus:z26.literal("SUCCESS"),version:SourceSyncAudioVersionSchema,productionRevision:z26.int().positive()});var SourceSyncAudioViewSchema=z26.strictObject({version:SourceSyncAudioVersionSchema,status:z26.enum(["CURRENT","STALE"]),availability:z26.enum(["AVAILABLE","UNAVAILABLE"])});var TimelineSourceSoundInputSchema=z27.strictObject({duckingMusicPermille:z27.int().nonnegative().max(1e3).optional(),soundPlanVersionId:z27.uuid(),clips:z27.array(z27.strictObject({ordinal:z27.int().min(1).max(200),treatment:SourceSoundTreatmentSchema,importedAudioVersionId:z27.uuid().optional()})).min(1).max(200),speechCues:z27.array(z27.strictObject({cueId:z27.string().regex(/^[a-z][a-z0-9_-]{0,63}$/),audioVersionId:z27.uuid()})).max(64)});var TimelineSourceSoundSourceSchema=z27.discriminatedUnion("kind",[z27.strictObject({kind:z27.literal("NATIVE_GENERATED"),version:NativeVideoSoundReferenceSchema}),z27.strictObject({kind:z27.literal("IMPORTED_SYNC"),version:SourceSyncAudioVersionSchema})]);var TimelineSourceSoundCompositionSchema=z27.strictObject({schemaVersion:z27.literal(1),soundPlanVersionId:z27.uuid(),soundPlanFingerprint:z27.string().regex(/^[0-9a-f]{64}$/),plannedCues:SoundMakingPlanContentSchema.shape.cues,mix:AudioMixProfileSchema,clips:z27.array(z27.strictObject({ordinal:z27.int().min(1).max(200),treatment:SourceSoundTreatmentSchema,source:TimelineSourceSoundSourceSchema.optional(),sourceInSample:z27.int().nonnegative().max(288e4),sourceOutSample:z27.int().nonnegative().max(288e4),startSample:z27.int().nonnegative().max(288e4),outputSampleCount:z27.int().positive().max(288e4)})).min(1).max(200),speechCues:z27.array(z27.strictObject({cueId:z27.string().regex(/^[a-z][a-z0-9_-]{0,63}$/),source:AudioVersionSchema,sourceInMs:z27.literal(0),sourceOutMs:z27.int().positive().max(6e4),startMs:z27.int().nonnegative().max(6e4),gainPermille:z27.literal(1e3)})).max(64)}).superRefine((v,ctx)=>{if(new Set(v.clips.map(c=>c.ordinal)).size!==v.clips.length||new Set(v.speechCues.map(c=>c.cueId)).size!==v.speechCues.length||v.speechCues.some(c=>c.source.purpose!=="VOICEOVER"||c.sourceOutMs!==c.source.media.durationMs)||v.clips.some(c=>c.treatment.policy!=="MUTE"!==!!c.source||c.source&&c.sourceOutSample<=c.sourceInSample))ctx.addIssue({code:"custom",message:"Explicit distinct clip sound decisions and exact source required"})});import{z as z28}from"zod";var Fingerprint=z28.string().regex(/^[0-9a-f]{64}$/);var AcceptedShotReferenceSchema=z28.strictObject({acceptanceId:z28.uuid(),reviewId:z28.uuid(),generationId:z28.uuid(),candidateId:z28.uuid(),shotId:ShotIdSchema,artifactId:ArtifactIdSchema,representationId:ArtifactRepresentationIdSchema,checksumSha256:Fingerprint,artifactChecksumSha256:Fingerprint,preparationId:z28.uuid(),contractId:z28.uuid(),contractFingerprint:Fingerprint,planVersionId:SceneShotPlanVersionIdSchema,planVersion:z28.int().positive(),shotPlanningRevision:z28.int().positive(),executionClass:z28.enum(["LIVE","TEST_ONLY"]),reviewResult:z28.enum(["PASS","WARNING"])});import{z as z29}from"zod";var Fingerprint2=z29.string().regex(/^[0-9a-f]{64}$/);var ProgrammaticAcceptedVisualSourceReferenceSchema=z29.strictObject({sourceKind:z29.literal("PROGRAMMATIC"),acceptanceId:z29.uuid(),reviewId:z29.uuid(),renderId:z29.uuid(),compositionId:z29.uuid(),compositionVersionId:z29.uuid(),compositionVersion:z29.int().positive(),compositionFingerprint:Fingerprint2,renderManifestFingerprint:Fingerprint2,shotId:ShotIdSchema,artifactId:ArtifactIdSchema,representationId:ArtifactRepresentationIdSchema,checksumSha256:Fingerprint2,artifactChecksumSha256:Fingerprint2,planVersionId:SceneShotPlanVersionIdSchema,planVersion:z29.int().positive(),shotPlanningRevision:z29.int().positive(),executionClass:z29.enum(["LIVE","TEST_ONLY"]),reviewResult:z29.enum(["PASS","WARNING"])});var ImportedAcceptedVisualSourceReferenceSchema=z29.strictObject({sourceKind:z29.literal("IMPORTED"),acceptanceId:z29.uuid(),reviewId:z29.uuid(),normalizationId:z29.uuid(),sourceId:z29.uuid(),sourceVersionId:z29.uuid(),shotId:ShotIdSchema,artifactId:ArtifactIdSchema,representationId:ArtifactRepresentationIdSchema,checksumSha256:Fingerprint2,executionClass:z29.enum(["LIVE","TEST_ONLY"]),reviewResult:z29.enum(["PASS","WARNING"])});var AcceptedVisualSourceReferenceSchema=z29.union([AcceptedShotReferenceSchema,ProgrammaticAcceptedVisualSourceReferenceSchema,ImportedAcceptedVisualSourceReferenceSchema]);import{z as z30}from"zod";var id6=z30.uuid().toLowerCase();var hash3=z30.string().regex(/^[0-9a-f]{64}$/);var CaptionTranscriptPlacementSchema=z30.discriminatedUnion("kind",[z30.strictObject({kind:z30.literal("AUDIO_TRACK"),purpose:z30.enum(["VOICEOVER","MUSIC"])}),z30.strictObject({kind:z30.literal("SPEECH_CUE"),cueId:z30.string().regex(/^[a-z][a-z0-9_-]{0,63}$/)}),z30.strictObject({kind:z30.literal("TIMELINE_OUTPUT")})]);var CaptionTranscriptPlanSchema=z30.strictObject({tenantId:TenantIdSchema,productionId:ProductionIdSchema,timelineVersionId:id6,language:z30.string().regex(/^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{1,8})*$/).max(60),sources:z30.array(z30.strictObject({observationId:id6,placement:CaptionTranscriptPlacementSchema,granularity:z30.enum(["word","segment"])})).min(1).max(64)});var AuthorTranscriptCaptionsSchema=CaptionTranscriptPlanSchema.extend({expectedProductionRevision:z30.int().positive(),expectedCaptionVersion:z30.int().nonnegative(),idempotencyKey:z30.string().trim().min(1).max(200)});var CaptionTranscriptProvenanceSchema=z30.strictObject({schemaVersion:z30.literal(1),advisory:z30.literal(true),timing:z30.literal("PROVIDER_REPORTED"),timelineVersionId:id6,timingFingerprint:hash3,sources:z30.array(z30.strictObject({observationId:id6,artifactId:id6,representationId:id6,checksumSha256:hash3,placement:CaptionTranscriptPlacementSchema,granularity:z30.enum(["word","segment"]),sourceInMs:z30.int().nonnegative(),sourceOutMs:z30.int().positive(),startMs:z30.int().nonnegative(),spanIndices:z30.array(z30.int().nonnegative().max(1199)).min(1).max(120),excludedSpans:z30.int().nonnegative().max(1200)})).min(1).max(64)});import{z as z31}from"zod";var sha3=z31.string().regex(/^[0-9a-f]{64}$/);var CaptionContentSchema=z31.strictObject({language:z31.string().regex(/^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{1,8})*$/).max(60),durationMs:z31.int().min(3e4).max(6e4),cues:z31.array(z31.strictObject({startMs:z31.int().nonnegative().max(59999),endMs:z31.int().positive().max(6e4),text:z31.string().min(1).max(240)})).min(1).max(120)});var CaptionScopeSchema=z31.strictObject({tenantId:TenantIdSchema,productionId:ProductionIdSchema});var AuthorCaptionsSchema=CaptionScopeSchema.extend({expectedProductionRevision:z31.int().positive(),expectedCaptionVersion:z31.int().nonnegative(),idempotencyKey:z31.string().trim().min(1).max(200),content:CaptionContentSchema});var CaptionGetSchema=CaptionScopeSchema.extend({versionId:z31.uuid()});var CaptionQuerySchema=CaptionScopeSchema.extend({limit:QueryLimitSchema,next:ContinuationSchema.optional()});var CaptionRepresentationSchema=z31.strictObject({id:z31.uuid(),checksumSha256:sha3,byteSize:z31.int().positive().max(131072)});var CaptionVersionSchema=CaptionScopeSchema.extend({transcriptProvenance:CaptionTranscriptProvenanceSchema.optional(),id:z31.uuid(),captionId:z31.uuid(),projectId:z31.uuid(),version:z31.int().positive(),artifactId:z31.uuid(),content:CaptionContentSchema,fingerprint:sha3,original:CaptionRepresentationSchema,subtitle:CaptionRepresentationSchema,previousVersionId:z31.uuid().nullable(),createdByPrincipalId:z31.uuid(),createdAt:z31.iso.datetime({offset:true})});var CaptionViewSchema=z31.strictObject({version:CaptionVersionSchema,isCurrent:z31.boolean(),availability:z31.enum(["AVAILABLE","UNAVAILABLE"])});var CaptionReceiptSchema=z31.strictObject({semanticStatus:z31.literal("SUCCESS"),version:CaptionVersionSchema,productionRevision:z31.int().positive()});var CaptionBasisSchema=CaptionScopeSchema.extend({productionRevision:z31.int().positive(),currentVersion:z31.int().nonnegative(),currentVersionId:z31.uuid().nullable(),authorable:z31.boolean()});var CaptionPageSchema=z31.strictObject({items:z31.array(CaptionViewSchema).max(200),page:QueryPageInfoSchema});var CaptionExportSchema=CaptionGetSchema.extend({format:z31.enum(["JSON","SRT"])});var CaptionSnapshotSchema=z31.strictObject({currentVersion:z31.int().positive().nullable(),currentVersionId:z31.uuid().nullable(),artifactId:z31.uuid().nullable(),availability:z31.enum(["NONE","AVAILABLE","UNAVAILABLE"]),cueCount:z31.int().nonnegative().max(120),durationMs:z31.int().min(3e4).max(6e4).nullable(),attachedToTimeline:z31.boolean(),attachedCaptionVersionId:z31.uuid().nullable().optional(),attachedTimelineVersionId:z31.uuid().nullable().optional()});var CaptionTranscriptDraftSchema=z31.strictObject({content:CaptionContentSchema,provenance:CaptionTranscriptProvenanceSchema});import{z as z32}from"zod";var LegacyCaptionRenderStyleSchema=z32.strictObject({id:z32.literal("PLAIN_TEXT_NOTO_SANS_SC_V1"),fontSha256:z32.literal("a3041811a78c361b1de50f953c805e0244951c21c5bd412f7232ef0d899af0da"),framePolicy:z32.literal("PTS_HALF_OPEN_CEIL_V1")});var RegularCaptionRenderStyleSchema=z32.strictObject({id:z32.literal("PLAIN_TEXT_NATIVE_SC_REGULAR_V2"),fontSha256:z32.literal("e5a51f41fc1b827da651afee3975e07a182ff4f8e04d9dfc0a3cecd6177a52b6"),framePolicy:z32.literal("PTS_HALF_OPEN_CEIL_V1")});var CaptionRenderStyleSchema=z32.discriminatedUnion("id",[LegacyCaptionRenderStyleSchema,RegularCaptionRenderStyleSchema]);import{z as z33}from"zod";var TimelineDurationSchema=z33.strictObject({totalMs:z33.int().positive().max(603e4),targetMs:z33.int().min(3e4).max(6e4),minMs:z33.literal(3e4),maxMs:z33.literal(6e4),deltaTargetMs:z33.int(),classification:z33.enum(["TOO_SHORT","WITHIN_TARGET","TOO_LONG"])});var TimelineClipSchema=z33.strictObject({ordinal:z33.int().positive().max(200),source:AcceptedShotReferenceSchema,technical:VideoTechnicalMetadataSchema,sourceInMs:z33.int().nonnegative(),sourceOutMs:z33.int().positive(),startMs:z33.int().nonnegative(),durationMs:z33.int().positive(),transition:ClipTransitionSchema,framing:ClipFramingSchema.optional()});var TimelineManifestSchema=z33.strictObject({schemaVersion:z33.literal(1),caption:CaptionVersionSchema.optional(),captionStyle:CaptionRenderStyleSchema.optional(),audio:TimelineAudioCompositionSchema.optional(),graphics:z33.array(TimelineGraphicSchema).max(8).optional(),basis:z33.strictObject({briefVersionId:BriefVersionIdSchema,briefVersion:z33.int().positive(),storyVersion:z33.int().positive(),planVersionId:SceneShotPlanVersionIdSchema,planVersion:z33.int().positive()}),output:z33.strictObject({aspectRatio:z33.enum(["16:9","9:16"]),profile:DeliveryOutputProfileSchema}),clips:z33.array(TimelineClipSchema).min(1).max(200),duration:TimelineDurationSchema,missingPlannedShotIds:z33.array(ShotIdSchema).max(200),executionClass:z33.enum(["LIVE","TEST_ONLY"])});var TimelineVersionIdentityShape={id:z33.uuid(),timelineId:z33.uuid(),tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,version:z33.int().positive(),fingerprint:z33.string().regex(/^[0-9a-f]{64}$/),createdByPrincipalId:PrincipalIdSchema,createdAt:z33.iso.datetime({offset:true})};function validateTimelineAttachments(timeline,context){if(timeline.audio?.tracks.some(t=>t.source.tenantId!==timeline.tenantId||t.source.projectId!==timeline.projectId||t.source.productionId!==timeline.productionId||t.startMs+t.sourceOutMs-t.sourceInMs>timeline.duration.totalMs||(t.startMs+t.sourceOutMs-t.sourceInMs)*48>Math.round(timeline.duration.totalMs*30/1e3)*1600))context.addIssue({code:"custom",message:"Timeline audio ownership or physical placement mismatch"});const caption=timeline.caption;if(timeline.captionStyle&&!caption)context.addIssue({code:"custom",message:"Timeline caption style requires an exact caption"});if(caption&&(caption.tenantId!==timeline.tenantId||caption.projectId!==timeline.projectId||caption.productionId!==timeline.productionId||caption.content.durationMs!==timeline.duration.totalMs))context.addIssue({code:"custom",message:"Timeline caption ownership or duration mismatch"})}var TimelineVersionSchema=TimelineManifestSchema.extend(TimelineVersionIdentityShape).superRefine(validateTimelineAttachments);import{z as z34}from"zod";var TimelineV2ClipSchema=TimelineManifestSchema.shape.clips.element.extend({source:AcceptedVisualSourceReferenceSchema});var TimelineV2ManifestSchema=TimelineManifestSchema.extend({schemaVersion:z34.literal(2),clips:z34.array(TimelineV2ClipSchema).min(1).max(200),sourceSound:TimelineSourceSoundCompositionSchema.optional()});var TimelineV2VersionSchema=TimelineV2ManifestSchema.extend(TimelineVersionIdentityShape).superRefine(validateTimelineAttachments);import{z as z35}from"zod";var sha4=z35.string().regex(/^[0-9a-f]{64}$/);var VisualFrameSequenceSchema=z35.strictObject({schemaVersion:z35.literal(1),profileId:z35.literal("RGBA_PNG_SEQUENCE_30_V1"),tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema.nullable(),artifactId:ArtifactIdSchema,representationId:ArtifactRepresentationIdSchema,checksumSha256:sha4,width:z35.int().min(1).max(1920),height:z35.int().min(1).max(1920),frameRate:z35.literal(30),frameCount:z35.int().min(1).max(360),alpha:z35.literal("STRAIGHT_RGBA"),frames:z35.array(z35.strictObject({ordinal:z35.int().min(0).max(359),artifactId:ArtifactIdSchema,representationId:ArtifactRepresentationIdSchema,checksumSha256:sha4,byteSize:z35.int().min(1).max(16*1024*1024)})).min(1).max(360)}).superRefine((v,context)=>{if(v.width*v.height>1920*1080||v.frames.length!==v.frameCount||v.frames.some((f,i)=>f.ordinal!==i)||new Set(v.frames.map(f=>f.representationId)).size!==v.frames.length||v.frames.reduce((n,f)=>n+f.byteSize,0)>64*1024*1024)context.addIssue({code:"custom",message:"Frame sequence geometry/order/identity/byte budget mismatch"})});var VisualLayerPlacementSchema=z35.strictObject({xPermille:z35.int().min(0).max(1e3),yPermille:z35.int().min(0).max(1e3),widthPermille:z35.int().min(1).max(1e3),heightPermille:z35.int().min(1).max(1e3)}).refine(v=>v.xPermille+v.widthPermille<=1e3&&v.yPermille+v.heightPermille<=1e3,"Layer rectangle must fit the canvas");var VisualLayerSchema=z35.strictObject({id:z35.uuid(),source:VisualFrameSequenceSchema,sourceInFrame:z35.int().min(0).max(359),sourceOutFrame:z35.int().min(1).max(360),startFrame:z35.int().min(0).max(1799),zIndex:z35.int().min(0).max(7),opacityPermille:z35.int().min(0).max(1e3),placement:VisualLayerPlacementSchema}).superRefine((v,context)=>{if(v.sourceOutFrame<=v.sourceInFrame||v.sourceOutFrame>v.source.frameCount||v.startFrame+v.sourceOutFrame-v.sourceInFrame>1800)context.addIssue({code:"custom",message:"Layer source/output frame interval mismatch"})});var VisualLayerCompositionSchema=z35.strictObject({schemaVersion:z35.literal(1),profileId:z35.literal("STRAIGHT_ALPHA_FRAME_OVERLAY_30_V1"),tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,totalFrames:z35.int().min(1).max(1800),layers:z35.array(VisualLayerSchema).min(1).max(8)}).superRefine((v,context)=>{const sources=new Map;const frames=new Map;let bytes=0;for(const layer of v.layers){const source=layer.source;const body=JSON.stringify(source);for(const frame of source.frames){const identity=JSON.stringify({artifactId:frame.artifactId,checksumSha256:frame.checksumSha256,byteSize:frame.byteSize,width:source.width,height:source.height});if(frames.has(frame.representationId)&&frames.get(frame.representationId)!==identity)context.addIssue({code:"custom",message:"Shared frame representation has inconsistent facts"});frames.set(frame.representationId,identity)}if(source.tenantId!==v.tenantId||source.projectId!==v.projectId||source.productionId!==null&&source.productionId!==v.productionId||layer.startFrame+layer.sourceOutFrame-layer.sourceInFrame>v.totalFrames||sources.has(source.representationId)&&sources.get(source.representationId)!==body)context.addIssue({code:"custom",message:"Layer source scope/identity/output bounds mismatch"});if(!sources.has(source.representationId))bytes+=source.frames.reduce((n,f)=>n+f.byteSize,0);sources.set(source.representationId,body)}if(new Set(v.layers.map(l=>l.id)).size!==v.layers.length||new Set(v.layers.map(l=>l.zIndex)).size!==v.layers.length||bytes>256*1024*1024)context.addIssue({code:"custom",message:"Layer instance/z-order/byte budget mismatch"})});import{z as z36}from"zod";var TimelineVisualLayerInputSchema=z36.strictObject({id:z36.uuid(),artifactId:ArtifactIdSchema,sourceInFrame:z36.int().min(0).max(359),sourceOutFrame:z36.int().min(1).max(360),startFrame:z36.int().min(0).max(1799),zIndex:z36.int().min(0).max(7),opacityPermille:z36.int().min(0).max(1e3),placement:VisualLayerPlacementSchema}).refine(layer=>layer.sourceOutFrame>layer.sourceInFrame&&layer.startFrame+layer.sourceOutFrame-layer.sourceInFrame<=1800,"Dynamic layer interval must advance and fit the output clock");var TimelineV3ManifestSchema=TimelineV2ManifestSchema.extend({schemaVersion:z36.literal(3),visualLayers:VisualLayerCompositionSchema});var TimelineV3VersionSchema=TimelineV3ManifestSchema.extend(TimelineVersionIdentityShape).superRefine((timeline,context)=>{validateTimelineAttachments(timeline,context);validateTimelineVisualLayerClock(timeline,context)});function validateTimelineVisualLayerClock(timeline,context){const composition=timeline.visualLayers;let sourceMs=0;let totalFrames=0;let previousFrames=0;for(const[index,clip]of timeline.clips.entries()){const previousBoundary=Math.round(sourceMs*30/1e3);sourceMs+=clip.durationMs;const frames=Math.round(sourceMs*30/1e3)-previousBoundary;const overlap=clip.transition==="CUT"?0:clip.transition.durationFrames;if(clip.ordinal!==index+1||frames<1||overlap>0&&(index===0||overlap>=frames||overlap>=previousFrames))context.addIssue({code:"custom",message:"Dynamic Timeline clip frame plan mismatch"});totalFrames+=frames-overlap;previousFrames=frames}if(timeline.tenantId!==void 0&&composition.tenantId!==timeline.tenantId||timeline.projectId!==void 0&&composition.projectId!==timeline.projectId||timeline.productionId!==void 0&&composition.productionId!==timeline.productionId||composition.totalFrames!==totalFrames||Math.abs(totalFrames*1e3/30-timeline.duration.totalMs)>1e3/60+.001)context.addIssue({code:"custom",message:"Dynamic Timeline ownership or physical output clock mismatch"})}import{z as z37}from"zod";var TimelineVersionReaderSchema=z37.discriminatedUnion("schemaVersion",[TimelineVersionSchema,TimelineV2VersionSchema,TimelineV3VersionSchema]);var TimelineManifestReaderSchema=z37.discriminatedUnion("schemaVersion",[TimelineManifestSchema,TimelineV2ManifestSchema,TimelineV3ManifestSchema.superRefine(validateTimelineVisualLayerClock)]);import{z as z38}from"zod";var TimelineScopeSchema=z38.strictObject({tenantId:TenantIdSchema,productionId:ProductionIdSchema});var TimelineClipInputSchema=z38.strictObject({shotId:ShotIdSchema,acceptanceId:z38.uuid(),framing:ClipFramingSchema.optional(),transition:ClipTransitionSchema.optional(),sourceInMs:z38.int().nonnegative().max(30150),sourceOutMs:z38.int().positive().max(30150)}).refine(v=>v.sourceOutMs>v.sourceInMs,"Clip source range must advance");var BuildTimelineShapeSchema=TimelineScopeSchema.extend({schemaVersion:z38.union([z38.literal(2),z38.literal(3)]).optional(),expectedProductionRevision:z38.int().positive(),expectedTimelineVersion:z38.int().nonnegative(),idempotencyKey:z38.string().trim().min(1).max(200),clips:z38.array(TimelineClipInputSchema).min(1).max(200),captionVersionId:z38.uuid().optional(),audio:TimelineAudioInputSchema.optional(),sourceSound:TimelineSourceSoundInputSchema.optional(),graphics:z38.array(TimelineGraphicInputSchema).max(8).optional(),visualLayers:z38.array(TimelineVisualLayerInputSchema).min(1).max(8).optional()});var BuildTimelineSchema=BuildTimelineShapeSchema.superRefine((input,context)=>{if(input.sourceSound&&!input.schemaVersion)context.addIssue({code:"custom",message:"Source sound requires explicit Timeline2/3"});if(input.schemaVersion===3!==!!input.visualLayers?.length)context.addIssue({code:"custom",message:"Dynamic layers require explicit Timeline3"});if(input.visualLayers&&(new Set(input.visualLayers.map(layer=>layer.id)).size!==input.visualLayers.length||new Set(input.visualLayers.map(layer=>layer.zIndex)).size!==input.visualLayers.length))context.addIssue({code:"custom",message:"Dynamic layer IDs and z-order must be unique"})});var TimelineStaleReasonSchema=z38.enum(["BRIEF_CHANGED","STORY_CHANGED","PLAN_CHANGED","SHOT_ACCEPTANCE_CHANGED","PRODUCTION_UNAVAILABLE","CAPTION_VERSION_CHANGED","CAPTION_UNAVAILABLE","AUDIO_VERSION_CHANGED","AUDIO_UNAVAILABLE","GRAPHIC_UNAVAILABLE","VISUAL_LAYER_UNAVAILABLE","SOUND_PLAN_CHANGED","SOURCE_SOUND_UNAVAILABLE"]);var TimelineViewSchema=z38.strictObject({version:TimelineVersionReaderSchema,isCurrent:z38.boolean(),freshness:z38.enum(["CURRENT_BASIS","STALE_BASIS"]),staleReasons:z38.array(TimelineStaleReasonSchema).max(13),assemblyStatus:z38.enum(["DRAFT","ASSEMBLY_READY"])});var TimelineGetSchema=TimelineScopeSchema.extend({versionId:z38.uuid()});var TimelineQuerySchema=TimelineScopeSchema.extend({limit:QueryLimitSchema,next:ContinuationSchema.optional()});var TimelinePageSchema=z38.strictObject({items:z38.array(TimelineViewSchema),page:QueryPageInfoSchema});var TimelineBuildReceiptSchema=z38.strictObject({semanticStatus:z38.literal("SUCCESS"),version:TimelineVersionReaderSchema,productionRevision:z38.int().positive()});var TimelineBasisSchema=TimelineScopeSchema.extend({productionRevision:z38.int().positive(),currentTimelineVersion:z38.int().nonnegative(),runnable:z38.boolean(),planningReady:z38.boolean(),output:TimelineManifestSchema.shape.output.nullable(),targetDurationMs:z38.int().positive().nullable(),shots:z38.array(z38.strictObject({shotId:ShotIdSchema,ordinal:z38.int().positive(),acceptanceStatus:z38.enum(["NONE","CURRENT","STALE"]),source:AcceptedVisualSourceReferenceSchema.nullable(),technical:VideoTechnicalMetadataSchema.nullable()})).max(200)});var TimelineSnapshotSchema=z38.strictObject({currentVersion:z38.int().positive().nullable(),stale:z38.boolean(),timelineId:z38.uuid().nullable(),versionId:z38.uuid().nullable(),assemblyStatus:z38.enum(["DRAFT","ASSEMBLY_READY"]).nullable(),totalDurationMs:z38.int().positive().nullable(),durationClassification:TimelineDurationSchema.shape.classification.nullable(),missingPlannedShots:z38.int().nonnegative(),staleReasons:z38.array(TimelineStaleReasonSchema).max(13)});import{z as z39}from"zod";var FinalRenderProfileIdSchema=z39.enum(["FINAL_H264_720P_V1","FINAL_H264_1080P_V1","FINAL_H264_480P_V1"]);var FinalRenderProfileSchema=z39.strictObject({id:FinalRenderProfileIdSchema,algorithm:z39.enum(["ORDERED_TRIM_CUT_V1","ORDERED_COMPOSE_V2"]),picturePolicy:PicturePolicySchema.optional(),width:z39.union([z39.literal(1280),z39.literal(720),z39.literal(1920),z39.literal(1080),z39.literal(854),z39.literal(480)]),height:z39.union([z39.literal(1280),z39.literal(720),z39.literal(1920),z39.literal(1080),z39.literal(854),z39.literal(480)]),frameRate:z39.literal(30),codec:z39.literal("h264"),pixelFormat:z39.literal("yuv420p"),fit:z39.literal("PAD"),hasAudio:z39.boolean(),audioMix:AudioMixProfileSchema.optional(),framePolicy:z39.literal("CUMULATIVE_NEAREST_FRAME"),encoder:z39.literal("libx264"),crf:z39.literal(18),preset:z39.literal("veryfast"),gopFrames:z39.literal(30),bFrames:z39.literal(0),audioPolicy:z39.enum(["SILENT","MIXED"]),captionPolicy:z39.enum(["NONE","BURN_IN"]),sourceQualityPolicy:z39.literal("NO_UPSCALE_V1"),captionStyle:CaptionRenderStyleSchema.optional(),graphicsPolicy:z39.literal("OVERLAY_V1").optional()}).superRefine((profile,context)=>{if(profile.hasAudio!==!!profile.audioMix||profile.hasAudio!==(profile.audioPolicy==="MIXED"))context.addIssue({code:"custom",message:"Exact native audio policy and mix must agree"});if(!!profile.captionStyle!==(profile.captionPolicy==="BURN_IN"))context.addIssue({code:"custom",message:"Caption burn-in requires exact native style"});const pair=profile.id==="FINAL_H264_720P_V1"?[1280,720]:profile.id==="FINAL_H264_480P_V1"?[854,480]:[1920,1080];if(!(profile.width===pair[0]&&profile.height===pair[1]||profile.width===pair[1]&&profile.height===pair[0]))context.addIssue({code:"custom",message:"Final profile geometry mismatch"})});import{z as z40}from"zod";var RoughCutProfileSchema=z40.strictObject({captionPolicy:z40.literal("BURN_IN").optional(),captionStyle:CaptionRenderStyleSchema.optional(),graphicsPolicy:z40.literal("OVERLAY_V1").optional(),id:z40.literal("PREVIEW_H264_480P_V1"),algorithm:z40.enum(["ORDERED_TRIM_CUT_V1","ORDERED_COMPOSE_V2"]),picturePolicy:PicturePolicySchema.optional(),width:z40.union([z40.literal(854),z40.literal(480)]),height:z40.union([z40.literal(854),z40.literal(480)]),frameRate:z40.literal(30),codec:z40.literal("h264"),pixelFormat:z40.literal("yuv420p"),fit:z40.literal("PAD"),hasAudio:z40.boolean(),audioMix:AudioMixProfileSchema.optional(),framePolicy:z40.literal("CUMULATIVE_NEAREST_FRAME")}).superRefine((profile,context)=>{if(profile.hasAudio!==!!profile.audioMix)context.addIssue({code:"custom",message:"Audio policy requires exact native mix"});if(!!profile.captionStyle!==!!profile.captionPolicy)context.addIssue({code:"custom",message:"Caption policy and style must agree"})});import{z as z41}from"zod";var RoughCutManifestSchema=z41.strictObject({schemaVersion:z41.literal(1),timeline:TimelineVersionSchema,profile:RoughCutProfileSchema,frames:z41.array(z41.strictObject({ordinal:z41.int().positive().max(200),startFrame:z41.int().nonnegative().max(1800),frameCount:z41.int().positive().max(1800),overlapFrames:z41.int().nonnegative().max(30).default(0)})).min(1).max(200),totalFrames:z41.int().min(900).max(1800)});import{z as z42}from"zod";var dynamicPolicy=z42.literal("STRAIGHT_ALPHA_FRAME_OVERLAY_30_V1");var VisualLayerPreviewProfileSchema=RoughCutProfileSchema.safeExtend({visualLayerPolicy:dynamicPolicy});var VisualLayerFinalProfileSchema=FinalRenderProfileSchema.safeExtend({visualLayerPolicy:dynamicPolicy,visualLayerSourceQualityPolicy:z42.literal("NO_UPSCALE_V1")});var shape={schemaVersion:z42.literal(3),timeline:TimelineV3VersionSchema};var preview=RoughCutManifestSchema.extend({...shape,profile:VisualLayerPreviewProfileSchema});var final=RoughCutManifestSchema.extend({...shape,profile:VisualLayerFinalProfileSchema});function validateClock(value2,context){if(value2.totalFrames!==value2.timeline.visualLayers.totalFrames)context.addIssue({code:"custom",message:"Dynamic render must use the frozen layer clock"})}var VisualLayerPreviewManifestSchema=preview.superRefine(validateClock);var VisualLayerFinalManifestSchema=final.superRefine(validateClock);var VisualLayerRenderManifestSchema=z42.union([VisualLayerPreviewManifestSchema,VisualLayerFinalManifestSchema]);import{z as z43}from"zod";var sha5=z43.string().regex(/^[0-9a-f]{64}$/);var RoughCutStartSchema=TimelineScopeSchema.extend({timelineVersionId:z43.uuid(),timelineFingerprint:sha5,expectedProductionRevision:z43.int().positive(),profileId:z43.literal("PREVIEW_H264_480P_V1"),idempotencyKey:z43.string().trim().min(1).max(200)});var RoughCutGetSchema=TimelineScopeSchema.extend({renderId:z43.uuid()});var RoughCutQuerySchema=TimelineScopeSchema.extend({limit:QueryLimitSchema,next:ContinuationSchema.optional()});var RoughCutV2ManifestSchema=RoughCutManifestSchema.extend({schemaVersion:z43.literal(2),timeline:TimelineV2VersionSchema});var RoughCutManifestReaderSchema=z43.discriminatedUnion("schemaVersion",[RoughCutManifestSchema,RoughCutV2ManifestSchema,VisualLayerPreviewManifestSchema]);var RoughCutTechnicalSchema=VideoTechnicalMetadataSchema.extend({hasAudio:z43.boolean(),audio:RenderedAudioSchema.optional(),durationMs:z43.int().min(29983).max(60017),frameRate:z43.literal(30),frameCount:z43.int().min(900).max(1800),engineVersion:z43.string().min(1).max(200)}).superRefine((v,ctx)=>{if(v.hasAudio!==!!v.audio||v.audio&&v.audio.sampleCount!==v.frameCount*1600)ctx.addIssue({code:"custom",message:"Actual audio stream must match physical output samples"})});var RoughCutArtifactSchema=RoughCutTechnicalSchema.safeExtend({artifactId:z43.uuid(),representationId:z43.uuid(),version:z43.int().positive(),poster:VideoPosterSchema,availability:z43.enum(["AVAILABLE","INVALID"]),reviewState:z43.enum(["UNREVIEWED","PASS","WARNING","FAIL"])});var RoughCutAdmissionSchema=z43.strictObject({semanticStatus:z43.literal("ACCEPTED"),renderId:z43.uuid(),operationId:OperationIdSchema,productionId:z43.uuid(),timelineVersionId:z43.uuid(),timelineFingerprint:sha5,executionClass:z43.enum(["LIVE","TEST_ONLY"]),manifestFingerprint:sha5,productionRevision:z43.int().positive()});var RoughCutViewSchema=TimelineScopeSchema.extend({renderId:z43.uuid(),projectId:ProjectIdSchema,runtimeJobId:z43.uuid(),operationId:OperationIdSchema,manifest:RoughCutManifestReaderSchema,manifestFingerprint:sha5,runtimeStatus:VideoGenerationViewSchema.shape.runtimeStatus,cancellationRequested:z43.boolean(),isCurrentTimeline:z43.boolean(),freshness:z43.enum(["CURRENT_BASIS","STALE_BASIS"]),staleReasons:z43.array(z43.string().min(1).max(120)).max(16),executionClass:z43.enum(["LIVE","TEST_ONLY"]),roughCut:RoughCutArtifactSchema.nullable(),createdByPrincipalId:PrincipalIdSchema,createdAt:z43.iso.datetime({offset:true})});var RoughCutPageSchema=z43.strictObject({items:z43.array(RoughCutViewSchema),page:QueryPageInfoSchema});var RoughCutSnapshotSchema=z43.strictObject({latestVersion:z43.int().positive().nullable(),reviewState:z43.enum(["UNREVIEWED","PASS","WARNING","FAIL"]).nullable(),latestRenderId:z43.uuid().nullable(),runtimeStatus:VideoGenerationViewSchema.shape.runtimeStatus.nullable(),currentRenderId:z43.uuid().nullable(),currentArtifactId:z43.uuid().nullable(),currentTimelineVersionId:z43.uuid().nullable(),stale:z43.boolean()});import{z as z44}from"zod";var TemporalEvidenceReferenceSchema=z44.strictObject({evidenceId:z44.uuid(),frameSetArtifactId:z44.uuid(),contactSheetArtifactId:z44.uuid(),manifestRepresentationId:z44.uuid(),sheetRepresentationId:z44.uuid(),planFingerprint:z44.string().regex(/^[0-9a-f]{64}$/),sourceArtifactId:z44.uuid(),sourceRepresentationId:z44.uuid(),sourceChecksumSha256:z44.string().regex(/^[0-9a-f]{64}$/),timestampsMs:z44.array(z44.number().nonnegative().max(6e4)).min(1).max(64),executionClass:z44.enum(["LIVE","TEST_ONLY"])});var TemporalEvidenceIdsSchema=z44.array(z44.uuid()).min(1).max(8).refine(v=>new Set(v).size===v.length,"Evidence references must be unique");import{z as z45}from"zod";var ListeningEvidenceIdsSchema=z45.array(z45.string().min(1).max(100)).max(64);var ListeningEvidenceSchema=z45.strictObject({id:z45.string().trim().min(1).max(100),kind:z45.enum(["AUDIO_LISTENING","VIDEO_WITH_AUDIO_PLAYBACK"]),media:z45.strictObject({artifactId:z45.uuid(),representationId:z45.uuid(),checksumSha256:z45.string().regex(/^[0-9a-f]{64}$/)}),coverage:z45.array(z45.strictObject({startMs:z45.int().nonnegative().max(6e4),endMs:z45.int().positive().max(6e4)}).refine(v=>v.endMs>v.startMs)).min(1).max(200),producer:z45.string().trim().min(1).max(200)});var ListeningEvidenceSetSchema=z45.array(ListeningEvidenceSchema).max(64).refine(v=>new Set(v.map(e=>e.id)).size===v.length);import{z as z46}from"zod";var sha6=z46.string().regex(/^[0-9a-f]{64}$/);var CompositionFindingLocalitySchema=z46.strictObject({schemaVersion:z46.literal(1),sourceKind:z46.literal("CODE"),role:z46.enum(["PRIMARY_VISUAL","VISUAL_LAYER"]),compositionId:z46.uuid(),compositionVersionId:z46.uuid(),compositionVersion:z46.int().positive(),compositionFingerprint:sha6,renderId:z46.uuid(),renderManifestFingerprint:sha6,artifactId:z46.uuid(),representationId:z46.uuid(),checksumSha256:sha6,clipOrdinal:z46.int().min(1).max(200).nullable(),visualLayerId:z46.uuid().nullable(),sourceInFrame:z46.int().min(0).max(359),sourceOutFrame:z46.int().min(1).max(360),mapping:z46.literal("INTERSECTING_NATIVE_30FPS_FRAME_CELLS")}).superRefine((v,ctx)=>{if(v.sourceOutFrame<=v.sourceInFrame||(v.role==="PRIMARY_VISUAL"?v.clipOrdinal===null||v.visualLayerId!==null:v.visualLayerId===null||v.clipOrdinal!==null))ctx.addIssue({code:"custom",message:"CODE locality requires an exact occurrence and advancing local frame interval"})});import{z as z47}from"zod";var CanonicalFactSchema=z47.strictObject({key:z47.string().regex(/^[A-Z][A-Z0-9_]{1,59}$/),value:z47.string().trim().min(1).max(300),sourceArtifactId:ArtifactIdSchema,evidence:z47.discriminatedUnion("kind",[z47.strictObject({kind:z47.literal("JSON_POINTER"),pointer:z47.string().startsWith("/").max(200)}),z47.strictObject({kind:z47.literal("EXACT_TEXT_LINE")})])});var BriefContentSchema=z47.strictObject({objective:z47.string().trim().min(1).max(1e3),productPresentationGoal:z47.string().trim().min(1).max(1e3),audience:z47.string().trim().min(1).max(300).optional(),styleTone:z47.string().trim().min(1).max(300).optional(),callToAction:z47.string().trim().min(1).max(300).optional(),targetDurationSeconds:z47.int().min(30).max(60),aspectRatio:z47.enum(["16:9","9:16"]),outputProfile:DeliveryOutputProfileSchema,canonicalFacts:z47.array(CanonicalFactSchema).max(32).default([])});var AcceptBriefRequestSchema=z47.strictObject({tenantId:TenantIdSchema,expectedProductionRevision:z47.int().positive(),revisionReason:z47.string().trim().min(1).max(1e3).optional(),sourceArtifactIds:z47.array(ArtifactIdSchema).max(20).default([]),content:BriefContentSchema});var BriefSourceReferenceSchema=z47.strictObject({artifactId:ArtifactIdSchema,checksumSha256:z47.string().regex(/^[0-9a-f]{64}$/)});var BriefVersionSchema=z47.strictObject({id:BriefVersionIdSchema,briefId:BriefIdSchema,tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,version:z47.int().positive(),content:BriefContentSchema,sources:z47.array(BriefSourceReferenceSchema).min(1).max(20),createdByPrincipalId:PrincipalIdSchema,createdAt:z47.iso.datetime({offset:true})});var AcceptBriefResultSchema=z47.discriminatedUnion("semanticStatus",[z47.strictObject({semanticStatus:z47.literal("SUCCESS"),briefVersion:BriefVersionSchema,productionRevision:z47.int().positive(),activeBriefVersion:z47.int().positive()}),z47.strictObject({semanticStatus:z47.literal("NEEDS_INPUT"),missingFacts:z47.array(z47.enum(["PRODUCT_INFORMATION_SOURCE","PRODUCT_NAME"])).min(1)})]);import{z as z48}from"zod";var StoryFactKeySchema=z48.string().regex(/^[A-Z][A-Z0-9_]{1,59}$/);var StoryFactClaimSchema=z48.strictObject({key:StoryFactKeySchema,value:z48.string().trim().min(1).max(300)});var StoryBeatSchema=z48.strictObject({summary:z48.string().trim().min(1).max(600),sceneRequirements:z48.array(z48.string().trim().min(1).max(300)).max(8).default([])});var StoryContentSchema=z48.strictObject({narrativeIntent:z48.string().trim().min(1).max(2e3),beats:z48.array(StoryBeatSchema).min(1).max(24),factualClaims:z48.array(StoryFactClaimSchema).max(32).default([])});var AcceptStoryRequestSchema=z48.strictObject({tenantId:TenantIdSchema,expectedProductionRevision:z48.int().positive(),expectedBriefVersion:z48.int().positive(),revisionReason:z48.string().trim().min(1).max(1e3).optional(),idempotencyKey:z48.string().trim().min(1).max(200),content:StoryContentSchema});var StoryVersionSchema=z48.strictObject({id:StoryVersionIdSchema,storyId:StoryIdSchema,tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,version:z48.int().positive(),briefVersionId:BriefVersionIdSchema,briefVersion:z48.int().positive(),content:StoryContentSchema,createdByPrincipalId:PrincipalIdSchema,createdAt:z48.iso.datetime({offset:true})});var AcceptStoryResultSchema=z48.discriminatedUnion("semanticStatus",[z48.strictObject({semanticStatus:z48.literal("SUCCESS"),storyVersion:StoryVersionSchema,productionRevision:z48.int().positive(),activeStoryVersion:z48.int().positive()}),z48.strictObject({semanticStatus:z48.literal("NEEDS_INPUT"),missingPrerequisites:z48.array(z48.literal("ACTIVE_BRIEF")).min(1)})]);import{z as z49}from"zod";var ConsistencyFamilySchema=z49.enum(["PRODUCT_IDENTITY","CHARACTER_IDENTITY","WARDROBE","LOCATION","BOUNDARY_CONTINUITY","STYLE","VOICE_IDENTITY"]);var ConsistencyEnforcementSchema=z49.enum(["LOCKED","REQUIRED","PREFERRED","FREE"]);var ConsistencyMasterReferenceSchema=z49.strictObject({artifactId:ArtifactIdSchema,representationId:ArtifactRepresentationIdSchema,checksumSha256:z49.string().regex(/^[0-9a-f]{64}$/),artifactChecksumSha256:z49.string().regex(/^[0-9a-f]{64}$/),contentType:z49.enum(["image/png","image/jpeg","image/webp","audio/wav"])});var Fact=z49.strictObject({dimension:z49.string().regex(/^[A-Z][A-Z0-9_]{0,63}$/),value:z49.string().trim().min(1).max(1e3)});var ConsistencySubjectSchema=z49.strictObject({id:z49.uuid(),kind:z49.enum(["CHARACTER","VOICE"]),displayName:z49.string().trim().min(1).max(200),facts:z49.array(Fact).min(1).max(32),master:ConsistencyMasterReferenceSchema}).superRefine((s,c)=>{if(new Set(s.facts.map(f=>f.dimension)).size!==s.facts.length)c.addIssue({code:"custom",message:"Canonical subject dimensions must be unique"});if(s.kind==="VOICE"!==(s.master.contentType==="audio/wav"))c.addIssue({code:"custom",message:"Character requires an image master; Voice requires audio"})});var ConsistencyRuleScopeSchema=z49.discriminatedUnion("kind",[z49.strictObject({kind:z49.literal("PROJECT")}),z49.strictObject({kind:z49.literal("PRODUCTION")}),z49.strictObject({kind:z49.literal("SCENE"),id:z49.uuid()}),z49.strictObject({kind:z49.literal("SHOT"),id:z49.uuid()}),z49.strictObject({kind:z49.literal("CONTINUITY_EDGE"),id:z49.uuid()})]);var ConsistencyRuleSchema=z49.strictObject({reviewScales:z49.array(ConsistencyReviewScaleSchema).min(1).max(3).refine(s=>new Set(s).size===s.length,"Review scales must be unique").optional(),continuity:ContinuityExpectationSchema.optional(),id:z49.uuid(),family:ConsistencyFamilySchema,subjectId:z49.uuid().nullable(),dimension:z49.string().regex(/^[A-Z][A-Z0-9_]{0,63}$/),scope:ConsistencyRuleScopeSchema,enforcement:ConsistencyEnforcementSchema,expected:z49.string().trim().min(1).max(1e3).nullable(),referenceMode:z49.enum(["NONE","SUBJECT_MASTER","EXACT"]),reference:ConsistencyMasterReferenceSchema.optional(),override:z49.strictObject({priorRuleId:z49.uuid(),reason:z49.string().trim().min(1).max(1e3)}).optional(),transition:z49.strictObject({edgeId:z49.uuid(),from:z49.string().trim().min(1).max(1e3),to:z49.string().trim().min(1).max(1e3),reason:z49.string().trim().min(1).max(1e3)}).optional()}).superRefine((r,c)=>{const invalid=message=>c.addIssue({code:"custom",message});if(r.continuity&&(r.enforcement==="FREE"||r.family==="VOICE_IDENTITY"))invalid("FREE/Voice rules cannot create visual state/time obligations");if(r.family==="VOICE_IDENTITY"&&r.reviewScales)invalid("Native Voice review remains inactive");if(r.enforcement==="FREE"!==(r.expected===null))invalid("FREE has no expected obligation; other enforcement requires an expectation");if(r.enforcement==="FREE"&&r.referenceMode!=="NONE")invalid("FREE cannot require reference conditioning");if(r.referenceMode==="EXACT"!==(r.reference!==void 0))invalid("Only EXACT reference mode carries an exact reference");if(r.referenceMode==="SUBJECT_MASTER"&&!r.subjectId)invalid("SUBJECT_MASTER requires an exact canonical subject");if(["CHARACTER_IDENTITY","WARDROBE","VOICE_IDENTITY"].includes(r.family)&&!r.subjectId)invalid("Character, Wardrobe and Voice obligations require an exact subject");if(r.family==="CHARACTER_IDENTITY"&&["LOCKED","REQUIRED"].includes(r.enforcement)&&r.referenceMode==="NONE")invalid("Mandatory Character identity requires concrete identity evidence");if(r.transition&&(r.family!=="WARDROBE"||r.transition.to!==r.expected||!r.override))invalid("A planned Wardrobe transition must name the changed inherited rule and new expectation")});var ConsistencyProfileContentSchema=z49.strictObject({subjects:z49.array(ConsistencySubjectSchema).max(32),rules:z49.array(ConsistencyRuleSchema).max(256)}).superRefine((p,c)=>{const invalid=message=>c.addIssue({code:"custom",message});if(new Set(p.subjects.map(s=>s.id)).size!==p.subjects.length||new Set(p.rules.map(r=>r.id)).size!==p.rules.length)invalid("Consistency subjects and rules require distinct stable IDs");for(const r of p.rules){const s=p.subjects.find(s2=>s2.id===r.subjectId);if(r.subjectId&&!s)invalid("Rule names an unknown canonical subject");if(s&&r.family==="VOICE_IDENTITY"!==(s.kind==="VOICE")&&["CHARACTER_IDENTITY","WARDROBE","VOICE_IDENTITY"].includes(r.family))invalid("Rule family and canonical subject kind disagree");if(r.override&&!p.rules.some(prior=>prior.id===r.override.priorRuleId))invalid("An override must name an existing inherited rule");if(r.reference&&r.family==="VOICE_IDENTITY"!==(r.reference.contentType==="audio/wav"))invalid("Visual obligations cannot use audio and Voice obligations cannot use images")}});var ConsistencyProfileScopeSchema=z49.strictObject({tenantId:TenantIdSchema,productionId:ProductionIdSchema});var ConsistencyProfileVersionQuerySchema=ConsistencyProfileScopeSchema.extend({profileId:z49.uuid()});var ConfigureConsistencyProfileSchema=ConsistencyProfileScopeSchema.extend({expectedProductionRevision:z49.int().positive(),expectedProfileVersion:z49.int().nonnegative(),content:ConsistencyProfileContentSchema,reason:z49.string().trim().min(1).max(2e3),idempotencyKey:z49.string().trim().min(1).max(200)});var ConsistencyProfileVersionSchema=ConsistencyProfileScopeSchema.extend({id:z49.uuid(),projectId:ProjectIdSchema,version:z49.int().positive(),previousVersionId:z49.uuid().nullable(),content:ConsistencyProfileContentSchema,fingerprint:z49.string().regex(/^[0-9a-f]{64}$/),reason:z49.string().trim().min(1).max(2e3),createdByPrincipalId:PrincipalIdSchema,createdAt:z49.iso.datetime({offset:true})});var ConsistencyProfileViewSchema=ConsistencyProfileScopeSchema.extend({productionRevision:z49.int().positive(),current:ConsistencyProfileVersionSchema.nullable()});var ConsistencyProfileReceiptSchema=z49.strictObject({semanticStatus:z49.literal("SUCCESS"),profile:ConsistencyProfileVersionSchema,productionRevision:z49.int().positive()});import{z as z50}from"zod";var sha7=z50.string().regex(/^[0-9a-f]{64}$/);var RoughCutReviewScopeSchema=TimelineScopeSchema.extend({renderId:z50.uuid()});var ReviewIntervalSchema=z50.strictObject({startMs:z50.int().nonnegative().max(6e4),endMs:z50.int().positive().max(6e4)}).refine(v=>v.endMs>v.startMs,"Review interval must advance");var RoughCutRequirementSchema=z50.strictObject({continuity:ContinuityExpectationSchema.optional(),consistencyScale:ConsistencyReviewScaleSchema.optional(),consistencyFamily:z50.enum(["PRODUCT_IDENTITY","CHARACTER_IDENTITY","WARDROBE","LOCATION","STYLE","BOUNDARY_CONTINUITY"]).optional(),consistencySubject:ConsistencySubjectSchema.optional(),consistencyReference:ConsistencyMasterReferenceSchema.optional(),key:z50.string().min(1).max(220),dimension:z50.enum(["PRODUCT_PRESENTATION","CANONICAL_FACT","NARRATIVE","PACING","REPETITION","STYLE","TECHNICAL","TRANSITION"]),expected:z50.string().min(1).max(4e3),enforcement:z50.enum(["LOCKED","REQUIRED","PREFERRED"]),scope:z50.enum(["PRODUCTION","TRANSITION"]),interval:ReviewIntervalSchema,shotIds:z50.array(z50.uuid()).min(1).max(200)});var RoughCutObservationSchema=z50.strictObject({listeningEvidenceIds:ListeningEvidenceIdsSchema.optional(),continuitySamples:ContinuitySamplesSchema.optional(),temporalEvidenceIds:TemporalEvidenceIdsSchema.optional(),key:z50.string().min(1).max(220),status:z50.enum(["SATISFIED","VIOLATED","NOT_OBSERVABLE","NOT_APPLICABLE"]),confidence:z50.enum(["CLEAR","UNCERTAIN"]),observed:z50.string().trim().min(1).max(1800),interval:ReviewIntervalSchema,location:z50.strictObject({interval:ReviewIntervalSchema,shotIds:z50.array(z50.uuid()).min(1).max(200)}).optional()});var RoughCutInspectionSchema=z50.strictObject({actor:z50.enum(["HUMAN","EXTERNAL_AGENT"]),method:z50.literal("FULL_TEMPORAL_INSPECTION"),coverage:z50.array(ReviewIntervalSchema).min(1).max(200)});var RoughCutReviewBasisSchema=z50.strictObject({consistencyRequirements:z50.array(RoughCutRequirementSchema).max(256).optional(),artifactId:z50.uuid(),representationId:z50.uuid(),checksumSha256:sha7,manifestFingerprint:sha7,manifest:RoughCutManifestReaderSchema,brief:BriefVersionSchema,story:StoryVersionSchema});var RecordRoughCutReviewSchema=RoughCutReviewScopeSchema.extend({listeningEvidence:ListeningEvidenceSetSchema.optional(),artifactId:z50.uuid(),representationId:z50.uuid(),checksumSha256:sha7,basisFingerprint:sha7,expectedProductionRevision:z50.int().positive(),expectedReviewVersion:z50.int().nonnegative(),idempotencyKey:z50.string().trim().min(1).max(200),inspection:RoughCutInspectionSchema,observations:z50.array(RoughCutObservationSchema).min(1).max(300),summary:z50.string().trim().min(1).max(2500)});var RoughCutReviewRecordSchema=RoughCutReviewScopeSchema.extend({listeningEvidence:ListeningEvidenceSetSchema.optional(),id:z50.uuid(),projectId:ProjectIdSchema,version:z50.int().positive(),kind:z50.literal("PRODUCTION_REVIEW_2"),lifecycle:z50.literal("COMPLETED"),evaluatorVersion:z50.literal("production-review-v1"),basis:RoughCutReviewBasisSchema,basisFingerprint:sha7,executionClass:z50.enum(["LIVE","TEST_ONLY"]),technical:RoughCutTechnicalSchema,durationMs:z50.int().min(3e4).max(6e4),requirements:z50.array(RoughCutRequirementSchema).min(1).max(300),inspection:RoughCutInspectionSchema,observations:z50.array(RoughCutObservationSchema).min(1).max(300),result:z50.enum(["PASS","WARNING","FAIL"]),blockingKeys:z50.array(z50.string()).max(300),warningKeys:z50.array(z50.string()).max(300),summary:z50.string().min(1).max(2500),createdByPrincipalId:PrincipalIdSchema,createdAt:z50.iso.datetime({offset:true})});var RoughCutReviewTargetSchema=RoughCutReviewScopeSchema.extend({temporalEvidence:z50.array(TemporalEvidenceReferenceSchema).max(8).optional(),projectId:ProjectIdSchema,productionRevision:z50.int().positive(),productionRunnable:z50.boolean(),executionClass:z50.enum(["LIVE","TEST_ONLY"]),freshness:z50.enum(["CURRENT_BASIS","STALE_BASIS"]),staleReasons:z50.array(z50.string()).max(18),inspectable:z50.boolean(),durationMs:z50.int().min(3e4).max(6e4),basis:RoughCutReviewBasisSchema,basisFingerprint:sha7,technical:RoughCutTechnicalSchema,requirements:z50.array(RoughCutRequirementSchema).min(1).max(300),latestReview:RoughCutReviewRecordSchema.nullable(),reviewVersion:z50.int().nonnegative(),finalReadyVersion:z50.int().nonnegative()});var RoughCutFindingSchema=RoughCutReviewScopeSchema.extend({compositionLocality:z50.array(CompositionFindingLocalitySchema).min(1).max(208).optional(),id:z50.uuid(),projectId:ProjectIdSchema,reviewId:z50.uuid(),reviewVersion:z50.int().positive(),basisFingerprint:sha7,artifactId:z50.uuid(),timelineVersionId:z50.uuid(),requirement:RoughCutRequirementSchema,observation:RoughCutObservationSchema,blocking:z50.boolean(),severity:z50.enum(["BLOCKING","WARNING"]),remediation:z50.enum(["REVISE_PRODUCTION","REVISE_TRANSITION","CORRECT_CANONICAL_CONTRADICTION"]),affectedScope:z50.strictObject({kind:z50.enum(["PRODUCTION","SHOT","TRANSITION","TIMELINE_REGION"]),interval:ReviewIntervalSchema,shotIds:z50.array(z50.uuid()).min(1).max(200)}),initialLifecycle:z50.literal("OPEN"),createdAt:z50.iso.datetime({offset:true})});var RoughCutFindingViewSchema=RoughCutFindingSchema.extend({lifecycle:z50.enum(["OPEN","REMEDIATION_PLANNED","RESOLVED","WAIVED","SUPERSEDED"]),proofReviewId:z50.uuid().nullable(),proofDecisionId:z50.uuid().nullable()});var RoughCutReviewQuerySchema=RoughCutReviewScopeSchema.extend({limit:QueryLimitSchema,next:ContinuationSchema.optional()});var RoughCutReviewPageSchema=z50.strictObject({items:z50.array(RoughCutReviewRecordSchema),page:QueryPageInfoSchema});var RoughCutFindingQuerySchema=TimelineScopeSchema.extend({renderId:z50.uuid().optional(),limit:QueryLimitSchema,next:ContinuationSchema.optional()});var RoughCutFindingGetSchema=TimelineScopeSchema.extend({findingId:z50.uuid()});var RoughCutFindingPageSchema=z50.strictObject({items:z50.array(RoughCutFindingViewSchema),page:QueryPageInfoSchema});var RoughCutReviewReceiptSchema=z50.strictObject({semanticStatus:z50.literal("SUCCESS"),review:RoughCutReviewRecordSchema,findingIds:z50.array(z50.uuid()).max(300),productionRevision:z50.int().positive()});var MAX_SHOT_REVIEW_REQUIREMENTS=2200;import{z as z51}from"zod";var Fingerprint3=z51.string().regex(/^[0-9a-f]{64}$/);var KeyframeReviewScopeSchema=z51.strictObject({tenantId:TenantIdSchema,productionId:ProductionIdSchema,generationId:z51.uuid()});var VisualRequirementSchema=z51.strictObject({intentPath:z51.string().min(1).max(220).optional(),key:z51.string().min(1).max(200),expected:z51.string().min(1).max(2500),enforcement:z51.enum(["LOCKED","REQUIRED","PREFERRED"])});var Region=z51.strictObject({x:z51.number().min(0).max(1),y:z51.number().min(0).max(1),width:z51.number().positive().max(1),height:z51.number().positive().max(1)}).refine(r=>r.x+r.width<=1&&r.y+r.height<=1,"Evidence region must fit within the image");var KeyframeObservationSchema=z51.strictObject({key:z51.string().min(1).max(200),status:z51.enum(["SATISFIED","VIOLATED","NOT_OBSERVABLE","NOT_APPLICABLE"]),confidence:z51.enum(["CLEAR","UNCERTAIN"]),observed:z51.string().trim().min(1).max(1500),region:Region.optional()});var RecordKeyframeReviewSchema=KeyframeReviewScopeSchema.extend({candidateId:z51.uuid(),representationId:z51.uuid(),checksumSha256:Fingerprint3,expectedReviewVersion:z51.int().nonnegative(),idempotencyKey:z51.string().trim().min(1).max(200),observations:z51.array(KeyframeObservationSchema).min(1).max(MAX_SHOT_REVIEW_REQUIREMENTS),summary:z51.string().trim().min(1).max(2e3)});var KeyframeReviewRecordSchema=z51.strictObject({id:z51.uuid(),tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,generationId:z51.uuid(),candidateId:z51.uuid(),artifactId:z51.uuid(),representationId:z51.uuid(),checksumSha256:Fingerprint3,shotId:ShotIdSchema,framePurpose:KeyframePurposeSchema,version:z51.int().positive(),preparationId:z51.uuid(),contractId:z51.uuid(),contractFingerprint:Fingerprint3,executionClass:z51.enum(["LIVE","TEST_ONLY"]),kind:z51.literal("KEYFRAME_REFERENCE"),lifecycle:z51.literal("COMPLETED"),evaluatorVersion:z51.literal("keyframe-reference-v1"),source:z51.literal("EXPLICIT_VISUAL_INSPECTION"),requirements:z51.array(VisualRequirementSchema).min(1).max(MAX_SHOT_REVIEW_REQUIREMENTS),observations:z51.array(KeyframeObservationSchema).min(1).max(MAX_SHOT_REVIEW_REQUIREMENTS),result:z51.enum(["PASS","WARNING","FAIL"]),blockingKeys:z51.array(z51.string()).max(MAX_SHOT_REVIEW_REQUIREMENTS),warningKeys:z51.array(z51.string()).max(MAX_SHOT_REVIEW_REQUIREMENTS),summary:z51.string().min(1).max(2e3),createdByPrincipalId:PrincipalIdSchema,createdAt:z51.iso.datetime({offset:true})});var DecideKeyframeSchema=KeyframeReviewScopeSchema.extend({candidateId:z51.uuid(),reviewId:z51.uuid(),expectedSelectionVersion:z51.int().nonnegative(),action:z51.enum(["ACCEPT","REJECT"]),acknowledgeWarnings:z51.boolean().default(false),reason:z51.string().trim().min(1).max(2e3),idempotencyKey:z51.string().trim().min(1).max(200)});var KeyframeReferenceScopeSchema=z51.strictObject({tenantId:TenantIdSchema,productionId:ProductionIdSchema,shotId:ShotIdSchema,framePurpose:KeyframePurposeSchema});var RevokeKeyframeSchema=KeyframeReferenceScopeSchema.extend({acceptanceId:z51.uuid(),expectedSelectionVersion:z51.int().positive(),reason:z51.string().trim().min(1).max(2e3),idempotencyKey:z51.string().trim().min(1).max(200)});var KeyframeDecisionRecordSchema=z51.strictObject({id:z51.uuid(),tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,shotId:ShotIdSchema,framePurpose:KeyframePurposeSchema,selectionVersion:z51.int().positive(),generationId:z51.uuid(),candidateId:z51.uuid(),reviewId:z51.uuid(),action:z51.enum(["ACCEPT","REJECT","REVOKE"]),reference:AcceptedKeyframeReferenceSchema.nullable(),previousAcceptanceId:z51.uuid().nullable(),warningKeys:z51.array(z51.string()).max(MAX_SHOT_REVIEW_REQUIREMENTS),acknowledgeWarnings:z51.boolean(),reason:z51.string().min(1).max(2e3),createdByPrincipalId:PrincipalIdSchema,createdAt:z51.iso.datetime({offset:true})});var KeyframeReviewTargetSchema=KeyframeReviewScopeSchema.extend({projectId:ProjectIdSchema,shotId:ShotIdSchema,framePurpose:KeyframePurposeSchema,preparationId:z51.uuid(),contractId:z51.uuid(),contractFingerprint:Fingerprint3,executionClass:z51.enum(["LIVE","TEST_ONLY"]),freshness:z51.enum(["CURRENT_BASIS","STALE_BASIS"]),runtimeSucceeded:z51.boolean(),productionRunnable:z51.boolean(),candidate:KeyframeCandidateSchema,requirements:z51.array(VisualRequirementSchema).min(1).max(MAX_SHOT_REVIEW_REQUIREMENTS),latestReview:KeyframeReviewRecordSchema.nullable(),reviewVersion:z51.int().nonnegative(),selectionVersion:z51.int().nonnegative(),activeAcceptanceId:z51.uuid().nullable()});var KeyframeReferenceViewSchema=KeyframeReferenceScopeSchema.extend({selectionVersion:z51.int().nonnegative(),status:z51.enum(["NONE","CURRENT","STALE"]),acceptance:KeyframeDecisionRecordSchema.nullable(),reference:AcceptedKeyframeReferenceSchema.nullable()});var KeyframeReviewQuerySchema=KeyframeReviewScopeSchema.extend({limit:QueryLimitSchema,next:ContinuationSchema.optional()});var KeyframeReviewPageSchema=z51.strictObject({items:z51.array(KeyframeReviewRecordSchema),page:QueryPageInfoSchema});var KeyframeReviewReceiptSchema=z51.strictObject({semanticStatus:z51.literal("SUCCESS"),review:KeyframeReviewRecordSchema,productionRevision:z51.int().positive()});var KeyframeDecisionReceiptSchema=z51.strictObject({semanticStatus:z51.literal("SUCCESS"),decision:KeyframeDecisionRecordSchema,productionRevision:z51.int().positive()});var KeyframeDecisionQuerySchema=KeyframeReferenceScopeSchema.extend({limit:QueryLimitSchema,next:ContinuationSchema.optional()});var KeyframeDecisionPageSchema=z51.strictObject({items:z51.array(KeyframeDecisionRecordSchema),page:QueryPageInfoSchema});var KeyframeReviewSummarySchema=z51.strictObject({reviewedCandidates:z51.int().nonnegative(),unreviewedCandidates:z51.int().nonnegative(),decisionCount:z51.int().nonnegative()});import{z as z52}from"zod";var Intent=z52.string().trim().min(1).max(300);var CameraIntentSchema=z52.strictObject({scale:z52.enum(["EXTREME_CLOSE_UP","CLOSE_UP","MEDIUM","WIDE","EXTREME_WIDE"]),framing:z52.enum(["CENTERED","OFF_CENTER","SYMMETRICAL","OVER_SHOULDER"]),angle:z52.enum(["EYE_LEVEL","HIGH","LOW","TOP_DOWN"]),movement:z52.enum(["STATIC","PAN","TILT","DOLLY","TRACK","ORBIT","CRANE","ZOOM"]),stability:z52.enum(["LOCKED","STABILIZED","HANDHELD"]),direction:z52.enum(["LEFT","RIGHT","UP","DOWN","FORWARD","BACKWARD","CLOCKWISE","COUNTERCLOCKWISE"]).optional(),lensIntent:z52.string().trim().min(1).max(120).optional()});var ShotTemporalBeatSchema=z52.strictObject({startSeconds:z52.number().min(0).max(30),endSeconds:z52.number().positive().max(30),action:Intent});var ShotDirectionSchema=z52.strictObject({camera:CameraIntentSchema,temporalBeats:z52.array(ShotTemporalBeatSchema).min(1).max(8),environmentIntent:Intent.optional(),lightingIntent:Intent.optional(),styleIntent:Intent.optional(),audioIntent:Intent.optional()});function checkShotDirectionTiming(direction,duration){let cursor=0;for(const beat of direction.temporalBeats){if(Math.abs(beat.startSeconds-cursor)>1e-6||beat.endSeconds<=beat.startSeconds)return false;cursor=beat.endSeconds}return Math.abs(cursor-duration)<=1e-6}import{z as z53}from"zod";var PlanningClientKeySchema=z53.string().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/);var BoundaryRequirementSchema=z53.strictObject({attribute:z53.string().regex(/^[A-Za-z][A-Za-z0-9_.-]{0,59}$/),value:z53.string().trim().min(1).max(300)});var ShotIntentSchema=z53.strictObject({narrativePurpose:z53.string().trim().min(1).max(600),subjectAction:z53.string().trim().min(1).max(600),targetDurationSeconds:z53.number().min(.5).max(30),subjectRequirements:z53.array(z53.string().trim().min(1).max(300)).max(16).default([]),cameraComposition:z53.string().trim().min(1).max(500).optional(),factualClaims:z53.array(StoryFactClaimSchema).max(16).default([]),requiresGeneratedKeyframe:z53.boolean().default(false),sourceMediaAllowed:z53.boolean().default(false),direction:ShotDirectionSchema.optional()}).superRefine((value2,context)=>{if(value2.direction&&!checkShotDirectionTiming(value2.direction,value2.targetDurationSeconds))context.addIssue({code:"custom",path:["direction","temporalBeats"],message:"Temporal beats must be contiguous from zero and cover exactly the Shot duration"})});var ShotPlanInputSchema=z53.strictObject({clientKey:PlanningClientKeySchema,shotId:ShotIdSchema.optional(),intent:ShotIntentSchema,entryBoundary:z53.array(BoundaryRequirementSchema).max(24).default([]),exitBoundary:z53.array(BoundaryRequirementSchema).max(24).default([])});var ScenePlanInputSchema=z53.strictObject({clientKey:PlanningClientKeySchema,sceneId:SceneIdSchema.optional(),purpose:z53.string().trim().min(1).max(800),locationContext:z53.string().trim().min(1).max(300).optional(),timeContext:z53.string().trim().min(1).max(300).optional(),entryBoundary:z53.array(BoundaryRequirementSchema).max(24).default([]),exitBoundary:z53.array(BoundaryRequirementSchema).max(24).default([]),shots:z53.array(ShotPlanInputSchema).min(1).max(24)});var ContinuityRequirementSchema=z53.strictObject({mode:z53.enum(["PERSIST","TRANSITION","REESTABLISH","REVIEW"]),attribute:z53.string().regex(/^[A-Za-z][A-Za-z0-9_.-]{0,59}$/),description:z53.string().trim().min(1).max(500)});var ContinuityEdgeInputSchema=z53.strictObject({fromShotKey:PlanningClientKeySchema,toShotKey:PlanningClientKeySchema,requirements:z53.array(ContinuityRequirementSchema).min(1).max(24)});var AcceptSceneShotPlanRequestSchema=z53.strictObject({tenantId:TenantIdSchema,expectedProductionRevision:z53.int().positive(),expectedStoryVersion:z53.int().positive(),revisionReason:z53.string().trim().min(1).max(1e3).optional(),idempotencyKey:z53.string().trim().min(1).max(200),scenes:z53.array(ScenePlanInputSchema).min(1).max(12),continuityEdges:z53.array(ContinuityEdgeInputSchema).max(64).default([])});var ShotPlanEntrySchema=z53.strictObject({shotId:ShotIdSchema,clientKey:PlanningClientKeySchema,ordinal:z53.int().positive(),planningRevision:z53.int().positive(),intent:ShotIntentSchema,entryBoundary:z53.array(BoundaryRequirementSchema).max(24),exitBoundary:z53.array(BoundaryRequirementSchema).max(24)});var ScenePlanEntrySchema=z53.strictObject({sceneId:SceneIdSchema,clientKey:PlanningClientKeySchema,ordinal:z53.int().positive(),purpose:z53.string().trim().min(1).max(800),locationContext:z53.string().trim().min(1).max(300).optional(),timeContext:z53.string().trim().min(1).max(300).optional(),entryBoundary:z53.array(BoundaryRequirementSchema).max(24),exitBoundary:z53.array(BoundaryRequirementSchema).max(24),shots:z53.array(ShotPlanEntrySchema).min(1).max(24)});var ContinuityEdgeSchema=z53.strictObject({id:ContinuityEdgeIdSchema,fromShotId:ShotIdSchema,toShotId:ShotIdSchema,requirements:z53.array(ContinuityRequirementSchema).min(1).max(24)});var SceneShotPlanVersionSchema=z53.strictObject({id:SceneShotPlanVersionIdSchema,planId:SceneShotPlanIdSchema,tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,version:z53.int().positive(),storyVersionId:StoryVersionIdSchema,storyVersion:z53.int().positive(),briefVersionId:BriefVersionIdSchema,briefVersion:z53.int().positive(),scenes:z53.array(ScenePlanEntrySchema).min(1).max(12),continuityEdges:z53.array(ContinuityEdgeSchema).max(64),createdByPrincipalId:PrincipalIdSchema,createdAt:z53.iso.datetime({offset:true})});var AcceptSceneShotPlanResultSchema=z53.discriminatedUnion("semanticStatus",[z53.strictObject({semanticStatus:z53.literal("SUCCESS"),planVersion:SceneShotPlanVersionSchema,productionRevision:z53.int().positive(),activeSceneShotPlanVersion:z53.int().positive()}),z53.strictObject({semanticStatus:z53.literal("NEEDS_INPUT"),missingPrerequisites:z53.array(z53.literal("ACTIVE_STORY")).min(1)})]);import{z as z54}from"zod";var Fingerprint4=z54.string().regex(/^[0-9a-f]{64}$/);var VideoReviewScopeSchema=z54.strictObject({tenantId:TenantIdSchema,productionId:ProductionIdSchema,generationId:z54.uuid()});var VideoReviewRequirementSchema=z54.strictObject({intentPath:z54.string().min(1).max(220).optional(),continuity:ContinuityExpectationSchema.optional(),interval:z54.strictObject({startMs:z54.int().nonnegative().max(6e4),endMs:z54.int().positive().max(6e4)}).refine(v=>v.endMs>v.startMs,"Requirement interval must advance").optional(),key:z54.string().min(1).max(220),family:z54.enum(["PRODUCT_IDENTITY","CHARACTER_IDENTITY","WARDROBE","LOCATION","STYLE","SHOT_INTENT","BOUNDARY_CONTINUITY","SOUND"]),expected:z54.string().min(1).max(2500),enforcement:z54.enum(["LOCKED","REQUIRED","PREFERRED"]),evidenceWindow:z54.enum(["WHOLE_VIDEO","START","END","TEMPORAL"])});var VideoObservationSchema=z54.strictObject({listeningEvidenceIds:ListeningEvidenceIdsSchema.optional(),continuitySamples:ContinuitySamplesSchema.optional(),temporalEvidenceIds:TemporalEvidenceIdsSchema.optional(),key:z54.string().min(1).max(220),status:z54.enum(["SATISFIED","VIOLATED","NOT_OBSERVABLE","NOT_APPLICABLE"]),confidence:z54.enum(["CLEAR","UNCERTAIN"]),observed:z54.string().trim().min(1).max(1800),interval:z54.strictObject({startMs:z54.int().nonnegative(),endMs:z54.int().positive()}).refine(v=>v.endMs>v.startMs,"Observation interval must advance").optional()});var RecordVideoReviewSchema=VideoReviewScopeSchema.extend({listeningEvidence:ListeningEvidenceSetSchema.optional(),candidateId:z54.uuid(),representationId:ArtifactRepresentationIdSchema,checksumSha256:Fingerprint4,expectedReviewVersion:z54.int().nonnegative(),idempotencyKey:z54.string().trim().min(1).max(200),observations:z54.array(VideoObservationSchema).min(1).max(MAX_SHOT_REVIEW_REQUIREMENTS),summary:z54.string().trim().min(1).max(2500)});var VideoReviewRecordSchema=z54.strictObject({listeningEvidence:ListeningEvidenceSetSchema.optional(),id:z54.uuid(),tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,generationId:z54.uuid(),candidateId:z54.uuid(),artifactId:ArtifactIdSchema,representationId:ArtifactRepresentationIdSchema,checksumSha256:Fingerprint4,shotId:ShotIdSchema,version:z54.int().positive(),preparationId:z54.uuid(),contractId:z54.uuid(),contractFingerprint:Fingerprint4,executionClass:z54.enum(["LIVE","TEST_ONLY"]),kind:z54.literal("SHOT_REVIEW_1"),lifecycle:z54.literal("COMPLETED"),evaluatorVersion:z54.literal("shot-review-v1"),source:z54.literal("EXPLICIT_MEDIA_INSPECTION"),technical:VideoTechnicalMetadataSchema,requirements:z54.array(VideoReviewRequirementSchema).min(1).max(MAX_SHOT_REVIEW_REQUIREMENTS),observations:z54.array(VideoObservationSchema).min(1).max(MAX_SHOT_REVIEW_REQUIREMENTS),result:z54.enum(["PASS","WARNING","FAIL"]),blockingKeys:z54.array(z54.string()).max(MAX_SHOT_REVIEW_REQUIREMENTS),warningKeys:z54.array(z54.string()).max(MAX_SHOT_REVIEW_REQUIREMENTS),summary:z54.string().min(1).max(2500),createdByPrincipalId:PrincipalIdSchema,createdAt:z54.iso.datetime({offset:true})});var DecideVideoShotSchema=VideoReviewScopeSchema.extend({candidateId:z54.uuid(),reviewId:z54.uuid(),expectedAcceptanceVersion:z54.int().nonnegative(),action:z54.enum(["ACCEPT","REJECT"]),acknowledgeWarnings:z54.boolean().default(false),reason:z54.string().trim().min(1).max(2500),idempotencyKey:z54.string().trim().min(1).max(200)});var ShotAcceptanceScopeSchema=z54.strictObject({tenantId:TenantIdSchema,productionId:ProductionIdSchema,shotId:ShotIdSchema});var RevokeShotAcceptanceSchema=ShotAcceptanceScopeSchema.extend({acceptanceId:z54.uuid(),expectedAcceptanceVersion:z54.int().positive(),reason:z54.string().trim().min(1).max(2500),idempotencyKey:z54.string().trim().min(1).max(200)});var GeneratedShotAcceptanceDecisionSchema=z54.strictObject({id:z54.uuid(),tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,shotId:ShotIdSchema,acceptanceVersion:z54.int().positive(),generationId:z54.uuid(),candidateId:z54.uuid(),artifactId:ArtifactIdSchema,representationId:ArtifactRepresentationIdSchema,reviewId:z54.uuid(),action:z54.enum(["ACCEPT","REJECT","REVOKE"]),reference:AcceptedShotReferenceSchema.nullable(),previousAcceptanceId:z54.uuid().nullable(),warningKeys:z54.array(z54.string()).max(MAX_SHOT_REVIEW_REQUIREMENTS),acknowledgeWarnings:z54.boolean(),reason:z54.string().min(1).max(2500),createdByPrincipalId:PrincipalIdSchema,createdAt:z54.iso.datetime({offset:true})});var ProgrammaticShotAcceptanceDecisionSchema=z54.strictObject({sourceKind:z54.literal("PROGRAMMATIC"),id:z54.uuid(),tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,shotId:ShotIdSchema,acceptanceVersion:z54.int().positive(),renderId:z54.uuid(),compositionId:z54.uuid(),compositionVersionId:z54.uuid(),artifactId:ArtifactIdSchema,representationId:ArtifactRepresentationIdSchema,reviewId:z54.uuid(),action:z54.enum(["ACCEPT","REJECT","REVOKE"]),reference:ProgrammaticAcceptedVisualSourceReferenceSchema.nullable(),previousAcceptanceId:z54.uuid().nullable(),warningKeys:z54.array(z54.string()).max(MAX_SHOT_REVIEW_REQUIREMENTS),acknowledgeWarnings:z54.boolean(),reason:z54.string().min(1).max(2500),createdByPrincipalId:PrincipalIdSchema,createdAt:z54.iso.datetime({offset:true})});var ShotAcceptanceDecisionSchema=z54.union([GeneratedShotAcceptanceDecisionSchema,ProgrammaticShotAcceptanceDecisionSchema,z54.strictObject({sourceKind:z54.literal("IMPORTED"),id:z54.uuid(),tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,shotId:ShotIdSchema,acceptanceVersion:z54.int().positive(),normalizationId:z54.uuid(),sourceId:z54.uuid(),sourceVersionId:z54.uuid(),artifactId:ArtifactIdSchema,representationId:ArtifactRepresentationIdSchema,reviewId:z54.uuid(),action:z54.enum(["ACCEPT","REJECT","REVOKE"]),reference:ImportedAcceptedVisualSourceReferenceSchema.nullable(),previousAcceptanceId:z54.uuid().nullable(),warningKeys:z54.array(z54.string()).max(MAX_SHOT_REVIEW_REQUIREMENTS),acknowledgeWarnings:z54.boolean(),reason:z54.string().min(1).max(2500),createdByPrincipalId:PrincipalIdSchema,createdAt:z54.iso.datetime({offset:true})})]);var VideoReviewTargetSchema=VideoReviewScopeSchema.extend({temporalEvidence:z54.array(TemporalEvidenceReferenceSchema).max(8).optional(),projectId:ProjectIdSchema,shotId:ShotIdSchema,preparationId:z54.uuid(),contractId:z54.uuid(),contractFingerprint:Fingerprint4,executionClass:z54.enum(["LIVE","TEST_ONLY"]),freshness:z54.enum(["CURRENT_BASIS","STALE_BASIS"]),runtimeSucceeded:z54.boolean(),productionRunnable:z54.boolean(),candidate:VideoCandidateSchema,requirements:z54.array(VideoReviewRequirementSchema).min(1).max(MAX_SHOT_REVIEW_REQUIREMENTS),latestReview:VideoReviewRecordSchema.nullable(),reviewVersion:z54.int().nonnegative(),acceptanceVersion:z54.int().nonnegative(),activeAcceptanceId:z54.uuid().nullable()});var ShotAcceptanceViewSchema=ShotAcceptanceScopeSchema.extend({acceptanceVersion:z54.int().nonnegative(),status:z54.enum(["NONE","CURRENT","STALE"]),acceptance:ShotAcceptanceDecisionSchema.nullable(),reference:AcceptedVisualSourceReferenceSchema.nullable()});var VideoReviewQuerySchema=VideoReviewScopeSchema.extend({limit:QueryLimitSchema,next:ContinuationSchema.optional()});var VideoReviewPageSchema=z54.strictObject({items:z54.array(VideoReviewRecordSchema),page:QueryPageInfoSchema});var ShotDecisionQuerySchema=ShotAcceptanceScopeSchema.extend({limit:QueryLimitSchema,next:ContinuationSchema.optional()});var ShotDecisionPageSchema=z54.strictObject({items:z54.array(ShotAcceptanceDecisionSchema),page:QueryPageInfoSchema});var VideoReviewReceiptSchema=z54.strictObject({semanticStatus:z54.literal("SUCCESS"),review:VideoReviewRecordSchema,productionRevision:z54.int().positive()});var ShotDecisionReceiptSchema=z54.strictObject({semanticStatus:z54.literal("SUCCESS"),decision:ShotAcceptanceDecisionSchema,productionRevision:z54.int().positive()});import{z as z55}from"zod";var Fingerprint5=z55.string().regex(/^[0-9a-f]{64}$/);var ProgrammaticVideoReviewScopeSchema=z55.strictObject({tenantId:TenantIdSchema,productionId:ProductionIdSchema,renderId:z55.uuid()});var ProgrammaticReviewMediaSchema=VideoTechnicalMetadataSchema.extend({artifactId:ArtifactIdSchema,representationId:ArtifactRepresentationIdSchema,availability:z55.enum(["AVAILABLE","INVALID"])});var ProgrammaticVideoReviewRecordSchema=z55.strictObject({sourceKind:z55.literal("PROGRAMMATIC"),id:z55.uuid(),tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,shotId:ShotIdSchema,renderId:z55.uuid(),compositionId:z55.uuid(),compositionVersionId:z55.uuid(),compositionVersion:z55.int().positive(),compositionFingerprint:Fingerprint5,renderManifestFingerprint:Fingerprint5,artifactId:ArtifactIdSchema,representationId:ArtifactRepresentationIdSchema,checksumSha256:Fingerprint5,version:z55.int().positive(),planVersionId:z55.uuid(),planVersion:z55.int().positive(),shotPlanningRevision:z55.int().positive(),executionClass:z55.enum(["LIVE","TEST_ONLY"]),kind:z55.literal("SHOT_REVIEW_1"),lifecycle:z55.literal("COMPLETED"),evaluatorVersion:z55.literal("shot-review-v1"),source:z55.literal("EXPLICIT_MEDIA_INSPECTION"),technical:VideoTechnicalMetadataSchema,requirements:z55.array(VideoReviewRequirementSchema).min(1).max(MAX_SHOT_REVIEW_REQUIREMENTS),observations:z55.array(VideoObservationSchema).min(1).max(MAX_SHOT_REVIEW_REQUIREMENTS),result:z55.enum(["PASS","WARNING","FAIL"]),blockingKeys:z55.array(z55.string()).max(MAX_SHOT_REVIEW_REQUIREMENTS),warningKeys:z55.array(z55.string()).max(MAX_SHOT_REVIEW_REQUIREMENTS),summary:z55.string().min(1).max(2500),createdByPrincipalId:PrincipalIdSchema,createdAt:z55.iso.datetime({offset:true})});var ProgrammaticVideoReviewTargetSchema=ProgrammaticVideoReviewScopeSchema.extend({sourceKind:z55.literal("PROGRAMMATIC"),temporalEvidence:z55.array(TemporalEvidenceReferenceSchema).max(8).optional(),projectId:ProjectIdSchema,shotId:ShotIdSchema,compositionId:z55.uuid(),compositionVersionId:z55.uuid(),compositionVersion:z55.int().positive(),compositionFingerprint:Fingerprint5,renderManifestFingerprint:Fingerprint5,executionClass:z55.enum(["LIVE","TEST_ONLY"]),freshness:z55.enum(["CURRENT_BASIS","STALE_BASIS"]),runtimeSucceeded:z55.boolean(),productionRunnable:z55.boolean(),media:ProgrammaticReviewMediaSchema,requirements:z55.array(VideoReviewRequirementSchema).min(1).max(MAX_SHOT_REVIEW_REQUIREMENTS),latestReview:ProgrammaticVideoReviewRecordSchema.nullable(),reviewVersion:z55.int().nonnegative(),acceptanceVersion:z55.int().nonnegative(),activeAcceptanceId:z55.uuid().nullable()});var RecordProgrammaticVideoReviewSchema=ProgrammaticVideoReviewScopeSchema.extend({representationId:ArtifactRepresentationIdSchema,checksumSha256:Fingerprint5,expectedReviewVersion:z55.int().nonnegative(),idempotencyKey:z55.string().trim().min(1).max(200),observations:z55.array(VideoObservationSchema).min(1).max(MAX_SHOT_REVIEW_REQUIREMENTS),summary:z55.string().trim().min(1).max(2500)});var DecideProgrammaticShotSchema=ProgrammaticVideoReviewScopeSchema.extend({reviewId:z55.uuid(),expectedAcceptanceVersion:z55.int().nonnegative(),action:z55.enum(["ACCEPT","REJECT"]),acknowledgeWarnings:z55.boolean().default(false),reason:z55.string().trim().min(1).max(2500),idempotencyKey:z55.string().trim().min(1).max(200)});var ProgrammaticVideoReviewQuerySchema=ProgrammaticVideoReviewScopeSchema.extend({limit:QueryLimitSchema,next:ContinuationSchema.optional()});var ProgrammaticVideoReviewPageSchema=z55.strictObject({items:z55.array(ProgrammaticVideoReviewRecordSchema),page:QueryPageInfoSchema});var ProgrammaticVideoReviewReceiptSchema=z55.strictObject({semanticStatus:z55.literal("SUCCESS"),review:ProgrammaticVideoReviewRecordSchema,productionRevision:z55.int().positive()});import{z as z56}from"zod";var WriterScopeSchema=z56.strictObject({tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema});var WriterBasisSchema=WriterScopeSchema.extend({productionRevision:z56.int().positive(),briefVersionId:BriefVersionIdSchema,briefVersion:z56.int().positive()});var IntentSchema=z56.string().trim().min(1).max(600);var WriterAlternativeSchema=z56.strictObject({alternativeId:z56.string().regex(/^[a-z][a-z0-9_-]{0,39}$/),title:z56.string().trim().min(1).max(120),story:StoryContentSchema,rationale:z56.strictObject({coreMessage:IntentSchema,hook:IntentSchema,audienceFit:IntentSchema,pacingIntent:IntentSchema,endingIntent:IntentSchema,tradeoffs:z56.array(IntentSchema).max(6)}),beatDurationsSeconds:z56.array(z56.int().positive().max(60)).min(1).max(24)});var WriterProposalSchema=z56.strictObject({origin:z56.strictObject({kind:z56.literal("EXTERNAL_AGENT_HOST"),label:z56.string().trim().min(1).max(100)}),unknowns:z56.array(z56.string().trim().min(1).max(300)).max(8),alternatives:z56.array(WriterAlternativeSchema).min(1).max(3)});var ValidateWriterProposalSchema=z56.strictObject({basis:WriterBasisSchema,revisionReason:AcceptStoryRequestSchema.shape.revisionReason,proposal:WriterProposalSchema});var MissingBriefSchema=z56.strictObject({semanticStatus:z56.literal("NEEDS_INPUT"),missingPrerequisites:z56.array(z56.literal("ACTIVE_BRIEF")).min(1).max(1)});var WriterBriefResultSchema=z56.discriminatedUnion("semanticStatus",[z56.strictObject({semanticStatus:z56.literal("SUCCESS"),basis:WriterBasisSchema,briefVersion:BriefVersionSchema}),MissingBriefSchema]);var WriterAcceptanceDraftSchema=z56.strictObject({alternativeId:WriterAlternativeSchema.shape.alternativeId,projectId:ProjectIdSchema,productionId:ProductionIdSchema,request:AcceptStoryRequestSchema.omit({idempotencyKey:true})});var WriterValidationResultSchema=z56.discriminatedUnion("semanticStatus",[z56.strictObject({semanticStatus:z56.literal("SUCCESS"),advisory:z56.literal(true),basis:WriterBasisSchema,proposal:WriterProposalSchema,acceptanceDrafts:z56.array(WriterAcceptanceDraftSchema).min(1).max(3),limitations:z56.array(z56.enum(["PROSE_IS_CREATIVE_INTENT_NOT_FACT_VERIFIED","PACING_IS_ADVISORY_NOT_TIMELINE_TRUTH","ACCEPTANCE_RECHECKS_CURRENT_BASIS"])).length(3)}),MissingBriefSchema]);import{z as z57}from"zod";var DirectorScopeSchema=WriterScopeSchema;var DirectorBasisSchema=WriterBasisSchema.extend({storyVersionId:StoryVersionIdSchema,storyVersion:z57.int().positive(),sceneShotPlanVersionId:SceneShotPlanVersionIdSchema.nullable(),sceneShotPlanVersion:z57.int().positive().nullable()}).refine(value2=>value2.sceneShotPlanVersionId===null===(value2.sceneShotPlanVersion===null),"Current plan ID and version must both be present or null");var Intent2=z57.string().trim().min(1).max(600);var Plan=AcceptSceneShotPlanRequestSchema.pick({scenes:true,continuityEdges:true});var DirectorAlternativeSchema=z57.strictObject({alternativeId:z57.string().regex(/^[a-z][a-z0-9_-]{0,39}$/),title:z57.string().trim().min(1).max(120),plan:Plan,rationale:z57.strictObject({storyInterpretation:Intent2,visualApproach:Intent2,pacingIntent:Intent2,tradeoffs:z57.array(Intent2).max(6)}),shotStoryBeats:z57.array(z57.strictObject({shotKey:PlanningClientKeySchema,beatOrdinals:z57.array(z57.int().positive().max(24)).min(1).max(4)})).min(1).max(48)}).refine(value2=>value2.plan.scenes.reduce((n,scene)=>n+scene.shots.length,0)<=48,"Director alternatives contain at most 48 Shots");var DirectorProposalSchema=z57.strictObject({origin:z57.strictObject({kind:z57.literal("EXTERNAL_AGENT_HOST"),label:z57.string().trim().min(1).max(100)}),unknowns:z57.array(z57.string().trim().min(1).max(300)).max(8),alternatives:z57.array(DirectorAlternativeSchema).min(1).max(3)});var ValidateDirectorProposalSchema=z57.strictObject({basis:DirectorBasisSchema,revisionReason:AcceptSceneShotPlanRequestSchema.shape.revisionReason,proposal:DirectorProposalSchema}).refine(value2=>new TextEncoder().encode(JSON.stringify(value2)).byteLength<=1024*1024,"Director validation input exceeds the 1 MiB JSON budget");var Missing=z57.strictObject({semanticStatus:z57.literal("NEEDS_INPUT"),missingPrerequisites:z57.array(z57.enum(["ACTIVE_BRIEF","ACTIVE_STORY"])).min(1).max(2)});var DirectorContextResultSchema=z57.discriminatedUnion("semanticStatus",[z57.strictObject({semanticStatus:z57.literal("SUCCESS"),basis:DirectorBasisSchema,briefVersion:BriefVersionSchema,storyVersion:StoryVersionSchema,sceneShotPlanVersion:SceneShotPlanVersionSchema.nullable(),stalePrerequisites:z57.array(z57.enum(["CURRENT_STORY","CURRENT_SCENE_SHOT_PLAN"])).min(1).max(2).optional()}),Missing]);var DirectorAcceptanceDraftSchema=z57.strictObject({alternativeId:DirectorAlternativeSchema.shape.alternativeId,projectId:DirectorScopeSchema.shape.projectId,productionId:DirectorScopeSchema.shape.productionId,request:AcceptSceneShotPlanRequestSchema.omit({idempotencyKey:true})});var DirectorValidationResultSchema=z57.discriminatedUnion("semanticStatus",[z57.strictObject({semanticStatus:z57.literal("SUCCESS"),advisory:z57.literal(true),basis:DirectorBasisSchema,proposal:DirectorProposalSchema,acceptanceDrafts:z57.array(DirectorAcceptanceDraftSchema).min(1).max(3),limitations:z57.array(z57.enum(["PROSE_IS_CREATIVE_INTENT_NOT_FACT_VERIFIED","DIRECTION_IS_INTENT_NOT_OBSERVED_MEDIA","ACCEPTANCE_RECHECKS_CURRENT_BASIS","PREPARATION_AND_GENERATION_REMAIN_SEPARATE"])).length(4)}),Missing]);import{z as z58}from"zod";var ReviewEvidenceKeySchema=z58.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);var ReviewEvidenceMediaSchema=z58.strictObject({artifactId:z58.uuid(),representationId:z58.uuid(),checksumSha256:z58.string().regex(/^[0-9a-f]{64}$/)});var common={id:ReviewEvidenceKeySchema,label:z58.string().trim().min(1).max(200),producer:z58.enum(["EXTERNAL_AGENT_HOST","HUMAN","VLM"]),media:ReviewEvidenceMediaSchema};var ReviewIntelligenceEvidenceSchema=z58.discriminatedUnion("kind",[z58.strictObject({...common,kind:z58.literal("METADATA")}),z58.strictObject({...common,kind:z58.literal("IMAGE_PIXELS")}),z58.strictObject({...common,kind:z58.literal("REGISTERED_TEMPORAL_FRAMES"),reference:TemporalEvidenceReferenceSchema}),z58.strictObject({...common,kind:z58.literal("VIDEO_PLAYBACK"),coverage:z58.array(ReviewIntervalSchema).min(1).max(200)}),z58.strictObject({...common,kind:z58.literal("AUDIO_LISTENING"),coverage:z58.array(ReviewIntervalSchema).min(1).max(200)}),z58.strictObject({...common,kind:z58.literal("VIDEO_WITH_AUDIO_PLAYBACK"),coverage:z58.array(ReviewIntervalSchema).min(1).max(200)}),z58.strictObject({...common,kind:z58.literal("VIDEO_FRAMES"),timestampsMs:z58.array(z58.number().nonnegative().max(6e4)).min(1).max(64)})]);import{z as z59}from"zod";var ObservationScopeSchema=z59.strictObject({tenantId:z59.uuid(),productionId:z59.uuid()});var ObservationSourceRequestSchema=z59.discriminatedUnion("kind",[z59.strictObject({kind:z59.literal("AUDIO"),media:ReviewEvidenceMediaSchema,versionId:z59.uuid(),purpose:z59.enum(["VOICEOVER","MUSIC"])}),z59.strictObject({kind:z59.literal("VIDEO"),media:ReviewEvidenceMediaSchema})]);var ObservationStartSchema=ObservationScopeSchema.extend({expectedProductionRevision:z59.int().positive(),idempotencyKey:z59.string().min(1).max(200),source:ObservationSourceRequestSchema,mode:ObservationModeSchema,selection:ProviderSelectionSchema,expectedModelProfileVersion:z59.int().positive(),parameters:ObservationParametersSchema.default({})}).refine(q=>q.mode==="TRANSCRIPTION"||q.mode==="AUDIO"===(q.source.kind==="AUDIO"),{message:"Observation input/mode mismatch"});var ObservationGetSchema=ObservationScopeSchema.extend({observationId:z59.uuid()});var ObservationBindingSchema=z59.strictObject({tenantId:z59.uuid(),connectionId:z59.uuid(),connectionVersion:z59.int().positive(),credentialRef:z59.string(),credentialVersion:z59.int().positive(),profile:ObservationProfileSchema,matrix:ModelCapabilityMatrixSchema.optional(),executionClass:z59.enum(["LIVE","TEST_ONLY"])}).refine(v=>!v.profile.modes.some(m=>m==="TRANSCRIPTION")||!!v.matrix,{message:"ASR requires its frozen capability matrix"});var ObservationSourceSchema=ReviewEvidenceMediaSchema.extend({tenantId:z59.uuid(),projectId:z59.uuid(),productionId:z59.uuid(),byteSize:z59.int().positive().max(12582912),durationMs:z59.number().positive().max(6e4),frameRate:z59.number().positive().max(60).optional(),executionClass:z59.enum(["LIVE","TEST_ONLY"])});var json=z59.record(z59.string(),z59.unknown());var ObservationResultSchema=z59.strictObject({schemaVersion:z59.int().positive(),advisory:z59.literal(true),producer:z59.enum(["VLM","ASR"]).optional(),source:ObservationSourceSchema,input:json,provider:json,observedAt:z59.iso.datetime(),report:json,transcript:TranscriptSchema.optional(),evidence:ReviewIntelligenceEvidenceSchema.optional(),limitations:z59.array(z59.string().max(200)).max(20)}).refine(v=>v.producer==="ASR"===!!v.transcript&&!(v.producer==="ASR"&&v.evidence),{message:"ASR transcript cannot provide listening or visual Review evidence"}).refine(v=>new TextEncoder().encode(JSON.stringify(v)).length<=131072,{message:"Observation report too large"}).refine(v=>v.transcript?.timing!=="PROVIDER_REPORTED"||v.provider.protocol==="OPENAI_WHISPER_TRANSCRIPTION_V1"&&[...v.transcript.words,...v.transcript.segments].every(item=>item.endMs<=v.source.durationMs),{message:"Transcript timing requires the exact supported protocol and media duration"});var ObservationAdmissionSchema=z59.strictObject({semanticStatus:z59.literal("ACCEPTED"),observationId:z59.uuid(),runtimeJobId:z59.uuid(),productionRevision:z59.int().positive(),executionClass:z59.enum(["LIVE","TEST_ONLY"])});var ObservationViewSchema=ObservationScopeSchema.extend({observationId:z59.uuid(),runtimeJobId:z59.uuid(),request:ObservationStartSchema,profile:ObservationProfileSchema,matrix:ModelCapabilityMatrixSchema.optional(),parameters:ObservationParametersSchema,executionClass:z59.enum(["LIVE","TEST_ONLY"]),runtimeStatus:z59.enum(["PENDING","READY","RUNNING","WAITING","SUCCEEDED","FAILED","CANCELLED","SUPERSEDED"]),providerStatus:z59.enum(["NOT_SUBMITTED","SUBMITTING","UNKNOWN","SUCCEEDED","REJECTED"]),cancellationRequested:z59.boolean(),failure:z59.strictObject({classification:z59.string().min(1).max(100),summary:z59.string().min(1).max(1e3)}).nullable(),result:ObservationResultSchema.nullable(),createdAt:z59.iso.datetime()});var ObservationOptionsSchema=ObservationScopeSchema.extend({options:z59.array(z59.strictObject({selection:ProviderSelectionSchema,profile:ObservationProfileSchema,matrix:ModelCapabilityMatrixSchema.optional(),connectionLabel:z59.string(),connectionVersion:z59.int().positive()})).max(100),possiblyTruncated:z59.boolean()});var ProductionGuidanceSchema=z59.strictObject({version:z59.enum(["NVS_PRODUCTION_GUIDANCE_V1","NVS_PRODUCTION_GUIDANCE_V2"]),instructions:z59.string().min(1).max(16e3)});var ProductionGuidanceContextSchema=ObservationScopeSchema.extend({projectId:z59.uuid(),revision:z59.int().positive(),guidance:ProductionGuidanceSchema});import{z as z60}from"zod";var sha8=z60.string().regex(/^[0-9a-f]{64}$/);var evidenceIds=z60.array(ReviewEvidenceKeySchema).max(16);var ReviewIntelligenceTargetSchema=z60.discriminatedUnion("kind",[z60.strictObject({kind:z60.literal("IMAGE"),generationId:z60.uuid()}),z60.strictObject({kind:z60.literal("VIDEO"),generationId:z60.uuid()}),z60.strictObject({kind:z60.literal("ROUGH_CUT"),renderId:z60.uuid()}),z60.strictObject({kind:z60.literal("PROGRAMMATIC"),renderId:z60.uuid()})]);var ReviewIntelligenceContextInputSchema=z60.strictObject({scope:DirectorScopeSchema,target:ReviewIntelligenceTargetSchema});var ReviewIntelligenceBasisSchema=ReviewIntelligenceContextInputSchema.extend({contextFingerprint:sha8});var ReviewIntelligenceOwnerTargetSchema=z60.discriminatedUnion("kind",[z60.strictObject({kind:z60.literal("IMAGE"),target:KeyframeReviewTargetSchema}),z60.strictObject({kind:z60.literal("VIDEO"),target:VideoReviewTargetSchema}),z60.strictObject({kind:z60.literal("ROUGH_CUT"),target:RoughCutReviewTargetSchema}),z60.strictObject({kind:z60.literal("PROGRAMMATIC"),target:ProgrammaticVideoReviewTargetSchema})]);var review=z60.discriminatedUnion("kind",[z60.strictObject({kind:z60.literal("IMAGE"),observations:z60.array(KeyframeObservationSchema.extend({evidenceIds})).min(1).max(MAX_SHOT_REVIEW_REQUIREMENTS)}),z60.strictObject({kind:z60.literal("VIDEO"),observations:z60.array(VideoObservationSchema.extend({evidenceIds})).min(1).max(MAX_SHOT_REVIEW_REQUIREMENTS)}),z60.strictObject({kind:z60.literal("PROGRAMMATIC"),observations:z60.array(VideoObservationSchema.extend({evidenceIds})).min(1).max(MAX_SHOT_REVIEW_REQUIREMENTS)}),z60.strictObject({kind:z60.literal("ROUGH_CUT"),observations:z60.array(RoughCutObservationSchema.extend({evidenceIds})).min(1).max(300),inspection:RoughCutInspectionSchema})]);var ValidateReviewIntelligenceSchema=z60.strictObject({basis:ReviewIntelligenceBasisSchema,proposal:z60.strictObject({origin:z60.strictObject({kind:z60.literal("EXTERNAL_AGENT_HOST"),label:z60.string().trim().min(1).max(100)}),summary:z60.string().trim().min(1).max(2e3),evidence:z60.array(ReviewIntelligenceEvidenceSchema).max(256),review})}).refine(input=>new TextEncoder().encode(JSON.stringify(input)).byteLength<=1024*1024,"Review Intelligence input exceeds the 1 MiB JSON budget");var ReviewIntelligenceContextResultSchema=z60.strictObject({semanticStatus:z60.literal("SUCCESS"),advisory:z60.literal(true),basis:ReviewIntelligenceBasisSchema,productionGuidance:ProductionGuidanceSchema.optional(),ownerContext:DirectorContextResultSchema,reviewTarget:ReviewIntelligenceOwnerTargetSchema,limitations:z60.array(z60.enum(["NO_IMPLICIT_MEDIA_OR_MODEL_CALL","READS_ARE_NOT_ATOMIC_OR_RESERVED"])).length(2)});var ReviewIntelligenceRecordDraftSchema=z60.discriminatedUnion("kind",[z60.strictObject({kind:z60.literal("PROGRAMMATIC"),input:RecordProgrammaticVideoReviewSchema.omit({idempotencyKey:true})}),z60.strictObject({kind:z60.literal("IMAGE"),input:RecordKeyframeReviewSchema.omit({idempotencyKey:true})}),z60.strictObject({kind:z60.literal("VIDEO"),input:RecordVideoReviewSchema.omit({idempotencyKey:true})}),z60.strictObject({kind:z60.literal("ROUGH_CUT"),input:RecordRoughCutReviewSchema.omit({idempotencyKey:true})})]);var ReviewIntelligenceIssueSchema=z60.strictObject({requirement:z60.union([VisualRequirementSchema,VideoReviewRequirementSchema,RoughCutRequirementSchema]),observation:z60.union([KeyframeObservationSchema,VideoObservationSchema,RoughCutObservationSchema]),evidenceIds,blocking:z60.boolean(),severity:z60.enum(["BLOCKING","WARNING"]),affectedScope:z60.strictObject({kind:z60.enum(["PRODUCTION","SHOT","TRANSITION","TIMELINE_REGION"]),interval:ReviewIntervalSchema,shotIds:z60.array(z60.uuid()).min(1).max(200)}).optional()});var ReviewIntelligenceValidationResultSchema=z60.strictObject({semanticStatus:z60.literal("SUCCESS"),advisory:z60.literal(true),basis:ReviewIntelligenceBasisSchema,proposal:ValidateReviewIntelligenceSchema.shape.proposal,canonicalRulePreview:z60.strictObject({source:z60.literal("EXISTING_CANONICAL_DOMAIN_RULES"),authoritative:z60.literal(false),evaluatorVersion:z60.enum(["keyframe-reference-v1","shot-review-v1","production-review-v1"]),result:z60.enum(["PASS","WARNING","FAIL"]),blockingKeys:z60.array(z60.string()).max(MAX_SHOT_REVIEW_REQUIREMENTS),warningKeys:z60.array(z60.string()).max(MAX_SHOT_REVIEW_REQUIREMENTS)}),issueProposals:z60.array(ReviewIntelligenceIssueSchema).max(MAX_SHOT_REVIEW_REQUIREMENTS),recordDraft:ReviewIntelligenceRecordDraftSchema,limitations:z60.array(z60.enum(["EVIDENCE_DECLARATIONS_ARE_NOT_ATTESTED_PIXEL_READS","RULE_PREVIEW_IS_NOT_A_CANONICAL_REVIEW","RECORD_RECHECKS_CURRENTNESS_CAS_AND_EXECUTION_CLASS","ACCEPTANCE_REMAINS_A_SEPARATE_OWNER_DECISION"])).length(4)});export{ClipTransitionSchema,TimelineGraphicInputSchema,AudioScopeSchema,AudioImportRequestSchema,AudioGetSchema,AudioQuerySchema,AudioViewSchema,AudioReceiptSchema,AudioBasisSchema,AudioPageSchema,AudioSnapshotSchema,TimelineAudioInputSchema,SourceSyncAudioStartSchema,SourceSyncAudioGetSchema,SourceSyncAudioVersionSchema,SourceSyncAudioReceiptSchema,SourceSyncAudioViewSchema,ProviderSelectionSchema,ConfigureProviderInputSchema,ProviderConnectionViewSchema,ProviderConnectionCommandSchema,ProviderCredentialRevokeSchema,SetKeyframeDefaultSchema,SpeechScopeSchema,SpeechStartSchema,SpeechGetSchema,SpeechAdmissionSchema,SpeechGenerationViewSchema,SpeechOptionsSchema,PreparationIdSchema,GenerationContractIdSchema,ContentFingerprintSchema,PreparationTargetSchema,PreparationBasisSchema,ReferenceRoleSchema,ReferenceBindingInputSchema,ExactEvidenceReferenceSchema,PreparationBlockerSchema,ConstraintSetSchema,ReferenceSetSchema,GenerationCostQuoteSchema,KeyframeProviderProfileSchema,KeyframeStartInputSchema,KeyframeGetInputSchema,KeyframeQueryInputSchema,KeyframeAdmissionSchema,KeyframeGenerationViewSchema,KeyframeQueryPageSchema,KeyframeMediaSchema,KeyframeSummarySchema,VideoProviderProfileSchema,VideoStartInputSchema,VideoGetInputSchema,VideoQueryInputSchema,VideoAdmissionSchema,VideoGenerationViewSchema,VideoQueryPageSchema,VideoSummarySchema,ProviderTenantInputSchema,ProviderDefaultViewSchema,ProviderConnectionPageSchema,ProviderModelsViewSchema,ProviderModelViewSchema,ConfigureProviderModelSchema,DisableProviderModelSchema,ProviderModelPageSchema,ProviderModelGetSchema,SoundPlanScopeSchema,SoundPlanValidateSchema,SoundPlanAcceptSchema,SoundPlanGetSchema,SoundPlanValidationSchema,SoundPlanViewSchema,SoundPlanReceiptSchema,SoundPlanContextSchema,AcceptedVisualSourceReferenceSchema,CaptionTranscriptPlanSchema,AuthorTranscriptCaptionsSchema,CaptionContentSchema,CaptionScopeSchema,AuthorCaptionsSchema,CaptionGetSchema,CaptionQuerySchema,CaptionViewSchema,CaptionReceiptSchema,CaptionBasisSchema,CaptionPageSchema,CaptionExportSchema,CaptionSnapshotSchema,CaptionTranscriptDraftSchema,VisualFrameSequenceSchema,TimelineVisualLayerInputSchema,TimelineManifestReaderSchema,TimelineScopeSchema,BuildTimelineShapeSchema,BuildTimelineSchema,TimelineViewSchema,TimelineGetSchema,TimelineQuerySchema,TimelinePageSchema,TimelineBuildReceiptSchema,TimelineBasisSchema,TimelineSnapshotSchema,FinalRenderProfileIdSchema,FinalRenderProfileSchema,RoughCutManifestSchema,VisualLayerFinalProfileSchema,VisualLayerFinalManifestSchema,RoughCutStartSchema,RoughCutGetSchema,RoughCutQuerySchema,RoughCutV2ManifestSchema,RoughCutManifestReaderSchema,RoughCutTechnicalSchema,RoughCutArtifactSchema,RoughCutAdmissionSchema,RoughCutViewSchema,RoughCutPageSchema,RoughCutSnapshotSchema,CompositionFindingLocalitySchema,BriefContentSchema,AcceptBriefRequestSchema,AcceptBriefResultSchema,StoryContentSchema,AcceptStoryRequestSchema,StoryVersionSchema,AcceptStoryResultSchema,ConsistencyProfileScopeSchema,ConsistencyProfileVersionQuerySchema,ConfigureConsistencyProfileSchema,ConsistencyProfileVersionSchema,ConsistencyProfileViewSchema,ConsistencyProfileReceiptSchema,RoughCutReviewScopeSchema,RecordRoughCutReviewSchema,RoughCutReviewRecordSchema,RoughCutReviewTargetSchema,RoughCutFindingViewSchema,RoughCutReviewQuerySchema,RoughCutReviewPageSchema,RoughCutFindingQuerySchema,RoughCutFindingPageSchema,RoughCutReviewReceiptSchema,MAX_SHOT_REVIEW_REQUIREMENTS,KeyframeReviewScopeSchema,VisualRequirementSchema,KeyframeObservationSchema,RecordKeyframeReviewSchema,DecideKeyframeSchema,KeyframeReferenceScopeSchema,RevokeKeyframeSchema,KeyframeReviewTargetSchema,KeyframeReferenceViewSchema,KeyframeReviewQuerySchema,KeyframeReviewPageSchema,KeyframeReviewReceiptSchema,KeyframeDecisionReceiptSchema,KeyframeDecisionQuerySchema,KeyframeDecisionPageSchema,KeyframeReviewSummarySchema,BoundaryRequirementSchema,ShotIntentSchema,AcceptSceneShotPlanRequestSchema,ShotPlanEntrySchema,SceneShotPlanVersionSchema,AcceptSceneShotPlanResultSchema,AgentHostScopeSchema,AgentHostSelectionSchema,ConfigureAgentHostSchema,RevokeAgentHostSchema,AgentHostBindingSchema,UpdateAgentHostSelectionSchema,AgentHostCurrentSchema,AgentHostHistoryQuerySchema,AgentHostHistoryPageSchema,AgentHostReadinessSchema,NativeRuntimePublicKeySchema,ConfigureNativeToolGrantSchema,NativeToolGrantGetSchema,RevokeNativeToolGrantSchema,NativeRuntimeProofRequestSchema,NativeToolGrantViewSchema,VideoReviewScopeSchema,VideoReviewRequirementSchema,VideoObservationSchema,RecordVideoReviewSchema,VideoReviewRecordSchema,DecideVideoShotSchema,ShotAcceptanceScopeSchema,RevokeShotAcceptanceSchema,GeneratedShotAcceptanceDecisionSchema,ProgrammaticShotAcceptanceDecisionSchema,VideoReviewTargetSchema,ShotAcceptanceViewSchema,VideoReviewQuerySchema,VideoReviewPageSchema,ShotDecisionQuerySchema,ShotDecisionPageSchema,VideoReviewReceiptSchema,ShotDecisionReceiptSchema,ProgrammaticVideoReviewScopeSchema,ProgrammaticVideoReviewTargetSchema,RecordProgrammaticVideoReviewSchema,DecideProgrammaticShotSchema,ProgrammaticVideoReviewQuerySchema,ProgrammaticVideoReviewPageSchema,ProgrammaticVideoReviewReceiptSchema,WriterScopeSchema,ValidateWriterProposalSchema,WriterBriefResultSchema,WriterValidationResultSchema,DirectorScopeSchema,DirectorBasisSchema,ValidateDirectorProposalSchema,DirectorContextResultSchema,DirectorValidationResultSchema,ReviewEvidenceKeySchema,ReviewEvidenceMediaSchema,ObservationScopeSchema,ObservationStartSchema,ObservationGetSchema,ObservationAdmissionSchema,ObservationViewSchema,ObservationOptionsSchema,ProductionGuidanceContextSchema,ReviewIntelligenceContextInputSchema,ReviewIntelligenceBasisSchema,ValidateReviewIntelligenceSchema,ReviewIntelligenceContextResultSchema,ReviewIntelligenceValidationResultSchema};
@@ -1 +0,0 @@
1
- import{z}from"zod";var TenantIdSchema=z.uuid().brand();var PrincipalIdSchema=z.uuid().brand();var ProjectIdSchema=z.uuid().brand();var ProductionIdSchema=z.uuid().brand();var ArtifactIdSchema=z.uuid().brand();var ArtifactRepresentationIdSchema=z.uuid().brand();var ArtifactRelationIdSchema=z.uuid().brand();var BriefIdSchema=z.uuid().brand();var BriefVersionIdSchema=z.uuid().brand();var StoryIdSchema=z.uuid().brand();var StoryVersionIdSchema=z.uuid().brand();var SceneShotPlanIdSchema=z.uuid().brand();var SceneShotPlanVersionIdSchema=z.uuid().brand();var SceneIdSchema=z.uuid().brand();var ShotIdSchema=z.uuid().brand();var ContinuityEdgeIdSchema=z.uuid().brand();var RuntimeJobIdSchema=z.uuid().brand();var OperationIdSchema=z.string().regex(/^op_[A-Za-z0-9_-]+$/).max(2048).brand();var RuntimeJobAttemptIdSchema=z.uuid().brand();var OutboxEventIdSchema=z.uuid().brand();import{z as z2}from"zod";var InterfaceSemanticStatusSchema=z2.enum(["SUCCESS","ACCEPTED","NO_CHANGE","INVALID_INPUT","NOT_FOUND","REVISION_CONFLICT","STALE_BASIS","BLOCKED","WAITING_PROVIDER","WAITING_INPUT","RETRYING","CAPABILITY_UNAVAILABLE","PROVIDER_UNAVAILABLE","BUDGET_BLOCKED","CANCELLED","SUPERSEDED","INTERNAL_OPERATIONAL_FAILURE"]);var ActionAvailabilitySchema=z2.enum(["AVAILABLE","UNAVAILABLE"]);var NextActionSchema=z2.object({capability:z2.string().min(1).max(120),targetType:z2.string().min(1).max(80),targetId:z2.string().min(1).max(2048),availability:ActionAvailabilitySchema,reason:z2.string().min(1).max(1e3).nullable()});var ContinuationSchema=z2.string().min(1).max(8192);var QueryLimitSchema=z2.int().min(1).max(100).default(20);var QueryPageInfoSchema=z2.object({hasMore:z2.boolean(),next:ContinuationSchema.nullable()});var WorkSummarySchema=z2.object({total:z2.int().nonnegative(),pending:z2.int().nonnegative(),ready:z2.int().nonnegative(),running:z2.int().nonnegative(),waiting:z2.int().nonnegative(),succeeded:z2.int().nonnegative(),failed:z2.int().nonnegative(),cancelled:z2.int().nonnegative(),superseded:z2.int().nonnegative(),attempts:z2.int().nonnegative()});import{z as z3}from"zod";var DeliveryOutputProfileSchema=z3.enum(["MP4_H264_1080P","MP4_H264_720P","MP4_H264_480P"]);var finalProfileIds={MP4_H264_1080P:"FINAL_H264_1080P_V1",MP4_H264_720P:"FINAL_H264_720P_V1",MP4_H264_480P:"FINAL_H264_480P_V1"};export{InterfaceSemanticStatusSchema,NextActionSchema,ContinuationSchema,QueryLimitSchema,QueryPageInfoSchema,WorkSummarySchema,TenantIdSchema,PrincipalIdSchema,ProjectIdSchema,ProductionIdSchema,ArtifactIdSchema,ArtifactRepresentationIdSchema,ArtifactRelationIdSchema,BriefIdSchema,BriefVersionIdSchema,StoryIdSchema,StoryVersionIdSchema,SceneShotPlanIdSchema,SceneShotPlanVersionIdSchema,SceneIdSchema,ShotIdSchema,ContinuityEdgeIdSchema,OperationIdSchema,DeliveryOutputProfileSchema,finalProfileIds};
@@ -1 +0,0 @@
1
- var NativeStudioSdkError=class extends Error{constructor(code,semanticStatus,outcome,status=null){super(`NativeStudio ${code}`);this.code=code;this.semanticStatus=semanticStatus;this.outcome=outcome;this.status=status;this.name="NativeStudioSdkError"}code;semanticStatus;outcome;status};function sdkInputError(){throw new NativeStudioSdkError("INVALID_INPUT","INVALID_INPUT","NO_WRITE")}export{NativeStudioSdkError,sdkInputError};
@@ -1 +0,0 @@
1
- import{ContinuationSchema,DeliveryOutputProfileSchema,PrincipalIdSchema,ProductionIdSchema,ProjectIdSchema,QueryLimitSchema,QueryPageInfoSchema,TenantIdSchema}from"./chunk-4M3AGNTZ.js";import{z as z3}from"zod";import{z as z2}from"zod";import{z}from"zod";var ProductionLifecycleSchema=z.enum(["ACTIVE","COMPLETED","FAILED","CANCELLED"]);var ProductionPhaseSchema=z.enum(["INTAKE","PLANNING","PREPARING_GENERATION","GENERATING","SHOT_REVIEW","ASSEMBLING","ROUGH_CUT_REVIEW","FINAL_READY","FINAL_RENDERING","DELIVERY_VALIDATION"]);var ProductionConditionSchema=z.enum(["RUNNABLE","RUNNING","WAITING_PROVIDER","WAITING_HUMAN","BLOCKED","RETRYING"]);var CreateProductionInputSchema=z.object({tenantId:TenantIdSchema,projectId:ProjectIdSchema,principalId:PrincipalIdSchema});var ProductionStateSchema=z.object({lifecycle:ProductionLifecycleSchema,phase:ProductionPhaseSchema,condition:ProductionConditionSchema,revision:z.int().positive(),blockingReason:z.string().min(1).nullable(),waitingReason:z.string().min(1).nullable()});var ProductionSchema=z.object({id:ProductionIdSchema,tenantId:TenantIdSchema,projectId:ProjectIdSchema,state:ProductionStateSchema,activeBriefVersion:z.int().positive().nullable().default(null),activeStoryVersion:z.int().positive().nullable().default(null),activeSceneShotPlanVersion:z.int().positive().nullable().default(null),createdByPrincipalId:PrincipalIdSchema,createdAt:z.iso.datetime({offset:true}),updatedAt:z.iso.datetime({offset:true})});var ProjectLifecycleSchema=z2.enum(["ACTIVE","ARCHIVED"]);var CreateProjectInputSchema=z2.object({tenantId:TenantIdSchema,principalId:PrincipalIdSchema,idempotencyKey:z2.string().trim().min(1).max(200),name:z2.string().trim().min(1).max(200)});var CreateProjectRequestSchema=CreateProjectInputSchema.omit({principalId:true}).strict();var ProjectSchema=z2.object({id:ProjectIdSchema,tenantId:TenantIdSchema,name:z2.string().min(1),lifecycle:ProjectLifecycleSchema,defaultActiveProductionId:ProductionIdSchema.nullable(),revision:z2.int().positive(),createdByPrincipalId:PrincipalIdSchema,createdAt:z2.iso.datetime({offset:true}),updatedAt:z2.iso.datetime({offset:true})});var CreatedProjectResultSchema=z2.object({project:ProjectSchema,production:ProductionSchema});var ProjectLibraryQuerySchema=z3.strictObject({tenantId:TenantIdSchema,limit:QueryLimitSchema,next:ContinuationSchema.optional()});var ProjectLibraryScopeSchema=z3.strictObject({tenantId:TenantIdSchema,projectId:ProjectIdSchema});var ProjectLibraryPageSchema=z3.strictObject({items:z3.array(ProjectSchema).max(100),page:QueryPageInfoSchema});var ProjectWorkspaceSchema=z3.strictObject({project:ProjectSchema,productions:z3.array(ProductionSchema).max(100),possiblyTruncated:z3.boolean()});var SourceLibraryQuerySchema=ProjectLibraryQuerySchema.extend({projectId:ProjectIdSchema.optional()});var SourceLibraryItemSchema=z3.strictObject({artifactId:z3.uuid(),representationId:z3.uuid(),projectId:ProjectIdSchema,kind:z3.enum(["REFERENCE_IMAGE","REFERENCE_VIDEO","PRODUCT_INFORMATION"]),originalName:z3.string().max(255),checksumSha256:z3.string().regex(/^[0-9a-f]{64}$/),contentType:z3.enum(["image/png","image/jpeg","image/webp","text/plain","application/json","video/mp4"]),byteSize:z3.int().positive().max(8388608),width:z3.int().positive().nullable(),height:z3.int().positive().nullable(),createdAt:z3.iso.datetime({offset:true})});var SourceLibraryPageSchema=z3.strictObject({items:z3.array(SourceLibraryItemSchema).max(100),page:QueryPageInfoSchema});var SourceLibraryMediaSchema=ProjectLibraryScopeSchema.extend({artifactId:z3.uuid()});var StudioInputContentSchema=z3.strictObject({schemaVersion:z3.literal(1),productionId:z3.uuid(),projectTitle:z3.string().trim().min(1).max(200),name:z3.string().trim().max(300),intent:z3.string().trim().min(1).max(2e3),aspectRatio:z3.enum(["16:9","9:16"]),targetDurationSeconds:z3.int().min(30).max(60),outputProfile:DeliveryOutputProfileSchema,sourceArtifactIds:z3.array(z3.uuid()).max(12)});import{z as z4}from"zod";var HumanEmailSchema=z4.string().trim().max(254).toLowerCase().pipe(z4.email()).refine(v=>/^[\x21-\x7e]+$/.test(v),"Use an ASCII email address");var HumanPasswordSchema=z4.string().max(512).superRefine((v,c)=>{const points=[...v];const control=points.some(c2=>c2.codePointAt(0)<32||c2.codePointAt(0)===127);if(points.length<15||points.length>128||control)c.addIssue({code:"custom",message:"Password must contain 15\u2013128 characters"})});var HumanCodePurposeSchema=z4.enum(["REGISTER","RESET_PASSWORD","LINK_EMAIL"]);var HumanCodeRequestSchema=z4.strictObject({email:HumanEmailSchema,purpose:HumanCodePurposeSchema});var HumanCodeRequestedSchema=z4.strictObject({accepted:z4.literal(true),challengeId:z4.uuid(),retryAfterSeconds:z4.literal(60),expiresInSeconds:z4.literal(600)});var proof={challengeId:z4.uuid(),email:HumanEmailSchema,code:z4.string().regex(/^\d{6}$/),password:HumanPasswordSchema};var HumanRegisterSchema=z4.strictObject({...proof,displayName:z4.string().trim().min(1).max(80)});var HumanResetSchema=z4.strictObject(proof);var HumanLoginSchema=z4.strictObject({email:HumanEmailSchema,password:z4.string().max(512)});var HumanTenantSchema=z4.strictObject({id:z4.uuid(),displayName:z4.string().max(200)});var HumanAccountSchema=z4.strictObject({principalId:z4.uuid(),displayName:z4.string().max(200),email:HumanEmailSchema.nullable(),tenants:z4.array(HumanTenantSchema).max(100)});var HumanDesktopSessionSchema=z4.strictObject({tenantId:z4.uuid(),scopeKey:z4.string().regex(/^[a-f0-9]{64}$/),expiresAt:z4.int().positive(),rememberMe:z4.boolean(),account:HumanAccountSchema.omit({tenants:true})});var HumanSessionSchema=z4.strictObject({accessToken:z4.string().regex(/^nvsh_[A-Za-z0-9_-]{43}$/),expiresAt:z4.iso.datetime(),account:HumanAccountSchema});var HumanIdentityAvailabilitySchema=z4.strictObject({passwordLogin:z4.boolean(),emailVerification:z4.boolean()});var HumanIdentityFailureSchema=z4.strictObject({code:z4.enum(["INVALID_INPUT","INVALID_CREDENTIALS","INVALID_CODE","RATE_LIMITED","MAIL_UNAVAILABLE","UNAVAILABLE","UNAUTHENTICATED","CONFLICT"])});var CliAccountRedirectSchema=z4.string().max(256).refine(value=>{try{const url=new URL(value);return url.protocol==="http:"&&url.hostname==="127.0.0.1"&&Number(url.port)>0&&!url.username&&!url.password&&!url.search&&!url.hash&&/^\/account-callback\/[a-f0-9-]{36}$/.test(url.pathname)&&url.href===value}catch{return false}},"Owned loopback account callback required");var proofKey=z4.string().regex(/^[A-Za-z0-9_-]{43}$/);var CliAccountRequestIdSchema=z4.uuid();var CliAccountStartSchema=z4.strictObject({redirectUri:CliAccountRedirectSchema,state:proofKey,codeChallenge:proofKey});var CliAccountStartedSchema=z4.strictObject({requestId:z4.uuid(),expiresAt:z4.iso.datetime()});var CliAccountPreviewSchema=CliAccountStartedSchema.extend({redirectUri:CliAccountRedirectSchema});var CliAccountDecisionSchema=z4.strictObject({requestId:z4.uuid(),approved:z4.boolean(),expectedPrincipalId:z4.uuid()});var CliAccountExchangeSchema=z4.strictObject({requestId:z4.uuid(),code:proofKey,codeVerifier:proofKey,redirectUri:CliAccountRedirectSchema});var CliAccountSessionSchema=HumanSessionSchema.extend({credentialPurpose:z4.literal("CLI_ACCOUNT")});var CliAccountIdentitySchema=z4.strictObject({credentialPurpose:z4.literal("CLI_ACCOUNT"),account:HumanAccountSchema});export{ProductionStateSchema,ProductionSchema,CreateProjectRequestSchema,CreatedProjectResultSchema,ProjectLibraryQuerySchema,ProjectLibraryScopeSchema,ProjectLibraryPageSchema,ProjectWorkspaceSchema,SourceLibraryQuerySchema,SourceLibraryPageSchema,SourceLibraryMediaSchema,StudioInputContentSchema,CliAccountStartSchema,CliAccountStartedSchema,CliAccountExchangeSchema,CliAccountSessionSchema,CliAccountIdentitySchema};
@@ -1,90 +0,0 @@
1
- $ErrorActionPreference = 'Stop'
2
- [Console]::InputEncoding = New-Object Text.UTF8Encoding($false)
3
- [Console]::OutputEncoding = New-Object Text.UTF8Encoding($false)
4
- try {
5
- $raw = [Console]::In.ReadToEnd()
6
- if ($raw.Length -gt 32768) { throw 'INPUT_LIMIT' }
7
- $request = $raw | ConvertFrom-Json
8
- $names = @('Bootstrap.ps1','NativeMain.cs','PrivateAccess.cs','PipeBridge.cs','JobNative.cs','JobRunner.cs')
9
- $directory = [IO.Path]::GetFullPath($request.directory)
10
- $hash = [Security.Cryptography.SHA256]::Create()
11
- foreach ($name in $names) {
12
- $file = Join-Path $directory $name
13
- if (([IO.File]::GetAttributes($file) -band [IO.FileAttributes]::ReparsePoint) -ne 0) { throw 'REPARSE' }
14
- $prefix = [Text.Encoding]::UTF8.GetBytes($name + "`n")
15
- [void]$hash.TransformBlock($prefix,0,$prefix.Length,$prefix,0)
16
- $bytes = [IO.File]::ReadAllBytes($file)
17
- if ($bytes.Length -gt 262144) { throw 'SOURCE_LIMIT' }
18
- [void]$hash.TransformBlock($bytes,0,$bytes.Length,$bytes,0)
19
- }
20
- [void]$hash.TransformFinalBlock([byte[]]@(),0,0)
21
- $digest = ([BitConverter]::ToString($hash.Hash)).Replace('-','').ToLowerInvariant()
22
- if ($digest -ne $request.sourceDigest) { throw 'SOURCE_CHANGED' }
23
- $sid = [Security.Principal.WindowsIdentity]::GetCurrent().User
24
- function Check-Private([string]$path) {
25
- $item = Get-Item -LiteralPath $path -Force
26
- if (($item.Attributes -band [IO.FileAttributes]::ReparsePoint) -ne 0) { throw 'REPARSE' }
27
- $acl = $item.GetAccessControl()
28
- if ($acl.GetOwner([Security.Principal.SecurityIdentifier]).Value -ne $sid.Value) { throw 'OWNER' }
29
- foreach ($rule in $acl.GetAccessRules($true,$true,[Security.Principal.SecurityIdentifier])) {
30
- if ($rule.AccessControlType -eq [Security.AccessControl.AccessControlType]::Allow -and
31
- $rule.IdentityReference.Value -notin @($sid.Value,'S-1-5-18','S-1-5-32-544')) { throw 'ACL' }
32
- }
33
- }
34
- function Private-Directory([string]$path) {
35
- if ([IO.Directory]::Exists($path)) { Check-Private $path; return }
36
- $acl = New-Object Security.AccessControl.DirectorySecurity
37
- $acl.SetOwner($sid)
38
- $acl.SetAccessRuleProtection($true,$false)
39
- $rule = New-Object Security.AccessControl.FileSystemAccessRule($sid,'FullControl','ContainerInherit,ObjectInherit','None','Allow')
40
- $acl.AddAccessRule($rule)
41
- [void][IO.Directory]::CreateDirectory($path,$acl)
42
- Check-Private $path
43
- }
44
- $base = Join-Path ([Environment]::GetFolderPath('LocalApplicationData')) 'NativeStudio-platform'
45
- Private-Directory $base
46
- $cache = Join-Path $base $digest
47
- Private-Directory $cache
48
- $mutex = New-Object Threading.Mutex($false,('Local\NVS-compile-' + $sid.Value + '-' + $digest))
49
- $locked = $false
50
- try {
51
- try { $locked = $mutex.WaitOne(10000) } catch [Threading.AbandonedMutexException] { $locked = $true }
52
- if (-not $locked) { throw 'BUSY' }
53
- $record = Join-Path $cache 'helper.json'
54
- if ([IO.File]::Exists($record)) {
55
- Check-Private $record
56
- $value = [IO.File]::ReadAllText($record) | ConvertFrom-Json
57
- if ($value.sourceDigest -ne $digest -or $value.file -notmatch '^helper-[0-9a-f-]{36}\.exe$') { throw 'CACHE' }
58
- $executable = Join-Path $cache $value.file
59
- Check-Private $executable
60
- $actual = (Get-FileHash -LiteralPath $executable -Algorithm SHA256).Hash.ToLowerInvariant()
61
- if ($actual -ne $value.sha256) { throw 'CACHE_CHANGED' }
62
- } else {
63
- $file = 'helper-' + [Guid]::NewGuid().ToString() + '.exe'
64
- $executable = Join-Path $cache $file
65
- $sources = @($names | Where-Object { $_.EndsWith('.cs') } | ForEach-Object { Join-Path $directory $_ })
66
- $compiler = New-Object CodeDom.Compiler.CompilerParameters
67
- $compiler.GenerateExecutable = $true
68
- $compiler.OutputAssembly = $executable
69
- $compiler.CompilerOptions = '/platform:x64 /optimize+ /langversion:5'
70
- $compiler.ReferencedAssemblies.AddRange(@('System.dll','System.Core.dll','System.Web.dll','System.Web.Extensions.dll','System.Security.dll'))
71
- Add-Type -Path $sources -CompilerParameters $compiler
72
- Check-Private $executable
73
- $actual = (Get-FileHash -LiteralPath $executable -Algorithm SHA256).Hash.ToLowerInvariant()
74
- $value = @{ sourceDigest=$digest; file=$file; sha256=$actual }
75
- $temporary = Join-Path $cache ([Guid]::NewGuid().ToString() + '.json')
76
- $bytes = [Text.Encoding]::UTF8.GetBytes(($value | ConvertTo-Json -Compress))
77
- $stream = New-Object IO.FileStream($temporary,[IO.FileMode]::CreateNew,[IO.FileAccess]::Write,[IO.FileShare]::None)
78
- try { $stream.Write($bytes,0,$bytes.Length); $stream.Flush($true) } finally { $stream.Dispose() }
79
- [IO.File]::Move($temporary,$record)
80
- Check-Private $record
81
- }
82
- @{ path=$executable; sha256=$actual; sourceDigest=$digest } | ConvertTo-Json -Compress
83
- } finally {
84
- if ($locked) { $mutex.ReleaseMutex() }
85
- $mutex.Dispose()
86
- }
87
- } catch {
88
- [Console]::Error.WriteLine('WINDOWS_HELPER_UNAVAILABLE')
89
- exit 1
90
- }