MCPcopy Create free account
hub / github.com/Tencent/teamai-cli / syncTeamUpdatesToLocal

Function syncTeamUpdatesToLocal

src/utils/pre-push-sync.ts:39–54  ·  view source on GitHub ↗
(
  teamConfig: TeamaiConfig,
  localConfig: LocalConfig,
  lastPullRev: string | null,
)

Source from the content-addressed store, hash-verified

37 * This is a no-op when `lastPullRev` is null (first run or after re-init).
38 */
39export async function syncTeamUpdatesToLocal(
40 teamConfig: TeamaiConfig,
41 localConfig: LocalConfig,
42 lastPullRev: string | null,
43): Promise<void> {
44 if (!lastPullRev) {
45 log.debug('No lastPullRev — skipping pre-push sync');
46 return;
47 }
48
49 const repoPath = localConfig.repo.localPath;
50 const baseDir = resolveBaseDir(localConfig);
51
52 await syncRulesToLocal(teamConfig, localConfig, repoPath, baseDir, lastPullRev);
53 await syncSkillsToLocal(teamConfig, localConfig, repoPath, baseDir, lastPullRev);
54}
55
56/**
57 * Sync rules: for each tool's rules/ directory, find rule files that differ

Callers 2

pushCoreFunction · 0.85

Calls 3

resolveBaseDirFunction · 0.85
syncRulesToLocalFunction · 0.85
syncSkillsToLocalFunction · 0.85

Tested by

no test coverage detected