Agent

The instance an Angular component injects: a session's snapshot fields as signals, the session's commands with their own signatures, and the AgentControls.

The type is derived from the session, so a backend's extra snapshot fields and commands appear without this layer naming them. Where a session member and a snapshot field share a name, the session member is the one exposed.

The object is stable for the life of its injector. Switching threads replaces the session underneath; the signals and commands stay the same references and follow the new session.

import type { Agent } from '@threadplane/angular/chat';

Declaration

export type Agent<TSession extends AgentSessionLike = AgentSession> = AgentControls & Omit<TSession, AgentSessionPlumbing | keyof AgentControls> & Omit<AgentFieldSignals<AgentSnapshotOf<TSession>>, keyof TSession | keyof AgentControls>;

Type parameters