import { type AnimationFromVideoJobResult, type LocomotionState, type VideoToMotionModel } from '@bitmagic/asset-core'; import type { Environment } from '../config/environments.js'; import { type ApiDeps } from '../http/client.js'; import type { ProjectContext } from '../project/context.js'; /** Matches asset-forger's cap; refused here so a 300 MB screen recording never leaves the machine. */ export declare const MAX_VIDEO_BYTES: number; export declare const JOBS_PATH = "/api/cli/v1/assets/animation-from-video/jobs"; export interface AnimationFromVideoRun { /** Local file to upload. Omitted when the clip is already at a URL. */ videoPath?: string; /** * Already-uploaded source URL: the sidecar's trim-analysis step uploads * first, `--video ` is given one, and the prompt lane generates one. * When set, the file at videoPath is not read or uploaded again. */ videoUrl?: string; /** Asset display name; defaults to the file's stem. */ name?: string; model?: VideoToMotionModel; loop?: boolean; locomotionState?: LocomotionState; /** Cut walk-to-the-camera frames off both ends (pose analysis in the Forger). */ autoTrim?: boolean; /** * Explicit trim window (seconds into the source clip), both or neither; the * window the creator confirmed on the dev view's trim bar. Takes precedence * over autoTrim server-side. */ trimStartSeconds?: number; trimEndSeconds?: number; assetId?: string; } export interface AnimationFromVideoDeps extends ApiDeps { log: (message: string) => void; sleep: (ms: number) => Promise; } export interface AnimationFromVideoInstallResult { motionId: string; animationUrl: string; durationSeconds: number; trimmedStartSeconds?: number; trimmedEndSeconds?: number; locomotionState?: LocomotionState; sparksCharged: number; patchesApplied: number; } interface JobStatus { status: 'pending' | 'running' | 'succeeded' | 'failed'; result?: AnimationFromVideoJobResult; error?: { kind?: string; message?: string; } | string; } export declare function isLocomotionState(value: unknown): value is LocomotionState; export declare function isVideoToMotionModel(value: unknown): value is VideoToMotionModel; /** The creator-facing sentence for a failed job — `error.kind` decides it, never the raw JSON. */ export declare function describeJobFailure(error: JobStatus['error']): string; /** * The clip's display name when `--name` is absent. A local file names itself * from its stem; a URL-sourced clip has no meaningful stem (the uploaded object * is `motion--…`), so it falls back to a plain label. */ export declare function defaultName(videoPath?: string): string; export declare function generateAndInstallAnimationFromVideo(options: { context: ProjectContext; environment: Environment; token: string; run: AnimationFromVideoRun; deps: AnimationFromVideoDeps; }): Promise; export {};