agent-playground / Exports / IPlaygroundBlockCollector
Interface: IPlaygroundBlockCollector
SSOT contract for consumers that only need the collector API.
IMPORTANT:
- Prefer importing this interface over importing the concrete class as a type.
- The concrete
PlaygroundBlockCollectorimplements this contract.
Hierarchy
↳
IPlaygroundBlockCollector
Implemented by
Table of contents
Methods
- updateRealTimeBlock
- getBlock
- removeBlock
- getBlockTree
- collectBlock
- updateBlock
- getBlocks
- getBlocksByParent
- clearBlocks
- generateBlockId
- createGroupBlock
- getStats
- addListener
- removeListener
Methods
updateRealTimeBlock
▸ updateRealTimeBlock(blockId, updates): void
Parameters
| Name | Type |
|---|---|
blockId | string |
updates | Partial<IRealTimeBlockMetadata> |
Returns
void
Defined in
agent-playground/src/lib/playground/block-tracking/block-collector.ts:20
getBlock
▸ getBlock(blockId): undefined | IBlockMessage
Parameters
| Name | Type |
|---|---|
blockId | string |
Returns
undefined | IBlockMessage
Defined in
agent-playground/src/lib/playground/block-tracking/block-collector.ts:21
removeBlock
▸ removeBlock(blockId): void
Parameters
| Name | Type |
|---|---|
blockId | string |
Returns
void
Defined in
agent-playground/src/lib/playground/block-tracking/block-collector.ts:22
getBlockTree
▸ getBlockTree(): IBlockTreeNode[]
Returns
Defined in
agent-playground/src/lib/playground/block-tracking/block-collector.ts:23
collectBlock
▸ collectBlock(message): void
Collect a new block message
Parameters
| Name | Type |
|---|---|
message | IBlockMessage |
Returns
void
Inherited from
IBlockDataCollector.collectBlock
Defined in
agent-playground/src/lib/playground/block-tracking/types.ts:175
updateBlock
▸ updateBlock(blockId, updates): void
Update an existing block
Parameters
| Name | Type |
|---|---|
blockId | string |
updates | Partial<IBlockMetadata> |
Returns
void
Inherited from
IBlockDataCollector.updateBlock
Defined in
agent-playground/src/lib/playground/block-tracking/types.ts:178
getBlocks
▸ getBlocks(): IBlockMessage[]
Get all collected blocks
Returns
Inherited from
Defined in
agent-playground/src/lib/playground/block-tracking/types.ts:181
getBlocksByParent
▸ getBlocksByParent(parentId?): IBlockMessage[]
Get blocks by parent ID for hierarchical rendering
Parameters
| Name | Type |
|---|---|
parentId? | string |
Returns
Inherited from
IBlockDataCollector.getBlocksByParent
Defined in
agent-playground/src/lib/playground/block-tracking/types.ts:184
clearBlocks
▸ clearBlocks(): void
Clear all blocks
Returns
void
Inherited from
IBlockDataCollector.clearBlocks
Defined in
agent-playground/src/lib/playground/block-tracking/types.ts:187
generateBlockId
▸ generateBlockId(): string
Generate unique block ID
Returns
string
Inherited from
IBlockDataCollector.generateBlockId
Defined in
agent-playground/src/lib/playground/block-tracking/types.ts:190
createGroupBlock
▸ createGroupBlock(type, content, parentId?, level?): IBlockMessage
Create a group block that can contain other blocks
Parameters
| Name | Type |
|---|---|
type | "user" | "assistant" | "tool_call" | "group" |
content | string |
parentId? | string |
level? | number |
Returns
Inherited from
IBlockDataCollector.createGroupBlock
Defined in
agent-playground/src/lib/playground/block-tracking/types.ts:193
getStats
▸ getStats(): Object
Get statistics about collected blocks
Returns
Object
| Name | Type |
|---|---|
total | number |
byType | Record<string, number> |
byState | Record<string, number> |
rootBlocks | number |
Inherited from
Defined in
agent-playground/src/lib/playground/block-tracking/types.ts:201
addListener
▸ addListener(listener): void
Add event listener
Parameters
| Name | Type |
|---|---|
listener | TBlockCollectionListener |
Returns
void
Inherited from
IBlockDataCollector.addListener
Defined in
agent-playground/src/lib/playground/block-tracking/types.ts:209
removeListener
▸ removeListener(listener): void
Remove event listener
Parameters
| Name | Type |
|---|---|
listener | TBlockCollectionListener |
Returns
void
Inherited from
IBlockDataCollector.removeListener
Defined in
agent-playground/src/lib/playground/block-tracking/types.ts:212