/**
 * Plugin manifest schema — mirrors `jait.plugin.json`.
 *
 * Every extension must ship a manifest at the root of its package.
 * The loader resolves the manifest first and only imports the entry
 * module when the plugin is enabled.
 */
/* ------------------------------------------------------------------ */
/*  Validation                                                         */
/* ------------------------------------------------------------------ */
/** Minimal validation — returns error string or null. */
export function validateManifest(raw) {
    if (!raw || typeof raw !== "object")
        return "Manifest must be a JSON object";
    const m = raw;
    if (typeof m.id !== "string" || !m.id)
        return "Manifest must have a non-empty 'id'";
    if (typeof m.displayName !== "string" || !m.displayName)
        return "Manifest must have a non-empty 'displayName'";
    if (typeof m.version !== "string" || !m.version)
        return "Manifest must have a non-empty 'version'";
    // id format: lowercase alphanumeric, hyphens, dots, and scoped (@org/name)
    if (!/^(@[\w-]+\/)?[\w][\w.-]*$/.test(m.id)) {
        return `Invalid plugin id '${m.id}' — use alphanumeric, hyphens, dots, and optional @scope/`;
    }
    return null;
}
//# sourceMappingURL=manifest.js.map