feat(core): jobs, scheduler, plugin registry, connections

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas Winther
2026-10-30 20:39:17 +01:00
co-authored by Claude Sonnet 5.5
parent 207c92bb4d
commit 166b8ecb5e
20 changed files with 744 additions and 10 deletions
+24
View File
@@ -0,0 +1,24 @@
import { expect, spyOn, test } from "bun:test";
import { join } from "node:path";
import { loadPlugins } from "../src/registry.ts";
const dir = join(import.meta.dir, "fixtures/plugins");
test("registry loads echo plugin and skips broken one", async () => {
const warn = spyOn(console, "warn").mockImplementation(() => {});
const reg = await loadPlugins([dir, join(dir, "does-not-exist")]);
expect(reg.list().map((m) => m.id)).toEqual(["echo"]);
expect(reg.get("echo")?.manifest.name).toBe("Echo");
expect(reg.get("broken")).toBeUndefined();
expect(warn.mock.calls.some((c) => String(c[0]).includes("broken"))).toBe(true);
await reg.reload();
expect(reg.list()).toHaveLength(1);
warn.mockRestore();
});
test("duplicate ids across dirs keep the first", async () => {
const warn = spyOn(console, "warn").mockImplementation(() => {});
const reg = await loadPlugins([dir, dir]);
expect(reg.list()).toHaveLength(1);
warn.mockRestore();
});