/** * Take creation — turn a render invocation into a VideoProject the web app can * show, and hand its conversation id down to the skill. * * Why this exists at all: ab-web derives a video's project from * `file.conversation_id → media_video_project → media_project`. A render whose * upload carries no conversation id is stored correctly but belongs to nothing, * so it shows up only in the raw asset list. The cloud agent injects * CONVERSATION_ID for its own runs; locally, nobody did — that is the bug this * module fixes. * * Idempotency lives on the server (`/video-project/ensure` is get-or-create on * `(user_id, client_session_key)`), not in a local state file: a pipeline is N * separate CLI processes, sometimes concurrent, and a local cache would have to * solve staleness and write races that a unique index solves for free. * * See docs/cli-project-binding-design.md §5. */ import { type HttpContext } from '../http.js'; export interface EnsuredTake { conversationId: string; videoProjectId: string; projectId: string; created: boolean; attempt: number; /** The grouping key this take was resolved under — reused as the trace's session id. */ sessionKey: string; /** Provenance label of the host we're running inside ('' when unknown). */ host: string; } /** * Look up the take for the current grouping key without creating anything. * * Used by pipeline skills that should attach to a take when one exists but must * never bring one into being: someone running `remixmate gen-image` on its own * isn't making a video, and an empty VideoProject is worse clutter than an * unattributed image. * * Deliberately does NOT resolve a project — resolveProject()'s last rung * lazily *creates* 「未分类」, which a read-only lookup has no business doing. */ export declare function findTake(ctx: HttpContext): Promise; /** * Resolve project + grouping key, then get-or-create the take. * Returns null when this invocation shouldn't own a take. */ export declare function ensureTake(ctx: HttpContext, opts: { jobId?: number; flagProjectId?: string; }): Promise;