Package com.github.copilot.sdk.json
Class SessionEndHookInput
java.lang.Object
com.github.copilot.sdk.json.SessionEndHookInput
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCwd()Gets the current working directory.getError()Gets the error message, if the session ended due to an error.Gets the final message, if any.Gets the reason for session end.longGets the timestamp when the session ended.Sets the current working directory.Sets the error message.setFinalMessage(String finalMessage) Sets the final message.Sets the reason for session end.setTimestamp(long timestamp) Sets the timestamp when the session ended.
-
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
Sets the timestamp when the session ended.- Parameters:
timestamp- the timestamp in milliseconds since epoch- Returns:
- this instance for method chaining
-
getCwd
Gets the current working directory.- Returns:
- the current working directory
-
setCwd
Sets the current working directory.- Parameters:
cwd- the current working directory- Returns:
- this instance for method chaining
-
getReason
Gets the reason for session end.- Returns:
- the reason: "complete", "error", "abort", "timeout", or "user_exit"
-
setReason
Sets the reason for session end.- Parameters:
reason- the reason: "complete", "error", "abort", "timeout", or "user_exit"- Returns:
- this instance for method chaining
-
getFinalMessage
Gets the final message, if any.- Returns:
- the final message, or
null
-
setFinalMessage
Sets the final message.- Parameters:
finalMessage- the final message- Returns:
- this instance for method chaining
-
getError
Gets the error message, if the session ended due to an error.- Returns:
- the error message, or
null
-
setError
Sets the error message.- Parameters:
error- the error message- Returns:
- this instance for method chaining
-