Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyMouseReporting(enabled bool) bool
- func MouseReportingEnabled() bool
- func RecordFromSession(sess adapter.Session, mode store.Mode) store.SessionRecord
- func SortSessions(sessions []adapter.Session)
- type AttachmentPolicySnapshot
- func (p AttachmentPolicySnapshot) BackDetach() bool
- func (p AttachmentPolicySnapshot) Capabilities() ClientCapabilities
- func (p AttachmentPolicySnapshot) ControlPrefix() string
- func (p AttachmentPolicySnapshot) Mouse() store.MousePolicy
- func (p AttachmentPolicySnapshot) MouseFiltered() bool
- func (p AttachmentPolicySnapshot) OwnsOuterScreen() bool
- type ClientCapabilities
- type ClientTemporaryOverride
- type DashboardMode
- type DoctorCheck
- type EffectivePolicy
- func (p EffectivePolicy) Diagnostics() []PolicyDiagnostic
- func (p EffectivePolicy) LaunchSnapshot() LaunchPolicySnapshot
- func (p EffectivePolicy) NewAttachment(temporary ClientTemporaryOverride, capabilities ClientCapabilities) (AttachmentPolicySnapshot, error)
- func (p EffectivePolicy) SelectedProfile() string
- type EffectiveProfileView
- type GlobalDoctorReport
- type GlyphSet
- type LaunchPolicySnapshot
- func (p LaunchPolicySnapshot) CommandAlias() string
- func (p LaunchPolicySnapshot) Mode() store.Mode
- func (p LaunchPolicySnapshot) Provider() string
- func (p LaunchPolicySnapshot) ProviderPolicy() adapter.ProviderTerminalPolicy
- func (p LaunchPolicySnapshot) ScrollbackLines() int
- func (p LaunchPolicySnapshot) TERM() string
- type LayoutClass
- type Model
- type NamedProfile
- type PolicyDiagnostic
- type ProfileDoctor
- type ProfileList
- type ProfileReferencedError
- type ProviderDoctor
- type ProviderPolicyDoctor
- type ResolutionInput
- type ResumeKind
- type ResumeOptions
- type Service
- func (s *Service) AssignProfileExact(id, name string) error
- func (s *Service) AttachSpec(ctx context.Context, id string) (adapter.AttachSpec, error)
- func (s *Service) AttachSpecExact(ctx context.Context, agentName, id string) (adapter.AttachSpec, error)
- func (s *Service) AttachSpecExactWithOptions(ctx context.Context, agentName, id string, opts ResumeOptions) (adapter.AttachSpec, error)
- func (s *Service) AttachSpecWithOptions(ctx context.Context, id string, opts ResumeOptions) (adapter.AttachSpec, error)
- func (s *Service) DispatchNamed(ctx context.Context, agentName, name, prompt, cwd, mode string) (adapter.Session, error)
- func (s *Service) DispatchNamedWithAlias(ctx context.Context, agentName, commandAlias, name, prompt, cwd, mode string) (adapter.Session, error)
- func (s *Service) DispatchNamedWithAliasProfile(ctx context.Context, ...) (adapter.Session, error)
- func (s *Service) DoctorGlobal(ctx context.Context) GlobalDoctorReport
- func (s *Service) DoctorSession(ctx context.Context, id string) (SessionDoctorReport, error)
- func (s *Service) EffectiveProfileExact(ctx context.Context, id string) (EffectiveProfileView, error)
- func (s *Service) Find(ctx context.Context, id string) (adapter.Session, store.Config, error)
- func (s *Service) FindExact(ctx context.Context, agentName, id string) (adapter.Session, store.Config, error)
- func (s *Service) ListProfiles() (ProfileList, error)
- func (s *Service) LoadSessions(ctx context.Context) ([]adapter.Session, store.Config, error)
- func (s *Service) NotifyClosed(sessionName string) error
- func (s *Service) PrintList(ctx context.Context, asJSON bool) error
- func (s *Service) Profile(name string) (NamedProfile, error)
- func (s *Service) PruneStartup(ctx context.Context) error
- func (s *Service) RefreshPRStatuses(ctx context.Context) error
- func (s *Service) RemoveProfile(name string) error
- func (s *Service) Rename(ctx context.Context, id, name string) error
- func (s *Service) RenameExact(ctx context.Context, agentName, id, name string) error
- func (s *Service) Restart(ctx context.Context, id string) error
- func (s *Service) RestartExact(ctx context.Context, agentName, id string) error
- func (s *Service) RestartExactWithOptions(ctx context.Context, agentName, id string, opts ResumeOptions) error
- func (s *Service) RestartWithOptions(ctx context.Context, id string, opts ResumeOptions) error
- func (s *Service) ResumeBackground(ctx context.Context, id string) error
- func (s *Service) ResumeBackgroundExact(ctx context.Context, agentName, id string) error
- func (s *Service) ResumeBackgroundExactWithOptions(ctx context.Context, agentName, id string, opts ResumeOptions) error
- func (s *Service) ResumeBackgroundWithOptions(ctx context.Context, id string, opts ResumeOptions) error
- func (s *Service) SetDefaultAgent(agent string) error
- func (s *Service) SetDefaultProfile(name string) error
- func (s *Service) SetUI(mut func(*store.UISettings)) error
- func (s *Service) Stop(ctx context.Context, id string, remove bool) error
- func (s *Service) StopExact(ctx context.Context, agentName, id string, remove bool) error
- func (s *Service) TogglePin(ctx context.Context, id string) error
- func (s *Service) TogglePinExact(ctx context.Context, agentName, id string) error
- func (s *Service) UpdateProfile(name string, mutate func(*store.Profile) error) error
- func (s *Service) UpdateProfileOverridesExact(id, provider string, mutate func(*store.SessionProfileOverrides) error) error
- func (s *Service) UpdateSortIndices(sessions []adapter.Session) error
- func (s *Service) UpdateSortOrder(sessions []adapter.Session) error
- type SessionDiagnosticSource
- type SessionDoctorReport
- type TermCaps
Constants ¶
const ( ResumeExact = adapter.ResumeExact ResumeHeuristic = adapter.ResumeHeuristic ResumeUnsupported = adapter.ResumeUnsupported )
const (
DiagnosticProfileFallback = "profile_fallback"
)
const ProbeGlyph = "●"
ProbeGlyph is the character the cli-side CPR measurement prints: it must be East-Asian-Ambiguous (the class that misrenders) and part of our vocabulary.
Variables ¶
var ErrAmbiguousResume = errors.New("ambiguous heuristic resume")
Functions ¶
func ApplyMouseReporting ¶
func MouseReportingEnabled ¶
func MouseReportingEnabled() bool
func RecordFromSession ¶
func SortSessions ¶
Types ¶
type AttachmentPolicySnapshot ¶
type AttachmentPolicySnapshot struct {
// contains filtered or unexported fields
}
func (AttachmentPolicySnapshot) BackDetach ¶
func (p AttachmentPolicySnapshot) BackDetach() bool
func (AttachmentPolicySnapshot) Capabilities ¶
func (p AttachmentPolicySnapshot) Capabilities() ClientCapabilities
func (AttachmentPolicySnapshot) ControlPrefix ¶
func (p AttachmentPolicySnapshot) ControlPrefix() string
func (AttachmentPolicySnapshot) Mouse ¶
func (p AttachmentPolicySnapshot) Mouse() store.MousePolicy
func (AttachmentPolicySnapshot) MouseFiltered ¶
func (p AttachmentPolicySnapshot) MouseFiltered() bool
func (AttachmentPolicySnapshot) OwnsOuterScreen ¶
func (p AttachmentPolicySnapshot) OwnsOuterScreen() bool
type ClientCapabilities ¶
type ClientTemporaryOverride ¶
type ClientTemporaryOverride struct {
Mouse *store.MousePolicy `json:"-"`
ControlPrefix *string `json:"-"`
BackDetach *bool `json:"-"`
}
type DashboardMode ¶
type DashboardMode uint8
DashboardMode is the primary dashboard surface. Like LayoutClass it is derived from the existing interaction state.
const ( ModeOperations DashboardMode = iota ModeNew )
type DoctorCheck ¶
type EffectivePolicy ¶
type EffectivePolicy struct {
// contains filtered or unexported fields
}
func ResolveProfilePolicy ¶
func ResolveProfilePolicy(input ResolutionInput) (EffectivePolicy, error)
func (EffectivePolicy) Diagnostics ¶
func (p EffectivePolicy) Diagnostics() []PolicyDiagnostic
func (EffectivePolicy) LaunchSnapshot ¶
func (p EffectivePolicy) LaunchSnapshot() LaunchPolicySnapshot
func (EffectivePolicy) NewAttachment ¶
func (p EffectivePolicy) NewAttachment(temporary ClientTemporaryOverride, capabilities ClientCapabilities) (AttachmentPolicySnapshot, error)
func (EffectivePolicy) SelectedProfile ¶
func (p EffectivePolicy) SelectedProfile() string
type EffectiveProfileView ¶
type EffectiveProfileView struct {
SessionID string `json:"session_id"`
Provider string `json:"provider"`
SelectedProfile string `json:"selected_profile"`
EffectiveProfile string `json:"effective_profile"`
Mode store.Mode `json:"mode"`
CommandAlias string `json:"command_alias"`
Mouse store.MousePolicy `json:"mouse"`
ControlPrefix string `json:"control_prefix"`
BackDetach bool `json:"back_detach"`
ScrollbackLines int `json:"scrollback_lines"`
}
type GlobalDoctorReport ¶
type GlobalDoctorReport struct {
Store DoctorCheck `json:"store"`
Runtime DoctorCheck `json:"runtime"`
Providers []ProviderDoctor `json:"providers"`
Profiles []ProfileDoctor `json:"profiles"`
}
type GlyphSet ¶
type GlyphSet uint8
GlyphSet selects the vocabulary the tone table renders with.
const ( // GlyphsUnicode is the full set: ● ○ ✕ ▲ ▸ ▌ ⇄ and hairline rules. GlyphsUnicode GlyphSet = iota // GlyphsASCII is the degraded set for terminals without UTF-8 or whose // fonts draw East-Asian-Ambiguous glyphs two cells wide. Substitution is // wholesale rather than per-glyph: a mixed vocabulary is harder to read // than a plain one, and the failure is per-terminal, not per-glyph. GlyphsASCII )
type LaunchPolicySnapshot ¶
type LaunchPolicySnapshot struct {
// contains filtered or unexported fields
}
func (LaunchPolicySnapshot) CommandAlias ¶
func (p LaunchPolicySnapshot) CommandAlias() string
func (LaunchPolicySnapshot) Mode ¶
func (p LaunchPolicySnapshot) Mode() store.Mode
func (LaunchPolicySnapshot) Provider ¶
func (p LaunchPolicySnapshot) Provider() string
func (LaunchPolicySnapshot) ProviderPolicy ¶
func (p LaunchPolicySnapshot) ProviderPolicy() adapter.ProviderTerminalPolicy
func (LaunchPolicySnapshot) ScrollbackLines ¶
func (p LaunchPolicySnapshot) ScrollbackLines() int
func (LaunchPolicySnapshot) TERM ¶
func (p LaunchPolicySnapshot) TERM() string
type LayoutClass ¶
type LayoutClass uint8
LayoutClass names the three responsive dashboard geometries. It is derived from the current terminal dimensions; Model deliberately stores no parallel layout booleans that could become contradictory after a resize.
const ( LayoutCompact LayoutClass = iota LayoutStandard LayoutWide )
type NamedProfile ¶
type PolicyDiagnostic ¶
type ProfileDoctor ¶
type ProfileList ¶
type ProfileList struct {
DefaultProfile string `json:"default_profile"`
Profiles []NamedProfile `json:"profiles"`
}
type ProfileReferencedError ¶
func (*ProfileReferencedError) Error ¶
func (e *ProfileReferencedError) Error() string
type ProviderDoctor ¶
type ProviderPolicyDoctor ¶
type ResolutionInput ¶
type ResolutionInput struct {
Config store.Config
Session store.SessionRecord
ProviderPolicy adapter.ProviderTerminalPolicy
}
type ResumeKind ¶
type ResumeKind = adapter.ResumeKind
type ResumeOptions ¶
type ResumeOptions struct {
AllowLatest bool
}
type Service ¶
type Service struct {
Store *store.Store
Registry *adapter.Registry
SessionDiagnostics SessionDiagnosticSource
// contains filtered or unexported fields
}
func (*Service) AssignProfileExact ¶
func (*Service) AttachSpec ¶
func (*Service) AttachSpecExact ¶
func (*Service) AttachSpecExactWithOptions ¶
func (s *Service) AttachSpecExactWithOptions(ctx context.Context, agentName, id string, opts ResumeOptions) (adapter.AttachSpec, error)
func (*Service) AttachSpecWithOptions ¶
func (s *Service) AttachSpecWithOptions(ctx context.Context, id string, opts ResumeOptions) (adapter.AttachSpec, error)
func (*Service) DispatchNamed ¶
func (*Service) DispatchNamedWithAlias ¶
func (*Service) DispatchNamedWithAliasProfile ¶
func (*Service) DoctorGlobal ¶
func (s *Service) DoctorGlobal(ctx context.Context) GlobalDoctorReport
func (*Service) DoctorSession ¶
func (*Service) EffectiveProfileExact ¶
func (*Service) FindExact ¶
func (s *Service) FindExact(ctx context.Context, agentName, id string) (adapter.Session, store.Config, error)
FindExact resolves the unique provider/session pair used by the TUI. Unlike Find it deliberately performs no prefix or cross-provider matching.
func (*Service) ListProfiles ¶
func (s *Service) ListProfiles() (ProfileList, error)
func (*Service) LoadSessions ¶
func (*Service) NotifyClosed ¶
NotifyClosed flags the record whose backend session name matches as user-closed. It backs the `uam notify-closed` CLI subcommand. Session hosts normally mark records closed in-process when their agent exits (store.MarkSessionClosed); this stays as the scriptable entry point.
Idempotent: a no-op if the record is already StatusClosedByUser or if no record matches (e.g., uam already deleted it via Ctrl+X / `uam rm`).
func (*Service) PruneStartup ¶
PruneStartup removes long-stale, dead records from the store so sessions.json does not grow unbounded. It is outage-safe: pruning only runs when at least one live session is visible, so a transient failure to scan the session runtime directory (which looks exactly like "no sessions") can never wipe every record. PruneOld then drops records whose process is gone and that have not been seen within pruneMaxAge (F20 Stage 2).
func (*Service) RefreshPRStatuses ¶
RefreshPRStatuses enriches stale discovered PRs outside the session-discovery path. Only PR-owned fields are persisted, and overlapping passes coalesce.
func (*Service) RemoveProfile ¶
func (*Service) RenameExact ¶
func (*Service) Restart ¶
Restart replaces a session's agent process while keeping its identity: a running backend session is stopped (soft close, record kept), then resumed under the same name with the provider's resume args so the agent picks its conversation back up. A session that is already stopped simply resumes.
func (*Service) RestartExact ¶
func (*Service) RestartExactWithOptions ¶
func (*Service) RestartWithOptions ¶
func (*Service) ResumeBackground ¶
ResumeBackground restarts a stopped session's backend session without attaching to it. It is a no-op when the session is already running.
func (*Service) ResumeBackgroundExact ¶
func (*Service) ResumeBackgroundExactWithOptions ¶
func (*Service) ResumeBackgroundWithOptions ¶
func (*Service) SetDefaultAgent ¶
func (*Service) SetDefaultProfile ¶
func (*Service) StopExact ¶
StopExact is the provider-aware TUI variant of Stop. The ID-only method is retained for CLI prefix lookup compatibility.
func (*Service) TogglePinExact ¶
func (*Service) UpdateProfile ¶
func (*Service) UpdateProfileOverridesExact ¶
func (*Service) UpdateSortIndices ¶
UpdateSortIndices persists the explicit canonical positions carried by each session. Grouped presentation order is not itself a global sort order: only the pair moved inside a workspace has its positions exchanged.
type SessionDiagnosticSource ¶
type SessionDoctorReport ¶
type SessionDoctorReport struct {
SessionID string `json:"session_id"`
SessionName string `json:"session_name"`
Provider string `json:"provider"`
RuntimeStatus string `json:"runtime_status"`
Runtime session.RuntimeDiagnostic `json:"runtime"`
SelectedProfile string `json:"selected_profile"`
EffectiveProfile string `json:"effective_profile"`
ProviderPolicy ProviderPolicyDoctor `json:"provider_policy"`
FallbackReasons []string `json:"fallback_reasons"`
}
type TermCaps ¶
type TermCaps struct {
Glyphs GlyphSet
// AmbiguousWide records the measured width of an East-Asian-Ambiguous
// glyph when the probe ran (0 = not probed, 1 = narrow, 2 = wide). It is
// diagnostic — doctor reports it — while Glyphs carries the decision.
AmbiguousWide int
// UTF8 records whether the locale advertises UTF-8.
UTF8 bool
// Probed reports whether the CPR measurement actually ran (false when
// stdout is not a TTY, the terminal never answered, or an override
// short-circuited it).
Probed bool
}
TermCaps is the result of the startup probe. The zero value is the full Unicode experience, which keeps every existing test rendering exactly what it rendered before.
func ApplyTermCaps ¶
ApplyTermCaps installs the probe result. It returns the previous value so tests can restore it with defer.
func CapsFromEnvironment ¶
CapsFromEnvironment resolves the non-probe inputs: locale and overrides. The CPR measurement lives in the cli package (it needs the real TTY before Bubble Tea starts); this half is pure and unit-testable.
Precedence: UAM_ASCII forces ASCII; UAM_WIDE=0 forces Unicode (trust the terminal); a non-UTF-8 locale forces ASCII; otherwise the measured width decides (2 → ASCII), defaulting to Unicode when unmeasured.
func CurrentTermCaps ¶
func CurrentTermCaps() TermCaps
CurrentTermCaps exposes the active capabilities (doctor reports them).