agent-playground / Exports
agent-playground
Table of contents
Classes
- PlaygroundBlockCollector
- CodeExecutor
- ExecutionSubscriber
- RealTimeLLMTracker
- PlaygroundHistoryPlugin
- PlaygroundStatisticsPlugin
- ProjectManager
- PlaygroundExecutor
- UniversalToolFactory
- PlaygroundWebSocketClient
Interfaces
- ILogger
- IPlaygroundBlockCollector
- IToolHooks
- IBlockMetadata
- IBlockMessage
- IBlockDataCollector
- IToolExecutionTrackingData
- IDelegationTrackingData
- IBlockTreeNode
- ICodeExecutionResult
- IErrorInfo
- IAgentContext
- IPlaygroundConfig
- IConversationEvent
- IAgentBlock
- IVisualizationData
- IPlaygroundHistoryPluginOptions
- IProjectConfig
- IPlaygroundProject
- IProjectMetadata
- IRemoteExecutor
- IPlaygroundTool
- IPlaygroundPlugin
- IPlaygroundAgentConfig
- IPlaygroundExecutorResult
- IPlaygroundUiError
- IUniversalToolFactoryOptions
- IPlaygroundConnectionStatus
- IPlaygroundWebSocketAuthenticatedEvent
- IPlaygroundWebSocketConnectionEvent
- IPlaygroundWebSocketErrorEvent
- IPlaygroundWebSocketMessage
Type Aliases
- TBlockCollectionEvent
- TBlockCollectionListener
- TPlaygroundEventName
- TPlaygroundProvider
- TPlaygroundMode
- TPlaygroundUiErrorKind
- TPlaygroundWebSocketEventPayload
- TPlaygroundWebSocketEventHandler
- TPlaygroundWebSocketMessageKind
Variables
Functions
- createBlockTrackingHooks
- createDelegationTrackingHooks
- validatePlaygroundConfig
- getPlaygroundConfig
- isFeatureEnabled
- validateFirebaseConfig
- logConfigurationStatus
- generateDemoExecutionData
- generateComplexDemoData
- createPlaygroundSandbox
- injectRemoteExecutor
- generateMockEnvironment
- requiresTransformation
- previewTransformation
- extractProviderInfo
- PlaygroundApp
- PlaygroundDemo
Type Aliases
TBlockCollectionEvent
Ƭ TBlockCollectionEvent: { type: "block_added" ; block: IBlockMessage } | { type: "block_updated" ; blockId: string ; updates: Partial<IBlockMetadata> } | { type: "block_removed" ; blockId: string } | { type: "blocks_cleared" }
Block collection events for real-time updates
Defined in
agent-playground/src/lib/playground/block-tracking/types.ts:258
TBlockCollectionListener
Ƭ TBlockCollectionListener: (event: TBlockCollectionEvent) => void
Block collection listener
Type declaration
▸ (event): void
Parameters
| Name | Type |
|---|---|
event | TBlockCollectionEvent |
Returns
void
Defined in
agent-playground/src/lib/playground/block-tracking/types.ts:267
TPlaygroundEventName
Ƭ TPlaygroundEventName: "user_message" | "assistant_response" | "tool_call_start" | "tool_call_complete" | "tool_call_error" | "execution_start" | "execution_complete" | "execution_error"
Defined in
agent-playground/src/lib/playground/plugins/playground-history-plugin.ts:6
TPlaygroundProvider
Ƭ TPlaygroundProvider: "openai" | "anthropic" | "google"
Defined in
agent-playground/src/lib/playground/project-manager.ts:16
TPlaygroundMode
Ƭ TPlaygroundMode: "agent"
Defined in
agent-playground/src/lib/playground/robota-executor-types.ts:58
TPlaygroundUiErrorKind
Ƭ TPlaygroundUiErrorKind: "user_message" | "recoverable" | "fatal"
Defined in
agent-playground/src/lib/playground/robota-executor-types.ts:60
TPlaygroundWebSocketEventPayload
Ƭ TPlaygroundWebSocketEventPayload: IPlaygroundWebSocketMessage | IPlaygroundWebSocketAuthenticatedEvent | IPlaygroundWebSocketConnectionEvent | IPlaygroundWebSocketErrorEvent
Defined in
agent-playground/src/lib/playground/websocket-client.ts:56
TPlaygroundWebSocketEventHandler
Ƭ TPlaygroundWebSocketEventHandler: (payload: TPlaygroundWebSocketEventPayload) => void
Type declaration
▸ (payload): void
Parameters
| Name | Type |
|---|---|
payload | TPlaygroundWebSocketEventPayload |
Returns
void
Defined in
agent-playground/src/lib/playground/websocket-client.ts:62
TPlaygroundWebSocketMessageKind
Ƭ TPlaygroundWebSocketMessageKind: "playground_update" | "auth" | "ping" | "pong"
Discriminant values for playground WebSocket message types.
Defined in
agent-remote/dist/browser/browser.d.mts:176
Variables
PLAYGROUND_WS_MESSAGE_TYPES
• Const PLAYGROUND_WS_MESSAGE_TYPES: Object
Type declaration
| Name | Type |
|---|---|
PLAYGROUND_UPDATE | "playground_update" |
AUTH | "auth" |
PING | "ping" |
PONG | "pong" |
Defined in
agent-playground/src/lib/playground/websocket-client.ts:19
PLAYGROUND_WS_CLIENT_EVENTS
• Const PLAYGROUND_WS_CLIENT_EVENTS: Object
Type declaration
| Name | Type |
|---|---|
AUTHENTICATED | "authenticated" |
CONNECTION | "connection" |
ERROR | "error" |
PLAYGROUND_UPDATE | "playground_update" |
Defined in
agent-playground/src/lib/playground/websocket-client.ts:26
Functions
createBlockTrackingHooks
▸ createBlockTrackingHooks(blockCollector, logger?, options?): 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 | undefined | The block collector instance |
logger | ILogger | SilentLogger | 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, TBlockKind> | undefined | Custom block type mapping |
Returns
Defined in
agent-playground/src/lib/playground/block-tracking/block-hooks.ts:43
createDelegationTrackingHooks
▸ createDelegationTrackingHooks(blockCollector, logger?, options?): IToolHooks
Create delegation tracking hooks for team agent scenarios Tracks when agents delegate tasks to other agents
Parameters
| Name | Type | Default value |
|---|---|---|
blockCollector | IBlockDataCollector | undefined |
logger | ILogger | SilentLogger |
options | Object | {} |
options.parentBlockId? | string | undefined |
options.level? | number | undefined |
Returns
Defined in
agent-playground/src/lib/playground/block-tracking/block-hooks.ts:309
validatePlaygroundConfig
▸ validatePlaygroundConfig(): IPlaygroundConfig
Validate and parse playground configuration from environment variables
Returns
Defined in
agent-playground/src/lib/playground/config-validation.ts:24
getPlaygroundConfig
▸ getPlaygroundConfig(): IPlaygroundConfig
Get playground configuration with validation
Returns
Defined in
agent-playground/src/lib/playground/config-validation.ts:69
isFeatureEnabled
▸ isFeatureEnabled(feature): boolean
Check if playground feature is enabled
Parameters
| Name | Type |
|---|---|
feature | "remoteExecution" | "streaming" | "tools" |
Returns
boolean
Defined in
agent-playground/src/lib/playground/config-validation.ts:76
validateFirebaseConfig
▸ validateFirebaseConfig(): Object
Validate Firebase configuration for playground
Returns
Object
| Name | Type |
|---|---|
valid | boolean |
missingVars | string[] |
Defined in
agent-playground/src/lib/playground/config-validation.ts:84
logConfigurationStatus
▸ logConfigurationStatus(): void
Development helper to log configuration status
Returns
void
Defined in
agent-playground/src/lib/playground/config-validation.ts:108
generateDemoExecutionData
▸ generateDemoExecutionData(blockCollector): void
Generate demo execution data for testing the tree visualization
Parameters
| Name | Type |
|---|---|
blockCollector | IPlaygroundBlockCollector |
Returns
void
Defined in
agent-playground/src/lib/playground/demo-execution-data.ts:21
generateComplexDemoData
▸ generateComplexDemoData(blockCollector): void
Generate a second demo scenario - Complex multi-tool execution
Parameters
| Name | Type |
|---|---|
blockCollector | IPlaygroundBlockCollector |
Returns
void
Defined in
agent-playground/src/lib/playground/demo-execution-data.ts:300
createPlaygroundSandbox
▸ createPlaygroundSandbox(config, transformCode): Object
Create a sandbox environment for secure code execution
Parameters
| Name | Type |
|---|---|
config | IPlaygroundConfig |
transformCode | (code: string, config: IPlaygroundConfig) => string |
Returns
Object
| Name | Type |
|---|---|
execute | (code: string) => Promise<{ result: TUniversalValue ; logs: string[] }> |
cleanup | () => void |
Defined in
agent-playground/src/lib/playground/remote-injection-sandbox.ts:20
injectRemoteExecutor
▸ injectRemoteExecutor(userCode, config): string
Transform user code to inject RemoteExecutor into all AI providers
Parameters
| Name | Type |
|---|---|
userCode | string |
config | IPlaygroundConfig |
Returns
string
Defined in
agent-playground/src/lib/playground/remote-injection.ts:35
generateMockEnvironment
▸ generateMockEnvironment(): Record<string, string>
Returns
Record<string, string>
Defined in
agent-playground/src/lib/playground/remote-injection.ts:128
requiresTransformation
▸ requiresTransformation(code): boolean
Parameters
| Name | Type |
|---|---|
code | string |
Returns
boolean
Defined in
agent-playground/src/lib/playground/remote-injection.ts:137
previewTransformation
▸ previewTransformation(code, config): Object
Parameters
| Name | Type |
|---|---|
code | string |
config | IPlaygroundConfig |
Returns
Object
| Name | Type |
|---|---|
original | string |
transformed | string |
changes | string[] |
Defined in
agent-playground/src/lib/playground/remote-injection.ts:147
extractProviderInfo
▸ extractProviderInfo(code): Object
Parameters
| Name | Type |
|---|---|
code | string |
Returns
Object
| Name | Type |
|---|---|
providers | string[] |
models | string[] |
hasTools | boolean |
hasPlugins | boolean |
Defined in
agent-playground/src/lib/playground/remote-injection.ts:165
PlaygroundApp
▸ PlaygroundApp(props): React.ReactElement
Parameters
| Name | Type |
|---|---|
props | Object |
props.defaultServerUrl? | string |
Returns
React.ReactElement
Defined in
agent-playground/src/playground/components/PlaygroundApp.tsx:278
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
agent-playground/src/playground/components/PlaygroundDemo.tsx:12