workspace

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMaxWorkspaces = 20

Variables

This section is empty.

Functions

func ForTask

func ForTask(taskName string) (string, error)

ForTask returns the workspace assigned to a task, if any.

func ResolveModel

func ResolveModel(cfg *Config, t *task.Task, override string) string

func ResolveReasoning

func ResolveReasoning(cfg *Config, t *task.Task, override string) string

func ValidateReasoningFlag

func ValidateReasoningFlag(harnessName, reasoning string) error

func ValidateReasoningLevel

func ValidateReasoningLevel(reasoning string) error

Types

type Acquisition

type Acquisition struct {
	Entry *Entry
	// contains filtered or unexported fields
}

Acquisition holds a workspace and its lock. Call Release() when done.

func (*Acquisition) Release

func (a *Acquisition) Release()

Release releases the workspace lock. Must be called after state is saved.

type Config

type Config struct {
	Harness       string         `json:"harness"`
	MaxWorkspaces int            `json:"max_workspaces"`
	Options       map[string]any `json:"options,omitempty"`
}

Config is the project configuration (.subtask/config.json).

func ConfigWithModelReasoning

func ConfigWithModelReasoning(cfg *Config, model, reasoning string) *Config

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig loads the project config from .subtask/config.json.

func (*Config) Save

func (c *Config) Save() error

Save writes the config to .subtask/config.json.

type Entry

type Entry struct {
	Name string // e.g., "workspace-1"
	Path string // e.g., "~/.subtask/workspaces/-Users-foo-code-project--1"
	ID   int    // e.g., 1
}

Entry defines a workspace.

func ListWorkspaces

func ListWorkspaces() ([]Entry, error)

ListWorkspaces discovers workspaces for the current project by globbing.

type Pool

type Pool struct{}

Pool manages workspace allocation.

func NewPool

func NewPool() *Pool

NewPool creates a workspace pool.

func (*Pool) Acquire

func (p *Pool) Acquire() (*Acquisition, error)

Acquire finds an available workspace with file locking to prevent races. The caller MUST call Release() on the returned Acquisition after saving state.

func (*Pool) AcquireExcluding

func (p *Pool) AcquireExcluding(excludePaths ...string) (*Acquisition, error)

AcquireExcluding finds an available workspace, excluding any paths provided. The caller MUST call Release() on the returned Acquisition after saving state.

Jump to

Keyboard shortcuts

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