Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Settings: give the Skills library a switch on Features

erywimb0dc175c142e
diff --git a/src/components/settings/SettingsWindow.test.ts b/src/components/settings/SettingsWindow.test.ts
index 28e2941948..49e25821fc 100644
--- a/src/components/settings/SettingsWindow.test.ts
+++ b/src/components/settings/SettingsWindow.test.ts
@@ -317,6 +317,23 @@ describe("Settings → Features", () => {
expect(featureSwitches()).toEqual({ skillBurger: true, threadTabs: false, suggestedReplies: false });
});
+ it("shows the Skills library switch, off until turned on, and saves it on", async () => {
+ const { api } = await import("@/state/store");
+ fixture.config = { features: { skillBurger: true, threadTabs: false, skillsLibrary: false } };
+ const html = render("features");
+ expect(html).toContain("Skills library");
+ expect(html).toContain("browse, import and assign skills");
+ expect(featureSwitches()).toEqual({ skillBurger: true, threadTabs: false, skillsLibrary: false });
+ fixture.switches.find((props) => (props as { "data-feature-switch"?: string })["data-feature-switch"] === "skillsLibrary")!.onClick!({} as never);
+ expect(api).toHaveBeenCalledWith("/api/config", { method: "PATCH", body: JSON.stringify({ features: { skillsLibrary: true } }) });
+ fixture.config = { features: { skillBurger: true, threadTabs: false, skillsLibrary: true } };
+ render("features");
+ expect(featureSwitches()).toEqual({ skillBurger: true, threadTabs: false, skillsLibrary: true });
+ expect(render("bots"), "the switch reveals the Skills section it gates").toContain('data-settings-block="skills"');
+ fixture.config = { features: { skillBurger: true, threadTabs: false, skillsLibrary: false } };
+ expect(render("bots")).not.toContain('data-settings-block="skills"');
+ });
+
it("shows no Board switch on a Team Cloud, even from an older server that still reports one", () => {
fixture.config = { cloudHome: true, team: { name: "Acme" }, features: { skillBurger: true, threadTabs: false, teamBoard: false } };
expect(render("features")).not.toContain("Board");
diff --git a/src/components/settings/pages/FeaturesPage.tsx b/src/components/settings/pages/FeaturesPage.tsx
index 26e73f370f..6622f66293 100644
--- a/src/components/settings/pages/FeaturesPage.tsx
+++ b/src/components/settings/pages/FeaturesPage.tsx
@@ -10,6 +10,7 @@ const COPY: Record<Feature, { title: LocaleKey; line: LocaleKey }> = {
skillBurger: { title: "settings.features.skillBurger", line: "settings.features.skillBurgerLine" },
threadTabs: { title: "settings.features.threadTabs", line: "settings.features.threadTabsLine" },
suggestedReplies: { title: "settings.features.suggestedReplies", line: "settings.features.suggestedRepliesLine" },
+ skillsLibrary: { title: "settings.features.skillsLibrary", line: "settings.features.skillsLibraryLine" },
};
/** One switch kept in this place's config.json; shown once its server says it knows the switch. */
@@ -49,6 +50,7 @@ export function FeaturesPage() {
<FeatureRow name="skillBurger" />
<FeatureRow name="threadTabs" />
<FeatureRow name="suggestedReplies" />
+ <FeatureRow name="skillsLibrary" />
</SettingsRows>
</SettingsGroup>
);
diff --git a/src/lib/use-feature.ts b/src/lib/use-feature.ts
index 04acfdfcfd..baa3986d8e 100644
--- a/src/lib/use-feature.ts
+++ b/src/lib/use-feature.ts
@@ -1,14 +1,15 @@
-import { skillBurgerEnabled, suggestedRepliesEnabled, threadTabsEnabled } from "@/lib/feature-flags";
+import { skillBurgerEnabled, skillsLibraryEnabled, suggestedRepliesEnabled, threadTabsEnabled } from "@/lib/feature-flags";
import type { ConfigStatus } from "@/state/store";
import { useStoreSelector } from "@/state/store-select";
/** Switches on Settings → Features, kept in the place's config.json (`features.<name>`), so its server reads them too. */
-export type Feature = "skillBurger" | "threadTabs" | "suggestedReplies";
+export type Feature = "skillBurger" | "threadTabs" | "suggestedReplies" | "skillsLibrary";
const FEATURES: Record<Feature, (config: ConfigStatus | null | undefined) => boolean> = {
skillBurger: skillBurgerEnabled,
threadTabs: threadTabsEnabled,
suggestedReplies: suggestedRepliesEnabled,
+ skillsLibrary: skillsLibraryEnabled,
};
/** Whether a switch on Settings → Features is on. */
diff --git a/src/locales/en.json b/src/locales/en.json
index cf38252006..54f51a8b86 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -12196,6 +12196,8 @@
"settings.features.threadTabsLine": "Show a bot's threads as tabs above the chat",
"settings.features.suggestedReplies": "Suggested replies",
"settings.features.suggestedRepliesLine": "After a bot replies, suggest what you might say next. The bot's own AI writes it with its smallest model, which uses a little of your plan or API credit.",
+ "settings.features.skillsLibrary": "Skills library",
+ "settings.features.skillsLibraryLine": "Show the Skills section in Settings, where you can browse, import and assign skills to bots",
"composer.placeholder.newThread": "Start a thread in {name}",
"room.feed.aria": "Threads in {name}",
"room.feed.replyOne": "1 reply",
diff --git a/src/locales/pt-br.json b/src/locales/pt-br.json
index 0dd3959498..ca1cfd02a3 100644
--- a/src/locales/pt-br.json
+++ b/src/locales/pt-br.json
@@ -12196,6 +12196,8 @@
"settings.features.threadTabsLine": "Mostra as conversas de um bot como abas acima do chat",
"settings.features.suggestedReplies": "Respostas sugeridas",
"settings.features.suggestedRepliesLine": "Depois que um bot responde, sugere o que você pode dizer em seguida. A própria IA do bot escreve com o menor modelo dela, o que usa um pouco do seu plano ou crédito de API.",
+ "settings.features.skillsLibrary": "Biblioteca de habilidades",
+ "settings.features.skillsLibraryLine": "Mostra a seção Habilidades nas Configurações, onde você pode consultar, importar e atribuir habilidades aos bots",
"composer.placeholder.newThread": "Comece uma conversa em {name}",
"room.feed.aria": "Conversas em {name}",
"room.feed.replyOne": "1 resposta",