MCPcopy
hub / github.com/openclaw/clawsweeper / markdownRepository

Function markdownRepository

src/clawsweeper.ts:1940–1954  ·  view source on GitHub ↗
(markdown: string, file?: string)

Source from the content-addressed store, hash-verified

1938}
1939
1940function markdownRepository(markdown: string, file?: string): string {
1941 const fromMarkdown = frontMatterValue(markdown, "repository");
1942 if (fromMarkdown) return normalizeRepo(fromMarkdown);
1943 if (file) {
1944 const normalizedPath = repoRelativePath(file);
1945 const recordsMatch = normalizedPath.match(/^records\/([^/]+)\//);
1946 if (recordsMatch?.[1]) {
1947 const profile = repositoryProfileForSlug(recordsMatch[1]);
1948 if (profile) return profile.targetRepo;
1949 }
1950 const parsed = parseReportFileName(basename(file));
1951 if (parsed?.repo) return parsed.repo;
1952 }
1953 return DEFAULT_TARGET_REPO;
1954}
1955
1956function isMarkdownForActiveRepo(markdown: string, file?: string): boolean {
1957 return markdownRepository(markdown, file) === targetRepo();

Callers 15

isMarkdownForActiveRepoFunction · 0.85
existingReviewFunction · 0.85
buildExistingReviewIndexFunction · 0.85
reportRootCauseClusterFunction · 0.85
renderWorkPlanFromReportFunction · 0.85
applyDecisionsCommandFunction · 0.85

Calls 6

normalizeRepoFunction · 0.85
repoRelativePathFunction · 0.85
repositoryProfileForSlugFunction · 0.85
parseReportFileNameFunction · 0.85
matchMethod · 0.80
frontMatterValueFunction · 0.70

Tested by

no test coverage detected