<!--
 ⚠️  AUTO-GENERATED FILE - DO NOT EDIT MANUALLY
 This file is automatically generated by scripts/docs-generator.js
 To make changes, edit the source TypeScript files or update the generator script
-->

[agents](../../) / [Exports](../modules) / AbstractPlugin

# Class: AbstractPlugin\<TOptions, TStats\>

Abstract class for all plugins with type parameter support
Provides plugin lifecycle management and common functionality

Enhanced with:

- Plugin classification system (categories and priorities)
- EventEmitter integration for module event subscription
- Improved statistics tracking
- Better error handling and recovery

## Type parameters

| Name       | Type                                                                                                        | Description                                                       |
| :--------- | :---------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------- |
| `TOptions` | extends [`IPluginOptions`](../interfaces/IPluginOptions) = [`IPluginOptions`](../interfaces/IPluginOptions) | Plugin options type that extends IPluginOptions                   |
| `TStats`   | extends [`IPluginStats`](../interfaces/IPluginStats) = [`IPluginStats`](../interfaces/IPluginStats)         | Plugin statistics type (defaults to IPluginStats for type safety) |

## Hierarchy

- **`AbstractPlugin`**

  ↳ [`ErrorHandlingPlugin`](ErrorHandlingPlugin)

  ↳ [`LimitsPlugin`](LimitsPlugin)

  ↳ [`EventEmitterPlugin`](EventEmitterPlugin)

  ↳ [`WebhookPlugin`](WebhookPlugin)

  ↳ [`ConversationHistoryPlugin`](ConversationHistoryPlugin)

  ↳ [`LoggingPlugin`](LoggingPlugin)

  ↳ [`UsagePlugin`](UsagePlugin)

  ↳ [`PerformancePlugin`](PerformancePlugin)

  ↳ [`ExecutionAnalyticsPlugin`](ExecutionAnalyticsPlugin)

## Implements

- [`ITypeSafePlugin`](../interfaces/ITypeSafePlugin)\<`TOptions`, `TStats`\>
- [`IPluginHooks`](../interfaces/IPluginHooks)

## Table of contents

### Constructors

- [constructor](AbstractPlugin#constructor)

### Properties

- [name](AbstractPlugin#name)
- [version](AbstractPlugin#version)
- [enabled](AbstractPlugin#enabled)
- [category](AbstractPlugin#category)
- [priority](AbstractPlugin#priority)

### Methods

- [initialize](AbstractPlugin#initialize)
- [subscribeToModuleEvents](AbstractPlugin#subscribetomoduleevents)
- [unsubscribeFromModuleEvents](AbstractPlugin#unsubscribefrommoduleevents)
- [dispose](AbstractPlugin#dispose)
- [enable](AbstractPlugin#enable)
- [disable](AbstractPlugin#disable)
- [isEnabled](AbstractPlugin#isenabled)
- [getConfig](AbstractPlugin#getconfig)
- [updateConfig](AbstractPlugin#updateconfig)
- [getData](AbstractPlugin#getdata)
- [clearData](AbstractPlugin#cleardata)
- [getStatus](AbstractPlugin#getstatus)
- [getStats](AbstractPlugin#getstats)
- [beforeRun](AbstractPlugin#beforerun)
- [afterRun](AbstractPlugin#afterrun)
- [beforeExecution](AbstractPlugin#beforeexecution)
- [afterExecution](AbstractPlugin#afterexecution)
- [beforeConversation](AbstractPlugin#beforeconversation)
- [afterConversation](AbstractPlugin#afterconversation)
- [beforeToolCall](AbstractPlugin#beforetoolcall)
- [beforeToolExecution](AbstractPlugin#beforetoolexecution)
- [afterToolCall](AbstractPlugin#aftertoolcall)
- [afterToolExecution](AbstractPlugin#aftertoolexecution)
- [beforeProviderCall](AbstractPlugin#beforeprovidercall)
- [afterProviderCall](AbstractPlugin#afterprovidercall)
- [onStreamingChunk](AbstractPlugin#onstreamingchunk)
- [onError](AbstractPlugin#onerror)
- [onMessageAdded](AbstractPlugin#onmessageadded)
- [onModuleEvent](AbstractPlugin#onmoduleevent)

## Constructors

### constructor

• **new AbstractPlugin**\<`TOptions`, `TStats`\>(): [`AbstractPlugin`](AbstractPlugin)\<`TOptions`, `TStats`\>

#### Type parameters

| Name       | Type                                                                                                        |
| :--------- | :---------------------------------------------------------------------------------------------------------- |
| `TOptions` | extends [`IPluginOptions`](../interfaces/IPluginOptions) = [`IPluginOptions`](../interfaces/IPluginOptions) |
| `TStats`   | extends [`IPluginStats`](../interfaces/IPluginStats) = [`IPluginStats`](../interfaces/IPluginStats)         |

#### Returns

[`AbstractPlugin`](AbstractPlugin)\<`TOptions`, `TStats`\>

## Properties

### name

• `Readonly` `Abstract` **name**: `string`

Plugin name

#### Implementation of

[ITypeSafePlugin](../interfaces/ITypeSafePlugin).[name](../interfaces/ITypeSafePlugin#name)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:301](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L301)

---

### version

• `Readonly` `Abstract` **version**: `string`

Plugin version

#### Implementation of

[ITypeSafePlugin](../interfaces/ITypeSafePlugin).[version](../interfaces/ITypeSafePlugin#version)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:304](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L304)

---

### enabled

• **enabled**: `boolean` = `true`

Plugin enabled state

#### Implementation of

[ITypeSafePlugin](../interfaces/ITypeSafePlugin).[enabled](../interfaces/ITypeSafePlugin#enabled)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:307](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L307)

---

### category

• **category**: [`PluginCategory`](../enums/PluginCategory) = `PluginCategory.CUSTOM`

Plugin category for classification

#### Implementation of

[ITypeSafePlugin](../interfaces/ITypeSafePlugin).[category](../interfaces/ITypeSafePlugin#category)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:310](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L310)

---

### priority

• **priority**: `number` = `PluginPriority.NORMAL`

Plugin priority for execution order

#### Implementation of

[ITypeSafePlugin](../interfaces/ITypeSafePlugin).[priority](../interfaces/ITypeSafePlugin#priority)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:313](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L313)

## Methods

### initialize

▸ **initialize**(`options?`): `Promise`\<`void`\>

Initialize the plugin with type-safe options

#### Parameters

| Name       | Type       |
| :--------- | :--------- |
| `options?` | `TOptions` |

#### Returns

`Promise`\<`void`\>

#### Implementation of

[ITypeSafePlugin](../interfaces/ITypeSafePlugin).[initialize](../interfaces/ITypeSafePlugin#initialize)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:338](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L338)

---

### subscribeToModuleEvents

▸ **subscribeToModuleEvents**(`eventEmitter`): `Promise`\<`void`\>

Subscribe to module events through EventEmitter

#### Parameters

| Name           | Type                                       |
| :------------- | :----------------------------------------- |
| `eventEmitter` | [`EventEmitterPlugin`](EventEmitterPlugin) |

#### Returns

`Promise`\<`void`\>

#### Implementation of

[ITypeSafePlugin](../interfaces/ITypeSafePlugin).[subscribeToModuleEvents](../interfaces/ITypeSafePlugin#subscribetomoduleevents)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:366](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L366)

---

### unsubscribeFromModuleEvents

▸ **unsubscribeFromModuleEvents**(`eventEmitter`): `Promise`\<`void`\>

Unsubscribe from module events

#### Parameters

| Name           | Type                                       |
| :------------- | :----------------------------------------- |
| `eventEmitter` | [`EventEmitterPlugin`](EventEmitterPlugin) |

#### Returns

`Promise`\<`void`\>

#### Implementation of

[ITypeSafePlugin](../interfaces/ITypeSafePlugin).[unsubscribeFromModuleEvents](../interfaces/ITypeSafePlugin#unsubscribefrommoduleevents)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:423](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L423)

---

### dispose

▸ **dispose**(): `Promise`\<`void`\>

Cleanup plugin resources

#### Returns

`Promise`\<`void`\>

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:438](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L438)

---

### enable

▸ **enable**(): `void`

Enable the plugin

#### Returns

`void`

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:450](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L450)

---

### disable

▸ **disable**(): `void`

Disable the plugin

#### Returns

`void`

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:457](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L457)

---

### isEnabled

▸ **isEnabled**(): `boolean`

Check if plugin is enabled

#### Returns

`boolean`

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:464](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L464)

---

### getConfig

▸ **getConfig**(): [`IPluginConfig`](../interfaces/IPluginConfig)

Get plugin configuration

#### Returns

[`IPluginConfig`](../interfaces/IPluginConfig)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:471](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L471)

---

### updateConfig

▸ **updateConfig**(`_config`): `void`

Update plugin configuration

#### Parameters

| Name      | Type                                           |
| :-------- | :--------------------------------------------- |
| `_config` | [`IPluginConfig`](../interfaces/IPluginConfig) |

#### Returns

`void`

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:478](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L478)

---

### getData

▸ **getData**(): [`IPluginData`](../interfaces/IPluginData)

Get plugin data - enhanced with classification information

#### Returns

[`IPluginData`](../interfaces/IPluginData)

#### Implementation of

[ITypeSafePlugin](../interfaces/ITypeSafePlugin).[getData](../interfaces/ITypeSafePlugin#getdata)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:485](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L485)

---

### clearData

▸ **clearData**(): `void`

Clear plugin data - common interface for all plugins
This method should be implemented by plugins that store data

#### Returns

`void`

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:505](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L505)

---

### getStatus

▸ **getStatus**(): `Object`

Get plugin status - enhanced with classification information

#### Returns

`Object`

| Name                    | Type                                        |
| :---------------------- | :------------------------------------------ |
| `name`                  | `string`                                    |
| `version`               | `string`                                    |
| `enabled`               | `boolean`                                   |
| `initialized`           | `boolean`                                   |
| `category`              | [`PluginCategory`](../enums/PluginCategory) |
| `priority`              | `number`                                    |
| `subscribedEventsCount` | `number`                                    |
| `hasEventEmitter`       | `boolean`                                   |

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:510](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L510)

---

### getStats

▸ **getStats**(): `TStats`

Get plugin statistics - enhanced with module event tracking

#### Returns

`TStats`

#### Implementation of

[ITypeSafePlugin](../interfaces/ITypeSafePlugin).[getStats](../interfaces/ITypeSafePlugin#getstats)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:535](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L535)

---

### beforeRun

▸ **beforeRun**(`input`, `options?`): `Promise`\<`void`\>

Called before agent run

#### Parameters

| Name       | Type                                       |
| :--------- | :----------------------------------------- |
| `input`    | `string`                                   |
| `options?` | [`IRunOptions`](../interfaces/IRunOptions) |

#### Returns

`Promise`\<`void`\>

#### Implementation of

[IPluginHooks](../interfaces/IPluginHooks).[beforeRun](../interfaces/IPluginHooks#beforerun)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:564](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L564)

---

### afterRun

▸ **afterRun**(`input`, `response`, `options?`): `Promise`\<`void`\>

Called after agent run

#### Parameters

| Name       | Type                                       |
| :--------- | :----------------------------------------- |
| `input`    | `string`                                   |
| `response` | `string`                                   |
| `options?` | [`IRunOptions`](../interfaces/IRunOptions) |

#### Returns

`Promise`\<`void`\>

#### Implementation of

[IPluginHooks](../interfaces/IPluginHooks).[afterRun](../interfaces/IPluginHooks#afterrun)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:565](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L565)

---

### beforeExecution

▸ **beforeExecution**(`context`): `Promise`\<`void`\>

Called before execution with context

#### Parameters

| Name      | Type                                                               |
| :-------- | :----------------------------------------------------------------- |
| `context` | [`IPluginExecutionContext`](../interfaces/IPluginExecutionContext) |

#### Returns

`Promise`\<`void`\>

#### Implementation of

[IPluginHooks](../interfaces/IPluginHooks).[beforeExecution](../interfaces/IPluginHooks#beforeexecution)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:566](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L566)

---

### afterExecution

▸ **afterExecution**(`context`, `result`): `Promise`\<`void`\>

Called after execution with context and result

#### Parameters

| Name      | Type                                                               |
| :-------- | :----------------------------------------------------------------- |
| `context` | [`IPluginExecutionContext`](../interfaces/IPluginExecutionContext) |
| `result`  | [`IPluginExecutionResult`](../interfaces/IPluginExecutionResult)   |

#### Returns

`Promise`\<`void`\>

#### Implementation of

[IPluginHooks](../interfaces/IPluginHooks).[afterExecution](../interfaces/IPluginHooks#afterexecution)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:567](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L567)

---

### beforeConversation

▸ **beforeConversation**(`context`): `Promise`\<`void`\>

Called before conversation with context

#### Parameters

| Name      | Type                                                               |
| :-------- | :----------------------------------------------------------------- |
| `context` | [`IPluginExecutionContext`](../interfaces/IPluginExecutionContext) |

#### Returns

`Promise`\<`void`\>

#### Implementation of

[IPluginHooks](../interfaces/IPluginHooks).[beforeConversation](../interfaces/IPluginHooks#beforeconversation)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:568](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L568)

---

### afterConversation

▸ **afterConversation**(`context`, `result`): `Promise`\<`void`\>

Called after conversation with context and result

#### Parameters

| Name      | Type                                                               |
| :-------- | :----------------------------------------------------------------- |
| `context` | [`IPluginExecutionContext`](../interfaces/IPluginExecutionContext) |
| `result`  | [`IPluginExecutionResult`](../interfaces/IPluginExecutionResult)   |

#### Returns

`Promise`\<`void`\>

#### Implementation of

[IPluginHooks](../interfaces/IPluginHooks).[afterConversation](../interfaces/IPluginHooks#afterconversation)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:569](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L569)

---

### beforeToolCall

▸ **beforeToolCall**(`toolName`, `parameters`): `Promise`\<`void`\>

Called before tool execution

#### Parameters

| Name         | Type                                            |
| :----------- | :---------------------------------------------- |
| `toolName`   | `string`                                        |
| `parameters` | [`TToolParameters`](../modules#ttoolparameters) |

#### Returns

`Promise`\<`void`\>

#### Implementation of

[IPluginHooks](../interfaces/IPluginHooks).[beforeToolCall](../interfaces/IPluginHooks#beforetoolcall)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:570](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L570)

---

### beforeToolExecution

▸ **beforeToolExecution**(`context`, `toolData`): `Promise`\<`void`\>

Called before tool execution with context

#### Parameters

| Name       | Type                                                               |
| :--------- | :----------------------------------------------------------------- |
| `context`  | [`IPluginExecutionContext`](../interfaces/IPluginExecutionContext) |
| `toolData` | [`IToolExecutionContext`](../interfaces/IToolExecutionContext)     |

#### Returns

`Promise`\<`void`\>

#### Implementation of

[IPluginHooks](../interfaces/IPluginHooks).[beforeToolExecution](../interfaces/IPluginHooks#beforetoolexecution)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:571](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L571)

---

### afterToolCall

▸ **afterToolCall**(`toolName`, `parameters`, `result`): `Promise`\<`void`\>

Called after tool execution

#### Parameters

| Name         | Type                                                         |
| :----------- | :----------------------------------------------------------- |
| `toolName`   | `string`                                                     |
| `parameters` | [`TToolParameters`](../modules#ttoolparameters)              |
| `result`     | [`IToolExecutionResult`](../interfaces/IToolExecutionResult) |

#### Returns

`Promise`\<`void`\>

#### Implementation of

[IPluginHooks](../interfaces/IPluginHooks).[afterToolCall](../interfaces/IPluginHooks#aftertoolcall)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:572](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L572)

---

### afterToolExecution

▸ **afterToolExecution**(`context`, `toolResults`): `Promise`\<`void`\>

Called after tool execution with context

#### Parameters

| Name          | Type                                                               |
| :------------ | :----------------------------------------------------------------- |
| `context`     | [`IPluginExecutionContext`](../interfaces/IPluginExecutionContext) |
| `toolResults` | [`IPluginExecutionResult`](../interfaces/IPluginExecutionResult)   |

#### Returns

`Promise`\<`void`\>

#### Implementation of

[IPluginHooks](../interfaces/IPluginHooks).[afterToolExecution](../interfaces/IPluginHooks#aftertoolexecution)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:573](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L573)

---

### beforeProviderCall

▸ **beforeProviderCall**(`messages`): `Promise`\<`void`\>

Called before AI provider call

#### Parameters

| Name       | Type                                                  |
| :--------- | :---------------------------------------------------- |
| `messages` | [`TUniversalMessage`](../modules#tuniversalmessage)[] |

#### Returns

`Promise`\<`void`\>

#### Implementation of

[IPluginHooks](../interfaces/IPluginHooks).[beforeProviderCall](../interfaces/IPluginHooks#beforeprovidercall)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:574](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L574)

---

### afterProviderCall

▸ **afterProviderCall**(`messages`, `response`): `Promise`\<`void`\>

Called after AI provider call

#### Parameters

| Name       | Type                                                  |
| :--------- | :---------------------------------------------------- |
| `messages` | [`TUniversalMessage`](../modules#tuniversalmessage)[] |
| `response` | [`TUniversalMessage`](../modules#tuniversalmessage)   |

#### Returns

`Promise`\<`void`\>

#### Implementation of

[IPluginHooks](../interfaces/IPluginHooks).[afterProviderCall](../interfaces/IPluginHooks#afterprovidercall)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:575](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L575)

---

### onStreamingChunk

▸ **onStreamingChunk**(`chunk`): `Promise`\<`void`\>

Called on streaming chunk

#### Parameters

| Name    | Type                                                |
| :------ | :-------------------------------------------------- |
| `chunk` | [`TUniversalMessage`](../modules#tuniversalmessage) |

#### Returns

`Promise`\<`void`\>

#### Implementation of

[IPluginHooks](../interfaces/IPluginHooks).[onStreamingChunk](../interfaces/IPluginHooks#onstreamingchunk)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:576](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L576)

---

### onError

▸ **onError**(`error`, `context?`): `Promise`\<`void`\>

Called on error

#### Parameters

| Name       | Type                                                       |
| :--------- | :--------------------------------------------------------- |
| `error`    | `Error`                                                    |
| `context?` | [`IPluginErrorContext`](../interfaces/IPluginErrorContext) |

#### Returns

`Promise`\<`void`\>

#### Implementation of

[IPluginHooks](../interfaces/IPluginHooks).[onError](../interfaces/IPluginHooks#onerror)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:577](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L577)

---

### onMessageAdded

▸ **onMessageAdded**(`message`): `Promise`\<`void`\>

Called on message added to history

#### Parameters

| Name      | Type                                                |
| :-------- | :-------------------------------------------------- |
| `message` | [`TUniversalMessage`](../modules#tuniversalmessage) |

#### Returns

`Promise`\<`void`\>

#### Implementation of

[IPluginHooks](../interfaces/IPluginHooks).[onMessageAdded](../interfaces/IPluginHooks#onmessageadded)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:578](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L578)

---

### onModuleEvent

▸ **onModuleEvent**(`eventType`, `eventData`): `Promise`\<`void`\>

Called when module events are received

#### Parameters

| Name        | Type                                   |
| :---------- | :------------------------------------- |
| `eventType` | [`EventType`](../modules#eventtype)    |
| `eventData` | [`EventData`](../interfaces/EventData) |

#### Returns

`Promise`\<`void`\>

#### Implementation of

[IPluginHooks](../interfaces/IPluginHooks).[onModuleEvent](../interfaces/IPluginHooks#onmoduleevent)

#### Defined in

[packages/agents/src/abstracts/abstract-plugin.ts:579](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-plugin.ts#L579)
