import { Dto } from '../api/client'; import { WidgetConfig } from '../types/widget-config'; /** * The org's agent as the embed sees it: branding, which engine serves the * web channel, and the features the CLIENT acts on. Features the server * applies on its own (preamble, inline UI) are not mirrored here — the embed * only forwards its toggles for those (see `resolveSendFeatures`). */ export type WidgetAgent = { name: string; avatarUrl: string | null; /** * The org's web channel runs the streaming engine (widget v5). `false` * means the classic blocking send. */ streaming: boolean; /** Optional on older backends; controls the maximum visible tool detail. */ presentation?: Dto['WidgetPresentationDto']; /** The org's EFFECTIVE features (entitlements already applied). */ features: { dictation: boolean; attachments: boolean; pageContext: boolean; clientTools: boolean; pageActions: boolean; }; }; type ServerAgent = Dto['WidgetAgentDto']; /** * snake_case (backend DTO) → camelCase (widget types) at the boundary. * * A backend that predates widget v5 returns no `agent` block. Preserve its * blocking send and attachment support when an embed is upgraded first. */ export declare function resolveWidgetAgent({ org, agent, }: { org: { name: string; }; agent?: ServerAgent | null; }): WidgetAgent; /** The client-side feature answers the UI asks for, narrowed by the embed. */ export declare function resolveClientFeatures(agent: WidgetAgent, config: WidgetConfig): { /** The composer offers voice dictation. */ dictation: boolean; /** The composer offers the attachment/upload affordance. */ attachments: boolean; /** * The visitor can mark the page (the composer's page-mark button) and the * widget's own page context rides along with each message. The host's * `config.context` is unaffected — it always rides along, as it did in v4. */ pageContext: boolean; /** * The widget performs the agent's client tools (highlight an element on * the host page). */ clientTools: boolean; /** The widget may click and type, independently of highlighting. */ pageActions: boolean; }; export type WidgetClientFeatures = ReturnType; export {}; //# sourceMappingURL=widget-agent.d.ts.map