@blitzreels/contracts 0.2.14 → 0.2.16
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/ai-credit-costs.d.ts +1 -1
- package/dist/clip-pipeline-credits.d.ts +23 -0
- package/dist/clip-pipeline-credits.d.ts.map +1 -0
- package/dist/clip-pipeline-credits.js +79 -0
- package/dist/clip-pipeline-credits.js.map +1 -0
- package/dist/creative-composition-edit.d.ts +198 -198
- package/dist/creative-style-contract.d.ts +70 -70
- package/dist/creative-style-contract.d.ts.map +1 -1
- package/dist/creative-style-contract.js +10 -4
- package/dist/creative-style-contract.js.map +1 -1
- package/dist/editor-command-contract.d.ts +132 -132
- package/dist/generation-image-size.d.ts.map +1 -1
- package/dist/generation-image-size.js +2 -0
- package/dist/generation-image-size.js.map +1 -1
- package/dist/generation-resolution.d.ts.map +1 -1
- package/dist/generation-resolution.js +4 -0
- package/dist/generation-resolution.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/metered-operations.d.ts +18 -1
- package/dist/metered-operations.d.ts.map +1 -1
- package/dist/metered-operations.js +14 -0
- package/dist/metered-operations.js.map +1 -1
- package/dist/model-prices.d.ts +45 -6
- package/dist/model-prices.d.ts.map +1 -1
- package/dist/model-prices.js +96 -15
- package/dist/model-prices.js.map +1 -1
- package/dist/output-assessment-contract.d.ts +48 -0
- package/dist/output-assessment-contract.d.ts.map +1 -0
- package/dist/output-assessment-contract.js +51 -0
- package/dist/output-assessment-contract.js.map +1 -0
- package/dist/plan-limits.d.ts +1 -0
- package/dist/plan-limits.d.ts.map +1 -1
- package/dist/plan-limits.js +5 -0
- package/dist/plan-limits.js.map +1 -1
- package/dist/popular-generation-models.d.ts +2 -2
- package/dist/popular-generation-models.d.ts.map +1 -1
- package/dist/popular-generation-models.js +3 -2
- package/dist/popular-generation-models.js.map +1 -1
- package/package.json +2 -2
|
@@ -2,7 +2,7 @@ export * from "./credit-units.js";
|
|
|
2
2
|
export declare const NARRATION_CHARS_PER_MINUTE: 750;
|
|
3
3
|
export declare const FACELESS_SCENE_DURATION_SECONDS: 6;
|
|
4
4
|
export declare const FACELESS_SCENE_COUNT_MIN: 3;
|
|
5
|
-
export declare const FACELESS_SCENE_COUNT_MAX:
|
|
5
|
+
export declare const FACELESS_SCENE_COUNT_MAX: 40;
|
|
6
6
|
export declare const FACELESS_CLIP_DURATION_SECONDS: 5;
|
|
7
7
|
export declare function estimateFacelessSceneCount({ durationSeconds, }: {
|
|
8
8
|
durationSeconds: number;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Conservative duration when metadata is missing so a run never starts underfunded. */
|
|
2
|
+
export declare const UNKNOWN_CLIP_PIPELINE_SOURCE_DURATION_SECONDS: number;
|
|
3
|
+
export declare const CLIP_AI_VISUAL_IMAGE_MODEL_ID = "google/nano-banana-2-lite";
|
|
4
|
+
export declare const CLIP_AI_VISUAL_VIDEO_MODEL_ID = "kling-2.1";
|
|
5
|
+
export declare const CLIP_AI_VISUAL_VIDEO_DURATION_SECONDS = 5;
|
|
6
|
+
export declare const MAX_AI_VISUAL_BEATS_PER_CLIP = 2;
|
|
7
|
+
export type ClipPipelineBrollOutputMode = "suggestions" | "images" | "videos";
|
|
8
|
+
/**
|
|
9
|
+
* User-facing credits to finish one clip-from-source run: optional link import, source analysis,
|
|
10
|
+
* one export per clip and the optional AI visuals and AI edit. Web, server and mobile share it so a
|
|
11
|
+
* run the client lets start is never refused by the server's budget check.
|
|
12
|
+
*/
|
|
13
|
+
export declare function estimateClipPipelineCredits({ sourceDurationSeconds, clipCount, maxClipDurationSeconds, includeImport, includedTrialPipeline, autoGenerateAiVisuals, autoAiEdit, brollOutputMode, }: {
|
|
14
|
+
sourceDurationSeconds: number;
|
|
15
|
+
clipCount: number;
|
|
16
|
+
maxClipDurationSeconds: number;
|
|
17
|
+
includeImport: boolean;
|
|
18
|
+
includedTrialPipeline: boolean;
|
|
19
|
+
autoGenerateAiVisuals: boolean;
|
|
20
|
+
autoAiEdit: boolean;
|
|
21
|
+
brollOutputMode: ClipPipelineBrollOutputMode;
|
|
22
|
+
}): number;
|
|
23
|
+
//# sourceMappingURL=clip-pipeline-credits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clip-pipeline-credits.d.ts","sourceRoot":"","sources":["../src/clip-pipeline-credits.ts"],"names":[],"mappings":"AAGA,wFAAwF;AACxF,eAAO,MAAM,6CAA6C,QAAU,CAAC;AACrE,eAAO,MAAM,6BAA6B,8BAA8B,CAAC;AACzE,eAAO,MAAM,6BAA6B,cAAc,CAAC;AACzD,eAAO,MAAM,qCAAqC,IAAI,CAAC;AACvD,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAG9C,MAAM,MAAM,2BAA2B,GAAG,aAAa,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAM9E;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,qBAAqB,EACrB,SAAS,EACT,sBAAsB,EACtB,aAAa,EACb,qBAAqB,EACrB,qBAAqB,EACrB,UAAU,EACV,eAAe,GAChB,EAAE;IACD,qBAAqB,EAAE,MAAM,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,aAAa,EAAE,OAAO,CAAC;IACvB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,2BAA2B,CAAC;CAC9C,GAAG,MAAM,CAyET"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { roundCreditDebit } from "./credit-units.js";
|
|
2
|
+
import { quoteMeteredOperation } from "./metered-operations.js";
|
|
3
|
+
/** Conservative duration when metadata is missing so a run never starts underfunded. */
|
|
4
|
+
export const UNKNOWN_CLIP_PIPELINE_SOURCE_DURATION_SECONDS = 15 * 60;
|
|
5
|
+
export const CLIP_AI_VISUAL_IMAGE_MODEL_ID = "google/nano-banana-2-lite";
|
|
6
|
+
export const CLIP_AI_VISUAL_VIDEO_MODEL_ID = "kling-2.1";
|
|
7
|
+
export const CLIP_AI_VISUAL_VIDEO_DURATION_SECONDS = 5;
|
|
8
|
+
export const MAX_AI_VISUAL_BEATS_PER_CLIP = 2;
|
|
9
|
+
const CLIP_AI_EDIT_AGENT_TOKEN_UNITS = 50;
|
|
10
|
+
function roundUpToTenth({ value }) {
|
|
11
|
+
return Math.ceil(value * 10) / 10;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* User-facing credits to finish one clip-from-source run: optional link import, source analysis,
|
|
15
|
+
* one export per clip and the optional AI visuals and AI edit. Web, server and mobile share it so a
|
|
16
|
+
* run the client lets start is never refused by the server's budget check.
|
|
17
|
+
*/
|
|
18
|
+
export function estimateClipPipelineCredits({ sourceDurationSeconds, clipCount, maxClipDurationSeconds, includeImport, includedTrialPipeline, autoGenerateAiVisuals, autoAiEdit, brollOutputMode, }) {
|
|
19
|
+
const durationSeconds = sourceDurationSeconds > 0 && Number.isFinite(sourceDurationSeconds)
|
|
20
|
+
? sourceDurationSeconds
|
|
21
|
+
: UNKNOWN_CLIP_PIPELINE_SOURCE_DURATION_SECONDS;
|
|
22
|
+
const durationMinutes = durationSeconds / 60;
|
|
23
|
+
const boundedClipCount = Math.max(0, Math.floor(clipCount));
|
|
24
|
+
const minutesPerClip = Math.max(1, Math.ceil(Math.max(0, maxClipDurationSeconds) / 60));
|
|
25
|
+
const importCredits = includeImport
|
|
26
|
+
? roundCreditDebit(quoteMeteredOperation({
|
|
27
|
+
operation: "url_import",
|
|
28
|
+
units: durationMinutes,
|
|
29
|
+
precision: "rate",
|
|
30
|
+
}))
|
|
31
|
+
: 0;
|
|
32
|
+
const analysisCredits = roundCreditDebit(quoteMeteredOperation({
|
|
33
|
+
operation: "source_analysis",
|
|
34
|
+
units: durationMinutes,
|
|
35
|
+
precision: "rate",
|
|
36
|
+
}));
|
|
37
|
+
const exportCredits = boundedClipCount *
|
|
38
|
+
quoteMeteredOperation({
|
|
39
|
+
operation: "export_video",
|
|
40
|
+
units: minutesPerClip,
|
|
41
|
+
precision: "rate",
|
|
42
|
+
});
|
|
43
|
+
const maxVisualCount = autoGenerateAiVisuals
|
|
44
|
+
? boundedClipCount * MAX_AI_VISUAL_BEATS_PER_CLIP
|
|
45
|
+
: 0;
|
|
46
|
+
const visualImageCredits = maxVisualCount *
|
|
47
|
+
quoteMeteredOperation({
|
|
48
|
+
operation: "image_generation",
|
|
49
|
+
model: CLIP_AI_VISUAL_IMAGE_MODEL_ID,
|
|
50
|
+
units: 1,
|
|
51
|
+
precision: "rate",
|
|
52
|
+
});
|
|
53
|
+
const visualVideoCredits = brollOutputMode === "videos"
|
|
54
|
+
? maxVisualCount *
|
|
55
|
+
quoteMeteredOperation({
|
|
56
|
+
operation: "image_to_video",
|
|
57
|
+
model: CLIP_AI_VISUAL_VIDEO_MODEL_ID,
|
|
58
|
+
units: CLIP_AI_VISUAL_VIDEO_DURATION_SECONDS,
|
|
59
|
+
precision: "rate",
|
|
60
|
+
})
|
|
61
|
+
: 0;
|
|
62
|
+
const editCredits = autoAiEdit
|
|
63
|
+
? boundedClipCount *
|
|
64
|
+
quoteMeteredOperation({
|
|
65
|
+
operation: "agent_token_estimate",
|
|
66
|
+
units: 1,
|
|
67
|
+
precision: "rate",
|
|
68
|
+
}) *
|
|
69
|
+
CLIP_AI_EDIT_AGENT_TOKEN_UNITS
|
|
70
|
+
: 0;
|
|
71
|
+
return roundUpToTenth({
|
|
72
|
+
value: importCredits +
|
|
73
|
+
(includedTrialPipeline ? 0 : analysisCredits + exportCredits) +
|
|
74
|
+
visualImageCredits +
|
|
75
|
+
visualVideoCredits +
|
|
76
|
+
editCredits,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=clip-pipeline-credits.js.map
|
|
@@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