MCPcopy
hub / github.com/inkeep/open-knowledge / constructor

Method constructor

packages/server/src/sync-engine.ts:233–253  ·  view source on GitHub ↗
(options: SyncEngineOptions)

Source from the content-addressed store, hash-verified

231 private conflictStore: ConflictStore;
232
233 constructor(options: SyncEngineOptions) {
234 this.projectDir = options.projectDir;
235 this.contentDir = options.contentDir;
236 this.contentFilter = options.contentFilter;
237 this.contentRoot = options.contentRoot ?? '';
238 this.pullIntervalSeconds = options.pullIntervalSeconds ?? 30;
239 this.pushIntervalSeconds = options.pushIntervalSeconds ?? 60;
240 this.syncEnabled = options.syncEnabled;
241 this.credentialArgs = options.credentialArgs ?? [];
242 this.cc1Broadcaster = options.cc1Broadcaster ?? null;
243 this.onStateChange = options.onStateChange;
244 this.onContentConflictsDetected = options.onContentConflictsDetected;
245 this.setBatchInProgress = options.setBatchInProgress;
246 this.onAutoDisable = options.onAutoDisable;
247 this.detectGh = options.detectGh;
248 this.ghTokenSource = createGhTokenSource(options.detectGh);
249 this.tokenStore = options.tokenStore;
250 this.checkPushPermissionFn = options.checkPushPermissionFn ?? defaultCheckPushPermission;
251 this.statePath = resolve(getLocalDir(this.projectDir), 'sync-state.json');
252 this.conflictStore = new ConflictStore(this.projectDir, this.currentBranch);
253 }
254
255 private gitHandle(gitIndexFile?: string): GitHandle {
256 return createGitInstance(this.projectDir, {

Callers

nothing calls this directly

Calls 2

createGhTokenSourceFunction · 0.90
getLocalDirFunction · 0.90

Tested by

no test coverage detected