Documentation
¶
Overview ¶
Package workspaceinventory provides the narrow, read-only inventory used by cross-project surfaces. It never creates or reconciles Sidecar state.
Index ¶
- func CanonicalPath(path string) string
- func CanonicalProjectPath(path string) string
- type Collector
- func (c Collector) CollectProject(ctx context.Context, name, root string, allRoots []string, panes []Pane) ProjectResult
- func (c Collector) CollectProjectInventory(ctx context.Context, name, root string) ProjectResult
- func (c Collector) CommitTrackers()
- func (c Collector) ForRefresh(maxCaptures int, claims ...ShellClaims) Collector
- func (c Collector) ListPanes(ctx context.Context) ([]Pane, error)
- func (c Collector) Metrics() MetricsSnapshot
- func (c Collector) RefreshProjectStatus(ctx context.Context, previous ProjectResult, allRoots []string, panes []Pane) ProjectResult
- func (c Collector) ValidateWorkspace(ctx context.Context, workspace Workspace) error
- func (c Collector) WithDefaults() Collector
- func (c Collector) WithShellClaims(claims ShellClaims) Collector
- type ExecRunner
- type Kind
- type MetricsSnapshot
- type Pane
- type ProjectResult
- type RefreshMetrics
- type Runner
- type ShellClaims
- type Workspace
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanonicalPath ¶
func CanonicalProjectPath ¶
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 ¶
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 ¶
ValidateWorkspace rechecks a card's exact durable identity without creating, migrating, reconciling, or mutating project state.
func (Collector) WithDefaults ¶
func (Collector) WithShellClaims ¶
func (c Collector) WithShellClaims(claims ShellClaims) Collector
type ExecRunner ¶
type ExecRunner struct{}
type MetricsSnapshot ¶
type MetricsSnapshot struct {
ProjectOps, Captures, MaxCaptures, TrackerCommits int64
}
type ProjectResult ¶
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 ShellClaims ¶
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
}