[**@s4ai/core Documentation v0.3.23**](../../../README.md)

***

[@s4ai/core Documentation](../../../modules.md) / [@s4ai/core](../README.md) / HyperSwarmClient

# Class: HyperSwarmClient

Defined in: infrastructure/hyper-swarm-client.js:11

## Constructors

### Constructor

> **new HyperSwarmClient**(`config?`): `HyperSwarmClient`

Defined in: infrastructure/hyper-swarm-client.js:12

#### Parameters

##### config?

#### Returns

`HyperSwarmClient`

## Properties

### enabled

> **enabled**: `boolean`

Defined in: infrastructure/hyper-swarm-client.js:17

***

### orchestratorScript

> **orchestratorScript**: `any`

Defined in: infrastructure/hyper-swarm-client.js:15

***

### pythonPath

> **pythonPath**: `any`

Defined in: infrastructure/hyper-swarm-client.js:13

***

### swarmDir

> **swarmDir**: `any`

Defined in: infrastructure/hyper-swarm-client.js:14

***

### timeout

> **timeout**: `any`

Defined in: infrastructure/hyper-swarm-client.js:16

## Methods

### \_logExecution()

> **\_logExecution**(`goal`, `result`): `Promise`\<`void`\>

Defined in: infrastructure/hyper-swarm-client.js:146

Private: Log execution to database

#### Parameters

##### goal

`any`

##### result

`any`

#### Returns

`Promise`\<`void`\>

***

### \_spawnPython()

> **\_spawnPython**(`params`, `script?`): `Promise`\<`any`\>

Defined in: infrastructure/hyper-swarm-client.js:94

Private: Spawn Python process

#### Parameters

##### params

`any`

##### script?

`any` = `...`

#### Returns

`Promise`\<`any`\>

***

### execute()

> **execute**(`goal`, `options?`): `Promise`\<`object`\>

Defined in: infrastructure/hyper-swarm-client.js:26

Execute high-level goal using HyperSwarm

#### Parameters

##### goal

`string`

High-level goal description

##### options?

`object` = `{}`

Execution options

#### Returns

`Promise`\<`object`\>

Execution result

***

### getMetrics()

> **getMetrics**(): `Promise`\<`any`\>

Defined in: infrastructure/hyper-swarm-client.js:175

Get swarm metrics from database

#### Returns

`Promise`\<`any`\>

***

### screenshotToCode()

> **screenshotToCode**(`screenshotPath`, `componentName`, `framework?`): `Promise`\<`object`\>

Defined in: infrastructure/hyper-swarm-client.js:63

Convert screenshot to code

#### Parameters

##### screenshotPath

`string`

Path to screenshot file

##### componentName

`string`

Component name

##### framework?

`string` = `'react'`

Target framework (react, vue, html)

#### Returns

`Promise`\<`object`\>

Generated code
