feat: add prompt history plugin Host prerequisites (#3588)

Co-authored-by: Carlos Florencio <carlosmflorencio@gmail.com>
This commit is contained in:
Clément Fiere
2026-09-15 20:05:40 +02:00
committed by GitHub
parent 186e354116
commit 2b1d0cf7d1
184 changed files with 21016 additions and 661 deletions
+26
View File
@@ -0,0 +1,26 @@
import { createHash } from "node:crypto";
import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
import path from "node:path";
import process from "node:process";
const argumentIndex = process.argv.indexOf("--outDir");
if (argumentIndex === -1 || !process.argv[argumentIndex + 1]) {
throw new Error("build:e2e-plugin requires --outDir");
}
const source = path.resolve("e2e/fixtures/plugins/prompt-history-plugin/bundle.js");
const outputDirectory = path.resolve(process.argv[argumentIndex + 1]);
const output = path.join(outputDirectory, "bundle.js");
const content = await readFile(source);
const sourceHash = createHash("sha256").update(content).digest("hex");
await rm(outputDirectory, { recursive: true, force: true });
await mkdir(outputDirectory, { recursive: true });
await writeFile(output, content);
const generated = await readFile(output);
const generatedHash = createHash("sha256").update(generated).digest("hex");
if (generatedHash !== sourceHash) {
throw new Error("build:e2e-plugin generated stale output");
}
console.log(`[build:e2e-plugin] ${sourceHash} -> ${output}`);