ExtractWorkflowDescription extracts the description field from workflow content string
(content string)
| 192 | |
| 193 | // ExtractWorkflowDescription extracts the description field from workflow content string |
| 194 | func ExtractWorkflowDescription(content string) string { |
| 195 | result, err := parser.ExtractFrontmatterFromContent(content) |
| 196 | if err != nil { |
| 197 | return "" |
| 198 | } |
| 199 | |
| 200 | if desc, ok := result.Frontmatter["description"]; ok { |
| 201 | if descStr, ok := desc.(string); ok { |
| 202 | return descStr |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | return "" |
| 207 | } |
| 208 | |
| 209 | // ExtractWorkflowEngine extracts the engine field from workflow content string. |
| 210 | // Supports both string format (engine: copilot) and nested format (engine: { id: copilot }). |