/** THE PLATFORM PROTOCOL VERSION: `major.minor`. The major names the * descriptor shape, the factory signature, the doors and the adapter contract a package is * written against, and the build form it is made in (the derived pack); a change that removes or * alters a required shape bumps it, an additive change bumps minor. A package declares the major * it targets (`protocol`), and the kernel serves its own major and no other: a package that * declares another, or none, is refused. */ export const PROTOCOL_VERSION = '3.0'; export const PROTOCOL_MAJOR = Number(PROTOCOL_VERSION.split('.')[0]); /** Where a package's declared protocol stands against this kernel: `current`, or `refused`. */ export function protocolStanding(declared: string | undefined): { major: number; standing: 'current' | 'refused' } { const major = declared === undefined ? Number.NaN : Number(String(declared).split('.')[0]); return major === PROTOCOL_MAJOR ? { major, standing: 'current' } : { major, standing: 'refused' }; }