MCPcopy Index your code
hub / github.com/codeaashu/claude-code / detectManifestType

Function detectManifestType

src/utils/plugins/validatePlugin.ts:54–70  ·  view source on GitHub ↗

* Detect whether a file is a plugin manifest or marketplace manifest

(
  filePath: string,
)

Source from the content-addressed store, hash-verified

52 * Detect whether a file is a plugin manifest or marketplace manifest
53 */
54function detectManifestType(
55 filePath: string,
56): 'plugin' | 'marketplace' | 'unknown' {
57 const fileName = path.basename(filePath)
58 const dirName = path.basename(path.dirname(filePath))
59
60 // Check filename patterns
61 if (fileName === 'plugin.json') return 'plugin'
62 if (fileName === 'marketplace.json') return 'marketplace'
63
64 // Check if it's in .claude-plugin directory
65 if (dirName === '.claude-plugin') {
66 return 'plugin' // Most likely plugin.json
67 }
68
69 return 'unknown'
70}
71
72/**
73 * Format Zod validation errors into a readable format

Callers 1

validateManifestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected