Central barrel export for the `utils` package, aggregating and re-exporting all utility functions, constants, and types from across the library to provide a single stable import surface for consumers. ## Key Components ### Formatting Utilities - **`formatDate`, `formatNumber`, `formatPrice`, `formatBytes`** — Core number/currency/byte/date formatters (`./format`) - **`formatLargeNumber`, `formatCurrency`, `formatPercent`, `formatDurationMMSS`**, and many more — Extended formatter suite covering metrics, trends, durations, and text - **`formatRelativeTime`, `formatAbsoluteDate`, `formatDateTime`** — Date/time helpers from `./date-utils` ### Color & Styling - **`getPlatformAccentColor`, `getCurrentPlatform`** — Platform-aware accent color resolution - **`getReadableTextColor`, `hexToRgb`, `deriveHoverColor`, `deriveActiveColor`** — Design-system color math utilities - **`cn`** — Class name utility (client-side only) ### Platform & Domain - **`getPlatformProductionUrl`, `getAllPlatformBaseDomains`** — Platform domain SSOT re-exported from `../platform-domains` - **`getPlatformLogo`** — Platform icon component resolver ### Navigation & Scroll - **`scrollElementIntoView`** — Smooth scroll with sticky-chrome offset compensation - **`navigateSamePageHash`, `normalizeHashFragment`** — Same-page hash navigation with `pushState` and synthetic `hashchange` ### Embed Auth - **`embedAuthedFetch`, `setEmbedAuthAdapter`** — Generic embed surface authentication - **`getEmbedProxyAuth`, `setEmbedProxyAuth`, `applyProxyAuth`** — Proxy auth storage (cookie SSOT) ### Chat Utilities (Server-Safe Re-exports) - **`escapeMarkdownInline`, `buildChatAttachmentViewUrl`** — Chat attachment markdown helpers - **`getSourceIconName`, `getSourceLabel`** — Source icons/labels, safe for server-side hub callers - **`readLeadingDecisionFrame`** — SSE leading-frame reader for `confirm-tool` route ### Icon & Media - **`getDynamicIcon`, `ICON_REGISTRY`, `getIconComponent`** — Dynamic icon registry - **`PLAY_ICON_PATH`** — SVG path constant (server-safe) ### SEO & Content - **`SEO_TITLE_MAX_LENGTH`, `SEO_DESCRIPTION_MAX_LENGTH`** — Character budget constants - **`buildListUrl`, `canonicalContentRefType`** — List-API URL builder - **`faqSectionSlug`, `faqItemAnchor`, `parseFaqHash`** — FAQ anchor SSOTs ### Miscellaneous - **`delay`, `generateRandomString`, `truncateString`, `deepClone`** — Common utilities - **`getProxiedImageUrl`, `shouldProxyImage`, `generateImageSizes`** — Image proxy builder - **`DEV_SECTION_PARAM_KEYS`, `devSectionAnchorId`** — Dev-center URL param keys - **`fetchPriorityProp`** — React 18/19 compatible `fetchpriority` prop builder ## Usage Example ```typescript // Import from the unified utils barrel import { cn, formatDate, formatCurrency, getPlatformAccentColor, scrollElementIntoView, embedAuthedFetch, SEO_TITLE_MAX_LENGTH, buildListUrl, } from '@flamingo-stack/openframe-oss-lib/utils' // Formatting const price = formatCurrency(1999, 'USD') // "$19.99" const date = formatDate(new Date(), 'short') // Color utilities const accent = getPlatformAccentColor('flamingo') // Scroll scrollElementIntoView(document.getElementById('section'), { offset: 64 }) // Embed auth const response = await embedAuthedFetch('/api/data') // SEO guard if (title.length > SEO_TITLE_MAX_LENGTH) { console.warn('Title exceeds SEO budget') } // List URL builder const url = buildListUrl('ticket', ['id-1', 'id-2'], '/content') ``` ## Notes - **Server-safe vs. client-only**: `cn` and canvas-based utilities (e.g., `color-analysis`) are client-only. Most other exports are isomorphic/server-safe. - **SSOT pattern**: Several exports are re-exports from canonical locations (e.g., `../platform-domains`, `./format`) to preserve backward compatibility without duplicating logic. - **Deprecated aliases**: Chat-prefixed auth symbols (`chat-authed-fetch`, `chat-proxy-auth-storage`) are kept as `@deprecated` re-exports in their original locations; use the `embed*` equivalents from this barrel going forward. **Source:** [`src/utils/index.ts`](https://github.com/flamingo-stack/openframe-oss-lib/blob/main/src/utils/index.ts)