Something went wrong. Try again.
Shared settings UI and config loader for pi extensions
Something went wrong. Try again.
941 B · 29 lines
TypeScript
at main
123456789101112131415161718192021222324252627282930import { getSettingsListTheme, type Theme,} from "@earendil-works/pi-coding-agent";import type { SettingsListTheme } from "@earendil-works/pi-tui";
/** * Combined settings theme that supports both: * - Settings list styling helpers (label/value/description/cursor/hint) * - Full UI theme methods (fg/bg/bold/italic/...) */export type SettingsTheme = SettingsListTheme & Theme;
/** * Build a settings theme that is safe to pass to components expecting * either SettingsListTheme or full Theme. */export function getSettingsTheme(theme: Theme): SettingsTheme { const settingsListTheme = getSettingsListTheme(); const combined = Object.create(theme) as SettingsTheme;
combined.label = settingsListTheme.label; combined.value = settingsListTheme.value; combined.description = settingsListTheme.description; combined.cursor = settingsListTheme.cursor; combined.hint = settingsListTheme.hint;
return combined;}