MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / parseManifest

Function parseManifest

internal/metadata/discover.go:202–216  ·  view source on GitHub ↗

parseManifest reads a markdown manifest and extracts name/description from YAML frontmatter when present, falling back to the provided default name and the first non-empty heading/paragraph for the description.

(path, fallbackName string)

Source from the content-addressed store, hash-verified

200// YAML frontmatter when present, falling back to the provided default name and
201// the first non-empty heading/paragraph for the description.
202func parseManifest(path, fallbackName string) (name, description string) {
203 name = fallbackName
204 data, err := os.ReadFile(path)
205 if err != nil {
206 return name, ""
207 }
208 fmName, fmDesc, ok := parseFrontmatter(string(data))
209 if ok {
210 if fmName != "" {
211 name = fmName
212 }
213 description = fmDesc
214 }
215 return name, description
216}
217
218// parseFrontmatter extracts name and description from a leading YAML
219// frontmatter block delimited by "---" lines. It is intentionally minimal:

Callers 1

resourceFromFileFunction · 0.85

Calls 2

parseFrontmatterFunction · 0.85
ReadFileMethod · 0.80

Tested by

no test coverage detected