import { type Locale } from '../i18n/types.js'; /** One overridden built-in skill: a replacement body, and/or a disable flag. * `body === undefined` + `disabled` = keep shipped body but never inject it. * `body` set = inject this instead of the shipped SKILL.md. */ export interface BuiltinSkillOverride { /** Full replacement SKILL.md (frontmatter + body). Omitted = use shipped body. */ body?: string; /** When true the skill is not injected at all (catalog + files both skip it). */ disabled?: boolean; /** ISO timestamp of the last edit to this entry (for history diffs / UI). */ updatedAt?: string; } /** The full current customization state. Everything is optional so an empty * object is the valid "no customization" baseline. */ export interface CustomizationState { schemaVersion: 1; /** Master switch. `false` = all overrides ignored (byte-identical baseline) * but retained on disk. Missing is treated as enabled (see {@link customizationEnabled}). */ enabled?: boolean; /** Prompt-key overrides, keyed by locale then i18n key. A value replaces the * shipped `t(key)` string for that locale. */ promptOverrides?: Partial>>; /** Conditional prompt lines forced on/off by the i18n key that renders them * (e.g. `ai.routing.no_visible_output_ok`). Absent = follow the shipped * gating logic; present = force that boolean regardless. */ conditionalLines?: Record; /** Built-in skill overrides keyed by skill name (e.g. `botmux-send`). */ builtinSkills?: Record; /** Last-modified ISO timestamp of the state as a whole. */ updatedAt?: string; } /** Metadata for one point-in-time snapshot in the history log. */ export interface CustomizationSnapshot { id: string; /** ISO time the snapshot was taken (i.e. when the *prior* state was captured). */ at: string; /** Short human label describing the mutation that triggered this snapshot, * e.g. "set ai.routing.intro (zh)" / "reset all to factory" / "import bundle". */ label: string; /** Coarse counts of the snapshotted state, for a quick history-list summary. */ summary: { promptKeys: number; skills: number; enabled: boolean; }; } /** Per-skill body cap — mirrors the spirit of role-resolver's MAX_ROLE_BYTES. */ export declare const MAX_SKILL_BODY_BYTES: number; /** Per prompt-override value cap. Individual fragments are short; this is a * generous ceiling that still stops a paste-bomb from bloating every prompt. */ export declare const MAX_PROMPT_OVERRIDE_BYTES: number; export declare function customizationsRoot(): string; /** Read the current state (short-TTL cached). Never throws — a missing or * corrupt file yields the empty baseline. */ export declare function readCustomizationState(): CustomizationState; export declare function invalidateCustomizationCache(): void; /** Whether customizations are active. Missing flag = enabled (opt-out master * switch); an explicit `false` disables everything. The resolution layer also * consults this so a single check short-circuits all override lookups. */ export declare function customizationEnabled(): boolean; export declare function listSnapshots(): CustomizationSnapshot[]; /** Read the full state stored in a snapshot (for diff preview before rollback). */ export declare function readSnapshotState(id: string): CustomizationState | undefined; /** Read a skill body as it existed in a snapshot (mirrors {@link readSkillOverrideBody}). */ export declare function readSnapshotSkillBody(id: string, name: string): string | undefined; /** Read the override SKILL.md body for a built-in skill, or undefined if none. * Reads the .md file when the state entry has a body; the state's `body` field * is a presence marker, the file is the source of truth for large text. */ export declare function readSkillOverrideBody(name: string): string | undefined; /** Set (or clear) the master enabled flag. */ export declare function setCustomizationEnabled(enabled: boolean): CustomizationState; /** Override (value set) or clear (value === null) a single prompt key for a locale. */ export declare function setPromptOverride(locale: Locale, key: string, value: string | null): CustomizationState; /** Force a conditional prompt line on/off, or clear the override (follow shipped gating). */ export declare function setConditionalLine(key: string, value: boolean | null): CustomizationState; /** Set (body != null) or clear (body === null) the override body for a built-in skill. * Clearing removes the body but leaves any `disabled` flag intact. */ export declare function setSkillOverrideBody(name: string, body: string | null): CustomizationState; /** Enable/disable injection of a built-in skill (independent of any body override). */ export declare function setSkillDisabled(name: string, disabled: boolean): CustomizationState; /** Reset EVERYTHING to factory: clears all overrides + skill bodies. Snapshots * first, so this is fully reversible via rollback. Keeps the master enabled * flag (resetting content is orthogonal to the on/off switch). */ export declare function resetAllToFactory(): CustomizationState; /** Roll the current state back to a snapshot's contents. Non-destructive: the * pre-rollback state is snapshotted first, so a rollback can itself be undone * by rolling forward to that new snapshot. */ export declare function rollbackToSnapshot(id: string): CustomizationState; /** Replace the entire state atomically (used by bundle import after diff * confirmation). Snapshots first. `skillBodies` maps skill name → SKILL.md so * the .md files are materialised alongside the state pointers. */ export declare function replaceState(next: CustomizationState, skillBodies: Record, label: string): CustomizationState; //# sourceMappingURL=customization-store.d.ts.map