Package com.github.copilot.sdk.json
Class SessionContext
java.lang.Object
com.github.copilot.sdk.json.SessionContext
- Direct Known Subclasses:
SessionListFilter
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the current git branch.getCwd()Gets the working directory where the session was created.Gets the git repository root directory.Gets the GitHub repository in "owner/repo" format.Sets the git branch.Sets the working directory.setGitRoot(String gitRoot) Sets the git repository root directory.setRepository(String repository) Sets the GitHub repository.
-
Constructor Details
-
SessionContext
public SessionContext()
-
-
Method Details
-
getCwd
Gets the working directory where the session was created.- Returns:
- the current working directory path
-
setCwd
Sets the working directory.- Parameters:
cwd- the current working directory path- Returns:
- this instance for method chaining
-
getGitRoot
Gets the git repository root directory.- Returns:
- the git root path, or
nullif not in a git repository
-
setGitRoot
Sets the git repository root directory.- Parameters:
gitRoot- the git root path- Returns:
- this instance for method chaining
-
getRepository
Gets the GitHub repository in "owner/repo" format.- Returns:
- the repository identifier, or
nullif not available
-
setRepository
Sets the GitHub repository.- Parameters:
repository- the repository in "owner/repo" format- Returns:
- this instance for method chaining
-
getBranch
Gets the current git branch.- Returns:
- the branch name, or
nullif not available
-
setBranch
Sets the git branch.- Parameters:
branch- the branch name- Returns:
- this instance for method chaining
-