import type { HelixApi } from './api'; /** * PRESETS — dressed characters, and saving them. * * A Preset is a Universal Item pinned to a Continuum Package of type `build`: a * free, never-owned preset (a base plus the exact add-ons installed on it). * "Preset" is the user-facing name (formerly "Look"); the API and Continuum * keep the identifier `build`, and internal code/field names (`lookItemId`, * `applyLook`, `saveLook`/`resolveLook`) are unchanged. A Preset's PARTS are * still owned and acquired individually from their own listings — a Preset is * a recipe, never a bundle, and applying one never grants, buys, or moves * anything the caller does not already own. * * This wraps the two Phase 2 contract endpoints an agent needs to actually * use a Preset end to end: * - resolveLook: GET /api/v1/continuum/public/looks/resolve (public) * - saveLook: POST /api/v1/universal-items/inventory/me/:id/looks (bearer) * Full contract: run/open-alpha-qa/looks/phase2-contract.txt in the workspace * root (items 4 and 6). Endpoint 6 is the one the backend lane has committed * to landing first; endpoint 4 may land later or not at all — saveLook is * built against the contract and unit-tested against a mock, same as * resolveLook, but only resolveLook has a live smoke test in this repo. */ export interface PackageRef { packageId: string; version: string; manifestCid: string; } export interface LookResolveAsset { package: PackageRef; item: { id: string; title: string; } | null; model: { url: string; cid: string; mediaType: string; bytes: number; } | null; } export interface LookResolveAddOn extends LookResolveAsset { slot: string; /** Slot type, attach/skin mode, and the add-on's sealed fits/ops — whatever the engine's add-on composer needs. */ fit: Record; } export interface LookResolveResult { look: { packageId: string; version: string; manifestCid: string; kind: string; title: string | null; itemId: string | null; }; base: LookResolveAsset; addOns: LookResolveAddOn[]; /** Non-null only when a merged Runtime Artifact exists (stretch goal on the backend). */ merged: { url: string; cid: string; mediaType: string; bytes: number; } | null; } export interface LookResolveQuery { itemId?: string; packageId?: string; version?: string; } /** * The dressed character behind one Look in a single public call: base model * plus every add-on, each with its pinned Package, model URL/CID, and fit * data — enough for a renderer to reproduce it without other calls. */ export declare function resolveLook(api: Pick, query: LookResolveQuery): Promise; export interface SaveLookInput { title: string; description?: string; visibility: 'private' | 'public'; /** An existing Look the caller created — advances it to a new Package Version instead of creating a fresh one. */ lookItemId?: string; } export interface SaveLookResult { lookItemId: string; package: PackageRef; visibility: 'private' | 'public'; vaultListingId: string | null; marketplaceListingId: string | null; created: boolean; } /** * "Save look": freezes an inventory instance's CURRENT composition into a * Look. Never charges a publish fee, never creates a creator-grant copy, * never creates a distribution — it publishes the recipe, not the parts. */ export declare function saveLook(api: Pick, inventoryItemId: string, input: SaveLookInput): Promise; /** * Parse the CLI's `` argument: an `@` splits a * packageId from an explicit version; a bare value is a Look item id. This is * the same disambiguation `helix look get` documents in its own --help. */ export declare function parseLookRef(ref: string): LookResolveQuery;