import type { HelixApi } from './api'; /** * SEARCHING THE MARKETPLACE CATALOGUE — the shelf, not the stockroom. * * `helix assets search` already searches the VAULT: raw creator resources, the * things a world is built OUT OF. It cannot answer the other question an agent * asks constantly — "what has someone already published that I can use?" — and * until now nothing could. A Universal Item is a PRODUCT; a Vault Asset is a * RESOURCE; they are two tables on purpose, and the CLI only had a door to one * of them. * * That gap is most obvious for BUILDS. A build is a published preset — a base * plus the exact add-ons installed on it — and it exists precisely so somebody * does not have to reassemble it. An agent asked for a police world should be * able to find a finished police character rather than sourcing a base, finding * a uniform, and proving the fit itself. It could not even see that such a * thing existed. * * ── WHY `--builds` IS THREE-VALUED AND DEFAULTS TO OFF ─────────────────────── * A build is not its own category: a character build IS an avatar, a vehicle * build IS a vehicle. So the default (`include`) is that builds come back * alongside everything else — that is what makes searching "police" work. * `only` narrows to presets; `exclude` is for the caller that specifically * wants BASES to build on, which a boolean flag could not express. * * The backend HARD-400s on an unknown query param, so every facet here is * omitted rather than sent empty — an older backend degrades to an unfiltered * search instead of failing outright. */ export declare const BUILD_FILTER_MODES: readonly ["include", "only", "exclude"]; export type BuildFilterMode = (typeof BUILD_FILTER_MODES)[number]; export interface ItemSearchInput { query?: string; kind?: string; category?: string; subCategory?: string; tag?: string; hostKind?: string; builds?: BuildFilterMode; limit?: number; } interface BackendItemRow { id?: unknown; slug?: unknown; title?: unknown; description?: unknown; kind?: unknown; category?: unknown; subCategory?: unknown; hostKind?: unknown; buildKind?: unknown; priceLix?: unknown; tags?: unknown; creator?: { id?: unknown; username?: unknown; } | null; assets?: Array<{ rendition?: unknown; cdnUrl?: unknown; }> | null; } /** One row, trimmed to what an agent needs to CHOOSE. */ export interface ItemSearchRow { id: string; slug: string; title: string; kind: string; /** `character` | `vehicle` | `weapon` | `device` for a build; null otherwise. */ buildKind: string | null; subCategory: string | null; hostKind: string | null; priceLix: string | null; tags: string[]; creator: string | null; thumbnailUrl: string | null; } export interface ItemSearchResult { items: ItemSearchRow[]; totalItems: number | null; /** Echoed back so a caller can see which facets actually reached the server. */ query: Record; } /** * The query string, with every off/default facet genuinely ABSENT. * * Exported for its own test: "sent only when set" is a rule that is trivially * broken by a refactor and whose failure is a 400 on every search rather than * a wrong result, so it is worth pinning independently of any network call. */ export declare function itemSearchQuery(input: ItemSearchInput): Record; export declare function projectItemSearchRow(row: BackendItemRow): ItemSearchRow; export declare function searchItems(api: Pick, input: ItemSearchInput): Promise; export interface ItemBuildPart { /** `base` for the host, otherwise the opening the add-on occupies. */ slot: string; packageId: string | null; version: string | null; manifestCid: string | null; itemId: string | null; title: string | null; kind: string | null; priceLix: string | null; /** Tri-state: null when nobody is signed in, which is not the same as false. */ owned: boolean | null; } export interface ItemBuildResult { itemId: string; kind: string; package: { packageId: string; version: string; manifestCid: string; } | null; parts: ItemBuildPart[]; totalPriceLix: string; unresolvedPartCount: number; } /** * The breakdown of one published build. * * The parts are the POINT of the command. A build is filed under its base's own * category and looks like any other item until something enumerates it, and an * agent choosing between a preset and assembling its own needs to see what the * preset actually contains — and what it would cost — before committing. */ export declare function getItemBuild(api: Pick, itemId: string): Promise; export {};