From 6e8f93cab385d5dc83bc846a1b6974c19431ba64 Mon Sep 17 00:00:00 2001 From: Agent Date: Sun, 11 Oct 2026 00:54:36 +0000 Subject: [PATCH] v1.0.2: share brand icons with sibling plugins (window.__dshModelBrands) --- client.js | 5 +++++ client.src.js | 5 +++++ package.json | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/client.js b/client.js index d32bd1c..6854f62 100644 --- a/client.js +++ b/client.js @@ -750,6 +750,11 @@ window.__ModuleLoader__.load({ inject: ['slots', 'locale', 'sessions', 'remote', 'remote.session', 'modelDirectories'], apply(ctx) { ctx.effect(() => ctx.locale.register(NS, { en, zh }), 'model-selector-plus: dictionaries'); + // Share brand icons with sibling plugins (e.g. omp-advisor's picker) without duplicating SVGs. + ctx.effect(() => { + window.__dshModelBrands = { brandOf, BrandIcon }; + return () => { if (window.__dshModelBrands?.brandOf === brandOf) delete window.__dshModelBrands; }; + }, 'model-selector-plus: brand icons'); // Priority -1 shadows the stock occupant (lowest priority renders). ctx.slots.inject('conversation.input.model', () => ctx.slots.register({ name: 'conversation.input.model', diff --git a/client.src.js b/client.src.js index dc1c17f..56eaf03 100644 --- a/client.src.js +++ b/client.src.js @@ -750,6 +750,11 @@ window.__ModuleLoader__.load({ inject: ['slots', 'locale', 'sessions', 'remote', 'remote.session', 'modelDirectories'], apply(ctx) { ctx.effect(() => ctx.locale.register(NS, { en, zh }), 'model-selector-plus: dictionaries'); + // Share brand icons with sibling plugins (e.g. omp-advisor's picker) without duplicating SVGs. + ctx.effect(() => { + window.__dshModelBrands = { brandOf, BrandIcon }; + return () => { if (window.__dshModelBrands?.brandOf === brandOf) delete window.__dshModelBrands; }; + }, 'model-selector-plus: brand icons'); // Priority -1 shadows the stock occupant (lowest priority renders). ctx.slots.inject('conversation.input.model', () => ctx.slots.register({ name: 'conversation.input.model', diff --git a/package.json b/package.json index 4c7a343..d16b0fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@local/model-selector-plus", - "version": "1.0.1", + "version": "1.0.2", "private": true, "type": "module", "exports": { ".": "./index.js", "./client": "./client.js" },