Copilot.Types.SessionHooks (Copilot SDK v2.3.0)

Copy Markdown

Configuration for session hooks.

Each field is an optional callback that the server invokes at the corresponding lifecycle point.

Summary

Functions

Returns true if any hook handler is set.

Look up a handler by hook type string.

Types

t()

@type t() :: %Copilot.Types.SessionHooks{
  on_error_occurred: (map(), map() -> map() | nil) | nil,
  on_post_tool_use: (map(), map() -> map() | nil) | nil,
  on_pre_tool_use: (map(), map() -> map() | nil) | nil,
  on_session_end: (map(), map() -> map() | nil) | nil,
  on_session_start: (map(), map() -> map() | nil) | nil,
  on_user_prompt_submitted: (map(), map() -> map() | nil) | nil
}

Functions

any_set?(h)

@spec any_set?(t()) :: boolean()

Returns true if any hook handler is set.

handler_for(h, hook_type)

@spec handler_for(t(), String.t()) :: (map(), map() -> map() | nil) | nil

Look up a handler by hook type string.