fix: auto-select plugin slots on enable/install (#1181) (thanks @sebslight)
This commit is contained in:
parent
3d922437e4
commit
156a43e29b
@ -7,6 +7,9 @@ Docs: https://docs.clawd.bot
|
|||||||
### Changes
|
### Changes
|
||||||
- Dependencies: update core + plugin deps (grammy, vitest, openai, Microsoft agents hosting, etc.).
|
- Dependencies: update core + plugin deps (grammy, vitest, openai, Microsoft agents hosting, etc.).
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
- Plugins: auto-select exclusive slots when enabling/installing plugins. (#1181) — thanks @sebslight.
|
||||||
|
|
||||||
## 2026.1.18-4
|
## 2026.1.18-4
|
||||||
|
|
||||||
### Changes
|
### Changes
|
||||||
|
|||||||
@ -47,7 +47,7 @@ export function applyExclusiveSlotSelection(params: {
|
|||||||
const pluginsConfig = params.config.plugins ?? {};
|
const pluginsConfig = params.config.plugins ?? {};
|
||||||
const prevSlot = pluginsConfig.slots?.[slotKey];
|
const prevSlot = pluginsConfig.slots?.[slotKey];
|
||||||
const slots = {
|
const slots = {
|
||||||
...(pluginsConfig.slots ?? {}),
|
...pluginsConfig.slots,
|
||||||
[slotKey]: params.selectedId,
|
[slotKey]: params.selectedId,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ export function applyExclusiveSlotSelection(params: {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const entries = { ...(pluginsConfig.entries ?? {}) };
|
const entries = { ...pluginsConfig.entries };
|
||||||
const disabledIds: string[] = [];
|
const disabledIds: string[] = [];
|
||||||
if (params.registry) {
|
if (params.registry) {
|
||||||
for (const plugin of params.registry.plugins) {
|
for (const plugin of params.registry.plugins) {
|
||||||
@ -67,7 +67,7 @@ export function applyExclusiveSlotSelection(params: {
|
|||||||
const entry = entries[plugin.id];
|
const entry = entries[plugin.id];
|
||||||
if (!entry || entry.enabled !== false) {
|
if (!entry || entry.enabled !== false) {
|
||||||
entries[plugin.id] = {
|
entries[plugin.id] = {
|
||||||
...(entry ?? {}),
|
...entry,
|
||||||
enabled: false,
|
enabled: false,
|
||||||
};
|
};
|
||||||
disabledIds.push(plugin.id);
|
disabledIds.push(plugin.id);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user