Skip to content

rulvar API reference


rulvar API reference / @rulvar/core / AgentEvents

Type Alias: AgentEvents

ts
type AgentEvents = 
  | {
  agentType: string;
  label?: string;
  type: "agent:queued";
}
  | {
  agentType: string;
  label?: string;
  model: string;
  role: string;
  type: "agent:start";
}
  | {
  agentType: string;
  costUsd: number;
  entryRef: number;
  label?: string;
  status: string;
  type: "agent:end";
  usage: Usage;
}
  | {
  agentType: string;
  error: WireError;
  label?: string;
  type: "agent:error";
  willRetry: boolean;
}
  | {
  agentType: string;
  attempt: number;
  maxAttempts: number;
  type: "agent:schema-retry";
}
  | {
  delta: string;
  type: "agent:stream";
};

Defined in: packages/core/src/l0/events.ts:45

Agent lifecycle.

Union Members

Type Literal

ts
{
  agentType: string;
  label?: string;
  type: "agent:queued";
}

Type Literal

ts
{
  agentType: string;
  label?: string;
  model: string;
  role: string;
  type: "agent:start";
}

Type Literal

ts
{
  agentType: string;
  costUsd: number;
  entryRef: number;
  label?: string;
  status: string;
  type: "agent:end";
  usage: Usage;
}

Type Literal

ts
{
  agentType: string;
  error: WireError;
  label?: string;
  type: "agent:error";
  willRetry: boolean;
}

Type Literal

ts
{
  agentType: string;
  attempt: number;
  maxAttempts: number;
  type: "agent:schema-retry";
}

Type Literal

ts
{
  delta: string;
  type: "agent:stream";
}

Emitted only when the call opts into streaming; never journaled, never re-emitted.