/** * On-disk preset format version. Doubles as a format discriminator: a file * whose `botmuxPreset` !== PRESET_VERSION is rejected by `loadPreset`. Bump * only on a breaking change to the shape below. */ export declare const PRESET_VERSION = 1; /** * A secret-free, shareable bot preset. Field order here matches the serialized * JSON (see `buildPreset`): marker first, identity-free config in the middle, * human guide last. */ export interface AgentPreset { /** Format marker + version. Always equal to {@link PRESET_VERSION}. */ botmuxPreset: number; /** CLI adapter id the source bot uses (e.g. 'claude-code', 'aiden'). */ cliId: string; /** Model override, if the source bot set one. */ model?: string; /** Team-level role markdown (the persona injected into the CLI). */ teamRole?: string; /** One-line capability label used in the collaboration roster. */ capability?: string; /** Human-facing name of the source bot — for display / default filename. */ sourceName?: string; /** Chinese guide telling the *receiving* agent how to apply this preset. */ guide: string; } /** * Input accepted by {@link buildPreset}. The named fields are the allow-list; * the index signature exists so callers can pass a full bot config (which also * carries secrets like larkAppSecret) without a type error — those extra keys * are simply never read. */ export interface BuildPresetInput { cliId: string; model?: string | null; teamRole?: string | null; capability?: string | null; sourceName?: string | null; /** Tolerate (and ignore) any extra fields, e.g. a full bot config's secrets. */ [extra: string]: unknown; } /** * Guide embedded in every exported preset, addressed to the AI agent that will * apply it on the receiving side. Kept in the file so it travels with the data. */ export declare const PRESET_GUIDE: string; /** * Build a preset by copying an explicit allow-list of fields. Never spreads * `input`, so any secret-bearing extra keys on it are dropped by construction. * Empty / null / undefined optional fields are omitted entirely. */ export declare function buildPreset(input: BuildPresetInput): AgentPreset; /** Serialize a preset to pretty JSON with a trailing newline (POSIX-friendly). */ export declare function serializePreset(preset: AgentPreset): string; /** * Slugify a string into a safe filename component: keep Unicode letters / digits * / `_` / `.` / `-`, replace every other run with a single `-`, then trim * leading/trailing separators. Returns '' if nothing usable remains (e.g. the * input was only spaces or slashes). CJK names are preserved (they're \p{L}). */ export declare function slugifyForFilename(raw: string): string; /** * Derive the default preset filename (no directory). Prefers the bot's human * name, falls back to its larkAppId, and ALWAYS slugifies so the path stays * valid/stable even when `name` carries spaces, slashes, etc. Never uses the * `botmux-` process name. Final 'bot' fallback guards the degenerate case * where both name and appId slug to empty. */ export declare function presetFilename(sourceName: string | undefined, appId: string): string; /** * Parse + validate a preset JSON string. Throws a friendly error on malformed * JSON or on a wrong/missing version (kept for tests and future "preset apply" * tooling). Unknown extra keys are stripped, so a future minor extension stays * readable by older code as long as the version still matches. */ export declare function loadPreset(raw: string): AgentPreset; //# sourceMappingURL=agent-preset.d.ts.map