mirror of
https://github.com/morluto/rea.git
synced 2026-12-03 13:24:20 +00:00
37 lines
1.3 KiB
TypeScript
37 lines
1.3 KiB
TypeScript
import type { Logger } from "pino";
|
||
|
||
import { createPythonPycService } from "../composition/pythonPyc.js";
|
||
import { PYTHON_PYC_TOOL_CONTRACTS } from "../contracts/python/pythonPycToolContracts.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 pyc files through the same shared workflow as MCP. */
|
||
export const registerPythonPycCommands = (
|
||
cli: CliInstance,
|
||
logger: Logger,
|
||
): void => {
|
||
registerContractCommand(
|
||
cli,
|
||
logger,
|
||
contractNamed(PYTHON_PYC_TOOL_CONTRACTS, "inspect_python_pyc"),
|
||
{
|
||
description:
|
||
"Inspect a supported CPython 3.7–3.15 pyc header and marshal code objects without executing bytecode",
|
||
positionals: ["path"],
|
||
callerPaths: ["path"],
|
||
evidenceDelivery: true,
|
||
viewDelivery: { invalidJson: "view must be valid JSON" },
|
||
fields: {
|
||
path: { description: "Local CPython .pyc file" },
|
||
view: {
|
||
description:
|
||
"JSON python-pyc view; requires --detail summary and --evidence_output",
|
||
},
|
||
},
|
||
},
|
||
deliverWithService(createPythonPycService, "rea-python-pyc"),
|
||
);
|
||
};
|