Carry the reviewed clean-install fixture repair through the Copilot stack

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-10-08 07:44:11 -05:00
commit dbbe3964fc
2 files changed
+28 -1

No files matched your search

@@ -6,6 +6,7 @@ import { tmpdir } from "node:os";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import test from "node:test";
import { build } from "esbuild";
import { COPILOT_DISTRIBUTIONS } from "./materialize-copilot-binary.mjs";
const runnerRoot = fileURLToPath(new URL("../", import.meta.url));
@@ -41,7 +42,15 @@ for (const owner of ["runner", "server"]) {
name: owner === "server" ? "@paperclipai/server" : "@paperclipai/paperclip-runner", type: "module",
}));
const runtimeRoot = owner === "server" ? join(root, "dist/vendor/paperclip-runner") : join(root, "dist");
await cp(join(runnerRoot, "dist"), runtimeRoot, { recursive: true });
// Compile the actual installation closure into a published package layout.
// A clean static-check checkout has no prebuilt dist directory.
await build({
entryPoints: [join(runnerRoot, "src/drivers/acpx/copilot-installation.ts"),
join(runnerRoot, "src/drivers/acpx/qualified-profiles.ts")],
outbase: join(runnerRoot, "src"), outdir: runtimeRoot,
bundle: true, platform: "node", format: "esm", target: "node24",
logLevel: "silent",
});
const scriptRoot = owner === "server" ? join(root, "dist") : join(root, "scripts");
await mkdir(scriptRoot, { recursive: true });
for (const name of helpers) await cp(join(runnerRoot, "scripts", name), join(scriptRoot, name));
+18
View File
@@ -0,0 +1,18 @@
import { access } from "node:fs/promises";
import { fileURLToPath } from "node:url";
const installer = new URL("../dist/install-copilot-assets.mjs", import.meta.url);
try {
await access(fileURLToPath(installer));
} catch (error) {
if (error.code !== "ENOENT") throw error;
// Dependencies install before compilation in a source workspace. Published
// server packages omit src and cannot take this bootstrap exception.
await access(fileURLToPath(new URL("../src/services/copilot-connection-probe.ts", import.meta.url)));
await access(fileURLToPath(new URL("../../pnpm-workspace.yaml", import.meta.url)));
process.stdout.write("Copilot runtime assets: source-workspace-pending-build\n");
process.exit(0);
}
const { installCopilotAssets } = await import(installer.href);
const result = await installCopilotAssets();
process.stdout.write(`Copilot runtime assets: ${result.status} (${result.target})\n`);