mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-23 10:55:31 -06:00
ebb2770000
* refactor: eliminate export name collisions * chore(scripts): burn resolved collision baselines * refactor: narrow legacy session load options * chore: refresh SDK and session debt baselines * refactor: adopt upstream secrets collision fix * test(plugin-sdk): mock renamed session store core * fix(scripts): track renamed session accessor core
41 lines
1.3 KiB
TypeScript
41 lines
1.3 KiB
TypeScript
// Manual facade. Keep loader boundary explicit.
|
|
import { loadBundledPluginPublicSurfaceModuleSyncCore } from "./facade-loader.js";
|
|
|
|
type FacadeModule = {
|
|
isQaLabCliAvailable: () => boolean;
|
|
registerQaLabCli: (program: unknown) => void;
|
|
};
|
|
|
|
function loadFacadeModule(): FacadeModule {
|
|
return loadBundledPluginPublicSurfaceModuleSyncCore<FacadeModule>({
|
|
dirName: "qa-lab",
|
|
artifactBasename: "cli.js",
|
|
});
|
|
}
|
|
|
|
function isMissingQaLabFacadeError(err: unknown): boolean {
|
|
if (!(err instanceof Error)) {
|
|
return false;
|
|
}
|
|
return (
|
|
err.message === "Unable to resolve bundled plugin public surface qa-lab/cli.js" ||
|
|
err.message.startsWith("Unable to open bundled plugin public surface ")
|
|
);
|
|
}
|
|
|
|
/** Register QA Lab CLI commands when the bundled QA Lab facade is present. */
|
|
export const registerQaLabCli: FacadeModule["registerQaLabCli"] = ((...args) =>
|
|
loadFacadeModule().registerQaLabCli(...args)) as FacadeModule["registerQaLabCli"];
|
|
|
|
/** Returns whether the QA Lab CLI facade can be loaded in this package build. */
|
|
export const isQaLabCliAvailable: FacadeModule["isQaLabCliAvailable"] = (() => {
|
|
try {
|
|
return loadFacadeModule().isQaLabCliAvailable();
|
|
} catch (err) {
|
|
if (isMissingQaLabFacadeError(err)) {
|
|
return false;
|
|
}
|
|
throw err;
|
|
}
|
|
}) as FacadeModule["isQaLabCliAvailable"];
|