test(qa): cover Plugin SDK import topology (#118878)

This commit is contained in:
Vincent Koc
2026-08-04 03:33:52 +08:00
committed by GitHub
parent bbb41289c2
commit dd656d973d
2 changed files with 28 additions and 8 deletions
@@ -6,9 +6,15 @@ scenario:
category: plugins.authoring-and-packaging-plugins
coverage:
primary:
- plugins.root-sdk-entrypoint
- plugins.focused-sdk-imports
- plugins.entrypoint-discovery
objective: Verify plugin authors can discover public SDK entrypoints and support status from the maintained catalog and documentation.
- plugins.migration-shims
objective: Verify plugin authors can discover and import the supported root, focused, and migration Plugin SDK entrypoints.
successCriteria:
- The supported top-level contract resolves through `openclaw/plugin-sdk/core`.
- Focused Plugin SDK subpaths resolve through their published package exports.
- Deprecated public subpaths remain importable while plugin authors migrate.
- Every public SDK catalog entry has a published package export.
- Private-local SDK entries stay out of published package exports.
- Deprecated entries remain public while their support status is maintained separately.
@@ -25,4 +31,4 @@ scenario:
execution:
kind: vitest
path: src/plugins/contracts/plugin-sdk-subpaths.test.ts
summary: Run the public SDK catalog, package export, and documentation classification contract.
summary: Run the Plugin SDK import topology, package export, and documentation classification contract.
@@ -1363,8 +1363,17 @@ describe("plugin-sdk subpath exports", () => {
>();
});
it("keeps runtime entry subpaths importable", async () => {
it("keeps the supported root SDK contract importable through core", async () => {
const coreSdk = await importResolvedPluginSdkSubpath("openclaw/plugin-sdk/core");
expect(coreSdk.definePluginEntry).toBe(coreDirectSdk.definePluginEntry);
expect(coreSdk.optionalStringEnum).toBe(coreDirectSdk.optionalStringEnum);
expect(coreSdk.prepareMemorySystemPromptAddition).toBe(
coreDirectSdk.prepareMemorySystemPromptAddition,
);
});
it("keeps focused SDK subpaths importable", async () => {
const channelActionsSdk = await importResolvedPluginSdkSubpath(
"openclaw/plugin-sdk/channel-actions",
);
@@ -1383,11 +1392,7 @@ describe("plugin-sdk subpath exports", () => {
representativeModules.push(await importResolvedPluginSdkSubpath(`openclaw/plugin-sdk/${id}`));
}
expect(coreSdk.definePluginEntry).toBe(pluginEntrySdk.definePluginEntry);
expect(coreSdk.optionalStringEnum).toBe(coreDirectSdk.optionalStringEnum);
expect(coreSdk.prepareMemorySystemPromptAddition).toBe(
coreDirectSdk.prepareMemorySystemPromptAddition,
);
expect(pluginEntrySdk.definePluginEntry).toBe(coreDirectSdk.definePluginEntry);
expect(channelActionsSdk.optionalStringEnum).toBe(channelActionsDirectSdk.optionalStringEnum);
expect(channelActionsSdk.stringEnum).toBe(channelActionsDirectSdk.stringEnum);
expectSourceMentions("error-runtime", [
@@ -1453,6 +1458,15 @@ describe("plugin-sdk subpath exports", () => {
}
});
it("keeps deprecated public SDK shims importable during migrations", async () => {
expect(deprecatedPublicPluginSdkEntrypoints.length).toBeGreaterThan(0);
for (const subpath of deprecatedPublicPluginSdkEntrypoints) {
const mod = await importResolvedPluginSdkSubpath(`openclaw/plugin-sdk/${subpath}`);
expect(typeof mod, `deprecated subpath ${subpath} should resolve`).toBe("object");
}
});
it("keeps repeated silent-token semantics visible through the reply-chunking subpath", async () => {
const replyChunkingSdk = await importResolvedPluginSdkSubpath(
"openclaw/plugin-sdk/reply-chunking",