mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
c70aee247e
* refactor(scripts): migrate JavaScript tools to TypeScript * fix(ci): keep changed-scope preflight zero-install * fix(ci): preserve zero-install script owners * fix(ci): complete script migration follow-through * fix(release): keep stable closeout zero-install * fix(scripts): preserve standalone execution boundaries * fix(scripts): repair standalone loader boundaries * fix(scripts): normalize gateway observation ids * fix(scripts): keep Docker packager standalone * test(scripts): preserve rebase cleanup helpers * test(sessions): use tracked temp directory
45 lines
1.5 KiB
TypeScript
45 lines
1.5 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { resolvePluginSurface } from "../../scripts/lib/plugin-inventory-doc.mts";
|
|
|
|
describe("resolvePluginSurface", () => {
|
|
it("keeps manifest identifiers as inline code while leaving labels visible", () => {
|
|
expect(
|
|
resolvePluginSurface({
|
|
id: "example",
|
|
channels: ["discord"],
|
|
providers: ["openai"],
|
|
contracts: {
|
|
webSearchProviders: {},
|
|
tools: {},
|
|
},
|
|
dashboard: {
|
|
dataBindings: [{ id: "items.list" }],
|
|
actionVerbs: [{ id: "refresh" }],
|
|
},
|
|
skills: ["example"],
|
|
}),
|
|
).toBe(
|
|
"channels: `discord`; providers: `openai`; contracts: `tools`, `webSearchProviders`; dashboard data bindings: `example.items.list`; dashboard action verbs: `example.refresh`; skills",
|
|
);
|
|
});
|
|
|
|
it("retains the generic fallback", () => {
|
|
expect(resolvePluginSurface({})).toBe("plugin");
|
|
});
|
|
|
|
it("escapes dashboard plugin owner delimiters and literal escape markers", () => {
|
|
expect(
|
|
resolvePluginSurface({
|
|
id: "dashboard.segmented",
|
|
dashboard: { actionVerbs: [{ id: "refresh" }] },
|
|
}),
|
|
).toBe("dashboard action verbs: `dashboard%2Esegmented.refresh`");
|
|
expect(
|
|
resolvePluginSurface({
|
|
id: "dashboard%2Esegmented",
|
|
dashboard: { dataBindings: [{ id: "refresh" }] },
|
|
}),
|
|
).toBe("dashboard data bindings: `dashboard%252Esegmented.refresh`");
|
|
});
|
|
});
|