Files
frames/packages/aws-lambda/src/index.ts
T
zooqueen 375d1e2816 packages: publish as @hanzo/frame and talk to api.hanzo.ai
The npm scope becomes @hanzo: the CLI is @hanzo/frame, every library is
@hanzo/frame-<name>. Versions go to 0.7.82.

Credentials come from Hanzo IAM. `hanzo login` runs the IAM device flow and
writes ~/.hanzo/credentials.json; unattended runs read HANZO_API_KEY delivered
from Hanzo KMS. src/api.ts is the one place that knows the base URL and the
credential, replacing the OAuth client, PKCE flow, loopback server, token
store, and ~/.heygen credential file. `frames auth` keeps only `status`, since
this CLI no longer issues credentials.

Publish and feedback post to api.hanzo.ai/v1 without the HeyGen routing header.
The HeyGen-hosted `frames cloud` render target is gone; local, AWS Lambda, and
Google Cloud Run remain. Voice resolves to Hanzo speech (POST /v1/audio/speech)
before local Kokoro; music resolves to local MusicGen.

No analytics project is configured, so the CLI and studio send no events —
they previously reported to HeyGen's. Drops the HeyGen wordmark from the studio
header and the HeyGen promo render fixture with its brand assets and fonts.
2026-08-13 17:21:08 -07:00

95 lines
3.1 KiB
TypeScript

/**
* `@hanzo/frame-aws-lambda` — Lambda adapter for the Frames
* distributed render pipeline.
*
* Two surfaces, one package:
*
* - **Server-side handler.** `handler`, the Step Functions event/result
* types, Chrome resolution, and S3 transport. These power the Lambda
* function bundled into `dist/handler.zip`.
* - **Client-side SDK.** `renderToLambda`, `getRenderProgress`,
* `deploySite`, `validateDistributedRenderConfig`, and `computeRenderCost`.
* Adopters call these from their Node process (CI scripts, CLIs, CDK
* pipelines) to drive a deployed stack without writing AWS-SDK
* boilerplate.
*
* The CDK L2 construct lives at the `./cdk` subpath export so SDK-only
* consumers don't pull `aws-cdk-lib` into their runtime graph:
*
* import { HyperframesRenderStack } from "@hanzo/frame-aws-lambda/cdk";
*
* The package is NOT a dependency of `@hanzo/frame-producer`; consumers
* install it separately.
*/
export { handler, type HandlerDeps, unwrapEvent } from "./handler.js";
export {
type AssembleEvent,
type AssembleLambdaResult,
type LambdaAction,
type LambdaEvent,
type LambdaPlanProtocol,
type LambdaResult,
type PlanEvent,
type PlanLambdaResult,
type PlanV1Event,
type PlanV1LambdaResult,
type PlanV2Event,
type PlanV2LambdaResult,
type RenderChunkEvent,
type RenderChunkLambdaResult,
type RenderChunkV1Event,
type RenderChunkV2Event,
type AssembleV1Event,
type AssembleV2Event,
type SerializableDistributedRenderConfig,
} from "./events.js";
// `_setSparticuzChromiumForTests` is intentionally NOT re-exported from
// the package barrel — it's a test-only DI seam. Test files import it
// directly from `./chromium.js`.
export {
ChromeBinaryUnavailableError,
type ChromeSource,
resolveChromeArgs,
resolveChromeExecutablePath,
resolveChromeSource,
} from "./chromium.js";
export {
downloadS3ObjectToFile,
downloadS3ObjectToFileVerified,
formatS3Uri,
parseS3Uri,
type S3Location,
tarDirectory,
untarDirectory,
uploadContentAddressedFileToS3,
uploadFileToS3,
} from "./s3Transport.js";
export {
S3PlanV2ArtifactPublisher,
type S3PlanV2ArtifactPublisherOptions,
} from "./s3PlanV2Publisher.js";
// ── Client-side SDK ─────────────────────────────────────────────────────────
export { deploySite, type DeploySiteOptions, type SiteHandle } from "./sdk/deploySite.js";
export {
renderToLambda,
type RenderHandle,
type RenderToLambdaOptions,
} from "./sdk/renderToLambda.js";
export {
getRenderProgress,
type GetRenderProgressOptions,
type RenderError,
type RenderProgress,
type RenderStatus,
} from "./sdk/getRenderProgress.js";
export {
type BilledLambdaInvocation,
computeRenderCost,
type RenderCost,
} from "./sdk/costAccounting.js";
export { InvalidConfigError, validateDistributedRenderConfig } from "./sdk/validateConfig.js";
// The CDK construct is exported separately via the `./cdk` subpath so
// SDK-only consumers don't pay the `aws-cdk-lib` import cost.