/** * Customization bundle — a self-contained, portable snapshot of a user's * built-in prompt + skill overrides, for sharing between botmux installs. * * Unlike skill "packs" (which are just name references and need the target to * already have those skills), a bundle INLINES everything: full prompt-override * strings per locale, full SKILL.md bodies, and disable flags. A bundle JSON is * therefore portable on its own — the recipient imports it with no dependency * on the author's environment. * * Export reads the live {@link customization-store} state + skill bodies. * Import validates the bundle, computes a human-readable diff against current * state (for a confirm-before-apply preview), and — only on confirmation — * calls {@link replaceState} to materialise it. */ import type { Locale } from '../i18n/types.js'; import { type CustomizationState } from '../services/customization-store.js'; export declare const BUNDLE_KIND = "botmux-customization-bundle"; export declare const BUNDLE_SCHEMA_VERSION: 1; export interface CustomizationBundle { schemaVersion: 1; kind: typeof BUNDLE_KIND; /** Optional author-supplied name / note (metadata only). */ name?: string; createdAt?: string; /** Prompt-key overrides per locale (inlined full strings). */ promptOverrides?: Partial>>; /** Conditional-line forced values. */ conditionalLines?: Record; /** Built-in skill overrides — each carries the FULL body inline (not a ref). */ builtinSkills?: Record; } export interface BundleDiffEntry { kind: 'prompt' | 'conditional' | 'skill'; /** i18n key or skill name. */ id: string; locale?: Locale; /** What the import would do to this item vs current state. */ action: 'add' | 'replace' | 'unchanged' | 'disable'; /** Short before/after preview for the confirm UI. */ before?: string; after?: string; } export interface BundleImportPreview { bundle: CustomizationBundle; diff: BundleDiffEntry[]; /** Aggregate counts for a quick summary line. */ summary: { adds: number; replaces: number; disables: number; unchanged: number; }; } /** Build a portable bundle from the current on-disk customization state. * Skill bodies are inlined by reading their .md files. */ export declare function exportBundle(opts?: { name?: string; createdAt?: string; }): CustomizationBundle; export declare class BundleError extends Error { } /** Parse + validate raw JSON text into a CustomizationBundle. Throws * BundleError with a human message on any structural problem. */ export declare function parseBundle(rawJson: string): CustomizationBundle; /** Compute the diff a bundle import would produce against current state. Pure — * reads current state but writes nothing. */ export declare function previewBundleImport(bundle: CustomizationBundle): BundleImportPreview; /** * Apply a validated bundle by REPLACING the current customization content with * it (snapshotting first, so it's reversible). Returns the resulting state. * * "Replace" (not merge) is deliberate for P0: it makes import deterministic and * the diff preview honest — what you see is exactly the resulting state. A merge * mode can be layered on later if requested. */ export declare function applyBundle(bundle: CustomizationBundle, label?: string): CustomizationState; /** Serialize a bundle to pretty JSON (with a trailing newline) for file output. */ export declare function serializeBundle(bundle: CustomizationBundle): string; //# sourceMappingURL=customization-bundle.d.ts.map