Interface: ApprovalRequest
Defined in: packages/agentos/src/api/types.ts:754
A pending approval request raised by the HITL subsystem.
Passed to HitlConfig.handler and emitted on the approvalRequested callback.
Properties
action
action:
string
Defined in: packages/agentos/src/api/types.ts:770
Short action label (e.g. tool or agent name).
agent
agent:
string
Defined in: packages/agentos/src/api/types.ts:768
Name of the agent that triggered the approval request.
context
context:
object
Defined in: packages/agentos/src/api/types.ts:785
Run context. A beforeReturn ("output") request fills it from the
result it approves: its agent calls, token total and cost, and the
milliseconds since the call started. An "agent" or "emergent"
request carries zeros and the strategy's own list of agent calls, not a
copy: it holds the calls made before the request and grows as later
calls finish, including calls of the same graph tier that finish while
the request waits (under the parallel strategy it is an empty list of
its own). A "tool" request carries no agent calls and zeros.
agentCalls
agentCalls:
AgentCallRecord[]
Agent call records (see above for which requests carry them).
elapsedMs
elapsedMs:
number
Milliseconds since the call started, on a beforeReturn request; 0 on the others.
totalCostUSD
totalCostUSD:
number
Total cost in USD of the result, on a beforeReturn request; 0 on the others.
totalTokens
totalTokens:
number
Total tokens of the result, on a beforeReturn request; 0 on the others.
description
description:
string
Defined in: packages/agentos/src/api/types.ts:772
Human-readable description of what is being approved.
details
details:
Record<string,unknown>
Defined in: packages/agentos/src/api/types.ts:774
Structured details about the pending action (tool args, agent config, etc.).
id
id:
string
Defined in: packages/agentos/src/api/types.ts:756
Unique identifier for this approval request.
type
type:
"emergent"|"tool"|"agent"|"output"|"strategy-override"
Defined in: packages/agentos/src/api/types.ts:766
What kind of action is awaiting approval.
"tool"— a tool invocation."agent"— an agent invocation."emergent"— synthesis of a new runtime agent."output"— the final answer before returning to the caller."strategy-override"— reserved; nothing raises it (seebeforeStrategyOverride).