UNPKG

@adonis-agora/agent

Version:

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

40 lines • 2.09 kB
import { type A2uiOptions } from '../a2ui/core.js'; import type { ProtocolAdapter } from '../spi/protocol-adapter.js'; export interface AgUiAdapterOptions { /** Where the route mounts, under the agent's path. Default `'ag-ui'` → `POST <path>/ag-ui`. */ path?: string; /** * How long a run that is waiting on a person AND still has other work announced may stay silent * before it is reported interrupted. Default 750 ms. */ quietMs?: number; /** * A2UI over AG-UI: every generative-UI frame is also sent as an `ACTIVITY_SNAPSHOT` of type * `a2ui-surface` (the A2UI messages under `a2ui_operations`), so CopilotKit's A2UI renderer — or * any client of AG-UI's A2UI binding — draws it. `true` maps the library builtins onto A2UI's * basic catalog; pass {@link A2uiOptions} for the app's own mappings or catalog. Inbound, * `forwardedProps.a2uiAction.userAction` is always read: the action becomes the user's turn. * * The basic catalog goes under the id the client advertises — `forwardedProps * .a2uiClientCapabilities`, or the "A2UI catalog capabilities" context entry CopilotKit sends — * and, when it advertises none, under the id AG-UI's A2UI binding uses * (`A2UI_LEGACY_BASIC_CATALOG_ID`: CopilotKit 1.77, `@ag-ui/a2ui-middleware`). */ a2ui?: boolean | A2uiOptions; } /** * Serve the agent over AG-UI 1.0 (https://docs.ag-ui.com/spec/1.0): the body of `POST <path>/ag-ui` * is a `RunAgentInput`, the answer the run as AG-UI events. A run that stops to ask ends with the * interrupt outcome and is continued by a later request carrying `resume`. * * ```ts * import { agUiAdapter } from '@adonis-agora/agent/ag-ui' * * export default defineConfig({ adapters: [agUiAdapter()] }) * ``` * * Authenticated and owner-scoped exactly as `chat`, `chat/:runId/stream` and the decision routes * are: it goes through the gates the provider hands every adapter. */ export declare function agUiAdapter(options?: AgUiAdapterOptions): ProtocolAdapter; //# sourceMappingURL=adapter.d.ts.map