import { AppCatalogEntry } from './app-catalog.js'; import 'zod'; import './app-registry-DtUAlxkN.js'; import '@agentproto/app'; /** * Publishing-pipeline helpers shared by `agentproto catalog build` * (`packages/cli`) and the `catalog:first-party` sync script * (`packages/runtime/scripts/sync-first-party-catalog.mjs`): sorting + * merging catalog entries, and rendering the embedded first-party * catalog TypeScript file. Single source of truth -- no copies. */ /** A v1 catalog document as published at `DEFAULT_CATALOG_SOURCE_URL`. */ interface CatalogDocument { schema: string; generatedAt: string; entries: AppCatalogEntry[]; } /** Entries sorted by `appId` (stable order for deterministic output). */ declare function sortCatalogEntries(entries: readonly AppCatalogEntry[]): AppCatalogEntry[]; /** Build a v1 catalog document with deterministic entry order. */ declare function buildCatalogDocument(entries: readonly AppCatalogEntry[], generatedAt: string): CatalogDocument; /** JSON serialization used for every published catalog file (2-space * indent, trailing newline) so diffs stay clean. */ declare function serializeCatalogDocument(doc: CatalogDocument): string; interface MergeCatalogResult { entries: AppCatalogEntry[]; /** `appId -> reason` for incoming entries that were NOT applied. */ skipped: Map; } /** * Merge incoming entries over `base` by `appId`: the incoming entry replaces * the existing one when its version is >= (per `compareCatalogVersions`; * unparseable versions always let the incoming entry win). An incoming * entry with a LOWER version is skipped with a warning and the existing * entry stays. Incoming entries with a version that ties or is unparseable * replace too -- publishing the same version twice is a no-op rewrite. */ declare function mergeCatalogEntries(base: readonly AppCatalogEntry[], incoming: readonly AppCatalogEntry[], compare: (a: string, b: string) => number | undefined): MergeCatalogResult; /** * Render the embedded first-party catalog TypeScript file. The emitted * source must pass typecheck and lint as-is: entries are serialized as * plain literals (key order preserved from the validated entry). */ declare function renderFirstPartyCatalogTs(entries: readonly AppCatalogEntry[]): string; export { type CatalogDocument, type MergeCatalogResult, buildCatalogDocument, mergeCatalogEntries, renderFirstPartyCatalogTs, serializeCatalogDocument, sortCatalogEntries };