AutoMovie API
    Preparing search index...

    Interface IAutoMovieCaptureFolder

    Opened capture storage with explicit ownership of file names and publication order.

    Before offering this port, the host confirms a requested comparison has a complete record, lists the destination, refuses every foreign entry before deleting any file, and removes only files owned by its previous record. Creating the destination directory may precede that refusal. The root may additionally contain the preserved rounds directory. Callers await each operation in order: claim before writing or external file creation, await all owned writes/removals, then close. A running record owns every claimed name, including names not yet written, so interruption permits a later capture to clean up. A complete record lists surviving successful writes and record.json itself; not every claim must produce a file. Failed cells can therefore coexist with a completed capture.

    This structural port intentionally admits host implementations other than the concrete AutoMovieCaptureFolder class. It removes that class's private-field admission restriction; it introduces no brand and cannot statically enforce sequencing or filesystem ownership. The render class implements the checks; other hosts must honor the same obligations.

    interface IAutoMovieCaptureFolder {
        compare: string | null;
        directory: string;
        earlier:
            | {
                budget: IAutoMovieCaptureBudget;
                comparison: IAutoMovieCaptureComparison
                | null;
                diagnostics?: IAudit;
                files: string[];
                layout: IAutoMovieCaptureLayout;
                request: [key: string, value: string][];
                revision: string;
                rows: IAutoMovieCaptureCellRecord[];
                section: Readonly<Record<string, unknown>> | null;
                sheets: string[];
                state: "complete";
                subject: {
                    durationSeconds: number;
                    fps: number;
                    height: number;
                    name: string;
                    width: number;
                };
                times: IAutoMovieCaptureTime[];
                video: IAutoMovieCaptureVideoSource
                | null;
                windows: IAutoMovieCaptureWindow[];
            }
            | null;
        reference: string
        | null;
        round: string | null;
        claim(names: readonly string[]): Promise<void>;
        close(
            record: Omit<
                Extract<IAutoMovieCaptureRecord, { state: "complete" }>,
                "files" | "state",
            >,
        ): Promise<
            {
                budget: IAutoMovieCaptureBudget;
                comparison: IAutoMovieCaptureComparison
                | null;
                diagnostics?: IAudit;
                files: string[];
                layout: IAutoMovieCaptureLayout;
                request: [key: string, value: string][];
                revision: string;
                rows: IAutoMovieCaptureCellRecord[];
                section: Readonly<Record<string, unknown>> | null;
                sheets: string[];
                state: "complete";
                subject: {
                    durationSeconds: number;
                    fps: number;
                    height: number;
                    name: string;
                    width: number;
                };
                times: IAutoMovieCaptureTime[];
                video: IAutoMovieCaptureVideoSource
                | null;
                windows: IAutoMovieCaptureWindow[];
            },
        >;
        read(name: string, earlier?: boolean): Promise<Uint8Array<ArrayBufferLike>>;
        remove(name: string): Promise<void>;
        write(
            name: string,
            data: string | Uint8Array<ArrayBufferLike>,
        ): Promise<void>;
    }

    Implemented by

    Index
    compare: string | null

    Compared round name, or null when no comparison was requested.

    directory: string

    Destination root or named round path without a trailing slash; path joining uses slash.

    earlier:
        | {
            budget: IAutoMovieCaptureBudget;
            comparison: IAutoMovieCaptureComparison
            | null;
            diagnostics?: IAudit;
            files: string[];
            layout: IAutoMovieCaptureLayout;
            request: [key: string, value: string][];
            revision: string;
            rows: IAutoMovieCaptureCellRecord[];
            section: Readonly<Record<string, unknown>> | null;
            sheets: string[];
            state: "complete";
            subject: {
                durationSeconds: number;
                fps: number;
                height: number;
                name: string;
                width: number;
            };
            times: IAutoMovieCaptureTime[];
            video: IAutoMovieCaptureVideoSource
            | null;
            windows: IAutoMovieCaptureWindow[];
        }
        | null

    Compared complete record read before destination cleanup; null exactly without comparison.

    Type Declaration

    • {
          budget: IAutoMovieCaptureBudget;
          comparison: IAutoMovieCaptureComparison | null;
          diagnostics?: IAudit;
          files: string[];
          layout: IAutoMovieCaptureLayout;
          request: [key: string, value: string][];
          revision: string;
          rows: IAutoMovieCaptureCellRecord[];
          section: Readonly<Record<string, unknown>> | null;
          sheets: string[];
          state: "complete";
          subject: {
              durationSeconds: number;
              fps: number;
              height: number;
              name: string;
              width: number;
          };
          times: IAutoMovieCaptureTime[];
          video: IAutoMovieCaptureVideoSource
          | null;
          windows: IAutoMovieCaptureWindow[];
      }
      • budget: IAutoMovieCaptureBudget

        The reader the sheets were laid out for.

      • comparison: IAutoMovieCaptureComparison | null

        The comparison against an earlier round, or null when none was asked.

      • Optionaldiagnostics?: IAudit

        Findings and coverage for captured samples that supplied diagnostics, without a full delivery schedule.

      • files: string[]

        Every file name the capture wrote in its folder, this record included.

      • layout: IAutoMovieCaptureLayout

        How the sheets were laid out.

      • request: [key: string, value: string][]

        The request as the named text values that repeat it.

      • revision: string

        Source revision the host drew from, such as a commit hash.

      • rows: IAutoMovieCaptureCellRecord[]

        One row per planned cell, in plan order.

      • section: Readonly<Record<string, unknown>> | null

        The subject owner's own section, such as a motion case's verdicts and metrics, as the host handed it over, or null when the owner has none.

      • sheets: string[]

        File names of the contact sheets, in order.

      • state: "complete"

        Written after the last file.

      • subject: {
            durationSeconds: number;
            fps: number;
            height: number;
            name: string;
            width: number;
        }

        The subject's name, clock and raster.

        • durationSeconds: number

          Running time in seconds.

        • fps: number

          Frames per second of its grid.

        • height: number

          Still height in pixels.

        • name: string

          Name of the subject.

        • width: number

          Still width in pixels.

      • times: IAutoMovieCaptureTime[]

        Every instant planned.

      • video: IAutoMovieCaptureVideoSource | null

        The video file the stills were taken from, with its detected cuts, or null for a drawn subject.

      • windows: IAutoMovieCaptureWindow[]

        The frames planned around each event and cut, with whether the subject's bounds cut them.

    • null
    reference: string | null

    Compared round directory, or null without comparison. Reads must not mutate it.

    round: string | null

    Kept round name, or null for replacement of the unnamed root capture.

    • Persist a running journal containing the union of claimed names before any corresponding file write. Reject separators, dot/dot-dot, and record.json. Empty input still publishes the current claims.

      Parameters

      • names: readonly string[]

      Returns Promise<void>

    • Publish complete metadata after all surviving owned writes finish. Derive state and files from successful writes rather than trusting the supplied metadata; return only after record.json is written. Caller must stop writing after publication; the concrete class has no closed-state guard.

      Parameters

      Returns Promise<
          {
              budget: IAutoMovieCaptureBudget;
              comparison: IAutoMovieCaptureComparison
              | null;
              diagnostics?: IAudit;
              files: string[];
              layout: IAutoMovieCaptureLayout;
              request: [key: string, value: string][];
              revision: string;
              rows: IAutoMovieCaptureCellRecord[];
              section: Readonly<Record<string, unknown>> | null;
              sheets: string[];
              state: "complete";
              subject: {
                  durationSeconds: number;
                  fps: number;
                  height: number;
                  name: string;
                  width: number;
              };
              times: IAutoMovieCaptureTime[];
              video: IAutoMovieCaptureVideoSource
              | null;
              windows: IAutoMovieCaptureWindow[];
          },
      >

    • Read a plain file name in this destination, or the compared directory when earlier is true. Default false; reject invalid names, unavailable comparison, and storage failures. The folder forwards the host's bytes without cloning; byte sharing follows the storage host's ownership policy.

      Parameters

      • name: string
      • Optionalearlier: boolean

      Returns Promise<Uint8Array<ArrayBufferLike>>

    • Replace one previously claimed file; text is UTF-8. Resolve only after storage succeeds, then remember it as written. Reject unclaimed names.

      Parameters

      • name: string
      • data: string | Uint8Array<ArrayBufferLike>

      Returns Promise<void>