MCPcopy Create free account
hub / github.com/Gan-Xing/CodexBridge / readRepoPackageScripts

Function readRepoPackageScripts

src/core/bridge_coordinator.ts:14484–14497  ·  view source on GitHub ↗
(repoRoot: string)

Source from the content-addressed store, hash-verified

14482}
14483
14484function readRepoPackageScripts(repoRoot: string): string[] {
14485 const packageJsonPath = path.join(repoRoot, 'package.json');
14486 if (!fs.existsSync(packageJsonPath)) {
14487 return [];
14488 }
14489 try {
14490 const parsed = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')) as { scripts?: Record<string, string> };
14491 return parsed?.scripts && typeof parsed.scripts === 'object'
14492 ? Object.keys(parsed.scripts)
14493 : [];
14494 } catch {
14495 return [];
14496 }
14497}
14498
14499function listRepoTopLevelEntries(repoRoot: string): string[] {
14500 try {

Callers 1

collectAgentRepoContextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected