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
- subscribeToWorkflowUpdates
- getCurrentWorkflow
- createAgent
- updateAgentTools
- getAgentConfiguration
- updateAgentToolsFromCard
- run
- execute
- runStream
- getPlaygroundStatistics
- recordPlaygroundAction
- recordBlockCreation
- getVisualizationData
- getPlaygroundEvents
- getHistory
- clearHistory
- dispose
- getLastExecutionId
- getExternalWorkflowStore
Constructors
constructor
• new PlaygroundExecutor(serverUrl, authToken, options): PlaygroundExecutor
Parameters
| Name | Type |
|---|---|
serverUrl | string |
authToken | string |
options | Object |
options.eventService | IEventService |
options.workflowSubscriber | WorkflowEventSubscriber |
options.logger? | AbstractLogger |
Returns
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
| Name | Type |
|---|---|
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
| Name | Type |
|---|---|
config | IPlaygroundAgentConfig |
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
| Name | Type |
|---|---|
agentId | string |
tools | IPlaygroundTool[] |
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
| Name | Type |
|---|---|
agentId | string |
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
| Name | Type |
|---|---|
agentId | string |
card | Object |
card.id | string |
card.name | string |
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
| Name | Type |
|---|---|
prompt | string |
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
| Name | Type |
|---|---|
prompt | string |
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
| Name | Type |
|---|---|
prompt | string |
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
| Name | Type |
|---|---|
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
| Name | Type |
|---|---|
blockType | string |
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
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
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