Versions in this module Expand all Collapse all v0 v0.4.5 Oct 16, 2026 Changes in this version + const EnvDevDebug + const EnvShellToolHint + var ErrFirstRunFailed = errors.New("bootstrap: first-run generation failed") + var ErrHeadlessExperiment = errors.New("bootstrap: invalid headless experiment binding") + var ErrModelNotInCatalog = errors.New("bootstrap: --model selection is not in the run's model catalog") + var ErrModelPickerRequired = errors.New("bootstrap: no model determined for a headless run; pass --model") + var ErrResumeListPreflight = errors.New("resume list preflight failed") + var ErrSessionWriteOnExit = errors.New("bootstrap: session write on exit failed") + func EnsureFirstRunDirs(home string) (failedPath string, cat fserrors.Category, err error) + func FirstRunDirs(home string) []string + func GeneratedSettingsBytes() []byte + func MaterializeBuiltinTemplates(home string) (failedPath string, cat fserrors.Category, err error) + func PrintFirstRunMessage(w io.Writer, settingsPath string) + func PrintSettingsToReview(w io.Writer) + func RunEnsureFirstRunDirs(home string, stderr io.Writer) int + func RunMaterializeBuiltinTemplates(home string, stderr io.Writer) int + func RunScaffoldGlobalCodemeldignore(home string, stderr io.Writer) int + func RunWriteSettings(home string, stdout, stderr io.Writer) int + func ScaffoldProjectCodemeldignore(projectRoot string, stderr io.Writer) error + func SettingsPath(home string) string + func StartTUI(ctx context.Context, result *BootstrapResult, stdout io.Writer) (retErr error) + func VCSTemplateDir(home string) string + func VCSTemplatePath(home, name string) string + func WriteFirstRunSettings(home string) (path string, step fsutil.AtomicWriteStep, cat fserrors.Category, err error) + type ActiveVCS struct + RepoRoot string + Template *vcs.Template + TrustedExplicitClasses bool + type BootstrapResult struct + AgentInstructions []agentinstr.LoadEntry + BackgroundPrune bool + Config map[string]any + ConfigLayerPaths []string + Home string + LaunchDir string + Mode any + Model any + ModelPickerRequired bool + ProjectRoot string + ResumeLockRelease func() + ResumeReplay bool + Session *sessions.Store + SettingsLayers []securitystate.LayerSnapshot + ToolRegistry any + TrustDecision trust.Decision + VCSTemplate any + WithheldInputs []WithheldInput + func RunFresh(ctx context.Context, cwd string, steps FreshSteps) (*BootstrapResult, error) + func RunResumePicker(ctx context.Context, cwd string, steps ResumeSteps) (*BootstrapResult, error) + func RunResumeWithID(ctx context.Context, cwd, id string, steps ResumeSteps) (*BootstrapResult, error) + type ConfigComposition struct + Config map[string]any + LocalLayer map[string]any + LocalPresent bool + ProjectLayer map[string]any + ProjectPresent bool + type DeniedCall struct + Reason string + Source string + Subject string + func RunHeadless(ctx context.Context, cwd string, steps FreshSteps, driver *HeadlessDriver) ([]DeniedCall, error) + func (d DeniedCall) DeclaredScope() bool + type FreshSteps struct + AcquireLock func(sessionPath, id string) (release func(), err error) + AppendLaunchBegan func(ctx context.Context, session *sessions.Store) error + BuildToolRegistry func(active any) (registry any, err error) + ComposeConfig func(global map[string]any, projectRoot string) (composition ConfigComposition, err error) + DetectVCS func(cwd string, composed map[string]any, templates any) (active any, err error) + DetermineModel func(composed, global map[string]any, projectRoot string, layerPaths []string) (selection any, pickerRequired bool, err error) + EnsureFreshSession func(home, projectRoot string) (session *sessions.Store, err error) + FlushSessionTitle func(ctx context.Context, session *sessions.Store) + GateTrust func(home, projectRoot, launchDir string) trust.Decision + InitMode func(ctx context.Context, session *sessions.Store, composed map[string]any, ...) (modeState any, err error) + LoadAgentInstructions func(ctx context.Context, session *sessions.Store, home, launchDir string, ...) ([]agentinstr.LoadEntry, error) + LoadGlobalSettings func(home string) (global map[string]any, err error) + LoadVCSTemplates func(home, projectRoot string, projectLayer map[string]any, approved bool) (templates any, err error) + RecoverJournals func(home, projectRoot string) + ResolveHome func() (home string, err error) + ResolveProjectRoot func(cwd string, global map[string]any) (projectRoot string, projectLayers []string, err error) + RunFirstRun func(home string) (ran bool, err error) + ScaffoldProjectIgnore func(projectRoot string) error + StartTUI func(ctx context.Context, result *BootstrapResult) error + ValidatePreferredVCS func(composed map[string]any, templates any) error + func DefaultFreshSteps(stdout, stderr io.Writer) FreshSteps + func HeadlessFreshSteps(stderr io.Writer, modelOverride *model.Selection, modeKey string) FreshSteps + type HeadlessDriver struct + func NewHeadlessDriver(prompt string, stdout, stderr io.Writer) *HeadlessDriver + func (d *HeadlessDriver) DeclaredFileScopes() (write, remove []string) + func (d *HeadlessDriver) DeniedSubjects() []DeniedCall + func (d *HeadlessDriver) DevDebugRequested() bool + func (d *HeadlessDriver) EnableDevDebug() + func (d *HeadlessDriver) EnableExperiment(exp HeadlessExperiment) error + func (d *HeadlessDriver) EnablePromptForApproval(stdin io.Reader) + func (d *HeadlessDriver) PromptForApprovalEnabled() bool + func (d *HeadlessDriver) Run(ctx context.Context, result *BootstrapResult) (retErr error) + func (d *HeadlessDriver) SessionTitle() string + func (d *HeadlessDriver) SetDeclaredFileScopes(write, remove []string) + func (d *HeadlessDriver) SetSessionTitle(title string) + func (d *HeadlessDriver) SetTimeLimit(deadline time.Time, limit time.Duration) + func (d *HeadlessDriver) TimeLimit() (deadline time.Time, limit time.Duration) + type HeadlessExperiment struct + DenyCall func(call turn.AssembledToolCall) (reason string, deny bool) + ExtraTools []HeadlessExtraTool + type HeadlessExtraTool struct + Definition provider.ToolDefinition + Handle func(ctx context.Context, arguments string) (turn.ToolResult, error) + type HomeResolveError struct + Err error + func (e *HomeResolveError) Error() string + func (e *HomeResolveError) Unwrap() error + type PromptDisplay struct + Action string + Body string + Boundary string + DirectHTTPFallback bool + ExceptionalAuthority string + FolderCoverage string + FolderSettingsPath string + GrantStoredSubject string + HostRequest string + LaunchDir string + OutOfRootFileWrite bool + OutOfRootReadScope bool + Pipeline string + ProjectRoot string + ProjectUntrusted bool + RequestedTarget string + Subject string + WholeCommand bool + WouldCreateSettingsFile bool + type PromptGateBuilder struct + func NewPromptGateBuilder(app *tui.App) *PromptGateBuilder + func (b *PromptGateBuilder) Build(req permissions.MatchRequest, display PromptDisplay) ... + type ProviderCatalogRefresher struct + func NewProviderCatalogRefresher(cache *config.Cache) *ProviderCatalogRefresher + func (r *ProviderCatalogRefresher) Refresh(providerID string, force bool, onComplete func(RefreshResult)) + type RefreshOutcome int + const RefreshCredentialUnavailable + const RefreshFailed + const RefreshRefused + const RefreshSkippedFresh + const RefreshUpdated + func (o RefreshOutcome) String() string + type RefreshResult struct + Outcome RefreshOutcome + ProviderID string + type ResumeSteps struct + AcquireLock func(sessionPath, id string) (release func(), err error) + AppendLaunchBegan func(ctx context.Context, store *sessions.Store) error + BuildToolRegistry func(active any) (registry any, err error) + ComposeConfig func(global map[string]any, projectRoot string) (composition ConfigComposition, err error) + DetectVCS func(cwd string, composed map[string]any, templates any) (active any, err error) + DetermineModel func(composed, global map[string]any, projectRoot string, layerPaths []string, ...) (selection any, pickerRequired bool, err error) + GateTrust func(home, projectRoot, launchDir string) trust.Decision + InitMode func(ctx context.Context, store *sessions.Store, composed map[string]any, ...) (modeState any, err error) + ListAndSelect func(home, cwd string, global map[string]any) (id string, picked bool, err error) + LoadAgentInstructions func(ctx context.Context, store *sessions.Store, home, launchDir string, ...) ([]agentinstr.LoadEntry, error) + LoadGlobalSettings func(home string) (global map[string]any, err error) + LoadVCSTemplates func(home, projectRoot string, projectLayer map[string]any, approved bool) (templates any, err error) + RecoverJournals func(home, projectRoot string) + RefreshUpdatedAt func(ctx context.Context, store *sessions.Store) error + ResolveHome func() (home string, err error) + ResolveProjectRoot func(cwd string, global map[string]any) (projectRoot string, projectLayers []string, err error) + ResolveResume func(id, cwd, home string) (sessionPath string, sess *sessions.Session, err error) + RunFirstRun func(home string) (ran bool, err error) + ScaffoldProjectIgnore func(projectRoot string) error + StartTUI func(ctx context.Context, result *BootstrapResult) error + ValidatePreferredVCS func(composed map[string]any, templates any) error + func DefaultResumeSteps(stdin io.Reader, stdout, stderr io.Writer) ResumeSteps + type WithheldCategory string + const WithheldSettings + const WithheldVCSTemplates + type WithheldInput struct + Category WithheldCategory + Path string