feat: load machine-scoped remote plugins

This commit is contained in:
Federico Jaramillo Martinez
2026-06-05 09:29:48 +02:00
parent 9c3dafc4d4
commit b9be7de206
13 changed files with 466 additions and 24 deletions
+15
View File
@@ -0,0 +1,15 @@
import { describe, expect, it } from "vitest";
import { machineScopedPluginId, parseMachineScopedPluginId } from "./machinePluginIds";
describe("machine-scoped plugin ids", () => {
it("encodes machine ids into valid plugin ids and decodes them", () => {
const scoped = machineScopedPluginId("550e8400-e29b-41d4-a716-446655440000", "project-tools");
expect(scoped).toMatch(/^machine\.[0-9a-f]+\.project-tools$/u);
expect(parseMachineScopedPluginId(scoped)).toEqual({ machineId: "550e8400-e29b-41d4-a716-446655440000", pluginId: "project-tools" });
});
it("leaves normal plugin ids unparsed", () => {
expect(parseMachineScopedPluginId("project-tools")).toBeUndefined();
});
});