mirror of
https://github.com/morluto/rea.git
synced 2026-10-28 18:35:53 +00:00
Ship Claude Code and Codex from one release-pinned npm artifact with bundled runtime dependencies, extraction-only MCP qualification, plugin-aware recovery, and synchronized release metadata. Integrates #2815 and the original proposal #1977. The original commits remain available on the PR branch; retain their author and assistant credit in this squash. Validation: required CI passed, real Codex/Claude loading verified, and reviewed packaging/recovery findings addressed. Co-authored-by: GamerDubz <themastergamerplays24.7@gmail.com> Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> Co-authored-by: OpenAI Codex <openai-codex@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
44 lines
1.5 KiB
JavaScript
44 lines
1.5 KiB
JavaScript
import { GHIDRA_BRIDGE_SOURCES } from "../src/ghidra/GhidraBridgeSources.ts";
|
|
|
|
const packedHopperBridge = "package/bridge/hopper_bridge.py";
|
|
const packedCutterBridge = "package/bridge/cutter/rea_bridge.py";
|
|
|
|
/** Check shipped bridge files; real-provider lanes verify runtime behavior. */
|
|
export async function verifyPackedBridge({ tarball, packedFiles, commands }) {
|
|
if (
|
|
packedFiles.some(
|
|
(path) => path.includes("__pycache__") || path.endsWith(".pyc"),
|
|
)
|
|
) {
|
|
throw new Error("package contained generated Python bytecode");
|
|
}
|
|
for (const path of [
|
|
packedHopperBridge,
|
|
packedCutterBridge,
|
|
...Object.values(GHIDRA_BRIDGE_SOURCES).map(
|
|
(name) => `package/bridge/ghidra/${name}`,
|
|
),
|
|
]) {
|
|
if (!packedFiles.includes(path)) throw new Error(`package omitted ${path}`);
|
|
}
|
|
// Read the packed source without extracting into the caller's leased root.
|
|
// Only the interpreter's standard library is needed; caller-local modules
|
|
// and site startup hooks must not replace the parser or execute here.
|
|
await commands.exec("python3", [
|
|
"-I",
|
|
"-S",
|
|
"-c",
|
|
[
|
|
"import ast, sys, tarfile",
|
|
"with tarfile.open(sys.argv[1]) as archive:",
|
|
" member = archive.getmember(sys.argv[2])",
|
|
" if not member.isfile():",
|
|
" raise ValueError(f'{member.name} is not a regular file')",
|
|
" with archive.extractfile(member) as source:",
|
|
" ast.parse(source.read().decode('utf-8'), filename=sys.argv[2])",
|
|
].join("\n"),
|
|
tarball,
|
|
packedHopperBridge,
|
|
]);
|
|
}
|