Skip to main content

Module repo

Module repo 

Source
Expand description

Repo-config phase of outrig init, plus the bootstrap fallback used by outrig image add when run in an uninitialized repo.

Two public entry points share one private writer:

  • ensure is what outrig init calls: idempotent: write the config if missing, log + skip if present.
  • resolve_or_bootstrap is what outrig image add calls before dispatching: walk up to find an existing .agents/outrig/config.toml, and on NoRepoConfig prompt the user to bootstrap one against cwd.

Constants§

DOC_SYNC_FIELDS
Slice of every Field declared in this module, for prompt_doc_sync.rs.

Functions§

ensure
Idempotent. Returns Some(image_name) when this call wrote the repo config (the user named an image during the bootstrap), or None when the file already existed and was left alone. Callers thread the name into the subsequent image_setup::add::run_with so the image-name prompt doesn’t fire twice.
resolve_or_bootstrap
Resolve the repo root for outrig image add. Walks up via [find_repo_root_from]; on OutrigError::NoRepoConfig prompts the user, and on yes bootstraps the repo config against cwd and returns cwd. On no, re-raises NoRepoConfig so the exit code and error string match the previous behavior for scripts that test the unconfigured case. Returns the resolved repo root paired with Some(image_name) when this call ran the bootstrap (the user named an image) or None when an existing config was found by walking up.