import { CliCredentials } from './config'; export declare const VAULT_ASSET_KINDS: readonly ["prop", "character", "animation", "audio", "texture", "material", "environment", "terrain", "vfx", "decal", "sky", "gaussian_splat", "scene", "interactive_item", "unreal_package"]; export type VaultAssetKind = (typeof VAULT_ASSET_KINDS)[number]; export type DreamerAssetKind = 'prop' | 'character'; export type StandaloneAssetKind = 'image' | 'prop' | 'material' | 'audio' | 'gaussian_splat' | 'animation'; export type DreamerApprovalGate = 'concept' | 'preview'; /** * A job that is alive but cannot advance without an explicit, money-spending decision. Carries the * job so callers can render the exact recovery command instead of a bare timeout. */ export declare class StrandedJobError extends Error { readonly job: DreamerAssetJob; constructor(job: DreamerAssetJob); } export type DreamerPipeline = 'dreamer' | 'asset'; export type DreamerAudioMode = 'sound_effect' | 'music' | 'text_to_speech'; export declare const AUDIO_GENERATION_TIMEOUT_MS: number; export declare const DREAMER_JOB_DEFAULT_TIMEOUT_MS: number; export declare const DEFAULT_POLL_INTERVAL_MS = 2000; export type DreamerAudioVoiceSettings = { stability?: number; similarityBoost?: number; style?: number; speed?: number; speakerBoost?: boolean; }; export type DreamerVoiceCategory = 'premade' | 'professional'; export type DreamerVoiceLanguage = { code: string; locale: string | null; accent: string | null; previewUrl: string | null; }; export type DreamerCatalogVoice = { id: string; name: string; description: string | null; category: DreamerVoiceCategory; labels: { accent: string | null; age: string | null; gender: string | null; useCase: string | null; }; languages: DreamerVoiceLanguage[]; previewUrl: string | null; curated: true; }; export type DreamerVoiceCatalogQuery = { search?: string; pageSize?: number; pageToken?: string; category?: DreamerVoiceCategory; }; export type DreamerVoiceCatalogResponse = { voices: DreamerCatalogVoice[]; selection: { defaultVoiceId: string | null; curatedVoiceIds: string[]; }; pageInfo: { pageSize: number; hasMore: boolean; nextPageToken: string | null; totalCount: number | null; }; stale: boolean; }; /** What a caller may do at a gate. `revise` alone means the server rejected its own output. */ export type DreamerGateOption = 'approve' | 'revise'; export type DreamerAwaitingApproval = { gate: DreamerApprovalGate; /** * Server-declared advance paths. Read this rather than hardcoding a state machine: normally * ['approve','revise'], but ['revise'] alone when the server rejected its own concept (e.g. the * reference sheet did not come out as four isolated views), which is unapprovable by definition. */ options?: DreamerGateOption[]; }; /** * One server-offered way to move a stuck job forward. The server owns this list — the CLI renders * it and never invents an entry. `costsLix` is per-action and load-bearing: `revise` and `retry` * spend, and a recovery verb presented as a free retry is how someone gets charged for a failure * they did not cause. */ export type DreamerRecoveryAction = { action: string; method?: string; endpoint?: string; description?: string; costsLix?: boolean; }; export type DreamerRecovery = { recoverable?: boolean; /** LIX still escrowed. Released by the economy's 24h hold sweep — no verb releases it early. */ openHoldLix?: number; actions?: DreamerRecoveryAction[]; }; export type DreamerJobStage = { name: string; action: string | null; status: string; lixCost?: number; startedAt?: string | null; endedAt?: string | null; }; export type DreamerAssetJob = { /** Deprecated alias of `jobId`, kept because existing callers read it. */ id: string; /** * The canonical job id. `start character` returned {id} while `start material` returned {jobId} * for the same command shape; every response this CLI normalizes now carries BOTH, so either * reader works and nothing that depended on the old key breaks. */ jobId?: string; status: string; currentStage?: string; title?: string; awaitingApproval: DreamerAwaitingApproval | null; stages?: DreamerJobStage[]; /** LIX spent so far. Canonical on both routes. */ lixSpentTotal?: number | string; /** LIX currently escrowed by this job — nonzero on a stranded job. */ openHoldLix?: number; /** Server hint that a dead-looking job is still advanceable. */ recoverable?: boolean; /** Server-authored recovery menu — the source of truth for what can advance this job. */ recovery?: DreamerRecovery; sparkSpentTotal?: number; error?: string; publishedItemId?: string | null; vaultAssetId?: string | null; vaultAutoPublish?: 'published' | 'disabled'; verification?: { vaultAssetId?: string | null; vaultAutoPublish?: 'published' | 'disabled'; [key: string]: unknown; } | null; artifacts?: { meshUrl?: string; thumbnailUrl?: string; referenceSheetUrl?: string; }; }; export type GenerateAssetInput = { kind: DreamerAssetKind; prompt: string; title?: string; additionalPrompt?: string; targetPolycount?: number; }; export type GenerateAssetFromReferenceInput = Omit & { referenceSheetPath: string; }; export type GenerateAssetOptions = { pollIntervalMs?: number; timeoutMs?: number; visibility?: 'public' | 'unlisted' | 'private'; onProgress?: (job: DreamerAssetJob) => void; }; export type StandaloneGeneratedAsset = { jobId: string; /** Deprecated alias of `jobId`, always populated on responses this CLI normalizes. */ id?: string; status: 'queued' | 'running' | 'succeeded' | 'failed'; asset?: { url: string; contentType: string; sizeBytes: number; kind: Exclude; }; error?: string; /** LIX spent. Canonical on both routes; `units` is the deprecated alias with an identical value. */ lixSpentTotal?: number | string; /** * A `failed` status on THIS route does not mean dead. The asset projection used to flatten an * ambiguous-concept job to a bare `failed` and drop the gate, while GET /dreamer/jobs/:id carried * it — two routes describing one job differently. Read these before believing `status`. */ awaitingApproval?: DreamerAwaitingApproval | null; recoverable?: boolean; recovery?: DreamerRecovery; openHoldLix?: number; /** @deprecated Same number as `lixSpentTotal`, in LIX — the backend computes it from that field. */ units?: number; /** Measured vendor cost (USD) for the generation — audio only; billed from metered usage, not a flat price. */ providerCostUsd?: number; /** Server-stamped evidence for how the provider cost was settled. */ billingEvidence?: 'measured_provider_credits' | 'estimated_accepted_duration'; vaultAssetId?: string | null; vaultAutoPublish?: 'published' | 'disabled'; }; /** * Input for `POST /api/v1/dreamer/assets/generate`. `prompt` is required for * `image`/`material`/`gaussian_splat` and for the `sound_effect`/`music` audio * modes; `text_to_speech` uses `text` + `voiceId` instead. Every constraint * (ranges, lengths, mode-gating) is validated server-side — this type mirrors * `DreamerAssetGenerateRequestDto` field-for-field but does not re-enforce it. */ export type GenerateStandaloneAssetInput = { kind: StandaloneAssetKind; prompt?: string; additionalPrompt?: string; projectId?: string; sessionId?: string; title?: string; resolution?: 1024 | 2048; repeatPerMeter?: number; splatScope?: 'object' | 'environment'; audioMode?: DreamerAudioMode; model?: string; outputFormat?: string; loop?: boolean; durationSeconds?: number; promptInfluence?: number; forceInstrumental?: boolean; text?: string; voiceId?: string; languageCode?: string; seed?: number; voiceSettings?: DreamerAudioVoiceSettings; pronunciationDictionaryIds?: string[]; }; export type VaultAssetSummary = { assetId: string; slug: string; title: string; kind: VaultAssetKind; origin: string; visibility: string; artifactUrl?: string; mimeType?: string; artifactMimeType?: string; artifactSizeBytes?: number; currentVersion?: number; selectionExplanation?: VaultSelectionExplanation | null; [key: string]: unknown; }; export type ResolvedVaultArtifact = { assetId: string; version: number; url: string | null; urlKind: 'cdn' | 'unavailable'; mimeType: string; sizeBytes: number; checksumSha256: string | null; relatedArtifacts: VaultRelatedArtifact[]; }; export type VaultRelatedArtifact = { role: string; url: string | null; mimeType: string; sizeBytes: number; checksumSha256: string; }; export type VaultAssetDetail = VaultAssetSummary & { artifact: ResolvedVaultArtifact; usedInWorlds?: Array>; }; export type VaultSelectionExplanation = { rankMode: 'relevance' | 'performance' | 'reuse'; lexical: { matchedTerms: string[]; matchedFields: Array<'title' | 'description' | 'tags' | 'kind'>; }; hardFilters: Record; performance: { tier: string | null; costScore: number | null; qualityScore: number | null; }; reuse: { worldUsageCount: number; usageCount: number; lastUsedAt: string | null; }; availability: { performanceMeasured: boolean; qualityMeasured: boolean; reuseObserved: boolean; }; }; export type VaultAssetSearch = { q?: string; /** * What `q` DOES. `narrow` makes it a hard filter — nothing matches, nothing comes * back; omit for the backend default `recall`, which ranks and never returns empty. */ match?: 'recall' | 'narrow'; kind?: VaultAssetKind[]; subtype?: string; scope?: 'object' | 'environment'; format?: string; performanceTier?: 'mobile' | 'desktop' | 'cinematic' | 'unknown'; rank?: 'relevance' | 'performance' | 'reuse'; skeleton?: string; engine?: string; license?: string; source?: string; origin?: string; creatorId?: string; /** TRUE narrows to platform-vouched assets, FALSE to community ones; omit for everything. */ official?: boolean; page?: number; limit?: number; }; export type InstalledVaultAsset = { assetId: string; slug: string; kind: VaultAssetKind; version: number; path: string; sourceUrl: string; checksumSha256: string; sizeBytes: number; materialRenditions?: MaterialRenditionSelection; relatedArtifacts: Array<{ role: string; path: string; sourceUrl: string; checksumSha256: string; sizeBytes: number; }>; }; export type VaultInstallPin = { version: number; checksumSha256: string; sizeBytes: number; }; export declare const MATERIAL_RENDITION_SELECTIONS: readonly ["runtime", "source", "all"]; export type MaterialRenditionSelection = (typeof MATERIAL_RENDITION_SELECTIONS)[number]; export type VaultAssetVersion = { version: number; url: string | null; mimeType: string; sizeBytes: number; checksumSha256: string | null; notes?: string | null; createdAt: string; }; export type VaultMetadataUpdate = { title?: string; description?: string | null; tags?: string[]; contentRating?: 'everyone' | 'teen' | 'mature' | 'adult'; contentRatingAttestationAccepted?: boolean; }; export type VaultAssetUsage = { assetId: string; worldUsageCount: number; usageCount: number; lastUsedAt: string | null; usedInWorlds: Array>; }; export declare class UnavailableCapabilityError extends Error { readonly capability: string; readonly code = "CAPABILITY_UNAVAILABLE"; constructor(capability: string, message: string); } export type MaterialMaps = { albedo: string; normal: string; orm: string; }; /** * One texture-resolution variant a catalog entry declares (pack catalog * schemaVersion 2+). `pixels` is the authored square edge, e.g. 2048 for "2k". */ export type MaterialResolutionVariant = { pixels?: number; maps: MaterialMaps; }; export type MaterialCatalogEntry = { id: string; name: string; category: string; kind: 'texture' | 'glass' | 'procedural_water'; tags: string[]; /** The DEFAULT resolution's maps. Unchanged across schema versions. */ maps?: MaterialMaps; /** Catalog schemaVersion 2+: names which `resolutions` key `maps` mirrors. */ defaultResolution?: string; /** Catalog schemaVersion 2+: every texture resolution this material carries. */ resolutions?: Record; [key: string]: unknown; }; /** One resolvable resolution of one material, normalized across schema versions. */ export type MaterialResolutionOption = { key: string; pixels: number | null; maps: MaterialMaps; }; /** * What a command actually resolved, and what else it could have. Present on * every material this CLI returns so a caller can SEE the choice it has * instead of guessing — and so a silent downgrade is impossible. */ export type MaterialResolutionReport = { /** Exactly what the caller passed, or null when they did not ask. */ requested: string | null; /** The catalog key whose maps were used; null when the material has none. */ resolved: string | null; /** Authored square edge of the resolved variant when the pack declares it. */ pixels: number | null; /** The key this material treats as its default. */ default: string | null; available: Array<{ key: string; pixels: number | null; }>; /** false for procedural materials — they carry no texture maps at all. */ applicable: boolean; note?: string; }; export type ResolvedMaterial = MaterialCatalogEntry & { resolvedMaps?: Record; resolution: MaterialResolutionReport; }; export type MaterialCatalogResult = { slug: string; version: string; /** The catalog's own schemaVersion, verbatim (1 = no per-resolution variants). */ schemaVersion: string | number | null; assetBaseUrl: string; materials: ResolvedMaterial[]; resolution: { requested: string | null; /** Every resolution key offered by ANY material in this pack. */ packResolutions: Array<{ key: string; pixels: number | null; }>; matched: number; /** Texture materials dropped because they lack the requested resolution. */ skippedWithoutResolution: number; /** Procedural materials dropped because they carry no texture maps. */ skippedProcedural: number; }; }; /** * The label a schemaVersion-1 entry's single resolution gets. Such a pack never * says how big its maps are, so naming it "1k" would be a guess presented as a * fact — and a creator asking for "1k" would then be silently served whatever * the pack happens to hold. "default" is the only honest label. */ export declare const DEFAULT_RESOLUTION_KEY = "default"; /** * Every resolution a material offers, in catalog-declared order, normalized so * that an old single-resolution pack and a new multi-resolution pack are the * same shape to every caller above this line. */ export declare function materialResolutionOptions(material: MaterialCatalogEntry): MaterialResolutionOption[]; /** The key whose maps the pack mirrors at the top level — the default download. */ export declare function materialDefaultResolutionKey(material: MaterialCatalogEntry, options?: MaterialResolutionOption[]): string | null; /** * Match a requested resolution against what a material declares. Exact keys win * (case-insensitively); `1024`/`2048` and `1k`/`2k` are accepted as aliases of * each other so a caller never has to know which spelling a pack chose. * Returns null when nothing matches — the caller MUST then fail loudly. */ export declare function matchMaterialResolution(options: MaterialResolutionOption[], requested: string): MaterialResolutionOption | null; export declare function describeGateAdvance(job: DreamerAssetJob): string[]; /** Rendered when a job cannot advance on its own — never auto-executed. */ export declare function formatStrandedJob(job: DreamerAssetJob): string; /** Approve a gate. Explicit, caller-initiated — never called on a gate already approved this run. */ export declare function approveDreamerGate(creds: CliCredentials, jobId: string, gate: DreamerApprovalGate): Promise; /** * Revise a gated stage with new guidance. CHARGES a fresh regeneration — it is a spend, not a free * retry, and it is the only advance path when the server refused its own concept. */ export declare function reviseDreamerGate(creds: CliCredentials, jobId: string, gate: DreamerApprovalGate, prompt?: string): Promise; /** Retry a FAILED job. Distinct from revise: no new guidance, resumes from the mesh phase. */ export declare function retryDreamerJob(creds: CliCredentials, jobId: string): Promise; export declare function generateAndPublishAsset(creds: CliCredentials, input: GenerateAssetInput, options?: GenerateAssetOptions): Promise; export declare function generateAndPublishAssetFromReference(creds: CliCredentials, input: GenerateAssetFromReferenceInput, options?: GenerateAssetOptions): Promise; export declare function startDreamerAssetGeneration(creds: CliCredentials, input: GenerateAssetInput): Promise; export declare function startDreamerAssetGenerationFromReference(creds: CliCredentials, input: GenerateAssetFromReferenceInput): Promise; export declare function getDreamerAssetGenerationJob(creds: CliCredentials, jobId: string): Promise; export declare function resumeAndPublishAsset(creds: CliCredentials, jobId: string, options?: GenerateAssetOptions): Promise; export declare function generateStandaloneAsset(creds: CliCredentials, input: GenerateStandaloneAssetInput, options?: { pollIntervalMs?: number; timeoutMs?: number; onProgress?: (job: StandaloneGeneratedAsset) => void; }): Promise; export declare function startStandaloneAssetGeneration(creds: CliCredentials, input: GenerateStandaloneAssetInput): Promise<{ jobId: string; id?: string; status: 'queued'; }>; export declare function getStandaloneAssetGenerationJob(creds: CliCredentials, jobId: string): Promise; export declare function generateImage(creds: CliCredentials, input: { prompt: string; additionalPrompt?: string; projectId?: string; sessionId?: string; title?: string; }, options?: { pollIntervalMs?: number; timeoutMs?: number; onProgress?: (job: StandaloneGeneratedAsset) => void; }): Promise; /** * Input for `generateAudio` — the same standalone generation input, narrowed to * `kind: 'audio'` (fixed) and the mode-relevant fields. `audioMode` defaults to * `sound_effect` server-side when omitted, matching the DTO default. */ export type GenerateAudioInput = Omit; /** * Generate a sound effect, music track, or spoken line via the ElevenLabs-backed * Dreamer audio route (`kind: 'audio'`) — one shared contract for all three modes. * Polls to a terminal state and returns the same standalone-job shape as * `generateImage`/`generateStandaloneAsset` (asset url/contentType/sizeBytes, * `units` Spark charged, `providerCostUsd` measured vendor cost, `vaultAssetId`). */ export declare function generateAudio(creds: CliCredentials, input: GenerateAudioInput, options?: { pollIntervalMs?: number; timeoutMs?: number; onProgress?: (job: StandaloneGeneratedAsset) => void; }): Promise; /** * List/search the HELIX-safe text-to-speech voice catalog. The backend keeps * vendor credentials and voice administration private; callers receive only * the stable selection projection used by website, CLI, SDK, and MCP clients. */ export declare function listDreamerVoices(creds: CliCredentials, query?: DreamerVoiceCatalogQuery): Promise; export declare function searchVaultAssets(apiUrl: string, query?: VaultAssetSearch, creds?: CliCredentials): Promise<{ items: VaultAssetSummary[]; totalItems: number; }>; export declare function getVaultAsset(apiUrl: string, assetId: string, creds?: CliCredentials): Promise; export declare function getVaultAssetVersions(apiUrl: string, assetId: string, creds?: CliCredentials): Promise<{ items: VaultAssetVersion[]; }>; export declare function updateVaultAssetMetadata(creds: CliCredentials, assetId: string, update: VaultMetadataUpdate): Promise; export declare function getVaultAssetUsage(apiUrl: string, assetId: string, creds?: CliCredentials): Promise; export declare function extensionFor(url: string, mimeType?: string): string; /** * Download a succeeded standalone-generation artifact (e.g. `generateAudio`'s * `asset`) to a local path. `asset.url` is normally an absolute CDN url; a * bare/relative path is resolved against `apiUrl` so a backend-relative URL * still works. Verifies the downloaded size against `asset.sizeBytes` when * the server reported one (`> 0`) — a cheap corruption check, no checksum is * available on this route (unlike the Vault install path). */ export declare function saveGeneratedAsset(asset: { url: string; contentType: string; sizeBytes: number; }, outputPath: string, opts?: { apiUrl?: string; }): Promise<{ bytes: number; }>; export declare function installVaultAsset(worldDir: string, apiUrl: string, assetId: string, creds?: CliCredentials, pin?: VaultInstallPin, materialRenditions?: MaterialRenditionSelection): Promise; export declare function listMaterials(apiUrl: string, query?: { q?: string; category?: string; limit?: number; resolution?: string; }, slug?: string): Promise; export declare function resolveMaterial(apiUrl: string, id: string, slug?: string, options?: { resolution?: string; }): Promise;