/** * HTTP client for the Dossier Registry API. * Uses Node.js built-in fetch (Node 20+). */ declare class RegistryError extends Error { statusCode: number | null; code: string | null; constructor(message: string, statusCode?: number | null, code?: string | null); } interface ListDossiersOptions { category?: string; page?: number; perPage?: number; } interface SearchOptions { page?: number; perPage?: number; } interface DossierContentResult { content: string; digest: string | null; } interface DossierInfo { name: string; title?: string; version?: string; status?: string; category?: string | string[]; risk_level?: string; objective?: string; description?: string; authors?: Array; tags?: string[]; checksum?: { algorithm?: string; hash?: string; }; signature?: { signed_by?: string; key_id?: string; }; content_url?: string; } interface DossierListItem { name: string; title?: string; description?: string; objective?: string; version?: string; category?: string | string[]; tags?: string[]; } interface ListTracesOptions { status?: string; dossier?: string; from?: string; to?: string; limit?: number; offset?: number; org?: string; } interface TraceListItem { trace_id: string; dossier: { title: string; version: string; }; agent?: { name?: string; version?: string; host?: string; }; started_at: string; completed_at: string | null; status: 'running' | 'success' | 'failed' | 'cancelled'; duration_ms: number | null; } interface ListTracesResult { traces: TraceListItem[]; pagination: { total: number; limit: number; offset: number; next: string | null; }; } interface ListDossiersResult { dossiers?: DossierListItem[]; data?: DossierListItem[]; total?: number; totalPages?: number; } interface PublishResult { name?: string; content_url?: string; } interface SearchResult { dossiers?: DossierListItem[]; total?: number; totalPages?: number; } declare class RegistryClient { private baseUrl; private token; constructor(baseUrl: string, token?: string | null); /** * Get the registry base URL (without /api/v1 suffix). */ getRegistryBaseUrl(): string; /** * Build request headers. */ private _buildHeaders; /** * Handle API response, throwing on errors. */ private _handleResponse; /** * Build URL with query parameters. */ private _buildUrl; /** * List dossiers from the registry. */ listDossiers(options?: ListDossiersOptions): Promise; /** * Get metadata for a dossier. */ getDossier(name: string, version?: string | null): Promise; /** * Download dossier content. */ getDossierContent(name: string, version?: string | null): Promise; /** * Search dossiers. */ searchDossiers(query: string, options?: SearchOptions): Promise; /** * Publish a dossier to the registry. */ publishDossier(namespace: string, content: string, changelog?: string | null): Promise; /** * Delete a dossier from the registry. */ removeDossier(name: string, version?: string | null): Promise>; /** * List execution traces. Defaults to the authenticated user's own traces; * pass `org` to list traces from anyone in that org (requires membership). */ listTraces(options?: ListTracesOptions): Promise; /** * Fetch a single execution trace by id (includes all its steps inline). * Pass `org` to read a trace from another member of that org (requires membership). */ getTrace(traceId: string, options?: { org?: string; }): Promise>; /** * Get current user info. */ getMe(): Promise>; /** * Exchange OAuth code for access token. */ exchangeCode(code: string, redirectUri: string): Promise>; } /** * Create a registry client for a specific resolved registry. */ declare function getClientForRegistry(registryUrl: string, token?: string | null): RegistryClient; /** * Parse a name@version string. */ declare function parseNameVersion(name: string): [string, string | null]; export { RegistryClient, RegistryError, getClientForRegistry, parseNameVersion }; export type { DossierInfo, DossierListItem, ListDossiersResult, DossierContentResult, PublishResult, SearchResult, ListDossiersOptions, SearchOptions, ListTracesOptions, ListTracesResult, TraceListItem, }; //# sourceMappingURL=registry-client.d.ts.map