(result *FrontmatterResult, validationErr error, isWorkflowFile, isAgentFile bool)
| 305 | } |
| 306 | |
| 307 | func extractToolsFromIncludedResult(result *FrontmatterResult, validationErr error, isWorkflowFile, isAgentFile bool) (string, error) { |
| 308 | if isAgentFile { |
| 309 | return "{}", nil |
| 310 | } |
| 311 | if validationErr == nil || isWorkflowFile { |
| 312 | return extractToolsFromFrontmatter(result.Frontmatter) |
| 313 | } |
| 314 | if tools, hasTools := result.Frontmatter["tools"]; hasTools { |
| 315 | toolsJSON, err := json.Marshal(tools) |
| 316 | if err != nil { |
| 317 | return "{}", nil |
| 318 | } |
| 319 | return strings.TrimSpace(string(toolsJSON)), nil |
| 320 | } |
| 321 | return "{}", nil |
| 322 | } |
| 323 | |
| 324 | func extractIncludedMarkdownContent(filePath, sectionName string, content []byte, visited map[string]struct { |
| 325 | }, extractTools bool) (string, error) { |
no test coverage detected