fix(custom-widgets): restore bundled authoring

This commit is contained in:
Thomas Camlong committed 2026-07-20 16:48:00 +02:00
1 parent c39ddc4285
commit 4c69ad90df
16 files changed
+180 -58

No files matched your search

@@ -1,9 +1,26 @@
import { describe, expect, test } from "vitest";
import { buildCustomWidgetAiPrompt, buildCustomWidgetFixPrompt, buildCustomWidgetMcpPrompt } from "../core/ai-prompt";
import { CUSTOM_WIDGET_SKILL_MD } from "../core/authoring-resources";
import { CUSTOM_WIDGET_STARTER } from "../core/examples";
describe("buildCustomWidgetAiPrompt", () => {
test("can embed the portable skill for standalone chat models", () => {
const prompt = buildCustomWidgetAiPrompt(
undefined,
undefined,
undefined,
"Create a status widget",
undefined,
CUSTOM_WIDGET_SKILL_MD,
);
expect(prompt).toContain("Use this embedded Homarr Custom Widget skill while authoring:");
expect(prompt).toContain("# Homarr Custom Widget");
expect(prompt).toContain("installed Mantine components can differ by Homarr release.");
expect(prompt.length).toBeLessThanOrEqual(8_000);
});
test("is concise and describes the one-widget v2 contract", () => {
const prompt = buildCustomWidgetAiPrompt(
undefined,
@@ -17,7 +17,7 @@ describe("custom widget Agent Skill", () => {
test("publishes repository-based skills.sh installation metadata", () => {
const skill = getCustomWidgetSkill();
expect(skill.skillsShUrl).toBe("https://www.skills.sh/homarr-labs/homarr/homarr-custom-widget");
expect(skill.sourceUrl).toContain("github.com/homarr-labs/homarr/tree/v2/.agents/skills/homarr-custom-widget");
expect(skill.sourceUrl).toBe("https://github.com/homarr-labs/homarr/tree/dev/.agents/skills/homarr-custom-widget");
expect(skill.installCommand).toBe(
"npx skills add https://github.com/homarr-labs/homarr --skill homarr-custom-widget",
);