The packaging script didn't copy turn-manager.ts to dist, causing 'Cannot find module ./turn-manager.js' at gateway startup.
16 lines
513 B
JavaScript
16 lines
513 B
JavaScript
import fs from "node:fs";
|
|
import path from "node:path";
|
|
|
|
const root = process.cwd();
|
|
const pluginDir = path.join(root, "plugin");
|
|
const outDir = path.join(root, "dist", "whispergate");
|
|
|
|
fs.rmSync(outDir, { recursive: true, force: true });
|
|
fs.mkdirSync(outDir, { recursive: true });
|
|
|
|
for (const f of ["index.ts", "rules.ts", "turn-manager.ts", "openclaw.plugin.json", "README.md", "package.json"]) {
|
|
fs.copyFileSync(path.join(pluginDir, f), path.join(outDir, f));
|
|
}
|
|
|
|
console.log(`packaged plugin to ${outDir}`);
|