Class SessionStartHookInput

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

public class SessionStartHookInput extends Object
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 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

      public SessionStartHookInput setTimestamp(long timestamp)
      Sets the timestamp when the session started.
      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 SessionStartHookInput setCwd(String cwd)
      Sets the current working directory.
      Parameters:
      cwd - the current working directory
      Returns:
      this instance for method chaining
    • getSource

      public String getSource()
      Gets the source of the session start.
      Returns:
      the source: "startup", "resume", or "new"
    • setSource

      public SessionStartHookInput setSource(String source)
      Sets the source of the session start.
      Parameters:
      source - the source: "startup", "resume", or "new"
      Returns:
      this instance for method chaining
    • getInitialPrompt

      public String getInitialPrompt()
      Gets the initial prompt, if any.
      Returns:
      the initial prompt, or null
    • setInitialPrompt

      public SessionStartHookInput setInitialPrompt(String initialPrompt)
      Sets the initial prompt.
      Parameters:
      initialPrompt - the initial prompt
      Returns:
      this instance for method chaining