Class SessionEndHookInput

java.lang.Object
com.github.copilot.sdk.json.SessionEndHookInput

public class SessionEndHookInput extends Object
Input for a session-end hook.

This hook is invoked when a session ends, allowing you to perform cleanup or logging.

Since:
1.0.7
  • Constructor Details

    • SessionEndHookInput

      public SessionEndHookInput()
  • Method Details

    • getTimestamp

      public long getTimestamp()
      Gets the timestamp when the session ended.
      Returns:
      the timestamp in milliseconds since epoch
    • setTimestamp

      public SessionEndHookInput setTimestamp(long timestamp)
      Sets the timestamp when the session ended.
      Parameters:
      timestamp - the timestamp in milliseconds since epoch
      Returns:
      this instance for method chaining
    • getCwd

      public String getCwd()
      Gets the current working directory.
      Returns:
      the current working directory
    • setCwd

      public SessionEndHookInput setCwd(String cwd)
      Sets the current working directory.
      Parameters:
      cwd - the current working directory
      Returns:
      this instance for method chaining
    • getReason

      public String getReason()
      Gets the reason for session end.
      Returns:
      the reason: "complete", "error", "abort", "timeout", or "user_exit"
    • setReason

      public SessionEndHookInput setReason(String reason)
      Sets the reason for session end.
      Parameters:
      reason - the reason: "complete", "error", "abort", "timeout", or "user_exit"
      Returns:
      this instance for method chaining
    • getFinalMessage

      public String getFinalMessage()
      Gets the final message, if any.
      Returns:
      the final message, or null
    • setFinalMessage

      public SessionEndHookInput setFinalMessage(String finalMessage)
      Sets the final message.
      Parameters:
      finalMessage - the final message
      Returns:
      this instance for method chaining
    • getError

      public String getError()
      Gets the error message, if the session ended due to an error.
      Returns:
      the error message, or null
    • setError

      public SessionEndHookInput setError(String error)
      Sets the error message.
      Parameters:
      error - the error message
      Returns:
      this instance for method chaining