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

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 +347 -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,458 @@
1
+ import type { SdkInput, SdkOperation, SdkOutput } from "./client.js";
2
+ import type { SdkRequestOptions } from "./transport/http.js";
3
+ export interface NavigationCaller {
4
+ call<K extends SdkOperation>(key: K, input: SdkInput<K>, options?: SdkRequestOptions): Promise<SdkOutput<K>>;
5
+ }
6
+ /** Public read aliases; transport capabilities and owner admission remain explicit. */
7
+ export declare class NativeStudioNavigationFacade {
8
+ private readonly caller;
9
+ constructor(caller: NavigationCaller);
10
+ find(input: SdkInput<"studio.start">, options?: SdkRequestOptions): Promise<{
11
+ tenantId: string & import("zod").$brand<"TenantId">;
12
+ choices: {
13
+ id: string & import("zod").$brand<"ProductionId">;
14
+ tenantId: string & import("zod").$brand<"TenantId">;
15
+ projectId: string & import("zod").$brand<"ProjectId">;
16
+ state: {
17
+ lifecycle: "ACTIVE" | "COMPLETED" | "FAILED" | "CANCELLED";
18
+ phase: "INTAKE" | "PLANNING" | "PREPARING_GENERATION" | "GENERATING" | "SHOT_REVIEW" | "ASSEMBLING" | "ROUGH_CUT_REVIEW" | "FINAL_READY" | "FINAL_RENDERING" | "DELIVERY_VALIDATION";
19
+ condition: "BLOCKED" | "RUNNABLE" | "RUNNING" | "WAITING_PROVIDER" | "WAITING_HUMAN" | "RETRYING";
20
+ revision: number;
21
+ blockingReason: string | null;
22
+ waitingReason: string | null;
23
+ };
24
+ activeBriefVersion: number | null;
25
+ activeStoryVersion: number | null;
26
+ activeSceneShotPlanVersion: number | null;
27
+ createdByPrincipalId: string & import("zod").$brand<"PrincipalId">;
28
+ createdAt: string;
29
+ updatedAt: string;
30
+ }[];
31
+ page: {
32
+ hasMore: boolean;
33
+ next: string | null;
34
+ };
35
+ selection: "NONE" | "ONE" | "CHOOSE";
36
+ guidance: "Select an explicit Production ID, then call studio_navigate. Never infer an ID.";
37
+ }>;
38
+ overview(input: SdkInput<"studio.navigate">, options?: SdkRequestOptions): Promise<{
39
+ tenantId: string & import("zod").$brand<"TenantId">;
40
+ projectId: string & import("zod").$brand<"ProjectId">;
41
+ productionId: string & import("zod").$brand<"ProductionId">;
42
+ evidence: {
43
+ source: "production_snapshot";
44
+ revision: number;
45
+ generatedAt: string;
46
+ };
47
+ state: {
48
+ lifecycle: "ACTIVE" | "COMPLETED" | "FAILED" | "CANCELLED";
49
+ phase: "INTAKE" | "PLANNING" | "PREPARING_GENERATION" | "GENERATING" | "SHOT_REVIEW" | "ASSEMBLING" | "ROUGH_CUT_REVIEW" | "FINAL_READY" | "FINAL_RENDERING" | "DELIVERY_VALIDATION";
50
+ condition: "BLOCKED" | "RUNNABLE" | "RUNNING" | "WAITING_PROVIDER" | "WAITING_HUMAN" | "RETRYING";
51
+ revision: number;
52
+ blockingReason: string | null;
53
+ waitingReason: string | null;
54
+ };
55
+ stateReasonsTruncated: {
56
+ blockingReason: boolean;
57
+ waitingReason: boolean;
58
+ };
59
+ planning: {
60
+ activeBriefVersion: number | null;
61
+ activeStoryVersion: number | null;
62
+ activeSceneShotPlanVersion: number | null;
63
+ };
64
+ shots: {
65
+ planned: number;
66
+ ready: number;
67
+ generating: number;
68
+ candidates: number;
69
+ accepted: number;
70
+ blocked: number;
71
+ stale: number;
72
+ };
73
+ work: {
74
+ total: number;
75
+ pending: number;
76
+ ready: number;
77
+ running: number;
78
+ waiting: number;
79
+ succeeded: number;
80
+ failed: number;
81
+ cancelled: number;
82
+ superseded: number;
83
+ attempts: number;
84
+ };
85
+ findings: {
86
+ open: number;
87
+ blocking: number;
88
+ warnings: number;
89
+ };
90
+ timeline: {
91
+ currentVersion: number | null;
92
+ stale: boolean;
93
+ };
94
+ final: {
95
+ renderState: string | null;
96
+ deliveryValidationState: string | null;
97
+ };
98
+ blockers: {
99
+ total: number;
100
+ truncated: boolean;
101
+ items: {
102
+ code: string;
103
+ summary: string;
104
+ targetType: string;
105
+ targetId: string;
106
+ evidence: {
107
+ path: string;
108
+ };
109
+ }[];
110
+ };
111
+ actions: {
112
+ total: number;
113
+ truncated: boolean;
114
+ items: {
115
+ capability: string;
116
+ targetType: string;
117
+ targetId: string;
118
+ availability: "UNAVAILABLE" | "AVAILABLE";
119
+ reason: string | null;
120
+ tool: string | null;
121
+ registration: "REGISTERED" | "NOT_ON_SURFACE";
122
+ readOnly: boolean | null;
123
+ purpose: string | null;
124
+ group: "local" | "review" | "execution" | "planning" | "delivery" | "navigation" | "materials" | "administration" | "unclassified" | null;
125
+ context: {
126
+ tenantId: string & import("zod").$brand<"TenantId">;
127
+ projectId: string & import("zod").$brand<"ProjectId">;
128
+ productionId: string & import("zod").$brand<"ProductionId">;
129
+ revision: number;
130
+ };
131
+ inputHints: {
132
+ knownInputs: Partial<Record<"shotId" | "artifactId" | "tenantId" | "projectId" | "productionId" | "sceneId" | "operationId" | "findingId", string>>;
133
+ schemaFingerprint: string | null;
134
+ requiredInputs: string[];
135
+ missingInputs: string[];
136
+ schemaInspectionRequired: true;
137
+ } | null;
138
+ recommendation: ("NOT_ON_SURFACE" | "NATIVE_AVAILABLE" | "NATIVE_UNAVAILABLE" | "GOAL_MATCH" | "INSPECT_SCHEMA")[];
139
+ inspect: {
140
+ tool: "studio_capability_describe";
141
+ arguments: {
142
+ tenantId: string & import("zod").$brand<"TenantId">;
143
+ tool: string;
144
+ projectId?: (string & import("zod").$brand<"ProjectId">) | undefined;
145
+ schemaCursor?: string | undefined;
146
+ };
147
+ } | null;
148
+ evidence: {
149
+ path: string;
150
+ };
151
+ }[];
152
+ page: {
153
+ hasMore: boolean;
154
+ next: string | null;
155
+ };
156
+ };
157
+ operations: {
158
+ total: number;
159
+ truncated: boolean;
160
+ items: {
161
+ id: string & import("zod").$brand<"OperationId">;
162
+ updatedAt: string;
163
+ semanticStatus: "INVALID_INPUT" | "NOT_FOUND" | "BLOCKED" | "REVISION_CONFLICT" | "CAPABILITY_UNAVAILABLE" | "INTERNAL_OPERATIONAL_FAILURE" | "CANCELLED" | "WAITING_PROVIDER" | "RETRYING" | "SUCCESS" | "ACCEPTED" | "NO_CHANGE" | "STALE_BASIS" | "WAITING_INPUT" | "PROVIDER_UNAVAILABLE" | "BUDGET_BLOCKED" | "SUPERSEDED";
164
+ productionId: string & import("zod").$brand<"ProductionId">;
165
+ startedAt: string;
166
+ inspect: {
167
+ tool: "operation_get";
168
+ arguments: {
169
+ tenantId: string & import("zod").$brand<"TenantId">;
170
+ productionId: string & import("zod").$brand<"ProductionId">;
171
+ operationId: string & import("zod").$brand<"OperationId">;
172
+ };
173
+ } | null;
174
+ targetCount: number;
175
+ blockerCount: number;
176
+ evidence: {
177
+ path: string;
178
+ };
179
+ }[];
180
+ };
181
+ related: {
182
+ tenantId: string & import("zod").$brand<"TenantId">;
183
+ catalogVersion: string;
184
+ outcome: "MATCHES" | "AMBIGUOUS" | "NO_MATCH";
185
+ candidates: {
186
+ tool: string;
187
+ title: string;
188
+ description: string;
189
+ family: string;
190
+ readOnly: boolean;
191
+ registration: "REGISTERED";
192
+ matchedTerms: string[];
193
+ group?: "local" | "review" | "execution" | "planning" | "delivery" | "navigation" | "materials" | "administration" | "unclassified" | undefined;
194
+ }[];
195
+ page: {
196
+ hasMore: boolean;
197
+ next: string | null;
198
+ };
199
+ guidance: "Registration is not availability or authorization. Inspect the selected schema and native context before invoking its typed command.";
200
+ } | null;
201
+ guidance: "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.";
202
+ }>;
203
+ next(input: SdkInput<"studio.navigate">, options?: SdkRequestOptions): Promise<{
204
+ tenantId: string & import("zod").$brand<"TenantId">;
205
+ projectId: string & import("zod").$brand<"ProjectId">;
206
+ productionId: string & import("zod").$brand<"ProductionId">;
207
+ evidence: {
208
+ source: "production_snapshot";
209
+ revision: number;
210
+ generatedAt: string;
211
+ };
212
+ state: {
213
+ lifecycle: "ACTIVE" | "COMPLETED" | "FAILED" | "CANCELLED";
214
+ phase: "INTAKE" | "PLANNING" | "PREPARING_GENERATION" | "GENERATING" | "SHOT_REVIEW" | "ASSEMBLING" | "ROUGH_CUT_REVIEW" | "FINAL_READY" | "FINAL_RENDERING" | "DELIVERY_VALIDATION";
215
+ condition: "BLOCKED" | "RUNNABLE" | "RUNNING" | "WAITING_PROVIDER" | "WAITING_HUMAN" | "RETRYING";
216
+ revision: number;
217
+ blockingReason: string | null;
218
+ waitingReason: string | null;
219
+ };
220
+ stateReasonsTruncated: {
221
+ blockingReason: boolean;
222
+ waitingReason: boolean;
223
+ };
224
+ planning: {
225
+ activeBriefVersion: number | null;
226
+ activeStoryVersion: number | null;
227
+ activeSceneShotPlanVersion: number | null;
228
+ };
229
+ shots: {
230
+ planned: number;
231
+ ready: number;
232
+ generating: number;
233
+ candidates: number;
234
+ accepted: number;
235
+ blocked: number;
236
+ stale: number;
237
+ };
238
+ work: {
239
+ total: number;
240
+ pending: number;
241
+ ready: number;
242
+ running: number;
243
+ waiting: number;
244
+ succeeded: number;
245
+ failed: number;
246
+ cancelled: number;
247
+ superseded: number;
248
+ attempts: number;
249
+ };
250
+ findings: {
251
+ open: number;
252
+ blocking: number;
253
+ warnings: number;
254
+ };
255
+ timeline: {
256
+ currentVersion: number | null;
257
+ stale: boolean;
258
+ };
259
+ final: {
260
+ renderState: string | null;
261
+ deliveryValidationState: string | null;
262
+ };
263
+ blockers: {
264
+ total: number;
265
+ truncated: boolean;
266
+ items: {
267
+ code: string;
268
+ summary: string;
269
+ targetType: string;
270
+ targetId: string;
271
+ evidence: {
272
+ path: string;
273
+ };
274
+ }[];
275
+ };
276
+ actions: {
277
+ total: number;
278
+ truncated: boolean;
279
+ items: {
280
+ capability: string;
281
+ targetType: string;
282
+ targetId: string;
283
+ availability: "UNAVAILABLE" | "AVAILABLE";
284
+ reason: string | null;
285
+ tool: string | null;
286
+ registration: "REGISTERED" | "NOT_ON_SURFACE";
287
+ readOnly: boolean | null;
288
+ purpose: string | null;
289
+ group: "local" | "review" | "execution" | "planning" | "delivery" | "navigation" | "materials" | "administration" | "unclassified" | null;
290
+ context: {
291
+ tenantId: string & import("zod").$brand<"TenantId">;
292
+ projectId: string & import("zod").$brand<"ProjectId">;
293
+ productionId: string & import("zod").$brand<"ProductionId">;
294
+ revision: number;
295
+ };
296
+ inputHints: {
297
+ knownInputs: Partial<Record<"shotId" | "artifactId" | "tenantId" | "projectId" | "productionId" | "sceneId" | "operationId" | "findingId", string>>;
298
+ schemaFingerprint: string | null;
299
+ requiredInputs: string[];
300
+ missingInputs: string[];
301
+ schemaInspectionRequired: true;
302
+ } | null;
303
+ recommendation: ("NOT_ON_SURFACE" | "NATIVE_AVAILABLE" | "NATIVE_UNAVAILABLE" | "GOAL_MATCH" | "INSPECT_SCHEMA")[];
304
+ inspect: {
305
+ tool: "studio_capability_describe";
306
+ arguments: {
307
+ tenantId: string & import("zod").$brand<"TenantId">;
308
+ tool: string;
309
+ projectId?: (string & import("zod").$brand<"ProjectId">) | undefined;
310
+ schemaCursor?: string | undefined;
311
+ };
312
+ } | null;
313
+ evidence: {
314
+ path: string;
315
+ };
316
+ }[];
317
+ page: {
318
+ hasMore: boolean;
319
+ next: string | null;
320
+ };
321
+ };
322
+ operations: {
323
+ total: number;
324
+ truncated: boolean;
325
+ items: {
326
+ id: string & import("zod").$brand<"OperationId">;
327
+ updatedAt: string;
328
+ semanticStatus: "INVALID_INPUT" | "NOT_FOUND" | "BLOCKED" | "REVISION_CONFLICT" | "CAPABILITY_UNAVAILABLE" | "INTERNAL_OPERATIONAL_FAILURE" | "CANCELLED" | "WAITING_PROVIDER" | "RETRYING" | "SUCCESS" | "ACCEPTED" | "NO_CHANGE" | "STALE_BASIS" | "WAITING_INPUT" | "PROVIDER_UNAVAILABLE" | "BUDGET_BLOCKED" | "SUPERSEDED";
329
+ productionId: string & import("zod").$brand<"ProductionId">;
330
+ startedAt: string;
331
+ inspect: {
332
+ tool: "operation_get";
333
+ arguments: {
334
+ tenantId: string & import("zod").$brand<"TenantId">;
335
+ productionId: string & import("zod").$brand<"ProductionId">;
336
+ operationId: string & import("zod").$brand<"OperationId">;
337
+ };
338
+ } | null;
339
+ targetCount: number;
340
+ blockerCount: number;
341
+ evidence: {
342
+ path: string;
343
+ };
344
+ }[];
345
+ };
346
+ related: {
347
+ tenantId: string & import("zod").$brand<"TenantId">;
348
+ catalogVersion: string;
349
+ outcome: "MATCHES" | "AMBIGUOUS" | "NO_MATCH";
350
+ candidates: {
351
+ tool: string;
352
+ title: string;
353
+ description: string;
354
+ family: string;
355
+ readOnly: boolean;
356
+ registration: "REGISTERED";
357
+ matchedTerms: string[];
358
+ group?: "local" | "review" | "execution" | "planning" | "delivery" | "navigation" | "materials" | "administration" | "unclassified" | undefined;
359
+ }[];
360
+ page: {
361
+ hasMore: boolean;
362
+ next: string | null;
363
+ };
364
+ guidance: "Registration is not availability or authorization. Inspect the selected schema and native context before invoking its typed command.";
365
+ } | null;
366
+ guidance: "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.";
367
+ }>;
368
+ resume(input: SdkInput<"operation.get">, options?: SdkRequestOptions): Promise<{
369
+ id: string & import("zod").$brand<"OperationId">;
370
+ productionId: string & import("zod").$brand<"ProductionId">;
371
+ semanticStatus: "INVALID_INPUT" | "NOT_FOUND" | "BLOCKED" | "REVISION_CONFLICT" | "CAPABILITY_UNAVAILABLE" | "INTERNAL_OPERATIONAL_FAILURE" | "CANCELLED" | "WAITING_PROVIDER" | "RETRYING" | "SUCCESS" | "ACCEPTED" | "NO_CHANGE" | "STALE_BASIS" | "WAITING_INPUT" | "PROVIDER_UNAVAILABLE" | "BUDGET_BLOCKED" | "SUPERSEDED";
372
+ targets: {
373
+ type: string;
374
+ id: string;
375
+ version: number | null;
376
+ }[];
377
+ work: {
378
+ total: number;
379
+ pending: number;
380
+ ready: number;
381
+ running: number;
382
+ waiting: number;
383
+ succeeded: number;
384
+ failed: number;
385
+ cancelled: number;
386
+ superseded: number;
387
+ attempts: number;
388
+ };
389
+ blockers: string[];
390
+ nextActions: {
391
+ capability: string;
392
+ targetType: string;
393
+ targetId: string;
394
+ availability: "UNAVAILABLE" | "AVAILABLE";
395
+ reason: string | null;
396
+ }[];
397
+ startedAt: string;
398
+ updatedAt: string;
399
+ }>;
400
+ groups(input?: SdkInput<"studio.capability.groups">, options?: SdkRequestOptions): Promise<{
401
+ tenantId: string & import("zod").$brand<"TenantId">;
402
+ catalogVersion: string;
403
+ groups: {
404
+ id: "local" | "review" | "execution" | "planning" | "delivery" | "navigation" | "materials" | "administration" | "unclassified";
405
+ title: string;
406
+ description: string;
407
+ count: number;
408
+ readOnlyCount: number;
409
+ }[];
410
+ }>;
411
+ search(input: SdkInput<"studio.capability.search">, options?: SdkRequestOptions): Promise<{
412
+ tenantId: string & import("zod").$brand<"TenantId">;
413
+ catalogVersion: string;
414
+ outcome: "MATCHES" | "AMBIGUOUS" | "NO_MATCH";
415
+ candidates: {
416
+ tool: string;
417
+ title: string;
418
+ description: string;
419
+ family: string;
420
+ readOnly: boolean;
421
+ registration: "REGISTERED";
422
+ matchedTerms: string[];
423
+ group?: "local" | "review" | "execution" | "planning" | "delivery" | "navigation" | "materials" | "administration" | "unclassified" | undefined;
424
+ }[];
425
+ page: {
426
+ hasMore: boolean;
427
+ next: string | null;
428
+ };
429
+ guidance: "Registration is not availability or authorization. Inspect the selected schema and native context before invoking its typed command.";
430
+ }>;
431
+ describe(input: SdkInput<"studio.capability.describe">, options?: SdkRequestOptions): Promise<{
432
+ tool: string;
433
+ title: string;
434
+ description: string;
435
+ family: string;
436
+ readOnly: boolean;
437
+ registration: "REGISTERED";
438
+ tenantId: string & import("zod").$brand<"TenantId">;
439
+ catalogVersion: string;
440
+ inputSchema: Record<string, unknown>;
441
+ outputSchema: Record<string, unknown> | null;
442
+ outputContract: "DECLARED" | "NOT_DECLARED";
443
+ schemaCursor: string;
444
+ guidance: "Use this bounded definition as client-local schema metadata. Standard tools/list stays stable; commands revalidate authority and current state.";
445
+ group?: "local" | "review" | "execution" | "planning" | "delivery" | "navigation" | "materials" | "administration" | "unclassified" | undefined;
446
+ definition?: {
447
+ name: string;
448
+ inputSchema: Record<string, unknown>;
449
+ title?: string | undefined;
450
+ description?: string | undefined;
451
+ outputSchema?: Record<string, unknown> | undefined;
452
+ annotations?: Record<string, unknown> | undefined;
453
+ execution?: Record<string, unknown> | undefined;
454
+ _meta?: Record<string, unknown> | undefined;
455
+ icons?: Record<string, unknown>[] | undefined;
456
+ } | undefined;
457
+ }>;
458
+ }
@@ -0,0 +1,51 @@
1
+ import type { NativeStudioAgentClient, SdkInput, SdkOutput, SdkOperation } from "./client.js";
2
+ import type { SdkRequestOptions } from "./transport/http.js";
3
+ export type PagedOperation = {
4
+ [K in SdkOperation]: SdkOutput<K> extends {
5
+ items: unknown[];
6
+ page: {
7
+ hasMore: boolean;
8
+ next: string | null;
9
+ };
10
+ } ? K : never;
11
+ }[SdkOperation];
12
+ export declare function queryPages<K extends PagedOperation>(client: Pick<NativeStudioAgentClient, "call">, key: K, input: SdkInput<K>, options?: SdkRequestOptions & {
13
+ maxPages?: number;
14
+ maxItems?: number;
15
+ }): AsyncGenerator<SdkOutput<K>>;
16
+ export declare function waitForOperation(client: Pick<NativeStudioAgentClient, "call">, input: SdkInput<"operation.get">, options?: SdkRequestOptions & {
17
+ maxPolls?: number;
18
+ timeoutMs?: number;
19
+ intervalMs?: number;
20
+ }): Promise<{
21
+ id: string & import("zod").$brand<"OperationId">;
22
+ productionId: string & import("zod").$brand<"ProductionId">;
23
+ semanticStatus: "INVALID_INPUT" | "NOT_FOUND" | "BLOCKED" | "REVISION_CONFLICT" | "CAPABILITY_UNAVAILABLE" | "INTERNAL_OPERATIONAL_FAILURE" | "CANCELLED" | "WAITING_PROVIDER" | "RETRYING" | "SUCCESS" | "ACCEPTED" | "NO_CHANGE" | "STALE_BASIS" | "WAITING_INPUT" | "PROVIDER_UNAVAILABLE" | "BUDGET_BLOCKED" | "SUPERSEDED";
24
+ targets: {
25
+ type: string;
26
+ id: string;
27
+ version: number | null;
28
+ }[];
29
+ work: {
30
+ total: number;
31
+ pending: number;
32
+ ready: number;
33
+ running: number;
34
+ waiting: number;
35
+ succeeded: number;
36
+ failed: number;
37
+ cancelled: number;
38
+ superseded: number;
39
+ attempts: number;
40
+ };
41
+ blockers: string[];
42
+ nextActions: {
43
+ capability: string;
44
+ targetType: string;
45
+ targetId: string;
46
+ availability: "UNAVAILABLE" | "AVAILABLE";
47
+ reason: string | null;
48
+ }[];
49
+ startedAt: string;
50
+ updatedAt: string;
51
+ }>;
@@ -0,0 +1,103 @@
1
+ import type { z } from "zod";
2
+ import { NativeRuntimeProofRequestSchema, NativeToolCredentialExchangeSchema } from "../contracts/index.js";
3
+ import { type NativeStudioHttpOptions, type SdkRequestOptions } from "./transport/http.js";
4
+ /** Runtime-only signed proof transport. There is no Human bearer source or automatic retry. */
5
+ export declare class NativeStudioRuntimeAuthorityClient {
6
+ readonly tenantId: string;
7
+ private readonly origin;
8
+ private readonly transport;
9
+ constructor(config: Omit<NativeStudioHttpOptions, "authorization"> & {
10
+ tenantId: string;
11
+ });
12
+ private input;
13
+ private resource;
14
+ prove(raw: Omit<z.input<typeof NativeRuntimeProofRequestSchema>, "tenantId"> & {
15
+ tenantId?: string;
16
+ }, options?: SdkRequestOptions): Promise<{
17
+ tenantId: string;
18
+ projectId: string;
19
+ protocol: "NATIVESTUDIO_RUNTIME_REGISTRATION_V1";
20
+ grantId: string;
21
+ bindingId: string;
22
+ bindingRevision: number;
23
+ configurationVersion: number;
24
+ selection: {
25
+ hostKey: string;
26
+ tenantKey: string;
27
+ workspaceKey: string;
28
+ projectKey: string;
29
+ agentKey: string;
30
+ agentVersion: number;
31
+ modelOptionKey: string;
32
+ };
33
+ runtimeKey: string;
34
+ installationId: string;
35
+ installationRevisionId: string;
36
+ publicKey: {
37
+ kty: "EC";
38
+ crv: "P-256";
39
+ x: string;
40
+ y: string;
41
+ };
42
+ resource: string;
43
+ revision: number;
44
+ enabled: boolean;
45
+ createdByPrincipalId: string;
46
+ runtimePrincipalId: string;
47
+ createdAt: string;
48
+ expiresAt: string;
49
+ challengeId: string;
50
+ challengeExpiresAt: string;
51
+ verifiedAt: string | null;
52
+ revokedAt: string | null;
53
+ }>;
54
+ status(raw: Omit<z.input<typeof NativeRuntimeProofRequestSchema>, "tenantId"> & {
55
+ tenantId?: string;
56
+ }, options?: SdkRequestOptions): Promise<{
57
+ tenantId: string;
58
+ projectId: string;
59
+ protocol: "NATIVESTUDIO_RUNTIME_REGISTRATION_V1";
60
+ grantId: string;
61
+ bindingId: string;
62
+ bindingRevision: number;
63
+ configurationVersion: number;
64
+ selection: {
65
+ hostKey: string;
66
+ tenantKey: string;
67
+ workspaceKey: string;
68
+ projectKey: string;
69
+ agentKey: string;
70
+ agentVersion: number;
71
+ modelOptionKey: string;
72
+ };
73
+ runtimeKey: string;
74
+ installationId: string;
75
+ installationRevisionId: string;
76
+ publicKey: {
77
+ kty: "EC";
78
+ crv: "P-256";
79
+ x: string;
80
+ y: string;
81
+ };
82
+ resource: string;
83
+ revision: number;
84
+ enabled: boolean;
85
+ createdByPrincipalId: string;
86
+ runtimePrincipalId: string;
87
+ createdAt: string;
88
+ expiresAt: string;
89
+ challengeId: string;
90
+ challengeExpiresAt: string;
91
+ verifiedAt: string | null;
92
+ revokedAt: string | null;
93
+ }>;
94
+ exchange(raw: Omit<z.input<typeof NativeToolCredentialExchangeSchema>, "tenantId"> & {
95
+ tenantId?: string;
96
+ }, options?: SdkRequestOptions): Promise<{
97
+ tokenType: "Bearer";
98
+ accessToken: string;
99
+ tokenId: string;
100
+ resource: string;
101
+ expiresAt: string;
102
+ }>;
103
+ }
@@ -0,0 +1,39 @@
1
+ import type { z } from "zod";
2
+ export interface NativeStudioHttpOptions {
3
+ baseUrl: string;
4
+ authorization(signal: AbortSignal): string | Promise<string>;
5
+ timeoutMs?: number;
6
+ maxJsonBytes?: number;
7
+ fetch?: typeof fetch;
8
+ }
9
+ export interface SdkRequestOptions {
10
+ signal?: AbortSignal;
11
+ }
12
+ export interface HttpRequest {
13
+ method: "GET" | "POST";
14
+ path: string;
15
+ tenantId: string;
16
+ query?: Record<string, string | number | undefined>;
17
+ body?: unknown;
18
+ importedVideo?: {
19
+ bytes: Uint8Array;
20
+ metadata: string;
21
+ };
22
+ authentication?: "runtime-proof";
23
+ readOnly?: boolean | undefined;
24
+ }
25
+ export interface SdkBinary {
26
+ bytes: Uint8Array;
27
+ contentType: string;
28
+ etag: string | null;
29
+ }
30
+ export declare class NativeStudioHttpTransport {
31
+ private readonly config;
32
+ private readonly origin;
33
+ private readonly timeout;
34
+ private readonly jsonLimit;
35
+ constructor(config: NativeStudioHttpOptions);
36
+ private response;
37
+ json<T>(request: HttpRequest, schema: z.ZodType<T>, options?: SdkRequestOptions): Promise<T>;
38
+ binary(request: HttpRequest, contentTypes: readonly string[], limit: number, options?: SdkRequestOptions): Promise<SdkBinary>;
39
+ }
@@ -0,0 +1 @@
1
+ export * from "./_types/sdk/account.js";
@@ -0,0 +1 @@
1
+ import{CliAccountExchangeSchema,CliAccountIdentitySchema,CliAccountSessionSchema,CliAccountStartSchema,CliAccountStartedSchema,ProjectLibraryPageSchema,ProjectWorkspaceSchema}from"./_chunks/chunk-7YCEMDNZ.js";import"./_chunks/chunk-4M3AGNTZ.js";import{NativeStudioSdkError}from"./_chunks/chunk-6NVIN2NI.js";import{z}from"zod";function accountServerOrigin(value){const url=new URL(value);if(url.pathname!=="/"||url.search||url.hash||url.username||url.password||!(url.protocol==="https:"||url.protocol==="http:"&&["127.0.0.1","localhost","[::1]"].includes(url.hostname)))throw new NativeStudioSdkError("ACCOUNT_SERVER_ORIGIN_REQUIRED","INVALID_INPUT","NO_WRITE");return url.origin}var NativeStudioAccountClient=class{constructor(options){this.options=options;this.serverOrigin=accountServerOrigin(options.serverOrigin);if(options.accessToken&&!/^nvsh_[A-Za-z0-9_-]{43}$/.test(options.accessToken))throw new NativeStudioSdkError("INVALID_ACCOUNT_CREDENTIAL","INVALID_INPUT","NO_WRITE")}options;serverOrigin;async request(action,schema,options={}){if(options.credential&&!this.options.accessToken)throw new NativeStudioSdkError("ACCOUNT_LOGIN_REQUIRED","INVALID_INPUT","NO_WRITE");const write=options.body!==void 0;let response;try{response=await(this.options.fetch??fetch)(`${this.serverOrigin}/api/cli-account/${action}${options.query?"?"+options.query:""}`,{method:write?"POST":"GET",cache:"no-store",redirect:"error",credentials:"omit",signal:AbortSignal.any([AbortSignal.timeout(15e3),...options.signal?[options.signal]:[]]),headers:{...write?{"content-type":"application/json"}:{},...options.credential?{authorization:"Bearer "+this.options.accessToken}:{}},...write?{body:JSON.stringify(options.body)}:{}})}catch{throw new NativeStudioSdkError("ACCOUNT_TRANSPORT_FAILED","BLOCKED",write?"UNKNOWN":"NO_WRITE")}if(!response.ok){await response.body?.cancel();throw new NativeStudioSdkError(response.status===401?"ACCOUNT_SESSION_EXPIRED_OR_REVOKED":"ACCOUNT_REQUEST_REJECTED","BLOCKED",write&&response.status>=500?"UNKNOWN":"REJECTED",response.status)}try{if(!(response.headers.get("content-type")??"").startsWith("application/json"))throw Error();const reader=response.body?.getReader();if(!reader)throw Error();const chunks=[];let size=0;try{while(true){const part=await reader.read();if(part.done)break;size+=part.value.byteLength;if(size>1024*1024){await reader.cancel();throw Error()}chunks.push(part.value)}}finally{reader.releaseLock()}const bytes=new Uint8Array(size);let offset=0;for(const part of chunks){bytes.set(part,offset);offset+=part.length}return schema.parse(JSON.parse(new TextDecoder().decode(bytes)))}catch{throw new NativeStudioSdkError("ACCOUNT_RESPONSE_INVALID","BLOCKED",write?"UNKNOWN":"NO_WRITE")}}async metadata(signal){return this.request("metadata",z.strictObject({protocol:z.literal("NVS_CLI_ACCOUNT_V1"),serverOrigin:z.literal(this.serverOrigin)}),{signal})}start(input,signal){return this.request("start",CliAccountStartedSchema,{body:CliAccountStartSchema.parse(input),signal})}exchange(input,signal){return this.request("exchange",CliAccountSessionSchema,{body:CliAccountExchangeSchema.parse(input),signal})}me(signal){return this.request("me",CliAccountIdentitySchema,{credential:true,signal})}logout(signal){return this.request("logout",z.strictObject({changed:z.literal(true)}),{credential:true,body:{},signal})}async projects(input,signal){const value=z.strictObject({tenantId:z.uuid(),limit:z.number().int().min(1).max(100).optional(),next:z.string().min(1).max(8192).optional()}).parse(input);const result=await this.request("projects",ProjectLibraryPageSchema,{credential:true,signal,query:new URLSearchParams({tenantId:value.tenantId,...value.limit?{limit:String(value.limit)}:{},...value.next?{next:value.next}:{}})});if(result.items.some(p=>p.tenantId!==value.tenantId))throw new NativeStudioSdkError("ACCOUNT_RESPONSE_SCOPE_MISMATCH","BLOCKED","NO_WRITE");return result}async project(input,signal){const value=z.strictObject({tenantId:z.uuid(),projectId:z.uuid()}).parse(input);const result=await this.request("project",ProjectWorkspaceSchema,{credential:true,signal,query:new URLSearchParams(value)});if(result.project.id!==value.projectId||result.project.tenantId!==value.tenantId)throw new NativeStudioSdkError("ACCOUNT_RESPONSE_SCOPE_MISMATCH","BLOCKED","NO_WRITE");return result}};export{CliAccountIdentitySchema,CliAccountSessionSchema,CliAccountStartSchema,CliAccountStartedSchema,NativeStudioAccountClient,accountServerOrigin};
@@ -0,0 +1 @@
1
+ export * from "./_types/sdk/desktop-previews.js";
@@ -0,0 +1 @@
1
+ import{desktopPublicKey,desktopReleaseSchema,desktopReleaseUrl,verifiedDesktopCatalogue}from"./_chunks/chunk-RK3YLCZP.js";import{z}from"zod";var previewPolicySchema=z.strictObject({protocol:z.literal("NVS_DESKTOP_PREVIEW_POLICY_V1"),applicationId:z.literal("com.nativestudio.desktop.preview"),catalogueUrl:z.string().url().max(4096),publicKey:z.string().min(32).max(16384)});var previewReleaseSchema=desktopReleaseSchema.extend({nativeSignature:z.enum(["UNSIGNED_PREVIEW","AD_HOC_PREVIEW"]),deviceAcceptance:z.enum(["ENGINEERING_VERIFIED","OWNER_PENDING"])});var previewCatalogueSchema=z.strictObject({protocol:z.literal("NVS_DESKTOP_PREVIEW_CATALOGUE_V1"),applicationId:z.literal("com.nativestudio.desktop.preview"),issuedAt:z.iso.datetime(),expiresAt:z.iso.datetime(),releases:z.array(previewReleaseSchema).max(128)});var signedSchema=z.strictObject({catalogue:previewCatalogueSchema,signature:z.string().regex(/^[A-Za-z0-9_-]{86}$/)});function parsePreviewPolicy(raw){const value=previewPolicySchema.parse(raw);desktopReleaseUrl(value.catalogueUrl);desktopPublicKey(value.publicKey);return value}function previewCatalogue(policy,signal=AbortSignal.timeout(15e3)){return verifiedDesktopCatalogue(policy,signedSchema,signal)}function newerPreviewVersion(candidate,current){const parse=v=>v.split(".").map(Number);if(!/^\d{1,8}\.\d{1,8}\.\d{1,8}$/.test(candidate)||!/^\d{1,8}\.\d{1,8}\.\d{1,8}$/.test(current))return false;const a=parse(candidate),b=parse(current);for(let i=0;i<3;i++)if(a[i]!==b[i])return a[i]>b[i];return false}export{newerPreviewVersion,parsePreviewPolicy,previewCatalogue,previewCatalogueSchema,previewPolicySchema,previewReleaseSchema};