cache
Module: vibex/cache
XAgent Cache - Simple cache for XAgent instances
Keeps XAgent instances alive for the entire application lifecycle to avoid recreating agents and maintain space context.
Classes
XAgentCache
View sourceMethods:
get
View sourceGet or create an XAgent instance for a space
function get(spaceId: string, options: XOptions): Promise<XAgent>Parameters:
| Name | Type | Description |
|---|---|---|
spaceId | string | |
options | XOptions |
remove
View sourceRemove an XAgent instance from cache (optional cleanup)
function remove(spaceId: string): voidParameters:
| Name | Type | Description |
|---|---|---|
spaceId | string |
clear
View sourceClear all cached instances (for testing or reset)
function clear(): voidgetStats
View sourceGet cache statistics
function getStats(): { size: number; spaceIds: string[] }