Type Alias: AgentEvent
@kortexya/reasoninglayer / Cognitive / AgentEvent
Type Alias: AgentEvent
AgentEvent = {
changeType:KbChangeType;sort:string;termId:string;type:"kb_change"; } | {actionSort:string;confidence:number;deadline?:string|null;reviewId:string;type:"hitl_request"; } | {actionsExecuted:number;agentId:string;beliefsUpdated:number;pendingReviews:string[];type:"cycle_complete"; } | {from?:string|null;priority:number;to:string;type:"attention_shift"; } | {goalId:string;result?:string|null;success:boolean;type:"goal_completed"; } | {blockedGoal:string;impasseType:string;recoverySuggestions:string[];type:"impasse_detected"; } | {agentId:string;timestamp:string;type:"connected"; } | {timestamp:string;type:"heartbeat"; } | {code:string;message:string;type:"error"; }
Defined in: src/types/cognitive.ts:1161
Real-time agent event pushed via WebSocket.
Type Declaration
{ changeType: KbChangeType; sort: string; termId: string; type: "kb_change"; }
changeType
changeType:
KbChangeType
Type of change.
sort
sort:
string
Sort of the term.
termId
termId:
string
Term ID that changed (UUID).
type
type:
"kb_change"
{ actionSort: string; confidence: number; deadline?: string | null; reviewId: string; type: "hitl_request"; }
actionSort
actionSort:
string
Action sort.
confidence
confidence:
number
Confidence level.
deadline?
optionaldeadline:string|null
Optional deadline.
reviewId
reviewId:
string
Review ID (UUID).
type
type:
"hitl_request"
{ actionsExecuted: number; agentId: string; beliefsUpdated: number; pendingReviews: string[]; type: "cycle_complete"; }
actionsExecuted
actionsExecuted:
number
Number of actions executed.
agentId
agentId:
string
Agent ID (UUID).
beliefsUpdated
beliefsUpdated:
number
Number of beliefs updated.
pendingReviews
pendingReviews:
string[]
Any pending reviews from this cycle.
type
type:
"cycle_complete"
{ from?: string | null; priority: number; to: string; type: "attention_shift"; }
from?
optionalfrom:string|null
Previous focus (UUID), if any.
priority
priority:
number
Priority of new focus.
to
to:
string
New focus (UUID).
type
type:
"attention_shift"
{ goalId: string; result?: string | null; success: boolean; type: "goal_completed"; }
goalId
goalId:
string
Goal ID (UUID).
result?
optionalresult:string|null
Optional result message.
success
success:
boolean
Success or failure.
type
type:
"goal_completed"
{ blockedGoal: string; impasseType: string; recoverySuggestions: string[]; type: "impasse_detected"; }
blockedGoal
blockedGoal:
string
Blocked goal ID (UUID).
impasseType
impasseType:
string
Type of impasse.
recoverySuggestions
recoverySuggestions:
string[]
Suggested recovery actions.
type
type:
"impasse_detected"
{ agentId: string; timestamp: string; type: "connected"; }
agentId
agentId:
string
Agent ID connected to (UUID).
timestamp
timestamp:
string
Server timestamp.
type
type:
"connected"
{ timestamp: string; type: "heartbeat"; }
timestamp
timestamp:
string
Server timestamp.
type
type:
"heartbeat"
{ code: string; message: string; type: "error"; }
code
code:
string
Error code.
message
message:
string
Error message.
type
type:
"error"
Remarks
9-variant tagged union discriminated by the type field.
Events are received through the cognitive agent WebSocket subscription.