Versions in this module Expand all Collapse all v0 v0.4.5 Oct 16, 2026 Changes in this version + const EffortDefault + const EffortNoReasoning + func DetermineSelection(ctx Context) (*Selection, Source, error) + func EmitModelChanged(store *sessions.Store, sel Selection, prior *Selection) error + func EmitModelEffortUnsupported(store *sessions.Store, provider, modelID, configuredEffort string) error + func EmitModelGlobalMirrorFailed(store *sessions.Store, targetPath string, sel Selection, ...) error + func EmitModelPersistFailed(store *sessions.Store, targetPath string, sel Selection, ...) error + func EmitModelResponse(store *sessions.Store, provider, modelID string, ...) error + func EmitModelTurn(store *sessions.Store, provider, modelID, effort string, source Source) error + func EmitTurnStart(store *sessions.Store, sel Selection, source Source, supportedSet []string) (effortToSend string, dropped bool, err error) + func ParseSelection(raw any) (*Selection, *ShapeError) + func RecoverActiveSelection(ctx Context) (*Selection, RecoveryOutcome, error) + func ResolveRequestEffort(sel Selection, supportedSet []string) (effortToSend, configuredEffort string, dropped bool) + func SumModelResponseTokens(records []sessions.Record) (inputTokens, outputTokens int64) + func UsageFromStreamUsage(u openai.CompletionUsage, usageValid bool) (inputTokens, outputTokens int64, cached *int64, anomalies []string) + func WriteActive(projectRoot string, sel Selection) (targetPath string, created bool, reason config.PersistReason, ...) + func WriteLastUsed(home string, sel Selection) (targetPath string, reason config.PersistReason, errCat fserrors.Category, ...) + type ActiveState struct + func NewActiveState(sel *Selection, source Source) *ActiveState + func (s *ActiveState) ApplyResumeSwitch(sel *Selection, source Source) + func (s *ActiveState) ApplyUserSelection(sel Selection, degraded bool) + func (s *ActiveState) CarryForward() + func (s *ActiveState) Current() (sel Selection, source Source, ok bool) + type Category string + const CategoryEffortInvalid + const CategoryEffortNotAdvertised + const CategoryMissingField + const CategoryModelNotAllowed + const CategoryNotObject + const CategoryProviderUnknown + const CategoryWrongType + type Context struct + Config *config.Cache + GlobalSettingsPath string + Providers []ProviderDiagnostic + Resume bool + ResumeRecords []sessions.Record + Store *sessions.Store + Warn io.Writer + type NoSelectableModelError struct + Lines []string + func (e *NoSelectableModelError) Error() string + type PickerResult struct + Degraded bool + func PersistPickerSelection(ctx context.Context, store *sessions.Store, ui tui.NoticeRenderer, ...) (PickerResult, error) + type ProviderDiagnostic struct + Models []string + ModelsSourcePath string + Name string + type RecoveryOutcome int + const RecoveryClean + const RecoveryFailed + const RecoveryNoModelTurn + type Selection struct + Effort string + ID string + Provider string + type ShapeError struct + Category Category + Field string + Value string + func Validate(sel *Selection, composedConfig *config.Cache) *ShapeError + func (e *ShapeError) Error() string + type Source string + const SourceGlobalFallback + const SourcePicker + const SourcePickerDegraded + const SourceProject + const SourceResume + type UsageAccumulator struct + func (a *UsageAccumulator) Add(u openai.CompletionUsage, usageValid bool) + func (a *UsageAccumulator) Totals() (inputTokens, outputTokens int64, cached *int64, cachedPartial bool, ...) + func (a *UsageAccumulator) UsageRounds() int