fix(coding-agent): share theme across package scopes

closes #4333
This commit is contained in:
Mario Zechner
2026-05-10 18:12:40 +02:00
parent f6b6b1f052
commit f8d0fa67dc
2 changed files with 3 additions and 0 deletions

View File

@@ -658,6 +658,7 @@ function getDefaultTheme(): string {
// Use globalThis to share theme across module loaders (tsx + jiti in dev mode)
const THEME_KEY = Symbol.for("@earendil-works/pi-coding-agent:theme");
const THEME_KEY_OLD = Symbol.for("@mariozechner/pi-coding-agent:theme");
// Export theme as a getter that reads from globalThis
// This ensures all module instances (tsx, jiti) see the same theme
@@ -671,6 +672,7 @@ export const theme: Theme = new Proxy({} as Theme, {
function setGlobalTheme(t: Theme): void {
(globalThis as Record<symbol, Theme>)[THEME_KEY] = t;
(globalThis as Record<symbol, Theme>)[THEME_KEY_OLD] = t;
}
let currentThemeName: string | undefined;