import type { Transport } from './transport'; /** * The marketplace search filter (GET `/api/marketplace/search` query params). * `tags` is sent as REPEATED `tags` params, one per value; `page` is supplied * per-request by the infinite query, never from the URL. `tier`, `namespace`, * `contract`, and `page_size` are accepted by the route but the v1 UI sends none * of them (every v1 row is official/tai42; the page size stays the server * default) — they exist for contract completeness. */ export interface MarketplaceSearchQuery { readonly q?: string; readonly kind?: string; readonly category?: string; readonly tags?: string[]; readonly namespace?: string; readonly tier?: string; readonly contract?: string; readonly sort?: 'downloads' | 'updated' | 'name' | 'relevance'; readonly page?: number; readonly page_size?: number; } /** * Body for installing / updating a plugin. `ref` is `namespace/name`. * * `env` / `secret_keys` satisfy an mcp-server entry's required `!ENV` markers in * the same transaction that writes the entry: `env` supplies the values, * `secret_keys` marks which land in the secret band. Both omitted for a plain * install (no required markers). * * `route_mounts` maps a route-carrying item name to the base prefix its routes * mount under (the default or the operator's remap); `accept_public_routes` * explicitly consents to the routes served without authentication. Omitted for a * plugin that registers no routes. */ export interface MarketplaceInstallBody { readonly ref: string; readonly version?: string; readonly env?: Record; readonly secret_keys?: string[]; readonly route_mounts?: Record; readonly accept_public_routes?: boolean; } /** * Body for previewing an install / update (`POST /api/marketplace/install/preview`): * resolves the spec and computes the routes, collisions, and public rows WITHOUT * side effects. `route_mounts` applies base overrides so the operator sees the * effect of a remap before committing. */ export interface MarketplaceInstallPreviewBody { readonly ref: string; readonly version?: string; readonly route_mounts?: Record; } /** Body for uninstalling a plugin. */ export interface MarketplaceUninstallBody { readonly ref: string; } export declare function marketplaceClient(t: Transport): { searchMarketplace: (query?: MarketplaceSearchQuery, signal?: AbortSignal) => Promise<{ listings: { ref: string; namespace: string; name: string; display_name: string | null; icon_url: string | null; package: string | null; description: string; categories: string[]; tags: string[]; trust_tier: string; pricing: string; latest_version: string | null; downloads: number; updated_at: string; kinds: { kind: string; count: number; names: string[]; }[]; groups: { name: string; count: number; }[]; premium?: boolean | null | undefined; }[]; total: number; page: number; page_size: number; }>; getMarketplacePlugin: (namespace: string, name: string, signal?: AbortSignal) => Promise<{ namespace: string; name: string; display_name: string | null; icon_url: string | null; package: string | null; description: string; readme_md: string | null; license: string | null; homepage_url: string | null; repository_url: string | null; categories: string[]; tags: string[]; trust_tier: string; pricing: string; downloads: number; latest: { version: string; contract_range: string | null; status: string; published_at: string | null; items: { kind: string; name: string; description: string; tags: string[]; group: string | null; routes?: { base: string; paths: { path: string; methods: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE")[]; public: boolean; }[]; } | null | undefined; required_env?: { name: string; secret: boolean; }[] | undefined; }[]; } | null; versions: { version: string; contract_range: string | null; status: string; published_at: string | null; }[]; source?: "pypi" | "github" | "spec" | null | undefined; docs_url?: string | null | undefined; premium?: boolean | null | undefined; }>; listMarketplaceCategories: (signal?: AbortSignal) => Promise; listMarketplaceKinds: (signal?: AbortSignal) => Promise; listInstalledMarketplacePlugins: (signal?: AbortSignal) => Promise<{ installed: { ref: string; version: string; source: string; delivery: "package" | "descriptor"; installed_at: string; latest: string | null; update_available: boolean; incompatible_newer: string | null; missing_upstream: boolean; compat: { status: "unknown" | "compatible" | "incompatible"; reason: string | null; }; items: { name: string; kind: string; }[]; route_mounts: Record; }[]; quarantined: { name: string; reason: string; }[]; }>; previewMarketplaceInstall: (body: MarketplaceInstallPreviewBody, signal?: AbortSignal) => Promise<{ ref: string; version: string; items: { item: string; kind: string; base: string; default_base: string; routes: { path: string; full_path: string; methods: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE")[]; public: boolean; }[]; }[]; collisions: { item: string; full_path: string; methods: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE")[]; conflict_owner: string; conflict_path: string; }[]; public_routes: { item: string; full_path: string; methods: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE")[]; }[]; new_public_routes: { item: string; full_path: string; methods: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE")[]; }[]; requires_public_acceptance: boolean; required_env: { name: string; secret: boolean; }[]; missing_env: string[]; delivery: "package" | "descriptor"; }>; installMarketplacePlugin: (body: MarketplaceInstallBody) => Promise<{ ref: string; version: string; notes: string[]; advisories: { id: number; listing: string; affected_versions: string; severity: string; summary: string; created_at: string; withdrawn_at: string | null; }[]; routes: { item: string; full_path: string; methods: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE")[]; public: boolean; }[]; }>; uninstallMarketplacePlugin: (body: MarketplaceUninstallBody) => Promise<{ ref: string; uninstalled: true; notes: string[]; }>; updateMarketplacePlugin: (body: MarketplaceInstallBody) => Promise<{ ref: string; version: string; notes: string[]; advisories: { id: number; listing: string; affected_versions: string; severity: string; summary: string; created_at: string; withdrawn_at: string | null; }[]; routes: { item: string; full_path: string; methods: ("GET" | "POST" | "PUT" | "PATCH" | "DELETE")[]; public: boolean; }[]; }>; upgradeAllMarketplacePlugins: () => Promise<{ results: { ref: string; outcome: "failed" | "upgraded" | "up-to-date" | "no-compatible-version"; detail: string; }[]; }>; getMarketplaceAdvisories: (signal?: AbortSignal) => Promise<{ advisories: { id: number; listing: string; affected_versions: string; severity: string; summary: string; created_at: string; withdrawn_at: string | null; }[]; fetched_at: string; }>; }; //# sourceMappingURL=marketplace-client.d.ts.map