@clipwright/core 0.34.0 → 0.36.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/README.md +6 -3
- package/dist/account-actors.d.ts +173 -15
- package/dist/account-actors.js +142 -11
- package/dist/account-actors.js.map +1 -1
- package/dist/actor-bounds.d.ts +4 -0
- package/dist/actor-bounds.js +4 -0
- package/dist/actor-bounds.js.map +1 -1
- package/dist/actors.d.ts +31 -0
- package/dist/actors.js +26 -0
- package/dist/actors.js.map +1 -1
- package/dist/api-failure.d.ts +1 -1
- package/dist/api-failure.js +2 -2
- package/dist/api-failure.js.map +1 -1
- package/dist/aspect.d.ts +1 -1
- package/dist/aspect.js +5 -5
- package/dist/aspect.js.map +1 -1
- package/dist/assets.d.ts +30 -6
- package/dist/assets.js +26 -8
- package/dist/assets.js.map +1 -1
- package/dist/billing-terms.d.ts +69 -0
- package/dist/billing-terms.js +8 -0
- package/dist/billing-terms.js.map +1 -1
- package/dist/canvas-fit.js +1 -1
- package/dist/canvas-fit.js.map +1 -1
- package/dist/contract-dispositions.d.ts +493 -9
- package/dist/contract-dispositions.js +38 -14
- package/dist/contract-dispositions.js.map +1 -1
- package/dist/contracts/v1/workflow-brief.d.ts +1441 -0
- package/dist/contracts/v1/workflow-brief.js +4 -0
- package/dist/contracts/v1/workflow-brief.js.map +1 -1
- package/dist/contracts/v1/workflow-catalog.d.ts +2181 -103
- package/dist/contracts/v1/workflow-catalog.js +4 -2
- package/dist/contracts/v1/workflow-catalog.js.map +1 -1
- package/dist/contracts/v1/workflow-client.d.ts +1673 -3
- package/dist/contracts/v1/workflow-client.js +6 -3
- package/dist/contracts/v1/workflow-client.js.map +1 -1
- package/dist/contracts/v1/workflow-execution.d.ts +164 -12
- package/dist/contracts/v1/workflow-execution.js +15 -7
- package/dist/contracts/v1/workflow-execution.js.map +1 -1
- package/dist/contracts/v1/workflow-plan.d.ts +3228 -140
- package/dist/contracts/v1/workflow-primitives.d.ts +3 -1
- package/dist/contracts/v1/workflow-primitives.js +1 -1
- package/dist/contracts/v1/workflow-primitives.js.map +1 -1
- package/dist/contracts/v1/workflow-run-read.d.ts +116 -3
- package/dist/edit-billing.d.ts +12 -0
- package/dist/edit-billing.js +7 -0
- package/dist/edit-billing.js.map +1 -1
- package/dist/edit-candidate.d.ts +2 -2
- package/dist/edit-candidate.js +2 -2
- package/dist/edit-candidate.js.map +1 -1
- package/dist/edit-long-form.d.ts +3 -3
- package/dist/edit-long-form.js +14 -4
- package/dist/edit-long-form.js.map +1 -1
- package/dist/edit-revision.d.ts +1 -1
- package/dist/edit-revision.js +1 -1
- package/dist/edit-revision.js.map +1 -1
- package/dist/endpoint-notes.d.ts +3 -0
- package/dist/endpoint-notes.js +70 -0
- package/dist/endpoint-notes.js.map +1 -0
- package/dist/endpoints.d.ts +4 -0
- package/dist/endpoints.js +16 -0
- package/dist/endpoints.js.map +1 -1
- package/dist/errors.d.ts +2 -2
- package/dist/errors.js +11 -2
- package/dist/errors.js.map +1 -1
- package/dist/face-billing.d.ts +55 -0
- package/dist/face-billing.js +24 -2
- package/dist/face-billing.js.map +1 -1
- package/dist/face-delivery.d.ts +1 -1
- package/dist/face-delivery.js +1 -1
- package/dist/face-delivery.js.map +1 -1
- package/dist/faceless-media-record.d.ts +1 -1
- package/dist/faceless-media-record.js +1 -1
- package/dist/faceless-media-record.js.map +1 -1
- package/dist/faceless-price.d.ts +49 -6
- package/dist/faceless-price.js +44 -10
- package/dist/faceless-price.js.map +1 -1
- package/dist/faceless-public-plan.d.ts +6 -2
- package/dist/faceless-public-plan.js +11 -7
- package/dist/faceless-public-plan.js.map +1 -1
- package/dist/faceless-public.d.ts +7 -2
- package/dist/faceless-public.js +5 -5
- package/dist/faceless-public.js.map +1 -1
- package/dist/faceless-voices.d.ts +6 -6
- package/dist/faceless-voices.js +5 -5
- package/dist/faceless-voices.js.map +1 -1
- package/dist/feedback.d.ts +29 -0
- package/dist/feedback.js +29 -0
- package/dist/feedback.js.map +1 -0
- package/dist/generations.d.ts +2 -19
- package/dist/generations.js +28 -49
- package/dist/generations.js.map +1 -1
- package/dist/idempotency.d.ts +2 -0
- package/dist/idempotency.js +7 -4
- package/dist/idempotency.js.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/dist/long-form-pricing.d.ts +7 -4
- package/dist/long-form-pricing.js +13 -10
- package/dist/long-form-pricing.js.map +1 -1
- package/dist/long-form-revision.js +1 -1
- package/dist/long-form-revision.js.map +1 -1
- package/dist/media-timebase.js +2 -2
- package/dist/media-timebase.js.map +1 -1
- package/dist/openapi.d.ts +155 -0
- package/dist/openapi.js +339 -0
- package/dist/openapi.js.map +1 -0
- package/dist/pacing.d.ts +15 -0
- package/dist/pacing.js +30 -0
- package/dist/pacing.js.map +1 -1
- package/dist/parts-pricing.d.ts +84 -0
- package/dist/parts-pricing.js +105 -0
- package/dist/parts-pricing.js.map +1 -0
- package/dist/presenter-beats.d.ts +45 -0
- package/dist/presenter-beats.js +144 -0
- package/dist/presenter-beats.js.map +1 -0
- package/dist/prices.d.ts +98 -0
- package/dist/prices.js +193 -0
- package/dist/prices.js.map +1 -0
- package/dist/public-responses.d.ts +23 -0
- package/dist/public-responses.js +11 -0
- package/dist/public-responses.js.map +1 -0
- package/dist/rate-limit.d.ts +2 -2
- package/dist/rate-limit.js +2 -2
- package/dist/rate-limit.js.map +1 -1
- package/dist/reference-analysis.d.ts +915 -0
- package/dist/reference-analysis.js +210 -0
- package/dist/reference-analysis.js.map +1 -0
- package/dist/reference-kinds.d.ts +8 -0
- package/dist/reference-kinds.js +10 -0
- package/dist/reference-kinds.js.map +1 -0
- package/dist/reference-profile.d.ts +671 -0
- package/dist/reference-profile.js +198 -0
- package/dist/reference-profile.js.map +1 -0
- package/dist/reference-staging.d.ts +583 -0
- package/dist/reference-staging.js +153 -0
- package/dist/reference-staging.js.map +1 -0
- package/dist/reference-voice.d.ts +305 -0
- package/dist/reference-voice.js +108 -0
- package/dist/reference-voice.js.map +1 -0
- package/dist/render-backend.d.ts +1 -1
- package/dist/resolved-timeline.d.ts +54 -2
- package/dist/resolved-timeline.js +52 -6
- package/dist/resolved-timeline.js.map +1 -1
- package/dist/run-static-warnings.js +15 -6
- package/dist/run-static-warnings.js.map +1 -1
- package/dist/runs.d.ts +78 -6
- package/dist/runs.js +9 -4
- package/dist/runs.js.map +1 -1
- package/dist/semantic-inserts.d.ts +1 -1
- package/dist/semantic-inserts.js +2 -2
- package/dist/semantic-inserts.js.map +1 -1
- package/dist/skills.d.ts +1810 -29
- package/dist/skills.js +148 -35
- package/dist/skills.js.map +1 -1
- package/dist/templates/callout.d.ts +2 -2
- package/dist/templates/callout.js +6 -6
- package/dist/templates/callout.js.map +1 -1
- package/dist/templates/checklist.js +2 -2
- package/dist/templates/checklist.js.map +1 -1
- package/dist/templates/index.d.ts +15 -8
- package/dist/templates/index.js +30 -18
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/notification.js +2 -2
- package/dist/templates/notification.js.map +1 -1
- package/dist/templates/phone-call.d.ts +3 -0
- package/dist/templates/phone-call.js +14 -7
- package/dist/templates/phone-call.js.map +1 -1
- package/dist/templates/progress.js +2 -2
- package/dist/templates/progress.js.map +1 -1
- package/dist/templates/size.d.ts +1 -1
- package/dist/templates/size.js +1 -1
- package/dist/templates/size.js.map +1 -1
- package/dist/templates/sounds.d.ts +357 -7
- package/dist/templates/sounds.js +34 -12
- package/dist/templates/sounds.js.map +1 -1
- package/dist/ugc-call.d.ts +89 -0
- package/dist/ugc-call.js +111 -0
- package/dist/ugc-call.js.map +1 -0
- package/dist/ugc-delivery.d.ts +1 -1
- package/dist/ugc-delivery.js +1 -1
- package/dist/ugc-delivery.js.map +1 -1
- package/dist/ugc-framing.d.ts +26 -0
- package/dist/ugc-framing.js +64 -0
- package/dist/ugc-framing.js.map +1 -0
- package/dist/ugc-layers.d.ts +5 -1
- package/dist/ugc-layers.js +6 -1
- package/dist/ugc-layers.js.map +1 -1
- package/dist/ugc-video-media.d.ts +1 -1
- package/dist/ugc-video-media.js +1 -1
- package/dist/ugc-video-media.js.map +1 -1
- package/dist/uploads.d.ts +2 -2
- package/dist/uploads.js +2 -2
- package/dist/uploads.js.map +1 -1
- package/dist/vendor-response.d.ts +4 -0
- package/dist/vendor-response.js +12 -0
- package/dist/vendor-response.js.map +1 -1
- package/dist/voice-admission.d.ts +836 -420
- package/dist/voice-admission.js +22 -5
- package/dist/voice-admission.js.map +1 -1
- package/dist/voice-listing.d.ts +4 -4
- package/dist/voice-listing.js +11 -6
- package/dist/voice-listing.js.map +1 -1
- package/dist/voice-pace.d.ts +34 -0
- package/dist/voice-pace.generated.json +72 -0
- package/dist/voice-pace.js +34 -0
- package/dist/voice-pace.js.map +1 -0
- package/dist/voices.d.ts +32 -19
- package/dist/voices.js +81 -35
- package/dist/voices.js.map +1 -1
- package/dist/workflows/catalog.js +2 -1
- package/dist/workflows/catalog.js.map +1 -1
- package/dist/workflows/index.d.ts +2 -0
- package/dist/workflows/index.js +2 -0
- package/dist/workflows/index.js.map +1 -1
- package/dist/workflows/methods/faceless-explainer.d.ts +388 -10
- package/dist/workflows/methods/kinetic-launch.d.ts +388 -10
- package/dist/workflows/methods/kinetic-launch.js +1 -1
- package/dist/workflows/methods/product-image-story.d.ts +388 -10
- package/dist/workflows/methods/reference-remake.d.ts +881 -0
- package/dist/workflows/methods/reference-remake.js +26 -0
- package/dist/workflows/methods/reference-remake.js.map +1 -0
- package/dist/workflows/methods/shared.d.ts +388 -10
- package/dist/workflows/methods/shared.js +2 -2
- package/dist/workflows/methods/shared.js.map +1 -1
- package/dist/workflows/methods/ugc-faq-answer.d.ts +388 -10
- package/dist/workflows/methods/ugc-product-intro.d.ts +388 -10
- package/dist/workflows/methods/website-proof-demo.d.ts +388 -10
- package/dist/workflows/methods/website-proof-demo.js +1 -1
- package/dist/workflows/reference-remake.d.ts +684 -0
- package/dist/workflows/reference-remake.js +602 -0
- package/dist/workflows/reference-remake.js.map +1 -0
- package/dist/workflows/validate.js +10 -7
- package/dist/workflows/validate.js.map +1 -1
- package/package.json +9 -4
- package/CHANGELOG.md +0 -1393
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { assetId } from "./asset-identity.js";
|
|
3
|
+
import { ASSET_VIDEO_MAX_SECONDS } from "./assets.js";
|
|
4
|
+
import { MAX_REFERENCE_TRANSCRIPT_WORDS, referenceHook, referenceProfile, referenceWord } from "./reference-profile.js";
|
|
5
|
+
/** Reference analysis (reference-to-video S1c): an MP4 asset read into a `reference_profile`. Its status lives at its own */
|
|
6
|
+
/** path, as an asset's processing does; its money (#927) rides a run of skill `analyze_reference` that holds and settles it. */
|
|
7
|
+
export const REFERENCE_ANALYSES_PATH = "/v1/reference-analyses";
|
|
8
|
+
export const REFERENCE_ANALYSIS_PATH = "/v1/reference-analyses/:id";
|
|
9
|
+
export const REFERENCE_ANALYSIS_QUOTE_PATH = "/v1/reference-analyses/quote";
|
|
10
|
+
export const ANALYZE_REFERENCE_TASK = "analyze-reference";
|
|
11
|
+
/** The run skill that carries an analysis's hold and charge; not a `SKILLS` entry, since no `/v1/skills` route starts it. */
|
|
12
|
+
export const ANALYZE_REFERENCE_SKILL = "analyze_reference";
|
|
13
|
+
export const referenceAnalysisId = z.string().regex(/^ref_[a-f0-9]{32}$/);
|
|
14
|
+
/** The price of a delivered analysis. */
|
|
15
|
+
export const REFERENCE_ANALYSIS_CREDITS = 70;
|
|
16
|
+
/** The data mode: metrics, transcript and a frame sheet without the vision pass. */
|
|
17
|
+
export const REFERENCE_DATA_CREDITS = 10;
|
|
18
|
+
/** `full` reads the reference into a profile; `data` hands back its numbers, words and a frame sheet, with no vision call. */
|
|
19
|
+
export const REFERENCE_ANALYSIS_MODES = ["full", "data"];
|
|
20
|
+
export const REFERENCE_ANALYSIS_MODE_CREDITS = {
|
|
21
|
+
full: REFERENCE_ANALYSIS_CREDITS, data: REFERENCE_DATA_CREDITS,
|
|
22
|
+
};
|
|
23
|
+
/** New analyses per account per hour: each costs us vendor money even when it fails, so the cap stays beside the price. */
|
|
24
|
+
export const REFERENCE_ANALYSIS_PER_HOUR = 10;
|
|
25
|
+
/** The data mode's own cap, scope `reference_data`: cheap enough to run on every candidate reel of a search (#921). */
|
|
26
|
+
export const REFERENCE_DATA_PER_HOUR = 60;
|
|
27
|
+
export const REFERENCE_DATA_SHEET_COLUMNS = 3;
|
|
28
|
+
export const REFERENCE_DATA_SHEET_ROWS = 3;
|
|
29
|
+
export const REFERENCE_DATA_SHEET_MAX_WIDTH = 1080;
|
|
30
|
+
export const REFERENCE_ANALYSIS_WINDOW_SECONDS = 3600;
|
|
31
|
+
/** The analysis stops here and fails; under the task's ceiling. */
|
|
32
|
+
export const REFERENCE_ANALYSIS_WORK_SECONDS = 420;
|
|
33
|
+
export const REFERENCE_ANALYSIS_TASK_MAX_DURATION_SECONDS = 600;
|
|
34
|
+
/** Past this a read calls an unfinished analysis failed: a task killed at its ceiling writes nothing. */
|
|
35
|
+
export const REFERENCE_ANALYSIS_DEADLINE_SECONDS = 900;
|
|
36
|
+
export const REFERENCE_ANALYSIS_STATES = ["queued", "analyzing", "succeeded", "failed"];
|
|
37
|
+
export const REFERENCE_ANALYSIS_ERRORS = ["timed_out", "analysis_failed", "asset_gone", "enqueue_failed"];
|
|
38
|
+
export const REFERENCE_ANALYSIS_ERROR_MESSAGES = {
|
|
39
|
+
timed_out: "the analysis did not finish in time and was stopped; start it again",
|
|
40
|
+
analysis_failed: "the reference could not be analysed; start it again or use another clip",
|
|
41
|
+
asset_gone: "the asset was deleted before the analysis began",
|
|
42
|
+
enqueue_failed: "the analysis could not be started; start it again",
|
|
43
|
+
};
|
|
44
|
+
/** What starts an analysis: ids only, so no file name or reference text reaches a log. */
|
|
45
|
+
export const analyzeReferencePayload = z.strictObject({ analysisId: referenceAnalysisId, accountId: z.string().min(1) });
|
|
46
|
+
export const REFERENCE_SOURCE_PLATFORMS = ["instagram", "tiktok"];
|
|
47
|
+
/** The live analysis a link replays is found by this key; a short TikTok link has none before it is resolved. */
|
|
48
|
+
export const referenceSourceKey = z.string().regex(/^(instagram|tiktok):[A-Za-z0-9_-]{1,64}$/);
|
|
49
|
+
export const REFERENCE_URL_YOUTUBE_REFUSAL = "YouTube gives no video file through our source; upload the MP4 with create_asset";
|
|
50
|
+
export const REFERENCE_URL_ACCEPTED = "an Instagram reel or post link (instagram.com/reel/<code>, /reels/<code>, /p/<code>) or a TikTok " +
|
|
51
|
+
"video link (tiktok.com/@<user>/video/<id>, vm.tiktok.com/<code>)";
|
|
52
|
+
const INSTAGRAM_HOSTS = new Set(["instagram.com", "www.instagram.com", "m.instagram.com"]);
|
|
53
|
+
const TIKTOK_HOSTS = new Set(["tiktok.com", "www.tiktok.com", "m.tiktok.com"]);
|
|
54
|
+
const YOUTUBE_HOSTS = new Set(["youtube.com", "www.youtube.com", "m.youtube.com", "music.youtube.com", "youtu.be", "www.youtu.be"]);
|
|
55
|
+
/** Which post a link names, read from its text alone: no network, so a refusal costs nothing (#930 S3). */
|
|
56
|
+
export function classifyReferenceUrl(raw) {
|
|
57
|
+
let url;
|
|
58
|
+
try {
|
|
59
|
+
url = new URL(raw);
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return { ok: false, message: `source_url is not a link; pass ${REFERENCE_URL_ACCEPTED}` };
|
|
63
|
+
}
|
|
64
|
+
const host = url.hostname.toLowerCase();
|
|
65
|
+
if (YOUTUBE_HOSTS.has(host))
|
|
66
|
+
return { ok: false, message: REFERENCE_URL_YOUTUBE_REFUSAL };
|
|
67
|
+
if (url.protocol === "https:" && url.username === "" && url.password === "" && (url.port === "" || url.port === "443")) {
|
|
68
|
+
const path = url.pathname;
|
|
69
|
+
const instagram = INSTAGRAM_HOSTS.has(host) ? /^\/(?:reel|reels|p)\/([A-Za-z0-9_-]{5,64})\/?$/.exec(path) : null;
|
|
70
|
+
if (instagram)
|
|
71
|
+
return { ok: true, url: url.href, platform: "instagram", key: `instagram:${instagram[1]}` };
|
|
72
|
+
const tiktok = TIKTOK_HOSTS.has(host) ? /^\/@[A-Za-z0-9_.-]{1,64}\/video\/(\d{5,32})\/?$/.exec(path) : null;
|
|
73
|
+
if (tiktok)
|
|
74
|
+
return { ok: true, url: url.href, platform: "tiktok", key: `tiktok:${tiktok[1]}` };
|
|
75
|
+
if (host === "vm.tiktok.com" && /^\/[A-Za-z0-9]{4,32}\/?$/.test(path))
|
|
76
|
+
return { ok: true, url: url.href, platform: "tiktok", key: null };
|
|
77
|
+
}
|
|
78
|
+
return { ok: false, message: `${host} ${url.pathname} is not a link we read; pass ${REFERENCE_URL_ACCEPTED}` };
|
|
79
|
+
}
|
|
80
|
+
export const analyzeReferenceRequest = z.strictObject({
|
|
81
|
+
asset_id: assetId.optional().describe(`asset_id of an MP4 asset of this account, at most ${ASSET_VIDEO_MAX_SECONDS} s and 100 MiB`),
|
|
82
|
+
source_url: z.string().url().startsWith("https://").max(2048).optional()
|
|
83
|
+
.describe(`instead of asset_id: ${REFERENCE_URL_ACCEPTED}; YouTube is refused`),
|
|
84
|
+
mode: z.enum(REFERENCE_ANALYSIS_MODES).optional().describe(`full (default, ${REFERENCE_ANALYSIS_CREDITS} credits): the reference_profile. ` +
|
|
85
|
+
`data (${REFERENCE_DATA_CREDITS} credits): duration, size, timed transcript, hook and a 3×3 frame sheet, without the vision pass`),
|
|
86
|
+
}).refine((request) => (request.asset_id === undefined) !== (request.source_url === undefined), {
|
|
87
|
+
message: "pass exactly one of asset_id or source_url",
|
|
88
|
+
});
|
|
89
|
+
const count = z.number().int().nonnegative().nullable();
|
|
90
|
+
const authorMedian = z.strictObject({ views: z.number().nonnegative().nullable(), ratio: z.number().nonnegative().nullable(),
|
|
91
|
+
reels: z.number().int().nonnegative(), window: z.string().min(1) }).nullable();
|
|
92
|
+
/** The post behind a link analysis (#930 S3): `null` is unknown, never 0, and each unknown is also a line in `warnings[]`. */
|
|
93
|
+
export const referenceSource = z.strictObject({
|
|
94
|
+
url: z.string().url(),
|
|
95
|
+
platform: z.enum(REFERENCE_SOURCE_PLATFORMS),
|
|
96
|
+
key: referenceSourceKey,
|
|
97
|
+
measured_at: z.string().datetime(),
|
|
98
|
+
published_at: z.string().datetime().nullable(),
|
|
99
|
+
duration_s: z.number().positive().nullable(),
|
|
100
|
+
metrics: z.strictObject({ views: count, likes: count, comments: count, views_per_hour: z.number().nonnegative().nullable() }),
|
|
101
|
+
/** The median of the author's reels within ±30 days of the post, the post excluded. */
|
|
102
|
+
author_median: authorMedian,
|
|
103
|
+
/** The median of the author's 12 latest reels, the post excluded. */
|
|
104
|
+
author_recent: authorMedian,
|
|
105
|
+
top_comments: z.array(z.strictObject({ text: z.string().min(1).max(300), likes: count })).max(10),
|
|
106
|
+
code_words: z.array(z.strictObject({ word: z.string().min(1).max(24), count: z.number().int().min(2) })),
|
|
107
|
+
});
|
|
108
|
+
const frameSheet = z.strictObject({
|
|
109
|
+
columns: z.number().int().positive(),
|
|
110
|
+
rows: z.number().int().positive(),
|
|
111
|
+
/** Each frame's second, row by row; every one inside the reel. */
|
|
112
|
+
times_s: z.array(z.number().nonnegative()).min(1),
|
|
113
|
+
});
|
|
114
|
+
const dataWords = { transcript: z.array(referenceWord).max(MAX_REFERENCE_TRANSCRIPT_WORDS),
|
|
115
|
+
/** `null` when no word starts in the first seconds; no caption, since no vision pass read the screen. */
|
|
116
|
+
hook: referenceHook.nullable() };
|
|
117
|
+
const dataProbe = { duration_s: z.number().positive(), width: z.number().int().positive(), height: z.number().int().positive(),
|
|
118
|
+
fps: z.number().positive() };
|
|
119
|
+
/** What a succeeded data analysis hands back (#930 S4): the probe, the transcribed words as the profile writes them, and a frame sheet. */
|
|
120
|
+
export const referenceData = z.strictObject({
|
|
121
|
+
...dataProbe,
|
|
122
|
+
...dataWords,
|
|
123
|
+
/** `url` is signed for 7 days on each read; `null` once the sheet passed the renders' 30 days in storage, said in `warnings[]`. */
|
|
124
|
+
frame_sheet: frameSheet.extend({ url: z.string().url().nullable() }),
|
|
125
|
+
});
|
|
126
|
+
/** What the data pass answers: the words, the sheet it uploaded and its warnings. */
|
|
127
|
+
export const referenceDataPass = z.strictObject({ ...dataWords, frame_sheet: frameSheet, cost_usd: z.number().nonnegative(),
|
|
128
|
+
warnings: z.array(z.string()) });
|
|
129
|
+
/** The row's `data`: the answer with the sheet's R2 key in place of its link, and our vendor cost, which no client reads. */
|
|
130
|
+
export const referenceDataStored = z.strictObject({ ...dataProbe, ...dataWords, frame_sheet: frameSheet.extend({ key: z.string().min(1) }),
|
|
131
|
+
cost_usd: z.number().nonnegative() });
|
|
132
|
+
export const referenceAnalysis = z.strictObject({
|
|
133
|
+
analysis_id: referenceAnalysisId,
|
|
134
|
+
asset_id: assetId,
|
|
135
|
+
/** `full` or `data` (#930 S4); an analysis started before the modes is `full`. */
|
|
136
|
+
mode: z.enum(REFERENCE_ANALYSIS_MODES),
|
|
137
|
+
state: z.enum(REFERENCE_ANALYSIS_STATES),
|
|
138
|
+
/** Set once a full analysis succeeded, `null` before, on failure and for a data analysis. */
|
|
139
|
+
reference_profile: referenceProfile.nullable(),
|
|
140
|
+
/** Set once a data analysis succeeded, `null` before, on failure and for a full analysis. */
|
|
141
|
+
data: referenceData.nullable(),
|
|
142
|
+
/** The post's numbers, comments and code words for an analysis started by `source_url`; `null` for an asset start. */
|
|
143
|
+
source: referenceSource.nullable(),
|
|
144
|
+
warnings: z.array(z.string()),
|
|
145
|
+
error: z.strictObject({ code: z.enum(REFERENCE_ANALYSIS_ERRORS), message: z.string().min(1) }).nullable(),
|
|
146
|
+
/** Held at the start; 0 for an analysis started before it was paid (#927). */
|
|
147
|
+
credits_reserved: z.number().int().nonnegative(),
|
|
148
|
+
/** Set at settlement: the price once succeeded, 0 once failed; `null` while it runs. */
|
|
149
|
+
credits_charged: z.number().int().nonnegative().nullable(),
|
|
150
|
+
/** The account's balance right after the settlement, read in its transaction; `null` until settled. */
|
|
151
|
+
balance_after_credits: z.number().int().nullable(),
|
|
152
|
+
created_at: z.string().datetime(),
|
|
153
|
+
finished_at: z.string().datetime().nullable(),
|
|
154
|
+
});
|
|
155
|
+
export const analysisQuoteResponse = z.strictObject({
|
|
156
|
+
/** The quoted asset; for a `source_url`, the asset of the analysis it replays, else `null` (its asset is made at the start). */
|
|
157
|
+
asset_id: assetId.nullable(),
|
|
158
|
+
/** What starting it now holds and, once it succeeds, charges: 0 when the asset already has a live analysis to answer. */
|
|
159
|
+
credits_estimate: z.number().int().nonnegative(),
|
|
160
|
+
/** The analysis a start would answer for free, or `null` when a start would begin a new, paid one. */
|
|
161
|
+
replays_analysis_id: referenceAnalysisId.nullable(),
|
|
162
|
+
warnings: z.array(z.string()),
|
|
163
|
+
});
|
|
164
|
+
/** What a client reads: a new state, error code or profile field must not break an installed client. */
|
|
165
|
+
export const referenceAnalysisRead = referenceAnalysis.extend({
|
|
166
|
+
state: z.string(),
|
|
167
|
+
reference_profile: z.record(z.string(), z.unknown()).nullable(),
|
|
168
|
+
error: z.object({ code: z.string(), message: z.string() }).nullable(),
|
|
169
|
+
// A server from before #930 S3 sends no source; a later one may add metrics this client does not know.
|
|
170
|
+
source: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
171
|
+
// A server from before #930 S4 sends neither mode nor data.
|
|
172
|
+
mode: z.string().optional(),
|
|
173
|
+
data: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
174
|
+
// A server from before #927 sends no money fields.
|
|
175
|
+
credits_reserved: referenceAnalysis.shape.credits_reserved.optional(),
|
|
176
|
+
credits_charged: referenceAnalysis.shape.credits_charged.optional(),
|
|
177
|
+
balance_after_credits: referenceAnalysis.shape.balance_after_credits.optional(),
|
|
178
|
+
});
|
|
179
|
+
/** Rule 3: every element we cannot draw is said in `warnings[]` too, not only inside the profile. */
|
|
180
|
+
export function referenceAnalysisWarnings(profile) {
|
|
181
|
+
return [...profile.unmapped.map((entry) => `beat ${entry.beat_index}: ${entry.what} is not drawn by our templates; substitute: ${entry.suggested_substitute}`), ...profile.analysis.warnings ?? []];
|
|
182
|
+
}
|
|
183
|
+
export const ANALYZE_REFERENCE_DESCRIPTION = "Read a reference ad into a reference_profile: its beats (role, timing as shares of the clip, whether the presenter " +
|
|
184
|
+
"speaks, listens or is off screen), the graphics in our template vocabulary, captions, pacing, palette and music. " +
|
|
185
|
+
"It keeps the reference's words: transcript (timed words), hook (the words of its first 3 s, through the end of that sentence), each beat's spoken_summary " +
|
|
186
|
+
"and each graphic's label_hint. " +
|
|
187
|
+
"What we cannot draw is in unmapped with a substitute and in warnings. Pass asset_id of an MP4 asset (create_asset " +
|
|
188
|
+
`with kind: "video"), at most ${ASSET_VIDEO_MAX_SECONDS} s and 100 MiB, or source_url: ${REFERENCE_URL_ACCEPTED}. ` +
|
|
189
|
+
"A link becomes an analysis-only asset of this account (asset_id in the answer) and the answer's source carries the " +
|
|
190
|
+
"post's views, likes, comments, views per hour, the author's median views around it and over their 12 latest reels, each with the ratio, the top comments " +
|
|
191
|
+
"and the code words commenters repeat; a number the platform did not give is null and named in warnings. A YouTube " +
|
|
192
|
+
"link is refused: upload its MP4 with create_asset. " +
|
|
193
|
+
`mode: "data" skips the vision pass and answers data instead of a profile: duration, size and fps, the timed ` +
|
|
194
|
+
"transcript, the hook and a 3×3 frame sheet (a signed JPEG link), with source for a link as above; a reel with no " +
|
|
195
|
+
`speech gives an empty transcript and a warning. ${REFERENCE_ANALYSIS_CREDITS} credits for full, ${REFERENCE_DATA_CREDITS} ` +
|
|
196
|
+
"for data, held at the start and charged once it succeeds; a failed analysis costs nothing. " +
|
|
197
|
+
`${REFERENCE_ANALYSIS_PER_HOUR} new full and ${REFERENCE_DATA_PER_HOUR} new data analyses per hour per account. ` +
|
|
198
|
+
"Answers at once with state queued; call get_reference_analysis every 10 seconds until succeeded (about a minute) or " +
|
|
199
|
+
"failed. The same asset, or the same reel by its full link, in the same mode returns the same analysis, free, unless it " +
|
|
200
|
+
"failed; a short vm.tiktok.com link always starts a new one. The asset is not changed. The profile names techniques; it " +
|
|
201
|
+
"copies no face, voice, music or brand of the reference.";
|
|
202
|
+
export const GET_REFERENCE_ANALYSIS_DESCRIPTION = "Read an analysis started by analyze_reference: state queued or analyzing, succeeded with reference_profile (mode full) " +
|
|
203
|
+
"or data (mode data) and warnings, or failed with error.code and error.message (timed_out, analysis_failed, asset_gone, " +
|
|
204
|
+
"enqueue_failed); source holds the post's metrics for an analysis started by source_url. " +
|
|
205
|
+
"credits_charged is the price once succeeded, 0 once failed. Free.";
|
|
206
|
+
export const QUOTE_ANALYSIS_DESCRIPTION = "Price analyze_reference for an asset_id or a source_url and a mode before starting it: credits_estimate is what a start " +
|
|
207
|
+
`holds and charges once it succeeds (${REFERENCE_ANALYSIS_CREDITS} full, ${REFERENCE_DATA_CREDITS} data), 0 when the ` +
|
|
208
|
+
"asset or the reel already has an analysis in that mode that a start would answer (replays_analysis_id). A YouTube or " +
|
|
209
|
+
"unknown link is refused here too. Free; starts nothing.";
|
|
210
|
+
//# sourceMappingURL=reference-analysis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference-analysis.js","sourceRoot":"","sources":["../src/reference-analysis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,8BAA8B,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAyB,MAAM,wBAAwB,CAAC;AAE/I,6HAA6H;AAC7H,gIAAgI;AAEhI,MAAM,CAAC,MAAM,uBAAuB,GAAG,wBAAwB,CAAC;AAChE,MAAM,CAAC,MAAM,uBAAuB,GAAG,4BAA4B,CAAC;AACpE,MAAM,CAAC,MAAM,6BAA6B,GAAG,8BAA8B,CAAC;AAC5E,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAC1D,6HAA6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,CAAC;AAED,MAAM,CAAC,MAAM,6BAA6B,GACxC,qHAAqH;IACrH,mHAAmH;IACnH,4JAA4J;IAC5J,iCAAiC;IACjC,oHAAoH;IACpH,gCAAgC,uBAAuB,kCAAkC,sBAAsB,IAAI;IACnH,qHAAqH;IACrH,2JAA2J;IAC3J,oHAAoH;IACpH,qDAAqD;IACrD,8GAA8G;IAC9G,mHAAmH;IACnH,mDAAmD,0BAA0B,sBAAsB,sBAAsB,GAAG;IAC5H,6FAA6F;IAC7F,GAAG,2BAA2B,iBAAiB,uBAAuB,2CAA2C;IACjH,sHAAsH;IACtH,yHAAyH;IACzH,yHAAyH;IACzH,yDAAyD,CAAC;AAE5D,MAAM,CAAC,MAAM,kCAAkC,GAC7C,yHAAyH;IACzH,yHAAyH;IACzH,0FAA0F;IAC1F,mEAAmE,CAAC;AAEtE,MAAM,CAAC,MAAM,0BAA0B,GACrC,0HAA0H;IAC1H,uCAAuC,0BAA0B,UAAU,sBAAsB,qBAAqB;IACtH,uHAAuH;IACvH,yDAAyD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Our template kinds, media laid over or instead of the presenter, a split layout, and what we cannot draw yet. */
|
|
2
|
+
export declare const REFERENCE_GRAPHIC_KINDS: readonly ["tag", "lower_third", "end_card", "title_card", "quote", "stat", "callout", "checklist", "phone_call", "compare", "notification", "progress", "rating", "overlay_media", "insert_media", "layout_split", "particles", "unmapped"];
|
|
3
|
+
export type ReferenceGraphicKind = (typeof REFERENCE_GRAPHIC_KINDS)[number];
|
|
4
|
+
/** Kinds an analysis also reads from an element's description when the model said other: what the Ana reel's answer called other (#930). */
|
|
5
|
+
export declare const REFERENCE_DESCRIBED_KINDS: readonly ["banner", "logo_card", "comment_box", "price_card", "concept_card"];
|
|
6
|
+
/** The analyser's names for a graphic: its prompt's own list, plus ours. */
|
|
7
|
+
export declare const REFERENCE_SOURCE_KINDS: readonly ["toggle_checklist", "phone_call", "notification", "before_after_split", "split_screen", "stat", "product_ui", "screenshot", "title_card", "end_card", "particles", "banner", "logo_card", "comment_box", "price_card", "concept_card", "tag", "lower_third", "end_card", "title_card", "quote", "stat", "callout", "checklist", "phone_call", "compare", "notification", "progress", "rating", "overlay_media", "insert_media", "layout_split", "particles", "unmapped", "other"];
|
|
8
|
+
export type ReferenceSourceKind = (typeof REFERENCE_SOURCE_KINDS)[number];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TEMPLATE_KIND_IDS } from "./templates/index.js";
|
|
2
|
+
// A reference graphic's kinds, shared by the profile's beats and its staging (#914): their own module, so neither imports the other.
|
|
3
|
+
/** Our template kinds, media laid over or instead of the presenter, a split layout, and what we cannot draw yet. */
|
|
4
|
+
export const REFERENCE_GRAPHIC_KINDS = [...TEMPLATE_KIND_IDS, "overlay_media", "insert_media", "layout_split", "particles", "unmapped"];
|
|
5
|
+
/** Kinds an analysis also reads from an element's description when the model said other: what the Ana reel's answer called other (#930). */
|
|
6
|
+
export const REFERENCE_DESCRIBED_KINDS = ["banner", "logo_card", "comment_box", "price_card", "concept_card"];
|
|
7
|
+
/** The analyser's names for a graphic: its prompt's own list, plus ours. */
|
|
8
|
+
export const REFERENCE_SOURCE_KINDS = ["toggle_checklist", "phone_call", "notification", "before_after_split", "split_screen", "stat", "product_ui",
|
|
9
|
+
"screenshot", "title_card", "end_card", "particles", ...REFERENCE_DESCRIBED_KINDS, ...REFERENCE_GRAPHIC_KINDS, "other"];
|
|
10
|
+
//# sourceMappingURL=reference-kinds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference-kinds.js","sourceRoot":"","sources":["../src/reference-kinds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,qIAAqI;AAErI,oHAAoH;AACpH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,GAAG,iBAAiB,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,CAAU,CAAC;AAEjJ,4IAA4I;AAC5I,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,CAAU,CAAC;AACvH,4EAA4E;AAC5E,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,kBAAkB,EAAE,YAAY,EAAE,cAAc,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY;IACjJ,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,yBAAyB,EAAE,GAAG,uBAAuB,EAAE,OAAO,CAAU,CAAC"}
|