import type { CliCredentials } from '../config'; import { type DriveEffect } from './drive'; import { type BytesFetch, type ItemRead, type Json, type Requester } from './platform'; export type AddOnIssueLevel = 'error' | 'warn'; export interface AddOnIssue { code: string; level: AddOnIssueLevel; path: string; message: string; fix: string; } export interface AddOnSpec { title: string; description?: string; tags?: string[]; slug?: string; version?: string; fits: Json; ops: Json[]; provenance?: { kind?: string; source?: string; }; definition?: Json; } export interface AddOnDir { dir: string; addonFile: string; glbFile?: string; thumbnailFile?: string; spec: AddOnSpec; } export declare function readAddOnDir(dirArg: string, overrides?: { glb?: string; }): AddOnDir; /** Slots the runtime draws NO geometry for (a GLB there is never seen): nothing to anchor. A subset of the slots whose part may * be pure tuning with no model at all (`TUNE_ONLY_VEHICLE_SLOT_TYPES`): an engine, exhaust or tyre may be tune-only OR modelled. */ export declare const TUNE_ONLY_SLOTS: Set; /** Metres: a socket-frame mesh must be centred on its mount this closely (on the axes it does not face along). */ export declare const SOCKET_CENTRE_TOLERANCE_M = 0.03; export declare function globMatches(glob: string, value: string): boolean; /** The add-on's own model: frame declaration and where its geometry sits relative to that frame. */ export declare function checkAddOnModel(spec: AddOnSpec, glb: Buffer | undefined): { issues: AddOnIssue[]; frame?: Json; box?: { min: number[]; max: number[]; }; }; export interface SlotRow { id: string; slotType: string; hide: string[]; instanceId?: string; } export interface SlotBoard { itemId: string; hostKind: string; slots: SlotRow[]; surface?: { paths?: string[]; } & Json; } export interface HostReport { id: string; title?: string; creatorId?: string; ownedByYou: boolean; issues: AddOnIssue[]; /** Hide globs the add-on needs that the host board does not grant, keyed by the board slot id that would grant them. */ missingGrants: Record; granted?: Record; /** Host wheel hubs (model frame) when this is a wheel add-on, for reference. */ hostNodes?: number; /** Which GLB the host checks read (the pinned Package's model, or the item web asset). */ modelSource?: string; /** Tunable paths the add-on requires that the host surface does not expose (a performance part then fits ZERO hosts). */ missingPaths?: string[]; /** The part's measured drive effect on this host (tune ops only; `--no-measure` skips it). */ drive?: { engineVersion: string | null; moved: string[]; perOp: Array<{ op: string; moved: string[]; }>; }; } export interface FitDryRun { ok: boolean; issues: Array<{ pointer: string; message: string; }>; fitsCount: number; sample: Array<{ id: string; title: string; }>; } export declare function validateFitDryRun(api: Requester, fits: Json, ops: Json[]): Promise; export declare function getSlotBoard(api: Requester, hostId: string): Promise; /** * The standard vehicle board's own hide grants per slot id. A board row's `hide` = these + the host's * hostGrantExtensions, so the difference reveals which grants a new Vehicle Package Version needs. * SYNC OBLIGATION: helix-backend-api src/add-ons/vehicle-slot-pack.ts (`hide:` of every SlotDefinition). */ export declare const STANDARD_VEHICLE_HIDES: Readonly>; /** The host's current hostGrantExtensions: the board's own field when the backend returns it, else board − standard. */ export declare function boardExtensions(board: SlotBoard & { hostGrantExtensions?: Record; }): Record; /** * The model the host actually DRAWS: its pinned Package Version's web model variant. The item's own `web` asset can * be stale (the live 993's still has identity wheel origins; its pinned 1.0.8 GLB is fixed), so it is only the * fallback for an unpinned host. */ export declare function hostModel(api: Requester, host: ItemRead, fetchBytes: BytesFetch, apiUrl: string, readObject?: (sha: string) => Promise): Promise<{ glb?: Buffer; pkg?: Json; source?: string; }>; /** Per-host checks: the host is a vehicle, its wheels are at the hubs (wheel slots), the hide targets exist, the board grants them. */ export declare function checkHost(api: Requester, hostId: string, spec: AddOnSpec, me: string | null, apiUrl: string, fetchBytes?: BytesFetch, frame?: Json): Promise; export interface AddOnCheckReport { ok: boolean; slotType: string; local: AddOnIssue[]; model: { frame?: Json; box?: { min: number[]; max: number[]; }; }; hosts: HostReport[]; dryRun?: FitDryRun; errors: number; warnings: number; } /** * The web customizer's meshless guard on the exact definition `vehicle addon publish` would seal. With no GLB the Package * seals no web variant, so the customizer equips it only when the root is a verified meshless definition. `addon.json`'s * `definition` is spread LAST into the root, so it can override the schema or restore a mesh: judge the merged object. */ export declare function customizerGuardIssues(spec: AddOnSpec, glb: Buffer | undefined): AddOnIssue[]; /** The whole pre-publish gate. With `grant`, missing hide grants on hosts YOU own are opened (then re-checked). */ export declare function checkAddOn(dir: AddOnDir, creds: CliCredentials, deps: { api: Requester; fetchBytes?: BytesFetch; onProgress?: (m: string) => void; /** Measure the tune ops on each host with the live runtime's physics (src/vehicle/drive.ts). Absent = not measured. */ measureDrive?: (vehiclePackage: Json, ops: Json[], slotType: string) => Promise; }): Promise; export declare function formatAddOnReport(r: AddOnCheckReport): string;