video-editing 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -31
- package/dist/{chunk-SSXAUKGV.js → chunk-W4IIL2T2.js} +740 -801
- package/dist/cli.js +223 -123
- package/dist/index.d.ts +174 -138
- package/dist/index.js +43 -29
- package/package.json +2 -2
- package/skills/video-editing/SKILL.md +102 -74
- package/skills/video-editing/references/cli-reference.md +112 -72
package/dist/index.d.ts
CHANGED
|
@@ -3029,8 +3029,8 @@ declare function resolvePhrase(stream: StreamWord[], phrase: string, opts?: Reso
|
|
|
3029
3029
|
type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
|
|
3030
3030
|
declare const DEFAULT_TIMEOUT_MS = 30000;
|
|
3031
3031
|
declare const DEFAULT_DOWNLOAD_TIMEOUT_MS = 300000;
|
|
3032
|
-
/** base = --api-base flag → CLIPREADY_API_BASE → API_BASE. */
|
|
3033
|
-
declare function resolveApiBase(flag: string | undefined, env?: NodeJS.ProcessEnv): string
|
|
3032
|
+
/** base = --api-base flag → CLIPREADY_API_BASE → API_BASE → the hosted cloud. */
|
|
3033
|
+
declare function resolveApiBase(flag: string | undefined, env?: NodeJS.ProcessEnv): string;
|
|
3034
3034
|
/** credential = --api-key flag → CLIPREADY_API_KEY → RUN_TOKEN. */
|
|
3035
3035
|
declare function resolveApiKey(flag: string | undefined, env?: NodeJS.ProcessEnv): string | undefined;
|
|
3036
3036
|
/** video id = --video-id flag → VIDEO_ID. */
|
|
@@ -3059,8 +3059,16 @@ declare function meUrl(base: string): string;
|
|
|
3059
3059
|
declare function projectsUrl(base: string): string;
|
|
3060
3060
|
declare function projectVideosUrl(base: string, projectId: string): string;
|
|
3061
3061
|
declare function runUrl(base: string, runId: string): string;
|
|
3062
|
+
/** Chunked-upload session routes: /api/v1/uploads/multipart[/parts|complete|abort|relay|relay-complete]. */
|
|
3063
|
+
declare function multipartUrl(base: string, tail?: "parts" | "complete" | "abort" | "relay" | "relay-complete"): string;
|
|
3064
|
+
/** Authenticated relay POST for one raw sub-chunk of a multipart part
|
|
3065
|
+
* (i is the 1-based sub-chunk index, of the sub-chunk count). */
|
|
3066
|
+
declare function multipartRelayUrl(base: string, uploadId: string, n: number, i: number, of: number): string;
|
|
3062
3067
|
declare function filesUrl(base: string, videoId: string, path?: string): string;
|
|
3063
3068
|
declare function transcribeUrl(base: string, videoId: string): string;
|
|
3069
|
+
/** POST /videos/{id}/ingest — server-side probe + audio extraction +
|
|
3070
|
+
* transcription + screening over the uploaded source (202 {run_id}). */
|
|
3071
|
+
declare function ingestUrl(base: string, videoId: string): string;
|
|
3064
3072
|
declare function compileUrl(base: string, videoId: string): string;
|
|
3065
3073
|
declare function resolveUrl(base: string, videoId: string): string;
|
|
3066
3074
|
declare function verifyUrl(base: string, videoId: string): string;
|
|
@@ -3106,6 +3114,18 @@ interface QaWaveformResult {
|
|
|
3106
3114
|
url: string;
|
|
3107
3115
|
words: QaWaveWord[];
|
|
3108
3116
|
}
|
|
3117
|
+
/** POST /videos/{id}/qa {kind:"inspect"} → the combined filmstrip + waveform
|
|
3118
|
+
* composite with the plan's cut regions shaded. */
|
|
3119
|
+
interface QaInspectResult {
|
|
3120
|
+
url: string;
|
|
3121
|
+
tStart: number;
|
|
3122
|
+
tEnd: number;
|
|
3123
|
+
cuts: Array<{
|
|
3124
|
+
start: number;
|
|
3125
|
+
end: number;
|
|
3126
|
+
}>;
|
|
3127
|
+
cached: boolean;
|
|
3128
|
+
}
|
|
3109
3129
|
/** One row of the VFS listing. */
|
|
3110
3130
|
interface VfsFileEntry {
|
|
3111
3131
|
path: string;
|
|
@@ -3196,6 +3216,18 @@ declare class CloudClient {
|
|
|
3196
3216
|
private readonly timeoutMs;
|
|
3197
3217
|
constructor(cfg: ResolvedConfig, opts?: ClientOptions);
|
|
3198
3218
|
private requireVideoId;
|
|
3219
|
+
/** Same client (same fetch/timeout) bound to a video id — for flows that
|
|
3220
|
+
* create the video mid-run (init). */
|
|
3221
|
+
withVideoId(videoId: string): CloudClient;
|
|
3222
|
+
/** The injected fetch — for helpers outside the class (multipart part PUTs)
|
|
3223
|
+
* that need raw Response access (e.g. the ETag header). */
|
|
3224
|
+
get fetch(): FetchLike;
|
|
3225
|
+
/** POST a JSON body to an absolute API URL with auth — public wrapper over
|
|
3226
|
+
* the private transport for helpers living outside the class (multipart). */
|
|
3227
|
+
postJson(url: string, body: unknown): Promise<unknown>;
|
|
3228
|
+
/** POST raw binary bytes to an authenticated API URL (multipart relay
|
|
3229
|
+
* sub-chunks). Content-Type application/octet-stream; JSON response. */
|
|
3230
|
+
postBinary(url: string, bytes: Uint8Array, timeoutMs?: number): Promise<unknown>;
|
|
3199
3231
|
private request;
|
|
3200
3232
|
createRender(mode: RenderMode): Promise<RenderCreate>;
|
|
3201
3233
|
getRender(renderId: string): Promise<RenderState>;
|
|
@@ -3209,6 +3241,11 @@ declare class CloudClient {
|
|
|
3209
3241
|
start: number;
|
|
3210
3242
|
end: number;
|
|
3211
3243
|
}): Promise<QaWaveformResult>;
|
|
3244
|
+
qaInspect(args: {
|
|
3245
|
+
start: number;
|
|
3246
|
+
end: number;
|
|
3247
|
+
nFrames?: number;
|
|
3248
|
+
}): Promise<QaInspectResult>;
|
|
3212
3249
|
listArtifacts(): Promise<string[]>;
|
|
3213
3250
|
getArtifact(name: string): Promise<ArtifactContent>;
|
|
3214
3251
|
/** POST /api/v1/assets: request an asset row + presigned upload URL
|
|
@@ -3220,8 +3257,11 @@ declare class CloudClient {
|
|
|
3220
3257
|
filename?: string;
|
|
3221
3258
|
}): Promise<AssetCreate>;
|
|
3222
3259
|
/** PUT raw bytes to a presigned upload URL. No Authorization header — the
|
|
3223
|
-
* signed URL carries its own credentials and may be a different host.
|
|
3224
|
-
|
|
3260
|
+
* signed URL carries its own credentials and may be a different host.
|
|
3261
|
+
* Mid-stream network failures (connection resets, TLS record errors) and
|
|
3262
|
+
* 5xx responses are retried with exponential backoff — the whole body is
|
|
3263
|
+
* an in-memory buffer, so every attempt is a clean full replay. */
|
|
3264
|
+
upload(url: string, bytes: Uint8Array, contentType: string, timeoutMs?: number, maxAttempts?: number): Promise<void>;
|
|
3225
3265
|
getReview(): Promise<ReviewSession>;
|
|
3226
3266
|
/** POST a review-round event ({run_id, type, payload?}); expects {ok:true}. */
|
|
3227
3267
|
pushReview(body: {
|
|
@@ -3276,13 +3316,18 @@ declare class CloudClient {
|
|
|
3276
3316
|
}): Promise<{
|
|
3277
3317
|
runId: string;
|
|
3278
3318
|
}>;
|
|
3279
|
-
/** POST /videos/{id}/
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3319
|
+
/** POST /videos/{id}/ingest {stem?} → 202 {run_id}. Server-side probe + audio
|
|
3320
|
+
* extraction + transcription + screening over the uploaded source. The stem
|
|
3321
|
+
* names every derived artifact (transcripts/<stem>.json, audio/<stem>.wav) —
|
|
3322
|
+
* omit it and the server defaults to "source". */
|
|
3323
|
+
ingestStart(stem?: string): Promise<{
|
|
3324
|
+
runId: string;
|
|
3325
|
+
}>;
|
|
3326
|
+
/** POST /videos/{id}/verify {mode?, window_s?} → 202 {run_id}. The server
|
|
3327
|
+
* sources the preview audio itself — nothing is uploaded. */
|
|
3328
|
+
verifyStart(body?: {
|
|
3283
3329
|
mode?: string;
|
|
3284
3330
|
window_s?: number;
|
|
3285
|
-
edl?: unknown;
|
|
3286
3331
|
}): Promise<{
|
|
3287
3332
|
runId: string;
|
|
3288
3333
|
}>;
|
|
@@ -3386,9 +3431,70 @@ interface PushedFile {
|
|
|
3386
3431
|
* inline; larger/binary payloads go presign → upload → commit. */
|
|
3387
3432
|
declare function pushFiles(client: CloudClient, jobDir: string, paths: string[], opts?: {
|
|
3388
3433
|
onFile?: (f: PushedFile) => void;
|
|
3434
|
+
log?: (line: string) => void;
|
|
3389
3435
|
}): Promise<PushedFile[]>;
|
|
3390
|
-
/** Upload one in-memory payload to the VFS (
|
|
3391
|
-
|
|
3436
|
+
/** Upload one in-memory payload to the VFS (used for WAVs and pushed renders).
|
|
3437
|
+
* Payloads over 8MB go chunked (multipart, per-part retry) when the server
|
|
3438
|
+
* supports it; otherwise — and for small payloads — the classic presign →
|
|
3439
|
+
* single PUT → commit flow. */
|
|
3440
|
+
declare function uploadVfsPayload(client: CloudClient, vfsPath: string, bytes: Uint8Array, contentType: string, opts?: {
|
|
3441
|
+
sha256?: string;
|
|
3442
|
+
log?: (line: string) => void;
|
|
3443
|
+
}): Promise<void>;
|
|
3444
|
+
/** Back-compat alias: upload one in-memory payload to the VFS. */
|
|
3445
|
+
declare function uploadVfsBytes(client: CloudClient, vfsPath: string, bytes: Uint8Array, contentType: string, log?: (line: string) => void): Promise<void>;
|
|
3446
|
+
|
|
3447
|
+
/** Payloads LARGER than this go multipart; at or below, the single-shot path. */
|
|
3448
|
+
declare const MULTIPART_THRESHOLD_BYTES: number;
|
|
3449
|
+
/** Direct part-PUT transport failures before the relay fallback kicks in. */
|
|
3450
|
+
declare const RELAY_DIRECT_ATTEMPTS = 3;
|
|
3451
|
+
/** Relay sub-chunk ceiling (3.5MB — under the API route's body limit). */
|
|
3452
|
+
declare const RELAY_SUBCHUNK_BYTES = 3670016;
|
|
3453
|
+
/** Multipart applies above the 8MB threshold. Accepts a byte count (streaming
|
|
3454
|
+
* callers stat the file) or an in-memory payload. */
|
|
3455
|
+
declare function shouldMultipart(sizeOrBytes: number | Uint8Array): boolean;
|
|
3456
|
+
/** A random-access byte source: only `len`-sized windows are ever materialized,
|
|
3457
|
+
* so uploads stay 2GB-safe (memory ≤ concurrency × part_size). */
|
|
3458
|
+
interface MultipartSource {
|
|
3459
|
+
size: number;
|
|
3460
|
+
/** Read exactly min(len, size - offset) bytes starting at offset. */
|
|
3461
|
+
readSlice(offset: number, len: number): Promise<Buffer>;
|
|
3462
|
+
}
|
|
3463
|
+
/** Wrap an in-memory payload as a source (small VFS pushes). */
|
|
3464
|
+
declare function bytesSource(bytes: Uint8Array): MultipartSource;
|
|
3465
|
+
interface FileSource extends MultipartSource {
|
|
3466
|
+
/** Close the underlying fd. Callers MUST close on completion AND failure. */
|
|
3467
|
+
close(): Promise<void>;
|
|
3468
|
+
}
|
|
3469
|
+
/** File-backed source: fs/promises open + positional reads. Never loads the
|
|
3470
|
+
* whole file; concurrent readSlice calls are safe (positional pread). */
|
|
3471
|
+
declare function openFileSource(path: string): Promise<FileSource>;
|
|
3472
|
+
interface MultipartOptions {
|
|
3473
|
+
kind: "asset" | "jobfile";
|
|
3474
|
+
/** In-memory payload (small VFS pushes). Exactly one of bytes/source. */
|
|
3475
|
+
bytes?: Uint8Array;
|
|
3476
|
+
/** Streaming payload (init sources) — 2GB-safe. */
|
|
3477
|
+
source?: MultipartSource;
|
|
3478
|
+
contentType: string;
|
|
3479
|
+
/** kind "asset": original filename (no video exists yet at init time). */
|
|
3480
|
+
filename?: string;
|
|
3481
|
+
/** kind "jobfile": owning video + VFS path (+ sha256 for integrity). */
|
|
3482
|
+
videoId?: string;
|
|
3483
|
+
path?: string;
|
|
3484
|
+
sha256?: string;
|
|
3485
|
+
log?: (line: string) => void;
|
|
3486
|
+
/** Retry backoff schedule override (tests) — defaults to jitteredBackoffMs. */
|
|
3487
|
+
backoffMs?: (attempt: number) => number;
|
|
3488
|
+
}
|
|
3489
|
+
/** Chunked upload of a payload (in-memory bytes OR a streaming source).
|
|
3490
|
+
* Returns "unavailable" ONLY when the server cannot do multipart at all
|
|
3491
|
+
* (503 multipart_unavailable / 404 / 405 on session create) so the caller can
|
|
3492
|
+
* fall back to the single-shot presign path. Any other failure aborts the
|
|
3493
|
+
* session (best-effort) and throws. Parts are sliced through
|
|
3494
|
+
* source.readSlice, so memory stays ≤ PART_CONCURRENCY × part_size. */
|
|
3495
|
+
declare function uploadMultipart(client: CloudClient, opts: MultipartOptions, timeoutMs?: number): Promise<{
|
|
3496
|
+
assetId?: string;
|
|
3497
|
+
} | "unavailable">;
|
|
3392
3498
|
|
|
3393
3499
|
interface JobFile {
|
|
3394
3500
|
video_id: string;
|
|
@@ -3396,6 +3502,10 @@ interface JobFile {
|
|
|
3396
3502
|
api_base: string;
|
|
3397
3503
|
stem: string;
|
|
3398
3504
|
duration_s: number;
|
|
3505
|
+
/** Absolute path of the original init source (used as the transcribe media
|
|
3506
|
+
* fallback and to re-bake vertical_src.mp4 on demand). Optional: job.json
|
|
3507
|
+
* files written before 2.0.1 don't have it. */
|
|
3508
|
+
source_path?: string;
|
|
3399
3509
|
}
|
|
3400
3510
|
declare function jobJsonPath(jobDir: string): string;
|
|
3401
3511
|
declare function writeJobFile(jobDir: string, job: JobFile): string;
|
|
@@ -3403,12 +3513,24 @@ declare function readJobFile(jobDir: string): JobFile | null;
|
|
|
3403
3513
|
/** Video id fallback for job-dir verbs: flag/env (already resolved) → job.json. */
|
|
3404
3514
|
declare function videoIdFromJob(jobDir: string, resolved: string | undefined): string;
|
|
3405
3515
|
|
|
3516
|
+
/** Sanitize a source-derived stem to the server's filename-safe charset
|
|
3517
|
+
* (letters, digits, `.` `_` `-`): every run of anything else becomes a single
|
|
3518
|
+
* `-`, leading/trailing `-` are trimmed. Apostrophes, spaces, unicode
|
|
3519
|
+
* punctuation etc. in the source filename must never leak into the stem —
|
|
3520
|
+
* the server rejects them ("stem must be a filename-safe string"). Falls back
|
|
3521
|
+
* to "source" when nothing survives. */
|
|
3522
|
+
declare function sanitizeStem(name: string): string;
|
|
3523
|
+
/** The artifact set init pulls after the ingest run completes (plus the
|
|
3524
|
+
* prompts/ prefix). probe.json carries the server-side media probe. */
|
|
3525
|
+
declare function ingestArtifactSet(stem: string): string[];
|
|
3526
|
+
/** Read duration_s out of a pulled probe.json ({duration_s, width, height,
|
|
3527
|
+
* rotation}). Throws when the file is absent or carries no usable duration. */
|
|
3528
|
+
declare function readProbeDuration(jobDir: string): number;
|
|
3406
3529
|
interface InitOptions {
|
|
3407
3530
|
source: string;
|
|
3408
3531
|
jobDir?: string;
|
|
3409
3532
|
title?: string;
|
|
3410
|
-
|
|
3411
|
-
master?: boolean;
|
|
3533
|
+
pollIntervalMs?: number;
|
|
3412
3534
|
verbose?: boolean;
|
|
3413
3535
|
}
|
|
3414
3536
|
interface InitResult {
|
|
@@ -3420,63 +3542,28 @@ interface InitResult {
|
|
|
3420
3542
|
durationS: number;
|
|
3421
3543
|
uploaded: string;
|
|
3422
3544
|
uploadedBytes: number;
|
|
3545
|
+
runId: string;
|
|
3546
|
+
pulled: FilesPullResult;
|
|
3547
|
+
/** Watch/review page in the clipready web app. */
|
|
3548
|
+
webUrl: string;
|
|
3423
3549
|
}
|
|
3424
3550
|
declare function initCloudJob(client: CloudClient, opts: InitOptions): Promise<InitResult>;
|
|
3425
3551
|
|
|
3426
3552
|
interface Transcribe2Options {
|
|
3427
|
-
/** Local media to extract the WAV from (source or vertical master). */
|
|
3428
|
-
media: string;
|
|
3429
3553
|
stem: string;
|
|
3430
|
-
language?: string;
|
|
3431
|
-
numSpeakers?: number;
|
|
3432
3554
|
pollIntervalMs?: number;
|
|
3433
3555
|
verbose?: boolean;
|
|
3434
3556
|
}
|
|
3435
3557
|
interface Transcribe2Result {
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
durationS: number;
|
|
3558
|
+
/** null when the artifacts already existed server-side (pull only). */
|
|
3559
|
+
runId: string | null;
|
|
3439
3560
|
pulled: FilesPullResult;
|
|
3440
3561
|
}
|
|
3441
|
-
/** The artifact set `transcribe` pulls
|
|
3562
|
+
/** The artifact set `transcribe` pulls (probe.json rides along since v3 —
|
|
3563
|
+
* it feeds job.json duration_s after an ingest re-run). */
|
|
3442
3564
|
declare function transcribeArtifactSet(stem: string): string[];
|
|
3443
|
-
/** Extract mono 16k pcm_s16le WAV + enforce the A/V clock guard. Returns the
|
|
3444
|
-
* WAV bytes and the decoded audio duration. */
|
|
3445
|
-
declare function extractGuardedWav(media: string): Promise<{
|
|
3446
|
-
bytes: Buffer;
|
|
3447
|
-
durationS: number;
|
|
3448
|
-
}>;
|
|
3449
3565
|
declare function transcribeCloud(client: CloudClient, jobDir: string, opts: Transcribe2Options): Promise<Transcribe2Result>;
|
|
3450
3566
|
|
|
3451
|
-
interface SilenceInterval {
|
|
3452
|
-
start: number;
|
|
3453
|
-
end: number;
|
|
3454
|
-
}
|
|
3455
|
-
interface DesilenceOptions {
|
|
3456
|
-
/** Silence threshold in dB (ffmpeg silencedetect `noise`). Default -39. */
|
|
3457
|
-
noiseDb: number;
|
|
3458
|
-
/** Minimum silence length (s) to act on — also silencedetect `d`. Default 0.30. */
|
|
3459
|
-
minSilence: number;
|
|
3460
|
-
/** Total air (s) to leave where an internal silence is cut. Default 0.13. */
|
|
3461
|
-
targetGap: number;
|
|
3462
|
-
/** Air kept BEFORE speech resumes at a cut / leading edge. Default 0.05. */
|
|
3463
|
-
leadKeep: number;
|
|
3464
|
-
/** Air kept AFTER speech ends at a cut / trailing edge. Default 0.08. */
|
|
3465
|
-
trailKeep: number;
|
|
3466
|
-
/** Drop any resulting sub-range shorter than this (s). Default 0.10. */
|
|
3467
|
-
minSegment: number;
|
|
3468
|
-
}
|
|
3469
|
-
declare const DEFAULT_DESILENCE: DesilenceOptions;
|
|
3470
|
-
/** ffmpeg argv for an amplitude silence scan. No video, null muxer; the report
|
|
3471
|
-
* lands on stderr. Pure (no execution). */
|
|
3472
|
-
declare function silenceDetectArgs(source: string, noiseDb: number, minSilenceS: number): string[];
|
|
3473
|
-
/** Parse `silence_start:` / `silence_end:` pairs out of ffmpeg stderr.
|
|
3474
|
-
* A dangling silence_start (silence runs to EOF) is closed at `sourceDurationS`
|
|
3475
|
-
* when provided (>0), otherwise dropped. */
|
|
3476
|
-
declare function parseSilenceDetect(stderr: string, sourceDurationS?: number): SilenceInterval[];
|
|
3477
|
-
/** Run silencedetect on a source and return the silence intervals. */
|
|
3478
|
-
declare function detectSilences(source: string, noiseDb: number, minSilenceS: number, sourceDurationS: number): Promise<SilenceInterval[]>;
|
|
3479
|
-
|
|
3480
3567
|
declare function timelineJsonPath2(jobDir: string): string;
|
|
3481
3568
|
declare function planPath2(jobDir: string): string;
|
|
3482
3569
|
declare function diagnosticsPath2(jobDir: string): string;
|
|
@@ -3494,8 +3581,6 @@ declare function validateLocal(doc: TimelineV2): {
|
|
|
3494
3581
|
errors: Diagnostic[];
|
|
3495
3582
|
warnings: Diagnostic[];
|
|
3496
3583
|
};
|
|
3497
|
-
/** Commodity local silence detection for every timeline source. */
|
|
3498
|
-
declare function detectSilencesForDoc(jobDir: string, doc: TimelineV2): Promise<Record<string, SilenceInterval[]>>;
|
|
3499
3584
|
/** Stat pass over asset refs so the server compile can emit asset-missing. */
|
|
3500
3585
|
declare function statAssetsForDoc(jobDir: string, doc: TimelineV2): Record<string, boolean>;
|
|
3501
3586
|
interface CompileRemoteResult {
|
|
@@ -3505,8 +3590,9 @@ interface CompileRemoteResult {
|
|
|
3505
3590
|
diagnosticsPath: string;
|
|
3506
3591
|
response: Record<string, unknown>;
|
|
3507
3592
|
}
|
|
3508
|
-
/** POST the raw timeline (+ local
|
|
3509
|
-
*
|
|
3593
|
+
/** POST the raw timeline (+ local asset stats) to the server compile and
|
|
3594
|
+
* write plan/diagnostics/edl exactly as returned (verbatim JSON). The server
|
|
3595
|
+
* sources silences from the VFS — no silences_by_source from the client. */
|
|
3510
3596
|
declare function compileRemote(client: CloudClient, jobDir: string, loaded: LoadedTimeline2): Promise<CompileRemoteResult>;
|
|
3511
3597
|
|
|
3512
3598
|
interface Verify2Options {
|
|
@@ -3523,87 +3609,37 @@ interface Verify2Result {
|
|
|
3523
3609
|
}
|
|
3524
3610
|
declare function verifyCloud(client: CloudClient, jobDir: string, opts?: Verify2Options): Promise<Verify2Result>;
|
|
3525
3611
|
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
counts: Record<string, unknown>;
|
|
3538
|
-
media: Array<{
|
|
3539
|
-
src: string;
|
|
3540
|
-
role: string;
|
|
3541
|
-
}>;
|
|
3542
|
-
out?: string;
|
|
3543
|
-
renderCmd: string[];
|
|
3544
|
-
rendered: boolean;
|
|
3545
|
-
renderExit?: number;
|
|
3612
|
+
/** QA output dir: <job>/qa when a job dir is given, else ./qa in cwd. */
|
|
3613
|
+
declare function qaDir(jobDir?: string): string;
|
|
3614
|
+
declare function framesPngPath(dir: string, start: number, end: number, suffix?: string): string;
|
|
3615
|
+
declare function waveformPngPath(dir: string, start: number, end: number): string;
|
|
3616
|
+
declare function waveformWordsPath(dir: string, start: number, end: number): string;
|
|
3617
|
+
/** The slice of a plan segment the QA math needs. */
|
|
3618
|
+
interface QaPlanSegment {
|
|
3619
|
+
srcStart: number;
|
|
3620
|
+
srcEnd: number;
|
|
3621
|
+
outStart: number;
|
|
3622
|
+
outEnd: number;
|
|
3546
3623
|
}
|
|
3547
|
-
/**
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
* -
|
|
3551
|
-
|
|
3552
|
-
declare function buildMediaEntry(jobDir: string, compDir: string, entry: {
|
|
3553
|
-
src: string;
|
|
3554
|
-
role: string;
|
|
3555
|
-
}, opts: {
|
|
3556
|
-
proxyCrf: number;
|
|
3557
|
-
}): Promise<string>;
|
|
3558
|
-
declare function composeCloud(client: CloudClient, jobDir: string, opts?: Compose2Options): Promise<Compose2Result>;
|
|
3559
|
-
|
|
3560
|
-
interface QaWindow {
|
|
3561
|
-
video: string;
|
|
3624
|
+
/** Read the segments array out of <job>/resolved/plan.json. */
|
|
3625
|
+
declare function readPlanSegments(jobDir: string): QaPlanSegment[];
|
|
3626
|
+
/** A source-time QA window; `suffix` distinguishes multi-window requests
|
|
3627
|
+
* ("-a"/"-b"/… — empty for a single window). */
|
|
3628
|
+
interface QaSourceWindow {
|
|
3562
3629
|
start: number;
|
|
3563
3630
|
end: number;
|
|
3564
|
-
|
|
3565
|
-
}
|
|
3566
|
-
/** ffmpeg argv for a filmstrip: `frames` evenly spaced frames of the window,
|
|
3567
|
-
* tiled `cols` per row, each frame scaled to `frameWidth`. Pure. */
|
|
3568
|
-
declare function qaFramesArgs(win: QaWindow, opts?: {
|
|
3569
|
-
frames?: number;
|
|
3570
|
-
cols?: number;
|
|
3571
|
-
frameWidth?: number;
|
|
3572
|
-
}): string[];
|
|
3573
|
-
/** ffmpeg argv for a waveform PNG of the window (showwavespic). Pure. */
|
|
3574
|
-
declare function qaWaveformArgs(win: QaWindow, opts?: {
|
|
3575
|
-
width?: number;
|
|
3576
|
-
height?: number;
|
|
3577
|
-
}): string[];
|
|
3578
|
-
interface QaWord {
|
|
3579
|
-
t: number;
|
|
3580
|
-
end: number;
|
|
3581
|
-
text: string;
|
|
3631
|
+
suffix: string;
|
|
3582
3632
|
}
|
|
3583
|
-
/**
|
|
3584
|
-
*
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
}
|
|
3594
|
-
declare function qaFramesLocal(jobDir: string, args: {
|
|
3595
|
-
video: string;
|
|
3596
|
-
start: number;
|
|
3597
|
-
end: number;
|
|
3598
|
-
frames?: number;
|
|
3599
|
-
cols?: number;
|
|
3600
|
-
}): Promise<QaLocalResult>;
|
|
3601
|
-
declare function qaWaveformLocal(jobDir: string, args: {
|
|
3602
|
-
video: string;
|
|
3603
|
-
start: number;
|
|
3604
|
-
end: number;
|
|
3605
|
-
stem?: string;
|
|
3606
|
-
}): Promise<QaLocalResult>;
|
|
3633
|
+
/** Source-time windows around join `i` (1-based: the boundary between plan
|
|
3634
|
+
* segments i and i+1): the last `spanS` seconds of segment i (tail, "-a")
|
|
3635
|
+
* and the first `spanS` seconds of segment i+1 (head, "-b"), each clamped
|
|
3636
|
+
* to its segment. */
|
|
3637
|
+
declare function joinSourceWindows(segments: QaPlanSegment[], joinIndex: number, spanS: number): QaSourceWindow[];
|
|
3638
|
+
/** Map an OUTPUT-time window onto source-time windows: intersect
|
|
3639
|
+
* [outStart, outEnd] with each segment's output range and shift into source
|
|
3640
|
+
* time (srcT = seg.srcStart + (outT - seg.outStart)). One window per
|
|
3641
|
+
* overlapped segment, suffixed -a/-b/… when the window crosses a join. */
|
|
3642
|
+
declare function outWindowToSourceWindows(segments: QaPlanSegment[], outStart: number, outEnd: number): QaSourceWindow[];
|
|
3607
3643
|
|
|
3608
3644
|
declare function reviewDir2(jobDir: string): string;
|
|
3609
3645
|
declare function roundJsonPath2(jobDir: string): string;
|
|
@@ -3707,4 +3743,4 @@ declare function loadPublicConfigEnv(env?: NodeJS.ProcessEnv): void;
|
|
|
3707
3743
|
/** Write/update ONE managed key in the config file, preserving other lines. */
|
|
3708
3744
|
declare function savePublicConfigKey(key: ManagedKey, value: string): string;
|
|
3709
3745
|
|
|
3710
|
-
export { type Anchor, type AssetCreate, type AudioItem, CAPABILITIES, CAPTION_STYLE_DEFAULTS, type Capability, type CapabilityStatus, type CaptionOverride, type CaptionPreset, type CaptionStyle, type ChangeOutcome2, type ClientOptions, CloudClient, type CloudFlags, CloudHttpError, type CompileRemoteResult, type
|
|
3746
|
+
export { type Anchor, type AssetCreate, type AudioItem, CAPABILITIES, CAPTION_STYLE_DEFAULTS, type Capability, type CapabilityStatus, type CaptionOverride, type CaptionPreset, type CaptionStyle, type ChangeOutcome2, type ClientOptions, CloudClient, type CloudFlags, CloudHttpError, type CompileRemoteResult, type CutBoundary, type CutRange, DEFAULT_DOWNLOAD_TIMEOUT_MS, DEFAULT_TIMEOUT_MS, type Diagnostic, type Diagnostics, type Edl, type EdlRange, type FeatureKey, type FetchLike, type FileSource, type FilesPullResult, type GradeSetting, INLINE_MAX_BYTES, type InitOptions, type InitResult, type InstallResult, type JobFile, type LoadedTimeline2, MAX_POLL_MS, MAX_RUN_POLL_MS, MULTIPART_THRESHOLD_BYTES, type MultipartOptions, type MultipartSource, type OutputAnchor, type OverlayFx, type OverlayItem, type ParseResult, type PhraseMatch, type PhraseSuggestion, type PollOptions, type Provenance, type PullReview2Result, type PulledFile, type Push2Failure, type PushComplete2Success, type PushTimeline2Success, type PushedFile, type QaPlanSegment, type QaSourceWindow, RELAY_DIRECT_ATTEMPTS, RELAY_SUBCHUNK_BYTES, REVIEW_STAGES2, type RenderCreate, type RenderMode, type RenderState, type RenderStatus, type ResolveOptions, type ResolveOutcome, type ResolvedConfig, type ReviewChange, type ReviewRound, type ReviewSession, type RunEvent, type RunPollOptions, type RunState, type RunStatus, type ScribeTranscript, type ScribeWord, type SourceAnchor, type StreamWord, type TimelineSettings, type TimelineSource, type TimelineV2, type Transcribe2Options, type Transcribe2Result, type Verify2Options, type Verify2Result, type VerifyJoinFinding, type VerifyResult, type VfsFileContent, type VfsFileEntry, type VfsPresign, type WordsAnchor, type ZoomItem, assertRunCompleted, assetContentType2, assetsUrl, bundledSkillDir, bytesSource, checkCapabilities, collectPlanAssetRefs2, compileRemote, compileUrl, composeUrl, defaultRenderOut, defaultSkillTarget, diagnosticsPath2, downloadTo, emptyDiagnostics, filesUrl, findPhrase, formatRunEvent, framesPngPath, fuzzySuggestions, ingestArtifactSet, ingestUrl, initCloudJob, installSkill, instructionPath2, isTerminalRunStatus, isTerminalStatus, jobJsonPath, joinSourceWindows, loadPublicConfigEnv, loadTimeline2, meUrl, multipartRelayUrl, multipartUrl, normalizePhrase, normalizeToken, openFileSource, outWindowToSourceWindows, parseFileContent, parseFileList, parseFilePresign, parseRenderCreate, parseRenderState, parseRunState, parseTimeline, planPath2, pollRender, pollRun, projectVideosUrl, projectsUrl, publicConfigDir, publicConfigEnvPath, pullFiles, pullReview2, pushComplete2, pushFiles, pushStage2, pushTimeline2, qaDir, readJobFile, readOutcomesFile2, readPlanSegments, readProbeDuration, renderUrl, rendersUrl, resolveApiBase, resolveApiKey, resolveConfig, resolvePhrase, resolveRunId2, resolveUrl, resolveVideoId, reviewDir2, reviewUrl, roundJsonPath2, runUrl, sameSha, sanitizeStem, savePublicConfigKey, sha256Hex, shouldMultipart, statAssetsForDoc, stripTrailingSlash, syncAssets2, timelineJsonPath2, timelineV2Schema, toVfsPath, transcribeArtifactSet, transcribeCloud, transcribeUrl, uploadMultipart, uploadVfsBytes, uploadVfsPayload, usesFromDoc, validateLocal, validateTimeline, verifyCloud, verifyUrl, vfsContentType, vfsLocalPath, videoIdFromJob, waveformPngPath, waveformWordsPath, wordStream, writeJobFile };
|
package/dist/index.js
CHANGED
|
@@ -4,51 +4,55 @@ import {
|
|
|
4
4
|
CAPTION_STYLE_DEFAULTS,
|
|
5
5
|
CloudClient,
|
|
6
6
|
CloudHttpError,
|
|
7
|
-
DEFAULT_DESILENCE,
|
|
8
7
|
DEFAULT_DOWNLOAD_TIMEOUT_MS,
|
|
9
8
|
DEFAULT_TIMEOUT_MS,
|
|
10
9
|
INLINE_MAX_BYTES,
|
|
11
10
|
MAX_POLL_MS,
|
|
12
11
|
MAX_RUN_POLL_MS,
|
|
12
|
+
MULTIPART_THRESHOLD_BYTES,
|
|
13
|
+
RELAY_DIRECT_ATTEMPTS,
|
|
14
|
+
RELAY_SUBCHUNK_BYTES,
|
|
13
15
|
REVIEW_STAGES2,
|
|
14
16
|
assertRunCompleted,
|
|
15
17
|
assetContentType2,
|
|
16
18
|
assetsUrl,
|
|
17
|
-
buildMediaEntry,
|
|
18
19
|
bundledSkillDir,
|
|
20
|
+
bytesSource,
|
|
19
21
|
checkCapabilities,
|
|
20
22
|
collectPlanAssetRefs2,
|
|
21
23
|
compileRemote,
|
|
22
24
|
compileUrl,
|
|
23
|
-
composeCloud,
|
|
24
25
|
composeUrl,
|
|
25
26
|
defaultRenderOut,
|
|
26
27
|
defaultSkillTarget,
|
|
27
|
-
detectSilences,
|
|
28
|
-
detectSilencesForDoc,
|
|
29
28
|
diagnosticsPath2,
|
|
30
29
|
downloadTo,
|
|
31
30
|
emptyDiagnostics,
|
|
32
|
-
extractGuardedWav,
|
|
33
31
|
filesUrl,
|
|
34
|
-
findLocalTranscript,
|
|
35
32
|
formatRunEvent,
|
|
33
|
+
framesPngPath,
|
|
34
|
+
ingestArtifactSet,
|
|
35
|
+
ingestUrl,
|
|
36
36
|
initCloudJob,
|
|
37
37
|
installSkill,
|
|
38
38
|
instructionPath2,
|
|
39
39
|
isTerminalRunStatus,
|
|
40
40
|
isTerminalStatus,
|
|
41
41
|
jobJsonPath,
|
|
42
|
+
joinSourceWindows,
|
|
42
43
|
loadPublicConfigEnv,
|
|
43
44
|
loadTimeline2,
|
|
44
45
|
meUrl,
|
|
46
|
+
multipartRelayUrl,
|
|
47
|
+
multipartUrl,
|
|
48
|
+
openFileSource,
|
|
49
|
+
outWindowToSourceWindows,
|
|
45
50
|
parseFileContent,
|
|
46
51
|
parseFileList,
|
|
47
52
|
parseFilePresign,
|
|
48
53
|
parseRenderCreate,
|
|
49
54
|
parseRenderState,
|
|
50
55
|
parseRunState,
|
|
51
|
-
parseSilenceDetect,
|
|
52
56
|
parseTimeline,
|
|
53
57
|
planPath2,
|
|
54
58
|
pollRender,
|
|
@@ -63,13 +67,11 @@ import {
|
|
|
63
67
|
pushFiles,
|
|
64
68
|
pushStage2,
|
|
65
69
|
pushTimeline2,
|
|
66
|
-
|
|
67
|
-
qaFramesLocal,
|
|
68
|
-
qaWaveformArgs,
|
|
69
|
-
qaWaveformLocal,
|
|
70
|
-
qaWordsForWindow,
|
|
70
|
+
qaDir,
|
|
71
71
|
readJobFile,
|
|
72
72
|
readOutcomesFile2,
|
|
73
|
+
readPlanSegments,
|
|
74
|
+
readProbeDuration,
|
|
73
75
|
renderUrl,
|
|
74
76
|
rendersUrl,
|
|
75
77
|
resolveApiBase,
|
|
@@ -83,9 +85,10 @@ import {
|
|
|
83
85
|
roundJsonPath2,
|
|
84
86
|
runUrl,
|
|
85
87
|
sameSha,
|
|
88
|
+
sanitizeStem,
|
|
86
89
|
savePublicConfigKey,
|
|
87
90
|
sha256Hex,
|
|
88
|
-
|
|
91
|
+
shouldMultipart,
|
|
89
92
|
statAssetsForDoc,
|
|
90
93
|
stripTrailingSlash,
|
|
91
94
|
syncAssets2,
|
|
@@ -95,7 +98,9 @@ import {
|
|
|
95
98
|
transcribeArtifactSet,
|
|
96
99
|
transcribeCloud,
|
|
97
100
|
transcribeUrl,
|
|
101
|
+
uploadMultipart,
|
|
98
102
|
uploadVfsBytes,
|
|
103
|
+
uploadVfsPayload,
|
|
99
104
|
usesFromDoc,
|
|
100
105
|
validateLocal,
|
|
101
106
|
validateTimeline,
|
|
@@ -104,8 +109,10 @@ import {
|
|
|
104
109
|
vfsContentType,
|
|
105
110
|
vfsLocalPath,
|
|
106
111
|
videoIdFromJob,
|
|
112
|
+
waveformPngPath,
|
|
113
|
+
waveformWordsPath,
|
|
107
114
|
writeJobFile
|
|
108
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-W4IIL2T2.js";
|
|
109
116
|
|
|
110
117
|
// src/timeline-v2/anchors.ts
|
|
111
118
|
function normalizeToken(text) {
|
|
@@ -227,55 +234,59 @@ export {
|
|
|
227
234
|
CAPTION_STYLE_DEFAULTS,
|
|
228
235
|
CloudClient,
|
|
229
236
|
CloudHttpError,
|
|
230
|
-
DEFAULT_DESILENCE,
|
|
231
237
|
DEFAULT_DOWNLOAD_TIMEOUT_MS,
|
|
232
238
|
DEFAULT_TIMEOUT_MS,
|
|
233
239
|
INLINE_MAX_BYTES,
|
|
234
240
|
MAX_POLL_MS,
|
|
235
241
|
MAX_RUN_POLL_MS,
|
|
242
|
+
MULTIPART_THRESHOLD_BYTES,
|
|
243
|
+
RELAY_DIRECT_ATTEMPTS,
|
|
244
|
+
RELAY_SUBCHUNK_BYTES,
|
|
236
245
|
REVIEW_STAGES2,
|
|
237
246
|
assertRunCompleted,
|
|
238
247
|
assetContentType2,
|
|
239
248
|
assetsUrl,
|
|
240
|
-
buildMediaEntry,
|
|
241
249
|
bundledSkillDir,
|
|
250
|
+
bytesSource,
|
|
242
251
|
checkCapabilities,
|
|
243
252
|
collectPlanAssetRefs2,
|
|
244
253
|
compileRemote,
|
|
245
254
|
compileUrl,
|
|
246
|
-
composeCloud,
|
|
247
255
|
composeUrl,
|
|
248
256
|
defaultRenderOut,
|
|
249
257
|
defaultSkillTarget,
|
|
250
|
-
detectSilences,
|
|
251
|
-
detectSilencesForDoc,
|
|
252
258
|
diagnosticsPath2,
|
|
253
259
|
downloadTo,
|
|
254
260
|
emptyDiagnostics,
|
|
255
|
-
extractGuardedWav,
|
|
256
261
|
filesUrl,
|
|
257
|
-
findLocalTranscript,
|
|
258
262
|
findPhrase,
|
|
259
263
|
formatRunEvent,
|
|
264
|
+
framesPngPath,
|
|
260
265
|
fuzzySuggestions,
|
|
266
|
+
ingestArtifactSet,
|
|
267
|
+
ingestUrl,
|
|
261
268
|
initCloudJob,
|
|
262
269
|
installSkill,
|
|
263
270
|
instructionPath2,
|
|
264
271
|
isTerminalRunStatus,
|
|
265
272
|
isTerminalStatus,
|
|
266
273
|
jobJsonPath,
|
|
274
|
+
joinSourceWindows,
|
|
267
275
|
loadPublicConfigEnv,
|
|
268
276
|
loadTimeline2,
|
|
269
277
|
meUrl,
|
|
278
|
+
multipartRelayUrl,
|
|
279
|
+
multipartUrl,
|
|
270
280
|
normalizePhrase,
|
|
271
281
|
normalizeToken,
|
|
282
|
+
openFileSource,
|
|
283
|
+
outWindowToSourceWindows,
|
|
272
284
|
parseFileContent,
|
|
273
285
|
parseFileList,
|
|
274
286
|
parseFilePresign,
|
|
275
287
|
parseRenderCreate,
|
|
276
288
|
parseRenderState,
|
|
277
289
|
parseRunState,
|
|
278
|
-
parseSilenceDetect,
|
|
279
290
|
parseTimeline,
|
|
280
291
|
planPath2,
|
|
281
292
|
pollRender,
|
|
@@ -290,13 +301,11 @@ export {
|
|
|
290
301
|
pushFiles,
|
|
291
302
|
pushStage2,
|
|
292
303
|
pushTimeline2,
|
|
293
|
-
|
|
294
|
-
qaFramesLocal,
|
|
295
|
-
qaWaveformArgs,
|
|
296
|
-
qaWaveformLocal,
|
|
297
|
-
qaWordsForWindow,
|
|
304
|
+
qaDir,
|
|
298
305
|
readJobFile,
|
|
299
306
|
readOutcomesFile2,
|
|
307
|
+
readPlanSegments,
|
|
308
|
+
readProbeDuration,
|
|
300
309
|
renderUrl,
|
|
301
310
|
rendersUrl,
|
|
302
311
|
resolveApiBase,
|
|
@@ -311,9 +320,10 @@ export {
|
|
|
311
320
|
roundJsonPath2,
|
|
312
321
|
runUrl,
|
|
313
322
|
sameSha,
|
|
323
|
+
sanitizeStem,
|
|
314
324
|
savePublicConfigKey,
|
|
315
325
|
sha256Hex,
|
|
316
|
-
|
|
326
|
+
shouldMultipart,
|
|
317
327
|
statAssetsForDoc,
|
|
318
328
|
stripTrailingSlash,
|
|
319
329
|
syncAssets2,
|
|
@@ -323,7 +333,9 @@ export {
|
|
|
323
333
|
transcribeArtifactSet,
|
|
324
334
|
transcribeCloud,
|
|
325
335
|
transcribeUrl,
|
|
336
|
+
uploadMultipart,
|
|
326
337
|
uploadVfsBytes,
|
|
338
|
+
uploadVfsPayload,
|
|
327
339
|
usesFromDoc,
|
|
328
340
|
validateLocal,
|
|
329
341
|
validateTimeline,
|
|
@@ -332,6 +344,8 @@ export {
|
|
|
332
344
|
vfsContentType,
|
|
333
345
|
vfsLocalPath,
|
|
334
346
|
videoIdFromJob,
|
|
347
|
+
waveformPngPath,
|
|
348
|
+
waveformWordsPath,
|
|
335
349
|
wordStream,
|
|
336
350
|
writeJobFile
|
|
337
351
|
};
|