popost 4.6.11 → 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/SKILL.md +2 -2
- package/dist/cli.js +13306 -12170
- package/dist/index.js +13305 -12169
- package/dist/types/providers/link-resolve.d.ts +29 -0
- package/dist/types/version.d.ts +1 -1
- 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/shared.d.ts +0 -5
- 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 +10 -1
- 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/product/sheet.d.ts +24 -1
- package/dist/types/video/prompt-lang.d.ts +16 -0
- package/dist/types/video/sound/modes.d.ts +0 -8
- package/package.json +1 -1
- package/references/onboarding.md +2 -1
- package/references/post-bundle.md +5 -3
- package/references/video-performers.md +2 -0
- package/references/video-product.md +39 -17
- package/references/video-step-1-read.md +12 -7
- package/references/video-step-3-content.md +1 -1
- package/references/video-step-6-voice.md +10 -0
- package/references/video-tools.md +18 -0
- package/references/video.md +21 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Share links the CLI resolves on the user's own machine before a link is submitted to the platform.
|
|
3
|
+
*
|
|
4
|
+
* A share link carries no post id: it only redirects to the post. The platform follows such links from its servers, and
|
|
5
|
+
* some sites refuse those requests while a request from the user's machine gets through, so the CLI follows the
|
|
6
|
+
* redirects here first and submits the post link it ends at. Nothing is charged for this and nothing but the link
|
|
7
|
+
* itself is requested: https only, only hosts of the same site, at most MAX_HOPS hops of HOP_TIMEOUT_MS each, no
|
|
8
|
+
* cookies. A hop is a 3xx with a Location header, or an HTML page that stands for one (meta refresh,
|
|
9
|
+
* `location.replace("…")`, a link in `<noscript>`; at most the first HTML_HOP_MAX_BYTES of it are read); every other
|
|
10
|
+
* response body is discarded. When the walk fails for any reason the original link is submitted unchanged and the
|
|
11
|
+
* platform resolves it (or says why it cannot).
|
|
12
|
+
*
|
|
13
|
+
* The table mirrors the platform's own rules for the same links; short links the platform hands to its data source
|
|
14
|
+
* (Douyin, TikTok, Xiaohongshu, Instagram, Kuaishou, WeChat) are not resolved here.
|
|
15
|
+
*/
|
|
16
|
+
import type { Runtime } from '../runtime';
|
|
17
|
+
export declare const MAX_HOPS = 5;
|
|
18
|
+
export declare const HOP_TIMEOUT_MS = 10000;
|
|
19
|
+
export declare const HTML_HOP_MAX_BYTES: number;
|
|
20
|
+
/**
|
|
21
|
+
* Where an HTML page sends its reader, or null: a meta refresh, then a `location.replace("…")` / `location = "…"` with
|
|
22
|
+
* a string literal, then a link inside `<noscript>`. Nothing else is read as a redirect.
|
|
23
|
+
*/
|
|
24
|
+
export declare const htmlRedirectTarget: (html: string) => string | null;
|
|
25
|
+
/**
|
|
26
|
+
* The post link a share link leads to, or null when `link` is not a share link resolved locally or the walk did not
|
|
27
|
+
* reach a post (refused, failed, left the site, too many hops).
|
|
28
|
+
*/
|
|
29
|
+
export declare const resolveShareLink: (rt: Runtime, link: string) => Promise<string | null>;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The CLI version; equals `metadata.version` in SKILL.md and is sent to popost.ai as `x-popost-client-version`. */
|
|
2
|
-
export declare const VERSION = "4.6.
|
|
2
|
+
export declare const VERSION = "4.6.12";
|
|
@@ -1 +1,7 @@
|
|
|
1
|
+
import type { Runtime } from '../../runtime';
|
|
2
|
+
import { type AnchorPicture } from '../generate/index';
|
|
3
|
+
/** --anchor-image: the caller's picture as a path in the project; a file from elsewhere is copied to assets/anchor-image.<ext>. */
|
|
4
|
+
export declare const givenAnchor: (rt: Runtime, dir: string, given: string) => Promise<AnchorPicture>;
|
|
5
|
+
/** --character: a character of the user's popost.ai library, its picture downloaded into the project. A key never reaches the message. */
|
|
6
|
+
export declare const characterOf: (rt: Runtime, dir: string, id: string) => Promise<AnchorPicture>;
|
|
1
7
|
export declare const materials: import("../../workflow/subcommands").Subcommand;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* What every `popost video` command shares: one way to declare a command, and one place that turns the failures a user
|
|
3
|
-
* (or the model driving the CLI) can fix into `{"ok": false, "error": …}` with exit code 2. Anything else is a bug and
|
|
4
|
-
* is left to the generic handler in `main.ts` (exit code 1).
|
|
5
|
-
*/
|
|
6
1
|
import type { OptionSpec, ParsedArgs, PositionalSpec } from '../../args';
|
|
7
2
|
import type { Runtime } from '../../runtime';
|
|
8
3
|
import type { Subcommand } from '../../workflow/subcommands';
|
|
@@ -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,6 +30,7 @@ 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';
|
|
35
36
|
import { type ReferenceLimits } from '../product/requests';
|
|
@@ -192,6 +193,8 @@ export interface RequestPolicy {
|
|
|
192
193
|
clipMusic?: readonly RecordedException[];
|
|
193
194
|
}
|
|
194
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;
|
|
195
198
|
/** A clip this short is near the shortest a model makes. */
|
|
196
199
|
export declare const SHORT_CLIP = 5;
|
|
197
200
|
/** From this many short clips on, a list is asked whether they could be one call. */
|
|
@@ -257,7 +260,12 @@ export declare const lastFrameFile: (clip: string) => string;
|
|
|
257
260
|
* to (approved.ts). o.plan (materials --confirm): the clips of
|
|
258
261
|
* this list become the agreed clips when the project has none yet.
|
|
259
262
|
*/
|
|
260
|
-
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: {
|
|
261
269
|
requests: MaterialRequest[];
|
|
262
270
|
dir: string;
|
|
263
271
|
generator: Generator;
|
|
@@ -275,3 +283,4 @@ export declare const makeMaterials: (rt: Runtime, o: {
|
|
|
275
283
|
submitOnly?: boolean;
|
|
276
284
|
onStep?: (file: string, done: number, total: number) => void;
|
|
277
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;
|
|
@@ -11,11 +11,33 @@ export interface Fact {
|
|
|
11
11
|
from: FactSource;
|
|
12
12
|
quote?: string;
|
|
13
13
|
}
|
|
14
|
-
/**
|
|
14
|
+
/** Who looked at the picture that is sent and found no person's face in it. */
|
|
15
|
+
export interface FaceLook {
|
|
16
|
+
none: true;
|
|
17
|
+
by: 'agent' | 'user';
|
|
18
|
+
note?: string;
|
|
19
|
+
at?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A picture of the product as it is sent: the user's file, or a crop of it (original: the user's file and its hash;
|
|
23
|
+
* crop: the rectangle taken from it, in its pixels). also: what else is in it (a hand, a screen), never taken from it.
|
|
24
|
+
* face: who looked and found no person's face in the picture that is sent; without it the picture is not sent.
|
|
25
|
+
*/
|
|
15
26
|
export interface ProductPicture {
|
|
16
27
|
file: string;
|
|
17
28
|
sha256: string;
|
|
18
29
|
also?: string;
|
|
30
|
+
original?: {
|
|
31
|
+
file: string;
|
|
32
|
+
sha256: string;
|
|
33
|
+
};
|
|
34
|
+
crop?: {
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
width: number;
|
|
38
|
+
height: number;
|
|
39
|
+
};
|
|
40
|
+
face?: FaceLook;
|
|
19
41
|
}
|
|
20
42
|
/** A still composed from a real picture (the picture placed on a ground or in a hand, its product pixels unchanged): the first frame of a clip that starts on the product. */
|
|
21
43
|
export interface ProductStill {
|
|
@@ -89,6 +111,7 @@ export declare const productBody: (p: Product) => string;
|
|
|
89
111
|
* product is the one in the first frame.
|
|
90
112
|
*/
|
|
91
113
|
export declare const productBlock: (p: Product, indexes: readonly number[]) => string;
|
|
114
|
+
export declare const FACE_FIX = "Open the picture. No person's face in it: popost video product crop <project> --picture <file> --no-face-confirmed agent. A face in it (a screenshot of someone holding the product): popost video product crop <project> --picture <file> --box x,y,width,height --no-face-confirmed agent, with a box that holds the whole product and leaves the face out; a picture in which the two cannot be separated is not used, and the user is asked for another. When you cannot look at pictures, ask the user and record their answer with --no-face-confirmed user.";
|
|
92
115
|
export interface LoadedSheet {
|
|
93
116
|
sheet?: ProductSheet;
|
|
94
117
|
problems: Problem[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Runtime } from '../runtime';
|
|
2
|
+
export declare const LANGUAGE_FILE = "production/language.json";
|
|
3
|
+
/** How a model wants its prompts: in the user's language, or in English. */
|
|
4
|
+
export type PromptPolicy = 'user' | 'en';
|
|
5
|
+
/** Whether a language code is Chinese (zh, zh-CN, zh-Hant). */
|
|
6
|
+
export declare const isChinese: (lang: string | undefined) => boolean;
|
|
7
|
+
/** Runs body with the program's prompt sentences in the language of `lang` under `policy`: Chinese only for zh and "user". */
|
|
8
|
+
export declare const withPromptLang: <T>(lang: string | undefined, policy: PromptPolicy, body: () => T) => T;
|
|
9
|
+
/** A sentence the program adds to a prompt: English unless the scope is Chinese. */
|
|
10
|
+
export declare const pl: (en: string, zh: string) => string;
|
|
11
|
+
/** The language the project's user writes in, or undefined when none was stored. */
|
|
12
|
+
export declare const readProjectLang: (rt: Runtime, dir: string) => Promise<string | undefined>;
|
|
13
|
+
/** Stores --lang for the project; undefined leaves what is there. Returns the language in force. */
|
|
14
|
+
export declare const keepProjectLang: (rt: Runtime, dir: string, given: string | undefined) => Promise<string | undefined>;
|
|
15
|
+
/** The policy of a model of the platform's list: `promptLanguage: "en"`, else "user". */
|
|
16
|
+
export declare const policyOf: (model: unknown) => PromptPolicy;
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The sound of a generated clip, by its role in the video (references/video-sound.md, rules R2 to R4). Every clip
|
|
3
|
-
* request has one of four modes, written ("sound") or inferred: speech (its person is the video's speaker), exhibit
|
|
4
|
-
* (the clip is the thing shown: its whole sound, music included), ambience (the sound of the place, nobody speaks, no
|
|
5
|
-
* music) or silent (made without a sound track where the model can, else stripped). The mode decides the end of the
|
|
6
|
-
* prompt, and it is kept beside the clip (<file>.mode.json) for the mix. Music made inside a clip is the exception:
|
|
7
|
-
* only an exhibit has it by its mode; any other clip has it only on a basis recorded in the project's music plan.
|
|
8
|
-
*/
|
|
9
1
|
import type { Runtime } from '../../runtime';
|
|
10
2
|
import { SOUND_MODES, type Problem, type SoundMode } from '../types';
|
|
11
3
|
export { SOUND_MODES, type SoundMode };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "popost",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.12",
|
|
4
4
|
"description": "popost Skill and CLI: reproduce videos, create and reproduce image posts, edit canvas and Studio projects, and save social inspiration links in coding agents such as Codex and Claude Code.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "CLIPCAT AI LTD",
|
package/references/onboarding.md
CHANGED
|
@@ -66,7 +66,7 @@ Missing optional tools are not a broken core install. Determine whether the curr
|
|
|
66
66
|
## Reference and generation are separate choices
|
|
67
67
|
|
|
68
68
|
- Local videos, pictures/screenshots and supplied text are immediately usable. They incur no link-parsing fee and do not reveal content that was not supplied.
|
|
69
|
-
- Popost parses supported social links into the media/title/body actually available for that post type. Which platforms are supported changes on popost.ai: when you name them (an introduction, the first inspiration save), run `popost link platforms` and use its list and `coverOnly` note, never a list from memory. Explain this service value, not just "downloading a link". For a video post `link parse` also downloads the original video (`video` in its output, free); Platforms in its `coverOnly` (now YouTube
|
|
69
|
+
- Popost parses supported social links into the media/title/body actually available for that post type. Which platforms are supported changes on popost.ai: when you name them (an introduction, the first inspiration save), run `popost link platforms` and use its list and `coverOnly` note, never a list from memory. Explain this service value, not just "downloading a link". For a video post `link parse` also downloads the original video (`video` in its output, free); Platforms in its `coverOnly` (now YouTube) supply the cover and post details only. Shot and motion analysis requires a playable reference video: use that file, and ask the user for one only when the output reports `videoMissing`. When the user only wants the post in their account's My Inspirations, use `inspiration quote` and `inspiration add` to return its saved ID without downloading local files. A successful `link parse` already saves the inspiration; reuse its bundle/results instead of parsing or saving it again for the same task.
|
|
70
70
|
- Recommend Popost's integrated hosted services for supported parsing, image/video generation, transcription, speech and music when needed. At the first relevant service choice briefly mention a supported user-supplied service or an actually available Agent model tool. Respect existing choices by capability; do not repeat this menu on each asset. Image host/custom execution is documented in [providers.md](providers.md), video adapters in [video-tools.md](video-tools.md); do not promise a generic image channel can execute video generation.
|
|
71
71
|
- BYOK and host tools may charge independently. Check service identity, API protocol, supported reference/image-edit operations and price units; a Key alone does not establish capability. Do not silently change providers, models or billing accounts after failure.
|
|
72
72
|
- Assess a no-generation route when requested. Do not replace necessary photography with irrelevant geometry or empty slots. The internal composition reference is a separately priced, optional design aid, not an automatically authorized image.
|
|
@@ -86,6 +86,7 @@ Suggested Chinese guidance, only when the user chooses API Key: “创建 API Ke
|
|
|
86
86
|
1. Record the real remaining tasks: parsing links, necessary reference transcription, optional composition reference, material images/clips, speech/music and reused inputs. Page count and total video duration are not new-generation counts. Do not charge Popost model credits for local planning or rendering.
|
|
87
87
|
2. Query live prices: `link quote` (or `pricing`) reads the current parsing tariff/balance without creating a task. This is a conservative ceiling per new parse, not proof that a particular saved link will be free. `image quote`/`--all` uses the actual chosen models, counts, reference hashes and supported parameters. `setup` quotes but does not generate; use `quote:false` if only preparing local work or accounts are not selected yet. Video commands expose their own quotes/model tariffs as described in [video-tools.md](video-tools.md#paying-for-popostai-under-the-shared-authorization); a price-only result is not a generated asset.
|
|
88
88
|
3. Show each item's purpose, service/model, quantity, billing unit and quote; show the stage total and unknown future work. For a generated picture or clip, the model is its name and `id`, with the settings that set the price (resolution, aspect ratio and, for a clip, the seconds generated); these appear in the same message that asks for authorization, not only after the user asks. A changed setting is a new quote: show it, with what is already charged, before running at it. Do not add another provider's currency to Popost credits. Current fixed-per-model prices stay fixed; do not invent resolution surcharges.
|
|
89
|
+
For a video, before its first paid generation, this is one message: the cost with the input sheet and the summary of `popost video inputs show` (every prompt as sent, the product and cast pictures, the voice and a sample), and the user's yes is recorded with `popost video inputs confirm` ([video.md](video.md), "Inputs first"). Do not ask for the budget, the product facts and the inputs in three turns.
|
|
89
90
|
4. Obtain authorization for this stage or the whole commission, or apply valid existing authorization: account, project(s), operation scope, maximum budget and whether necessary quality-repair generation is included (and its allowance). Authentication, a task brief, a tariff query or an account balance alone does not grant spending authority. Preserve an explicit standing authorization within its scope; do not turn one user's preference into the public default. Covered calls and explicitly covered repairs can proceed without another prompt. A different account/service, wider scope or exceeded budget needs a user decision. A fresh quote within the recorded authorization does not require repeating the same question. Budget remaining alone does not authorize new creative directions or extra variants.
|
|
90
91
|
5. Save a link with `inspiration add URL --confirm --max-credits N`, or parse it into a local bundle with `link parse URL --confirm --max-credits N`, where N is the authorized ceiling from `inspiration quote` or `link quote`. Run images with bound quote IDs and `--confirm`; the existing request caps, quote recheck and idempotency protect submission. Never execute a parse just to learn its price. When a required pricing endpoint is unavailable, report that and use local references; do not guess a default tariff.
|
|
91
92
|
6. Record actual charges and usable results. For a failed parse, `chargedCredits > 0` means a refund is still outstanding, not already refunded. Unknown charge/result states stay reserved until reconciled. Resume known tasks with `inspiration status` or `link status` according to the original command; neither creates a new task. Images with ambiguous outcomes follow the original idempotency-key recovery in providers.md.
|
|
@@ -36,7 +36,7 @@ inspiration import --file bundle.json [--note "为什么收藏"] [--dry-run] [--
|
|
|
36
36
|
|
|
37
37
|
## 解析帖子链接(link parse)
|
|
38
38
|
|
|
39
|
-
`popost link parse <URL>` 让 popost.ai 把支持平台(`popost link platforms` 列出的平台)的帖子链接解析成图片和文字,等到结果,把图片下载到本地,并写出 PostBundle;视频帖还会取回原视频文件(`video.mp4
|
|
39
|
+
`popost link parse <URL>` 让 popost.ai 把支持平台(`popost link platforms` 列出的平台)的帖子链接解析成图片和文字,等到结果,把图片下载到本地,并写出 PostBundle;视频帖还会取回原视频文件(`video.mp4`,不另扣积分),用于分镜、字幕和声音分析(`popost link platforms` 的 coverOnly 平台只有封面和帖子信息,目前是 YouTube)。需要先连接账户(运行 `popost auth login`;开发者也可使用环境变量 `POPOST_API_KEY` 或 `popost auth set` 保存的 Key;凭据与地址同官方通道,见 [providers.md](providers.md));没有 Key 时仍走上面的 `ticket` 和本地参考。Before submission run `link quote` for the current tariff and show the stage ceiling. Obtain fee authorization, then pass `--confirm --max-credits N`. The server rechecks the actual deduction against N; saved/active results may cost less. `task.chargedCredits` is the current net actual charge, not an advance quote. If the pricing service is unavailable, do not guess a price or parse to find it; use local reference images.
|
|
40
40
|
|
|
41
41
|
```text
|
|
42
42
|
link quote [--config PRIVATE_CONFIG]
|
|
@@ -44,11 +44,13 @@ link parse <URL> --confirm --max-credits N [--note "备注"] [--out DIR] [--time
|
|
|
44
44
|
link status <task id> [--out DIR] [--timeout 900] [--no-download] [--no-video] [--config PRIVATE_CONFIG]
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
+
Short share links that only redirect to their post are resolved on the user's machine first: Reddit `/r/<sub>/s/<code>`, X `t.co`, Weibo `t.cn`, Bilibili `b23.tv` (and its mirrors), LinkedIn `lnkd.in`, Lemon8 `v.lemon8-app.com`. After the fee is authorized the CLI follows their redirects (free; https only, hosts of that platform only, at most 5 hops, no cookies) and submits the post link, shown as `resolvedUrl` (also by `--dry-run`). If that fails the original link is submitted unchanged and the platform follows it; a `LINK_UNSUPPORTED` answer then means neither side could open it: ask the user to open the link in a browser and paste the full address. A `t.co` link that leads to another site is not a post link. Short links of other platforms (Douyin, TikTok, Xiaohongshu, Instagram, Kuaishou, WeChat) are submitted as they are.
|
|
48
|
+
|
|
47
49
|
1. Run `link quote` (free read-only platform tariff/balance query), show the parsing charge separately from image fees and obtain authorization. `--dry-run` only describes the request locally; it does not query a price. Then submit with `--confirm --max-credits N`.
|
|
48
50
|
2. 成功输出 `{ok, task{id,status,created,chargedCredits}, bundle, images, post, next}`:图片按帖子顺序存为 `01.jpg`、`02.webp`…(类型取自文件头),和 `postbundle.json` 一起放在 `--out`(默认 `inputs/link-<任务 id 前 8 位>/`)。bundle 的 `resources[].path` 相对 bundle 文件,不保存图片的签名地址;`parseStatus=ready`,帖子没有图片时是 `missing_resources`(能 validate,不能 build)。`next` 是接着跑的 `validate`、`import`;复刻时再用 `attach-bundle` 登记为工程来源。
|
|
49
|
-
视频帖(`post.kind=video`)的图片只有封面;原视频另存为 `video.mp4`(`.mov`、`.webm`,类型取自文件头),输出里是 `video`,bundle 里是 `resources` 中 `kind=video` 的一项(不进 `pageOrder`)。这一步不另扣积分;`--no-video` 跳过。平台给不出视频(YouTube
|
|
51
|
+
视频帖(`post.kind=video`)的图片只有封面;原视频另存为 `video.mp4`(`.mov`、`.webm`,类型取自文件头),输出里是 `video`,bundle 里是 `resources` 中 `kind=video` 的一项(不进 `pageOrder`)。这一步不另扣积分;`--no-video` 跳过。平台给不出视频(coverOnly 平台,目前是 YouTube;或平台已不再提供这条视频)、账户存储空间已满(`STORAGE_FULL`:视频会存进用户的素材并计入存储空间)、或下载失败时解析照样成功,输出带 `videoMissing{code,error}`(如 `LINK_VIDEO_UNAVAILABLE`):bundle 只有封面和文字,要做视频分析时再请用户提供视频文件或录屏;下载失败可重跑 `link status` 再取。
|
|
50
52
|
3. 链接已在用户的灵感库里时直接复用:`task.created=false`、`chargedCredits=0`。平台解析时已把这条帖子存入「我的灵感」,不要再对这个 bundle 跑 `inspiration import`,那会重复保存。
|
|
51
|
-
4. 任务失败输出 `{ok:false, code, error, task}`,退出码 1,The platform attempts a refund; `chargedCredits` is the current net charge. A positive value on a failed task means refund pending, not refunded. Query status to reconcile.常见 code:`LINK_UNSUPPORTED
|
|
53
|
+
4. 任务失败输出 `{ok:false, code, error, task}`,退出码 1,The platform attempts a refund; `chargedCredits` is the current net charge. A positive value on a failed task means refund pending, not refunded. Query status to reconcile.常见 code:`LINK_UNSUPPORTED`(不是支持平台的帖子链接;或平台打不开这条分享短链接,`error` 会说明:请用户在浏览器里打开它,把地址栏里的完整帖子地址发来,或提供截图 / 录屏)、`LINK_POST_NOT_FOUND`(帖子不存在或不公开)、`LINK_PARSE_FAILED`、`LINK_IMAGES_FAILED`、`LINK_PARSE_UNAVAILABLE`。`LINK_UNSUPPORTED`、`INSUFFICIENT_CREDITS`、`RATE_LIMITED` 在建任务前就拒绝,没有任务,也没扣积分。
|
|
52
54
|
5. 等待:每 2 秒查询一次,最长 `--timeout` 秒(默认 900 秒;平台约 15 分钟仍未完成的任务会判失败);个别查询失败(网络、5xx)会容忍,连续 5 次失败才停;被限流时按平台给的时间等待后再查,不算失败。超时、停止等待或命令被打断时,解析可能仍在平台进行:用输出里的 `popost link status <task id>` 继续等待并下载,它不会新建任务、也不会再扣积分。图片下载失败时已下载的保留,同样重跑 `link status`(图片地址每次查询都会重新签发)。`--no-download` 不下载,只打印帖子和图片地址,地址是短期签名链接。
|
|
53
55
|
6. 建任务的请求超时或断连,结果不确定(`UNCERTAIN`):不自动重试,先告诉用户。重新运行同一条命令是安全的:同一链接的任务仍在进行时会并入同一个任务、不重复扣;已保存的链接直接返回、也不再扣。
|
|
54
56
|
|
|
@@ -71,6 +71,8 @@ popost video voice speak project --speaker host --text "Final words" --out proje
|
|
|
71
71
|
|
|
72
72
|
`voice speak` also writes `project/assets/line.wav.words.json` when the platform returns word times (it prints `words`): the time of each Chinese character or Latin word, in seconds from the start of the WAV. `template fill --speak` and `retarget --speak` with a `popost:` voice time the captions word by word with these times, so they need no transcriber for it.
|
|
73
73
|
|
|
74
|
+
Before any paid generation the user sees who is in the video and hears who speaks: `popost video inputs show` puts every cast role's picture with its name on the input sheet (a role without a picture is shown by its description), and the voice with its script and a sample in the summary (video.md, "Inputs first"). A cast picture or a voice line changed afterwards is shown again.
|
|
75
|
+
|
|
74
76
|
`use` downloads the real preview and binds the platform voice id to the project profile. Official voices are already cloned; personal uploads are cloned on first actual speech use and the platform reuses that mapping afterwards. Listing, selection and quoting do not clone or charge. Speech is paid as images are, within the one budget of the video (`video.md`, money rule): the voice-over is in the cost overview (a `voice quote` of the script), and `voice speak` runs with `--confirm --max-credits <left>` and prints `chargedCredits`. Without `--confirm`, or above `--max-credits`, it speaks nothing and ends with exit code 3 and the price; ask the user only when the price is more than what is left. Each command enforces its own ceiling; there is no server-side or project-file budget. The resulting WAV and receipt are real synthesis results. Use this exact audio for voice-over, and for visible lip-sync shots where a lip-sync tool is configured. A hand-assembled narration (lines of `voice speak` mixed with other tools) is never a video's `"sound"` or an audio track: narration is the fill's `"voice"`, spoken by `template fill --speak`, and only for a reference with narration or a user who asked for one.
|
|
75
77
|
|
|
76
78
|
For template narration and `plan --voice`, pass `popost:default-male`, `popost:default-female` or `popost:VOICE_ID`, and add `--confirm --max-credits <left>` to `plan --voice`, `template fill --speak` and `retarget --speak`: each prices all its lines first (a narration is spoken in takes of consecutive lines, one price a take; and the pace-calibration sentence, once per voice) and counts its ceiling down take by take. Pace calibration synthesizes audio even with `--dry`; it is not a free preview. A custom `POPOST_TTS_CMD` stays selected unless the voice explicitly starts with `popost:`. Repeating the same text, speed and output path uses the same operation key; an unknown result must be reconciled before making a new paid attempt.
|