UNPKG

@adonis-agora/agent

Version:

Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.

46 lines • 2.46 kB
import type { PartialToolInput } from '../spi/tool.js'; import type { Catalog, GenuiStreaming } from './catalog.js'; import type { TreeLimits } from './tree.js'; /** * One node of a tree the model is still writing — what a partial `genui:tree` frame carries. * * `id` is the node's position: `root`, then `<parent id>.<index>` (`root.1.0`). It never changes as * the tree grows (a model only ever appends), and the final tree's nodes are addressed by the same * rule, so a renderer keyed on it keeps every node mounted from the first preview to the final frame. */ export interface GenuiPartialElement { id: string; type: string; props: Record<string, unknown>; children?: GenuiPartialElement[]; /** The model has not finished writing this node: its props (or children) may still grow. */ incomplete?: true; /** * The node's component streams `complete`: its props and children are held back until its whole * subtree has arrived (`props` is `{}`). Draw a placeholder, never the component. (A `complete` * layout holding a component that streams `partial` itself — a `Sandbox` — is not held once its * own props are whole: it is drawn `incomplete`, with its children so far.) */ held?: true; } /** The id of the child at `index` of the node `parentId` (the root is `root`). */ export declare function treeNodeId(parentId: string, index: number): string; export interface PartialTreeOptions { /** How a component without its own `streaming` appears. Default `'complete'`. */ streaming?: GenuiStreaming; limits?: TreeLimits; } /** * The part of a streaming `ui__render` input worth drawing: every node whose `type` has fully * arrived and names a component of `catalog` (the negotiated one: what this client draws), with its * props so far — unvalidated, and flagged `incomplete` while still open. A node whose component * streams `complete` is a `held` placeholder until it closes. * * `{ root: null }` while nothing is drawable yet. `null` when the input can no longer become a tree * this client draws (an unknown or undrawable component, children where none are taken, past the * size limits): the preview stops there, and the final push decides what is shown. */ export declare function partialTree(catalog: Catalog, input: PartialToolInput, options?: PartialTreeOptions): { root: GenuiPartialElement | null; } | null; //# sourceMappingURL=progressive.d.ts.map