Skip to content

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 PlaygroundBlockCollector implements this contract.

Hierarchy

Implemented by

Table of contents

Methods

Methods

updateRealTimeBlock

updateRealTimeBlock(blockId, updates): void

Parameters

NameType
blockIdstring
updatesPartial<IRealTimeBlockMetadata>

Returns

void

Defined in

agent-playground/src/lib/playground/block-tracking/block-collector.ts:20


getBlock

getBlock(blockId): undefined | IBlockMessage

Parameters

NameType
blockIdstring

Returns

undefined | IBlockMessage

Defined in

agent-playground/src/lib/playground/block-tracking/block-collector.ts:21


removeBlock

removeBlock(blockId): void

Parameters

NameType
blockIdstring

Returns

void

Defined in

agent-playground/src/lib/playground/block-tracking/block-collector.ts:22


getBlockTree

getBlockTree(): IBlockTreeNode[]

Returns

IBlockTreeNode[]

Defined in

agent-playground/src/lib/playground/block-tracking/block-collector.ts:23


collectBlock

collectBlock(message): void

Collect a new block message

Parameters

NameType
messageIBlockMessage

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

NameType
blockIdstring
updatesPartial<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

IBlockMessage[]

Inherited from

IBlockDataCollector.getBlocks

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

NameType
parentId?string

Returns

IBlockMessage[]

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

NameType
type"user" | "assistant" | "tool_call" | "group"
contentstring
parentId?string
level?number

Returns

IBlockMessage

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

NameType
totalnumber
byTypeRecord<string, number>
byStateRecord<string, number>
rootBlocksnumber

Inherited from

IBlockDataCollector.getStats

Defined in

agent-playground/src/lib/playground/block-tracking/types.ts:201


addListener

addListener(listener): void

Add event listener

Parameters

NameType
listenerTBlockCollectionListener

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

NameType
listenerTBlockCollectionListener

Returns

void

Inherited from

IBlockDataCollector.removeListener

Defined in

agent-playground/src/lib/playground/block-tracking/types.ts:212

Released under the MIT License.