import type { WidgetRuntimeMeta } from '../lib/contract/types'; import type { Prefs } from '../runtime/prefs'; import type { BridgeState } from '../runtime/bridge'; import type { SourceAdapter, SourceTick, TickReason } from './source-contract'; /** Point the consumer rules at the live registry (called once by lib/registry). */ export declare function useRuntimeMeta(next: Record): void; export declare const SOURCE_REGISTRY: readonly SourceAdapter[]; /** The adapter for a `manifest.source` value, or undefined when none exists * (a widget whose source was removed, or a manifest written before its * adapter landed — `pnpm check:registry` fails the build for the latter). */ export declare function adapterFor(id: string): SourceAdapter | undefined; /** Does any adapter answer this source? The skeleton decision needs this: a * source nobody serves can never be "still loading". */ export declare function hasSource(id: string): boolean; /** Every source id a manifest may declare. */ export declare function sourceIds(): string[]; /** * Does any INSTALLED unit declare that it reads a non-route source? * * `source` covers host ROUTES (the adapter contract polls a URL). Some data has no * route at all: the DSH scheduled-task subsystem is a client Remote FACE with a * change event (see data/schedule.ts). A unit that reads one of those declares it * in its manifest (`reads: ['schedule']`, surfaced through WIDGET_RUNTIME), and * this is the same gate the adapters get — nothing is subscribed, and no call is * made, unless a card that renders it is on the rail. */ export declare function readsSchedule(prefs: Prefs): boolean; /** The installed instances this adapter serves (what the tick sees). */ export declare function instancesFor(adapter: SourceAdapter, prefs: Prefs): string[]; /** * The adapters that have at least one consumer right now. * * Nothing is requested unless some installed unit can render it: the OpenCode * route answers 503 while its key is unconfigured, so asking anyway printed * "Failed to load resource: 503" on every turn for a feature the user had never * placed on the rail (reported 2026-09-30), and a route nobody renders is pure * waste. Installing a widget starts its feed on the next render, because prefs * are read live at the point of use. */ export declare function activeAdapters(prefs: Prefs): SourceAdapter[]; /** Build the per-tick context an adapter reads. Pure: everything comes from the * arguments, so two ticks with the same inputs behave identically. */ export declare function makeTick(adapter: SourceAdapter, reason: TickReason, prefs: Prefs, state: BridgeState, railOpen: boolean, now: number): SourceTick;