import { AgentChatMessage } from '@voltro/client'; import { AgentChatPart } from '@voltro/client'; import { AgentChatState } from '@voltro/client'; import { CopilotAnswer } from '@voltro/client'; import { DataCopilotState } from '@voltro/client'; import { FieldDescriptor } from '@voltro/client'; import { FieldOption } from '@voltro/client'; import { FormBinding } from '@voltro/client'; import { QueryFiltersState } from '@voltro/client'; import { ReactNode } from 'react'; import { Schema } from 'effect'; import { UseDataTableOptions } from '@voltro/client'; import { WidgetKind } from '@voltro/client'; import { WorkflowRunStatus } from '@voltro/client'; /** Kit-styled default chat surface. Streaming bubbles, the live typewriter * row, an input box wired to `.send`. */ export declare function AgentChat(props: AgentChatProps): ReactNode; export declare interface AgentChatProps { readonly api: string; readonly agent: string; readonly threadId: string; readonly placeholder?: string; readonly sendLabel?: string; readonly emptyText?: string; } /** Render a message's content from its persisted parts, falling back to the * flat `content` string when no parts are present (e.g. a user turn). */ export declare function AgentMessageView({ message }: { readonly message: AgentChatMessage; }): ReactNode; /** Render one persisted message part by its `type`. Unknown types fall back to * a labelled JSON dump so nothing is silently dropped. */ export declare function AgentPartView({ part }: { readonly part: AgentChatPart; }): ReactNode; /** Headless render-prop over useAgentChat for fully custom layouts. */ export declare function AgentStream(props: AgentStreamProps): ReactNode; export declare interface AgentStreamProps { readonly api: string; readonly agent: string; readonly threadId: string; readonly children: (chat: AgentChatState) => ReactNode; } export declare function AppAgent(props: AppAgentProps): ReactNode; export declare interface AppAgentProps extends AgentChatProps { /** The tools this agent can use — rendered as a capability disclosure. */ readonly tools?: ReadonlyArray; /** Show the tools disclosure (default true when `tools` is non-empty). */ readonly showTools?: boolean; } /** A tool the agent can call (the manifest's `exposeAsTool` view / * synthesizeToolSpecs output). Structural — no @voltro/ai dep in the kit. */ export declare interface AppAgentTool { readonly name: string; readonly description?: string; /** mutation/action → true. */ readonly write?: boolean; /** Requires human confirmation before it runs. */ readonly confirm?: boolean; } /** Approve/Reject buttons bound to a parked `awaitSignal` / `awaitUpdate`. * Controlled + gated: renders nothing unless the run is actually waiting. */ export declare function ApprovalControls(props: ApprovalControlsProps): ReactNode; export declare interface ApprovalControlsProps { /** Render ONLY when true — gate on `run.waitingFor?.name === 'approval'`. */ readonly when: boolean; readonly onApprove: () => void; readonly onReject: () => void; readonly approveLabel?: string; readonly rejectLabel?: string; readonly pending?: boolean; } export declare const AsyncSelect: (props: AsyncSelectProps) => ReactNode; export declare interface AsyncSelectProps extends WidgetProps { /** The api the source query lives on. */ readonly api: string; /** The source query tag that supplies the options (`'users.search'`). */ readonly source: string; readonly labelField?: string; readonly valueField?: string; /** Map the typed term → the source query input. Default `{ q: term }`. */ readonly input?: (term: string) => Record; readonly debounceMs?: number; } export declare function AutoForm = Record, Output = unknown>(props: AutoFormProps): ReactNode; export declare interface AutoFormProps, Output> { readonly api: string; /** The mutation tag to bind to (`'todos.create'`). create vs. update are * different tags → different forms; no CRUD-mode abstraction. */ readonly mutation: string; /** The mutation's input `Schema`. Optional — resolved from the mounted * descriptor's capability-map entry (`descriptors[tag].input`) when omitted. */ readonly schema?: Schema.Schema.Any; readonly defaults?: Partial; readonly onSuccess?: (output: Output) => void; readonly submitLabel?: string; /** Distinguishes several forms on one page for the no-JS round-trip: the * 422 re-render re-fills only the form whose key was submitted. Defaults * to the mutation tag — set it when one page mounts the SAME mutation * twice. */ readonly formKey?: string; /** Where a successful NO-JS submit redirects (303). Same-origin path only * (`/thanks`); defaults to the submitting page's own URL. The JS path is * unaffected — use `onSuccess` there. */ readonly redirectTo?: string; /** Set `false` to render no `action` — for a purely static deploy (dist on * a CDN, no `voltro start`) where `/form/*` does not exist and a native * POST could only 404. With JS the form then works exactly as before. */ readonly action?: false; /** Rung 3 — own the layout; arrange ``s yourself. The binding is * passed for derived UI (pending, isValid, values). */ readonly children?: (binding: FormBinding) => ReactNode; } export declare const ConnectAccount: ({ connection, instructionsUrl, loading, children, className, }: ConnectAccountProps) => ReactNode; /** Bound form: name the api + connection and the component resolves the handle * itself. `loading` comes from the hook, so the caller passes neither. */ export declare interface ConnectAccountBoundProps { readonly api: string; readonly connectionId: string; readonly instructionsUrl?: string; readonly children?: (connection: ConnectAccountHandleLike) => ReactNode; readonly className?: string; } /** * Bound variant — resolves the handle through `useConnection`. * * A separate component rather than an overload on `ConnectAccount`, because a * hook cannot be called conditionally: a single component that called * `useConnection` only when `api` was present would break the rules of hooks * the moment a caller switched between the two forms. */ export declare const ConnectAccountFor: ({ api, connectionId, ...rest }: ConnectAccountBoundProps) => ReactNode; /** Structural shape of `@voltro/client`'s `ConnectedAccountHandle` — mirrored * rather than imported so the kit stays decoupled from the hook package (the * same convention `` follows). */ export declare interface ConnectAccountHandleLike { readonly connectionId: string; readonly kind: 'oauth2' | 'pat'; readonly label: string; readonly status: 'disconnected' | 'connected' | 'expired' | 'revoked' | 'error'; readonly accountLabel: string | null; readonly connected: boolean; readonly needsAttention: boolean; readonly pending: boolean; readonly connect: () => Promise; readonly submitToken: (token: string) => Promise; readonly disconnect: () => Promise; } export declare interface ConnectAccountProps { readonly connection: ConnectAccountHandleLike; /** Where the user mints a personal access token — rendered as a help link * under the token field. `pat` connections only. */ readonly instructionsUrl?: string; /** True while the parent is still loading the connection list. */ readonly loading?: boolean; /** Replace the whole rendering while keeping the behaviour (rung-1 escape * hatch, same as the other components in this kit). */ readonly children?: (connection: ConnectAccountHandleLike) => ReactNode; readonly className?: string; } /** Kit-styled default copilot surface: a question box wired to the action + * a results region that swaps between refusal, empty, and a generic table. */ export declare function DataCopilot(props: DataCopilotProps): ReactNode; /** Render a copilot answer: a refusal message, an empty note, or a table. */ export declare function DataCopilotAnswer(props: { readonly answer: CopilotAnswer | undefined; readonly emptyText?: string; }): ReactNode; export declare interface DataCopilotProps { readonly api: string; /** The copilot action tag (input `{ question }`, output `CopilotAnswer`). */ readonly action: string; readonly placeholder?: string; readonly askLabel?: string; readonly emptyText?: string; } /** Headless render-prop over `useDataCopilot` for a fully custom layout. */ export declare function DataCopilotStream(props: DataCopilotStreamProps): ReactNode; export declare interface DataCopilotStreamProps { readonly api: string; readonly action: string; readonly children: (copilot: DataCopilotState) => ReactNode; } export declare function DataTable = Record>(props: DataTableProps): ReactNode; export declare interface DataTableProps extends UseDataTableOptions { readonly api: string; /** The reactive query tag whose rows + output schema drive the table. */ readonly query: string; readonly emptyText?: string; readonly loadingText?: string; /** Label for the "Load more" button (shown when `pageSize` is set + more rows exist). */ readonly loadMoreText?: string; /** Custom cell renderer; defaults to a string/boolean format. */ readonly renderCell?: (row: Row, column: FieldDescriptor) => ReactNode; /** Per-row action cell (e.g. edit/delete buttons wired to mutations). */ readonly rowActions?: (row: Row) => ReactNode; /** Stable row key; defaults to `row.id` then index. */ readonly rowKey?: (row: Row) => string; } /** The English defaults. A deployment overrides any subtree via * {@link UiStringsProvider}; unspecified keys fall through to these. */ export declare const defaultUiStrings: UiStrings; /** The built-in defaults. Plain accessible HTML; overridable per app via the * registry, per field via a `` render-prop. `async-select` renders a * plain text input by design — a registry widget can't carry the `api`/`source` * binding a query-bound picker needs, so use the shipped `` * component (or a rung-2 override) for the live picker. */ export declare const defaultWidgets: Record; /** "X is editing" — surfaces that other users are active on the same * row/field. Soft (warn, not a hard lock). Renders nothing when alone. */ export declare function EditingIndicator(props: EditingIndicatorProps): ReactNode; export declare interface EditingIndicatorProps { readonly members: ReadonlyArray; /** Exclude the current user from the roster. */ readonly selfKey?: string; /** Soft field-level scope — only members whose `meta.field` matches. */ readonly field?: string; readonly verb?: string; readonly nameOf?: (m: PresenceMemberLike) => string; } /** Render one field of the enclosing `` — via its render-prop child * (rung 1) or the resolved widget (the seam). Returns null for an unknown * field name. */ export declare const Field: ({ name, children }: FieldProps) => ReactNode; export declare interface FieldProps { readonly name: string; /** Rung 1 — render this field with a custom widget; the binding still owns * value / validation / submit. Omit to use the seam's widget for the kind. */ readonly children?: (props: WidgetProps) => ReactNode; } /** A form-shaped skeleton: one label+control placeholder per field of the * mutation's input Schema. */ export declare function FormSkeleton(props: FormSkeletonProps): ReactNode; export declare interface FormSkeletonProps { readonly api: string; readonly mutation: string; /** Fallback field count when the descriptor isn't resolvable yet. Default 3. */ readonly fallbackFields?: number; } /** Up-to-two-letter initials from a display name. */ export declare const initials: (name: string) => string; /** A caller may override any subtree, not the whole object — deep-partial. The * `workflow.status` map is itself partial so you can relabel a single status. */ export declare type PartialUiStrings = { readonly [K in keyof UiStrings]?: K extends 'workflow' ? Partial> & { readonly status?: Partial; } : Partial; }; /** Live roster of who's viewing this record/page. Feed it `usePresence(...)`. */ export declare function PresenceAvatars(props: PresenceAvatarsProps): ReactNode; export declare interface PresenceAvatarsProps { readonly members: ReadonlyArray; /** Cap the visible avatars; the rest collapse into a "+N" chip. Default 5. */ readonly max?: number; readonly nameOf?: (m: PresenceMemberLike) => string; /** Override one avatar's rendering (rung-1 escape hatch). */ readonly renderAvatar?: (m: PresenceMemberLike, name: string) => ReactNode; } /** Structural shape of a presence member — matches `PresenceMember` from * @voltro/plugin-presence/web without coupling the kit to that package. * * No `lastSeen`: it used to be here, was rendered by nothing, and was the * owning replica's clock — so a component that DID render it would have been * wrong by the skew between two pods, with nothing to say so. */ export declare interface PresenceMemberLike { readonly key: string; readonly meta: Record | null; } export declare function QueryFilters>(props: QueryFiltersProps): ReactNode; export declare interface QueryFiltersProps { readonly api: string; readonly query: string; readonly initial?: Readonly>; readonly showCount?: boolean; /** Render the live results beneath the panel. */ readonly children?: (state: QueryFiltersState) => ReactNode; } export declare function RecordView = Record>(props: RecordViewProps): ReactNode; export declare interface RecordViewProps> { readonly api: string; readonly query: string; readonly input?: Readonly>; /** Restrict/order the scalar fields shown (defaults to all non-relation keys). */ readonly fields?: ReadonlyArray; /** Override one scalar field's rendering (rung-1 escape hatch). */ readonly renderField?: (name: string, value: unknown, record: R) => ReactNode; /** Override a relation's rendering (default: a nested table of the items). */ readonly renderRelation?: (name: string, items: ReadonlyArray>, record: R) => ReactNode; readonly loadingText?: string; readonly emptyText?: string; } /** Build the "X is editing" / "X and Y are editing" / "X and N others are * editing" sentence from the editor names. Pure — exported for tests. The * sentence templates come from the kit strings (localizable); defaults to the * English {@link defaultUiStrings} presence subtree when none is passed. */ export declare const summarizeEditors: (names: ReadonlyArray, verb: string, strings?: UiStrings["presence"]) => string; /** A table-shaped skeleton: the query's real columns as header placeholders + * N placeholder rows. */ export declare function TableSkeleton(props: TableSkeletonProps): ReactNode; export declare interface TableSkeletonProps { readonly api: string; readonly query: string; /** Skeleton row count. Default 5. */ readonly rows?: number; /** Fallback column count when the descriptor isn't resolvable. Default 4. */ readonly fallbackColumns?: number; } /** Every user-facing string the kit renders. Scalars are literals; anything * that interpolates a value (count, name, label) is a function so a locale can * reorder/pluralize. English defaults live in {@link defaultUiStrings}. */ export declare interface UiStrings { /** — the reset button, the "Any