popost 4.6.10 → 4.6.12
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 +2 -0
- package/SKILL.md +5 -3
- package/assets/canvas/assets/{dist-C40jmU-w.js → dist-DAI3U0Jz.js} +1 -1
- package/assets/canvas/assets/{es-aF1SvUMY.js → es-3zEBH4X5.js} +1 -1
- package/assets/canvas/assets/index-Ce4sDSi9.css +1 -0
- package/assets/canvas/assets/{index-CxUXSxcb.js → index-Dc4qgNYJ.js} +4 -4
- package/assets/canvas/assets/{jszip.min-Bf2BQwaC.js → jszip.min-BwYI3Gs3.js} +1 -1
- package/assets/canvas/build-info.json +6 -6
- package/assets/canvas/index.html +2 -2
- package/dist/cli.js +18401 -14673
- package/dist/index.js +19448 -15784
- package/dist/types/cloud/account.d.ts +14 -0
- package/dist/types/cloud/deliver.d.ts +29 -0
- package/dist/types/cloud/entitlement.d.ts +55 -0
- package/dist/types/cloud/paid-gate.d.ts +159 -0
- package/dist/types/cloud/service.d.ts +68 -23
- package/dist/types/commands/update.d.ts +2 -0
- package/dist/types/device-login.d.ts +35 -0
- package/dist/types/editor/canvas-state.d.ts +1 -1
- package/dist/types/editor/handoff.d.ts +10 -3
- package/dist/types/editor/http-types.d.ts +4 -1
- package/dist/types/editor/routes-cloud.d.ts +4 -3
- package/dist/types/install/record.d.ts +15 -0
- package/dist/types/providers/api-errors.d.ts +2 -0
- package/dist/types/providers/api.d.ts +1 -1
- package/dist/types/providers/link-resolve.d.ts +29 -0
- package/dist/types/providers/link.d.ts +2 -0
- package/dist/types/runtime.d.ts +38 -0
- package/dist/types/update/auto.d.ts +14 -0
- package/dist/types/update/check.d.ts +47 -0
- package/dist/types/update/install-kind.d.ts +27 -0
- package/dist/types/update/npm.d.ts +8 -0
- package/dist/types/update/perform.d.ts +64 -0
- package/dist/types/update/report.d.ts +7 -0
- package/dist/types/update/semver.d.ts +17 -0
- package/dist/types/update/session.d.ts +19 -0
- package/dist/types/update/state.d.ts +91 -0
- package/dist/types/update/verify.d.ts +33 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/types/video/cache/frames.d.ts +85 -0
- package/dist/types/video/cache/holds.d.ts +35 -0
- package/dist/types/video/cache/project.d.ts +57 -0
- package/dist/types/video/commands/clean.d.ts +9 -0
- package/dist/types/video/commands/inputs.d.ts +2 -0
- package/dist/types/video/commands/materials.d.ts +6 -0
- package/dist/types/video/commands/product.d.ts +15 -0
- package/dist/types/video/commands/shared.d.ts +0 -5
- package/dist/types/video/compile/footage.d.ts +24 -7
- package/dist/types/video/compile/index.d.ts +3 -0
- package/dist/types/video/generate/cloud-image.d.ts +3 -1
- package/dist/types/video/generate/cloud.d.ts +5 -0
- package/dist/types/video/generate/dialogue.d.ts +2 -10
- package/dist/types/video/generate/index.d.ts +23 -2
- package/dist/types/video/inputs/collect.d.ts +104 -0
- package/dist/types/video/inputs/record.d.ts +106 -0
- package/dist/types/video/inputs/sheet.d.ts +8 -0
- package/dist/types/video/inputs/summary.d.ts +72 -0
- package/dist/types/video/preview/cloud.d.ts +20 -1
- package/dist/types/video/preview/edit/routes.d.ts +17 -11
- package/dist/types/video/preview/export-settings.d.ts +1 -2
- package/dist/types/video/preview/project.d.ts +3 -0
- package/dist/types/video/preview/shell/dom.d.ts +2 -0
- package/dist/types/video/preview/shell/studio/cloud.d.ts +6 -1
- package/dist/types/video/preview/shell/studio/compare.d.ts +16 -0
- package/dist/types/video/preview/shell/studio/copy.d.ts +24 -3
- package/dist/types/video/preview/shell/studio/paid.d.ts +23 -0
- package/dist/types/video/preview/shell/studio/style.d.ts +2 -2
- package/dist/types/video/preview/shell/studio/workspace.d.ts +2 -0
- package/dist/types/video/preview/shell-bundle.d.ts +1 -1
- package/dist/types/video/product/requests.d.ts +74 -0
- package/dist/types/video/product/review.d.ts +74 -0
- package/dist/types/video/product/sheet.d.ts +122 -0
- package/dist/types/video/project/schema.d.ts +21 -21
- package/dist/types/video/prompt-lang.d.ts +16 -0
- package/dist/types/video/render/index.d.ts +2 -0
- package/dist/types/video/render/session.d.ts +4 -0
- package/dist/types/video/replication/contract.d.ts +29 -29
- package/dist/types/video/replication/production.d.ts +5 -5
- package/dist/types/video/replication/schema.d.ts +2 -2
- package/dist/types/video/replication/speech-observed.d.ts +6 -6
- package/dist/types/video/sound/modes.d.ts +0 -8
- package/package.json +1 -1
- package/references/host-editor.md +21 -6
- package/references/image-workflow.md +5 -5
- package/references/onboarding.md +22 -1
- package/references/post-bundle.md +10 -8
- package/references/video-editing.md +19 -7
- package/references/video-performers.md +4 -2
- package/references/video-product.md +196 -0
- package/references/video-replication.md +1 -1
- package/references/video-step-1-read.md +16 -6
- package/references/video-step-3-content.md +15 -7
- package/references/video-step-6-voice.md +10 -0
- package/references/video-step-7-deliver.md +36 -1
- package/references/video-tools.md +61 -7
- package/references/video.md +26 -0
- package/assets/canvas/assets/index-C5rz5H21.css +0 -1
- package/dist/types/cloud/auth-flow.d.ts +0 -30
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Runtime } from '../../runtime';
|
|
2
2
|
import type { FootageFacts, FootageInfo, Project, Resolved } from '../types';
|
|
3
3
|
import { type FootageColour } from '../media/footage';
|
|
4
|
-
|
|
5
|
-
export
|
|
4
|
+
import type { FootageHold } from '../cache/holds';
|
|
5
|
+
export { FOOTAGE_CACHE } from '../cache/frames';
|
|
6
6
|
export interface FootageProbe {
|
|
7
7
|
/** Codecs that common browsers decode directly; other sources keep extracted frame pictures. */
|
|
8
8
|
native?: Record<string, boolean>;
|
|
@@ -15,6 +15,20 @@ export interface FootageStats {
|
|
|
15
15
|
extracted: number;
|
|
16
16
|
reused: number;
|
|
17
17
|
ms: number;
|
|
18
|
+
/** The size of the frame cache after the build, and what the build removed from it. */
|
|
19
|
+
cacheBytes?: number;
|
|
20
|
+
freedBytes?: number;
|
|
21
|
+
/** Set when the frames this timeline shows are alone larger than the cache's size cap: they stay. */
|
|
22
|
+
overCap?: {
|
|
23
|
+
neededBytes: number;
|
|
24
|
+
capBytes: number;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface ExtractOptions {
|
|
28
|
+
/** The render scale, so a half-size render extracts half-size pictures. */
|
|
29
|
+
scale?: number;
|
|
30
|
+
/** The caller shows the pictures for longer than the build (a render page, the preview): the directories are named in it before anything is removed. */
|
|
31
|
+
hold?: FootageHold;
|
|
18
32
|
}
|
|
19
33
|
/** Reads every video material whose file lies inside the project and exists (check reports the others). */
|
|
20
34
|
export declare const probeFootage: (rt: Runtime, project: Project, projectDir: string) => Promise<FootageProbe>;
|
|
@@ -27,12 +41,15 @@ export declare const extractSize: (r: Resolved, id: string, src: Pick<FootageFac
|
|
|
27
41
|
height: number;
|
|
28
42
|
};
|
|
29
43
|
/**
|
|
30
|
-
* Extracts the frames the timeline shows (missing ones only) and returns the timeline with each footage's dir set
|
|
31
|
-
*
|
|
44
|
+
* Extracts the frames the timeline shows (missing ones only) and returns the timeline with each footage's dir set,
|
|
45
|
+
* then removes from the cache what this state of the project no longer needs (never a failure of the build).
|
|
32
46
|
*/
|
|
33
|
-
export declare const extractFootage: (rt: Runtime, r: Resolved, projectDir: string, probed: FootageProbe, opts?: {
|
|
34
|
-
scale?: number;
|
|
35
|
-
}) => Promise<{
|
|
47
|
+
export declare const extractFootage: (rt: Runtime, r: Resolved, projectDir: string, probed: FootageProbe, opts?: ExtractOptions) => Promise<{
|
|
36
48
|
resolved: Resolved;
|
|
37
49
|
stats: FootageStats;
|
|
38
50
|
}>;
|
|
51
|
+
/**
|
|
52
|
+
* A build that shows no extracted frames (no video, or the Studio playing the clips themselves): the caller's hold
|
|
53
|
+
* names nothing, and the cache loses the directories of clips the project no longer has.
|
|
54
|
+
*/
|
|
55
|
+
export declare const releaseFootage: (rt: Runtime, r: Resolved, projectDir: string, opts?: ExtractOptions) => Promise<void>;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import type { Runtime } from '../../runtime';
|
|
7
7
|
import type { Problem, Project, Resolved } from '../types';
|
|
8
8
|
import { type FootageStats } from './footage';
|
|
9
|
+
import type { FootageHold } from '../cache/holds';
|
|
9
10
|
export { compilePage } from './page';
|
|
10
11
|
export { loadWords } from './words';
|
|
11
12
|
export interface BuiltPage {
|
|
@@ -27,6 +28,8 @@ export interface BuildOptions {
|
|
|
27
28
|
source?: unknown;
|
|
28
29
|
/** Fetch the effects of the catalogue the project names and does not have yet (render, preview, draft export). */
|
|
29
30
|
fetchEffects?: boolean;
|
|
31
|
+
/** The caller shows the page for longer than the build: the frame directories it shows are named in this hold (cache/holds.ts). */
|
|
32
|
+
hold?: FootageHold;
|
|
30
33
|
}
|
|
31
34
|
/** projectDir: as the user typed it (the problems name it so), against rt.cwd. */
|
|
32
35
|
export declare const buildPage: (rt: Runtime, projectDir: string, opts?: BuildOptions) => Promise<BuiltPage>;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { type JsonRecord } from '../../providers/base';
|
|
2
2
|
import type { Runtime } from '../../runtime';
|
|
3
3
|
import { type CloudSettings } from './cloud';
|
|
4
|
-
import { type GenerateRequest } from './index';
|
|
4
|
+
import { type GenerateRequest, type PriceToConfirm } from './index';
|
|
5
5
|
/** What a made picture says: what it cost, what this call charged (0 when it was paid before) and its request key. */
|
|
6
6
|
export interface MadePicture {
|
|
7
7
|
credits?: number;
|
|
8
8
|
chargedCredits: number;
|
|
9
9
|
key: string;
|
|
10
10
|
}
|
|
11
|
+
/** What a picture would cost (POST /images/quote, free): nothing is sent to a model and nothing is charged. */
|
|
12
|
+
export declare const pricePicture: (rt: Runtime, s: CloudSettings, config: JsonRecord, request: GenerateRequest) => Promise<PriceToConfirm>;
|
|
11
13
|
/** Makes the picture a request asks for at out, on popost.ai; resolves with what it cost and what this call charged. */
|
|
12
14
|
export declare const makePicture: (rt: Runtime, s: CloudSettings, config: JsonRecord, request: GenerateRequest, out: string) => Promise<MadePicture>;
|
|
@@ -63,5 +63,10 @@ export interface MadeClip {
|
|
|
63
63
|
}
|
|
64
64
|
/** Makes the clip a request asks for at out, on popost.ai; resolves with the credits it cost and was charged now. */
|
|
65
65
|
export declare const makeClip: (rt: Runtime, client: PopostClient, s: CloudSettings, request: GenerateRequest, out: string) => Promise<MadeClip>;
|
|
66
|
+
/**
|
|
67
|
+
* What a clip would cost, and nothing else: its references are uploaded as for any quote (free), the request is priced
|
|
68
|
+
* (POST /videos/quote), no task is looked up, made or waited for, and nothing is charged whatever the settings say.
|
|
69
|
+
*/
|
|
70
|
+
export declare const priceClip: (rt: Runtime, client: PopostClient, s: CloudSettings, request: GenerateRequest) => Promise<PriceToConfirm>;
|
|
66
71
|
/** GET /videos/models: the models a clip can be made with, and the one used when POPOST_VIDEO_MODEL is unset. */
|
|
67
72
|
export declare const listModels: (client: PopostClient) => Promise<JsonRecord>;
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Lines a person says in a generated clip, with their times. The integrated video models speak lines written into
|
|
3
|
-
* the prompt, with matching mouths, and keep to times given as "0.0-2.3 s ... says": so a request names the lines, who
|
|
4
|
-
* says each, and their language, and this program writes the times and the dialogue block of the prompt. The times
|
|
5
|
-
* come from the template: a line names the beat it re-makes ("beat"), the clip starts where a shot of the template
|
|
6
|
-
* starts ("shot", from 1; default: the shot in which the first named beat begins), and a line's slot is its beat's
|
|
7
|
-
* time counted from that shot's start. A fill then shows the clip from "in": 0 in that shot, and the person speaks
|
|
8
|
-
* where the reference's did. Seconds written by hand ("at", "to") are for a project without a template's beats only.
|
|
9
|
-
* Everything here is checked before a clip is paid for. Pure.
|
|
10
|
-
*/
|
|
11
1
|
import { type Pace } from '../retarget/pace';
|
|
12
2
|
import type { Problem } from '../types';
|
|
13
3
|
/** One line of a request: who says what, in which beat of the template (or, without beats, from when to when in the clip). */
|
|
@@ -113,4 +103,6 @@ export declare const coverageProblems: (requests: readonly {
|
|
|
113
103
|
/** The sentence that keeps music out of a clip of a video whose music is one separate track. */
|
|
114
104
|
export declare const NO_MUSIC = " No background music and no score in this clip: only the ambient sound of the scene, its sound effects and any dialogue. The music of the video is a separate track.";
|
|
115
105
|
/** The dialogue block of a prompt: the language in plain words, native lip-synced speech, each line with its time, and what must not be heard or seen. English whatever the lines' language; the lines are verbatim. */
|
|
106
|
+
/** NO_MUSIC in the language of the prompt. */
|
|
107
|
+
export declare const noMusic: () => string;
|
|
116
108
|
export declare const dialoguePrompt: (d: TimedDialogue) => string;
|
|
@@ -30,8 +30,10 @@ import type { Problem } from '../types';
|
|
|
30
30
|
import { type UnplannedClip } from './approved';
|
|
31
31
|
import { type VisibleSpeech } from './speech';
|
|
32
32
|
import { type BeatTimes } from './dialogue';
|
|
33
|
+
import { type PromptPolicy } from '../prompt-lang';
|
|
33
34
|
import { type ClipMusicBasis, type ModeContext, type RecordedException, type SoundMode } from '../sound/modes';
|
|
34
35
|
import { type ClipMusicUse } from './clip-sound';
|
|
36
|
+
import { type ReferenceLimits } from '../product/requests';
|
|
35
37
|
export type GenerateKind = 'video' | 'image';
|
|
36
38
|
export interface GenerateRequest {
|
|
37
39
|
prompt: string;
|
|
@@ -111,6 +113,12 @@ export declare const commandGenerator: (rt: Runtime) => Generator | undefined;
|
|
|
111
113
|
export interface MaterialRequest extends GenerateRequest {
|
|
112
114
|
/** Visible role ids from cast.json; [] explicitly declares a shot without people. */
|
|
113
115
|
cast?: string[];
|
|
116
|
+
/**
|
|
117
|
+
* The products of the project's product sheet this file shows (production/product.json; product/requests.ts); []
|
|
118
|
+
* declares that it shows none. Every picture the user gave of them goes with the request as a reference picture,
|
|
119
|
+
* and the sheet's product block into its prompt. A project with a sheet refuses a request without this.
|
|
120
|
+
*/
|
|
121
|
+
products?: string[];
|
|
114
122
|
speech?: VisibleSpeech;
|
|
115
123
|
/**
|
|
116
124
|
* The role of the clip's own sound in the video (sound/modes.ts; video-sound.md): "speech", "exhibit", "ambience"
|
|
@@ -185,6 +193,8 @@ export interface RequestPolicy {
|
|
|
185
193
|
clipMusic?: readonly RecordedException[];
|
|
186
194
|
}
|
|
187
195
|
export declare const NOTES = "materials.json";
|
|
196
|
+
/** The name of a requested file among the inputs the user confirms (inputs/record.ts): "clip:assets/a.mp4", "picture:assets/a.png". */
|
|
197
|
+
export declare const inputKey: (file: string) => string;
|
|
188
198
|
/** A clip this short is near the shortest a model makes. */
|
|
189
199
|
export declare const SHORT_CLIP = 5;
|
|
190
200
|
/** From this many short clips on, a list is asked whether they could be one call. */
|
|
@@ -250,16 +260,27 @@ export declare const lastFrameFile: (clip: string) => string;
|
|
|
250
260
|
* to (approved.ts). o.plan (materials --confirm): the clips of
|
|
251
261
|
* this list become the agreed clips when the project has none yet.
|
|
252
262
|
*/
|
|
253
|
-
export declare const makeMaterials: (rt: Runtime, o:
|
|
263
|
+
export declare const makeMaterials: (rt: Runtime, o: MaterialsRun) => Promise<MaterialsReport>;
|
|
264
|
+
type MaterialsRun = Parameters<typeof makeMaterialsIn>[1] & {
|
|
265
|
+
lang?: string; /** How the model in use takes prompts (prompt-lang.ts); default "user". */
|
|
266
|
+
policy?: PromptPolicy;
|
|
267
|
+
};
|
|
268
|
+
declare const makeMaterialsIn: (rt: Runtime, o: {
|
|
254
269
|
requests: MaterialRequest[];
|
|
255
270
|
dir: string;
|
|
256
271
|
generator: Generator;
|
|
257
272
|
anchor?: boolean;
|
|
258
273
|
picture?: AnchorPicture;
|
|
259
|
-
plan?: boolean;
|
|
274
|
+
plan?: boolean; /** The product rules' view of the run: the model's reference limits, and whether files are paid for now (product/requests.ts). */
|
|
275
|
+
product?: {
|
|
276
|
+
limits?: ReferenceLimits;
|
|
277
|
+
unread?: string;
|
|
278
|
+
paying?: boolean;
|
|
279
|
+
};
|
|
260
280
|
times?: BeatTimes;
|
|
261
281
|
music?: boolean;
|
|
262
282
|
modes?: ModeContext;
|
|
263
283
|
submitOnly?: boolean;
|
|
264
284
|
onStep?: (file: string, done: number, total: number) => void;
|
|
265
285
|
}) => Promise<MaterialsReport>;
|
|
286
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { Runtime } from '../../runtime';
|
|
2
|
+
import { type AnchorPicture, type MaterialRequest } from '../generate/index';
|
|
3
|
+
import type { BeatTimes } from '../generate/dialogue';
|
|
4
|
+
import { type PromptPolicy } from '../prompt-lang';
|
|
5
|
+
import type { Problem } from '../types';
|
|
6
|
+
/** A picture that goes to a model with a request, and what it is there. */
|
|
7
|
+
export interface SentPicture {
|
|
8
|
+
file: string;
|
|
9
|
+
role: 'product' | 'cast' | 'reference' | 'first frame' | 'last frame' | 'anchor';
|
|
10
|
+
name: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ShownClip {
|
|
13
|
+
key: string;
|
|
14
|
+
kind: 'video' | 'image';
|
|
15
|
+
file: string;
|
|
16
|
+
/** The request's own words, and the whole prompt as it is sent (product block, cast and sound sentences included). */
|
|
17
|
+
what: string;
|
|
18
|
+
prompt: string;
|
|
19
|
+
seconds?: number;
|
|
20
|
+
aspect?: string;
|
|
21
|
+
model?: string;
|
|
22
|
+
resolution?: string;
|
|
23
|
+
/** null: no price is known (a generator of the user's own, or the quote could not be read: priceNote says). */
|
|
24
|
+
credits: number | null;
|
|
25
|
+
priceNote?: string;
|
|
26
|
+
pictures: SentPicture[];
|
|
27
|
+
sounds: string[];
|
|
28
|
+
clips: string[];
|
|
29
|
+
products: string[];
|
|
30
|
+
cast: string[];
|
|
31
|
+
notes: string[];
|
|
32
|
+
}
|
|
33
|
+
export interface ShownVoice {
|
|
34
|
+
key: string;
|
|
35
|
+
speaker: string;
|
|
36
|
+
voice: string;
|
|
37
|
+
/** The voice on the platform, when it is one. */
|
|
38
|
+
id?: string;
|
|
39
|
+
name?: string;
|
|
40
|
+
language?: string;
|
|
41
|
+
speed: number;
|
|
42
|
+
lines: string[];
|
|
43
|
+
credits: number | null;
|
|
44
|
+
priceNote?: string;
|
|
45
|
+
/** A recording the user can hear, in the project, and where it comes from; none when there is none without paying. */
|
|
46
|
+
sample?: {
|
|
47
|
+
file: string;
|
|
48
|
+
from: string;
|
|
49
|
+
};
|
|
50
|
+
/** No free sample: the cheapest paid one, one sentence, with its price, for the user to ask for. */
|
|
51
|
+
paidSample?: {
|
|
52
|
+
text: string;
|
|
53
|
+
credits: number | null;
|
|
54
|
+
command: string;
|
|
55
|
+
};
|
|
56
|
+
note?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface Gathered {
|
|
59
|
+
problems: Problem[];
|
|
60
|
+
policy: PromptPolicy;
|
|
61
|
+
model?: string;
|
|
62
|
+
products: {
|
|
63
|
+
key: string;
|
|
64
|
+
id: string;
|
|
65
|
+
what: string;
|
|
66
|
+
pictures: {
|
|
67
|
+
file: string;
|
|
68
|
+
original?: string;
|
|
69
|
+
crop?: string;
|
|
70
|
+
face: string;
|
|
71
|
+
}[];
|
|
72
|
+
confirm?: string;
|
|
73
|
+
}[];
|
|
74
|
+
cast: {
|
|
75
|
+
key: string;
|
|
76
|
+
id: string;
|
|
77
|
+
description: string;
|
|
78
|
+
picture?: string;
|
|
79
|
+
note?: string;
|
|
80
|
+
}[];
|
|
81
|
+
anchor?: {
|
|
82
|
+
file: string;
|
|
83
|
+
note: string;
|
|
84
|
+
};
|
|
85
|
+
clips: ShownClip[];
|
|
86
|
+
kept: string[];
|
|
87
|
+
voices: ShownVoice[];
|
|
88
|
+
balance?: number;
|
|
89
|
+
notes: string[];
|
|
90
|
+
}
|
|
91
|
+
/** How the model in use takes prompts, from the platform's list; "user" when it does not say or cannot be read. */
|
|
92
|
+
export declare const promptPolicy: (rt: Runtime) => Promise<{
|
|
93
|
+
policy: PromptPolicy;
|
|
94
|
+
model?: string;
|
|
95
|
+
}>;
|
|
96
|
+
/** Everything a paid run of this list would send, and what it would cost; nothing is made or charged. */
|
|
97
|
+
export declare const gather: (rt: Runtime, dir: string, o: {
|
|
98
|
+
requests: MaterialRequest[];
|
|
99
|
+
picture?: AnchorPicture;
|
|
100
|
+
anchor?: boolean;
|
|
101
|
+
times?: BeatTimes;
|
|
102
|
+
music?: boolean;
|
|
103
|
+
lang?: string;
|
|
104
|
+
}) => Promise<Gathered>;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { Runtime } from '../../runtime';
|
|
2
|
+
import { type MaterialRequest } from '../generate/index';
|
|
3
|
+
export declare const INPUTS_FILE = "production/inputs.json";
|
|
4
|
+
export declare const VOICE_PLAN_FILE = "production/voice-plan.json";
|
|
5
|
+
/** Where the input sheet, the summary and the voice samples go. */
|
|
6
|
+
export declare const INPUTS_DIR = "production/inputs";
|
|
7
|
+
/** One voice of the video: who speaks, in which voice, how fast, and the lines it will say. */
|
|
8
|
+
export interface PlannedVoice {
|
|
9
|
+
speaker: string;
|
|
10
|
+
voice: string;
|
|
11
|
+
speed?: number;
|
|
12
|
+
language?: string;
|
|
13
|
+
lines: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface VoicePlan {
|
|
16
|
+
version: 1;
|
|
17
|
+
voices: PlannedVoice[];
|
|
18
|
+
}
|
|
19
|
+
/** A text shown to the user in their language beside the text that is sent; sent: the hash of the text it renders. */
|
|
20
|
+
export interface DisplayText {
|
|
21
|
+
sent: string;
|
|
22
|
+
lang: string;
|
|
23
|
+
text: string;
|
|
24
|
+
}
|
|
25
|
+
export interface InputsRecord {
|
|
26
|
+
version: 1;
|
|
27
|
+
/** What the last `inputs show` built: the items with their hashes, the sent texts' hashes, and where the list was read from. */
|
|
28
|
+
shown?: {
|
|
29
|
+
at: string;
|
|
30
|
+
requests?: string;
|
|
31
|
+
anchor?: string;
|
|
32
|
+
lang?: string;
|
|
33
|
+
items: Record<string, string>;
|
|
34
|
+
texts: Record<string, string>;
|
|
35
|
+
sheets: string[];
|
|
36
|
+
summary: string;
|
|
37
|
+
missing?: string[];
|
|
38
|
+
};
|
|
39
|
+
/** The user's answer (or who authorised going on unattended), with the items it was given for. */
|
|
40
|
+
confirmed?: {
|
|
41
|
+
by: 'user' | 'unattended';
|
|
42
|
+
quote: string;
|
|
43
|
+
at: string;
|
|
44
|
+
items: Record<string, string>;
|
|
45
|
+
};
|
|
46
|
+
display?: Record<string, DisplayText>;
|
|
47
|
+
}
|
|
48
|
+
export declare const readInputs: (rt: Runtime, dir: string) => Promise<InputsRecord>;
|
|
49
|
+
export declare const writeInputs: (rt: Runtime, dir: string, record: InputsRecord) => Promise<void>;
|
|
50
|
+
export declare const readVoicePlan: (rt: Runtime, dir: string) => Promise<VoicePlan | undefined>;
|
|
51
|
+
export declare const voiceKey: (speaker: string) => string;
|
|
52
|
+
export declare const voiceHash: (v: PlannedVoice) => string;
|
|
53
|
+
export interface CurrentInputs {
|
|
54
|
+
/** Every item of the project as it stands, by key, with its hash. */
|
|
55
|
+
items: Record<string, string>;
|
|
56
|
+
/** The keys of the requested files that do not exist yet: what a paid run would make. */
|
|
57
|
+
toMake: string[];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The inputs of a project as they stand: its products, cast and voices, the anchor picture when one is given, and
|
|
61
|
+
* every request of the list (when one is given) with all it depends on.
|
|
62
|
+
*/
|
|
63
|
+
export declare const currentInputs: (rt: Runtime, dir: string, o?: {
|
|
64
|
+
requests?: readonly MaterialRequest[];
|
|
65
|
+
anchor?: string;
|
|
66
|
+
}) => Promise<CurrentInputs>;
|
|
67
|
+
/** The keys among `needed` whose item was not confirmed as it stands. */
|
|
68
|
+
export declare const pendingOf: (record: InputsRecord, current: CurrentInputs, needed: readonly string[]) => string[];
|
|
69
|
+
/** The `confirm` block of exit code 3: what to show the user and how to record their answer. */
|
|
70
|
+
export declare const confirmBlock: (rt: Runtime, dir: string, record: InputsRecord, pending: readonly string[], project: string) => {
|
|
71
|
+
confirm: Record<string, unknown>;
|
|
72
|
+
next: string;
|
|
73
|
+
};
|
|
74
|
+
/** Whether a project has anything that makes the paid voice commands wait for the user: inputs that were shown, a voice plan, or a product sheet. */
|
|
75
|
+
export declare const gatesVoice: (rt: Runtime, dir: string) => Promise<boolean>;
|
|
76
|
+
/**
|
|
77
|
+
* What stands between a paid voice command and its work: undefined when the voice (and the lines, when given) are in
|
|
78
|
+
* the voice plan the user confirmed, else the pending keys and why. A project that never showed inputs, has no voice
|
|
79
|
+
* plan and no product sheet is not held (a video that is only narrated).
|
|
80
|
+
*/
|
|
81
|
+
export declare const voicePending: (rt: Runtime, dir: string, o: {
|
|
82
|
+
voice?: string;
|
|
83
|
+
speaker?: string;
|
|
84
|
+
lines?: readonly string[];
|
|
85
|
+
}) => Promise<{
|
|
86
|
+
pending: string[];
|
|
87
|
+
why: string;
|
|
88
|
+
} | undefined>;
|
|
89
|
+
/** A paid command stopped before its work: the user has not confirmed these inputs. Printed as { ok: false, confirm, next } with exit code 3. */
|
|
90
|
+
export declare class InputsPending extends Error {
|
|
91
|
+
readonly block: {
|
|
92
|
+
confirm: Record<string, unknown>;
|
|
93
|
+
next: string;
|
|
94
|
+
};
|
|
95
|
+
name: string;
|
|
96
|
+
constructor(block: {
|
|
97
|
+
confirm: Record<string, unknown>;
|
|
98
|
+
next: string;
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/** Stops a paid voice command (paying: it was run with --confirm) whose voice or lines the user has not confirmed. */
|
|
102
|
+
export declare const holdVoice: (rt: Runtime, dir: string, project: string, paying: boolean, o: {
|
|
103
|
+
voice?: string;
|
|
104
|
+
speaker?: string;
|
|
105
|
+
lines?: readonly string[];
|
|
106
|
+
}) => Promise<void>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Runtime } from '../../runtime';
|
|
2
|
+
import type { Summary, SummaryItem } from './summary';
|
|
3
|
+
/** How many clips or pictures one sheet holds; the first sheet also holds the product, the cast and the voice. */
|
|
4
|
+
export declare const ROWS_A_SHEET = 6;
|
|
5
|
+
/** The page of one sheet. data: the bytes of every picture it shows, by its path in the project. */
|
|
6
|
+
export declare const sheetHtml: (s: Summary, rows: readonly SummaryItem[], first: boolean, page: string, data: ReadonlyMap<string, Uint8Array>) => string;
|
|
7
|
+
/** Writes the sheets of a summary into `outDir` (in the project) and returns their paths in the project. Needs the local browser. */
|
|
8
|
+
export declare const writeSheets: (rt: Runtime, dir: string, outDir: string, s: Summary) => Promise<string[]>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { PromptPolicy } from '../prompt-lang';
|
|
2
|
+
import type { Gathered, ShownClip, ShownVoice } from './collect';
|
|
3
|
+
import type { DisplayText } from './record';
|
|
4
|
+
/** The script most of a text is written in: enough to tell whether it can be the user's language. */
|
|
5
|
+
export declare const scriptOf: (text: string) => "han" | "kana" | "hangul" | "cyrillic" | "arabic" | "latin";
|
|
6
|
+
/**
|
|
7
|
+
* Whether a text sent in English needs a version in the user's language beside it: never for an English user; for any
|
|
8
|
+
* other language unless the text is already written in that language's own script.
|
|
9
|
+
*/
|
|
10
|
+
export declare const needsDisplay: (text: string, lang: string | undefined, policy: PromptPolicy) => boolean;
|
|
11
|
+
/** Whether a text is plainly not in the user's language: written in another script than that language uses. */
|
|
12
|
+
export declare const otherScript: (text: string, lang: string | undefined) => boolean;
|
|
13
|
+
/** A text as the user is shown it: `display` first when there is one, `sent` always; displayMissing: a version in the user's language is owed. */
|
|
14
|
+
export interface ShownText {
|
|
15
|
+
sent: string;
|
|
16
|
+
display?: string;
|
|
17
|
+
displayMissing?: true;
|
|
18
|
+
}
|
|
19
|
+
export declare const textHash: (text: string) => string;
|
|
20
|
+
/** The version in the user's language of a sent text: the stored one while it renders this very text in this language. */
|
|
21
|
+
export declare const shownText: (sent: string, lang: string | undefined, policy: PromptPolicy, stored: DisplayText | undefined, script?: boolean) => ShownText;
|
|
22
|
+
export interface SummaryItem extends Omit<ShownClip, 'prompt'> {
|
|
23
|
+
prompt: ShownText;
|
|
24
|
+
confirmed: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface SummaryVoice extends Omit<ShownVoice, 'lines'> {
|
|
27
|
+
lines: string[];
|
|
28
|
+
script: ShownText;
|
|
29
|
+
confirmed: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface Summary {
|
|
32
|
+
version: 1;
|
|
33
|
+
lang?: string;
|
|
34
|
+
policy: PromptPolicy;
|
|
35
|
+
model?: string;
|
|
36
|
+
products: (Gathered['products'][number] & {
|
|
37
|
+
confirmed: boolean;
|
|
38
|
+
})[];
|
|
39
|
+
/** The facts of the product the user did not state, in one line, to correct or agree to. */
|
|
40
|
+
inferred?: string;
|
|
41
|
+
cast: (Gathered['cast'][number] & {
|
|
42
|
+
confirmed: boolean;
|
|
43
|
+
})[];
|
|
44
|
+
anchor?: Gathered['anchor'];
|
|
45
|
+
items: SummaryItem[];
|
|
46
|
+
kept: string[];
|
|
47
|
+
voices: SummaryVoice[];
|
|
48
|
+
totals: {
|
|
49
|
+
clips: number;
|
|
50
|
+
pictures: number;
|
|
51
|
+
seconds: number;
|
|
52
|
+
credits: number;
|
|
53
|
+
unpriced: number;
|
|
54
|
+
balance?: number;
|
|
55
|
+
};
|
|
56
|
+
sheets: string[];
|
|
57
|
+
/** The keys whose text in the user's language is still owed. */
|
|
58
|
+
displayMissing: string[];
|
|
59
|
+
notes: string[];
|
|
60
|
+
}
|
|
61
|
+
export declare const summarize: (g: Gathered, o: {
|
|
62
|
+
lang?: string;
|
|
63
|
+
display?: Readonly<Record<string, DisplayText>>;
|
|
64
|
+
confirmed?: Readonly<Record<string, string>>;
|
|
65
|
+
items: Readonly<Record<string, string>>;
|
|
66
|
+
inferred?: string;
|
|
67
|
+
sheets: string[];
|
|
68
|
+
}) => Summary;
|
|
69
|
+
/** The summary with the display texts as they are stored now (after `inputs translate`). */
|
|
70
|
+
export declare const withDisplay: (s: Summary, display: Readonly<Record<string, DisplayText>>) => Summary;
|
|
71
|
+
/** The summary as text for the agent's message. */
|
|
72
|
+
export declare const summaryText: (s: Summary) => string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type CloudDelivery } from '../../cloud/deliver';
|
|
1
2
|
import { CloudService } from '../../cloud/service';
|
|
2
3
|
import type { Runtime } from '../../runtime';
|
|
3
4
|
import type { PreviewState } from './protocol';
|
|
@@ -7,7 +8,25 @@ interface File {
|
|
|
7
8
|
bytes: number;
|
|
8
9
|
absolute: string;
|
|
9
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* How long one request of a sync may take before it is given up: a minute, plus a second for every MB it carries (the
|
|
13
|
+
* upload of a file) or refers to (the sync of the project, which the platform checks file by file), fifteen minutes at
|
|
14
|
+
* most. Without it a stalled connection would keep `popost video render` from ever returning.
|
|
15
|
+
*/
|
|
16
|
+
export interface CloudLimits {
|
|
17
|
+
baseMs: number;
|
|
18
|
+
perMbMs: number;
|
|
19
|
+
capMs: number;
|
|
20
|
+
}
|
|
21
|
+
export declare const CLOUD_LIMITS: CloudLimits;
|
|
22
|
+
export declare const cloudTimeoutMs: (bytes: number, limits?: CloudLimits) => number;
|
|
10
23
|
/** Only dependencies named by video.json and its scene documents are uploaded. Cache, logs and credentials stay local. */
|
|
11
24
|
export declare const projectFiles: (rt: Runtime, dir: string, source: unknown) => Promise<File[]>;
|
|
12
|
-
export declare const createVideoCloud: (rt: Runtime, dir: string, state: () => Promise<PreviewState>, enabled?: boolean) => CloudService;
|
|
25
|
+
export declare const createVideoCloud: (rt: Runtime, dir: string, state: () => Promise<PreviewState>, enabled?: boolean, limits?: CloudLimits) => CloudService;
|
|
26
|
+
/**
|
|
27
|
+
* Sync a video project once from a command, with no Studio open (`popost video render`): the Studio's own adapter, so the
|
|
28
|
+
* same files, the same uploads by content hash and the same `.studio/cloud.json`. `undefined` when no account is connected
|
|
29
|
+
* or the host shows projects in its own editor; never throws.
|
|
30
|
+
*/
|
|
31
|
+
export declare const syncVideoProject: (rt: Runtime, projectDir: string, lang: "zh" | "en", limits?: CloudLimits) => Promise<CloudDelivery | undefined>;
|
|
13
32
|
export {};
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* POST /api/edit one operation (ops.ts) -> { ok, op, label, history, state } or { ok: false, problems, history }
|
|
5
5
|
* POST /api/undo the step before -> the same answer
|
|
6
6
|
* POST /api/redo the step undone last -> the same answer
|
|
7
|
+
* POST /api/open-pricing opens the pricing page in the system browser (cloud/entitlement.ts) -> { ok, opened, url }
|
|
7
8
|
* POST /api/render starts a render into out.mp4; progress and result come as "render" events
|
|
8
9
|
* GET /api/schema the JSON schema of the parts of video.json the page edits (allowed values and ranges)
|
|
9
10
|
*/
|
|
@@ -19,6 +20,11 @@ export interface EditContext {
|
|
|
19
20
|
editor: Editor;
|
|
20
21
|
exportAccess?: () => Promise<ExportAccess>;
|
|
21
22
|
studio?: (path: string, body: Record<string, unknown>) => Promise<unknown>;
|
|
23
|
+
/** Opens the pricing page of the configured site in the system browser; the request chooses the language only. */
|
|
24
|
+
openPricing?: (lang: unknown) => Promise<{
|
|
25
|
+
opened: boolean;
|
|
26
|
+
url: string;
|
|
27
|
+
}>;
|
|
22
28
|
render: RenderJob;
|
|
23
29
|
/** Origins a request from the page itself carries: "http://127.0.0.1:<port>" and the other loopback names. */
|
|
24
30
|
origins: ReadonlySet<string>;
|
|
@@ -113,8 +119,8 @@ declare const SCHEMAS: {
|
|
|
113
119
|
enter: z.ZodOptional<z.ZodObject<{
|
|
114
120
|
preset: z.ZodEnum<{
|
|
115
121
|
pop: "pop";
|
|
116
|
-
type: "type";
|
|
117
122
|
none: "none";
|
|
123
|
+
type: "type";
|
|
118
124
|
fade: "fade";
|
|
119
125
|
wipe: "wipe";
|
|
120
126
|
slide: "slide";
|
|
@@ -140,8 +146,8 @@ declare const SCHEMAS: {
|
|
|
140
146
|
exit: z.ZodOptional<z.ZodObject<{
|
|
141
147
|
preset: z.ZodEnum<{
|
|
142
148
|
pop: "pop";
|
|
143
|
-
type: "type";
|
|
144
149
|
none: "none";
|
|
150
|
+
type: "type";
|
|
145
151
|
fade: "fade";
|
|
146
152
|
wipe: "wipe";
|
|
147
153
|
slide: "slide";
|
|
@@ -217,8 +223,8 @@ declare const SCHEMAS: {
|
|
|
217
223
|
enter: z.ZodOptional<z.ZodObject<{
|
|
218
224
|
preset: z.ZodEnum<{
|
|
219
225
|
pop: "pop";
|
|
220
|
-
type: "type";
|
|
221
226
|
none: "none";
|
|
227
|
+
type: "type";
|
|
222
228
|
fade: "fade";
|
|
223
229
|
wipe: "wipe";
|
|
224
230
|
slide: "slide";
|
|
@@ -244,8 +250,8 @@ declare const SCHEMAS: {
|
|
|
244
250
|
exit: z.ZodOptional<z.ZodObject<{
|
|
245
251
|
preset: z.ZodEnum<{
|
|
246
252
|
pop: "pop";
|
|
247
|
-
type: "type";
|
|
248
253
|
none: "none";
|
|
254
|
+
type: "type";
|
|
249
255
|
fade: "fade";
|
|
250
256
|
wipe: "wipe";
|
|
251
257
|
slide: "slide";
|
|
@@ -328,8 +334,8 @@ declare const SCHEMAS: {
|
|
|
328
334
|
enter: z.ZodOptional<z.ZodObject<{
|
|
329
335
|
preset: z.ZodEnum<{
|
|
330
336
|
pop: "pop";
|
|
331
|
-
type: "type";
|
|
332
337
|
none: "none";
|
|
338
|
+
type: "type";
|
|
333
339
|
fade: "fade";
|
|
334
340
|
wipe: "wipe";
|
|
335
341
|
slide: "slide";
|
|
@@ -355,8 +361,8 @@ declare const SCHEMAS: {
|
|
|
355
361
|
exit: z.ZodOptional<z.ZodObject<{
|
|
356
362
|
preset: z.ZodEnum<{
|
|
357
363
|
pop: "pop";
|
|
358
|
-
type: "type";
|
|
359
364
|
none: "none";
|
|
365
|
+
type: "type";
|
|
360
366
|
fade: "fade";
|
|
361
367
|
wipe: "wipe";
|
|
362
368
|
slide: "slide";
|
|
@@ -441,8 +447,8 @@ declare const SCHEMAS: {
|
|
|
441
447
|
enter: z.ZodOptional<z.ZodObject<{
|
|
442
448
|
preset: z.ZodEnum<{
|
|
443
449
|
pop: "pop";
|
|
444
|
-
type: "type";
|
|
445
450
|
none: "none";
|
|
451
|
+
type: "type";
|
|
446
452
|
fade: "fade";
|
|
447
453
|
wipe: "wipe";
|
|
448
454
|
slide: "slide";
|
|
@@ -468,8 +474,8 @@ declare const SCHEMAS: {
|
|
|
468
474
|
exit: z.ZodOptional<z.ZodObject<{
|
|
469
475
|
preset: z.ZodEnum<{
|
|
470
476
|
pop: "pop";
|
|
471
|
-
type: "type";
|
|
472
477
|
none: "none";
|
|
478
|
+
type: "type";
|
|
473
479
|
fade: "fade";
|
|
474
480
|
wipe: "wipe";
|
|
475
481
|
slide: "slide";
|
|
@@ -617,8 +623,8 @@ declare const SCHEMAS: {
|
|
|
617
623
|
enter: z.ZodOptional<z.ZodObject<{
|
|
618
624
|
preset: z.ZodEnum<{
|
|
619
625
|
pop: "pop";
|
|
620
|
-
type: "type";
|
|
621
626
|
none: "none";
|
|
627
|
+
type: "type";
|
|
622
628
|
fade: "fade";
|
|
623
629
|
wipe: "wipe";
|
|
624
630
|
slide: "slide";
|
|
@@ -644,8 +650,8 @@ declare const SCHEMAS: {
|
|
|
644
650
|
exit: z.ZodOptional<z.ZodObject<{
|
|
645
651
|
preset: z.ZodEnum<{
|
|
646
652
|
pop: "pop";
|
|
647
|
-
type: "type";
|
|
648
653
|
none: "none";
|
|
654
|
+
type: "type";
|
|
649
655
|
fade: "fade";
|
|
650
656
|
wipe: "wipe";
|
|
651
657
|
slide: "slide";
|
|
@@ -1009,8 +1015,8 @@ declare const SCHEMAS: {
|
|
|
1009
1015
|
readonly motion: z.ZodObject<{
|
|
1010
1016
|
preset: z.ZodEnum<{
|
|
1011
1017
|
pop: "pop";
|
|
1012
|
-
type: "type";
|
|
1013
1018
|
none: "none";
|
|
1019
|
+
type: "type";
|
|
1014
1020
|
fade: "fade";
|
|
1015
1021
|
wipe: "wipe";
|
|
1016
1022
|
slide: "slide";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/** What the render route needs of the account's entitlement (`cloud/entitlement.ts`). */
|
|
2
2
|
export interface ExportAccess {
|
|
3
3
|
premium: boolean;
|
|
4
4
|
verified: boolean;
|
|
@@ -14,7 +14,6 @@ export interface VideoExportSettings {
|
|
|
14
14
|
from?: number;
|
|
15
15
|
to?: number;
|
|
16
16
|
}
|
|
17
|
-
export declare const exportAccess: (rt: Runtime) => Promise<ExportAccess>;
|
|
18
17
|
export declare const readExportSettings: (raw: unknown, canvas: {
|
|
19
18
|
width: number;
|
|
20
19
|
height: number;
|