Skip to content

playground / Exports / PlaygroundExecutor

Class: PlaygroundExecutor

Playground executor for managing Robota agents in browser (team removed)

Follows Facade Pattern - simple interface with essential methods only Integrates PlaygroundStatisticsPlugin for real-time metrics collection

Table of contents

Constructors

Methods

Constructors

constructor

new PlaygroundExecutor(serverUrl, authToken, options): PlaygroundExecutor

Parameters

NameType
serverUrlstring
authTokenstring
optionsObject
options.eventServiceIEventService
options.workflowSubscriberWorkflowEventSubscriber
options.logger?AbstractLogger

Returns

PlaygroundExecutor

Defined in

playground/src/lib/playground/robota-executor.ts:141

Methods

subscribeToWorkflowUpdates

subscribeToWorkflowUpdates(callback): void

Allows the Playground UI to subscribe to workflow updates.

Parameters

NameType
callback(workflow: IWorkflowExportStructure) => void

Returns

void

Defined in

playground/src/lib/playground/robota-executor.ts:216


getCurrentWorkflow

getCurrentWorkflow(): IWorkflowExportStructure

Get current workflow snapshot.

Returns

IWorkflowExportStructure

Defined in

playground/src/lib/playground/robota-executor.ts:224


createAgent

createAgent(config): Promise<void>

Create and configure an agent (Facade method)

Parameters

NameType
configIPlaygroundAgentConfig

Returns

Promise<void>

Defined in

playground/src/lib/playground/robota-executor.ts:256


updateAgentTools

updateAgentTools(agentId, tools): Promise<{ version: number }>

Update tools on a specific agent instance by rootId(conversationId). Strict: if agent not found in registry, throws.

Parameters

NameType
agentIdstring
toolsIPlaygroundTool[]

Returns

Promise<{ version: number }>

Defined in

playground/src/lib/playground/robota-executor.ts:298


getAgentConfiguration

getAgentConfiguration(agentId): Promise<{ version: number ; tools: { name: string ; parameters?: string[] }[] ; updatedAt: number ; metadata?: Record<string, unknown> }>

Read current configuration of an agent by rootId(conversationId).

Parameters

NameType
agentIdstring

Returns

Promise<{ version: number ; tools: { name: string ; parameters?: string[] }[] ; updatedAt: number ; metadata?: Record<string, unknown> }>

Defined in

playground/src/lib/playground/robota-executor.ts:312


updateAgentToolsFromCard

updateAgentToolsFromCard(agentId, card): Promise<{ version: number }>

Convenience: from UI card ({ id, name, description }) append tool from registry and update agent

Parameters

NameType
agentIdstring
cardObject
card.idstring
card.namestring
card.description?string

Returns

Promise<{ version: number }>

Defined in

playground/src/lib/playground/robota-executor.ts:343


run

run(prompt): Promise<IPlaygroundExecutorResult>

Execute a prompt (Facade method) 🚫 DEPRECATED: Use execute() method instead (Example 26 compatibility)

Parameters

NameType
promptstring

Returns

Promise<IPlaygroundExecutorResult>

Defined in

playground/src/lib/playground/robota-executor.ts:369


execute

execute(prompt, onChunk?): Promise<IPlaygroundExecutorResult>

Execution flow aligned with Example 26 (single-pass, UI-friendly).

Parameters

NameType
promptstring
onChunk?(chunk: string) => void

Returns

Promise<IPlaygroundExecutorResult>

Defined in

playground/src/lib/playground/robota-executor.ts:429


runStream

runStream(prompt): AsyncGenerator<string, IPlaygroundExecutorResult, any>

Execute with streaming response (Facade method) 🚫 DEPRECATED: Use execute() method instead (Example 26 compatibility)

Parameters

NameType
promptstring

Returns

AsyncGenerator<string, IPlaygroundExecutorResult, any>

Defined in

playground/src/lib/playground/robota-executor.ts:485


getPlaygroundStatistics

getPlaygroundStatistics(): IPlaygroundMetrics

Get current Playground statistics

Returns

IPlaygroundMetrics

Defined in

playground/src/lib/playground/robota-executor.ts:557


recordPlaygroundAction

recordPlaygroundAction(actionType, metadata?): Promise<void>

Record a Playground-specific action

Parameters

NameType
actionType"chat_send" | "agent_create" | "team_create" | "agent_start" | "team_start" | "agent_stop" | "team_stop" | "block_expand" | "block_collapse" | "config_change"
metadata?Record<string, TUniversalValue>

Returns

Promise<void>

Defined in

playground/src/lib/playground/robota-executor.ts:564


recordBlockCreation

recordBlockCreation(blockType, metadata?): Promise<void>

Record block creation for visualization

Parameters

NameType
blockTypestring
metadata?Record<string, TUniversalValue>

Returns

Promise<void>

Defined in

playground/src/lib/playground/robota-executor.ts:571


getVisualizationData

getVisualizationData(): IVisualizationData

Get visualization data from history plugin

Returns

IVisualizationData

Defined in

playground/src/lib/playground/robota-executor.ts:578


getPlaygroundEvents

getPlaygroundEvents(): IConversationEvent[]

Get all playground events from PlaygroundHistoryPlugin These events include all EventService events (execution., toolcall, task.*)

Returns

IConversationEvent[]

Defined in

playground/src/lib/playground/robota-executor.ts:586


getHistory

getHistory(): TUniversalMessage[]

Get conversation history from current agent/team

Returns

TUniversalMessage[]

Defined in

playground/src/lib/playground/robota-executor.ts:602


clearHistory

clearHistory(): void

Clear conversation history (Facade essential method)

Returns

void

Defined in

playground/src/lib/playground/robota-executor.ts:612


dispose

dispose(): Promise<void>

Dispose of all resources (Facade method)

Returns

Promise<void>

Defined in

playground/src/lib/playground/robota-executor.ts:619


getLastExecutionId

getLastExecutionId(): null | string

Get last execution ID for External Store connection

Returns

null | string

Defined in

playground/src/lib/playground/robota-executor.ts:777


getExternalWorkflowStore

getExternalWorkflowStore(): IExternalWorkflowStore

STEP 8.3.3: Get External Workflow Store for manual node management

Returns

IExternalWorkflowStore

Defined in

playground/src/lib/playground/robota-executor.ts:867

Released under the MIT License.