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

[playground](../) / Exports

# playground

## Table of contents

### Classes

- [PlaygroundBlockCollector](classes/PlaygroundBlockCollector)
- [CodeExecutor](classes/CodeExecutor)
- [ExecutionSubscriber](classes/ExecutionSubscriber)
- [DefaultExternalWorkflowStore](classes/DefaultExternalWorkflowStore)
- [RealTimeLLMTracker](classes/RealTimeLLMTracker)
- [PlaygroundHistoryPlugin](classes/PlaygroundHistoryPlugin)
- [PlaygroundStatisticsPlugin](classes/PlaygroundStatisticsPlugin)
- [ProjectManager](classes/ProjectManager)
- [PlaygroundExecutor](classes/PlaygroundExecutor)
- [UniversalToolFactory](classes/UniversalToolFactory)
- [PlaygroundWebSocketClient](classes/PlaygroundWebSocketClient)
- [WorkflowSubscriberEventService](classes/WorkflowSubscriberEventService)

### Interfaces

- [IToolHooks](interfaces/IToolHooks)
- [IBlockMetadata](interfaces/IBlockMetadata)
- [IBlockMessage](interfaces/IBlockMessage)
- [IBlockDataCollector](interfaces/IBlockDataCollector)
- [IToolExecutionTrackingData](interfaces/IToolExecutionTrackingData)
- [IDelegationTrackingData](interfaces/IDelegationTrackingData)
- [IBlockTreeNode](interfaces/IBlockTreeNode)
- [IExecutionResult](interfaces/IExecutionResult)
- [IErrorInfo](interfaces/IErrorInfo)
- [IAgentContext](interfaces/IAgentContext)
- [IPlaygroundConfig](interfaces/IPlaygroundConfig)
- [IExternalWorkflowStore](interfaces/IExternalWorkflowStore)
- [IManualAgentData](interfaces/IManualAgentData)
- [IManualUserInputData](interfaces/IManualUserInputData)
- [IConversationEvent](interfaces/IConversationEvent)
- [IAgentBlock](interfaces/IAgentBlock)
- [IVisualizationData](interfaces/IVisualizationData)
- [IPlaygroundHistoryPluginOptions](interfaces/IPlaygroundHistoryPluginOptions)
- [IProjectConfig](interfaces/IProjectConfig)
- [IPlaygroundProject](interfaces/IPlaygroundProject)
- [IProjectMetadata](interfaces/IProjectMetadata)
- [IPlaygroundTool](interfaces/IPlaygroundTool)
- [IPlaygroundPlugin](interfaces/IPlaygroundPlugin)
- [IPlaygroundAgentConfig](interfaces/IPlaygroundAgentConfig)
- [IPlaygroundExecutorResult](interfaces/IPlaygroundExecutorResult)
- [IPlaygroundUiError](interfaces/IPlaygroundUiError)
- [IUniversalToolFactoryOptions](interfaces/IUniversalToolFactoryOptions)
- [IPlaygroundWebSocketMessage](interfaces/IPlaygroundWebSocketMessage)
- [IPlaygroundConnectionStatus](interfaces/IPlaygroundConnectionStatus)
- [IPlaygroundWebSocketAuthenticatedEvent](interfaces/IPlaygroundWebSocketAuthenticatedEvent)
- [IPlaygroundWebSocketConnectionEvent](interfaces/IPlaygroundWebSocketConnectionEvent)
- [IPlaygroundWebSocketErrorEvent](interfaces/IPlaygroundWebSocketErrorEvent)

### Type Aliases

- [SimpleLogger](#simplelogger)
- [TBlockCollectionEvent](#tblockcollectionevent)
- [TBlockCollectionListener](#tblockcollectionlistener)
- [TPlaygroundEventType](#tplaygroundeventtype)
- [TPlaygroundProvider](#tplaygroundprovider)
- [TPlaygroundMode](#tplaygroundmode)
- [TPlaygroundUiErrorKind](#tplaygrounduierrorkind)
- [TPlaygroundWebSocketMessageType](#tplaygroundwebsocketmessagetype)
- [TPlaygroundWebSocketEventPayload](#tplaygroundwebsocketeventpayload)
- [TPlaygroundWebSocketEventHandler](#tplaygroundwebsocketeventhandler)

### Functions

- [createBlockTrackingHooks](#createblocktrackinghooks)
- [createDelegationTrackingHooks](#createdelegationtrackinghooks)
- [validatePlaygroundConfig](#validateplaygroundconfig)
- [getPlaygroundConfig](#getplaygroundconfig)
- [isFeatureEnabled](#isfeatureenabled)
- [validateFirebaseConfig](#validatefirebaseconfig)
- [logConfigurationStatus](#logconfigurationstatus)
- [generateDemoExecutionData](#generatedemoexecutiondata)
- [generateComplexDemoData](#generatecomplexdemodata)
- [injectRemoteExecutor](#injectremoteexecutor)
- [createPlaygroundSandbox](#createplaygroundsandbox)
- [generateMockEnvironment](#generatemockenvironment)
- [requiresTransformation](#requirestransformation)
- [previewTransformation](#previewtransformation)
- [extractProviderInfo](#extractproviderinfo)
- [PlaygroundApp](#playgroundapp)
- [PlaygroundDemo](#playgrounddemo)

## Type Aliases

### SimpleLogger

Ƭ **SimpleLogger**: `AbstractLogger`

Simple logger type - convenience alias for AbstractLogger

This is a type alias that extends AbstractLogger for backward compatibility
and convenience. It provides the same interface as AbstractLogger.

TYPE HIERARCHY:
AbstractLogger (interface) ← Base type
↓
SimpleLogger (alias) ← This type
↓
SilentLogger, ConsoleLogger (implementations)

#### Defined in

agents/dist/node/index.d.ts:1744

---

### TBlockCollectionEvent

Ƭ **TBlockCollectionEvent**: \{ `type`: `"block_added"` ; `block`: [`IBlockMessage`](interfaces/IBlockMessage) } \| \{ `type`: `"block_updated"` ; `blockId`: `string` ; `updates`: `Partial`\<[`IBlockMetadata`](interfaces/IBlockMetadata)\> } \| \{ `type`: `"block_removed"` ; `blockId`: `string` } \| \{ `type`: `"blocks_cleared"` }

Block collection events for real-time updates

#### Defined in

[playground/src/lib/playground/block-tracking/types.ts:253](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/block-tracking/types.ts#L253)

---

### TBlockCollectionListener

Ƭ **TBlockCollectionListener**: (`event`: [`TBlockCollectionEvent`](#tblockcollectionevent)) => `void`

Block collection listener

#### Type declaration

▸ (`event`): `void`

##### Parameters

| Name    | Type                                              |
| :------ | :------------------------------------------------ |
| `event` | [`TBlockCollectionEvent`](#tblockcollectionevent) |

##### Returns

`void`

#### Defined in

[playground/src/lib/playground/block-tracking/types.ts:262](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/block-tracking/types.ts#L262)

---

### TPlaygroundEventType

Ƭ **TPlaygroundEventType**: `"user_message"` \| `"assistant_response"` \| `"tool_call_start"` \| `"tool_call_complete"` \| `"tool_call_error"` \| `"execution_start"` \| `"execution_complete"` \| `"execution_error"`

#### Defined in

[playground/src/lib/playground/plugins/playground-history-plugin.ts:4](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/plugins/playground-history-plugin.ts#L4)

---

### TPlaygroundProvider

Ƭ **TPlaygroundProvider**: `"openai"` \| `"anthropic"` \| `"google"`

#### Defined in

[playground/src/lib/playground/project-manager.ts:9](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/project-manager.ts#L9)

---

### TPlaygroundMode

Ƭ **TPlaygroundMode**: `"agent"`

#### Defined in

[playground/src/lib/playground/robota-executor.ts:88](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/robota-executor.ts#L88)

---

### TPlaygroundUiErrorKind

Ƭ **TPlaygroundUiErrorKind**: `"user_message"` \| `"recoverable"` \| `"fatal"`

#### Defined in

[playground/src/lib/playground/robota-executor.ts:90](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/robota-executor.ts#L90)

---

### TPlaygroundWebSocketMessageType

Ƭ **TPlaygroundWebSocketMessageType**: `"playground_update"` \| `"auth"` \| `"ping"` \| `"pong"`

#### Defined in

[playground/src/lib/playground/websocket-client.ts:11](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/websocket-client.ts#L11)

---

### TPlaygroundWebSocketEventPayload

Ƭ **TPlaygroundWebSocketEventPayload**: [`IPlaygroundWebSocketMessage`](interfaces/IPlaygroundWebSocketMessage) \| [`IPlaygroundWebSocketAuthenticatedEvent`](interfaces/IPlaygroundWebSocketAuthenticatedEvent) \| [`IPlaygroundWebSocketConnectionEvent`](interfaces/IPlaygroundWebSocketConnectionEvent) \| [`IPlaygroundWebSocketErrorEvent`](interfaces/IPlaygroundWebSocketErrorEvent)

#### Defined in

[playground/src/lib/playground/websocket-client.ts:45](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/websocket-client.ts#L45)

---

### TPlaygroundWebSocketEventHandler

Ƭ **TPlaygroundWebSocketEventHandler**: (`payload`: [`TPlaygroundWebSocketEventPayload`](#tplaygroundwebsocketeventpayload)) => `void`

#### Type declaration

▸ (`payload`): `void`

##### Parameters

| Name      | Type                                                                    |
| :-------- | :---------------------------------------------------------------------- |
| `payload` | [`TPlaygroundWebSocketEventPayload`](#tplaygroundwebsocketeventpayload) |

##### Returns

`void`

#### Defined in

[playground/src/lib/playground/websocket-client.ts:51](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/websocket-client.ts#L51)

## Functions

### createBlockTrackingHooks

▸ **createBlockTrackingHooks**(`blockCollector`, `logger?`, `options?`): [`IToolHooks`](interfaces/IToolHooks)

Create block tracking hooks that implement the universal IToolHooks interface
This connects the SDK's universal hook system to the web app's block visualization

#### Parameters

| Name                        | Type                                                    | Default value          | Description                           |
| :-------------------------- | :------------------------------------------------------ | :--------------------- | :------------------------------------ |
| `blockCollector`            | [`IBlockDataCollector`](interfaces/IBlockDataCollector) | `undefined`            | The block collector instance          |
| `logger`                    | `AbstractLogger`                                        | `DefaultConsoleLogger` | Optional logger for debugging         |
| `options`                   | `Object`                                                | `{}`                   | Additional configuration options      |
| `options.parentBlockId?`    | `string`                                                | `undefined`            | Parent block ID for nested tool calls |
| `options.level?`            | `number`                                                | `undefined`            | Level for hierarchical nesting        |
| `options.blockTypeMapping?` | `Record`\<`string`, `TBlockType`\>                      | `undefined`            | Custom block type mapping             |

#### Returns

[`IToolHooks`](interfaces/IToolHooks)

#### Defined in

[playground/src/lib/playground/block-tracking/block-hooks.ts:24](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/block-tracking/block-hooks.ts#L24)

---

### createDelegationTrackingHooks

▸ **createDelegationTrackingHooks**(`blockCollector`, `logger?`, `options?`): [`IToolHooks`](interfaces/IToolHooks)

Create delegation tracking hooks for team agent scenarios
Tracks when agents delegate tasks to other agents

#### Parameters

| Name                     | Type                                                    | Default value          |
| :----------------------- | :------------------------------------------------------ | :--------------------- |
| `blockCollector`         | [`IBlockDataCollector`](interfaces/IBlockDataCollector) | `undefined`            |
| `logger`                 | `AbstractLogger`                                        | `DefaultConsoleLogger` |
| `options`                | `Object`                                                | `{}`                   |
| `options.parentBlockId?` | `string`                                                | `undefined`            |
| `options.level?`         | `number`                                                | `undefined`            |

#### Returns

[`IToolHooks`](interfaces/IToolHooks)

#### Defined in

[playground/src/lib/playground/block-tracking/block-hooks.ts:280](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/block-tracking/block-hooks.ts#L280)

---

### validatePlaygroundConfig

▸ **validatePlaygroundConfig**(): [`IPlaygroundConfig`](interfaces/IPlaygroundConfig)

Validate and parse playground configuration from environment variables

#### Returns

[`IPlaygroundConfig`](interfaces/IPlaygroundConfig)

#### Defined in

[playground/src/lib/playground/config-validation.ts:24](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/config-validation.ts#L24)

---

### getPlaygroundConfig

▸ **getPlaygroundConfig**(): [`IPlaygroundConfig`](interfaces/IPlaygroundConfig)

Get playground configuration with validation

#### Returns

[`IPlaygroundConfig`](interfaces/IPlaygroundConfig)

#### Defined in

[playground/src/lib/playground/config-validation.ts:68](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/config-validation.ts#L68)

---

### isFeatureEnabled

▸ **isFeatureEnabled**(`feature`): `boolean`

Check if playground feature is enabled

#### Parameters

| Name      | Type                                              |
| :-------- | :------------------------------------------------ |
| `feature` | `"remoteExecution"` \| `"streaming"` \| `"tools"` |

#### Returns

`boolean`

#### Defined in

[playground/src/lib/playground/config-validation.ts:75](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/config-validation.ts#L75)

---

### validateFirebaseConfig

▸ **validateFirebaseConfig**(): `Object`

Validate Firebase configuration for playground

#### Returns

`Object`

| Name          | Type       |
| :------------ | :--------- |
| `valid`       | `boolean`  |
| `missingVars` | `string`[] |

#### Defined in

[playground/src/lib/playground/config-validation.ts:83](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/config-validation.ts#L83)

---

### logConfigurationStatus

▸ **logConfigurationStatus**(): `void`

Development helper to log configuration status

#### Returns

`void`

#### Defined in

[playground/src/lib/playground/config-validation.ts:107](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/config-validation.ts#L107)

---

### generateDemoExecutionData

▸ **generateDemoExecutionData**(`blockCollector`): `void`

Generate demo execution data for testing the tree visualization

#### Parameters

| Name             | Type                                                           |
| :--------------- | :------------------------------------------------------------- |
| `blockCollector` | [`PlaygroundBlockCollector`](classes/PlaygroundBlockCollector) |

#### Returns

`void`

#### Defined in

[playground/src/lib/playground/demo-execution-data.ts:8](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/demo-execution-data.ts#L8)

---

### generateComplexDemoData

▸ **generateComplexDemoData**(`blockCollector`): `void`

Generate a second demo scenario - Complex multi-tool execution

#### Parameters

| Name             | Type                                                           |
| :--------------- | :------------------------------------------------------------- |
| `blockCollector` | [`PlaygroundBlockCollector`](classes/PlaygroundBlockCollector) |

#### Returns

`void`

#### Defined in

[playground/src/lib/playground/demo-execution-data.ts:287](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/demo-execution-data.ts#L287)

---

### injectRemoteExecutor

▸ **injectRemoteExecutor**(`userCode`, `config`): `string`

Transform user code to inject RemoteExecutor into all AI providers

#### Parameters

| Name       | Type                                                | Description                                   |
| :--------- | :-------------------------------------------------- | :-------------------------------------------- |
| `userCode` | `string`                                            | Original user code from the playground editor |
| `config`   | [`IPlaygroundConfig`](interfaces/IPlaygroundConfig) | Playground configuration with server details  |

#### Returns

`string`

Transformed code with RemoteExecutor injection

#### Defined in

[playground/src/lib/playground/remote-injection.ts:41](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/remote-injection.ts#L41)

---

### createPlaygroundSandbox

▸ **createPlaygroundSandbox**(`config`): `Object`

Create a sandbox environment for secure code execution

#### Parameters

| Name     | Type                                                |
| :------- | :-------------------------------------------------- |
| `config` | [`IPlaygroundConfig`](interfaces/IPlaygroundConfig) |

#### Returns

`Object`

| Name      | Type                                                                         |
| :-------- | :--------------------------------------------------------------------------- |
| `execute` | (`code`: `string`) => `Promise`\<\{ `result`: `any` ; `logs`: `string`[] }\> |
| `cleanup` | () => `void`                                                                 |

#### Defined in

[playground/src/lib/playground/remote-injection.ts:467](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/remote-injection.ts#L467)

---

### generateMockEnvironment

▸ **generateMockEnvironment**(): `Record`\<`string`, `string`\>

Generate mock environment variables for playground

#### Returns

`Record`\<`string`, `string`\>

#### Defined in

[playground/src/lib/playground/remote-injection.ts:578](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/remote-injection.ts#L578)

---

### requiresTransformation

▸ **requiresTransformation**(`code`): `boolean`

Check if code requires transformation for playground

#### Parameters

| Name   | Type     |
| :----- | :------- |
| `code` | `string` |

#### Returns

`boolean`

#### Defined in

[playground/src/lib/playground/remote-injection.ts:590](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/remote-injection.ts#L590)

---

### previewTransformation

▸ **previewTransformation**(`code`, `config`): `Object`

Preview transformed code for debugging

#### Parameters

| Name     | Type                                                |
| :------- | :-------------------------------------------------- |
| `code`   | `string`                                            |
| `config` | [`IPlaygroundConfig`](interfaces/IPlaygroundConfig) |

#### Returns

`Object`

| Name          | Type       |
| :------------ | :--------- |
| `original`    | `string`   |
| `transformed` | `string`   |
| `changes`     | `string`[] |

#### Defined in

[playground/src/lib/playground/remote-injection.ts:603](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/remote-injection.ts#L603)

---

### extractProviderInfo

▸ **extractProviderInfo**(`code`): `Object`

Extract provider information from code

#### Parameters

| Name   | Type     |
| :----- | :------- |
| `code` | `string` |

#### Returns

`Object`

| Name         | Type       |
| :----------- | :--------- |
| `providers`  | `string`[] |
| `models`     | `string`[] |
| `hasTools`   | `boolean`  |
| `hasPlugins` | `boolean`  |

#### Defined in

[playground/src/lib/playground/remote-injection.ts:627](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/lib/playground/remote-injection.ts#L627)

---

### PlaygroundApp

▸ **PlaygroundApp**(`props`): `React.ReactElement`

#### Parameters

| Name                       | Type                                                                                             |
| :------------------------- | :----------------------------------------------------------------------------------------------- |
| `props`                    | `Object`                                                                                         |
| `props.createEventService` | (`workflowSubscriber`: `WorkflowEventSubscriber`, `logger`: `AbstractLogger`) => `IEventService` |

#### Returns

`React.ReactElement`

#### Defined in

[playground/src/playground/components/PlaygroundApp.tsx:504](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/playground/components/PlaygroundApp.tsx#L504)

---

### PlaygroundDemo

▸ **PlaygroundDemo**(): `JSX.Element`

PlaygroundDemo

No-login demo page component. This intentionally does not call any LLM providers.
It renders deterministic demo execution data using the block-tracking visualizer.

#### Returns

`JSX.Element`

#### Defined in

[playground/src/playground/components/PlaygroundDemo.tsx:12](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/playground/src/playground/components/PlaygroundDemo.tsx#L12)
