MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / catalogBaseUrl

Function catalogBaseUrl

packages/kosong/src/catalog.ts:109–117  ·  view source on GitHub ↗
(
  entry: CatalogProviderEntry,
  wire: ProviderType,
)

Source from the content-addressed store, hash-verified

107 * family SDKs append `/chat/completions` to a `/v1` base, so those pass through.
108 */
109export function catalogBaseUrl(
110 entry: CatalogProviderEntry,
111 wire: ProviderType,
112): string | undefined {
113 const api = entry.api;
114 if (typeof api !== 'string' || api.length === 0) return undefined;
115 if (wire === 'anthropic') return api.replace(/\/v1\/?$/, '');
116 return api;
117}
118
119/** Normalizes one catalog model entry into a {@link CatalogModel}; skips invalid entries. */
120export function catalogModelToCapability(model: CatalogModelEntry): CatalogModel | undefined {

Callers 3

catalog.test.tsFile · 0.90
handleCatalogProviderAddFunction · 0.85
handleCatalogAddFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected