mirror of
https://github.com/openclaw/openclaw.git
synced 2026-10-03 17:53:39 +00:00
Let plugin themes declare bounded, self-contained SVG assets for avatar hats and composer visitors. Capture artwork with each plugin generation, expose content-hashed authenticated resource URLs, and rasterize images lazily in the Control UI. Personal imports remain limited to built-in artwork IDs. Package declared assets through the shared filesystem boundary while keeping manifest declarations usable by native build and updater tooling. Preserve existing pointer interactions, loaded-photo hats, palette notifications, and transcript invalidation. Document validation and reload behavior. Validation: focused protocol, manifest, Gateway, UI, packaging, native updater, and extracted PR tooling tests; core/UI/scripts and affected test typechecks; protocol generators, style lint, dead-code checks, assertion and line-cap ratchets, formatting, docs links, and scoped-clean P1 review. Inspected synthetic before/after captures are attached to the PR. Startup budget files remain unchanged at 370300 B baseline and 370876 B enforcement.
23 lines
760 B
TypeScript
23 lines
760 B
TypeScript
import { normalizeManifestThemes } from "../../src/plugins/manifest-themes.ts";
|
|
|
|
/** Packaging consumes the same declared paths as manifest discovery. */
|
|
export function collectPluginThemeAssetPaths(manifest: Record<string, unknown>): string[] {
|
|
if (typeof manifest.id !== "string") {
|
|
return [];
|
|
}
|
|
const normalized = normalizeManifestThemes(manifest.themes, manifest.id);
|
|
if (!normalized.ok) {
|
|
return [];
|
|
}
|
|
const paths = new Set<string>();
|
|
for (const theme of normalized.themes ?? []) {
|
|
paths.add(theme.source);
|
|
for (const source of Object.values(theme.hats ?? {})) {
|
|
paths.add(source);
|
|
}
|
|
for (const critter of Object.values(theme.critters ?? {})) {
|
|
paths.add(critter.source);
|
|
}
|
|
}
|
|
return [...paths];
|
|
}
|