Class SessionContext

java.lang.Object
com.github.copilot.sdk.json.SessionContext
Direct Known Subclasses:
SessionListFilter

public class SessionContext extends Object
Working directory context for a session.

Contains information about the working directory where the session was created, including git repository information if applicable.

Since:
1.0.0
  • Constructor Details

    • SessionContext

      public SessionContext()
  • Method Details

    • getCwd

      public String getCwd()
      Gets the working directory where the session was created.
      Returns:
      the current working directory path
    • setCwd

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

      public String getGitRoot()
      Gets the git repository root directory.
      Returns:
      the git root path, or null if not in a git repository
    • setGitRoot

      public SessionContext setGitRoot(String gitRoot)
      Sets the git repository root directory.
      Parameters:
      gitRoot - the git root path
      Returns:
      this instance for method chaining
    • getRepository

      public String getRepository()
      Gets the GitHub repository in "owner/repo" format.
      Returns:
      the repository identifier, or null if not available
    • setRepository

      public SessionContext setRepository(String repository)
      Sets the GitHub repository.
      Parameters:
      repository - the repository in "owner/repo" format
      Returns:
      this instance for method chaining
    • getBranch

      public String getBranch()
      Gets the current git branch.
      Returns:
      the branch name, or null if not available
    • setBranch

      public SessionContext setBranch(String branch)
      Sets the git branch.
      Parameters:
      branch - the branch name
      Returns:
      this instance for method chaining