Files
AgentCompany/tests/unit/builtin-skills-bundle.test.ts
T
ZacharyZhang-NY eaaf36f859 Language-aware house style and a resizable chat split
House style now follows the app language: Chinese UI forces the new
bundled humanizer-zh skill into every run, English forces humanizer -
one variant per run, picked by preference with cross-language fallback
so an older catalogue never silently loses house style. Both variants
are protected from grant/revoke, list_skills labels each with its
language, the bundle guard requires both, and startup sync imports the
new skill into existing orgs on next launch. Covered by a unit test
that flips app_state.language and asserts which humanizer compiles.

The chat split is now adjustable: drag the conversation list's right
edge (200-480px, persisted in localStorage) and the composer textarea
grew a native vertical resize grip capped at 40vh.
2026-07-09 01:14:05 -04:00

28 lines
1.2 KiB
TypeScript

import { mkdtempSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { join, resolve } from "node:path";
import { describe, expect, test } from "vitest";
import { stageBuiltinSkillsLibrary } from "../../src/main/services/builtin-skills";
/**
* The real bundled catalogue must stage cleanly: every skill gets a unique
* slug, the forced humanizer skill exists, and category files carry the
* descriptions agents browse. A broken bundle should fail CI, not first
* launch.
*/
describe("bundled skill catalogue", () => {
test("the repo bundle stages with unique slugs and the forced humanizer", () => {
const libraryRoot = mkdtempSync(join(tmpdir(), "ac-bundle-check-"));
try {
const staged = stageBuiltinSkillsLibrary(resolve(process.cwd(), "built-in skills"), libraryRoot);
expect(staged.length).toBeGreaterThan(200);
expect(staged.some((unit) => unit.slug === "humanizer")).toBe(true);
expect(staged.some((unit) => unit.slug === "humanizer-zh")).toBe(true);
const withDescription = staged.filter((unit) => unit.manifest.description).length;
expect(withDescription / staged.length).toBeGreaterThan(0.9);
} finally {
rmSync(libraryRoot, { recursive: true, force: true });
}
});
});