@clipwright/core 0.72.0 → 0.73.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ad-guide.js +3 -2
- package/dist/ads.js +2 -3
- package/dist/api-failure.d.ts +1 -4
- package/dist/api-failure.js +6 -16
- package/dist/assets.d.ts +6 -0
- package/dist/billing-terms.d.ts +12 -0
- package/dist/contract-dispositions.d.ts +19 -1
- package/dist/contract-dispositions.js +2 -0
- package/dist/contracts/v1/workflow-brief.d.ts +10 -0
- package/dist/contracts/v1/workflow-catalog.d.ts +10 -0
- package/dist/contracts/v1/workflow-client.d.ts +5 -0
- package/dist/contracts/v1/workflow-execution.d.ts +16 -0
- package/dist/contracts/v1/workflow-plan.d.ts +15 -0
- package/dist/contracts/v1/workflow-run-read.d.ts +11 -0
- package/dist/cuts.js +2 -2
- package/dist/edit-music.js +5 -5
- package/dist/endpoint-notes.js +2 -0
- package/dist/endpoints.js +3 -0
- package/dist/errors.d.ts +2 -29
- package/dist/errors.js +2 -13
- package/dist/face-billing.d.ts +11 -1
- package/dist/face-billing.js +5 -2
- package/dist/faceless-price.d.ts +1 -0
- package/dist/faceless-price.js +1 -0
- package/dist/faceless-public.d.ts +29 -1
- package/dist/faceless-public.js +12 -24
- package/dist/film-cut.d.ts +0 -4
- package/dist/film-cut.js +2 -4
- package/dist/film-drafts.d.ts +11 -0
- package/dist/film-drafts.js +8 -0
- package/dist/film-guide.d.ts +10 -49
- package/dist/film-guide.js +37 -3
- package/dist/generations-output.d.ts +5 -0
- package/dist/generations-output.js +2 -0
- package/dist/generations.d.ts +25 -0
- package/dist/generations.js +3 -1
- package/dist/idempotency.d.ts +1 -0
- package/dist/idempotency.js +7 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/mascots.d.ts +110 -1
- package/dist/mascots.js +38 -1
- package/dist/mcp-ugc-descriptions.d.ts +1 -1
- package/dist/mcp-ugc-descriptions.js +1 -1
- package/dist/music.d.ts +1 -0
- package/dist/music.js +1 -0
- package/dist/openapi.js +13 -8
- package/dist/own-agent-price.d.ts +20 -3
- package/dist/own-agent-price.js +39 -8
- package/dist/own-agent-runs.d.ts +77 -23
- package/dist/own-agent-runs.js +26 -12
- package/dist/parts-pricing.d.ts +14 -5
- package/dist/parts-pricing.js +27 -14
- package/dist/presenter-engine.d.ts +17 -0
- package/dist/presenter-engine.js +35 -0
- package/dist/prices.d.ts +7 -3
- package/dist/prices.js +66 -20
- package/dist/reference-analysis.d.ts +47 -0
- package/dist/reference-analysis.js +7 -0
- package/dist/reference-display.js +3 -0
- package/dist/reference-film-kit.d.ts +43 -0
- package/dist/reference-film-kit.js +22 -0
- package/dist/render-backend.d.ts +1 -0
- package/dist/runs.d.ts +12 -0
- package/dist/skill-theme-explainer.js +3 -1
- package/dist/skill-theme.js +5 -0
- package/dist/skills.d.ts +58 -1
- package/dist/skills.js +70 -33
- package/dist/upscale.d.ts +120 -0
- package/dist/upscale.js +116 -0
- package/dist/voice-admission.d.ts +14 -0
- package/dist/voice-admission.js +9 -0
- package/dist/voice-listing.js +1 -1
- package/dist/voices.d.ts +1 -0
- package/dist/workflows/methods/faceless-explainer.d.ts +2 -0
- package/dist/workflows/methods/kinetic-launch.d.ts +4 -0
- package/dist/workflows/methods/product-image-story.d.ts +2 -0
- package/dist/workflows/methods/reference-remake.d.ts +2 -0
- package/dist/workflows/methods/shared.d.ts +2 -0
- package/dist/workflows/methods/ugc-faq-answer.d.ts +2 -0
- package/dist/workflows/methods/ugc-product-intro.d.ts +2 -0
- package/dist/workflows/methods/website-proof-demo.d.ts +4 -0
- package/package.json +1 -1
package/dist/generations.d.ts
CHANGED
|
@@ -357,6 +357,31 @@ export declare const generationModels: z.ZodObject<{
|
|
|
357
357
|
reference: z.ZodOptional<z.ZodLiteral<true>>;
|
|
358
358
|
}, z.core.$strict>>;
|
|
359
359
|
}, z.core.$strict>>;
|
|
360
|
+
upscale: z.ZodOptional<z.ZodObject<{
|
|
361
|
+
video: z.ZodObject<{
|
|
362
|
+
fps: z.ZodNumber;
|
|
363
|
+
max_frames: z.ZodNumber;
|
|
364
|
+
unit: z.ZodLiteral<"second">;
|
|
365
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
366
|
+
from: z.ZodObject<{
|
|
367
|
+
width: z.ZodNumber;
|
|
368
|
+
height: z.ZodNumber;
|
|
369
|
+
}, z.core.$strict>;
|
|
370
|
+
width: z.ZodNumber;
|
|
371
|
+
height: z.ZodNumber;
|
|
372
|
+
unit_credits: z.ZodNumber;
|
|
373
|
+
}, z.core.$strict>>;
|
|
374
|
+
}, z.core.$strict>;
|
|
375
|
+
image: z.ZodNullable<z.ZodObject<{
|
|
376
|
+
unit: z.ZodLiteral<"image">;
|
|
377
|
+
factor: z.ZodNumber;
|
|
378
|
+
media_types: z.ZodArray<z.ZodString>;
|
|
379
|
+
min_short_side: z.ZodNumber;
|
|
380
|
+
max_long_side: z.ZodNumber;
|
|
381
|
+
max_output_pixels: z.ZodNumber;
|
|
382
|
+
unit_credits: z.ZodNumber;
|
|
383
|
+
}, z.core.$strict>>;
|
|
384
|
+
}, z.core.$strict>>;
|
|
360
385
|
contract_version: z.ZodString;
|
|
361
386
|
}, z.core.$strict>;
|
|
362
387
|
export type GenerationModels = z.infer<typeof generationModels>;
|
package/dist/generations.js
CHANGED
|
@@ -4,6 +4,7 @@ import { generationShot, shotIssues } from "./generation-shot.js";
|
|
|
4
4
|
import { GENERATION_KINDS } from "./generations-output.js";
|
|
5
5
|
import { maxCreditsField } from "./max-credits.js";
|
|
6
6
|
import { runId } from "./runs.js";
|
|
7
|
+
import { listedUpscale } from "./upscale.js";
|
|
7
8
|
import { uploadId } from "./uploads.js";
|
|
8
9
|
export const GENERATION_MODELS_PATH = "/v1/generations/models";
|
|
9
10
|
export const GENERATE_IMAGE_QUOTE_PATH = "/v1/skills/generate_image/quote";
|
|
@@ -63,7 +64,7 @@ export const GENERATION_CAPABILITIES = deepFreeze({
|
|
|
63
64
|
},
|
|
64
65
|
flare: {
|
|
65
66
|
kind: "image",
|
|
66
|
-
rows: [image("9:16", 1008, 1792, 7, true), image("16:9", 1792, 1008, 7), image("1:1", 1024, 1024, 7), image("21:9", 2352, 1008,
|
|
67
|
+
rows: [image("9:16", 1008, 1792, 7, true), image("16:9", 1792, 1008, 7), image("1:1", 1024, 1024, 7), image("21:9", 2352, 1008, 20, true)],
|
|
67
68
|
},
|
|
68
69
|
"gemini-3-pro-image": {
|
|
69
70
|
kind: "image",
|
|
@@ -334,6 +335,7 @@ const listedModel = z.strictObject({
|
|
|
334
335
|
});
|
|
335
336
|
export const generationModels = z.strictObject({
|
|
336
337
|
models: z.array(listedModel),
|
|
338
|
+
upscale: listedUpscale.optional(),
|
|
337
339
|
contract_version: z.string().min(1),
|
|
338
340
|
});
|
|
339
341
|
export function listGenerationModels(options = {}) {
|
package/dist/idempotency.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare function actorIdempotencyKeyFor(input: unknown, clientId: string)
|
|
|
8
8
|
export declare function revisionIdempotencyKeyFor(sourceRunId: string, request: unknown, clientId: string): string;
|
|
9
9
|
export declare function candidateIdempotencyKeyFor(sourceRunId: string, request: unknown, clientId: string): string;
|
|
10
10
|
export declare function generationIdempotencyKeyFor(skill: "generate_image" | "generate_video", request: unknown, clientId: string): string;
|
|
11
|
+
export declare function upscaleIdempotencyKeyFor(request: unknown, clientId: string): string;
|
|
11
12
|
export declare function ownAgentIdempotencyKeyFor(skill: OwnAgentSkill, request: unknown, clientId: string): string;
|
|
12
13
|
export declare function uploadRequestIdentity(kind: "import" | "intent", input: unknown): unknown;
|
|
13
14
|
export declare function uploadRequestIdempotencyKeyFor(kind: "import" | "intent", input: unknown, clientId: string): string;
|
package/dist/idempotency.js
CHANGED
|
@@ -8,6 +8,7 @@ import { filmCutPreviewInput, filmCutRunInput } from "./film-cut.js";
|
|
|
8
8
|
import { generateImageRequest, generateVideoRequest } from "./generations.js";
|
|
9
9
|
import { filmEditInput, filmHeroInput, filmRenderInput, filmStillsInput, filmVoiceInput, takeCheckInput, takeFramesInput } from "./own-agent-runs.js";
|
|
10
10
|
import { runId } from "./runs.js";
|
|
11
|
+
import { upscaleRequest } from "./upscale.js";
|
|
11
12
|
import { measuredVideoSize } from "./video-size.js";
|
|
12
13
|
import { makeUgcInput } from "./skills.js";
|
|
13
14
|
import { uploadImportRequest, uploadIntentRequest } from "./uploads.js";
|
|
@@ -65,6 +66,12 @@ export function generationIdempotencyKeyFor(skill, request, clientId) {
|
|
|
65
66
|
.update(clientId + JSON.stringify(canonicalize(parsed)))
|
|
66
67
|
.digest("hex");
|
|
67
68
|
}
|
|
69
|
+
export function upscaleIdempotencyKeyFor(request, clientId) {
|
|
70
|
+
const parsed = { op: "upscale", request: upscaleRequest.parse(request) };
|
|
71
|
+
return createHash("sha256")
|
|
72
|
+
.update(clientId + JSON.stringify(canonicalize(parsed)))
|
|
73
|
+
.digest("hex");
|
|
74
|
+
}
|
|
68
75
|
export function ownAgentIdempotencyKeyFor(skill, request, clientId) {
|
|
69
76
|
const schema = skill === "film_stills" ? filmStillsInput : skill === "film_voice" ? filmVoiceInput : skill === "film_hero" ? filmHeroInput
|
|
70
77
|
: skill === "film_edit" ? filmEditInput : skill === "film_take_frames" ? takeFramesInput : skill === "film_take_check" ? takeCheckInput
|
package/dist/index.d.ts
CHANGED
|
@@ -74,6 +74,7 @@ export * from "./speech-rhythm-contract.js";
|
|
|
74
74
|
export * from "./face-billing.js";
|
|
75
75
|
export * from "./long-form-pricing.js";
|
|
76
76
|
export * from "./parts-pricing.js";
|
|
77
|
+
export * from "./presenter-engine.js";
|
|
77
78
|
export * from "./music.js";
|
|
78
79
|
export * from "./edit-music.js";
|
|
79
80
|
export * from "./presenter-matte.js";
|
|
@@ -93,6 +94,7 @@ export * from "./generation-shot.js";
|
|
|
93
94
|
export * from "./scene-bible.js";
|
|
94
95
|
export * from "./generations.js";
|
|
95
96
|
export * from "./generations-output.js";
|
|
97
|
+
export * from "./upscale.js";
|
|
96
98
|
export * from "./reference-profile.js";
|
|
97
99
|
export * from "./reference-bring.js";
|
|
98
100
|
export * from "./reference-lyrics.js";
|
|
@@ -102,6 +104,7 @@ export * from "./reference-staging.js";
|
|
|
102
104
|
export * from "./reference-text-spans.js";
|
|
103
105
|
export * from "./reference-voice.js";
|
|
104
106
|
export * from "./reference-analysis.js";
|
|
107
|
+
export * from "./reference-film-kit.js";
|
|
105
108
|
export * from "./brand-styles.js";
|
|
106
109
|
export * from "./reference-display.js";
|
|
107
110
|
export * from "./creator-profile.js";
|
package/dist/index.js
CHANGED
|
@@ -74,6 +74,7 @@ export * from "./speech-rhythm-contract.js";
|
|
|
74
74
|
export * from "./face-billing.js";
|
|
75
75
|
export * from "./long-form-pricing.js";
|
|
76
76
|
export * from "./parts-pricing.js";
|
|
77
|
+
export * from "./presenter-engine.js";
|
|
77
78
|
export * from "./music.js";
|
|
78
79
|
export * from "./edit-music.js";
|
|
79
80
|
export * from "./presenter-matte.js";
|
|
@@ -93,6 +94,7 @@ export * from "./generation-shot.js";
|
|
|
93
94
|
export * from "./scene-bible.js";
|
|
94
95
|
export * from "./generations.js";
|
|
95
96
|
export * from "./generations-output.js";
|
|
97
|
+
export * from "./upscale.js";
|
|
96
98
|
export * from "./reference-profile.js";
|
|
97
99
|
export * from "./reference-bring.js";
|
|
98
100
|
export * from "./reference-lyrics.js";
|
|
@@ -102,6 +104,7 @@ export * from "./reference-staging.js";
|
|
|
102
104
|
export * from "./reference-text-spans.js";
|
|
103
105
|
export * from "./reference-voice.js";
|
|
104
106
|
export * from "./reference-analysis.js";
|
|
107
|
+
export * from "./reference-film-kit.js";
|
|
105
108
|
export * from "./brand-styles.js";
|
|
106
109
|
export * from "./reference-display.js";
|
|
107
110
|
export * from "./creator-profile.js";
|
package/dist/mascots.d.ts
CHANGED
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const MASCOT_POSES: readonly ["up", "palm", "point", "celebrate", "surprise", "think", "shrug", "wink", "neutral"];
|
|
3
3
|
export type MascotPoseName = (typeof MASCOT_POSES)[number];
|
|
4
|
+
export declare const MASCOT_SPRITES: readonly ["half", "open", "blink", "smile", "surprise", "look_left", "look_right"];
|
|
5
|
+
export type MascotSpriteName = (typeof MASCOT_SPRITES)[number];
|
|
6
|
+
export declare const MASCOT_TALK_SPRITES: readonly ["half", "open", "blink"];
|
|
7
|
+
export declare const mascotSprite: z.ZodObject<{
|
|
8
|
+
key: z.ZodString;
|
|
9
|
+
bytes: z.ZodNumber;
|
|
10
|
+
sha256: z.ZodString;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
export type MascotSprite = z.infer<typeof mascotSprite>;
|
|
13
|
+
export declare const mascotAnchors: z.ZodObject<{
|
|
14
|
+
eyes: z.ZodTuple<[z.ZodObject<{
|
|
15
|
+
x: z.ZodNumber;
|
|
16
|
+
y: z.ZodNumber;
|
|
17
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
18
|
+
x: z.ZodNumber;
|
|
19
|
+
y: z.ZodNumber;
|
|
20
|
+
}, z.core.$strict>], null>;
|
|
21
|
+
mouth: z.ZodObject<{
|
|
22
|
+
x: z.ZodNumber;
|
|
23
|
+
y: z.ZodNumber;
|
|
24
|
+
}, z.core.$strict>;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
export type MascotAnchors = z.infer<typeof mascotAnchors>;
|
|
4
27
|
export declare const mascotPose: z.ZodObject<{
|
|
5
28
|
key: z.ZodString;
|
|
6
29
|
bytes: z.ZodNumber;
|
|
@@ -25,11 +48,40 @@ export declare const mascotPose: z.ZodObject<{
|
|
|
25
48
|
rig: z.ZodOptional<z.ZodString>;
|
|
26
49
|
photo: z.ZodOptional<z.ZodLiteral<true>>;
|
|
27
50
|
unread: z.ZodOptional<z.ZodLiteral<true>>;
|
|
51
|
+
sprites: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
52
|
+
blink: "blink";
|
|
53
|
+
half: "half";
|
|
54
|
+
look_left: "look_left";
|
|
55
|
+
look_right: "look_right";
|
|
56
|
+
open: "open";
|
|
57
|
+
smile: "smile";
|
|
58
|
+
surprise: "surprise";
|
|
59
|
+
}> & z.core.$partial, z.ZodObject<{
|
|
60
|
+
key: z.ZodString;
|
|
61
|
+
bytes: z.ZodNumber;
|
|
62
|
+
sha256: z.ZodString;
|
|
63
|
+
}, z.core.$strict>>>;
|
|
64
|
+
anchors: z.ZodOptional<z.ZodObject<{
|
|
65
|
+
eyes: z.ZodTuple<[z.ZodObject<{
|
|
66
|
+
x: z.ZodNumber;
|
|
67
|
+
y: z.ZodNumber;
|
|
68
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
69
|
+
x: z.ZodNumber;
|
|
70
|
+
y: z.ZodNumber;
|
|
71
|
+
}, z.core.$strict>], null>;
|
|
72
|
+
mouth: z.ZodObject<{
|
|
73
|
+
x: z.ZodNumber;
|
|
74
|
+
y: z.ZodNumber;
|
|
75
|
+
}, z.core.$strict>;
|
|
76
|
+
}, z.core.$strict>>;
|
|
77
|
+
head: z.ZodOptional<z.ZodLiteral<true>>;
|
|
78
|
+
quiet: z.ZodOptional<z.ZodLiteral<true>>;
|
|
28
79
|
}, z.core.$strict>;
|
|
29
80
|
export type MascotPose = z.infer<typeof mascotPose>;
|
|
30
|
-
export type MascotPoseFace = "works" | "still" | "faceless";
|
|
81
|
+
export type MascotPoseFace = "works" | "still" | "faceless" | "quiet";
|
|
31
82
|
export declare function mascotPoseFace(pose: unknown): MascotPoseFace;
|
|
32
83
|
export declare const mascotPoseWorks: (pose: unknown) => boolean;
|
|
84
|
+
export declare function heroLook(details: string | null | undefined): "drawn" | "photo";
|
|
33
85
|
export declare const mascotPoses: z.ZodRecord<z.ZodEnum<{
|
|
34
86
|
celebrate: "celebrate";
|
|
35
87
|
neutral: "neutral";
|
|
@@ -64,6 +116,34 @@ export declare const mascotPoses: z.ZodRecord<z.ZodEnum<{
|
|
|
64
116
|
rig: z.ZodOptional<z.ZodString>;
|
|
65
117
|
photo: z.ZodOptional<z.ZodLiteral<true>>;
|
|
66
118
|
unread: z.ZodOptional<z.ZodLiteral<true>>;
|
|
119
|
+
sprites: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
120
|
+
blink: "blink";
|
|
121
|
+
half: "half";
|
|
122
|
+
look_left: "look_left";
|
|
123
|
+
look_right: "look_right";
|
|
124
|
+
open: "open";
|
|
125
|
+
smile: "smile";
|
|
126
|
+
surprise: "surprise";
|
|
127
|
+
}> & z.core.$partial, z.ZodObject<{
|
|
128
|
+
key: z.ZodString;
|
|
129
|
+
bytes: z.ZodNumber;
|
|
130
|
+
sha256: z.ZodString;
|
|
131
|
+
}, z.core.$strict>>>;
|
|
132
|
+
anchors: z.ZodOptional<z.ZodObject<{
|
|
133
|
+
eyes: z.ZodTuple<[z.ZodObject<{
|
|
134
|
+
x: z.ZodNumber;
|
|
135
|
+
y: z.ZodNumber;
|
|
136
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
137
|
+
x: z.ZodNumber;
|
|
138
|
+
y: z.ZodNumber;
|
|
139
|
+
}, z.core.$strict>], null>;
|
|
140
|
+
mouth: z.ZodObject<{
|
|
141
|
+
x: z.ZodNumber;
|
|
142
|
+
y: z.ZodNumber;
|
|
143
|
+
}, z.core.$strict>;
|
|
144
|
+
}, z.core.$strict>>;
|
|
145
|
+
head: z.ZodOptional<z.ZodLiteral<true>>;
|
|
146
|
+
quiet: z.ZodOptional<z.ZodLiteral<true>>;
|
|
67
147
|
}, z.core.$strict>>;
|
|
68
148
|
export type MascotPoses = z.infer<typeof mascotPoses>;
|
|
69
149
|
export declare const pinnedMascot: z.ZodObject<{
|
|
@@ -102,6 +182,34 @@ export declare const pinnedMascot: z.ZodObject<{
|
|
|
102
182
|
rig: z.ZodOptional<z.ZodString>;
|
|
103
183
|
photo: z.ZodOptional<z.ZodLiteral<true>>;
|
|
104
184
|
unread: z.ZodOptional<z.ZodLiteral<true>>;
|
|
185
|
+
sprites: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
186
|
+
blink: "blink";
|
|
187
|
+
half: "half";
|
|
188
|
+
look_left: "look_left";
|
|
189
|
+
look_right: "look_right";
|
|
190
|
+
open: "open";
|
|
191
|
+
smile: "smile";
|
|
192
|
+
surprise: "surprise";
|
|
193
|
+
}> & z.core.$partial, z.ZodObject<{
|
|
194
|
+
key: z.ZodString;
|
|
195
|
+
bytes: z.ZodNumber;
|
|
196
|
+
sha256: z.ZodString;
|
|
197
|
+
}, z.core.$strict>>>;
|
|
198
|
+
anchors: z.ZodOptional<z.ZodObject<{
|
|
199
|
+
eyes: z.ZodTuple<[z.ZodObject<{
|
|
200
|
+
x: z.ZodNumber;
|
|
201
|
+
y: z.ZodNumber;
|
|
202
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
203
|
+
x: z.ZodNumber;
|
|
204
|
+
y: z.ZodNumber;
|
|
205
|
+
}, z.core.$strict>], null>;
|
|
206
|
+
mouth: z.ZodObject<{
|
|
207
|
+
x: z.ZodNumber;
|
|
208
|
+
y: z.ZodNumber;
|
|
209
|
+
}, z.core.$strict>;
|
|
210
|
+
}, z.core.$strict>>;
|
|
211
|
+
head: z.ZodOptional<z.ZodLiteral<true>>;
|
|
212
|
+
quiet: z.ZodOptional<z.ZodLiteral<true>>;
|
|
105
213
|
}, z.core.$strict>>;
|
|
106
214
|
}, z.core.$strict>;
|
|
107
215
|
export type PinnedMascot = z.infer<typeof pinnedMascot>;
|
|
@@ -118,5 +226,6 @@ export declare const mascotSummary: z.ZodObject<{
|
|
|
118
226
|
wink: "wink";
|
|
119
227
|
}>>;
|
|
120
228
|
character: z.ZodNullable<z.ZodString>;
|
|
229
|
+
head: z.ZodOptional<z.ZodBoolean>;
|
|
121
230
|
}, z.core.$strict>;
|
|
122
231
|
export type MascotSummary = z.infer<typeof mascotSummary>;
|
package/dist/mascots.js
CHANGED
|
@@ -2,6 +2,15 @@ import { z } from "zod";
|
|
|
2
2
|
import { assetId } from "./asset-identity.js";
|
|
3
3
|
export const MASCOT_POSES = ["up", "palm", "point", "celebrate", "surprise", "think", "shrug", "wink", "neutral"];
|
|
4
4
|
const share = z.number().min(0).max(1);
|
|
5
|
+
export const MASCOT_SPRITES = ["half", "open", "blink", "smile", "surprise", "look_left", "look_right"];
|
|
6
|
+
export const MASCOT_TALK_SPRITES = ["half", "open", "blink"];
|
|
7
|
+
export const mascotSprite = z.strictObject({
|
|
8
|
+
key: z.string().min(1).max(300),
|
|
9
|
+
bytes: z.number().int().positive().max(32 * 1024 ** 2),
|
|
10
|
+
sha256: z.string().regex(/^[a-f0-9]{64}$/),
|
|
11
|
+
});
|
|
12
|
+
const point = z.strictObject({ x: share, y: share });
|
|
13
|
+
export const mascotAnchors = z.strictObject({ eyes: z.tuple([point, point]), mouth: point });
|
|
5
14
|
export const mascotPose = z.strictObject({
|
|
6
15
|
key: z.string().min(1).max(300),
|
|
7
16
|
bytes: z.number().int().positive().max(32 * 1024 ** 2),
|
|
@@ -13,13 +22,35 @@ export const mascotPose = z.strictObject({
|
|
|
13
22
|
rig: z.string().min(1).max(300).optional(),
|
|
14
23
|
photo: z.literal(true).optional(),
|
|
15
24
|
unread: z.literal(true).optional(),
|
|
25
|
+
sprites: z.partialRecord(z.enum(MASCOT_SPRITES), mascotSprite).optional(),
|
|
26
|
+
anchors: mascotAnchors.optional(),
|
|
27
|
+
head: z.literal(true).optional(),
|
|
28
|
+
quiet: z.literal(true).optional(),
|
|
29
|
+
}).superRefine((pose, ctx) => {
|
|
30
|
+
const issue = (message) => ctx.addIssue({ code: z.ZodIssueCode.custom, message });
|
|
31
|
+
if (pose.sprites && !pose.anchors)
|
|
32
|
+
issue("a pose with sprites carries their anchors");
|
|
33
|
+
if (pose.anchors && !pose.sprites)
|
|
34
|
+
issue("anchors come with sprites");
|
|
35
|
+
if (pose.sprites && (pose.mouth || pose.eyes))
|
|
36
|
+
issue("a pose with sprites keeps its own mouth: no mouth or eyes to draw");
|
|
37
|
+
if (pose.head && !MASCOT_SPRITES.every(name => pose.sprites?.[name]))
|
|
38
|
+
issue("a head carries every sprite");
|
|
39
|
+
if (pose.quiet && (pose.sprites || pose.mouth || pose.eyes))
|
|
40
|
+
issue("a quiet pose has no face to move");
|
|
16
41
|
});
|
|
17
42
|
export function mascotPoseFace(pose) {
|
|
18
43
|
if (typeof pose !== "object" || pose === null)
|
|
19
44
|
return "faceless";
|
|
20
|
-
const { photo, mouth, eyes, unread } = pose;
|
|
45
|
+
const { photo, mouth, eyes, unread, sprites, anchors, quiet } = pose;
|
|
21
46
|
if (photo === true)
|
|
22
47
|
return "works";
|
|
48
|
+
if (typeof sprites === "object" && sprites !== null) {
|
|
49
|
+
const has = (name) => { const s = sprites[name]; return (typeof s === "object" && s !== null) || typeof s === "string"; };
|
|
50
|
+
return has("half") && has("open") && typeof anchors === "object" && anchors !== null ? "works" : "still";
|
|
51
|
+
}
|
|
52
|
+
if (quiet === true)
|
|
53
|
+
return "quiet";
|
|
23
54
|
if (typeof mouth === "object" && mouth !== null) {
|
|
24
55
|
const ink = mouth.ink;
|
|
25
56
|
return typeof ink === "string" ? "works" : !Object.hasOwn(mouth, "ink") ? "still" : "faceless";
|
|
@@ -28,10 +59,16 @@ export function mascotPoseFace(pose) {
|
|
|
28
59
|
return unread === true || (Array.isArray(points) && points.length > 0) ? "still" : "faceless";
|
|
29
60
|
}
|
|
30
61
|
export const mascotPoseWorks = (pose) => mascotPoseFace(pose) === "works";
|
|
62
|
+
const PHOTO_LOOK = /\b(?:photo[- ]?real\w*|photographic|hyper[- ]?real\w*|realistic|life[- ]?like|true[- ]to[- ]life|live[- ]action|real[- ]photo|keep (?:\w+ )?(?:as )?(?:a |the )?photo|as (?:a |in the )?photo)\b/i;
|
|
63
|
+
const DRAWN_LOOK = /\b(?:cartoon\w*|drawn|drawing|illustrat\w*|animated|anime|[23]d|comic\w*|sketch\w*|styli[sz]ed|caricature\w*)\b/i;
|
|
64
|
+
export function heroLook(details) {
|
|
65
|
+
return details && PHOTO_LOOK.test(details) && !DRAWN_LOOK.test(details) ? "photo" : "drawn";
|
|
66
|
+
}
|
|
31
67
|
export const mascotPoses = z.partialRecord(z.enum(MASCOT_POSES), mascotPose)
|
|
32
68
|
.refine((poses) => poses.neutral !== undefined, { message: "a mascot holds its neutral pose" });
|
|
33
69
|
export const pinnedMascot = z.strictObject({ asset_id: assetId, poses: mascotPoses });
|
|
34
70
|
export const mascotSummary = z.strictObject({
|
|
35
71
|
poses: z.array(z.enum(MASCOT_POSES)).min(1),
|
|
36
72
|
character: z.string().min(1).nullable(),
|
|
73
|
+
head: z.boolean().optional(),
|
|
37
74
|
});
|
|
@@ -23,7 +23,7 @@ export declare const MCP_UGC_DESCRIPTIONS: {
|
|
|
23
23
|
readonly actor_gender: string;
|
|
24
24
|
readonly aspect_ratio: string;
|
|
25
25
|
readonly caption_mode: string;
|
|
26
|
-
readonly visible_ai_label: "
|
|
26
|
+
readonly visible_ai_label: "Not available right now: a request that sets it is refused.";
|
|
27
27
|
readonly layout_windows: string;
|
|
28
28
|
readonly end_hold_s: string;
|
|
29
29
|
readonly edit_sounds: string;
|
|
@@ -105,7 +105,7 @@ export const MCP_UGC_DESCRIPTIONS = {
|
|
|
105
105
|
"image. A source more than 15% off the request is refused (aspect_conflict) before any charge.",
|
|
106
106
|
caption_mode: "full (default): every spoken word. highlights: only around caption_emphasis quotes (lead-in, quote, short tail); requires " +
|
|
107
107
|
"caption_emphasis. Captions hide under a full-frame insert.",
|
|
108
|
-
visible_ai_label: "
|
|
108
|
+
visible_ai_label: "Not available right now: a request that sets it is refused.",
|
|
109
109
|
layout_windows: "Text-anchored presenter reframings: split (9:16 only) or card; no overlap with each other or an insert; needs what " +
|
|
110
110
|
"inserts need. A covered or blurred presenter is billed as face time.",
|
|
111
111
|
end_hold_s: "Seconds the last frame holds after the last word, the presenter frozen and every layer kept; production seconds. Needs " +
|
package/dist/music.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { PartsLine } from "./parts-pricing.js";
|
|
3
3
|
export declare const MUSIC_BED_CREDITS = 60;
|
|
4
|
+
export declare const FILM_MUSIC_BED_CREDITS = 20;
|
|
4
5
|
export declare const MUSIC_MOOD_MAX_CHARS = 400;
|
|
5
6
|
export declare const MUSIC_DESCRIPTION: string;
|
|
6
7
|
export declare const ONE_LINE_TEXT: RegExp;
|
package/dist/music.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export const MUSIC_BED_CREDITS = 60;
|
|
3
|
+
export const FILM_MUSIC_BED_CREDITS = 20;
|
|
3
4
|
export const MUSIC_MOOD_MAX_CHARS = 400;
|
|
4
5
|
export const MUSIC_DESCRIPTION = "Background music under the voice, made for this video by AI; it may carry an invisible watermark; off unless " +
|
|
5
6
|
'you ask. "auto" takes the mood from the ' +
|
package/dist/openapi.js
CHANGED
|
@@ -25,6 +25,7 @@ import { API_ENDPOINTS, endpointLabel } from "./endpoints.js";
|
|
|
25
25
|
import { facelessQuoteResponse } from "./faceless-public.js";
|
|
26
26
|
import { feedbackRequest, feedbackResponse } from "./feedback.js";
|
|
27
27
|
import { generateImageRequest, generateVideoRequest, generationModels, generationQuote } from "./generations.js";
|
|
28
|
+
import { upscaleQuote, upscaleRequest } from "./upscale.js";
|
|
28
29
|
import { pricesResponse } from "./prices.js";
|
|
29
30
|
import { PUBLIC_API_BASE_URL, PUBLIC_APP_BASE_URL } from "./public-endpoints.js";
|
|
30
31
|
import { healthResponse, publicSkillsResponse } from "./public-responses.js";
|
|
@@ -175,14 +176,14 @@ export const OPENAPI_ROUTES = {
|
|
|
175
176
|
"POST /v1/take-checks/quote": { exposure: "excluded", reason: "Not offered yet: film runs join the contract when their mode launches (#1337)." },
|
|
176
177
|
"POST /v1/take-checks": { exposure: "excluded", reason: "Not offered yet: film runs join the contract when their mode launches (#1337)." },
|
|
177
178
|
"GET /v1/film-runs/{id}": { exposure: "excluded", reason: "Not offered yet: film runs join the contract when their mode launches (#1337)." },
|
|
178
|
-
"POST /v1/film-cuts/check": { exposure: "excluded", reason: "
|
|
179
|
-
"POST /v1/film-cuts/quote": { exposure: "excluded", reason: "
|
|
180
|
-
"POST /v1/film-cuts": { exposure: "excluded", reason: "
|
|
181
|
-
"POST /v1/cut-previews/quote": { exposure: "excluded", reason: "
|
|
182
|
-
"POST /v1/cut-previews": { exposure: "excluded", reason: "
|
|
183
|
-
"POST /v1/cuts": { exposure: "excluded", reason: "
|
|
184
|
-
"POST /v1/cuts/{id}": { exposure: "excluded", reason: "
|
|
185
|
-
"GET /v1/cuts/{id}": { exposure: "excluded", reason: "
|
|
179
|
+
"POST /v1/film-cuts/check": { exposure: "excluded", reason: "Offered through MCP (check_cut)." },
|
|
180
|
+
"POST /v1/film-cuts/quote": { exposure: "excluded", reason: "Offered through MCP (quote_cut, render_cut)." },
|
|
181
|
+
"POST /v1/film-cuts": { exposure: "excluded", reason: "Offered through MCP (quote_cut, render_cut)." },
|
|
182
|
+
"POST /v1/cut-previews/quote": { exposure: "excluded", reason: "Offered through MCP (quote_cut_preview, preview_cut)." },
|
|
183
|
+
"POST /v1/cut-previews": { exposure: "excluded", reason: "Offered through MCP (quote_cut_preview, preview_cut)." },
|
|
184
|
+
"POST /v1/cuts": { exposure: "excluded", reason: "Offered through MCP (create_cut, get_cut, update_cut)." },
|
|
185
|
+
"POST /v1/cuts/{id}": { exposure: "excluded", reason: "Offered through MCP (create_cut, get_cut, update_cut)." },
|
|
186
|
+
"GET /v1/cuts/{id}": { exposure: "excluded", reason: "Offered through MCP (create_cut, get_cut, update_cut)." },
|
|
186
187
|
"GET /v1/film-guide": { exposure: "excluded", reason: "Not offered yet: the film guide joins the contract when its mode launches (#1356)." },
|
|
187
188
|
"GET /v1/film-kit": { exposure: "excluded", reason: "Not offered yet: the film kit joins the contract when its mode launches (#1356)." },
|
|
188
189
|
"GET /v1/ad-guide": { exposure: "excluded", reason: "Not offered yet: the ad guide joins the contract when it opens to every account (#1539)." },
|
|
@@ -220,6 +221,10 @@ export const OPENAPI_ROUTES = {
|
|
|
220
221
|
body: named("GenerateVideoRequest", generateVideoRequest), responses: { 200: named("GenerationQuote", generationQuote) } },
|
|
221
222
|
"POST /v1/skills/generate_video/run": { exposure: "public", operationId: "generateVideo", tag: "Skills",
|
|
222
223
|
body: named("GenerateVideoRequest", generateVideoRequest), responses: { 202: Run, 200: Run } },
|
|
224
|
+
"POST /v1/skills/upscale/quote": { exposure: "public", operationId: "quoteUpscale", tag: "Skills",
|
|
225
|
+
body: named("UpscaleRequest", upscaleRequest), responses: { 200: named("UpscaleQuote", upscaleQuote) } },
|
|
226
|
+
"POST /v1/skills/upscale/run": { exposure: "public", operationId: "upscale", tag: "Skills",
|
|
227
|
+
body: named("UpscaleRequest", upscaleRequest), responses: { 202: Run, 200: Run } },
|
|
223
228
|
"POST /v1/reference-analyses/quote": { exposure: "public", operationId: "quoteAnalysis", tag: "Reference analysis",
|
|
224
229
|
body: named("AnalyzeReferenceRequest", analyzeReferenceRequest), responses: { 200: named("AnalysisQuote", analysisQuoteResponse) } },
|
|
225
230
|
"POST /v1/reference-analyses": { exposure: "public", operationId: "analyzeReference", tag: "Reference analysis",
|
|
@@ -10,6 +10,11 @@ export declare const OWN_VOICE_CREDITS_PER_SECOND = 2;
|
|
|
10
10
|
export declare const OWN_STILLS_MAX_PER_CALL = 24, OWN_FILM_MAX_SECONDS = 120, OWN_VOICE_MAX_SECONDS = 120;
|
|
11
11
|
export declare const OWN_STILLS_SINGLE_MAX = 8;
|
|
12
12
|
export declare const OWN_HERO_POSE_CREDITS = 9, OWN_HERO_POSES = 9;
|
|
13
|
+
export declare const OWN_HERO_HEAD_CREDITS = 120;
|
|
14
|
+
export declare const OWN_HEAD_FAILED_PER_DAY = 3;
|
|
15
|
+
export declare const OWN_HERO_SPRITE_CREDITS = 8;
|
|
16
|
+
export declare const OWN_HERO_TALKING_POSES: readonly ["neutral", "palm", "point", "up"];
|
|
17
|
+
export declare const OWN_HERO_MAX_SPRITES: number;
|
|
13
18
|
export declare const OWN_EDIT_CREDITS = 10, OWN_EDIT_MAX_SECONDS = 60;
|
|
14
19
|
export declare const OWN_TAKE_FRAMES_MAX = 96, TAKE_FRAMES_PER_HOUR = 60, TAKE_FRAMES_WINDOW_SECONDS = 3600;
|
|
15
20
|
export declare const TAKE_PICTURE_CHECKS_PER_HOUR = 30;
|
|
@@ -18,6 +23,8 @@ export declare const HERO_RUNS_PER_HOUR = 10;
|
|
|
18
23
|
export declare const OWN_HERO_FREE_POSES_PER_DAY = 27;
|
|
19
24
|
export declare const OWN_HERO_FREE_POSES_WINDOW_HOURS = 24;
|
|
20
25
|
export declare const CUT_PREVIEWS_PER_HOUR = 20;
|
|
26
|
+
export declare const CUTS_IN_FLIGHT_PER_ACCOUNT = 4;
|
|
27
|
+
export declare const CUT_BUSY_RETRY_SECONDS = 120;
|
|
21
28
|
export declare const OWN_TAKE_CHECK_CREDITS = 10;
|
|
22
29
|
export declare const OWN_TAKE_CHECK_PICTURE_CREDITS = 20;
|
|
23
30
|
export declare const OWN_TAKE_CHECK_PICTURE_LONG_CREDITS = 38, TAKE_PICTURE_SHORT_TIER_SECONDS = 4.1;
|
|
@@ -45,8 +52,11 @@ export declare const ownAgentTerms: z.ZodObject<{
|
|
|
45
52
|
extra_second_credits: z.ZodNumber;
|
|
46
53
|
voice_credits_per_second: z.ZodNumber;
|
|
47
54
|
pose_credits: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
head_credits: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
sprite_credits: z.ZodOptional<z.ZodNumber>;
|
|
48
57
|
edit_credits: z.ZodOptional<z.ZodNumber>;
|
|
49
58
|
music_credits: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
film_music_credits: z.ZodOptional<z.ZodNumber>;
|
|
50
60
|
take_check_credits: z.ZodOptional<z.ZodNumber>;
|
|
51
61
|
picture_check_credits: z.ZodOptional<z.ZodNumber>;
|
|
52
62
|
picture_check_long_credits: z.ZodOptional<z.ZodNumber>;
|
|
@@ -60,12 +70,16 @@ export declare const ownAgentTerms: z.ZodObject<{
|
|
|
60
70
|
free_stills_window_hours: z.ZodOptional<z.ZodNumber>;
|
|
61
71
|
}, z.core.$strict>;
|
|
62
72
|
export type OwnAgentTerms = z.infer<typeof ownAgentTerms>;
|
|
63
|
-
export declare const ownAgentTermsNow: (
|
|
73
|
+
export declare const ownAgentTermsNow: (options?: {
|
|
74
|
+
sprites?: boolean;
|
|
75
|
+
}) => OwnAgentTerms;
|
|
64
76
|
export declare const isOwnAgentEnabled: (env: Readonly<Record<string, string | undefined>>) => boolean;
|
|
65
|
-
export declare const
|
|
77
|
+
export declare const isFilmHeadEnabled: (env: Readonly<Record<string, string | undefined>>) => boolean;
|
|
78
|
+
export declare const isHeroSpritesEnabled: (env: Readonly<Record<string, string | undefined>>) => boolean;
|
|
79
|
+
export declare function ownFilmRenderCredits(s: number, terms?: OwnAgentTerms, music?: boolean): number;
|
|
66
80
|
export declare const ownVoiceCredits: (s: number, terms?: OwnAgentTerms) => number;
|
|
67
81
|
export declare function ownStillsCredits(n: number, terms?: OwnAgentTerms, free?: number): number;
|
|
68
|
-
export declare function ownHeroCredits(n: number, terms?: OwnAgentTerms): number;
|
|
82
|
+
export declare function ownHeroCredits(n: number, terms?: OwnAgentTerms, sprites?: number, head?: boolean): number;
|
|
69
83
|
export declare function ownEditCredits(s: number, terms?: OwnAgentTerms, music?: boolean): number;
|
|
70
84
|
export type OwnAgentDelivery = {
|
|
71
85
|
skill: "film_stills";
|
|
@@ -81,9 +95,12 @@ export type OwnAgentDelivery = {
|
|
|
81
95
|
} | {
|
|
82
96
|
skill: "film_render";
|
|
83
97
|
seconds: number;
|
|
98
|
+
music?: boolean;
|
|
84
99
|
} | {
|
|
85
100
|
skill: "film_hero";
|
|
86
101
|
poses: number;
|
|
102
|
+
sprites?: number;
|
|
103
|
+
head?: boolean;
|
|
87
104
|
} | {
|
|
88
105
|
skill: "film_edit";
|
|
89
106
|
seconds: number;
|
package/dist/own-agent-price.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { FACELESS_EXPLAINER_POSE_PICTURES } from "./faceless-price.js";
|
|
3
|
-
import { MUSIC_BED_CREDITS } from "./music.js";
|
|
3
|
+
import { FILM_MUSIC_BED_CREDITS, MUSIC_BED_CREDITS } from "./music.js";
|
|
4
4
|
export const OWN_AGENT_TARIFF = "own-agent-v2";
|
|
5
5
|
export const OWN_AGENT_TARIFF_V1 = "own-agent-v1";
|
|
6
6
|
export const OWN_AGENT_SKILLS = ["film_stills", "film_voice", "film_render", "film_hero", "film_edit", "film_take_frames", "film_take_check",
|
|
@@ -12,6 +12,11 @@ export const OWN_VOICE_CREDITS_PER_SECOND = 2;
|
|
|
12
12
|
export const OWN_STILLS_MAX_PER_CALL = 24, OWN_FILM_MAX_SECONDS = 120, OWN_VOICE_MAX_SECONDS = 120;
|
|
13
13
|
export const OWN_STILLS_SINGLE_MAX = 8;
|
|
14
14
|
export const OWN_HERO_POSE_CREDITS = 9, OWN_HERO_POSES = FACELESS_EXPLAINER_POSE_PICTURES;
|
|
15
|
+
export const OWN_HERO_HEAD_CREDITS = 120;
|
|
16
|
+
export const OWN_HEAD_FAILED_PER_DAY = 3;
|
|
17
|
+
export const OWN_HERO_SPRITE_CREDITS = 8;
|
|
18
|
+
export const OWN_HERO_TALKING_POSES = ["neutral", "palm", "point", "up"];
|
|
19
|
+
export const OWN_HERO_MAX_SPRITES = OWN_HERO_TALKING_POSES.length * 3;
|
|
15
20
|
export const OWN_EDIT_CREDITS = 10, OWN_EDIT_MAX_SECONDS = 60;
|
|
16
21
|
export const OWN_TAKE_FRAMES_MAX = 96, TAKE_FRAMES_PER_HOUR = 60, TAKE_FRAMES_WINDOW_SECONDS = 3600;
|
|
17
22
|
export const TAKE_PICTURE_CHECKS_PER_HOUR = 30;
|
|
@@ -20,6 +25,8 @@ export const HERO_RUNS_PER_HOUR = 10;
|
|
|
20
25
|
export const OWN_HERO_FREE_POSES_PER_DAY = 27;
|
|
21
26
|
export const OWN_HERO_FREE_POSES_WINDOW_HOURS = 24;
|
|
22
27
|
export const CUT_PREVIEWS_PER_HOUR = 20;
|
|
28
|
+
export const CUTS_IN_FLIGHT_PER_ACCOUNT = 4;
|
|
29
|
+
export const CUT_BUSY_RETRY_SECONDS = 120;
|
|
23
30
|
export const OWN_TAKE_CHECK_CREDITS = 10;
|
|
24
31
|
export const OWN_TAKE_CHECK_PICTURE_CREDITS = 20;
|
|
25
32
|
export const OWN_TAKE_CHECK_PICTURE_LONG_CREDITS = 38, TAKE_PICTURE_SHORT_TIER_SECONDS = 4.1;
|
|
@@ -39,8 +46,11 @@ export const ownAgentTerms = z.strictObject({
|
|
|
39
46
|
extra_second_credits: z.number().int().nonnegative(),
|
|
40
47
|
voice_credits_per_second: z.number().int().nonnegative(),
|
|
41
48
|
pose_credits: z.number().int().nonnegative().optional(),
|
|
49
|
+
head_credits: z.number().int().nonnegative().optional(),
|
|
50
|
+
sprite_credits: z.number().int().nonnegative().optional(),
|
|
42
51
|
edit_credits: z.number().int().nonnegative().optional(),
|
|
43
52
|
music_credits: z.number().int().nonnegative().optional(),
|
|
53
|
+
film_music_credits: z.number().int().nonnegative().optional(),
|
|
44
54
|
take_check_credits: z.number().int().nonnegative().optional(),
|
|
45
55
|
picture_check_credits: z.number().int().nonnegative().optional(),
|
|
46
56
|
picture_check_long_credits: z.number().int().nonnegative().optional(),
|
|
@@ -56,13 +66,18 @@ export const ownAgentTerms = z.strictObject({
|
|
|
56
66
|
.refine(t => new Set(CUT_TERMS.map(key => t[key] === undefined)).size === 1, "a cut's prices come all together or not at all");
|
|
57
67
|
const CUT_TERMS = ["cut_credits", "cut_included_seconds", "cut_extra_second_credits", "cut_bed_credits", "cut_take_sound_credits_per_second",
|
|
58
68
|
"cut_music_credits"];
|
|
59
|
-
export const ownAgentTermsNow = () => ({ tariff: OWN_AGENT_TARIFF, still_credits: OWN_STILL_CREDITS,
|
|
69
|
+
export const ownAgentTermsNow = (options = {}) => ({ tariff: OWN_AGENT_TARIFF, still_credits: OWN_STILL_CREDITS,
|
|
70
|
+
render_credits: OWN_FILM_RENDER_CREDITS,
|
|
60
71
|
included_seconds: OWN_FILM_INCLUDED_SECONDS, extra_second_credits: OWN_FILM_EXTRA_SECOND_CREDITS, voice_credits_per_second: OWN_VOICE_CREDITS_PER_SECOND,
|
|
61
|
-
pose_credits: OWN_HERO_POSE_CREDITS,
|
|
72
|
+
pose_credits: OWN_HERO_POSE_CREDITS, head_credits: OWN_HERO_HEAD_CREDITS, ...(options.sprites ? { sprite_credits: OWN_HERO_SPRITE_CREDITS } : {}),
|
|
73
|
+
edit_credits: OWN_EDIT_CREDITS, music_credits: MUSIC_BED_CREDITS, film_music_credits: FILM_MUSIC_BED_CREDITS,
|
|
74
|
+
take_check_credits: OWN_TAKE_CHECK_CREDITS,
|
|
62
75
|
picture_check_credits: OWN_TAKE_CHECK_PICTURE_CREDITS, picture_check_long_credits: OWN_TAKE_CHECK_PICTURE_LONG_CREDITS, free_stills: OWN_FREE_STILLS, free_stills_window_hours: OWN_FREE_STILLS_WINDOW_HOURS, cut_credits: OWN_CUT_CREDITS, cut_included_seconds: OWN_CUT_INCLUDED_SECONDS,
|
|
63
76
|
cut_extra_second_credits: OWN_CUT_EXTRA_SECOND_CREDITS, cut_bed_credits: OWN_CUT_BED_CREDITS,
|
|
64
77
|
cut_take_sound_credits_per_second: OWN_CUT_TAKE_SOUND_CREDITS_PER_SECOND, cut_music_credits: MUSIC_BED_CREDITS });
|
|
65
78
|
export const isOwnAgentEnabled = (env) => env.CLIPWRIGHT_OWN_AGENT === "1";
|
|
79
|
+
export const isFilmHeadEnabled = (env) => env.CLIPWRIGHT_FILM_HEAD === "1";
|
|
80
|
+
export const isHeroSpritesEnabled = (env) => env.CLIPWRIGHT_HERO_SPRITES === "1";
|
|
66
81
|
const seconds = (s, max, what) => {
|
|
67
82
|
if (!Number.isFinite(s) || s <= 0 || s > max)
|
|
68
83
|
throw new Error(`${what} of ${s} s is outside 0–${max} s`);
|
|
@@ -73,19 +88,35 @@ const frames = (n) => {
|
|
|
73
88
|
throw new Error(`${n} stills is outside 0–${OWN_STILLS_MAX_PER_CALL}`);
|
|
74
89
|
return n;
|
|
75
90
|
};
|
|
76
|
-
export
|
|
91
|
+
export function ownFilmRenderCredits(s, terms = ownAgentTermsNow(), music = false) {
|
|
92
|
+
const film = terms.render_credits + terms.extra_second_credits * Math.max(0, seconds(s, OWN_FILM_MAX_SECONDS, "a film") - terms.included_seconds);
|
|
93
|
+
if (music && terms.film_music_credits === undefined)
|
|
94
|
+
throw new Error("these terms price no film music");
|
|
95
|
+
return film + (music ? terms.film_music_credits : 0);
|
|
96
|
+
}
|
|
77
97
|
export const ownVoiceCredits = (s, terms = ownAgentTermsNow()) => terms.voice_credits_per_second * seconds(s, OWN_VOICE_MAX_SECONDS, "a take");
|
|
78
98
|
export function ownStillsCredits(n, terms = ownAgentTermsNow(), free = 0) {
|
|
79
99
|
if (!Number.isSafeInteger(free) || free < 0 || free > (terms.free_stills ?? 0))
|
|
80
100
|
throw new Error(`${free} free stills is outside these terms`);
|
|
81
101
|
return terms.still_credits * Math.max(0, frames(n) - free);
|
|
82
102
|
}
|
|
83
|
-
export function ownHeroCredits(n, terms = ownAgentTermsNow()) {
|
|
103
|
+
export function ownHeroCredits(n, terms = ownAgentTermsNow(), sprites = 0, head = false) {
|
|
104
|
+
if (head) {
|
|
105
|
+
if (terms.head_credits === undefined)
|
|
106
|
+
throw new Error("these terms price no head");
|
|
107
|
+
if (n !== 0 && n !== 1)
|
|
108
|
+
throw new Error(`${n} heads is outside 0–1`);
|
|
109
|
+
return terms.head_credits * n;
|
|
110
|
+
}
|
|
84
111
|
if (!Number.isSafeInteger(n) || n < 0 || n > OWN_HERO_POSES)
|
|
85
112
|
throw new Error(`${n} poses is outside 0–${OWN_HERO_POSES}`);
|
|
86
113
|
if (terms.pose_credits === undefined)
|
|
87
114
|
throw new Error("these terms price no hero pose");
|
|
88
|
-
|
|
115
|
+
if (!Number.isSafeInteger(sprites) || sprites < 0 || sprites > OWN_HERO_MAX_SPRITES)
|
|
116
|
+
throw new Error(`${sprites} sprites is outside 0–${OWN_HERO_MAX_SPRITES}`);
|
|
117
|
+
if (sprites > 0 && terms.sprite_credits === undefined)
|
|
118
|
+
throw new Error("these terms price no sprite");
|
|
119
|
+
return terms.pose_credits * n + (terms.sprite_credits ?? 0) * sprites;
|
|
89
120
|
}
|
|
90
121
|
export function ownEditCredits(s, terms = ownAgentTermsNow(), music = false) {
|
|
91
122
|
seconds(s, OWN_EDIT_MAX_SECONDS, "an edit");
|
|
@@ -121,11 +152,11 @@ export function ownTakeFramesCredits(sheets) {
|
|
|
121
152
|
export function ownAgentCharge(delivery, terms, heldCredits) {
|
|
122
153
|
const charge = delivery.skill === "film_stills" || delivery.skill === "film_cut_preview" ? ownStillsCredits(delivery.frames, terms, delivery.free)
|
|
123
154
|
: delivery.skill === "film_voice" ? ownVoiceCredits(delivery.seconds, terms)
|
|
124
|
-
: delivery.skill === "film_hero" ? ownHeroCredits(delivery.poses, terms)
|
|
155
|
+
: delivery.skill === "film_hero" ? ownHeroCredits(delivery.poses, terms, delivery.sprites ?? 0, delivery.head === true)
|
|
125
156
|
: delivery.skill === "film_edit" ? ownEditCredits(delivery.seconds, terms, delivery.music === true)
|
|
126
157
|
: delivery.skill === "film_take_frames" ? ownTakeFramesCredits(delivery.sheets)
|
|
127
158
|
: delivery.skill === "film_take_check" ? ownTakeCheckCredits(delivery.checks, terms, delivery.against, delivery.long === true)
|
|
128
|
-
: delivery.skill === "film_cut" ? ownCutCredits(delivery, terms) : ownFilmRenderCredits(delivery.seconds, terms);
|
|
159
|
+
: delivery.skill === "film_cut" ? ownCutCredits(delivery, terms) : ownFilmRenderCredits(delivery.seconds, terms, delivery.music === true);
|
|
129
160
|
if (!Number.isSafeInteger(heldCredits) || charge > heldCredits)
|
|
130
161
|
throw new Error(`${delivery.skill} charge ${charge} is over its hold ${heldCredits}`);
|
|
131
162
|
return charge;
|