import type { RawGthConfig } from '#src/config/types.js'; /** * A profile name maps to a single directory segment under `.gsloth-settings/`, so it must be one * safe path component: letters, digits, `.`, `_`, `-` only, and never `.`/`..` (which would escape * or self-reference the settings dir). This is a create-time guard so a traversal-shaped name * (`../evil`, `a/b`) can never write outside the profile tree. */ export declare const PROFILE_NAME_RE: RegExp; /** Fallback provider/model for a scaffold seeded from neither a current config nor `--model`. */ export declare const DEFAULT_SCAFFOLD_PROVIDER = "anthropic"; export declare const DEFAULT_SCAFFOLD_MODEL = "claude-sonnet-4-5"; /** * Reject a profile name that is empty, `.`/`..`, or contains anything other than * `[A-Za-z0-9._-]` (so it can never traverse out of `.gsloth-settings/`). Throws a clear error; * returns the trimmed name on success. */ export declare function validateProfileName(nameRaw: string): string; /** * The on-disk path a named profile's config is written to / discovered at: * `/.gsloth/.gsloth-settings//.gsloth.config.json`. Resolved against * {@link @gaunt-sloth/core!utils/systemUtils.getProjectDir | getProjectDir} so it matches the loader's read-side resolution. */ export declare function resolveProfileConfigPath(name: string): string; /** * Options for seeding a scaffold. `seedType`/`seedModel` come from the current effective config * (`modelProviderType` / `modelDisplayName`) when one resolves — present for JSON configs, absent * for module (JS/MJS/TS) configs, which hand back an already-built LLM with no raw `type`. When * neither seed nor {@link modelOverride} is available the scaffold falls back to the template * defaults ({@link DEFAULT_SCAFFOLD_PROVIDER} / {@link DEFAULT_SCAFFOLD_MODEL}) so the written * profile is always a valid, editable starting point. */ export interface ProfileScaffoldSeed { /** Provider `type` of the current config (`modelProviderType`), when resolvable. */ seedType?: string; /** Model id of the current config (`modelDisplayName`), when resolvable. */ seedModel?: string; /** `--model ` override — wins over the seeded/template model. */ modelOverride?: string; } /** * Build a complete, standalone raw profile config: `{ llm: { type, model } }`. The provider `type` * comes from the current config's provider when known, else the template default; the model comes * from `--model`, else the current config's model, else the template default. Shape-only — the * caller validates it against the schema before writing. */ export declare function buildProfileScaffold(seed: ProfileScaffoldSeed): RawGthConfig; /** Outcome of {@link createNamedProfile}: the resolved path the profile config was written to. */ export interface CreateProfileResult { /** Absolute path of the written profile config. */ path: string; /** The provider:model the scaffold was seeded with, for a confirmation message. */ llm: { type: string; model: string; }; } /** * Scaffold a new named profile at {@link resolveProfileConfigPath}. Validates the name (no * traversal), builds the scaffold ({@link buildProfileScaffold}), validates it against the GS2-1 * schema BEFORE writing (never writes an invalid profile), and refuses to clobber an existing * profile unless `force`. Creates the `.gsloth/.gsloth-settings//` tree as needed so the * loader's profile-discovery convention resolves it afterwards. * * @throws Error on an invalid name, an invalid scaffold, or an existing file without `force`. */ export declare function createNamedProfile(nameRaw: string, seed: ProfileScaffoldSeed & { force?: boolean; }): CreateProfileResult;