# Class: ComputerUseAgent

An Agent to perform tasks on the computer.

## Hierarchy

- `BaseTaskAgent`

  ↳ **`ComputerUseAgent`**

## Table of contents


### Properties

- [session](#session)
- [toolPrefix](#toolprefix)

### Methods

- [executeTask](#executetask)
- [executeTaskAndWait](#executetaskandwait)
- [executeTaskStreamWs](#executetaskstreamws)
- [hasStreamingParams](#hasstreamingparams)
- [resolveAgentTarget](#resolveagenttarget)
- [startTaskStreamWs](#starttaskstreamws)
- [terminateTask](#terminatetask)

## Properties

### session

• `Protected` **session**: ``McpSession``

#### Inherited from

BaseTaskAgent.session

___

### toolPrefix

• `Protected` **toolPrefix**: `string` = `"flux"`

#### Overrides

BaseTaskAgent.toolPrefix

## Methods

### executeTask

▸ **executeTask**(`task`): `Promise`\<``ExecutionResult``\>

Execute a specific task described in human language.
Note: MobileUseAgent overrides this to return TaskExecution instead.

#### Parameters

| Name | Type |
| :------ | :------ |
| `task` | `string` |

#### Returns

`Promise`\<``ExecutionResult``\>

#### Inherited from

BaseTaskAgent.executeTask

___

### executeTaskAndWait

▸ **executeTaskAndWait**(`task`, `timeout`): `Promise`\<``ExecutionResult``\>

Execute a specific task described in human language synchronously.
This is a synchronous interface that blocks until the task is completed or
an error occurs, or timeout happens. The default polling interval is 3 seconds.

#### Parameters

| Name | Type |
| :------ | :------ |
| `task` | `string` |
| `timeout` | `number` |

#### Returns

`Promise`\<``ExecutionResult``\>

#### Inherited from

BaseTaskAgent.executeTaskAndWait

___

### executeTaskStreamWs

▸ **executeTaskStreamWs**(`params`): `Promise`\<``ExecutionResult``\>

Execute a task via WebSocket streaming channel.

#### Parameters

| Name | Type |
| :------ | :------ |
| `params` | `Object` |
| `params.options?` | ``AgentStreamingOptions`` \| ``MobileTaskOptions`` |
| `params.taskParams` | `Record`\<`string`, `any`\> |
| `params.timeout` | `number` |

#### Returns

`Promise`\<``ExecutionResult``\>

#### Inherited from

BaseTaskAgent.executeTaskStreamWs

### hasStreamingParams

▸ **hasStreamingParams**(`options?`): `boolean`

Check if any streaming option is provided.

#### Parameters

| Name | Type |
| :------ | :------ |
| `options?` | ``AgentStreamingOptions`` \| ``MobileTaskOptions`` |

#### Returns

`boolean`

#### Inherited from

BaseTaskAgent.hasStreamingParams

___

### resolveAgentTarget

▸ **resolveAgentTarget**(): `string`

Resolve the WS target for this agent from MCP tools list.

#### Returns

`string`

#### Inherited from

BaseTaskAgent.resolveAgentTarget

___

### startTaskStreamWs

▸ **startTaskStreamWs**(`params`): `Promise`\<\{ `context`: \{ `errors`: `Error`[] ; `finalContentParts`: `string`[] ; `lastError`: `undefined` \| `Record`\<`string`, `any`\>  } ; `handle`: \{ `cancel`: () => `Promise`\<`void`\> ; `invocationId`: `string` ; `waitEnd`: () => `Promise`\<`any`\> ; `write`: (`data`: `Record`\<`string`, `any`\>) => `Promise`\<`void`\>  }  }\>

Start a task via WebSocket streaming channel. Returns handle and context
immediately without blocking. Use handle.waitEnd() to await completion.

#### Parameters

| Name | Type |
| :------ | :------ |
| `params` | `Object` |
| `params.options?` | ``AgentStreamingOptions`` \| ``MobileTaskOptions`` |
| `params.taskParams` | `Record`\<`string`, `any`\> |

#### Returns

`Promise`\<\{ `context`: \{ `errors`: `Error`[] ; `finalContentParts`: `string`[] ; `lastError`: `undefined` \| `Record`\<`string`, `any`\>  } ; `handle`: \{ `cancel`: () => `Promise`\<`void`\> ; `invocationId`: `string` ; `waitEnd`: () => `Promise`\<`any`\> ; `write`: (`data`: `Record`\<`string`, `any`\>) => `Promise`\<`void`\>  }  }\>

#### Inherited from

BaseTaskAgent.startTaskStreamWs

___

### terminateTask

▸ **terminateTask**(`taskId`): `Promise`\<``ExecutionResult``\>

Terminate a task with a specified task ID.

#### Parameters

| Name | Type |
| :------ | :------ |
| `taskId` | `string` |

#### Returns

`Promise`\<``ExecutionResult``\>

#### Inherited from

BaseTaskAgent.terminateTask
