Files
openclaw/scripts/lib/deprecated-plugin-sdk-usage.mts
T
Peter Steinberger dceb2c343c refactor: retire due compat-ledger surfaces (context-engine host params, deactivate alias, logging internals) (#121845)
* refactor(plugins): retire deactivate hook alias

* refactor(plugin-sdk): prune retired facade exports

* test(logging): isolate logger test controls

* refactor(logging): internalize file transport controls

* test(plugin-sdk): preserve retired facade coverage

* test(auto-reply): remove stale diagnostic imports

* refactor(logging): delete dead config-read guard

shouldSkipMutatingLoggingConfigRead had no production caller even on main;
it survived the dead-export scan only via logger's testApi re-export. The
test-isolation commit removed that mask, exposing the fossil. Delete the
guard, its test-only re-export, its mock entry, and its dedicated test file.

* refactor(plugin-sdk): retire due compatibility subpaths

* test(plugin-sdk): type group policy predicates

* refactor(plugin-sdk): split removed subpath records

* refactor(secrets): remove retired collector barrel

* test(plugin-sdk): tighten wildcard surface pin

* refactor(plugin-sdk): retire matrix facade metadata

* style(plugin-sdk): format facade metadata

* fix(ci): load channel setup contracts from source

Repair the main-owned regression from 99d662473c (Peter Steinberger): the new env-contract test could consume stale ignored dist metadata instead of the checked-in plugin declaration.

* test(plugin-sdk): refresh API baseline after rebase
2026-08-12 12:41:27 -07:00

55 lines
2.2 KiB
TypeScript

// Builds the list of deprecated public plugin SDK specifiers guarded by scripts.
import deprecatedPublicPluginSdkSubpaths from "./plugin-sdk-deprecated-public-subpaths.json" with { type: "json" };
const DEPRECATED_PLUGIN_SDK_EXTRA_SPECIFIERS: string[] = [];
type BannedInternalPluginSdkFacadeModule = {
modulePath: string;
canonical: string;
allowedImporters?: string[];
};
/** Build fully qualified deprecated plugin SDK module specifiers from subpath metadata. */
export function buildDeprecatedPluginSdkModuleSpecifiers(
deprecatedSubpaths: string[] = deprecatedPublicPluginSdkSubpaths,
) {
const unscoped = [
...DEPRECATED_PLUGIN_SDK_EXTRA_SPECIFIERS,
...deprecatedSubpaths.map((subpath) => `openclaw/plugin-sdk/${subpath}`),
];
// tsconfig aliases the scoped @openclaw/plugin-sdk package to the same
// src/plugin-sdk modules, so ban both spellings of every deprecated specifier.
return [...new Set(unscoped.flatMap((specifier) => [specifier, `@${specifier}`]))].toSorted(
(a, b) => a.localeCompare(b),
);
}
/**
* Deprecated facade modules that stay exported for third-party plugins until the
* documented break train, but must have zero internal importers (src/**,
* extensions/**) via package specifier or relative path. Table-driven and
* additive: future facade collapses (e.g. config-schema) append rows here.
* `modulePath` is the extension-less repo path; `allowedImporters` lists the
* compat re-export chain that keeps the public subpath alive.
*/
export const BANNED_INTERNAL_PLUGIN_SDK_FACADE_MODULES: BannedInternalPluginSdkFacadeModule[] = [
// Reply facades: canonical seams are openclaw/plugin-sdk/channel-inbound and
// openclaw/plugin-sdk/channel-outbound (defineChannelMessageAdapter family).
{
modulePath: "src/plugin-sdk/channel-message",
canonical: "openclaw/plugin-sdk/channel-outbound",
},
{
modulePath: "src/plugin-sdk/channel-reply-pipeline",
canonical: "openclaw/plugin-sdk/channel-outbound",
},
{
modulePath: "src/plugin-sdk/inbound-reply-dispatch",
canonical: "openclaw/plugin-sdk/channel-inbound",
},
{
modulePath: "src/plugin-sdk/inbound-envelope",
canonical: "openclaw/plugin-sdk/channel-inbound",
},
];