export interface CliPublicCommandDescriptor { id: string; command: string; summary: string; docsDescriptionKey?: string; } export declare const API_KEY_TERM = "API key"; /** * Back-compat alias for internal callers that still import `CLI_KEY_TERM`. * Points at the same string as `API_KEY_TERM`. */ export declare const CLI_KEY_TERM = "API key"; /** HTTP header sent by the bundled CLI binary on every request. */ export declare const CLI_VERSION_HEADER = "x-autokap-cli-version"; export declare const MIN_CLI_VERSION_FOR_SIGNED_PROGRAMS = "1.0.9"; export declare const MIN_CLI_VERSION_FOR_DIRECT_ARTIFACT_UPLOADS = "1.5.0"; export declare const CLI_DEFAULT_INSTALL_COMMAND = "npx -y autokap@latest"; export declare const CLI_DEFAULT_INSTALLED_SETUP_COMMAND = "autokap login "; export declare const CLI_DEFAULT_SETUP_COMMAND = "npx -y autokap@latest login "; export declare const CLI_FALLBACK_PROGRAM_COMMAND = "autokap run --program "; export declare function buildCliRunCommand(presetId: string, options?: { local?: boolean; env?: string; dry?: boolean; regenerateTts?: boolean; }): string; export declare function buildCliInstalledSetupCommand(cliKey: string): string; export declare const CLI_PUBLIC_COMMANDS: CliPublicCommandDescriptor[]; /** * Per-clip metadata uploaded by the CLI alongside the raw MP4. The compositor * worker consumes these to drive the merge step in clipId order. Opcode * timings are retained for diagnostics and future compositor effects. */ export interface VideoClipMetadata { /** Variant that produced this raw clip. Required for video-demo matrices. */ variantId: string; lang: string; theme: 'light' | 'dark'; clipId: string; /** Storage path within the `videos` bucket (e.g. `raw/{video_id}/{clip_id}.mp4`). */ mp4StoragePath: string; /** * Live origin the clip was captured against (`artifact.captureUrl ?? * program.baseUrl`). The compositor resolves it to a project environment so * a video-demo recapture self-heals its GitHub obsolescence baseline (AUT-221 * Lot 10). Optional for backward-compat with older CLIs that don't send it. */ captureUrl?: string; /** Measured duration of the captured MP4 in milliseconds. */ durationMs: number; /** * Per-opcode timing entries that landed within this clip, taken verbatim * from `RunResult.opcodeTimings` (see execution-types). The compositor * filters by `clipId === clip.clipId`. */ opcodeTimings: Array<{ stepIndex: number; stepId?: string; opcodeKind: string; timecodeStartMs: number; timecodeEndMs: number; bbox?: { x: number; y: number; width: number; height: number; } | null; /** * For TYPE opcodes captured in clipCursor mode: clip-relative ms timestamp * of every keystroke produced by `humanType`. Drives per-keystroke keyboard * SFX in the video compositor. */ keystrokeOffsetsMs?: number[]; /** * For CLICK / DOUBLE_CLICK / CHECK opcodes captured in clipCursor mode: * clip-relative ms timestamp of each actual click dispatched by Playwright * (measured AFTER the cursor animation settled). Drives mouse SFX in * sync with the visible click. */ clickOffsetsMs?: number[]; }>; } export interface VideoAudioAsset { stepId: string; url: string; duration_ms: number; word_timings?: Array<{ word: string; start_ms: number; end_ms: number; }>; } export type VideoAudioAssetsByLocale = Record; /** Body of POST /api/cli/video-complete. */ export interface VideoCompletePayload { videoId: string; /** `runId` the CLI generated for this run (already used for telemetry). */ runId: string; clips: VideoClipMetadata[]; /** Per-run TTS assets generated by /api/cli/video-prepare. */ audioAssets?: VideoAudioAsset[]; /** Per-locale TTS assets generated by /api/cli/video-prepare. */ audioAssetsByLocale?: VideoAudioAssetsByLocale; } /** Server response. */ export interface VideoCompleteResponse { composeRunId: string; composeRunIds?: string[]; compositorTrigger?: { triggered: boolean; operationName?: string; skippedReason?: string; error?: string; }; } export type ArtifactUploadObjectId = "screenshotRaw" | "screenshot" | "clipGif" | "clipMp4" | "clipThumbnail" | "videoMp4" | "tabIcon"; export interface ArtifactUploadMetadata { presetId: string; runId: string; /** Per-invocation session id grouping every charge of one CLI run (migration 267). */ sessionId?: string | null; variantId: string; targetId?: string | null; targetLabel?: string | null; programVersion?: number | null; compileFingerprint?: string | null; engineVersion?: number | null; programSchemaVersion?: number | null; programSchemaVersionOrigin?: number | null; cliVersion?: string | null; programHash?: string | null; mediaMode: "screenshot" | "clip" | "video"; mimeType: string; captureType: "fullpage" | "element"; captureUrl: string; /** * Document title captured from the page at screenshot time (Playwright's * `page.title()`). Server uses it as the tab title in browser mockups; falls * back to `parsed.hostname` when absent (older CLIs do not send it). */ pageTitle?: string | null; lang: string; theme: "light" | "dark"; deviceFrame?: string | null; deviceScaleFactor?: number | null; viewport?: { width: number; height: number; } | null; altText?: string | null; elementSelector?: string | null; captureId?: string | null; captureName?: string | null; clipId?: string | null; clipName?: string | null; stepDescription?: string | null; stepIndex?: number | null; durationMs?: number | null; trimStartMs?: number | null; artifactPlan?: Record | null; tabIconMimeType?: string | null; tabIconSha256?: string | null; } export interface ArtifactUploadTarget { id: ArtifactUploadObjectId; bucket: "screenshots" | "videos"; path: string; contentType: string; method: "PUT"; signedUrl: string; token?: string; expiresAt: string; } export interface ArtifactUploadInitRequest { metadata: ArtifactUploadMetadata; } export interface ArtifactUploadInitResponse { uploadId: string; uploads: ArtifactUploadTarget[]; expiresAt: string; } export interface ArtifactUploadedObject { id: ArtifactUploadObjectId; bucket: "screenshots" | "videos"; path: string; contentType: string; sizeBytes: number; sha256: string; } export interface ArtifactUploadCompleteRequest { uploadId: string; metadata: ArtifactUploadMetadata; objects: ArtifactUploadedObject[]; }