popost 4.6.12 → 4.6.14

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.
Files changed (48) hide show
  1. package/README.md +2 -0
  2. package/SKILL.md +11 -3
  3. package/dist/cli.js +1890 -998
  4. package/dist/index.js +1886 -995
  5. package/dist/types/commands/feedback.d.ts +2 -0
  6. package/dist/types/feedback/bundle.d.ts +33 -0
  7. package/dist/types/feedback/clean.d.ts +44 -0
  8. package/dist/types/feedback/project-files.d.ts +19 -0
  9. package/dist/types/feedback/transcript.d.ts +38 -0
  10. package/dist/types/feedback/upload.d.ts +13 -0
  11. package/dist/types/render/browser.d.ts +3 -1
  12. package/dist/types/runtime.d.ts +3 -0
  13. package/dist/types/version.d.ts +1 -1
  14. package/dist/types/video/commands/product.d.ts +2 -6
  15. package/dist/types/video/describe/parts.d.ts +13 -14
  16. package/dist/types/video/eval/readback-kept.d.ts +4 -3
  17. package/dist/types/video/generate/cloud.d.ts +1 -0
  18. package/dist/types/video/generate/dialogue.d.ts +2 -0
  19. package/dist/types/video/generate/index.d.ts +8 -0
  20. package/dist/types/video/generate/provenance.d.ts +13 -0
  21. package/dist/types/video/generate/speech.d.ts +1 -1
  22. package/dist/types/video/look/sheets.d.ts +17 -0
  23. package/dist/types/video/render/chunked.d.ts +11 -2
  24. package/dist/types/video/render/chunks.d.ts +5 -2
  25. package/dist/types/video/render/index.d.ts +25 -5
  26. package/dist/types/video/replication/books.d.ts +1 -1
  27. package/dist/types/video/replication/contract.d.ts +56 -0
  28. package/dist/types/video/replication/review.d.ts +17 -0
  29. package/dist/types/video/replication/voice-spans.d.ts +1 -1
  30. package/dist/types/video/sound/modes.d.ts +5 -7
  31. package/dist/types/video/sound/speech-check.d.ts +1 -1
  32. package/package.json +1 -1
  33. package/references/execution-contract.md +31 -0
  34. package/references/onboarding.md +2 -0
  35. package/references/video-continuity.md +42 -0
  36. package/references/video-native-observation.md +2 -0
  37. package/references/video-performers.md +2 -0
  38. package/references/video-project.md +2 -2
  39. package/references/video-replication.md +3 -1
  40. package/references/video-scenes.md +2 -2
  41. package/references/video-sound.md +19 -27
  42. package/references/video-step-0-machine.md +7 -0
  43. package/references/video-step-1-read.md +3 -0
  44. package/references/video-step-3-content.md +8 -0
  45. package/references/video-step-6-voice.md +6 -1
  46. package/references/video-step-7-deliver.md +6 -2
  47. package/references/video-tools.md +28 -1
  48. package/references/video.md +29 -2
@@ -0,0 +1,2 @@
1
+ import type { CommandMain } from '../runtime';
2
+ export declare const main: CommandMain;
@@ -0,0 +1,33 @@
1
+ import { type ProjectTask } from '../providers/task';
2
+ import type { Runtime } from '../runtime';
3
+ import { type CleanStats } from './clean';
4
+ import { type ProjectFiles } from './project-files';
5
+ import { type AgentInfo, type TranscriptPart } from './transcript';
6
+ export declare const FORMAT = "popost-feedback/1";
7
+ export declare const MESSAGE_MAX_CHARS = 4000;
8
+ /** The most the platform takes, compressed. */
9
+ export declare const MAX_BUNDLE_BYTES: number;
10
+ export interface FeedbackOptions {
11
+ readonly message: string;
12
+ readonly dir?: string;
13
+ readonly transcript?: string;
14
+ readonly noTranscript?: boolean;
15
+ readonly session?: string;
16
+ }
17
+ export interface BuiltFeedback {
18
+ readonly message: string;
19
+ readonly agent: AgentInfo;
20
+ readonly transcript: TranscriptPart & {
21
+ readonly omittedImages: number;
22
+ };
23
+ readonly projectDir?: string;
24
+ readonly task?: ProjectTask;
25
+ readonly project?: ProjectFiles;
26
+ readonly stats: CleanStats;
27
+ readonly gzip: Uint8Array;
28
+ readonly sha256: string;
29
+ }
30
+ /** A path under the home folder as `~/…`. */
31
+ export declare const tildify: (rt: Runtime, path: string) => string;
32
+ /** Everything that would be sent, cleaned and compressed. Reads only local files; sends nothing. */
33
+ export declare const buildFeedback: (rt: Runtime, options: FeedbackOptions) => Promise<BuiltFeedback>;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * What a problem report (`popost feedback`) removes before anything leaves the machine, the same in the dry run and the
3
+ * upload, so the counts the dry run shows are the counts of what is sent:
4
+ *
5
+ * - pictures and other binary data: a `data:` URL, or a string of only base64 characters longer than 1 KB, becomes
6
+ * `[omitted: <mime or 'binary'> <N> KB]` (counted in `omittedImages`);
7
+ * - secrets: known token shapes (popost keys and device tokens, `sk-…`, AWS, GitHub, Slack, `Bearer …`, JWTs, PEM private
8
+ * keys), the signature and token parameters of signed URLs, values under a secret's name (isSecretName: a word of the
9
+ * name is secret, token, password, passwd, pwd, credential(s) or apikey, or `key` after api, access, secret, private,
10
+ * client, auth, signing, encryption, master, service or account) when the value is quoted (`"name": "value"`) or the
11
+ * name is a variable's (`NAME=value`), and the exact values of such variables of this process's environment (counted in
12
+ * `redactions`). A bare `key` (a map key, a storage key) and code (`token: params.token`) are left alone, so the
13
+ * source an agent read stays readable;
14
+ * - the user's home directory, written as `~`.
15
+ *
16
+ * It is a best effort over text the user agreed to send, not a guarantee: the dry run shows the user what goes.
17
+ */
18
+ import type { Runtime } from '../runtime';
19
+ export declare const REDACTED = "[redacted]";
20
+ /** A string longer than this that is only base64 characters is binary data, not text. */
21
+ export declare const BINARY_MIN_CHARS = 1024;
22
+ export interface CleanStats {
23
+ redactions: number;
24
+ omittedImages: number;
25
+ }
26
+ export interface Cleaner {
27
+ readonly stats: CleanStats;
28
+ /** One string: pictures out, secrets out, home as `~`. */
29
+ readonly text: (value: string) => string;
30
+ /** A parsed JSON value, every string and every value under a secret's name cleaned. */
31
+ readonly json: (value: unknown) => unknown;
32
+ }
33
+ export declare const isSecretName: (name: string) => boolean;
34
+ /** The values of this process's variables named like secrets, longest first (a key inside a longer value goes with it). */
35
+ export declare const environmentSecrets: (env: Runtime["env"]) => string[];
36
+ export declare const createCleaner: (options?: {
37
+ readonly homeDir?: string;
38
+ readonly secrets?: readonly string[];
39
+ }) => Cleaner;
40
+ /** A JSONL text cleaned line by line: a line that parses is cleaned as JSON and written back compact; any other stays text. */
41
+ export declare const cleanJsonl: (cleaner: Cleaner, raw: string) => {
42
+ text: string;
43
+ lines: number;
44
+ };
@@ -0,0 +1,19 @@
1
+ import type { Runtime } from '../runtime';
2
+ import type { Cleaner } from './clean';
3
+ export declare const MAX_DEPTH = 6;
4
+ export declare const MAX_LISTED = 2000;
5
+ export declare const DOCUMENT_MAX_BYTES: number;
6
+ export declare const DOCUMENTS_MAX_BYTES: number;
7
+ export interface ListedFile {
8
+ readonly path: string;
9
+ readonly bytes: number;
10
+ }
11
+ export interface ProjectFiles {
12
+ /** Every file found, POSIX paths relative to the project. */
13
+ readonly files: readonly ListedFile[];
14
+ /** The text that goes, by relative path. */
15
+ readonly documents: Readonly<Record<string, string>>;
16
+ /** More files than MAX_LISTED: the list stops there. */
17
+ readonly listTruncated: boolean;
18
+ }
19
+ export declare const collectProjectFiles: (rt: Runtime, root: string, cleaner: Cleaner) => Promise<ProjectFiles>;
@@ -0,0 +1,38 @@
1
+ import type { Runtime } from '../runtime';
2
+ import { type Cleaner } from './clean';
3
+ export declare const TRANSCRIPT_MAX_BYTES: number;
4
+ /** More than this is not read at all: only its end, so a huge file cannot exhaust memory. */
5
+ export declare const TRANSCRIPT_READ_MAX_BYTES: number;
6
+ export type TranscriptStatus = 'found' | 'missing' | 'skipped';
7
+ export type TranscriptFormat = 'claude-code-jsonl' | 'codex-jsonl' | 'jsonl' | 'text';
8
+ export interface AgentInfo {
9
+ readonly id: string;
10
+ readonly label: string;
11
+ readonly sessionId?: string;
12
+ }
13
+ export interface TranscriptPart {
14
+ readonly status: TranscriptStatus;
15
+ readonly path?: string;
16
+ readonly format?: TranscriptFormat;
17
+ readonly text?: string;
18
+ readonly lines: number;
19
+ readonly bytes: number;
20
+ readonly truncated: boolean;
21
+ /** Why there is none, for the user. */
22
+ readonly reason?: string;
23
+ }
24
+ export declare class FeedbackError extends Error {
25
+ readonly code: string;
26
+ name: string;
27
+ constructor(code: string, message: string);
28
+ }
29
+ /** The agent this command runs in, and its session: --session first, then what the agent sets. */
30
+ export declare const detectAgent: (rt: Runtime, session?: string) => AgentInfo;
31
+ /**
32
+ * The cleaned transcript. `file`: --transcript (resolved from the working folder); `skip`: --no-transcript. A named file
33
+ * that cannot be read is an error; an agent's transcript that is not found is `missing` with the reason.
34
+ */
35
+ export declare const readTranscript: (rt: Runtime, agent: AgentInfo, cleaner: Cleaner, options: {
36
+ file?: string;
37
+ skip?: boolean;
38
+ }) => Promise<TranscriptPart>;
@@ -0,0 +1,13 @@
1
+ import type { PopostClient } from '../providers/api';
2
+ import { type JsonRecord } from '../providers/base';
3
+ import type { Runtime } from '../runtime';
4
+ import type { BuiltFeedback } from './bundle';
5
+ export interface SentFeedback {
6
+ readonly id: string;
7
+ readonly reference: string;
8
+ readonly receivedAt: string;
9
+ }
10
+ /** The body of `POST /feedback`: what the report is, for the team's list; the report itself goes to the upload address. */
11
+ export declare const reservation: (rt: Runtime, built: BuiltFeedback, operationKey: string) => JsonRecord;
12
+ /** Reserve, upload, complete; once more with the same operation key when the bytes did not arrive. */
13
+ export declare const sendFeedback: (rt: Runtime, client: PopostClient, built: BuiltFeedback) => Promise<SentFeedback>;
@@ -3,7 +3,9 @@ import type { BrowserProfile } from '../runtime';
3
3
  export declare class BrowserUnavailableError extends Error {
4
4
  name: string;
5
5
  }
6
- /** The browser executable to use, or `null` when none is found. */
6
+ /** Existing browser candidates, preserving an explicit executable selection. */
7
+ export declare const chromiumCandidates: (env: Readonly<Record<string, string | undefined>>) => string[];
8
+ /** The first discovered executable; launch also verifies it and can try another installed browser. */
7
9
  export declare const findChromium: (env: Readonly<Record<string, string | undefined>>) => string | null;
8
10
  /**
9
11
  * The arguments of a launch. rasterThreads: for video frames, Chrome's raster threads from the CPU budget (1 to 4).
@@ -157,6 +157,9 @@ export interface EditorHost {
157
157
  export interface Runtime {
158
158
  /** Desktop operating system. Virtual hosts may omit this capability. */
159
159
  readonly platform?: string;
160
+ /** Desktop-only: the processor architecture and the Node version, told in a problem report (`popost feedback`). */
161
+ readonly arch?: string;
162
+ readonly nodeVersion?: string;
160
163
  readonly fs: FileSystem;
161
164
  /** `node:path` of the platform for the real disk, `node:path/posix` for a virtual one. */
162
165
  readonly path: PlatformPath;
@@ -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.12";
2
+ export declare const VERSION = "4.6.14";
@@ -1,13 +1,9 @@
1
1
  import type { Runtime } from '../../runtime';
2
2
  import { type ReferenceLimits } from '../product/requests';
3
3
  import { type Commands } from './shared';
4
- /**
5
- * What the model of the clips takes, from the built-in generator's own list (POPOST_VIDEO_MODEL, else the platform's
6
- * default). A generator of the user's own, or a list that cannot be read, gives no limits and says why: the list of
7
- * requests is then not held to them, and says so.
8
- */
9
- /** POPOST_GEN_CMD names the built-in generator (popost video generate, whatever comes before and after it). */
4
+ /** Recognize either Popost executable form, including profile flags. Adapter arguments may also contain these words. */
10
5
  export declare const builtInGenerator: (rt: Runtime) => boolean;
6
+ /** Read the Popost model limits, or the exact-frame capability declared for an external adapter. */
11
7
  export declare const referenceLimits: (rt: Runtime) => Promise<{
12
8
  limits?: ReferenceLimits;
13
9
  unread?: string;
@@ -1,16 +1,3 @@
1
- /**
2
- * The three readings of a reference that describe needs: the measurement (always), the on-screen text (with a text
3
- * reader) and the speech (with a transcriber). None needs another, so they run side by side when the CPU budget has
4
- * room (SIDE_BY_SIDE_FROM processors), and one after another below it; the result is the same either way. A transcriber
5
- * that works elsewhere (Transcriber.remote: popost.ai's) takes none of the budget: it starts at once at any budget and
6
- * waits beside the local parts, so the speech no longer waits for the reader's minutes. On a 30 s
7
- * video they take from half a minute to several minutes, the reader most, so a progress line about all three goes
8
- * out every everyMs, and it says which part works and which waits its turn. Beside them (or after them, below the
9
- * budget) a few frames a second are decoded for the frame around the content (inset.ts); the same frames give each shot
10
- * the share of its middle picture that is not ground (measure/fill.ts), at no further decoding. With pictures asked for,
11
- * that pass waits for the measurement and also decodes the frames of describe's pictures (frames.ts), at the same size,
12
- * and writes them: the frames of a shot's sheet depend on where the measurement put its boundaries.
13
- */
14
1
  import type { Runtime } from '../../runtime';
15
2
  import { type SheetResult } from '../look/sheets';
16
3
  import { type Inset, type InsetSamples } from './inset';
@@ -34,7 +21,8 @@ export interface ReadReferenceOptions {
34
21
  /**
35
22
  * inset: the frame around the content when the shots show one (inset.ts). pictures: the sheets written, when asked for.
36
23
  * speechFailed: the transcriber failed (its message, first line); the rest of the reading stands, and the speech is
37
- * then unknown, not absent.
24
+ * then unknown, not absent. textReused: how many of the frames the reader was to read had their lines kept from an
25
+ * earlier describe of the same video, when any had.
38
26
  */
39
27
  export interface ReferenceReading {
40
28
  measure: Measure;
@@ -43,7 +31,18 @@ export interface ReferenceReading {
43
31
  inset?: Inset;
44
32
  pictures?: SheetResult[];
45
33
  speechFailed?: string;
34
+ textReused?: {
35
+ frames: number;
36
+ of: number;
37
+ };
46
38
  }
39
+ /**
40
+ * Where describe keeps the reader's lines of a video's frames (eval/readback-kept.ts): beside the measurement cache
41
+ * (measure/cache.ts), in the working directory, named by the video's bytes and this version. A second describe of the
42
+ * same video, into the same directory or another (a paid one after a free one, say), takes them instead of reading
43
+ * again. They are kept by the bytes of each frame and for one reader: another ffmpeg or another reader reads again.
44
+ */
45
+ export declare const describeTextFile: (rt: Runtime, video: string) => Promise<string>;
47
46
  /**
48
47
  * Each shot with the share of its middle picture that is not ground: the sample nearest the middle of the shot's clean
49
48
  * interior, clear of the transitions. A shot too short to hold a sample keeps none.
@@ -3,8 +3,9 @@ import type { TextReader } from '../text/types';
3
3
  /** Where the lines of the last readback are kept, in the project. */
4
4
  export declare const TEXT_CACHE = "readback.text.json";
5
5
  /**
6
- * A reader that takes the lines of every frame whose bytes the last readback read (file) and reads the others with
7
- * reader, then keeps the lines of this readback's frames, and only those, in file. onKept is told how many frames'
8
- * lines it took, before the reader starts.
6
+ * A reader that takes the lines of every frame whose bytes the last reading read (file) and reads the others with
7
+ * reader, then keeps the lines of this reading's frames, and only those, in file. onKept is told how many frames'
8
+ * lines it took, before the reader starts. Each call is one reading: of a reading done in several calls, file keeps
9
+ * the last call's frames.
9
10
  */
10
11
  export declare const keptReader: (rt: Runtime, file: string, reader: TextReader, onKept?: (kept: number, of: number) => void) => TextReader;
@@ -60,6 +60,7 @@ export interface MadeClip {
60
60
  credits?: number;
61
61
  chargedCredits: number;
62
62
  key: string;
63
+ task: string;
63
64
  }
64
65
  /** Makes the clip a request asks for at out, on popost.ai; resolves with the credits it cost and was charged now. */
65
66
  export declare const makeClip: (rt: Runtime, client: PopostClient, s: CloudSettings, request: GenerateRequest, out: string) => Promise<MadeClip>;
@@ -7,6 +7,7 @@ export interface SpeechLine {
7
7
  beat?: number;
8
8
  at?: number;
9
9
  to?: number;
10
+ offscreen?: boolean;
10
11
  }
11
12
  /** Native speech with timed lines: the model speaks them, lips and voice made together. */
12
13
  export interface DialogueSpeech {
@@ -22,6 +23,7 @@ export interface TimedLine {
22
23
  at: number;
23
24
  to: number;
24
25
  beat?: number;
26
+ offscreen?: true;
25
27
  }
26
28
  export interface TimedDialogue {
27
29
  mode: 'native';
@@ -31,6 +31,7 @@ import { type UnplannedClip } from './approved';
31
31
  import { type VisibleSpeech } from './speech';
32
32
  import { type BeatTimes } from './dialogue';
33
33
  import { type PromptPolicy } from '../prompt-lang';
34
+ import { type MaterialProvider } from './provenance';
34
35
  import { type ClipMusicBasis, type ModeContext, type RecordedException, type SoundMode } from '../sound/modes';
35
36
  import { type ClipMusicUse } from './clip-sound';
36
37
  import { type ReferenceLimits } from '../product/requests';
@@ -102,6 +103,7 @@ export interface Made {
102
103
  credits?: number;
103
104
  chargedCredits?: number;
104
105
  key?: string;
106
+ task?: string;
105
107
  }
106
108
  export interface Generator {
107
109
  /** Makes one file at out, with `env` added to its environment. Resolves with what it cost, when the command says. */
@@ -136,6 +138,8 @@ export interface MaterialRequest extends GenerateRequest {
136
138
  anchor?: boolean;
137
139
  /** The file of another clip (of this list, or of the project): this clip starts from its last frame, as its firstFrame. */
138
140
  continues?: string;
141
+ /** A reviewed source frame to continue from; omitted means the last frame. */
142
+ continueAt?: number;
139
143
  }
140
144
  /** motionAmount: how much a clip's picture moves (measure/amount.ts), to hold against the reference shot it is for. */
141
145
  /**
@@ -143,6 +147,7 @@ export interface MaterialRequest extends GenerateRequest {
143
147
  * because what it starts from (waitsFor) is still being made; a later run sends it.
144
148
  */
145
149
  export interface MadeMaterial {
150
+ receipt?: string;
146
151
  file: string;
147
152
  kind: GenerateKind;
148
153
  made: boolean;
@@ -187,6 +192,7 @@ export interface MaterialsReport {
187
192
  * of the list, or by a clip the project already has (covered).
188
193
  */
189
194
  export interface RequestPolicy {
195
+ frames?: boolean;
190
196
  selectedIdentity?: boolean;
191
197
  times?: BeatTimes;
192
198
  covered?: ReadonlySet<number>; /** The exceptions the project records for music inside clips. */
@@ -280,6 +286,8 @@ declare const makeMaterialsIn: (rt: Runtime, o: {
280
286
  times?: BeatTimes;
281
287
  music?: boolean;
282
288
  modes?: ModeContext;
289
+ frames?: boolean;
290
+ provider?: MaterialProvider;
283
291
  submitOnly?: boolean;
284
292
  onStep?: (file: string, done: number, total: number) => void;
285
293
  }) => Promise<MaterialsReport>;
@@ -1,3 +1,16 @@
1
+ import type { Runtime } from '../../runtime';
2
+ export type MaterialProvider = 'popost.ai' | 'external';
3
+ export interface MaterialReceipt {
4
+ version: 1;
5
+ pipeline: 'popost video materials';
6
+ provider: MaterialProvider;
7
+ sha256: string;
8
+ requestHash: string;
9
+ continues?: string;
10
+ continueAt?: number;
11
+ }
12
+ export declare const materialReceiptFile: (clip: string) => string;
13
+ export declare const readMaterialReceipt: (rt: Runtime, full: string) => Promise<MaterialReceipt | undefined>;
1
14
  export interface MaterialProvenance {
2
15
  request: object;
3
16
  voiceHash?: string;
@@ -17,4 +17,4 @@ export declare const speakersOf: (speech: VisibleSpeech | SentSpeech) => string[
17
17
  /** The final audio a lip-synced clip is made to (the first form only). */
18
18
  export declare const speechAudio: (speech: VisibleSpeech | SentSpeech | undefined) => string | undefined;
19
19
  export declare const speechPrompt: (speech: SentSpeech) => string;
20
- export declare const finalizeSpeech: (rt: Runtime, clip: string, speech: SentSpeech, dir: string, destination?: string) => Promise<void>;
20
+ export declare const finalizeSpeech: (rt: Runtime, clip: string, speech: SentSpeech, dir: string, destination?: string) => Promise<string | undefined>;
@@ -54,5 +54,22 @@ export declare const gridOf: (n: number, tileWidth: number) => {
54
54
  };
55
55
  /** The time written under a frame: seconds to a hundredth, as "12.34s". */
56
56
  export declare const timeLabel: (seconds: number) => string;
57
+ /**
58
+ * The JPEG quality of every picture written for an agent to look at (sheets here, look's moments and pairs). An agent
59
+ * sends each picture it opens to its model, over the user's connection: q 5 is a quarter fewer bytes than q 3 at the
60
+ * same look (SSIM 0.99 on describe's sheets), full colour resolution kept for coloured text.
61
+ */
62
+ export declare const LOOK_JPEG: readonly ["-q:v", "5"];
63
+ /**
64
+ * The most pixels a picture to look at keeps: about what a model looks at without scaling it down (Claude about
65
+ * 1.15 megapixels; GPT models scale the short side to 768). A taller sheet (a transition of many frames) is written
66
+ * scaled down to it: the pixels above it would be sent and thrown away.
67
+ */
68
+ export declare const LOOK_MAX_PIXELS = 1150000;
69
+ /** A sheet's size as written: the drawn size, scaled down to LOOK_MAX_PIXELS when it is larger (even sides). */
70
+ export declare const lookSize: (width: number, height: number) => {
71
+ width: number;
72
+ height: number;
73
+ };
57
74
  /** Writes every sheet into outDir in one decoding pass; returns them with their frames and times, and the frames kept. */
58
75
  export declare const writeSheets: (rt: Runtime, video: string, specs: readonly SheetSpec[], o: SheetOptions) => Promise<SheetsWritten>;
@@ -3,7 +3,7 @@
3
3
  * and kept, and the picture of all of them is put together with the sound in one last ffmpeg run that copies it.
4
4
  */
5
5
  import type { Runtime } from '../../runtime';
6
- import type { ResolvedAudio } from '../types';
6
+ import type { Resolved, ResolvedAudio } from '../types';
7
7
  import type { ImageFormat, Session } from './session';
8
8
  export interface ChunkedJob {
9
9
  sessions: Session[];
@@ -22,8 +22,17 @@ export interface ChunkedJob {
22
22
  keep: boolean;
23
23
  onProgress?: (frame: number, total: number) => void;
24
24
  }
25
- /** Renders the whole video of the pages into job.out in chunks; says how many chunks there were and how many were kept ones. */
25
+ /**
26
+ * The shots a set of drawn frame ranges shows, in timeline order: what a review after a fix needs to look at again (the
27
+ * frames of the other shots are the copied chunks, the same pictures as before).
28
+ */
29
+ export declare const shotsIn: (r: Resolved, ranges: readonly [number, number][]) => string[];
30
+ /**
31
+ * Renders the whole video of the pages into job.out in chunks; says how many chunks there were, how many were kept
32
+ * ones, and, when some were kept, which shots the drawn ones show.
33
+ */
26
34
  export declare const renderInChunks: (rt: Runtime, job: ChunkedJob) => Promise<{
27
35
  total: number;
28
36
  reused: number;
37
+ drawnShots?: string[];
29
38
  }>;
@@ -4,7 +4,7 @@ import type { ImageFormat, Session } from './session';
4
4
  export declare const CHUNK_DIR = ".cache/render-chunks";
5
5
  /** Bound a long single scene so a local timeline edit need not invalidate the entire video. */
6
6
  export declare const MAX_CHUNK_SECONDS = 4;
7
- /** The frames of each chunk: per segment, split at four seconds; one shorter than a second joined to the next (the last to the one before). */
7
+ /** The frames of each chunk: per segment, split every four seconds; one shorter than a second joined to the next (the last to the one before). */
8
8
  export declare const chunkRanges: (r: Resolved) => [number, number][];
9
9
  /** What the keys of one render share, and the hashes of the files they name, read once each. */
10
10
  export interface KeyContext {
@@ -25,7 +25,10 @@ export declare const keyContext: (rt: Runtime, root: string, session: Session, o
25
25
  quality: number;
26
26
  crf: number;
27
27
  }) => Promise<KeyContext>;
28
- /** The key of one frame from the page's state (Session.state). */
28
+ /**
29
+ * The key of one frame from the page's state (Session.state). In the markup a frame of a video material is replaced by
30
+ * its bytes, where it stands: the extraction directory changes with the clip's date, the picture does not.
31
+ */
29
32
  export declare const frameKey: (rt: Runtime, c: KeyContext, state: {
30
33
  markup: string;
31
34
  scenes: {
@@ -46,10 +46,14 @@ export interface RenderVideoResult {
46
46
  reused: number;
47
47
  /** What the finished sound lacks, for the answer (warnings): the music ending before the video. Whole renders with sound only. */
48
48
  problems: Problem[];
49
- /** A whole render's chunks (render/chunked.ts), and how many were copied from the render before. */
49
+ /**
50
+ * A whole render's chunks (render/chunked.ts), how many were copied from the render before and, when any was, the
51
+ * shots (segment ids) the drawn ones show: the ones a review after a fix opens again.
52
+ */
50
53
  chunks?: {
51
54
  total: number;
52
55
  reused: number;
56
+ drawnShots?: string[];
53
57
  };
54
58
  /** A whole render: what was removed of the frame cache once the video was written (cache/frames.ts). */
55
59
  framesFreedBytes?: number;
@@ -77,7 +81,8 @@ export interface Renderer {
77
81
  height: number;
78
82
  frames: number;
79
83
  /** PNG of frame n. */
80
- frame(n: number): Promise<Buffer>;
84
+ /** PNG unless asked for JPEG (LOOK_JPEG_QUALITY): a frame to look at, about a fifth of the bytes. */
85
+ frame(n: number, format?: ImageFormat): Promise<Buffer>;
81
86
  close(): Promise<void>;
82
87
  }
83
88
  /** Keeps one page open for many frames. Every frame is a screenshot of its own unless opts.reuse is true. */
@@ -86,9 +91,22 @@ export declare const openRenderer: (rt: Runtime, projectDir: string, opts?: {
86
91
  reuse?: boolean;
87
92
  lazyScenes?: boolean;
88
93
  }) => Promise<Renderer>;
89
- /** Writes one frame as PNG. projectDir and out: as the user typed them (against rt.cwd). */
90
- /** The file of frame n in a directory of frames: f000045.png, so that names sort as the frames do. */
91
- export declare const frameFileName: (n: number) => string;
94
+ /**
95
+ * The quality of a frame written as JPEG to be looked at. Every picture an agent opens is sent to its model, so a
96
+ * frame to look at is a JPEG (a fifth to a tenth of the PNG's bytes, the same picture to the eye); a PNG stays for
97
+ * exact pixels.
98
+ */
99
+ export declare const LOOK_JPEG_QUALITY = 85;
100
+ /** JPEG for a file named .jpg or .jpeg, else PNG. */
101
+ export declare const frameFormatOf: (file: string) => ImageFormat;
102
+ /**
103
+ * The scale of a frame to look at when none was asked for: the canvas drawn at most at LOOK_MAX_PIXELS (a model scales
104
+ * a larger picture down after it was sent). 1 for a canvas within it, and when video.json cannot be read (the
105
+ * renderer then says what is wrong with the project).
106
+ */
107
+ export declare const lookScale: (rt: Runtime, projectDir: string) => Promise<number>;
108
+ /** The file of frame n in a directory of frames: f000045.png (or .jpg), so that names sort as the frames do. */
109
+ export declare const frameFileName: (n: number, format?: ImageFormat) => string;
92
110
  /**
93
111
  * Several frames of the project, drawn in one browser session (one page load instead of one a frame) into outDir as
94
112
  * frameFileName(n), in frame order, each frame once. The page is a pure function of the frame number, so a frame
@@ -99,6 +117,7 @@ export declare const renderFrames: (rt: Runtime, opts: {
99
117
  frames: readonly number[];
100
118
  outDir: string;
101
119
  scale?: number;
120
+ format?: ImageFormat;
102
121
  }) => Promise<{
103
122
  width: number;
104
123
  height: number;
@@ -107,6 +126,7 @@ export declare const renderFrames: (rt: Runtime, opts: {
107
126
  out: string;
108
127
  }[];
109
128
  }>;
129
+ /** Writes one frame: JPEG for an out named .jpg or .jpeg, else PNG. projectDir and out: as the user typed them (against rt.cwd). */
110
130
  export declare const renderFrame: (rt: Runtime, opts: {
111
131
  projectDir: string;
112
132
  frame: number;
@@ -29,7 +29,7 @@ export declare const bindEvidence: (rt: Runtime, dir: string, file: string, o: {
29
29
  */
30
30
  export declare const withEvidence: (list: readonly ReplicationEvidence[], e: ReplicationEvidence) => ReplicationEvidence[];
31
31
  /** The places --add knows, for messages. */
32
- export declare const PLACES = "audio, visual, inventory, music, scope, event:<id> (replication.json); plan:visual, plan:event:<id> (replication.plan.json); review:audio, review:visual, review:event:<id> (replication.review.json)";
32
+ export declare const PLACES = "audio, visual, inventory, music, scope, event:<id> (replication.json); plan:visual, plan:event:<id> (replication.plan.json); review:audio, review:visual, review:join-<frame>, review:event:<id> (replication.review.json)";
33
33
  export interface BoundReference {
34
34
  file: string;
35
35
  sha256: string;
@@ -206,6 +206,34 @@ export declare const reviewSchema: z.ZodObject<{
206
206
  }, z.core.$strict>>;
207
207
  id: z.ZodString;
208
208
  }, z.core.$strict>>>;
209
+ joins: z.ZodOptional<z.ZodArray<z.ZodObject<{
210
+ status: z.ZodEnum<{
211
+ pending: "pending";
212
+ unknown: "unknown";
213
+ failed: "failed";
214
+ passed: "passed";
215
+ }>;
216
+ evidence: z.ZodArray<z.ZodObject<{
217
+ kind: z.ZodEnum<{
218
+ unknown: "unknown";
219
+ measured: "measured";
220
+ user: "user";
221
+ observed: "observed";
222
+ }>;
223
+ detail: z.ZodString;
224
+ file: z.ZodOptional<z.ZodString>;
225
+ sha256: z.ZodOptional<z.ZodString>;
226
+ media: z.ZodOptional<z.ZodEnum<{
227
+ video: "video";
228
+ frame: "frame";
229
+ data: "data";
230
+ audio: "audio";
231
+ }>>;
232
+ frame: z.ZodOptional<z.ZodNumber>;
233
+ at: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
234
+ }, z.core.$strict>>;
235
+ at: z.ZodNumber;
236
+ }, z.core.$strict>>>;
209
237
  audioUses: z.ZodOptional<z.ZodArray<z.ZodObject<{
210
238
  kind: z.ZodEnum<{
211
239
  sound: "sound";
@@ -620,6 +648,34 @@ export declare const contractSchema: z.ZodObject<{
620
648
  }, z.core.$strict>>;
621
649
  id: z.ZodString;
622
650
  }, z.core.$strict>>>;
651
+ joins: z.ZodOptional<z.ZodArray<z.ZodObject<{
652
+ status: z.ZodEnum<{
653
+ pending: "pending";
654
+ unknown: "unknown";
655
+ failed: "failed";
656
+ passed: "passed";
657
+ }>;
658
+ evidence: z.ZodArray<z.ZodObject<{
659
+ kind: z.ZodEnum<{
660
+ unknown: "unknown";
661
+ measured: "measured";
662
+ user: "user";
663
+ observed: "observed";
664
+ }>;
665
+ detail: z.ZodString;
666
+ file: z.ZodOptional<z.ZodString>;
667
+ sha256: z.ZodOptional<z.ZodString>;
668
+ media: z.ZodOptional<z.ZodEnum<{
669
+ video: "video";
670
+ frame: "frame";
671
+ data: "data";
672
+ audio: "audio";
673
+ }>>;
674
+ frame: z.ZodOptional<z.ZodNumber>;
675
+ at: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
676
+ }, z.core.$strict>>;
677
+ at: z.ZodNumber;
678
+ }, z.core.$strict>>>;
623
679
  audioUses: z.ZodOptional<z.ZodArray<z.ZodObject<{
624
680
  kind: z.ZodEnum<{
625
681
  sound: "sound";
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import type { ReplicationAudioUse, ReplicationContract, ReplicationReview } from './contract';
8
8
  import type { ReplicationPlan } from './production';
9
+ import type { Resolved, ResolvedSegment } from '../types';
9
10
  /** The final video as the review binds it: its path in the project, SHA-256 and clock. */
10
11
  export interface ReviewedVideo {
11
12
  file: string;
@@ -25,6 +26,21 @@ export interface BuiltReview {
25
26
  /** Required events with no frames: not in the plan and not given. */
26
27
  missing: string[];
27
28
  }
29
+ /** Sample both sides of each cut and the middle of any transition between them. */
30
+ export declare const joinFrames: (segments: readonly Pick<ResolvedSegment, "start" | "end" | "transition">[], fps: number) => {
31
+ at: number;
32
+ frames: number[];
33
+ }[];
34
+ /** Equal frame counts plus less than a quarter-frame accumulated clock drift preserve frame identity. */
35
+ export declare const matchingReviewClock: (clock: {
36
+ frames: number;
37
+ fps: number;
38
+ }, video: Pick<ReviewedVideo, "frames" | "fps">) => boolean;
39
+ /** Layer visibility can introduce a cut inside a segment, including a static picture used over a generated clip. */
40
+ export declare const timelineJoins: (r: Pick<Resolved, "segments" | "items" | "frames" | "canvas">, extra?: readonly number[]) => {
41
+ at: number;
42
+ frames: number[];
43
+ }[];
28
44
  /** n frames spread over total, one in the middle of each nth. */
29
45
  export declare const spreadFrames: (total: number, n: number) => number[];
30
46
  /** The lead-in, middle and resolved frame of a target span [a, b), inside the video; two at least where it has two. */
@@ -40,6 +56,7 @@ export declare const buildReview: (o: {
40
56
  plan?: ReplicationPlan;
41
57
  video: ReviewedVideo;
42
58
  visual: number[];
59
+ joins?: ReturnType<typeof joinFrames>;
43
60
  events: Readonly<Record<string, number[]>>;
44
61
  audioUses?: ReplicationAudioUse[];
45
62
  }) => BuiltReview;
@@ -1,3 +1,3 @@
1
1
  /** Strict speech metadata uses the audio track's local clock, independently of its timeline placement. */
2
2
  import type { Problem, Project, Resolved } from '../types';
3
- export declare const voiceSpanProblems: (project: Pick<Project, "tracks">, resolved: Pick<Resolved, "audio" | "frames">) => Problem[];
3
+ export declare const voiceSpanProblems: (project: Partial<Pick<Project, "tracks">>, resolved: Pick<Resolved, "audio" | "frames">) => Problem[];