import type { SmartObjectSpec } from '@bitmagic/asset-core'; import type { Environment } from '../config/environments.js'; import type { ProjectContext } from '../project/context.js'; /** Bake resolution and scale. Defaults live with the commands, which document them to creators. */ export interface VoxelizeFlags { minVoxelSize: number; maxVoxelSize: number; /** Metres. Absent = the GLB's own size, as the Creator's voxelize dialog leaves it by default. */ targetHeight?: number; fillInterior: boolean; } /** * What the bake was handed. * * A union rather than two optional URLs because exactly one is always true, and because the two * take different engine messages. Shared with `generate prop`, which makes the same choice for the * same reason — see generate/prop.ts. */ export type BakeSource = { kind: 'glb'; glbUrl: string; } /** `smartObject`: the Forger's parts-and-lights verdict for this master, baked with it when present. */ | { kind: 'master'; masterUrl: string; smartObject?: SmartObjectSpec; }; /** The URL a source carries, for messages that just need to name what is kept. */ export declare function bakeSourceUrl(source: BakeSource): string; export interface VoxelizeGlbRequest { context: ProjectContext; environment: Environment; token: string; /** Asset name; also what the engine builds its uploaded `.vxl` filename from. */ name: string; source: BakeSource; /** The id to register under. The engine echoes it back, and callers must check that it did. */ assetId: string; voxel: VoxelizeFlags; /** What the creator should do if this fails — what is kept, and the command that resumes it. */ retryHint: string; /** Distinguishes concurrent requests in the page; also names the lane in the transport log. */ requestPrefix: string; log: (message: string) => void; } /** Runs the bake and returns the engine's asset record. Injected in tests, real everywhere else. */ export type VoxelizeGlb = (request: VoxelizeGlbRequest) => Promise>; export declare const voxelizeGlbIntoAsset: VoxelizeGlb; /** * The engine ECHOES the id it was given — but only since it learned to honour a supplied id for an * asset that does not exist yet. An older vendored engine mints its own, and since the caller's * upsert matches on the id it ASKED for, a mismatch would silently append under a different id * than the one reported: the command prints an id absent from world.json, `assets remove` cannot * find it, and a retry adds a second copy instead of replacing. */ export declare function assertEngineHonouredId(engineAsset: Record, assetId: string, name: string, keptHint: string): void;