agentskit.js

ChatTriggerOptions

Auto-generated API reference for ChatTriggerOptions.

Interface: ChatTriggerOptions<TContext>

Defined in: chat-trigger.ts:172

#Type Parameters

#TContext

TContext = unknown

#Properties

#adapter

adapter: ChatSurfaceAdapter

Defined in: chat-trigger.ts:173


#agent

agent: AgentHandle<TContext>

Defined in: chat-trigger.ts:174


#autoReply?

optional autoReply?: boolean

Defined in: chat-trigger.ts:192

Auto-reply with the agent's output via adapter.reply when present.


#buildContext?

optional buildContext?: (event) => TContext

Defined in: chat-trigger.ts:185

Build the per-event runtime context (e.g. tenant id, user id). Default: \{ event \}.

#Parameters

event

ChatSurfaceEvent

#Returns

TContext


#buildTask?

optional buildTask?: (event) => string

Defined in: chat-trigger.ts:180

Build the agent task from the parsed event. Default: pull event.text for message / mention / reply, fall back to a structured JSON encoding for events without text (reaction, file).

#Parameters

event

ChatSurfaceEvent

#Returns

string


#eventSchema?

optional eventSchema?: JSONSchema7

Defined in: chat-trigger.ts:207

Opt-in JSON Schema for the parsed ChatSurfaceEvent (ADR-0011). When set together with validateEvent, an event that fails the schema is rejected with HTTP 400 before the agent runs β€” defence in depth on top of adapter.verify. The schema type is the same JSONSchema7 accepted by ArgsValidator.


#filter?

optional filter?: (event) => boolean

Defined in: chat-trigger.ts:190

Filter events before running the agent. Return false to skip. Useful for ignoring bot-on-bot loops or off-hours messages.

#Parameters

event

ChatSurfaceEvent

#Returns

boolean


#onEvent?

optional onEvent?: (event) => void

Defined in: chat-trigger.ts:214

Observability hook.

#Parameters

event

ChatTriggerObserverEvent

#Returns

void


#strict?

optional strict?: boolean

Defined in: chat-trigger.ts:199

Reject construction when adapter.verify is missing. Default true β€” set to false only when you have an external auth proxy in front of the trigger. Surfaces the footgun at author time instead of accepting spoofed webhooks at runtime.


#validateEvent?

optional validateEvent?: ArgsValidator

Defined in: chat-trigger.ts:212

Validator used with eventSchema. Use createAjvValidator() from @agentskit/validation. No-op unless eventSchema is also set.

Explore nearby

✎ Edit this page on GitHubΒ·Found a problem? Open an issue β†’Β·How to contribute β†’

On this page

Ask the docs

Ask anything about AgentsKit. Answers come from the docs corpus via OpenRouter free-tier models. Rate limited per IP.