Documentation
¶
Overview ¶
Package managedtarget resolves a caller-facing shell name into one host-shaped Sidecar-owned target. Resolve is state-free: callers supply the candidates they are authorized to expose. List/Candidates load that universe from a Sidecar state directory so the CLI and the TUI cannot disagree.
Index ¶
- Constants
- func ObserveWorktreeOrphans(ctx context.Context, projects []Project, opts ObserveOptions) shellliveness.OrphanObservation
- func WorktreeOrphans(ctx context.Context, projects []Project, opts ObserveOptions) shellliveness.OrphanPlan
- type Error
- type ErrorKind
- type ObserveOptions
- type Project
- type Query
- type Target
Constants ¶
const ( KindShell = "shell" KindWorktree = "worktree" )
Variables ¶
This section is empty.
Functions ¶
func ObserveWorktreeOrphans ¶ added in v1.15.0
func ObserveWorktreeOrphans(ctx context.Context, projects []Project, opts ObserveOptions) shellliveness.OrphanObservation
ObserveWorktreeOrphans gathers the evidence for projects. A tmux server with no sessions is an empty listing, not a failure: `no server running` means there is nothing live to be orphaned.
Git is asked only when there is something to judge. Every verdict needs a directory that is gone, so a pass with no live worktree session in a missing directory (and no caller asking for root verdicts) never spawns git at all. That keeps the common `agent list` free of a git process per project.
func WorktreeOrphans ¶ added in v1.15.0
func WorktreeOrphans(ctx context.Context, projects []Project, opts ObserveOptions) shellliveness.OrphanPlan
WorktreeOrphans is ObserveWorktreeOrphans followed by the decision.
Types ¶
type ObserveOptions ¶ added in v1.15.0
type ObserveOptions struct {
// WantRoots asks for root verdicts even when no session is suspect, for a
// caller (`shell list`) that marks shells rather than sessions.
WantRoots bool
}
ObserveOptions says how much evidence a caller needs.
type Project ¶ added in v1.15.0
Project is the registered-project facts the candidate scan needs. Callers that already loaded the registry (the CLI) pass this; List loads it from stateDir.
func LoadProjects ¶ added in v1.15.0
LoadProjects reads every registered project under stateDir/projects.
type Target ¶
type Target struct {
Host, Project, ProjectRoot, Kind, Session, Name, Namespace, WorkDir, WorktreeRoot, ManifestPath string
Priority int
}
func Candidates ¶ added in v1.15.0
Candidates is every shell and worktree session the given projects own, each worktree root listed exactly once.
Shell records belong to the project whose manifest holds them. Worktree roots do not, because several registered projects can see the same directory. Each root therefore has one owner, chosen by how strongly a project claims it: created worktree, then the project's own checkout, then the first project that merely discovered it through Git.