MCPcopy Create free account
hub / github.com/anomalyco/models.dev / SyncProvider

Interface SyncProvider

packages/core/src/sync/index.ts:49–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47export type SyncedMetadata = Omit<z.infer<typeof ModelMetadata>, "id">;
48
49export interface SyncProvider<SourceModel> {
50 id: string;
51 name: string;
52 modelsDir: string;
53 metadataNamespace?: string;
54 skipCreates?: boolean;
55 deleteMissing?: boolean;
56 preserveSymlinks?: boolean;
57 preserveBaseModels?: boolean;
58 sameModel?(current: ExistingModel, desired: SyncedModel): boolean;
59 missingNotice?(paths: string[]): string[];
60 sourceID?(model: SourceModel): string;
61 skippedNotice?(ids: string[]): string[];
62 fetchModels(): Promise<unknown>;
63 parseModels(raw: unknown): SourceModel[];
64 translateModel(
65 model: SourceModel,
66 context: {
67 existing(id: string): ExistingModel | undefined;
68 authored(id: string): ExistingModel | undefined;
69 },
70 ): { id: string; model: SyncedModel; metadata?: { id: string; model: SyncedMetadata } } | undefined;
71}
72
73export interface SyncResult {
74 id: string;

Callers 8

syncProviderFunction · 0.80
syncProviderFunction · 0.80
syncProviderFunction · 0.80
syncProviderFunction · 0.80
syncProviderFunction · 0.80
syncProviderFunction · 0.80
sync.test.tsFile · 0.80
syncProviderFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected