Package com.github.copilot.sdk.json
Class SessionStartHookInput
java.lang.Object
com.github.copilot.sdk.json.SessionStartHookInput
Input for a session-start hook.
This hook is invoked when a session starts, allowing you to perform initialization or modify the session configuration.
- Since:
- 1.0.7
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCwd()Gets the current working directory.Gets the initial prompt, if any.Gets the source of the session start.longGets the timestamp when the session started.Sets the current working directory.setInitialPrompt(String initialPrompt) Sets the initial prompt.Sets the source of the session start.setTimestamp(long timestamp) Sets the timestamp when the session started.
-
Constructor Details
-
SessionStartHookInput
public SessionStartHookInput()
-
-
Method Details
-
getTimestamp
public long getTimestamp()Gets the timestamp when the session started.- Returns:
- the timestamp in milliseconds since epoch
-
setTimestamp
Sets the timestamp when the session started.- 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
-
getSource
Gets the source of the session start.- Returns:
- the source: "startup", "resume", or "new"
-
setSource
Sets the source of the session start.- Parameters:
source- the source: "startup", "resume", or "new"- Returns:
- this instance for method chaining
-
getInitialPrompt
Gets the initial prompt, if any.- Returns:
- the initial prompt, or
null
-
setInitialPrompt
Sets the initial prompt.- Parameters:
initialPrompt- the initial prompt- Returns:
- this instance for method chaining
-