mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-02 10:44:52 +01:00
Co-Authored-By: Paperclip <noreply@paperclip.ing> * commit '7bfaf3da4': Version Copilot protocol policy as profile v3 Version patched Cursor isolation as profile v3 Clarify Cursor admission and patched runtime isolation boundaries Fence Copilot ACP connection policy before protocol dispatch Bind Cursor typed-error constructor outside the native turn scope Isolate pinned Cursor ACP configuration and preserve typed failures
36 lines
1.8 KiB
JavaScript
36 lines
1.8 KiB
JavaScript
import { materializePiDistribution } from "./materialize-pi-distribution.mjs";
|
|
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 === "pi") return materializePiDistribution({ outputRoot });
|
|
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:c91aa592ec867071ec4457b9b7230399ce42ad918787ceed99b4b651ea5607e2",
|
|
closureDigest: `sha256:${result.closureSha256}` };
|
|
}
|
|
throw new Error(`The ${provider} candidate distribution builder is not included in this source revision`);
|
|
}
|