# Class CollaborationSession

Manages a collaboration session between multiple experts.

- Defined in packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:47

##### Index

### Constructors

constructor

### Methods

start
submitResult
requestReview
submitReview
vote
getStatus
getSessionId
markExpertFailed
getTaskAssignments
finalize
cancel
addEventListener
removeEventListener

## Constructors

### constructor

- new CollaborationSession(
  options?: CollaborationSessionOptions,
  ): CollaborationSession

  #### Parameters

  - options: CollaborationSessionOptions = {}

  #### Returns CollaborationSession

  - Defined in packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:57

## Methods

### start

- start(config: CollaborationConfig): Result<string, AgentError>

  Starts a new collaboration session.

  #### Parameters

  - config: CollaborationConfig

  #### Returns Result<string, AgentError>

  - Defined in packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:66

### submitResult

- submitResult(expertId: string, result: TaskResult): Result<void, AgentError>

  Submits a result from an expert.

  #### Parameters

  - expertId: string
  - result: TaskResult

  #### Returns Result<void, AgentError>

  - Defined in packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:116

### requestReview

- requestReview(
  fromExpert: string,
  toExpert: string,
  artifact: unknown,
  ): Result<void, AgentError>

  Requests a review from one expert to another.

  #### Parameters

  - fromExpert: string
  - toExpert: string
  - artifact: unknown

  #### Returns Result<void, AgentError>

  - Defined in packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:148

### submitReview

- submitReview(
  reviewerId: string,
  requesterId: string,
  approved: boolean,
  feedback: string,
  ): Result<void, AgentError>

  Submits a review response.

  #### Parameters

  - reviewerId: string
  - requesterId: string
  - approved: boolean
  - feedback: string

  #### Returns Result<void, AgentError>

  - Defined in packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:169

### vote

- vote(
  expertId: string,
  decision: "approve" | "reject" | "abstain",
  reasoning: string,
  ): Result<void, AgentError>

  Submits a vote for consensus protocol.

  #### Parameters

  - expertId: string
  - decision: "approve" | "reject" | "abstain"
  - reasoning: string

  #### Returns Result<void, AgentError>

  - Defined in packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:199

### getStatus

- getStatus(): SessionState | null

  #### Returns SessionState | null

  - Defined in packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:242

### getSessionId

- getSessionId(): string | null

  #### Returns string | null

  - Defined in packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:245

### markExpertFailed

- markExpertFailed(expertId: string, _error: string): Result<void, AgentError>

  Marks an expert as failed.

  #### Parameters

  - expertId: string
  - _error: string

  #### Returns Result<void, AgentError>

  - Defined in packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:250

### getTaskAssignments

- getTaskAssignments(): TaskAssignmentMessage[]

  Gets task assignments for experts based on pattern.

  #### Returns TaskAssignmentMessage[]

  - Defined in packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:277

### finalize

- finalize(): Result<CollaborationResult, AgentError>

  Finalizes the session and returns aggregated result.

  #### Returns Result<CollaborationResult, AgentError>

  - Defined in packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:284

### cancel

- cancel(reason: string): void

  #### Parameters

  - reason: string

  #### Returns void

  - Defined in packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:335

### addEventListener

- addEventListener(listener: (event: SessionEvent) => void): void

  #### Parameters

  - listener: (event: SessionEvent) => void

  #### Returns void

  - Defined in packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:345

### removeEventListener

- removeEventListener(listener: (event: SessionEvent) => void): void

  #### Parameters

  - listener: (event: SessionEvent) => void

  #### Returns void

  - Defined in packages/nexus-agents/src/agents/collaboration/collaboration-session.ts:356