import type { AssetDependencies } from './schemas.js' export interface AssetVersion { id: string assetId: string version: string approved: boolean npmDependencies: Record assetDependencies: AssetDependencies skillDependencies: Record sourceKey: string sourceSizeBytes: number | null createdAt: Date } export interface Asset { id: string name: string type: string description: string | null ownerId: string createdAt: Date updatedAt: Date } export interface AssetSearchResult { id: string name: string type: string description: string | null ownerId: string createdAt: Date updatedAt: Date latestVersion: string approved: boolean /** Visibility. `private` assets are owner-only (resolvable only by their owner or an admin). */ access: 'public' | 'private' /** * The asset's capability key — embedded in file URL paths and in the preview URL's `?key=` query. * Present only for the owner (and admins); null otherwise. */ accessKey?: string | null npmDependencies: Record assetDependencies: AssetDependencies skillDependencies: Record sourceSizeBytes: number | null /** Public URL of the preview image, or null for types without one. */ previewUrl: string | null } /** Metadata for an exact lookup. New providers identify the selected version; legacy ones may not. */ export interface AssetExactResult extends AssetSearchResult { version?: string } /** One stored file of a version, from the derived index (an R2 list over the version's prefix). */ export interface AssetFileEntry { path: string /** Fetch-ready data-plane URL containing every credential required for access. */ url: string sizeBytes: number /** The object's md5 (hex) — its R2 etag; installs verify downloads against it. */ etag: string } /** The derived file index of a version, for per-file installs from the data plane. */ export interface AssetFilesResult { files: AssetFileEntry[] } export interface PaginatedList { items: T[] total: number page: number limit: number totalPages: number } export interface User { id: string name: string email: string emailVerified: boolean image: string | null role: string isAdmin: boolean /** * Capability entitlements from the auth service (e.g. `market:private`, `market:generate`). Lets * the frontend gate features (a private-visibility toggle) without re-deriving role logic. */ entitledScopes: string[] createdAt: Date updatedAt: Date } export interface GenerateAssetResult { assetName: string version: string } /** Provider-owned type guidance and installation policy. */ export interface AssetInstallMetadata { searchMessage?: string installMessage?: string /** Omitted by Market APIs released before capability discovery. */ canGenerate?: boolean /** Whether `generate` takes reference images for this type. */ acceptsReferenceImages?: boolean saveOnInstall: boolean readAssetDependenciesFromPackageJson: boolean omitUnchangedInstalledFilesOnUpload: boolean }