Files
openclaw/scripts/lib/deprecated-plugin-sdk-usage.mjs
Peter SteinbergerandGitHub c7e7ac2728 refactor: remove expired plugin compatibility surfaces (#111451)
* docs(secrets): remove retired web credential paths

* refactor(web): remove retired provider compatibility paths

* refactor(providers): delete retired compatibility routes

* refactor(secrets): remove retired credential aliases

* refactor(plugin-sdk): delete retired compatibility surfaces

* docs(plugin-sdk): remove retired migration guidance

* chore(plugin-sdk): refresh rebased surface budgets

* chore(plugin-sdk): refresh API removal baseline

* refactor(compat): migrate retired internal callers

* chore(plugin-sdk): refresh current-main baselines

* test(config): migrate plugin-owned secret assertions

* test(gateway): narrow plugin secret refs

* fix(plugin-sdk): preserve private boundary type identity

* chore(compat): remove stale sweep references

* chore(lint): lower max-lines budget

* refactor(secrets): remove unused web helper

* build(plugin-sdk): drop removed compat entries

* chore(plugin-sdk): refresh rebased API baseline

* chore(plugin-sdk): use Linux API baseline hash

* fix(plugin-sdk): preserve private bundled build entries

* fix(plugin-sdk): package private runtime facades

* fix(plugins): preserve external credential contracts
2026-07-19 11:04:48 -07:00

59 lines
2.4 KiB
JavaScript

// 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 = [];
/** Build fully qualified deprecated plugin SDK module specifiers from subpath metadata. */
export function buildDeprecatedPluginSdkModuleSpecifiers(
deprecatedSubpaths = 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 = [
// 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",
},
// Shared dispatch bridge backing the facades above; only the SDK seams may
// consume it directly so channel code stays on channel-inbound/channel-outbound.
{
modulePath: "src/channels/message/inbound-reply-dispatch",
canonical: "openclaw/plugin-sdk/channel-inbound",
allowedImporters: [
"src/plugin-sdk/channel-inbound.ts",
"src/plugin-sdk/inbound-reply-dispatch.ts",
],
},
];