# Type Alias: AgentEvent

```ts
type AgentEvent = 
  | {
  content: string;
  type: "message_delta";
}
  | {
  content: string;
  type: "message";
}
  | {
  args: unknown;
  callId: string;
  name: string;
  type: "tool_call";
}
  | {
  callId: string;
  error?: string;
  result: unknown;
  type: "tool_result";
}
  | {
  content: string;
  type: "thinking";
}
  | {
  error?: string;
  status: "running" | "waiting" | "complete" | "error";
  type: "status";
}
  | {
  data: Record<string, unknown>;
  type: "metadata";
}
  | {
  annotations?: ToolAnnotations;
  approvalId: string;
  args: unknown;
  streamId: string;
  toolName: string;
  type: "approval_pending";
};

```

## Type Declaration[​](#type-declaration "Direct link to Type Declaration")

```ts
{
  content: string;
  type: "message_delta";
}

```

### content[​](#content "Direct link to content")

```ts
content: string;

```

### type[​](#type "Direct link to type")

```ts
type: "message_delta";

```

```ts
{
  content: string;
  type: "message";
}

```

### content[​](#content-1 "Direct link to content")

```ts
content: string;

```

### type[​](#type-1 "Direct link to type")

```ts
type: "message";

```

```ts
{
  args: unknown;
  callId: string;
  name: string;
  type: "tool_call";
}

```

### args[​](#args "Direct link to args")

```ts
args: unknown;

```

### callId[​](#callid "Direct link to callId")

```ts
callId: string;

```

### name[​](#name "Direct link to name")

```ts
name: string;

```

### type[​](#type-2 "Direct link to type")

```ts
type: "tool_call";

```

```ts
{
  callId: string;
  error?: string;
  result: unknown;
  type: "tool_result";
}

```

### callId[​](#callid-1 "Direct link to callId")

```ts
callId: string;

```

### error?[​](#error "Direct link to error?")

```ts
optional error: string;

```

### result[​](#result "Direct link to result")

```ts
result: unknown;

```

### type[​](#type-3 "Direct link to type")

```ts
type: "tool_result";

```

```ts
{
  content: string;
  type: "thinking";
}

```

### content[​](#content-2 "Direct link to content")

```ts
content: string;

```

### type[​](#type-4 "Direct link to type")

```ts
type: "thinking";

```

```ts
{
  error?: string;
  status: "running" | "waiting" | "complete" | "error";
  type: "status";
}

```

### error?[​](#error-1 "Direct link to error?")

```ts
optional error: string;

```

### status[​](#status "Direct link to status")

```ts
status: "running" | "waiting" | "complete" | "error";

```

### type[​](#type-5 "Direct link to type")

```ts
type: "status";

```

```ts
{
  data: Record<string, unknown>;
  type: "metadata";
}

```

### data[​](#data "Direct link to data")

```ts
data: Record<string, unknown>;

```

### type[​](#type-6 "Direct link to type")

```ts
type: "metadata";

```

```ts
{
  annotations?: ToolAnnotations;
  approvalId: string;
  args: unknown;
  streamId: string;
  toolName: string;
  type: "approval_pending";
}

```

### annotations?[​](#annotations "Direct link to annotations?")

```ts
optional annotations: ToolAnnotations;

```

### approvalId[​](#approvalid "Direct link to approvalId")

```ts
approvalId: string;

```

### args[​](#args-1 "Direct link to args")

```ts
args: unknown;

```

### streamId[​](#streamid "Direct link to streamId")

```ts
streamId: string;

```

### toolName[​](#toolname "Direct link to toolName")

```ts
toolName: string;

```

### type[​](#type-7 "Direct link to type")

```ts
type: "approval_pending";

```

Emitted by the agents plugin (not adapters) when a mutating tool call is awaiting human approval — fires for tools annotated with `effect: "write" | "update" | "destructive"` (preferred) or the legacy `destructive: true` boolean. Clients should render an approval prompt and POST to `/chat/approve` with the matching `approvalId` and a `decision` of `approve` or `deny`.
