/** * marketplace-index.ts * * A static, self-hostable JSON index of capability bundles. The governance is * STRUCTURAL, not policy: an index entry that lacks a SHA-256 pin or a * capability summary cannot be represented, `PinnedMarketplaceIndexEntry` * makes `source.sha256` and `capabilities` required, and `parseMarketplaceIndex` * rejects any entry missing them. A registry built from this type therefore * cannot list an unpinned or capability-opaque bundle; there is no field to omit * that would let one through. * * This is the governed-registry position: a public index without mandatory * pinning + declared capabilities is on the do-not-build list, so the format * simply cannot express one. */ import type { PinnedBundleSource } from './bundle-pin.js'; import type { BundleCapabilitySummary } from './bundle-manifest.js'; import { type CapabilityBundleManifest } from './bundle-manifest.js'; /** One bundle listed in a marketplace index. Pin + capabilities are required. */ export interface PinnedMarketplaceIndexEntry { readonly id: string; readonly name: string; readonly version: string; readonly kind: CapabilityBundleManifest['kind']; readonly summary: string; /** The pinned source, `source.sha256` is required by the type. */ readonly source: PinnedBundleSource; /** The bundle's declared capability summary, required, never omitted. */ readonly capabilities: BundleCapabilitySummary; readonly author?: string | undefined; } /** The marketplace index document. `version` is fixed at 1. */ export interface PinnedMarketplaceIndex { readonly version: 1; readonly bundles: readonly PinnedMarketplaceIndexEntry[]; } /** Result of validating an untrusted value as a marketplace index. */ export type MarketplaceIndexValidation = { readonly ok: true; readonly index: PinnedMarketplaceIndex; } | { readonly ok: false; readonly errors: readonly string[]; }; /** * Validate an untrusted value as a marketplace index. Every entry must carry a * pinned source and a capability summary; the first missing pin or summary makes * the whole document invalid (a partially-governed index is not accepted). */ export declare function parseMarketplaceIndex(value: unknown): MarketplaceIndexValidation; /** * Build a governed index entry from a validated bundle manifest and a pinned * source. Because the capability summary is derived from the manifest, an entry * is always capability-complete by construction. */ export declare function buildMarketplaceIndexEntry(manifest: CapabilityBundleManifest, source: PinnedBundleSource): PinnedMarketplaceIndexEntry; /** Serialize a marketplace index to canonical pretty JSON with a trailing newline. */ export declare function serializeMarketplaceIndex(index: PinnedMarketplaceIndex): string; //# sourceMappingURL=marketplace-index.d.ts.map