# Class ReadonlyContext

A readonly context represents the data of a single invocation of an agent.

#### Hierarchy (View Summary)

- ReadonlyContext
  - Context

- Defined in agents/readonly_context.ts:16

## Constructors

### constructor

- new ReadonlyContext(invocationContext: InvocationContext): ReadonlyContext

  #### Parameters

  - invocationContext: InvocationContext

  #### Returns ReadonlyContext

  - Defined in agents/readonly_context.ts:17

## Properties

### `Readonly` invocationContext

invocationContext: InvocationContext

- Defined in agents/readonly_context.ts:17

## Accessors

### agentName

- get agentName(): string

  The current agent name.

  #### Returns string

  - Defined in agents/readonly_context.ts:50

### invocationId

- get invocationId(): string

  The current invocation id.

  #### Returns string

  - Defined in agents/readonly_context.ts:29

### sessionId

- get sessionId(): string

  The ID of the current session.

  #### Returns string

  - Defined in agents/readonly_context.ts:43

### state

- get state(): Readonly<State>

  The state of the current session.

  #### Returns Readonly<State>

  - Defined in agents/readonly_context.ts:57

### userContent

- get userContent(): Content | undefined

  The user content that started this invocation.

  #### Returns Content | undefined

  - Defined in agents/readonly_context.ts:22

### userId

- get userId(): string

  The user ID of the current session.

  #### Returns string

  - Defined in agents/readonly_context.ts:36