<!--
 ⚠️  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
-->

[sessions](../../) / [Exports](../modules) / TemplateManagerAdapter

# Class: TemplateManagerAdapter

TemplateManagerAdapter - adapts agents package AgentFactory/AgentTemplates to ITemplateManager interface

This adapter allows the sessions package to use the template functionality from
the agents package without duplicating implementation.

## Implements

- [`ITemplateManager`](../interfaces/ITemplateManager)

## Table of contents

### Constructors

- [constructor](TemplateManagerAdapter#constructor)

### Methods

- [getTemplate](TemplateManagerAdapter#gettemplate)
- [listTemplates](TemplateManagerAdapter#listtemplates)
- [validateTemplate](TemplateManagerAdapter#validatetemplate)
- [registerTemplate](TemplateManagerAdapter#registertemplate)
- [unregisterTemplate](TemplateManagerAdapter#unregistertemplate)
- [getTemplateDetails](TemplateManagerAdapter#gettemplatedetails)
- [applyTemplate](TemplateManagerAdapter#applytemplate)

## Constructors

### constructor

• **new TemplateManagerAdapter**(`agentFactory?`): [`TemplateManagerAdapter`](TemplateManagerAdapter)

#### Parameters

| Name            | Type           |
| :-------------- | :------------- |
| `agentFactory?` | `AgentFactory` |

#### Returns

[`TemplateManagerAdapter`](TemplateManagerAdapter)

#### Defined in

[sessions/src/adapters/template-manager-adapter.ts:14](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/sessions/src/adapters/template-manager-adapter.ts#L14)

## Methods

### getTemplate

▸ **getTemplate**(`name`): `any`

Get template configuration by name

#### Parameters

| Name   | Type     |
| :----- | :------- |
| `name` | `string` |

#### Returns

`any`

#### Implementation of

[ITemplateManager](../interfaces/ITemplateManager).[getTemplate](../interfaces/ITemplateManager#gettemplate)

#### Defined in

[sessions/src/adapters/template-manager-adapter.ts:22](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/sessions/src/adapters/template-manager-adapter.ts#L22)

---

### listTemplates

▸ **listTemplates**(): `string`[]

List all available template names

#### Returns

`string`[]

#### Implementation of

[ITemplateManager](../interfaces/ITemplateManager).[listTemplates](../interfaces/ITemplateManager#listtemplates)

#### Defined in

[sessions/src/adapters/template-manager-adapter.ts:34](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/sessions/src/adapters/template-manager-adapter.ts#L34)

---

### validateTemplate

▸ **validateTemplate**(`config`): `boolean`

Validate template configuration

#### Parameters

| Name     | Type          |
| :------- | :------------ |
| `config` | `AgentConfig` |

#### Returns

`boolean`

#### Implementation of

[ITemplateManager](../interfaces/ITemplateManager).[validateTemplate](../interfaces/ITemplateManager#validatetemplate)

#### Defined in

[sessions/src/adapters/template-manager-adapter.ts:42](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/sessions/src/adapters/template-manager-adapter.ts#L42)

---

### registerTemplate

▸ **registerTemplate**(`template`): `void`

Register a new template

#### Parameters

| Name       | Type            |
| :--------- | :-------------- |
| `template` | `AgentTemplate` |

#### Returns

`void`

#### Defined in

[sessions/src/adapters/template-manager-adapter.ts:56](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/sessions/src/adapters/template-manager-adapter.ts#L56)

---

### unregisterTemplate

▸ **unregisterTemplate**(`templateId`): `boolean`

Unregister a template

#### Parameters

| Name         | Type     |
| :----------- | :------- |
| `templateId` | `string` |

#### Returns

`boolean`

#### Defined in

[sessions/src/adapters/template-manager-adapter.ts:63](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/sessions/src/adapters/template-manager-adapter.ts#L63)

---

### getTemplateDetails

▸ **getTemplateDetails**(`name`): `any`

Get template details (full template object)

#### Parameters

| Name   | Type     |
| :----- | :------- |
| `name` | `string` |

#### Returns

`any`

#### Defined in

[sessions/src/adapters/template-manager-adapter.ts:70](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/sessions/src/adapters/template-manager-adapter.ts#L70)

---

### applyTemplate

▸ **applyTemplate**(`templateId`, `overrides?`): `any`

Apply template to create agent config with overrides

#### Parameters

| Name         | Type          |
| :----------- | :------------ |
| `templateId` | `string`      |
| `overrides`  | `AgentConfig` |

#### Returns

`any`

#### Defined in

[sessions/src/adapters/template-manager-adapter.ts:77](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/sessions/src/adapters/template-manager-adapter.ts#L77)
