Scaffold LogicSRC and CommandBoard plugins

This commit is contained in:
Anthony Ettinger 2026-06-06 11:24:02 +00:00
parent 59927e140c
commit 5c9ea821f6
67 changed files with 5958 additions and 0 deletions

View file

@ -0,0 +1,33 @@
import { describe, expect, it } from "vitest";
import { createPluginRegistry } from "./index.js";
import type { PluginDefinition } from "./types.js";
const examplePlugin: PluginDefinition = {
manifest: {
id: "example",
name: "Example",
version: "1.0.0",
type: ["testing"],
default: false,
capabilities: ["tests.run"],
commands: ["test"],
env: ["EXAMPLE_TOKEN"]
}
};
describe("PluginRegistry", () => {
it("indexes enabled plugins by capability", () => {
const registry = createPluginRegistry([examplePlugin]);
expect(registry.byCapability("tests.run")).toHaveLength(1);
expect(registry.snapshot().capabilities["tests.run"]).toEqual(["example"]);
});
it("honors disabled config", () => {
const registry = createPluginRegistry([examplePlugin], {
example: { enabled: false }
});
expect(registry.enabled()).toHaveLength(0);
});
});