<!--
 ⚠️  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) / LimitsPlugin

# Class: LimitsPlugin

Plugin for rate limiting and resource control
Enforces limits on token usage, request frequency, and costs

## Hierarchy

- [`AbstractPlugin`](AbstractPlugin)\<[`LimitsPluginOptions`](../interfaces/LimitsPluginOptions)\>

  ↳ **`LimitsPlugin`**

## Table of contents

### Constructors

- [constructor](LimitsPlugin#constructor)

### Properties

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

### Methods

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

## Constructors

### constructor

• **new LimitsPlugin**(`options`): [`LimitsPlugin`](LimitsPlugin)

#### Parameters

| Name      | Type                                                       |
| :-------- | :--------------------------------------------------------- |
| `options` | [`LimitsPluginOptions`](../interfaces/LimitsPluginOptions) |

#### Returns

[`LimitsPlugin`](LimitsPlugin)

#### Overrides

[AbstractPlugin](AbstractPlugin).[constructor](AbstractPlugin#constructor)

#### Defined in

[packages/agents/src/plugins/limits-plugin.ts:65](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/plugins/limits-plugin.ts#L65)

## Properties

### enabled

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

Plugin enabled state

#### Inherited from

[AbstractPlugin](AbstractPlugin).[enabled](AbstractPlugin#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

#### Inherited from

[AbstractPlugin](AbstractPlugin).[category](AbstractPlugin#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

#### Inherited from

[AbstractPlugin](AbstractPlugin).[priority](AbstractPlugin#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)

---

### name

• **name**: `string` = `'LimitsPlugin'`

Plugin name

#### Overrides

[AbstractPlugin](AbstractPlugin).[name](AbstractPlugin#name)

#### Defined in

[packages/agents/src/plugins/limits-plugin.ts:56](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/plugins/limits-plugin.ts#L56)

---

### version

• **version**: `string` = `'1.0.0'`

Plugin version

#### Overrides

[AbstractPlugin](AbstractPlugin).[version](AbstractPlugin#version)

#### Defined in

[packages/agents/src/plugins/limits-plugin.ts:57](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/plugins/limits-plugin.ts#L57)

## Methods

### initialize

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

Initialize the plugin with type-safe options

#### Parameters

| Name       | Type                                                       |
| :--------- | :--------------------------------------------------------- |
| `options?` | [`LimitsPluginOptions`](../interfaces/LimitsPluginOptions) |

#### Returns

`Promise`\<`void`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[initialize](AbstractPlugin#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`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[subscribeToModuleEvents](AbstractPlugin#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`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[unsubscribeFromModuleEvents](AbstractPlugin#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`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[dispose](AbstractPlugin#dispose)

#### 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`

#### Inherited from

[AbstractPlugin](AbstractPlugin).[enable](AbstractPlugin#enable)

#### 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`

#### Inherited from

[AbstractPlugin](AbstractPlugin).[disable](AbstractPlugin#disable)

#### 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`

#### Inherited from

[AbstractPlugin](AbstractPlugin).[isEnabled](AbstractPlugin#isenabled)

#### 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)

#### Inherited from

[AbstractPlugin](AbstractPlugin).[getConfig](AbstractPlugin#getconfig)

#### 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`

#### Inherited from

[AbstractPlugin](AbstractPlugin).[updateConfig](AbstractPlugin#updateconfig)

#### 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)

#### Inherited from

[AbstractPlugin](AbstractPlugin).[getData](AbstractPlugin#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`

#### Inherited from

[AbstractPlugin](AbstractPlugin).[clearData](AbstractPlugin#cleardata)

#### 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`                                   |

#### Inherited from

[AbstractPlugin](AbstractPlugin).[getStatus](AbstractPlugin#getstatus)

#### 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**(): [`IPluginStats`](../interfaces/IPluginStats)

Get plugin statistics - enhanced with module event tracking

#### Returns

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

#### Inherited from

[AbstractPlugin](AbstractPlugin).[getStats](AbstractPlugin#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`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[beforeRun](AbstractPlugin#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`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[afterRun](AbstractPlugin#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)

---

### beforeConversation

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

Called before conversation with context

#### Parameters

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

#### Returns

`Promise`\<`void`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[beforeConversation](AbstractPlugin#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`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[afterConversation](AbstractPlugin#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`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[beforeToolCall](AbstractPlugin#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`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[beforeToolExecution](AbstractPlugin#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`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[afterToolCall](AbstractPlugin#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`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[afterToolExecution](AbstractPlugin#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`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[beforeProviderCall](AbstractPlugin#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`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[afterProviderCall](AbstractPlugin#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`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[onStreamingChunk](AbstractPlugin#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`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[onError](AbstractPlugin#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`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[onMessageAdded](AbstractPlugin#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`\>

#### Inherited from

[AbstractPlugin](AbstractPlugin).[onModuleEvent](AbstractPlugin#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)

---

### beforeExecution

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

Check limits before execution

#### Parameters

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

#### Returns

`Promise`\<`void`\>

#### Overrides

[AbstractPlugin](AbstractPlugin).[beforeExecution](AbstractPlugin#beforeexecution)

#### Defined in

[packages/agents/src/plugins/limits-plugin.ts:102](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/plugins/limits-plugin.ts#L102)

---

### afterExecution

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

Update limits after execution

#### Parameters

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

#### Returns

`Promise`\<`void`\>

#### Overrides

[AbstractPlugin](AbstractPlugin).[afterExecution](AbstractPlugin#afterexecution)

#### Defined in

[packages/agents/src/plugins/limits-plugin.ts:140](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/plugins/limits-plugin.ts#L140)

---

### getLimitsStatus

▸ **getLimitsStatus**(`key?`): `PluginLimitsStatusData`

Get current limits status

REASON: Limits status contains mixed data types (numbers, strings, arrays, objects) for comprehensive status reporting
ALTERNATIVES_CONSIDERED:

1. Strict interface definitions (too rigid for dynamic status data)
2. Union types (becomes unwieldy for status reporting)
3. Generic constraints (too complex for status methods)
4. Separate status types (breaks existing functionality)
5. Type assertions (decreases type safety)
   TODO: Consider specific status interface if patterns emerge

#### Parameters

| Name   | Type     |
| :----- | :------- |
| `key?` | `string` |

#### Returns

`PluginLimitsStatusData`

#### Defined in

[packages/agents/src/plugins/limits-plugin.ts:506](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/plugins/limits-plugin.ts#L506)

---

### resetLimits

▸ **resetLimits**(`key?`): `void`

Reset limits for a key or all keys

#### Parameters

| Name   | Type     |
| :----- | :------- |
| `key?` | `string` |

#### Returns

`void`

#### Defined in

[packages/agents/src/plugins/limits-plugin.ts:539](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/plugins/limits-plugin.ts#L539)
