plugin-sdk: add channel subpaths and migrate bundled plugins

This commit is contained in:
Gustavo Madeira Santana
2026-03-03 22:07:03 -05:00
parent 1c200ca7ae
commit 1278ee9248
75 changed files with 808 additions and 174 deletions

View File

@@ -41,6 +41,18 @@ const exportedNames = exportMatch[1]
const exportSet = new Set(exportedNames);
const requiredSubpathEntries = [
"core",
"telegram",
"discord",
"slack",
"signal",
"imessage",
"whatsapp",
"line",
"account-id",
];
// Critical functions that channel extension plugins import from openclaw/plugin-sdk.
// If any of these are missing, plugins will fail at runtime with:
// TypeError: (0 , _pluginSdk.<name>) is not a function
@@ -76,10 +88,25 @@ for (const name of requiredExports) {
}
}
for (const entry of requiredSubpathEntries) {
const jsPath = resolve(__dirname, "..", "dist", "plugin-sdk", `${entry}.js`);
const dtsPath = resolve(__dirname, "..", "dist", "plugin-sdk", `${entry}.d.ts`);
if (!existsSync(jsPath)) {
console.error(`MISSING SUBPATH JS: dist/plugin-sdk/${entry}.js`);
missing += 1;
}
if (!existsSync(dtsPath)) {
console.error(`MISSING SUBPATH DTS: dist/plugin-sdk/${entry}.d.ts`);
missing += 1;
}
}
if (missing > 0) {
console.error(`\nERROR: ${missing} required export(s) missing from dist/plugin-sdk/index.js.`);
console.error(
`\nERROR: ${missing} required plugin-sdk artifact(s) missing (named exports or subpath files).`,
);
console.error("This will break channel extension plugins at runtime.");
console.error("Check src/plugin-sdk/index.ts and rebuild.");
console.error("Check src/plugin-sdk/index.ts, subpath entries, and rebuild.");
process.exit(1);
}