plugin-sdk: expose compaction delegate through compat

This commit is contained in:
Josh Lehman
2026-03-17 12:59:49 -07:00
parent 3c404e82b6
commit 63277cfb2b
2 changed files with 15 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ if (shouldWarnCompatImport) {
export { emptyPluginConfigSchema } from "../plugins/config-schema.js";
export { resolveControlCommandGate } from "../channels/command-gating.js";
export { delegateCompactionToRuntime } from "../context-engine/delegate.js";
export { createAccountStatusSink } from "./channel-lifecycle.js";
export { createPluginRuntimeStore } from "./runtime-store.js";

View File

@@ -127,6 +127,20 @@ describe("plugin-sdk root alias", () => {
expect(Object.getOwnPropertyDescriptor(lazyRootSdk, "slowHelper")).toBeDefined();
});
it("forwards delegateCompactionToRuntime through the compat-backed root alias", () => {
const delegateCompactionToRuntime = () => "delegated";
const lazyModule = loadRootAliasWithStubs({
monolithicExports: {
delegateCompactionToRuntime,
},
});
const lazyRootSdk = lazyModule.moduleExports;
expect(typeof lazyRootSdk.delegateCompactionToRuntime).toBe("function");
expect(lazyRootSdk.delegateCompactionToRuntime).toBe(delegateCompactionToRuntime);
expect("delegateCompactionToRuntime" in lazyRootSdk).toBe(true);
});
it("loads legacy root exports through the merged root wrapper", { timeout: 240_000 }, () => {
expect(typeof rootSdk.resolveControlCommandGate).toBe("function");
expect(typeof rootSdk.default).toBe("object");