Skip to content

resolveIdentityProfileConfigPath

resolveIdentityProfileConfigPath(identityProfile, options?): string | undefined

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/config/loader.ts:387

STRICT existence check for an EXPLICITLY-named identity profile: does .gsloth/.gsloth-settings/<identityProfile>/<config> resolve to a real config file anywhere in the same up-tree search findProjectConfigPath walks? Returns the resolved profile config path (nearest dir, then format precedence) when the profile has its OWN config, undefined otherwise.

Unlike findProjectConfigPath, it matches ONLY the profile-specific path — it NEVER falls through to a plain <dir>/<config> and NEVER falls back to the global config. That strictness is the whole point: it lets a caller distinguish “this named profile really exists” from “a bare config happens to be present / a global config exists,” a distinction the loader’s fall-through deliberately blurs.

PURE PREDICATE — never throws, never calls exit, so it can be asked the question without committing to an outcome. initConfig uses it to enforce that an explicitly-named profile really exists (raising a catchable ConfigDiscoveryError when it does not), and callers that want to CLASSIFY rather than fail — BATCH-12’s identity matrix checks every declared identity up front so one message can name them all — ask it directly. A blank/whitespace-only name counts as “no profile” → undefined.

string

The explicitly-requested identity profile name.

CFG-56 — globalOnly searches ~/.gsloth/.gsloth-settings/<name>/ INSTEAD of the up-tree project walk, for a --global run.

boolean

string | undefined

The resolved profile config path, or undefined when the profile has no config.