# DialOptions

<!-- https://uncage.vercel.app/docs/api/agent/interfaces/dialoptions/ -->

Defined in: agent/src/transport/types.ts:98

## Properties

| Property | Type | Description | Defined in |
| ------ | ------ | ------ | ------ |
| <a id="property-cursor"></a> `cursor` | `object` | http: highest outbox seq dispatched, kept for the process lifetime. Crash semantics: a command dispatched but not yet acknowledged when the agent process dies is delivered again to the next process and runs again (dedupe is per process). A command acknowledged whose result never reached the hub before the crash is lost: the website request times out (`commandTimeoutMs`). Within one process, results not accepted by the hub are re-sent after every welcome. | agent/src/transport/types.ts:120 |
| `cursor.get` | () => `number` | - | agent/src/transport/types.ts:120 |
| `cursor.set` | (`seq`) => `void` | - | agent/src/transport/types.ts:120 |
| <a id="property-fetch"></a> `fetch` | (`input`, `init?`) => `Promise`\<`Response`\> | - | agent/src/transport/types.ts:124 |
| <a id="property-hello"></a> `hello` | `Omit`\<`Extract`\<`AgentFrame`, \{ `t`: `"hello"`; \}\>, `"transport"`\> | - | agent/src/transport/types.ts:107 |
| <a id="property-huburl"></a> `hubUrl` | `string` | - | agent/src/transport/types.ts:99 |
| <a id="property-logger"></a> `logger` | [`AgentLogger`](https://uncage.vercel.app/docs/api/agent/interfaces/agentlogger.md) | - | agent/src/transport/types.ts:125 |
| <a id="property-siteid"></a> `siteId?` | `string` | For log lines. | agent/src/transport/types.ts:127 |
| <a id="property-timing"></a> `timing` | [`AgentTiming`](https://uncage.vercel.app/docs/api/agent/interfaces/agenttiming.md) | - | agent/src/transport/types.ts:123 |
| <a id="property-token"></a> `token` | `string` | - | agent/src/transport/types.ts:106 |
| <a id="property-url"></a> `url?` | `string` | The transport URL the hub offered (`/agent/info` `transports[].url`), already checked to be on the site's host with a safe scheme (`offeredTransportUrl`). Default: derived from `hubUrl` (`<hubUrl>/agent`, ws(s) for WebSocket). | agent/src/transport/types.ts:105 |

## Methods

### busy()

```ts
busy(): boolean;
```

Defined in: agent/src/transport/types.ts:122

A run in progress or a tool call pending (keeps the hub in fast polling).

#### Returns

`boolean`

***

### onFrame()

```ts
onFrame(f): void;
```

Defined in: agent/src/transport/types.ts:111

A hub frame after the welcome (never `welcome`, `ping` or `upgrade_required`).

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `f` | \| \{ `machineId`: `string`; `minAgentVersion`: `string`; `protocol`: `number`; `t`: `"welcome"`; \} \| \{ `minAgentVersion`: `string`; `t`: `"upgrade_required"`; \} \| \{ `args`: `unknown`; `id`: `string`; `op`: \| `"createSession"` \| `"startRun"` \| `"cancelRun"` \| `"decide"` \| `"updateSettings"` \| `"addAttachment"` \| `"snapshot"` \| `"listSessions"` \| `"readEvents"`; `t`: `"command"`; \} \| \{ `sequence`: `number`; `sessionId`: `string`; `t`: `"ack"`; \} \| \{ `id`: `string`; `ok`: `true`; `result`: \{ `content`: ( \| \{ `text`: `string`; `type`: `"text"`; \} \| \{ `json`: `unknown`; `type`: `"json"`; \})[]; `isError?`: `boolean`; \}; `t`: `"tool_result"`; \} \| \{ `error`: \{ `code`: \| `"auth_required"` \| `"runtime_unavailable"` \| `"unsupported_capability"` \| `"invalid_workspace"` \| `"session_busy"` \| `"session_read_only"` \| `"not_found"` \| `"unauthorized"` \| `"forbidden_origin"` \| `"invalid_request"` \| `"approval_expired"` \| `"approval_already_resolved"` \| `"event_replay_unavailable"` \| `"runtime_disconnected"` \| `"policy_denied"` \| `"store_locked"` \| `"attachment_too_large"` \| `"attachment_type_unsupported"` \| `"machine_offline"` \| `"machine_not_found"` \| `"upgrade_required"` \| `"tool_failed"` \| `"device_code_expired"` \| `"rate_limited"` \| `"internal_error"`; `details?`: `Record`\<`string`, `unknown`\>; `hint?`: `string`; `message`: `string`; `requestId?`: `string`; `retryable`: `boolean`; \}; `id`: `string`; `ok`: `false`; `t`: `"tool_result"`; \} \| \{ `id`: `string`; `maxBytes`: `number`; `path`: `string`; `sessionId`: `string`; `t`: `"file_pull"`; \} \| \{ `id`: `string`; `mime`: `string`; `name`: `string`; `sessionId`: `string`; `size`: `number`; `t`: `"attachment_begin"`; \} \| \{ `data`: `string`; `id`: `string`; `seq`: `number`; `t`: `"attachment_chunk"`; \} \| \{ `id`: `string`; `t`: `"attachment_end"`; \} \| \{ `id`: `string`; `t`: `"attachment_abort"`; \} \| \{ `at`: `number`; `t`: `"ping"`; \} |

#### Returns

`void`

***

### onWelcome()

```ts
onWelcome(w): void;
```

Defined in: agent/src/transport/types.ts:109

The hub accepted the link. ws: `replies` is empty (follow-up frames arrive through `onFrame`).

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `w` | \{ `machineId`: `string`; `replies`: ( \| \{ `machineId`: `string`; `minAgentVersion`: `string`; `protocol`: `number`; `t`: `"welcome"`; \} \| \{ `minAgentVersion`: `string`; `t`: `"upgrade_required"`; \} \| \{ `args`: `unknown`; `id`: `string`; `op`: \| `"createSession"` \| `"startRun"` \| `"cancelRun"` \| `"decide"` \| `"updateSettings"` \| `"addAttachment"` \| `"snapshot"` \| `"listSessions"` \| `"readEvents"`; `t`: `"command"`; \} \| \{ `sequence`: `number`; `sessionId`: `string`; `t`: `"ack"`; \} \| \{ `id`: `string`; `ok`: `true`; `result`: \{ `content`: ( \| \{ `text`: `string`; `type`: `"text"`; \} \| \{ `json`: `unknown`; `type`: `"json"`; \})[]; `isError?`: `boolean`; \}; `t`: `"tool_result"`; \} \| \{ `error`: \{ `code`: \| `"auth_required"` \| `"runtime_unavailable"` \| `"unsupported_capability"` \| `"invalid_workspace"` \| `"session_busy"` \| `"session_read_only"` \| `"not_found"` \| `"unauthorized"` \| `"forbidden_origin"` \| `"invalid_request"` \| `"approval_expired"` \| `"approval_already_resolved"` \| `"event_replay_unavailable"` \| `"runtime_disconnected"` \| `"policy_denied"` \| `"store_locked"` \| `"attachment_too_large"` \| `"attachment_type_unsupported"` \| `"machine_offline"` \| `"machine_not_found"` \| `"upgrade_required"` \| `"tool_failed"` \| `"device_code_expired"` \| `"rate_limited"` \| `"internal_error"`; `details?`: `Record`\<`string`, `unknown`\>; `hint?`: `string`; `message`: `string`; `requestId?`: `string`; `retryable`: `boolean`; \}; `id`: `string`; `ok`: `false`; `t`: `"tool_result"`; \} \| \{ `id`: `string`; `maxBytes`: `number`; `path`: `string`; `sessionId`: `string`; `t`: `"file_pull"`; \} \| \{ `id`: `string`; `mime`: `string`; `name`: `string`; `sessionId`: `string`; `size`: `number`; `t`: `"attachment_begin"`; \} \| \{ `data`: `string`; `id`: `string`; `seq`: `number`; `t`: `"attachment_chunk"`; \} \| \{ `id`: `string`; `t`: `"attachment_end"`; \} \| \{ `id`: `string`; `t`: `"attachment_abort"`; \} \| \{ `at`: `number`; `t`: `"ping"`; \})[]; \} |
| `w.machineId` | `string` |
| `w.replies` | ( \| \{ `machineId`: `string`; `minAgentVersion`: `string`; `protocol`: `number`; `t`: `"welcome"`; \} \| \{ `minAgentVersion`: `string`; `t`: `"upgrade_required"`; \} \| \{ `args`: `unknown`; `id`: `string`; `op`: \| `"createSession"` \| `"startRun"` \| `"cancelRun"` \| `"decide"` \| `"updateSettings"` \| `"addAttachment"` \| `"snapshot"` \| `"listSessions"` \| `"readEvents"`; `t`: `"command"`; \} \| \{ `sequence`: `number`; `sessionId`: `string`; `t`: `"ack"`; \} \| \{ `id`: `string`; `ok`: `true`; `result`: \{ `content`: ( \| \{ `text`: `string`; `type`: `"text"`; \} \| \{ `json`: `unknown`; `type`: `"json"`; \})[]; `isError?`: `boolean`; \}; `t`: `"tool_result"`; \} \| \{ `error`: \{ `code`: \| `"auth_required"` \| `"runtime_unavailable"` \| `"unsupported_capability"` \| `"invalid_workspace"` \| `"session_busy"` \| `"session_read_only"` \| `"not_found"` \| `"unauthorized"` \| `"forbidden_origin"` \| `"invalid_request"` \| `"approval_expired"` \| `"approval_already_resolved"` \| `"event_replay_unavailable"` \| `"runtime_disconnected"` \| `"policy_denied"` \| `"store_locked"` \| `"attachment_too_large"` \| `"attachment_type_unsupported"` \| `"machine_offline"` \| `"machine_not_found"` \| `"upgrade_required"` \| `"tool_failed"` \| `"device_code_expired"` \| `"rate_limited"` \| `"internal_error"`; `details?`: `Record`\<`string`, `unknown`\>; `hint?`: `string`; `message`: `string`; `requestId?`: `string`; `retryable`: `boolean`; \}; `id`: `string`; `ok`: `false`; `t`: `"tool_result"`; \} \| \{ `id`: `string`; `maxBytes`: `number`; `path`: `string`; `sessionId`: `string`; `t`: `"file_pull"`; \} \| \{ `id`: `string`; `mime`: `string`; `name`: `string`; `sessionId`: `string`; `size`: `number`; `t`: `"attachment_begin"`; \} \| \{ `data`: `string`; `id`: `string`; `seq`: `number`; `t`: `"attachment_chunk"`; \} \| \{ `id`: `string`; `t`: `"attachment_end"`; \} \| \{ `id`: `string`; `t`: `"attachment_abort"`; \} \| \{ `at`: `number`; `t`: `"ping"`; \})[] |

#### Returns

`void`
