data

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RuntimeLocalWorktree = "local-worktree"
	RuntimeLocalCheckout = "local-checkout"
	RuntimeLocalDocker   = "local-docker"
	RuntimeCloudSandbox  = "cloud-sandbox"
)

Runtime constants for workspace execution backends

Variables

This section is empty.

Functions

func NormalizeRuntime added in v0.0.5

func NormalizeRuntime(runtime string) string

NormalizeRuntime returns a normalized runtime string

Types

type LoadResult added in v0.0.5

type LoadResult struct {
	Metadata *Metadata
	Warning  string // Non-empty if migration action needed
}

LoadResult includes metadata and any migration warnings

type Metadata

type Metadata struct {
	Name                 string            `json:"name"`
	Branch               string            `json:"branch"`
	Repo                 string            `json:"repo"`
	Base                 string            `json:"base"`
	Created              string            `json:"created"`
	Assistant            string            `json:"assistant"` // "claude", "codex", "gemini"
	Runtime              string            `json:"runtime"`   // "local-worktree", "local-docker", "cloud-sandbox" (default: "local-worktree")
	Scripts              ScriptsConfig     `json:"scripts"`
	ScriptMode           string            `json:"script_mode"` // "concurrent" or "nonconcurrent"
	Env                  map[string]string `json:"env"`
	PortBase             *int              `json:"port_base"`
	LastActiveBufferName string            `json:"last_active_buffer_name"`
	OpenTabs             []TabInfo         `json:"open_tabs,omitempty"` // Persisted tabs
	ActiveTabIndex       int               `json:"active_tab_index"`
}

Metadata stores per-workspace configuration

type MetadataStore

type MetadataStore struct {
	// contains filtered or unexported fields
}

MetadataStore manages per-workspace metadata persistence

func NewMetadataStore

func NewMetadataStore(metadataRoot string) *MetadataStore

NewMetadataStore creates a new metadata store

func (*MetadataStore) Delete

func (s *MetadataStore) Delete(ws *Workspace) error

Delete removes metadata for a workspace

func (*MetadataStore) Load

func (s *MetadataStore) Load(ws *Workspace) (*LoadResult, error)

Load loads metadata for a workspace

func (*MetadataStore) Save

func (s *MetadataStore) Save(ws *Workspace, meta *Metadata) error

Save saves metadata for a workspace

type Project

type Project struct {
	Name       string      `json:"name"`
	Path       string      `json:"path"` // Absolute path to repository
	Workspaces []Workspace `json:"-"`    // Discovered dynamically via git
}

Project represents a registered git repository with its workspaces

func NewProject

func NewProject(path string) *Project

NewProject creates a new Project from a repository path

func (*Project) AddWorkspace added in v0.0.5

func (p *Project) AddWorkspace(ws Workspace)

AddWorkspace adds a workspace to the project

func (*Project) FindWorkspace added in v0.0.5

func (p *Project) FindWorkspace(root string) *Workspace

FindWorkspace finds a workspace by its root path

func (*Project) FindWorkspaceByName added in v0.0.5

func (p *Project) FindWorkspaceByName(name string) *Workspace

FindWorkspaceByName finds a workspace by its name

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry manages the projects.json file for persistent project tracking

func NewRegistry

func NewRegistry(path string) *Registry

NewRegistry creates a new registry at the specified path

func (*Registry) AddProject

func (r *Registry) AddProject(path string) error

AddProject adds a project path to the registry

func (*Registry) Load

func (r *Registry) Load() ([]string, error)

Load reads the project paths from the registry file

func (*Registry) Projects

func (r *Registry) Projects() ([]string, error)

Projects returns a copy of all registered project paths

func (*Registry) RemoveProject

func (r *Registry) RemoveProject(path string) error

RemoveProject removes a project path from the registry

func (*Registry) Save

func (r *Registry) Save(paths []string) error

Save writes the project paths to the registry file

type ScriptsConfig

type ScriptsConfig struct {
	Setup   string `json:"setup"`
	Run     string `json:"run"`
	Archive string `json:"archive"`
}

ScriptsConfig holds the setup/run/archive script commands

type TabInfo

type TabInfo struct {
	Assistant string `json:"assistant"`
	Name      string `json:"name"`
}

TabInfo stores information about an open tab

type Workspace added in v0.0.5

type Workspace struct {
	Name    string    `json:"name"`
	Branch  string    `json:"branch"`
	Base    string    `json:"base"` // Base ref (e.g., origin/main)
	Repo    string    `json:"repo"` // Primary checkout path
	Root    string    `json:"root"` // Workspace path
	Created time.Time `json:"created"`
}

Workspace represents a git worktree entry with its associated metadata

func NewWorkspace added in v0.0.5

func NewWorkspace(name, branch, base, repo, root string) *Workspace

NewWorkspace creates a new Workspace with the current timestamp

func (Workspace) ID added in v0.0.5

func (w Workspace) ID() WorkspaceID

ID returns a unique identifier for the workspace based on its repo and root paths

func (Workspace) IsMainBranch added in v0.0.5

func (w Workspace) IsMainBranch() bool

IsMainBranch returns true if this workspace is on main or master branch

func (Workspace) IsPrimaryCheckout added in v0.0.5

func (w Workspace) IsPrimaryCheckout() bool

IsPrimaryCheckout returns true if this is the main checkout (not a worktree)

type WorkspaceID added in v0.0.5

type WorkspaceID string

WorkspaceID is a unique identifier based on repo+root hash

Jump to

Keyboard shortcuts

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