mirror of
https://github.com/morluto/rea.git
synced 2026-12-03 13:24:20 +00:00
37 lines
1.2 KiB
TypeScript
37 lines
1.2 KiB
TypeScript
import type { Logger } from "pino";
|
|
|
|
import { createBeamService } from "../composition/erlang.js";
|
|
import { ERLANG_BEAM_TOOL_CONTRACTS } from "../contracts/erlang/beamToolContracts.js";
|
|
import { contractNamed } from "./contractCliDescription.js";
|
|
import { registerContractCommand } from "./contractCommand.js";
|
|
import { deliverWithService } from "./contractCommandRunners.js";
|
|
import type { CliInstance } from "./types.js";
|
|
|
|
/** Inspect operator-selected BEAM files through the same shared workflow as MCP. */
|
|
export const registerErlangCommands = (
|
|
cli: CliInstance,
|
|
logger: Logger,
|
|
): void => {
|
|
registerContractCommand(
|
|
cli,
|
|
logger,
|
|
contractNamed(ERLANG_BEAM_TOOL_CONTRACTS, "inspect_erlang_beam"),
|
|
{
|
|
description:
|
|
"Inspect Erlang BEAM atoms, exports, imports and Code header without executing bytecode",
|
|
positionals: ["path"],
|
|
callerPaths: ["path"],
|
|
evidenceDelivery: true,
|
|
viewDelivery: { invalidJson: "view must be valid JSON" },
|
|
fields: {
|
|
path: { description: "Local BEAM file" },
|
|
view: {
|
|
description:
|
|
"JSON beam view; requires --detail summary and --evidence_output",
|
|
},
|
|
},
|
|
},
|
|
deliverWithService(createBeamService, "rea-erlang-beam"),
|
|
);
|
|
};
|