diff --git a/scripts/install-dirigent-openclaw.mjs b/scripts/install-dirigent-openclaw.mjs index 2623702..2e09207 100755 --- a/scripts/install-dirigent-openclaw.mjs +++ b/scripts/install-dirigent-openclaw.mjs @@ -22,11 +22,26 @@ const __dirname = path.dirname(new URL(import.meta.url).pathname); // Ensure dist/dirigent exists (handles git clone without npm prepare) const DIST_DIR = path.resolve(__dirname, "..", "dist", "dirigent"); const PLUGIN_SRC_DIR = path.resolve(__dirname, "..", "plugin"); -if (mode === "install" && !fs.existsSync(DIST_DIR)) { - console.log("[dirigent] dist/ not found, syncing from plugin/..."); - fs.mkdirSync(DIST_DIR, { recursive: true }); - for (const f of fs.readdirSync(PLUGIN_SRC_DIR)) { - fs.copyFileSync(path.join(PLUGIN_SRC_DIR, f), path.join(DIST_DIR, f)); +const NO_REPLY_API_SRC_DIR = path.resolve(__dirname, "..", "no-reply-api"); +const NO_REPLY_API_DIST_DIR = path.resolve(__dirname, "..", "dist", "no-reply-api"); + +if (mode === "install") { + // Copy plugin files to dist/dirigent + if (!fs.existsSync(DIST_DIR)) { + console.log("[dirigent] dist/dirigent/ not found, syncing from plugin/..."); + fs.mkdirSync(DIST_DIR, { recursive: true }); + for (const f of fs.readdirSync(PLUGIN_SRC_DIR)) { + fs.copyFileSync(path.join(PLUGIN_SRC_DIR, f), path.join(DIST_DIR, f)); + } + } + + // Copy no-reply-api files to dist/no-reply-api + if (!fs.existsSync(NO_REPLY_API_DIST_DIR)) { + console.log("[dirigent] dist/no-reply-api/ not found, syncing from no-reply-api/..."); + fs.mkdirSync(NO_REPLY_API_DIST_DIR, { recursive: true }); + for (const f of fs.readdirSync(NO_REPLY_API_SRC_DIR)) { + fs.copyFileSync(path.join(NO_REPLY_API_SRC_DIR, f), path.join(NO_REPLY_API_DIST_DIR, f)); + } } }