/**
 * View-renderer registry — the contract for `view.<type>` capabilities.
 *
 * A `view.<type>` capability (view.timeline, and in future view.chart /
 * view.kanban / view.board / …) is rendered by a swappable RENDERER, not by an
 * independently-resolved instance factory. Each registered view type declares:
 *
 *   - `default`  — the renderer used when the manifest doesn't override it. BY
 *     CONTRACT this is always an **app-demo-compatible runtime React component**
 *     with no external dependency, so the dynamic interpreter renders the view
 *     out of the box (no codegen, no library install) and a generated app pulls
 *     no extra package for the default. The richer, library-backed renderers
 *     are opt-in (chosen explicitly in the manifest).
 *   - `renderers` — every renderer name valid for this capability (the `default`
 *     plus any opt-in alternatives, e.g. the vis-timeline-backed `VisTimeline`).
 *
 * Realize's pre-flight gate validates a `view.<type>` mapping against this
 * registry (`validateViewRendererMappings`), replacing the 6.96.13 blanket skip:
 * a renderer that isn't valid for its declared capability now fails loud with a
 * precise message, while an UNregistered view type is left to the runtime's
 * graceful list-degradation (pattern-walker fallback) rather than blocking
 * realize. New view types graduate out of that fallback by being registered
 * here with an app-demo-compatible default renderer. (#view-component-factories)
 */
export const VIEW_RENDERER_REGISTRY = {
    // Timeline — `TimelineGridCustom` is the zero-dependency custom renderer the
    // runtime resolves by default (RuntimeView: `Timeline → TimelineGrid`), so it
    // renders in app-demo with no extra package; the generated frontend factory
    // only pulls `vis-timeline` when `VisTimeline` is explicitly chosen. So the
    // DEFAULT is app-demo-compatible; `VisTimeline` is the interactive opt-in.
    'view.timeline': {
        default: 'TimelineGridCustom',
        renderers: ['TimelineGridCustom', 'VisTimeline'],
    },
    // Kanban — `KanbanBoard` is the zero-dependency custom renderer the runtime
    // resolves by default (RuntimeView: `Kanban → KanbanBoard`); records grouped
    // into columns by a lifecycle state / status attribute. No library-backed
    // alternative yet, so the default IS the only renderer today — and it renders
    // in app-demo with no extra dependency.
    'view.kanban': {
        default: 'KanbanBoard',
        renderers: ['KanbanBoard'],
    },
};
/** True if `capability` is a `view.<type>` capability. */
export function isViewCapability(capability) {
    return typeof capability === 'string' && /^view\./.test(capability);
}
/** The registry entry for a view capability, or undefined if unregistered. */
export function getViewRenderer(capability) {
    return VIEW_RENDERER_REGISTRY[capability];
}
/**
 * Validate a `view.<type>` → renderer mapping against the registry.
 *   - `ok`           — registered capability, renderer is valid for it
 *   - `bad-renderer` — registered capability, renderer is NOT one of its valid
 *                      renderers (typo / wrong renderer) → realize fails loud
 *   - `unregistered` — not a registered view capability → the runtime degrades
 *                      it gracefully to a list (pattern-walker fallback); not a
 *                      realize error
 */
export function validateViewRenderer(capability, renderer) {
    const entry = VIEW_RENDERER_REGISTRY[capability];
    if (!entry)
        return { status: 'unregistered' };
    if (renderer && entry.renderers.includes(renderer))
        return { status: 'ok', entry };
    return { status: 'bad-renderer', entry };
}
//# sourceMappingURL=view-renderers.js.map