/** * AWS Lambda handler for HyperFrames distributed rendering. * * One Lambda function, three roles. Step Functions dispatches by setting * `event.Action`; the handler unwraps Map-state envelopes, primes the * Lambda environment (Chrome path, ffmpeg path, tmpdir), and forwards to * the matching OSS primitive from `@hyperframes/producer/distributed`. * * Everything heavy — capture, encode, audio mix — happens inside the OSS * primitives. The handler is thin glue: parse event → S3 download → call * primitive → S3 upload → return small JSON result. */ import { S3Client } from "@aws-sdk/client-s3"; import { assemble, type ChunkRenderer, plan, planV2WithPublisher } from "@hyperframes/producer/distributed"; import type { AssembleEvent, LambdaEvent, LambdaResult, PlanEvent, RenderChunkEvent } from "./events.js"; /** * Optional injection points used by the handler's unit tests. Production * callers leave these unset; the real OSS primitives are used. Tests * inject `s3` and `primitives` directly rather than mutating module * state — the dependency-injection seam is sufficient and avoids a * second leak point for cross-test contamination. */ export interface HandlerDeps { s3?: S3Client; primitives?: { plan: typeof plan; planV2WithPublisher?: typeof planV2WithPublisher; renderChunk: ChunkRenderer; assemble: typeof assemble; }; /** Override the per-invocation `/tmp` workdir root (defaults to Lambda's `/tmp`). */ tmpRoot?: string; /** Skip Chrome resolution (used by handler dispatch tests that mock renderChunk). */ skipChromeResolution?: boolean; } /** * Lambda entry. Step Functions sometimes wraps the event in * `{ Payload: ... }` or `{ Input: ... }` depending on the state machine * shape; unwrap until we hit a discriminated event. */ export declare function handler(event: LambdaEvent, deps?: HandlerDeps): Promise; export declare function unwrapEvent(event: LambdaEvent): PlanEvent | RenderChunkEvent | AssembleEvent; //# sourceMappingURL=handler.d.ts.map