@adonis-agora/agent
Version:
Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.
22 lines • 1.58 kB
TypeScript
import { type ComponentType, type ReactNode } from 'react';
import { type CatalogOptions, type ComponentDefinition, type ComponentPresentation } from '../../../genui/index.js';
import type { GenuiRegistry } from './types.js';
export interface ReactComponentRenderers<P extends object> {
react?: ComponentType<P>;
text?: (props: P) => string | Promise<string>;
/** Return each page's complete props. Each page is validated again before SSR. */
paginate?: (props: P, rowsPerPage: number) => readonly P[] | Promise<readonly P[]>;
}
/** App-scoped registry shared by GenuiProvider and static server rendering. */
export declare function createReactComponentRegistry(options?: CatalogOptions): {
readonly catalog: import("../../../genui/catalog.js").Catalog;
readonly manifest: readonly import("../../../genui/registry.js").ComponentManifest[];
readonly components: GenuiRegistry;
prepare: (presentation: ComponentPresentation<object>) => Promise<ComponentPresentation<Record<string, unknown>>>;
render: (presentation: ComponentPresentation<object>, channel: string) => Promise<unknown>;
register<P extends object>(definition: ComponentDefinition<P>, renderers: ReactComponentRenderers<P>): /*elided*/ any;
renderPages(presentation: ComponentPresentation<object>, size: number): Promise<ReactNode[]>;
paginate(presentation: ComponentPresentation<object>, size: number): Promise<ComponentPresentation[]>;
};
export type ReactComponentRegistry = ReturnType<typeof createReactComponentRegistry>;
//# sourceMappingURL=react-registry.d.ts.map