EventHandlers
Defined in: agent/event-handlers.ts:21
Named event handlers for different event types.
Properties
Section titled “Properties”onGadgetCall()?
Section titled “onGadgetCall()?”
optionalonGadgetCall: (call) =>void|Promise<void>
Defined in: agent/event-handlers.ts:26
Called when a gadget is about to be executed
Parameters
Section titled “Parameters”dependencies
Section titled “dependencies”string[]
gadgetName
Section titled “gadgetName”string
invocationId
Section titled “invocationId”string
parameters?
Section titled “parameters?”Record<string, unknown>
parametersRaw
Section titled “parametersRaw”string
Returns
Section titled “Returns”void | Promise<void>
onGadgetResult()?
Section titled “onGadgetResult()?”
optionalonGadgetResult: (result) =>void|Promise<void>
Defined in: agent/event-handlers.ts:35
Called when a gadget execution completes
Parameters
Section titled “Parameters”result
Section titled “result”error?
Section titled “error?”string
gadgetName
Section titled “gadgetName”string
invocationId
Section titled “invocationId”string
parameters
Section titled “parameters”Record<string, unknown>
result?
Section titled “result?”string
Returns
Section titled “Returns”void | Promise<void>
onHumanInputRequired()?
Section titled “onHumanInputRequired()?”
optionalonHumanInputRequired: (data) =>void|Promise<void>
Defined in: agent/event-handlers.ts:44
Called when human input is required
Parameters
Section titled “Parameters”gadgetName
Section titled “gadgetName”string
question
Section titled “question”string
Returns
Section titled “Returns”void | Promise<void>
onOther()?
Section titled “onOther()?”
optionalonOther: (event) =>void|Promise<void>
Defined in: agent/event-handlers.ts:47
Called for any other event type
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void | Promise<void>
onText()?
Section titled “onText()?”
optionalonText: (content) =>void|Promise<void>
Defined in: agent/event-handlers.ts:23
Called when text is generated by the LLM
Parameters
Section titled “Parameters”content
Section titled “content”string
Returns
Section titled “Returns”void | Promise<void>