MCPcopy Create free account
hub / github.com/MatterAIOrg/OrbCode / readLinkedAgents

Function readLinkedAgents

src/config/links.ts:136–146  ·  view source on GitHub ↗

First AGENTS.md found inside a linked repo, or undefined.

(repo: string)

Source from the content-addressed store, hash-verified

134
135/** First AGENTS.md found inside a linked repo, or undefined. */
136function readLinkedAgents(repo: string): string | undefined {
137 for (const rel of AGENTS_LOCATIONS) {
138 try {
139 const text = fs.readFileSync(path.join(repo, rel), "utf8")
140 if (text.trim()) return text
141 } catch {
142 // try the next location
143 }
144 }
145 return undefined
146}
147
148function truncate(text: string, max: number): string {
149 return text.length <= max ? text : text.slice(0, max) + "\n… (truncated)"

Callers 1

renderLinkedReposSectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected