@nativestudio/sdk 0.0.0-stage → 0.3.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/COMPATIBILITY.json +14 -0
  2. package/LICENSE +21 -0
  3. package/README.md +74 -2
  4. package/dist/BUNDLED_DEPENDENCIES.json +1 -0
  5. package/dist/_chunks/chunk-34KSWLCI.js +1 -0
  6. package/dist/_chunks/chunk-4IOFVNFG.js +1 -0
  7. package/dist/_chunks/chunk-4M3AGNTZ.js +1 -0
  8. package/dist/_chunks/chunk-6NVIN2NI.js +1 -0
  9. package/dist/_chunks/chunk-7YCEMDNZ.js +1 -0
  10. package/dist/_chunks/chunk-RK3YLCZP.js +1 -0
  11. package/dist/_types/contracts/accepted-shot.d.ts +27 -0
  12. package/dist/_types/contracts/accepted-visual-source.d.ts +120 -0
  13. package/dist/_types/contracts/agent-execution-lifecycle.d.ts +749 -0
  14. package/dist/_types/contracts/agent-execution-oauth.d.ts +71 -0
  15. package/dist/_types/contracts/agent-execution-registration.d.ts +240 -0
  16. package/dist/_types/contracts/agent-execution-selection.d.ts +107 -0
  17. package/dist/_types/contracts/agent-host-execution.d.ts +706 -0
  18. package/dist/_types/contracts/agent-host-generic-transport.d.ts +12 -0
  19. package/dist/_types/contracts/agent-host.d.ts +226 -0
  20. package/dist/_types/contracts/artifact-discovery.d.ts +170 -0
  21. package/dist/_types/contracts/artifact.d.ts +188 -0
  22. package/dist/_types/contracts/audio.d.ts +331 -0
  23. package/dist/_types/contracts/brief.d.ts +178 -0
  24. package/dist/_types/contracts/caption-render.d.ts +20 -0
  25. package/dist/_types/contracts/caption-transcript.d.ts +102 -0
  26. package/dist/_types/contracts/captions.d.ts +420 -0
  27. package/dist/_types/contracts/clip-framing.d.ts +14 -0
  28. package/dist/_types/contracts/clip-transition.d.ts +6 -0
  29. package/dist/_types/contracts/composition-authoring-guide.d.ts +160 -0
  30. package/dist/_types/contracts/composition-authoring.d.ts +744 -0
  31. package/dist/_types/contracts/composition-finding-locality.d.ts +24 -0
  32. package/dist/_types/contracts/composition-frame-render.d.ts +226 -0
  33. package/dist/_types/contracts/composition-making.d.ts +390 -0
  34. package/dist/_types/contracts/composition-observation.d.ts +239 -0
  35. package/dist/_types/contracts/composition-render-base.d.ts +292 -0
  36. package/dist/_types/contracts/composition-render-observation.d.ts +278 -0
  37. package/dist/_types/contracts/composition-render.d.ts +406 -0
  38. package/dist/_types/contracts/composition-repair.d.ts +451 -0
  39. package/dist/_types/contracts/composition-source-review.d.ts +1042 -0
  40. package/dist/_types/contracts/consistency-profile.d.ts +845 -0
  41. package/dist/_types/contracts/continuity-evaluation.d.ts +48 -0
  42. package/dist/_types/contracts/delivery-completion.d.ts +210 -0
  43. package/dist/_types/contracts/delivery-manifest.d.ts +11776 -0
  44. package/dist/_types/contracts/delivery-operations.d.ts +5009 -0
  45. package/dist/_types/contracts/delivery-output-profile.d.ts +12 -0
  46. package/dist/_types/contracts/delivery-summary.d.ts +220 -0
  47. package/dist/_types/contracts/delivery-validation.d.ts +183 -0
  48. package/dist/_types/contracts/director-proposal.d.ts +1067 -0
  49. package/dist/_types/contracts/editor-intelligence.d.ts +5751 -0
  50. package/dist/_types/contracts/exploration-recommendation.d.ts +11863 -0
  51. package/dist/_types/contracts/external-agent-access.d.ts +95 -0
  52. package/dist/_types/contracts/final-ready.d.ts +301 -0
  53. package/dist/_types/contracts/final-render-profile.d.ts +59 -0
  54. package/dist/_types/contracts/final-render.d.ts +8181 -0
  55. package/dist/_types/contracts/foundation.d.ts +1 -0
  56. package/dist/_types/contracts/generation-contract.d.ts +268 -0
  57. package/dist/_types/contracts/generation-cost.d.ts +70 -0
  58. package/dist/_types/contracts/health.d.ts +6 -0
  59. package/dist/_types/contracts/human-identity.d.ts +149 -0
  60. package/dist/_types/contracts/hyperframe-profile.d.ts +5 -0
  61. package/dist/_types/contracts/ids.d.ts +41 -0
  62. package/dist/_types/contracts/index.d.ts +122 -0
  63. package/dist/_types/contracts/interface/common.d.ts +56 -0
  64. package/dist/_types/contracts/interface/execution-output.d.ts +99 -0
  65. package/dist/_types/contracts/interface/index.d.ts +7 -0
  66. package/dist/_types/contracts/interface/media-output.d.ts +62 -0
  67. package/dist/_types/contracts/interface/operation.d.ts +61 -0
  68. package/dist/_types/contracts/interface/output.d.ts +15 -0
  69. package/dist/_types/contracts/interface/production-snapshot.d.ts +832 -0
  70. package/dist/_types/contracts/interface/query.d.ts +315 -0
  71. package/dist/_types/contracts/keyframe-generation.d.ts +349 -0
  72. package/dist/_types/contracts/keyframe-reference.d.ts +31 -0
  73. package/dist/_types/contracts/keyframe-review.d.ts +753 -0
  74. package/dist/_types/contracts/lifecycle-event-projections.d.ts +191 -0
  75. package/dist/_types/contracts/lifecycle-events.d.ts +156 -0
  76. package/dist/_types/contracts/listening-evidence.d.ts +37 -0
  77. package/dist/_types/contracts/local-execution/agent-review.d.ts +560 -0
  78. package/dist/_types/contracts/local-execution/canonical.d.ts +2 -0
  79. package/dist/_types/contracts/local-execution/common.d.ts +48 -0
  80. package/dist/_types/contracts/local-execution/completion.d.ts +128 -0
  81. package/dist/_types/contracts/local-execution/device.d.ts +134 -0
  82. package/dist/_types/contracts/local-execution/index.d.ts +11 -0
  83. package/dist/_types/contracts/local-execution/ipc.d.ts +1202 -0
  84. package/dist/_types/contracts/local-execution/lifecycle.d.ts +319 -0
  85. package/dist/_types/contracts/local-execution/local-navigation.d.ts +710 -0
  86. package/dist/_types/contracts/local-execution/preview.d.ts +3663 -0
  87. package/dist/_types/contracts/local-execution/tool-selection.d.ts +15 -0
  88. package/dist/_types/contracts/local-execution/work.d.ts +3441 -0
  89. package/dist/_types/contracts/matrix-parameter-rule.d.ts +23 -0
  90. package/dist/_types/contracts/media-export.d.ts +23 -0
  91. package/dist/_types/contracts/media-observation.d.ts +1159 -0
  92. package/dist/_types/contracts/model-capability-matrix.d.ts +118 -0
  93. package/dist/_types/contracts/native-tool-authority-failure.d.ts +38 -0
  94. package/dist/_types/contracts/native-tool-authority.d.ts +110 -0
  95. package/dist/_types/contracts/native-tool-execution.d.ts +287 -0
  96. package/dist/_types/contracts/native-tool-gateway.d.ts +41 -0
  97. package/dist/_types/contracts/native-video-audio.d.ts +62 -0
  98. package/dist/_types/contracts/navigation-context.d.ts +253 -0
  99. package/dist/_types/contracts/navigation-groups.d.ts +51 -0
  100. package/dist/_types/contracts/navigation.d.ts +238 -0
  101. package/dist/_types/contracts/observation-profile.d.ts +99 -0
  102. package/dist/_types/contracts/planning-input.d.ts +177 -0
  103. package/dist/_types/contracts/principal.d.ts +26 -0
  104. package/dist/_types/contracts/production-creation.d.ts +66 -0
  105. package/dist/_types/contracts/production-termination.d.ts +51 -0
  106. package/dist/_types/contracts/production.d.ts +111 -0
  107. package/dist/_types/contracts/programmatic-composition.d.ts +762 -0
  108. package/dist/_types/contracts/programmatic-exploration.d.ts +7459 -0
  109. package/dist/_types/contracts/programmatic-video-review.d.ts +894 -0
  110. package/dist/_types/contracts/project-library.d.ts +173 -0
  111. package/dist/_types/contracts/project.d.ts +93 -0
  112. package/dist/_types/contracts/provider-catalog.d.ts +421 -0
  113. package/dist/_types/contracts/provider-models.d.ts +3380 -0
  114. package/dist/_types/contracts/provider.d.ts +142 -0
  115. package/dist/_types/contracts/reference-preview.d.ts +36 -0
  116. package/dist/_types/contracts/repair-lifecycle.d.ts +2896 -0
  117. package/dist/_types/contracts/repair-plan.d.ts +728 -0
  118. package/dist/_types/contracts/repair-strategy.d.ts +5751 -0
  119. package/dist/_types/contracts/review-intelligence-evidence.d.ts +136 -0
  120. package/dist/_types/contracts/review-intelligence-final-output.d.ts +8705 -0
  121. package/dist/_types/contracts/review-intelligence.d.ts +11543 -0
  122. package/dist/_types/contracts/review1-repair-source.d.ts +452 -0
  123. package/dist/_types/contracts/review1-repair-strategy.d.ts +491 -0
  124. package/dist/_types/contracts/review1-repair.d.ts +36 -0
  125. package/dist/_types/contracts/rough-cut-manifest.d.ts +347 -0
  126. package/dist/_types/contracts/rough-cut-profile.d.ts +37 -0
  127. package/dist/_types/contracts/rough-cut-review.d.ts +12819 -0
  128. package/dist/_types/contracts/rough-cut.d.ts +5862 -0
  129. package/dist/_types/contracts/scene-shot-plan.d.ts +882 -0
  130. package/dist/_types/contracts/sdk-discovery.d.ts +66 -0
  131. package/dist/_types/contracts/shot-direction.d.ts +113 -0
  132. package/dist/_types/contracts/shot-preparation-basis.d.ts +356 -0
  133. package/dist/_types/contracts/shot-preparation.d.ts +2285 -0
  134. package/dist/_types/contracts/shot-sound-instruction.d.ts +58 -0
  135. package/dist/_types/contracts/sound-making-plan.d.ts +1585 -0
  136. package/dist/_types/contracts/source-sound-policy.d.ts +10 -0
  137. package/dist/_types/contracts/source-workspace.d.ts +62 -0
  138. package/dist/_types/contracts/speech.d.ts +424 -0
  139. package/dist/_types/contracts/story.d.ts +98 -0
  140. package/dist/_types/contracts/temporal-evidence-operation.d.ts +379 -0
  141. package/dist/_types/contracts/temporal-evidence-reference.d.ts +18 -0
  142. package/dist/_types/contracts/temporal-evidence.d.ts +248 -0
  143. package/dist/_types/contracts/tenant.d.ts +7 -0
  144. package/dist/_types/contracts/timeline-audio.d.ts +97 -0
  145. package/dist/_types/contracts/timeline-graphics.d.ts +80 -0
  146. package/dist/_types/contracts/timeline-manifest.d.ts +702 -0
  147. package/dist/_types/contracts/timeline-source-sound.d.ts +352 -0
  148. package/dist/_types/contracts/timeline-v2.d.ts +1263 -0
  149. package/dist/_types/contracts/timeline-version-reader.d.ts +2945 -0
  150. package/dist/_types/contracts/timeline-visual-layers.d.ts +1245 -0
  151. package/dist/_types/contracts/timeline.d.ts +4942 -0
  152. package/dist/_types/contracts/transcription.d.ts +80 -0
  153. package/dist/_types/contracts/video-generation.d.ts +643 -0
  154. package/dist/_types/contracts/video-review.d.ts +1871 -0
  155. package/dist/_types/contracts/visual-exploration.d.ts +1586 -0
  156. package/dist/_types/contracts/visual-layer-render.d.ts +2777 -0
  157. package/dist/_types/contracts/visual-layer.d.ts +112 -0
  158. package/dist/_types/contracts/visual-sequence.d.ts +121 -0
  159. package/dist/_types/contracts/writer-proposal.d.ts +268 -0
  160. package/dist/_types/sdk/account.d.ts +109 -0
  161. package/dist/_types/sdk/auxiliary-media.d.ts +43 -0
  162. package/dist/_types/sdk/catalog/agent-host-execution.d.ts +1551 -0
  163. package/dist/_types/sdk/catalog/agent-host.d.ts +344 -0
  164. package/dist/_types/sdk/catalog/assembly.d.ts +37634 -0
  165. package/dist/_types/sdk/catalog/audio-caption.d.ts +1374 -0
  166. package/dist/_types/sdk/catalog/canonical-repair.d.ts +4584 -0
  167. package/dist/_types/sdk/catalog/composition-source.d.ts +1556 -0
  168. package/dist/_types/sdk/catalog/composition.d.ts +2815 -0
  169. package/dist/_types/sdk/catalog/core.d.ts +3049 -0
  170. package/dist/_types/sdk/catalog/delivery.d.ts +14169 -0
  171. package/dist/_types/sdk/catalog/discovery.d.ts +75 -0
  172. package/dist/_types/sdk/catalog/editor.d.ts +6540 -0
  173. package/dist/_types/sdk/catalog/generation.d.ts +942 -0
  174. package/dist/_types/sdk/catalog/imported-visual.d.ts +3111 -0
  175. package/dist/_types/sdk/catalog/keyframe-review.d.ts +859 -0
  176. package/dist/_types/sdk/catalog/lifecycle-events.d.ts +329 -0
  177. package/dist/_types/sdk/catalog/mcp.d.ts +245 -0
  178. package/dist/_types/sdk/catalog/media-descriptors.d.ts +139 -0
  179. package/dist/_types/sdk/catalog/media-observation.d.ts +958 -0
  180. package/dist/_types/sdk/catalog/native-tool-authority.d.ts +281 -0
  181. package/dist/_types/sdk/catalog/navigation.d.ts +559 -0
  182. package/dist/_types/sdk/catalog/planning-intelligence.d.ts +2031 -0
  183. package/dist/_types/sdk/catalog/programmatic-exploration.d.ts +9855 -0
  184. package/dist/_types/sdk/catalog/programmatic-review.d.ts +1106 -0
  185. package/dist/_types/sdk/catalog/provider.d.ts +4439 -0
  186. package/dist/_types/sdk/catalog/reference-preview.d.ts +180 -0
  187. package/dist/_types/sdk/catalog/repair-strategy.d.ts +8916 -0
  188. package/dist/_types/sdk/catalog/reviewer.d.ts +23133 -0
  189. package/dist/_types/sdk/catalog/shot-preparation.d.ts +2974 -0
  190. package/dist/_types/sdk/catalog/sound-making-plan.d.ts +1778 -0
  191. package/dist/_types/sdk/catalog/source-sync.d.ts +1313 -0
  192. package/dist/_types/sdk/catalog/spec.d.ts +37 -0
  193. package/dist/_types/sdk/catalog/speech.d.ts +397 -0
  194. package/dist/_types/sdk/catalog/temporal-evidence.d.ts +391 -0
  195. package/dist/_types/sdk/catalog/video-review.d.ts +2149 -0
  196. package/dist/_types/sdk/catalog/visual-exploration.d.ts +10838 -0
  197. package/dist/_types/sdk/client.d.ts +75 -0
  198. package/dist/_types/sdk/desktop-catalogue.d.ts +25 -0
  199. package/dist/_types/sdk/desktop-previews.d.ts +118 -0
  200. package/dist/_types/sdk/desktop-releases.d.ts +75 -0
  201. package/dist/_types/sdk/errors.d.ts +9 -0
  202. package/dist/_types/sdk/evidence-image.d.ts +22 -0
  203. package/dist/_types/sdk/image-media.d.ts +43 -0
  204. package/dist/_types/sdk/index.d.ts +16 -0
  205. package/dist/_types/sdk/local-runtime/device-client.d.ts +77 -0
  206. package/dist/_types/sdk/local-runtime-client.d.ts +932 -0
  207. package/dist/_types/sdk/mcp-client.d.ts +55 -0
  208. package/dist/_types/sdk/mcp-image.d.ts +52 -0
  209. package/dist/_types/sdk/media.d.ts +104 -0
  210. package/dist/_types/sdk/navigation-client.d.ts +141 -0
  211. package/dist/_types/sdk/navigation-facade.d.ts +458 -0
  212. package/dist/_types/sdk/observe.d.ts +51 -0
  213. package/dist/_types/sdk/runtime-authority.d.ts +103 -0
  214. package/dist/_types/sdk/transport/http.d.ts +39 -0
  215. package/dist/account.d.ts +1 -0
  216. package/dist/account.js +1 -0
  217. package/dist/desktop-previews.d.ts +1 -0
  218. package/dist/desktop-previews.js +1 -0
  219. package/dist/desktop-releases.d.ts +1 -0
  220. package/dist/desktop-releases.js +1 -0
  221. package/dist/errors.d.ts +1 -0
  222. package/dist/errors.js +1 -0
  223. package/dist/index.d.ts +2 -0
  224. package/dist/index.js +1 -0
  225. package/dist/local-runtime.d.ts +1 -0
  226. package/dist/local-runtime.js +1 -0
  227. package/dist/native/Bootstrap.ps1 +90 -0
  228. package/dist/native/JobNative.cs +127 -0
  229. package/dist/native/JobRunner.cs +360 -0
  230. package/dist/native/NativeMain.cs +146 -0
  231. package/dist/native/PipeBridge.cs +260 -0
  232. package/dist/native/PrivateAccess.cs +152 -0
  233. package/dist/runtime-authority.d.ts +1 -0
  234. package/dist/runtime-authority.js +1 -0
  235. package/package.json +50 -3
@@ -0,0 +1,14 @@
1
+ {
2
+ "protocol": "NVS_PRODUCT_COMPATIBILITY_V1",
3
+ "product": "@nativestudio/sdk",
4
+ "version": "0.3.0-rc.1",
5
+ "source": {
6
+ "head": "5de1fe58abdd64d067a177bc2df274c2aded863c",
7
+ "fileDigest": "9f7d91f329c3d7d3dcd9723623c15c6c080d4593c00d7865adc806647f151e5d",
8
+ "dirty": false,
9
+ "remoteMainHead": "5de1fe58abdd64d067a177bc2df274c2aded863c"
10
+ },
11
+ "node": ">=24.12 <25",
12
+ "discoveryProfile": "contextual-v1",
13
+ "accountProtocol": "NVS_CLI_ACCOUNT_V1"
14
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 NativeStudio contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,75 @@
1
- # Temporary Holding Version
1
+ # NativeStudio SDK
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A typed Node.js24 client of NativeStudio public HTTP/MCP interfaces. Install only
4
+ `@nativestudio/sdk`; required first-party JavaScript and declarations are included.
5
+ No private package overrides or separately installed contracts/platform packages are
6
+ required. Preview releases use the `next` channel; pin the exact verified version on
7
+ the NativeStudio download page. Local qualification uses its inspected tarball. TypeScript projects use their normal Node24
8
+ types/compiler development environment.
9
+
10
+ Use a currently patched Node24 release. The engine floor is API compatibility,
11
+ not a recommendation to run an old security patch.
12
+
13
+ ## Navigation before execution
14
+
15
+ ```ts
16
+ import { NativeStudioAgentClient } from "@nativestudio/sdk";
17
+ const studio = new NativeStudioAgentClient({
18
+ baseUrl: "https://studio.example.com",
19
+ tenantId: selectedTenantId,
20
+ authorization: (signal) => credentials.authorization(signal),
21
+ });
22
+ const groups = await studio.navigation.groups();
23
+ const matches = await studio.navigation.search({ query: "找参考素材", group: "materials" });
24
+ ```
25
+
26
+ Use the exact advertised input schema and returned native nextActions. `find`,
27
+ `overview`, `next` and `resume` are read/navigation helpers. They do not admit writes
28
+ or choose creative intent. `NativeStudioMcpClient` borrows an authenticated MCP
29
+ session whose host owns connection, consent and shutdown. Remote availability and
30
+ Tenant/Project authorization remain server-owned.
31
+
32
+ ## Supported surface
33
+
34
+ The root exports HTTP/MCP clients, `NativeStudioNavigationClient` and navigation
35
+ facade, typed native operation catalogue/mappings, bounded media types/helpers,
36
+ `queryPages`, `waitForOperation`, safe errors/options and selected navigation schemas.
37
+ The full contracts module and private SDK helpers are not public package exports.
38
+ `NativeStudioSdkError` is also available through `/errors` with the same class identity.
39
+
40
+ Explicit extensions:
41
+
42
+ - `/account`: experimental first-party account handoff, identity and workspace/Project reads. Account tokens are never MCP tokens.
43
+ - `/local-runtime`: Node-only authenticated local socket/device client and selected protocol DTOs. It never opens SQLite or installs/starts a daemon.
44
+ - `/desktop-releases`: experimental bounded signed stable release metadata helpers.
45
+ - `/desktop-previews`: separate signed Developer Preview metadata; no native auto-install authority.
46
+ - `/runtime-authority`: explicit native Runtime authority HTTP client; server authorization is still mandatory.
47
+
48
+ Root/cloud imports perform no filesystem/SQLite initialization, daemon startup,
49
+ collection, executable download or network work. Internal relative declaration
50
+ modules support the reviewed exports; deep imports into them are unsupported.
51
+
52
+ ## Native truth, errors and compatibility
53
+
54
+ Provide current native Tenant scope, target identity, revision and explicit request
55
+ idempotency where required. Query pagination is bounded. Media reads require native
56
+ identity/checksum and enforce byte budgets. HTTP rejects redirects, credential URLs
57
+ and public plaintext endpoints; development loopback HTTP is explicit.
58
+
59
+ There is no automatic retry of a write. `UNKNOWN` means its outcome needs native
60
+ read-only reconciliation; a timeout does not cancel a Job or justify replay. Safe
61
+ SDK errors omit raw bodies/credentials. An Operation receipt does not prove finished
62
+ media or independent Review acceptance.
63
+
64
+ `COMPATIBILITY.json` records the discovery/account protocols and exact source/version.
65
+ Experimental extensions may change before1.0 and require matching advertised server
66
+ capabilities. New interfaces require an appropriate SDK/server combination; a server
67
+ Git SHA does not impose automatic client upgrades. Stable root breaking changes
68
+ require a documented pre-1.0 minor or later major transition; additive/fix changes do
69
+ not silently change native authority. Retire old fields only with migration guidance.
70
+
71
+ First-party code uses MIT; installed JavaScript/declarations are intentionally
72
+ readable. Source maps, embedded sources, private paths, credentials, state databases
73
+ and build/test metadata are excluded from product artifacts. A clean advisory scan
74
+ covers currently known issues in exact installed/bundled dependencies, not a promise
75
+ that unknown vulnerabilities cannot exist.
@@ -0,0 +1 @@
1
+ {"protocol":"NVS_BUNDLED_DEPENDENCIES_V1","dependencies":[]}
@@ -0,0 +1 @@
1
+ import{CreatedProjectResultSchema,ProductionSchema,ProductionStateSchema,SourceLibraryMediaSchema,StudioInputContentSchema}from"./chunk-7YCEMDNZ.js";import{AcceptBriefRequestSchema,AcceptSceneShotPlanRequestSchema,AcceptStoryRequestSchema,AcceptedVisualSourceReferenceSchema,AgentHostBindingSchema,AgentHostScopeSchema,AgentHostSelectionSchema,AudioSnapshotSchema,AuthorCaptionsSchema,BoundaryRequirementSchema,BriefContentSchema,BuildTimelineSchema,BuildTimelineShapeSchema,CaptionContentSchema,CaptionSnapshotSchema,ClipTransitionSchema,CompositionFindingLocalitySchema,ConstraintSetSchema,ContentFingerprintSchema,DirectorBasisSchema,DirectorContextResultSchema,DirectorScopeSchema,ExactEvidenceReferenceSchema,FinalRenderProfileIdSchema,FinalRenderProfileSchema,GenerationContractIdSchema,GenerationCostQuoteSchema,KeyframeGenerationViewSchema,KeyframeMediaSchema,KeyframeObservationSchema,KeyframeProviderProfileSchema,KeyframeReviewScopeSchema,KeyframeReviewSummarySchema,KeyframeStartInputSchema,KeyframeSummarySchema,NativeRuntimeProofRequestSchema,NativeRuntimePublicKeySchema,NativeToolGrantViewSchema,PreparationBasisSchema,PreparationBlockerSchema,PreparationIdSchema,PreparationTargetSchema,ProgrammaticVideoReviewTargetSchema,ProviderSelectionSchema,ReferenceBindingInputSchema,ReferenceRoleSchema,ReferenceSetSchema,ReviewEvidenceKeySchema,ReviewIntelligenceContextResultSchema,ReviewIntelligenceValidationResultSchema,RoughCutAdmissionSchema,RoughCutArtifactSchema,RoughCutFindingViewSchema,RoughCutGetSchema,RoughCutManifestSchema,RoughCutQuerySchema,RoughCutReviewRecordSchema,RoughCutReviewTargetSchema,RoughCutSnapshotSchema,RoughCutTechnicalSchema,RoughCutV2ManifestSchema,RoughCutViewSchema,SceneShotPlanVersionSchema,ShotIntentSchema,ShotPlanEntrySchema,StoryContentSchema,StoryVersionSchema,TimelineAudioInputSchema,TimelineBasisSchema,TimelineGraphicInputSchema,TimelineManifestReaderSchema,TimelineScopeSchema,TimelineSnapshotSchema,TimelineViewSchema,TimelineVisualLayerInputSchema,ValidateReviewIntelligenceSchema,VideoGenerationViewSchema,VideoObservationSchema,VideoProviderProfileSchema,VideoReviewRequirementSchema,VideoReviewScopeSchema,VideoStartInputSchema,VideoSummarySchema,VisualFrameSequenceSchema,VisualLayerFinalManifestSchema,VisualLayerFinalProfileSchema,VisualRequirementSchema}from"./chunk-4IOFVNFG.js";import{ArtifactIdSchema,ArtifactRelationIdSchema,ArtifactRepresentationIdSchema,ContinuationSchema,DeliveryOutputProfileSchema,InterfaceSemanticStatusSchema,NextActionSchema,OperationIdSchema,PrincipalIdSchema,ProductionIdSchema,ProjectIdSchema,QueryLimitSchema,QueryPageInfoSchema,SceneShotPlanVersionIdSchema,ShotIdSchema,TenantIdSchema,WorkSummarySchema,finalProfileIds}from"./chunk-4M3AGNTZ.js";import{NativeStudioSdkError,sdkInputError}from"./chunk-6NVIN2NI.js";import{z}from"zod";var OperationTargetSchema=z.object({type:z.string().min(1).max(120),id:z.string().min(1).max(2048),version:z.int().positive().nullable()});var OperationSummarySchema=z.object({id:OperationIdSchema,productionId:ProductionIdSchema,semanticStatus:InterfaceSemanticStatusSchema,targets:z.array(OperationTargetSchema).max(100),work:WorkSummarySchema,blockers:z.array(z.string().min(1).max(1e3)).max(100),nextActions:z.array(NextActionSchema).max(50),startedAt:z.iso.datetime({offset:true}),updatedAt:z.iso.datetime({offset:true})});import{z as z8}from"zod";import{z as z7}from"zod";import{z as z3}from"zod";import{z as z2}from"zod";var sha=z2.string().regex(/^[0-9a-f]{64}$/);var DeliveryPolicySchema=z2.strictObject({schemaVersion:z2.literal(1),requiredAudio:z2.boolean(),requiredCaptions:z2.boolean(),requiredGraphics:z2.boolean(),finalApproval:z2.enum(["AUTOMATIC","HUMAN"])});var DeliveryPolicyInputSchema=DeliveryPolicySchema.extend({requiredAudio:z2.boolean().default(false),requiredCaptions:z2.boolean().default(false),requiredGraphics:z2.boolean().default(false),finalApproval:z2.enum(["AUTOMATIC","HUMAN"]).default("AUTOMATIC")});var DeliveryCompositionSchema=z2.strictObject({hasAudio:z2.boolean(),hasCaptions:z2.boolean(),hasGraphics:z2.boolean()});var DeliveryTargetSchema=z2.strictObject({tenantId:z2.uuid(),projectId:z2.uuid(),productionId:z2.uuid(),renderId:z2.uuid(),timelineVersionId:z2.uuid(),timelineFingerprint:sha,selectionId:z2.uuid(),selectionVersion:z2.int().positive(),renderManifestFingerprint:sha,artifactId:z2.uuid(),representationId:z2.uuid(),checksumSha256:sha,byteSize:z2.int().positive().max(128*1024*1024),executionClass:z2.enum(["LIVE","TEST_ONLY"])});var DeliveryCheckKeySchema=z2.enum(["FILE_READABLE","CHECKSUM","CONTAINER_PROFILE","DURATION","VIDEO_DECODE","AUDIO_DECODE","REQUIRED_AUDIO","REQUIRED_CAPTIONS","REQUIRED_GRAPHICS","MISSING_MEDIA","BLACK_FRAMES","ARTIFACT_REGISTRATION","PROVENANCE","MANIFEST_INTEGRITY","EXACT_BASIS","BLOCKING_FINDINGS"]);var DeliveryCheckSchema=z2.strictObject({key:DeliveryCheckKeySchema,status:z2.enum(["PASS","FAIL","UNVERIFIED","NOT_APPLICABLE"]),detail:z2.string().trim().min(1).max(1e3)});var DeliveryValidationReviewSchema=z2.strictObject({id:z2.uuid(),target:DeliveryTargetSchema,policy:DeliveryPolicySchema,policyFingerprint:sha,composition:DeliveryCompositionSchema,checks:z2.array(DeliveryCheckSchema).length(DeliveryCheckKeySchema.options.length),result:z2.enum(["PASS","FAIL"]),blockingChecks:z2.array(DeliveryCheckKeySchema).max(DeliveryCheckKeySchema.options.length),createdAt:z2.iso.datetime({offset:true})}).superRefine((review,ctx)=>{const seen=new Set;const blocked=new Set;const{policy,composition}=review;for(const check of review.checks){if(seen.has(check.key))ctx.addIssue({code:"custom",message:"Duplicate deterministic delivery check"});seen.add(check.key);const mayOmit=check.key==="AUDIO_DECODE"&&!composition.hasAudio||check.key==="REQUIRED_AUDIO"&&!policy.requiredAudio||check.key==="REQUIRED_CAPTIONS"&&!policy.requiredCaptions||check.key==="REQUIRED_GRAPHICS"&&!policy.requiredGraphics;if(check.status==="NOT_APPLICABLE"&&!mayOmit)ctx.addIssue({code:"custom",message:"Required delivery evidence cannot be omitted"});if(check.status==="FAIL"||check.status==="UNVERIFIED")blocked.add(check.key)}if(policy.requiredAudio&&!composition.hasAudio)blocked.add("REQUIRED_AUDIO");if(policy.requiredCaptions&&!composition.hasCaptions)blocked.add("REQUIRED_CAPTIONS");if(policy.requiredGraphics&&!composition.hasGraphics)blocked.add("REQUIRED_GRAPHICS");const expected=DeliveryCheckKeySchema.options.filter(key10=>blocked.has(key10));if(review.result!==(expected.length?"FAIL":"PASS")||JSON.stringify(review.blockingChecks)!==JSON.stringify(expected))ctx.addIssue({code:"custom",message:"Review result and blockers must match complete owned evidence"})});var sha2=z3.string().regex(/^[0-9a-f]{64}$/);function sameTarget(a,b){return Object.keys(DeliveryTargetSchema.shape).every(key10=>a[key10]===b[key10])}var DeliveryApprovalSchema=z3.strictObject({id:z3.uuid(),reviewId:z3.uuid(),target:DeliveryTargetSchema,policyFingerprint:sha2,authority:z3.literal("HUMAN"),action:z3.enum(["APPROVE","REJECT"]),principalId:z3.uuid(),createdAt:z3.iso.datetime({offset:true})});var DeliveryManifestLinkSchema=z3.strictObject({id:z3.uuid(),checksumSha256:sha2,target:DeliveryTargetSchema,policyFingerprint:sha2,reviewId:z3.uuid()});var FinalDeliveryReceiptSchema=z3.strictObject({id:z3.uuid(),deliveryRole:z3.literal("FINAL_ARTIFACT"),review:DeliveryValidationReviewSchema,manifest:DeliveryManifestLinkSchema,approval:DeliveryApprovalSchema.nullable(),productionRevision:z3.int().positive(),completedAt:z3.iso.datetime({offset:true})}).superRefine((receipt,ctx)=>{const{review,manifest,approval}=receipt;if(review.result!=="PASS"||!sameTarget(manifest.target,review.target)||manifest.reviewId!==review.id||manifest.policyFingerprint!==review.policyFingerprint)ctx.addIssue({code:"custom",message:"Final delivery requires an exact PASS Review and Manifest"});if(review.policy.finalApproval==="HUMAN"){if(!approval||approval.action!=="APPROVE"||approval.reviewId!==review.id||approval.policyFingerprint!==review.policyFingerprint||!sameTarget(approval.target,review.target))ctx.addIssue({code:"custom",message:"Configured Human gate requires exact Human approval"})}else if(approval){ctx.addIssue({code:"custom",message:"Automatic delivery does not carry an unconfigured approval"})}});import{z as z6}from"zod";import{z as z5}from"zod";import{z as z4}from"zod";var sha3=z4.string().regex(/^[0-9a-f]{64}$/);var DecideFinalReadySchema=TimelineScopeSchema.extend({renderId:z4.uuid(),reviewId:z4.uuid(),basisFingerprint:sha3,action:z4.enum(["SELECT","REJECT"]),acknowledgeWarnings:z4.boolean().default(false),expectedProductionRevision:z4.int().positive(),expectedFinalReadyVersion:z4.int().nonnegative(),reason:z4.string().trim().min(1).max(2500),idempotencyKey:z4.string().trim().min(1).max(200)});var RevokeFinalReadySchema=TimelineScopeSchema.extend({selectionId:z4.uuid(),expectedFinalReadyVersion:z4.int().positive(),expectedProductionRevision:z4.int().positive(),reason:z4.string().trim().min(1).max(2500),idempotencyKey:z4.string().trim().min(1).max(200)});var FinalReadyDecisionSchema=TimelineScopeSchema.extend({id:z4.uuid(),projectId:ProjectIdSchema,version:z4.int().positive(),action:z4.enum(["SELECT","REJECT","REVOKE"]),renderId:z4.uuid(),reviewId:z4.uuid(),basisFingerprint:sha3,timelineVersionId:z4.uuid(),timelineFingerprint:sha3,artifactId:z4.uuid(),representationId:z4.uuid(),checksumSha256:sha3,outputProfile:DeliveryOutputProfileSchema,executionClass:z4.enum(["LIVE","TEST_ONLY"]),previousSelectionId:z4.uuid().nullable(),acknowledgeWarnings:z4.boolean(),warningKeys:z4.array(z4.string()).max(300),reason:z4.string().min(1).max(2500),createdByPrincipalId:PrincipalIdSchema,createdAt:z4.iso.datetime({offset:true})});var FinalReadyViewSchema=TimelineScopeSchema.extend({version:z4.int().nonnegative(),status:z4.enum(["NONE","CURRENT","STALE"]),selection:FinalReadyDecisionSchema.nullable(),staleReasons:z4.array(z4.string()).max(24)});var FinalReadyQuerySchema=TimelineScopeSchema.extend({limit:QueryLimitSchema,next:ContinuationSchema.optional()});var FinalReadyPageSchema=z4.strictObject({items:z4.array(FinalReadyDecisionSchema),page:QueryPageInfoSchema});var FinalReadyReceiptSchema=z4.strictObject({semanticStatus:z4.literal("SUCCESS"),decision:FinalReadyDecisionSchema,productionRevision:z4.int().positive()});var RoughCutReviewSnapshotSchema=z4.strictObject({currentRenderId:z4.uuid().nullable(),latestReviewId:z4.uuid().nullable(),reviewVersion:z4.int().nonnegative(),result:z4.enum(["PASS","WARNING","FAIL"]).nullable(),current:z4.boolean(),inspectable:z4.boolean(),executionClass:z4.enum(["LIVE","TEST_ONLY"]).nullable(),findings:z4.strictObject({open:z4.int().nonnegative(),blocking:z4.int().nonnegative(),warnings:z4.int().nonnegative()}),finalReady:FinalReadyViewSchema,latestDecision:FinalReadyDecisionSchema.nullable()});var sha4=z5.string().regex(/^[0-9a-f]{64}$/);function hasTimelineAudio(timeline){return!!timeline.audio||!!timeline.sourceSound&&(timeline.sourceSound.clips.some(c=>!!c.source)||timeline.sourceSound.speechCues.length>0)}var FinalRenderStartSchema=TimelineScopeSchema.extend({selectionId:z5.uuid(),expectedFinalReadyVersion:z5.int().positive(),timelineVersionId:z5.uuid(),timelineFingerprint:sha4,expectedProductionRevision:z5.int().positive(),profileId:FinalRenderProfileIdSchema,audioPolicy:z5.enum(["SILENT","MIXED"]),captionPolicy:z5.enum(["NONE","BURN_IN"]),idempotencyKey:z5.string().trim().min(1).max(200)});var FinalRenderGetSchema=RoughCutGetSchema;var FinalRenderQuerySchema=RoughCutQuerySchema;var finalManifestShape={selection:FinalReadyDecisionSchema.refine(v=>v.action==="SELECT"),selectionVersion:z5.int().positive(),profile:FinalRenderProfileSchema};var finalV1=RoughCutManifestSchema.extend(finalManifestShape);var finalV2=RoughCutV2ManifestSchema.extend(finalManifestShape);var finalV3=VisualLayerFinalManifestSchema.safeExtend({...finalManifestShape,profile:VisualLayerFinalProfileSchema});function validateFinalManifest(manifest,context){const{selection:selected,timeline,profile}=manifest;const expectedProfile=finalProfileIds[timeline.output.profile];const landscape=timeline.output.aspectRatio==="16:9";if(!!profile.picturePolicy!==timeline.clips.some(c=>!!c.framing)||profile.audioPolicy!==(hasTimelineAudio(timeline)?"MIXED":"SILENT")||!!profile.audioMix!==hasTimelineAudio(timeline)||profile.captionPolicy!==(timeline.caption?"BURN_IN":"NONE")||!!profile.captionStyle!==!!timeline.caption||!!profile.graphicsPolicy!==!!timeline.graphics?.length||selected.tenantId!==timeline.tenantId||selected.projectId!==timeline.projectId||selected.productionId!==timeline.productionId||selected.timelineVersionId!==timeline.id||selected.timelineFingerprint!==timeline.fingerprint||selected.version>manifest.selectionVersion||selected.outputProfile!==timeline.output.profile||selected.executionClass!==timeline.executionClass||profile.id!==expectedProfile||profile.width>profile.height!==landscape)context.addIssue({code:"custom",message:"Final selection, Timeline and profile mismatch"})}var FinalRenderManifestSchema=finalV1.superRefine(validateFinalManifest);var FinalRenderV2ManifestSchema=finalV2.superRefine(validateFinalManifest);var FinalRenderV3ManifestSchema=finalV3.superRefine(validateFinalManifest);var FinalRenderManifestReaderSchema=z5.discriminatedUnion("schemaVersion",[FinalRenderManifestSchema,FinalRenderV2ManifestSchema,FinalRenderV3ManifestSchema]);var FinalRenderTechnicalSchema=RoughCutTechnicalSchema;var FinalRenderArtifactSchema=RoughCutArtifactSchema.safeExtend({reviewState:z5.literal("UNREVIEWED"),deliveryRole:z5.literal("NONE")});var FinalRenderAdmissionSchema=RoughCutAdmissionSchema.extend({selectionId:z5.uuid(),selectionVersion:z5.int().positive(),profileId:FinalRenderProfileIdSchema});var FinalRenderViewSchema=RoughCutViewSchema.omit({roughCut:true,manifest:true,staleReasons:true}).extend({manifest:FinalRenderManifestReaderSchema,finalOutput:FinalRenderArtifactSchema.nullable(),finalDelivery:FinalDeliveryReceiptSchema.nullable().default(null),staleReasons:z5.array(z5.string().min(1).max(120)).max(24)});var FinalRenderPageSchema=z5.strictObject({items:z5.array(FinalRenderViewSchema).max(200),page:QueryPageInfoSchema});var FinalRenderSourceBlockerSchema=z5.strictObject({code:z5.enum(["SOURCE_RESOLUTION_INSUFFICIENT","SOURCE_MEDIA_UNSUPPORTED"]),shotId:z5.uuid(),ordinal:z5.int().positive().max(200),actualWidth:z5.int().positive().max(4096),actualHeight:z5.int().positive().max(4096),requiredWidth:z5.int().positive().max(4096),requiredHeight:z5.int().positive().max(4096)});var FinalRenderEligibilitySchema=TimelineScopeSchema.extend({productionRevision:z5.int().positive(),finalReady:FinalReadyViewSchema,profile:z5.union([FinalRenderProfileSchema,VisualLayerFinalProfileSchema]).nullable(),renderable:z5.boolean(),blockers:z5.array(z5.string().min(1).max(120)).max(24),sourceBlockers:z5.array(FinalRenderSourceBlockerSchema).max(200),supportedAudioPolicy:z5.enum(["SILENT","MIXED"]),supportedCaptionPolicy:z5.enum(["NONE","BURN_IN"])});var FinalRenderSnapshotSchema=z5.strictObject({latestRenderId:z5.uuid().nullable(),runtimeStatus:RoughCutViewSchema.shape.runtimeStatus.nullable(),currentRenderId:z5.uuid().nullable(),currentArtifactId:z5.uuid().nullable(),stale:z5.boolean(),eligibility:FinalRenderEligibilitySchema});var sha5=z6.string().regex(/^[0-9a-f]{64}$/);var DeliveryManifestBasisSchema=z6.strictObject({schemaVersion:z6.literal(1),evaluatorVersion:z6.literal("DELIVERY_V1"),target:DeliveryTargetSchema,policyVersionId:z6.uuid(),policyVersion:z6.int().positive(),policy:DeliveryPolicySchema,policyFingerprint:sha5,finalRenderRuntimeJobId:z6.uuid(),finalRenderManifest:FinalRenderManifestReaderSchema,finalRenderTechnical:FinalRenderTechnicalSchema,roughCutReview:RoughCutReviewRecordSchema,artifacts:z6.array(z6.strictObject({artifactId:z6.uuid(),family:z6.string().min(1).max(100),origin:z6.string().min(1).max(100),checksumSha256:sha5})).min(1).max(2e3),relations:z6.array(z6.strictObject({id:z6.uuid(),sourceArtifactId:z6.uuid(),targetArtifactId:z6.uuid(),relationType:z6.string().min(1).max(100)})).max(4e3)}).superRefine((basis,ctx)=>{const t=basis.target,m=basis.finalRenderManifest;if(t.selectionId!==m.selection.id||t.selectionVersion!==m.selectionVersion||t.timelineVersionId!==m.timeline.id||t.timelineFingerprint!==m.timeline.fingerprint||t.tenantId!==m.timeline.tenantId||t.projectId!==m.timeline.projectId||t.productionId!==m.timeline.productionId||t.executionClass!==m.timeline.executionClass||t.checksumSha256!==basis.finalRenderTechnical.checksumSha256||t.byteSize!==basis.finalRenderTechnical.byteSize||basis.finalRenderTechnical.hasAudio!==m.profile.hasAudio||basis.roughCutReview.id!==m.selection.reviewId||basis.roughCutReview.basisFingerprint!==m.selection.basisFingerprint||!basis.artifacts.some(a=>a.artifactId===t.artifactId&&a.checksumSha256===t.checksumSha256)||new Set(basis.artifacts.map(a=>a.artifactId)).size!==basis.artifacts.length||new Set(basis.relations.map(r=>r.id)).size!==basis.relations.length||basis.relations.some(r=>!basis.artifacts.some(a=>a.artifactId===r.sourceArtifactId)||!basis.artifacts.some(a=>a.artifactId===r.targetArtifactId)))ctx.addIssue({code:"custom",message:"Manifest must identify exact render, Review-2 and provenance"})});var ProductionDeliveryManifestSchema=DeliveryManifestBasisSchema.safeExtend({reviewId:z6.uuid(),productionRevision:z6.int().positive(),completedAt:z6.iso.datetime({offset:true})});var DeliveryManifestGetSchema=TimelineScopeSchema.extend({manifestId:z6.uuid()});var RegisteredDeliveryManifestSchema=z6.strictObject({link:DeliveryManifestLinkSchema,body:ProductionDeliveryManifestSchema}).refine(v=>v.link.reviewId===v.body.reviewId&&v.link.policyFingerprint===v.body.policyFingerprint&&Object.keys(DeliveryTargetSchema.shape).every(key10=>v.link.target[key10]===v.body.target[key10]),"Manifest registration must match exact body");var sha6=z7.string().regex(/^[0-9a-f]{64}$/);var mutation=TimelineScopeSchema.extend({expectedProductionRevision:z7.int().positive(),idempotencyKey:z7.string().trim().min(1).max(200)});var ConfigureDeliveryPolicySchema=mutation.extend({expectedPolicyVersion:z7.int().nonnegative(),policy:DeliveryPolicyInputSchema});var DeliveryPolicyVersionSchema=TimelineScopeSchema.extend({id:z7.uuid(),projectId:z7.uuid(),version:z7.int().positive(),policy:DeliveryPolicySchema,policyFingerprint:sha6,createdByPrincipalId:z7.uuid(),createdAt:z7.iso.datetime({offset:true})});var DeliveryPolicyReceiptSchema=z7.strictObject({policy:DeliveryPolicyVersionSchema,productionRevision:z7.int().positive()});var StartDeliveryValidationSchema=mutation.extend({target:DeliveryTargetSchema,expectedPolicyVersion:z7.int().nonnegative()}).refine(v=>v.target.tenantId===v.tenantId&&v.target.productionId===v.productionId,"Exact delivery target must match command scope");var DeliveryValidationGetSchema=TimelineScopeSchema.extend({validationId:z7.uuid()});var DecideDeliveryApprovalSchema=mutation.extend({validationId:z7.uuid(),reviewId:z7.uuid(),target:DeliveryTargetSchema,policyFingerprint:sha6,action:z7.enum(["APPROVE","REJECT"])}).refine(v=>v.target.tenantId===v.tenantId&&v.target.productionId===v.productionId,"Exact approval target must match command scope");var DeliveryAdmissionSchema=z7.strictObject({semanticStatus:z7.literal("ACCEPTED"),validationId:z7.uuid(),runtimeJobId:z7.uuid(),operationId:z7.string().min(1),target:DeliveryTargetSchema,policyVersionId:z7.uuid(),policyVersion:z7.int().positive(),policyFingerprint:sha6,manifestBasisFingerprint:sha6,evaluatorVersion:z7.literal("DELIVERY_V1"),productionRevision:z7.int().positive()});var DeliveryFindingSchema=z7.strictObject({id:z7.uuid(),reviewId:z7.uuid(),target:DeliveryTargetSchema,key:DeliveryCheckKeySchema,detail:z7.string().trim().min(1).max(1e3),blocking:z7.literal(true),createdAt:z7.iso.datetime({offset:true})});var DeliveryCompletionBlockerSchema=z7.enum(["VALIDATION_FAILED","EXACT_OUTPUT_CHANGED","DELIVERY_POLICY_CHANGED","FINAL_READY_STALE","ARTIFACT_UNAVAILABLE","PROVENANCE_INCOMPLETE","MANIFEST_NOT_REGISTERED","MANIFEST_BINDING_MISMATCH","BLOCKING_FINDINGS","TEST_EVIDENCE_DISABLED","APPROVAL_BINDING_MISMATCH","APPROVAL_REJECTED"]);var DeliveryReviewReceiptSchema=z7.strictObject({review:DeliveryValidationReviewSchema,action:z7.enum(["COMPLETE","WAITING_HUMAN","BLOCK"]),blockers:z7.array(DeliveryCompletionBlockerSchema).max(12),productionRevision:z7.int().positive()});var DeliveryDecisionReceiptSchema=z7.strictObject({approval:DeliveryApprovalSchema,finalDelivery:FinalDeliveryReceiptSchema.nullable(),productionRevision:z7.int().positive(),condition:z7.enum(["RUNNABLE","BLOCKED"])});var DeliveryValidationViewSchema=z7.strictObject({admission:DeliveryAdmissionSchema,policy:DeliveryPolicyVersionSchema,manifestBasis:DeliveryManifestBasisSchema,runtimeStatus:z7.enum(["PENDING","READY","RUNNING","WAITING","SUCCEEDED","FAILED","CANCELLED","SUPERSEDED"]),current:z7.boolean(),reviewReceipt:DeliveryReviewReceiptSchema.nullable(),findings:z7.array(DeliveryFindingSchema).max(16),approval:DeliveryApprovalSchema.nullable(),finalDelivery:FinalDeliveryReceiptSchema.nullable()});var DeliverySnapshotSchema=TimelineScopeSchema.extend({productionRevision:z7.int().positive(),policy:DeliveryPolicyVersionSchema.nullable(),currentValidationId:z7.uuid().nullable(),finalDelivery:FinalDeliveryReceiptSchema.nullable()});var DeliverySummarySchema=z8.strictObject({policy:DeliveryPolicyVersionSchema.nullable(),validation:z8.strictObject({id:z8.uuid(),runtimeStatus:DeliveryValidationViewSchema.shape.runtimeStatus,current:z8.boolean(),reviewId:z8.uuid().nullable(),result:z8.enum(["PASS","FAIL"]).nullable(),action:z8.enum(["COMPLETE","WAITING_HUMAN","BLOCK"]).nullable(),blockingChecks:z8.array(DeliveryCheckKeySchema).max(16),approvalAction:z8.enum(["APPROVE","REJECT"]).nullable()}).nullable(),finalDelivery:FinalDeliveryReceiptSchema.nullable()});import{z as z12}from"zod";import{z as z11}from"zod";import{z as z10}from"zod";import{z as z9}from"zod";var ShotSoundContentSchema=z9.strictObject({model:z9.strictObject({modelProfileId:z9.string().regex(/^[a-z][a-z0-9-]{1,79}$/),modelProfileVersion:z9.int().positive(),connectionId:z9.uuid()}).optional(),nativeAudio:z9.boolean(),cues:z9.array(z9.strictObject({id:z9.string().regex(/^[a-z][a-z0-9_-]{0,63}$/),role:z9.enum(["DIALOGUE","MUSIC","AMBIENCE","SOUND_EFFECT","NARRATION"]),startMs:z9.int().nonnegative().max(3e4),endMs:z9.int().positive().max(3e4),text:z9.string().trim().min(1).max(6e3).optional(),exactSpeech:z9.boolean(),lipSync:z9.enum(["REQUIRED","NONE"])}).refine(v=>v.endMs>v.startMs)).max(64)});var ShotSoundInstructionSchema=z9.strictObject({soundPlanVersionId:z9.uuid().toLowerCase(),fingerprint:z9.string().regex(/^[0-9a-f]{64}$/),content:ShotSoundContentSchema});var GenerationContractSchema=z10.strictObject({id:GenerationContractIdSchema,schemaVersion:z10.literal(1),preparationId:PreparationIdSchema,target:PreparationTargetSchema,basis:PreparationBasisSchema,mode:z10.enum(["REFERENCE_TO_IMAGE","REFERENCE_TO_VIDEO","FIRST_FRAME_TO_VIDEO","FIRST_LAST_FRAME_TO_VIDEO"]),creativeInstruction:z10.strictObject({sound:ShotSoundInstructionSchema.optional(),shot:ShotIntentSchema,scenePurpose:z10.string().min(1).max(800),locationContext:z10.string().max(300).optional(),timeContext:z10.string().max(300).optional(),productPresentationGoal:z10.string().min(1).max(1e3),styleTone:z10.string().max(300).optional(),entryBoundary:z10.array(BoundaryRequirementSchema).max(48),exitBoundary:z10.array(BoundaryRequirementSchema).max(48)}),acceptedShotReferences:z10.array(AcceptedVisualSourceReferenceSchema).max(24).default([]),constraintSetFingerprint:ContentFingerprintSchema,referenceSetFingerprint:ContentFingerprintSchema,output:z10.strictObject({aspectRatio:z10.enum(["16:9","9:16"]),targetDurationSeconds:z10.number().min(.5).max(30).nullable(),workingResolution:z10.null(),frameRate:z10.null(),finalDeliveryProfile:DeliveryOutputProfileSchema}),requiredCapabilities:z10.strictObject({referenceConditioning:z10.literal(true),referenceRoles:z10.array(ReferenceRoleSchema).min(1).max(8),startFrameControl:z10.boolean(),endFrameControl:z10.boolean(),nativeAudio:z10.boolean().optional()}),fingerprint:ContentFingerprintSchema}).superRefine((value,context)=>{const invalid=message=>context.addIssue({code:"custom",message});if(value.target.mediaType==="IMAGE"&&value.acceptedShotReferences.length)invalid("Image generation cannot depend on accepted video Shots");if(value.target.mediaType==="IMAGE"&&(value.mode!=="REFERENCE_TO_IMAGE"||value.output.targetDurationSeconds!==null||value.requiredCapabilities.startFrameControl||value.requiredCapabilities.endFrameControl))invalid("Image generation cannot claim video duration or frame-control semantics");if(value.target.mediaType==="VIDEO"&&(value.mode==="REFERENCE_TO_IMAGE"||value.output.targetDurationSeconds===null))invalid("Video generation requires video mode and duration");const roles=value.requiredCapabilities.referenceRoles;if(!roles.some(role=>role==="PRODUCT_IDENTITY"||role==="PRODUCT_PACKSHOT"))invalid("Product identity requires concrete reference conditioning");if(value.requiredCapabilities.startFrameControl&&!roles.includes("START_FRAME_ANCHOR"))invalid("Start-frame control requires an exact anchor role");if(value.requiredCapabilities.endFrameControl&&!roles.includes("END_FRAME_ANCHOR"))invalid("End-frame control requires an exact anchor role");if(value.mode==="FIRST_LAST_FRAME_TO_VIDEO"&&(!value.requiredCapabilities.startFrameControl||!value.requiredCapabilities.endFrameControl))invalid("First/last mode requires both anchor capabilities")});var PrepareShotRequestSchema=z11.strictObject({tenantId:TenantIdSchema,expectedProductionRevision:z11.int().positive(),expectedPlanVersionId:SceneShotPlanVersionIdSchema,expectedPlanVersion:z11.int().positive(),expectedShotPlanningRevision:z11.int().positive(),expectedPreparationVersion:z11.int().nonnegative(),idempotencyKey:z11.string().trim().min(1).max(200),target:PreparationTargetSchema,referenceBindings:z11.array(ReferenceBindingInputSchema).max(12).default([])});var PreparationVersionSchema=z11.strictObject({id:PreparationIdSchema,version:z11.int().positive(),basis:PreparationBasisSchema,target:PreparationTargetSchema,constraints:ConstraintSetSchema,referenceSet:ReferenceSetSchema,canonicalSources:z11.array(ExactEvidenceReferenceSchema).max(64),acceptedShotReferences:z11.array(AcceptedVisualSourceReferenceSchema).max(24).default([]),blockers:z11.array(PreparationBlockerSchema).max(2048),contract:GenerationContractSchema.nullable(),createdByPrincipalId:PrincipalIdSchema,createdAt:z11.iso.datetime({offset:true})}).superRefine((value,context)=>{const invalid=message=>context.addIssue({code:"custom",message});if(value.constraints.preparationId!==value.id||value.referenceSet.preparationId!==value.id||value.constraints.version!==value.version||value.referenceSet.version!==value.version)invalid("Resolved snapshot identity must match preparation");if(value.contract!==null!==(value.blockers.length===0))invalid("A preparation contract exists only for an unblocked preflight");if(value.contract&&(value.contract.preparationId!==value.id||JSON.stringify(value.contract.basis)!==JSON.stringify(value.basis)||JSON.stringify(value.contract.target)!==JSON.stringify(value.target)||value.contract.constraintSetFingerprint!==value.constraints.fingerprint||value.contract.referenceSetFingerprint!==value.referenceSet.fingerprint||JSON.stringify(value.contract.acceptedShotReferences)!==JSON.stringify(value.acceptedShotReferences)))invalid("Generation Contract must freeze the exact preparation basis and snapshots")});var PrepareShotResultSchema=z11.strictObject({semanticStatus:z11.literal("SUCCESS"),preparation:PreparationVersionSchema,productionRevision:z11.int().positive()});var PreparationViewSchema=z11.strictObject({preparation:PreparationVersionSchema,freshness:z11.enum(["CURRENT_BASIS","STALE_BASIS"]),superseded:z11.boolean(),freshnessReasons:z11.array(z11.enum(["PLAN_CHANGED","SHOT_CHANGED","REFERENCE_UNAVAILABLE","CONSISTENCY_PROFILE_CHANGED","SOUND_PLAN_CHANGED","SUPERSEDED","KEYFRAME_SELECTION_CHANGED","PREDECESSOR_ACCEPTANCE_CHANGED"])).max(8),execution:z11.strictObject({eligibleVideoSelections:z11.array(ProviderSelectionSchema).max(1600).optional(),available:z11.boolean(),reasons:z11.array(z11.enum(["STALE_BASIS","PREPARATION_BLOCKED","PRODUCTION_NOT_RUNNABLE","PROVIDER_CAPABILITY_UNAVAILABLE","VIDEO_SELECTION_REQUIRED"])).min(0).max(4)})});var PreparationQueryInputSchema=z11.strictObject({tenantId:TenantIdSchema,productionId:ProductionIdSchema,shotId:ShotIdSchema.optional(),mediaType:z11.enum(["IMAGE","VIDEO"]).optional(),limit:QueryLimitSchema,next:ContinuationSchema.optional()});var PreparationQueryPageSchema=z11.strictObject({items:z11.array(PreparationViewSchema),page:QueryPageInfoSchema});var PreparationGetInputSchema=z11.strictObject({tenantId:TenantIdSchema,productionId:ProductionIdSchema,preparationId:PreparationIdSchema});var PreparationActiveInputSchema=z11.strictObject({tenantId:TenantIdSchema,productionId:ProductionIdSchema,shotId:ShotIdSchema,mediaType:z11.enum(["IMAGE","VIDEO"])});var PreparationSummarySchema=z11.strictObject({latest:z11.int().nonnegative(),current:z11.int().nonnegative(),stale:z11.int().nonnegative(),contractValid:z11.int().nonnegative(),preflightBlocked:z11.int().nonnegative(),executionAvailable:z11.int().nonnegative()});var NullableVersionSchema=z12.int().positive().nullable();var ProductionBlockerSchema=z12.object({code:z12.string().min(1).max(120),summary:z12.string().min(1).max(1e3),targetType:z12.string().min(1).max(80),targetId:z12.string().min(1).max(2048)});var ProductionSnapshotSchema=z12.object({tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,state:ProductionStateSchema,planning:z12.object({activeBriefVersion:NullableVersionSchema,activeStoryVersion:NullableVersionSchema,activeSceneShotPlanVersion:NullableVersionSchema}),preparation:PreparationSummarySchema.optional(),keyframes:KeyframeSummarySchema.optional(),keyframeReview:KeyframeReviewSummarySchema.optional(),videos:VideoSummarySchema.optional(),captions:CaptionSnapshotSchema.optional(),audio:AudioSnapshotSchema.optional(),shots:z12.object({planned:z12.int().nonnegative(),ready:z12.int().nonnegative(),generating:z12.int().nonnegative(),candidates:z12.int().nonnegative(),accepted:z12.int().nonnegative(),blocked:z12.int().nonnegative(),stale:z12.int().nonnegative()}),findings:z12.object({open:z12.int().nonnegative(),blocking:z12.int().nonnegative(),warnings:z12.int().nonnegative()}),timeline:z12.object({currentVersion:NullableVersionSchema,stale:z12.boolean(),...TimelineSnapshotSchema.omit({currentVersion:true,stale:true}).partial().shape}),roughCut:RoughCutSnapshotSchema.partial().required({latestVersion:true,reviewState:true}),review2:RoughCutReviewSnapshotSchema.optional(),final:z12.object({ready:FinalReadyViewSchema.optional(),render:FinalRenderSnapshotSchema.optional(),renderState:z12.string().min(1).max(120).nullable(),delivery:DeliverySummarySchema.optional(),deliveryValidationState:z12.string().min(1).max(120).nullable()}),work:WorkSummarySchema,activeOperations:z12.array(OperationSummarySchema).max(20),blockers:z12.array(ProductionBlockerSchema).max(100),latestDecisions:z12.array(z12.string().min(1).max(1e3)).max(50),nextActions:z12.array(NextActionSchema).max(50),generatedAt:z12.iso.datetime({offset:true})});import{z as z13}from"zod";var ProductionQueryInputSchema=z13.object({tenantId:TenantIdSchema,projectId:ProjectIdSchema.optional(),search:z13.string().trim().min(1).max(200).optional(),attention:z13.enum(["NEEDS_YOU","WORKING","FINISHED"]).optional(),limit:QueryLimitSchema,next:ContinuationSchema.optional()});var ProductionQueryPageSchema=z13.object({items:z13.array(ProductionSchema),page:QueryPageInfoSchema});var OperationQueryInputSchema=z13.object({tenantId:TenantIdSchema,productionId:ProductionIdSchema,limit:QueryLimitSchema,next:ContinuationSchema.optional()});var OperationQueryPageSchema=z13.object({items:z13.array(OperationSummarySchema),page:QueryPageInfoSchema});var StoryQueryInputSchema=z13.object({tenantId:TenantIdSchema,productionId:ProductionIdSchema,limit:QueryLimitSchema,next:ContinuationSchema.optional()});var StoryQueryPageSchema=z13.object({items:z13.array(StoryVersionSchema),page:QueryPageInfoSchema});var SceneShotPlanQueryInputSchema=z13.object({tenantId:TenantIdSchema,productionId:ProductionIdSchema,limit:QueryLimitSchema,next:ContinuationSchema.optional()});var SceneShotPlanQueryPageSchema=z13.object({items:z13.array(SceneShotPlanVersionSchema),page:QueryPageInfoSchema});import{z as z14}from"zod";var InterfaceCancellationDataSchema=z14.strictObject({cancellationAccepted:z14.boolean()});var InterfaceCancellationReceiptSchema=InterfaceCancellationDataSchema.extend({semanticStatus:z14.literal("SUCCESS")});import{z as z20}from"zod";import{z as z19}from"zod";import{z as z15}from"zod";var AgentExecutionContractDigest="834d35515b14007b7900b09bb8e2988169fe6400c77109dba0f793a628c32c90";var key=z15.string().regex(/^[A-Za-z0-9_-]{1,160}$/);var AgentHostGenericInstallationTransportSchema=z15.strictObject({protocol:z15.literal("AGENT_STACK_GENERIC_INSTALLATION_V3"),installationId:key,installationRevisionId:key,slotKey:z15.string().regex(/^[a-z0-9_-]{1,64}$/),contractDigest:z15.literal(AgentExecutionContractDigest),capabilityDigest:z15.string().regex(/^[a-f0-9]{64}$/)});import{z as z16}from"zod";var id=z16.uuid();var sha7=z16.string().regex(/^[0-9a-f]{64}$/);var AgentHostExecutionScopeSchema=z16.strictObject({tenantId:id,projectId:id,productionId:id});var StartAgentHostExecutionSchema=AgentHostExecutionScopeSchema.extend({requestId:id,studioInputArtifactId:id,bindingId:id,expectedProductionRevision:z16.int().positive(),expectedBindingRevision:z16.int().positive(),expectedConfigurationVersion:z16.int().positive()});var AgentHostExecutionGetSchema=AgentHostExecutionScopeSchema.extend({executionId:id});var AgentHostExecutionQuerySchema=AgentHostExecutionScopeSchema.extend({limit:z16.int().min(1).max(100).default(20),beforeId:id.optional()});var AgentHostExecutionSourceSchema=z16.strictObject({artifactId:id,representationId:id,checksumSha256:sha7,byteSize:z16.int().positive().max(8388608),contentType:z16.string().min(1).max(100),kind:z16.enum(["PRODUCT_INFORMATION","REFERENCE_IMAGE","REFERENCE_VIDEO"])});var AgentHostExecutionInputSchema=AgentHostExecutionScopeSchema.extend({protocol:z16.literal("NATIVESTUDIO_PRODUCTION_V1"),executionId:id,hostRequestId:id,productionRevision:z16.int().positive(),studioInput:StudioInputContentSchema,intake:AgentHostExecutionSourceSchema,sources:z16.array(AgentHostExecutionSourceSchema).max(12)}).refine(v=>v.studioInput.productionId===v.productionId&&v.studioInput.sourceArtifactIds.length===v.sources.length&&new Set(v.sources.map(s=>s.artifactId)).size===v.sources.length&&v.sources.every((s,index)=>s.artifactId===v.studioInput.sourceArtifactIds[index])&&!v.sources.some(s=>s.artifactId===v.intake.artifactId));var NativeInstallationTransportSchema=z16.strictObject({protocol:z16.literal("AGENT_STACK_NATIVE_INSTALLATION_V2"),installationId:z16.string().regex(/^[A-Za-z0-9_-]{1,160}$/),installationRevisionId:z16.string().regex(/^[A-Za-z0-9_-]{1,160}$/),slotKey:z16.string().regex(/^[a-z0-9_-]{1,64}$/)});var AgentHostInstallationTransportSchema=z16.discriminatedUnion("protocol",[NativeInstallationTransportSchema,AgentHostGenericInstallationTransportSchema]);var AgentHostNativeToolAuthoritySchema=AgentHostExecutionScopeSchema.extend({protocol:z16.literal("NATIVESTUDIO_AGENT_TOOLS_V1"),authorityRef:id,executionId:id,hostRequestId:id,bindingId:id,configurationVersion:z16.int().positive(),inputFingerprint:sha7,capabilityDigest:sha7,expiresAt:z16.iso.datetime({offset:true}),executionClass:z16.enum(["LIVE","TEST_ONLY"]),transport:AgentHostInstallationTransportSchema.optional()});var AgentHostExecutionSnapshotSchema=z16.strictObject({binding:AgentHostBindingSchema,input:AgentHostExecutionInputSchema,authority:AgentHostNativeToolAuthoritySchema}).refine(v=>v.binding.tenantId===v.input.tenantId&&v.binding.projectId===v.input.projectId&&v.binding.enabled&&v.authority.tenantId===v.input.tenantId&&v.authority.projectId===v.input.projectId&&v.authority.productionId===v.input.productionId&&v.authority.executionId===v.input.executionId&&v.authority.hostRequestId===v.input.hostRequestId&&v.authority.bindingId===v.binding.bindingId&&v.authority.configurationVersion===v.binding.configurationVersion);var AgentHostTaskObservationSchema=z16.strictObject({requestId:id,runKey:z16.string().regex(/^[A-Za-z0-9_-]{1,160}$/),status:z16.enum(["accepted","running","succeeded","failed","cancelled","unknown"]),agentKey:z16.string().min(1).max(64),agentVersion:z16.int().positive(),modelOptionKey:z16.string().min(1).max(64),cancelRequested:z16.boolean(),createdAt:z16.iso.datetime({offset:true}),updatedAt:z16.iso.datetime({offset:true}),timing:z16.strictObject({acceptedAt:z16.iso.datetime({offset:true}),deadlineAt:z16.iso.datetime({offset:true}),limitSource:z16.literal("TASK_POLICY")}).nullable()});var AgentHostDispatchPhaseSchema=z16.enum(["ADMITTED","SENDING","OUTCOME_UNKNOWN","OBSERVING","REJECTED","CANCELLED_BEFORE_SUBMISSION"]);var AgentHostExecutionViewSchema=AgentHostExecutionScopeSchema.extend({executionId:id,requestId:id,requestedByPrincipalId:id,hostRequestId:id,revision:z16.int().positive(),snapshotFingerprint:sha7,snapshot:AgentHostExecutionSnapshotSchema,dispatchPhase:AgentHostDispatchPhaseSchema,active:z16.boolean(),observation:AgentHostTaskObservationSchema.nullable(),cancelRequestId:id.nullable(),errorCode:z16.string().regex(/^[A-Z_]{1,80}$/).nullable(),createdAt:z16.iso.datetime({offset:true}),updatedAt:z16.iso.datetime({offset:true})}).refine(v=>v.snapshot.input.executionId===v.executionId&&v.snapshot.input.hostRequestId===v.hostRequestId&&v.snapshot.input.tenantId===v.tenantId&&v.snapshot.input.projectId===v.projectId&&v.snapshot.input.productionId===v.productionId&&(!v.observation||v.observation.requestId===v.hostRequestId&&v.observation.agentKey===v.snapshot.binding.selection.agentKey&&v.observation.agentVersion===v.snapshot.binding.selection.agentVersion&&v.observation.modelOptionKey===v.snapshot.binding.selection.modelOptionKey));var AgentHostExecutionPageSchema=z16.strictObject({items:z16.array(AgentHostExecutionViewSchema).max(100),hasMore:z16.boolean(),nextBeforeId:id.nullable()}).refine(v=>v.hasMore===(v.nextBeforeId!==null)&&(!v.hasMore||v.nextBeforeId===v.items.at(-1)?.executionId)&&new Set(v.items.map(item=>item.executionId)).size===v.items.length);var AgentHostExecutionEventSchema=z16.strictObject({id,executionId:id,revision:z16.int().positive(),action:z16.enum(["ADMIT","CLAIM","RECOVER_UNKNOWN","OBSERVE","REJECT","CANCEL_REQUEST","CANCEL_UNSENT"]),createdByPrincipalId:id,observation:AgentHostTaskObservationSchema.nullable(),errorCode:z16.string().regex(/^[A-Z_]{1,80}$/).nullable(),createdAt:z16.iso.datetime({offset:true})});var AgentHostExecutionEventQuerySchema=AgentHostExecutionGetSchema.extend({limit:z16.int().min(1).max(100).default(20),beforeRevision:z16.int().positive().optional()});var AgentHostExecutionEventPageSchema=z16.strictObject({items:z16.array(AgentHostExecutionEventSchema).max(100),hasMore:z16.boolean(),nextBeforeRevision:z16.int().positive().nullable()}).refine(v=>v.hasMore===(v.nextBeforeRevision!==null)&&(!v.hasMore||v.nextBeforeRevision===v.items.at(-1)?.revision)&&v.items.every((item,index)=>!index||item.revision<v.items[index-1].revision));var AgentHostExecutionFailureSchema=z16.strictObject({semanticStatus:z16.enum(["INVALID_INPUT","NOT_FOUND","BLOCKED","REVISION_CONFLICT","CAPABILITY_UNAVAILABLE","INTERNAL_OPERATIONAL_FAILURE"]),error:z16.strictObject({code:z16.enum(["INVALID_INPUT","UNAUTHENTICATED","FORBIDDEN","NOT_FOUND","REVISION_CONFLICT","REQUEST_CONFLICT","SOURCE_UNAVAILABLE","TOOL_AUTHORITY_UNAVAILABLE","ACTIVE_EXECUTION_EXISTS","LEASE_LOST","BINDING_UNAVAILABLE","INTERNAL_OPERATIONAL_FAILURE"]),message:z16.literal("Agent Host execution did not complete")})});import{z as z17}from"zod";var id2=z17.uuid().regex(/^[0-9a-f-]{36}$/);var key2=z17.string().regex(/^[A-Za-z0-9_-]{1,160}$/);var digest=z17.string().regex(/^[a-f0-9]{64}$/);var https=z17.url().max(2048).refine(v=>{const u=new URL(v);return u.protocol==="https:"&&!u.username&&!u.password&&!u.search&&!u.hash});var AgentExecutionLimitsSchema=z17.strictObject({grantMaxSeconds:z17.int().positive().max(30*86400),executionMaxSeconds:z17.int().min(10).max(21600),leaseMaxSeconds:z17.int().positive(),renewWindowSeconds:z17.int().positive(),renewBeforeSeconds:z17.int().positive(),assertionSeconds:z17.literal(60),clockSkewSeconds:z17.literal(5)}).refine(v=>v.renewBeforeSeconds<=v.renewWindowSeconds&&v.renewWindowSeconds<v.leaseMaxSeconds&&v.leaseMaxSeconds<=v.executionMaxSeconds);var AgentExecutionCapabilitiesSchema=z17.strictObject({protocol:z17.literal("delegated-mcp-execution"),protocolVersion:z17.literal(1),contractDigest:z17.literal(AgentExecutionContractDigest),issuer:https.refine(v=>new URL(v).origin===v),resource:https,endpoints:z17.strictObject({capabilities:https,authorize:https,token:https,identity:https,bind:https,bindingQuery:https,access:https,accessQuery:https,leaseRenew:https,leaseQuery:https,close:https}),supportedProfiles:z17.tuple([z17.literal("stateless-json-v1")]),limits:AgentExecutionLimitsSchema}).refine(v=>new URL(v.resource).origin===v.issuer&&Object.values(v.endpoints).every(e=>new URL(e).origin===v.issuer));var AgentExecutionDescriptorSchema=z17.strictObject({schemaVersion:z17.literal(1),runtimeKey:key2,installationId:key2,displayName:z17.string().min(1).max(160),redirectUri:https,publicJwk:NativeRuntimePublicKeySchema});var AgentExecutionProfileSchema=z17.strictObject({schemaVersion:z17.literal(1),profileKey:key2,revision:z17.int().positive(),capabilities:AgentExecutionCapabilitiesSchema,capabilityDigest:digest,nativeToolCapabilityDigest:digest,redirectOrigins:z17.array(https.refine(v=>new URL(v).origin===v)).min(1).max(16),scopes:z17.array(z17.string().regex(/^[A-Za-z0-9:_-]{1,128}$/)).min(1).max(32),bootstrap:z17.strictObject({slotKey:z17.string().regex(/^[a-z0-9][a-z0-9_-]{0,63}$/),entryTool:z17.string().regex(/^[A-Za-z0-9_.-]{1,128}$/),argumentsMode:z17.literal("task-input")})});var AgentExecutionRegistrationSchema=AgentExecutionDescriptorSchema.extend({clientId:key2,registrationRevision:z17.int().positive(),issuer:https,resource:https,keyId:z17.string().regex(/^[A-Za-z0-9_-]{43}$/),protocol:z17.literal("delegated-mcp-execution"),protocolVersion:z17.literal(1),contractDigest:z17.literal(AgentExecutionContractDigest),capabilityDigest:digest});var ApproveAgentExecutionRegistrationSchema=AgentHostScopeSchema.extend({requestId:id2,bindingId:id2,expectedBindingRevision:z17.int().positive(),expectedConfigurationVersion:z17.int().positive(),profileKey:key2,expectedProfileRevision:z17.int().positive(),descriptor:AgentExecutionDescriptorSchema});var AgentExecutionRegistrationGetSchema=AgentHostScopeSchema.extend({clientId:id2});var RevokeAgentExecutionRegistrationSchema=AgentExecutionRegistrationGetSchema.extend({requestId:id2,expectedRevision:z17.int().positive()});var AgentExecutionRegistrationViewSchema=AgentExecutionRegistrationGetSchema.extend({schemaVersion:z17.literal(1),revision:z17.int().positive(),enabled:z17.boolean(),bindingId:id2,bindingRevision:z17.int().positive(),configurationVersion:z17.int().positive(),profile:AgentExecutionProfileSchema,registration:AgentExecutionRegistrationSchema,approvedByPrincipalId:id2,createdAt:z17.iso.datetime(),revokedAt:z17.iso.datetime().nullable()}).refine(v=>v.clientId===v.registration.clientId&&v.enabled===(v.revokedAt===null)&&v.registration.capabilityDigest===v.profile.capabilityDigest&&v.registration.resource===v.profile.capabilities.resource&&v.registration.issuer===v.profile.capabilities.issuer);import{z as z18}from"zod";var id3=z18.uuid();var opaque=z18.string().min(1).max(4096);var digest2=z18.string().regex(/^[a-f0-9]{64}$/);var AgentExecutionConsentSchema=z18.strictObject({response_type:z18.literal("code"),client_id:id3,redirect_uri:z18.url().max(2048),resource:z18.url().max(2048),scope:z18.string().min(1).max(4096),state:z18.string().min(1).max(512),code_challenge:z18.string().regex(/^[A-Za-z0-9_-]{43}$/),code_challenge_method:z18.literal("S256")});var ApproveAgentExecutionConsentSchema=AgentHostScopeSchema.extend({profileKey:z18.string().regex(/^[A-Za-z0-9_-]{1,160}$/),requestId:id3,consent:AgentExecutionConsentSchema,expiresInSeconds:z18.int().min(60).max(30*86400)});var AgentExecutionGrantSchema=z18.strictObject({protocolVersion:z18.literal(1),clientId:id3,registrationRevision:z18.int().positive(),resource:z18.url().max(2048),grantRef:id3,grantRevision:z18.int().positive(),expiresAt:z18.iso.datetime(),scopes:z18.array(z18.string().min(1).max(128)).min(1).max(32)});var AgentExecutionTokenFormSchema=z18.discriminatedUnion("grant_type",[z18.strictObject({grant_type:z18.literal("authorization_code"),client_id:id3,resource:z18.url().max(2048),registration_revision:z18.string().regex(/^[1-9][0-9]{0,14}$/),code:opaque,code_verifier:z18.string().regex(/^[A-Za-z0-9._~-]{43,128}$/),redirect_uri:z18.url().max(2048),client_assertion_type:z18.literal("urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),client_assertion:opaque}),z18.strictObject({grant_type:z18.literal("refresh_token"),client_id:id3,resource:z18.url().max(2048),registration_revision:z18.string().regex(/^[1-9][0-9]{0,14}$/),refresh_token:opaque,client_assertion_type:z18.literal("urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),client_assertion:opaque})]);var AgentExecutionAssertionSchema=z18.strictObject({iss:id3,sub:id3,aud:z18.url().max(2048),iat:z18.int().nonnegative(),exp:z18.int().positive(),jti:id3,requestDigest:digest2}).refine(v=>v.exp===v.iat+60);var id4=z19.uuid();var key3=z19.string().regex(/^[A-Za-z0-9_-]{1,160}$/);var digest3=z19.string().regex(/^[a-f0-9]{64}$/);var time=z19.iso.datetime();var AgentExecutionIdentitySchema=z19.strictObject({authorityRef:key3,executionId:key3,installationId:key3,installationRevisionId:key3,invocationId:id4,inputDigest:digest3});var AgentExecutionLeaseSchema=z19.strictObject({protocolVersion:z19.literal(1),bindingId:key3,executionId:key3,leaseRevision:z19.int().positive(),expiresAt:time,hardExpiresAt:time,renewedAt:time,renewBeforeSeconds:z19.int().positive()});var AgentExecutionBindingReceiptSchema=AgentExecutionIdentitySchema.extend({protocolVersion:z19.literal(1),bindingId:key3,grantRef:key3,grantRevision:z19.int().positive(),hardExpiresAt:time,boundAt:time,lease:AgentExecutionLeaseSchema});var AgentExecutionAccessMetadataSchema=z19.strictObject({protocolVersion:z19.literal(1),bindingId:key3,executionId:key3,accessGeneration:z19.int().positive(),expiresAt:time});var AgentExecutionPayloadSchemas={identity:z19.strictObject({}),bind:AgentExecutionIdentitySchema.extend({deadlineAt:time}),bindingQuery:z19.strictObject({authorityRef:key3,executionId:key3,originalRequestId:id4}),access:z19.strictObject({bindingId:key3,executionId:key3,expectedAccessGeneration:z19.int().nonnegative()}),accessQuery:z19.strictObject({bindingId:key3,executionId:key3,originalRequestId:id4}),leaseRenew:z19.strictObject({bindingId:key3,executionId:key3,expectedLeaseRevision:z19.int().positive()}),leaseQuery:z19.strictObject({bindingId:key3,executionId:key3,originalRequestId:id4}),close:z19.strictObject({bindingId:key3,executionId:key3,reason:z19.enum(["FINISHED","CANCELLED","ABORTED"])})};var envelope=z19.strictObject({protocolVersion:z19.literal(1),contractDigest:z19.literal(AgentExecutionContractDigest),capabilityDigest:digest3,requestId:id4,clientId:id4,registrationRevision:z19.int().positive(),resource:z19.url().max(2048),grantRef:id4,grantRevision:z19.int().positive(),payload:z19.unknown(),clientAssertion:z19.string().min(1).max(4096)});var AgentExecutionRequestSchemas={identity:envelope.extend({payload:AgentExecutionPayloadSchemas.identity}),bind:envelope.extend({payload:AgentExecutionPayloadSchemas.bind}),bindingQuery:envelope.extend({payload:AgentExecutionPayloadSchemas.bindingQuery}),access:envelope.extend({payload:AgentExecutionPayloadSchemas.access}),accessQuery:envelope.extend({payload:AgentExecutionPayloadSchemas.accessQuery}),leaseRenew:envelope.extend({payload:AgentExecutionPayloadSchemas.leaseRenew}),leaseQuery:envelope.extend({payload:AgentExecutionPayloadSchemas.leaseQuery}),close:envelope.extend({payload:AgentExecutionPayloadSchemas.close})};var AgentExecutionQualificationSchema=z19.strictObject({protocol:z19.literal("NVS_GENERIC_EXECUTION_QUALIFICATION_V1"),transport:AgentHostGenericInstallationTransportSchema,selection:AgentHostSelectionSchema,checkedAt:time,executionClass:z19.enum(["LIVE","TEST_ONLY"])});var AgentExecutionPermitSchema=z19.strictObject({schemaVersion:z19.literal(1),proof:AgentHostNativeToolAuthoritySchema,input:AgentHostExecutionInputSchema,inputDigest:digest3,guidance:z19.strictObject({version:z19.string().min(1).max(100),instructions:z19.string().min(1).max(2e4)}),registration:AgentExecutionRegistrationViewSchema,grant:AgentExecutionGrantSchema,qualification:AgentExecutionQualificationSchema,requestedByPrincipalId:id4,createdAt:time}).refine(v=>v.proof.transport?.protocol==="AGENT_STACK_GENERIC_INSTALLATION_V3"&&v.proof.tenantId===v.registration.tenantId&&v.proof.projectId===v.registration.projectId&&v.proof.productionId===v.input.productionId&&v.proof.executionId===v.input.executionId&&v.proof.hostRequestId===v.input.hostRequestId&&v.proof.bindingId===v.registration.bindingId&&v.proof.configurationVersion===v.registration.configurationVersion&&v.proof.capabilityDigest===v.registration.profile.nativeToolCapabilityDigest&&v.proof.transport.capabilityDigest===v.registration.profile.capabilityDigest&&v.grant.clientId===v.registration.clientId&&v.grant.resource===v.registration.registration.resource&&v.grant.registrationRevision===v.registration.registration.registrationRevision&&v.qualification.transport.installationId===v.proof.transport.installationId&&v.qualification.transport.installationRevisionId===v.proof.transport.installationRevisionId&&v.qualification.transport.capabilityDigest===v.proof.transport.capabilityDigest&&v.qualification.transport.slotKey===v.proof.transport.slotKey&&Date.parse(v.proof.expiresAt)<=Date.parse(v.grant.expiresAt)&&v.input.tenantId===v.proof.tenantId&&v.input.projectId===v.proof.projectId&&v.registration.enabled&&v.proof.transport.installationId===v.registration.registration.installationId&&v.proof.transport.slotKey===v.registration.profile.bootstrap.slotKey&&v.proof.executionClass===v.qualification.executionClass);var AgentExecutionBindingSchema=z19.strictObject({protocol:z19.literal("delegated-mcp-execution"),protocolVersion:z19.literal(1),contractDigest:z19.literal(AgentExecutionContractDigest),capabilityDigest:digest3,issuer:z19.url(),resource:z19.url(),slotKey:z19.string().regex(/^[a-z0-9][a-z0-9_-]{0,63}$/),registration:AgentExecutionRegistrationViewSchema.shape.registration,grant:AgentExecutionGrantSchema,endpoints:AgentExecutionRegistrationViewSchema.shape.profile.shape.capabilities.shape.endpoints,limits:AgentExecutionRegistrationViewSchema.shape.profile.shape.capabilities.shape.limits,bootstrap:AgentExecutionRegistrationViewSchema.shape.profile.shape.bootstrap,transportPolicy:z19.strictObject({profile:z19.literal("stateless-json-v1")}),runtimePolicy:z19.strictObject({sandbox:z19.literal("read-only"),webSearch:z19.literal("disabled"),localExecution:z19.literal("disabled"),toolExposure:z19.literal("direct"),maxTurns:z19.literal(1)})});var AgentExecutionInstallationObservationSchema=z19.strictObject({schemaVersion:z19.literal(3),installationId:key3,installationRevisionId:key3,slotKey:z19.string().regex(/^[a-z0-9][a-z0-9_-]{0,63}$/),binding:AgentExecutionBindingSchema,identity:AgentExecutionGrantSchema.extend({decision:z19.enum(["ALLOW","DRAIN","DENY","UNKNOWN"]),observedAt:time}),checkedAt:time});var AgentExecutionBootstrapInputSchema=z19.strictObject({nativeStudio:AgentHostExecutionInputSchema.safeExtend({nativeToolAuthority:AgentHostNativeToolAuthoritySchema})});var task=AgentExecutionBootstrapInputSchema.shape.nativeStudio;var AgentExecutionBootstrapResultSchema=z20.strictObject({schemaVersion:z20.literal(1),protocol:z20.literal("NVS_EXECUTION_CONTEXT_V1"),executionId:task.shape.executionId,hostRequestId:task.shape.hostRequestId,inputDigest:z20.string().regex(/^[a-f0-9]{64}$/),task,guidance:AgentExecutionPermitSchema.shape.guidance,outputContract:z20.strictObject({version:z20.literal("NVS_HOST_REPORT_V1"),authoritative:z20.literal(false),instructions:z20.string().min(1).max(2e4)})});import{z as z23}from"zod";import{z as z22}from"zod";import{z as z21}from"zod";var ArtifactLifecycleSchema=z21.enum(["CREATING","PROCESSING","READY","INVALID","ARCHIVED"]);var ArtifactMetadataSchema=z21.object({id:ArtifactIdSchema,tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema.nullable(),family:z21.string().trim().min(1),origin:z21.string().trim().min(1),lifecycle:ArtifactLifecycleSchema,createdByPrincipalId:PrincipalIdSchema,checksumSha256:z21.string().regex(/^[0-9a-f]{64}$/).nullable(),contentType:z21.string().trim().min(1).nullable(),primaryRepresentationId:ArtifactRepresentationIdSchema.nullable(),mediaMetadata:z21.record(z21.string(),z21.unknown()),createdAt:z21.iso.datetime({offset:true}),readyAt:z21.iso.datetime({offset:true}).nullable()});var ArtifactRepresentationSchema=z21.object({id:ArtifactRepresentationIdSchema,tenantId:TenantIdSchema,artifactId:ArtifactIdSchema,role:z21.string().trim().min(1),storageDriver:z21.string().trim().min(1),storageLocator:z21.record(z21.string(),z21.unknown()),checksumSha256:z21.string().regex(/^[0-9a-f]{64}$/),contentType:z21.string().trim().min(1),byteSize:z21.string().regex(/^\d+$/),width:z21.int().positive().nullable(),height:z21.int().positive().nullable(),durationMs:z21.string().regex(/^\d+$/).nullable(),frameRate:z21.string().nullable(),videoCodec:z21.string().nullable(),audioCodec:z21.string().nullable(),hasAudio:z21.boolean().nullable(),sampleRateHz:z21.int().positive().nullable(),audioChannels:z21.int().positive().nullable(),createdAt:z21.iso.datetime({offset:true})});var ArtifactRelationSchema=z21.object({id:ArtifactRelationIdSchema,tenantId:TenantIdSchema,sourceArtifactId:ArtifactIdSchema,targetArtifactId:ArtifactIdSchema,relationType:z21.string().trim().min(1),createdByPrincipalId:PrincipalIdSchema,createdAt:z21.iso.datetime({offset:true})});var RegisterReadyArtifactInputSchema=z21.object({tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema.nullable(),principalId:PrincipalIdSchema,family:z21.string().trim().min(1),origin:z21.string().trim().min(1),representation:z21.object({role:z21.string().trim().min(1),storageDriver:z21.string().trim().min(1),storageLocator:z21.record(z21.string(),z21.unknown()),checksumSha256:z21.string().regex(/^[0-9a-f]{64}$/),contentType:z21.string().trim().min(1),byteSize:z21.string().regex(/^\d+$/),width:z21.int().positive().nullable(),height:z21.int().positive().nullable(),durationMs:z21.string().regex(/^\d+$/).nullable(),frameRate:z21.string().nullable(),videoCodec:z21.string().nullable(),audioCodec:z21.string().nullable(),hasAudio:z21.boolean().nullable(),sampleRateHz:z21.int().positive().nullable(),audioChannels:z21.int().positive().nullable()}),mediaMetadata:z21.record(z21.string(),z21.unknown()).default({}),provenance:z21.array(z21.object({targetArtifactId:ArtifactIdSchema,relationType:z21.string().trim().min(1)})).default([])});var ReadyArtifactRegistrationSchema=z21.object({artifact:ArtifactMetadataSchema,primaryRepresentation:ArtifactRepresentationSchema,relations:z21.array(ArtifactRelationSchema)});var SourceInputMetadataSchema=z21.strictObject({idempotencyKey:z21.string().trim().min(1).max(200).optional(),tenantId:TenantIdSchema,kind:z21.enum(["PRODUCT_INFORMATION","REFERENCE_IMAGE","REFERENCE_VIDEO"]),contentType:z21.enum(["text/plain","application/json","image/png","image/jpeg","image/webp","video/mp4"]),originalName:z21.string().trim().min(1).max(255).optional()});var UploadSourceInputRequestSchema=SourceInputMetadataSchema.extend({contentBase64:z21.string().min(4).max(11184812).regex(/^[A-Za-z0-9+/]*={0,2}$/)});var key4=z22.string().trim().min(1).max(200);var ScopedSourceInputSchema=SourceInputMetadataSchema.extend({projectId:ProjectIdSchema,idempotencyKey:key4});var ScopedSourceUploadSchema=UploadSourceInputRequestSchema.extend({projectId:ProjectIdSchema,idempotencyKey:key4});var SourceReadSchema=SourceLibraryMediaSchema.extend({offsetBytes:z22.int().min(0).max(8388608).default(0),maxTextBytes:z22.int().min(4).max(65536).default(16384)});var SourceTextWindowSchema=SourceLibraryMediaSchema.extend({contentType:z22.enum(["text/plain","application/json"]),checksumSha256:z22.string().regex(/^[0-9a-f]{64}$/),totalBytes:z22.int().positive().max(8388608),offsetBytes:z22.int().nonnegative(),byteLength:z22.int().nonnegative().max(65536),nextOffsetBytes:z22.int().nonnegative().nullable(),text:z22.string().max(65536)});var InterfaceImageMetadataSchema=KeyframeMediaSchema.omit({contentBase64:true});var InterfacePosterMetadataSchema=InterfaceImageMetadataSchema.extend({contentType:z23.literal("image/png")});var InterfaceDownloadDescriptorSchema=z23.strictObject({method:z23.literal("GET"),path:z23.string().min(1).max(2048),tenantId:TenantIdSchema,authentication:z23.literal("BEARER_AND_TENANT_HEADER"),contentType:z23.enum(["video/mp4","image/png","application/json"]),checksumSha256:z23.string().regex(/^[0-9a-f]{64}$/),byteSize:z23.int().positive().max(128*1024*1024)});var SourceReadResultSchema=z23.union([SourceTextWindowSchema,SourceLibraryMediaSchema.extend(InterfaceImageMetadataSchema.shape).strict(),SourceLibraryMediaSchema.extend({contentType:z23.literal("video/mp4"),checksumSha256:z23.string().regex(/^[0-9a-f]{64}$/),byteSize:z23.int().positive().max(8388608),importOperation:z23.literal("imported-visual.register-source")}).strict()]);import{z as z24}from"zod";var StartReferencePreviewSchema=z24.strictObject({tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,sourceArtifactId:ArtifactIdSchema,expectedBriefVersion:z24.int().positive(),idempotencyKey:z24.string().regex(/^[A-Za-z0-9_-]{8,80}$/)});var ReferencePreviewAdmissionSchema=z24.strictObject({semanticStatus:z24.literal("ACCEPTED"),operationId:OperationIdSchema,productionId:ProductionIdSchema,sourceArtifactId:ArtifactIdSchema,briefVersion:z24.int().positive()});var ReferencePreviewResultSchema=z24.strictObject({semanticStatus:z24.literal("SUCCESS"),sourceArtifactId:ArtifactIdSchema,representationId:ArtifactRepresentationIdSchema,contentType:z24.literal("image/png"),checksumSha256:z24.string().regex(/^[0-9a-f]{64}$/),width:z24.int().positive(),height:z24.int().positive(),byteSize:z24.int().positive(),contentBase64:z24.string().min(4)});var ReferencePreviewOperationInputSchema=z24.strictObject({tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,operationId:OperationIdSchema});import{z as z25}from"zod";var StudioCapabilitiesInputSchema=z25.strictObject({tenantId:TenantIdSchema,productionId:ProductionIdSchema.optional()});var StudioCapabilitiesSchema=z25.strictObject({semanticStatus:z25.literal("SUCCESS"),capabilities:z25.array(z25.strictObject({capability:z25.string().min(1).max(120),tool:z25.string().min(1).max(120).optional(),availability:z25.enum(["AVAILABLE","UNAVAILABLE"]),reason:z25.string().min(1).max(1e3).nullable()})).max(512)});var VideoOptionsSchema=z25.array(z25.strictObject({selection:ProviderSelectionSchema,profile:VideoProviderProfileSchema})).max(1600);import{z as z26}from"zod";var WorkspaceHealthSchema=z26.object({service:z26.string().min(1),status:z26.literal("ok")});import{z as z27}from"zod";var PrincipalKindSchema=z27.enum(["HUMAN","AGENT","SERVICE","WORKER"]);var PrincipalSchema=z27.object({id:PrincipalIdSchema,kind:PrincipalKindSchema,issuer:z27.string().trim().min(1),subject:z27.string().trim().min(1),displayName:z27.string().trim().min(1).nullable()});var TenantMembershipSchema=z27.object({tenantId:TenantIdSchema,principalId:PrincipalIdSchema});import{z as z28}from"zod";var TenantSchema=z28.object({id:TenantIdSchema,displayName:z28.string().trim().min(1).nullable(),createdAt:z28.iso.datetime({offset:true})});import{z as z29}from"zod";var Key=z29.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);var Intent=z29.string().trim().min(1).max(600);var ExplorationScopeSchema=DirectorScopeSchema.extend({shotId:ShotIdSchema});var ExplorationBasisSchema=DirectorBasisSchema.safeExtend({shotId:ShotIdSchema,shotPlanningRevision:z29.int().positive()});var ExplorationContextInputSchema=z29.strictObject({scope:ExplorationScopeSchema,preparationIds:z29.array(PreparationIdSchema).max(6).default([])}).refine(v=>new Set(v.preparationIds).size===v.preparationIds.length,"Preparation IDs must be distinct");var ExplorationProfileIdentitySchema=KeyframeProviderProfileSchema.pick({id:true,adapterVersion:true,model:true,executionClass:true});var ExplorationOptionSchema=z29.strictObject({selection:ProviderSelectionSchema.nullable(),profile:z29.discriminatedUnion("mediaType",[KeyframeProviderProfileSchema,VideoProviderProfileSchema])});var Missing=z29.strictObject({semanticStatus:z29.literal("NEEDS_INPUT"),missingPrerequisites:z29.array(z29.enum(["ACTIVE_BRIEF","ACTIVE_STORY","ACTIVE_SCENE_SHOT_PLAN"])).min(1).max(3)});var ExplorationContextResultSchema=z29.discriminatedUnion("semanticStatus",[z29.strictObject({semanticStatus:z29.literal("SUCCESS"),advisory:z29.literal(true),basis:ExplorationBasisSchema,owner:DirectorContextResultSchema.options[0],preparations:z29.array(z29.strictObject({view:PreparationViewSchema,eligibleOptions:z29.array(ExplorationOptionSchema).max(24),eligibleOptionCount:z29.int().nonnegative(),optionsTruncated:z29.boolean()})).max(6)}),Missing]);var ImageDraft=KeyframeStartInputSchema.omit({idempotencyKey:true});var VideoDraft=VideoStartInputSchema.omit({idempotencyKey:true});var ExplorationCommandSchema=z29.strictObject({commandKey:Key,purpose:Intent,mediaType:z29.enum(["IMAGE","VIDEO"]),preparationId:PreparationIdSchema,contractId:ImageDraft.shape.contractId,contractFingerprint:ImageDraft.shape.contractFingerprint,selection:ProviderSelectionSchema.nullable(),profile:ExplorationProfileIdentitySchema});var ValidateExplorationPlanSchema=z29.strictObject({basis:ExplorationBasisSchema,plan:z29.strictObject({origin:z29.strictObject({kind:z29.literal("EXTERNAL_AGENT_HOST"),label:z29.string().trim().min(1).max(100)}),objective:Intent,comparisonCriteria:z29.array(Intent).min(1).max(8),unknowns:z29.array(z29.string().trim().min(1).max(300)).max(8),maximumGenerationCommands:z29.int().min(1).max(6),commands:z29.array(ExplorationCommandSchema).min(1).max(6)})}).refine(v=>new TextEncoder().encode(JSON.stringify(v)).byteLength<=1024*1024,"Exploration input exceeds the 1 MiB JSON budget");var ExplorationDraftSchema=z29.discriminatedUnion("mediaType",[z29.strictObject({commandKey:Key,mediaType:z29.literal("IMAGE"),request:ImageDraft}),z29.strictObject({commandKey:Key,mediaType:z29.literal("VIDEO"),request:VideoDraft})]);var ExplorationValidationResultSchema=z29.discriminatedUnion("semanticStatus",[z29.strictObject({semanticStatus:z29.literal("SUCCESS"),advisory:z29.literal(true),basis:ExplorationBasisSchema,plan:ValidateExplorationPlanSchema.shape.plan,generationDrafts:z29.array(ExplorationDraftSchema).min(1).max(6),limitations:z29.array(z29.enum(["ADMISSION_RECHECKS_BASIS_AND_PROVIDER","COMMAND_COUNT_IS_NOT_MONETARY_BUDGET","NO_AUTOMATIC_EXECUTION_OR_ACCEPTANCE","QUALITY_REQUIRES_EXACT_MEDIA_INSPECTION"])).length(4)}),Missing]);var ExplorationCompareInputSchema=z29.strictObject({scope:ExplorationScopeSchema,items:z29.array(z29.strictObject({label:Key,mediaType:z29.enum(["IMAGE","VIDEO"]),generationId:z29.uuid()})).min(2).max(6)});var ExplorationComparisonResultSchema=z29.strictObject({semanticStatus:z29.literal("SUCCESS"),advisory:z29.literal(true),scope:ExplorationScopeSchema,items:z29.array(z29.discriminatedUnion("mediaType",[z29.strictObject({label:Key,mediaType:z29.literal("IMAGE"),generation:KeyframeGenerationViewSchema,handoff:z29.strictObject({mediaRead:KeyframeReviewScopeSchema,reviewTarget:KeyframeReviewScopeSchema}).nullable()}),z29.strictObject({label:Key,mediaType:z29.literal("VIDEO"),generation:VideoGenerationViewSchema,handoff:z29.strictObject({mediaRead:VideoReviewScopeSchema,reviewTarget:VideoReviewScopeSchema}).nullable()})])).min(2).max(6),limitations:z29.tuple([z29.literal("OWNER_STATES_ARE_NOT_VISUAL_SCORES"),z29.literal("REVIEW_AND_ACCEPTANCE_REMAIN_EXPLICIT")])});import{z as z30}from"zod";var sha8=z30.string().regex(/^[0-9a-f]{64}$/);var FinalOutputReviewContextInputSchema=z30.strictObject({scope:DirectorScopeSchema,renderId:z30.uuid()});var FinalOutputReviewBasisSchema=FinalOutputReviewContextInputSchema.extend({contextFingerprint:sha8});var FinalOutputReviewContextResultSchema=z30.strictObject({semanticStatus:z30.literal("SUCCESS"),advisory:z30.literal(true),basis:FinalOutputReviewBasisSchema,ownerContext:DirectorContextResultSchema,deliveryTarget:DeliveryTargetSchema,deliverySnapshot:DeliverySnapshotSchema,validation:DeliveryValidationViewSchema.nullable(),manifest:RegisteredDeliveryManifestSchema.nullable(),limitations:z30.array(z30.enum(["OWNER_REVIEW_3_REMAINS_AUTHORITATIVE","NO_CALLER_SUPPLIED_DELIVERY_CHECKS","NO_IMPLICIT_MEDIA_OR_MODEL_CALL","READS_ARE_NOT_ATOMIC_OR_RESERVED"])).length(4)});import{z as z39}from"zod";import{z as z38}from"zod";import{z as z31}from"zod";var sha9=z31.string().regex(/^[0-9a-f]{64}$/);var name=z31.string().regex(/^[A-Za-z][A-Za-z0-9_.-]{0,63}$/);var CompositionPathSchema=z31.string().max(240).regex(/^[A-Za-z0-9_-][A-Za-z0-9_.-]*(?:\/[A-Za-z0-9_.-]+)*$/).refine(v=>!v.split("/").some(p=>p==="."||p===".."));var CompositionScopeSchema=z31.strictObject({tenantId:z31.uuid(),productionId:z31.uuid()});var CompositionBasisPinSchema=z31.strictObject({briefVersionId:z31.uuid(),storyVersionId:z31.uuid(),planVersionId:z31.uuid(),shotId:z31.uuid().nullable()});var CompositionBindingSchema=z31.strictObject({name,purpose:z31.enum(["SOURCE","DEPENDENCY_MANIFEST","DEPENDENCY_LOCK","DATA","FONT","IMAGE","VIDEO"]),artifactId:z31.uuid(),representationId:z31.uuid(),checksumSha256:sha9,declaredOrigin:z31.enum(["CODE","AI","HUMAN","IMPORTED","UNKNOWN"])});var parameter=z31.discriminatedUnion("type",[z31.strictObject({name,type:z31.literal("STRING"),value:z31.string().max(4e3),maxLength:z31.int().min(0).max(4e3)}).refine(v=>v.value.length<=v.maxLength),z31.strictObject({name,type:z31.literal("NUMBER"),value:z31.number().finite(),minimum:z31.number().finite(),maximum:z31.number().finite()}).refine(v=>v.minimum<=v.value&&v.value<=v.maximum),z31.strictObject({name,type:z31.literal("BOOLEAN"),value:z31.boolean()})]);var CompositionContentSchema=z31.strictObject({schemaVersion:z31.literal(1),provider:z31.literal("HYPERFRAME"),dialect:z31.literal("HYPERFRAME_HTML_GSAP_V1"),role:z31.enum(["PRIMARY_VISUAL","VISUAL_LAYER"]),executionClass:z31.enum(["LIVE","TEST_ONLY"]),intent:z31.string().trim().min(1).max(2e3),viewport:z31.strictObject({width:z31.int().min(1).max(8192),height:z31.int().min(1).max(8192)}),clock:z31.strictObject({numerator:z31.int().positive(),denominator:z31.int().positive(),frameCount:z31.int().positive().max(2147483647)}),entrypoint:CompositionPathSchema,parameterSchemaVersion:z31.literal(1),parameters:z31.array(parameter).max(64),bindings:z31.array(CompositionBindingSchema).min(3).max(64),dependencies:z31.array(z31.strictObject({name:z31.string().regex(/^(?:@[a-z0-9._-]+\/)?[a-z0-9._-]+$/),version:z31.string().regex(/^\d+\.\d+\.\d+(?:-[A-Za-z0-9.-]+)?$/),integrity:z31.string().regex(/^sha(?:256|384|512)-[A-Za-z0-9+/]+={0,2}$/)})).min(1).max(64),randomSeed:z31.int().nonnegative().max(4294967295).nullable()}).superRefine((c,ctx)=>{for(const list of[c.parameters,c.bindings,c.dependencies])if(new Set(list.map(x=>x.name)).size!==list.length)ctx.addIssue({code:"custom",message:"Names must be unique within each input group"});for(const purpose of["SOURCE","DEPENDENCY_MANIFEST","DEPENDENCY_LOCK"])if(c.bindings.filter(x=>x.purpose===purpose).length!==1)ctx.addIssue({code:"custom",path:["bindings"],message:"Exactly one "+purpose+" binding is required"});if(c.bindings.find(x=>x.purpose==="SOURCE")?.declaredOrigin!=="CODE")ctx.addIssue({code:"custom",path:["bindings"],message:"Programmatic source must retain CODE provenance"});for(const p of["@hyperframes/engine","@hyperframes/producer","gsap"])if(!c.dependencies.some(x=>x.name===p))ctx.addIssue({code:"custom",path:["dependencies"],message:"Missing authoring dependency: "+p})});var CompositionSourceBundleSchema=z31.strictObject({schemaVersion:z31.literal(1),entrypoint:CompositionPathSchema,files:z31.array(z31.strictObject({path:CompositionPathSchema,contentType:z31.enum(["text/html","text/css","text/javascript","image/svg+xml","application/json"]),content:z31.string().max(1048576)})).min(1).max(128)}).superRefine((b,ctx)=>{if(new Set(b.files.map(x=>x.path)).size!==b.files.length)ctx.addIssue({code:"custom",message:"Source paths must be unique"});if(!b.files.some(x=>x.path===b.entrypoint&&x.contentType==="text/html"))ctx.addIssue({code:"custom",message:"Entrypoint must resolve to a declared HTML file"})});var SubmitCompositionSchema=CompositionScopeSchema.extend({compositionId:z31.uuid().nullable(),expectedVersion:z31.int().nonnegative(),previousVersionId:z31.uuid().nullable(),expectedProductionRevision:z31.int().positive(),basis:CompositionBasisPinSchema,content:CompositionContentSchema,idempotencyKey:z31.string().trim().min(1).max(200)}).superRefine((i,ctx)=>{if(i.expectedVersion===0!==(i.compositionId===null&&i.previousVersionId===null)||i.expectedVersion>0&&(!i.compositionId||!i.previousVersionId))ctx.addIssue({code:"custom",message:"Create and exact-version revision identities must not be mixed"});if(i.content.role==="PRIMARY_VISUAL"&&!i.basis.shotId)ctx.addIssue({code:"custom",message:"Primary visual must bind a planned Shot"})});var CompositionGetSchema=CompositionScopeSchema.extend({compositionId:z31.uuid(),versionId:z31.uuid().optional()});var CompositionHistorySchema=CompositionScopeSchema.extend({compositionId:z31.uuid(),limit:z31.int().min(1).max(100).default(20),beforeVersion:z31.int().positive().optional()});var CompositionInputFactSchema=CompositionBindingSchema.extend({contentType:z31.string().min(1),byteSize:z31.int().positive().max(67108864),registeredOrigin:z31.string().min(1),executionClass:z31.enum(["LIVE","TEST_ONLY"]).nullable()});var CompositionVersionSchema=CompositionScopeSchema.extend({id:z31.uuid(),compositionId:z31.uuid(),projectId:z31.uuid(),version:z31.int().positive(),previousVersionId:z31.uuid().nullable(),basis:CompositionBasisPinSchema,content:CompositionContentSchema,inputs:z31.array(CompositionInputFactSchema).min(3).max(64),fingerprint:sha9,createdByPrincipalId:z31.uuid(),createdAt:z31.iso.datetime({offset:true})}).refine(v=>v.version===1===(v.previousVersionId===null));var CompositionReceiptSchema=z31.strictObject({semanticStatus:z31.literal("SUCCESS"),version:CompositionVersionSchema,productionRevision:z31.int().positive()});var CompositionViewSchema=z31.strictObject({version:CompositionVersionSchema,isCurrent:z31.boolean(),basisStatus:z31.enum(["CURRENT","STALE"]),inputStatus:z31.enum(["AVAILABLE","UNAVAILABLE"]),byteReadback:z31.literal("NOT_CHECKED")});var CompositionPageSchema=z31.strictObject({items:z31.array(CompositionViewSchema).max(100),hasMore:z31.boolean(),nextBeforeVersion:z31.int().positive().nullable()});var CompositionDependencyManifestSchema=z31.object({dependencies:z31.record(z31.string(),z31.string())});var CompositionDependencyLockSchema=z31.object({lockfileVersion:z31.literal(3),packages:z31.record(z31.string(),z31.object({version:z31.string().optional(),integrity:z31.string().optional(),dependencies:z31.record(z31.string(),z31.string()).optional()}))});import{z as z34}from"zod";import{z as z32}from"zod";var Text=z32.string().trim().min(1).max(600);var Method=z32.enum(["HUMAN","AI","CODE"]);var Key2=z32.string().regex(/^[a-z][a-z0-9_.:-]{0,99}$/);var CompositionAuthoringObligationsSchema=z32.strictObject({schemaVersion:z32.literal(1),basis:CompositionBasisPinSchema,productionRevision:z32.int().positive(),output:BriefContentSchema.pick({targetDurationSeconds:true,aspectRatio:true,outputProfile:true}),objective:BriefContentSchema.shape.objective,productPresentationGoal:BriefContentSchema.shape.productPresentationGoal,audience:BriefContentSchema.shape.audience,styleTone:BriefContentSchema.shape.styleTone,callToAction:BriefContentSchema.shape.callToAction,narrativeIntent:StoryContentSchema.shape.narrativeIntent,canonicalFacts:BriefContentSchema.shape.canonicalFacts,storyBeats:StoryContentSchema.shape.beats,storyFactualClaims:StoryContentSchema.shape.factualClaims,shot:ShotPlanEntrySchema.nullable(),obligationKeys:z32.array(Key2).min(1).max(384).refine(v=>new Set(v).size===v.length,"Obligation keys must be unique"),semantics:z32.literal("ACCEPTED_INTENT_NOT_OBSERVED_MEDIA")}).refine(v=>v.basis.shotId===null===(v.shot===null)&&(!v.shot||v.shot.shotId===v.basis.shotId),"Authoring Shot must match the exact planning basis");var MakingAlternativeSchema=z32.strictObject({alternativeId:z32.string().regex(/^[a-z][a-z0-9_-]{0,39}$/),title:z32.string().trim().min(1).max(120),method:z32.enum(["HUMAN","AI","CODE","HYBRID"]),contributions:z32.array(z32.strictObject({method:Method,role:z32.enum(["PRIMARY_VISUAL","VISUAL_LAYER"]),intent:Text})).min(1).max(6),rationale:Text,tradeoffs:z32.array(Text).max(6),obligationKeys:z32.array(Key2).min(1).max(384)}).superRefine((v,ctx)=>{const methods=new Set(v.contributions.map(c=>c.method));if(v.method==="HYBRID"?methods.size<2:methods.size!==1||!methods.has(v.method))ctx.addIssue({code:"custom",path:["contributions"],message:"Contributions must match the advisory making method"});if(new Set(v.contributions.map(c=>c.method+":"+c.role)).size!==v.contributions.length)ctx.addIssue({code:"custom",path:["contributions"],message:"Method/role contributions must be unique"});if(new Set(v.obligationKeys).size!==v.obligationKeys.length)ctx.addIssue({code:"custom",path:["obligationKeys"],message:"Obligation references must be unique"})});var ValidateCompositionMakingSchema=CompositionScopeSchema.extend({projectId:z32.uuid(),expectedProductionRevision:z32.int().positive(),basis:CompositionBasisPinSchema,proposal:z32.strictObject({origin:z32.strictObject({kind:z32.literal("EXTERNAL_AGENT_HOST"),label:z32.string().trim().min(1).max(100)}),makingIntent:z32.enum(["REAL_WORLD_CAPTURE","GENERATED_SCENE","PROGRAMMATIC_EXPLANATION"]),unknowns:z32.array(z32.string().trim().min(1).max(300)).max(8),alternatives:z32.array(MakingAlternativeSchema).min(1).max(3)})}).superRefine((v,ctx)=>{if(new Set(v.proposal.alternatives.map(a=>a.alternativeId)).size!==v.proposal.alternatives.length)ctx.addIssue({code:"custom",message:"Alternative IDs must be unique"});if(new TextEncoder().encode(JSON.stringify(v)).byteLength>131072)ctx.addIssue({code:"custom",message:"Making proposal exceeds the 128 KiB UTF-8 JSON budget"})});var CompositionMakingValidationSchema=CompositionScopeSchema.extend({semanticStatus:z32.literal("SUCCESS"),advisory:z32.literal(true),projectId:z32.uuid(),authoring:CompositionAuthoringObligationsSchema,proposal:ValidateCompositionMakingSchema.shape.proposal,limitations:z32.tuple([z32.literal("STRATEGY_IS_AGENT_ADVICE_NOT_CANONICAL_SELECTION"),z32.literal("SOURCE_METHOD_IS_NOT_PROVENANCE_OR_PROVIDER_ELIGIBILITY"),z32.literal("AUTHORING_AND_RENDER_RECHECK_CURRENT_BASIS"),z32.literal("INDEPENDENT_REVIEW_AND_DELIVERY_REMAIN_REQUIRED")])}).superRefine((v,ctx)=>{const required=new Set(v.authoring.obligationKeys);if(new Set(v.proposal.alternatives.map(a=>a.alternativeId)).size!==v.proposal.alternatives.length||v.proposal.alternatives.some(a=>a.obligationKeys.length!==required.size||a.obligationKeys.some(k=>!required.has(k))))ctx.addIssue({code:"custom",message:"Making result must retain unique alternatives and exact native obligation coverage"})});import{z as z33}from"zod";var CompositionAuthoringRequirementsSchema=z33.strictObject({videoFrameCache:z33.strictObject({profileId:z33.literal("HYPERFRAME_1080P30_FRAME_CACHE_V2"),media:z33.literal("MANAGED_MP4_H264_CFR30_SDR_YUV420P"),maxVideos:z33.literal(4),maxDimension:z33.literal(1920),maxPixels:z33.literal(2073600),maxSourceSeconds:z33.literal(60),playbackRate:z33.literal(1),loop:z33.literal(false),sourceOffset:z33.literal("ZERO_BASED_FRAME_ALIGNED"),srcPattern:z33.literal("/inputs/{inputName}.mp4"),attributes:z33.tuple([z33.literal("id"),z33.literal("src"),z33.literal("data-start"),z33.literal("data-duration")]),dynamicVideoSupported:z33.literal(false),nativePlaybackAndCanvasSamplingSupported:z33.literal(false)}).optional(),semantics:z33.literal("REQUIREMENTS_NOT_RUNTIME_OR_REVIEW_EVIDENCE"),dependencies:CompositionContentSchema.shape.dependencies,html:z33.strictObject({entrypoint:z33.literal("index.html"),stageSelector:z33.literal("#stage"),timelineRegistry:z33.literal("window.__timelines"),readinessPromise:z33.literal("window.__nativeReady"),gsapScript:z33.literal("/_native/gsap.min.js"),managedInputsScript:z33.literal("/native-inputs.js"),rootAttributes:z33.tuple([z33.literal("data-composition-id"),z33.literal("data-width"),z33.literal("data-height"),z33.literal("data-duration")]),timing:z33.literal("PAUSED_GSAP_TIMELINE_WITH_DURATION_MATCHING_LOCAL_CLOCK")})});var jsonSchema=z33.record(z33.string().max(120),z33.json());var CompositionAuthoringGuideSchema=z33.strictObject({inputTool:z33.literal("composition_put_input"),inputField:z33.literal("contentUtf8"),encoding:z33.literal("UTF8_JSON"),schemas:z33.strictObject({SOURCE:jsonSchema,DEPENDENCY_MANIFEST:jsonSchema,DEPENDENCY_LOCK:jsonSchema}),rendererRequirements:CompositionAuthoringRequirementsSchema.nullable(),dependencyInputs:z33.strictObject({dependencies:CompositionContentSchema.shape.dependencies,manifest:CompositionDependencyManifestSchema,lock:CompositionDependencyLockSchema}).nullable().optional(),validation:z33.literal("NATIVE_OWNER_RECHECKS_BYTES_BASIS_AND_SEMANTIC_REFINEMENTS")}).refine(v=>new TextEncoder().encode(JSON.stringify(v)).byteLength<=65536);var CreateCompositionSchema=SubmitCompositionSchema.safeExtend({compositionId:z34.null(),expectedVersion:z34.literal(0),previousVersionId:z34.null()});var ReviseCompositionSchema=SubmitCompositionSchema.safeExtend({compositionId:z34.uuid(),expectedVersion:z34.int().positive(),previousVersionId:z34.uuid()});var CompositionBriefQuerySchema=CompositionScopeSchema.extend({shotId:z34.uuid().nullable().default(null)});var CompositionAuthoringBriefSchema=CompositionScopeSchema.extend({projectId:z34.uuid(),productionRevision:z34.int().positive(),planningStatus:z34.enum(["READY","MISSING_PLANNING","STALE_PLANNING","INACTIVE"]),basis:CompositionBasisPinSchema.nullable(),briefContent:BriefContentSchema.nullable(),storyContent:StoryContentSchema.nullable(),shot:ShotPlanEntrySchema.nullable(),authoring:CompositionAuthoringObligationsSchema.nullable().optional()});var ValidateCompositionSchema=CompositionScopeSchema.extend({expectedProductionRevision:z34.int().positive(),basis:CompositionBasisPinSchema,content:CompositionContentSchema}).superRefine((v,ctx)=>{if(v.content.role==="PRIMARY_VISUAL"&&!v.basis.shotId)ctx.addIssue({code:"custom",path:["basis","shotId"],message:"Primary visual requires a planned Shot"})});var CompositionValidationReceiptSchema=z34.strictObject({authoringValidation:z34.literal("PASS"),basis:CompositionBasisPinSchema,productionRevision:z34.int().positive(),contentFingerprint:z34.string().regex(/^[0-9a-f]{64}$/),inputCount:z34.int().min(3).max(64),byteReadback:z34.literal("VERIFIED"),rendererValidation:z34.literal("NOT_EXECUTED"),renderAvailability:z34.enum(["AVAILABLE","UNAVAILABLE"]),nextActions:z34.array(z34.enum(["CREATE_COMPOSITION","REVISE_COMPOSITION"])).max(2)});var PutCompositionInputSchema=CompositionScopeSchema.extend({name:CompositionBindingSchema.shape.name,purpose:z34.enum(["SOURCE","DEPENDENCY_MANIFEST","DEPENDENCY_LOCK","DATA"]),declaredOrigin:CompositionBindingSchema.shape.declaredOrigin,executionClass:z34.enum(["LIVE","TEST_ONLY"]),contentUtf8:z34.string().min(1).max(8388608),idempotencyKey:z34.string().trim().min(1).max(200)}).superRefine((v,ctx)=>{if(v.purpose==="SOURCE"&&v.declaredOrigin!=="CODE")ctx.addIssue({code:"custom",path:["declaredOrigin"],message:"Programmatic source must retain CODE provenance"})});var CompositionInputReceiptSchema=z34.strictObject({binding:CompositionBindingSchema,projectId:z34.uuid(),contentType:z34.literal("application/json"),byteSize:z34.int().positive().max(8388608),executionClass:z34.enum(["LIVE","TEST_ONLY"]),inputStatus:z34.enum(["AVAILABLE","UNAVAILABLE"]),byteReadback:z34.literal("VERIFIED_AT_REGISTRATION")});var CompositionCapabilitySchema=z34.strictObject({capability:z34.string().min(1).max(80),tool:z34.string().nullable(),availability:z34.enum(["AVAILABLE","UNAVAILABLE"]),reason:z34.string().nullable()});var CompositionCapabilitiesSchema=z34.strictObject({provider:z34.literal("HYPERFRAME"),dialect:z34.literal("HYPERFRAME_HTML_GSAP_V1"),planningStatus:CompositionAuthoringBriefSchema.shape.planningStatus,capabilities:z34.array(CompositionCapabilitySchema).max(18),inputLimitsMiB:z34.strictObject({SOURCE:z34.literal(8),DEPENDENCY_MANIFEST:z34.literal(8),DEPENDENCY_LOCK:z34.literal(8),DATA:z34.literal(8),FONT:z34.literal(32),IMAGE:z34.literal(8),VIDEO:z34.literal(64)}),clockSemantics:z34.literal("RATIONAL_FPS_HALF_OPEN_FRAMES"),rendererValidation:z34.enum(["C3_PENDING","PER_REQUEST_CONFORMANCE"]),authoringGuide:CompositionAuthoringGuideSchema.optional()});var CompositionFailureSchema=z34.strictObject({semanticStatus:z34.enum(["INVALID_INPUT","NOT_FOUND","REVISION_CONFLICT","STALE_BASIS","BLOCKED","CAPABILITY_UNAVAILABLE","INTERNAL_OPERATIONAL_FAILURE"]),error:z34.strictObject({code:z34.string().max(80),message:z34.string().max(2e3)}),retryable:z34.boolean(),nextActions:z34.array(z34.string().max(80)).max(4),diagnostics:z34.array(z34.strictObject({code:z34.string().max(80),message:z34.string().max(2e3)})).max(32)});import{z as z37}from"zod";import{z as z35}from"zod";var HyperframeLegacyRenderProfileSchema=z35.strictObject({id:z35.literal("HYPERFRAME_1080P30_FULL_PAINT_V1"),adapter:z35.literal("native-hyperframe-v1"),engine:z35.literal("0.8.134"),producer:z35.literal("0.8.134"),gsap:z35.literal("3.15.0"),node:z35.string().min(1).max(80),browser:z35.string().min(1).max(160),browserSha256:z35.string().regex(/^[0-9a-f]{64}$/),ffmpeg:z35.string().min(1).max(240),maxFrames:z35.literal(360),timeoutMs:z35.literal(6e5),maxRssBytes:z35.literal(3221225472),maxScratchBytes:z35.literal(3221225472),maxOutputBytes:z35.literal(134217728),maxCpuMs:z35.literal(6e5),capture:z35.literal("PNG_SOFTWARE_SCREENSHOT_FULL_PAINT"),encode:z35.literal("H264_YUV420P_CRF18_THREADS2_NO_AUDIO")});var HyperframeCachedRenderProfileSchema=HyperframeLegacyRenderProfileSchema.extend({id:z35.literal("HYPERFRAME_1080P30_FRAME_CACHE_V2"),adapter:z35.literal("native-hyperframe-cache-v2"),encode:z35.literal("H264_YUV420P_CRF18_VERYFAST_THREADS2_NO_AUDIO")});var HyperframeRenderProfileSchema=z35.discriminatedUnion("id",[HyperframeLegacyRenderProfileSchema,HyperframeCachedRenderProfileSchema]);var CompositionRenderStartSchema=CompositionGetSchema.extend({versionId:z35.uuid(),fingerprint:z35.string().regex(/^[0-9a-f]{64}$/),expectedProductionRevision:z35.int().positive(),profileId:z35.enum(["HYPERFRAME_1080P30_FULL_PAINT_V1","HYPERFRAME_1080P30_FRAME_CACHE_V2","HYPERFRAME_RGBA_PNG30_FULL_PAINT_V1"]),idempotencyKey:z35.string().trim().min(1).max(200)});var CompositionRenderGetSchema=CompositionScopeSchema.extend({renderId:z35.uuid()});var CompositionRenderManifestSchema=z35.strictObject({schemaVersion:z35.literal(1),version:CompositionVersionSchema,profile:HyperframeRenderProfileSchema,firstFrame:z35.literal(0),frameCount:z35.int().min(1).max(360)}).superRefine((m,ctx)=>{if(m.frameCount!==m.version.content.clock.frameCount||m.version.inputs.reduce((n,i)=>n+i.byteSize,0)>134217728)ctx.addIssue({code:"custom",message:"Exact frame count and aggregate input budget required"})});var CompositionRenderReceiptSchema=z35.strictObject({semanticStatus:z35.literal("ACCEPTED"),renderId:z35.uuid(),runtimeJobId:z35.uuid(),compositionVersionId:z35.uuid(),manifestFingerprint:z35.string().regex(/^[0-9a-f]{64}$/),productionRevision:z35.int().positive()});var CompositionRenderTechnicalSchema=z35.strictObject({width:z35.literal(1920),height:z35.literal(1080),frameRate:z35.literal(30),frameCount:z35.int().min(1).max(360),durationMs:z35.number().positive(),contentType:z35.literal("video/mp4"),videoCodec:z35.literal("h264"),pixelFormat:z35.literal("yuv420p"),hasAudio:z35.literal(false),fullDecode:z35.literal(true),checksumSha256:z35.string().regex(/^[0-9a-f]{64}$/),byteSize:z35.int().min(1).max(134217728),decodedFramesSha256:z35.string().regex(/^[0-9a-f]{64}$/)});var CompositionRenderResourcesSchema=z35.strictObject({sampleIntervalMs:z35.literal(100),sampledTreePeakRssBytes:z35.int().nonnegative(),sampledTreeCpuMs:z35.number().nonnegative(),observedPids:z35.int().nonnegative(),scratchPeakBytes:z35.int().nonnegative(),wallMs:z35.number().nonnegative(),processGroupCleaned:z35.literal(true)});import{z as z36}from"zod";var HyperframeAlphaRenderProfileSchema=HyperframeLegacyRenderProfileSchema.extend({id:z36.literal("HYPERFRAME_RGBA_PNG30_FULL_PAINT_V1"),adapter:z36.literal("native-hyperframe-alpha-v1"),encode:z36.literal("RGBA_PNG_SEQUENCE_30_V1"),maxOutputBytes:z36.literal(67108864),maxDecodedBytes:z36.literal(536870912)});var CompositionFrameRenderManifestSchema=z36.strictObject({...CompositionRenderManifestSchema.shape,schemaVersion:z36.literal(2),profile:HyperframeAlphaRenderProfileSchema}).superRefine((m,context)=>{const c=m.version.content;if(m.frameCount!==c.clock.frameCount||m.version.inputs.reduce((n,i)=>n+i.byteSize,0)>134217728||c.role!=="VISUAL_LAYER"||c.viewport.width>1920||c.viewport.height>1920||c.viewport.width*c.viewport.height>1920*1080||c.viewport.width*c.viewport.height*m.frameCount*4>m.profile.maxDecodedBytes||c.clock.numerator!==30||c.clock.denominator!==1)context.addIssue({code:"custom",message:"Qualified CODE alpha geometry/role/clock/decoded budget mismatch"})});var CompositionFrameTechnicalSchema=z36.strictObject({profileId:z36.literal("RGBA_PNG_SEQUENCE_30_V1"),width:z36.int().min(1).max(1920),height:z36.int().min(1).max(1920),frameRate:z36.literal(30),frameCount:z36.int().min(1).max(360),alpha:z36.literal("STRAIGHT_RGBA"),fullDecode:z36.literal(true),frames:z36.array(z36.strictObject({ordinal:z36.int().min(0).max(359),checksumSha256:z36.string().regex(/^[0-9a-f]{64}$/),byteSize:z36.int().min(1).max(16777216)})).min(1).max(360)}).superRefine((value,context)=>{if(value.frames.length!==value.frameCount||value.frames.some((f,i)=>f.ordinal!==i)||value.width*value.height>1920*1080||value.width*value.height*value.frameCount*4>536870912||value.frames.reduce((n,f)=>n+f.byteSize,0)>67108864)context.addIssue({code:"custom",message:"CODE frame order/geometry/byte budget mismatch"})});var CompositionFrameRenderOutputSchema=z36.strictObject({sequence:VisualFrameSequenceSchema,technical:CompositionFrameTechnicalSchema,resources:CompositionRenderResourcesSchema}).superRefine((output,context)=>{if(output.sequence.width!==output.technical.width||output.sequence.height!==output.technical.height||output.sequence.frameCount!==output.technical.frameCount||output.sequence.frames.some((frame,i)=>frame.ordinal!==output.technical.frames[i]?.ordinal||frame.checksumSha256!==output.technical.frames[i]?.checksumSha256||frame.byteSize!==output.technical.frames[i]?.byteSize))context.addIssue({code:"custom",message:"CODE frame output must identify the exact native sequence"})});var CompositionRenderManifestReaderSchema=z37.discriminatedUnion("schemaVersion",[CompositionRenderManifestSchema,CompositionFrameRenderManifestSchema]);var CompositionRenderViewSchema=z37.strictObject({sourceIdentity:z37.strictObject({tenantId:z37.uuid(),projectId:z37.uuid(),productionId:z37.uuid(),compositionId:z37.uuid(),versionId:z37.uuid(),fingerprint:z37.string().regex(/^[0-9a-f]{64}$/),shotId:z37.uuid().nullable(),role:z37.enum(["PRIMARY_VISUAL","VISUAL_LAYER"])}).optional(),frameOutput:CompositionFrameRenderOutputSchema.optional(),receipt:CompositionRenderReceiptSchema,lifecycle:z37.string().min(1).max(80),cancellationRequested:z37.boolean(),failureClassification:z37.string().min(1).max(80).nullable(),output:z37.strictObject({artifactId:z37.uuid(),representationId:z37.uuid(),technical:CompositionRenderTechnicalSchema,resources:CompositionRenderResourcesSchema}).nullable()}).superRefine((view,context)=>{if(view.sourceIdentity&&view.sourceIdentity.versionId!==view.receipt.compositionVersionId)context.addIssue({code:"custom",message:"Render source identity must bind the admitted exact version"});if(view.frameOutput&&view.output!==null)context.addIssue({code:"custom",message:"CODE frame output must match its render Production and exclude an MP4 output"})});var CompositionRenderCancellationSchema=z37.strictObject({cancellationRequested:z37.boolean()});var ParameterValue=z38.strictObject({kind:z38.literal("PARAMETER_VALUE"),name:CompositionBindingSchema.shape.name,value:z38.union([z38.string().max(4e3),z38.number().finite(),z38.boolean()])});var Binding=CompositionBindingSchema.extend({purpose:z38.enum(["SOURCE","DATA","FONT","IMAGE","VIDEO"])});var CompositionRepairConsumerSchema=z38.discriminatedUnion("role",[z38.strictObject({role:z38.literal("PRIMARY_VISUAL"),clipOrdinal:z38.int().min(1).max(200)}),z38.strictObject({role:z38.literal("VISUAL_LAYER"),visualLayerId:z38.uuid()})]);var Consumers=z38.array(CompositionRepairConsumerSchema).min(1).max(208).refine(items=>new Set(items.map(i=>i.role==="PRIMARY_VISUAL"?i.role+i.clipOrdinal:i.role+i.visualLayerId)).size===items.length,"Coordinated consumers must be unique exact occurrences");var CompositionRepairPatchSchema=z38.discriminatedUnion("kind",[ParameterValue,z38.strictObject({kind:z38.literal("BINDING_REPLACE"),binding:Binding})]);var ReviseCompositionRepairActionSchema=z38.strictObject({kind:z38.literal("REVISE_COMPOSITION"),localityIndex:z38.int().min(0).max(207),patches:z38.array(CompositionRepairPatchSchema).min(1).max(16),coordinatedConsumers:Consumers.optional()}).superRefine((v,ctx)=>{const names=v.patches.map(p=>p.kind+":"+(p.kind==="PARAMETER_VALUE"?p.name:p.binding.name));if(new Set(names).size!==names.length)ctx.addIssue({code:"custom",message:"Local Composition patch targets must be unique"})});var CompositionRepairSubjectSchema=z38.strictObject({locality:CompositionFindingLocalitySchema,composition:CompositionViewSchema,render:CompositionRenderViewSchema});var{idempotencyKey,...revisionShape}=ReviseCompositionSchema.shape;var RevisionDraft=z38.strictObject(revisionShape).refine(v=>v.content.role!=="PRIMARY_VISUAL"||v.basis.shotId!==null,"Primary repair retains an exact planned Shot");var CompositionRepairHandoffSchema=z38.strictObject({kind:z38.literal("COMPOSITION_REVISE"),locality:CompositionFindingLocalitySchema,input:RevisionDraft,renderProfileId:z38.enum(["HYPERFRAME_1080P30_FULL_PAINT_V1","HYPERFRAME_1080P30_FRAME_CACHE_V2","HYPERFRAME_RGBA_PNG30_FULL_PAINT_V1"]),sourceReviewRequired:z38.boolean(),coordinatedConsumers:Consumers.optional()}).superRefine((v,ctx)=>{if(v.input.compositionId!==v.locality.compositionId||v.input.previousVersionId!==v.locality.compositionVersionId||v.input.expectedVersion!==v.locality.compositionVersion||v.input.content.role!==v.locality.role||v.coordinatedConsumers?.some(i=>i.role!==v.locality.role)||v.sourceReviewRequired!==(v.locality.role==="PRIMARY_VISUAL")||!(v.locality.role==="PRIMARY_VISUAL"?["HYPERFRAME_1080P30_FULL_PAINT_V1","HYPERFRAME_1080P30_FRAME_CACHE_V2"].includes(v.renderProfileId):v.renderProfileId==="HYPERFRAME_RGBA_PNG30_FULL_PAINT_V1"))ctx.addIssue({code:"custom",message:"Composition repair handoff must retain exact locality identity, role and original output profile"})});var text=z39.string().trim().min(1).max(2e3);var key5=z39.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);var RepairStrategyContextInputSchema=z39.strictObject({scope:DirectorScopeSchema,findingId:z39.uuid()});var RepairStrategyBasisSchema=RepairStrategyContextInputSchema.extend({contextFingerprint:z39.string().regex(/^[0-9a-f]{64}$/)});var RepairStrategyActionSchema=z39.discriminatedUnion("kind",[ReviseCompositionRepairActionSchema,z39.strictObject({kind:z39.literal("TRIM_CLIP"),ordinal:z39.int().min(1).max(200),sourceInMs:z39.int().nonnegative().max(30150),sourceOutMs:z39.int().positive().max(30150)}),z39.strictObject({kind:z39.literal("REVISE_CAPTIONS"),content:CaptionContentSchema}),z39.strictObject({kind:z39.literal("ADJUST_TRANSITION"),ordinal:z39.int().min(2).max(200),transition:ClipTransitionSchema}),z39.strictObject({kind:z39.literal("ADJUST_AUDIO_COMPOSITION"),audio:TimelineAudioInputSchema}),z39.strictObject({kind:z39.literal("ACKNOWLEDGE_WARNINGS"),acknowledgements:z39.array(z39.strictObject({key:z39.string().min(1).max(220),reason:text})).min(1).max(300)}),z39.strictObject({kind:z39.literal("REGENERATE_SHOT"),shotId:z39.uuid()}),z39.strictObject({kind:z39.literal("REQUEST_HUMAN_INPUT"),question:text}),z39.strictObject({kind:z39.literal("REQUEST_CANONICAL_CHANGE"),requestedChange:text})]);var RepairStrategyAlternativeSchema=z39.strictObject({id:key5,rationale:text,whySmallerChangeInsufficient:text,action:RepairStrategyActionSchema});var ValidateRepairStrategySchema=z39.strictObject({basis:RepairStrategyBasisSchema,proposal:z39.strictObject({origin:z39.strictObject({kind:z39.literal("EXTERNAL_AGENT_HOST"),label:z39.string().trim().min(1).max(100)}),summary:text,alternatives:z39.array(RepairStrategyAlternativeSchema).min(1).max(6),selectedAlternativeId:key5})}).refine(v=>new TextEncoder().encode(JSON.stringify(v)).byteLength<=1024*1024,"Repair Strategy input exceeds the 1 MiB JSON budget");var RepairStrategyContextResultSchema=z39.strictObject({compositionRepairAvailable:z39.boolean().optional(),semanticStatus:z39.literal("SUCCESS"),advisory:z39.literal(true),basis:RepairStrategyBasisSchema,ownerContext:DirectorContextResultSchema,finding:RoughCutFindingViewSchema,reviewTarget:RoughCutReviewTargetSchema,finalReady:FinalReadyViewSchema,eligibility:z39.strictObject({ready:z39.boolean(),reasons:z39.array(z39.enum(["FINDING_NOT_OPEN","TARGET_STALE","MEDIA_UNAVAILABLE","PRODUCTION_UNAVAILABLE","REVIEW_CHANGED","FINDING_BASIS_CHANGED"])).max(6)})});var RepairStrategyHandoffSchema=z39.discriminatedUnion("kind",[CompositionRepairHandoffSchema,z39.strictObject({kind:z39.literal("TIMELINE_BUILD"),input:BuildTimelineShapeSchema.omit({idempotencyKey:true})}),z39.strictObject({kind:z39.literal("CAPTION_AUTHOR"),input:AuthorCaptionsSchema.omit({idempotencyKey:true})}),z39.strictObject({kind:z39.literal("FINAL_READY_DECIDE"),input:DecideFinalReadySchema.omit({idempotencyKey:true})}),z39.strictObject({kind:z39.literal("REGENERATION_INTENT"),preparationQuery:PreparationActiveInputSchema,admission:z39.literal("EXPLICIT_NATIVE_PREPARATION_AND_SELECTION_REQUIRED")}),z39.strictObject({kind:z39.literal("HUMAN_INPUT_INTENT"),question:text}),z39.strictObject({kind:z39.literal("CANONICAL_CHANGE_INTENT"),requestedChange:text})]);var RepairStrategyValidationResultSchema=z39.strictObject({semanticStatus:z39.literal("SUCCESS"),advisory:z39.literal(true),basis:RepairStrategyBasisSchema,proposal:ValidateRepairStrategySchema.shape.proposal,finding:RoughCutFindingViewSchema,alternatives:z39.array(z39.strictObject({alternativeId:key5,affectedScope:RoughCutFindingViewSchema.shape.affectedScope,handoff:RepairStrategyHandoffSchema,materialChange:z39.boolean(),preservedAcceptanceIds:z39.array(z39.uuid()).max(200),followUp:z39.array(z39.enum(["REVOKE_FINAL_READY_AND_REFRESH","REFRESH_TIMELINE_BASIS","ATTACH_NEW_CAPTION","REFRESH_AND_PREPARE_SHOT","EXPLICIT_VIDEO_GENERATION","REVIEW_1","SHOT_ACCEPTANCE","REBUILD_TIMELINE","ROUGH_CUT_RENDER","REVIEW_2","FINAL_READY_DECISION","AUTHORIZED_PLANNING_DECISION","COMPOSITION_REVISE","COMPOSITION_RENDER"])).max(10)})).min(1).max(6),selectedAlternativeId:key5,limitations:z39.tuple([z39.literal("NO_CANONICAL_REPAIR_LIFECYCLE_OR_WRITE"),z39.literal("READS_ARE_NOT_ATOMIC_OR_RESERVED"),z39.literal("CREATIVE_RATIONALE_IS_NOT_VERIFIED"),z39.literal("OWNER_RECHECKS_CAS_IDEMPOTENCY_AND_EXECUTION_CLASS"),z39.literal("MATERIAL_REPAIR_REQUIRES_NEW_OBSERVATION_AND_REVIEW")])}).superRefine((v,ctx)=>{const ids=v.alternatives.map(a=>a.alternativeId);const proposed=v.proposal.alternatives.map(a=>a.id);if(v.finding.id!==v.basis.findingId||v.finding.tenantId!==v.basis.scope.tenantId||v.finding.projectId!==v.basis.scope.projectId||v.finding.productionId!==v.basis.scope.productionId||v.selectedAlternativeId!==v.proposal.selectedAlternativeId||!ids.includes(v.selectedAlternativeId)||new Set(ids).size!==ids.length||ids.length!==proposed.length||ids.some(id7=>!proposed.includes(id7)))ctx.addIssue({code:"custom",message:"Repair validation must retain exact Finding and proposal selection"});for(const alternative of v.alternatives){const h=alternative.handoff;if("input"in h&&(h.input.tenantId!==v.basis.scope.tenantId||h.input.productionId!==v.basis.scope.productionId))ctx.addIssue({code:"custom",message:"Repair handoff must retain the exact native Tenant/Production scope"})}});import{z as z40}from"zod";var text2=z40.string().trim().min(1).max(2e3);var key6=z40.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);var EditorContextInputSchema=z40.strictObject({scope:DirectorScopeSchema,timelineVersionId:z40.uuid()});var EditorBasisSchema=EditorContextInputSchema.extend({contextFingerprint:z40.string().regex(/^[0-9a-f]{64}$/)});var EditorAlternativeSchema=z40.strictObject({id:key6,rationale:text2,pacingIntent:text2,action:z40.discriminatedUnion("kind",[z40.strictObject({kind:z40.literal("BUILD_TIMELINE"),clips:BuildTimelineSchema.shape.clips}),z40.strictObject({kind:z40.literal("EDIT_GRAPHICS"),graphics:z40.array(TimelineGraphicInputSchema).min(1).max(8)}),z40.strictObject({kind:z40.literal("EDIT_VISUAL_LAYERS"),visualLayers:z40.array(TimelineVisualLayerInputSchema).min(1).max(8)}),z40.strictObject({kind:z40.literal("EDIT_AUDIO_COMPOSITION"),audio:TimelineAudioInputSchema}),z40.strictObject({kind:z40.literal("REVISE_CAPTIONS"),content:CaptionContentSchema}),z40.strictObject({kind:z40.literal("REQUEST_COMPOSITION_CAPABILITY"),concern:z40.enum(["TRANSITION","AUDIO_VISUAL_ALIGNMENT","VOICE_TIMING","CAPTION_RETIMING"]),requestedChange:text2}),z40.strictObject({kind:z40.literal("REQUEST_HUMAN_INPUT"),question:text2})])});var ValidateEditorProposalSchema=z40.strictObject({basis:EditorBasisSchema,proposal:z40.strictObject({origin:z40.strictObject({kind:z40.literal("EXTERNAL_AGENT_HOST"),label:z40.string().trim().min(1).max(100)}),summary:text2,alternatives:z40.array(EditorAlternativeSchema).min(1).max(6),selectedAlternativeId:key6})}).refine(v=>new TextEncoder().encode(JSON.stringify(v)).byteLength<=1024*1024,"Editor Intelligence input exceeds the 1 MiB JSON budget");var EditorContextResultSchema=z40.strictObject({semanticStatus:z40.literal("SUCCESS"),advisory:z40.literal(true),basis:EditorBasisSchema,ownerContext:DirectorContextResultSchema,timeline:TimelineViewSchema,timelineBasis:TimelineBasisSchema,finalReady:FinalReadyViewSchema,eligibility:z40.strictObject({ready:z40.boolean(),reasons:z40.array(z40.enum(["TIMELINE_NOT_CURRENT","TIMELINE_STALE","PRODUCTION_UNAVAILABLE","PLANNING_NOT_READY","CREATIVE_BASIS_CHANGED","NO_CURRENT_ACCEPTED_MEDIA","COMPOSITION_VERSION_UNSUPPORTED"])).max(7)})});var ReviewScope=z40.strictObject({kind:z40.literal("PRODUCTION"),interval:z40.strictObject({startMs:z40.literal(0),endMs:z40.int().positive().max(603e4)}),shotIds:z40.array(z40.uuid()).min(1).max(200),dimensions:z40.array(z40.enum(["PACING","ORDERING","CUT_CONTINUITY","PRODUCT_PRESENTATION","CAPTION_TIMING_VISIBILITY","AUDIO_VISUAL_ALIGNMENT","BASIC_MIX"])).min(4).max(7),requirement:z40.literal("COMPLETE_NEW_OUTPUT_INSPECTION")});var EditorHandoffSchema=z40.discriminatedUnion("kind",[z40.strictObject({kind:z40.literal("TIMELINE_BUILD"),input:BuildTimelineShapeSchema.omit({idempotencyKey:true}),preview:TimelineManifestReaderSchema,assemblyStatus:z40.enum(["DRAFT","ASSEMBLY_READY"]),changedOrdinals:z40.array(z40.int().positive().max(200)).max(200),changedGraphicArtifactIds:z40.array(z40.uuid()).max(8),changedAudioPurposes:z40.array(z40.enum(["VOICEOVER","MUSIC"])).max(2),preservedAcceptanceIds:z40.array(z40.uuid()).max(200),reviewScope:ReviewScope,followUp:z40.array(z40.enum(["NATIVE_TIMELINE_BUILD","COMPLETE_TIMELINE","ROUGH_CUT_RENDER","REVIEW_2","FINAL_READY_DECISION"])).min(4).max(5)}),z40.strictObject({kind:z40.literal("CAPTION_AUTHOR"),input:AuthorCaptionsSchema.omit({idempotencyKey:true}),attachment:z40.strictObject({expectedTimelineVersion:z40.int().positive(),preserveCurrentComposition:z40.literal(true),composition:z40.strictObject({schemaVersion:BuildTimelineShapeSchema.shape.schemaVersion,clips:BuildTimelineSchema.shape.clips,audio:BuildTimelineSchema.shape.audio.optional(),sourceSound:BuildTimelineShapeSchema.shape.sourceSound,graphics:BuildTimelineSchema.shape.graphics.optional(),visualLayers:BuildTimelineShapeSchema.shape.visualLayers})}),followUp:z40.tuple([z40.literal("NATIVE_CAPTION_AUTHOR"),z40.literal("ATTACH_NEW_CAPTION_TO_TIMELINE"),z40.literal("ROUGH_CUT_RENDER"),z40.literal("REVIEW_2"),z40.literal("FINAL_READY_DECISION")])}),z40.strictObject({kind:z40.literal("COMPOSITION_CAPABILITY_INTENT"),concern:z40.enum(["TRANSITION","AUDIO_VISUAL_ALIGNMENT","VOICE_TIMING","CAPTION_RETIMING"]),requestedChange:text2,admission:z40.literal("EXPLICIT_CANONICAL_CAPABILITY_REQUIRED")}),z40.strictObject({kind:z40.literal("HUMAN_INPUT_INTENT"),question:text2})]);var EditorValidationResultSchema=z40.strictObject({semanticStatus:z40.literal("SUCCESS"),advisory:z40.literal(true),basis:EditorBasisSchema,proposal:ValidateEditorProposalSchema.shape.proposal,alternatives:z40.array(z40.strictObject({alternativeId:key6,handoff:EditorHandoffSchema})).min(1).max(6),selectedAlternativeId:key6,limitations:z40.tuple([z40.literal("NO_TIMELINE_WRITE_RENDER_OR_PROVIDER_CALL"),z40.literal("READS_ARE_NOT_ATOMIC_OR_RESERVED"),z40.literal("CREATIVE_RATIONALE_IS_NOT_VERIFIED"),z40.literal("OWNER_RECHECKS_CAS_IDEMPOTENCY_AND_EXECUTION_CLASS"),z40.literal("EDIT_REQUIRES_NEW_OUTPUT_INSPECTION_AND_REVIEW")])});import{z as z41}from"zod";var sha10=z41.string().regex(/^[0-9a-f]{64}$/);var TemporalEvidenceSourceSchema=z41.strictObject({tenantId:z41.uuid(),projectId:z41.uuid(),productionId:z41.uuid(),artifactId:z41.uuid(),representationId:z41.uuid(),checksumSha256:sha10,byteSize:z41.int().positive().max(128*1024*1024),width:z41.int().min(16).max(4096),height:z41.int().min(16).max(4096),durationMs:z41.int().positive().max(6e4),frameRate:z41.number().min(1).max(60),frameCount:z41.int().positive().max(3600),videoCodec:z41.literal("h264"),executionClass:z41.enum(["LIVE","TEST_ONLY"])}).refine(v=>Math.abs(v.frameCount/v.frameRate*1e3-v.durationMs)<=150,"Exact frame count, duration and rate must agree");var TemporalRiskWindowSchema=z41.strictObject({startMs:z41.int().nonnegative().max(6e4),endMs:z41.int().positive().max(6e4),reason:z41.enum(["TEMPORAL_BEAT","PRIOR_FINDING","SUSPICIOUS_DRIFT","SCENE_CHANGE"])}).refine(v=>v.endMs>v.startMs,"Risk window must advance");var TemporalSamplingProfileSchema=z41.strictObject({id:z41.literal("ADAPTIVE_TEMPORAL_V1"),motion:z41.enum(["NORMAL","HIGH"]),lockedIdentity:z41.boolean(),windows:z41.array(TemporalRiskWindowSchema).max(32)});var TemporalSampleSchema=z41.strictObject({ordinal:z41.int().nonnegative().max(63),frameIndex:z41.int().nonnegative().max(3599),timestampMs:z41.number().nonnegative().max(6e4),reasons:z41.array(z41.enum(["START","END","INTERIOR","HIGH_MOTION","LOCKED_IDENTITY","TEMPORAL_BEAT","PRIOR_FINDING","SUSPICIOUS_DRIFT","SCENE_CHANGE"])).min(1).max(9)});var TemporalSamplingPlanSchema=z41.strictObject({schemaVersion:z41.literal(1),source:TemporalEvidenceSourceSchema,profile:TemporalSamplingProfileSchema,samples:z41.array(TemporalSampleSchema).min(1).max(64),frameWidth:z41.int().min(16).max(320),frameHeight:z41.int().min(16).max(320),columns:z41.int().min(1).max(4),rows:z41.int().min(1).max(16),gutterPx:z41.literal(8)}).superRefine((p,ctx)=>{const s=p.samples;if(s[0]?.frameIndex!==0||s.at(-1)?.frameIndex!==p.source.frameCount-1||p.rows!==Math.ceil(s.length/p.columns)||p.columns!==Math.min(4,s.length)||s.some((v,i)=>v.ordinal!==i||v.frameIndex>=p.source.frameCount||Math.abs(v.timestampMs-v.frameIndex*1e3/p.source.frameRate)>.001||i>0&&v.frameIndex<=s[i-1].frameIndex||new Set(v.reasons).size!==v.reasons.length)||p.profile.windows.some(w=>w.endMs>p.source.durationMs))ctx.addIssue({code:"custom",message:"Temporal samples must preserve exact bounded source order, time and layout"})});var ExtractedTemporalFrameSchema=z41.strictObject({sample:TemporalSampleSchema,checksumSha256:sha10,byteSize:z41.int().positive().max(2*1024*1024),width:z41.int().positive().max(320),height:z41.int().positive().max(320),contentType:z41.literal("image/png")});var TemporalEvidenceManifestSchema=z41.strictObject({schemaVersion:z41.literal(1),plan:TemporalSamplingPlanSchema,engineVersion:z41.string().min(1).max(200),frames:z41.array(ExtractedTemporalFrameSchema).min(1).max(64),sheet:z41.strictObject({checksumSha256:sha10,byteSize:z41.int().positive().max(16*1024*1024),width:z41.int().positive().max(1320),height:z41.int().positive().max(5256),contentType:z41.literal("image/png")})}).superRefine((m,ctx)=>{const p=m.plan;if(m.frames.length!==p.samples.length||m.frames.some((f,i)=>JSON.stringify(f.sample)!==JSON.stringify(p.samples[i])||f.width!==p.frameWidth||f.height!==p.frameHeight)||m.sheet.width!==p.columns*p.frameWidth+(p.columns+1)*p.gutterPx||m.sheet.height!==p.rows*p.frameHeight+(p.rows+1)*p.gutterPx)ctx.addIssue({code:"custom",message:"Evidence frames and sheet must match the exact sampling plan"})});import{z as z42}from"zod";var scope={tenantId:z42.uuid(),productionId:z42.uuid()};var TemporalEvidenceTargetSchema=z42.strictObject({...scope,artifactId:z42.uuid(),representationId:z42.uuid(),checksumSha256:z42.string().regex(/^[0-9a-f]{64}$/)});var OriginalVideoReadSchema=TemporalEvidenceTargetSchema;var OriginalVideoResultSchema=z42.strictObject({source:TemporalEvidenceSourceSchema,contentType:z42.literal("video/mp4"),dataBase64:z42.string().min(4).max(4*Math.ceil(8*1024*1024/3)).regex(/^[A-Za-z0-9+/]+={0,2}$/)}).refine(v=>{const padding=v.dataBase64.endsWith("==")?2:v.dataBase64.endsWith("=")?1:0;return v.dataBase64.length%4===0&&v.source.byteSize<=8*1024*1024&&v.dataBase64.length/4*3-padding===v.source.byteSize},"Original video must match its exact bounded byte size");var TemporalEvidenceStartSchema=TemporalEvidenceTargetSchema.extend({profile:TemporalSamplingProfileSchema,expectedProductionRevision:z42.int().positive(),idempotencyKey:z42.string().trim().min(1).max(128)});var TemporalEvidenceGetSchema=z42.strictObject({...scope,evidenceId:z42.uuid()});var TemporalEvidenceAdmissionSchema=z42.strictObject({semanticStatus:z42.literal("ACCEPTED"),evidenceId:z42.uuid(),runtimeJobId:z42.uuid(),operationId:z42.string().min(1),source:TemporalEvidenceSourceSchema,planFingerprint:z42.string().regex(/^[0-9a-f]{64}$/),productionRevision:z42.int().positive()});var TemporalEvidenceOutputSchema=z42.strictObject({frameSetArtifactId:z42.uuid(),manifestRepresentationId:z42.uuid(),frameRepresentationIds:z42.array(z42.uuid()).min(1).max(64),contactSheetArtifactId:z42.uuid(),sheetRepresentationId:z42.uuid(),manifest:TemporalEvidenceManifestSchema,createdAt:z42.iso.datetime({offset:true})}).refine(v=>v.frameRepresentationIds.length===v.manifest.frames.length&&new Set(v.frameRepresentationIds).size===v.frameRepresentationIds.length,"Exact frame representations must be complete and unique");var TemporalEvidenceViewSchema=z42.strictObject({evidenceId:z42.uuid(),runtimeJobId:z42.uuid(),operationId:z42.string().min(1),source:TemporalEvidenceSourceSchema,planFingerprint:z42.string().regex(/^[0-9a-f]{64}$/),runtimeState:z42.enum(["PENDING","READY","RUNNING","WAITING","SUCCEEDED","FAILED","CANCELLED","SUPERSEDED"]),output:TemporalEvidenceOutputSchema.nullable()});var TemporalEvidenceMediaSchema=TemporalEvidenceGetSchema.extend({kind:z42.enum(["FRAME","SHEET","MANIFEST"]),ordinal:z42.int().nonnegative().max(63).optional()}).refine(v=>v.kind==="FRAME"?v.ordinal!==void 0:v.ordinal===void 0,"Only individual frames require an ordinal");var TemporalEvidenceImageSchema=TemporalEvidenceMediaSchema.safeExtend({kind:z42.enum(["FRAME","SHEET"])});var TemporalEvidenceImageMetadataSchema=TemporalEvidenceImageSchema.safeExtend({contentType:z42.literal("image/png"),checksumSha256:z42.string().regex(/^[0-9a-f]{64}$/),byteSize:z42.int().positive().max(16*1024*1024)});import{z as z43}from"zod";var Text2=z43.string().trim().min(1).max(1e3);var bounded=(value,bytes)=>new TextEncoder().encode(JSON.stringify(value)).byteLength<=bytes;var ExplorationComparisonCriterionSchema=z43.strictObject({key:ReviewEvidenceKeySchema,description:Text2,modality:z43.enum(["VISUAL","TEMPORAL"])});var ExplorationRecommendationContextInputSchema=ExplorationCompareInputSchema.extend({criteria:z43.array(ExplorationComparisonCriterionSchema).min(1).max(8)}).superRefine((v,c)=>{if(new Set(v.items.map(i=>i.mediaType)).size!==1)c.addIssue({code:"custom",message:"Recommendation compares one media type"});if(new Set(v.items.map(i=>i.label)).size!==v.items.length||new Set(v.items.map(i=>i.generationId.toLowerCase())).size!==v.items.length)c.addIssue({code:"custom",message:"Labels and generation identities must be distinct"});if(new Set(v.criteria.map(i=>i.key)).size!==v.criteria.length)c.addIssue({code:"custom",message:"Comparison criterion keys must be distinct"});if(v.items[0].mediaType==="IMAGE"&&v.criteria.some(i=>i.modality==="TEMPORAL"))c.addIssue({code:"custom",message:"Temporal comparison requires VIDEO"});if(!bounded(v,1024*1024))c.addIssue({code:"custom",message:"Recommendation input exceeds 1 MiB"})});var ExplorationRecommendationBasisSchema=z43.strictObject({input:ExplorationRecommendationContextInputSchema,contextFingerprint:z43.string().regex(/^[0-9a-f]{64}$/)});var ExplorationRecommendationCandidateSchema=z43.strictObject({label:ReviewEvidenceKeySchema,readiness:z43.enum(["REVIEWABLE","UNAVAILABLE"]),reasons:z43.array(z43.enum(["NO_CANDIDATE","STALE_BASIS","PRODUCTION_NOT_RUNNABLE","OUTPUT_NOT_INSPECTABLE"])).max(4),reviewContext:ReviewIntelligenceContextResultSchema.nullable()});var ExplorationRecommendationContextResultSchema=z43.strictObject({semanticStatus:z43.literal("SUCCESS"),advisory:z43.literal(true),basis:ExplorationRecommendationBasisSchema,comparison:ExplorationComparisonResultSchema,candidates:z43.array(ExplorationRecommendationCandidateSchema).min(2).max(6),limitations:z43.tuple([z43.literal("READS_ARE_NOT_ATOMIC_OR_RESERVED"),z43.literal("NO_IMPLICIT_MEDIA_OR_MODEL_CALL")])}).refine(v=>bounded(v,2*1024*1024),"Recommendation context exceeds 2 MiB");var ExplorationComparisonJudgmentSchema=z43.strictObject({label:ReviewEvidenceKeySchema,criterionKey:ReviewEvidenceKeySchema,judgment:z43.enum(["FAVORABLE","UNFAVORABLE","UNCERTAIN","NOT_OBSERVABLE"]),rationale:Text2,evidenceIds:z43.array(ReviewEvidenceKeySchema).max(16)});var ExplorationRecommendationDecisionSchema=z43.discriminatedUnion("kind",[z43.strictObject({kind:z43.literal("RECOMMEND"),label:ReviewEvidenceKeySchema,rationale:Text2,notSelected:z43.array(z43.strictObject({label:ReviewEvidenceKeySchema,reason:Text2})).min(1).max(5)}),z43.strictObject({kind:z43.literal("NO_RECOMMENDATION"),reason:Text2})]);var ValidateExplorationRecommendationSchema=z43.strictObject({basis:ExplorationRecommendationBasisSchema,proposal:z43.strictObject({origin:z43.strictObject({kind:z43.literal("EXTERNAL_AGENT_HOST"),label:z43.string().trim().min(1).max(100)}),summary:z43.string().trim().min(1).max(2e3),assessments:z43.array(z43.strictObject({label:ReviewEvidenceKeySchema,reviewProposal:ValidateReviewIntelligenceSchema.shape.proposal})).max(6),judgments:z43.array(ExplorationComparisonJudgmentSchema).max(48),decision:ExplorationRecommendationDecisionSchema,unknowns:z43.array(z43.string().trim().min(1).max(300)).max(8)})}).refine(v=>bounded(v,1024*1024),"Recommendation input exceeds 1 MiB");var ExplorationRecommendationValidationResultSchema=z43.strictObject({semanticStatus:z43.literal("SUCCESS"),advisory:z43.literal(true),basis:ExplorationRecommendationBasisSchema,origin:ValidateExplorationRecommendationSchema.shape.proposal.shape.origin,summary:z43.string(),judgments:z43.array(ExplorationComparisonJudgmentSchema).max(48),decision:ExplorationRecommendationDecisionSchema,unknowns:z43.array(z43.string()).max(8),reviews:z43.array(z43.strictObject({label:ReviewEvidenceKeySchema,validation:ReviewIntelligenceValidationResultSchema})).max(6),limitations:z43.tuple([z43.literal("HOST_PREFERENCE_IS_NOT_CANONICAL_SELECTION"),z43.literal("EVIDENCE_DECLARATIONS_ARE_NOT_ATTESTED_INSPECTION"),z43.literal("RULE_PREVIEWS_ARE_NOT_CANONICAL_REVIEWS"),z43.literal("EXPLICIT_RECORD_AND_SEPARATE_ACCEPTANCE_REQUIRED"),z43.literal("OWNER_RECHECKS_CURRENTNESS_CAS_AND_EXECUTION_CLASS")])}).refine(v=>bounded(v,4*1024*1024),"Recommendation result exceeds 4 MiB");import{z as z45}from"zod";import{z as z44}from"zod";var Review1FindingSchema=z44.strictObject({id:z44.uuid(),tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,shotId:ShotIdSchema,mediaType:z44.enum(["IMAGE","VIDEO"]),framePurpose:z44.string().max(40).optional(),generationId:z44.uuid(),candidateId:z44.uuid(),reviewId:z44.uuid(),artifactId:z44.uuid(),representationId:z44.uuid(),checksumSha256:z44.string().regex(/^[0-9a-f]{64}$/),preparationId:z44.uuid(),contractId:z44.uuid(),contractFingerprint:z44.string().regex(/^[0-9a-f]{64}$/),executionClass:z44.enum(["LIVE","TEST_ONLY"]),requirement:z44.union([VideoReviewRequirementSchema,VisualRequirementSchema]),observation:z44.union([VideoObservationSchema,KeyframeObservationSchema]),blocking:z44.boolean(),severity:z44.enum(["BLOCKING","WARNING"]),basisFingerprint:z44.string().regex(/^[0-9a-f]{64}$/),createdAt:z44.iso.datetime({offset:true})}).superRefine((v,c)=>{if(v.requirement.key!==v.observation.key||v.blocking!==(v.severity==="BLOCKING"))c.addIssue({code:"custom",message:"Finding must bind its exact native obligation"})});var Review1FindingViewSchema=Review1FindingSchema.safeExtend({lifecycle:z44.enum(["OPEN","REMEDIATION_PLANNED","RESOLVED","SUPERSEDED"]),proofReviewId:z44.uuid().nullable()});var Review1RepairSourceSchema=z44.strictObject(Review1FindingSchema.shape).omit({id:true,createdAt:true}).superRefine((v,c)=>{if(v.requirement.key!==v.observation.key||v.blocking!==(v.severity==="BLOCKING"))c.addIssue({code:"custom",message:"Source must bind its exact native obligation"})});var Review1RepairSourceQuerySchema=z44.strictObject({tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,mediaType:z44.enum(["IMAGE","VIDEO"]),generationId:z44.uuid(),reviewId:z44.uuid(),requirementKey:z44.string().min(1).max(220)});var sha11=z45.string().regex(/^[0-9a-f]{64}$/);var handoffs={REVISE_COMPOSITION:"COMPOSITION_REVISE",TRIM_CLIP:"TIMELINE_BUILD",ADJUST_TRANSITION:"TIMELINE_BUILD",ADJUST_AUDIO_COMPOSITION:"TIMELINE_BUILD",REVISE_CAPTIONS:"CAPTION_AUTHOR",ACKNOWLEDGE_WARNINGS:"FINAL_READY_DECIDE",REGENERATE_SHOT:"REGENERATION_INTENT",REQUEST_HUMAN_INPUT:"HUMAN_INPUT_INTENT",REQUEST_CANONICAL_CHANGE:"CANONICAL_CHANGE_INTENT"};var SemanticRepairBudgetSchema=z45.strictObject({maxSemanticAttempts:z45.int().min(1).max(20),maxElapsedMs:z45.int().min(1).max(864e5),currency:z45.literal("USD"),maxCostMicros:z45.int().min(0).max(1e9),maxConsecutiveNoImprovement:z45.int().min(1).max(20)});var RepairPlanScopeSchema=z45.strictObject({tenantId:TenantIdSchema,productionId:ProductionIdSchema,planId:z45.uuid()});var AuthorRepairPlanSchema=z45.strictObject({strategy:ValidateRepairStrategySchema,expectedProductionRevision:z45.int().positive(),expectedCaseVersion:z45.int().nonnegative(),budget:SemanticRepairBudgetSchema,idempotencyKey:z45.string().trim().min(1).max(200)}).superRefine((v,c)=>{const p=v.strategy.proposal;if(new Set(p.alternatives.map(a=>a.id)).size!==p.alternatives.length||!p.alternatives.some(a=>a.id===p.selectedAlternativeId))c.addIssue({code:"custom",message:"Repair authoring requires unique alternatives and an explicit selection"})});var RepairDecisionSchema=z45.strictObject({id:z45.uuid(),tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,caseId:z45.uuid(),caseVersion:z45.int().positive(),basis:RepairStrategyBasisSchema,sourceReviewId:z45.uuid(),sourceRenderId:z45.uuid().nullable(),review1Source:Review1FindingSchema.optional(),sourceBasisFingerprint:sha11,affectedScopeFingerprint:sha11,obligationFingerprint:sha11,proposal:ValidateRepairStrategySchema.shape.proposal,selectedAlternativeId:z45.string().regex(/^[a-z][a-z0-9_-]{0,39}$/),handoff:RepairStrategyHandoffSchema,budget:SemanticRepairBudgetSchema,createdByPrincipalId:PrincipalIdSchema,createdAt:z45.iso.datetime({offset:true})}).superRefine((d,c)=>{if(d.sourceRenderId===null!==!!d.review1Source||d.review1Source&&(d.review1Source.id!==d.basis.findingId||d.review1Source.reviewId!==d.sourceReviewId||d.review1Source.tenantId!==d.tenantId||d.review1Source.projectId!==d.projectId||d.review1Source.productionId!==d.productionId||d.handoff.kind!=="REGENERATION_INTENT"))c.addIssue({code:"custom",message:"Repair must retain its native Review layer and source"});if(d.basis.scope.tenantId!==d.tenantId||d.basis.scope.productionId!==d.productionId||d.basis.scope.projectId!==d.projectId)c.addIssue({code:"custom",message:"Repair Decision scope must be exactly owned"});if(d.selectedAlternativeId!==d.proposal.selectedAlternativeId||new Set(d.proposal.alternatives.map(a=>a.id)).size!==d.proposal.alternatives.length||!d.proposal.alternatives.some(a=>a.id===d.selectedAlternativeId&&handoffs[a.action.kind]===d.handoff.kind))c.addIssue({code:"custom",message:"Repair Decision must bind the explicit selected alternative"})});var SemanticRepairAttemptSchema=z45.strictObject({id:z45.uuid(),planId:z45.uuid(),caseId:z45.uuid(),ordinal:z45.int().min(1).max(20),executionIdentity:z45.string().trim().min(1).max(200),strategyFingerprint:sha11,startedAt:z45.iso.datetime({offset:true}),reservedCostMicros:z45.int().min(0).max(1e9),chargedCostMicros:z45.int().min(0).max(1e9).nullable(),currency:z45.literal("USD"),outcome:z45.enum(["IN_FLIGHT","AWAITING_REVIEW","IMPROVED","NO_IMPROVEMENT","OPERATIONAL_FAILURE","WAIVED"])});var RecordRepairProofSchema=RepairPlanScopeSchema.extend({attemptId:z45.uuid(),renderId:z45.uuid(),reviewId:z45.uuid(),expectedProductionRevision:z45.int().positive(),idempotencyKey:z45.string().trim().min(1).max(200)});import{z as z46}from"zod";var AuthorReview1RepairSchema=z46.strictObject({tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,mediaType:z46.enum(["IMAGE","VIDEO"]),generationId:z46.uuid(),reviewId:z46.uuid(),requirementKey:z46.string().min(1).max(220),reason:z46.string().trim().min(1).max(2e3),expectedProductionRevision:z46.int().positive(),expectedCaseVersion:z46.int().nonnegative(),budget:SemanticRepairBudgetSchema,idempotencyKey:z46.string().trim().min(1).max(200)});var RecordReview1RepairProofSchema=RepairPlanScopeSchema.extend({attemptId:z46.uuid(),generationId:z46.uuid(),reviewId:z46.uuid(),expectedProductionRevision:z46.int().positive(),idempotencyKey:z46.string().trim().min(1).max(200)});import{z as z47}from"zod";var ExecuteRepairSchema=RepairPlanScopeSchema.extend({expectedProductionRevision:z47.int().positive(),expectedCaseVersion:z47.int().positive(),idempotencyKey:z47.string().trim().min(1).max(200),generation:VideoStartInputSchema.omit({idempotencyKey:true}).optional(),keyframeGeneration:KeyframeStartInputSchema.omit({idempotencyKey:true}).optional()});var RepairAttemptEventSchema=z47.strictObject({id:z47.uuid(),attemptId:z47.uuid(),version:z47.int().positive(),outcome:SemanticRepairAttemptSchema.shape.outcome.exclude(["IN_FLIGHT"]),renderId:z47.uuid().nullable(),reviewId:z47.uuid().nullable(),generationId:z47.uuid().optional(),recordedAt:z47.iso.datetime({offset:true})});var RepairAttemptViewSchema=SemanticRepairAttemptSchema.extend({costQuote:GenerationCostQuoteSchema.optional(),events:z47.array(RepairAttemptEventSchema).max(40)});var RepairCaseViewSchema=z47.strictObject({id:z47.uuid(),version:z47.int().positive(),issueKey:z47.string().regex(/^[0-9a-f]{64}$/),budget:SemanticRepairBudgetSchema,openedAt:z47.iso.datetime({offset:true})});var RepairPlanViewSchema=z47.strictObject({review1Finding:Review1FindingViewSchema.optional(),decision:RepairDecisionSchema,repairCase:RepairCaseViewSchema,attempts:z47.array(RepairAttemptViewSchema).max(20)});var RepairAuthorReceiptSchema=z47.strictObject({semanticStatus:z47.literal("SUCCESS"),decision:RepairDecisionSchema,productionRevision:z47.int().positive()});var RepairExecutionReceiptSchema=z47.strictObject({costQuote:GenerationCostQuoteSchema.optional(),semanticStatus:z47.literal("ACCEPTED"),attempt:SemanticRepairAttemptSchema,decision:RepairDecisionSchema,productionRevision:z47.int().positive(),generation:ExecuteRepairSchema.shape.generation.nullable(),keyframeGeneration:ExecuteRepairSchema.shape.keyframeGeneration.nullable().optional()});var RepairProgressSchema=z47.strictObject({view:RepairPlanViewSchema,stage:z47.enum(["WAITING_INPUT","WAITING_GENERATION","WAITING_COMPOSITION_RENDER","WAITING_SOURCE_ACCEPTANCE","WAITING_RENDER","AWAITING_REVIEW","WAIVED","OPERATIONAL_FAILURE","IMPROVED","NO_IMPROVEMENT"]),renderId:z47.uuid().nullable(),generationId:z47.uuid().nullable()});var RepairProofReceiptSchema=z47.strictObject({semanticStatus:z47.literal("SUCCESS"),event:RepairAttemptEventSchema,productionRevision:z47.int().positive()});import{z as z48}from"zod";var EXTERNAL_EVENT_TYPES=["production.started","production.failed","production.cancelled","finding.opened","artifact.created","shot.candidate_ready","shot.accepted","review.completed","rough_cut.ready","final_render.ready","approval.required","production.completed","delivery.validation_failed"];var ExternalEventTypeSchema=z48.enum(EXTERNAL_EVENT_TYPES);var LifecycleEventScopeSchema=z48.object({tenantId:TenantIdSchema,productionId:ProductionIdSchema}).strict();var ExternalLifecycleEventSchema=z48.object({schemaVersion:z48.literal(1),eventId:z48.uuid(),tenantId:TenantIdSchema,productionId:ProductionIdSchema,projectId:z48.uuid(),type:ExternalEventTypeSchema,target:z48.object({type:z48.string().min(1).max(60),id:z48.uuid()}).strict(),occurredAt:z48.iso.datetime(),basis:z48.object({productionRevision:z48.number().int().positive()}).strict(),payload:z48.object({sourceEventType:z48.string().min(1).max(100),artifactId:z48.uuid().optional(),candidateId:z48.uuid().optional(),reviewId:z48.uuid().optional(),findingId:z48.uuid().optional(),shotId:z48.uuid().optional(),manifestId:z48.uuid().optional(),validationId:z48.uuid().optional(),action:z48.string().max(40).optional(),result:z48.string().max(40).optional(),executionClass:z48.enum(["LIVE","TEST_ONLY"]).optional()}).strict()}).strict();var WebhookEndpointSchema=z48.url().max(2048).refine(value=>{const u=new URL(value);return u.protocol==="https:"&&!u.username&&!u.password&&!u.hash&&(!u.port||u.port==="443")&&!u.hostname.startsWith("[")});var ConfigureWebhookSchema=LifecycleEventScopeSchema.extend({subscriptionId:z48.uuid(),expectedRevision:z48.number().int().nonnegative(),idempotencyKey:z48.string().min(1).max(128),endpoint:WebhookEndpointSchema,eventTypes:z48.array(ExternalEventTypeSchema).min(1).max(EXTERNAL_EVENT_TYPES.length).refine(v=>new Set(v).size===v.length),signingSecret:z48.string().min(32).max(256)}).strict();var DisableWebhookSchema=LifecycleEventScopeSchema.extend({subscriptionId:z48.uuid(),expectedRevision:z48.number().int().positive(),idempotencyKey:z48.string().min(1).max(128)}).strict();var ReplayWebhookSchema=DisableWebhookSchema.extend({eventId:z48.uuid()}).strict();var QueryLifecycleEventsSchema=LifecycleEventScopeSchema.extend({kind:z48.enum(["subscriptions","events","deliveries","attempts"]),subscriptionId:z48.uuid().optional(),deliveryId:z48.uuid().optional(),after:z48.uuid().optional(),limit:z48.number().int().min(1).max(50).default(20)}).strict().refine(v=>v.kind!=="attempts"||!!v.deliveryId);var WebhookSubscriptionSchema=LifecycleEventScopeSchema.extend({subscriptionId:z48.uuid(),version:z48.number().int().positive(),revision:z48.number().int().positive(),state:z48.enum(["ACTIVE","DISABLED","DEGRADED"]),endpoint:WebhookEndpointSchema,eventTypes:z48.array(ExternalEventTypeSchema),updatedAt:z48.iso.datetime()}).strict();import{z as z49}from"zod";var WebhookReplayReceiptSchema=z49.strictObject({deliveryId:z49.uuid(),eventId:z49.uuid(),runtimeJobId:z49.uuid()});var WebhookDeliveryViewSchema=z49.strictObject({deliveryId:z49.uuid(),eventId:z49.uuid(),subscriptionId:z49.uuid(),subscriptionVersion:z49.int().positive(),replayNumber:z49.int().nonnegative(),runtimeJobId:z49.uuid(),lifecycle:z49.enum(["PENDING","READY","RUNNING","WAITING","SUCCEEDED","FAILED","CANCELLED","SUPERSEDED"]),runtimeAttempts:z49.int().nonnegative(),wakeAt:z49.iso.datetime({offset:true}).nullable()});var WebhookAttemptViewSchema=z49.strictObject({attemptId:z49.uuid(),runtimeAttemptId:z49.uuid(),outcome:z49.enum(["STARTED","ACKNOWLEDGED","TRANSIENT","PERMANENT","SKIPPED"]),responseStatus:z49.int().min(100).max(599).nullable(),startedAt:z49.iso.datetime({offset:true}),endedAt:z49.iso.datetime({offset:true}).nullable()});var page={next:z49.uuid().nullable()};var WebhookSubscriptionPageSchema=z49.strictObject({...page,items:z49.array(WebhookSubscriptionSchema).max(50)});var ExternalLifecycleEventPageSchema=z49.strictObject({...page,items:z49.array(ExternalLifecycleEventSchema).max(50)});var WebhookDeliveryPageSchema=z49.strictObject({...page,items:z49.array(WebhookDeliveryViewSchema).max(50)});var WebhookAttemptPageSchema=z49.strictObject({...page,items:z49.array(WebhookAttemptViewSchema).max(50)});var LifecycleEventCapabilitiesSchema=z49.strictObject({eventTypes:z49.array(ExternalEventTypeSchema).max(13),unavailableNativeEvents:z49.array(z49.enum(["production.failed","production.cancelled","finding.opened"])).max(3),delivery:z49.literal("AT_LEAST_ONCE"),payload:z49.literal("QUERY_NOTIFICATION"),scope:z49.literal("PRODUCTION"),automaticOutboundAttempts:z49.literal(3),manualReplaysPerEvent:z49.literal(3),projectOnlyArtifacts:z49.literal("UNAVAILABLE"),orderingGuaranteed:z49.literal(false),signature:z49.literal("HMAC_SHA256_TIMESTAMP_DOT_EXACT_BODY")});import{z as z50}from"zod";var sha12=z50.string().regex(/^[0-9a-f]{64}$/);var CompositionSourceInspectSchema=CompositionGetSchema.extend({versionId:z50.uuid(),fingerprint:sha12,file:CompositionPathSchema.optional(),startLine:z50.int().min(1).max(8388609).default(1),lineLimit:z50.int().min(1).max(200).default(80)});var CompositionSourceInspectionSchema=z50.strictObject({composition:CompositionViewSchema,source:CompositionInputFactSchema,byteReadback:z50.literal("VERIFIED"),selection:z50.strictObject({file:CompositionPathSchema.nullable(),startLine:z50.int().positive(),lineLimit:z50.int().min(1).max(200)}),files:z50.array(z50.strictObject({path:CompositionPathSchema,contentType:z50.string().max(80),byteSize:z50.int().nonnegative().max(8388608),lineCount:z50.int().positive().max(8388609)})).min(1).max(128),window:z50.strictObject({file:CompositionPathSchema,startLine:z50.int().positive(),lines:z50.array(z50.strictObject({number:z50.int().positive(),text:z50.string().max(65536)})).max(200),hasMore:z50.boolean(),nextLine:z50.int().positive().nullable()}).nullable(),limitations:z50.tuple([z50.literal("SOURCE_INSPECTION_IS_NOT_OUTPUT_REVIEW"),z50.literal("READS_ARE_NOT_ATOMIC_OR_RESERVED")])});var SourceReviewContextInputSchema=z50.strictObject({scope:DirectorScopeSchema,source:CompositionSourceInspectSchema,renderId:z50.uuid().optional()}).refine(i=>i.scope.tenantId===i.source.tenantId&&i.scope.productionId===i.source.productionId,"Source Review retains exact Tenant/Production scope");var SourceReviewContextSchema=z50.strictObject({semanticStatus:z50.literal("SUCCESS"),advisory:z50.literal(true),basis:z50.strictObject({input:SourceReviewContextInputSchema,contextFingerprint:sha12}),ownerContext:DirectorContextResultSchema,source:CompositionSourceInspectionSchema,render:CompositionRenderViewSchema.nullable(),outputReviewTarget:ProgrammaticVideoReviewTargetSchema.nullable(),limitations:z50.tuple([z50.literal("SOURCE_REASONING_DOES_NOT_CERTIFY_OUTPUT_QUALITY"),z50.literal("INDEPENDENT_OUTPUT_REVIEW_AND_ACCEPTANCE_REQUIRED"),z50.literal("READS_ARE_NOT_ATOMIC_OR_RESERVED")])});import{z as z51}from"zod";var key7=z51.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);var ProgrammaticCompareSchema=z51.strictObject({scope:ExplorationScopeSchema,items:z51.array(z51.strictObject({label:key7,renderId:z51.uuid()})).min(2).max(6)}).superRefine((i,c)=>{if(new Set(i.items.map(v=>v.label)).size!==i.items.length||new Set(i.items.map(v=>v.renderId.toLowerCase())).size!==i.items.length)c.addIssue({code:"custom",message:"Programmatic labels and exact renders must be distinct"})});var ProgrammaticComparisonSchema=z51.strictObject({semanticStatus:z51.literal("SUCCESS"),advisory:z51.literal(true),scope:ExplorationScopeSchema,selection:ProgrammaticCompareSchema.shape.items,items:z51.array(z51.strictObject({label:key7,sourceKind:z51.literal("PROGRAMMATIC"),composition:CompositionViewSchema,render:CompositionRenderViewSchema,reviewTarget:ProgrammaticVideoReviewTargetSchema.nullable()})).min(2).max(6),limitations:z51.tuple([z51.literal("OWNER_STATES_ARE_NOT_VISUAL_SCORES"),z51.literal("REVIEW_AND_ACCEPTANCE_REMAIN_EXPLICIT")])}).superRefine((v,c)=>{if(v.items.length!==v.selection.length||v.items.some((item,i)=>item.label!==v.selection[i].label||item.render.receipt.renderId!==v.selection[i].renderId))c.addIssue({code:"custom",message:"Programmatic comparison retains every exact selected label/render"});for(const item of v.items){const owner=item.composition.version,target=item.reviewTarget;if(owner.tenantId!==v.scope.tenantId||owner.projectId!==v.scope.projectId||owner.productionId!==v.scope.productionId||owner.basis.shotId!==v.scope.shotId||owner.content.role!=="PRIMARY_VISUAL"||owner.id!==item.render.receipt.compositionVersionId||target&&(target.renderId!==item.render.receipt.renderId||target.compositionVersionId!==owner.id||target.tenantId!==v.scope.tenantId||target.projectId!==v.scope.projectId||target.productionId!==v.scope.productionId||target.shotId!==v.scope.shotId))c.addIssue({code:"custom",message:"Programmatic comparison retains exact native source/output scope"})}}).refine(i=>new TextEncoder().encode(JSON.stringify(i)).byteLength<=2*1024*1024,"Programmatic comparison exceeds2MiB");var ProgrammaticRecommendationContextInputSchema=ProgrammaticCompareSchema.safeExtend({criteria:z51.array(ExplorationComparisonCriterionSchema).min(1).max(8)}).refine(i=>new Set(i.criteria.map(v=>v.key)).size===i.criteria.length,"Criteria must be distinct");var ProgrammaticRecommendationBasisSchema=z51.strictObject({input:ProgrammaticRecommendationContextInputSchema,contextFingerprint:z51.string().regex(/^[0-9a-f]{64}$/)});var ProgrammaticRecommendationContextSchema=z51.strictObject({semanticStatus:z51.literal("SUCCESS"),advisory:z51.literal(true),basis:ProgrammaticRecommendationBasisSchema,comparison:ProgrammaticComparisonSchema,candidates:z51.array(ExplorationRecommendationCandidateSchema).min(2).max(6),limitations:z51.tuple([z51.literal("READS_ARE_NOT_ATOMIC_OR_RESERVED"),z51.literal("NO_IMPLICIT_MEDIA_OR_MODEL_CALL")])}).superRefine((v,c)=>{if(JSON.stringify(v.basis.input.scope)!==JSON.stringify(v.comparison.scope)||JSON.stringify(v.basis.input.items)!==JSON.stringify(v.comparison.selection)||v.candidates.length!==v.comparison.items.length||v.candidates.some((candidate,i)=>candidate.label!==v.comparison.items[i].label))c.addIssue({code:"custom",message:"Programmatic Recommendation keeps exact comparison scope/selection"});for(const candidate of v.candidates){const target=candidate.reviewContext?.reviewTarget;const item=v.comparison.items.find(i=>i.label===candidate.label);if(target&&(target.kind!=="PROGRAMMATIC"||target.target.renderId!==item?.render.receipt.renderId||target.target.compositionVersionId!==item.composition.version.id))c.addIssue({code:"custom",message:"Candidate assessment binds the exact native CODE output"})}}).refine(i=>new TextEncoder().encode(JSON.stringify(i)).byteLength<=2*1024*1024,"Programmatic recommendation context exceeds2MiB");var ValidateProgrammaticRecommendationSchema=z51.strictObject({basis:ProgrammaticRecommendationBasisSchema,proposal:ValidateExplorationRecommendationSchema.shape.proposal}).refine(i=>new TextEncoder().encode(JSON.stringify(i)).byteLength<=1024*1024,"Programmatic recommendation input exceeds1MiB");var ProgrammaticRecommendationValidationSchema=z51.strictObject({...ExplorationRecommendationValidationResultSchema.shape,basis:ProgrammaticRecommendationBasisSchema}).superRefine((v,c)=>{const s=v.basis.input.scope;for(const assessment of v.reviews){const item=v.basis.input.items.find(i=>i.label===assessment.label),draft=assessment.validation.recordDraft;if(!item||draft.kind!=="PROGRAMMATIC"||draft.input.renderId!==item.renderId||draft.input.tenantId!==s.tenantId||draft.input.productionId!==s.productionId||assessment.validation.basis.scope.projectId!==s.projectId)c.addIssue({code:"custom",message:"Recommendation review draft binds exact CODE output and scope"})}}).refine(i=>new TextEncoder().encode(JSON.stringify(i)).byteLength<=4*1024*1024,"Programmatic recommendation result exceeds4MiB");import{z as z52}from"zod";var CompositionRenderQuerySchema=CompositionScopeSchema.extend({limit:z52.int().min(1).max(24).default(12),next:ContinuationSchema.optional(),shotId:z52.uuid().optional(),role:z52.enum(["PRIMARY_VISUAL","VISUAL_LAYER"]).default("PRIMARY_VISUAL")});var CompositionRenderObservationSchema=z52.strictObject({render:CompositionRenderViewSchema,createdAt:z52.iso.datetime({offset:true}),version:z52.int().positive(),executionClass:z52.enum(["LIVE","TEST_ONLY"]),freshness:z52.enum(["CURRENT_BASIS","STALE_BASIS"]),available:z52.boolean(),review:z52.strictObject({result:z52.enum(["UNREVIEWED","PASS","WARNING","FAIL"]),reviewId:z52.uuid().nullable(),acceptanceId:z52.uuid().nullable(),accepted:z52.boolean()})}).superRefine((v,ctx)=>{if(!v.render.sourceIdentity||v.review.result==="UNREVIEWED"!==(v.review.reviewId===null)||v.review.accepted!==(v.review.acceptanceId!==null)||v.review.accepted&&(!v.review.acceptanceId||!v.review.reviewId||!v.available||v.freshness!=="CURRENT_BASIS"||!["PASS","WARNING"].includes(v.review.result)))ctx.addIssue({code:"custom",message:"Observation requires exact native source/Review/acceptance identity"})});var CompositionRenderPageSchema=z52.strictObject({items:z52.array(CompositionRenderObservationSchema).max(24),page:QueryPageInfoSchema}).refine(v=>new TextEncoder().encode(JSON.stringify(v)).byteLength<=4194304,"Render observation page exceeds 4 MiB");var CompositionRenderMediaDescriptorSchema=z52.strictObject({path:z52.string().regex(/^\/v1\/productions\/[0-9a-f-]{36}\/compositions\/renders\/[0-9a-f-]{36}\/media$/i),contentType:z52.literal("video/mp4"),checksumSha256:z52.string().regex(/^[0-9a-f]{64}$/),byteSize:z52.int().positive().max(134217728),authentication:z52.literal("BEARER_AND_TENANT_HEADER")});import{z as z53}from"zod";var CompositionSampleStartSchema=CompositionRenderGetSchema.extend({expectedProductionRevision:z53.int().positive(),profile:TemporalSamplingProfileSchema,idempotencyKey:z53.string().trim().min(1).max(128)});var CompositionObserveGetSchema=CompositionRenderGetSchema.extend({evidenceId:z53.uuid()});var RenderObservationIdentitySchema=z53.strictObject({renderId:z53.uuid(),compositionVersionId:z53.uuid(),artifactId:z53.uuid(),representationId:z53.uuid(),checksumSha256:z53.string().regex(/^[0-9a-f]{64}$/)});var CompositionSampleReceiptSchema=RenderObservationIdentitySchema.extend({evidence:TemporalEvidenceAdmissionSchema,nextActions:z53.tuple([z53.literal("READ_OBSERVATION")])});var CompositionFrameObservationSchema=z53.strictObject({ordinal:z53.int().nonnegative().max(63),frameIndex:z53.int().nonnegative().max(3599),timestampMs:z53.number().nonnegative().max(6e4),checksumSha256:z53.string().regex(/^[0-9a-f]{64}$/),representationId:z53.uuid(),diagnostic:z53.literal("FRAME_EVIDENCE_READY")});var CompositionObservationViewSchema=RenderObservationIdentitySchema.extend({evidence:TemporalEvidenceViewSchema,frames:z53.array(CompositionFrameObservationSchema).max(64),contactSheetArtifactId:z53.uuid().nullable(),nextActions:z53.array(z53.enum(["READ_OBSERVATION","READ_FRAME_MEDIA","REVISE_COMPOSITION","RENDER_REVISION"])).min(1).max(4)});var HYPERFRAME_RENDER_PROFILE={id:"HYPERFRAME_1080P30_FULL_PAINT_V1",adapter:"native-hyperframe-v1",engine:"0.8.134",producer:"0.8.134",gsap:"3.15.0",node:"v24.21.0",browser:"Google Chrome for Testing 154.0.8037.57",browserSha256:"60c03e8882f4bb47459a905ede1074e1e746c5b765e437c288e460320540a8a3",ffmpeg:"ffmpeg version 8.0.1-3ubuntu2 Copyright (c) 2000-2025 the FFmpeg developers",maxFrames:360,timeoutMs:6e5,maxRssBytes:3221225472,maxScratchBytes:3221225472,maxOutputBytes:134217728,maxCpuMs:6e5,capture:"PNG_SOFTWARE_SCREENSHOT_FULL_PAINT",encode:"H264_YUV420P_CRF18_THREADS2_NO_AUDIO"};var HYPERFRAME_ALPHA_RENDER_PROFILE={...HYPERFRAME_RENDER_PROFILE,id:"HYPERFRAME_RGBA_PNG30_FULL_PAINT_V1",adapter:"native-hyperframe-alpha-v1",encode:"RGBA_PNG_SEQUENCE_30_V1",maxOutputBytes:67108864,maxDecodedBytes:536870912};var HYPERFRAME_CACHED_RENDER_PROFILE={...HYPERFRAME_RENDER_PROFILE,id:"HYPERFRAME_1080P30_FRAME_CACHE_V2",adapter:"native-hyperframe-cache-v2",encode:"H264_YUV420P_CRF18_VERYFAST_THREADS2_NO_AUDIO"};var scope2={projectId:ProjectIdSchema,productionId:ProductionIdSchema};var ScopedAcceptBriefSchema=AcceptBriefRequestSchema.extend(scope2);var ScopedAcceptStorySchema=AcceptStoryRequestSchema.extend(scope2);var ScopedAcceptSceneShotPlanSchema=AcceptSceneShotPlanRequestSchema.extend(scope2);import{z as z54}from"zod";var id5=z54.uuid();var ActivateAgentExecutionSchema=AgentHostScopeSchema.extend({profileKey:z54.string().regex(/^[A-Za-z0-9_-]{1,160}$/),requestId:id5,bindingId:id5,expectedBindingRevision:z54.int().positive(),expectedConfigurationVersion:z54.int().positive(),clientId:id5,grantRef:id5,installationRevisionId:z54.string().regex(/^[A-Za-z0-9_-]{1,160}$/)});var AgentExecutionSelectionSchema=z54.strictObject({registration:AgentExecutionRegistrationViewSchema,grant:AgentExecutionGrantSchema,installationRevisionId:z54.string().regex(/^[A-Za-z0-9_-]{1,160}$/)}).refine(v=>v.grant.clientId===v.registration.clientId&&v.grant.registrationRevision===v.registration.registration.registrationRevision&&v.grant.resource===v.registration.registration.resource);import{z as z55}from"zod";var NativeToolAuthorityFailureSchema=z55.strictObject({semanticStatus:z55.enum(["INVALID_INPUT","NOT_FOUND","BLOCKED","REVISION_CONFLICT","CAPABILITY_UNAVAILABLE","INTERNAL_OPERATIONAL_FAILURE"]),error:z55.strictObject({code:z55.enum(["INVALID_INPUT","UNAUTHENTICATED","FORBIDDEN","NOT_FOUND","BINDING_UNAVAILABLE","REQUEST_CONFLICT","REVISION_CONFLICT","GRANT_CONFLICT","GRANT_EXPIRED","GRANT_REVOKED","PROOF_INVALID","PROOF_REPLAY","CHALLENGE_EXPIRED","PERMIT_UNAVAILABLE","QUALIFICATION_UNAVAILABLE","CREDENTIAL_INVALID","CREDENTIAL_EXPIRED","CREDENTIAL_UNAVAILABLE","CREDENTIAL_LIMIT","HOST_RUN_UNAVAILABLE","INTERNAL_OPERATIONAL_FAILURE"]),message:z55.literal("Native tool authority operation did not complete")})});import{z as z56}from"zod";var NativeToolGatewayDescriptorSchema=z56.strictObject({name:z56.string().regex(/^[a-z][a-z0-9_]{0,99}$/),inputSchemaFingerprint:z56.string().regex(/^[a-f0-9]{64}$/),scope:z56.enum(["PRODUCTION","PROJECT_READ"]),readOnly:z56.boolean()});var NativeToolGatewayManifestSchema=z56.strictObject({protocol:z56.literal("NATIVESTUDIO_NATIVE_MCP_V1"),policy:z56.literal("NVS_PROJECT_READ_PRODUCTION_WRITE_V1"),tools:z56.array(NativeToolGatewayDescriptorSchema).min(1).max(256)}).refine(v=>v.tools.every((tool,index)=>index===0||v.tools[index-1].name<tool.name));var NativeToolGatewayContractSchema=z56.strictObject({manifest:NativeToolGatewayManifestSchema,capabilityDigest:z56.string().regex(/^[a-f0-9]{64}$/)});import{z as z57}from"zod";var id6=z57.uuid().regex(/^[0-9a-f-]{36}$/);var sha13=z57.string().regex(/^[a-f0-9]{64}$/);var key8=z57.string().regex(/^[A-Za-z0-9_-]{1,160}$/);var NativeRuntimeQualificationSchema=z57.strictObject({protocol:z57.literal("NATIVESTUDIO_RUNTIME_TOOLS_V1"),runtimeKey:key8,installationId:key8,installationRevisionId:key8,resource:z57.url().max(2048),publicKeyFingerprint:sha13,bindingId:id6,configurationVersion:z57.int().positive(),selection:AgentHostSelectionSchema,capabilityDigest:sha13,executionClass:z57.enum(["LIVE","TEST_ONLY"]),transport:AgentHostInstallationTransportSchema.optional()});var NativeToolPermitSchema=z57.strictObject({proof:AgentHostNativeToolAuthoritySchema,input:AgentHostExecutionInputSchema,grant:NativeToolGrantViewSchema,qualification:NativeRuntimeQualificationSchema,requestedByPrincipalId:id6,createdAt:z57.iso.datetime({offset:true})}).refine(v=>v.proof.tenantId===v.input.tenantId&&v.proof.projectId===v.input.projectId&&v.proof.productionId===v.input.productionId&&v.proof.executionId===v.input.executionId&&v.proof.hostRequestId===v.input.hostRequestId&&v.grant.tenantId===v.input.tenantId&&v.grant.projectId===v.input.projectId&&v.grant.enabled&&v.grant.verifiedAt!==null&&v.proof.bindingId===v.grant.bindingId&&v.proof.configurationVersion===v.grant.configurationVersion&&v.qualification.runtimeKey===v.grant.runtimeKey&&v.qualification.installationId===v.grant.installationId&&v.qualification.installationRevisionId===v.grant.installationRevisionId&&v.qualification.resource===v.grant.resource&&v.qualification.bindingId===v.grant.bindingId&&v.qualification.configurationVersion===v.grant.configurationVersion&&v.qualification.capabilityDigest===v.proof.capabilityDigest&&v.qualification.executionClass===v.proof.executionClass&&(v.proof.transport===void 0?v.qualification.transport===void 0:v.qualification.transport?.protocol===v.proof.transport.protocol&&v.qualification.transport.installationId===v.proof.transport.installationId&&v.qualification.transport.installationRevisionId===v.proof.transport.installationRevisionId&&v.qualification.transport.slotKey===v.proof.transport.slotKey&&(v.proof.transport.protocol!=="AGENT_STACK_GENERIC_INSTALLATION_V3"||v.qualification.transport.protocol==="AGENT_STACK_GENERIC_INSTALLATION_V3"&&v.qualification.transport.contractDigest===v.proof.transport.contractDigest&&v.qualification.transport.capabilityDigest===v.proof.transport.capabilityDigest)&&v.proof.transport.installationId===v.grant.installationId&&v.proof.transport.installationRevisionId===v.grant.installationRevisionId)&&Date.parse(v.proof.expiresAt)<=Date.parse(v.grant.expiresAt));var NativeToolPermitGetSchema=AgentHostExecutionScopeSchema.extend({authorityRef:id6});var NativeExecutionProofClaimsSchema=AgentHostExecutionScopeSchema.extend({iss:key8,sub:key8,aud:z57.url().max(2048),grantId:id6,grantRevision:z57.int().positive(),installationRevisionId:key8,authorityRef:id6,executionId:id6,hostRequestId:id6,inputFingerprint:sha13,runKey:key8,jti:id6,iat:z57.int().nonnegative(),exp:z57.int().positive()}).refine(v=>v.exp>v.iat&&v.exp-v.iat<=60);var NativeToolCredentialExchangeSchema=NativeToolPermitGetSchema.extend({assertion:z57.string().regex(/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/).max(8192).meta({writeOnly:true})});var NativeToolCredentialMetadataSchema=NativeToolPermitGetSchema.extend({protocol:z57.literal("NATIVESTUDIO_NATIVE_CREDENTIAL_V1"),tokenId:id6,grantId:id6,grantRevision:z57.int().positive(),executionId:id6,hostRequestId:id6,runKey:key8,jti:id6,assertionFingerprint:sha13,tokenFingerprint:sha13,issuedAt:z57.iso.datetime({offset:true}),expiresAt:z57.iso.datetime({offset:true})});var NativeToolCredentialReplySchema=z57.strictObject({tokenType:z57.literal("Bearer"),accessToken:z57.string().regex(/^nvst_[0-9a-f-]{36}\.[A-Za-z0-9_-]{43}$/).meta({readOnly:true}),tokenId:id6,resource:z57.url().max(2048),expiresAt:z57.iso.datetime({offset:true})}).refine(v=>v.accessToken.startsWith(`nvst_${v.tokenId}.`));var NativeToolSessionSchema=NativeToolPermitGetSchema.extend({authorityProtocol:z57.literal("NVS_GENERIC_EXECUTION_V1").optional(),tokenId:id6,executionId:id6,hostRequestId:id6,grantId:id6,grantRevision:z57.int().positive(),runKey:key8,runtimePrincipalId:id6,approvedByPrincipalId:id6,requestedByPrincipalId:id6,capabilityDigest:sha13,resource:z57.url().max(2048),issuer:z57.url().max(2048),subject:z57.string().max(200),executionClass:z57.enum(["LIVE","TEST_ONLY"]),expiresAt:z57.iso.datetime({offset:true})});import{z as z58}from"zod";var CreateProductionRequestSchema=z58.strictObject({tenantId:TenantIdSchema,projectId:ProjectIdSchema,idempotencyKey:z58.string().trim().min(1).max(200)});var CreatedProductionResultSchema=CreatedProjectResultSchema;import{z as z59}from"zod";var VisualSequenceScopeSchema=z59.strictObject({tenantId:TenantIdSchema,projectId:ProjectIdSchema});var RegisterVisualSequenceSchema=VisualSequenceScopeSchema.extend({productionId:ProductionIdSchema.nullable(),idempotencyKey:z59.string().trim().min(1).max(200),width:z59.int().min(1).max(1920),height:z59.int().min(1).max(1920),frameArtifactIds:z59.array(ArtifactIdSchema).min(1).max(360)}).refine(v=>v.width*v.height<=1920*1080&&new Set(v.frameArtifactIds).size===v.frameArtifactIds.length,"Sequence requires bounded geometry and unique ordered frame Artifacts");var VisualSequenceGetSchema=VisualSequenceScopeSchema.extend({artifactId:ArtifactIdSchema});var VisualSequenceViewSchema=z59.strictObject({sequence:VisualFrameSequenceSchema,freshness:z59.enum(["CURRENT_BASIS","STALE_BASIS"]),staleReasons:z59.array(z59.enum(["SEQUENCE_UNAVAILABLE","FRAME_UNAVAILABLE"])).max(2),createdAt:z59.iso.datetime({offset:true})});var VisualSequenceQuerySchema=VisualSequenceScopeSchema.extend({limit:QueryLimitSchema,next:ContinuationSchema.optional()});var VisualSequencePageSchema=z59.strictObject({items:z59.array(VisualSequenceViewSchema).max(100),page:QueryPageInfoSchema});var{checksumSha256:_checksum,...manifestShape}=VisualFrameSequenceSchema.shape;var VisualSequenceManifestSchema=z59.strictObject(manifestShape).superRefine((value,context)=>{if(!VisualFrameSequenceSchema.safeParse({...value,checksumSha256:"0".repeat(64)}).success)context.addIssue({code:"custom",message:"Invalid canonical frame sequence manifest"})});import{z as z60}from"zod";var sha14=z60.string().regex(/^[0-9a-f]{64}$/);var WavExportResultSchema=z60.strictObject({contentType:z60.literal("audio/wav"),checksumSha256:sha14,byteSize:z60.int().min(44).max(12582912),contentBase64:z60.string().min(60).max(16777216).regex(/^[A-Za-z0-9+/]+={0,2}$/)});var AudioExportResultSchema=WavExportResultSchema.extend({representationId:z60.uuid()});var CaptionExportResultSchema=z60.strictObject({contentType:z60.enum(["application/json","application/x-subrip"]),checksumSha256:sha14,representationId:z60.uuid(),text:z60.string().min(1).max(131072)});import{z as z61}from"zod";var tenant=TenantIdSchema.transform(v=>v.toLowerCase());var project=ProjectIdSchema.transform(v=>v.toLowerCase());var production=ProductionIdSchema.transform(v=>v.toLowerCase());var artifact=ArtifactIdSchema.transform(v=>v.toLowerCase());var representation=ArtifactRepresentationIdSchema.transform(v=>v.toLowerCase());var DiscoverableArtifactFamilySchema=z61.enum(["KEYFRAME_CANDIDATE","SHOT_CANDIDATE","COMPOSITION_RENDER_OUTPUT","ROUGH_CUT","FINAL_RENDER_OUTPUT","IMPORTED_VISUAL_ORIGINAL","IMPORTED_VISUAL_NORMALIZED","IMPORTED_VISUAL_POSTER","AUDIO","AUDIO_SOURCE_SYNC","CAPTION","CONTACT_SHEET"]);var DiscoveryContentTypeSchema=z61.enum(["image/png","image/jpeg","image/webp","video/mp4","audio/wav","audio/mpeg","application/json","text/plain","application/x-subrip"]);var ArtifactDiscoveryQuerySchema=z61.strictObject({tenantId:tenant,projectId:project.optional(),productionId:production.optional(),family:DiscoverableArtifactFamilySchema.optional(),search:z61.string().trim().min(1).max(200).optional(),lifecycle:z61.enum(["READY","ARCHIVED"]).default("READY"),limit:QueryLimitSchema,next:ContinuationSchema.optional()});var ArtifactDiscoveryMediaSchema=z61.strictObject({tenantId:tenant,projectId:project,artifactId:artifact,representationId:representation});var ArtifactDiscoveryItemSchema=z61.strictObject({artifactId:ArtifactIdSchema,projectId:ProjectIdSchema,projectName:z61.string().min(1).max(200),productionId:ProductionIdSchema.nullable(),representationId:ArtifactRepresentationIdSchema,family:DiscoverableArtifactFamilySchema,lifecycle:z61.enum(["READY","ARCHIVED"]),origin:z61.string().min(1).max(120),contentType:DiscoveryContentTypeSchema,checksumSha256:z61.string().regex(/^[a-f0-9]{64}$/),byteSize:z61.int().positive(),width:z61.int().positive().nullable(),height:z61.int().positive().nullable(),durationMs:z61.int().nonnegative().nullable(),createdAt:z61.iso.datetime({offset:true}),originalName:z61.string().max(255).nullable(),executionClass:z61.enum(["LIVE","TEST_ONLY","UNKNOWN"]),mediaAvailable:z61.boolean(),sourceVersionId:z61.uuid().nullable(),normalizationId:z61.uuid().nullable()});var ArtifactDiscoveryPageSchema=z61.strictObject({items:z61.array(ArtifactDiscoveryItemSchema).max(100),page:QueryPageInfoSchema});import{z as z62}from"zod";var ExternalGrantQuerySchema=z62.strictObject({tenantId:z62.uuid()});var ExternalGrantPageSchema=z62.strictObject({items:z62.array(z62.strictObject({grantId:z62.uuid(),projectId:z62.uuid(),displayName:z62.string().max(100),scopes:z62.array(z62.enum(["nvs:read","nvs:write"])).min(1).max(2),expiresAt:z62.iso.datetime()})).max(100),possiblyTruncated:z62.boolean()});var ExternalAccessScopeSchema=z62.enum(["nvs:read","nvs:write"]);var ExternalProjectScopeSchema=z62.strictObject({tenantId:z62.uuid(),projectId:z62.uuid()});var redirect=z62.string().min(1).max(2048).superRefine((value,ctx)=>{try{const u=new URL(value);if(u.username||u.password||u.hash||!(u.protocol==="https:"||u.protocol==="http:"&&["127.0.0.1","[::1]"].includes(u.hostname)||u.protocol==="workbuddy:"))throw Error()}catch{ctx.addIssue({code:"custom",message:"Invalid registered callback"})}});var RegisterExternalClientSchema=ExternalProjectScopeSchema.extend({displayName:z62.string().trim().min(1).max(100),redirectUris:z62.array(redirect).min(1).max(16).refine(v=>new Set(v).size===v.length)});var DynamicExternalClientSchema=z62.object({client_name:z62.string().trim().min(1).max(100).default("External MCP client"),redirect_uris:z62.array(redirect).min(1).max(16).refine(v=>new Set(v).size===v.length),token_endpoint_auth_method:z62.literal("none").default("none"),grant_types:z62.array(z62.enum(["authorization_code","refresh_token"])).min(1).max(2).optional(),response_types:z62.array(z62.literal("code")).length(1).optional(),application_type:z62.enum(["native","web"]).optional()});var ExternalAuthorizationSchema=z62.strictObject({response_type:z62.literal("code"),client_id:z62.uuid(),redirect_uri:redirect,resource:z62.url().max(2048),scope:z62.string().max(100).refine(value=>{const scopes=value.split(" ");return scopes.includes("nvs:read")&&new Set(scopes).size===scopes.length&&scopes.every(s=>ExternalAccessScopeSchema.safeParse(s).success)}),state:z62.string().min(16).max(1024),code_challenge:z62.string().regex(/^[A-Za-z0-9_-]{43}$/),code_challenge_method:z62.literal("S256")});var commonToken={client_id:z62.uuid(),resource:z62.url().max(2048)};var ExternalTokenRequestSchema=z62.discriminatedUnion("grant_type",[z62.strictObject({...commonToken,grant_type:z62.literal("authorization_code"),code:z62.string().regex(/^nvsc_[A-Za-z0-9_-]{43}$/),redirect_uri:redirect,code_verifier:z62.string().regex(/^[A-Za-z0-9._~-]{43,128}$/)}),z62.strictObject({...commonToken,grant_type:z62.literal("refresh_token"),refresh_token:z62.string().regex(/^nvsr_[A-Za-z0-9_-]{43}$/)})]);var ExternalRevocationSchema=z62.strictObject({client_id:z62.uuid(),token:z62.string().regex(/^(nvsa_|nvsr_)[A-Za-z0-9_-]{43}$/),token_type_hint:z62.enum(["access_token","refresh_token"]).optional()});import{z as z63}from"zod";var TerminateProductionSchema=z63.strictObject({tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,outcome:z63.enum(["FAILED","CANCELLED"]),expectedProductionRevision:z63.int().positive(),reason:z63.string().trim().min(1).max(1e3),idempotencyKey:z63.string().trim().min(1).max(200)});var ProductionTerminationReceiptSchema=z63.strictObject({decisionId:z63.uuid(),productionId:ProductionIdSchema,projectId:ProjectIdSchema,state:ProductionStateSchema});import{z as z64}from"zod";var text3=z64.string().trim().min(1).max(600);var key9=z64.string().regex(/^[a-z][a-z0-9_-]{0,39}$/);var Review1RepairSourceResultSchema=z64.strictObject({input:Review1RepairSourceQuerySchema,source:Review1RepairSourceSchema,productionRevision:z64.int().positive(),caseVersion:z64.int().nonnegative(),budget:SemanticRepairBudgetSchema.nullable()}).superRefine((v,c)=>{const fields=["tenantId","projectId","productionId","mediaType","generationId","reviewId"];if(fields.some(key10=>v.input[key10]!==v.source[key10])||v.input.requirementKey!==v.source.requirement.key)c.addIssue({code:"custom",message:"Native source must match the exact scoped Review obligation"})});var Review1RepairStrategyBasisSchema=z64.strictObject({input:Review1RepairSourceQuerySchema,contextFingerprint:z64.string().regex(/^[0-9a-f]{64}$/)});var Review1RepairStrategyContextSchema=z64.strictObject({semanticStatus:z64.literal("SUCCESS"),advisory:z64.literal(true),basis:Review1RepairStrategyBasisSchema,owner:Review1RepairSourceResultSchema});var ValidateReview1RepairStrategySchema=z64.strictObject({basis:Review1RepairStrategyBasisSchema,budget:SemanticRepairBudgetSchema.optional(),proposal:z64.strictObject({origin:z64.strictObject({kind:z64.literal("EXTERNAL_AGENT_HOST"),label:z64.string().trim().min(1).max(100)}),summary:text3,alternatives:z64.array(z64.strictObject({id:key9,rationale:text3,whySmallerChangeInsufficient:text3,action:z64.discriminatedUnion("kind",[z64.strictObject({kind:z64.literal("REGENERATE_SHOT")}),z64.strictObject({kind:z64.literal("REQUEST_HUMAN_INPUT"),question:text3}),z64.strictObject({kind:z64.literal("REQUEST_CANONICAL_CHANGE"),requestedChange:text3})])})).min(1).max(6),selectedAlternativeId:key9})}).refine(v=>new TextEncoder().encode(JSON.stringify(v)).byteLength<=1024*1024,"Review-1 strategy exceeds 1 MiB");var Review1RepairStrategyValidationSchema=z64.strictObject({semanticStatus:z64.literal("SUCCESS"),advisory:z64.literal(true),basis:Review1RepairStrategyBasisSchema,proposal:ValidateReview1RepairStrategySchema.shape.proposal,alternatives:z64.array(z64.strictObject({alternativeId:key9,handoff:z64.discriminatedUnion("kind",[z64.strictObject({kind:z64.literal("AUTHOR_REVIEW1_REPAIR"),input:AuthorReview1RepairSchema.omit({idempotencyKey:true})}),z64.strictObject({kind:z64.literal("HUMAN_INPUT_INTENT"),question:text3}),z64.strictObject({kind:z64.literal("CANONICAL_CHANGE_INTENT"),requestedChange:text3})])})).min(1).max(6),selectedAlternativeId:key9,followUp:z64.union([z64.tuple([]),z64.tuple([z64.literal("EXPLICIT_NATIVE_AUTHORING"),z64.literal("OWNER_BUDGET_AND_COST_ADMISSION"),z64.literal("EXPLICIT_NATIVE_EXECUTION"),z64.literal("INDEPENDENT_REVIEW_1_AND_NATIVE_PROOF")])])});import{z as z66}from"zod";import{z as z65}from"zod";var NavigationGroupIdSchema=z65.enum(["navigation","materials","planning","execution","review","delivery","local","administration","unclassified"]);var NavigationGroups=Object.freeze([{id:"navigation",title:"\u5BFC\u822A\u4E0E\u6062\u590D",description:"Locate Productions, inspect state and reconcile original Operations"},{id:"materials",title:"\u9879\u76EE\u4E0E\u7D20\u6750",description:"Projects, source material, references and Artifact discovery"},{id:"planning",title:"\u521B\u4F5C\u4E0E\u8BA1\u5212",description:"Brief, Story, Scenes, Shots and creative plans"},{id:"execution",title:"\u6267\u884C\u4E0E\u8FDB\u5EA6",description:"Generation, runtime Jobs, observation and cancellation"},{id:"review",title:"\u5BA1\u67E5\u4E0E\u4FEE\u590D",description:"Review targets, Findings, evidence and repair"},{id:"delivery",title:"\u88C5\u914D\u4E0E\u4EA4\u4ED8",description:"Timeline, composition, preview, rendering and delivery"},{id:"local",title:"\u672C\u5730\u6267\u884C",description:"Authorized local Runtime, media tools and Agent connections"},{id:"administration",title:"\u7BA1\u7406\u4E0E\u96C6\u6210",description:"Tenant integration, Providers and native authority configuration"},{id:"unclassified",title:"\u5F85\u5206\u7C7B\u80FD\u529B",description:"Registered capabilities awaiting explicit semantic classification"}]);var namespaces=[["navigation",/^nvs_open_execution$/],["local",/^local_/],["administration",/^(?:provider_|tenant_|oauth_|credential_|native_tool_|agent_host_|webhook_)/],["review",/(?:^|_)(?:review|reviewer|finding|repair)(?:_|$)/],["navigation",/^(?:studio_|operation_|production_(?:query|snapshot)|job_(?:get|query)|production_guidance_)/],["materials",/^(?:project_|source_|artifact_|reference_|visual_sequence_|imported_visual_|source_sync_)/],["planning",/^(?:brief_|story_|scene_|shot_|writer_|director_|exploration_|consistency_|making_|sound_plan_|planning_|editor_)/],["delivery",/^(?:timeline_|composition_|rough_cut_|final_|delivery_|caption_|audio_)/],["execution",/^(?:production_|keyframe_|video_|generation_|speech_|media_observation_|temporal_evidence_|lifecycle_)/]];function navigationGroup(tool){return namespaces.find(([,pattern])=>pattern.test(tool))?.[0]??"unclassified"}var NavigationProfile="contextual-v1";var NavigationProfileKey="io.nativestudio/discovery-profile";var NavigationToolNames=["studio_start","studio_capability_search","studio_capability_describe","studio_capability_groups","studio_navigate"];var Scope=z66.object({tenantId:TenantIdSchema,projectId:ProjectIdSchema.optional()});var ToolName=z66.string().regex(/^[a-zA-Z0-9_-]{1,120}$/);var StudioStartInputSchema=ProductionQueryInputSchema.extend({limit:z66.int().min(1).max(5).default(5)}).strict();var StudioStartSchema=z66.object({tenantId:TenantIdSchema,choices:ProductionQueryPageSchema.shape.items.max(5),page:ProductionQueryPageSchema.shape.page,selection:z66.enum(["NONE","ONE","CHOOSE"]),guidance:z66.literal("Select an explicit Production ID, then call studio_navigate. Never infer an ID.")}).strict();var CapabilitySummarySchema=z66.object({tool:ToolName,title:z66.string().max(500),description:z66.string().max(6e3),family:z66.string().min(1).max(120),group:NavigationGroupIdSchema.optional(),readOnly:z66.boolean(),registration:z66.literal("REGISTERED")}).strict();var CapabilitySearchInputSchema=Scope.extend({query:z66.string().trim().min(1).max(240),family:z66.string().regex(/^[a-z0-9_-]{1,120}$/).optional(),group:NavigationGroupIdSchema.optional(),limit:z66.int().min(1).max(8).default(5),next:z66.string().min(1).max(2048).optional()}).strict();var CapabilitySearchSchema=z66.object({tenantId:TenantIdSchema,catalogVersion:z66.string().regex(/^[a-f0-9]{64}$/),outcome:z66.enum(["MATCHES","AMBIGUOUS","NO_MATCH"]),candidates:z66.array(CapabilitySummarySchema.extend({matchedTerms:z66.array(z66.string().max(120)).max(24)})).max(8),page:z66.object({hasMore:z66.boolean(),next:z66.string().max(2048).nullable()}).strict(),guidance:z66.literal("Registration is not availability or authorization. Inspect the selected schema and native context before invoking its typed command.")}).strict();var CapabilityDescribeInputSchema=Scope.extend({tool:ToolName,schemaCursor:z66.string().min(1).max(2048).optional()}).strict();var CapabilityGroupsInputSchema=Scope.strict();var CapabilityGroupsSchema=z66.object({tenantId:TenantIdSchema,catalogVersion:z66.string().regex(/^[a-f0-9]{64}$/),groups:z66.array(z66.object({id:NavigationGroupIdSchema,title:z66.string().max(120),description:z66.string().max(500),count:z66.int().nonnegative(),readOnlyCount:z66.int().nonnegative()}).strict()).max(9)}).strict();var JsonSchema=z66.record(z66.string(),z66.unknown());var PublicToolDefinitionSchema=z66.object({name:ToolName,title:z66.string().optional(),description:z66.string().optional(),inputSchema:JsonSchema,outputSchema:JsonSchema.optional(),annotations:JsonSchema.optional(),execution:JsonSchema.optional(),_meta:JsonSchema.optional(),icons:z66.array(JsonSchema).optional()}).strict();var CapabilityDescribeSchema=CapabilitySummarySchema.extend({tenantId:TenantIdSchema,catalogVersion:z66.string().regex(/^[a-f0-9]{64}$/),inputSchema:JsonSchema,outputSchema:JsonSchema.nullable(),outputContract:z66.enum(["DECLARED","NOT_DECLARED"]),schemaCursor:z66.string().min(1).max(2048),definition:PublicToolDefinitionSchema.optional(),guidance:z66.literal("Use this bounded definition as client-local schema metadata. Standard tools/list stays stable; commands revalidate authority and current state.")}).strict();var StudioNavigateInputSchema=Scope.extend({productionId:ProductionIdSchema,goal:z66.string().trim().min(1).max(240).optional(),actionLimit:z66.int().min(1).max(8).default(8).describe("Native action page size: 1\u20138 (default 8). Omit this field unless a smaller page is needed."),actionNext:z66.string().min(1).max(2048).optional().describe("Opaque actions.page.next; keep the same goal and actionLimit. Changed native state requires a fresh first page.")}).strict();import{z as z67}from"zod";var Evidence=z67.object({path:z67.string().min(1).max(120)}).strict();var StudioNavigationSchema=z67.object({tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,evidence:z67.object({source:z67.literal("production_snapshot"),revision:z67.int().positive(),generatedAt:z67.iso.datetime({offset:true})}).strict(),state:ProductionSnapshotSchema.shape.state.extend({blockingReason:z67.string().max(1e3).nullable(),waitingReason:z67.string().max(1e3).nullable()}),stateReasonsTruncated:z67.object({blockingReason:z67.boolean(),waitingReason:z67.boolean()}).strict(),planning:ProductionSnapshotSchema.shape.planning,shots:ProductionSnapshotSchema.shape.shots,work:ProductionSnapshotSchema.shape.work,findings:ProductionSnapshotSchema.shape.findings,timeline:ProductionSnapshotSchema.shape.timeline.pick({currentVersion:true,stale:true}),final:ProductionSnapshotSchema.shape.final.pick({renderState:true,deliveryValidationState:true}),blockers:z67.object({total:z67.int().nonnegative(),truncated:z67.boolean(),items:z67.array(ProductionSnapshotSchema.shape.blockers.element.extend({evidence:Evidence})).max(10)}).strict(),actions:z67.object({total:z67.int().nonnegative(),truncated:z67.boolean(),items:z67.array(NextActionSchema.extend({tool:z67.string().min(1).max(120).nullable(),registration:z67.enum(["REGISTERED","NOT_ON_SURFACE"]),readOnly:z67.boolean().nullable(),purpose:z67.string().max(500).nullable(),group:NavigationGroupIdSchema.nullable(),context:z67.object({tenantId:TenantIdSchema,projectId:ProjectIdSchema,productionId:ProductionIdSchema,revision:z67.int().positive()}).strict(),inputHints:z67.object({knownInputs:z67.partialRecord(z67.enum(["tenantId","projectId","productionId","shotId","sceneId","findingId","operationId","artifactId"]),z67.string().min(1).max(2048)),schemaFingerprint:z67.string().regex(/^[a-f0-9]{64}$/).nullable(),requiredInputs:z67.array(z67.string()).max(128),missingInputs:z67.array(z67.string()).max(128),schemaInspectionRequired:z67.literal(true)}).strict().nullable(),recommendation:z67.array(z67.enum(["NATIVE_AVAILABLE","NATIVE_UNAVAILABLE","GOAL_MATCH","INSPECT_SCHEMA","NOT_ON_SURFACE"])).max(4),inspect:z67.object({tool:z67.literal("studio_capability_describe"),arguments:CapabilityDescribeInputSchema}).strict().nullable(),evidence:Evidence})).max(8),page:z67.object({hasMore:z67.boolean(),next:z67.string().max(2048).nullable()}).strict()}).strict(),operations:z67.object({total:z67.int().nonnegative(),truncated:z67.boolean(),items:z67.array(OperationSummarySchema.pick({id:true,productionId:true,semanticStatus:true,startedAt:true,updatedAt:true}).extend({inspect:z67.object({tool:z67.literal("operation_get"),arguments:z67.object({tenantId:TenantIdSchema,productionId:ProductionIdSchema,operationId:OperationSummarySchema.shape.id}).strict()}).strict().nullable(),targetCount:z67.int().nonnegative(),blockerCount:z67.int().nonnegative(),evidence:Evidence})).max(5)}).strict(),related:CapabilitySearchSchema.nullable(),guidance:z67.literal("Use native IDs and revision from this snapshot. An outstanding or unacknowledged write must be reconciled through its Operation; never replay it automatically. Commands revalidate current authority, prerequisites, revision and idempotency.")}).strict();function abortable(promise,signal){if(signal.aborted){void promise.catch(()=>{});return Promise.reject(signal.reason)}return new Promise((resolve,reject)=>{const abort=()=>reject(signal.reason);signal.addEventListener("abort",abort,{once:true});promise.then(resolve,reject).finally(()=>signal.removeEventListener("abort",abort))})}async function boundedResponseBytes(response,limit,signal){const length=response.headers.get("content-length");if(length!==null&&(!/^\d+$/.test(length)||Number(length)>limit)){void response.body?.cancel().catch(()=>{});throw new NativeStudioSdkError("RESPONSE_TOO_LARGE","INTERNAL_OPERATIONAL_FAILURE","UNKNOWN")}if(!response.body)return new Uint8Array;const reader=response.body.getReader();const chunks=[];let size=0;try{while(true){const next=await abortable(reader.read(),signal);if(next.done)break;size+=next.value.byteLength;if(size>limit)throw new NativeStudioSdkError("RESPONSE_TOO_LARGE","INTERNAL_OPERATIONAL_FAILURE","UNKNOWN");chunks.push(next.value)}const result=new Uint8Array(size);let offset=0;for(const chunk of chunks){result.set(chunk,offset);offset+=chunk.byteLength}return result}finally{void reader.cancel().catch(()=>{});reader.releaseLock()}}var nativeFailureCodes=new Set([...NativeToolAuthorityFailureSchema.shape.error.shape.code.options,"REQUEST_CONFLICT","HOST_UNAVAILABLE","CREDENTIAL_UNAVAILABLE","CREDENTIAL_SCOPE_MISMATCH","BINDING_REVOKED","UNAUTHENTICATED","FORBIDDEN","NOT_FOUND","INVALID_INPUT","REVISION_CONFLICT","STALE_BASIS","BLOCKED","CAPABILITY_UNAVAILABLE","PROVIDER_UNAVAILABLE","BUDGET_BLOCKED","CANCELLED","SUPERSEDED","INTERNAL_OPERATIONAL_FAILURE","IDEMPOTENCY_CONFLICT","INPUT_UNAVAILABLE","AUDIO_UNAVAILABLE","CAPTION_UNAVAILABLE","TEST_EVIDENCE_DENIED","CONFLICT","INVALID_MEDIA","LEASE_LOST","SOURCE_UNAVAILABLE","TOOL_AUTHORITY_UNAVAILABLE","ACTIVE_EXECUTION_EXISTS","BINDING_UNAVAILABLE","PROVIDER_CAPABILITY_UNAVAILABLE","REPLAY_EXHAUSTED"]);var statuses={400:["INVALID_INPUT"],413:["INVALID_INPUT"],415:["INVALID_INPUT"],401:["BLOCKED"],403:["BLOCKED"],404:["NOT_FOUND"],409:["REVISION_CONFLICT","STALE_BASIS","BLOCKED","CAPABILITY_UNAVAILABLE","BUDGET_BLOCKED","CANCELLED","SUPERSEDED"],422:["INVALID_INPUT"],429:["BUDGET_BLOCKED","PROVIDER_UNAVAILABLE"]};async function nativeFailure(response,signal){try{if(response.headers.get("content-type")?.split(";")[0]?.trim()!=="application/json")return null;const bytes=await boundedResponseBytes(response,64*1024,signal);const raw=JSON.parse(new TextDecoder("utf-8",{fatal:true}).decode(bytes));if(!raw||typeof raw!=="object"||Array.isArray(raw))return null;const record=raw;const status=InterfaceSemanticStatusSchema.safeParse(record.semanticStatus);if(!status.success||!(statuses[response.status]??(response.status>=500?["INTERNAL_OPERATIONAL_FAILURE","PROVIDER_UNAVAILABLE","CAPABILITY_UNAVAILABLE"]:[])).includes(status.data))return null;const error=record.error;const code=error&&typeof error==="object"?error.code:void 0;return{semanticStatus:status.data,code:typeof code==="string"&&nativeFailureCodes.has(code)?code:status.data}}catch{return null}finally{void response.body?.cancel().catch(()=>{})}}var NativeStudioHttpTransport=class{constructor(config){this.config=config;try{this.origin=new URL(config.baseUrl);if(this.origin.username||this.origin.password||this.origin.search||this.origin.hash||this.origin.pathname!=="/"||this.origin.protocol!=="https:"&&!(this.origin.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(this.origin.hostname)))sdkInputError()}catch{sdkInputError()}this.timeout=config.timeoutMs??3e4;this.jsonLimit=config.maxJsonBytes??16*1024*1024;if(!Number.isSafeInteger(this.timeout)||this.timeout<1||this.timeout>3e5||!Number.isSafeInteger(this.jsonLimit)||this.jsonLimit<1024||this.jsonLimit>32*1024*1024)sdkInputError()}config;origin;timeout;jsonLimit;async response(request,options){const write=request.method==="POST"&&!request.readOnly;if(!request.path.startsWith("/v1/")||request.path.includes("?")||request.path.includes("#")||request.path.includes(".."))sdkInputError();const url=new URL(request.path,this.origin);if(url.origin!==this.origin.origin||!url.pathname.startsWith("/v1/")||!["GET","POST"].includes(request.method)||!TenantIdSchema.safeParse(request.tenantId).success)sdkInputError();for(const[key10,value]of Object.entries(request.query??{}))if(value!==void 0)url.searchParams.set(key10,String(value));let body;try{if(request.importedVideo){const v=request.importedVideo;if(request.method!=="POST"||request.body!==void 0||!/^\/v1\/productions\/[a-f0-9-]{36}\/imported-visuals\/originals\/bytes$/i.test(request.path)||!(v.bytes instanceof Uint8Array)||v.bytes.length<32||v.bytes.length>128*1024*1024||!/^[A-Za-z0-9_-]+$/.test(v.metadata)||v.metadata.length>8192)sdkInputError();body=new Uint8Array(v.bytes)}else body=request.body===void 0?void 0:JSON.stringify(request.body);if(typeof body==="string"&&new TextEncoder().encode(body).byteLength>18*1024*1024)sdkInputError()}catch{sdkInputError()}const timeout=AbortSignal.timeout(this.timeout);const signal=options.signal?AbortSignal.any([options.signal,timeout]):timeout;if(signal.aborted)throw new NativeStudioSdkError("REQUEST_ABORTED","BLOCKED","NO_WRITE");let authorization;if(request.authentication==="runtime-proof"){if(request.method!=="POST"||!/^\/v1\/projects\/[0-9a-f-]{36}\/(?:native-tool-grants\/[0-9a-f-]{36}\/(?:proof|status)|productions\/[0-9a-f-]{36}\/native-tool-credentials\/exchange)$/.test(request.path))sdkInputError()}else{try{authorization=await abortable(Promise.resolve().then(()=>this.config.authorization(signal)),signal)}catch{throw new NativeStudioSdkError(signal.aborted?"REQUEST_ABORTED":"UNAUTHENTICATED","BLOCKED","NO_WRITE")}if(typeof authorization!=="string"||!/^Bearer [A-Za-z0-9._~+/-]+={0,2}$/.test(authorization)||authorization.length>16384)throw new NativeStudioSdkError("UNAUTHENTICATED","BLOCKED","NO_WRITE")}if(signal.aborted)throw new NativeStudioSdkError("REQUEST_ABORTED","BLOCKED","NO_WRITE");try{const pending=Promise.resolve().then(()=>(this.config.fetch??fetch)(url,{method:request.method,redirect:"error",cache:"no-store",signal,headers:{...authorization===void 0?{}:{authorization},"x-native-tenant-id":request.tenantId,accept:"application/json",...request.body===void 0?{}:{"content-type":"application/json"},...request.importedVideo?{"content-type":"video/mp4","x-native-import-metadata":request.importedVideo.metadata}:{}},...body===void 0?{}:{body}}));void pending.then(late=>{if(signal.aborted)void late.body?.cancel().catch(()=>{})},()=>{});const response=await abortable(pending,signal);if(!response.ok){const status=response.status;const native=await nativeFailure(response,signal);const code=status===401?"UNAUTHENTICATED":status===403?"FORBIDDEN":status===404?"NOT_FOUND":status===400||status===413||status===415||status===422?"INVALID_INPUT":status===409?"REVISION_CONFLICT":"HTTP_FAILURE";const semanticStatus=status===401||status===403?"BLOCKED":status===404?"NOT_FOUND":status===400||status===413||status===415||status===422?"INVALID_INPUT":status===409?"REVISION_CONFLICT":"INTERNAL_OPERATIONAL_FAILURE";throw new NativeStudioSdkError(native?.code??code,native?.semanticStatus??semanticStatus,status>=500&&write?"UNKNOWN":"REJECTED",status)}return{response,signal}}catch(error){if(error instanceof NativeStudioSdkError)throw error;throw new NativeStudioSdkError(write?"OUTCOME_UNKNOWN":signal.aborted?"REQUEST_ABORTED":"TRANSPORT_UNAVAILABLE","INTERNAL_OPERATIONAL_FAILURE",write?"UNKNOWN":"NO_WRITE")}}async json(request,schema,options={}){const{response,signal}=await this.response(request,options);try{const contentType=response.headers.get("content-type")?.split(";")[0]?.trim();if(contentType!=="application/json"){void response.body?.cancel().catch(()=>{});throw new Error}const bytes=await boundedResponseBytes(response,this.jsonLimit,signal);return schema.parse(JSON.parse(new TextDecoder("utf-8",{fatal:true}).decode(bytes)))}catch(error){if(error instanceof NativeStudioSdkError)throw new NativeStudioSdkError(error.code,error.semanticStatus,request.method==="POST"&&!request.readOnly?"UNKNOWN":"NO_WRITE",error.status);throw new NativeStudioSdkError("RESPONSE_INVALID","INTERNAL_OPERATIONAL_FAILURE",request.method==="POST"&&!request.readOnly?"UNKNOWN":"NO_WRITE")}}async binary(request,contentTypes,limit,options={}){if(request.method!=="GET"||!Number.isSafeInteger(limit)||limit<1||limit>128*1024*1024)sdkInputError();const{response,signal}=await this.response(request,options);const contentType=response.headers.get("content-type")?.split(";")[0]?.trim()??"";if(!contentTypes.includes(contentType)){await response.body?.cancel().catch(()=>{});throw new NativeStudioSdkError("RESPONSE_INVALID","INTERNAL_OPERATIONAL_FAILURE","NO_WRITE")}try{return{bytes:await boundedResponseBytes(response,limit,signal),contentType,etag:response.headers.get("etag")}}catch(error){throw new NativeStudioSdkError(error instanceof NativeStudioSdkError?error.code:signal.aborted?"REQUEST_ABORTED":"RESPONSE_INVALID","INTERNAL_OPERATIONAL_FAILURE","NO_WRITE")}}};function operation(input,output,request,identity=[],options={}){return Object.freeze({input,output,request,identity,readOnly:options.readOnly,expectedPath:void 0,identityWhenPresent:options.identityWhenPresent??[]})}function path(...parts){return"/v1/"+parts.map(value=>encodeURIComponent(value)).join("/")}function pageQuery(input){return{limit:input.limit,next:input.next}}function mcpOperation(input,output,readOnly,identity=[],expectedPath){return Object.freeze({input,output,request:null,readOnly,identity,expectedPath,identityWhenPresent:[]})}var scopeKeys=["tenantId","projectId","productionId"];function navigationResponseMatches(value){if(!value||typeof value!=="object")return true;const result=value;if(result.evidence?.source!=="production_snapshot")return true;if(!result.actions?.items||!result.operations?.items)return false;const same2=(a,b)=>typeof a==="string"&&typeof b==="string"&&a.toLowerCase()===b.toLowerCase();const hintsMatch=input=>!input||scopeKeys.every(key10=>input[key10]===void 0||same2(input[key10],result[key10]));return result.actions.items.every(action=>scopeKeys.every(key10=>same2(action.context[key10],result[key10]))&&action.context.revision===result.evidence.revision&&hintsMatch(action.inputHints?.knownInputs)&&hintsMatch(action.inspect?.arguments))&&result.operations.items.every(operation2=>hintsMatch(operation2.inspect?.arguments)&&(!operation2.inspect||operation2.inspect.arguments.operationId===operation2.id))}var envelopes=new Set(["choices","related","operations","items","project","production","productions","artifact","primaryRepresentation","relations","storyVersion","planVersion","version","manifest","timeline","basis","review","selection","decision","target","admission","policy","finalDelivery","receipt","render","evidence","source","sourceIdentity","preparation","link","body","latestReview","finalReady","approval","binding","snapshot","sequence","frames","frameOutput","acceptance","reference","candidate","connection","scope","profile","current","ownerContext","comparison","candidates","reviewContext","input","recordDraft","owner","output","result","briefVersion","deliveryTarget","deliverySnapshot","validation","preparations","view","generationDrafts","request","generation","handoff","mediaRead","reviewTarget","reviews"]);var uuid=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function same(left,right){if(Array.isArray(left)||Array.isArray(right))return Array.isArray(left)&&Array.isArray(right)&&left.length===right.length&&left.every((item,i)=>same(item,right[i]));if(left&&right&&typeof left==="object"&&typeof right==="object"){const a=left,b=right;const keys=Object.keys(a);return keys.length===Object.keys(b).length&&keys.every(key10=>Object.hasOwn(b,key10)&&same(a[key10],b[key10]))}return typeof left==="string"&&typeof right==="string"&&uuid.test(left)&&uuid.test(right)?left.toLowerCase()===right.toLowerCase():left===right}function scopeMatches(value,scope3,depth=0){if(!value||typeof value!=="object")return true;if(depth>12)return false;if(Array.isArray(value))return value.every(item=>scopeMatches(item,scope3,depth+1));const record=value;for(const key10 of["tenantId","projectId","productionId"])if(scope3[key10]!==void 0&&record[key10]!==void 0&&record[key10]!==null&&!same(record[key10],scope3[key10]))return false;return Object.entries(record).every(([key10,item])=>!envelopes.has(key10)||scopeMatches(item,scope3,depth+1))}function targetsMatch(value,parts,expected){if(!parts.length)return same(value,expected);const[part,...rest]=parts;if(part==="*")return Array.isArray(value)&&value.every(item=>targetsMatch(item,rest,expected));return!!value&&typeof value==="object"&&targetsMatch(value[part],rest,expected)}function assertResponseBindings(result,input,identity,method,pathOrBindings,additionalBindings=[]){const expectedPath=typeof pathOrBindings==="string"?pathOrBindings:void 0;const identityWhenPresent=typeof pathOrBindings==="string"||pathOrBindings===void 0?additionalBindings:pathOrBindings;const record=result;const basis=input.basis;const basisInput=basis?.input;const nested=input.scope??basis?.scope??basisInput?.scope??basis;if(!scopeMatches(result,input)||!navigationResponseMatches(result)||nested!==void 0&&!scopeMatches(result,nested)||expectedPath!==void 0&&(typeof record?.path!=="string"||record.path.replace(/[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}/gi,id7=>id7.toLowerCase())!==expectedPath.replace(/[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}/gi,id7=>id7.toLowerCase()))||[...identity,...identityWhenPresent.filter(([,target])=>!!record&&Object.hasOwn(record,target))].some(([key10,target,whenStatus])=>{if(whenStatus!==void 0&&record?.semanticStatus!==whenStatus)return false;const expected=key10.split(".").reduce((value,field)=>value&&typeof value==="object"?value[field]:void 0,input);return expected!==void 0&&!targetsMatch(result,target.split("."),expected)})||Array.isArray(record?.items)&&typeof input.limit==="number"&&record.items.length>input.limit)throw new NativeStudioSdkError("RESPONSE_SCOPE_MISMATCH","INTERNAL_OPERATIONAL_FAILURE",method==="POST"?"UNKNOWN":"NO_WRITE")}var NativeStudioRuntimeAuthorityClient=class{tenantId;origin;transport;constructor(config){const tenant2=TenantIdSchema.safeParse(config.tenantId);if(!tenant2.success)sdkInputError();this.tenantId=tenant2.data.toLowerCase();if(config.maxJsonBytes!==void 0&&config.maxJsonBytes>65536)sdkInputError();try{this.origin=new URL(config.baseUrl);if(this.origin.protocol!=="https:")sdkInputError()}catch{sdkInputError()}this.transport=new NativeStudioHttpTransport({...config,maxJsonBytes:config.maxJsonBytes??65536,authorization:()=>{throw new Error("Runtime proof has no bearer credential")}})}input(schema,raw){if(!raw||typeof raw!=="object"||Array.isArray(raw))sdkInputError();const record=raw;if(record.tenantId!==void 0&&(typeof record.tenantId!=="string"||record.tenantId.toLowerCase()!==this.tenantId))sdkInputError();const parsed=schema.safeParse({...record,tenantId:this.tenantId});if(!parsed.success)sdkInputError();return parsed.data}resource(projectId,resource){if(resource!==new URL(`/mcp/native/v1/projects/${projectId}`,this.origin).href)throw new NativeStudioSdkError("RESPONSE_SCOPE_MISMATCH","INTERNAL_OPERATIONAL_FAILURE","UNKNOWN")}async prove(raw,options={}){const value=this.input(NativeRuntimeProofRequestSchema,raw),result=await this.transport.json({method:"POST",tenantId:this.tenantId,path:path("projects",value.projectId,"native-tool-grants",value.grantId,"proof"),body:{assertion:value.assertion},authentication:"runtime-proof"},NativeToolGrantViewSchema,options);assertResponseBindings(result,value,[["grantId","grantId"]],"POST");this.resource(value.projectId,result.resource);return result}async status(raw,options={}){const value=this.input(NativeRuntimeProofRequestSchema,raw);try{const result=await this.transport.json({method:"POST",tenantId:this.tenantId,path:path("projects",value.projectId,"native-tool-grants",value.grantId,"status"),body:{assertion:value.assertion},authentication:"runtime-proof"},NativeToolGrantViewSchema,options);assertResponseBindings(result,value,[["grantId","grantId"]],"POST");this.resource(value.projectId,result.resource);return result}catch(error){if(error instanceof NativeStudioSdkError)throw new NativeStudioSdkError(error.code,error.semanticStatus,"NO_WRITE",error.status);throw error}}async exchange(raw,options={}){const value=this.input(NativeToolCredentialExchangeSchema,raw),result=await this.transport.json({method:"POST",tenantId:this.tenantId,path:path("projects",value.projectId,"productions",value.productionId,"native-tool-credentials","exchange"),body:{authorityRef:value.authorityRef,assertion:value.assertion},authentication:"runtime-proof"},NativeToolCredentialReplySchema,options);this.resource(value.projectId,result.resource);if(!result.accessToken.startsWith(`nvst_${result.tokenId}.`))throw new NativeStudioSdkError("RESPONSE_SCOPE_MISMATCH","INTERNAL_OPERATIONAL_FAILURE","UNKNOWN");return result}};export{OperationSummarySchema,DeliveryTargetSchema,DecideFinalReadySchema,RevokeFinalReadySchema,FinalReadyViewSchema,FinalReadyQuerySchema,FinalReadyPageSchema,FinalReadyReceiptSchema,FinalRenderStartSchema,FinalRenderGetSchema,FinalRenderQuerySchema,FinalRenderAdmissionSchema,FinalRenderViewSchema,FinalRenderPageSchema,FinalRenderEligibilitySchema,DeliveryManifestGetSchema,RegisteredDeliveryManifestSchema,ConfigureDeliveryPolicySchema,DeliveryPolicyVersionSchema,DeliveryPolicyReceiptSchema,StartDeliveryValidationSchema,DeliveryValidationGetSchema,DecideDeliveryApprovalSchema,DeliveryAdmissionSchema,DeliveryDecisionReceiptSchema,DeliveryValidationViewSchema,DeliverySnapshotSchema,PrepareShotRequestSchema,PrepareShotResultSchema,PreparationViewSchema,PreparationQueryInputSchema,PreparationQueryPageSchema,PreparationGetInputSchema,PreparationActiveInputSchema,ProductionSnapshotSchema,ProductionQueryInputSchema,ProductionQueryPageSchema,OperationQueryInputSchema,OperationQueryPageSchema,StoryQueryInputSchema,StoryQueryPageSchema,SceneShotPlanQueryInputSchema,SceneShotPlanQueryPageSchema,InterfaceCancellationReceiptSchema,StartAgentHostExecutionSchema,AgentHostExecutionGetSchema,AgentHostExecutionQuerySchema,AgentHostExecutionViewSchema,AgentHostExecutionPageSchema,AgentHostExecutionEventQuerySchema,AgentHostExecutionEventPageSchema,ReadyArtifactRegistrationSchema,UploadSourceInputRequestSchema,SourceReadSchema,SourceTextWindowSchema,InterfaceDownloadDescriptorSchema,StartReferencePreviewSchema,ReferencePreviewAdmissionSchema,ReferencePreviewResultSchema,ReferencePreviewOperationInputSchema,StudioCapabilitiesInputSchema,StudioCapabilitiesSchema,ExplorationContextInputSchema,ExplorationContextResultSchema,ValidateExplorationPlanSchema,ExplorationValidationResultSchema,ExplorationCompareInputSchema,ExplorationComparisonResultSchema,FinalOutputReviewContextInputSchema,FinalOutputReviewContextResultSchema,CompositionScopeSchema,CompositionGetSchema,CompositionHistorySchema,CompositionReceiptSchema,CompositionViewSchema,CompositionPageSchema,ValidateCompositionMakingSchema,CompositionMakingValidationSchema,CreateCompositionSchema,ReviseCompositionSchema,CompositionBriefQuerySchema,CompositionAuthoringBriefSchema,ValidateCompositionSchema,CompositionValidationReceiptSchema,PutCompositionInputSchema,CompositionInputReceiptSchema,CompositionCapabilitiesSchema,CompositionRenderStartSchema,CompositionRenderGetSchema,CompositionRenderReceiptSchema,CompositionRenderViewSchema,CompositionRenderCancellationSchema,RepairStrategyContextInputSchema,ValidateRepairStrategySchema,RepairStrategyContextResultSchema,RepairStrategyValidationResultSchema,EditorContextInputSchema,ValidateEditorProposalSchema,EditorContextResultSchema,EditorValidationResultSchema,TemporalEvidenceSourceSchema,TemporalEvidenceTargetSchema,OriginalVideoReadSchema,OriginalVideoResultSchema,TemporalEvidenceStartSchema,TemporalEvidenceGetSchema,TemporalEvidenceAdmissionSchema,TemporalEvidenceViewSchema,TemporalEvidenceMediaSchema,TemporalEvidenceImageSchema,TemporalEvidenceImageMetadataSchema,ExplorationRecommendationContextInputSchema,ExplorationRecommendationContextResultSchema,ValidateExplorationRecommendationSchema,ExplorationRecommendationValidationResultSchema,Review1RepairSourceQuerySchema,RepairPlanScopeSchema,AuthorRepairPlanSchema,RecordRepairProofSchema,AuthorReview1RepairSchema,RecordReview1RepairProofSchema,ExecuteRepairSchema,RepairPlanViewSchema,RepairAuthorReceiptSchema,RepairProgressSchema,RepairProofReceiptSchema,LifecycleEventScopeSchema,ConfigureWebhookSchema,DisableWebhookSchema,ReplayWebhookSchema,QueryLifecycleEventsSchema,WebhookSubscriptionSchema,WebhookReplayReceiptSchema,WebhookSubscriptionPageSchema,ExternalLifecycleEventPageSchema,WebhookDeliveryPageSchema,WebhookAttemptPageSchema,LifecycleEventCapabilitiesSchema,CompositionSourceInspectSchema,CompositionSourceInspectionSchema,SourceReviewContextInputSchema,SourceReviewContextSchema,ProgrammaticCompareSchema,ProgrammaticComparisonSchema,ProgrammaticRecommendationContextInputSchema,ProgrammaticRecommendationContextSchema,ValidateProgrammaticRecommendationSchema,ProgrammaticRecommendationValidationSchema,CompositionRenderQuerySchema,CompositionRenderPageSchema,CompositionRenderMediaDescriptorSchema,CompositionSampleStartSchema,CompositionObserveGetSchema,CompositionSampleReceiptSchema,CompositionObservationViewSchema,ScopedAcceptBriefSchema,ScopedAcceptStorySchema,ScopedAcceptSceneShotPlanSchema,CreateProductionRequestSchema,CreatedProductionResultSchema,RegisterVisualSequenceSchema,VisualSequenceGetSchema,VisualSequenceViewSchema,VisualSequenceQuerySchema,VisualSequencePageSchema,WavExportResultSchema,AudioExportResultSchema,CaptionExportResultSchema,DiscoveryContentTypeSchema,ArtifactDiscoveryQuerySchema,ArtifactDiscoveryMediaSchema,ArtifactDiscoveryPageSchema,TerminateProductionSchema,ProductionTerminationReceiptSchema,Review1RepairStrategyContextSchema,ValidateReview1RepairStrategySchema,Review1RepairStrategyValidationSchema,NavigationGroupIdSchema,NavigationGroups,navigationGroup,NavigationProfile,NavigationProfileKey,NavigationToolNames,StudioStartInputSchema,StudioStartSchema,CapabilitySearchInputSchema,CapabilitySearchSchema,CapabilityDescribeInputSchema,CapabilityGroupsInputSchema,CapabilityGroupsSchema,PublicToolDefinitionSchema,CapabilityDescribeSchema,StudioNavigateInputSchema,StudioNavigationSchema,operation,path,pageQuery,mcpOperation,assertResponseBindings,abortable,nativeFailureCodes,NativeStudioHttpTransport,NativeStudioRuntimeAuthorityClient};