/** * Brand constants for easy rebranding if domain availability requires it. * All naming throughout the codebase should reference these constants. */ export const BRAND = { /** Display name (e.g., "Fragments") */ name: "Fragments", /** Lowercase name for file paths and CLI (e.g., "fragments") */ nameLower: "fragments", /** File extension for fragment definition files — V2 canonical format */ fileExtension: ".contract.json", /** Legacy file extension for segments (still supported for migration) */ legacyFileExtension: ".segment.tsx", /** JSON file extension for compiled output */ jsonExtension: ".fragment.json", /** Default output file name (e.g., "fragments.json") */ outFile: "fragments.json", /** Config file name (e.g., "fragments.config.ts") */ configFile: "fragments.config.ts", /** Legacy config file name (still supported for migration) */ legacyConfigFile: "segments.config.ts", /** CLI command name (e.g., "fragments") */ cliCommand: "fragments", /** Package scope (e.g., "@fragments") */ packageScope: "@fragments", /** Directory for storing fragments, registry, and cache */ dataDir: ".fragments", /** Components subdirectory within .fragments/ */ componentsDir: "components", /** Registry file name */ registryFile: "registry.json", /** Default compiler governance report path */ governanceFile: ".fragments/governance.json", /** Context file name (AI-ready markdown) */ contextFile: "context.md", /** Screenshots subdirectory */ screenshotsDir: "screenshots", /** Cache subdirectory (gitignored) */ cacheDir: "cache", /** Diff output subdirectory (gitignored) */ diffDir: "diff", /** Manifest filename */ manifestFile: "manifest.json", /** Prefix for localStorage keys (e.g., "fragments-") */ storagePrefix: "fragments-", /** Static viewer HTML file name */ viewerHtmlFile: "fragments-viewer.html", /** MCP tool name prefix (e.g., "fragments_") */ mcpToolPrefix: "fragments_", /** File extension for block definition files */ blockFileExtension: ".block.ts", /** @deprecated Use blockFileExtension instead */ recipeFileExtension: ".recipe.ts", /** Vite plugin namespace */ vitePluginNamespace: "fragments-core-shim", } as const; export type Brand = typeof BRAND; /** * Default configuration values for the service. * These can be overridden in fragments.config.ts */ export const DEFAULTS = { /** Default viewport dimensions */ viewport: { width: 1280, height: 800, }, /** Default diff threshold (percentage) */ diffThreshold: 5, /** Browser pool size */ poolSize: 3, /** Idle timeout before browser shutdown (ms) - 5 minutes */ idleTimeoutMs: 5 * 60 * 1000, /** Delay after render before capture (ms) */ captureDelayMs: 100, /** Font loading timeout (ms) */ fontTimeoutMs: 3000, /** Default theme */ theme: "light" as const, /** Dev server port */ port: 6006, } as const; export type Defaults = typeof DEFAULTS;