mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-25 02:26:12 +02:00
Preserve both profile-specific guards and complete terminal diagnostics; bind Copilot v4 to the regenerated ACPX patch. Co-Authored-By: Paperclip <noreply@paperclip.ing>
34 lines
1.6 KiB
JavaScript
34 lines
1.6 KiB
JavaScript
import { materializePinnedCursorDistribution } from "./materialize-cursor-distribution.mjs";
|
|
const CANDIDATES = new Set(["cursor", "copilot", "pi"]);
|
|
|
|
export function parseProviderPackArguments(args) {
|
|
let output;
|
|
const candidates = [];
|
|
for (const value of args.filter(value => value !== "--")) {
|
|
if (value.startsWith("--candidate-providers=")) {
|
|
for (const provider of value.slice("--candidate-providers=".length).split(",").filter(Boolean)) {
|
|
if (!CANDIDATES.has(provider) || candidates.includes(provider)) throw new Error("Unknown or duplicate candidate provider");
|
|
candidates.push(provider);
|
|
}
|
|
} else if (value.startsWith("--") || output !== undefined) throw new Error("Invalid provider-pack arguments");
|
|
else output = value;
|
|
}
|
|
return { output, candidates };
|
|
}
|
|
|
|
/** Closed source-owned builder registry; provider branches add their exact pins. */
|
|
export async function materializeCandidateProviderPack({ provider, outputRoot }) {
|
|
if (!CANDIDATES.has(provider)) throw new Error("Unknown candidate provider");
|
|
if (provider === "copilot") {
|
|
const { buildPinnedCopilotDistribution } = await import("./build-copilot-distribution.mjs");
|
|
return buildPinnedCopilotDistribution({ outputRoot });
|
|
}
|
|
if (provider === "cursor") {
|
|
const result = await materializePinnedCursorDistribution({ destination: outputRoot });
|
|
return { version: result.version,
|
|
profileDigest: "sha256:b1440d559ebc4eef5c7a582f1c81fc153270cfbafa1731a8ee76d83713bdf61b",
|
|
closureDigest: `sha256:${result.closureSha256}` };
|
|
}
|
|
throw new Error(`The ${provider} candidate distribution builder is not included in this source revision`);
|
|
}
|