workspaceinventory

package
v0.94.1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package workspaceinventory provides the narrow, read-only inventory used by cross-project surfaces. It never creates or reconciles Sidecar state.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanonicalPath

func CanonicalPath(path string) string

func CanonicalProjectPath

func CanonicalProjectPath(path string) string

CanonicalProjectPath resolves a configured checkout to its canonical main worktree when Git's linked-worktree metadata is available. Missing and non-Git paths retain their canonical configured identity so they can still produce an independent error result.

Types

type Collector

type Collector struct {
	Runner  Runner
	Capture func(string, int) (string, error)
	Now     func() time.Time
	// contains filtered or unexported fields
}

func (Collector) CollectProject

func (c Collector) CollectProject(ctx context.Context, name, root string, allRoots []string, panes []Pane) ProjectResult

CollectProject reads one Git inventory and already-existing Sidecar metadata.

func (Collector) CollectProjectInventory

func (c Collector) CollectProjectInventory(ctx context.Context, name, root string) ProjectResult

CollectProjectInventory reads one project's lightweight Git and existing Sidecar metadata without inspecting tmux or capturing panes. Callers can therefore fan this stage out with the same project bound as the rest of a refresh and paint each result before global shell collision resolution.

func (Collector) CommitTrackers

func (c Collector) CommitTrackers()

CommitTrackers promotes a completed refresh's generation-local activity state. Canceled/stale refreshes are simply never committed.

func (Collector) ForRefresh

func (c Collector) ForRefresh(maxCaptures int, claims ...ShellClaims) Collector

ForRefresh returns a collector sharing provider history with its parent while independently bounding pane captures for one refresh generation.

func (Collector) ListPanes

func (c Collector) ListPanes(ctx context.Context) ([]Pane, error)

ListPanes takes the single global tmux inventory used by an Overview refresh.

func (Collector) Metrics

func (c Collector) Metrics() MetricsSnapshot

func (Collector) RefreshProjectStatus

func (c Collector) RefreshProjectStatus(ctx context.Context, previous ProjectResult, allRoots []string, panes []Pane) ProjectResult

RefreshProjectStatus reuses an immutable successful project inventory and refreshes only live tmux/provider evidence. It performs no Git or metadata reads, allowing visible polling to stay cheaper than explicit inventory refreshes.

func (Collector) ValidateWorkspace

func (c Collector) ValidateWorkspace(ctx context.Context, workspace Workspace) error

ValidateWorkspace rechecks a card's exact durable identity without creating, migrating, reconciling, or mutating project state.

func (Collector) WithDefaults

func (c Collector) WithDefaults() Collector

func (Collector) WithShellClaims

func (c Collector) WithShellClaims(claims ShellClaims) Collector

type ExecRunner

type ExecRunner struct{}

func (ExecRunner) Output

func (ExecRunner) Output(ctx context.Context, name string, args ...string) ([]byte, error)

type Kind

type Kind string
const (
	KindWorktree Kind = "worktree"
	KindShell    Kind = "shell"
)

type MetricsSnapshot

type MetricsSnapshot struct {
	ProjectOps, Captures, MaxCaptures, TrackerCommits int64
}

type Pane

type Pane struct {
	ID, Session, Path, Command, Title string
	Dead                              bool
}

type ProjectResult

type ProjectResult struct {
	ProjectKey, ProjectName, ProjectRoot string
	Workspaces                           []Workspace
	ObservedAt                           time.Time
	Err                                  error
}

type RefreshMetrics

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

RefreshMetrics contains privacy-safe operation and concurrency counters for an in-memory refresh. It never includes project paths, pane IDs, or output.

type Runner

type Runner interface {
	Output(context.Context, string, ...string) ([]byte, error)
}

type ShellClaims

type ShellClaims struct {
	Sessions map[string]bool
	Owners   map[string]string
}

ShellClaims records globally reserved agent-shell sessions and their unique owning project. An empty owner marks a collision that no project may claim.

func BuildShellClaims

func BuildShellClaims(results []ProjectResult) ShellClaims

type Workspace

type Workspace struct {
	ID, ProjectKey, ProjectName, ProjectRoot string
	Kind                                     Kind
	Key, Name, Path, Branch, TaskID          string
	TmuxName, PaneID, Provider, Namespace    string
	Presentation                             agentstatus.Presentation
	ObservedAt                               time.Time
}

Jump to

Keyboard shortcuts

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