@threadplane/angularInterfacev0.3.7

AgentConfig

Configuration for one injected agent.

import type { AgentConfig } from '@threadplane/angular';

Declaration

export interface AgentConfig<TSession extends AgentSessionLike = AgentSession>  {
  readonly createSession: (context: AgentSessionContext) => TSession;
  readonly onThreadId?: (threadId: string) => void;
  readonly optionalCommands?: readonly string[];
  readonly threadId?: Signal<string | null | undefined> | string | null;
}

Type parameters

Members

createSession

Creates the session for one thread. Called once when the agent is built and again for each thread switch, always in the agent's injection context, so it may call inject(). The agent owns every session it is given and disposes it.

readonly createSession: (context: AgentSessionContext) => TSession;

onThreadId

Called with the id of a thread a session created.

readonly onThreadId?: (threadId: string) => void;

optionalCommands

Names of optional commands, or other optional session members, this backend's sessions may leave undefined, beyond the core contract's. A name listed here reads as undefined on the agent while the session lacks it, instead of as a snapshot field.

readonly optionalCommands?: readonly string[];

threadId

The thread to start on. Pass a signal to have the agent follow it: a change to a different id switches threads.

readonly threadId?: Signal<string | null | undefined> | string | null;