# OpenConnectionOptions
Source: https://docs.maelstrom-ai.co/dev/reference/engine/interfaces/openconnectionoptions/
Documentation revision: 89a8f5e9d10cedcf0b30376d7846113f06f26120
SDK manifests in this build: @maelstrom-co/react@0.2.1, @maelstrom-co/client@0.2.1, @maelstrom-co/connectors@0.2.1, @maelstrom-co/protocol@0.2.1, @maelstrom-co/engine@0.2.1
These docs follow this source revision. Manifest versions do not prove release compatibility; verify the installed package exports before using an API.

Defined in: [packages/engine/src/lib/agent-session/connection.ts:25](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/engine/src/lib/agent-session/connection.ts#L25)

Server-owned context and clock for one connection. Never supplied to the Planner.

The agent loop is experimental in 0.3 and may change in any minor release.

> [!WARNING]
> Experimental
> 
> This API should not be used in production and may be trimmed from a public release.

## Properties

### acknowledgementTimeoutMs?

> `readonly` `optional` **acknowledgementTimeoutMs?**: `number`

Defined in: [packages/engine/src/lib/agent-session/connection.ts:54](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/engine/src/lib/agent-session/connection.ts#L54)

Maximum wait in milliseconds for the browser to acknowledge a UI change with `ui_applied`. Defaults to 30,000. Must be a positive integer no greater than 2,147,483,647, or opening the connection throws. On the UI-only route, when it elapses, the run finishes with code `ui_ack_timeout`, every queued utterance finishes as `cancelled`, and the next utterance plans against its own Chart. A `change_screen` change of an Agent Run waits as long, then its goals that depend on the change answer `unknown`, a goal with a clarification verdict keeps `needs_clarification`, and the next queued Screen Change starts on the last acknowledged Chart.

> [!WARNING]
> Experimental
> 
> This API should not be used in production and may be trimmed from a public release.

* * *

### capabilities?

> `readonly` `optional` **capabilities?**: `unknown`

Defined in: [packages/engine/src/lib/agent-session/connection.ts:33](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/engine/src/lib/agent-session/connection.ts#L33)

Browser capability manifest, opaque until Client Tools are configured.

> [!WARNING]
> Experimental
> 
> This API should not be used in production and may be trimmed from a public release.

* * *

### clock?

> `readonly` `optional` **clock?**: () => `number`

Defined in: [packages/engine/src/lib/agent-session/connection.ts:35](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/engine/src/lib/agent-session/connection.ts#L35)

Monotonic millisecond clock for measuring run duration. Defaults to performance.now.

> [!WARNING]
> Experimental
> 
> This API should not be used in production and may be trimmed from a public release.

#### Returns

`number`

* * *

### scheduleTimeout?

> `readonly` `optional` **scheduleTimeout?**: (`callback`, `ms`) => () => `void`

Defined in: [packages/engine/src/lib/agent-session/connection.ts:41](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/engine/src/lib/agent-session/connection.ts#L41)

Schedules a callback after a delay in milliseconds and returns a function that cancels it. Agent Runs use it for their deadline. Defaults to `globalThis.setTimeout`, cancelled with `globalThis.clearTimeout`.

> [!WARNING]
> Experimental
> 
> This API should not be used in production and may be trimmed from a public release.

Calls `callback` once after `ms` milliseconds and returns a function that cancels the call when it has not happened yet.

#### Parameters

##### callback

() => `void`

##### ms

`number`

#### Returns

() => `void`

* * *

### sessionId

> `readonly` **sessionId**: `SessionId`

Defined in: [packages/engine/src/lib/agent-session/connection.ts:27](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/engine/src/lib/agent-session/connection.ts#L27)

Session the host authorized before opening this connection.

> [!WARNING]
> Experimental
> 
> This API should not be used in production and may be trimmed from a public release.

* * *

### token?

> `readonly` `optional` **token?**: `string`

Defined in: [packages/engine/src/lib/agent-session/connection.ts:31](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/engine/src/lib/agent-session/connection.ts#L31)

Optional application credential. Provider API keys do not belong here.

> [!WARNING]
> Experimental
> 
> This API should not be used in production and may be trimmed from a public release.

* * *

### user

> `readonly` **user**: `unknown`

Defined in: [packages/engine/src/lib/agent-session/connection.ts:29](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/engine/src/lib/agent-session/connection.ts#L29)

Host-authenticated principal, opaque to the UI-only route. Use null for anonymous applications.

> [!WARNING]
> Experimental
> 
> This API should not be used in production and may be trimmed from a public release.
