(filePath: string)
| 426 | * Get resource type from file path |
| 427 | */ |
| 428 | export function getResourceType(filePath: string): string { |
| 429 | if (filePath.endsWith(".agent.md")) return "agent"; |
| 430 | if (filePath.endsWith(".instructions.md")) return "instruction"; |
| 431 | if (/(^|\/)skills\//.test(filePath)) return "skill"; |
| 432 | if (/(^|\/)hooks\//.test(filePath)) return "hook"; |
| 433 | if (/(^|\/)workflows\//.test(filePath) && filePath.endsWith(".md")) |
| 434 | return "workflow"; |
| 435 | // Check for plugin directories (e.g., plugins/<id>, plugins/<id>/) |
| 436 | if (/(^|\/)plugins\/[^/]+\/?$/.test(filePath)) return "plugin"; |
| 437 | // Check for plugin.json files (e.g., plugins/<id>/.github/plugin/plugin.json) |
| 438 | if (filePath.endsWith("/.github/plugin/plugin.json")) return "plugin"; |
| 439 | return "unknown"; |
| 440 | } |
| 441 | |
| 442 | /** |
| 443 | * Format a resource type for display |
no outgoing calls
no test coverage detected