# Class ConsensusProtocol

Consensus collaboration protocol.

#### Implements

- ICollaborationProtocol

- Defined in packages/nexus-agents/src/agents/collaboration/consensus-protocol.ts:22

##### Index

### Constructors

constructor

### Properties

pattern
logger
session
cancelled
options

### Methods

cancel
execute

## Constructors

### constructor

- new ConsensusProtocol(options?: ProtocolOptions): ConsensusProtocol

  #### Parameters

  - options: ProtocolOptions = {}

  #### Returns ConsensusProtocol

  - Defined in packages/nexus-agents/src/agents/collaboration/consensus-protocol.ts:29

## Properties

### `Readonly` pattern

pattern: "consensus" = ...

Implementation of ICollaborationProtocol.pattern

- Defined in packages/nexus-agents/src/agents/collaboration/consensus-protocol.ts:23

### `Protected` `Readonly` logger

logger: ILogger

- Defined in packages/nexus-agents/src/agents/collaboration/consensus-protocol.ts:24

### `Protected` session

session: CollaborationSession | null = null

- Defined in packages/nexus-agents/src/agents/collaboration/consensus-protocol.ts:25

### `Protected` cancelled

cancelled: boolean = false

- Defined in packages/nexus-agents/src/agents/collaboration/consensus-protocol.ts:26

### `Protected` `Readonly` options

options: ProtocolOptions

- Defined in packages/nexus-agents/src/agents/collaboration/consensus-protocol.ts:27

## Methods

### cancel

- cancel(reason: string): void

  #### Parameters

  - reason: string

  #### Returns void

  Implementation of ICollaborationProtocol.cancel

  - Defined in packages/nexus-agents/src/agents/collaboration/consensus-protocol.ts:34

### execute

- execute(
  config: CollaborationConfig,
  agents: Map<string, IAgent>,
  ): Promise<Result<CollaborationResult, AgentError>>

  #### Parameters

  - config: CollaborationConfig
  - agents: Map<string, IAgent>

  #### Returns Promise<Result<CollaborationResult, AgentError>>

  Implementation of ICollaborationProtocol.execute

  - Defined in packages/nexus-agents/src/agents/collaboration/consensus-protocol.ts:40