diff --git a/src/app/catalog/[repoName]/[serverName]/[version]/actions.ts b/src/app/catalog/[repoName]/[serverName]/[version]/actions.ts index 980fbbf9..b2717380 100644 --- a/src/app/catalog/[repoName]/[serverName]/[version]/actions.ts +++ b/src/app/catalog/[repoName]/[serverName]/[version]/actions.ts @@ -5,9 +5,21 @@ import { getAuthenticatedClient } from "@/lib/api-client"; export async function getServerDetails(serverName: string, version: string) { const api = await getAuthenticatedClient(); + const registriesResult = await api.getV1Registries({ client: api.client }); + const registryName = registriesResult.data?.registries?.[0]?.name; + + if (!registryName) { + return { + error: new Error("No registry available"), + data: null, + response: null, + }; + } + const { error, data, response } = - await api.getRegistryV01ServersByServerNameVersionsByVersion({ + await api.getRegistryByRegistryNameV01ServersByServerNameVersionsByVersion({ path: { + registryName, serverName, version, }, diff --git a/src/app/catalog/actions.test.ts b/src/app/catalog/actions.test.ts index 2931b771..adc04384 100644 --- a/src/app/catalog/actions.test.ts +++ b/src/app/catalog/actions.test.ts @@ -1,4 +1,4 @@ -import { mockedGetRegistryV01Servers } from "@mocks/fixtures/registry_v0_1_servers/get"; +import { mockedGetRegistryV01Servers } from "@mocks/fixtures/registry_registryName_v0_1_servers/get"; import { HttpResponse } from "msw"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { getServers } from "./actions"; diff --git a/src/app/catalog/actions.ts b/src/app/catalog/actions.ts index d2271ca0..0e89bf98 100644 --- a/src/app/catalog/actions.ts +++ b/src/app/catalog/actions.ts @@ -11,10 +11,9 @@ export async function getRegistries(): Promise< GithubComStacklokToolhiveRegistryServerInternalServiceRegistryInfo[] > { const api = await getAuthenticatedClient(); - const registries = await api.getExtensionV0Registries({ + const registries = await api.getV1Registries({ client: api.client, }); - if (registries.error) { console.error("[catalog] Failed to fetch registries:", registries.error); throw registries.error; @@ -23,6 +22,7 @@ export async function getRegistries(): Promise< if (!registries.data) { return []; } + // console.log("registries", JSON.stringify(registries.data, null, 2)); return registries.data.registries ?? []; } @@ -38,38 +38,21 @@ interface ServerListParams { search?: string; } +/** + * Fetches MCP servers using the first available registry as default. + * Used when no specific registry is selected by the user. + */ export async function getServers( params?: ServerListParams, ): Promise { - const api = await getAuthenticatedClient(); - const servers = await api.getRegistryV01Servers({ - client: api.client, - query: { - version: "latest", - cursor: params?.cursor || undefined, - limit: params?.limit, - search: params?.search || undefined, - }, - }); + const registries = await getRegistries(); + const defaultRegistry = registries[0]?.name; - if (servers.error) { - console.error("[catalog] Failed to fetch servers:", servers.error); - throw servers.error; - } - - if (!servers.data) { + if (!defaultRegistry) { return { servers: [] }; } - const data = servers.data; - const items = Array.isArray(data?.servers) ? data.servers : []; - - return { - servers: items - .map((item) => item?.server) - .filter((server): server is V0ServerJson => server != null), - nextCursor: data.metadata?.nextCursor, - }; + return getServersByRegistryName(defaultRegistry, params); } /** diff --git a/src/app/catalog/page.tsx b/src/app/catalog/page.tsx index 8e780917..5f262168 100644 --- a/src/app/catalog/page.tsx +++ b/src/app/catalog/page.tsx @@ -1,4 +1,4 @@ -import { getRegistries, getServers, getServersByRegistryName } from "./actions"; +import { getRegistries, getServersByRegistryName } from "./actions"; import { ServersWrapper } from "./components/servers-wrapper"; import { CATALOG_PAGE_SIZE } from "./constants"; @@ -20,12 +20,12 @@ export default async function CatalogPage({ searchParams }: CatalogPageProps) { search: search || undefined, }; - const [registries, { servers, nextCursor }] = await Promise.all([ - getRegistries(), - registryName - ? getServersByRegistryName(registryName, paginationParams) - : getServers(paginationParams), - ]); + const registries = await getRegistries(); + const selectedRegistry = registryName ?? registries[0]?.name; + + const { servers, nextCursor } = selectedRegistry + ? await getServersByRegistryName(selectedRegistry, paginationParams) + : { servers: [], nextCursor: undefined }; return ( ; }; -/** - * List registries - * - * List all registries - */ -export const getExtensionV0Registries = ( - options?: Options, -) => - (options?.client ?? client).get< - GetExtensionV0RegistriesResponses, - GetExtensionV0RegistriesErrors, - ThrowOnError - >({ - security: [{ name: "Authorization", type: "apiKey" }], - url: "/extension/v0/registries", - ...options, - headers: { - "Content-Type": "application/json", - ...options?.headers, - }, - }); - -/** - * Delete registry - * - * Delete a registry by name. Only registries created via API can be deleted. - */ -export const deleteExtensionV0RegistriesByRegistryName = < - ThrowOnError extends boolean = false, ->( - options: Options, -) => - (options.client ?? client).delete< - DeleteExtensionV0RegistriesByRegistryNameResponses, - DeleteExtensionV0RegistriesByRegistryNameErrors, - ThrowOnError - >({ - security: [{ name: "Authorization", type: "apiKey" }], - url: "/extension/v0/registries/{registryName}", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }); - -/** - * Get registry - * - * Get a registry by name - */ -export const getExtensionV0RegistriesByRegistryName = < - ThrowOnError extends boolean = false, ->( - options: Options, -) => - (options.client ?? client).get< - GetExtensionV0RegistriesByRegistryNameResponses, - GetExtensionV0RegistriesByRegistryNameErrors, - ThrowOnError - >({ - security: [{ name: "Authorization", type: "apiKey" }], - url: "/extension/v0/registries/{registryName}", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }); - -/** - * Create or update registry - * - * Create a new registry or update an existing one. Only registries created via API can be updated. - */ -export const putExtensionV0RegistriesByRegistryName = < - ThrowOnError extends boolean = false, ->( - options: Options, -) => - (options.client ?? client).put< - PutExtensionV0RegistriesByRegistryNameResponses, - PutExtensionV0RegistriesByRegistryNameErrors, - ThrowOnError - >({ - security: [{ name: "Authorization", type: "apiKey" }], - url: "/extension/v0/registries/{registryName}", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }); - /** * Health check * @@ -249,111 +132,6 @@ export const getReadiness = ( ThrowOnError >({ url: "/readiness", ...options }); -/** - * Publish server (not supported) - * - * Publish a server to the registry. This server does not support publishing via this endpoint. - * Use the registry-specific endpoint /{registryName}/v0.1/publish instead. - * - * @deprecated - */ -export const postRegistryV01Publish = ( - options?: Options, -) => - (options?.client ?? client).post< - unknown, - PostRegistryV01PublishErrors, - ThrowOnError - >({ - security: [{ name: "Authorization", type: "apiKey" }], - url: "/registry/v0.1/publish", - ...options, - headers: { - "Content-Type": "application/json", - ...options?.headers, - }, - }); - -/** - * List servers (aggregated) - * - * Get a list of available servers from all registries (aggregated view) - * - * @deprecated - */ -export const getRegistryV01Servers = ( - options?: Options, -) => - (options?.client ?? client).get< - GetRegistryV01ServersResponses, - GetRegistryV01ServersErrors, - ThrowOnError - >({ - security: [{ name: "Authorization", type: "apiKey" }], - url: "/registry/v0.1/servers", - ...options, - headers: { - "Content-Type": "application/json", - ...options?.headers, - }, - }); - -/** - * List all versions of an MCP server (aggregated) - * - * Returns all available versions for a specific MCP server from all registries (aggregated view) - * - * @deprecated - */ -export const getRegistryV01ServersByServerNameVersions = < - ThrowOnError extends boolean = false, ->( - options: Options, -) => - (options.client ?? client).get< - GetRegistryV01ServersByServerNameVersionsResponses, - GetRegistryV01ServersByServerNameVersionsErrors, - ThrowOnError - >({ - security: [{ name: "Authorization", type: "apiKey" }], - url: "/registry/v0.1/servers/{serverName}/versions", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }); - -/** - * Get specific MCP server version (aggregated) - * - * Returns detailed information about a specific version of an MCP server from all registries. - * Use the special version `latest` to get the latest version. - * - * @deprecated - */ -export const getRegistryV01ServersByServerNameVersionsByVersion = < - ThrowOnError extends boolean = false, ->( - options: Options< - GetRegistryV01ServersByServerNameVersionsByVersionData, - ThrowOnError - >, -) => - (options.client ?? client).get< - GetRegistryV01ServersByServerNameVersionsByVersionResponses, - GetRegistryV01ServersByServerNameVersionsByVersionErrors, - ThrowOnError - >({ - security: [{ name: "Authorization", type: "apiKey" }], - url: "/registry/v0.1/servers/{serverName}/versions/{version}", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }); - /** * List servers in specific registry * @@ -405,32 +183,6 @@ export const getRegistryByRegistryNameV01ServersByServerNameVersions = < }, }); -/** - * Delete server version from specific registry - * - * Delete a server version from a specific managed registry - */ -export const deleteRegistryByRegistryNameV01ServersByServerNameVersionsByVersion = - ( - options: Options< - DeleteRegistryByRegistryNameV01ServersByServerNameVersionsByVersionData, - ThrowOnError - >, - ) => - (options.client ?? client).delete< - DeleteRegistryByRegistryNameV01ServersByServerNameVersionsByVersionResponses, - DeleteRegistryByRegistryNameV01ServersByServerNameVersionsByVersionErrors, - ThrowOnError - >({ - security: [{ name: "Authorization", type: "apiKey" }], - url: "/registry/{registryName}/v0.1/servers/{serverName}/versions/{version}", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }); - /** * Get specific MCP server version in specific registry * @@ -485,33 +237,6 @@ export const getRegistryByRegistryNameV01xDevToolhiveSkills = < }, }); -/** - * Publish skill - * - * Publish a skill version to the registry. - */ -export const postRegistryByRegistryNameV01xDevToolhiveSkills = < - ThrowOnError extends boolean = false, ->( - options: Options< - PostRegistryByRegistryNameV01xDevToolhiveSkillsData, - ThrowOnError - >, -) => - (options.client ?? client).post< - PostRegistryByRegistryNameV01xDevToolhiveSkillsResponses, - PostRegistryByRegistryNameV01xDevToolhiveSkillsErrors, - ThrowOnError - >({ - security: [{ name: "Authorization", type: "apiKey" }], - url: "/registry/{registryName}/v0.1/x/dev.toolhive/skills", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }); - /** * Get latest skill version * @@ -565,32 +290,6 @@ export const getRegistryByRegistryNameV01xDevToolhiveSkillsByNamespaceByNameVers }, }); -/** - * Delete skill version - * - * Delete a specific version of a skill from the registry. - */ -export const deleteRegistryByRegistryNameV01xDevToolhiveSkillsByNamespaceByNameVersionsByVersion = - ( - options: Options< - DeleteRegistryByRegistryNameV01xDevToolhiveSkillsByNamespaceByNameVersionsByVersionData, - ThrowOnError - >, - ) => - (options.client ?? client).delete< - DeleteRegistryByRegistryNameV01xDevToolhiveSkillsByNamespaceByNameVersionsByVersionResponses, - DeleteRegistryByRegistryNameV01xDevToolhiveSkillsByNamespaceByNameVersionsByVersionErrors, - ThrowOnError - >({ - security: [{ name: "Authorization", type: "apiKey" }], - url: "/registry/{registryName}/v0.1/x/dev.toolhive/skills/{namespace}/{name}/versions/{version}", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }); - /** * Get specific skill version * @@ -620,17 +319,21 @@ export const getRegistryByRegistryNameV01xDevToolhiveSkillsByNamespaceByNameVers /** * Publish entry * - * Publish a new entry + * Publish a new server or skill entry. Exactly one of 'server' or 'skill' must be provided. */ export const postV1Entries = ( - options?: Options, + options: Options, ) => - (options?.client ?? client).post({ + (options.client ?? client).post< + PostV1EntriesResponses, + PostV1EntriesErrors, + ThrowOnError + >({ url: "/v1/entries", ...options, headers: { "Content-Type": "application/json", - ...options?.headers, + ...options.headers, }, }); @@ -671,7 +374,7 @@ export const deleteV1EntriesByTypeByNameVersionsByVersion = < >, ) => (options.client ?? client).delete< - unknown, + DeleteV1EntriesByTypeByNameVersionsByVersionResponses, DeleteV1EntriesByTypeByNameVersionsByVersionErrors, ThrowOnError >({ @@ -691,16 +394,18 @@ export const deleteV1EntriesByTypeByNameVersionsByVersion = < export const getV1Registries = ( options?: Options, ) => - (options?.client ?? client).get( - { - url: "/v1/registries", - ...options, - headers: { - "Content-Type": "application/json", - ...options?.headers, - }, + (options?.client ?? client).get< + GetV1RegistriesResponses, + GetV1RegistriesErrors, + ThrowOnError + >({ + url: "/v1/registries", + ...options, + headers: { + "Content-Type": "application/json", + ...options?.headers, }, - ); + }); /** * Delete registry @@ -711,7 +416,7 @@ export const deleteV1RegistriesByName = ( options: Options, ) => (options.client ?? client).delete< - unknown, + DeleteV1RegistriesByNameResponses, DeleteV1RegistriesByNameErrors, ThrowOnError >({ @@ -732,7 +437,7 @@ export const getV1RegistriesByName = ( options: Options, ) => (options.client ?? client).get< - unknown, + GetV1RegistriesByNameResponses, GetV1RegistriesByNameErrors, ThrowOnError >({ @@ -753,7 +458,7 @@ export const putV1RegistriesByName = ( options: Options, ) => (options.client ?? client).put< - unknown, + PutV1RegistriesByNameResponses, PutV1RegistriesByNameErrors, ThrowOnError >({ @@ -776,7 +481,7 @@ export const getV1RegistriesByNameEntries = < options: Options, ) => (options.client ?? client).get< - unknown, + GetV1RegistriesByNameEntriesResponses, GetV1RegistriesByNameEntriesErrors, ThrowOnError >({ @@ -796,7 +501,11 @@ export const getV1RegistriesByNameEntries = < export const getV1Sources = ( options?: Options, ) => - (options?.client ?? client).get({ + (options?.client ?? client).get< + GetV1SourcesResponses, + GetV1SourcesErrors, + ThrowOnError + >({ url: "/v1/sources", ...options, headers: { @@ -814,7 +523,7 @@ export const deleteV1SourcesByName = ( options: Options, ) => (options.client ?? client).delete< - unknown, + DeleteV1SourcesByNameResponses, DeleteV1SourcesByNameErrors, ThrowOnError >({ @@ -835,7 +544,7 @@ export const getV1SourcesByName = ( options: Options, ) => (options.client ?? client).get< - unknown, + GetV1SourcesByNameResponses, GetV1SourcesByNameErrors, ThrowOnError >({ @@ -856,7 +565,7 @@ export const putV1SourcesByName = ( options: Options, ) => (options.client ?? client).put< - unknown, + PutV1SourcesByNameResponses, PutV1SourcesByNameErrors, ThrowOnError >({ @@ -877,7 +586,7 @@ export const getV1SourcesByNameEntries = ( options: Options, ) => (options.client ?? client).get< - unknown, + GetV1SourcesByNameEntriesResponses, GetV1SourcesByNameEntriesErrors, ThrowOnError >({ @@ -901,27 +610,3 @@ export const getVersion = ( url: "/version", ...options, }); - -/** - * Publish server to specific registry - * - * Publish a server version to a specific managed registry - */ -export const postByRegistryNameV01Publish = < - ThrowOnError extends boolean = false, ->( - options: Options, -) => - (options.client ?? client).post< - PostByRegistryNameV01PublishResponses, - PostByRegistryNameV01PublishErrors, - ThrowOnError - >({ - security: [{ name: "Authorization", type: "apiKey" }], - url: "/{registryName}/v0.1/publish", - ...options, - headers: { - "Content-Type": "application/json", - ...options.headers, - }, - }); diff --git a/src/generated/types.gen.ts b/src/generated/types.gen.ts index fe307a20..bde4a386 100644 --- a/src/generated/types.gen.ts +++ b/src/generated/types.gen.ts @@ -4,51 +4,6 @@ export type ClientOptions = { baseUrl: `${string}://${string}` | (string & {}); }; -/** - * API endpoint source - */ -export type GithubComStacklokToolhiveRegistryServerInternalConfigApiConfig = { - /** - * Endpoint is the base API URL (without path) - * The registry handler will append the appropriate paths for the MCP Registry API v0.1: - * - /v0.1/servers - List all servers - * - /v0.1/servers/{name}/versions - List server versions - * - /v0.1/servers/{name}/versions/{version} - Get specific version - * Example: "http://my-registry-api.default.svc.cluster.local/registry" - */ - endpoint?: string; -}; - -/** - * Local file or URL source - */ -export type GithubComStacklokToolhiveRegistryServerInternalConfigFileConfig = { - /** - * Data is the inline registry data as a JSON string - * Mutually exclusive with Path and URL - exactly one must be specified - * Useful for API-created registries where the data is provided directly - */ - data?: string; - /** - * Path is the path to the registry.json file on the local filesystem - * Can be absolute or relative to the working directory - * Mutually exclusive with URL and Data - exactly one must be specified - */ - path?: string; - /** - * Timeout is the timeout for HTTP requests when using URL - * Defaults to 30s if not specified - * Only applicable when URL is set - */ - timeout?: string; - /** - * URL is the HTTP/HTTPS URL to fetch the registry file from - * Mutually exclusive with Path and Data - exactly one must be specified - * HTTPS is required unless the host is localhost or THV_REGISTRY_INSECURE_URL=true - */ - url?: string; -}; - /** * Filtering rules */ @@ -58,65 +13,6 @@ export type GithubComStacklokToolhiveRegistryServerInternalConfigFilterConfig = tags?: GithubComStacklokToolhiveRegistryServerInternalConfigTagFilterConfig; }; -/** - * Auth contains optional authentication for private repositories - */ -export type GithubComStacklokToolhiveRegistryServerInternalConfigGitAuthConfig = - { - /** - * PasswordFile is the path to a file containing the Git password/token - * Must be an absolute path; whitespace is trimmed from the content - */ - passwordFile?: string; - /** - * Username is the Git username for HTTP Basic authentication - */ - username?: string; - }; - -/** - * Git repository source - */ -export type GithubComStacklokToolhiveRegistryServerInternalConfigGitConfig = { - auth?: GithubComStacklokToolhiveRegistryServerInternalConfigGitAuthConfig; - /** - * Branch is the Git branch to use (mutually exclusive with Tag and Commit) - */ - branch?: string; - /** - * Commit is the Git commit SHA to use (mutually exclusive with Branch and Tag) - */ - commit?: string; - /** - * Path is the path to the registry file within the repository - */ - path?: string; - /** - * Repository is the Git repository URL (HTTP/HTTPS/SSH) - */ - repository?: string; - /** - * Tag is the Git tag to use (mutually exclusive with Branch and Commit) - */ - tag?: string; -}; - -/** - * Kubernetes discovery source - */ -export type GithubComStacklokToolhiveRegistryServerInternalConfigKubernetesConfig = - { - [key: string]: unknown; - }; - -/** - * Managed registry (no sync) - */ -export type GithubComStacklokToolhiveRegistryServerInternalConfigManagedConfig = - { - [key: string]: unknown; - }; - export type GithubComStacklokToolhiveRegistryServerInternalConfigNameFilterConfig = { exclude?: Array; @@ -133,14 +29,6 @@ export type GithubComStacklokToolhiveRegistryServerInternalConfigSourceType = | "managed" | "kubernetes"; -/** - * Sync schedule configuration - */ -export type GithubComStacklokToolhiveRegistryServerInternalConfigSyncPolicyConfig = - { - interval?: string; - }; - export type GithubComStacklokToolhiveRegistryServerInternalConfigTagFilterConfig = { exclude?: Array; @@ -154,54 +42,140 @@ export type GithubComStacklokToolhiveRegistryServerInternalServiceCreationType = | "API" | "CONFIG"; -export type GithubComStacklokToolhiveRegistryServerInternalServiceRegistryCreateRequest = +export type GithubComStacklokToolhiveRegistryServerInternalServiceEntryVersionInfo = { - api?: GithubComStacklokToolhiveRegistryServerInternalConfigApiConfig; - file?: GithubComStacklokToolhiveRegistryServerInternalConfigFileConfig; - filter?: GithubComStacklokToolhiveRegistryServerInternalConfigFilterConfig; - /** - * "toolhive" or "upstream" - */ - format?: string; - git?: GithubComStacklokToolhiveRegistryServerInternalConfigGitConfig; - kubernetes?: GithubComStacklokToolhiveRegistryServerInternalConfigKubernetesConfig; - managed?: GithubComStacklokToolhiveRegistryServerInternalConfigManagedConfig; - syncPolicy?: GithubComStacklokToolhiveRegistryServerInternalConfigSyncPolicyConfig; + createdAt?: string; + description?: string; + title?: string; + updatedAt?: string; + version?: string; + }; + +export type GithubComStacklokToolhiveRegistryServerInternalServiceRegistryEntriesResponse = + { + entries?: Array; + }; + +export type GithubComStacklokToolhiveRegistryServerInternalServiceRegistryEntryInfo = + { + entryType?: string; + name?: string; + sourceName?: string; + version?: string; }; export type GithubComStacklokToolhiveRegistryServerInternalServiceRegistryInfo = { createdAt?: string; creationType?: GithubComStacklokToolhiveRegistryServerInternalServiceCreationType; - filterConfig?: GithubComStacklokToolhiveRegistryServerInternalConfigFilterConfig; - /** - * toolhive or upstream - */ - format?: string; name?: string; - /** - * Type-specific source configuration - */ - sourceConfig?: unknown; - sourceType?: GithubComStacklokToolhiveRegistryServerInternalConfigSourceType; - /** - * Sync interval string - */ - syncSchedule?: string; - syncStatus?: GithubComStacklokToolhiveRegistryServerInternalServiceRegistrySyncStatus; - /** - * MANAGED, FILE, REMOTE, KUBERNETES - */ - type?: string; + sources?: Array; updatedAt?: string; }; -export type GithubComStacklokToolhiveRegistryServerInternalServiceRegistryListResponse = +export type GithubComStacklokToolhiveRegistryServerInternalServiceSkill = { + _meta?: { + [key: string]: unknown; + }; + allowedTools?: Array; + compatibility?: string; + createdAt?: string; + description?: string; + icons?: Array; + id?: string; + isLatest?: boolean; + license?: string; + metadata?: { + [key: string]: unknown; + }; + name?: string; + namespace?: string; + packages?: Array; + repository?: GithubComStacklokToolhiveRegistryServerInternalServiceSkillRepository; + status?: string; + title?: string; + updatedAt?: string; + version?: string; +}; + +export type GithubComStacklokToolhiveRegistryServerInternalServiceSkillIcon = { + label?: string; + size?: string; + src?: string; + type?: string; +}; + +export type GithubComStacklokToolhiveRegistryServerInternalServiceSkillPackage = + { + commit?: string; + digest?: string; + identifier?: string; + mediaType?: string; + ref?: string; + registryType?: string; + subfolder?: string; + url?: string; + }; + +export type GithubComStacklokToolhiveRegistryServerInternalServiceSkillRepository = + { + type?: string; + url?: string; + }; + +export type GithubComStacklokToolhiveRegistryServerInternalServiceSourceEntriesResponse = + { + entries?: Array; + }; + +export type GithubComStacklokToolhiveRegistryServerInternalServiceSourceEntryInfo = + { + claims?: { + [key: string]: unknown; + }; + entryType?: string; + name?: string; + versions?: Array; + }; + +export type GithubComStacklokToolhiveRegistryServerInternalServiceSourceInfo = { + /** + * Authorization claims + */ + claims?: { + [key: string]: unknown; + }; + createdAt?: string; + creationType?: GithubComStacklokToolhiveRegistryServerInternalServiceCreationType; + filterConfig?: GithubComStacklokToolhiveRegistryServerInternalConfigFilterConfig; + /** + * toolhive or upstream + */ + format?: string; + name?: string; + /** + * Type-specific source configuration + */ + sourceConfig?: unknown; + sourceType?: GithubComStacklokToolhiveRegistryServerInternalConfigSourceType; + /** + * Sync interval string + */ + syncSchedule?: string; + syncStatus?: GithubComStacklokToolhiveRegistryServerInternalServiceSourceSyncStatus; + /** + * MANAGED, FILE, REMOTE, KUBERNETES + */ + type?: string; + updatedAt?: string; +}; + +export type GithubComStacklokToolhiveRegistryServerInternalServiceSourceListResponse = { - registries?: Array; + sources?: Array; }; -export type GithubComStacklokToolhiveRegistryServerInternalServiceRegistrySyncStatus = +export type GithubComStacklokToolhiveRegistryServerInternalServiceSourceSyncStatus = { /** * Number of sync attempts @@ -245,6 +219,18 @@ export type InternalApiVersionResponse = { version?: string; }; +export type InternalApiV1PublishEntryRequest = { + claims?: { + [key: string]: unknown; + }; + server?: V0ServerJson; + skill?: GithubComStacklokToolhiveRegistryServerInternalServiceSkill; +}; + +export type InternalApiV1RegistryListResponse = { + registries?: Array; +}; + export type InternalApiXSkillsSkillListMetadata = { count?: number; nextCursor?: string; @@ -498,6 +484,8 @@ export type V0RegistryExtensions = { isLatest?: boolean; publishedAt?: string; status?: ModelStatus; + statusChangedAt?: string; + statusMessage?: string; updatedAt?: string; }; @@ -535,58 +523,113 @@ export type V0ServerResponse = { server?: V0ServerJson; }; -export type GetExtensionV0RegistriesData = { - body?: { - [key: string]: unknown; - }; +export type GetHealthData = { + body?: never; path?: never; query?: never; - url: "/extension/v0/registries"; + url: "/health"; }; -export type GetExtensionV0RegistriesErrors = { +export type GetHealthResponses = { /** - * Unauthorized + * OK */ - 401: { + 200: InternalApiHealthResponse; +}; + +export type GetHealthResponse = GetHealthResponses[keyof GetHealthResponses]; + +export type GetOpenapiJsonData = { + body?: never; + path?: never; + query?: never; + url: "/openapi.json"; +}; + +export type GetOpenapiJsonErrors = { + /** + * Internal Server Error + */ + 500: { [key: string]: string; }; +}; + +export type GetOpenapiJsonError = + GetOpenapiJsonErrors[keyof GetOpenapiJsonErrors]; + +export type GetOpenapiJsonResponses = { /** - * Internal server error + * OpenAPI 3.1.0 specification */ - 500: { + 200: { + [key: string]: unknown; + }; +}; + +export type GetOpenapiJsonResponse = + GetOpenapiJsonResponses[keyof GetOpenapiJsonResponses]; + +export type GetReadinessData = { + body?: never; + path?: never; + query?: never; + url: "/readiness"; +}; + +export type GetReadinessErrors = { + /** + * Service Unavailable + */ + 503: { [key: string]: string; }; }; -export type GetExtensionV0RegistriesError = - GetExtensionV0RegistriesErrors[keyof GetExtensionV0RegistriesErrors]; +export type GetReadinessError = GetReadinessErrors[keyof GetReadinessErrors]; -export type GetExtensionV0RegistriesResponses = { +export type GetReadinessResponses = { /** - * List of registries + * OK */ - 200: GithubComStacklokToolhiveRegistryServerInternalServiceRegistryListResponse; + 200: InternalApiReadinessResponse; }; -export type GetExtensionV0RegistriesResponse = - GetExtensionV0RegistriesResponses[keyof GetExtensionV0RegistriesResponses]; +export type GetReadinessResponse = + GetReadinessResponses[keyof GetReadinessResponses]; -export type DeleteExtensionV0RegistriesByRegistryNameData = { +export type GetRegistryByRegistryNameV01ServersData = { body?: { [key: string]: unknown; }; path: { /** - * Registry Name + * Registry name */ registryName: string; }; - query?: never; - url: "/extension/v0/registries/{registryName}"; + query?: { + /** + * Pagination cursor for retrieving next set of results + */ + cursor?: string; + /** + * Maximum number of items to return + */ + limit?: number; + /** + * Search servers by name (substring match) + */ + search?: string; + /** + * Filter by version ('latest' for latest version, or an exact version like '1.2.3') + */ + version?: string; + }; + url: "/registry/{registryName}/v0.1/servers"; }; -export type DeleteExtensionV0RegistriesByRegistryNameErrors = { +export type GetRegistryByRegistryNameV01ServersErrors = { /** * Bad request */ @@ -599,488 +642,20 @@ export type DeleteExtensionV0RegistriesByRegistryNameErrors = { 401: { [key: string]: string; }; - /** - * Forbidden - cannot delete CONFIG registry - */ - 403: { - [key: string]: string; - }; /** * Registry not found */ 404: { [key: string]: string; }; - /** - * Internal server error - */ - 500: { - [key: string]: string; - }; - /** - * Not implemented - */ - 501: { - [key: string]: string; - }; }; -export type DeleteExtensionV0RegistriesByRegistryNameError = - DeleteExtensionV0RegistriesByRegistryNameErrors[keyof DeleteExtensionV0RegistriesByRegistryNameErrors]; +export type GetRegistryByRegistryNameV01ServersError = + GetRegistryByRegistryNameV01ServersErrors[keyof GetRegistryByRegistryNameV01ServersErrors]; -export type DeleteExtensionV0RegistriesByRegistryNameResponses = { +export type GetRegistryByRegistryNameV01ServersResponses = { /** - * Registry deleted - */ - 204: void; -}; - -export type DeleteExtensionV0RegistriesByRegistryNameResponse = - DeleteExtensionV0RegistriesByRegistryNameResponses[keyof DeleteExtensionV0RegistriesByRegistryNameResponses]; - -export type GetExtensionV0RegistriesByRegistryNameData = { - body?: { - [key: string]: unknown; - }; - path: { - /** - * Registry Name - */ - registryName: string; - }; - query?: never; - url: "/extension/v0/registries/{registryName}"; -}; - -export type GetExtensionV0RegistriesByRegistryNameErrors = { - /** - * Bad request - */ - 400: { - [key: string]: string; - }; - /** - * Unauthorized - */ - 401: { - [key: string]: string; - }; - /** - * Registry not found - */ - 404: { - [key: string]: string; - }; - /** - * Internal server error - */ - 500: { - [key: string]: string; - }; - /** - * Not implemented - */ - 501: { - [key: string]: string; - }; -}; - -export type GetExtensionV0RegistriesByRegistryNameError = - GetExtensionV0RegistriesByRegistryNameErrors[keyof GetExtensionV0RegistriesByRegistryNameErrors]; - -export type GetExtensionV0RegistriesByRegistryNameResponses = { - /** - * Registry details - */ - 200: GithubComStacklokToolhiveRegistryServerInternalServiceRegistryInfo; -}; - -export type GetExtensionV0RegistriesByRegistryNameResponse = - GetExtensionV0RegistriesByRegistryNameResponses[keyof GetExtensionV0RegistriesByRegistryNameResponses]; - -export type PutExtensionV0RegistriesByRegistryNameData = { - /** - * Registry configuration - */ - body: - | { - [key: string]: unknown; - } - | GithubComStacklokToolhiveRegistryServerInternalServiceRegistryCreateRequest; - path: { - /** - * Registry Name - */ - registryName: string; - }; - query?: never; - url: "/extension/v0/registries/{registryName}"; -}; - -export type PutExtensionV0RegistriesByRegistryNameErrors = { - /** - * Bad request - invalid configuration - */ - 400: { - [key: string]: string; - }; - /** - * Unauthorized - */ - 401: { - [key: string]: string; - }; - /** - * Forbidden - cannot modify CONFIG registry - */ - 403: { - [key: string]: string; - }; - /** - * Internal server error - */ - 500: { - [key: string]: string; - }; - /** - * Not implemented - */ - 501: { - [key: string]: string; - }; -}; - -export type PutExtensionV0RegistriesByRegistryNameError = - PutExtensionV0RegistriesByRegistryNameErrors[keyof PutExtensionV0RegistriesByRegistryNameErrors]; - -export type PutExtensionV0RegistriesByRegistryNameResponses = { - /** - * Registry updated - */ - 200: GithubComStacklokToolhiveRegistryServerInternalServiceRegistryInfo; - /** - * Registry created - */ - 201: GithubComStacklokToolhiveRegistryServerInternalServiceRegistryInfo; -}; - -export type PutExtensionV0RegistriesByRegistryNameResponse = - PutExtensionV0RegistriesByRegistryNameResponses[keyof PutExtensionV0RegistriesByRegistryNameResponses]; - -export type GetHealthData = { - body?: never; - path?: never; - query?: never; - url: "/health"; -}; - -export type GetHealthResponses = { - /** - * OK - */ - 200: InternalApiHealthResponse; -}; - -export type GetHealthResponse = GetHealthResponses[keyof GetHealthResponses]; - -export type GetOpenapiJsonData = { - body?: never; - path?: never; - query?: never; - url: "/openapi.json"; -}; - -export type GetOpenapiJsonErrors = { - /** - * Internal Server Error - */ - 500: { - [key: string]: string; - }; -}; - -export type GetOpenapiJsonError = - GetOpenapiJsonErrors[keyof GetOpenapiJsonErrors]; - -export type GetOpenapiJsonResponses = { - /** - * OpenAPI 3.1.0 specification - */ - 200: { - [key: string]: unknown; - }; -}; - -export type GetOpenapiJsonResponse = - GetOpenapiJsonResponses[keyof GetOpenapiJsonResponses]; - -export type GetReadinessData = { - body?: never; - path?: never; - query?: never; - url: "/readiness"; -}; - -export type GetReadinessErrors = { - /** - * Service Unavailable - */ - 503: { - [key: string]: string; - }; -}; - -export type GetReadinessError = GetReadinessErrors[keyof GetReadinessErrors]; - -export type GetReadinessResponses = { - /** - * OK - */ - 200: InternalApiReadinessResponse; -}; - -export type GetReadinessResponse = - GetReadinessResponses[keyof GetReadinessResponses]; - -export type PostRegistryV01PublishData = { - body?: { - [key: string]: unknown; - }; - path?: never; - query?: never; - url: "/registry/v0.1/publish"; -}; - -export type PostRegistryV01PublishErrors = { - /** - * Unauthorized - */ - 401: { - [key: string]: string; - }; - /** - * Not implemented - */ - 501: { - [key: string]: string; - }; -}; - -export type PostRegistryV01PublishError = - PostRegistryV01PublishErrors[keyof PostRegistryV01PublishErrors]; - -export type GetRegistryV01ServersData = { - body?: { - [key: string]: unknown; - }; - path?: never; - query?: { - /** - * Pagination cursor for retrieving next set of results - */ - cursor?: string; - /** - * Maximum number of items to return - */ - limit?: number; - /** - * Search servers by name (substring match) - */ - search?: string; - /** - * Filter by version ('latest' for latest version, or an exact version like '1.2.3') - */ - version?: string; - }; - url: "/registry/v0.1/servers"; -}; - -export type GetRegistryV01ServersErrors = { - /** - * Bad request - */ - 400: { - [key: string]: string; - }; - /** - * Unauthorized - */ - 401: { - [key: string]: string; - }; -}; - -export type GetRegistryV01ServersError = - GetRegistryV01ServersErrors[keyof GetRegistryV01ServersErrors]; - -export type GetRegistryV01ServersResponses = { - /** - * OK - */ - 200: V0ServerListResponse; -}; - -export type GetRegistryV01ServersResponse = - GetRegistryV01ServersResponses[keyof GetRegistryV01ServersResponses]; - -export type GetRegistryV01ServersByServerNameVersionsData = { - body?: { - [key: string]: unknown; - }; - path: { - /** - * URL-encoded server name (e.g., \ - */ - serverName: string; - }; - query?: never; - url: "/registry/v0.1/servers/{serverName}/versions"; -}; - -export type GetRegistryV01ServersByServerNameVersionsErrors = { - /** - * Bad request - */ - 400: { - [key: string]: string; - }; - /** - * Unauthorized - */ - 401: { - [key: string]: string; - }; - /** - * Server not found - */ - 404: { - [key: string]: string; - }; -}; - -export type GetRegistryV01ServersByServerNameVersionsError = - GetRegistryV01ServersByServerNameVersionsErrors[keyof GetRegistryV01ServersByServerNameVersionsErrors]; - -export type GetRegistryV01ServersByServerNameVersionsResponses = { - /** - * A list of all versions for the server - */ - 200: V0ServerListResponse; -}; - -export type GetRegistryV01ServersByServerNameVersionsResponse = - GetRegistryV01ServersByServerNameVersionsResponses[keyof GetRegistryV01ServersByServerNameVersionsResponses]; - -export type GetRegistryV01ServersByServerNameVersionsByVersionData = { - body?: { - [key: string]: unknown; - }; - path: { - /** - * URL-encoded server name (e.g., \ - */ - serverName: string; - /** - * URL-encoded version to retrieve (e.g., \ - */ - version: string; - }; - query?: never; - url: "/registry/v0.1/servers/{serverName}/versions/{version}"; -}; - -export type GetRegistryV01ServersByServerNameVersionsByVersionErrors = { - /** - * Bad request - */ - 400: { - [key: string]: string; - }; - /** - * Unauthorized - */ - 401: { - [key: string]: string; - }; - /** - * Server or version not found - */ - 404: { - [key: string]: string; - }; -}; - -export type GetRegistryV01ServersByServerNameVersionsByVersionError = - GetRegistryV01ServersByServerNameVersionsByVersionErrors[keyof GetRegistryV01ServersByServerNameVersionsByVersionErrors]; - -export type GetRegistryV01ServersByServerNameVersionsByVersionResponses = { - /** - * Detailed server information - */ - 200: V0ServerResponse; -}; - -export type GetRegistryV01ServersByServerNameVersionsByVersionResponse = - GetRegistryV01ServersByServerNameVersionsByVersionResponses[keyof GetRegistryV01ServersByServerNameVersionsByVersionResponses]; - -export type GetRegistryByRegistryNameV01ServersData = { - body?: { - [key: string]: unknown; - }; - path: { - /** - * Registry name - */ - registryName: string; - }; - query?: { - /** - * Pagination cursor for retrieving next set of results - */ - cursor?: string; - /** - * Maximum number of items to return - */ - limit?: number; - /** - * Search servers by name (substring match) - */ - search?: string; - /** - * Filter by version ('latest' for latest version, or an exact version like '1.2.3') - */ - version?: string; - }; - url: "/registry/{registryName}/v0.1/servers"; -}; - -export type GetRegistryByRegistryNameV01ServersErrors = { - /** - * Bad request - */ - 400: { - [key: string]: string; - }; - /** - * Unauthorized - */ - 401: { - [key: string]: string; - }; - /** - * Registry not found - */ - 404: { - [key: string]: string; - }; -}; - -export type GetRegistryByRegistryNameV01ServersError = - GetRegistryByRegistryNameV01ServersErrors[keyof GetRegistryByRegistryNameV01ServersErrors]; - -export type GetRegistryByRegistryNameV01ServersResponses = { - /** - * OK + * OK */ 200: V0ServerListResponse; }; @@ -1140,77 +715,6 @@ export type GetRegistryByRegistryNameV01ServersByServerNameVersionsResponses = { export type GetRegistryByRegistryNameV01ServersByServerNameVersionsResponse = GetRegistryByRegistryNameV01ServersByServerNameVersionsResponses[keyof GetRegistryByRegistryNameV01ServersByServerNameVersionsResponses]; -export type DeleteRegistryByRegistryNameV01ServersByServerNameVersionsByVersionData = - { - body?: { - [key: string]: unknown; - }; - path: { - /** - * Registry name - */ - registryName: string; - /** - * Server name (URL-encoded) - */ - serverName: string; - /** - * Version (URL-encoded) - */ - version: string; - }; - query?: never; - url: "/registry/{registryName}/v0.1/servers/{serverName}/versions/{version}"; - }; - -export type DeleteRegistryByRegistryNameV01ServersByServerNameVersionsByVersionErrors = - { - /** - * Bad request - */ - 400: { - [key: string]: string; - }; - /** - * Unauthorized - */ - 401: { - [key: string]: string; - }; - /** - * Not a managed registry - */ - 403: { - [key: string]: string; - }; - /** - * Server version not found - */ - 404: { - [key: string]: string; - }; - /** - * Internal server error - */ - 500: { - [key: string]: string; - }; - }; - -export type DeleteRegistryByRegistryNameV01ServersByServerNameVersionsByVersionError = - DeleteRegistryByRegistryNameV01ServersByServerNameVersionsByVersionErrors[keyof DeleteRegistryByRegistryNameV01ServersByServerNameVersionsByVersionErrors]; - -export type DeleteRegistryByRegistryNameV01ServersByServerNameVersionsByVersionResponses = - { - /** - * No content - */ - 204: void; - }; - -export type DeleteRegistryByRegistryNameV01ServersByServerNameVersionsByVersionResponse = - DeleteRegistryByRegistryNameV01ServersByServerNameVersionsByVersionResponses[keyof DeleteRegistryByRegistryNameV01ServersByServerNameVersionsByVersionResponses]; - export type GetRegistryByRegistryNameV01ServersByServerNameVersionsByVersionData = { body?: { @@ -1329,71 +833,6 @@ export type GetRegistryByRegistryNameV01xDevToolhiveSkillsResponses = { export type GetRegistryByRegistryNameV01xDevToolhiveSkillsResponse = GetRegistryByRegistryNameV01xDevToolhiveSkillsResponses[keyof GetRegistryByRegistryNameV01xDevToolhiveSkillsResponses]; -export type PostRegistryByRegistryNameV01xDevToolhiveSkillsData = { - /** - * Skill data - */ - body: - | { - [key: string]: unknown; - } - | RegistrySkill; - path: { - /** - * Registry name - */ - registryName: string; - }; - query?: never; - url: "/registry/{registryName}/v0.1/x/dev.toolhive/skills"; -}; - -export type PostRegistryByRegistryNameV01xDevToolhiveSkillsErrors = { - /** - * Bad request - */ - 400: { - [key: string]: string; - }; - /** - * Unauthorized - */ - 401: { - [key: string]: string; - }; - /** - * Not a managed registry - */ - 403: { - [key: string]: string; - }; - /** - * Version already exists - */ - 409: { - [key: string]: string; - }; - /** - * Internal server error - */ - 500: { - [key: string]: string; - }; -}; - -export type PostRegistryByRegistryNameV01xDevToolhiveSkillsError = - PostRegistryByRegistryNameV01xDevToolhiveSkillsErrors[keyof PostRegistryByRegistryNameV01xDevToolhiveSkillsErrors]; - -export type PostRegistryByRegistryNameV01xDevToolhiveSkillsResponses = { - /** - * Created - */ - 201: RegistrySkill; -}; - -export type PostRegistryByRegistryNameV01xDevToolhiveSkillsResponse = - PostRegistryByRegistryNameV01xDevToolhiveSkillsResponses[keyof PostRegistryByRegistryNameV01xDevToolhiveSkillsResponses]; - export type GetRegistryByRegistryNameV01xDevToolhiveSkillsByNamespaceByNameData = { body?: { @@ -1512,81 +951,6 @@ export type GetRegistryByRegistryNameV01xDevToolhiveSkillsByNamespaceByNameVersi export type GetRegistryByRegistryNameV01xDevToolhiveSkillsByNamespaceByNameVersionsResponse = GetRegistryByRegistryNameV01xDevToolhiveSkillsByNamespaceByNameVersionsResponses[keyof GetRegistryByRegistryNameV01xDevToolhiveSkillsByNamespaceByNameVersionsResponses]; -export type DeleteRegistryByRegistryNameV01xDevToolhiveSkillsByNamespaceByNameVersionsByVersionData = - { - body?: { - [key: string]: unknown; - }; - path: { - /** - * Registry name - */ - registryName: string; - /** - * Skill namespace (reverse-DNS) - */ - namespace: string; - /** - * Skill name - */ - name: string; - /** - * Skill version - */ - version: string; - }; - query?: never; - url: "/registry/{registryName}/v0.1/x/dev.toolhive/skills/{namespace}/{name}/versions/{version}"; - }; - -export type DeleteRegistryByRegistryNameV01xDevToolhiveSkillsByNamespaceByNameVersionsByVersionErrors = - { - /** - * Bad request - */ - 400: { - [key: string]: string; - }; - /** - * Unauthorized - */ - 401: { - [key: string]: string; - }; - /** - * Not a managed registry - */ - 403: { - [key: string]: string; - }; - /** - * Skill version not found - */ - 404: { - [key: string]: string; - }; - /** - * Internal server error - */ - 500: { - [key: string]: string; - }; - }; - -export type DeleteRegistryByRegistryNameV01xDevToolhiveSkillsByNamespaceByNameVersionsByVersionError = - DeleteRegistryByRegistryNameV01xDevToolhiveSkillsByNamespaceByNameVersionsByVersionErrors[keyof DeleteRegistryByRegistryNameV01xDevToolhiveSkillsByNamespaceByNameVersionsByVersionErrors]; - -export type DeleteRegistryByRegistryNameV01xDevToolhiveSkillsByNamespaceByNameVersionsByVersionResponses = - { - /** - * No content - */ - 204: void; - }; - -export type DeleteRegistryByRegistryNameV01xDevToolhiveSkillsByNamespaceByNameVersionsByVersionResponse = - DeleteRegistryByRegistryNameV01xDevToolhiveSkillsByNamespaceByNameVersionsByVersionResponses[keyof DeleteRegistryByRegistryNameV01xDevToolhiveSkillsByNamespaceByNameVersionsByVersionResponses]; - export type GetRegistryByRegistryNameV01xDevToolhiveSkillsByNamespaceByNameVersionsByVersionData = { body?: { @@ -1651,9 +1015,14 @@ export type GetRegistryByRegistryNameV01xDevToolhiveSkillsByNamespaceByNameVersi GetRegistryByRegistryNameV01xDevToolhiveSkillsByNamespaceByNameVersionsByVersionResponses[keyof GetRegistryByRegistryNameV01xDevToolhiveSkillsByNamespaceByNameVersionsByVersionResponses]; export type PostV1EntriesData = { - body?: { - [key: string]: unknown; - }; + /** + * Entry to publish (server or skill) + */ + body: + | { + [key: string]: unknown; + } + | InternalApiV1PublishEntryRequest; path?: never; query?: never; url: "/v1/entries"; @@ -1661,15 +1030,39 @@ export type PostV1EntriesData = { export type PostV1EntriesErrors = { /** - * Not implemented + * Bad request */ - 501: { + 400: { + [key: string]: string; + }; + /** + * Conflict + */ + 409: { + [key: string]: string; + }; + /** + * Internal server error + */ + 500: { [key: string]: string; }; }; export type PostV1EntriesError = PostV1EntriesErrors[keyof PostV1EntriesErrors]; +export type PostV1EntriesResponses = { + /** + * Published entry (server or skill) + */ + 201: { + [key: string]: unknown; + }; +}; + +export type PostV1EntriesResponse = + PostV1EntriesResponses[keyof PostV1EntriesResponses]; + export type PutV1EntriesByTypeByNameClaimsData = { body?: { [key: string]: unknown; @@ -1736,9 +1129,15 @@ export type DeleteV1EntriesByTypeByNameVersionsByVersionErrors = { [key: string]: string; }; /** - * Not implemented + * Not found */ - 501: { + 404: { + [key: string]: string; + }; + /** + * Internal server error + */ + 500: { [key: string]: string; }; }; @@ -1746,6 +1145,16 @@ export type DeleteV1EntriesByTypeByNameVersionsByVersionErrors = { export type DeleteV1EntriesByTypeByNameVersionsByVersionError = DeleteV1EntriesByTypeByNameVersionsByVersionErrors[keyof DeleteV1EntriesByTypeByNameVersionsByVersionErrors]; +export type DeleteV1EntriesByTypeByNameVersionsByVersionResponses = { + /** + * No Content + */ + 204: void; +}; + +export type DeleteV1EntriesByTypeByNameVersionsByVersionResponse = + DeleteV1EntriesByTypeByNameVersionsByVersionResponses[keyof DeleteV1EntriesByTypeByNameVersionsByVersionResponses]; + export type GetV1RegistriesData = { body?: { [key: string]: unknown; @@ -1757,9 +1166,9 @@ export type GetV1RegistriesData = { export type GetV1RegistriesErrors = { /** - * Not implemented + * Internal server error */ - 501: { + 500: { [key: string]: string; }; }; @@ -1767,6 +1176,16 @@ export type GetV1RegistriesErrors = { export type GetV1RegistriesError = GetV1RegistriesErrors[keyof GetV1RegistriesErrors]; +export type GetV1RegistriesResponses = { + /** + * Registries list + */ + 200: InternalApiV1RegistryListResponse; +}; + +export type GetV1RegistriesResponse = + GetV1RegistriesResponses[keyof GetV1RegistriesResponses]; + export type DeleteV1RegistriesByNameData = { body?: { [key: string]: unknown; @@ -1789,9 +1208,21 @@ export type DeleteV1RegistriesByNameErrors = { [key: string]: string; }; /** - * Not implemented + * Cannot modify config-created registry */ - 501: { + 403: { + [key: string]: string; + }; + /** + * Registry not found + */ + 404: { + [key: string]: string; + }; + /** + * Internal server error + */ + 500: { [key: string]: string; }; }; @@ -1799,6 +1230,16 @@ export type DeleteV1RegistriesByNameErrors = { export type DeleteV1RegistriesByNameError = DeleteV1RegistriesByNameErrors[keyof DeleteV1RegistriesByNameErrors]; +export type DeleteV1RegistriesByNameResponses = { + /** + * Registry deleted + */ + 204: void; +}; + +export type DeleteV1RegistriesByNameResponse = + DeleteV1RegistriesByNameResponses[keyof DeleteV1RegistriesByNameResponses]; + export type GetV1RegistriesByNameData = { body?: { [key: string]: unknown; @@ -1821,9 +1262,15 @@ export type GetV1RegistriesByNameErrors = { [key: string]: string; }; /** - * Not implemented + * Registry not found */ - 501: { + 404: { + [key: string]: string; + }; + /** + * Internal server error + */ + 500: { [key: string]: string; }; }; @@ -1831,6 +1278,16 @@ export type GetV1RegistriesByNameErrors = { export type GetV1RegistriesByNameError = GetV1RegistriesByNameErrors[keyof GetV1RegistriesByNameErrors]; +export type GetV1RegistriesByNameResponses = { + /** + * Registry details + */ + 200: GithubComStacklokToolhiveRegistryServerInternalServiceRegistryInfo; +}; + +export type GetV1RegistriesByNameResponse = + GetV1RegistriesByNameResponses[keyof GetV1RegistriesByNameResponses]; + export type PutV1RegistriesByNameData = { body?: { [key: string]: unknown; @@ -1853,9 +1310,15 @@ export type PutV1RegistriesByNameErrors = { [key: string]: string; }; /** - * Not implemented + * Cannot modify config-created registry */ - 501: { + 403: { + [key: string]: string; + }; + /** + * Internal server error + */ + 500: { [key: string]: string; }; }; @@ -1863,6 +1326,20 @@ export type PutV1RegistriesByNameErrors = { export type PutV1RegistriesByNameError = PutV1RegistriesByNameErrors[keyof PutV1RegistriesByNameErrors]; +export type PutV1RegistriesByNameResponses = { + /** + * Registry updated + */ + 200: GithubComStacklokToolhiveRegistryServerInternalServiceRegistryInfo; + /** + * Registry created + */ + 201: GithubComStacklokToolhiveRegistryServerInternalServiceRegistryInfo; +}; + +export type PutV1RegistriesByNameResponse = + PutV1RegistriesByNameResponses[keyof PutV1RegistriesByNameResponses]; + export type GetV1RegistriesByNameEntriesData = { body?: { [key: string]: unknown; @@ -1885,9 +1362,15 @@ export type GetV1RegistriesByNameEntriesErrors = { [key: string]: string; }; /** - * Not implemented + * Registry not found */ - 501: { + 404: { + [key: string]: string; + }; + /** + * Internal server error + */ + 500: { [key: string]: string; }; }; @@ -1895,6 +1378,16 @@ export type GetV1RegistriesByNameEntriesErrors = { export type GetV1RegistriesByNameEntriesError = GetV1RegistriesByNameEntriesErrors[keyof GetV1RegistriesByNameEntriesErrors]; +export type GetV1RegistriesByNameEntriesResponses = { + /** + * Registry entries + */ + 200: GithubComStacklokToolhiveRegistryServerInternalServiceRegistryEntriesResponse; +}; + +export type GetV1RegistriesByNameEntriesResponse = + GetV1RegistriesByNameEntriesResponses[keyof GetV1RegistriesByNameEntriesResponses]; + export type GetV1SourcesData = { body?: { [key: string]: unknown; @@ -1906,15 +1399,25 @@ export type GetV1SourcesData = { export type GetV1SourcesErrors = { /** - * Not implemented + * Internal server error */ - 501: { + 500: { [key: string]: string; }; }; export type GetV1SourcesError = GetV1SourcesErrors[keyof GetV1SourcesErrors]; +export type GetV1SourcesResponses = { + /** + * Sources list + */ + 200: GithubComStacklokToolhiveRegistryServerInternalServiceSourceListResponse; +}; + +export type GetV1SourcesResponse = + GetV1SourcesResponses[keyof GetV1SourcesResponses]; + export type DeleteV1SourcesByNameData = { body?: { [key: string]: unknown; @@ -1937,9 +1440,27 @@ export type DeleteV1SourcesByNameErrors = { [key: string]: string; }; /** - * Not implemented + * Cannot modify config-created source */ - 501: { + 403: { + [key: string]: string; + }; + /** + * Source not found + */ + 404: { + [key: string]: string; + }; + /** + * Source in use + */ + 409: { + [key: string]: string; + }; + /** + * Internal server error + */ + 500: { [key: string]: string; }; }; @@ -1947,6 +1468,16 @@ export type DeleteV1SourcesByNameErrors = { export type DeleteV1SourcesByNameError = DeleteV1SourcesByNameErrors[keyof DeleteV1SourcesByNameErrors]; +export type DeleteV1SourcesByNameResponses = { + /** + * Source deleted + */ + 204: void; +}; + +export type DeleteV1SourcesByNameResponse = + DeleteV1SourcesByNameResponses[keyof DeleteV1SourcesByNameResponses]; + export type GetV1SourcesByNameData = { body?: { [key: string]: unknown; @@ -1969,9 +1500,15 @@ export type GetV1SourcesByNameErrors = { [key: string]: string; }; /** - * Not implemented + * Source not found */ - 501: { + 404: { + [key: string]: string; + }; + /** + * Internal server error + */ + 500: { [key: string]: string; }; }; @@ -1979,6 +1516,16 @@ export type GetV1SourcesByNameErrors = { export type GetV1SourcesByNameError = GetV1SourcesByNameErrors[keyof GetV1SourcesByNameErrors]; +export type GetV1SourcesByNameResponses = { + /** + * Source details + */ + 200: GithubComStacklokToolhiveRegistryServerInternalServiceSourceInfo; +}; + +export type GetV1SourcesByNameResponse = + GetV1SourcesByNameResponses[keyof GetV1SourcesByNameResponses]; + export type PutV1SourcesByNameData = { body?: { [key: string]: unknown; @@ -2001,9 +1548,15 @@ export type PutV1SourcesByNameErrors = { [key: string]: string; }; /** - * Not implemented + * Cannot modify config-created source */ - 501: { + 403: { + [key: string]: string; + }; + /** + * Internal server error + */ + 500: { [key: string]: string; }; }; @@ -2011,6 +1564,20 @@ export type PutV1SourcesByNameErrors = { export type PutV1SourcesByNameError = PutV1SourcesByNameErrors[keyof PutV1SourcesByNameErrors]; +export type PutV1SourcesByNameResponses = { + /** + * Source updated + */ + 200: GithubComStacklokToolhiveRegistryServerInternalServiceSourceInfo; + /** + * Source created + */ + 201: GithubComStacklokToolhiveRegistryServerInternalServiceSourceInfo; +}; + +export type PutV1SourcesByNameResponse = + PutV1SourcesByNameResponses[keyof PutV1SourcesByNameResponses]; + export type GetV1SourcesByNameEntriesData = { body?: { [key: string]: unknown; @@ -2033,9 +1600,15 @@ export type GetV1SourcesByNameEntriesErrors = { [key: string]: string; }; /** - * Not implemented + * Source not found */ - 501: { + 404: { + [key: string]: string; + }; + /** + * Internal server error + */ + 500: { [key: string]: string; }; }; @@ -2043,6 +1616,16 @@ export type GetV1SourcesByNameEntriesErrors = { export type GetV1SourcesByNameEntriesError = GetV1SourcesByNameEntriesErrors[keyof GetV1SourcesByNameEntriesErrors]; +export type GetV1SourcesByNameEntriesResponses = { + /** + * Source entries + */ + 200: GithubComStacklokToolhiveRegistryServerInternalServiceSourceEntriesResponse; +}; + +export type GetV1SourcesByNameEntriesResponse = + GetV1SourcesByNameEntriesResponses[keyof GetV1SourcesByNameEntriesResponses]; + export type GetVersionData = { body?: never; path?: never; @@ -2058,74 +1641,3 @@ export type GetVersionResponses = { }; export type GetVersionResponse = GetVersionResponses[keyof GetVersionResponses]; - -export type PostByRegistryNameV01PublishData = { - /** - * Server data - */ - body: - | { - [key: string]: unknown; - } - | V0ServerJson; - path: { - /** - * Registry name - */ - registryName: string; - }; - query?: never; - url: "/{registryName}/v0.1/publish"; -}; - -export type PostByRegistryNameV01PublishErrors = { - /** - * Bad request - */ - 400: { - [key: string]: string; - }; - /** - * Unauthorized - */ - 401: { - [key: string]: string; - }; - /** - * Not a managed registry - */ - 403: { - [key: string]: string; - }; - /** - * Registry not found - */ - 404: { - [key: string]: string; - }; - /** - * Version already exists - */ - 409: { - [key: string]: string; - }; - /** - * Internal server error - */ - 500: { - [key: string]: string; - }; -}; - -export type PostByRegistryNameV01PublishError = - PostByRegistryNameV01PublishErrors[keyof PostByRegistryNameV01PublishErrors]; - -export type PostByRegistryNameV01PublishResponses = { - /** - * Created - */ - 201: V0ServerJson; -}; - -export type PostByRegistryNameV01PublishResponse = - PostByRegistryNameV01PublishResponses[keyof PostByRegistryNameV01PublishResponses]; diff --git a/src/lib/schemas/server-meta.test.ts b/src/lib/schemas/server-meta.test.ts index e3fc834b..0f08af2d 100644 --- a/src/lib/schemas/server-meta.test.ts +++ b/src/lib/schemas/server-meta.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "vitest"; import type { V0ServerJson } from "@/generated/types.gen"; -import { mockedGetRegistryV01Servers } from "@/mocks/fixtures/registry_v0_1_servers/get"; +import { mockedGetRegistryV01Servers } from "@/mocks/fixtures/registry_registryName_v0_1_servers/get"; import { parseStacklokMeta } from "./server-meta"; const servers = mockedGetRegistryV01Servers.defaultValue.servers ?? []; diff --git a/src/lib/utils.test.ts b/src/lib/utils.test.ts index 54617ace..04cf7e21 100644 --- a/src/lib/utils.test.ts +++ b/src/lib/utils.test.ts @@ -1,6 +1,6 @@ import { describe, expect, it } from "vitest"; import type { V0ServerJson } from "@/generated/types.gen"; -import { mockedGetRegistryV01Servers } from "@/mocks/fixtures/registry_v0_1_servers/get"; +import { mockedGetRegistryV01Servers } from "@/mocks/fixtures/registry_registryName_v0_1_servers/get"; import { getTools, isVirtualMCPServer } from "./utils"; const servers = mockedGetRegistryV01Servers.defaultValue.servers ?? []; diff --git a/src/mocks/fixtures/extension_v0_registries/get.ts b/src/mocks/fixtures/extension_v0_registries/get.ts index e3011487..8f4ad5e1 100644 --- a/src/mocks/fixtures/extension_v0_registries/get.ts +++ b/src/mocks/fixtures/extension_v0_registries/get.ts @@ -1,23 +1,12 @@ -import type { GetExtensionV0RegistriesResponse } from "@api/types.gen"; +import type { GetV1RegistriesResponse } from "@api/types.gen"; import { AutoAPIMock } from "@mocks"; -export const mockedGetExtensionV0Registries = - AutoAPIMock({ - registries: [ - { - name: "Ut est", - createdAt: "2024-01-01T00:00:00.000Z", - creationType: "CONFIG", - filterConfig: { - names: { - exclude: ["tempor in Lorem"], - include: ["occaecat id"], - }, - tags: { - exclude: ["dolor dolore"], - include: ["Ut tempor sit anim enim"], - }, - }, - }, - ], - }); +export const mockedGetV1Registries = AutoAPIMock({ + registries: [ + { + name: "Ut est", + createdAt: "2024-01-01T00:00:00.000Z", + creationType: "CONFIG", + }, + ], +}); diff --git a/src/mocks/fixtures/registry_registryName_v0_1_servers/get.ts b/src/mocks/fixtures/registry_registryName_v0_1_servers/get.ts new file mode 100644 index 00000000..2da1e054 --- /dev/null +++ b/src/mocks/fixtures/registry_registryName_v0_1_servers/get.ts @@ -0,0 +1,615 @@ +import type { GetRegistryByRegistryNameV01ServersResponse } from "@api/types.gen"; +import { AutoAPIMock } from "@mocks"; +import { HttpResponse } from "msw"; + +export const mockedGetRegistryByRegistryNameV01Servers = + AutoAPIMock({ + servers: [ + { + server: { + title: "AWS Nova Canvas", + name: "awslabs/aws-nova-canvas", + version: "1.0.0", + description: + "MCP server for AI-powered image generation using Amazon Nova Canvas and AWS services", + repository: { + source: "github", + id: "awslabs", + url: "https://github.com/awslabs/aws-nova-canvas", + }, + _meta: { + "io.modelcontextprotocol.registry/publisher-provided": {}, + }, + icons: [ + { + sizes: ["32x32"], + mimeType: "image/x-icon", + src: "https://www.amazon.com/favicon.ico", + }, + ], + packages: [ + { + version: "1.0.0", + environmentVariables: [ + { + name: "AWS_ACCESS_KEY_ID", + }, + ], + }, + ], + remotes: [ + { + type: "http", + url: "https://example.com/awslabs/aws-nova-canvas", + headers: [], + }, + ], + }, + _meta: { + "io.modelcontextprotocol.registry/official": { + isLatest: false, + publishedAt: "2024-01-16T07:47:41.0Z", + status: "active", + }, + }, + }, + { + server: { + name: "com.toolhive.k8s.toolhive-system/osv", + title: "OSV Vulnerabilities", + version: "1.0.0", + description: + "OSV (Open Source Vulnerabilities) database access for querying package and commit vulnerabilities", + remotes: [ + { + type: "streamable-http", + url: "https://mcp.stacklok.dev/osv/mcp", + }, + ], + _meta: { + "io.modelcontextprotocol.registry/publisher-provided": { + "io.github.stacklok": { + "https://mcp.stacklok.dev/osv/mcp": { + metadata: { + kubernetes: { + image: + "781189302813.dkr.ecr.us-east-1.amazonaws.com/stackloklabs/osv-mcp/server", + kind: "MCPServer", + name: "osv", + namespace: "toolhive-system", + transport: "streamable-http", + uid: "a47c2d8d-b15a-4d2e-a7ff-b1e0b5ce410f", + }, + }, + tool_definitions: [ + { + name: "get_vulnerability", + description: + "Get details for a specific vulnerability by ID", + }, + { + name: "query_vulnerabilities_batch", + description: + "Query for vulnerabilities affecting multiple packages or commits at once", + }, + { + name: "query_vulnerability", + description: + "Query for vulnerabilities affecting a specific package version or commit", + }, + ], + tools: [ + "query_vulnerability", + "query_vulnerabilities_batch", + "get_vulnerability", + ], + }, + }, + }, + }, + icons: [], + packages: [ + { + registryType: "oci", + identifier: + "781189302813.dkr.ecr.us-east-1.amazonaws.com/stackloklabs/osv-mcp/server", + version: "latest", + }, + ], + }, + _meta: { + "io.modelcontextprotocol.registry/official": { + status: "active", + isLatest: true, + publishedAt: "2025-12-15T10:30:00Z", + updatedAt: "2025-12-15T10:30:00Z", + }, + }, + }, + { + server: { + name: "com.toolhive.k8s.production/my-vmcp-server", + title: "Virtual MCP Server", + version: "1.0.0", + description: "Virtual MCP server for code analysis", + remotes: [ + { + type: "streamable-http", + url: "https://mcp.example.com/servers/my-vmcp-server", + }, + ], + _meta: { + "io.modelcontextprotocol.registry/publisher-provided": { + "io.github.stacklok": { + "https://mcp.example.com/servers/my-vmcp-server": { + metadata: { + kubernetes: { + kind: "VirtualMCPServer", + namespace: "production", + name: "my-vmcp-server", + uid: "a1b2c3d4-e5f6-7890-abcd-ef1234567890", + }, + }, + }, + }, + }, + }, + icons: [], + packages: [], + }, + _meta: { + "io.modelcontextprotocol.registry/official": { + status: "active", + isLatest: true, + publishedAt: "2025-12-15T10:30:00Z", + updatedAt: "2025-12-15T10:30:00Z", + }, + }, + }, + { + server: { + title: "AgentQL MCP", + name: "tinyfish/agentql-mcp", + version: "1.0.1", + description: "A powerful MCP server for building AI agents", + repository: { + source: "github", + id: "tinyfish", + url: "https://github.com/tinyfish/agentql-mcp", + }, + _meta: { + "io.modelcontextprotocol.registry/publisher-provided": {}, + }, + icons: [], + packages: [], + remotes: [ + { + type: "http", + url: "https://example.com/tinyfish/agentql-mcp", + headers: [], + }, + ], + }, + _meta: { + "io.modelcontextprotocol.registry/official": { + isLatest: true, + publishedAt: "2024-02-09T18:53:24.0Z", + status: "active", + }, + }, + }, + { + server: { + title: "Astra DB MCP", + name: "datastax/astra-db-mcp", + version: "1.0.2", + description: "Integrate AI assistants with Astra DB", + repository: { + source: "github", + id: "datastax", + url: "https://github.com/datastax/astra-db-mcp", + }, + _meta: { + "io.modelcontextprotocol.registry/publisher-provided": {}, + }, + icons: [], + packages: [], + remotes: [ + { + type: "http", + url: "https://example.com/datastax/astra-db-mcp", + headers: [], + }, + ], + }, + _meta: { + "io.modelcontextprotocol.registry/official": { + isLatest: true, + publishedAt: "2024-06-16T06:09:48.0Z", + status: "active", + }, + }, + }, + { + server: { + title: "Microsoft Azure", + name: "microsoft/azure-mcp", + version: "1.0.0", + description: "Connect AI assistants to Azure services", + repository: { + source: "github", + id: "microsoft", + url: "https://github.com/microsoft/azure-mcp", + }, + _meta: {}, + icons: [], + packages: [], + remotes: [ + { + type: "http", + url: "https://example.com/microsoft/azure-mcp", + headers: [], + }, + ], + }, + _meta: { + "io.modelcontextprotocol.registry/official": { + isLatest: true, + publishedAt: "2024-01-16T07:47:41.0Z", + status: "active", + }, + }, + }, + { + server: { + title: "Google Workspace", + name: "google/mcp-google-apps", + version: "1.0.0", + description: + "Access your Google Workspace apps, including calendar, mail, drive, docs, slides and sheets", + repository: { + source: "github", + id: "google", + url: "https://github.com/google/mcp-google-apps", + }, + _meta: {}, + icons: [], + packages: [], + remotes: [ + { + type: "http", + url: "https://example.com/google", + headers: [], + }, + ], + }, + _meta: { + "io.modelcontextprotocol.registry/official": { + isLatest: true, + publishedAt: "2024-01-16T07:47:41.0Z", + status: "active", + }, + }, + }, + { + server: { + title: "Figma Desktop", + name: "figma/mcp-desktop", + version: "1.0.0", + description: + "Connect AI assistants to Figma Desktop for design collaboration and automation", + repository: { + source: "github", + id: "figma", + url: "https://github.com/figma/mcp-desktop", + }, + _meta: {}, + icons: [], + packages: [], + remotes: [ + { + type: "http", + url: "https://example.com/figma", + headers: [], + }, + ], + }, + _meta: { + "io.modelcontextprotocol.registry/official": { + isLatest: true, + publishedAt: "2024-01-16T07:47:41.0Z", + status: "active", + }, + }, + }, + { + server: { + title: "Slack Workspace", + name: "slack/mcp-slack", + version: "1.0.0", + description: + "Integrate AI assistants with Slack for team communication and automation", + repository: { + source: "github", + id: "slack", + url: "https://github.com/slack/mcp-slack", + }, + _meta: {}, + icons: [], + packages: [], + remotes: [ + { + type: "http", + url: "https://example.com/slack", + headers: [], + }, + ], + }, + _meta: { + "io.modelcontextprotocol.registry/official": { + isLatest: true, + publishedAt: "2024-01-16T07:47:41.0Z", + status: "active", + }, + }, + }, + { + server: { + title: "GitHub API", + name: "github/mcp-github", + version: "1.0.0", + description: + "Interact with GitHub repositories, issues, and pull requests", + repository: { + source: "github", + id: "github", + url: "https://github.com/github/mcp-github", + }, + _meta: {}, + icons: [], + packages: [], + remotes: [ + { + type: "http", + url: "https://example.com/github", + headers: [], + }, + ], + }, + _meta: { + "io.modelcontextprotocol.registry/official": { + isLatest: true, + publishedAt: "2024-01-16T07:47:41.0Z", + status: "active", + }, + }, + }, + { + server: { + title: "Stripe Payments", + name: "stripe/mcp-stripe", + version: "1.0.0", + description: + "Manage Stripe payments, subscriptions, and customer data", + repository: { + source: "github", + id: "stripe", + url: "https://github.com/stripe/mcp-stripe", + }, + _meta: {}, + icons: [], + packages: [], + remotes: [ + { + type: "http", + url: "https://example.com/stripe", + headers: [], + }, + ], + }, + _meta: { + "io.modelcontextprotocol.registry/official": { + isLatest: true, + publishedAt: "2024-01-16T07:47:41.0Z", + status: "active", + }, + }, + }, + { + server: { + title: "Notion Workspace", + name: "notion/mcp-notion", + version: "1.0.0", + description: "Access and manage Notion pages, databases, and content", + repository: { + source: "github", + id: "notion", + url: "https://github.com/notion/mcp-notion", + }, + _meta: {}, + icons: [], + packages: [], + remotes: [ + { + type: "http", + url: "https://example.com/notion", + headers: [], + }, + ], + }, + _meta: { + "io.modelcontextprotocol.registry/official": { + isLatest: true, + publishedAt: "2024-01-16T07:47:41.0Z", + status: "active", + }, + }, + }, + { + server: { + title: "Salesforce CRM", + name: "salesforce/mcp-salesforce", + version: "1.0.0", + description: + "Connect to Salesforce CRM for customer management and automation", + repository: { + source: "github", + id: "salesforce", + url: "https://github.com/salesforce/mcp-salesforce", + }, + _meta: {}, + icons: [], + packages: [], + remotes: [ + { + type: "http", + url: "https://example.com/salesforce", + headers: [], + }, + ], + }, + _meta: { + "io.modelcontextprotocol.registry/official": { + isLatest: true, + publishedAt: "2024-01-16T07:47:41.0Z", + status: "active", + }, + }, + }, + { + server: { + title: "HubSpot Marketing", + name: "hubspot/mcp-hubspot", + version: "1.0.0", + description: + "Integrate with HubSpot for marketing automation and CRM", + repository: { + source: "github", + id: "hubspot", + url: "https://github.com/hubspot/mcp-hubspot", + }, + _meta: {}, + icons: [], + packages: [], + remotes: [ + { + type: "http", + url: "https://example.com/hubspot", + headers: [], + }, + ], + }, + _meta: { + "io.modelcontextprotocol.registry/official": { + isLatest: true, + publishedAt: "2024-01-16T07:47:41.0Z", + status: "active", + }, + }, + }, + { + server: { + title: "Linear Project", + name: "linear/mcp-linear", + version: "1.0.0", + description: "Manage Linear issues, projects, and team workflows", + repository: { + source: "github", + id: "linear", + url: "https://github.com/linear/mcp-linear", + }, + _meta: {}, + icons: [], + packages: [], + remotes: [ + { + type: "http", + url: "https://example.com/linear", + headers: [], + }, + ], + }, + _meta: { + "io.modelcontextprotocol.registry/official": { + isLatest: true, + publishedAt: "2024-01-16T07:47:41.0Z", + status: "active", + }, + }, + }, + { + server: { + title: "Trello Boards", + name: "trello/mcp-trello", + version: "1.0.0", + description: "Access and manage Trello boards, cards, and lists", + repository: { + source: "github", + id: "trello", + url: "https://github.com/trello/mcp-trello", + }, + _meta: {}, + icons: [], + packages: [], + remotes: [ + { + type: "http", + url: "https://example.com/trello", + headers: [], + }, + ], + }, + _meta: { + "io.modelcontextprotocol.registry/official": { + isLatest: true, + publishedAt: "2024-01-16T07:47:41.0Z", + status: "active", + }, + }, + }, + { + server: { + title: "Jira Management", + name: "atlassian/mcp-jira", + version: "1.0.0", + description: + "Manage Jira issues, projects, and workflows through AI assistants", + repository: { + source: "github", + id: "atlassian", + url: "https://github.com/atlassian/mcp-jira", + }, + websiteUrl: "https://github.com/atlassian/mcp-jira", + _meta: {}, + icons: [], + packages: [], + remotes: [], + }, + _meta: { + "io.modelcontextprotocol.registry/official": { + isLatest: true, + publishedAt: "2024-01-16T07:47:41.0Z", + status: "active", + }, + }, + }, + ], + metadata: { + count: 17, + nextCursor: "next-page", + }, + }) + .scenario("empty-servers", (self) => + self.override(() => ({ + servers: [], + metadata: { count: 0 }, + })), + ) + .scenario("server-error", (self) => + self.overrideHandler(() => + HttpResponse.json({ error: "Internal Server Error" }, { status: 500 }), + ), + ); + +export const mockedGetRegistryV01Servers = + mockedGetRegistryByRegistryNameV01Servers; diff --git a/src/mocks/fixtures/registry_v0_1_servers/get.ts b/src/mocks/fixtures/registry_v0_1_servers/get.ts index abd11b03..9a8edd2e 100644 --- a/src/mocks/fixtures/registry_v0_1_servers/get.ts +++ b/src/mocks/fixtures/registry_v0_1_servers/get.ts @@ -1,9 +1,9 @@ -import type { GetRegistryV01ServersResponse } from "@api/types.gen"; +import type { GetRegistryByRegistryNameV01ServersResponse } from "@api/types.gen"; import { AutoAPIMock } from "@mocks"; import { HttpResponse } from "msw"; export const mockedGetRegistryV01Servers = - AutoAPIMock({ + AutoAPIMock({ servers: [ { server: { diff --git a/src/mocks/fixtures/registry_v0_1_servers__serverName__versions__version_/get.ts b/src/mocks/fixtures/registry_v0_1_servers__serverName__versions__version_/get.ts index 19498fec..778410ef 100644 --- a/src/mocks/fixtures/registry_v0_1_servers__serverName__versions__version_/get.ts +++ b/src/mocks/fixtures/registry_v0_1_servers__serverName__versions__version_/get.ts @@ -1,53 +1,55 @@ -import type { GetRegistryV01ServersByServerNameVersionsByVersionResponse } from "@api/types.gen"; +import type { GetRegistryByRegistryNameV01ServersByServerNameVersionsByVersionResponse } from "@api/types.gen"; import { AutoAPIMock } from "@mocks"; export const mockedGetRegistryV01ServersByServerNameVersionsByVersion = - AutoAPIMock({ - server: { - name: "awslabs/aws-nova-canvas", - title: "AWS Nova Canvas MCP Server", - version: "1.0.0", - description: - "Image generation using Amazon Nova Canvas. A Model Context Protocol server that integrates with AWS services for AI-powered image generation.\n\nAmazon Nova Canvas is a cutting-edge image generation service that leverages advanced AI models to create high-quality images from text descriptions. This MCP server provides seamless integration with AWS services, allowing you to generate images programmatically within your applications.\n\nKey Features:\n- High-quality image generation with customizable parameters\n- Support for multiple image formats (PNG, JPEG, WebP)\n- Configurable image dimensions and aspect ratios\n- Advanced prompt engineering capabilities\n- Cost-effective pricing with pay-as-you-go model\n- Enterprise-grade security and compliance\n- Real-time generation with low latency\n- Batch processing support for multiple images\n\nUse Cases:\n- Content creation for marketing and advertising\n- Product visualization and mockups\n- Social media content generation\n- E-commerce product images\n- Game asset creation\n- Architectural visualization\n- Educational materials and illustrations\n\nThis server requires valid AWS credentials with appropriate permissions to access the Amazon Nova Canvas service. Make sure your IAM role has the necessary policies attached before using this integration.\n\nFor more information about pricing, limits, and best practices, please refer to the official AWS documentation.", - repository: { - source: "github", - id: "awslabs", - url: "https://github.com/awslabs/aws-nova-canvas", - }, - websiteUrl: "https://github.com/awslabs/aws-nova-canvas", - icons: [ - { - src: "https://www.amazon.com/favicon.ico", - sizes: ["32x32"], - mimeType: "image/x-icon", - }, - ], - packages: [ - { - version: "1.0.0", - environmentVariables: [ - { - name: "AWS_ACCESS_KEY_ID", - }, - { - name: "AWS_SECRET_ACCESS_KEY", - }, - ], + AutoAPIMock( + { + server: { + name: "awslabs/aws-nova-canvas", + title: "AWS Nova Canvas MCP Server", + version: "1.0.0", + description: + "Image generation using Amazon Nova Canvas. A Model Context Protocol server that integrates with AWS services for AI-powered image generation.\n\nAmazon Nova Canvas is a cutting-edge image generation service that leverages advanced AI models to create high-quality images from text descriptions. This MCP server provides seamless integration with AWS services, allowing you to generate images programmatically within your applications.\n\nKey Features:\n- High-quality image generation with customizable parameters\n- Support for multiple image formats (PNG, JPEG, WebP)\n- Configurable image dimensions and aspect ratios\n- Advanced prompt engineering capabilities\n- Cost-effective pricing with pay-as-you-go model\n- Enterprise-grade security and compliance\n- Real-time generation with low latency\n- Batch processing support for multiple images\n\nUse Cases:\n- Content creation for marketing and advertising\n- Product visualization and mockups\n- Social media content generation\n- E-commerce product images\n- Game asset creation\n- Architectural visualization\n- Educational materials and illustrations\n\nThis server requires valid AWS credentials with appropriate permissions to access the Amazon Nova Canvas service. Make sure your IAM role has the necessary policies attached before using this integration.\n\nFor more information about pricing, limits, and best practices, please refer to the official AWS documentation.", + repository: { + source: "github", + id: "awslabs", + url: "https://github.com/awslabs/aws-nova-canvas", }, - ], - remotes: [ - { - type: "http", - url: "https://example.com/awslabs/aws-nova-canvas", - headers: [], + websiteUrl: "https://github.com/awslabs/aws-nova-canvas", + icons: [ + { + src: "https://www.amazon.com/favicon.ico", + sizes: ["32x32"], + mimeType: "image/x-icon", + }, + ], + packages: [ + { + version: "1.0.0", + environmentVariables: [ + { + name: "AWS_ACCESS_KEY_ID", + }, + { + name: "AWS_SECRET_ACCESS_KEY", + }, + ], + }, + ], + remotes: [ + { + type: "http", + url: "https://example.com/awslabs/aws-nova-canvas", + headers: [], + }, + ], + }, + _meta: { + "io.modelcontextprotocol.registry/official": { + isLatest: true, + publishedAt: "2024-11-20T10:00:00.0Z", + status: "active", }, - ], - }, - _meta: { - "io.modelcontextprotocol.registry/official": { - isLatest: true, - publishedAt: "2024-11-20T10:00:00.0Z", - status: "active", }, }, - }); + ); diff --git a/src/mocks/fixtures/v1_registries/get.ts b/src/mocks/fixtures/v1_registries/get.ts new file mode 100644 index 00000000..9157f240 --- /dev/null +++ b/src/mocks/fixtures/v1_registries/get.ts @@ -0,0 +1,12 @@ +import type { GetV1RegistriesResponse } from "@api/types.gen"; +import { AutoAPIMock } from "@mocks"; + +export const mockedGetV1Registries = AutoAPIMock({ + registries: [ + { + name: "default", + createdAt: "2024-01-01T00:00:00.000Z", + creationType: "CONFIG", + }, + ], +}); diff --git a/src/mocks/server-detail/index.ts b/src/mocks/server-detail/index.ts index 84559e06..9096deed 100644 --- a/src/mocks/server-detail/index.ts +++ b/src/mocks/server-detail/index.ts @@ -1,13 +1,13 @@ import type { RequestHandler } from "msw"; import { HttpResponse, http } from "msw"; -import { mockedGetRegistryV01Servers } from "../fixtures/registry_v0_1_servers/get"; +import { mockedGetRegistryV01Servers } from "../fixtures/registry_registryName_v0_1_servers/get"; // Add non-schema, hand-written mocks here. // These take precedence over the schema-based mocks. export const serverDetailHandlers: RequestHandler[] = [ // Mock for server detail endpoint - returns server from list with normalized version http.get( - "*/registry/v0.1/servers/:serverName/versions/:version", + "*/registry/:registryName/v0.1/servers/:serverName/versions/:version", ({ params }) => { // MSW already decodes the path parameters const serverName = String(params.serverName); diff --git a/swagger.json b/swagger.json index d92ae28f..ab621692 100644 --- a/swagger.json +++ b/swagger.json @@ -1,38 +1,6 @@ { "components": { "schemas": { - "github_com_stacklok_toolhive-registry-server_internal_config.APIConfig": { - "description": "API endpoint source", - "properties": { - "endpoint": { - "description": "Endpoint is the base API URL (without path)\nThe registry handler will append the appropriate paths for the MCP Registry API v0.1:\n - /v0.1/servers - List all servers\n - /v0.1/servers/{name}/versions - List server versions\n - /v0.1/servers/{name}/versions/{version} - Get specific version\nExample: \"http://my-registry-api.default.svc.cluster.local/registry\"", - "type": "string" - } - }, - "type": "object" - }, - "github_com_stacklok_toolhive-registry-server_internal_config.FileConfig": { - "description": "Local file or URL source", - "properties": { - "data": { - "description": "Data is the inline registry data as a JSON string\nMutually exclusive with Path and URL - exactly one must be specified\nUseful for API-created registries where the data is provided directly", - "type": "string" - }, - "path": { - "description": "Path is the path to the registry.json file on the local filesystem\nCan be absolute or relative to the working directory\nMutually exclusive with URL and Data - exactly one must be specified", - "type": "string" - }, - "timeout": { - "description": "Timeout is the timeout for HTTP requests when using URL\nDefaults to 30s if not specified\nOnly applicable when URL is set", - "type": "string" - }, - "url": { - "description": "URL is the HTTP/HTTPS URL to fetch the registry file from\nMutually exclusive with Path and Data - exactly one must be specified\nHTTPS is required unless the host is localhost or THV_REGISTRY_INSECURE_URL=true", - "type": "string" - } - }, - "type": "object" - }, "github_com_stacklok_toolhive-registry-server_internal_config.FilterConfig": { "description": "Filtering rules", "properties": { @@ -45,57 +13,6 @@ }, "type": "object" }, - "github_com_stacklok_toolhive-registry-server_internal_config.GitAuthConfig": { - "description": "Auth contains optional authentication for private repositories", - "properties": { - "passwordFile": { - "description": "PasswordFile is the path to a file containing the Git password/token\nMust be an absolute path; whitespace is trimmed from the content", - "type": "string" - }, - "username": { - "description": "Username is the Git username for HTTP Basic authentication", - "type": "string" - } - }, - "type": "object" - }, - "github_com_stacklok_toolhive-registry-server_internal_config.GitConfig": { - "description": "Git repository source", - "properties": { - "auth": { - "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_config.GitAuthConfig" - }, - "branch": { - "description": "Branch is the Git branch to use (mutually exclusive with Tag and Commit)", - "type": "string" - }, - "commit": { - "description": "Commit is the Git commit SHA to use (mutually exclusive with Branch and Tag)", - "type": "string" - }, - "path": { - "description": "Path is the path to the registry file within the repository", - "type": "string" - }, - "repository": { - "description": "Repository is the Git repository URL (HTTP/HTTPS/SSH)", - "type": "string" - }, - "tag": { - "description": "Tag is the Git tag to use (mutually exclusive with Branch and Commit)", - "type": "string" - } - }, - "type": "object" - }, - "github_com_stacklok_toolhive-registry-server_internal_config.KubernetesConfig": { - "description": "Kubernetes discovery source", - "type": "object" - }, - "github_com_stacklok_toolhive-registry-server_internal_config.ManagedConfig": { - "description": "Managed registry (no sync)", - "type": "object" - }, "github_com_stacklok_toolhive-registry-server_internal_config.NameFilterConfig": { "properties": { "exclude": { @@ -127,15 +44,6 @@ "SourceTypeKubernetes" ] }, - "github_com_stacklok_toolhive-registry-server_internal_config.SyncPolicyConfig": { - "description": "Sync schedule configuration", - "properties": { - "interval": { - "type": "string" - } - }, - "type": "object" - }, "github_com_stacklok_toolhive-registry-server_internal_config.TagFilterConfig": { "properties": { "exclude": { @@ -161,32 +69,51 @@ "type": "string", "x-enum-varnames": ["CreationTypeAPI", "CreationTypeCONFIG"] }, - "github_com_stacklok_toolhive-registry-server_internal_service.RegistryCreateRequest": { + "github_com_stacklok_toolhive-registry-server_internal_service.EntryVersionInfo": { "properties": { - "api": { - "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_config.APIConfig" + "createdAt": { + "type": "string" }, - "file": { - "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_config.FileConfig" + "description": { + "type": "string" }, - "filter": { - "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_config.FilterConfig" + "title": { + "type": "string" }, - "format": { - "description": "\"toolhive\" or \"upstream\"", + "updatedAt": { "type": "string" }, - "git": { - "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_config.GitConfig" + "version": { + "type": "string" + } + }, + "type": "object" + }, + "github_com_stacklok_toolhive-registry-server_internal_service.RegistryEntriesResponse": { + "properties": { + "entries": { + "items": { + "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.RegistryEntryInfo" + }, + "type": "array", + "uniqueItems": false + } + }, + "type": "object" + }, + "github_com_stacklok_toolhive-registry-server_internal_service.RegistryEntryInfo": { + "properties": { + "entryType": { + "type": "string" }, - "kubernetes": { - "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_config.KubernetesConfig" + "name": { + "type": "string" }, - "managed": { - "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_config.ManagedConfig" + "sourceName": { + "type": "string" }, - "syncPolicy": { - "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_config.SyncPolicyConfig" + "version": { + "type": "string" } }, "type": "object" @@ -199,32 +126,15 @@ "creationType": { "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.CreationType" }, - "filterConfig": { - "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_config.FilterConfig" - }, - "format": { - "description": "toolhive or upstream", - "type": "string" - }, "name": { "type": "string" }, - "sourceConfig": { - "description": "Type-specific source configuration" - }, - "sourceType": { - "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_config.SourceType" - }, - "syncSchedule": { - "description": "Sync interval string", - "type": "string" - }, - "syncStatus": { - "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.RegistrySyncStatus" - }, - "type": { - "description": "MANAGED, FILE, REMOTE, KUBERNETES", - "type": "string" + "sources": { + "items": { + "type": "string" + }, + "type": "array", + "uniqueItems": false }, "updatedAt": { "type": "string" @@ -232,109 +142,141 @@ }, "type": "object" }, - "github_com_stacklok_toolhive-registry-server_internal_service.RegistryListResponse": { + "github_com_stacklok_toolhive-registry-server_internal_service.Skill": { "properties": { - "registries": { + "_meta": { + "additionalProperties": {}, + "type": "object" + }, + "allowedTools": { "items": { - "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.RegistryInfo" + "type": "string" }, "type": "array", "uniqueItems": false - } - }, - "type": "object" - }, - "github_com_stacklok_toolhive-registry-server_internal_service.RegistrySyncStatus": { - "properties": { - "attemptCount": { - "description": "Number of sync attempts", - "type": "integer" }, - "lastAttempt": { - "description": "Last sync attempt", + "compatibility": { "type": "string" }, - "lastSyncTime": { - "description": "Last successful sync", + "createdAt": { "type": "string" }, - "message": { - "description": "Status or error message", + "description": { "type": "string" }, - "phase": { - "description": "complete, syncing, failed", + "icons": { + "items": { + "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.SkillIcon" + }, + "type": "array", + "uniqueItems": false + }, + "id": { "type": "string" }, - "serverCount": { - "description": "Number of servers in registry", - "type": "integer" - } - }, - "type": "object" - }, - "internal_api.HealthResponse": { - "properties": { + "isLatest": { + "type": "boolean" + }, + "license": { + "type": "string" + }, + "metadata": { + "additionalProperties": {}, + "type": "object" + }, + "name": { + "type": "string" + }, + "namespace": { + "type": "string" + }, + "packages": { + "items": { + "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.SkillPackage" + }, + "type": "array", + "uniqueItems": false + }, + "repository": { + "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.SkillRepository" + }, "status": { - "example": "healthy", + "type": "string" + }, + "title": { + "type": "string" + }, + "updatedAt": { + "type": "string" + }, + "version": { "type": "string" } }, "type": "object" }, - "internal_api.ReadinessResponse": { + "github_com_stacklok_toolhive-registry-server_internal_service.SkillIcon": { "properties": { - "status": { - "example": "ready", + "label": { + "type": "string" + }, + "size": { + "type": "string" + }, + "src": { + "type": "string" + }, + "type": { "type": "string" } }, "type": "object" }, - "internal_api.VersionResponse": { + "github_com_stacklok_toolhive-registry-server_internal_service.SkillPackage": { "properties": { - "build_date": { - "example": "2025-01-15T10:30:00Z", + "commit": { "type": "string" }, - "commit": { - "example": "abc123def", + "digest": { "type": "string" }, - "go_version": { - "example": "go1.21.5", + "identifier": { "type": "string" }, - "platform": { - "example": "linux/amd64", + "mediaType": { "type": "string" }, - "version": { - "example": "v0.1.0", + "ref": { + "type": "string" + }, + "registryType": { + "type": "string" + }, + "subfolder": { + "type": "string" + }, + "url": { "type": "string" } }, "type": "object" }, - "internal_api_x_skills.SkillListMetadata": { + "github_com_stacklok_toolhive-registry-server_internal_service.SkillRepository": { "properties": { - "count": { - "type": "integer" + "type": { + "type": "string" }, - "nextCursor": { + "url": { "type": "string" } }, "type": "object" }, - "internal_api_x_skills.SkillListResponse": { + "github_com_stacklok_toolhive-registry-server_internal_service.SourceEntriesResponse": { "properties": { - "metadata": { - "$ref": "#/components/schemas/internal_api_x_skills.SkillListMetadata" - }, - "skills": { + "entries": { "items": { - "$ref": "#/components/schemas/registry.Skill" + "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.SourceEntryInfo" }, "type": "array", "uniqueItems": false @@ -342,24 +284,229 @@ }, "type": "object" }, - "model.Argument": { + "github_com_stacklok_toolhive-registry-server_internal_service.SourceEntryInfo": { "properties": { - "isRepeated": { - "type": "boolean" + "claims": { + "additionalProperties": {}, + "type": "object" }, - "name": { - "example": "--port", + "entryType": { "type": "string" }, - "type": { - "$ref": "#/components/schemas/model.ArgumentType" - }, - "valueHint": { - "example": "file_path", + "name": { "type": "string" - } - }, - "type": "object" + }, + "versions": { + "items": { + "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.EntryVersionInfo" + }, + "type": "array", + "uniqueItems": false + } + }, + "type": "object" + }, + "github_com_stacklok_toolhive-registry-server_internal_service.SourceInfo": { + "properties": { + "claims": { + "additionalProperties": {}, + "description": "Authorization claims", + "type": "object" + }, + "createdAt": { + "type": "string" + }, + "creationType": { + "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.CreationType" + }, + "filterConfig": { + "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_config.FilterConfig" + }, + "format": { + "description": "toolhive or upstream", + "type": "string" + }, + "name": { + "type": "string" + }, + "sourceConfig": { + "description": "Type-specific source configuration" + }, + "sourceType": { + "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_config.SourceType" + }, + "syncSchedule": { + "description": "Sync interval string", + "type": "string" + }, + "syncStatus": { + "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.SourceSyncStatus" + }, + "type": { + "description": "MANAGED, FILE, REMOTE, KUBERNETES", + "type": "string" + }, + "updatedAt": { + "type": "string" + } + }, + "type": "object" + }, + "github_com_stacklok_toolhive-registry-server_internal_service.SourceListResponse": { + "properties": { + "sources": { + "items": { + "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.SourceInfo" + }, + "type": "array", + "uniqueItems": false + } + }, + "type": "object" + }, + "github_com_stacklok_toolhive-registry-server_internal_service.SourceSyncStatus": { + "properties": { + "attemptCount": { + "description": "Number of sync attempts", + "type": "integer" + }, + "lastAttempt": { + "description": "Last sync attempt", + "type": "string" + }, + "lastSyncTime": { + "description": "Last successful sync", + "type": "string" + }, + "message": { + "description": "Status or error message", + "type": "string" + }, + "phase": { + "description": "complete, syncing, failed", + "type": "string" + }, + "serverCount": { + "description": "Number of servers in registry", + "type": "integer" + } + }, + "type": "object" + }, + "internal_api.HealthResponse": { + "properties": { + "status": { + "example": "healthy", + "type": "string" + } + }, + "type": "object" + }, + "internal_api.ReadinessResponse": { + "properties": { + "status": { + "example": "ready", + "type": "string" + } + }, + "type": "object" + }, + "internal_api.VersionResponse": { + "properties": { + "build_date": { + "example": "2025-01-15T10:30:00Z", + "type": "string" + }, + "commit": { + "example": "abc123def", + "type": "string" + }, + "go_version": { + "example": "go1.21.5", + "type": "string" + }, + "platform": { + "example": "linux/amd64", + "type": "string" + }, + "version": { + "example": "v0.1.0", + "type": "string" + } + }, + "type": "object" + }, + "internal_api_v1.publishEntryRequest": { + "properties": { + "claims": { + "additionalProperties": {}, + "type": "object" + }, + "server": { + "$ref": "#/components/schemas/v0.ServerJSON" + }, + "skill": { + "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.Skill" + } + }, + "type": "object" + }, + "internal_api_v1.registryListResponse": { + "properties": { + "registries": { + "items": { + "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.RegistryInfo" + }, + "type": "array", + "uniqueItems": false + } + }, + "type": "object" + }, + "internal_api_x_skills.SkillListMetadata": { + "properties": { + "count": { + "type": "integer" + }, + "nextCursor": { + "type": "string" + } + }, + "type": "object" + }, + "internal_api_x_skills.SkillListResponse": { + "properties": { + "metadata": { + "$ref": "#/components/schemas/internal_api_x_skills.SkillListMetadata" + }, + "skills": { + "items": { + "$ref": "#/components/schemas/registry.Skill" + }, + "type": "array", + "uniqueItems": false + } + }, + "type": "object" + }, + "model.Argument": { + "properties": { + "isRepeated": { + "type": "boolean" + }, + "name": { + "example": "--port", + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/model.ArgumentType" + }, + "valueHint": { + "example": "file_path", + "type": "string" + } + }, + "type": "object" }, "model.ArgumentType": { "enum": ["positional", "named"], @@ -734,6 +881,13 @@ "status": { "$ref": "#/components/schemas/model.Status" }, + "statusChangedAt": { + "format": "date-time", + "type": "string" + }, + "statusMessage": { + "type": "string" + }, "updatedAt": { "format": "date-time", "type": "string" @@ -877,41 +1031,38 @@ "url": "" }, "paths": { - "/extension/v0/registries": { + "/health": { "get": { - "description": "List all registries", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - }, + "description": "Check if the registry API is healthy", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.RegistryListResponse" + "$ref": "#/components/schemas/internal_api.HealthResponse" } } }, - "description": "List of registries" - }, - "401": { + "description": "OK" + } + }, + "summary": "Health check", + "tags": ["system"] + } + }, + "/openapi.json": { + "get": { + "description": "Get the OpenAPI 3.1.0 specification for this API", + "responses": { + "200": { "content": { "application/json": { "schema": { - "additionalProperties": { - "type": "string" - }, "type": "object" } } }, - "description": "Unauthorized" + "description": "OpenAPI 3.1.0 specification" }, "500": { "content": { @@ -924,750 +1075,28 @@ } } }, - "description": "Internal server error" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "List registries", - "tags": ["extension"] - } - }, - "/extension/v0/registries/{registryName}": { - "delete": { - "description": "Delete a registry by name. Only registries created via API can be deleted.", - "parameters": [ - { - "description": "Registry Name", - "in": "path", - "name": "registryName", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "responses": { - "204": { - "description": "Registry deleted" - }, - "400": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Bad request" - }, - "401": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Unauthorized" - }, - "403": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Forbidden - cannot delete CONFIG registry" - }, - "404": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Registry not found" - }, - "500": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Internal server error" - }, - "501": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Not implemented" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Delete registry", - "tags": ["extension"] - }, - "get": { - "description": "Get a registry by name", - "parameters": [ - { - "description": "Registry Name", - "in": "path", - "name": "registryName", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.RegistryInfo" - } - } - }, - "description": "Registry details" - }, - "400": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Bad request" - }, - "401": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Unauthorized" - }, - "404": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Registry not found" - }, - "500": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Internal server error" - }, - "501": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Not implemented" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Get registry", - "tags": ["extension"] - }, - "put": { - "description": "Create a new registry or update an existing one. Only registries created via API can be updated.", - "parameters": [ - { - "description": "Registry Name", - "in": "path", - "name": "registryName", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "type": "object" - }, - { - "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.RegistryCreateRequest", - "summary": "body", - "description": "Registry configuration" - } - ] - } - } - }, - "description": "Registry configuration", - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.RegistryInfo" - } - } - }, - "description": "Registry updated" - }, - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.RegistryInfo" - } - } - }, - "description": "Registry created" - }, - "400": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Bad request - invalid configuration" - }, - "401": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Unauthorized" - }, - "403": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Forbidden - cannot modify CONFIG registry" - }, - "500": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Internal server error" - }, - "501": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Not implemented" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Create or update registry", - "tags": ["extension"] - } - }, - "/health": { - "get": { - "description": "Check if the registry API is healthy", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/internal_api.HealthResponse" - } - } - }, - "description": "OK" - } - }, - "summary": "Health check", - "tags": ["system"] - } - }, - "/openapi.json": { - "get": { - "description": "Get the OpenAPI 3.1.0 specification for this API", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - }, - "description": "OpenAPI 3.1.0 specification" - }, - "500": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Internal Server Error" - } - }, - "summary": "OpenAPI specification", - "tags": ["system"] - } - }, - "/readiness": { - "get": { - "description": "Check if the registry API is ready to serve requests", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/internal_api.ReadinessResponse" - } - } - }, - "description": "OK" - }, - "503": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Service Unavailable" - } - }, - "summary": "Readiness check", - "tags": ["system"] - } - }, - "/registry/v0.1/publish": { - "post": { - "deprecated": true, - "description": "Publish a server to the registry. This server does not support publishing via this endpoint.\nUse the registry-specific endpoint /{registryName}/v0.1/publish instead.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "responses": { - "401": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Unauthorized" - }, - "501": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Not implemented" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Publish server (not supported)", - "tags": ["registry-aggregated"] - } - }, - "/registry/v0.1/servers": { - "get": { - "deprecated": true, - "description": "Get a list of available servers from all registries (aggregated view)", - "parameters": [ - { - "description": "Pagination cursor for retrieving next set of results", - "in": "query", - "name": "cursor", - "schema": { - "type": "string" - } - }, - { - "description": "Maximum number of items to return", - "in": "query", - "name": "limit", - "schema": { - "type": "integer" - } - }, - { - "description": "Search servers by name (substring match)", - "in": "query", - "name": "search", - "schema": { - "type": "string" - } - }, - { - "description": "Filter by version ('latest' for latest version, or an exact version like '1.2.3')", - "in": "query", - "name": "version", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/v0.ServerListResponse" - } - } - }, - "description": "OK" - }, - "400": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Bad request" - }, - "401": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Unauthorized" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "List servers (aggregated)", - "tags": ["registry-aggregated"] - } - }, - "/registry/v0.1/servers/{serverName}/versions": { - "get": { - "deprecated": true, - "description": "Returns all available versions for a specific MCP server from all registries (aggregated view)", - "parameters": [ - { - "description": "URL-encoded server name (e.g., \\", - "in": "path", - "name": "serverName", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/v0.ServerListResponse" - } - } - }, - "description": "A list of all versions for the server" - }, - "400": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Bad request" - }, - "401": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Unauthorized" - }, - "404": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Server not found" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "List all versions of an MCP server (aggregated)", - "tags": ["registry-aggregated"] - } - }, - "/registry/v0.1/servers/{serverName}/versions/{version}": { - "get": { - "deprecated": true, - "description": "Returns detailed information about a specific version of an MCP server from all registries.\nUse the special version `latest` to get the latest version.", - "parameters": [ - { - "description": "URL-encoded server name (e.g., \\", - "in": "path", - "name": "serverName", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "URL-encoded version to retrieve (e.g., \\", - "in": "path", - "name": "version", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/v0.ServerResponse" - } - } - }, - "description": "Detailed server information" - }, - "400": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Bad request" - }, - "401": { + "description": "Internal Server Error" + } + }, + "summary": "OpenAPI specification", + "tags": ["system"] + } + }, + "/readiness": { + "get": { + "description": "Check if the registry API is ready to serve requests", + "responses": { + "200": { "content": { "application/json": { "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" + "$ref": "#/components/schemas/internal_api.ReadinessResponse" } } }, - "description": "Unauthorized" + "description": "OK" }, - "404": { + "503": { "content": { "application/json": { "schema": { @@ -1678,16 +1107,11 @@ } } }, - "description": "Server or version not found" + "description": "Service Unavailable" } }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Get specific MCP server version (aggregated)", - "tags": ["registry-aggregated"] + "summary": "Readiness check", + "tags": ["system"] } }, "/registry/{registryName}/v0.1/servers": { @@ -1898,124 +1322,6 @@ } }, "/registry/{registryName}/v0.1/servers/{serverName}/versions/{version}": { - "delete": { - "description": "Delete a server version from a specific managed registry", - "parameters": [ - { - "description": "Registry name", - "in": "path", - "name": "registryName", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "Server name (URL-encoded)", - "in": "path", - "name": "serverName", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "Version (URL-encoded)", - "in": "path", - "name": "version", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "responses": { - "204": { - "description": "No content" - }, - "400": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Bad request" - }, - "401": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Unauthorized" - }, - "403": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Not a managed registry" - }, - "404": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Server version not found" - }, - "500": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Internal server error" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Delete server version from specific registry", - "tags": ["registry"] - }, "get": { "description": "Returns detailed information about a specific version of an MCP server from a specific registry.\nUse the special version `latest` to get the latest version.", "parameters": [ @@ -2180,127 +1486,9 @@ } } }, - "description": "List of skills" - }, - "400": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Bad request" - }, - "500": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Internal server error" - } - }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "List skills in registry", - "tags": ["skills"] - }, - "post": { - "description": "Publish a skill version to the registry.", - "parameters": [ - { - "description": "Registry name", - "in": "path", - "name": "registryName", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "type": "object" - }, - { - "$ref": "#/components/schemas/registry.Skill", - "summary": "body", - "description": "Skill data" - } - ] - } - } - }, - "description": "Skill data", - "required": true - }, - "responses": { - "201": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/registry.Skill" - } - } - }, - "description": "Created" - }, - "400": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Bad request" - }, - "401": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Unauthorized" - }, - "403": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Not a managed registry" + "description": "List of skills" }, - "409": { + "400": { "content": { "application/json": { "schema": { @@ -2311,7 +1499,7 @@ } } }, - "description": "Version already exists" + "description": "Bad request" }, "500": { "content": { @@ -2332,7 +1520,7 @@ "BearerAuth": [] } ], - "summary": "Publish skill", + "summary": "List skills in registry", "tags": ["skills"] } }, @@ -2539,8 +1727,8 @@ } }, "/registry/{registryName}/v0.1/x/dev.toolhive/skills/{namespace}/{name}/versions/{version}": { - "delete": { - "description": "Delete a specific version of a skill from the registry.", + "get": { + "description": "Get a specific version of a skill.", "parameters": [ { "description": "Registry name", @@ -2589,36 +1777,17 @@ } }, "responses": { - "204": { - "description": "No content" - }, - "400": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Bad request" - }, - "401": { + "200": { "content": { "application/json": { "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" + "$ref": "#/components/schemas/registry.Skill" } } }, - "description": "Unauthorized" + "description": "Skill details" }, - "403": { + "400": { "content": { "application/json": { "schema": { @@ -2629,7 +1798,7 @@ } } }, - "description": "Not a managed registry" + "description": "Bad request" }, "404": { "content": { @@ -2642,7 +1811,7 @@ } } }, - "description": "Skill version not found" + "description": "Skill or version not found" }, "500": { "content": { @@ -2663,68 +1832,43 @@ "BearerAuth": [] } ], - "summary": "Delete skill version", + "summary": "Get specific skill version", "tags": ["skills"] - }, - "get": { - "description": "Get a specific version of a skill.", - "parameters": [ - { - "description": "Registry name", - "in": "path", - "name": "registryName", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "Skill namespace (reverse-DNS)", - "in": "path", - "name": "namespace", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "Skill name", - "in": "path", - "name": "name", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "Skill version", - "in": "path", - "name": "version", - "required": true, - "schema": { - "type": "string" - } - } - ], + } + }, + "/v1/entries": { + "post": { + "description": "Publish a new server or skill entry. Exactly one of 'server' or 'skill' must be provided.", "requestBody": { "content": { "application/json": { "schema": { - "type": "object" + "oneOf": [ + { + "type": "object" + }, + { + "$ref": "#/components/schemas/internal_api_v1.publishEntryRequest", + "summary": "request", + "description": "Entry to publish (server or skill)" + } + ] } } - } + }, + "description": "Entry to publish (server or skill)", + "required": true }, "responses": { - "200": { + "201": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/registry.Skill" + "type": "object" } } }, - "description": "Skill details" + "description": "Published entry (server or skill)" }, "400": { "content": { @@ -2739,7 +1883,7 @@ }, "description": "Bad request" }, - "404": { + "409": { "content": { "application/json": { "schema": { @@ -2750,7 +1894,7 @@ } } }, - "description": "Skill or version not found" + "description": "Conflict" }, "500": { "content": { @@ -2766,42 +1910,6 @@ "description": "Internal server error" } }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Get specific skill version", - "tags": ["skills"] - } - }, - "/v1/entries": { - "post": { - "description": "Publish a new entry", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "responses": { - "501": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Not implemented" - } - }, "summary": "Publish entry", "tags": ["v1"] } @@ -2912,6 +2020,9 @@ } }, "responses": { + "204": { + "description": "No Content" + }, "400": { "content": { "application/json": { @@ -2925,7 +2036,7 @@ }, "description": "Bad request" }, - "501": { + "404": { "content": { "application/json": { "schema": { @@ -2936,7 +2047,20 @@ } } }, - "description": "Not implemented" + "description": "Not found" + }, + "500": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + } + }, + "description": "Internal server error" } }, "summary": "Delete published entry", @@ -2956,7 +2080,17 @@ } }, "responses": { - "501": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/internal_api_v1.registryListResponse" + } + } + }, + "description": "Registries list" + }, + "500": { "content": { "application/json": { "schema": { @@ -2967,7 +2101,7 @@ } } }, - "description": "Not implemented" + "description": "Internal server error" } }, "summary": "List registries", @@ -2998,6 +2132,9 @@ } }, "responses": { + "204": { + "description": "Registry deleted" + }, "400": { "content": { "application/json": { @@ -3011,7 +2148,7 @@ }, "description": "Bad request" }, - "501": { + "403": { "content": { "application/json": { "schema": { @@ -3022,7 +2159,33 @@ } } }, - "description": "Not implemented" + "description": "Cannot modify config-created registry" + }, + "404": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + } + }, + "description": "Registry not found" + }, + "500": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + } + }, + "description": "Internal server error" } }, "summary": "Delete registry", @@ -3051,6 +2214,16 @@ } }, "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.RegistryInfo" + } + } + }, + "description": "Registry details" + }, "400": { "content": { "application/json": { @@ -3064,7 +2237,7 @@ }, "description": "Bad request" }, - "501": { + "404": { "content": { "application/json": { "schema": { @@ -3075,7 +2248,20 @@ } } }, - "description": "Not implemented" + "description": "Registry not found" + }, + "500": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + } + }, + "description": "Internal server error" } }, "summary": "Get registry", @@ -3104,6 +2290,26 @@ } }, "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.RegistryInfo" + } + } + }, + "description": "Registry updated" + }, + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.RegistryInfo" + } + } + }, + "description": "Registry created" + }, "400": { "content": { "application/json": { @@ -3115,9 +2321,22 @@ } } }, - "description": "Bad request" + "description": "Bad request" + }, + "403": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + } + }, + "description": "Cannot modify config-created registry" }, - "501": { + "500": { "content": { "application/json": { "schema": { @@ -3128,7 +2347,7 @@ } } }, - "description": "Not implemented" + "description": "Internal server error" } }, "summary": "Create or update registry", @@ -3159,6 +2378,16 @@ } }, "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.RegistryEntriesResponse" + } + } + }, + "description": "Registry entries" + }, "400": { "content": { "application/json": { @@ -3172,7 +2401,7 @@ }, "description": "Bad request" }, - "501": { + "404": { "content": { "application/json": { "schema": { @@ -3183,7 +2412,20 @@ } } }, - "description": "Not implemented" + "description": "Registry not found" + }, + "500": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + } + }, + "description": "Internal server error" } }, "summary": "List registry entries", @@ -3203,7 +2445,17 @@ } }, "responses": { - "501": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.SourceListResponse" + } + } + }, + "description": "Sources list" + }, + "500": { "content": { "application/json": { "schema": { @@ -3214,7 +2466,7 @@ } } }, - "description": "Not implemented" + "description": "Internal server error" } }, "summary": "List sources", @@ -3245,6 +2497,9 @@ } }, "responses": { + "204": { + "description": "Source deleted" + }, "400": { "content": { "application/json": { @@ -3258,7 +2513,7 @@ }, "description": "Bad request" }, - "501": { + "403": { "content": { "application/json": { "schema": { @@ -3269,36 +2524,22 @@ } } }, - "description": "Not implemented" - } - }, - "summary": "Delete source", - "tags": ["v1"] - }, - "get": { - "description": "Get a source by name", - "parameters": [ - { - "description": "Source Name", - "in": "path", - "name": "name", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object" + "description": "Cannot modify config-created source" + }, + "404": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } } - } - } - }, - "responses": { - "400": { + }, + "description": "Source not found" + }, + "409": { "content": { "application/json": { "schema": { @@ -3309,9 +2550,9 @@ } } }, - "description": "Bad request" + "description": "Source in use" }, - "501": { + "500": { "content": { "application/json": { "schema": { @@ -3322,14 +2563,14 @@ } } }, - "description": "Not implemented" + "description": "Internal server error" } }, - "summary": "Get source", + "summary": "Delete source", "tags": ["v1"] }, - "put": { - "description": "Create a new source or update an existing one", + "get": { + "description": "Get a source by name", "parameters": [ { "description": "Source Name", @@ -3351,6 +2592,16 @@ } }, "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.SourceInfo" + } + } + }, + "description": "Source details" + }, "400": { "content": { "application/json": { @@ -3364,7 +2615,7 @@ }, "description": "Bad request" }, - "501": { + "404": { "content": { "application/json": { "schema": { @@ -3375,16 +2626,27 @@ } } }, - "description": "Not implemented" + "description": "Source not found" + }, + "500": { + "content": { + "application/json": { + "schema": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + } + }, + "description": "Internal server error" } }, - "summary": "Create or update source", + "summary": "Get source", "tags": ["v1"] - } - }, - "/v1/sources/{name}/entries": { - "get": { - "description": "List all entries for a source", + }, + "put": { + "description": "Create a new source or update an existing one", "parameters": [ { "description": "Source Name", @@ -3406,6 +2668,26 @@ } }, "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.SourceInfo" + } + } + }, + "description": "Source updated" + }, + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.SourceInfo" + } + } + }, + "description": "Source created" + }, "400": { "content": { "application/json": { @@ -3419,7 +2701,7 @@ }, "description": "Bad request" }, - "501": { + "403": { "content": { "application/json": { "schema": { @@ -3430,40 +2712,34 @@ } } }, - "description": "Not implemented" - } - }, - "summary": "List source entries", - "tags": ["v1"] - } - }, - "/version": { - "get": { - "description": "Get version information about the registry API", - "responses": { - "200": { + "description": "Cannot modify config-created source" + }, + "500": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/internal_api.VersionResponse" + "additionalProperties": { + "type": "string" + }, + "type": "object" } } }, - "description": "OK" + "description": "Internal server error" } }, - "summary": "Version information", - "tags": ["system"] + "summary": "Create or update source", + "tags": ["v1"] } }, - "/{registryName}/v0.1/publish": { - "post": { - "description": "Publish a server version to a specific managed registry", + "/v1/sources/{name}/entries": { + "get": { + "description": "List all entries for a source", "parameters": [ { - "description": "Registry name", + "description": "Source Name", "in": "path", - "name": "registryName", + "name": "name", "required": true, "schema": { "type": "string" @@ -3474,32 +2750,21 @@ "content": { "application/json": { "schema": { - "oneOf": [ - { - "type": "object" - }, - { - "$ref": "#/components/schemas/v0.ServerJSON", - "summary": "server", - "description": "Server data" - } - ] + "type": "object" } } - }, - "description": "Server data", - "required": true + } }, "responses": { - "201": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/v0.ServerJSON" + "$ref": "#/components/schemas/github_com_stacklok_toolhive-registry-server_internal_service.SourceEntriesResponse" } } }, - "description": "Created" + "description": "Source entries" }, "400": { "content": { @@ -3514,32 +2779,6 @@ }, "description": "Bad request" }, - "401": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Unauthorized" - }, - "403": { - "content": { - "application/json": { - "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" - } - } - }, - "description": "Not a managed registry" - }, "404": { "content": { "application/json": { @@ -3551,9 +2790,9 @@ } } }, - "description": "Registry not found" + "description": "Source not found" }, - "409": { + "500": { "content": { "application/json": { "schema": { @@ -3564,29 +2803,30 @@ } } }, - "description": "Version already exists" - }, - "500": { + "description": "Internal server error" + } + }, + "summary": "List source entries", + "tags": ["v1"] + } + }, + "/version": { + "get": { + "description": "Get version information about the registry API", + "responses": { + "200": { "content": { "application/json": { "schema": { - "additionalProperties": { - "type": "string" - }, - "type": "object" + "$ref": "#/components/schemas/internal_api.VersionResponse" } } }, - "description": "Internal server error" + "description": "OK" } }, - "security": [ - { - "BearerAuth": [] - } - ], - "summary": "Publish server to specific registry", - "tags": ["registry"] + "summary": "Version information", + "tags": ["system"] } } },