Module decision_translation

Module decision_translation 

Source
Expand description

Shared decision-translation helpers for converting SuspensionResponse values into ToolCallDecision commands.

Both the AG-UI and AI-SDK protocol adapters delegate to these functions so that approval/denial semantics are defined in exactly one place.

Functionsยง

current_unix_millis
Current time as milliseconds since the Unix epoch.
decision_action_from_result
Determine whether a result value represents approval or denial.
decision_reason_from_result
Extract a human-readable reason string from a denial result.
is_denied_token
Return true if a string value represents a denial intent.
suspension_response_to_decision
Convert a SuspensionResponse into a routable ToolCallDecision.