microfoom
API referenceType aliases

AgentEvent

Type Alias: AgentEvent

type AgentEvent = 
  | {
  kind?: "program" | "method" | "turn" | "scope";
  name: string;
  parent?: string;
  span: string;
  type: "span_start";
}
  | {
  durationMs: number;
  span: string;
  type: "span_end";
  usage: AgentUsage;
}
  | {
  label?: string;
  span: string;
  type: "turn_start";
}
  | {
  method: string;
  span: string;
  type: "foom_call";
}
  | {
  attempt: number;
  span: string;
  type: "repair";
}
  | {
  level: "info" | "warn" | "error";
  message: string;
  span: string;
  type: "log";
}
  | {
  attributes: Record<string, unknown>;
  span: string;
  type: "annotate";
}
  | {
  span: string;
  systemPrompt: string;
  type: "turn_meta";
}
  | {
  span: string;
  text: string;
  type: "user_prompt";
}
  | {
  span: string;
  type: "msg_start";
}
  | {
  delta: string;
  span: string;
  type: "msg_text";
}
  | {
  delta: string;
  span: string;
  type: "msg_thinking";
}
  | {
  span: string;
  type: "msg_end";
}
  | {
  args: unknown;
  callId: string;
  name: string;
  span: string;
  type: "tool_start";
}
  | {
  callId: string;
  content: string;
  isError: boolean;
  span: string;
  type: "tool_end";
};

Defined in: packages/microfoom-core/src/events.ts:8

A trace event. The built-in run panel and any exporter subscribe to these.

Union Members

Type Literal

{
  kind?: "program" | "method" | "turn" | "scope";
  name: string;
  parent?: string;
  span: string;
  type: "span_start";
}

kind?

readonly optional kind?: "program" | "method" | "turn" | "scope";

What produced the span — drives the render glyph. Absent for manual scopes.

name

readonly name: string;

parent?

readonly optional parent?: string;

span

readonly span: string;

type

readonly type: "span_start";

Type Literal

{
  durationMs: number;
  span: string;
  type: "span_end";
  usage: AgentUsage;
}

Type Literal

{
  label?: string;
  span: string;
  type: "turn_start";
}

Type Literal

{
  method: string;
  span: string;
  type: "foom_call";
}

Type Literal

{
  attempt: number;
  span: string;
  type: "repair";
}

Type Literal

{
  level: "info" | "warn" | "error";
  message: string;
  span: string;
  type: "log";
}

Type Literal

{
  attributes: Record<string, unknown>;
  span: string;
  type: "annotate";
}

Type Literal

{
  span: string;
  systemPrompt: string;
  type: "turn_meta";
}

Type Literal

{
  span: string;
  text: string;
  type: "user_prompt";
}

Type Literal

{
  span: string;
  type: "msg_start";
}

Type Literal

{
  delta: string;
  span: string;
  type: "msg_text";
}

Type Literal

{
  delta: string;
  span: string;
  type: "msg_thinking";
}

Type Literal

{
  span: string;
  type: "msg_end";
}

Type Literal

{
  args: unknown;
  callId: string;
  name: string;
  span: string;
  type: "tool_start";
}

Type Literal

{
  callId: string;
  content: string;
  isError: boolean;
  span: string;
  type: "tool_end";
}

On this page