workspace

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AgentsFile added in v0.3.0

func AgentsFile(root string) string

func BranchMetaPath

func BranchMetaPath(root, branch string) string

func BranchNameFromDir

func BranchNameFromDir(name string) string

func ClaudeFile added in v0.3.0

func ClaudeFile(root string) string

func FindRoot

func FindRoot(start string) (string, error)

func LogsPath

func LogsPath(root string) string

func ReadBranchMeta

func ReadBranchMeta(dir string) (string, bool, error)

func RepoWorktreePath

func RepoWorktreePath(root, branch, repoDir string) string

func SaveState added in v0.2.0

func SaveState(root string, state State) error

func StatePath

func StatePath(root string) string

func UpdateAgentsFile added in v0.3.0

func UpdateAgentsFile(root string, cfg config.WorkspaceConfig, state State) error

func UseBranchDirs

func UseBranchDirs(root string) bool

func WorksetFile

func WorksetFile(root string) string

func WorkspaceBranchName added in v0.3.0

func WorkspaceBranchName(name string) string

WorkspaceBranchName derives a git-safe branch name from the workspace name. Valid git branch names are preserved as-is to avoid changing existing behavior.

func WorkspaceDirName added in v0.3.0

func WorkspaceDirName(name string) string

func WorktreeBranchPath

func WorktreeBranchPath(root, branch string) string

func WorktreeDirName

func WorktreeDirName(branch string) string

func WorktreeName

func WorktreeName(branch string) string

func WorktreesPath

func WorktreesPath(root string) string

func WriteBranchMeta

func WriteBranchMeta(root, branch string) error

Types

type PullRequestState added in v0.3.0

type PullRequestState struct {
	Repo                string `json:"repo"`
	Number              int    `json:"number"`
	URL                 string `json:"url"`
	Title               string `json:"title"`
	Body                string `json:"body,omitempty"`
	State               string `json:"state"`
	Draft               bool   `json:"draft"`
	Merged              bool   `json:"merged"`
	BaseRepo            string `json:"base_repo"`
	BaseBranch          string `json:"base_branch"`
	HeadRepo            string `json:"head_repo"`
	HeadBranch          string `json:"head_branch"`
	UpdatedAt           string `json:"updated_at,omitempty"`
	Author              string `json:"author,omitempty"`
	CommentsCount       int    `json:"comments_count,omitempty"`
	ReviewCommentsCount int    `json:"review_comments_count,omitempty"`
}

type State

type State struct {
	CurrentBranch string                      `json:"current_branch"`
	PullRequests  map[string]PullRequestState `json:"pull_requests,omitempty"`
}

func LoadState added in v0.2.0

func LoadState(root string) (State, error)

type Workspace

type Workspace struct {
	Root   string
	Config config.WorkspaceConfig
	State  State
}

func Init

func Init(root, name string, defaults config.Defaults) (Workspace, error)

func Load

func Load(root string, defaults config.Defaults) (Workspace, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL