Fix plugin detection in getResourceType for deep-linking

Update getResourceType to detect plugin directories (plugins/<id>) and plugin.json files instead of .collection.yml files. This fixes deep-linking via #file=plugins/<id> which was previously resolving to 'unknown' and not opening the plugin modal.

Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-13 04:49:45 +00:00
parent 5d2d2d78cb
commit 65cd7bac3f

View File

@@ -233,7 +233,9 @@ export function getResourceType(filePath: string): string {
return "skill";
if (/(^|\/)hooks\//.test(filePath) && filePath.endsWith("README.md"))
return "hook";
if (filePath.endsWith(".collection.yml")) return "plugin";
// Check for plugin directories (e.g., plugins/<id>) or plugin.json files
if (/(^|\/)plugins\/[^/]+\/?$/.test(filePath) || filePath.endsWith("/.github/plugin/plugin.json"))
return "plugin";
return "unknown";
}